text: 'use strict';
  
  var React = require('react');
  var reactDom = require('react-dom');
  
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
  
  function _interopNamespace(e) {
    if (e && e.__esModule) return e;
    var n = Object.create(null);
    if (e) {
      Object.keys(e).forEach(function (k) {
        if (k !== 'default') {
          var d = Object.getOwnPropertyDescriptor(e, k);
          Object.defineProperty(n, k, d.get ? d : {
            enumerable: true,
            get: function () { return e[k]; }
          });
        }
      });
    }
    n["default"] = e;
    return Object.freeze(n);
  }
  
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
  
  function ownKeys$2(object, enumerableOnly) {
    var keys = Object.keys(object);
  
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function (sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
  
    return keys;
  }
  
  function _objectSpread2$2(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) {
        _defineProperty$3(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  
    return target;
  }
  
  function _defineProperty$3(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
  
    return obj;
  }
  
  function _extends$3() {
    _extends$3 = Object.assign || function (target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
  
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
  
      return target;
    };
  
    return _extends$3.apply(this, arguments);
  }
  
  function _objectWithoutPropertiesLoose$2(source, excluded) {
    if (source == null) return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
  
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      target[key] = source[key];
    }
  
    return target;
  }
  
  function _objectWithoutProperties$1(source, excluded) {
    if (source == null) return {};
  
    var target = _objectWithoutPropertiesLoose$2(source, excluded);
  
    var key, i;
  
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
  
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
  
    return target;
  }
  
  function _taggedTemplateLiteral(strings, raw) {
    if (!raw) {
      raw = strings.slice(0);
    }
  
    return Object.freeze(Object.defineProperties(strings, {
      raw: {
        value: Object.freeze(raw)
      }
    }));
  }
  
  function _slicedToArray$1(arr, i) {
    return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
  }
  
  function _toConsumableArray$1(arr) {
    return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
  }
  
  function _arrayWithoutHoles$1(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
  }
  
  function _arrayWithHoles$1(arr) {
    if (Array.isArray(arr)) return arr;
  }
  
  function _iterableToArray$1(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  
  function _iterableToArrayLimit$1(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
  
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
  
    var _s, _e;
  
    try {
      for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
  
        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }
  
    return _arr;
  }
  
  function _unsupportedIterableToArray$1(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
  }
  
  function _arrayLikeToArray$1(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
  
    for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  
    return arr2;
  }
  
  function _nonIterableSpread$1() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  
  function _nonIterableRest$1() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  
  function _extends$2() {
    _extends$2 = Object.assign || function (target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
  
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
  
      return target;
    };
  
    return _extends$2.apply(this, arguments);
  }
  
  function memoize(fn) {
    var cache = Object.create(null);
    return function (arg) {
      if (cache[arg] === undefined) cache[arg] = fn(arg);
      return cache[arg];
    };
  }
  
  var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
  
  var isPropValid = /* #__PURE__ */memoize(function (prop) {
    return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
    /* o */
    && prop.charCodeAt(1) === 110
    /* n */
    && prop.charCodeAt(2) < 91;
  }
  /* Z+1 */
  );
  
  /*
  
  Based off glamor's StyleSheet, thanks Sunil ❤️
  
  high performance StyleSheet for css-in-js systems
  
  - uses multiple style tags behind the scenes for millions of rules
  - uses `insertRule` for appending in production for *much* faster performance
  
  // usage
  
  import { StyleSheet } from '@emotion/sheet'
  
  let styleSheet = new StyleSheet({ key: '', container: document.head })
  
  styleSheet.insert('#box { border: 1px solid red; }')
  - appends a css rule into the stylesheet
  
  styleSheet.flush()
  - empties the stylesheet of all its contents
  
  */
  // $FlowFixMe
  function sheetForTag(tag) {
    if (tag.sheet) {
      // $FlowFixMe
      return tag.sheet;
    } // this weirdness brought to you by firefox
  
    /* istanbul ignore next */
  
  
    for (var i = 0; i < document.styleSheets.length; i++) {
      if (document.styleSheets[i].ownerNode === tag) {
        // $FlowFixMe
        return document.styleSheets[i];
      }
    }
  }
  
  function createStyleElement(options) {
    var tag = document.createElement('style');
    tag.setAttribute('data-emotion', options.key);
  
    if (options.nonce !== undefined) {
      tag.setAttribute('nonce', options.nonce);
    }
  
    tag.appendChild(document.createTextNode(''));
    tag.setAttribute('data-s', '');
    return tag;
  }
  
  var StyleSheet = /*#__PURE__*/function () {
    function StyleSheet(options) {
      var _this = this;
  
      this._insertTag = function (tag) {
        var before;
  
        if (_this.tags.length === 0) {
          if (_this.insertionPoint) {
            before = _this.insertionPoint.nextSibling;
          } else if (_this.prepend) {
            before = _this.container.firstChild;
          } else {
            before = _this.before;
          }
        } else {
          before = _this.tags[_this.tags.length - 1].nextSibling;
        }
  
        _this.container.insertBefore(tag, before);
  
        _this.tags.push(tag);
      };
  
      this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
      this.tags = [];
      this.ctr = 0;
      this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
  
      this.key = options.key;
      this.container = options.container;
      this.prepend = options.prepend;
      this.insertionPoint = options.insertionPoint;
      this.before = null;
    }
  
    var _proto = StyleSheet.prototype;
  
    _proto.hydrate = function hydrate(nodes) {
      nodes.forEach(this._insertTag);
    };
  
    _proto.insert = function insert(rule) {
      // the max length is how many rules we have per style tag, it's 65000 in speedy mode
      // it's 1 in dev because we insert source maps that map a single rule to a location
      // and you can only have one source map per style tag
      if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
        this._insertTag(createStyleElement(this));
      }
  
      var tag = this.tags[this.tags.length - 1];
  
      if (process.env.NODE_ENV !== 'production') {
        var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
  
        if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
          // this would only cause problem in speedy mode
          // but we don't want enabling speedy to affect the observable behavior
          // so we report this error at all times
          console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');
        }
  
        this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
      }
  
      if (this.isSpeedy) {
        var sheet = sheetForTag(tag);
  
        try {
          // this is the ultrafast version, works across browsers
          // the big drawback is that the css won't be editable in devtools
          sheet.insertRule(rule, sheet.cssRules.length);
        } catch (e) {
          if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear){/.test(rule)) {
            console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
          }
        }
      } else {
        tag.appendChild(document.createTextNode(rule));
      }
  
      this.ctr++;
    };
  
    _proto.flush = function flush() {
      // $FlowFixMe
      this.tags.forEach(function (tag) {
        return tag.parentNode && tag.parentNode.removeChild(tag);
      });
      this.tags = [];
      this.ctr = 0;
  
      if (process.env.NODE_ENV !== 'production') {
        this._alreadyInsertedOrderInsensitiveRule = false;
      }
    };
  
    return StyleSheet;
  }();
  
  var MS = '-ms-';
  var MOZ = '-moz-';
  var WEBKIT = '-webkit-';
  var COMMENT = 'comm';
  var RULESET = 'rule';
  var DECLARATION = 'decl';
  var IMPORT = '@import';
  var KEYFRAMES = '@keyframes';
  
  /**
   * @param {number}
   * @return {number}
   */
  var abs = Math.abs;
  /**
   * @param {number}
   * @return {string}
   */
  
  var from = String.fromCharCode;
  /**
   * @param {object}
   * @return {object}
   */
  
  var assign$1 = Object.assign;
  /**
   * @param {string} value
   * @param {number} length
   * @return {number}
   */
  
  function hash(value, length) {
    return (((length << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3);
  }
  /**
   * @param {string} value
   * @return {string}
   */
  
  function trim(value) {
    return value.trim();
  }
  /**
   * @param {string} value
   * @param {RegExp} pattern
   * @return {string?}
   */
  
  function match$1(value, pattern) {
    return (value = pattern.exec(value)) ? value[0] : value;
  }
  /**
   * @param {string} value
   * @param {(string|RegExp)} pattern
   * @param {string} replacement
   * @return {string}
   */
  
  function replace(value, pattern, replacement) {
    return value.replace(pattern, replacement);
  }
  /**
   * @param {string} value
   * @param {string} search
   * @return {number}
   */
  
  function indexof(value, search) {
    return value.indexOf(search);
  }
  /**
   * @param {string} value
   * @param {number} index
   * @return {number}
   */
  
  function charat(value, index) {
    return value.charCodeAt(index) | 0;
  }
  /**
   * @param {string} value
   * @param {number} begin
   * @param {number} end
   * @return {string}
   */
  
  function substr(value, begin, end) {
    return value.slice(begin, end);
  }
  /**
   * @param {string} value
   * @return {number}
   */
  
  function strlen(value) {
    return value.length;
  }
  /**
   * @param {any[]} value
   * @return {number}
   */
  
  function sizeof(value) {
    return value.length;
  }
  /**
   * @param {any} value
   * @param {any[]} array
   * @return {any}
   */
  
  function append(value, array) {
    return array.push(value), value;
  }
  /**
   * @param {string[]} array
   * @param {function} callback
   * @return {string}
   */
  
  function combine(array, callback) {
    return array.map(callback).join('');
  }
  
  var line = 1;
  var column = 1;
  var length = 0;
  var position = 0;
  var character = 0;
  var characters = '';
  /**
   * @param {string} value
   * @param {object | null} root
   * @param {object | null} parent
   * @param {string} type
   * @param {string[] | string} props
   * @param {object[] | string} children
   * @param {number} length
   */
  
  function node(value, root, parent, type, props, children, length) {
    return {
      value: value,
      root: root,
      parent: parent,
      type: type,
      props: props,
      children: children,
      line: line,
      column: column,
      length: length,
      return: ''
    };
  }
  /**
   * @param {object} root
   * @param {object} props
   * @return {object}
   */
  
  function copy(root, props) {
    return assign$1(node('', null, null, '', null, null, 0), root, {
      length: -root.length
    }, props);
  }
  /**
   * @return {number}
   */
  
  function char() {
    return character;
  }
  /**
   * @return {number}
   */
  
  function prev() {
    character = position > 0 ? charat(characters, --position) : 0;
    if (column--, character === 10) column = 1, line--;
    return character;
  }
  /**
   * @return {number}
   */
  
  function next() {
    character = position < length ? charat(characters, position++) : 0;
    if (column++, character === 10) column = 1, line++;
    return character;
  }
  /**
   * @return {number}
   */
  
  function peek() {
    return charat(characters, position);
  }
  /**
   * @return {number}
   */
  
  function caret() {
    return position;
  }
  /**
   * @param {number} begin
   * @param {number} end
   * @return {string}
   */
  
  function slice(begin, end) {
    return substr(characters, begin, end);
  }
  /**
   * @param {number} type
   * @return {number}
   */
  
  function token(type) {
    switch (type) {
      // \0 \t \n \r \s whitespace token
      case 0:
      case 9:
      case 10:
      case 13:
      case 32:
        return 5;
      // ! + , / > @ ~ isolate token
  
      case 33:
      case 43:
      case 44:
      case 47:
      case 62:
      case 64:
      case 126: // ; { } breakpoint token
  
      case 59:
      case 123:
      case 125:
        return 4;
      // : accompanied token
  
      case 58:
        return 3;
      // " ' ( [ opening delimit token
  
      case 34:
      case 39:
      case 40:
      case 91:
        return 2;
      // ) ] closing delimit token
  
      case 41:
      case 93:
        return 1;
    }
  
    return 0;
  }
  /**
   * @param {string} value
   * @return {any[]}
   */
  
  function alloc(value) {
    return line = column = 1, length = strlen(characters = value), position = 0, [];
  }
  /**
   * @param {any} value
   * @return {any}
   */
  
  function dealloc(value) {
    return characters = '', value;
  }
  /**
   * @param {number} type
   * @return {string}
   */
  
  function delimit(type) {
    return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
  }
  /**
   * @param {number} type
   * @return {string}
   */
  
  function whitespace(type) {
    while (character = peek()) if (character < 33) next();else break;
  
    return token(type) > 2 || token(character) > 3 ? '' : ' ';
  }
  /**
   * @param {number} index
   * @param {number} count
   * @return {string}
   */
  
  function escaping(index, count) {
    while (--count && next()) // not 0-9 A-F a-f
    if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) break;
  
    return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
  }
  /**
   * @param {number} type
   * @return {number}
   */
  
  function delimiter(type) {
    while (next()) switch (character) {
      // ] ) " '
      case type:
        return position;
      // " '
  
      case 34:
      case 39:
        if (type !== 34 && type !== 39) delimiter(character);
        break;
      // (
  
      case 40:
        if (type === 41) delimiter(type);
        break;
      // \
  
      case 92:
        next();
        break;
    }
  
    return position;
  }
  /**
   * @param {number} type
   * @param {number} index
   * @return {number}
   */
  
  function commenter(type, index) {
    while (next()) // //
    if (type + character === 47 + 10) break; // /*
    else if (type + character === 42 + 42 && peek() === 47) break;
  
    return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next());
  }
  /**
   * @param {number} index
   * @return {string}
   */
  
  function identifier(index) {
    while (!token(peek())) next();
  
    return slice(index, position);
  }
  
  /**
   * @param {string} value
   * @return {object[]}
   */
  
  function compile(value) {
    return dealloc(parse$1('', null, null, null, [''], value = alloc(value), 0, [0], value));
  }
  /**
   * @param {string} value
   * @param {object} root
   * @param {object?} parent
   * @param {string[]} rule
   * @param {string[]} rules
   * @param {string[]} rulesets
   * @param {number[]} pseudo
   * @param {number[]} points
   * @param {string[]} declarations
   * @return {object}
   */
  
  function parse$1(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
    var index = 0;
    var offset = 0;
    var length = pseudo;
    var atrule = 0;
    var property = 0;
    var previous = 0;
    var variable = 1;
    var scanning = 1;
    var ampersand = 1;
    var character = 0;
    var type = '';
    var props = rules;
    var children = rulesets;
    var reference = rule;
    var characters = type;
  
    while (scanning) switch (previous = character, character = next()) {
      // (
      case 40:
        if (previous != 108 && characters.charCodeAt(length - 1) == 58) {
          if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1) ampersand = -1;
          break;
        }
  
      // " ' [
  
      case 34:
      case 39:
      case 91:
        characters += delimit(character);
        break;
      // \t \n \r \s
  
      case 9:
      case 10:
      case 13:
      case 32:
        characters += whitespace(previous);
        break;
      // \
  
      case 92:
        characters += escaping(caret() - 1, 7);
        continue;
      // /
  
      case 47:
        switch (peek()) {
          case 42:
          case 47:
            append(comment(commenter(next(), caret()), root, parent), declarations);
            break;
  
          default:
            characters += '/';
        }
  
        break;
      // {
  
      case 123 * variable:
        points[index++] = strlen(characters) * ampersand;
      // } ; \0
  
      case 125 * variable:
      case 59:
      case 0:
        switch (character) {
          // \0 }
          case 0:
          case 125:
            scanning = 0;
          // ;
  
          case 59 + offset:
            if (property > 0 && strlen(characters) - length) append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations);
            break;
          // @ ;
  
          case 59:
            characters += ';';
          // { rule/at-rule
  
          default:
            append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
            if (character === 123) if (offset === 0) parse$1(characters, root, reference, reference, props, rulesets, length, points, children);else switch (atrule) {
              // d m s
              case 100:
              case 109:
              case 115:
                parse$1(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children);
                break;
  
              default:
                parse$1(characters, reference, reference, reference, [''], children, 0, points, children);
            }
        }
  
        index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
        break;
      // :
  
      case 58:
        length = 1 + strlen(characters), property = previous;
  
      default:
        if (variable < 1) if (character == 123) --variable;else if (character == 125 && variable++ == 0 && prev() == 125) continue;
  
        switch (characters += from(character), character * variable) {
          // &
          case 38:
            ampersand = offset > 0 ? 1 : (characters += '\f', -1);
            break;
          // ,
  
          case 44:
            points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
            break;
          // @
  
          case 64:
            // -
            if (peek() === 45) characters += delimit(next());
            atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
            break;
          // -
  
          case 45:
            if (previous === 45 && strlen(characters) == 2) variable = 0;
        }
  
    }
  
    return rulesets;
  }
  /**
   * @param {string} value
   * @param {object} root
   * @param {object?} parent
   * @param {number} index
   * @param {number} offset
   * @param {string[]} rules
   * @param {number[]} points
   * @param {string} type
   * @param {string[]} props
   * @param {string[]} children
   * @param {number} length
   * @return {object}
   */
  
  function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length) {
    var post = offset - 1;
    var rule = offset === 0 ? rules : [''];
    var size = sizeof(rule);
  
    for (var i = 0, j = 0, k = 0; i < index; ++i) for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x]))) props[k++] = z;
  
    return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length);
  }
  /**
   * @param {number} value
   * @param {object} root
   * @param {object?} parent
   * @return {object}
   */
  
  function comment(value, root, parent) {
    return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
  }
  /**
   * @param {string} value
   * @param {object} root
   * @param {object?} parent
   * @param {number} length
   * @return {object}
   */
  
  function declaration(value, root, parent, length) {
    return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length);
  }
  
  /**
   * @param {string} value
   * @param {number} length
   * @return {string}
   */
  
  function prefix(value, length) {
    switch (hash(value, length)) {
      // color-adjust
      case 5103:
        return WEBKIT + 'print-' + value + value;
      // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
  
      case 5737:
      case 4201:
      case 3177:
      case 3433:
      case 1641:
      case 4457:
      case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
  
      case 5572:
      case 6356:
      case 5844:
      case 3191:
      case 6645:
      case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
  
      case 6391:
      case 5879:
      case 5623:
      case 6135:
      case 4599:
      case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
  
      case 4215:
      case 6389:
      case 5109:
      case 5365:
      case 5621:
      case 3829:
        return WEBKIT + value + value;
      // appearance, user-select, transform, hyphens, text-size-adjust
  
      case 5349:
      case 4246:
      case 4810:
      case 6968:
      case 2756:
        return WEBKIT + value + MOZ + value + MS + value + value;
      // flex, flex-direction
  
      case 6828:
      case 4268:
        return WEBKIT + value + MS + value + value;
      // order
  
      case 6165:
        return WEBKIT + value + MS + 'flex-' + value + value;
      // align-items
  
      case 5187:
        return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;
      // align-self
  
      case 5443:
        return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;
      // align-content
  
      case 4675:
        return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;
      // flex-shrink
  
      case 5548:
        return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;
      // flex-basis
  
      case 5292:
        return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;
      // flex-grow
  
      case 6060:
        return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;
      // transition
  
      case 4554:
        return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;
      // cursor
  
      case 6187:
        return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
      // background, background-image
  
      case 5495:
      case 3959:
        return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
      // justify-content
  
      case 4968:
        return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;
      // (margin|padding)-inline-(start|end)
  
      case 4095:
      case 3583:
      case 4068:
      case 2532:
        return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
      // (min|max)?(width|height|inline-size|block-size)
  
      case 8116:
      case 7059:
      case 5753:
      case 5535:
      case 5445:
      case 5701:
      case 4933:
      case 4677:
      case 5533:
      case 5789:
      case 5021:
      case 4765:
        // stretch, max-content, min-content, fill-available
        if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
          // (m)ax-content, (m)in-content
          case 109:
            // -
            if (charat(value, length + 4) !== 45) break;
          // (f)ill-available, (f)it-content
  
          case 102:
            return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
          // (s)tretch
  
          case 115:
            return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
        }
        break;
      // position: sticky
  
      case 4949:
        // (s)ticky?
        if (charat(value, length + 1) !== 115) break;
      // display: (flex|inline-flex)
  
      case 6444:
        switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
          // stic(k)y
          case 107:
            return replace(value, ':', ':' + WEBKIT) + value;
          // (inline-)?fl(e)x
  
          case 101:
            return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
        }
  
        break;
      // writing-mode
  
      case 5936:
        switch (charat(value, length + 11)) {
          // vertical-l(r)
          case 114:
            return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
          // vertical-r(l)
  
          case 108:
            return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
          // horizontal(-)tb
  
          case 45:
            return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
        }
  
        return WEBKIT + value + MS + value + value;
    }
  
    return value;
  }
  
  /**
   * @param {object[]} children
   * @param {function} callback
   * @return {string}
   */
  
  function serialize$1(children, callback) {
    var output = '';
    var length = sizeof(children);
  
    for (var i = 0; i < length; i++) output += callback(children[i], i, children, callback) || '';
  
    return output;
  }
  /**
   * @param {object} element
   * @param {number} index
   * @param {object[]} children
   * @param {function} callback
   * @return {string}
   */
  
  function stringify(element, index, children, callback) {
    switch (element.type) {
      case IMPORT:
      case DECLARATION:
        return element.return = element.return || element.value;
  
      case COMMENT:
        return '';
  
      case KEYFRAMES:
        return element.return = element.value + '{' + serialize$1(element.children, callback) + '}';
  
      case RULESET:
        element.value = element.props.join(',');
    }
  
    return strlen(children = serialize$1(element.children, callback)) ? element.return = element.value + '{' + children + '}' : '';
  }
  
  /**
   * @param {function[]} collection
   * @return {function}
   */
  
  function middleware(collection) {
    var length = sizeof(collection);
    return function (element, index, children, callback) {
      var output = '';
  
      for (var i = 0; i < length; i++) output += collection[i](element, index, children, callback) || '';
  
      return output;
    };
  }
  /**
   * @param {function} callback
   * @return {function}
   */
  
  function rulesheet(callback) {
    return function (element) {
      if (!element.root) if (element = element.return) callback(element);
    };
  }
  /**
   * @param {object} element
   * @param {number} index
   * @param {object[]} children
   * @param {function} callback
   */
  
  function prefixer(element, index, children, callback) {
    if (element.length > -1) if (!element.return) switch (element.type) {
      case DECLARATION:
        element.return = prefix(element.value, element.length);
        break;
  
      case KEYFRAMES:
        return serialize$1([copy(element, {
          value: replace(element.value, '@', '@' + WEBKIT)
        })], callback);
  
      case RULESET:
        if (element.length) return combine(element.props, function (value) {
          switch (match$1(value, /(::plac\w+|:read-\w+)/)) {
            // :read-(only|write)
            case ':read-only':
            case ':read-write':
              return serialize$1([copy(element, {
                props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
              })], callback);
            // :placeholder
  
            case '::placeholder':
              return serialize$1([copy(element, {
                props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
              }), copy(element, {
                props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
              }), copy(element, {
                props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
              })], callback);
          }
  
          return '';
        });
    }
  }
  
  var weakMemoize = function weakMemoize(func) {
    // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
    var cache = new WeakMap();
    return function (arg) {
      if (cache.has(arg)) {
        // $FlowFixMe
        return cache.get(arg);
      }
  
      var ret = func(arg);
      cache.set(arg, ret);
      return ret;
    };
  };
  
  var last = function last(arr) {
    return arr.length ? arr[arr.length - 1] : null;
  }; // based on https://github.com/thysultan/stylis.js/blob/e6843c373ebcbbfade25ebcc23f540ed8508da0a/src/Tokenizer.js#L239-L244
  
  
  var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
    var previous = 0;
    var character = 0;
  
    while (true) {
      previous = character;
      character = peek(); // &\f
  
      if (previous === 38 && character === 12) {
        points[index] = 1;
      }
  
      if (token(character)) {
        break;
      }
  
      next();
    }
  
    return slice(begin, position);
  };
  
  var toRules = function toRules(parsed, points) {
    // pretend we've started with a comma
    var index = -1;
    var character = 44;
  
    do {
      switch (token(character)) {
        case 0:
          // &\f
          if (character === 38 && peek() === 12) {
            // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
            // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
            // and when it should just concatenate the outer and inner selectors
            // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
            points[index] = 1;
          }
  
          parsed[index] += identifierWithPointTracking(position - 1, points, index);
          break;
  
        case 2:
          parsed[index] += delimit(character);
          break;
  
        case 4:
          // comma
          if (character === 44) {
            // colon
            parsed[++index] = peek() === 58 ? '&\f' : '';
            points[index] = parsed[index].length;
            break;
          }
  
        // fallthrough
  
        default:
          parsed[index] += from(character);
      }
    } while (character = next());
  
    return parsed;
  };
  
  var getRules = function getRules(value, points) {
    return dealloc(toRules(alloc(value), points));
  }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
  
  
  var fixedElements = /* #__PURE__ */new WeakMap();
  
  var compat = function compat(element) {
    if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
    // negative .length indicates that this rule has been already prefixed
    element.length < 1) {
      return;
    }
  
    var value = element.value,
        parent = element.parent;
    var isImplicitRule = element.column === parent.column && element.line === parent.line;
  
    while (parent.type !== 'rule') {
      parent = parent.parent;
      if (!parent) return;
    } // short-circuit for the simplest case
  
  
    if (element.props.length === 1 && value.charCodeAt(0) !== 58
    /* colon */
    && !fixedElements.get(parent)) {
      return;
    } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
    // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
  
  
    if (isImplicitRule) {
      return;
    }
  
    fixedElements.set(element, true);
    var points = [];
    var rules = getRules(value, points);
    var parentRules = parent.props;
  
    for (var i = 0, k = 0; i < rules.length; i++) {
      for (var j = 0; j < parentRules.length; j++, k++) {
        element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
      }
    }
  };
  
  var removeLabel = function removeLabel(element) {
    if (element.type === 'decl') {
      var value = element.value;
  
      if ( // charcode for l
      value.charCodeAt(0) === 108 && // charcode for b
      value.charCodeAt(2) === 98) {
        // this ignores label
        element["return"] = '';
        element.value = '';
      }
    }
  };
  
  var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
  
  var isIgnoringComment = function isIgnoringComment(element) {
    return !!element && element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
  };
  
  var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
    return function (element, index, children) {
      if (element.type !== 'rule') return;
      var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
  
      if (unsafePseudoClasses && cache.compat !== true) {
        var prevElement = index > 0 ? children[index - 1] : null;
  
        if (prevElement && isIgnoringComment(last(prevElement.children))) {
          return;
        }
  
        unsafePseudoClasses.forEach(function (unsafePseudoClass) {
          console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
        });
      }
    };
  };
  
  var isImportRule = function isImportRule(element) {
    return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
  };
  
  var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
    for (var i = index - 1; i >= 0; i--) {
      if (!isImportRule(children[i])) {
        return true;
      }
    }
  
    return false;
  }; // use this to remove incorrect elements from further processing
  // so they don't get handed to the `sheet` (or anything else)
  // as that could potentially lead to additional logs which in turn could be overhelming to the user
  
  
  var nullifyElement = function nullifyElement(element) {
    element.type = '';
    element.value = '';
    element["return"] = '';
    element.children = '';
    element.props = '';
  };
  
  var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
    if (!isImportRule(element)) {
      return;
    }
  
    if (element.parent) {
      console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
      nullifyElement(element);
    } else if (isPrependedWithRegularRules(index, children)) {
      console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
      nullifyElement(element);
    }
  };
  
  var isBrowser$5 = typeof document !== 'undefined';
  var getServerStylisCache = isBrowser$5 ? undefined : weakMemoize(function () {
    return memoize(function () {
      var cache = {};
      return function (name) {
        return cache[name];
      };
    });
  });
  var defaultStylisPlugins = [prefixer];
  
  var createCache = function createCache(options) {
    var key = options.key;
  
    if (process.env.NODE_ENV !== 'production' && !key) {
      throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements.");
    }
  
    if (isBrowser$5 && key === 'css') {
      var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
      // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
      // note this very very intentionally targets all style elements regardless of the key to ensure
      // that creating a cache works inside of render of a React component
  
      Array.prototype.forEach.call(ssrStyles, function (node) {
        // we want to only move elements which have a space in the data-emotion attribute value
        // because that indicates that it is an Emotion 11 server-side rendered style elements
        // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
        // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
        // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
        // will not result in the Emotion 10 styles being destroyed
        var dataEmotionAttribute = node.getAttribute('data-emotion');
  
        if (dataEmotionAttribute.indexOf(' ') === -1) {
          return;
        }
  
        document.head.appendChild(node);
        node.setAttribute('data-s', '');
      });
    }
  
    var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
  
    if (process.env.NODE_ENV !== 'production') {
      // $FlowFixMe
      if (/[^a-z-]/.test(key)) {
        throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
      }
    }
  
    var inserted = {}; // $FlowFixMe
  
    var container;
    var nodesToHydrate = [];
  
    if (isBrowser$5) {
      container = options.container || document.head;
      Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
      // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
      document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
        var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
  
        for (var i = 1; i < attrib.length; i++) {
          inserted[attrib[i]] = true;
        }
  
        nodesToHydrate.push(node);
      });
    }
  
    var _insert;
  
    var omnipresentPlugins = [compat, removeLabel];
  
    if (process.env.NODE_ENV !== 'production') {
      omnipresentPlugins.push(createUnsafeSelectorsAlarm({
        get compat() {
          return cache.compat;
        }
  
      }), incorrectImportAlarm);
    }
  
    if (isBrowser$5) {
      var currentSheet;
      var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {
        if (!element.root) {
          if (element["return"]) {
            currentSheet.insert(element["return"]);
          } else if (element.value && element.type !== COMMENT) {
            // insert empty rule in non-production environments
            // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
            currentSheet.insert(element.value + "{}");
          }
        }
      } : rulesheet(function (rule) {
        currentSheet.insert(rule);
      })];
      var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
  
      var stylis = function stylis(styles) {
        return serialize$1(compile(styles), serializer);
      };
  
      _insert = function insert(selector, serialized, sheet, shouldCache) {
        currentSheet = sheet;
  
        if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
          currentSheet = {
            insert: function insert(rule) {
              sheet.insert(rule + serialized.map);
            }
          };
        }
  
        stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
  
        if (shouldCache) {
          cache.inserted[serialized.name] = true;
        }
      };
    } else {
      var _finalizingPlugins = [stringify];
  
      var _serializer = middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
  
      var _stylis = function _stylis(styles) {
        return serialize$1(compile(styles), _serializer);
      }; // $FlowFixMe
  
  
      var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
  
      var getRules = function getRules(selector, serialized) {
        var name = serialized.name;
  
        if (serverStylisCache[name] === undefined) {
          serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
        }
  
        return serverStylisCache[name];
      };
  
      _insert = function _insert(selector, serialized, sheet, shouldCache) {
        var name = serialized.name;
        var rules = getRules(selector, serialized);
  
        if (cache.compat === undefined) {
          // in regular mode, we don't set the styles on the inserted cache
          // since we don't need to and that would be wasting memory
          // we return them so that they are rendered in a style tag
          if (shouldCache) {
            cache.inserted[name] = true;
          }
  
          if ( // using === development instead of !== production
          // because if people do ssr in tests, the source maps showing up would be annoying
          process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
            return rules + serialized.map;
          }
  
          return rules;
        } else {
          // in compat mode, we put the styles on the inserted cache so
          // that emotion-server can pull out the styles
          // except when we don't want to cache it which was in Global but now
          // is nowhere but we don't want to do a major right now
          // and just in case we're going to leave the case here
          // it's also not affecting client side bundle size
          // so it's really not a big deal
          if (shouldCache) {
            cache.inserted[name] = rules;
          } else {
            return rules;
          }
        }
      };
    }
  
    var cache = {
      key: key,
      sheet: new StyleSheet({
        key: key,
        container: container,
        nonce: options.nonce,
        speedy: options.speedy,
        prepend: options.prepend,
        insertionPoint: options.insertionPoint
      }),
      nonce: options.nonce,
      inserted: inserted,
      registered: {},
      insert: _insert
    };
    cache.sheet.hydrate(nodesToHydrate);
    return cache;
  };
  
  var commonjsGlobal$2 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  
  function getAugmentedNamespace(n) {
  	if (n.__esModule) return n;
  	var a = Object.defineProperty({}, '__esModule', {value: true});
  	Object.keys(n).forEach(function (k) {
  		var d = Object.getOwnPropertyDescriptor(n, k);
  		Object.defineProperty(a, k, d.get ? d : {
  			enumerable: true,
  			get: function () {
  				return n[k];
  			}
  		});
  	});
  	return a;
  }
  
  var reactIs = {exports: {}};
  
  var reactIs_production_min = {};
  
  /** @license React v16.13.1
   * react-is.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  
  var b = "function" === typeof Symbol && Symbol.for,
      c$1 = b ? Symbol.for("react.element") : 60103,
      d = b ? Symbol.for("react.portal") : 60106,
      e = b ? Symbol.for("react.fragment") : 60107,
      f = b ? Symbol.for("react.strict_mode") : 60108,
      g = b ? Symbol.for("react.profiler") : 60114,
      h = b ? Symbol.for("react.provider") : 60109,
      k = b ? Symbol.for("react.context") : 60110,
      l = b ? Symbol.for("react.async_mode") : 60111,
      m = b ? Symbol.for("react.concurrent_mode") : 60111,
      n = b ? Symbol.for("react.forward_ref") : 60112,
      p = b ? Symbol.for("react.suspense") : 60113,
      q = b ? Symbol.for("react.suspense_list") : 60120,
      r$1 = b ? Symbol.for("react.memo") : 60115,
      t = b ? Symbol.for("react.lazy") : 60116,
      v = b ? Symbol.for("react.block") : 60121,
      w$1 = b ? Symbol.for("react.fundamental") : 60117,
      x = b ? Symbol.for("react.responder") : 60118,
      y = b ? Symbol.for("react.scope") : 60119;
  
  function z(a) {
    if ("object" === typeof a && null !== a) {
      var u = a.$$typeof;
  
      switch (u) {
        case c$1:
          switch (a = a.type, a) {
            case l:
            case m:
            case e:
            case g:
            case f:
            case p:
              return a;
  
            default:
              switch (a = a && a.$$typeof, a) {
                case k:
                case n:
                case t:
                case r$1:
                case h:
                  return a;
  
                default:
                  return u;
              }
  
          }
  
        case d:
          return u;
      }
    }
  }
  
  function A(a) {
    return z(a) === m;
  }
  
  reactIs_production_min.AsyncMode = l;
  reactIs_production_min.ConcurrentMode = m;
  reactIs_production_min.ContextConsumer = k;
  reactIs_production_min.ContextProvider = h;
  reactIs_production_min.Element = c$1;
  reactIs_production_min.ForwardRef = n;
  reactIs_production_min.Fragment = e;
  reactIs_production_min.Lazy = t;
  reactIs_production_min.Memo = r$1;
  reactIs_production_min.Portal = d;
  reactIs_production_min.Profiler = g;
  reactIs_production_min.StrictMode = f;
  reactIs_production_min.Suspense = p;
  
  reactIs_production_min.isAsyncMode = function (a) {
    return A(a) || z(a) === l;
  };
  
  reactIs_production_min.isConcurrentMode = A;
  
  reactIs_production_min.isContextConsumer = function (a) {
    return z(a) === k;
  };
  
  reactIs_production_min.isContextProvider = function (a) {
    return z(a) === h;
  };
  
  reactIs_production_min.isElement = function (a) {
    return "object" === typeof a && null !== a && a.$$typeof === c$1;
  };
  
  reactIs_production_min.isForwardRef = function (a) {
    return z(a) === n;
  };
  
  reactIs_production_min.isFragment = function (a) {
    return z(a) === e;
  };
  
  reactIs_production_min.isLazy = function (a) {
    return z(a) === t;
  };
  
  reactIs_production_min.isMemo = function (a) {
    return z(a) === r$1;
  };
  
  reactIs_production_min.isPortal = function (a) {
    return z(a) === d;
  };
  
  reactIs_production_min.isProfiler = function (a) {
    return z(a) === g;
  };
  
  reactIs_production_min.isStrictMode = function (a) {
    return z(a) === f;
  };
  
  reactIs_production_min.isSuspense = function (a) {
    return z(a) === p;
  };
  
  reactIs_production_min.isValidElementType = function (a) {
    return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r$1 || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w$1 || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
  };
  
  reactIs_production_min.typeOf = z;
  
  var reactIs_development = {};
  
  /** @license React v16.13.1
   * react-is.development.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  
  if (process.env.NODE_ENV !== "production") {
    (function () {
      // nor polyfill, then a plain number is used for performance.
  
      var hasSymbol = typeof Symbol === 'function' && Symbol.for;
      var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
      var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
      var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
      var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
      var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
      var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
      var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
      // (unstable) APIs that have been removed. Can we remove the symbols?
  
      var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
      var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
      var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
      var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
      var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
      var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
      var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
      var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
      var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
      var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
      var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
  
      function isValidElementType(type) {
        return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
        type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
      }
  
      function typeOf(object) {
        if (typeof object === 'object' && object !== null) {
          var $$typeof = object.$$typeof;
  
          switch ($$typeof) {
            case REACT_ELEMENT_TYPE:
              var type = object.type;
  
              switch (type) {
                case REACT_ASYNC_MODE_TYPE:
                case REACT_CONCURRENT_MODE_TYPE:
                case REACT_FRAGMENT_TYPE:
                case REACT_PROFILER_TYPE:
                case REACT_STRICT_MODE_TYPE:
                case REACT_SUSPENSE_TYPE:
                  return type;
  
                default:
                  var $$typeofType = type && type.$$typeof;
  
                  switch ($$typeofType) {
                    case REACT_CONTEXT_TYPE:
                    case REACT_FORWARD_REF_TYPE:
                    case REACT_LAZY_TYPE:
                    case REACT_MEMO_TYPE:
                    case REACT_PROVIDER_TYPE:
                      return $$typeofType;
  
                    default:
                      return $$typeof;
                  }
  
              }
  
            case REACT_PORTAL_TYPE:
              return $$typeof;
          }
        }
  
        return undefined;
      } // AsyncMode is deprecated along with isAsyncMode
  
  
      var AsyncMode = REACT_ASYNC_MODE_TYPE;
      var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
      var ContextConsumer = REACT_CONTEXT_TYPE;
      var ContextProvider = REACT_PROVIDER_TYPE;
      var Element = REACT_ELEMENT_TYPE;
      var ForwardRef = REACT_FORWARD_REF_TYPE;
      var Fragment = REACT_FRAGMENT_TYPE;
      var Lazy = REACT_LAZY_TYPE;
      var Memo = REACT_MEMO_TYPE;
      var Portal = REACT_PORTAL_TYPE;
      var Profiler = REACT_PROFILER_TYPE;
      var StrictMode = REACT_STRICT_MODE_TYPE;
      var Suspense = REACT_SUSPENSE_TYPE;
      var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
  
      function isAsyncMode(object) {
        {
          if (!hasWarnedAboutDeprecatedIsAsyncMode) {
            hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
  
            console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
          }
        }
        return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
      }
  
      function isConcurrentMode(object) {
        return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
      }
  
      function isContextConsumer(object) {
        return typeOf(object) === REACT_CONTEXT_TYPE;
      }
  
      function isContextProvider(object) {
        return typeOf(object) === REACT_PROVIDER_TYPE;
      }
  
      function isElement(object) {
        return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
      }
  
      function isForwardRef(object) {
        return typeOf(object) === REACT_FORWARD_REF_TYPE;
      }
  
      function isFragment(object) {
        return typeOf(object) === REACT_FRAGMENT_TYPE;
      }
  
      function isLazy(object) {
        return typeOf(object) === REACT_LAZY_TYPE;
      }
  
      function isMemo(object) {
        return typeOf(object) === REACT_MEMO_TYPE;
      }
  
      function isPortal(object) {
        return typeOf(object) === REACT_PORTAL_TYPE;
      }
  
      function isProfiler(object) {
        return typeOf(object) === REACT_PROFILER_TYPE;
      }
  
      function isStrictMode(object) {
        return typeOf(object) === REACT_STRICT_MODE_TYPE;
      }
  
      function isSuspense(object) {
        return typeOf(object) === REACT_SUSPENSE_TYPE;
      }
  
      reactIs_development.AsyncMode = AsyncMode;
      reactIs_development.ConcurrentMode = ConcurrentMode;
      reactIs_development.ContextConsumer = ContextConsumer;
      reactIs_development.ContextProvider = ContextProvider;
      reactIs_development.Element = Element;
      reactIs_development.ForwardRef = ForwardRef;
      reactIs_development.Fragment = Fragment;
      reactIs_development.Lazy = Lazy;
      reactIs_development.Memo = Memo;
      reactIs_development.Portal = Portal;
      reactIs_development.Profiler = Profiler;
      reactIs_development.StrictMode = StrictMode;
      reactIs_development.Suspense = Suspense;
      reactIs_development.isAsyncMode = isAsyncMode;
      reactIs_development.isConcurrentMode = isConcurrentMode;
      reactIs_development.isContextConsumer = isContextConsumer;
      reactIs_development.isContextProvider = isContextProvider;
      reactIs_development.isElement = isElement;
      reactIs_development.isForwardRef = isForwardRef;
      reactIs_development.isFragment = isFragment;
      reactIs_development.isLazy = isLazy;
      reactIs_development.isMemo = isMemo;
      reactIs_development.isPortal = isPortal;
      reactIs_development.isProfiler = isProfiler;
      reactIs_development.isStrictMode = isStrictMode;
      reactIs_development.isSuspense = isSuspense;
      reactIs_development.isValidElementType = isValidElementType;
      reactIs_development.typeOf = typeOf;
    })();
  }
  
  if (process.env.NODE_ENV === 'production') {
    reactIs.exports = reactIs_production_min;
  } else {
    reactIs.exports = reactIs_development;
  }
  
  var isBrowser$4 = typeof document !== 'undefined';
  
  function getRegisteredStyles$1(registered, registeredStyles, classNames) {
    var rawClassName = '';
    classNames.split(' ').forEach(function (className) {
      if (registered[className] !== undefined) {
        registeredStyles.push(registered[className] + ";");
      } else {
        rawClassName += className + " ";
      }
    });
    return rawClassName;
  }
  
  var insertStyles$1 = function insertStyles(cache, serialized, isStringTag) {
    var className = cache.key + "-" + serialized.name;
  
    if ( // we only need to add the styles to the registered cache if the
    // class name could be used further down
    // the tree but if it's a string tag, we know it won't
    // so we don't have to add it to registered cache.
    // this improves memory usage since we can avoid storing the whole style string
    (isStringTag === false || // we need to always store it if we're in compat mode and
    // in node since emotion-server relies on whether a style is in
    // the registered cache to know whether a style is global or not
    // also, note that this check will be dead code eliminated in the browser
    isBrowser$4 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
      cache.registered[className] = serialized.styles;
    }
  
    if (cache.inserted[serialized.name] === undefined) {
      var stylesForSSR = '';
      var current = serialized;
  
      do {
        var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
  
        if (!isBrowser$4 && maybeStyles !== undefined) {
          stylesForSSR += maybeStyles;
        }
  
        current = current.next;
      } while (current !== undefined);
  
      if (!isBrowser$4 && stylesForSSR.length !== 0) {
        return stylesForSSR;
      }
    }
  };
  
  /* eslint-disable */
  // Inspired by https://github.com/garycourt/murmurhash-js
  // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
  function murmur2(str) {
    // 'm' and 'r' are mixing constants generated offline.
    // They're not really 'magic', they just happen to work well.
    // const m = 0x5bd1e995;
    // const r = 24;
    // Initialize the hash
    var h = 0; // Mix 4 bytes at a time into the hash
  
    var k,
        i = 0,
        len = str.length;
  
    for (; len >= 4; ++i, len -= 4) {
      k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
      k =
      /* Math.imul(k, m): */
      (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
      k ^=
      /* k >>> r: */
      k >>> 24;
      h =
      /* Math.imul(k, m): */
      (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
      /* Math.imul(h, m): */
      (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
    } // Handle the last few bytes of the input array
  
  
    switch (len) {
      case 3:
        h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
  
      case 2:
        h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
  
      case 1:
        h ^= str.charCodeAt(i) & 0xff;
        h =
        /* Math.imul(h, m): */
        (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
    } // Do a few final mixes of the hash to ensure the last few
    // bytes are well-incorporated.
  
  
    h ^= h >>> 13;
    h =
    /* Math.imul(h, m): */
    (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
    return ((h ^ h >>> 15) >>> 0).toString(36);
  }
  
  var unitlessKeys = {
    animationIterationCount: 1,
    borderImageOutset: 1,
    borderImageSlice: 1,
    borderImageWidth: 1,
    boxFlex: 1,
    boxFlexGroup: 1,
    boxOrdinalGroup: 1,
    columnCount: 1,
    columns: 1,
    flex: 1,
    flexGrow: 1,
    flexPositive: 1,
    flexShrink: 1,
    flexNegative: 1,
    flexOrder: 1,
    gridRow: 1,
    gridRowEnd: 1,
    gridRowSpan: 1,
    gridRowStart: 1,
    gridColumn: 1,
    gridColumnEnd: 1,
    gridColumnSpan: 1,
    gridColumnStart: 1,
    msGridRow: 1,
    msGridRowSpan: 1,
    msGridColumn: 1,
    msGridColumnSpan: 1,
    fontWeight: 1,
    lineHeight: 1,
    opacity: 1,
    order: 1,
    orphans: 1,
    tabSize: 1,
    widows: 1,
    zIndex: 1,
    zoom: 1,
    WebkitLineClamp: 1,
    // SVG-related properties
    fillOpacity: 1,
    floodOpacity: 1,
    stopOpacity: 1,
    strokeDasharray: 1,
    strokeDashoffset: 1,
    strokeMiterlimit: 1,
    strokeOpacity: 1,
    strokeWidth: 1
  };
  
  var ILLEGAL_ESCAPE_SEQUENCE_ERROR$1 = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
  var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
  var hyphenateRegex = /[A-Z]|^ms/g;
  var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
  
  var isCustomProperty = function isCustomProperty(property) {
    return property.charCodeAt(1) === 45;
  };
  
  var isProcessableValue = function isProcessableValue(value) {
    return value != null && typeof value !== 'boolean';
  };
  
  var processStyleName = /* #__PURE__ */memoize(function (styleName) {
    return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
  });
  
  var processStyleValue = function processStyleValue(key, value) {
    switch (key) {
      case 'animation':
      case 'animationName':
        {
          if (typeof value === 'string') {
            return value.replace(animationRegex, function (match, p1, p2) {
              cursor = {
                name: p1,
                styles: p2,
                next: cursor
              };
              return p1;
            });
          }
        }
    }
  
    if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
      return value + 'px';
    }
  
    return value;
  };
  
  if (process.env.NODE_ENV !== 'production') {
    var contentValuePattern = /(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
    var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
    var oldProcessStyleValue = processStyleValue;
    var msPattern = /^-ms-/;
    var hyphenPattern = /-(.)/g;
    var hyphenatedCache = {};
  
    processStyleValue = function processStyleValue(key, value) {
      if (key === 'content') {
        if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
          throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
        }
      }
  
      var processed = oldProcessStyleValue(key, value);
  
      if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
        hyphenatedCache[key] = true;
        console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {
          return _char.toUpperCase();
        }) + "?");
      }
  
      return processed;
    };
  }
  
  function handleInterpolation(mergedProps, registered, interpolation) {
    if (interpolation == null) {
      return '';
    }
  
    if (interpolation.__emotion_styles !== undefined) {
      if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {
        throw new Error('Component selectors can only be used in conjunction with @emotion/babel-plugin.');
      }
  
      return interpolation;
    }
  
    switch (typeof interpolation) {
      case 'boolean':
        {
          return '';
        }
  
      case 'object':
        {
          if (interpolation.anim === 1) {
            cursor = {
              name: interpolation.name,
              styles: interpolation.styles,
              next: cursor
            };
            return interpolation.name;
          }
  
          if (interpolation.styles !== undefined) {
            var next = interpolation.next;
  
            if (next !== undefined) {
              // not the most efficient thing ever but this is a pretty rare case
              // and there will be very few iterations of this generally
              while (next !== undefined) {
                cursor = {
                  name: next.name,
                  styles: next.styles,
                  next: cursor
                };
                next = next.next;
              }
            }
  
            var styles = interpolation.styles + ";";
  
            if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
              styles += interpolation.map;
            }
  
            return styles;
          }
  
          return createStringFromObject(mergedProps, registered, interpolation);
        }
  
      case 'function':
        {
          if (mergedProps !== undefined) {
            var previousCursor = cursor;
            var result = interpolation(mergedProps);
            cursor = previousCursor;
            return handleInterpolation(mergedProps, registered, result);
          } else if (process.env.NODE_ENV !== 'production') {
            console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`");
          }
  
          break;
        }
  
      case 'string':
        if (process.env.NODE_ENV !== 'production') {
          var matched = [];
          var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
            var fakeVarName = "animation" + matched.length;
            matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
            return "${" + fakeVarName + "}";
          });
  
          if (matched.length) {
            console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`"));
          }
        }
  
        break;
    } // finalize string values (regular strings and functions interpolated into css calls)
  
  
    if (registered == null) {
      return interpolation;
    }
  
    var cached = registered[interpolation];
    return cached !== undefined ? cached : interpolation;
  }
  
  function createStringFromObject(mergedProps, registered, obj) {
    var string = '';
  
    if (Array.isArray(obj)) {
      for (var i = 0; i < obj.length; i++) {
        string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
      }
    } else {
      for (var _key in obj) {
        var value = obj[_key];
  
        if (typeof value !== 'object') {
          if (registered != null && registered[value] !== undefined) {
            string += _key + "{" + registered[value] + "}";
          } else if (isProcessableValue(value)) {
            string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
          }
        } else {
          if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {
            throw new Error('Component selectors can only be used in conjunction with @emotion/babel-plugin.');
          }
  
          if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
            for (var _i = 0; _i < value.length; _i++) {
              if (isProcessableValue(value[_i])) {
                string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
              }
            }
          } else {
            var interpolated = handleInterpolation(mergedProps, registered, value);
  
            switch (_key) {
              case 'animation':
              case 'animationName':
                {
                  string += processStyleName(_key) + ":" + interpolated + ";";
                  break;
                }
  
              default:
                {
                  if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
                    console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
                  }
  
                  string += _key + "{" + interpolated + "}";
                }
            }
          }
        }
      }
    }
  
    return string;
  }
  
  var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
  var sourceMapPattern;
  
  if (process.env.NODE_ENV !== 'production') {
    sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
  } // this is the cursor for keyframes
  // keyframes are stored on the SerializedStyles object as a linked list
  
  
  var cursor;
  
  var serializeStyles = function serializeStyles(args, registered, mergedProps) {
    if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
      return args[0];
    }
  
    var stringMode = true;
    var styles = '';
    cursor = undefined;
    var strings = args[0];
  
    if (strings == null || strings.raw === undefined) {
      stringMode = false;
      styles += handleInterpolation(mergedProps, registered, strings);
    } else {
      if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {
        console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR$1);
      }
  
      styles += strings[0];
    } // we start at 1 since we've already handled the first arg
  
  
    for (var i = 1; i < args.length; i++) {
      styles += handleInterpolation(mergedProps, registered, args[i]);
  
      if (stringMode) {
        if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {
          console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR$1);
        }
  
        styles += strings[i];
      }
    }
  
    var sourceMap;
  
    if (process.env.NODE_ENV !== 'production') {
      styles = styles.replace(sourceMapPattern, function (match) {
        sourceMap = match;
        return '';
      });
    } // using a global regex with .exec is stateful so lastIndex has to be reset each time
  
  
    labelPattern.lastIndex = 0;
    var identifierName = '';
    var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
  
    while ((match = labelPattern.exec(styles)) !== null) {
      identifierName += '-' + // $FlowFixMe we know it's not null
      match[1];
    }
  
    var name = murmur2(styles) + identifierName;
  
    if (process.env.NODE_ENV !== 'production') {
      // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
      return {
        name: name,
        styles: styles,
        map: sourceMap,
        next: cursor,
        toString: function toString() {
          return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
        }
      };
    }
  
    return {
      name: name,
      styles: styles,
      next: cursor
    };
  };
  
  var isBrowser$3 = typeof document !== 'undefined';
  var hasOwnProperty$1 = {}.hasOwnProperty;
  var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
  // because this module is primarily intended for the browser and node
  // but it's also required in react native and similar environments sometimes
  // and we could have a special build just for that
  // but this is much easier and the native packages
  // might use a different theme context in the future anyway
  typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
    key: 'css'
  }) : null);
  
  if (process.env.NODE_ENV !== 'production') {
    EmotionCacheContext.displayName = 'EmotionCacheContext';
  }
  
  EmotionCacheContext.Provider;
  
  var withEmotionCache = function withEmotionCache(func) {
    // $FlowFixMe
    return /*#__PURE__*/React.forwardRef(function (props, ref) {
      // the cache will never be null in the browser
      var cache = React.useContext(EmotionCacheContext);
      return func(props, cache, ref);
    });
  };
  
  if (!isBrowser$3) {
    withEmotionCache = function withEmotionCache(func) {
      return function (props) {
        var cache = React.useContext(EmotionCacheContext);
  
        if (cache === null) {
          // yes, we're potentially creating this on every render
          // it doesn't actually matter though since it's only on the server
          // so there will only every be a single render
          // that could change in the future because of suspense and etc. but for now,
          // this works and i don't want to optimise for a future thing that we aren't sure about
          cache = createCache({
            key: 'css'
          });
          return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {
            value: cache
          }, func(props, cache));
        } else {
          return func(props, cache);
        }
      };
    };
  }
  
  var ThemeContext = /* #__PURE__ */React.createContext({});
  
  if (process.env.NODE_ENV !== 'production') {
    ThemeContext.displayName = 'EmotionThemeContext';
  }
  
  var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
  var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
  
  var Noop = function Noop() {
    return null;
  };
  
  var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
    var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
    // not passing the registered cache to serializeStyles because it would
    // make certain babel optimisations not possible
  
    if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
      cssProp = cache.registered[cssProp];
    }
  
    var type = props[typePropName];
    var registeredStyles = [cssProp];
    var className = '';
  
    if (typeof props.className === 'string') {
      className = getRegisteredStyles$1(cache.registered, registeredStyles, props.className);
    } else if (props.className != null) {
      className = props.className + " ";
    }
  
    var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));
  
    if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
      var labelFromStack = props[labelPropName];
  
      if (labelFromStack) {
        serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
      }
    }
  
    var rules = insertStyles$1(cache, serialized, typeof type === 'string');
    className += cache.key + "-" + serialized.name;
    var newProps = {};
  
    for (var key in props) {
      if (hasOwnProperty$1.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
        newProps[key] = props[key];
      }
    }
  
    newProps.ref = ref;
    newProps.className = className;
    var ele = /*#__PURE__*/React.createElement(type, newProps);
    var possiblyStyleElement = /*#__PURE__*/React.createElement(Noop, null);
  
    if (!isBrowser$3 && rules !== undefined) {
      var _ref;
  
      var serializedNames = serialized.name;
      var next = serialized.next;
  
      while (next !== undefined) {
        serializedNames += ' ' + next.name;
        next = next.next;
      }
  
      possiblyStyleElement = /*#__PURE__*/React.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + " " + serializedNames, _ref.dangerouslySetInnerHTML = {
        __html: rules
      }, _ref.nonce = cache.sheet.nonce, _ref));
    } // Need to return the same number of siblings or else `React.useId` will cause hydration mismatches.
  
  
    return /*#__PURE__*/React.createElement(React.Fragment, null, possiblyStyleElement, ele);
  });
  
  if (process.env.NODE_ENV !== 'production') {
    Emotion.displayName = 'EmotionCssPropInternal';
  }
  
  var isBrowser$2 = typeof document !== 'undefined';
  
  function getRegisteredStyles(registered, registeredStyles, classNames) {
    var rawClassName = '';
    classNames.split(' ').forEach(function (className) {
      if (registered[className] !== undefined) {
        registeredStyles.push(registered[className] + ";");
      } else {
        rawClassName += className + " ";
      }
    });
    return rawClassName;
  }
  
  var registerStyles = function registerStyles(cache, serialized, isStringTag) {
    var className = cache.key + "-" + serialized.name;
  
    if ( // we only need to add the styles to the registered cache if the
    // class name could be used further down
    // the tree but if it's a string tag, we know it won't
    // so we don't have to add it to registered cache.
    // this improves memory usage since we can avoid storing the whole style string
    (isStringTag === false || // we need to always store it if we're in compat mode and
    // in node since emotion-server relies on whether a style is in
    // the registered cache to know whether a style is global or not
    // also, note that this check will be dead code eliminated in the browser
    isBrowser$2 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
      cache.registered[className] = serialized.styles;
    }
  };
  
  var insertStyles = function insertStyles(cache, serialized, isStringTag) {
    registerStyles(cache, serialized, isStringTag);
    var className = cache.key + "-" + serialized.name;
  
    if (cache.inserted[serialized.name] === undefined) {
      var stylesForSSR = '';
      var current = serialized;
  
      do {
        var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
  
        if (!isBrowser$2 && maybeStyles !== undefined) {
          stylesForSSR += maybeStyles;
        }
  
        current = current.next;
      } while (current !== undefined);
  
      if (!isBrowser$2 && stylesForSSR.length !== 0) {
        return stylesForSSR;
      }
    }
  };
  
  var testOmitPropsOnStringTag = isPropValid;
  
  var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
    return key !== 'theme';
  };
  
  var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
    return typeof tag === 'string' && // 96 is one less than the char code
    // for "a" so this is checking that
    // it's a lowercase character
    tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
  };
  
  var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
    var shouldForwardProp;
  
    if (options) {
      var optionsShouldForwardProp = options.shouldForwardProp;
      shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
        return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
      } : optionsShouldForwardProp;
    }
  
    if (typeof shouldForwardProp !== 'function' && isReal) {
      shouldForwardProp = tag.__emotion_forwardProp;
    }
  
    return shouldForwardProp;
  };
  
  var isBrowser = typeof document !== 'undefined';
  var useInsertionEffect = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : function useInsertionEffect(create) {
    create();
  };
  
  function useInsertionEffectMaybe(create) {
    if (!isBrowser) {
      return create();
    }
  
    useInsertionEffect(create);
  }
  
  var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
  var isBrowser$1 = typeof document !== 'undefined';
  
  var Insertion = function Insertion(_ref) {
    var cache = _ref.cache,
        serialized = _ref.serialized,
        isStringTag = _ref.isStringTag;
    registerStyles(cache, serialized, isStringTag);
    var rules = useInsertionEffectMaybe(function () {
      return insertStyles(cache, serialized, isStringTag);
    });
  
    if (!isBrowser$1 && rules !== undefined) {
      var _ref2;
  
      var serializedNames = serialized.name;
      var next = serialized.next;
  
      while (next !== undefined) {
        serializedNames += ' ' + next.name;
        next = next.next;
      }
  
      return /*#__PURE__*/React.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
        __html: rules
      }, _ref2.nonce = cache.sheet.nonce, _ref2));
    }
  
    return null;
  };
  
  var createStyled = function createStyled(tag, options) {
    if (process.env.NODE_ENV !== 'production') {
      if (tag === undefined) {
        throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.');
      }
    }
  
    var isReal = tag.__emotion_real === tag;
    var baseTag = isReal && tag.__emotion_base || tag;
    var identifierName;
    var targetClassName;
  
    if (options !== undefined) {
      identifierName = options.label;
      targetClassName = options.target;
    }
  
    var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
    var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
    var shouldUseAs = !defaultShouldForwardProp('as');
    return function () {
      var args = arguments;
      var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
  
      if (identifierName !== undefined) {
        styles.push("label:" + identifierName + ";");
      }
  
      if (args[0] == null || args[0].raw === undefined) {
        styles.push.apply(styles, args);
      } else {
        if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {
          console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
        }
  
        styles.push(args[0][0]);
        var len = args.length;
        var i = 1;
  
        for (; i < len; i++) {
          if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {
            console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
          }
  
          styles.push(args[i], args[0][i]);
        }
      } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
  
  
      var Styled = withEmotionCache(function (props, cache, ref) {
        var FinalTag = shouldUseAs && props.as || baseTag;
        var className = '';
        var classInterpolations = [];
        var mergedProps = props;
  
        if (props.theme == null) {
          mergedProps = {};
  
          for (var key in props) {
            mergedProps[key] = props[key];
          }
  
          mergedProps.theme = React.useContext(ThemeContext);
        }
  
        if (typeof props.className === 'string') {
          className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
        } else if (props.className != null) {
          className = props.className + " ";
        }
  
        var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
        className += cache.key + "-" + serialized.name;
  
        if (targetClassName !== undefined) {
          className += " " + targetClassName;
        }
  
        var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
        var newProps = {};
  
        for (var _key in props) {
          if (shouldUseAs && _key === 'as') continue;
  
          if ( // $FlowFixMe
          finalShouldForwardProp(_key)) {
            newProps[_key] = props[_key];
          }
        }
  
        newProps.className = className;
        newProps.ref = ref;
        return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
          cache: cache,
          serialized: serialized,
          isStringTag: typeof FinalTag === 'string'
        }), /*#__PURE__*/React.createElement(FinalTag, newProps));
      });
      Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
      Styled.defaultProps = tag.defaultProps;
      Styled.__emotion_real = Styled;
      Styled.__emotion_base = baseTag;
      Styled.__emotion_styles = styles;
      Styled.__emotion_forwardProp = shouldForwardProp;
      Object.defineProperty(Styled, 'toString', {
        value: function value() {
          if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {
            return 'NO_COMPONENT_SELECTOR';
          } // $FlowFixMe: coerce undefined to string
  
  
          return "." + targetClassName;
        }
      });
  
      Styled.withComponent = function (nextTag, nextOptions) {
        return createStyled(nextTag, _extends$2({}, options, nextOptions, {
          shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
        })).apply(void 0, styles);
      };
  
      return Styled;
    };
  };
  
  var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
  'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
  var newStyled = createStyled.bind();
  tags.forEach(function (tagName) {
    // $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
    newStyled[tagName] = newStyled(tagName);
  });
  
  var propTypes = {exports: {}};
  
  /*
  object-assign
  (c) Sindre Sorhus
  @license MIT
  */
  /* eslint-disable no-unused-vars */
  
  var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  var hasOwnProperty = Object.prototype.hasOwnProperty;
  var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  
  function toObject(val) {
    if (val === null || val === undefined) {
      throw new TypeError('Object.assign cannot be called with null or undefined');
    }
  
    return Object(val);
  }
  
  function shouldUseNative() {
    try {
      if (!Object.assign) {
        return false;
      } // Detect buggy property enumeration order in older V8 versions.
      // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  
  
      var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
  
      test1[5] = 'de';
  
      if (Object.getOwnPropertyNames(test1)[0] === '5') {
        return false;
      } // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  
  
      var test2 = {};
  
      for (var i = 0; i < 10; i++) {
        test2['_' + String.fromCharCode(i)] = i;
      }
  
      var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
        return test2[n];
      });
  
      if (order2.join('') !== '0123456789') {
        return false;
      } // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  
  
      var test3 = {};
      'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
        test3[letter] = letter;
      });
  
      if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
        return false;
      }
  
      return true;
    } catch (err) {
      // We don't expect any of the above to throw, but better to be safe.
      return false;
    }
  }
  
  var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
    var from;
    var to = toObject(target);
    var symbols;
  
    for (var s = 1; s < arguments.length; s++) {
      from = Object(arguments[s]);
  
      for (var key in from) {
        if (hasOwnProperty.call(from, key)) {
          to[key] = from[key];
        }
      }
  
      if (getOwnPropertySymbols) {
        symbols = getOwnPropertySymbols(from);
  
        for (var i = 0; i < symbols.length; i++) {
          if (propIsEnumerable.call(from, symbols[i])) {
            to[symbols[i]] = from[symbols[i]];
          }
        }
      }
    }
  
    return to;
  };
  
  /**
   * Copyright (c) 2013-present, Facebook, Inc.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  
  var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
  
  var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
  
  /**
   * Copyright (c) 2013-present, Facebook, Inc.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  
  var printWarning$1 = function () {};
  
  if (process.env.NODE_ENV !== 'production') {
    var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
  
    var loggedTypeFailures = {};
  
    var has$1 = has$2;
  
    printWarning$1 = function (text) {
      var message = 'Warning: ' + text;
  
      if (typeof console !== 'undefined') {
        console.error(message);
      }
  
      try {
        // --- Welcome to debugging React ---
        // This error was thrown as a convenience so that you can use this stack
        // to find the callsite that caused this warning to fire.
        throw new Error(message);
      } catch (x) {
        /**/
      }
    };
  }
  /**
   * Assert that the values match with the type specs.
   * Error messages are memorized and will only be shown once.
   *
   * @param {object} typeSpecs Map of name to a ReactPropType
   * @param {object} values Runtime values that need to be type-checked
   * @param {string} location e.g. "prop", "context", "child context"
   * @param {string} componentName Name of the component for error messages.
   * @param {?Function} getStack Returns the component stack.
   * @private
   */
  
  
  function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
    if (process.env.NODE_ENV !== 'production') {
      for (var typeSpecName in typeSpecs) {
        if (has$1(typeSpecs, typeSpecName)) {
          var error; // Prop type validation may throw. In case they do, we don't want to
          // fail the render phase where it didn't fail before. So we log it.
          // After these have been cleaned up, we'll let them throw.
  
          try {
            // This is intentionally an invariant that gets caught. It's the same
            // behavior as without this statement except with a better message.
            if (typeof typeSpecs[typeSpecName] !== 'function') {
              var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
              err.name = 'Invariant Violation';
              throw err;
            }
  
            error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
          } catch (ex) {
            error = ex;
          }
  
          if (error && !(error instanceof Error)) {
            printWarning$1((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
          }
  
          if (error instanceof Error && !(error.message in loggedTypeFailures)) {
            // Only monitor this failure once because there tends to be a lot of the
            // same error.
            loggedTypeFailures[error.message] = true;
            var stack = getStack ? getStack() : '';
            printWarning$1('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
          }
        }
      }
    }
  }
  /**
   * Resets warning cache when testing.
   *
   * @private
   */
  
  
  checkPropTypes$1.resetWarningCache = function () {
    if (process.env.NODE_ENV !== 'production') {
      loggedTypeFailures = {};
    }
  };
  
  var checkPropTypes_1 = checkPropTypes$1;
  
  /**
   * Copyright (c) 2013-present, Facebook, Inc.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  
  var ReactIs$1 = reactIs.exports;
  
  var assign = objectAssign;
  
  var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
  
  var has = has$2;
  
  var checkPropTypes = checkPropTypes_1;
  
  var printWarning = function () {};
  
  if (process.env.NODE_ENV !== 'production') {
    printWarning = function (text) {
      var message = 'Warning: ' + text;
  
      if (typeof console !== 'undefined') {
        console.error(message);
      }
  
      try {
        // --- Welcome to debugging React ---
        // This error was thrown as a convenience so that you can use this stack
        // to find the callsite that caused this warning to fire.
        throw new Error(message);
      } catch (x) {}
    };
  }
  
  function emptyFunctionThatReturnsNull() {
    return null;
  }
  
  var factoryWithTypeCheckers = function (isValidElement, throwOnDirectAccess) {
    /* global Symbol */
    var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
    var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
  
    /**
     * Returns the iterator method function contained on the iterable object.
     *
     * Be sure to invoke the function with the iterable as context:
     *
     *     var iteratorFn = getIteratorFn(myIterable);
     *     if (iteratorFn) {
     *       var iterator = iteratorFn.call(myIterable);
     *       ...
     *     }
     *
     * @param {?object} maybeIterable
     * @return {?function}
     */
  
    function getIteratorFn(maybeIterable) {
      var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
  
      if (typeof iteratorFn === 'function') {
        return iteratorFn;
      }
    }
    /**
     * Collection of methods that allow declaration and validation of props that are
     * supplied to React components. Example usage:
     *
     *   var Props = require('ReactPropTypes');
     *   var MyArticle = React.createClass({
     *     propTypes: {
     *       // An optional string prop named "description".
     *       description: Props.string,
     *
     *       // A required enum prop named "category".
     *       category: Props.oneOf(['News','Photos']).isRequired,
     *
     *       // A prop named "dialog" that requires an instance of Dialog.
     *       dialog: Props.instanceOf(Dialog).isRequired
     *     },
     *     render: function() { ... }
     *   });
     *
     * A more formal specification of how these methods are used:
     *
     *   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
     *   decl := ReactPropTypes.{type}(.isRequired)?
     *
     * Each and every declaration produces a function with the same signature. This
     * allows the creation of custom validation functions. For example:
     *
     *  var MyLink = React.createClass({
     *    propTypes: {
     *      // An optional string or URI prop named "href".
     *      href: function(props, propName, componentName) {
     *        var propValue = props[propName];
     *        if (propValue != null && typeof propValue !== 'string' &&
     *            !(propValue instanceof URI)) {
     *          return new Error(
     *            'Expected a string or an URI for ' + propName + ' in ' +
     *            componentName
     *          );
     *        }
     *      }
     *    },
     *    render: function() {...}
     *  });
     *
     * @internal
     */
  
  
    var ANONYMOUS = '<<anonymous>>'; // Important!
    // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
  
    var ReactPropTypes = {
      array: createPrimitiveTypeChecker('array'),
      bigint: createPrimitiveTypeChecker('bigint'),
      bool: createPrimitiveTypeChecker('boolean'),
      func: createPrimitiveTypeChecker('function'),
      number: createPrimitiveTypeChecker('number'),
      object: createPrimitiveTypeChecker('object'),
      string: createPrimitiveTypeChecker('string'),
      symbol: createPrimitiveTypeChecker('symbol'),
      any: createAnyTypeChecker(),
      arrayOf: createArrayOfTypeChecker,
      element: createElementTypeChecker(),
      elementType: createElementTypeTypeChecker(),
      instanceOf: createInstanceTypeChecker,
      node: createNodeChecker(),
      objectOf: createObjectOfTypeChecker,
      oneOf: createEnumTypeChecker,
      oneOfType: createUnionTypeChecker,
      shape: createShapeTypeChecker,
      exact: createStrictShapeTypeChecker
    };
    /**
     * inlined Object.is polyfill to avoid requiring consumers ship their own
     * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
     */
  
    /*eslint-disable no-self-compare*/
  
    function is(x, y) {
      // SameValue algorithm
      if (x === y) {
        // Steps 1-5, 7-10
        // Steps 6.b-6.e: +0 != -0
        return x !== 0 || 1 / x === 1 / y;
      } else {
        // Step 6.a: NaN == NaN
        return x !== x && y !== y;
      }
    }
    /*eslint-enable no-self-compare*/
  
    /**
     * We use an Error-like object for backward compatibility as people may call
     * PropTypes directly and inspect their output. However, we don't use real
     * Errors anymore. We don't inspect their stack anyway, and creating them
     * is prohibitively expensive if they are created too often, such as what
     * happens in oneOfType() for any type before the one that matched.
     */
  
  
    function PropTypeError(message, data) {
      this.message = message;
      this.data = data && typeof data === 'object' ? data : {};
      this.stack = '';
    } // Make `instanceof Error` still work for returned errors.
  
  
    PropTypeError.prototype = Error.prototype;
  
    function createChainableTypeChecker(validate) {
      if (process.env.NODE_ENV !== 'production') {
        var manualPropTypeCallCache = {};
        var manualPropTypeWarningCount = 0;
      }
  
      function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
        componentName = componentName || ANONYMOUS;
        propFullName = propFullName || propName;
  
        if (secret !== ReactPropTypesSecret$1) {
          if (throwOnDirectAccess) {
            // New behavior only for users of `prop-types` package
            var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
            err.name = 'Invariant Violation';
            throw err;
          } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
            // Old behavior for people using React.PropTypes
            var cacheKey = componentName + ':' + propName;
  
            if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
            manualPropTypeWarningCount < 3) {
              printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
              manualPropTypeCallCache[cacheKey] = true;
              manualPropTypeWarningCount++;
            }
          }
        }
  
        if (props[propName] == null) {
          if (isRequired) {
            if (props[propName] === null) {
              return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
            }
  
            return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
          }
  
          return null;
        } else {
          return validate(props, propName, componentName, location, propFullName);
        }
      }
  
      var chainedCheckType = checkType.bind(null, false);
      chainedCheckType.isRequired = checkType.bind(null, true);
      return chainedCheckType;
    }
  
    function createPrimitiveTypeChecker(expectedType) {
      function validate(props, propName, componentName, location, propFullName, secret) {
        var propValue = props[propName];
        var propType = getPropType(propValue);
  
        if (propType !== expectedType) {
          // `propValue` being instance of, say, date/regexp, pass the 'object'
          // check, but we can offer a more precise error message here rather than
          // 'of type `object`'.
          var preciseType = getPreciseType(propValue);
          return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
            expectedType: expectedType
          });
        }
  
        return null;
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function createAnyTypeChecker() {
      return createChainableTypeChecker(emptyFunctionThatReturnsNull);
    }
  
    function createArrayOfTypeChecker(typeChecker) {
      function validate(props, propName, componentName, location, propFullName) {
        if (typeof typeChecker !== 'function') {
          return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
        }
  
        var propValue = props[propName];
  
        if (!Array.isArray(propValue)) {
          var propType = getPropType(propValue);
          return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
        }
  
        for (var i = 0; i < propValue.length; i++) {
          var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
  
          if (error instanceof Error) {
            return error;
          }
        }
  
        return null;
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function createElementTypeChecker() {
      function validate(props, propName, componentName, location, propFullName) {
        var propValue = props[propName];
  
        if (!isValidElement(propValue)) {
          var propType = getPropType(propValue);
          return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
        }
  
        return null;
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function createElementTypeTypeChecker() {
      function validate(props, propName, componentName, location, propFullName) {
        var propValue = props[propName];
  
        if (!ReactIs$1.isValidElementType(propValue)) {
          var propType = getPropType(propValue);
          return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
        }
  
        return null;
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function createInstanceTypeChecker(expectedClass) {
      function validate(props, propName, componentName, location, propFullName) {
        if (!(props[propName] instanceof expectedClass)) {
          var expectedClassName = expectedClass.name || ANONYMOUS;
          var actualClassName = getClassName(props[propName]);
          return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
        }
  
        return null;
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function createEnumTypeChecker(expectedValues) {
      if (!Array.isArray(expectedValues)) {
        if (process.env.NODE_ENV !== 'production') {
          if (arguments.length > 1) {
            printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
          } else {
            printWarning('Invalid argument supplied to oneOf, expected an array.');
          }
        }
  
        return emptyFunctionThatReturnsNull;
      }
  
      function validate(props, propName, componentName, location, propFullName) {
        var propValue = props[propName];
  
        for (var i = 0; i < expectedValues.length; i++) {
          if (is(propValue, expectedValues[i])) {
            return null;
          }
        }
  
        var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
          var type = getPreciseType(value);
  
          if (type === 'symbol') {
            return String(value);
          }
  
          return value;
        });
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function createObjectOfTypeChecker(typeChecker) {
      function validate(props, propName, componentName, location, propFullName) {
        if (typeof typeChecker !== 'function') {
          return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
        }
  
        var propValue = props[propName];
        var propType = getPropType(propValue);
  
        if (propType !== 'object') {
          return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
        }
  
        for (var key in propValue) {
          if (has(propValue, key)) {
            var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
  
            if (error instanceof Error) {
              return error;
            }
          }
        }
  
        return null;
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function createUnionTypeChecker(arrayOfTypeCheckers) {
      if (!Array.isArray(arrayOfTypeCheckers)) {
        process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
        return emptyFunctionThatReturnsNull;
      }
  
      for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
        var checker = arrayOfTypeCheckers[i];
  
        if (typeof checker !== 'function') {
          printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
          return emptyFunctionThatReturnsNull;
        }
      }
  
      function validate(props, propName, componentName, location, propFullName) {
        var expectedTypes = [];
  
        for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
          var checker = arrayOfTypeCheckers[i];
          var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
  
          if (checkerResult == null) {
            return null;
          }
  
          if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
            expectedTypes.push(checkerResult.data.expectedType);
          }
        }
  
        var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function createNodeChecker() {
      function validate(props, propName, componentName, location, propFullName) {
        if (!isNode(props[propName])) {
          return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
        }
  
        return null;
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function invalidValidatorError(componentName, location, propFullName, key, type) {
      return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
    }
  
    function createShapeTypeChecker(shapeTypes) {
      function validate(props, propName, componentName, location, propFullName) {
        var propValue = props[propName];
        var propType = getPropType(propValue);
  
        if (propType !== 'object') {
          return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
        }
  
        for (var key in shapeTypes) {
          var checker = shapeTypes[key];
  
          if (typeof checker !== 'function') {
            return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
          }
  
          var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
  
          if (error) {
            return error;
          }
        }
  
        return null;
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function createStrictShapeTypeChecker(shapeTypes) {
      function validate(props, propName, componentName, location, propFullName) {
        var propValue = props[propName];
        var propType = getPropType(propValue);
  
        if (propType !== 'object') {
          return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
        } // We need to check all keys in case some are required but missing from props.
  
  
        var allKeys = assign({}, props[propName], shapeTypes);
  
        for (var key in allKeys) {
          var checker = shapeTypes[key];
  
          if (has(shapeTypes, key) && typeof checker !== 'function') {
            return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
          }
  
          if (!checker) {
            return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, '  ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, '  '));
          }
  
          var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
  
          if (error) {
            return error;
          }
        }
  
        return null;
      }
  
      return createChainableTypeChecker(validate);
    }
  
    function isNode(propValue) {
      switch (typeof propValue) {
        case 'number':
        case 'string':
        case 'undefined':
          return true;
  
        case 'boolean':
          return !propValue;
  
        case 'object':
          if (Array.isArray(propValue)) {
            return propValue.every(isNode);
          }
  
          if (propValue === null || isValidElement(propValue)) {
            return true;
          }
  
          var iteratorFn = getIteratorFn(propValue);
  
          if (iteratorFn) {
            var iterator = iteratorFn.call(propValue);
            var step;
  
            if (iteratorFn !== propValue.entries) {
              while (!(step = iterator.next()).done) {
                if (!isNode(step.value)) {
                  return false;
                }
              }
            } else {
              // Iterator will provide entry [k,v] tuples rather than values.
              while (!(step = iterator.next()).done) {
                var entry = step.value;
  
                if (entry) {
                  if (!isNode(entry[1])) {
                    return false;
                  }
                }
              }
            }
          } else {
            return false;
          }
  
          return true;
  
        default:
          return false;
      }
    }
  
    function isSymbol(propType, propValue) {
      // Native Symbol.
      if (propType === 'symbol') {
        return true;
      } // falsy value can't be a Symbol
  
  
      if (!propValue) {
        return false;
      } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
  
  
      if (propValue['@@toStringTag'] === 'Symbol') {
        return true;
      } // Fallback for non-spec compliant Symbols which are polyfilled.
  
  
      if (typeof Symbol === 'function' && propValue instanceof Symbol) {
        return true;
      }
  
      return false;
    } // Equivalent of `typeof` but with special handling for array and regexp.
  
  
    function getPropType(propValue) {
      var propType = typeof propValue;
  
      if (Array.isArray(propValue)) {
        return 'array';
      }
  
      if (propValue instanceof RegExp) {
        // Old webkits (at least until Android 4.0) return 'function' rather than
        // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
        // passes PropTypes.object.
        return 'object';
      }
  
      if (isSymbol(propType, propValue)) {
        return 'symbol';
      }
  
      return propType;
    } // This handles more types than `getPropType`. Only used for error messages.
    // See `createPrimitiveTypeChecker`.
  
  
    function getPreciseType(propValue) {
      if (typeof propValue === 'undefined' || propValue === null) {
        return '' + propValue;
      }
  
      var propType = getPropType(propValue);
  
      if (propType === 'object') {
        if (propValue instanceof Date) {
          return 'date';
        } else if (propValue instanceof RegExp) {
          return 'regexp';
        }
      }
  
      return propType;
    } // Returns a string that is postfixed to a warning about an invalid type.
    // For example, "undefined" or "of type array"
  
  
    function getPostfixForTypeWarning(value) {
      var type = getPreciseType(value);
  
      switch (type) {
        case 'array':
        case 'object':
          return 'an ' + type;
  
        case 'boolean':
        case 'date':
        case 'regexp':
          return 'a ' + type;
  
        default:
          return type;
      }
    } // Returns class name of the object, if any.
  
  
    function getClassName(propValue) {
      if (!propValue.constructor || !propValue.constructor.name) {
        return ANONYMOUS;
      }
  
      return propValue.constructor.name;
    }
  
    ReactPropTypes.checkPropTypes = checkPropTypes;
    ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
    ReactPropTypes.PropTypes = ReactPropTypes;
    return ReactPropTypes;
  };
  
  /**
   * Copyright (c) 2013-present, Facebook, Inc.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  
  var ReactPropTypesSecret = ReactPropTypesSecret_1;
  
  function emptyFunction() {}
  
  function emptyFunctionWithReset() {}
  
  emptyFunctionWithReset.resetWarningCache = emptyFunction;
  
  var factoryWithThrowingShims = function () {
    function shim(props, propName, componentName, location, propFullName, secret) {
      if (secret === ReactPropTypesSecret) {
        // It is still safe when called from React.
        return;
      }
  
      var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
      err.name = 'Invariant Violation';
      throw err;
    }
    shim.isRequired = shim;
  
    function getShim() {
      return shim;
    }
    // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
  
    var ReactPropTypes = {
      array: shim,
      bigint: shim,
      bool: shim,
      func: shim,
      number: shim,
      object: shim,
      string: shim,
      symbol: shim,
      any: shim,
      arrayOf: getShim,
      element: shim,
      elementType: shim,
      instanceOf: getShim,
      node: shim,
      objectOf: getShim,
      oneOf: getShim,
      oneOfType: getShim,
      shape: getShim,
      exact: getShim,
      checkPropTypes: emptyFunctionWithReset,
      resetWarningCache: emptyFunction
    };
    ReactPropTypes.PropTypes = ReactPropTypes;
    return ReactPropTypes;
  };
  
  /**
   * Copyright (c) 2013-present, Facebook, Inc.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  
  if (process.env.NODE_ENV !== 'production') {
    var ReactIs = reactIs.exports; // By explicitly using `prop-types` you are opting into new development behavior.
    // http://fb.me/prop-types-in-prod
  
  
    var throwOnDirectAccess = true;
    propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
  } else {
    // By explicitly using `prop-types` you are opting into new production behavior.
    // http://fb.me/prop-types-in-prod
    propTypes.exports = factoryWithThrowingShims();
  }
  
  var PropTypes = propTypes.exports;
  
  var classnames = {exports: {}};
  
  /*!
    Copyright (c) 2018 Jed Watson.
    Licensed under the MIT License (MIT), see
    http://jedwatson.github.io/classnames
  */
  
  (function (module) {
  /* global define */
  (function () {
  
    var hasOwn = {}.hasOwnProperty;
  
    function classNames() {
      var classes = [];
  
      for (var i = 0; i < arguments.length; i++) {
        var arg = arguments[i];
        if (!arg) continue;
        var argType = typeof arg;
  
        if (argType === 'string' || argType === 'number') {
          classes.push(arg);
        } else if (Array.isArray(arg)) {
          if (arg.length) {
            var inner = classNames.apply(null, arg);
  
            if (inner) {
              classes.push(inner);
            }
          }
        } else if (argType === 'object') {
          if (arg.toString === Object.prototype.toString) {
            for (var key in arg) {
              if (hasOwn.call(arg, key) && arg[key]) {
                classes.push(key);
              }
            }
          } else {
            classes.push(arg.toString());
          }
        }
      }
  
      return classes.join(' ');
    }
  
    if (module.exports) {
      classNames.default = classNames;
      module.exports = classNames;
    } else {
      window.classNames = classNames;
    }
  })();
  }(classnames));
  
  var classNames = classnames.exports;
  
  /*!
   * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
   * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
   */
  
  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  
  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
  }
  
  function _defineProperty$2(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
  
    return obj;
  }
  
  function _objectSpread(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i] != null ? arguments[i] : {};
      var ownKeys = Object.keys(source);
  
      if (typeof Object.getOwnPropertySymbols === 'function') {
        ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
        }));
      }
  
      ownKeys.forEach(function (key) {
        _defineProperty$2(target, key, source[key]);
      });
    }
  
    return target;
  }
  
  function _slicedToArray(arr, i) {
    return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  }
  
  function _arrayWithHoles(arr) {
    if (Array.isArray(arr)) return arr;
  }
  
  function _iterableToArrayLimit(arr, i) {
    var _arr = [];
    var _n = true;
    var _d = false;
    var _e = undefined;
  
    try {
      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);
  
        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"] != null) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }
  
    return _arr;
  }
  
  function _nonIterableRest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance");
  }
  
  var noop = function noop() {};
  
  var _WINDOW = {};
  var _DOCUMENT = {};
  var _MUTATION_OBSERVER = null;
  var _PERFORMANCE = {
    mark: noop,
    measure: noop
  };
  
  try {
    if (typeof window !== 'undefined') _WINDOW = window;
    if (typeof document !== 'undefined') _DOCUMENT = document;
    if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
    if (typeof performance !== 'undefined') _PERFORMANCE = performance;
  } catch (e) {}
  
  var _ref = _WINDOW.navigator || {},
      _ref$userAgent = _ref.userAgent,
      userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;
  
  var WINDOW = _WINDOW;
  var DOCUMENT = _DOCUMENT;
  var PERFORMANCE = _PERFORMANCE;
  !!WINDOW.document;
  var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
  ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
  var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
  var DEFAULT_FAMILY_PREFIX = 'fa';
  var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
  var DATA_FA_I2SVG = 'data-fa-i2svg';
  
  (function () {
    try {
      return process.env.NODE_ENV === 'production';
    } catch (e) {
      return false;
    }
  })();
  var DUOTONE_CLASSES = {
    GROUP: 'group',
    SWAP_OPACITY: 'swap-opacity',
    PRIMARY: 'primary',
    SECONDARY: 'secondary'
  };
  var initial = WINDOW.FontAwesomeConfig || {};
  
  function getAttrConfig(attr) {
    var element = DOCUMENT.querySelector('script[' + attr + ']');
  
    if (element) {
      return element.getAttribute(attr);
    }
  }
  
  function coerce(val) {
    // Getting an empty string will occur if the attribute is set on the HTML tag but without a value
    // We'll assume that this is an indication that it should be toggled to true
    // For example <script data-search-pseudo-elements src="..."></script>
    if (val === '') return true;
    if (val === 'false') return false;
    if (val === 'true') return true;
    return val;
  }
  
  if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
    var attrs = [['data-family-prefix', 'familyPrefix'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];
    attrs.forEach(function (_ref) {
      var _ref2 = _slicedToArray(_ref, 2),
          attr = _ref2[0],
          key = _ref2[1];
  
      var val = coerce(getAttrConfig(attr));
  
      if (val !== undefined && val !== null) {
        initial[key] = val;
      }
    });
  }
  
  var _default = {
    familyPrefix: DEFAULT_FAMILY_PREFIX,
    replacementClass: DEFAULT_REPLACEMENT_CLASS,
    autoReplaceSvg: true,
    autoAddCss: true,
    autoA11y: true,
    searchPseudoElements: false,
    observeMutations: true,
    mutateApproach: 'async',
    keepOriginalSource: true,
    measurePerformance: false,
    showMissingIcons: true
  };
  
  var _config = _objectSpread({}, _default, initial);
  
  if (!_config.autoReplaceSvg) _config.observeMutations = false;
  
  var config = _objectSpread({}, _config);
  
  WINDOW.FontAwesomeConfig = config;
  var w = WINDOW || {};
  if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
  if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
  if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
  if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
  var namespace = w[NAMESPACE_IDENTIFIER];
  var functions = [];
  
  var listener = function listener() {
    DOCUMENT.removeEventListener('DOMContentLoaded', listener);
    loaded = 1;
    functions.map(function (fn) {
      return fn();
    });
  };
  
  var loaded = false;
  
  if (IS_DOM) {
    loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
    if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
  }
  
  typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';
  typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
  var meaninglessTransform = {
    size: 16,
    x: 0,
    y: 0,
    rotate: 0,
    flipX: false,
    flipY: false
  };
  
  function insertCss(css) {
    if (!css || !IS_DOM) {
      return;
    }
  
    var style = DOCUMENT.createElement('style');
    style.setAttribute('type', 'text/css');
    style.innerHTML = css;
    var headChildren = DOCUMENT.head.childNodes;
    var beforeChild = null;
  
    for (var i = headChildren.length - 1; i > -1; i--) {
      var child = headChildren[i];
      var tagName = (child.tagName || '').toUpperCase();
  
      if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
        beforeChild = child;
      }
    }
  
    DOCUMENT.head.insertBefore(style, beforeChild);
    return css;
  }
  
  var idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  
  function nextUniqueId() {
    var size = 12;
    var id = '';
  
    while (size-- > 0) {
      id += idPool[Math.random() * 62 | 0];
    }
  
    return id;
  }
  
  function htmlEscape(str) {
    return "".concat(str).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
  }
  
  function joinAttributes(attributes) {
    return Object.keys(attributes || {}).reduce(function (acc, attributeName) {
      return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
    }, '').trim();
  }
  
  function joinStyles(styles) {
    return Object.keys(styles || {}).reduce(function (acc, styleName) {
      return acc + "".concat(styleName, ": ").concat(styles[styleName], ";");
    }, '');
  }
  
  function transformIsMeaningful(transform) {
    return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
  }
  
  function transformForSvg(_ref) {
    var transform = _ref.transform,
        containerWidth = _ref.containerWidth,
        iconWidth = _ref.iconWidth;
    var outer = {
      transform: "translate(".concat(containerWidth / 2, " 256)")
    };
    var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
    var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
    var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
    var inner = {
      transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
    };
    var path = {
      transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
    };
    return {
      outer: outer,
      inner: inner,
      path: path
    };
  }
  
  var ALL_SPACE = {
    x: 0,
    y: 0,
    width: '100%',
    height: '100%'
  };
  
  function fillBlack(abstract) {
    var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  
    if (abstract.attributes && (abstract.attributes.fill || force)) {
      abstract.attributes.fill = 'black';
    }
  
    return abstract;
  }
  
  function deGroup(abstract) {
    if (abstract.tag === 'g') {
      return abstract.children;
    } else {
      return [abstract];
    }
  }
  
  function makeIconMasking(_ref) {
    var children = _ref.children,
        attributes = _ref.attributes,
        main = _ref.main,
        mask = _ref.mask,
        explicitMaskId = _ref.maskId,
        transform = _ref.transform;
    var mainWidth = main.width,
        mainPath = main.icon;
    var maskWidth = mask.width,
        maskPath = mask.icon;
    var trans = transformForSvg({
      transform: transform,
      containerWidth: maskWidth,
      iconWidth: mainWidth
    });
    var maskRect = {
      tag: 'rect',
      attributes: _objectSpread({}, ALL_SPACE, {
        fill: 'white'
      })
    };
    var maskInnerGroupChildrenMixin = mainPath.children ? {
      children: mainPath.children.map(fillBlack)
    } : {};
    var maskInnerGroup = {
      tag: 'g',
      attributes: _objectSpread({}, trans.inner),
      children: [fillBlack(_objectSpread({
        tag: mainPath.tag,
        attributes: _objectSpread({}, mainPath.attributes, trans.path)
      }, maskInnerGroupChildrenMixin))]
    };
    var maskOuterGroup = {
      tag: 'g',
      attributes: _objectSpread({}, trans.outer),
      children: [maskInnerGroup]
    };
    var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
    var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
    var maskTag = {
      tag: 'mask',
      attributes: _objectSpread({}, ALL_SPACE, {
        id: maskId,
        maskUnits: 'userSpaceOnUse',
        maskContentUnits: 'userSpaceOnUse'
      }),
      children: [maskRect, maskOuterGroup]
    };
    var defs = {
      tag: 'defs',
      children: [{
        tag: 'clipPath',
        attributes: {
          id: clipId
        },
        children: deGroup(maskPath)
      }, maskTag]
    };
    children.push(defs, {
      tag: 'rect',
      attributes: _objectSpread({
        fill: 'currentColor',
        'clip-path': "url(#".concat(clipId, ")"),
        mask: "url(#".concat(maskId, ")")
      }, ALL_SPACE)
    });
    return {
      children: children,
      attributes: attributes
    };
  }
  
  function makeIconStandard(_ref) {
    var children = _ref.children,
        attributes = _ref.attributes,
        main = _ref.main,
        transform = _ref.transform,
        styles = _ref.styles;
    var styleString = joinStyles(styles);
  
    if (styleString.length > 0) {
      attributes['style'] = styleString;
    }
  
    if (transformIsMeaningful(transform)) {
      var trans = transformForSvg({
        transform: transform,
        containerWidth: main.width,
        iconWidth: main.width
      });
      children.push({
        tag: 'g',
        attributes: _objectSpread({}, trans.outer),
        children: [{
          tag: 'g',
          attributes: _objectSpread({}, trans.inner),
          children: [{
            tag: main.icon.tag,
            children: main.icon.children,
            attributes: _objectSpread({}, main.icon.attributes, trans.path)
          }]
        }]
      });
    } else {
      children.push(main.icon);
    }
  
    return {
      children: children,
      attributes: attributes
    };
  }
  
  function asIcon(_ref) {
    var children = _ref.children,
        main = _ref.main,
        mask = _ref.mask,
        attributes = _ref.attributes,
        styles = _ref.styles,
        transform = _ref.transform;
  
    if (transformIsMeaningful(transform) && main.found && !mask.found) {
      var width = main.width,
          height = main.height;
      var offset = {
        x: width / height / 2,
        y: 0.5
      };
      attributes['style'] = joinStyles(_objectSpread({}, styles, {
        'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
      }));
    }
  
    return [{
      tag: 'svg',
      attributes: attributes,
      children: children
    }];
  }
  
  function asSymbol(_ref) {
    var prefix = _ref.prefix,
        iconName = _ref.iconName,
        children = _ref.children,
        attributes = _ref.attributes,
        symbol = _ref.symbol;
    var id = symbol === true ? "".concat(prefix, "-").concat(config.familyPrefix, "-").concat(iconName) : symbol;
    return [{
      tag: 'svg',
      attributes: {
        style: 'display: none;'
      },
      children: [{
        tag: 'symbol',
        attributes: _objectSpread({}, attributes, {
          id: id
        }),
        children: children
      }]
    }];
  }
  
  function makeInlineSvgAbstract(params) {
    var _params$icons = params.icons,
        main = _params$icons.main,
        mask = _params$icons.mask,
        prefix = params.prefix,
        iconName = params.iconName,
        transform = params.transform,
        symbol = params.symbol,
        title = params.title,
        maskId = params.maskId,
        titleId = params.titleId,
        extra = params.extra,
        _params$watchable = params.watchable,
        watchable = _params$watchable === void 0 ? false : _params$watchable;
  
    var _ref = mask.found ? mask : main,
        width = _ref.width,
        height = _ref.height;
  
    var isUploadedIcon = prefix === 'fak';
    var widthClass = isUploadedIcon ? '' : "fa-w-".concat(Math.ceil(width / height * 16));
    var attrClass = [config.replacementClass, iconName ? "".concat(config.familyPrefix, "-").concat(iconName) : '', widthClass].filter(function (c) {
      return extra.classes.indexOf(c) === -1;
    }).filter(function (c) {
      return c !== '' || !!c;
    }).concat(extra.classes).join(' ');
    var content = {
      children: [],
      attributes: _objectSpread({}, extra.attributes, {
        'data-prefix': prefix,
        'data-icon': iconName,
        'class': attrClass,
        'role': extra.attributes.role || 'img',
        'xmlns': 'http://www.w3.org/2000/svg',
        'viewBox': "0 0 ".concat(width, " ").concat(height)
      })
    };
    var uploadedIconWidthStyle = isUploadedIcon && !~extra.classes.indexOf('fa-fw') ? {
      width: "".concat(width / height * 16 * 0.0625, "em")
    } : {};
  
    if (watchable) {
      content.attributes[DATA_FA_I2SVG] = '';
    }
  
    if (title) content.children.push({
      tag: 'title',
      attributes: {
        id: content.attributes['aria-labelledby'] || "title-".concat(titleId || nextUniqueId())
      },
      children: [title]
    });
  
    var args = _objectSpread({}, content, {
      prefix: prefix,
      iconName: iconName,
      main: main,
      mask: mask,
      maskId: maskId,
      transform: transform,
      symbol: symbol,
      styles: _objectSpread({}, uploadedIconWidthStyle, extra.styles)
    });
  
    var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),
        children = _ref2.children,
        attributes = _ref2.attributes;
  
    args.children = children;
    args.attributes = attributes;
  
    if (symbol) {
      return asSymbol(args);
    } else {
      return asIcon(args);
    }
  }
  
  var noop$1 = function noop() {};
  
  config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
    mark: noop$1,
    measure: noop$1
  };
  /**
   * Internal helper to bind a function known to have 4 arguments
   * to a given context.
   */
  
  var bindInternal4 = function bindInternal4(func, thisContext) {
    return function (a, b, c, d) {
      return func.call(thisContext, a, b, c, d);
    };
  };
  /**
   * # Reduce
   *
   * A fast object `.reduce()` implementation.
   *
   * @param  {Object}   subject      The object to reduce over.
   * @param  {Function} fn           The reducer function.
   * @param  {mixed}    initialValue The initial value for the reducer, defaults to subject[0].
   * @param  {Object}   thisContext  The context for the reducer.
   * @return {mixed}                 The final result.
   */
  
  
  var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
    var keys = Object.keys(subject),
        length = keys.length,
        iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
        i,
        key,
        result;
  
    if (initialValue === undefined) {
      i = 1;
      result = subject[keys[0]];
    } else {
      i = 0;
      result = initialValue;
    }
  
    for (; i < length; i++) {
      key = keys[i];
      result = iterator(result, subject[key], key, subject);
    }
  
    return result;
  };
  
  function defineIcons(prefix, icons) {
    var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
    var _params$skipHooks = params.skipHooks,
        skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
    var normalized = Object.keys(icons).reduce(function (acc, iconName) {
      var icon = icons[iconName];
      var expanded = !!icon.icon;
  
      if (expanded) {
        acc[icon.iconName] = icon.icon;
      } else {
        acc[iconName] = icon;
      }
  
      return acc;
    }, {});
  
    if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
      namespace.hooks.addPack(prefix, normalized);
    } else {
      namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);
    }
    /**
     * Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
     * of new styles we needed to differentiate between them. Prefix `fa` is now an alias
     * for `fas` so we'll easy the upgrade process for our users by automatically defining
     * this as well.
     */
  
  
    if (prefix === 'fas') {
      defineIcons('fa', icons);
    }
  }
  
  var styles = namespace.styles,
      shims = namespace.shims;
  
  var build = function build() {
    var lookup = function lookup(reducer) {
      return reduce(styles, function (o, style, prefix) {
        o[prefix] = reduce(style, reducer, {});
        return o;
      }, {});
    };
  
    lookup(function (acc, icon, iconName) {
      if (icon[3]) {
        acc[icon[3]] = iconName;
      }
  
      return acc;
    });
    lookup(function (acc, icon, iconName) {
      var ligatures = icon[2];
      acc[iconName] = iconName;
      ligatures.forEach(function (ligature) {
        acc[ligature] = iconName;
      });
      return acc;
    });
    var hasRegular = ('far' in styles);
    reduce(shims, function (acc, shim) {
      var oldName = shim[0];
      var prefix = shim[1];
      var iconName = shim[2];
  
      if (prefix === 'far' && !hasRegular) {
        prefix = 'fas';
      }
  
      acc[oldName] = {
        prefix: prefix,
        iconName: iconName
      };
      return acc;
    }, {});
  };
  
  build();
  
  namespace.styles;
  
  function iconFromMapping(mapping, prefix, iconName) {
    if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
      return {
        prefix: prefix,
        iconName: iconName,
        icon: mapping[prefix][iconName]
      };
    }
  }
  
  function toHtml(abstractNodes) {
    var tag = abstractNodes.tag,
        _abstractNodes$attrib = abstractNodes.attributes,
        attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,
        _abstractNodes$childr = abstractNodes.children,
        children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
  
    if (typeof abstractNodes === 'string') {
      return htmlEscape(abstractNodes);
    } else {
      return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
    }
  }
  
  var parseTransformString = function parseTransformString(transformString) {
    var transform = {
      size: 16,
      x: 0,
      y: 0,
      flipX: false,
      flipY: false,
      rotate: 0
    };
  
    if (!transformString) {
      return transform;
    } else {
      return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
        var parts = n.toLowerCase().split('-');
        var first = parts[0];
        var rest = parts.slice(1).join('-');
  
        if (first && rest === 'h') {
          acc.flipX = true;
          return acc;
        }
  
        if (first && rest === 'v') {
          acc.flipY = true;
          return acc;
        }
  
        rest = parseFloat(rest);
  
        if (isNaN(rest)) {
          return acc;
        }
  
        switch (first) {
          case 'grow':
            acc.size = acc.size + rest;
            break;
  
          case 'shrink':
            acc.size = acc.size - rest;
            break;
  
          case 'left':
            acc.x = acc.x - rest;
            break;
  
          case 'right':
            acc.x = acc.x + rest;
            break;
  
          case 'up':
            acc.y = acc.y - rest;
            break;
  
          case 'down':
            acc.y = acc.y + rest;
            break;
  
          case 'rotate':
            acc.rotate = acc.rotate + rest;
            break;
        }
  
        return acc;
      }, transform);
    }
  };
  
  function MissingIcon(error) {
    this.name = 'MissingIcon';
    this.message = error || 'Icon unavailable';
    this.stack = new Error().stack;
  }
  
  MissingIcon.prototype = Object.create(Error.prototype);
  MissingIcon.prototype.constructor = MissingIcon;
  var FILL = {
    fill: 'currentColor'
  };
  var ANIMATION_BASE = {
    attributeType: 'XML',
    repeatCount: 'indefinite',
    dur: '2s'
  };
  ({
    tag: 'path',
    attributes: _objectSpread({}, FILL, {
      d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'
    })
  });
  
  var OPACITY_ANIMATE = _objectSpread({}, ANIMATION_BASE, {
    attributeName: 'opacity'
  });
  
  ({
    tag: 'circle',
    attributes: _objectSpread({}, FILL, {
      cx: '256',
      cy: '364',
      r: '28'
    }),
    children: [{
      tag: 'animate',
      attributes: _objectSpread({}, ANIMATION_BASE, {
        attributeName: 'r',
        values: '28;14;28;28;14;28;'
      })
    }, {
      tag: 'animate',
      attributes: _objectSpread({}, OPACITY_ANIMATE, {
        values: '1;0;1;1;0;1;'
      })
    }]
  });
  ({
    tag: 'path',
    attributes: _objectSpread({}, FILL, {
      opacity: '1',
      d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'
    }),
    children: [{
      tag: 'animate',
      attributes: _objectSpread({}, OPACITY_ANIMATE, {
        values: '1;0;0;0;0;1;'
      })
    }]
  });
  ({
    tag: 'path',
    attributes: _objectSpread({}, FILL, {
      opacity: '0',
      d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'
    }),
    children: [{
      tag: 'animate',
      attributes: _objectSpread({}, OPACITY_ANIMATE, {
        values: '0;0;1;1;0;0;'
      })
    }]
  });
  namespace.styles;
  
  function asFoundIcon(icon) {
    var width = icon[0];
    var height = icon[1];
  
    var _icon$slice = icon.slice(4),
        _icon$slice2 = _slicedToArray(_icon$slice, 1),
        vectorData = _icon$slice2[0];
  
    var element = null;
  
    if (Array.isArray(vectorData)) {
      element = {
        tag: 'g',
        attributes: {
          class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.GROUP)
        },
        children: [{
          tag: 'path',
          attributes: {
            class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.SECONDARY),
            fill: 'currentColor',
            d: vectorData[0]
          }
        }, {
          tag: 'path',
          attributes: {
            class: "".concat(config.familyPrefix, "-").concat(DUOTONE_CLASSES.PRIMARY),
            fill: 'currentColor',
            d: vectorData[1]
          }
        }]
      };
    } else {
      element = {
        tag: 'path',
        attributes: {
          fill: 'currentColor',
          d: vectorData
        }
      };
    }
  
    return {
      found: true,
      width: width,
      height: height,
      icon: element
    };
  }
  
  namespace.styles;
  
  var baseStyles = "svg:not(:root).svg-inline--fa {\n  overflow: visible;\n}\n\n.svg-inline--fa {\n  display: inline-block;\n  font-size: inherit;\n  height: 1em;\n  overflow: visible;\n  vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n  vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n  width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n  width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n  width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n  width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n  width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n  width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n  width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n  width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n  width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n  width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n  width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n  width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n  width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n  width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n  width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n  width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n  width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n  width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n  width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n  width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n  margin-right: 0.3em;\n  width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n  margin-left: 0.3em;\n  width: auto;\n}\n.svg-inline--fa.fa-border {\n  height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n  width: 2em;\n}\n.svg-inline--fa.fa-fw {\n  width: 1.25em;\n}\n\n.fa-layers svg.svg-inline--fa {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.fa-layers {\n  display: inline-block;\n  height: 1em;\n  position: relative;\n  text-align: center;\n  vertical-align: -0.125em;\n  width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n  -webkit-transform-origin: center center;\n          transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n  display: inline-block;\n  position: absolute;\n  text-align: center;\n}\n\n.fa-layers-text {\n  left: 50%;\n  top: 50%;\n  -webkit-transform: translate(-50%, -50%);\n          transform: translate(-50%, -50%);\n  -webkit-transform-origin: center center;\n          transform-origin: center center;\n}\n\n.fa-layers-counter {\n  background-color: #ff253a;\n  border-radius: 1em;\n  -webkit-box-sizing: border-box;\n          box-sizing: border-box;\n  color: #fff;\n  height: 1.5em;\n  line-height: 1;\n  max-width: 5em;\n  min-width: 1.5em;\n  overflow: hidden;\n  padding: 0.25em;\n  right: 0;\n  text-overflow: ellipsis;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top right;\n          transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n  bottom: 0;\n  right: 0;\n  top: auto;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: bottom right;\n          transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n  bottom: 0;\n  left: 0;\n  right: auto;\n  top: auto;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: bottom left;\n          transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n  right: 0;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top right;\n          transform-origin: top right;\n}\n\n.fa-layers-top-left {\n  left: 0;\n  right: auto;\n  top: 0;\n  -webkit-transform: scale(0.25);\n          transform: scale(0.25);\n  -webkit-transform-origin: top left;\n          transform-origin: top left;\n}\n\n.fa-lg {\n  font-size: 1.3333333333em;\n  line-height: 0.75em;\n  vertical-align: -0.0667em;\n}\n\n.fa-xs {\n  font-size: 0.75em;\n}\n\n.fa-sm {\n  font-size: 0.875em;\n}\n\n.fa-1x {\n  font-size: 1em;\n}\n\n.fa-2x {\n  font-size: 2em;\n}\n\n.fa-3x {\n  font-size: 3em;\n}\n\n.fa-4x {\n  font-size: 4em;\n}\n\n.fa-5x {\n  font-size: 5em;\n}\n\n.fa-6x {\n  font-size: 6em;\n}\n\n.fa-7x {\n  font-size: 7em;\n}\n\n.fa-8x {\n  font-size: 8em;\n}\n\n.fa-9x {\n  font-size: 9em;\n}\n\n.fa-10x {\n  font-size: 10em;\n}\n\n.fa-fw {\n  text-align: center;\n  width: 1.25em;\n}\n\n.fa-ul {\n  list-style-type: none;\n  margin-left: 2.5em;\n  padding-left: 0;\n}\n.fa-ul > li {\n  position: relative;\n}\n\n.fa-li {\n  left: -2em;\n  position: absolute;\n  text-align: center;\n  width: 2em;\n  line-height: inherit;\n}\n\n.fa-border {\n  border: solid 0.08em #eee;\n  border-radius: 0.1em;\n  padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n  float: left;\n}\n\n.fa-pull-right {\n  float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n  margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n  margin-left: 0.3em;\n}\n\n.fa-spin {\n  -webkit-animation: fa-spin 2s infinite linear;\n          animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n  -webkit-animation: fa-spin 1s infinite steps(8);\n          animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n            transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n            transform: rotate(360deg);\n  }\n}\n\n@keyframes fa-spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n            transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(360deg);\n            transform: rotate(360deg);\n  }\n}\n.fa-rotate-90 {\n  -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)\";\n  -webkit-transform: rotate(90deg);\n          transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n  -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)\";\n  -webkit-transform: rotate(180deg);\n          transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n  -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)\";\n  -webkit-transform: rotate(270deg);\n          transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n  -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)\";\n  -webkit-transform: scale(-1, 1);\n          transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n  -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\";\n  -webkit-transform: scale(1, -1);\n          transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n  -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\";\n  -webkit-transform: scale(-1, -1);\n          transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n  -webkit-filter: none;\n          filter: none;\n}\n\n.fa-stack {\n  display: inline-block;\n  height: 2em;\n  position: relative;\n  width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n  bottom: 0;\n  left: 0;\n  margin: auto;\n  position: absolute;\n  right: 0;\n  top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n  height: 1em;\n  width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n  height: 2em;\n  width: 2.5em;\n}\n\n.fa-inverse {\n  color: #fff;\n}\n\n.sr-only {\n  border: 0;\n  clip: rect(0, 0, 0, 0);\n  height: 1px;\n  margin: -1px;\n  overflow: hidden;\n  padding: 0;\n  position: absolute;\n  width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n  clip: auto;\n  height: auto;\n  margin: 0;\n  overflow: visible;\n  position: static;\n  width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n  fill: var(--fa-primary-color, currentColor);\n  opacity: 1;\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n  fill: var(--fa-secondary-color, currentColor);\n  opacity: 0.4;\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n  opacity: 0.4;\n  opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n  opacity: 1;\n  opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n  fill: black;\n}\n\n.fad.fa-inverse {\n  color: #fff;\n}";
  
  function css() {
    var dfp = DEFAULT_FAMILY_PREFIX;
    var drc = DEFAULT_REPLACEMENT_CLASS;
    var fp = config.familyPrefix;
    var rc = config.replacementClass;
    var s = baseStyles;
  
    if (fp !== dfp || rc !== drc) {
      var dPatt = new RegExp("\\.".concat(dfp, "\\-"), 'g');
      var customPropPatt = new RegExp("\\--".concat(dfp, "\\-"), 'g');
      var rPatt = new RegExp("\\.".concat(drc), 'g');
      s = s.replace(dPatt, ".".concat(fp, "-")).replace(customPropPatt, "--".concat(fp, "-")).replace(rPatt, ".".concat(rc));
    }
  
    return s;
  }
  
  var Library = /*#__PURE__*/function () {
    function Library() {
      _classCallCheck(this, Library);
  
      this.definitions = {};
    }
  
    _createClass(Library, [{
      key: "add",
      value: function add() {
        var _this = this;
  
        for (var _len = arguments.length, definitions = new Array(_len), _key = 0; _key < _len; _key++) {
          definitions[_key] = arguments[_key];
        }
  
        var additions = definitions.reduce(this._pullDefinitions, {});
        Object.keys(additions).forEach(function (key) {
          _this.definitions[key] = _objectSpread({}, _this.definitions[key] || {}, additions[key]);
          defineIcons(key, additions[key]);
          build();
        });
      }
    }, {
      key: "reset",
      value: function reset() {
        this.definitions = {};
      }
    }, {
      key: "_pullDefinitions",
      value: function _pullDefinitions(additions, definition) {
        var normalized = definition.prefix && definition.iconName && definition.icon ? {
          0: definition
        } : definition;
        Object.keys(normalized).map(function (key) {
          var _normalized$key = normalized[key],
              prefix = _normalized$key.prefix,
              iconName = _normalized$key.iconName,
              icon = _normalized$key.icon;
          if (!additions[prefix]) additions[prefix] = {};
          additions[prefix][iconName] = icon;
        });
        return additions;
      }
    }]);
  
    return Library;
  }();
  
  function ensureCss() {
    if (config.autoAddCss && !_cssInserted) {
      insertCss(css());
      _cssInserted = true;
    }
  }
  
  function apiObject(val, abstractCreator) {
    Object.defineProperty(val, 'abstract', {
      get: abstractCreator
    });
    Object.defineProperty(val, 'html', {
      get: function get() {
        return val.abstract.map(function (a) {
          return toHtml(a);
        });
      }
    });
    Object.defineProperty(val, 'node', {
      get: function get() {
        if (!IS_DOM) return;
        var container = DOCUMENT.createElement('div');
        container.innerHTML = val.html;
        return container.children;
      }
    });
    return val;
  }
  
  function findIconDefinition(iconLookup) {
    var _iconLookup$prefix = iconLookup.prefix,
        prefix = _iconLookup$prefix === void 0 ? 'fa' : _iconLookup$prefix,
        iconName = iconLookup.iconName;
    if (!iconName) return;
    return iconFromMapping(library.definitions, prefix, iconName) || iconFromMapping(namespace.styles, prefix, iconName);
  }
  
  function resolveIcons(next) {
    return function (maybeIconDefinition) {
      var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var iconDefinition = (maybeIconDefinition || {}).icon ? maybeIconDefinition : findIconDefinition(maybeIconDefinition || {});
      var mask = params.mask;
  
      if (mask) {
        mask = (mask || {}).icon ? mask : findIconDefinition(mask || {});
      }
  
      return next(iconDefinition, _objectSpread({}, params, {
        mask: mask
      }));
    };
  }
  
  var library = new Library();
  
  var _cssInserted = false;
  var parse = {
    transform: function transform(transformString) {
      return parseTransformString(transformString);
    }
  };
  var icon = resolveIcons(function (iconDefinition) {
    var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    var _params$transform = params.transform,
        transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
        _params$symbol = params.symbol,
        symbol = _params$symbol === void 0 ? false : _params$symbol,
        _params$mask = params.mask,
        mask = _params$mask === void 0 ? null : _params$mask,
        _params$maskId = params.maskId,
        maskId = _params$maskId === void 0 ? null : _params$maskId,
        _params$title = params.title,
        title = _params$title === void 0 ? null : _params$title,
        _params$titleId = params.titleId,
        titleId = _params$titleId === void 0 ? null : _params$titleId,
        _params$classes = params.classes,
        classes = _params$classes === void 0 ? [] : _params$classes,
        _params$attributes = params.attributes,
        attributes = _params$attributes === void 0 ? {} : _params$attributes,
        _params$styles = params.styles,
        styles = _params$styles === void 0 ? {} : _params$styles;
    if (!iconDefinition) return;
    var prefix = iconDefinition.prefix,
        iconName = iconDefinition.iconName,
        icon = iconDefinition.icon;
    return apiObject(_objectSpread({
      type: 'icon'
    }, iconDefinition), function () {
      ensureCss();
  
      if (config.autoA11y) {
        if (title) {
          attributes['aria-labelledby'] = "".concat(config.replacementClass, "-title-").concat(titleId || nextUniqueId());
        } else {
          attributes['aria-hidden'] = 'true';
          attributes['focusable'] = 'false';
        }
      }
  
      return makeInlineSvgAbstract({
        icons: {
          main: asFoundIcon(icon),
          mask: mask ? asFoundIcon(mask.icon) : {
            found: false,
            width: null,
            height: null,
            icon: {}
          }
        },
        prefix: prefix,
        iconName: iconName,
        transform: _objectSpread({}, meaninglessTransform, transform),
        symbol: symbol,
        title: title,
        maskId: maskId,
        titleId: titleId,
        extra: {
          attributes: attributes,
          styles: styles,
          classes: classes
        }
      });
    });
  });
  
  function ownKeys$1(object, enumerableOnly) {
    var keys = Object.keys(object);
  
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
      enumerableOnly && (symbols = symbols.filter(function (sym) {
        return Object.getOwnPropertyDescriptor(object, sym).enumerable;
      })), keys.push.apply(keys, symbols);
    }
  
    return keys;
  }
  
  function _objectSpread2$1(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = null != arguments[i] ? arguments[i] : {};
      i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
        _defineProperty$1(target, key, source[key]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  
    return target;
  }
  
  function _typeof(obj) {
    "@babel/helpers - typeof";
  
    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
      return typeof obj;
    } : function (obj) {
      return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
    }, _typeof(obj);
  }
  
  function _defineProperty$1(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
  
    return obj;
  }
  
  function _objectWithoutPropertiesLoose$1(source, excluded) {
    if (source == null) return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
  
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      target[key] = source[key];
    }
  
    return target;
  }
  
  function _objectWithoutProperties(source, excluded) {
    if (source == null) return {};
  
    var target = _objectWithoutPropertiesLoose$1(source, excluded);
  
    var key, i;
  
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
  
      for (i = 0; i < sourceSymbolKeys.length; i++) {
        key = sourceSymbolKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
  
    return target;
  }
  
  function _toConsumableArray(arr) {
    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  }
  
  function _arrayWithoutHoles(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  }
  
  function _iterableToArray(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  
  function _unsupportedIterableToArray(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _arrayLikeToArray(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  }
  
  function _arrayLikeToArray(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
  
    for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
  
    return arr2;
  }
  
  function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  } // Get CSS class list from a props object
  
  
  function classList(props) {
    var _classes;
  
    var beat = props.beat,
        fade = props.fade,
        flash = props.flash,
        spin = props.spin,
        spinPulse = props.spinPulse,
        spinReverse = props.spinReverse,
        pulse = props.pulse,
        fixedWidth = props.fixedWidth,
        inverse = props.inverse,
        border = props.border,
        listItem = props.listItem,
        flip = props.flip,
        size = props.size,
        rotation = props.rotation,
        pull = props.pull; // map of CSS class names to properties
  
    var classes = (_classes = {
      'fa-beat': beat,
      'fa-fade': fade,
      'fa-flash': flash,
      'fa-spin': spin,
      'fa-spin-reverse': spinReverse,
      'fa-spin-pulse': spinPulse,
      'fa-pulse': pulse,
      'fa-fw': fixedWidth,
      'fa-inverse': inverse,
      'fa-border': border,
      'fa-li': listItem,
      'fa-flip-horizontal': flip === 'horizontal' || flip === 'both',
      'fa-flip-vertical': flip === 'vertical' || flip === 'both'
    }, _defineProperty$1(_classes, "fa-".concat(size), typeof size !== 'undefined' && size !== null), _defineProperty$1(_classes, "fa-rotate-".concat(rotation), typeof rotation !== 'undefined' && rotation !== null && rotation !== 0), _defineProperty$1(_classes, "fa-pull-".concat(pull), typeof pull !== 'undefined' && pull !== null), _defineProperty$1(_classes, 'fa-swap-opacity', props.swapOpacity), _classes); // map over all the keys in the classes object
    // return an array of the keys where the value for the key is not null
  
    return Object.keys(classes).map(function (key) {
      return classes[key] ? key : null;
    }).filter(function (key) {
      return key;
    });
  } // Camelize taken from humps
  // humps is copyright © 2012+ Dom Christie
  // Released under the MIT license.
  // Performant way to determine if object coerces to a number
  
  
  function _isNumerical(obj) {
    obj = obj - 0; // eslint-disable-next-line no-self-compare
  
    return obj === obj;
  }
  
  function camelize(string) {
    if (_isNumerical(string)) {
      return string;
    } // eslint-disable-next-line no-useless-escape
  
  
    string = string.replace(/[\-_\s]+(.)?/g, function (match, chr) {
      return chr ? chr.toUpperCase() : '';
    }); // Ensure 1st char is always lowercase
  
    return string.substr(0, 1).toLowerCase() + string.substr(1);
  }
  
  var _excluded$1$1 = ["style"];
  
  function capitalize(val) {
    return val.charAt(0).toUpperCase() + val.slice(1);
  }
  
  function styleToObject(style) {
    return style.split(';').map(function (s) {
      return s.trim();
    }).filter(function (s) {
      return s;
    }).reduce(function (acc, pair) {
      var i = pair.indexOf(':');
      var prop = camelize(pair.slice(0, i));
      var value = pair.slice(i + 1).trim();
      prop.startsWith('webkit') ? acc[capitalize(prop)] = value : acc[prop] = value;
      return acc;
    }, {});
  }
  
  function convert(createElement, element) {
    var extraProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  
    if (typeof element === 'string') {
      return element;
    }
  
    var children = (element.children || []).map(function (child) {
      return convert(createElement, child);
    });
    /* eslint-disable dot-notation */
  
    var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {
      var val = element.attributes[key];
  
      switch (key) {
        case 'class':
          acc.attrs['className'] = val;
          delete element.attributes['class'];
          break;
  
        case 'style':
          acc.attrs['style'] = styleToObject(val);
          break;
  
        default:
          if (key.indexOf('aria-') === 0 || key.indexOf('data-') === 0) {
            acc.attrs[key.toLowerCase()] = val;
          } else {
            acc.attrs[camelize(key)] = val;
          }
  
      }
  
      return acc;
    }, {
      attrs: {}
    });
  
    var _extraProps$style = extraProps.style,
        existingStyle = _extraProps$style === void 0 ? {} : _extraProps$style,
        remaining = _objectWithoutProperties(extraProps, _excluded$1$1);
  
    mixins.attrs['style'] = _objectSpread2$1(_objectSpread2$1({}, mixins.attrs['style']), existingStyle);
    /* eslint-enable */
  
    return createElement.apply(void 0, [element.tag, _objectSpread2$1(_objectSpread2$1({}, mixins.attrs), remaining)].concat(_toConsumableArray(children)));
  }
  
  var PRODUCTION = false;
  
  try {
    PRODUCTION = process.env.NODE_ENV === 'production';
  } catch (e) {}
  
  function log() {
    if (!PRODUCTION && console && typeof console.error === 'function') {
      var _console;
  
      (_console = console).error.apply(_console, arguments);
    }
  }
  
  function normalizeIconArgs(icon) {
    // this has everything that it needs to be rendered which means it was probably imported
    // directly from an icon svg package
    if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
      return icon;
    }
  
  
    if (icon === null) {
      return null;
    } // if the icon is an object and has a prefix and an icon name, return it
  
  
    if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName) {
      return icon;
    } // if it's an array with length of two
  
  
    if (Array.isArray(icon) && icon.length === 2) {
      // use the first item as prefix, second as icon name
      return {
        prefix: icon[0],
        iconName: icon[1]
      };
    } // if it's a string, use it as the icon name
  
  
    if (typeof icon === 'string') {
      return {
        prefix: 'fas',
        iconName: icon
      };
    }
  } // creates an object with a key of key
  // and a value of value
  // if certain conditions are met
  
  
  function objectWithKey(key, value) {
    // if the value is a non-empty array
    // or it's not an array but it is truthy
    // then create the object with the key and the value
    // if not, return an empty array
    return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty$1({}, key, value) : {};
  }
  
  var _excluded$2 = ["forwardedRef"];
  
  function FontAwesomeIcon(_ref) {
    var forwardedRef = _ref.forwardedRef,
        props = _objectWithoutProperties(_ref, _excluded$2);
  
    var iconArgs = props.icon,
        maskArgs = props.mask,
        symbol = props.symbol,
        className = props.className,
        title = props.title,
        titleId = props.titleId;
    var iconLookup = normalizeIconArgs(iconArgs);
    var classes = objectWithKey('classes', [].concat(_toConsumableArray(classList(props)), _toConsumableArray(className.split(' '))));
    var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
    var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
    var renderedIcon = icon(iconLookup, _objectSpread2$1(_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, classes), transform), mask), {}, {
      symbol: symbol,
      title: title,
      titleId: titleId
    }));
  
    if (!renderedIcon) {
      log('Could not find icon', iconLookup);
      return null;
    }
  
    var abstract = renderedIcon.abstract;
    var extraProps = {
      ref: forwardedRef
    };
    Object.keys(props).forEach(function (key) {
      // eslint-disable-next-line no-prototype-builtins
      if (!FontAwesomeIcon.defaultProps.hasOwnProperty(key)) {
        extraProps[key] = props[key];
      }
    });
    return convertCurry(abstract[0], extraProps);
  }
  
  FontAwesomeIcon.displayName = 'FontAwesomeIcon';
  FontAwesomeIcon.propTypes = {
    beat: PropTypes.bool,
    border: PropTypes.bool,
    className: PropTypes.string,
    fade: PropTypes.bool,
    flash: PropTypes.bool,
    mask: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),
    fixedWidth: PropTypes.bool,
    inverse: PropTypes.bool,
    flip: PropTypes.oneOf(['horizontal', 'vertical', 'both']),
    icon: PropTypes.oneOfType([PropTypes.object, PropTypes.array, PropTypes.string]),
    listItem: PropTypes.bool,
    pull: PropTypes.oneOf(['right', 'left']),
    pulse: PropTypes.bool,
    rotation: PropTypes.oneOf([0, 90, 180, 270]),
    size: PropTypes.oneOf(['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x']),
    spin: PropTypes.bool,
    spinPulse: PropTypes.bool,
    spinReverse: PropTypes.bool,
    symbol: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
    title: PropTypes.string,
    transform: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
    swapOpacity: PropTypes.bool
  };
  FontAwesomeIcon.defaultProps = {
    border: false,
    className: '',
    mask: null,
    fixedWidth: false,
    inverse: false,
    flip: null,
    icon: null,
    listItem: false,
    pull: null,
    pulse: false,
    rotation: null,
    size: null,
    spin: false,
    symbol: false,
    title: '',
    transform: null,
    swapOpacity: false
  };
  var convertCurry = convert.bind(null, React__default["default"].createElement);
  
  var faAngleDoubleDown = {};
  
  (function (exports) {
  
  Object.defineProperty(exports, '__esModule', {
    value: true
  });
  var prefix = 'fas';
  var iconName = 'angle-double-down';
  var width = 320;
  var height = 512;
  var ligatures = [];
  var unicode = 'f103';
  var svgPathData = 'M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z';
  exports.definition = {
    prefix: prefix,
    iconName: iconName,
    icon: [width, height, ligatures, unicode, svgPathData]
  };
  exports.faAngleDoubleDown = exports.definition;
  exports.prefix = prefix;
  exports.iconName = iconName;
  exports.width = width;
  exports.height = height;
  exports.ligatures = ligatures;
  exports.unicode = unicode;
  exports.svgPathData = svgPathData;
  }(faAngleDoubleDown));
  
  var COMPLETE = 'complete',
      CANCELED = 'canceled';
  
  function raf(task) {
    if ('requestAnimationFrame' in window) {
      return window.requestAnimationFrame(task);
    }
  
    setTimeout(task, 16);
  }
  
  function setElementScroll(element, x, y) {
  
    if (element.self === element) {
      element.scrollTo(x, y);
    } else {
      element.scrollLeft = x;
      element.scrollTop = y;
    }
  }
  
  function getTargetScrollLocation(scrollSettings, parent) {
    var align = scrollSettings.align,
        target = scrollSettings.target,
        targetPosition = target.getBoundingClientRect(),
        parentPosition,
        x,
        y,
        differenceX,
        differenceY,
        targetWidth,
        targetHeight,
        leftAlign = align && align.left != null ? align.left : 0.5,
        topAlign = align && align.top != null ? align.top : 0.5,
        leftOffset = align && align.leftOffset != null ? align.leftOffset : 0,
        topOffset = align && align.topOffset != null ? align.topOffset : 0,
        leftScalar = leftAlign,
        topScalar = topAlign;
  
    if (scrollSettings.isWindow(parent)) {
      targetWidth = Math.min(targetPosition.width, parent.innerWidth);
      targetHeight = Math.min(targetPosition.height, parent.innerHeight);
      x = targetPosition.left + parent.pageXOffset - parent.innerWidth * leftScalar + targetWidth * leftScalar;
      y = targetPosition.top + parent.pageYOffset - parent.innerHeight * topScalar + targetHeight * topScalar;
      x -= leftOffset;
      y -= topOffset;
      x = scrollSettings.align.lockX ? parent.pageXOffset : x;
      y = scrollSettings.align.lockY ? parent.pageYOffset : y;
      differenceX = x - parent.pageXOffset;
      differenceY = y - parent.pageYOffset;
    } else {
      targetWidth = targetPosition.width;
      targetHeight = targetPosition.height;
      parentPosition = parent.getBoundingClientRect();
      var offsetLeft = targetPosition.left - (parentPosition.left - parent.scrollLeft);
      var offsetTop = targetPosition.top - (parentPosition.top - parent.scrollTop);
      x = offsetLeft + targetWidth * leftScalar - parent.clientWidth * leftScalar;
      y = offsetTop + targetHeight * topScalar - parent.clientHeight * topScalar;
      x -= leftOffset;
      y -= topOffset;
      x = Math.max(Math.min(x, parent.scrollWidth - parent.clientWidth), 0);
      y = Math.max(Math.min(y, parent.scrollHeight - parent.clientHeight), 0);
      x = scrollSettings.align.lockX ? parent.scrollLeft : x;
      y = scrollSettings.align.lockY ? parent.scrollTop : y;
      differenceX = x - parent.scrollLeft;
      differenceY = y - parent.scrollTop;
    }
  
    return {
      x: x,
      y: y,
      differenceX: differenceX,
      differenceY: differenceY
    };
  }
  
  function animate(parent) {
    var scrollSettings = parent._scrollSettings;
  
    if (!scrollSettings) {
      return;
    }
  
    var maxSynchronousAlignments = scrollSettings.maxSynchronousAlignments;
    var location = getTargetScrollLocation(scrollSettings, parent),
        time = Date.now() - scrollSettings.startTime,
        timeValue = Math.min(1 / scrollSettings.time * time, 1);
  
    if (scrollSettings.endIterations >= maxSynchronousAlignments) {
      setElementScroll(parent, location.x, location.y);
      parent._scrollSettings = null;
      return scrollSettings.end(COMPLETE);
    }
  
    var easeValue = 1 - scrollSettings.ease(timeValue);
    setElementScroll(parent, location.x - location.differenceX * easeValue, location.y - location.differenceY * easeValue);
  
    if (time >= scrollSettings.time) {
      scrollSettings.endIterations++; // Align ancestor synchronously
  
      scrollSettings.scrollAncestor && animate(scrollSettings.scrollAncestor);
      animate(parent);
      return;
    }
  
    raf(animate.bind(null, parent));
  }
  
  function defaultIsWindow(target) {
    return target.self === target;
  }
  
  function transitionScrollTo(target, parent, settings, scrollAncestor, callback) {
    var idle = !parent._scrollSettings,
        lastSettings = parent._scrollSettings,
        now = Date.now(),
        cancelHandler,
        passiveOptions = {
      passive: true
    };
  
    if (lastSettings) {
      lastSettings.end(CANCELED);
    }
  
    function end(endType) {
      parent._scrollSettings = null;
  
      if (parent.parentElement && parent.parentElement._scrollSettings) {
        parent.parentElement._scrollSettings.end(endType);
      }
  
      if (settings.debug) {
        console.log('Scrolling ended with type', endType, 'for', parent);
      }
  
      callback(endType);
  
      if (cancelHandler) {
        parent.removeEventListener('touchstart', cancelHandler, passiveOptions);
        parent.removeEventListener('wheel', cancelHandler, passiveOptions);
      }
    }
  
    var maxSynchronousAlignments = settings.maxSynchronousAlignments;
  
    if (maxSynchronousAlignments == null) {
      maxSynchronousAlignments = 3;
    }
  
    parent._scrollSettings = {
      startTime: now,
      endIterations: 0,
      target: target,
      time: settings.time,
      ease: settings.ease,
      align: settings.align,
      isWindow: settings.isWindow || defaultIsWindow,
      maxSynchronousAlignments: maxSynchronousAlignments,
      end: end,
      scrollAncestor
    };
  
    if (!('cancellable' in settings) || settings.cancellable) {
      cancelHandler = end.bind(null, CANCELED);
      parent.addEventListener('touchstart', cancelHandler, passiveOptions);
      parent.addEventListener('wheel', cancelHandler, passiveOptions);
    }
  
    if (idle) {
      animate(parent);
    }
  
    return cancelHandler;
  }
  
  function defaultIsScrollable(element) {
    return 'pageXOffset' in element || (element.scrollHeight !== element.clientHeight || element.scrollWidth !== element.clientWidth) && getComputedStyle(element).overflow !== 'hidden';
  }
  
  function defaultValidTarget() {
    return true;
  }
  
  function findParentElement(el) {
    if (el.assignedSlot) {
      return findParentElement(el.assignedSlot);
    }
  
    if (el.parentElement) {
      if (el.parentElement.tagName === 'BODY') {
        return el.parentElement.ownerDocument.defaultView || el.parentElement.ownerDocument.ownerWindow;
      }
  
      return el.parentElement;
    }
  
    if (el.getRootNode) {
      var parent = el.getRootNode();
  
      if (parent.nodeType === 11) {
        return parent.host;
      }
    }
  }
  
  var scrollIntoView = function (target, settings, callback) {
    if (!target) {
      return;
    }
  
    if (typeof settings === 'function') {
      callback = settings;
      settings = null;
    }
  
    if (!settings) {
      settings = {};
    }
  
    settings.time = isNaN(settings.time) ? 1000 : settings.time;
  
    settings.ease = settings.ease || function (v) {
      return 1 - Math.pow(1 - v, v / 2);
    };
  
    settings.align = settings.align || {};
    var parent = findParentElement(target),
        parents = 1;
  
    function done(endType) {
      parents--;
  
      if (!parents) {
        callback && callback(endType);
      }
    }
  
    var validTarget = settings.validTarget || defaultValidTarget;
    var isScrollable = settings.isScrollable;
  
    if (settings.debug) {
      console.log('About to scroll to', target);
  
      if (!parent) {
        console.error('Target did not have a parent, is it mounted in the DOM?');
      }
    }
  
    var scrollingElements = [];
  
    while (parent) {
      if (settings.debug) {
        console.log('Scrolling parent node', parent);
      }
  
      if (validTarget(parent, parents) && (isScrollable ? isScrollable(parent, defaultIsScrollable) : defaultIsScrollable(parent))) {
        parents++;
        scrollingElements.push(parent);
      }
  
      parent = findParentElement(parent);
  
      if (!parent) {
        done(COMPLETE);
        break;
      }
    }
  
    return scrollingElements.reduce((cancel, parent, index) => transitionScrollTo(target, parent, settings, scrollingElements[index + 1], done), null);
  };
  
  function getBasePlacement(placement) {
    return placement.split('-')[0];
  }
  
  function getAlignment(placement) {
    return placement.split('-')[1];
  }
  
  function getMainAxisFromPlacement(placement) {
    return ['top', 'bottom'].includes(getBasePlacement(placement)) ? 'x' : 'y';
  }
  
  function getLengthFromAxis(axis) {
    return axis === 'y' ? 'height' : 'width';
  }
  
  function computeCoordsFromPlacement(_ref) {
    let {
      reference,
      floating,
      placement
    } = _ref;
    const commonX = reference.x + reference.width / 2 - floating.width / 2;
    const commonY = reference.y + reference.height / 2 - floating.height / 2;
    let coords;
  
    switch (getBasePlacement(placement)) {
      case 'top':
        coords = {
          x: commonX,
          y: reference.y - floating.height
        };
        break;
  
      case 'bottom':
        coords = {
          x: commonX,
          y: reference.y + reference.height
        };
        break;
  
      case 'right':
        coords = {
          x: reference.x + reference.width,
          y: commonY
        };
        break;
  
      case 'left':
        coords = {
          x: reference.x - floating.width,
          y: commonY
        };
        break;
  
      default:
        coords = {
          x: reference.x,
          y: reference.y
        };
    }
  
    const mainAxis = getMainAxisFromPlacement(placement);
    const length = getLengthFromAxis(mainAxis);
  
    switch (getAlignment(placement)) {
      case 'start':
        coords[mainAxis] = coords[mainAxis] - (reference[length] / 2 - floating[length] / 2);
        break;
  
      case 'end':
        coords[mainAxis] = coords[mainAxis] + (reference[length] / 2 - floating[length] / 2);
        break;
    }
  
    return coords;
  }
  
  const computePosition$1 = async (reference, floating, config) => {
    const {
      placement = 'bottom',
      strategy = 'absolute',
      middleware = [],
      platform
    } = config;
  
    if (process.env.NODE_ENV !== "production") {
      if (platform == null) {
        console.error(['Floating UI: `platform` property was not passed to config. If you', 'want to use Floating UI on the web, install @floating-ui/dom', 'instead of the /core package. Otherwise, you can create your own', '`platform`: https://floating-ui.com/docs/platform'].join(' '));
      }
  
      if (middleware.filter(_ref => {
        let {
          name
        } = _ref;
        return name === 'autoPlacement' || name === 'flip';
      }).length > 1) {
        throw new Error(['Floating UI: duplicate `flip` and/or `autoPlacement`', 'middleware detected. This will lead to an infinite loop. Ensure only', 'one of either has been passed to the `middleware` array.'].join(' '));
      }
    }
  
    let rects = await platform.getElementRects({
      reference,
      floating,
      strategy
    });
    let {
      x,
      y
    } = computeCoordsFromPlacement({ ...rects,
      placement
    });
    let statefulPlacement = placement;
    let middlewareData = {};
    let _debug_loop_count_ = 0;
  
    for (let i = 0; i < middleware.length; i++) {
      if (process.env.NODE_ENV !== "production") {
        _debug_loop_count_++;
  
        if (_debug_loop_count_ > 100) {
          throw new Error(['Floating UI: The middleware lifecycle appears to be', 'running in an infinite loop. This is usually caused by a `reset`', 'continually being returned without a break condition.'].join(' '));
        }
      }
  
      const {
        name,
        fn
      } = middleware[i];
      const {
        x: nextX,
        y: nextY,
        data,
        reset
      } = await fn({
        x,
        y,
        initialPlacement: placement,
        placement: statefulPlacement,
        strategy,
        middlewareData,
        rects,
        platform,
        elements: {
          reference,
          floating
        }
      });
      x = nextX != null ? nextX : x;
      y = nextY != null ? nextY : y;
      middlewareData = { ...middlewareData,
        [name]: data != null ? data : {}
      };
  
      if (reset) {
        if (typeof reset === 'object') {
          if (reset.placement) {
            statefulPlacement = reset.placement;
          }
  
          if (reset.rects) {
            rects = reset.rects === true ? await platform.getElementRects({
              reference,
              floating,
              strategy
            }) : reset.rects;
          }
  
          ({
            x,
            y
          } = computeCoordsFromPlacement({ ...rects,
            placement: statefulPlacement
          }));
        }
  
        i = -1;
        continue;
      }
    }
  
    return {
      x,
      y,
      placement: statefulPlacement,
      strategy,
      middlewareData
    };
  };
  
  function expandPaddingObject(padding) {
    return {
      top: 0,
      right: 0,
      bottom: 0,
      left: 0,
      ...padding
    };
  }
  
  function getSideObjectFromPadding(padding) {
    return typeof padding !== 'number' ? expandPaddingObject(padding) : {
      top: padding,
      right: padding,
      bottom: padding,
      left: padding
    };
  }
  
  function rectToClientRect(rect) {
    return { ...rect,
      top: rect.y,
      left: rect.x,
      right: rect.x + rect.width,
      bottom: rect.y + rect.height
    };
  }
  
  async function detectOverflow(middlewareArguments, options) {
    if (options === void 0) {
      options = {};
    }
  
    const {
      x,
      y,
      platform,
      rects,
      elements,
      strategy
    } = middlewareArguments;
    const {
      boundary = 'clippingParents',
      rootBoundary = 'viewport',
      elementContext = 'floating',
      altBoundary = false,
      padding = 0
    } = options;
    const paddingObject = getSideObjectFromPadding(padding);
    const altContext = elementContext === 'floating' ? 'reference' : 'floating';
    const element = elements[altBoundary ? altContext : elementContext];
    const clippingClientRect = await platform.getClippingClientRect({
      element: (await platform.isElement(element)) ? element : element.contextElement || (await platform.getDocumentElement({
        element: elements.floating
      })),
      boundary,
      rootBoundary
    });
    const elementClientRect = rectToClientRect(await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
      rect: elementContext === 'floating' ? { ...rects.floating,
        x,
        y
      } : rects.reference,
      offsetParent: await platform.getOffsetParent({
        element: elements.floating
      }),
      strategy
    })); // positive = overflowing the clipping rect
    // 0 or negative = within the clipping rect
  
    return {
      top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
      bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
      left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
      right: elementClientRect.right - clippingClientRect.right + paddingObject.right
    };
  }
  
  const min$2 = Math.min;
  const max$2 = Math.max;
  
  function within(min$1, value, max$1) {
    return max$2(min$1, min$2(value, max$1));
  }
  
  function getCrossAxis(axis) {
    return axis === 'x' ? 'y' : 'x';
  }
  
  const shift = function (options) {
    if (options === void 0) {
      options = {};
    }
  
    return {
      name: 'shift',
      options,
  
      async fn(middlewareArguments) {
        const {
          x,
          y,
          placement
        } = middlewareArguments;
        const {
          mainAxis: checkMainAxis = true,
          crossAxis: checkCrossAxis = false,
          limiter = {
            fn: _ref => {
              let {
                x,
                y
              } = _ref;
              return {
                x,
                y
              };
            }
          },
          ...detectOverflowOptions
        } = options;
        const coords = {
          x,
          y
        };
        const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
        const mainAxis = getMainAxisFromPlacement(getBasePlacement(placement));
        const crossAxis = getCrossAxis(mainAxis);
        let mainAxisCoord = coords[mainAxis];
        let crossAxisCoord = coords[crossAxis];
  
        if (checkMainAxis) {
          const minSide = mainAxis === 'y' ? 'top' : 'left';
          const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
          const min = mainAxisCoord + overflow[minSide];
          const max = mainAxisCoord - overflow[maxSide];
          mainAxisCoord = within(min, mainAxisCoord, max);
        }
  
        if (checkCrossAxis) {
          const minSide = crossAxis === 'y' ? 'top' : 'left';
          const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
          const min = crossAxisCoord + overflow[minSide];
          const max = crossAxisCoord - overflow[maxSide];
          crossAxisCoord = within(min, crossAxisCoord, max);
        }
  
        const limitedCoords = limiter.fn({ ...middlewareArguments,
          [mainAxis]: mainAxisCoord,
          [crossAxis]: crossAxisCoord
        });
        return { ...limitedCoords,
          data: {
            x: limitedCoords.x - x,
            y: limitedCoords.y - y
          }
        };
      }
  
    };
  };
  
  const size = function (options) {
    if (options === void 0) {
      options = {};
    }
  
    return {
      name: 'size',
      options,
  
      async fn(middlewareArguments) {
        var _middlewareData$size;
  
        const {
          placement,
          rects,
          middlewareData
        } = middlewareArguments;
        const {
          apply,
          ...detectOverflowOptions
        } = options;
  
        if ((_middlewareData$size = middlewareData.size) != null && _middlewareData$size.skip) {
          return {};
        }
  
        const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);
        const basePlacement = getBasePlacement(placement);
        const isEnd = getAlignment(placement) === 'end';
        let heightSide;
        let widthSide;
  
        if (basePlacement === 'top' || basePlacement === 'bottom') {
          heightSide = basePlacement;
          widthSide = isEnd ? 'left' : 'right';
        } else {
          widthSide = basePlacement;
          heightSide = isEnd ? 'top' : 'bottom';
        }
  
        const xMin = max$2(overflow.left, 0);
        const xMax = max$2(overflow.right, 0);
        const yMin = max$2(overflow.top, 0);
        const yMax = max$2(overflow.bottom, 0);
        const dimensions = {
          height: rects.floating.height - (['left', 'right'].includes(placement) ? 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$2(overflow.top, overflow.bottom)) : overflow[heightSide]),
          width: rects.floating.width - (['top', 'bottom'].includes(placement) ? 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$2(overflow.left, overflow.right)) : overflow[widthSide])
        };
        apply == null ? void 0 : apply({ ...dimensions,
          ...rects
        });
        return {
          data: {
            skip: true
          },
          reset: {
            rects: true
          }
        };
      }
  
    };
  };
  
  function isWindow(value) {
    return (value == null ? void 0 : value.toString()) === '[object Window]';
  }
  
  function getWindow(node) {
    if (node == null) {
      return window;
    }
  
    if (!isWindow(node)) {
      const ownerDocument = node.ownerDocument;
      return ownerDocument ? ownerDocument.defaultView || window : window;
    }
  
    return node;
  }
  
  function getComputedStyle$1(element) {
    return getWindow(element).getComputedStyle(element);
  }
  
  function getNodeName(node) {
    return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
  }
  
  function isHTMLElement(value) {
    return value instanceof getWindow(value).HTMLElement;
  }
  
  function isElement(value) {
    return value instanceof getWindow(value).Element;
  }
  
  function isNode(value) {
    return value instanceof getWindow(value).Node;
  }
  
  function isShadowRoot(node) {
    const OwnElement = getWindow(node).ShadowRoot;
    return node instanceof OwnElement || node instanceof ShadowRoot;
  }
  
  function isScrollParent(element) {
    // Firefox wants us to check `-x` and `-y` variations as well
    const {
      overflow,
      overflowX,
      overflowY
    } = getComputedStyle$1(element);
    return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
  }
  
  function isTableElement(element) {
    return ['table', 'td', 'th'].includes(getNodeName(element));
  }
  
  function isContainingBlock(element) {
    // TODO: Try and use feature detection here instead
    const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
    const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
    // create a containing block.
    // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
  
    return css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
  }
  
  const min$1 = Math.min;
  const max$1 = Math.max;
  const round = Math.round;
  
  function getBoundingClientRect(element, includeScale) {
    if (includeScale === void 0) {
      includeScale = false;
    }
  
    const clientRect = element.getBoundingClientRect();
    let scaleX = 1;
    let scaleY = 1;
  
    if (includeScale && isHTMLElement(element)) {
      scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
      scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
    }
  
    return {
      width: clientRect.width / scaleX,
      height: clientRect.height / scaleY,
      top: clientRect.top / scaleY,
      right: clientRect.right / scaleX,
      bottom: clientRect.bottom / scaleY,
      left: clientRect.left / scaleX,
      x: clientRect.left / scaleX,
      y: clientRect.top / scaleY
    };
  }
  
  function getDocumentElement(node) {
    return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
  }
  
  function getNodeScroll(element) {
    if (isWindow(element)) {
      return {
        scrollLeft: element.pageXOffset,
        scrollTop: element.pageYOffset
      };
    }
  
    return {
      scrollLeft: element.scrollLeft,
      scrollTop: element.scrollTop
    };
  }
  
  function getWindowScrollBarX(element) {
    // If <html> has a CSS width greater than the viewport, then this will be
    // incorrect for RTL.
    return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
  }
  
  function isScaled(element) {
    const rect = getBoundingClientRect(element);
    return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
  }
  
  function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
    const isOffsetParentAnElement = isHTMLElement(offsetParent);
    const documentElement = getDocumentElement(offsetParent);
    const rect = getBoundingClientRect(element, isOffsetParentAnElement && isScaled(offsetParent));
    let scroll = {
      scrollLeft: 0,
      scrollTop: 0
    };
    const offsets = {
      x: 0,
      y: 0
    };
  
    if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
      if (getNodeName(offsetParent) !== 'body' || isScrollParent(documentElement)) {
        scroll = getNodeScroll(offsetParent);
      }
  
      if (isHTMLElement(offsetParent)) {
        const offsetRect = getBoundingClientRect(offsetParent, true);
        offsets.x = offsetRect.x + offsetParent.clientLeft;
        offsets.y = offsetRect.y + offsetParent.clientTop;
      } else if (documentElement) {
        offsets.x = getWindowScrollBarX(documentElement);
      }
    }
  
    return {
      x: rect.left + scroll.scrollLeft - offsets.x,
      y: rect.top + scroll.scrollTop - offsets.y,
      width: rect.width,
      height: rect.height
    };
  }
  
  function getParentNode(node) {
    if (getNodeName(node) === 'html') {
      return node;
    }
  
    return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
      // @ts-ignore
      node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
      node.parentNode || ( // DOM Element detected
      isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
      getDocumentElement(node) // fallback
  
    );
  }
  
  function getTrueOffsetParent(element) {
    if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
      return null;
    }
  
    return element.offsetParent;
  }
  
  function getContainingBlock(element) {
    let currentNode = getParentNode(element);
  
    while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
      if (isContainingBlock(currentNode)) {
        return currentNode;
      } else {
        currentNode = currentNode.parentNode;
      }
    }
  
    return null;
  } // Gets the closest ancestor positioned element. Handles some edge cases,
  // such as table ancestors and cross browser bugs.
  
  
  function getOffsetParent(element) {
    const window = getWindow(element);
    let offsetParent = getTrueOffsetParent(element);
  
    while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
      offsetParent = getTrueOffsetParent(offsetParent);
    }
  
    if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
      return window;
    }
  
    return offsetParent || getContainingBlock(element) || window;
  }
  
  function getDimensions(element) {
    return {
      width: element.offsetWidth,
      height: element.offsetHeight
    };
  }
  
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
    let {
      rect,
      offsetParent,
      strategy
    } = _ref;
    const isOffsetParentAnElement = isHTMLElement(offsetParent);
    const documentElement = getDocumentElement(offsetParent);
  
    if (offsetParent === documentElement) {
      return rect;
    }
  
    let scroll = {
      scrollLeft: 0,
      scrollTop: 0
    };
    const offsets = {
      x: 0,
      y: 0
    };
  
    if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
      if (getNodeName(offsetParent) !== 'body' || isScrollParent(documentElement)) {
        scroll = getNodeScroll(offsetParent);
      }
  
      if (isHTMLElement(offsetParent)) {
        const offsetRect = getBoundingClientRect(offsetParent, true);
        offsets.x = offsetRect.x + offsetParent.clientLeft;
        offsets.y = offsetRect.y + offsetParent.clientTop;
      } // This doesn't appear to be need to be negated.
      // else if (documentElement) {
      //   offsets.x = getWindowScrollBarX(documentElement);
      // }
  
    }
  
    return { ...rect,
      x: rect.x - scroll.scrollLeft + offsets.x,
      y: rect.y - scroll.scrollTop + offsets.y
    };
  }
  
  function getViewportRect(element) {
    const win = getWindow(element);
    const html = getDocumentElement(element);
    const visualViewport = win.visualViewport;
    let width = html.clientWidth;
    let height = html.clientHeight;
    let x = 0;
    let y = 0;
  
    if (visualViewport) {
      width = visualViewport.width;
      height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
      // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
      // errors due to floating point numbers, so we need to check precision.
      // Safari returns a number <= 0, usually < -1 when pinch-zoomed
  
      if (Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < 0.01) {
        x = visualViewport.offsetLeft;
        y = visualViewport.offsetTop;
      }
    }
  
    return {
      width,
      height,
      x,
      y
    };
  } // of the `<html>` and `<body>` rect bounds if horizontally scrollable
  
  
  function getDocumentRect(element) {
    var _element$ownerDocumen;
  
    const html = getDocumentElement(element);
    const scroll = getNodeScroll(element);
    const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
    const width = max$1(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
    const height = max$1(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
    let x = -scroll.scrollLeft + getWindowScrollBarX(element);
    const y = -scroll.scrollTop;
  
    if (getComputedStyle$1(body || html).direction === 'rtl') {
      x += max$1(html.clientWidth, body ? body.clientWidth : 0) - width;
    }
  
    return {
      width,
      height,
      x,
      y
    };
  }
  
  function getScrollParent(node) {
    if (['html', 'body', '#document'].includes(getNodeName(node))) {
      // @ts-ignore assume body is always available
      return node.ownerDocument.body;
    }
  
    if (isHTMLElement(node) && isScrollParent(node)) {
      return node;
    }
  
    return getScrollParent(getParentNode(node));
  }
  
  function getScrollParents(node, list) {
    var _node$ownerDocument;
  
    if (list === void 0) {
      list = [];
    }
  
    const scrollParent = getScrollParent(node);
    const isBody = scrollParent === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
    const win = getWindow(scrollParent);
    const target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
    const updatedList = list.concat(target);
    return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
    updatedList.concat(getScrollParents(getParentNode(target)));
  }
  
  function contains(parent, child) {
    const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
  
    if (parent.contains(child)) {
      return true;
    } // then fallback to custom implementation with Shadow DOM support
    else if (rootNode && isShadowRoot(rootNode)) {
      let next = child;
  
      do {
        // use `===` replace node.isSameNode()
        if (next && parent === next) {
          return true;
        } // @ts-ignore: need a better way to handle this...
  
  
        next = next.parentNode || next.host;
      } while (next);
    }
  
    return false;
  }
  
  function getInnerBoundingClientRect(element) {
    const clientRect = getBoundingClientRect(element);
    const top = clientRect.top + element.clientTop;
    const left = clientRect.left + element.clientLeft;
    return {
      top,
      left,
      x: left,
      y: top,
      right: left + element.clientWidth,
      bottom: top + element.clientHeight,
      width: element.clientWidth,
      height: element.clientHeight
    };
  }
  
  function getClientRectFromClippingParent(element, clippingParent) {
    if (clippingParent === 'viewport') {
      return rectToClientRect(getViewportRect(element));
    }
  
    if (isElement(clippingParent)) {
      return getInnerBoundingClientRect(clippingParent);
    }
  
    return rectToClientRect(getDocumentRect(getDocumentElement(element)));
  } // A "clipping parent" is an overflowable container with the characteristic of
  // clipping (or hiding) overflowing elements with a position different from
  // `initial`
  
  
  function getClippingParents(element) {
    const clippingParents = getScrollParents(getParentNode(element));
    const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle$1(element).position);
    const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
  
    if (!isElement(clipperElement)) {
      return [];
    } // @ts-ignore isElement check ensures we return Array<Element>
  
  
    return clippingParents.filter(clippingParent => isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body');
  } // Gets the maximum area that the element is visible in due to any number of
  // clipping parents
  
  
  function getClippingClientRect(_ref) {
    let {
      element,
      boundary,
      rootBoundary
    } = _ref;
    const mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
    const clippingParents = [...mainClippingParents, rootBoundary];
    const firstClippingParent = clippingParents[0];
    const clippingRect = clippingParents.reduce((accRect, clippingParent) => {
      const rect = getClientRectFromClippingParent(element, clippingParent);
      accRect.top = max$1(rect.top, accRect.top);
      accRect.right = min$1(rect.right, accRect.right);
      accRect.bottom = min$1(rect.bottom, accRect.bottom);
      accRect.left = max$1(rect.left, accRect.left);
      return accRect;
    }, getClientRectFromClippingParent(element, firstClippingParent));
    clippingRect.width = clippingRect.right - clippingRect.left;
    clippingRect.height = clippingRect.bottom - clippingRect.top;
    clippingRect.x = clippingRect.left;
    clippingRect.y = clippingRect.top;
    return clippingRect;
  }
  
  const platform = {
    getElementRects: _ref => {
      let {
        reference,
        floating,
        strategy
      } = _ref;
      return {
        reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
        floating: { ...getDimensions(floating),
          x: 0,
          y: 0
        }
      };
    },
    convertOffsetParentRelativeRectToViewportRelativeRect: args => convertOffsetParentRelativeRectToViewportRelativeRect(args),
    getOffsetParent: _ref2 => {
      let {
        element
      } = _ref2;
      return getOffsetParent(element);
    },
    isElement: value => isElement(value),
    getDocumentElement: _ref3 => {
      let {
        element
      } = _ref3;
      return getDocumentElement(element);
    },
    getClippingClientRect: args => getClippingClientRect(args),
    getDimensions: _ref4 => {
      let {
        element
      } = _ref4;
      return getDimensions(element);
    },
    getClientRects: _ref5 => {
      let {
        element
      } = _ref5;
      return element.getClientRects();
    }
  };
  
  const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
    platform,
    ...options
  });
  
  var index = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect; // Fork of `fast-deep-equal` that only does the comparisons we need and compares
  // functions
  
  function deepEqual(a, b) {
    if (a === b) {
      return true;
    }
  
    if (typeof a !== typeof b) {
      return false;
    }
  
    if (typeof a === 'function' && a.toString() === b.toString()) {
      return true;
    }
  
    let length, i, keys;
  
    if (a && b && typeof a == 'object') {
      if (Array.isArray(a)) {
        length = a.length;
        if (length != b.length) return false;
  
        for (i = length; i-- !== 0;) {
          if (!deepEqual(a[i], b[i])) {
            return false;
          }
        }
  
        return true;
      }
  
      keys = Object.keys(a);
      length = keys.length;
  
      if (length !== Object.keys(b).length) {
        return false;
      }
  
      for (i = length; i-- !== 0;) {
        if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {
          return false;
        }
      }
  
      for (i = length; i-- !== 0;) {
        const key = keys[i];
  
        if (key === '_owner' && a.$$typeof) {
          continue;
        }
  
        if (!deepEqual(a[key], b[key])) {
          return false;
        }
      }
  
      return true;
    }
  
    return a !== a && b !== b;
  }
  
  function useFloating(_temp) {
    let {
      middleware,
      placement,
      strategy
    } = _temp === void 0 ? {} : _temp;
    const reference = React.useRef(null);
    const floating = React.useRef(null);
    const [data, setData] = React.useState({
      // Setting these to `null` will allow the consumer to determine if
      // `computePosition()` has run yet
      x: null,
      y: null,
      strategy: strategy != null ? strategy : 'absolute',
      placement: 'bottom',
      middlewareData: {}
    });
    const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
  
    if (!deepEqual(latestMiddleware == null ? void 0 : latestMiddleware.map(_ref => {
      let {
        options
      } = _ref;
      return options;
    }), middleware == null ? void 0 : middleware.map(_ref2 => {
      let {
        options
      } = _ref2;
      return options;
    }))) {
      setLatestMiddleware(middleware);
    }
  
    const isMountedRef = React.useRef(true);
    index(() => {
      isMountedRef.current = true;
      return () => {
        isMountedRef.current = false;
      };
    }, []);
    const update = React.useCallback(() => {
      if (!reference.current || !floating.current) {
        return;
      }
  
      computePosition(reference.current, floating.current, {
        middleware: latestMiddleware,
        placement,
        strategy
      }).then(data => {
        if (isMountedRef.current) {
          setData(data);
        }
      });
    }, [latestMiddleware, placement, strategy]);
    index(update, [update]);
    const setReference = React.useCallback(node => {
      reference.current = node;
      update();
    }, [update]);
    const setFloating = React.useCallback(node => {
      floating.current = node;
      update();
    }, [update]);
    return React.useMemo(() => ({ ...data,
      update,
      reference: setReference,
      floating: setFloating,
      refs: {
        reference,
        floating
      }
    }), [data, update, setReference, setFloating]);
  }
  
  var dist$1 = {};
  
  var r,
      B = r || (r = {});
  B.Pop = "POP";
  B.Push = "PUSH";
  B.Replace = "REPLACE";
  var C = "production" !== process.env.NODE_ENV ? function (b) {
    return Object.freeze(b);
  } : function (b) {
    return b;
  };
  
  function D(b, h) {
    if (!b) {
      "undefined" !== typeof console && console.warn(h);
  
      try {
        throw Error(h);
      } catch (e) {}
    }
  }
  
  function E(b) {
    b.preventDefault();
    b.returnValue = "";
  }
  
  function F() {
    var b = [];
    return {
      get length() {
        return b.length;
      },
  
      push: function (h) {
        b.push(h);
        return function () {
          b = b.filter(function (e) {
            return e !== h;
          });
        };
      },
      call: function (h) {
        b.forEach(function (e) {
          return e && e(h);
        });
      }
    };
  }
  
  function H() {
    return Math.random().toString(36).substr(2, 8);
  }
  
  function I(b) {
    var h = b.pathname;
    h = void 0 === h ? "/" : h;
    var e = b.search;
    e = void 0 === e ? "" : e;
    b = b.hash;
    b = void 0 === b ? "" : b;
    e && "?" !== e && (h += "?" === e.charAt(0) ? e : "?" + e);
    b && "#" !== b && (h += "#" === b.charAt(0) ? b : "#" + b);
    return h;
  }
  
  function J(b) {
    var h = {};
  
    if (b) {
      var e = b.indexOf("#");
      0 <= e && (h.hash = b.substr(e), b = b.substr(0, e));
      e = b.indexOf("?");
      0 <= e && (h.search = b.substr(e), b = b.substr(0, e));
      b && (h.pathname = b);
    }
  
    return h;
  }
  
  function createBrowserHistory(b) {
    function h() {
      var c = p.location,
          a = m.state || {};
      return [a.idx, C({
        pathname: c.pathname,
        search: c.search,
        hash: c.hash,
        state: a.usr || null,
        key: a.key || "default"
      })];
    }
  
    function e(c) {
      return "string" === typeof c ? c : I(c);
    }
  
    function x(c, a) {
      void 0 === a && (a = null);
      return C(_extends$2({
        pathname: q.pathname,
        hash: "",
        search: ""
      }, "string" === typeof c ? J(c) : c, {
        state: a,
        key: H()
      }));
    }
  
    function z(c) {
      t = c;
      c = h();
      v = c[0];
      q = c[1];
      d.call({
        action: t,
        location: q
      });
    }
  
    function A(c, a) {
      function f() {
        A(c, a);
      }
  
      var l = r.Push,
          k = x(c, a);
  
      if (!g.length || (g.call({
        action: l,
        location: k,
        retry: f
      }), !1)) {
        var n = [{
          usr: k.state,
          key: k.key,
          idx: v + 1
        }, e(k)];
        k = n[0];
        n = n[1];
  
        try {
          m.pushState(k, "", n);
        } catch (G) {
          p.location.assign(n);
        }
  
        z(l);
      }
    }
  
    function y(c, a) {
      function f() {
        y(c, a);
      }
  
      var l = r.Replace,
          k = x(c, a);
      g.length && (g.call({
        action: l,
        location: k,
        retry: f
      }), 1) || (k = [{
        usr: k.state,
        key: k.key,
        idx: v
      }, e(k)], m.replaceState(k[0], "", k[1]), z(l));
    }
  
    function w(c) {
      m.go(c);
    }
  
    void 0 === b && (b = {});
    b = b.window;
    var p = void 0 === b ? document.defaultView : b,
        m = p.history,
        u = null;
    p.addEventListener("popstate", function () {
      if (u) g.call(u), u = null;else {
        var c = r.Pop,
            a = h(),
            f = a[0];
        a = a[1];
        if (g.length) {
          if (null != f) {
            var l = v - f;
            l && (u = {
              action: c,
              location: a,
              retry: function () {
                w(-1 * l);
              }
            }, w(l));
          } else "production" !== process.env.NODE_ENV ? D(!1, "You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.") : void 0;
        } else z(c);
      }
    });
    var t = r.Pop;
    b = h();
    var v = b[0],
        q = b[1],
        d = F(),
        g = F();
    null == v && (v = 0, m.replaceState(_extends$2({}, m.state, {
      idx: v
    }), ""));
    return {
      get action() {
        return t;
      },
  
      get location() {
        return q;
      },
  
      createHref: e,
      push: A,
      replace: y,
      go: w,
      back: function () {
        w(-1);
      },
      forward: function () {
        w(1);
      },
      listen: function (c) {
        return d.push(c);
      },
      block: function (c) {
        var a = g.push(c);
        1 === g.length && p.addEventListener("beforeunload", E);
        return function () {
          a();
          g.length || p.removeEventListener("beforeunload", E);
        };
      }
    };
  }
  
  function createHashHistory(b) {
    function h() {
      var a = J(m.location.hash.substr(1)),
          f = a.pathname,
          l = a.search;
      a = a.hash;
      var k = u.state || {};
      return [k.idx, C({
        pathname: void 0 === f ? "/" : f,
        search: void 0 === l ? "" : l,
        hash: void 0 === a ? "" : a,
        state: k.usr || null,
        key: k.key || "default"
      })];
    }
  
    function e() {
      if (t) c.call(t), t = null;else {
        var a = r.Pop,
            f = h(),
            l = f[0];
        f = f[1];
        if (c.length) {
          if (null != l) {
            var k = q - l;
            k && (t = {
              action: a,
              location: f,
              retry: function () {
                p(-1 * k);
              }
            }, p(k));
          } else "production" !== process.env.NODE_ENV ? D(!1, "You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.") : void 0;
        } else A(a);
      }
    }
  
    function x(a) {
      var f = document.querySelector("base"),
          l = "";
      f && f.getAttribute("href") && (f = m.location.href, l = f.indexOf("#"), l = -1 === l ? f : f.slice(0, l));
      return l + "#" + ("string" === typeof a ? a : I(a));
    }
  
    function z(a, f) {
      void 0 === f && (f = null);
      return C(_extends$2({
        pathname: d.pathname,
        hash: "",
        search: ""
      }, "string" === typeof a ? J(a) : a, {
        state: f,
        key: H()
      }));
    }
  
    function A(a) {
      v = a;
      a = h();
      q = a[0];
      d = a[1];
      g.call({
        action: v,
        location: d
      });
    }
  
    function y(a, f) {
      function l() {
        y(a, f);
      }
  
      var k = r.Push,
          n = z(a, f);
      "production" !== process.env.NODE_ENV ? D("/" === n.pathname.charAt(0), "Relative pathnames are not supported in hash history.push(" + JSON.stringify(a) + ")") : void 0;
  
      if (!c.length || (c.call({
        action: k,
        location: n,
        retry: l
      }), !1)) {
        var G = [{
          usr: n.state,
          key: n.key,
          idx: q + 1
        }, x(n)];
        n = G[0];
        G = G[1];
  
        try {
          u.pushState(n, "", G);
        } catch (K) {
          m.location.assign(G);
        }
  
        A(k);
      }
    }
  
    function w(a, f) {
      function l() {
        w(a, f);
      }
  
      var k = r.Replace,
          n = z(a, f);
      "production" !== process.env.NODE_ENV ? D("/" === n.pathname.charAt(0), "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(a) + ")") : void 0;
      c.length && (c.call({
        action: k,
        location: n,
        retry: l
      }), 1) || (n = [{
        usr: n.state,
        key: n.key,
        idx: q
      }, x(n)], u.replaceState(n[0], "", n[1]), A(k));
    }
  
    function p(a) {
      u.go(a);
    }
  
    void 0 === b && (b = {});
    b = b.window;
    var m = void 0 === b ? document.defaultView : b,
        u = m.history,
        t = null;
    m.addEventListener("popstate", e);
    m.addEventListener("hashchange", function () {
      var a = h()[1];
      I(a) !== I(d) && e();
    });
    var v = r.Pop;
    b = h();
    var q = b[0],
        d = b[1],
        g = F(),
        c = F();
    null == q && (q = 0, u.replaceState(_extends$2({}, u.state, {
      idx: q
    }), ""));
    return {
      get action() {
        return v;
      },
  
      get location() {
        return d;
      },
  
      createHref: x,
      push: y,
      replace: w,
      go: p,
      back: function () {
        p(-1);
      },
      forward: function () {
        p(1);
      },
      listen: function (a) {
        return g.push(a);
      },
      block: function (a) {
        var f = c.push(a);
        1 === c.length && m.addEventListener("beforeunload", E);
        return function () {
          f();
          c.length || m.removeEventListener("beforeunload", E);
        };
      }
    };
  }
  
  function createMemoryHistory(b) {
    function h(d, g) {
      void 0 === g && (g = null);
      return C(_extends$2({
        pathname: t.pathname,
        search: "",
        hash: ""
      }, "string" === typeof d ? J(d) : d, {
        state: g,
        key: H()
      }));
    }
  
    function e(d, g, c) {
      return !q.length || (q.call({
        action: d,
        location: g,
        retry: c
      }), !1);
    }
  
    function x(d, g) {
      u = d;
      t = g;
      v.call({
        action: u,
        location: t
      });
    }
  
    function z(d, g) {
      var c = r.Push,
          a = h(d, g);
      "production" !== process.env.NODE_ENV ? D("/" === t.pathname.charAt(0), "Relative pathnames are not supported in memory history.push(" + JSON.stringify(d) + ")") : void 0;
      e(c, a, function () {
        z(d, g);
      }) && (m += 1, p.splice(m, p.length, a), x(c, a));
    }
  
    function A(d, g) {
      var c = r.Replace,
          a = h(d, g);
      "production" !== process.env.NODE_ENV ? D("/" === t.pathname.charAt(0), "Relative pathnames are not supported in memory history.replace(" + JSON.stringify(d) + ")") : void 0;
      e(c, a, function () {
        A(d, g);
      }) && (p[m] = a, x(c, a));
    }
  
    function y(d) {
      var g = Math.min(Math.max(m + d, 0), p.length - 1),
          c = r.Pop,
          a = p[g];
      e(c, a, function () {
        y(d);
      }) && (m = g, x(c, a));
    }
  
    void 0 === b && (b = {});
    var w = b;
    b = w.initialEntries;
    w = w.initialIndex;
    var p = (void 0 === b ? ["/"] : b).map(function (d) {
      var g = C(_extends$2({
        pathname: "/",
        search: "",
        hash: "",
        state: null,
        key: H()
      }, "string" === typeof d ? J(d) : d));
      "production" !== process.env.NODE_ENV ? D("/" === g.pathname.charAt(0), "Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: " + JSON.stringify(d) + ")") : void 0;
      return g;
    }),
        m = Math.min(Math.max(null == w ? p.length - 1 : w, 0), p.length - 1),
        u = r.Pop,
        t = p[m],
        v = F(),
        q = F();
    return {
      get index() {
        return m;
      },
  
      get action() {
        return u;
      },
  
      get location() {
        return t;
      },
  
      createHref: function (d) {
        return "string" === typeof d ? d : I(d);
      },
      push: z,
      replace: A,
      go: y,
      back: function () {
        y(-1);
      },
      forward: function () {
        y(1);
      },
      listen: function (d) {
        return v.push(d);
      },
      block: function (d) {
        return q.push(d);
      }
    };
  }
  
  /**
   * React Router v6.2.1
   *
   * Copyright (c) Remix Software Inc.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */
  
  function invariant(cond, message) {
    if (!cond) throw new Error(message);
  }
  
  function warning$1(cond, message) {
    if (!cond) {
      // eslint-disable-next-line no-console
      if (typeof console !== "undefined") console.warn(message);
  
      try {
        // Welcome to debugging React Router!
        //
        // This error is thrown as a convenience so you can more easily
        // find the source for a warning that appears in the console by
        // enabling "pause on exceptions" in your JavaScript debugger.
        throw new Error(message); // eslint-disable-next-line no-empty
      } catch (e) {}
    }
  }
  
  const alreadyWarned = {};
  
  function warningOnce(key, cond, message) {
    if (!cond && !alreadyWarned[key]) {
      alreadyWarned[key] = true;
      process.env.NODE_ENV !== "production" ? warning$1(false, message) : void 0;
    }
  } ///////////////////////////////////////////////////////////////////////////////
  // CONTEXT
  ///////////////////////////////////////////////////////////////////////////////
  
  /**
   * A Navigator is a "location changer"; it's how you get to different locations.
   *
   * Every history instance conforms to the Navigator interface, but the
   * distinction is useful primarily when it comes to the low-level <Router> API
   * where both the location and a navigator must be provided separately in order
   * to avoid "tearing" that may occur in a suspense-enabled app if the action
   * and/or location were to be read directly from the history instance.
   */
  
  
  const NavigationContext = /*#__PURE__*/React.createContext(null);
  
  if (process.env.NODE_ENV !== "production") {
    NavigationContext.displayName = "Navigation";
  }
  
  const LocationContext = /*#__PURE__*/React.createContext(null);
  
  if (process.env.NODE_ENV !== "production") {
    LocationContext.displayName = "Location";
  }
  
  const RouteContext = /*#__PURE__*/React.createContext({
    outlet: null,
    matches: []
  });
  
  if (process.env.NODE_ENV !== "production") {
    RouteContext.displayName = "Route";
  } ///////////////////////////////////////////////////////////////////////////////
  // COMPONENTS
  ///////////////////////////////////////////////////////////////////////////////
  
  /**
   * A <Router> that stores all entries in memory.
   *
   * @see https://reactrouter.com/docs/en/v6/api#memoryrouter
   */
  
  
  function MemoryRouter(_ref) {
    let {
      basename,
      children,
      initialEntries,
      initialIndex
    } = _ref;
    let historyRef = React.useRef();
  
    if (historyRef.current == null) {
      historyRef.current = createMemoryHistory({
        initialEntries,
        initialIndex
      });
    }
  
    let history = historyRef.current;
    let [state, setState] = React.useState({
      action: history.action,
      location: history.location
    });
    React.useLayoutEffect(() => history.listen(setState), [history]);
    return /*#__PURE__*/React.createElement(Router, {
      basename: basename,
      children: children,
      location: state.location,
      navigationType: state.action,
      navigator: history
    });
  }
  /**
   * Changes the current location.
   *
   * Note: This API is mostly useful in React.Component subclasses that are not
   * able to use hooks. In functional components, we recommend you use the
   * `useNavigate` hook instead.
   *
   * @see https://reactrouter.com/docs/en/v6/api#navigate
   */
  
  
  function Navigate(_ref2) {
    let {
      to,
      replace,
      state
    } = _ref2;
    !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of
    // the router loaded. We can help them understand how to avoid that.
    "<Navigate> may be used only in the context of a <Router> component.") : invariant(false) : void 0;
    process.env.NODE_ENV !== "production" ? warning$1(!React.useContext(NavigationContext).static, "<Navigate> must not be used on the initial render in a <StaticRouter>. " + "This is a no-op, but you should modify your code so the <Navigate> is " + "only ever rendered in response to some user interaction or state change.") : void 0;
    let navigate = useNavigate();
    React.useEffect(() => {
      navigate(to, {
        replace,
        state
      });
    });
    return null;
  }
  /**
   * Renders the child route's element, if there is one.
   *
   * @see https://reactrouter.com/docs/en/v6/api#outlet
   */
  
  
  function Outlet(props) {
    return useOutlet(props.context);
  }
  /**
   * Declares an element that should be rendered at a certain URL path.
   *
   * @see https://reactrouter.com/docs/en/v6/api#route
   */
  
  
  function Route(_props) {
    process.env.NODE_ENV !== "production" ? invariant(false, "A <Route> is only ever to be used as the child of <Routes> element, " + "never rendered directly. Please wrap your <Route> in a <Routes>.") : invariant(false);
  }
  /**
   * Provides location context for the rest of the app.
   *
   * Note: You usually won't render a <Router> directly. Instead, you'll render a
   * router that is more specific to your environment such as a <BrowserRouter>
   * in web browsers or a <StaticRouter> for server rendering.
   *
   * @see https://reactrouter.com/docs/en/v6/api#router
   */
  
  
  function Router(_ref3) {
    let {
      basename: basenameProp = "/",
      children = null,
      location: locationProp,
      navigationType = r.Pop,
      navigator,
      static: staticProp = false
    } = _ref3;
    !!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, "You cannot render a <Router> inside another <Router>." + " You should never have more than one in your app.") : invariant(false) : void 0;
    let basename = normalizePathname(basenameProp);
    let navigationContext = React.useMemo(() => ({
      basename,
      navigator,
      static: staticProp
    }), [basename, navigator, staticProp]);
  
    if (typeof locationProp === "string") {
      locationProp = J(locationProp);
    }
  
    let {
      pathname = "/",
      search = "",
      hash = "",
      state = null,
      key = "default"
    } = locationProp;
    let location = React.useMemo(() => {
      let trailingPathname = stripBasename(pathname, basename);
  
      if (trailingPathname == null) {
        return null;
      }
  
      return {
        pathname: trailingPathname,
        search,
        hash,
        state,
        key
      };
    }, [basename, pathname, search, hash, state, key]);
    process.env.NODE_ENV !== "production" ? warning$1(location != null, "<Router basename=\"" + basename + "\"> is not able to match the URL " + ("\"" + pathname + search + hash + "\" because it does not start with the ") + "basename, so the <Router> won't render anything.") : void 0;
  
    if (location == null) {
      return null;
    }
  
    return /*#__PURE__*/React.createElement(NavigationContext.Provider, {
      value: navigationContext
    }, /*#__PURE__*/React.createElement(LocationContext.Provider, {
      children: children,
      value: {
        location,
        navigationType
      }
    }));
  }
  /**
   * A container for a nested tree of <Route> elements that renders the branch
   * that best matches the current location.
   *
   * @see https://reactrouter.com/docs/en/v6/api#routes
   */
  
  
  function Routes(_ref4) {
    let {
      children,
      location
    } = _ref4;
    return useRoutes(createRoutesFromChildren(children), location);
  } ///////////////////////////////////////////////////////////////////////////////
  // HOOKS
  ///////////////////////////////////////////////////////////////////////////////
  
  /**
   * Returns the full href for the given "to" value. This is useful for building
   * custom links that are also accessible and preserve right-click behavior.
   *
   * @see https://reactrouter.com/docs/en/v6/api#usehref
   */
  
  
  function useHref(to) {
    !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useHref() may be used only in the context of a <Router> component.") : invariant(false) : void 0;
    let {
      basename,
      navigator
    } = React.useContext(NavigationContext);
    let {
      hash,
      pathname,
      search
    } = useResolvedPath(to);
    let joinedPathname = pathname;
  
    if (basename !== "/") {
      let toPathname = getToPathname(to);
      let endsWithSlash = toPathname != null && toPathname.endsWith("/");
      joinedPathname = pathname === "/" ? basename + (endsWithSlash ? "/" : "") : joinPaths([basename, pathname]);
    }
  
    return navigator.createHref({
      pathname: joinedPathname,
      search,
      hash
    });
  }
  /**
   * Returns true if this component is a descendant of a <Router>.
   *
   * @see https://reactrouter.com/docs/en/v6/api#useinroutercontext
   */
  
  
  function useInRouterContext() {
    return React.useContext(LocationContext) != null;
  }
  /**
   * Returns the current location object, which represents the current URL in web
   * browsers.
   *
   * Note: If you're using this it may mean you're doing some of your own
   * "routing" in your app, and we'd like to know what your use case is. We may
   * be able to provide something higher-level to better suit your needs.
   *
   * @see https://reactrouter.com/docs/en/v6/api#uselocation
   */
  
  
  function useLocation() {
    !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useLocation() may be used only in the context of a <Router> component.") : invariant(false) : void 0;
    return React.useContext(LocationContext).location;
  }
  /**
   * Returns the current navigation action which describes how the router came to
   * the current location, either by a pop, push, or replace on the history stack.
   *
   * @see https://reactrouter.com/docs/en/v6/api#usenavigationtype
   */
  
  
  function useNavigationType() {
    return React.useContext(LocationContext).navigationType;
  }
  /**
   * Returns true if the URL for the given "to" value matches the current URL.
   * This is useful for components that need to know "active" state, e.g.
   * <NavLink>.
   *
   * @see https://reactrouter.com/docs/en/v6/api#usematch
   */
  
  
  function useMatch(pattern) {
    !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useMatch() may be used only in the context of a <Router> component.") : invariant(false) : void 0;
    let {
      pathname
    } = useLocation();
    return React.useMemo(() => matchPath(pattern, pathname), [pathname, pattern]);
  }
  /**
   * The interface for the navigate() function returned from useNavigate().
   */
  
  /**
   * Returns an imperative method for changing the location. Used by <Link>s, but
   * may also be used by other elements to change the location.
   *
   * @see https://reactrouter.com/docs/en/v6/api#usenavigate
   */
  
  
  function useNavigate() {
    !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useNavigate() may be used only in the context of a <Router> component.") : invariant(false) : void 0;
    let {
      basename,
      navigator
    } = React.useContext(NavigationContext);
    let {
      matches
    } = React.useContext(RouteContext);
    let {
      pathname: locationPathname
    } = useLocation();
    let routePathnamesJson = JSON.stringify(matches.map(match => match.pathnameBase));
    let activeRef = React.useRef(false);
    React.useEffect(() => {
      activeRef.current = true;
    });
    let navigate = React.useCallback(function (to, options) {
      if (options === void 0) {
        options = {};
      }
  
      process.env.NODE_ENV !== "production" ? warning$1(activeRef.current, "You should call navigate() in a React.useEffect(), not when " + "your component is first rendered.") : void 0;
      if (!activeRef.current) return;
  
      if (typeof to === "number") {
        navigator.go(to);
        return;
      }
  
      let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname);
  
      if (basename !== "/") {
        path.pathname = joinPaths([basename, path.pathname]);
      }
  
      (!!options.replace ? navigator.replace : navigator.push)(path, options.state);
    }, [basename, navigator, routePathnamesJson, locationPathname]);
    return navigate;
  }
  
  const OutletContext = /*#__PURE__*/React.createContext(null);
  /**
   * Returns the context (if provided) for the child route at this level of the route
   * hierarchy.
   * @see https://reactrouter.com/docs/en/v6/api#useoutletcontext
   */
  
  function useOutletContext() {
    return React.useContext(OutletContext);
  }
  /**
   * Returns the element for the child route at this level of the route
   * hierarchy. Used internally by <Outlet> to render child routes.
   *
   * @see https://reactrouter.com/docs/en/v6/api#useoutlet
   */
  
  
  function useOutlet(context) {
    let outlet = React.useContext(RouteContext).outlet;
  
    if (outlet) {
      return /*#__PURE__*/React.createElement(OutletContext.Provider, {
        value: context
      }, outlet);
    }
  
    return outlet;
  }
  /**
   * Returns an object of key/value pairs of the dynamic params from the current
   * URL that were matched by the route path.
   *
   * @see https://reactrouter.com/docs/en/v6/api#useparams
   */
  
  
  function useParams() {
    let {
      matches
    } = React.useContext(RouteContext);
    let routeMatch = matches[matches.length - 1];
    return routeMatch ? routeMatch.params : {};
  }
  /**
   * Resolves the pathname of the given `to` value against the current location.
   *
   * @see https://reactrouter.com/docs/en/v6/api#useresolvedpath
   */
  
  
  function useResolvedPath(to) {
    let {
      matches
    } = React.useContext(RouteContext);
    let {
      pathname: locationPathname
    } = useLocation();
    let routePathnamesJson = JSON.stringify(matches.map(match => match.pathnameBase));
    return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname), [to, routePathnamesJson, locationPathname]);
  }
  /**
   * Returns the element of the route that matched the current location, prepared
   * with the correct context to render the remainder of the route tree. Route
   * elements in the tree must render an <Outlet> to render their child route's
   * element.
   *
   * @see https://reactrouter.com/docs/en/v6/api#useroutes
   */
  
  
  function useRoutes(routes, locationArg) {
    !useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useRoutes() may be used only in the context of a <Router> component.") : invariant(false) : void 0;
    let {
      matches: parentMatches
    } = React.useContext(RouteContext);
    let routeMatch = parentMatches[parentMatches.length - 1];
    let parentParams = routeMatch ? routeMatch.params : {};
    let parentPathname = routeMatch ? routeMatch.pathname : "/";
    let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
    let parentRoute = routeMatch && routeMatch.route;
  
    if (process.env.NODE_ENV !== "production") {
      // You won't get a warning about 2 different <Routes> under a <Route>
      // without a trailing *, but this is a best-effort warning anyway since we
      // cannot even give the warning unless they land at the parent route.
      //
      // Example:
      //
      // <Routes>
      //   {/* This route path MUST end with /* because otherwise
      //       it will never match /blog/post/123 */}
      //   <Route path="blog" element={<Blog />} />
      //   <Route path="blog/feed" element={<BlogFeed />} />
      // </Routes>
      //
      // function Blog() {
      //   return (
      //     <Routes>
      //       <Route path="post/:id" element={<Post />} />
      //     </Routes>
      //   );
      // }
      let parentPath = parentRoute && parentRoute.path || "";
      warningOnce(parentPathname, !parentRoute || parentPath.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ("\"" + parentPathname + "\" (under <Route path=\"" + parentPath + "\">) but the ") + "parent route path has no trailing \"*\". This means if you navigate " + "deeper, the parent won't match anymore and therefore the child " + "routes will never render.\n\n" + ("Please change the parent <Route path=\"" + parentPath + "\"> to <Route ") + ("path=\"" + (parentPath === "/" ? "*" : parentPath + "/*") + "\">."));
    }
  
    let locationFromContext = useLocation();
    let location;
  
    if (locationArg) {
      var _parsedLocationArg$pa;
  
      let parsedLocationArg = typeof locationArg === "string" ? J(locationArg) : locationArg;
      !(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? process.env.NODE_ENV !== "production" ? invariant(false, "When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, " + "the location pathname must begin with the portion of the URL pathname that was " + ("matched by all parent routes. The current pathname base is \"" + parentPathnameBase + "\" ") + ("but pathname \"" + parsedLocationArg.pathname + "\" was given in the `location` prop.")) : invariant(false) : void 0;
      location = parsedLocationArg;
    } else {
      location = locationFromContext;
    }
  
    let pathname = location.pathname || "/";
    let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
    let matches = matchRoutes(routes, {
      pathname: remainingPathname
    });
  
    if (process.env.NODE_ENV !== "production") {
      process.env.NODE_ENV !== "production" ? warning$1(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") : void 0;
      process.env.NODE_ENV !== "production" ? warning$1(matches == null || matches[matches.length - 1].route.element !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" does not have an element. " + "This means it will render an <Outlet /> with a null value by default resulting in an \"empty\" page.") : void 0;
    }
  
    return _renderMatches(matches && matches.map(match => Object.assign({}, match, {
      params: Object.assign({}, parentParams, match.params),
      pathname: joinPaths([parentPathnameBase, match.pathname]),
      pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([parentPathnameBase, match.pathnameBase])
    })), parentMatches);
  } ///////////////////////////////////////////////////////////////////////////////
  // UTILS
  ///////////////////////////////////////////////////////////////////////////////
  
  /**
   * Creates a route config from a React "children" object, which is usually
   * either a `<Route>` element or an array of them. Used internally by
   * `<Routes>` to create a route config from its children.
   *
   * @see https://reactrouter.com/docs/en/v6/api#createroutesfromchildren
   */
  
  
  function createRoutesFromChildren(children) {
    let routes = [];
    React.Children.forEach(children, element => {
      if (! /*#__PURE__*/React.isValidElement(element)) {
        // Ignore non-elements. This allows people to more easily inline
        // conditionals in their route config.
        return;
      }
  
      if (element.type === React.Fragment) {
        // Transparently support React.Fragment and its children.
        routes.push.apply(routes, createRoutesFromChildren(element.props.children));
        return;
      }
  
      !(element.type === Route) ? process.env.NODE_ENV !== "production" ? invariant(false, "[" + (typeof element.type === "string" ? element.type : element.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : invariant(false) : void 0;
      let route = {
        caseSensitive: element.props.caseSensitive,
        element: element.props.element,
        index: element.props.index,
        path: element.props.path
      };
  
      if (element.props.children) {
        route.children = createRoutesFromChildren(element.props.children);
      }
  
      routes.push(route);
    });
    return routes;
  }
  /**
   * The parameters that were parsed from the URL path.
   */
  
  /**
   * Returns a path with params interpolated.
   *
   * @see https://reactrouter.com/docs/en/v6/api#generatepath
   */
  
  
  function generatePath(path, params) {
    if (params === void 0) {
      params = {};
    }
  
    return path.replace(/:(\w+)/g, (_, key) => {
      !(params[key] != null) ? process.env.NODE_ENV !== "production" ? invariant(false, "Missing \":" + key + "\" param") : invariant(false) : void 0;
      return params[key];
    }).replace(/\/*\*$/, _ => params["*"] == null ? "" : params["*"].replace(/^\/*/, "/"));
  }
  /**
   * A RouteMatch contains info about how a route matched a URL.
   */
  
  /**
   * Matches the given routes to a location and returns the match data.
   *
   * @see https://reactrouter.com/docs/en/v6/api#matchroutes
   */
  
  
  function matchRoutes(routes, locationArg, basename) {
    if (basename === void 0) {
      basename = "/";
    }
  
    let location = typeof locationArg === "string" ? J(locationArg) : locationArg;
    let pathname = stripBasename(location.pathname || "/", basename);
  
    if (pathname == null) {
      return null;
    }
  
    let branches = flattenRoutes(routes);
    rankRouteBranches(branches);
    let matches = null;
  
    for (let i = 0; matches == null && i < branches.length; ++i) {
      matches = matchRouteBranch(branches[i], pathname);
    }
  
    return matches;
  }
  
  function flattenRoutes(routes, branches, parentsMeta, parentPath) {
    if (branches === void 0) {
      branches = [];
    }
  
    if (parentsMeta === void 0) {
      parentsMeta = [];
    }
  
    if (parentPath === void 0) {
      parentPath = "";
    }
  
    routes.forEach((route, index) => {
      let meta = {
        relativePath: route.path || "",
        caseSensitive: route.caseSensitive === true,
        childrenIndex: index,
        route
      };
  
      if (meta.relativePath.startsWith("/")) {
        !meta.relativePath.startsWith(parentPath) ? process.env.NODE_ENV !== "production" ? invariant(false, "Absolute route path \"" + meta.relativePath + "\" nested under path " + ("\"" + parentPath + "\" is not valid. An absolute child route path ") + "must start with the combined path of all its parent routes.") : invariant(false) : void 0;
        meta.relativePath = meta.relativePath.slice(parentPath.length);
      }
  
      let path = joinPaths([parentPath, meta.relativePath]);
      let routesMeta = parentsMeta.concat(meta); // Add the children before adding this route to the array so we traverse the
      // route tree depth-first and child routes appear before their parents in
      // the "flattened" version.
  
      if (route.children && route.children.length > 0) {
        !(route.index !== true) ? process.env.NODE_ENV !== "production" ? invariant(false, "Index routes must not have child routes. Please remove " + ("all child routes from route path \"" + path + "\".")) : invariant(false) : void 0;
        flattenRoutes(route.children, branches, routesMeta, path);
      } // Routes without a path shouldn't ever match by themselves unless they are
      // index routes, so don't add them to the list of possible branches.
  
  
      if (route.path == null && !route.index) {
        return;
      }
  
      branches.push({
        path,
        score: computeScore(path, route.index),
        routesMeta
      });
    });
    return branches;
  }
  
  function rankRouteBranches(branches) {
    branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first
    : compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));
  }
  
  const paramRe = /^:\w+$/;
  const dynamicSegmentValue = 3;
  const indexRouteValue = 2;
  const emptySegmentValue = 1;
  const staticSegmentValue = 10;
  const splatPenalty = -2;
  
  const isSplat = s => s === "*";
  
  function computeScore(path, index) {
    let segments = path.split("/");
    let initialScore = segments.length;
  
    if (segments.some(isSplat)) {
      initialScore += splatPenalty;
    }
  
    if (index) {
      initialScore += indexRouteValue;
    }
  
    return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore);
  }
  
  function compareIndexes(a, b) {
    let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);
    return siblings ? // If two routes are siblings, we should try to match the earlier sibling
    // first. This allows people to have fine-grained control over the matching
    // behavior by simply putting routes with identical paths in the order they
    // want them tried.
    a[a.length - 1] - b[b.length - 1] : // Otherwise, it doesn't really make sense to rank non-siblings by index,
    // so they sort equally.
    0;
  }
  
  function matchRouteBranch(branch, pathname) {
    let {
      routesMeta
    } = branch;
    let matchedParams = {};
    let matchedPathname = "/";
    let matches = [];
  
    for (let i = 0; i < routesMeta.length; ++i) {
      let meta = routesMeta[i];
      let end = i === routesMeta.length - 1;
      let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";
      let match = matchPath({
        path: meta.relativePath,
        caseSensitive: meta.caseSensitive,
        end
      }, remainingPathname);
      if (!match) return null;
      Object.assign(matchedParams, match.params);
      let route = meta.route;
      matches.push({
        params: matchedParams,
        pathname: joinPaths([matchedPathname, match.pathname]),
        pathnameBase: joinPaths([matchedPathname, match.pathnameBase]),
        route
      });
  
      if (match.pathnameBase !== "/") {
        matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);
      }
    }
  
    return matches;
  }
  /**
   * Renders the result of `matchRoutes()` into a React element.
   */
  
  
  function renderMatches(matches) {
    return _renderMatches(matches);
  }
  
  function _renderMatches(matches, parentMatches) {
    if (parentMatches === void 0) {
      parentMatches = [];
    }
  
    if (matches == null) return null;
    return matches.reduceRight((outlet, match, index) => {
      return /*#__PURE__*/React.createElement(RouteContext.Provider, {
        children: match.route.element !== undefined ? match.route.element : /*#__PURE__*/React.createElement(Outlet, null),
        value: {
          outlet,
          matches: parentMatches.concat(matches.slice(0, index + 1))
        }
      });
    }, null);
  }
  /**
   * A PathPattern is used to match on some portion of a URL pathname.
   */
  
  /**
   * Performs pattern matching on a URL pathname and returns information about
   * the match.
   *
   * @see https://reactrouter.com/docs/en/v6/api#matchpath
   */
  
  
  function matchPath(pattern, pathname) {
    if (typeof pattern === "string") {
      pattern = {
        path: pattern,
        caseSensitive: false,
        end: true
      };
    }
  
    let [matcher, paramNames] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);
    let match = pathname.match(matcher);
    if (!match) return null;
    let matchedPathname = match[0];
    let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
    let captureGroups = match.slice(1);
    let params = paramNames.reduce((memo, paramName, index) => {
      // We need to compute the pathnameBase here using the raw splat value
      // instead of using params["*"] later because it will be decoded then
      if (paramName === "*") {
        let splatValue = captureGroups[index] || "";
        pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
      }
  
      memo[paramName] = safelyDecodeURIComponent(captureGroups[index] || "", paramName);
      return memo;
    }, {});
    return {
      params,
      pathname: matchedPathname,
      pathnameBase,
      pattern
    };
  }
  
  function compilePath(path, caseSensitive, end) {
    if (caseSensitive === void 0) {
      caseSensitive = false;
    }
  
    if (end === void 0) {
      end = true;
    }
  
    process.env.NODE_ENV !== "production" ? warning$1(path === "*" || !path.endsWith("*") || path.endsWith("/*"), "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\".")) : void 0;
    let paramNames = [];
    let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below
    .replace(/^\/*/, "/") // Make sure it has a leading /
    .replace(/[\\.*+^$?{}|()[\]]/g, "\\$&") // Escape special regex chars
    .replace(/:(\w+)/g, (_, paramName) => {
      paramNames.push(paramName);
      return "([^\\/]+)";
    });
  
    if (path.endsWith("*")) {
      paramNames.push("*");
      regexpSource += path === "*" || path === "/*" ? "(.*)$" // Already matched the initial /, just match the rest
      : "(?:\\/(.+)|\\/*)$"; // Don't include the / in params["*"]
    } else {
      regexpSource += end ? "\\/*$" // When matching to the end, ignore trailing slashes
      : // Otherwise, match a word boundary or a proceeding /. The word boundary restricts
      // parent routes to matching only their own words and nothing more, e.g. parent
      // route "/home" should not match "/home2".
      "(?:\\b|\\/|$)";
    }
  
    let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i");
    return [matcher, paramNames];
  }
  
  function safelyDecodeURIComponent(value, paramName) {
    try {
      return decodeURIComponent(value);
    } catch (error) {
      process.env.NODE_ENV !== "production" ? warning$1(false, "The value for the URL param \"" + paramName + "\" will not be decoded because" + (" the string \"" + value + "\" is a malformed URL segment. This is probably") + (" due to a bad percent encoding (" + error + ").")) : void 0;
      return value;
    }
  }
  /**
   * Returns a resolved path object relative to the given pathname.
   *
   * @see https://reactrouter.com/docs/en/v6/api#resolvepath
   */
  
  
  function resolvePath(to, fromPathname) {
    if (fromPathname === void 0) {
      fromPathname = "/";
    }
  
    let {
      pathname: toPathname,
      search = "",
      hash = ""
    } = typeof to === "string" ? J(to) : to;
    let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
    return {
      pathname,
      search: normalizeSearch(search),
      hash: normalizeHash(hash)
    };
  }
  
  function resolvePathname(relativePath, fromPathname) {
    let segments = fromPathname.replace(/\/+$/, "").split("/");
    let relativeSegments = relativePath.split("/");
    relativeSegments.forEach(segment => {
      if (segment === "..") {
        // Keep the root "" segment so the pathname starts at /
        if (segments.length > 1) segments.pop();
      } else if (segment !== ".") {
        segments.push(segment);
      }
    });
    return segments.length > 1 ? segments.join("/") : "/";
  }
  
  function resolveTo(toArg, routePathnames, locationPathname) {
    let to = typeof toArg === "string" ? J(toArg) : toArg;
    let toPathname = toArg === "" || to.pathname === "" ? "/" : to.pathname; // If a pathname is explicitly provided in `to`, it should be relative to the
    // route context. This is explained in `Note on `<Link to>` values` in our
    // migration guide from v5 as a means of disambiguation between `to` values
    // that begin with `/` and those that do not. However, this is problematic for
    // `to` values that do not provide a pathname. `to` can simply be a search or
    // hash string, in which case we should assume that the navigation is relative
    // to the current location's pathname and *not* the route pathname.
  
    let from;
  
    if (toPathname == null) {
      from = locationPathname;
    } else {
      let routePathnameIndex = routePathnames.length - 1;
  
      if (toPathname.startsWith("..")) {
        let toSegments = toPathname.split("/"); // Each leading .. segment means "go up one route" instead of "go up one
        // URL segment".  This is a key difference from how <a href> works and a
        // major reason we call this a "to" value instead of a "href".
  
        while (toSegments[0] === "..") {
          toSegments.shift();
          routePathnameIndex -= 1;
        }
  
        to.pathname = toSegments.join("/");
      } // If there are more ".." segments than parent routes, resolve relative to
      // the root / URL.
  
  
      from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
    }
  
    let path = resolvePath(to, from); // Ensure the pathname has a trailing slash if the original to value had one.
  
    if (toPathname && toPathname !== "/" && toPathname.endsWith("/") && !path.pathname.endsWith("/")) {
      path.pathname += "/";
    }
  
    return path;
  }
  
  function getToPathname(to) {
    // Empty strings should be treated the same as / paths
    return to === "" || to.pathname === "" ? "/" : typeof to === "string" ? J(to).pathname : to.pathname;
  }
  
  function stripBasename(pathname, basename) {
    if (basename === "/") return pathname;
  
    if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
      return null;
    }
  
    let nextChar = pathname.charAt(basename.length);
  
    if (nextChar && nextChar !== "/") {
      // pathname does not start with basename/
      return null;
    }
  
    return pathname.slice(basename.length) || "/";
  }
  
  const joinPaths = paths => paths.join("/").replace(/\/\/+/g, "/");
  
  const normalizePathname = pathname => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
  
  const normalizeSearch = search => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
  
  const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash; ///////////////////////////////////////////////////////////////////////////////
  
  /**
   * React Router DOM v6.2.1
   *
   * Copyright (c) Remix Software Inc.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */
  
  function _extends$1() {
    _extends$1 = Object.assign || function (target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
  
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
  
      return target;
    };
  
    return _extends$1.apply(this, arguments);
  }
  
  function _objectWithoutPropertiesLoose(source, excluded) {
    if (source == null) return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
  
    for (i = 0; i < sourceKeys.length; i++) {
      key = sourceKeys[i];
      if (excluded.indexOf(key) >= 0) continue;
      target[key] = source[key];
    }
  
    return target;
  }
  
  const _excluded$1 = ["onClick", "reloadDocument", "replace", "state", "target", "to"],
        _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"];
  
  function warning(cond, message) {
    if (!cond) {
      // eslint-disable-next-line no-console
      if (typeof console !== "undefined") console.warn(message);
  
      try {
        // Welcome to debugging React Router!
        //
        // This error is thrown as a convenience so you can more easily
        // find the source for a warning that appears in the console by
        // enabling "pause on exceptions" in your JavaScript debugger.
        throw new Error(message); // eslint-disable-next-line no-empty
      } catch (e) {}
    }
  } ////////////////////////////////////////////////////////////////////////////////
  // COMPONENTS
  ////////////////////////////////////////////////////////////////////////////////
  
  /**
   * A `<Router>` for use in web browsers. Provides the cleanest URLs.
   */
  
  
  function BrowserRouter(_ref) {
    let {
      basename,
      children,
      window
    } = _ref;
    let historyRef = React.useRef();
  
    if (historyRef.current == null) {
      historyRef.current = createBrowserHistory({
        window
      });
    }
  
    let history = historyRef.current;
    let [state, setState] = React.useState({
      action: history.action,
      location: history.location
    });
    React.useLayoutEffect(() => history.listen(setState), [history]);
    return /*#__PURE__*/React.createElement(Router, {
      basename: basename,
      children: children,
      location: state.location,
      navigationType: state.action,
      navigator: history
    });
  }
  /**
   * A `<Router>` for use in web browsers. Stores the location in the hash
   * portion of the URL so it is not sent to the server.
   */
  
  
  function HashRouter(_ref2) {
    let {
      basename,
      children,
      window
    } = _ref2;
    let historyRef = React.useRef();
  
    if (historyRef.current == null) {
      historyRef.current = createHashHistory({
        window
      });
    }
  
    let history = historyRef.current;
    let [state, setState] = React.useState({
      action: history.action,
      location: history.location
    });
    React.useLayoutEffect(() => history.listen(setState), [history]);
    return /*#__PURE__*/React.createElement(Router, {
      basename: basename,
      children: children,
      location: state.location,
      navigationType: state.action,
      navigator: history
    });
  }
  /**
   * A `<Router>` that accepts a pre-instantiated history object. It's important
   * to note that using your own history object is highly discouraged and may add
   * two versions of the history library to your bundles unless you use the same
   * version of the history library that React Router uses internally.
   */
  
  
  function HistoryRouter(_ref3) {
    let {
      basename,
      children,
      history
    } = _ref3;
    const [state, setState] = React.useState({
      action: history.action,
      location: history.location
    });
    React.useLayoutEffect(() => history.listen(setState), [history]);
    return /*#__PURE__*/React.createElement(Router, {
      basename: basename,
      children: children,
      location: state.location,
      navigationType: state.action,
      navigator: history
    });
  }
  
  if (process.env.NODE_ENV !== "production") {
    HistoryRouter.displayName = "unstable_HistoryRouter";
  }
  
  function isModifiedEvent(event) {
    return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
  }
  /**
   * The public API for rendering a history-aware <a>.
   */
  
  
  const Link = /*#__PURE__*/React.forwardRef(function LinkWithRef(_ref4, ref) {
    let {
      onClick,
      reloadDocument,
      replace = false,
      state,
      target,
      to
    } = _ref4,
        rest = _objectWithoutPropertiesLoose(_ref4, _excluded$1);
  
    let href = useHref(to);
    let internalOnClick = useLinkClickHandler(to, {
      replace,
      state,
      target
    });
  
    function handleClick(event) {
      if (onClick) onClick(event);
  
      if (!event.defaultPrevented && !reloadDocument) {
        internalOnClick(event);
      }
    }
  
    return (
      /*#__PURE__*/
      // eslint-disable-next-line jsx-a11y/anchor-has-content
      React.createElement("a", _extends$1({}, rest, {
        href: href,
        onClick: handleClick,
        ref: ref,
        target: target
      }))
    );
  });
  
  if (process.env.NODE_ENV !== "production") {
    Link.displayName = "Link";
  }
  /**
   * A <Link> wrapper that knows if it's "active" or not.
   */
  
  
  const NavLink = /*#__PURE__*/React.forwardRef(function NavLinkWithRef(_ref5, ref) {
    let {
      "aria-current": ariaCurrentProp = "page",
      caseSensitive = false,
      className: classNameProp = "",
      end = false,
      style: styleProp,
      to,
      children
    } = _ref5,
        rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);
  
    let location = useLocation();
    let path = useResolvedPath(to);
    let locationPathname = location.pathname;
    let toPathname = path.pathname;
  
    if (!caseSensitive) {
      locationPathname = locationPathname.toLowerCase();
      toPathname = toPathname.toLowerCase();
    }
  
    let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/";
    let ariaCurrent = isActive ? ariaCurrentProp : undefined;
    let className;
  
    if (typeof classNameProp === "function") {
      className = classNameProp({
        isActive
      });
    } else {
      // If the className prop is not a function, we use a default `active`
      // class for <NavLink />s that are active. In v5 `active` was the default
      // value for `activeClassName`, but we are removing that API and can still
      // use the old default behavior for a cleaner upgrade path and keep the
      // simple styling rules working as they currently do.
      className = [classNameProp, isActive ? "active" : null].filter(Boolean).join(" ");
    }
  
    let style = typeof styleProp === "function" ? styleProp({
      isActive
    }) : styleProp;
    return /*#__PURE__*/React.createElement(Link, _extends$1({}, rest, {
      "aria-current": ariaCurrent,
      className: className,
      ref: ref,
      style: style,
      to: to
    }), typeof children === "function" ? children({
      isActive
    }) : children);
  });
  
  if (process.env.NODE_ENV !== "production") {
    NavLink.displayName = "NavLink";
  } ////////////////////////////////////////////////////////////////////////////////
  // HOOKS
  ////////////////////////////////////////////////////////////////////////////////
  
  /**
   * Handles the click behavior for router `<Link>` components. This is useful if
   * you need to create custom `<Link>` components with the same click behavior we
   * use in our exported `<Link>`.
   */
  
  
  function useLinkClickHandler(to, _temp) {
    let {
      target,
      replace: replaceProp,
      state
    } = _temp === void 0 ? {} : _temp;
    let navigate = useNavigate();
    let location = useLocation();
    let path = useResolvedPath(to);
    return React.useCallback(event => {
      if (event.button === 0 && ( // Ignore everything but left clicks
      !target || target === "_self") && // Let browser handle "target=_blank" etc.
      !isModifiedEvent(event) // Ignore clicks with modifier keys
      ) {
        event.preventDefault(); // If the URL hasn't changed, a regular <a> will do a replace instead of
        // a push, so do the same here.
  
        let replace = !!replaceProp || I(location) === I(path);
        navigate(to, {
          replace,
          state
        });
      }
    }, [location, navigate, path, replaceProp, state, target, to]);
  }
  /**
   * A convenient wrapper for reading and writing search parameters via the
   * URLSearchParams interface.
   */
  
  
  function useSearchParams(defaultInit) {
    process.env.NODE_ENV !== "production" ? warning(typeof URLSearchParams !== "undefined", "You cannot use the `useSearchParams` hook in a browser that does not " + "support the URLSearchParams API. If you need to support Internet " + "Explorer 11, we recommend you load a polyfill such as " + "https://github.com/ungap/url-search-params\n\n" + "If you're unsure how to load polyfills, we recommend you check out " + "https://polyfill.io/v3/ which provides some recommendations about how " + "to load polyfills only for users that need them, instead of for every " + "user.") : void 0;
    let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
    let location = useLocation();
    let searchParams = React.useMemo(() => {
      let searchParams = createSearchParams(location.search);
  
      for (let key of defaultSearchParamsRef.current.keys()) {
        if (!searchParams.has(key)) {
          defaultSearchParamsRef.current.getAll(key).forEach(value => {
            searchParams.append(key, value);
          });
        }
      }
  
      return searchParams;
    }, [location.search]);
    let navigate = useNavigate();
    let setSearchParams = React.useCallback((nextInit, navigateOptions) => {
      navigate("?" + createSearchParams(nextInit), navigateOptions);
    }, [navigate]);
    return [searchParams, setSearchParams];
  }
  /**
   * Creates a URLSearchParams object using the given initializer.
   *
   * This is identical to `new URLSearchParams(init)` except it also
   * supports arrays as values in the object form of the initializer
   * instead of just strings. This is convenient when you need multiple
   * values for a given key, but don't want to use an array initializer.
   *
   * For example, instead of:
   *
   *   let searchParams = new URLSearchParams([
   *     ['sort', 'name'],
   *     ['sort', 'price']
   *   ]);
   *
   * you can do:
   *
   *   let searchParams = createSearchParams({
   *     sort: ['name', 'price']
   *   });
   */
  
  
  function createSearchParams(init) {
    if (init === void 0) {
      init = "";
    }
  
    return new URLSearchParams(typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {
      let value = init[key];
      return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]);
    }, []));
  }
  
  var reactRouterDom$1 = /*#__PURE__*/Object.freeze({
    __proto__: null,
    BrowserRouter: BrowserRouter,
    HashRouter: HashRouter,
    Link: Link,
    NavLink: NavLink,
    createSearchParams: createSearchParams,
    unstable_HistoryRouter: HistoryRouter,
    useLinkClickHandler: useLinkClickHandler,
    useSearchParams: useSearchParams,
    MemoryRouter: MemoryRouter,
    Navigate: Navigate,
    Outlet: Outlet,
    Route: Route,
    Router: Router,
    Routes: Routes,
    UNSAFE_LocationContext: LocationContext,
    UNSAFE_NavigationContext: NavigationContext,
    UNSAFE_RouteContext: RouteContext,
    createRoutesFromChildren: createRoutesFromChildren,
    generatePath: generatePath,
    matchPath: matchPath,
    matchRoutes: matchRoutes,
    renderMatches: renderMatches,
    resolvePath: resolvePath,
    useHref: useHref,
    useInRouterContext: useInRouterContext,
    useLocation: useLocation,
    useMatch: useMatch,
    useNavigate: useNavigate,
    useNavigationType: useNavigationType,
    useOutlet: useOutlet,
    useOutletContext: useOutletContext,
    useParams: useParams,
    useResolvedPath: useResolvedPath,
    useRoutes: useRoutes
  });
  
  var require$$1 = /*@__PURE__*/getAugmentedNamespace(reactRouterDom$1);
  
  Object.defineProperty(dist$1, '__esModule', {
    value: true
  });
  
  var react = React__default["default"];
  
  var reactRouterDom = require$$1;
  
  function requiredArgs$1(required, args) {
    if (args.length < required) {
      throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
    }
  }
  /**
   * @name toDate
   * @category Common Helpers
   * @summary Convert the given argument to an instance of Date.
   *
   * @description
   * Convert the given argument to an instance of Date.
   *
   * If the argument is an instance of Date, the function returns its clone.
   *
   * If the argument is a number, it is treated as a timestamp.
   *
   * If the argument is none of the above, the function returns Invalid Date.
   *
   * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
   *
   * @param {Date|Number} argument - the value to convert
   * @returns {Date} the parsed date in the local time zone
   * @throws {TypeError} 1 argument required
   *
   * @example
   * // Clone the date:
   * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
   * //=> Tue Feb 11 2014 11:30:30
   *
   * @example
   * // Convert the timestamp to date:
   * const result = toDate(1392098430000)
   * //=> Tue Feb 11 2014 11:30:30
   */
  
  
  function toDate$1(argument) {
    requiredArgs$1(1, arguments);
    var argStr = Object.prototype.toString.call(argument); // Clone the date
  
    if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
      // Prevent the date to lose the milliseconds when passed to new Date() in IE10
      return new Date(argument.getTime());
    } else if (typeof argument === 'number' || argStr === '[object Number]') {
      return new Date(argument);
    } else {
      if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
        // eslint-disable-next-line no-console
        console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
  
        console.warn(new Error().stack);
      }
  
      return new Date(NaN);
    }
  }
  /**
   * @name differenceInMilliseconds
   * @category Millisecond Helpers
   * @summary Get the number of milliseconds between the given dates.
   *
   * @description
   * Get the number of milliseconds between the given dates.
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * @param {Date|Number} dateLeft - the later date
   * @param {Date|Number} dateRight - the earlier date
   * @returns {Number} the number of milliseconds
   * @throws {TypeError} 2 arguments required
   *
   * @example
   * // How many milliseconds are between
   * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
   * const result = differenceInMilliseconds(
   *   new Date(2014, 6, 2, 12, 30, 21, 700),
   *   new Date(2014, 6, 2, 12, 30, 20, 600)
   * )
   * //=> 1100
   */
  
  
  function differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) {
    requiredArgs$1(2, arguments);
    var dateLeft = toDate$1(dirtyDateLeft);
    var dateRight = toDate$1(dirtyDateRight);
    return dateLeft.getTime() - dateRight.getTime();
  }
  
  const useAlarm = (time, callback) => {
    const timeout_ref = react.useRef();
    react.useEffect(() => {
      const targetTime = differenceInMilliseconds(time, new Date());
  
      if (targetTime > 0) {
        timeout_ref.current = setTimeout(callback, targetTime);
      }
  
      return () => {
        if (timeout_ref.current) {
          clearTimeout(timeout_ref.current);
        }
      };
    }, [time, callback]);
  };
  
  const useArcTan = ({
    x = 0,
    p = 100,
    n = 50000,
    q = 5
  }) => {
    const value = react.useMemo(() => Math.atan((x - p / 2) / (p / q)) * (n / (Math.atan(q / 2) * 2)) + n / 2, [x, p, n]);
    return value;
  };
  
  var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof commonjsGlobal$2 !== 'undefined' ? commonjsGlobal$2 : typeof self !== 'undefined' ? self : {};
  var dist = {};
  Object.defineProperty(dist, '__esModule', {
    value: true
  });
  
  const arrayDiff = (a, b) => a.filter(i => b.indexOf(i) === -1);
  
  const chunk = (arr, len) => {
    const chunks = [];
    let i = 0;
    const n = arr.length;
  
    while (i < n) {
      chunks.push(arr.slice(i, i += len));
    }
  
    return chunks;
  };
  
  const coalesce = conditions => {
    const match = conditions.find(c => c[0] === true);
    return typeof match === 'undefined' ? conditions[conditions.length - 1] : match[1];
  };
  
  const dig = (object, path_string) => {
    const names = path_string.split('.');
    let value = object;
  
    for (let i = 0; i < names.length; i += 1) {
      if (!value) break;
      value = value[names[i]];
    }
  
    return value;
  };
  
  const decodeHTMLEntities = text => {
    const entities = [['amp', '&'], ['apos', "'"], ['#x27', "'"], ['#x2F', '/'], ['#39', "'"], ['#47', '/'], ['lt', '<'], ['gt', '>'], ['nbsp', ' '], ['quot', '"'], ['rsquo', "'"]];
    let decoded_text = text;
  
    for (let i = 0, max = entities.length; i < max; i += 1) decoded_text = decoded_text.replace(new RegExp(`&${entities[i][0]};`, 'g'), entities[i][1]);
  
    return decoded_text;
  };
  
  const escapeRegExp = str => str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
  
  const factorial = n => {
    const sign = BigInt(Math.sign(n));
    n = BigInt(Math.abs(n));
    if (n == 0) return BigInt(1);
    let r = BigInt(1);
  
    for (; n > 1; n--) r *= n;
  
    return r * sign;
  };
  
  const sample = arr => arr[Math.floor(Math.random() * arr.length)];
  
  const fakeCreditCard = (should_error = false) => {
    // Card number for Authorize.net only
    const number = should_error ? 4222222222222 : sample([// 42424242424242, //
    370000000000002, // American Express Test Card
    6011000000000012, // Discover Test Card
    5424000000000015, // MasterCard Test Card
    4007000000027, // Visa Test Card
    4012888818888 // Visa Test Card
    ]);
    return {
      number,
      zip: 33626,
      cvv: String(number).length === 15 ? '1234' : '123',
      expiry: `01/${new Date().getFullYear() - 1998}`
    };
  };
  
  const fontAwesomeIconToBlob = ({
    icon,
    iconName,
    prefix
  }, props = {
    fill: '#000'
  }) => {
    const svg = `
  		<svg
  			aria-hidden="true"
  			focusable="false"
  			data-prefix="${prefix}"
  			data-icon="${iconName}"
  			class="svg-inline--fa fa-${iconName} fa-w-12"
  			role="img"
  			xmlns="http://www.w3.org/2000/svg"
  			viewBox="0 0 ${icon[0]} ${icon[1]}"
  		>
  			<path fill="${props.fill}" d="${icon[4]}"></path>
  		</svg>
  	`;
    return new Blob([svg], {
      type: 'image/svg+xml'
    });
  };
  
  const fontAwesomeIconToBlobURL = (font_awesome_icon, props) => {
    const blob = fontAwesomeIconToBlob(font_awesome_icon, props);
    return URL.createObjectURL(blob);
  };
  
  const formatBytes = (bytes, decimals = 2) => {
    if (bytes === 0) return '0 Bytes';
    const k = 1024;
    const dm = decimals < 0 ? 0 : decimals;
    const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
    const i = Math.floor(Math.log(bytes) / Math.log(k));
    return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
  };
  
  const parseCurrencyFloat = (string = '') => parseFloat(String(string).replace(/[^\d.\-e]/g, ''));
  
  const parseCurrency = (string = '') => Number(parseCurrencyFloat(string).toFixed(2));
  
  const formatCurrency = (number_or_string, include_prefix = false) => {
    const formatted_currency = new Intl.NumberFormat('en', {
      style: 'currency',
      currency: 'USD'
    }).format(parseCurrencyFloat(number_or_string));
    return !include_prefix ? formatted_currency.replace('$', '') : formatted_currency;
  };
  
  const formatCurrencyInput = (string = '') => parseFloat(String(string).replace(/[^\d.\-e]/g, '')) / 100.0;
  
  function toInteger$1(dirtyNumber) {
    if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
      return NaN;
    }
  
    var number = Number(dirtyNumber);
  
    if (isNaN(number)) {
      return number;
    }
  
    return number < 0 ? Math.ceil(number) : Math.floor(number);
  }
  
  function requiredArgs(required, args) {
    if (args.length < required) {
      throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
    }
  }
  
  var MILLISECONDS_IN_HOUR = 3600000;
  var MILLISECONDS_IN_MINUTE = 60000;
  var DEFAULT_ADDITIONAL_DIGITS = 2;
  var patterns = {
    dateTimeDelimiter: /[T ]/,
    timeZoneDelimiter: /[Z ]/i,
    timezone: /([Z+-].*)$/
  };
  var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
  var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
  var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
  /**
   * @name parseISO
   * @category Common Helpers
   * @summary Parse ISO string
   *
   * @description
   * Parse the given string in ISO 8601 format and return an instance of Date.
   *
   * Function accepts complete ISO 8601 formats as well as partial implementations.
   * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
   *
   * If the argument isn't a string, the function cannot parse the string or
   * the values are invalid, it returns Invalid Date.
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * - The previous `parse` implementation was renamed to `parseISO`.
   *
   *   ```javascript
   *   // Before v2.0.0
   *   parse('2016-01-01')
   *
   *   // v2.0.0 onward
   *   parseISO('2016-01-01')
   *   ```
   *
   * - `parseISO` now validates separate date and time values in ISO-8601 strings
   *   and returns `Invalid Date` if the date is invalid.
   *
   *   ```javascript
   *   parseISO('2018-13-32')
   *   //=> Invalid Date
   *   ```
   *
   * - `parseISO` now doesn't fall back to `new Date` constructor
   *   if it fails to parse a string argument. Instead, it returns `Invalid Date`.
   *
   * @param {String} argument - the value to convert
   * @param {Object} [options] - an object with options.
   * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format
   * @returns {Date} the parsed date in the local time zone
   * @throws {TypeError} 1 argument required
   * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2
   *
   * @example
   * // Convert string '2014-02-11T11:30:30' to date:
   * var result = parseISO('2014-02-11T11:30:30')
   * //=> Tue Feb 11 2014 11:30:30
   *
   * @example
   * // Convert string '+02014101' to date,
   * // if the additional number of digits in the extended year format is 1:
   * var result = parseISO('+02014101', { additionalDigits: 1 })
   * //=> Fri Apr 11 2014 00:00:00
   */
  
  function parseISO(argument, dirtyOptions) {
    requiredArgs(1, arguments);
    var options = dirtyOptions || {};
    var additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : toInteger$1(options.additionalDigits);
  
    if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
      throw new RangeError('additionalDigits must be 0, 1 or 2');
    }
  
    if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {
      return new Date(NaN);
    }
  
    var dateStrings = splitDateString(argument);
    var date;
  
    if (dateStrings.date) {
      var parseYearResult = parseYear(dateStrings.date, additionalDigits);
      date = parseDate(parseYearResult.restDateString, parseYearResult.year);
    }
  
    if (isNaN(date) || !date) {
      return new Date(NaN);
    }
  
    var timestamp = date.getTime();
    var time = 0;
    var offset;
  
    if (dateStrings.time) {
      time = parseTime(dateStrings.time);
  
      if (isNaN(time) || time === null) {
        return new Date(NaN);
      }
    }
  
    if (dateStrings.timezone) {
      offset = parseTimezone(dateStrings.timezone);
  
      if (isNaN(offset)) {
        return new Date(NaN);
      }
    } else {
      var dirtyDate = new Date(timestamp + time); // js parsed string assuming it's in UTC timezone
      // but we need it to be parsed in our timezone
      // so we use utc values to build date in our timezone.
      // Year values from 0 to 99 map to the years 1900 to 1999
      // so set year explicitly with setFullYear.
  
      var result = new Date(0);
      result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
      result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
      return result;
    }
  
    return new Date(timestamp + time + offset);
  }
  
  function splitDateString(dateString) {
    var dateStrings = {};
    var array = dateString.split(patterns.dateTimeDelimiter);
    var timeString; // The regex match should only return at maximum two array elements.
    // [date], [time], or [date, time].
  
    if (array.length > 2) {
      return dateStrings;
    }
  
    if (/:/.test(array[0])) {
      dateStrings.date = null;
      timeString = array[0];
    } else {
      dateStrings.date = array[0];
      timeString = array[1];
  
      if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
        dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
        timeString = dateString.substr(dateStrings.date.length, dateString.length);
      }
    }
  
    if (timeString) {
      var token = patterns.timezone.exec(timeString);
  
      if (token) {
        dateStrings.time = timeString.replace(token[1], '');
        dateStrings.timezone = token[1];
      } else {
        dateStrings.time = timeString;
      }
    }
  
    return dateStrings;
  }
  
  function parseYear(dateString, additionalDigits) {
    var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)');
    var captures = dateString.match(regex); // Invalid ISO-formatted year
  
    if (!captures) return {
      year: null
    };
    var year = captures[1] && parseInt(captures[1]);
    var century = captures[2] && parseInt(captures[2]);
    return {
      year: century == null ? year : century * 100,
      restDateString: dateString.slice((captures[1] || captures[2]).length)
    };
  }
  
  function parseDate(dateString, year) {
    // Invalid ISO-formatted year
    if (year === null) return null;
    var captures = dateString.match(dateRegex); // Invalid ISO-formatted string
  
    if (!captures) return null;
    var isWeekDate = !!captures[4];
    var dayOfYear = parseDateUnit(captures[1]);
    var month = parseDateUnit(captures[2]) - 1;
    var day = parseDateUnit(captures[3]);
    var week = parseDateUnit(captures[4]);
    var dayOfWeek = parseDateUnit(captures[5]) - 1;
  
    if (isWeekDate) {
      if (!validateWeekDate(year, week, dayOfWeek)) {
        return new Date(NaN);
      }
  
      return dayOfISOWeekYear(year, week, dayOfWeek);
    } else {
      var date = new Date(0);
  
      if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
        return new Date(NaN);
      }
  
      date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
      return date;
    }
  }
  
  function parseDateUnit(value) {
    return value ? parseInt(value) : 1;
  }
  
  function parseTime(timeString) {
    var captures = timeString.match(timeRegex);
    if (!captures) return null; // Invalid ISO-formatted time
  
    var hours = parseTimeUnit(captures[1]);
    var minutes = parseTimeUnit(captures[2]);
    var seconds = parseTimeUnit(captures[3]);
  
    if (!validateTime(hours, minutes, seconds)) {
      return NaN;
    }
  
    return hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1000;
  }
  
  function parseTimeUnit(value) {
    return value && parseFloat(value.replace(',', '.')) || 0;
  }
  
  function parseTimezone(timezoneString) {
    if (timezoneString === 'Z') return 0;
    var captures = timezoneString.match(timezoneRegex);
    if (!captures) return 0;
    var sign = captures[1] === '+' ? -1 : 1;
    var hours = parseInt(captures[2]);
    var minutes = captures[3] && parseInt(captures[3]) || 0;
  
    if (!validateTimezone(hours, minutes)) {
      return NaN;
    }
  
    return sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE);
  }
  
  function dayOfISOWeekYear(isoWeekYear, week, day) {
    var date = new Date(0);
    date.setUTCFullYear(isoWeekYear, 0, 4);
    var fourthOfJanuaryDay = date.getUTCDay() || 7;
    var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
    date.setUTCDate(date.getUTCDate() + diff);
    return date;
  } // Validation functions
  // February is null to handle the leap year (using ||)
  
  
  var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  
  function isLeapYearIndex(year) {
    return year % 400 === 0 || year % 4 === 0 && year % 100;
  }
  
  function validateDate(year, month, date) {
    return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
  }
  
  function validateDayOfYearDate(year, dayOfYear) {
    return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
  }
  
  function validateWeekDate(_year, week, day) {
    return week >= 1 && week <= 53 && day >= 0 && day <= 6;
  }
  
  function validateTime(hours, minutes, seconds) {
    if (hours === 24) {
      return minutes === 0 && seconds === 0;
    }
  
    return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
  }
  
  function validateTimezone(_hours, minutes) {
    return minutes >= 0 && minutes <= 59;
  }
  /**
   * @name toDate
   * @category Common Helpers
   * @summary Convert the given argument to an instance of Date.
   *
   * @description
   * Convert the given argument to an instance of Date.
   *
   * If the argument is an instance of Date, the function returns its clone.
   *
   * If the argument is a number, it is treated as a timestamp.
   *
   * If the argument is none of the above, the function returns Invalid Date.
   *
   * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
   *
   * @param {Date|Number} argument - the value to convert
   * @returns {Date} the parsed date in the local time zone
   * @throws {TypeError} 1 argument required
   *
   * @example
   * // Clone the date:
   * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
   * //=> Tue Feb 11 2014 11:30:30
   *
   * @example
   * // Convert the timestamp to date:
   * const result = toDate(1392098430000)
   * //=> Tue Feb 11 2014 11:30:30
   */
  
  
  function toDate(argument) {
    requiredArgs(1, arguments);
    var argStr = Object.prototype.toString.call(argument); // Clone the date
  
    if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
      // Prevent the date to lose the milliseconds when passed to new Date() in IE10
      return new Date(argument.getTime());
    } else if (typeof argument === 'number' || argStr === '[object Number]') {
      return new Date(argument);
    } else {
      if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
        // eslint-disable-next-line no-console
        console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
  
        console.warn(new Error().stack);
      }
  
      return new Date(NaN);
    }
  }
  /**
   * @name startOfDay
   * @category Day Helpers
   * @summary Return the start of a day for the given date.
   *
   * @description
   * Return the start of a day for the given date.
   * The result will be in the local timezone.
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * @param {Date|Number} date - the original date
   * @returns {Date} the start of a day
   * @throws {TypeError} 1 argument required
   *
   * @example
   * // The start of a day for 2 September 2014 11:55:00:
   * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
   * //=> Tue Sep 02 2014 00:00:00
   */
  
  
  function startOfDay(dirtyDate) {
    requiredArgs(1, arguments);
    var date = toDate(dirtyDate);
    date.setHours(0, 0, 0, 0);
    return date;
  }
  /**
   * @name isSameDay
   * @category Day Helpers
   * @summary Are the given dates in the same day?
   *
   * @description
   * Are the given dates in the same day?
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * @param {Date|Number} dateLeft - the first date to check
   * @param {Date|Number} dateRight - the second date to check
   * @returns {Boolean} the dates are in the same day
   * @throws {TypeError} 2 arguments required
   *
   * @example
   * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
   * var result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
   * //=> true
   */
  
  
  function isSameDay(dirtyDateLeft, dirtyDateRight) {
    requiredArgs(2, arguments);
    var dateLeftStartOfDay = startOfDay(dirtyDateLeft);
    var dateRightStartOfDay = startOfDay(dirtyDateRight);
    return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();
  }
  /**
   * @name isSameMonth
   * @category Month Helpers
   * @summary Are the given dates in the same month?
   *
   * @description
   * Are the given dates in the same month?
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * @param {Date|Number} dateLeft - the first date to check
   * @param {Date|Number} dateRight - the second date to check
   * @returns {Boolean} the dates are in the same month
   * @throws {TypeError} 2 arguments required
   *
   * @example
   * // Are 2 September 2014 and 25 September 2014 in the same month?
   * var result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))
   * //=> true
   */
  
  
  function isSameMonth(dirtyDateLeft, dirtyDateRight) {
    requiredArgs(2, arguments);
    var dateLeft = toDate(dirtyDateLeft);
    var dateRight = toDate(dirtyDateRight);
    return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth();
  }
  /**
   * @name isSameYear
   * @category Year Helpers
   * @summary Are the given dates in the same year?
   *
   * @description
   * Are the given dates in the same year?
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * @param {Date|Number} dateLeft - the first date to check
   * @param {Date|Number} dateRight - the second date to check
   * @returns {Boolean} the dates are in the same year
   * @throws {TypeError} 2 arguments required
   *
   * @example
   * // Are 2 September 2014 and 25 September 2014 in the same year?
   * var result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))
   * //=> true
   */
  
  
  function isSameYear(dirtyDateLeft, dirtyDateRight) {
    requiredArgs(2, arguments);
    var dateLeft = toDate(dirtyDateLeft);
    var dateRight = toDate(dirtyDateRight);
    return dateLeft.getFullYear() === dateRight.getFullYear();
  }
  /**
   * @name isValid
   * @category Common Helpers
   * @summary Is the given date valid?
   *
   * @description
   * Returns false if argument is Invalid Date and true otherwise.
   * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
   * Invalid Date is a Date, whose time value is NaN.
   *
   * Time value of Date: http://es5.github.io/#x15.9.1.1
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * - Now `isValid` doesn't throw an exception
   *   if the first argument is not an instance of Date.
   *   Instead, argument is converted beforehand using `toDate`.
   *
   *   Examples:
   *
   *   | `isValid` argument        | Before v2.0.0 | v2.0.0 onward |
   *   |---------------------------|---------------|---------------|
   *   | `new Date()`              | `true`        | `true`        |
   *   | `new Date('2016-01-01')`  | `true`        | `true`        |
   *   | `new Date('')`            | `false`       | `false`       |
   *   | `new Date(1488370835081)` | `true`        | `true`        |
   *   | `new Date(NaN)`           | `false`       | `false`       |
   *   | `'2016-01-01'`            | `TypeError`   | `false`       |
   *   | `''`                      | `TypeError`   | `false`       |
   *   | `1488370835081`           | `TypeError`   | `true`        |
   *   | `NaN`                     | `TypeError`   | `false`       |
   *
   *   We introduce this change to make *date-fns* consistent with ECMAScript behavior
   *   that try to coerce arguments to the expected type
   *   (which is also the case with other *date-fns* functions).
   *
   * @param {*} date - the date to check
   * @returns {Boolean} the date is valid
   * @throws {TypeError} 1 argument required
   *
   * @example
   * // For the valid date:
   * var result = isValid(new Date(2014, 1, 31))
   * //=> true
   *
   * @example
   * // For the value, convertable into a date:
   * var result = isValid(1393804800000)
   * //=> true
   *
   * @example
   * // For the invalid date:
   * var result = isValid(new Date(''))
   * //=> false
   */
  
  
  function isValid(dirtyDate) {
    requiredArgs(1, arguments);
    var date = toDate(dirtyDate);
    return !isNaN(date);
  }
  
  var formatDistanceLocale = {
    lessThanXSeconds: {
      one: 'less than a second',
      other: 'less than {{count}} seconds'
    },
    xSeconds: {
      one: '1 second',
      other: '{{count}} seconds'
    },
    halfAMinute: 'half a minute',
    lessThanXMinutes: {
      one: 'less than a minute',
      other: 'less than {{count}} minutes'
    },
    xMinutes: {
      one: '1 minute',
      other: '{{count}} minutes'
    },
    aboutXHours: {
      one: 'about 1 hour',
      other: 'about {{count}} hours'
    },
    xHours: {
      one: '1 hour',
      other: '{{count}} hours'
    },
    xDays: {
      one: '1 day',
      other: '{{count}} days'
    },
    aboutXWeeks: {
      one: 'about 1 week',
      other: 'about {{count}} weeks'
    },
    xWeeks: {
      one: '1 week',
      other: '{{count}} weeks'
    },
    aboutXMonths: {
      one: 'about 1 month',
      other: 'about {{count}} months'
    },
    xMonths: {
      one: '1 month',
      other: '{{count}} months'
    },
    aboutXYears: {
      one: 'about 1 year',
      other: 'about {{count}} years'
    },
    xYears: {
      one: '1 year',
      other: '{{count}} years'
    },
    overXYears: {
      one: 'over 1 year',
      other: 'over {{count}} years'
    },
    almostXYears: {
      one: 'almost 1 year',
      other: 'almost {{count}} years'
    }
  };
  
  function formatDistance(token, count, options) {
    options = options || {};
    var result;
  
    if (typeof formatDistanceLocale[token] === 'string') {
      result = formatDistanceLocale[token];
    } else if (count === 1) {
      result = formatDistanceLocale[token].one;
    } else {
      result = formatDistanceLocale[token].other.replace('{{count}}', count);
    }
  
    if (options.addSuffix) {
      if (options.comparison > 0) {
        return 'in ' + result;
      } else {
        return result + ' ago';
      }
    }
  
    return result;
  }
  
  function buildFormatLongFn(args) {
    return function (dirtyOptions) {
      var options = dirtyOptions || {};
      var width = options.width ? String(options.width) : args.defaultWidth;
      var format = args.formats[width] || args.formats[args.defaultWidth];
      return format;
    };
  }
  
  var dateFormats = {
    full: 'EEEE, MMMM do, y',
    long: 'MMMM do, y',
    medium: 'MMM d, y',
    short: 'MM/dd/yyyy'
  };
  var timeFormats = {
    full: 'h:mm:ss a zzzz',
    long: 'h:mm:ss a z',
    medium: 'h:mm:ss a',
    short: 'h:mm a'
  };
  var dateTimeFormats = {
    full: "{{date}} 'at' {{time}}",
    long: "{{date}} 'at' {{time}}",
    medium: '{{date}}, {{time}}',
    short: '{{date}}, {{time}}'
  };
  var formatLong = {
    date: buildFormatLongFn({
      formats: dateFormats,
      defaultWidth: 'full'
    }),
    time: buildFormatLongFn({
      formats: timeFormats,
      defaultWidth: 'full'
    }),
    dateTime: buildFormatLongFn({
      formats: dateTimeFormats,
      defaultWidth: 'full'
    })
  };
  var formatRelativeLocale = {
    lastWeek: "'last' eeee 'at' p",
    yesterday: "'yesterday at' p",
    today: "'today at' p",
    tomorrow: "'tomorrow at' p",
    nextWeek: "eeee 'at' p",
    other: 'P'
  };
  
  function formatRelative(token, _date, _baseDate, _options) {
    return formatRelativeLocale[token];
  }
  
  function buildLocalizeFn(args) {
    return function (dirtyIndex, dirtyOptions) {
      var options = dirtyOptions || {};
      var context = options.context ? String(options.context) : 'standalone';
      var valuesArray;
  
      if (context === 'formatting' && args.formattingValues) {
        var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
        var width = options.width ? String(options.width) : defaultWidth;
        valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
      } else {
        var _defaultWidth = args.defaultWidth;
  
        var _width = options.width ? String(options.width) : args.defaultWidth;
  
        valuesArray = args.values[_width] || args.values[_defaultWidth];
      }
  
      var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
      return valuesArray[index];
    };
  }
  
  var eraValues = {
    narrow: ['B', 'A'],
    abbreviated: ['BC', 'AD'],
    wide: ['Before Christ', 'Anno Domini']
  };
  var quarterValues = {
    narrow: ['1', '2', '3', '4'],
    abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
    wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] // Note: in English, the names of days of the week and months are capitalized.
    // If you are making a new locale based on this one, check if the same is true for the language you're working on.
    // Generally, formatted dates should look like they are in the middle of a sentence,
    // e.g. in Spanish language the weekdays and months should be in the lowercase.
  
  };
  var monthValues = {
    narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
    abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
    wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
  };
  var dayValues = {
    narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
    short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
    abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
    wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
  };
  var dayPeriodValues = {
    narrow: {
      am: 'a',
      pm: 'p',
      midnight: 'mi',
      noon: 'n',
      morning: 'morning',
      afternoon: 'afternoon',
      evening: 'evening',
      night: 'night'
    },
    abbreviated: {
      am: 'AM',
      pm: 'PM',
      midnight: 'midnight',
      noon: 'noon',
      morning: 'morning',
      afternoon: 'afternoon',
      evening: 'evening',
      night: 'night'
    },
    wide: {
      am: 'a.m.',
      pm: 'p.m.',
      midnight: 'midnight',
      noon: 'noon',
      morning: 'morning',
      afternoon: 'afternoon',
      evening: 'evening',
      night: 'night'
    }
  };
  var formattingDayPeriodValues = {
    narrow: {
      am: 'a',
      pm: 'p',
      midnight: 'mi',
      noon: 'n',
      morning: 'in the morning',
      afternoon: 'in the afternoon',
      evening: 'in the evening',
      night: 'at night'
    },
    abbreviated: {
      am: 'AM',
      pm: 'PM',
      midnight: 'midnight',
      noon: 'noon',
      morning: 'in the morning',
      afternoon: 'in the afternoon',
      evening: 'in the evening',
      night: 'at night'
    },
    wide: {
      am: 'a.m.',
      pm: 'p.m.',
      midnight: 'midnight',
      noon: 'noon',
      morning: 'in the morning',
      afternoon: 'in the afternoon',
      evening: 'in the evening',
      night: 'at night'
    }
  };
  
  function ordinalNumber(dirtyNumber, _dirtyOptions) {
    var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
    // if they are different for different grammatical genders,
    // use `options.unit`:
    //
    //   var options = dirtyOptions || {}
    //   var unit = String(options.unit)
    //
    // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
    // 'day', 'hour', 'minute', 'second'
  
    var rem100 = number % 100;
  
    if (rem100 > 20 || rem100 < 10) {
      switch (rem100 % 10) {
        case 1:
          return number + 'st';
  
        case 2:
          return number + 'nd';
  
        case 3:
          return number + 'rd';
      }
    }
  
    return number + 'th';
  }
  
  var localize = {
    ordinalNumber: ordinalNumber,
    era: buildLocalizeFn({
      values: eraValues,
      defaultWidth: 'wide'
    }),
    quarter: buildLocalizeFn({
      values: quarterValues,
      defaultWidth: 'wide',
      argumentCallback: function (quarter) {
        return Number(quarter) - 1;
      }
    }),
    month: buildLocalizeFn({
      values: monthValues,
      defaultWidth: 'wide'
    }),
    day: buildLocalizeFn({
      values: dayValues,
      defaultWidth: 'wide'
    }),
    dayPeriod: buildLocalizeFn({
      values: dayPeriodValues,
      defaultWidth: 'wide',
      formattingValues: formattingDayPeriodValues,
      defaultFormattingWidth: 'wide'
    })
  };
  
  function buildMatchPatternFn(args) {
    return function (dirtyString, dirtyOptions) {
      var string = String(dirtyString);
      var options = dirtyOptions || {};
      var matchResult = string.match(args.matchPattern);
  
      if (!matchResult) {
        return null;
      }
  
      var matchedString = matchResult[0];
      var parseResult = string.match(args.parsePattern);
  
      if (!parseResult) {
        return null;
      }
  
      var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
      value = options.valueCallback ? options.valueCallback(value) : value;
      return {
        value: value,
        rest: string.slice(matchedString.length)
      };
    };
  }
  
  function buildMatchFn(args) {
    return function (dirtyString, dirtyOptions) {
      var string = String(dirtyString);
      var options = dirtyOptions || {};
      var width = options.width;
      var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
      var matchResult = string.match(matchPattern);
  
      if (!matchResult) {
        return null;
      }
  
      var matchedString = matchResult[0];
      var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
      var value;
  
      if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {
        value = findIndex(parsePatterns, function (pattern) {
          return pattern.test(matchedString);
        });
      } else {
        value = findKey(parsePatterns, function (pattern) {
          return pattern.test(matchedString);
        });
      }
  
      value = args.valueCallback ? args.valueCallback(value) : value;
      value = options.valueCallback ? options.valueCallback(value) : value;
      return {
        value: value,
        rest: string.slice(matchedString.length)
      };
    };
  }
  
  function findKey(object, predicate) {
    for (var key in object) {
      if (object.hasOwnProperty(key) && predicate(object[key])) {
        return key;
      }
    }
  }
  
  function findIndex(array, predicate) {
    for (var key = 0; key < array.length; key++) {
      if (predicate(array[key])) {
        return key;
      }
    }
  }
  
  var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
  var parseOrdinalNumberPattern = /\d+/i;
  var matchEraPatterns = {
    narrow: /^(b|a)/i,
    abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
    wide: /^(before christ|before common era|anno domini|common era)/i
  };
  var parseEraPatterns = {
    any: [/^b/i, /^(a|c)/i]
  };
  var matchQuarterPatterns = {
    narrow: /^[1234]/i,
    abbreviated: /^q[1234]/i,
    wide: /^[1234](th|st|nd|rd)? quarter/i
  };
  var parseQuarterPatterns = {
    any: [/1/i, /2/i, /3/i, /4/i]
  };
  var matchMonthPatterns = {
    narrow: /^[jfmasond]/i,
    abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
    wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
  };
  var parseMonthPatterns = {
    narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
    any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
  };
  var matchDayPatterns = {
    narrow: /^[smtwf]/i,
    short: /^(su|mo|tu|we|th|fr|sa)/i,
    abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
    wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
  };
  var parseDayPatterns = {
    narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
    any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
  };
  var matchDayPeriodPatterns = {
    narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
    any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
  };
  var parseDayPeriodPatterns = {
    any: {
      am: /^a/i,
      pm: /^p/i,
      midnight: /^mi/i,
      noon: /^no/i,
      morning: /morning/i,
      afternoon: /afternoon/i,
      evening: /evening/i,
      night: /night/i
    }
  };
  var match = {
    ordinalNumber: buildMatchPatternFn({
      matchPattern: matchOrdinalNumberPattern,
      parsePattern: parseOrdinalNumberPattern,
      valueCallback: function (value) {
        return parseInt(value, 10);
      }
    }),
    era: buildMatchFn({
      matchPatterns: matchEraPatterns,
      defaultMatchWidth: 'wide',
      parsePatterns: parseEraPatterns,
      defaultParseWidth: 'any'
    }),
    quarter: buildMatchFn({
      matchPatterns: matchQuarterPatterns,
      defaultMatchWidth: 'wide',
      parsePatterns: parseQuarterPatterns,
      defaultParseWidth: 'any',
      valueCallback: function (index) {
        return index + 1;
      }
    }),
    month: buildMatchFn({
      matchPatterns: matchMonthPatterns,
      defaultMatchWidth: 'wide',
      parsePatterns: parseMonthPatterns,
      defaultParseWidth: 'any'
    }),
    day: buildMatchFn({
      matchPatterns: matchDayPatterns,
      defaultMatchWidth: 'wide',
      parsePatterns: parseDayPatterns,
      defaultParseWidth: 'any'
    }),
    dayPeriod: buildMatchFn({
      matchPatterns: matchDayPeriodPatterns,
      defaultMatchWidth: 'any',
      parsePatterns: parseDayPeriodPatterns,
      defaultParseWidth: 'any'
    })
  };
  /**
   * @type {Locale}
   * @category Locales
   * @summary English locale (United States).
   * @language English
   * @iso-639-2 eng
   * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
   * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
   */
  
  var locale = {
    code: 'en-US',
    formatDistance: formatDistance,
    formatLong: formatLong,
    formatRelative: formatRelative,
    localize: localize,
    match: match,
    options: {
      weekStartsOn: 0
      /* Sunday */
      ,
      firstWeekContainsDate: 1
    }
  };
  /**
   * @name addMilliseconds
   * @category Millisecond Helpers
   * @summary Add the specified number of milliseconds to the given date.
   *
   * @description
   * Add the specified number of milliseconds to the given date.
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * @param {Date|Number} date - the date to be changed
   * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
   * @returns {Date} the new date with the milliseconds added
   * @throws {TypeError} 2 arguments required
   *
   * @example
   * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
   * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
   * //=> Thu Jul 10 2014 12:45:30.750
   */
  
  function addMilliseconds$1(dirtyDate, dirtyAmount) {
    requiredArgs(2, arguments);
    var timestamp = toDate(dirtyDate).getTime();
    var amount = toInteger$1(dirtyAmount);
    return new Date(timestamp + amount);
  }
  /**
   * @name subMilliseconds
   * @category Millisecond Helpers
   * @summary Subtract the specified number of milliseconds from the given date.
   *
   * @description
   * Subtract the specified number of milliseconds from the given date.
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * @param {Date|Number} date - the date to be changed
   * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
   * @returns {Date} the new date with the milliseconds subtracted
   * @throws {TypeError} 2 arguments required
   *
   * @example
   * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
   * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
   * //=> Thu Jul 10 2014 12:45:29.250
   */
  
  
  function subMilliseconds(dirtyDate, dirtyAmount) {
    requiredArgs(2, arguments);
    var amount = toInteger$1(dirtyAmount);
    return addMilliseconds$1(dirtyDate, -amount);
  }
  
  function addLeadingZeros(number, targetLength) {
    var sign = number < 0 ? '-' : '';
    var output = Math.abs(number).toString();
  
    while (output.length < targetLength) {
      output = '0' + output;
    }
  
    return sign + output;
  }
  /*
   * |     | Unit                           |     | Unit                           |
   * |-----|--------------------------------|-----|--------------------------------|
   * |  a  | AM, PM                         |  A* |                                |
   * |  d  | Day of month                   |  D  |                                |
   * |  h  | Hour [1-12]                    |  H  | Hour [0-23]                    |
   * |  m  | Minute                         |  M  | Month                          |
   * |  s  | Second                         |  S  | Fraction of second             |
   * |  y  | Year (abs)                     |  Y  |                                |
   *
   * Letters marked by * are not implemented but reserved by Unicode standard.
   */
  
  
  var formatters$1 = {
    // Year
    y: function (date, token) {
      // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
      // | Year     |     y | yy |   yyy |  yyyy | yyyyy |
      // |----------|-------|----|-------|-------|-------|
      // | AD 1     |     1 | 01 |   001 |  0001 | 00001 |
      // | AD 12    |    12 | 12 |   012 |  0012 | 00012 |
      // | AD 123   |   123 | 23 |   123 |  0123 | 00123 |
      // | AD 1234  |  1234 | 34 |  1234 |  1234 | 01234 |
      // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
      var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
  
      var year = signedYear > 0 ? signedYear : 1 - signedYear;
      return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
    },
    // Month
    M: function (date, token) {
      var month = date.getUTCMonth();
      return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
    },
    // Day of the month
    d: function (date, token) {
      return addLeadingZeros(date.getUTCDate(), token.length);
    },
    // AM or PM
    a: function (date, token) {
      var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
  
      switch (token) {
        case 'a':
        case 'aa':
          return dayPeriodEnumValue.toUpperCase();
  
        case 'aaa':
          return dayPeriodEnumValue;
  
        case 'aaaaa':
          return dayPeriodEnumValue[0];
  
        case 'aaaa':
        default:
          return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
      }
    },
    // Hour [1-12]
    h: function (date, token) {
      return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
    },
    // Hour [0-23]
    H: function (date, token) {
      return addLeadingZeros(date.getUTCHours(), token.length);
    },
    // Minute
    m: function (date, token) {
      return addLeadingZeros(date.getUTCMinutes(), token.length);
    },
    // Second
    s: function (date, token) {
      return addLeadingZeros(date.getUTCSeconds(), token.length);
    },
    // Fraction of second
    S: function (date, token) {
      var numberOfDigits = token.length;
      var milliseconds = date.getUTCMilliseconds();
      var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
      return addLeadingZeros(fractionalSeconds, token.length);
    }
  };
  var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
  // See issue: https://github.com/date-fns/date-fns/issues/376
  
  function getUTCDayOfYear(dirtyDate) {
    requiredArgs(1, arguments);
    var date = toDate(dirtyDate);
    var timestamp = date.getTime();
    date.setUTCMonth(0, 1);
    date.setUTCHours(0, 0, 0, 0);
    var startOfYearTimestamp = date.getTime();
    var difference = timestamp - startOfYearTimestamp;
    return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
  } // See issue: https://github.com/date-fns/date-fns/issues/376
  
  
  function startOfUTCISOWeek(dirtyDate) {
    requiredArgs(1, arguments);
    var weekStartsOn = 1;
    var date = toDate(dirtyDate);
    var day = date.getUTCDay();
    var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
    date.setUTCDate(date.getUTCDate() - diff);
    date.setUTCHours(0, 0, 0, 0);
    return date;
  } // See issue: https://github.com/date-fns/date-fns/issues/376
  
  
  function getUTCISOWeekYear(dirtyDate) {
    requiredArgs(1, arguments);
    var date = toDate(dirtyDate);
    var year = date.getUTCFullYear();
    var fourthOfJanuaryOfNextYear = new Date(0);
    fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
    fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
    var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
    var fourthOfJanuaryOfThisYear = new Date(0);
    fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
    fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
    var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
  
    if (date.getTime() >= startOfNextYear.getTime()) {
      return year + 1;
    } else if (date.getTime() >= startOfThisYear.getTime()) {
      return year;
    } else {
      return year - 1;
    }
  } // See issue: https://github.com/date-fns/date-fns/issues/376
  
  
  function startOfUTCISOWeekYear(dirtyDate) {
    requiredArgs(1, arguments);
    var year = getUTCISOWeekYear(dirtyDate);
    var fourthOfJanuary = new Date(0);
    fourthOfJanuary.setUTCFullYear(year, 0, 4);
    fourthOfJanuary.setUTCHours(0, 0, 0, 0);
    var date = startOfUTCISOWeek(fourthOfJanuary);
    return date;
  }
  
  var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
  // See issue: https://github.com/date-fns/date-fns/issues/376
  
  function getUTCISOWeek(dirtyDate) {
    requiredArgs(1, arguments);
    var date = toDate(dirtyDate);
    var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
    // because the number of milliseconds in a week is not constant
    // (e.g. it's different in the week of the daylight saving time clock shift)
  
    return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
  } // See issue: https://github.com/date-fns/date-fns/issues/376
  
  
  function startOfUTCWeek(dirtyDate, dirtyOptions) {
    requiredArgs(1, arguments);
    var options = dirtyOptions || {};
    var locale = options.locale;
    var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
    var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger$1(localeWeekStartsOn);
    var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger$1(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
  
    if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
      throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
    }
  
    var date = toDate(dirtyDate);
    var day = date.getUTCDay();
    var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
    date.setUTCDate(date.getUTCDate() - diff);
    date.setUTCHours(0, 0, 0, 0);
    return date;
  } // See issue: https://github.com/date-fns/date-fns/issues/376
  
  
  function getUTCWeekYear(dirtyDate, dirtyOptions) {
    requiredArgs(1, arguments);
    var date = toDate(dirtyDate, dirtyOptions);
    var year = date.getUTCFullYear();
    var options = dirtyOptions || {};
    var locale = options.locale;
    var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
    var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger$1(localeFirstWeekContainsDate);
    var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger$1(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
  
    if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
      throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
    }
  
    var firstWeekOfNextYear = new Date(0);
    firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
    firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
    var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
    var firstWeekOfThisYear = new Date(0);
    firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
    firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
    var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
  
    if (date.getTime() >= startOfNextYear.getTime()) {
      return year + 1;
    } else if (date.getTime() >= startOfThisYear.getTime()) {
      return year;
    } else {
      return year - 1;
    }
  } // See issue: https://github.com/date-fns/date-fns/issues/376
  
  
  function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
    requiredArgs(1, arguments);
    var options = dirtyOptions || {};
    var locale = options.locale;
    var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
    var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger$1(localeFirstWeekContainsDate);
    var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger$1(options.firstWeekContainsDate);
    var year = getUTCWeekYear(dirtyDate, dirtyOptions);
    var firstWeek = new Date(0);
    firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
    firstWeek.setUTCHours(0, 0, 0, 0);
    var date = startOfUTCWeek(firstWeek, dirtyOptions);
    return date;
  }
  
  var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
  // See issue: https://github.com/date-fns/date-fns/issues/376
  
  function getUTCWeek(dirtyDate, options) {
    requiredArgs(1, arguments);
    var date = toDate(dirtyDate);
    var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
    // because the number of milliseconds in a week is not constant
    // (e.g. it's different in the week of the daylight saving time clock shift)
  
    return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
  }
  
  var dayPeriodEnum = {
    am: 'am',
    pm: 'pm',
    midnight: 'midnight',
    noon: 'noon',
    morning: 'morning',
    afternoon: 'afternoon',
    evening: 'evening',
    night: 'night'
    /*
     * |     | Unit                           |     | Unit                           |
     * |-----|--------------------------------|-----|--------------------------------|
     * |  a  | AM, PM                         |  A* | Milliseconds in day            |
     * |  b  | AM, PM, noon, midnight         |  B  | Flexible day period            |
     * |  c  | Stand-alone local day of week  |  C* | Localized hour w/ day period   |
     * |  d  | Day of month                   |  D  | Day of year                    |
     * |  e  | Local day of week              |  E  | Day of week                    |
     * |  f  |                                |  F* | Day of week in month           |
     * |  g* | Modified Julian day            |  G  | Era                            |
     * |  h  | Hour [1-12]                    |  H  | Hour [0-23]                    |
     * |  i! | ISO day of week                |  I! | ISO week of year               |
     * |  j* | Localized hour w/ day period   |  J* | Localized hour w/o day period  |
     * |  k  | Hour [1-24]                    |  K  | Hour [0-11]                    |
     * |  l* | (deprecated)                   |  L  | Stand-alone month              |
     * |  m  | Minute                         |  M  | Month                          |
     * |  n  |                                |  N  |                                |
     * |  o! | Ordinal number modifier        |  O  | Timezone (GMT)                 |
     * |  p! | Long localized time            |  P! | Long localized date            |
     * |  q  | Stand-alone quarter            |  Q  | Quarter                        |
     * |  r* | Related Gregorian year         |  R! | ISO week-numbering year        |
     * |  s  | Second                         |  S  | Fraction of second             |
     * |  t! | Seconds timestamp              |  T! | Milliseconds timestamp         |
     * |  u  | Extended year                  |  U* | Cyclic year                    |
     * |  v* | Timezone (generic non-locat.)  |  V* | Timezone (location)            |
     * |  w  | Local week of year             |  W* | Week of month                  |
     * |  x  | Timezone (ISO-8601 w/o Z)      |  X  | Timezone (ISO-8601)            |
     * |  y  | Year (abs)                     |  Y  | Local week-numbering year      |
     * |  z  | Timezone (specific non-locat.) |  Z* | Timezone (aliases)             |
     *
     * Letters marked by * are not implemented but reserved by Unicode standard.
     *
     * Letters marked by ! are non-standard, but implemented by date-fns:
     * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
     * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
     *   i.e. 7 for Sunday, 1 for Monday, etc.
     * - `I` is ISO week of year, as opposed to `w` which is local week of year.
     * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
     *   `R` is supposed to be used in conjunction with `I` and `i`
     *   for universal ISO week-numbering date, whereas
     *   `Y` is supposed to be used in conjunction with `w` and `e`
     *   for week-numbering date specific to the locale.
     * - `P` is long localized date format
     * - `p` is long localized time format
     */
  
  };
  var formatters = {
    // Era
    G: function (date, token, localize) {
      var era = date.getUTCFullYear() > 0 ? 1 : 0;
  
      switch (token) {
        // AD, BC
        case 'G':
        case 'GG':
        case 'GGG':
          return localize.era(era, {
            width: 'abbreviated'
          });
        // A, B
  
        case 'GGGGG':
          return localize.era(era, {
            width: 'narrow'
          });
        // Anno Domini, Before Christ
  
        case 'GGGG':
        default:
          return localize.era(era, {
            width: 'wide'
          });
      }
    },
    // Year
    y: function (date, token, localize) {
      // Ordinal number
      if (token === 'yo') {
        var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
  
        var year = signedYear > 0 ? signedYear : 1 - signedYear;
        return localize.ordinalNumber(year, {
          unit: 'year'
        });
      }
  
      return formatters$1.y(date, token);
    },
    // Local week-numbering year
    Y: function (date, token, localize, options) {
      var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
  
      var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
  
      if (token === 'YY') {
        var twoDigitYear = weekYear % 100;
        return addLeadingZeros(twoDigitYear, 2);
      } // Ordinal number
  
  
      if (token === 'Yo') {
        return localize.ordinalNumber(weekYear, {
          unit: 'year'
        });
      } // Padding
  
  
      return addLeadingZeros(weekYear, token.length);
    },
    // ISO week-numbering year
    R: function (date, token) {
      var isoWeekYear = getUTCISOWeekYear(date); // Padding
  
      return addLeadingZeros(isoWeekYear, token.length);
    },
    // Extended year. This is a single number designating the year of this calendar system.
    // The main difference between `y` and `u` localizers are B.C. years:
    // | Year | `y` | `u` |
    // |------|-----|-----|
    // | AC 1 |   1 |   1 |
    // | BC 1 |   1 |   0 |
    // | BC 2 |   2 |  -1 |
    // Also `yy` always returns the last two digits of a year,
    // while `uu` pads single digit years to 2 characters and returns other years unchanged.
    u: function (date, token) {
      var year = date.getUTCFullYear();
      return addLeadingZeros(year, token.length);
    },
    // Quarter
    Q: function (date, token, localize) {
      var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
  
      switch (token) {
        // 1, 2, 3, 4
        case 'Q':
          return String(quarter);
        // 01, 02, 03, 04
  
        case 'QQ':
          return addLeadingZeros(quarter, 2);
        // 1st, 2nd, 3rd, 4th
  
        case 'Qo':
          return localize.ordinalNumber(quarter, {
            unit: 'quarter'
          });
        // Q1, Q2, Q3, Q4
  
        case 'QQQ':
          return localize.quarter(quarter, {
            width: 'abbreviated',
            context: 'formatting'
          });
        // 1, 2, 3, 4 (narrow quarter; could be not numerical)
  
        case 'QQQQQ':
          return localize.quarter(quarter, {
            width: 'narrow',
            context: 'formatting'
          });
        // 1st quarter, 2nd quarter, ...
  
        case 'QQQQ':
        default:
          return localize.quarter(quarter, {
            width: 'wide',
            context: 'formatting'
          });
      }
    },
    // Stand-alone quarter
    q: function (date, token, localize) {
      var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
  
      switch (token) {
        // 1, 2, 3, 4
        case 'q':
          return String(quarter);
        // 01, 02, 03, 04
  
        case 'qq':
          return addLeadingZeros(quarter, 2);
        // 1st, 2nd, 3rd, 4th
  
        case 'qo':
          return localize.ordinalNumber(quarter, {
            unit: 'quarter'
          });
        // Q1, Q2, Q3, Q4
  
        case 'qqq':
          return localize.quarter(quarter, {
            width: 'abbreviated',
            context: 'standalone'
          });
        // 1, 2, 3, 4 (narrow quarter; could be not numerical)
  
        case 'qqqqq':
          return localize.quarter(quarter, {
            width: 'narrow',
            context: 'standalone'
          });
        // 1st quarter, 2nd quarter, ...
  
        case 'qqqq':
        default:
          return localize.quarter(quarter, {
            width: 'wide',
            context: 'standalone'
          });
      }
    },
    // Month
    M: function (date, token, localize) {
      var month = date.getUTCMonth();
  
      switch (token) {
        case 'M':
        case 'MM':
          return formatters$1.M(date, token);
        // 1st, 2nd, ..., 12th
  
        case 'Mo':
          return localize.ordinalNumber(month + 1, {
            unit: 'month'
          });
        // Jan, Feb, ..., Dec
  
        case 'MMM':
          return localize.month(month, {
            width: 'abbreviated',
            context: 'formatting'
          });
        // J, F, ..., D
  
        case 'MMMMM':
          return localize.month(month, {
            width: 'narrow',
            context: 'formatting'
          });
        // January, February, ..., December
  
        case 'MMMM':
        default:
          return localize.month(month, {
            width: 'wide',
            context: 'formatting'
          });
      }
    },
    // Stand-alone month
    L: function (date, token, localize) {
      var month = date.getUTCMonth();
  
      switch (token) {
        // 1, 2, ..., 12
        case 'L':
          return String(month + 1);
        // 01, 02, ..., 12
  
        case 'LL':
          return addLeadingZeros(month + 1, 2);
        // 1st, 2nd, ..., 12th
  
        case 'Lo':
          return localize.ordinalNumber(month + 1, {
            unit: 'month'
          });
        // Jan, Feb, ..., Dec
  
        case 'LLL':
          return localize.month(month, {
            width: 'abbreviated',
            context: 'standalone'
          });
        // J, F, ..., D
  
        case 'LLLLL':
          return localize.month(month, {
            width: 'narrow',
            context: 'standalone'
          });
        // January, February, ..., December
  
        case 'LLLL':
        default:
          return localize.month(month, {
            width: 'wide',
            context: 'standalone'
          });
      }
    },
    // Local week of year
    w: function (date, token, localize, options) {
      var week = getUTCWeek(date, options);
  
      if (token === 'wo') {
        return localize.ordinalNumber(week, {
          unit: 'week'
        });
      }
  
      return addLeadingZeros(week, token.length);
    },
    // ISO week of year
    I: function (date, token, localize) {
      var isoWeek = getUTCISOWeek(date);
  
      if (token === 'Io') {
        return localize.ordinalNumber(isoWeek, {
          unit: 'week'
        });
      }
  
      return addLeadingZeros(isoWeek, token.length);
    },
    // Day of the month
    d: function (date, token, localize) {
      if (token === 'do') {
        return localize.ordinalNumber(date.getUTCDate(), {
          unit: 'date'
        });
      }
  
      return formatters$1.d(date, token);
    },
    // Day of year
    D: function (date, token, localize) {
      var dayOfYear = getUTCDayOfYear(date);
  
      if (token === 'Do') {
        return localize.ordinalNumber(dayOfYear, {
          unit: 'dayOfYear'
        });
      }
  
      return addLeadingZeros(dayOfYear, token.length);
    },
    // Day of week
    E: function (date, token, localize) {
      var dayOfWeek = date.getUTCDay();
  
      switch (token) {
        // Tue
        case 'E':
        case 'EE':
        case 'EEE':
          return localize.day(dayOfWeek, {
            width: 'abbreviated',
            context: 'formatting'
          });
        // T
  
        case 'EEEEE':
          return localize.day(dayOfWeek, {
            width: 'narrow',
            context: 'formatting'
          });
        // Tu
  
        case 'EEEEEE':
          return localize.day(dayOfWeek, {
            width: 'short',
            context: 'formatting'
          });
        // Tuesday
  
        case 'EEEE':
        default:
          return localize.day(dayOfWeek, {
            width: 'wide',
            context: 'formatting'
          });
      }
    },
    // Local day of week
    e: function (date, token, localize, options) {
      var dayOfWeek = date.getUTCDay();
      var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
  
      switch (token) {
        // Numerical value (Nth day of week with current locale or weekStartsOn)
        case 'e':
          return String(localDayOfWeek);
        // Padded numerical value
  
        case 'ee':
          return addLeadingZeros(localDayOfWeek, 2);
        // 1st, 2nd, ..., 7th
  
        case 'eo':
          return localize.ordinalNumber(localDayOfWeek, {
            unit: 'day'
          });
  
        case 'eee':
          return localize.day(dayOfWeek, {
            width: 'abbreviated',
            context: 'formatting'
          });
        // T
  
        case 'eeeee':
          return localize.day(dayOfWeek, {
            width: 'narrow',
            context: 'formatting'
          });
        // Tu
  
        case 'eeeeee':
          return localize.day(dayOfWeek, {
            width: 'short',
            context: 'formatting'
          });
        // Tuesday
  
        case 'eeee':
        default:
          return localize.day(dayOfWeek, {
            width: 'wide',
            context: 'formatting'
          });
      }
    },
    // Stand-alone local day of week
    c: function (date, token, localize, options) {
      var dayOfWeek = date.getUTCDay();
      var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
  
      switch (token) {
        // Numerical value (same as in `e`)
        case 'c':
          return String(localDayOfWeek);
        // Padded numerical value
  
        case 'cc':
          return addLeadingZeros(localDayOfWeek, token.length);
        // 1st, 2nd, ..., 7th
  
        case 'co':
          return localize.ordinalNumber(localDayOfWeek, {
            unit: 'day'
          });
  
        case 'ccc':
          return localize.day(dayOfWeek, {
            width: 'abbreviated',
            context: 'standalone'
          });
        // T
  
        case 'ccccc':
          return localize.day(dayOfWeek, {
            width: 'narrow',
            context: 'standalone'
          });
        // Tu
  
        case 'cccccc':
          return localize.day(dayOfWeek, {
            width: 'short',
            context: 'standalone'
          });
        // Tuesday
  
        case 'cccc':
        default:
          return localize.day(dayOfWeek, {
            width: 'wide',
            context: 'standalone'
          });
      }
    },
    // ISO day of week
    i: function (date, token, localize) {
      var dayOfWeek = date.getUTCDay();
      var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
  
      switch (token) {
        // 2
        case 'i':
          return String(isoDayOfWeek);
        // 02
  
        case 'ii':
          return addLeadingZeros(isoDayOfWeek, token.length);
        // 2nd
  
        case 'io':
          return localize.ordinalNumber(isoDayOfWeek, {
            unit: 'day'
          });
        // Tue
  
        case 'iii':
          return localize.day(dayOfWeek, {
            width: 'abbreviated',
            context: 'formatting'
          });
        // T
  
        case 'iiiii':
          return localize.day(dayOfWeek, {
            width: 'narrow',
            context: 'formatting'
          });
        // Tu
  
        case 'iiiiii':
          return localize.day(dayOfWeek, {
            width: 'short',
            context: 'formatting'
          });
        // Tuesday
  
        case 'iiii':
        default:
          return localize.day(dayOfWeek, {
            width: 'wide',
            context: 'formatting'
          });
      }
    },
    // AM or PM
    a: function (date, token, localize) {
      var hours = date.getUTCHours();
      var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
  
      switch (token) {
        case 'a':
        case 'aa':
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'abbreviated',
            context: 'formatting'
          });
  
        case 'aaa':
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'abbreviated',
            context: 'formatting'
          }).toLowerCase();
  
        case 'aaaaa':
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'narrow',
            context: 'formatting'
          });
  
        case 'aaaa':
        default:
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'wide',
            context: 'formatting'
          });
      }
    },
    // AM, PM, midnight, noon
    b: function (date, token, localize) {
      var hours = date.getUTCHours();
      var dayPeriodEnumValue;
  
      if (hours === 12) {
        dayPeriodEnumValue = dayPeriodEnum.noon;
      } else if (hours === 0) {
        dayPeriodEnumValue = dayPeriodEnum.midnight;
      } else {
        dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
      }
  
      switch (token) {
        case 'b':
        case 'bb':
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'abbreviated',
            context: 'formatting'
          });
  
        case 'bbb':
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'abbreviated',
            context: 'formatting'
          }).toLowerCase();
  
        case 'bbbbb':
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'narrow',
            context: 'formatting'
          });
  
        case 'bbbb':
        default:
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'wide',
            context: 'formatting'
          });
      }
    },
    // in the morning, in the afternoon, in the evening, at night
    B: function (date, token, localize) {
      var hours = date.getUTCHours();
      var dayPeriodEnumValue;
  
      if (hours >= 17) {
        dayPeriodEnumValue = dayPeriodEnum.evening;
      } else if (hours >= 12) {
        dayPeriodEnumValue = dayPeriodEnum.afternoon;
      } else if (hours >= 4) {
        dayPeriodEnumValue = dayPeriodEnum.morning;
      } else {
        dayPeriodEnumValue = dayPeriodEnum.night;
      }
  
      switch (token) {
        case 'B':
        case 'BB':
        case 'BBB':
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'abbreviated',
            context: 'formatting'
          });
  
        case 'BBBBB':
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'narrow',
            context: 'formatting'
          });
  
        case 'BBBB':
        default:
          return localize.dayPeriod(dayPeriodEnumValue, {
            width: 'wide',
            context: 'formatting'
          });
      }
    },
    // Hour [1-12]
    h: function (date, token, localize) {
      if (token === 'ho') {
        var hours = date.getUTCHours() % 12;
        if (hours === 0) hours = 12;
        return localize.ordinalNumber(hours, {
          unit: 'hour'
        });
      }
  
      return formatters$1.h(date, token);
    },
    // Hour [0-23]
    H: function (date, token, localize) {
      if (token === 'Ho') {
        return localize.ordinalNumber(date.getUTCHours(), {
          unit: 'hour'
        });
      }
  
      return formatters$1.H(date, token);
    },
    // Hour [0-11]
    K: function (date, token, localize) {
      var hours = date.getUTCHours() % 12;
  
      if (token === 'Ko') {
        return localize.ordinalNumber(hours, {
          unit: 'hour'
        });
      }
  
      return addLeadingZeros(hours, token.length);
    },
    // Hour [1-24]
    k: function (date, token, localize) {
      var hours = date.getUTCHours();
      if (hours === 0) hours = 24;
  
      if (token === 'ko') {
        return localize.ordinalNumber(hours, {
          unit: 'hour'
        });
      }
  
      return addLeadingZeros(hours, token.length);
    },
    // Minute
    m: function (date, token, localize) {
      if (token === 'mo') {
        return localize.ordinalNumber(date.getUTCMinutes(), {
          unit: 'minute'
        });
      }
  
      return formatters$1.m(date, token);
    },
    // Second
    s: function (date, token, localize) {
      if (token === 'so') {
        return localize.ordinalNumber(date.getUTCSeconds(), {
          unit: 'second'
        });
      }
  
      return formatters$1.s(date, token);
    },
    // Fraction of second
    S: function (date, token) {
      return formatters$1.S(date, token);
    },
    // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
    X: function (date, token, _localize, options) {
      var originalDate = options._originalDate || date;
      var timezoneOffset = originalDate.getTimezoneOffset();
  
      if (timezoneOffset === 0) {
        return 'Z';
      }
  
      switch (token) {
        // Hours and optional minutes
        case 'X':
          return formatTimezoneWithOptionalMinutes(timezoneOffset);
        // Hours, minutes and optional seconds without `:` delimiter
        // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
        // so this token always has the same output as `XX`
  
        case 'XXXX':
        case 'XX':
          // Hours and minutes without `:` delimiter
          return formatTimezone(timezoneOffset);
        // Hours, minutes and optional seconds with `:` delimiter
        // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
        // so this token always has the same output as `XXX`
  
        case 'XXXXX':
        case 'XXX': // Hours and minutes with `:` delimiter
  
        default:
          return formatTimezone(timezoneOffset, ':');
      }
    },
    // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
    x: function (date, token, _localize, options) {
      var originalDate = options._originalDate || date;
      var timezoneOffset = originalDate.getTimezoneOffset();
  
      switch (token) {
        // Hours and optional minutes
        case 'x':
          return formatTimezoneWithOptionalMinutes(timezoneOffset);
        // Hours, minutes and optional seconds without `:` delimiter
        // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
        // so this token always has the same output as `xx`
  
        case 'xxxx':
        case 'xx':
          // Hours and minutes without `:` delimiter
          return formatTimezone(timezoneOffset);
        // Hours, minutes and optional seconds with `:` delimiter
        // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
        // so this token always has the same output as `xxx`
  
        case 'xxxxx':
        case 'xxx': // Hours and minutes with `:` delimiter
  
        default:
          return formatTimezone(timezoneOffset, ':');
      }
    },
    // Timezone (GMT)
    O: function (date, token, _localize, options) {
      var originalDate = options._originalDate || date;
      var timezoneOffset = originalDate.getTimezoneOffset();
  
      switch (token) {
        // Short
        case 'O':
        case 'OO':
        case 'OOO':
          return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
        // Long
  
        case 'OOOO':
        default:
          return 'GMT' + formatTimezone(timezoneOffset, ':');
      }
    },
    // Timezone (specific non-location)
    z: function (date, token, _localize, options) {
      var originalDate = options._originalDate || date;
      var timezoneOffset = originalDate.getTimezoneOffset();
  
      switch (token) {
        // Short
        case 'z':
        case 'zz':
        case 'zzz':
          return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
        // Long
  
        case 'zzzz':
        default:
          return 'GMT' + formatTimezone(timezoneOffset, ':');
      }
    },
    // Seconds timestamp
    t: function (date, token, _localize, options) {
      var originalDate = options._originalDate || date;
      var timestamp = Math.floor(originalDate.getTime() / 1000);
      return addLeadingZeros(timestamp, token.length);
    },
    // Milliseconds timestamp
    T: function (date, token, _localize, options) {
      var originalDate = options._originalDate || date;
      var timestamp = originalDate.getTime();
      return addLeadingZeros(timestamp, token.length);
    }
  };
  
  function formatTimezoneShort(offset, dirtyDelimiter) {
    var sign = offset > 0 ? '-' : '+';
    var absOffset = Math.abs(offset);
    var hours = Math.floor(absOffset / 60);
    var minutes = absOffset % 60;
  
    if (minutes === 0) {
      return sign + String(hours);
    }
  
    var delimiter = dirtyDelimiter || '';
    return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
  }
  
  function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
    if (offset % 60 === 0) {
      var sign = offset > 0 ? '-' : '+';
      return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
    }
  
    return formatTimezone(offset, dirtyDelimiter);
  }
  
  function formatTimezone(offset, dirtyDelimiter) {
    var delimiter = dirtyDelimiter || '';
    var sign = offset > 0 ? '-' : '+';
    var absOffset = Math.abs(offset);
    var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
    var minutes = addLeadingZeros(absOffset % 60, 2);
    return sign + hours + delimiter + minutes;
  }
  
  function dateLongFormatter(pattern, formatLong) {
    switch (pattern) {
      case 'P':
        return formatLong.date({
          width: 'short'
        });
  
      case 'PP':
        return formatLong.date({
          width: 'medium'
        });
  
      case 'PPP':
        return formatLong.date({
          width: 'long'
        });
  
      case 'PPPP':
      default:
        return formatLong.date({
          width: 'full'
        });
    }
  }
  
  function timeLongFormatter(pattern, formatLong) {
    switch (pattern) {
      case 'p':
        return formatLong.time({
          width: 'short'
        });
  
      case 'pp':
        return formatLong.time({
          width: 'medium'
        });
  
      case 'ppp':
        return formatLong.time({
          width: 'long'
        });
  
      case 'pppp':
      default:
        return formatLong.time({
          width: 'full'
        });
    }
  }
  
  function dateTimeLongFormatter(pattern, formatLong) {
    var matchResult = pattern.match(/(P+)(p+)?/);
    var datePattern = matchResult[1];
    var timePattern = matchResult[2];
  
    if (!timePattern) {
      return dateLongFormatter(pattern, formatLong);
    }
  
    var dateTimeFormat;
  
    switch (datePattern) {
      case 'P':
        dateTimeFormat = formatLong.dateTime({
          width: 'short'
        });
        break;
  
      case 'PP':
        dateTimeFormat = formatLong.dateTime({
          width: 'medium'
        });
        break;
  
      case 'PPP':
        dateTimeFormat = formatLong.dateTime({
          width: 'long'
        });
        break;
  
      case 'PPPP':
      default:
        dateTimeFormat = formatLong.dateTime({
          width: 'full'
        });
        break;
    }
  
    return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
  }
  
  var longFormatters = {
    p: timeLongFormatter,
    P: dateTimeLongFormatter
  };
  /**
   * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
   * They usually appear for dates that denote time before the timezones were introduced
   * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
   * and GMT+01:00:00 after that date)
   *
   * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
   * which would lead to incorrect calculations.
   *
   * This function returns the timezone offset in milliseconds that takes seconds in account.
   */
  
  function getTimezoneOffsetInMilliseconds(date) {
    var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
    utcDate.setUTCFullYear(date.getFullYear());
    return date.getTime() - utcDate.getTime();
  }
  
  var protectedDayOfYearTokens = ['D', 'DD'];
  var protectedWeekYearTokens = ['YY', 'YYYY'];
  
  function isProtectedDayOfYearToken(token) {
    return protectedDayOfYearTokens.indexOf(token) !== -1;
  }
  
  function isProtectedWeekYearToken(token) {
    return protectedWeekYearTokens.indexOf(token) !== -1;
  }
  
  function throwProtectedError(token, format, input) {
    if (token === 'YYYY') {
      throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
    } else if (token === 'YY') {
      throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
    } else if (token === 'D') {
      throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
    } else if (token === 'DD') {
      throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
    }
  } // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
  //   (one of the certain letters followed by `o`)
  // - (\w)\1* matches any sequences of the same letter
  // - '' matches two quote characters in a row
  // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
  //   except a single quote symbol, which ends the sequence.
  //   Two quote characters do not end the sequence.
  //   If there is no matching single quote
  //   then the sequence will continue until the end of the string.
  // - . matches any single character unmatched by previous parts of the RegExps
  
  
  var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
  // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
  
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
  var escapedStringRegExp = /^'([^]*?)'?$/;
  var doubleQuoteRegExp = /''/g;
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
  /**
   * @name format
   * @category Common Helpers
   * @summary Format the date.
   *
   * @description
   * Return the formatted date string in the given format. The result may vary by locale.
   *
   * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
   * > See: https://git.io/fxCyr
   *
   * The characters wrapped between two single quotes characters (') are escaped.
   * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
   * (see the last example)
   *
   * Format of the string is based on Unicode Technical Standard #35:
   * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
   * with a few additions (see note 7 below the table).
   *
   * Accepted patterns:
   * | Unit                            | Pattern | Result examples                   | Notes |
   * |---------------------------------|---------|-----------------------------------|-------|
   * | Era                             | G..GGG  | AD, BC                            |       |
   * |                                 | GGGG    | Anno Domini, Before Christ        | 2     |
   * |                                 | GGGGG   | A, B                              |       |
   * | Calendar year                   | y       | 44, 1, 1900, 2017                 | 5     |
   * |                                 | yo      | 44th, 1st, 0th, 17th              | 5,7   |
   * |                                 | yy      | 44, 01, 00, 17                    | 5     |
   * |                                 | yyy     | 044, 001, 1900, 2017              | 5     |
   * |                                 | yyyy    | 0044, 0001, 1900, 2017            | 5     |
   * |                                 | yyyyy   | ...                               | 3,5   |
   * | Local week-numbering year       | Y       | 44, 1, 1900, 2017                 | 5     |
   * |                                 | Yo      | 44th, 1st, 1900th, 2017th         | 5,7   |
   * |                                 | YY      | 44, 01, 00, 17                    | 5,8   |
   * |                                 | YYY     | 044, 001, 1900, 2017              | 5     |
   * |                                 | YYYY    | 0044, 0001, 1900, 2017            | 5,8   |
   * |                                 | YYYYY   | ...                               | 3,5   |
   * | ISO week-numbering year         | R       | -43, 0, 1, 1900, 2017             | 5,7   |
   * |                                 | RR      | -43, 00, 01, 1900, 2017           | 5,7   |
   * |                                 | RRR     | -043, 000, 001, 1900, 2017        | 5,7   |
   * |                                 | RRRR    | -0043, 0000, 0001, 1900, 2017     | 5,7   |
   * |                                 | RRRRR   | ...                               | 3,5,7 |
   * | Extended year                   | u       | -43, 0, 1, 1900, 2017             | 5     |
   * |                                 | uu      | -43, 01, 1900, 2017               | 5     |
   * |                                 | uuu     | -043, 001, 1900, 2017             | 5     |
   * |                                 | uuuu    | -0043, 0001, 1900, 2017           | 5     |
   * |                                 | uuuuu   | ...                               | 3,5   |
   * | Quarter (formatting)            | Q       | 1, 2, 3, 4                        |       |
   * |                                 | Qo      | 1st, 2nd, 3rd, 4th                | 7     |
   * |                                 | QQ      | 01, 02, 03, 04                    |       |
   * |                                 | QQQ     | Q1, Q2, Q3, Q4                    |       |
   * |                                 | QQQQ    | 1st quarter, 2nd quarter, ...     | 2     |
   * |                                 | QQQQQ   | 1, 2, 3, 4                        | 4     |
   * | Quarter (stand-alone)           | q       | 1, 2, 3, 4                        |       |
   * |                                 | qo      | 1st, 2nd, 3rd, 4th                | 7     |
   * |                                 | qq      | 01, 02, 03, 04                    |       |
   * |                                 | qqq     | Q1, Q2, Q3, Q4                    |       |
   * |                                 | qqqq    | 1st quarter, 2nd quarter, ...     | 2     |
   * |                                 | qqqqq   | 1, 2, 3, 4                        | 4     |
   * | Month (formatting)              | M       | 1, 2, ..., 12                     |       |
   * |                                 | Mo      | 1st, 2nd, ..., 12th               | 7     |
   * |                                 | MM      | 01, 02, ..., 12                   |       |
   * |                                 | MMM     | Jan, Feb, ..., Dec                |       |
   * |                                 | MMMM    | January, February, ..., December  | 2     |
   * |                                 | MMMMM   | J, F, ..., D                      |       |
   * | Month (stand-alone)             | L       | 1, 2, ..., 12                     |       |
   * |                                 | Lo      | 1st, 2nd, ..., 12th               | 7     |
   * |                                 | LL      | 01, 02, ..., 12                   |       |
   * |                                 | LLL     | Jan, Feb, ..., Dec                |       |
   * |                                 | LLLL    | January, February, ..., December  | 2     |
   * |                                 | LLLLL   | J, F, ..., D                      |       |
   * | Local week of year              | w       | 1, 2, ..., 53                     |       |
   * |                                 | wo      | 1st, 2nd, ..., 53th               | 7     |
   * |                                 | ww      | 01, 02, ..., 53                   |       |
   * | ISO week of year                | I       | 1, 2, ..., 53                     | 7     |
   * |                                 | Io      | 1st, 2nd, ..., 53th               | 7     |
   * |                                 | II      | 01, 02, ..., 53                   | 7     |
   * | Day of month                    | d       | 1, 2, ..., 31                     |       |
   * |                                 | do      | 1st, 2nd, ..., 31st               | 7     |
   * |                                 | dd      | 01, 02, ..., 31                   |       |
   * | Day of year                     | D       | 1, 2, ..., 365, 366               | 9     |
   * |                                 | Do      | 1st, 2nd, ..., 365th, 366th       | 7     |
   * |                                 | DD      | 01, 02, ..., 365, 366             | 9     |
   * |                                 | DDD     | 001, 002, ..., 365, 366           |       |
   * |                                 | DDDD    | ...                               | 3     |
   * | Day of week (formatting)        | E..EEE  | Mon, Tue, Wed, ..., Sun           |       |
   * |                                 | EEEE    | Monday, Tuesday, ..., Sunday      | 2     |
   * |                                 | EEEEE   | M, T, W, T, F, S, S               |       |
   * |                                 | EEEEEE  | Mo, Tu, We, Th, Fr, Su, Sa        |       |
   * | ISO day of week (formatting)    | i       | 1, 2, 3, ..., 7                   | 7     |
   * |                                 | io      | 1st, 2nd, ..., 7th                | 7     |
   * |                                 | ii      | 01, 02, ..., 07                   | 7     |
   * |                                 | iii     | Mon, Tue, Wed, ..., Sun           | 7     |
   * |                                 | iiii    | Monday, Tuesday, ..., Sunday      | 2,7   |
   * |                                 | iiiii   | M, T, W, T, F, S, S               | 7     |
   * |                                 | iiiiii  | Mo, Tu, We, Th, Fr, Su, Sa        | 7     |
   * | Local day of week (formatting)  | e       | 2, 3, 4, ..., 1                   |       |
   * |                                 | eo      | 2nd, 3rd, ..., 1st                | 7     |
   * |                                 | ee      | 02, 03, ..., 01                   |       |
   * |                                 | eee     | Mon, Tue, Wed, ..., Sun           |       |
   * |                                 | eeee    | Monday, Tuesday, ..., Sunday      | 2     |
   * |                                 | eeeee   | M, T, W, T, F, S, S               |       |
   * |                                 | eeeeee  | Mo, Tu, We, Th, Fr, Su, Sa        |       |
   * | Local day of week (stand-alone) | c       | 2, 3, 4, ..., 1                   |       |
   * |                                 | co      | 2nd, 3rd, ..., 1st                | 7     |
   * |                                 | cc      | 02, 03, ..., 01                   |       |
   * |                                 | ccc     | Mon, Tue, Wed, ..., Sun           |       |
   * |                                 | cccc    | Monday, Tuesday, ..., Sunday      | 2     |
   * |                                 | ccccc   | M, T, W, T, F, S, S               |       |
   * |                                 | cccccc  | Mo, Tu, We, Th, Fr, Su, Sa        |       |
   * | AM, PM                          | a..aa   | AM, PM                            |       |
   * |                                 | aaa     | am, pm                            |       |
   * |                                 | aaaa    | a.m., p.m.                        | 2     |
   * |                                 | aaaaa   | a, p                              |       |
   * | AM, PM, noon, midnight          | b..bb   | AM, PM, noon, midnight            |       |
   * |                                 | bbb     | am, pm, noon, midnight            |       |
   * |                                 | bbbb    | a.m., p.m., noon, midnight        | 2     |
   * |                                 | bbbbb   | a, p, n, mi                       |       |
   * | Flexible day period             | B..BBB  | at night, in the morning, ...     |       |
   * |                                 | BBBB    | at night, in the morning, ...     | 2     |
   * |                                 | BBBBB   | at night, in the morning, ...     |       |
   * | Hour [1-12]                     | h       | 1, 2, ..., 11, 12                 |       |
   * |                                 | ho      | 1st, 2nd, ..., 11th, 12th         | 7     |
   * |                                 | hh      | 01, 02, ..., 11, 12               |       |
   * | Hour [0-23]                     | H       | 0, 1, 2, ..., 23                  |       |
   * |                                 | Ho      | 0th, 1st, 2nd, ..., 23rd          | 7     |
   * |                                 | HH      | 00, 01, 02, ..., 23               |       |
   * | Hour [0-11]                     | K       | 1, 2, ..., 11, 0                  |       |
   * |                                 | Ko      | 1st, 2nd, ..., 11th, 0th          | 7     |
   * |                                 | KK      | 01, 02, ..., 11, 00               |       |
   * | Hour [1-24]                     | k       | 24, 1, 2, ..., 23                 |       |
   * |                                 | ko      | 24th, 1st, 2nd, ..., 23rd         | 7     |
   * |                                 | kk      | 24, 01, 02, ..., 23               |       |
   * | Minute                          | m       | 0, 1, ..., 59                     |       |
   * |                                 | mo      | 0th, 1st, ..., 59th               | 7     |
   * |                                 | mm      | 00, 01, ..., 59                   |       |
   * | Second                          | s       | 0, 1, ..., 59                     |       |
   * |                                 | so      | 0th, 1st, ..., 59th               | 7     |
   * |                                 | ss      | 00, 01, ..., 59                   |       |
   * | Fraction of second              | S       | 0, 1, ..., 9                      |       |
   * |                                 | SS      | 00, 01, ..., 99                   |       |
   * |                                 | SSS     | 000, 001, ..., 999                |       |
   * |                                 | SSSS    | ...                               | 3     |
   * | Timezone (ISO-8601 w/ Z)        | X       | -08, +0530, Z                     |       |
   * |                                 | XX      | -0800, +0530, Z                   |       |
   * |                                 | XXX     | -08:00, +05:30, Z                 |       |
   * |                                 | XXXX    | -0800, +0530, Z, +123456          | 2     |
   * |                                 | XXXXX   | -08:00, +05:30, Z, +12:34:56      |       |
   * | Timezone (ISO-8601 w/o Z)       | x       | -08, +0530, +00                   |       |
   * |                                 | xx      | -0800, +0530, +0000               |       |
   * |                                 | xxx     | -08:00, +05:30, +00:00            | 2     |
   * |                                 | xxxx    | -0800, +0530, +0000, +123456      |       |
   * |                                 | xxxxx   | -08:00, +05:30, +00:00, +12:34:56 |       |
   * | Timezone (GMT)                  | O...OOO | GMT-8, GMT+5:30, GMT+0            |       |
   * |                                 | OOOO    | GMT-08:00, GMT+05:30, GMT+00:00   | 2     |
   * | Timezone (specific non-locat.)  | z...zzz | GMT-8, GMT+5:30, GMT+0            | 6     |
   * |                                 | zzzz    | GMT-08:00, GMT+05:30, GMT+00:00   | 2,6   |
   * | Seconds timestamp               | t       | 512969520                         | 7     |
   * |                                 | tt      | ...                               | 3,7   |
   * | Milliseconds timestamp          | T       | 512969520900                      | 7     |
   * |                                 | TT      | ...                               | 3,7   |
   * | Long localized date             | P       | 04/29/1453                        | 7     |
   * |                                 | PP      | Apr 29, 1453                      | 7     |
   * |                                 | PPP     | April 29th, 1453                  | 7     |
   * |                                 | PPPP    | Friday, April 29th, 1453          | 2,7   |
   * | Long localized time             | p       | 12:00 AM                          | 7     |
   * |                                 | pp      | 12:00:00 AM                       | 7     |
   * |                                 | ppp     | 12:00:00 AM GMT+2                 | 7     |
   * |                                 | pppp    | 12:00:00 AM GMT+02:00             | 2,7   |
   * | Combination of date and time    | Pp      | 04/29/1453, 12:00 AM              | 7     |
   * |                                 | PPpp    | Apr 29, 1453, 12:00:00 AM         | 7     |
   * |                                 | PPPppp  | April 29th, 1453 at ...           | 7     |
   * |                                 | PPPPpppp| Friday, April 29th, 1453 at ...   | 2,7   |
   * Notes:
   * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
   *    are the same as "stand-alone" units, but are different in some languages.
   *    "Formatting" units are declined according to the rules of the language
   *    in the context of a date. "Stand-alone" units are always nominative singular:
   *
   *    `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
   *
   *    `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
   *
   * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
   *    the single quote characters (see below).
   *    If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
   *    the output will be the same as default pattern for this unit, usually
   *    the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
   *    are marked with "2" in the last column of the table.
   *
   *    `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
   *
   *    `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
   *
   *    `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
   *
   *    `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
   *
   *    `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
   *
   * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
   *    The output will be padded with zeros to match the length of the pattern.
   *
   *    `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
   *
   * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
   *    These tokens represent the shortest form of the quarter.
   *
   * 5. The main difference between `y` and `u` patterns are B.C. years:
   *
   *    | Year | `y` | `u` |
   *    |------|-----|-----|
   *    | AC 1 |   1 |   1 |
   *    | BC 1 |   1 |   0 |
   *    | BC 2 |   2 |  -1 |
   *
   *    Also `yy` always returns the last two digits of a year,
   *    while `uu` pads single digit years to 2 characters and returns other years unchanged:
   *
   *    | Year | `yy` | `uu` |
   *    |------|------|------|
   *    | 1    |   01 |   01 |
   *    | 14   |   14 |   14 |
   *    | 376  |   76 |  376 |
   *    | 1453 |   53 | 1453 |
   *
   *    The same difference is true for local and ISO week-numbering years (`Y` and `R`),
   *    except local week-numbering years are dependent on `options.weekStartsOn`
   *    and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
   *    and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
   *
   * 6. Specific non-location timezones are currently unavailable in `date-fns`,
   *    so right now these tokens fall back to GMT timezones.
   *
   * 7. These patterns are not in the Unicode Technical Standard #35:
   *    - `i`: ISO day of week
   *    - `I`: ISO week of year
   *    - `R`: ISO week-numbering year
   *    - `t`: seconds timestamp
   *    - `T`: milliseconds timestamp
   *    - `o`: ordinal number modifier
   *    - `P`: long localized date
   *    - `p`: long localized time
   *
   * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
   *    You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
   *
   * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
   *    You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * - The second argument is now required for the sake of explicitness.
   *
   *   ```javascript
   *   // Before v2.0.0
   *   format(new Date(2016, 0, 1))
   *
   *   // v2.0.0 onward
   *   format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
   *   ```
   *
   * - New format string API for `format` function
   *   which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
   *   See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
   *
   * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
   *
   * @param {Date|Number} date - the original date
   * @param {String} format - the string of tokens
   * @param {Object} [options] - an object with options.
   * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
   * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
   * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
   * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
   *   see: https://git.io/fxCyr
   * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
   *   see: https://git.io/fxCyr
   * @returns {String} the formatted date string
   * @throws {TypeError} 2 arguments required
   * @throws {RangeError} `date` must not be Invalid Date
   * @throws {RangeError} `options.locale` must contain `localize` property
   * @throws {RangeError} `options.locale` must contain `formatLong` property
   * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
   * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
   * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
   * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
   * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
   * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
   * @throws {RangeError} format string contains an unescaped latin alphabet character
   *
   * @example
   * // Represent 11 February 2014 in middle-endian format:
   * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
   * //=> '02/11/2014'
   *
   * @example
   * // Represent 2 July 2014 in Esperanto:
   * import { eoLocale } from 'date-fns/locale/eo'
   * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
   *   locale: eoLocale
   * })
   * //=> '2-a de julio 2014'
   *
   * @example
   * // Escape string by single quote characters:
   * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
   * //=> "3 o'clock"
   */
  
  function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
    requiredArgs(2, arguments);
    var formatStr = String(dirtyFormatStr);
    var options = dirtyOptions || {};
    var locale$1 = options.locale || locale;
    var localeFirstWeekContainsDate = locale$1.options && locale$1.options.firstWeekContainsDate;
    var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger$1(localeFirstWeekContainsDate);
    var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger$1(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
  
    if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
      throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
    }
  
    var localeWeekStartsOn = locale$1.options && locale$1.options.weekStartsOn;
    var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger$1(localeWeekStartsOn);
    var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger$1(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
  
    if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
      throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
    }
  
    if (!locale$1.localize) {
      throw new RangeError('locale must contain localize property');
    }
  
    if (!locale$1.formatLong) {
      throw new RangeError('locale must contain formatLong property');
    }
  
    var originalDate = toDate(dirtyDate);
  
    if (!isValid(originalDate)) {
      throw new RangeError('Invalid time value');
    } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
    // This ensures that when UTC functions will be implemented, locales will be compatible with them.
    // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
  
  
    var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
    var utcDate = subMilliseconds(originalDate, timezoneOffset);
    var formatterOptions = {
      firstWeekContainsDate: firstWeekContainsDate,
      weekStartsOn: weekStartsOn,
      locale: locale$1,
      _originalDate: originalDate
    };
    var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
      var firstCharacter = substring[0];
  
      if (firstCharacter === 'p' || firstCharacter === 'P') {
        var longFormatter = longFormatters[firstCharacter];
        return longFormatter(substring, locale$1.formatLong, formatterOptions);
      }
  
      return substring;
    }).join('').match(formattingTokensRegExp).map(function (substring) {
      // Replace two single quote characters with one single quote character
      if (substring === "''") {
        return "'";
      }
  
      var firstCharacter = substring[0];
  
      if (firstCharacter === "'") {
        return cleanEscapedString(substring);
      }
  
      var formatter = formatters[firstCharacter];
  
      if (formatter) {
        if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
          throwProtectedError(substring, dirtyFormatStr, dirtyDate);
        }
  
        if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
          throwProtectedError(substring, dirtyFormatStr, dirtyDate);
        }
  
        return formatter(utcDate, substring, locale$1.localize, formatterOptions);
      }
  
      if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
        throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
      }
  
      return substring;
    }).join('');
    return result;
  }
  
  function cleanEscapedString(input) {
    return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
  }
  
  const formatDateRange = (start, end, delimiter = '-') => {
    const start_date = parseISO(start);
    const end_date = parseISO(end);
  
    if (isSameDay(start_date, end_date)) {
      return format(start_date, 'MMM d, yyyy');
    }
  
    if (isSameMonth(start_date, end_date)) {
      return `${format(start_date, 'MMM d')} ${delimiter} ${format(end_date, 'd, yyyy')}`;
    }
  
    if (isSameYear(start_date, end_date)) {
      return `${format(start_date, 'MMM d')} ${delimiter} ${format(end_date, 'MMM d, yyyy')}`;
    }
  
    return `${format(start_date, 'MMM d, yyyy')} ${delimiter} ${format(end_date, 'MMM d, yyyy')}`;
  };
  
  const formatPercentage = number_or_string => new Intl.NumberFormat('en', {
    style: 'percent',
    minimumFractionDigits: 0,
    maximumFractionDigits: 2
  }).format(number_or_string);
  
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof commonjsGlobal$1 !== 'undefined' ? commonjsGlobal$1 : typeof self !== 'undefined' ? self : {};
  var phoneFormatter = {
    normalize: function extract(phoneNumber) {
      return phoneNumber.replace(/^[\+\d{1,3}\-\s]*\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/, "$1$2$3");
    },
    format: function format(phoneNumber, formatString, options) {
      // Normalize the phone number first unless not asked to do so in the options
      if (!options || !options.normalize) {
        phoneNumber = this.normalize(phoneNumber);
      }
  
      for (var i = 0, l = phoneNumber.length; i < l; i++) {
        formatString = formatString.replace("N", phoneNumber[i]);
      }
  
      return formatString;
    }
  };
  
  const formatPhoneNumber = number => {
    let number_string = number ? String(number) : number;
  
    if (number) {
      number_string = number_string.replace(/^(1+|\+1+|0+)/g, '');
      number_string = phoneFormatter.format(number_string.replace(/\D/g, '').substr(0, 10), '(NNN) NNN-NNNN');
      number_string = number_string.indexOf('N') !== -1 ? number_string.substring(0, number_string.indexOf('N')).replace(/([()-\s]+$)/g, '') : number_string;
    }
  
    return number_string;
  };
  
  const generateToken = () => Math.random().toString(36).substr(2);
  
  const nextNode = node => {
    if (node.hasChildNodes()) {
      return node.firstChild;
    }
  
    while (node && !node.nextSibling) {
      node = node.parentNode;
    }
  
    if (!node) {
      return null;
    }
  
    return node.nextSibling;
  };
  
  const getRangeSelectedNodes = range => {
    let node = range.startContainer;
    const end_node = range.endContainer;
  
    if (node === end_node) {
      return [node.parentNode];
    }
  
    const range_nodes = [];
  
    while (node && node !== end_node) {
      node = nextNode(node);
  
      if (node.nodeType !== 3) {
        range_nodes.push(node);
      }
    }
  
    node = range.startContainer;
  
    while (node && node !== range.commonAncestorContainer) {
      if (node.nodeType !== 3) {
        range_nodes.unshift(node);
      }
  
      node = node.parentNode;
    }
  
    return range_nodes;
  };
  
  const getSelection = () => {
    if (window.getSelection) {
      return window.getSelection();
    }
  
    if (document.getSelection) {
      return document.getSelection();
    }
  
    if (document.selection) {
      return document.selection.createRange().text;
    }
  };
  
  const getSelectedNodes = () => {
    const selection = getSelection();
  
    if (!selection.isCollapsed) {
      return getRangeSelectedNodes(selection.getRangeAt(0));
    }
  
    return [];
  };
  
  const isFunction = func => Boolean(func) && {}.toString.call(func) === '[object Function]';
  
  const isUUID = str => RegExp(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i).test(String(str));
  
  const listToText = words => {
    switch (words.length) {
      case 1:
        return words[0];
  
      case 2:
        return words.join(' and ');
  
      default:
        const last = words.pop();
        return `${words.join(', ')}, and ${last}`;
    }
  };
  
  const lzw_decode = s => {
    const dict = {};
    const data = `${s}`.split('');
    let currChar = data[0];
    let oldPhrase = currChar;
    const out = [currChar];
    let code = 256;
    let phrase;
  
    for (let i = 1; i < data.length; i += 1) {
      const currCode = data[i].charCodeAt(0);
  
      if (currCode < 256) {
        phrase = data[i];
      } else {
        phrase = dict[currCode] ? dict[currCode] : oldPhrase + currChar;
      }
  
      out.push(phrase);
      currChar = phrase.charAt(0);
      dict[code] = oldPhrase + currChar;
      code += 1;
      oldPhrase = phrase;
    }
  
    return out.join('');
  };
  
  const lzw_encode = s => {
    const dict = {};
    const data = `${s}`.split('');
    const out = [];
    let currChar;
    let phrase = data[0];
    let code = 256;
  
    for (let i = 1; i < data.length; i += 1) {
      currChar = data[i];
  
      if (dict[phrase + currChar] != null) {
        phrase += currChar;
      } else {
        out.push(phrase.length > 1 ? dict[phrase] : phrase.charCodeAt(0));
        dict[phrase + currChar] = code;
        code += 1;
        phrase = currChar;
      }
    }
  
    out.push(phrase.length > 1 ? dict[phrase] : phrase.charCodeAt(0));
  
    for (let i = 0; i < out.length; i += 1) {
      out[i] = String.fromCharCode(out[i]);
    }
  
    return out.join('');
  }; // Returns a function, that, when invoked, will only be triggered at most once
  
  
  const makeThrottle = (wait = 1000, options = {}) => {
    let previous = 0;
    return () => {
      const now = Date.now();
      if (!previous && options.leading === false) previous = now;
      const remaining = wait - (now - previous);
  
      if (remaining <= 0 || remaining > wait) {
        previous = now;
        return false; // Not throttled
      }
  
      return true; // Throttled
    };
  };
  
  const max = arr => {
    let {
      length
    } = arr;
    let maximum = -Infinity;
  
    while (length--) {
      maximum = arr[length] > maximum ? arr[length] : maximum;
    }
  
    return maximum;
  };
  
  const min = arr => {
    let {
      length
    } = arr;
    let minimum = Infinity;
  
    while (length--) {
      minimum = arr[length] < minimum ? arr[length] : minimum;
    }
  
    return minimum;
  };
  
  const optionsFromStrings = string_array => {
    if (Array.isArray(string_array)) {
      return string_array.map(str => ({
        text: str,
        value: str
      }));
    }
  
    return [];
  };
  
  const permute = i => {
    const perm_arr = [];
    const used_chars = [];
  
    function perm(input) {
      let ch;
  
      for (let i = 0; i < input.length; i++) {
        ch = input.splice(i, 1)[0];
        used_chars.push(ch);
  
        if (input.length == 0) {
          perm_arr.push(used_chars.slice());
        }
  
        perm(input);
        input.splice(i, 0, ch);
        used_chars.pop();
      }
  
      return perm_arr;
    }
  
    return perm(i);
  };
  
  const phoneToInteger = formatted_phone => Number(String(formatted_phone).replace(/\D/g, ''));
  
  const possessive = (string, APOSTROPHE_CHAR = '’') => {
    if (string === '') {
      return string;
    }
  
    const lastChar = string.slice(-1);
    const endOfWord = lastChar.toLowerCase() === 's' ? APOSTROPHE_CHAR : `${APOSTROPHE_CHAR}s`;
    return `${string}${endOfWord}`;
  };
  
  const queryVariables = loc => {
    let {
      search
    } = loc;
    const params = {};
    if (search[0] === '?') search = search.substring(1);
    search.split('&').forEach(v => {
      if (v) {
        const pair = v.split('=');
        params[pair[0]] = decodeURIComponent(pair[1]); // eslint-disable-line prefer-destructuring
      }
    });
    return params;
  };
  
  const radians = deg => deg * Math.PI / 180;
  
  const readFile = file => {
    return new Promise((resolve, reject) => {
      const reader = new FileReader();
  
      reader.onload = e => {
        resolve(new Uint8Array(e.target.result));
      };
  
      reader.readAsArrayBuffer(file);
    });
  };
  
  const recurrenceRuleText = recurrence_rule => {
    const text = [`Repeats every ${recurrence_rule.interval} ${pluralize(recurrence_rule.frequency, parseInt(recurrence_rule.interval, 10))}`];
  
    if (recurrence_rule.frequency === 'week') {
      let days_of_week = Object.keys(recurrence_rule.days_of_week).filter(d => recurrence_rule.days_of_week[d]);
  
      if (days_of_week.length) {
        days_of_week = days_of_week.map(d => titleize(d));
  
        if (days_of_week.length > 2) {
          const last_day = days_of_week.pop();
          text.push(`on ${days_of_week.join(', ')}, and ${last_day}`);
        } else if (days_of_week.length === 2) {
          text.push(`on ${days_of_week.join(' and ')}`);
        } else {
          text.push(`on ${days_of_week[0]}`);
        }
      }
    }
  
    if (recurrence_rule.will_end || typeof recurrence_rule.will_end === 'undefined' && typeof recurrence_rule.end !== 'undefined') text.push(`until ${recurrence_rule.end.format('MMMM Do, YYYY')}`);
    return text.join(' ');
  };
  
  var FileSaver_min = {
    exports: {}
  };
  
  (function (module, exports) {
    (function (a, b) {
      b();
    })(commonjsGlobal, function () {
      function b(a, b) {
        return "undefined" == typeof b ? b = {
          autoBom: !1
        } : "object" != typeof b && (console.warn("Deprecated: Expected third argument to be a object"), b = {
          autoBom: !b
        }), b.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type) ? new Blob(["\uFEFF", a], {
          type: a.type
        }) : a;
      }
  
      function c(a, b, c) {
        var d = new XMLHttpRequest();
        d.open("GET", a), d.responseType = "blob", d.onload = function () {
          g(d.response, b, c);
        }, d.onerror = function () {
          console.error("could not download file");
        }, d.send();
      }
  
      function d(a) {
        var b = new XMLHttpRequest();
        b.open("HEAD", a, !1);
  
        try {
          b.send();
        } catch (a) {}
  
        return 200 <= b.status && 299 >= b.status;
      }
  
      function e(a) {
        try {
          a.dispatchEvent(new MouseEvent("click"));
        } catch (c) {
          var b = document.createEvent("MouseEvents");
          b.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), a.dispatchEvent(b);
        }
      }
  
      var f = "object" == typeof window && window.window === window ? window : "object" == typeof self && self.self === self ? self : "object" == typeof commonjsGlobal && commonjsGlobal.global === commonjsGlobal ? commonjsGlobal : void 0,
          a = f.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent),
          g = f.saveAs || ("object" != typeof window || window !== f ? function () {} : "download" in HTMLAnchorElement.prototype && !a ? function (b, g, h) {
        var i = f.URL || f.webkitURL,
            j = document.createElement("a");
        g = g || b.name || "download", j.download = g, j.rel = "noopener", "string" == typeof b ? (j.href = b, j.origin === location.origin ? e(j) : d(j.href) ? c(b, g, h) : e(j, j.target = "_blank")) : (j.href = i.createObjectURL(b), setTimeout(function () {
          i.revokeObjectURL(j.href);
        }, 4E4), setTimeout(function () {
          e(j);
        }, 0));
      } : "msSaveOrOpenBlob" in navigator ? function (f, g, h) {
        if (g = g || f.name || "download", "string" != typeof f) navigator.msSaveOrOpenBlob(b(f, h), g);else if (d(f)) c(f, g, h);else {
          var i = document.createElement("a");
          i.href = f, i.target = "_blank", setTimeout(function () {
            e(i);
          });
        }
      } : function (b, d, e, g) {
        if (g = g || open("", "_blank"), g && (g.document.title = g.document.body.innerText = "downloading..."), "string" == typeof b) return c(b, d, e);
        var h = "application/octet-stream" === b.type,
            i = /constructor/i.test(f.HTMLElement) || f.safari,
            j = /CriOS\/[\d]+/.test(navigator.userAgent);
  
        if ((j || h && i || a) && "undefined" != typeof FileReader) {
          var k = new FileReader();
          k.onloadend = function () {
            var a = k.result;
            a = j ? a : a.replace(/^data:[^;]*;/, "data:attachment/file;"), g ? g.location.href = a : location = a, g = null;
          }, k.readAsDataURL(b);
        } else {
          var l = f.URL || f.webkitURL,
              m = l.createObjectURL(b);
          g ? g.location = m : location.href = m, g = null, setTimeout(function () {
            l.revokeObjectURL(m);
          }, 4E4);
        }
      });
      f.saveAs = g.saveAs = g, module.exports = g;
    });
  })(FileSaver_min);
  
  const saveFile = (data, file_name) => {
    const s2ab = s => {
      const buf = new ArrayBuffer(s.length);
      const view = new Uint8Array(buf);
  
      for (let i = 0; i !== s.length; i += 1) view[i] = s.charCodeAt(i) & 0xff;
  
      return buf;
    };
  
    FileSaver_min.exports.saveAs(new Blob([s2ab(data)], {
      type: 'application/octet-stream'
    }), `${file_name}`);
  };
  
  const serialize = function (obj, prefix) {
    const str = [];
    let p;
  
    for (p in obj) {
      if (obj.hasOwnProperty(p)) {
        const k = prefix ? `${prefix}[${p}]` : p;
        const v = obj[p];
        str.push(v !== null && typeof v === 'object' ? serialize(v, k) : `${encodeURIComponent(k)}=${encodeURIComponent(v)}`);
      }
    }
  
    return str.join('&');
  };
  
  const setFind = (set, cb) => {
    const it = set.values();
    let v = it.next();
  
    while (!v.done) {
      if (cb(v.value)) {
        return v.value;
      }
  
      v = it.next();
    }
  
    return undefined;
  };
  
  const shortDate = date => `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`;
  
  const shuffle = arr => {
    const array = [...arr];
    let currentIndex = array.length;
    let randomIndex; // While there remain elements to shuffle...
  
    while (0 !== currentIndex) {
      // Pick a remaining element...
      randomIndex = Math.floor(Math.random() * currentIndex);
      currentIndex--; // And swap it with the current element.
  
      [array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
    }
  
    return array;
  }; // const bad_shuffle = (arr) => {
  //   bad_shuffle
  // }
  
  
  const sleep = (delay = 500) => new Promise(r => setTimeout(r, delay));
  
  const sortCurrency = (a, b) => parseCurrency(a) > parseCurrency(b) ? 1 : -1;
  /**
   * @name isDate
   * @category Common Helpers
   * @summary Is the given value a date?
   *
   * @description
   * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * @param {*} value - the value to check
   * @returns {boolean} true if the given value is a date
   * @throws {TypeError} 1 arguments required
   *
   * @example
   * // For a valid date:
   * const result = isDate(new Date())
   * //=> true
   *
   * @example
   * // For an invalid date:
   * const result = isDate(new Date(NaN))
   * //=> true
   *
   * @example
   * // For some value:
   * const result = isDate('2014-02-31')
   * //=> false
   *
   * @example
   * // For an object:
   * const result = isDate({})
   * //=> false
   */
  
  
  function isDate(value) {
    requiredArgs(1, arguments);
    return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';
  }
  
  const stripTimezone = datetime => {
    window.isDate = isDate;
  
    if (typeof datetime === 'undefined' || datetime === null) {
      return datetime;
    }
  
    if (typeof datetime === 'string') {
      // const time_zones = ['ACDT','ACST','ACT','ACT','ACWST','ADT','AEDT','AEST','AET','AFT','AKDT','AKST','ALMT','AMST','AMT','AMT','ANAT','AQTT','ART','AST','AST','AWST','AZOST','AZOT','AZT','BNT','BIOT','BIT','BOT','BRST','BRT','BST','BST','BST','BTT','CAT','CCT','CDT','CDT','CEST','CET','CHADT','CHAST','CHOT','CHOST','CHST','CHUT','CIST','CKT','CLST','CLT','COST','COT','CST','CST','CST','CT','CVT','CWST','CXT','DAVT','DDUT','DFT','EASST','EAST','EAT','ECT','ECT','EDT','EEST','EET','EGST','EGT','EST','FET','FJT','FKST','FKT','FNT','GALT','GAMT','GET','GFT','GILT','GIT','GMT','GST','GST','GYT','HDT','HAEC','HST','HKT','HMT','HOVST','HOVT','ICT','IDLW','IDT','IOT','IRDT','IRKT','IRST','IST','IST','IST','JST','KALT','KGT','KOST','KRAT','KST','LHST','LHST','LINT','MAGT','MART','MAWT','MDT','MET','MEST','MHT','MIST','MIT','MMT','MSK','MST','MST','MUT','MVT','MYT','NCT','NDT','NFT','NOVT','NPT','NST','NT','NUT','NZDT','NZST','OMST','ORAT','PDT','PET','PETT','PGT','PHOT','PHT','PKT','PMDT','PMST','PONT','PST','PST','PWT','PYST','PYT','RET','ROTT','SAKT','SAMT','SAST','SBT','SCT','SDT','SGT','SLST','SRET','SRT','SST','SST','SYOT','TAHT','THA','TFT','TJT','TKT','TLT','TMT','TRT','TOT','TVT','ULAST','ULAT','UTC','UYST','UYT','UZT','VET','VLAT','VOLT','VOST','VUT','WAKT','WAST','WAT','WEST','WET','WIB','WIT','WITA','WGST','WGT','WST','YAKT','YEKT']
      datetime = datetime.replace(/UT(?![\s$;])/, 'UTC');
      datetime = datetime.replace(/Z$|[A-Z]+[\s\d.:]*([-−+]\d\d$)|(Z?[-−+](\d\d:?\d\d))|(Z[-−+]\d|(\s?[A-Z]{3,4}\s?[-−+]+[\d:৪]{0,5})|(\s?[A-Z]{3,4}\s?)|(\(.+\)))|(\w+ (Daylight|Standard) Time)|[\[\(].+[\]\)]/, '');
      if (!datetime.includes('T')) datetime = datetime.replace(/-/g, '/');
      datetime = new Date(datetime);
    }
  
    const components = {};
  
    if (isDate(datetime)) {
      components.year = datetime.getFullYear();
      components.month = datetime.getMonth();
      components.date = datetime.getDate();
      components.hours = datetime.getHours();
      components.minutes = datetime.getMinutes();
    } else if (datetime.constructor.name === 'Moment') {
      components.year = datetime.year();
      components.month = datetime.month();
      components.date = datetime.date();
      components.hours = datetime.hours();
      components.minutes = datetime.minutes();
    } else {
      throw new Error(`Unrecognized date object: ${typeof datetime}, ${datetime.constructor.name}, ${datetime}`);
    }
  
    return new Date(components.year, components.month, components.date, components.hours, components.minutes);
  };
  
  const titleize$1 = str => (str || '').replace(/([_-])/g, ' ').replace(/([.](?!\s))/g, ' ').replace(/([A-Z_-])/g, ' $1').replace(/\w\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()).replace(/\s\s/g, ' ').trim();
  
  const titleizeConstantName = str => (str || '').replace(/([._-])/g, ' ').replace(/\w\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
  
  const toBoolean = value => {
    switch (typeof value === 'string' ? value.toLowerCase() : value) {
      case false:
      case 'false':
      case 'f':
      case 0:
      case '':
      case null:
        return false;
  
      default:
        return true;
    }
  };
  
  const underscore = string => {
    if (!String(string).match(new RegExp('[A-Z-]|::|\s'))) return String(string);
    let word = String(string).replace('::', '/'); // word = word.replace(/(?:(?:([A-Za-z\d]))|\b)(((?=a)b))(?=\b|[^a-z])/g, (match, _, p1, p2) => `${p1 && '_' }${p2.toLowerCase}`)
  
    word = word.replace(/([A-Z\d]+)(?=[A-Z][a-z])|([a-z\d])(?=[A-Z])/g, (match, p1, p2) => (p1 || p2) + "_");
    word = word.replace(/-|\s/g, '_');
    word = word.toLowerCase();
    return word;
  };
  
  const uniqByProperty = (arr, accessor) => {
    const results = [];
    const map = new Map();
  
    for (let i = 0; i < arr.length; i += 1) {
      if (!map.has(arr[i][accessor])) {
        map.set(arr[i][accessor], true);
        results.push(arr[i]);
      }
    }
  
    return results;
  };
  
  dist.arrayDiff = arrayDiff;
  dist.chunk = chunk;
  dist.coalesce = coalesce;
  dist.decodeHTMLEntities = decodeHTMLEntities;
  dist.dig = dig;
  dist.escapeRegExp = escapeRegExp;
  dist.factorial = factorial;
  dist.fakeCreditCard = fakeCreditCard;
  dist.fontAwesomeIconToBlob = fontAwesomeIconToBlob;
  dist.fontAwesomeIconToBlobURL = fontAwesomeIconToBlobURL;
  dist.formatBytes = formatBytes;
  dist.formatCurrency = formatCurrency;
  dist.formatCurrencyInput = formatCurrencyInput;
  dist.formatDateRange = formatDateRange;
  dist.formatPercentage = formatPercentage;
  var formatPhoneNumber_1 = dist.formatPhoneNumber = formatPhoneNumber;
  dist.generateToken = generateToken;
  dist.getRangeSelectedNodes = getRangeSelectedNodes;
  dist.getSelectedNodes = getSelectedNodes;
  dist.getSelection = getSelection;
  dist.isFunction = isFunction;
  dist.isUUID = isUUID;
  dist.listToText = listToText;
  dist.lzw_decode = lzw_decode;
  dist.lzw_encode = lzw_encode;
  dist.makeThrottle = makeThrottle;
  dist.max = max;
  dist.min = min;
  dist.nextNode = nextNode;
  var optionsFromStrings_1 = dist.optionsFromStrings = optionsFromStrings;
  dist.parseCurrency = parseCurrency;
  dist.parseCurrencyFloat = parseCurrencyFloat;
  dist.permute = permute;
  dist.phoneToInteger = phoneToInteger;
  dist.possessive = possessive;
  var queryVariables_1 = dist.queryVariables = queryVariables;
  dist.radians = radians;
  dist.readFile = readFile;
  dist.recurrenceRuleText = recurrenceRuleText;
  dist.sample = sample;
  dist.saveFile = saveFile;
  dist.serialize = serialize;
  dist.setFind = setFind;
  dist.shortDate = shortDate;
  dist.shuffle = shuffle;
  dist.sleep = sleep;
  dist.sortCurrency = sortCurrency;
  dist.stripTimezone = stripTimezone;
  dist.titleize = titleize$1;
  dist.titleizeConstantName = titleizeConstantName;
  dist.toBoolean = toBoolean;
  dist.underscore = underscore;
  dist.uniqByProperty = uniqByProperty;
  
  function _extends() {
    _extends = Object.assign || function (target) {
      for (var i = 1; i < arguments.length; i++) {
        var source = arguments[i];
  
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
  
      return target;
    };
  
    return _extends.apply(this, arguments);
  }
  
  var removeAccents$2 = {
    exports: {}
  };
  var characterMap = {
    "À": "A",
    "Á": "A",
    "Â": "A",
    "Ã": "A",
    "Ä": "A",
    "Å": "A",
    "Ấ": "A",
    "Ắ": "A",
    "Ẳ": "A",
    "Ẵ": "A",
    "Ặ": "A",
    "Æ": "AE",
    "Ầ": "A",
    "Ằ": "A",
    "Ȃ": "A",
    "Ç": "C",
    "Ḉ": "C",
    "È": "E",
    "É": "E",
    "Ê": "E",
    "Ë": "E",
    "Ế": "E",
    "Ḗ": "E",
    "Ề": "E",
    "Ḕ": "E",
    "Ḝ": "E",
    "Ȇ": "E",
    "Ì": "I",
    "Í": "I",
    "Î": "I",
    "Ï": "I",
    "Ḯ": "I",
    "Ȋ": "I",
    "Ð": "D",
    "Ñ": "N",
    "Ò": "O",
    "Ó": "O",
    "Ô": "O",
    "Õ": "O",
    "Ö": "O",
    "Ø": "O",
    "Ố": "O",
    "Ṍ": "O",
    "Ṓ": "O",
    "Ȏ": "O",
    "Ù": "U",
    "Ú": "U",
    "Û": "U",
    "Ü": "U",
    "Ý": "Y",
    "à": "a",
    "á": "a",
    "â": "a",
    "ã": "a",
    "ä": "a",
    "å": "a",
    "ấ": "a",
    "ắ": "a",
    "ẳ": "a",
    "ẵ": "a",
    "ặ": "a",
    "æ": "ae",
    "ầ": "a",
    "ằ": "a",
    "ȃ": "a",
    "ç": "c",
    "ḉ": "c",
    "è": "e",
    "é": "e",
    "ê": "e",
    "ë": "e",
    "ế": "e",
    "ḗ": "e",
    "ề": "e",
    "ḕ": "e",
    "ḝ": "e",
    "ȇ": "e",
    "ì": "i",
    "í": "i",
    "î": "i",
    "ï": "i",
    "ḯ": "i",
    "ȋ": "i",
    "ð": "d",
    "ñ": "n",
    "ò": "o",
    "ó": "o",
    "ô": "o",
    "õ": "o",
    "ö": "o",
    "ø": "o",
    "ố": "o",
    "ṍ": "o",
    "ṓ": "o",
    "ȏ": "o",
    "ù": "u",
    "ú": "u",
    "û": "u",
    "ü": "u",
    "ý": "y",
    "ÿ": "y",
    "Ā": "A",
    "ā": "a",
    "Ă": "A",
    "ă": "a",
    "Ą": "A",
    "ą": "a",
    "Ć": "C",
    "ć": "c",
    "Ĉ": "C",
    "ĉ": "c",
    "Ċ": "C",
    "ċ": "c",
    "Č": "C",
    "č": "c",
    "C̆": "C",
    "c̆": "c",
    "Ď": "D",
    "ď": "d",
    "Đ": "D",
    "đ": "d",
    "Ē": "E",
    "ē": "e",
    "Ĕ": "E",
    "ĕ": "e",
    "Ė": "E",
    "ė": "e",
    "Ę": "E",
    "ę": "e",
    "Ě": "E",
    "ě": "e",
    "Ĝ": "G",
    "Ǵ": "G",
    "ĝ": "g",
    "ǵ": "g",
    "Ğ": "G",
    "ğ": "g",
    "Ġ": "G",
    "ġ": "g",
    "Ģ": "G",
    "ģ": "g",
    "Ĥ": "H",
    "ĥ": "h",
    "Ħ": "H",
    "ħ": "h",
    "Ḫ": "H",
    "ḫ": "h",
    "Ĩ": "I",
    "ĩ": "i",
    "Ī": "I",
    "ī": "i",
    "Ĭ": "I",
    "ĭ": "i",
    "Į": "I",
    "į": "i",
    "İ": "I",
    "ı": "i",
    "Ĳ": "IJ",
    "ĳ": "ij",
    "Ĵ": "J",
    "ĵ": "j",
    "Ķ": "K",
    "ķ": "k",
    "Ḱ": "K",
    "ḱ": "k",
    "K̆": "K",
    "k̆": "k",
    "Ĺ": "L",
    "ĺ": "l",
    "Ļ": "L",
    "ļ": "l",
    "Ľ": "L",
    "ľ": "l",
    "Ŀ": "L",
    "ŀ": "l",
    "Ł": "l",
    "ł": "l",
    "Ḿ": "M",
    "ḿ": "m",
    "M̆": "M",
    "m̆": "m",
    "Ń": "N",
    "ń": "n",
    "Ņ": "N",
    "ņ": "n",
    "Ň": "N",
    "ň": "n",
    "ŉ": "n",
    "N̆": "N",
    "n̆": "n",
    "Ō": "O",
    "ō": "o",
    "Ŏ": "O",
    "ŏ": "o",
    "Ő": "O",
    "ő": "o",
    "Œ": "OE",
    "œ": "oe",
    "P̆": "P",
    "p̆": "p",
    "Ŕ": "R",
    "ŕ": "r",
    "Ŗ": "R",
    "ŗ": "r",
    "Ř": "R",
    "ř": "r",
    "R̆": "R",
    "r̆": "r",
    "Ȓ": "R",
    "ȓ": "r",
    "Ś": "S",
    "ś": "s",
    "Ŝ": "S",
    "ŝ": "s",
    "Ş": "S",
    "Ș": "S",
    "ș": "s",
    "ş": "s",
    "Š": "S",
    "š": "s",
    "Ţ": "T",
    "ţ": "t",
    "ț": "t",
    "Ț": "T",
    "Ť": "T",
    "ť": "t",
    "Ŧ": "T",
    "ŧ": "t",
    "T̆": "T",
    "t̆": "t",
    "Ũ": "U",
    "ũ": "u",
    "Ū": "U",
    "ū": "u",
    "Ŭ": "U",
    "ŭ": "u",
    "Ů": "U",
    "ů": "u",
    "Ű": "U",
    "ű": "u",
    "Ų": "U",
    "ų": "u",
    "Ȗ": "U",
    "ȗ": "u",
    "V̆": "V",
    "v̆": "v",
    "Ŵ": "W",
    "ŵ": "w",
    "Ẃ": "W",
    "ẃ": "w",
    "X̆": "X",
    "x̆": "x",
    "Ŷ": "Y",
    "ŷ": "y",
    "Ÿ": "Y",
    "Y̆": "Y",
    "y̆": "y",
    "Ź": "Z",
    "ź": "z",
    "Ż": "Z",
    "ż": "z",
    "Ž": "Z",
    "ž": "z",
    "ſ": "s",
    "ƒ": "f",
    "Ơ": "O",
    "ơ": "o",
    "Ư": "U",
    "ư": "u",
    "Ǎ": "A",
    "ǎ": "a",
    "Ǐ": "I",
    "ǐ": "i",
    "Ǒ": "O",
    "ǒ": "o",
    "Ǔ": "U",
    "ǔ": "u",
    "Ǖ": "U",
    "ǖ": "u",
    "Ǘ": "U",
    "ǘ": "u",
    "Ǚ": "U",
    "ǚ": "u",
    "Ǜ": "U",
    "ǜ": "u",
    "Ứ": "U",
    "ứ": "u",
    "Ṹ": "U",
    "ṹ": "u",
    "Ǻ": "A",
    "ǻ": "a",
    "Ǽ": "AE",
    "ǽ": "ae",
    "Ǿ": "O",
    "ǿ": "o",
    "Þ": "TH",
    "þ": "th",
    "Ṕ": "P",
    "ṕ": "p",
    "Ṥ": "S",
    "ṥ": "s",
    "X́": "X",
    "x́": "x",
    "Ѓ": "Г",
    "ѓ": "г",
    "Ќ": "К",
    "ќ": "к",
    "A̋": "A",
    "a̋": "a",
    "E̋": "E",
    "e̋": "e",
    "I̋": "I",
    "i̋": "i",
    "Ǹ": "N",
    "ǹ": "n",
    "Ồ": "O",
    "ồ": "o",
    "Ṑ": "O",
    "ṑ": "o",
    "Ừ": "U",
    "ừ": "u",
    "Ẁ": "W",
    "ẁ": "w",
    "Ỳ": "Y",
    "ỳ": "y",
    "Ȁ": "A",
    "ȁ": "a",
    "Ȅ": "E",
    "ȅ": "e",
    "Ȉ": "I",
    "ȉ": "i",
    "Ȍ": "O",
    "ȍ": "o",
    "Ȑ": "R",
    "ȑ": "r",
    "Ȕ": "U",
    "ȕ": "u",
    "B̌": "B",
    "b̌": "b",
    "Č̣": "C",
    "č̣": "c",
    "Ê̌": "E",
    "ê̌": "e",
    "F̌": "F",
    "f̌": "f",
    "Ǧ": "G",
    "ǧ": "g",
    "Ȟ": "H",
    "ȟ": "h",
    "J̌": "J",
    "ǰ": "j",
    "Ǩ": "K",
    "ǩ": "k",
    "M̌": "M",
    "m̌": "m",
    "P̌": "P",
    "p̌": "p",
    "Q̌": "Q",
    "q̌": "q",
    "Ř̩": "R",
    "ř̩": "r",
    "Ṧ": "S",
    "ṧ": "s",
    "V̌": "V",
    "v̌": "v",
    "W̌": "W",
    "w̌": "w",
    "X̌": "X",
    "x̌": "x",
    "Y̌": "Y",
    "y̌": "y",
    "A̧": "A",
    "a̧": "a",
    "B̧": "B",
    "b̧": "b",
    "Ḑ": "D",
    "ḑ": "d",
    "Ȩ": "E",
    "ȩ": "e",
    "Ɛ̧": "E",
    "ɛ̧": "e",
    "Ḩ": "H",
    "ḩ": "h",
    "I̧": "I",
    "i̧": "i",
    "Ɨ̧": "I",
    "ɨ̧": "i",
    "M̧": "M",
    "m̧": "m",
    "O̧": "O",
    "o̧": "o",
    "Q̧": "Q",
    "q̧": "q",
    "U̧": "U",
    "u̧": "u",
    "X̧": "X",
    "x̧": "x",
    "Z̧": "Z",
    "z̧": "z"
  };
  var chars = Object.keys(characterMap).join('|');
  var allAccents = new RegExp(chars, 'g');
  var firstAccent = new RegExp(chars, '');
  
  var removeAccents = function (string) {
    return string.replace(allAccents, function (match) {
      return characterMap[match];
    });
  };
  
  var hasAccents = function (string) {
    return !!string.match(firstAccent);
  };
  
  removeAccents$2.exports = removeAccents;
  removeAccents$2.exports.has = hasAccents;
  removeAccents$2.exports.remove = removeAccents;
  var removeAccents$1 = removeAccents$2.exports;
  var rankings = {
    CASE_SENSITIVE_EQUAL: 7,
    EQUAL: 6,
    STARTS_WITH: 5,
    WORD_STARTS_WITH: 4,
    CONTAINS: 3,
    ACRONYM: 2,
    MATCHES: 1,
    NO_MATCH: 0
  };
  matchSorter.rankings = rankings;
  
  var defaultBaseSortFn = function defaultBaseSortFn(a, b) {
    return String(a.rankedValue).localeCompare(String(b.rankedValue));
  };
  /**
   * Takes an array of items and a value and returns a new array with the items that match the given value
   * @param {Array} items - the items to sort
   * @param {String} value - the value to use for ranking
   * @param {Object} options - Some options to configure the sorter
   * @return {Array} - the new sorted array
   */
  
  
  function matchSorter(items, value, options) {
    if (options === void 0) {
      options = {};
    }
  
    var _options = options,
        keys = _options.keys,
        _options$threshold = _options.threshold,
        threshold = _options$threshold === void 0 ? rankings.MATCHES : _options$threshold,
        _options$baseSort = _options.baseSort,
        baseSort = _options$baseSort === void 0 ? defaultBaseSortFn : _options$baseSort,
        _options$sorter = _options.sorter,
        sorter = _options$sorter === void 0 ? function (matchedItems) {
      return matchedItems.sort(function (a, b) {
        return sortRankedValues(a, b, baseSort);
      });
    } : _options$sorter;
    var matchedItems = items.reduce(reduceItemsToRanked, []);
    return sorter(matchedItems).map(function (_ref) {
      var item = _ref.item;
      return item;
    });
  
    function reduceItemsToRanked(matches, item, index) {
      var rankingInfo = getHighestRanking(item, keys, value, options);
      var rank = rankingInfo.rank,
          _rankingInfo$keyThres = rankingInfo.keyThreshold,
          keyThreshold = _rankingInfo$keyThres === void 0 ? threshold : _rankingInfo$keyThres;
  
      if (rank >= keyThreshold) {
        matches.push(_extends({}, rankingInfo, {
          item: item,
          index: index
        }));
      }
  
      return matches;
    }
  }
  /**
   * Gets the highest ranking for value for the given item based on its values for the given keys
   * @param {*} item - the item to rank
   * @param {Array} keys - the keys to get values from the item for the ranking
   * @param {String} value - the value to rank against
   * @param {Object} options - options to control the ranking
   * @return {{rank: Number, keyIndex: Number, keyThreshold: Number}} - the highest ranking
   */
  
  
  function getHighestRanking(item, keys, value, options) {
    if (!keys) {
      // if keys is not specified, then we assume the item given is ready to be matched
      var stringItem = item;
      return {
        // ends up being duplicate of 'item' in matches but consistent
        rankedValue: stringItem,
        rank: getMatchRanking(stringItem, value, options),
        keyIndex: -1,
        keyThreshold: options.threshold
      };
    }
  
    var valuesToRank = getAllValuesToRank(item, keys);
    return valuesToRank.reduce(function (_ref2, _ref3, i) {
      var rank = _ref2.rank,
          rankedValue = _ref2.rankedValue,
          keyIndex = _ref2.keyIndex,
          keyThreshold = _ref2.keyThreshold;
      var itemValue = _ref3.itemValue,
          attributes = _ref3.attributes;
      var newRank = getMatchRanking(itemValue, value, options);
      var newRankedValue = rankedValue;
      var minRanking = attributes.minRanking,
          maxRanking = attributes.maxRanking,
          threshold = attributes.threshold;
  
      if (newRank < minRanking && newRank >= rankings.MATCHES) {
        newRank = minRanking;
      } else if (newRank > maxRanking) {
        newRank = maxRanking;
      }
  
      if (newRank > rank) {
        rank = newRank;
        keyIndex = i;
        keyThreshold = threshold;
        newRankedValue = itemValue;
      }
  
      return {
        rankedValue: newRankedValue,
        rank: rank,
        keyIndex: keyIndex,
        keyThreshold: keyThreshold
      };
    }, {
      rankedValue: item,
      rank: rankings.NO_MATCH,
      keyIndex: -1,
      keyThreshold: options.threshold
    });
  }
  /**
   * Gives a rankings score based on how well the two strings match.
   * @param {String} testString - the string to test against
   * @param {String} stringToRank - the string to rank
   * @param {Object} options - options for the match (like keepDiacritics for comparison)
   * @returns {Number} the ranking for how well stringToRank matches testString
   */
  
  
  function getMatchRanking(testString, stringToRank, options) {
    testString = prepareValueForComparison(testString, options);
    stringToRank = prepareValueForComparison(stringToRank, options); // too long
  
    if (stringToRank.length > testString.length) {
      return rankings.NO_MATCH;
    } // case sensitive equals
  
  
    if (testString === stringToRank) {
      return rankings.CASE_SENSITIVE_EQUAL;
    } // Lower casing before further comparison
  
  
    testString = testString.toLowerCase();
    stringToRank = stringToRank.toLowerCase(); // case insensitive equals
  
    if (testString === stringToRank) {
      return rankings.EQUAL;
    } // starts with
  
  
    if (testString.startsWith(stringToRank)) {
      return rankings.STARTS_WITH;
    } // word starts with
  
  
    if (testString.includes(" " + stringToRank)) {
      return rankings.WORD_STARTS_WITH;
    } // contains
  
  
    if (testString.includes(stringToRank)) {
      return rankings.CONTAINS;
    } else if (stringToRank.length === 1) {
      // If the only character in the given stringToRank
      //   isn't even contained in the testString, then
      //   it's definitely not a match.
      return rankings.NO_MATCH;
    } // acronym
  
  
    if (getAcronym(testString).includes(stringToRank)) {
      return rankings.ACRONYM;
    } // will return a number between rankings.MATCHES and
    // rankings.MATCHES + 1 depending  on how close of a match it is.
  
  
    return getClosenessRanking(testString, stringToRank);
  }
  /**
   * Generates an acronym for a string.
   *
   * @param {String} string the string for which to produce the acronym
   * @returns {String} the acronym
   */
  
  
  function getAcronym(string) {
    var acronym = '';
    var wordsInString = string.split(' ');
    wordsInString.forEach(function (wordInString) {
      var splitByHyphenWords = wordInString.split('-');
      splitByHyphenWords.forEach(function (splitByHyphenWord) {
        acronym += splitByHyphenWord.substr(0, 1);
      });
    });
    return acronym;
  }
  /**
   * Returns a score based on how spread apart the
   * characters from the stringToRank are within the testString.
   * A number close to rankings.MATCHES represents a loose match. A number close
   * to rankings.MATCHES + 1 represents a tighter match.
   * @param {String} testString - the string to test against
   * @param {String} stringToRank - the string to rank
   * @returns {Number} the number between rankings.MATCHES and
   * rankings.MATCHES + 1 for how well stringToRank matches testString
   */
  
  
  function getClosenessRanking(testString, stringToRank) {
    var matchingInOrderCharCount = 0;
    var charNumber = 0;
  
    function findMatchingCharacter(matchChar, string, index) {
      for (var j = index, J = string.length; j < J; j++) {
        var stringChar = string[j];
  
        if (stringChar === matchChar) {
          matchingInOrderCharCount += 1;
          return j + 1;
        }
      }
  
      return -1;
    }
  
    function getRanking(spread) {
      var spreadPercentage = 1 / spread;
      var inOrderPercentage = matchingInOrderCharCount / stringToRank.length;
      var ranking = rankings.MATCHES + inOrderPercentage * spreadPercentage;
      return ranking;
    }
  
    var firstIndex = findMatchingCharacter(stringToRank[0], testString, 0);
  
    if (firstIndex < 0) {
      return rankings.NO_MATCH;
    }
  
    charNumber = firstIndex;
  
    for (var i = 1, I = stringToRank.length; i < I; i++) {
      var matchChar = stringToRank[i];
      charNumber = findMatchingCharacter(matchChar, testString, charNumber);
      var found = charNumber > -1;
  
      if (!found) {
        return rankings.NO_MATCH;
      }
    }
  
    var spread = charNumber - firstIndex;
    return getRanking(spread);
  }
  /**
   * Sorts items that have a rank, index, and keyIndex
   * @param {Object} a - the first item to sort
   * @param {Object} b - the second item to sort
   * @return {Number} -1 if a should come first, 1 if b should come first, 0 if equal
   */
  
  
  function sortRankedValues(a, b, baseSort) {
    var aFirst = -1;
    var bFirst = 1;
    var aRank = a.rank,
        aKeyIndex = a.keyIndex;
    var bRank = b.rank,
        bKeyIndex = b.keyIndex;
    var same = aRank === bRank;
  
    if (same) {
      if (aKeyIndex === bKeyIndex) {
        // use the base sort function as a tie-breaker
        return baseSort(a, b);
      } else {
        return aKeyIndex < bKeyIndex ? aFirst : bFirst;
      }
    } else {
      return aRank > bRank ? aFirst : bFirst;
    }
  }
  /**
   * Prepares value for comparison by stringifying it, removing diacritics (if specified)
   * @param {String} value - the value to clean
   * @param {Object} options - {keepDiacritics: whether to remove diacritics}
   * @return {String} the prepared value
   */
  
  
  function prepareValueForComparison(value, _ref4) {
    var keepDiacritics = _ref4.keepDiacritics; // value might not actually be a string at this point (we don't get to choose)
    // so part of preparing the value for comparison is ensure that it is a string
  
    value = "" + value; // toString
  
    if (!keepDiacritics) {
      value = removeAccents$1(value);
    }
  
    return value;
  }
  /**
   * Gets value for key in item at arbitrarily nested keypath
   * @param {Object} item - the item
   * @param {Object|Function} key - the potentially nested keypath or property callback
   * @return {Array} - an array containing the value(s) at the nested keypath
   */
  
  
  function getItemValues(item, key) {
    if (typeof key === 'object') {
      key = key.key;
    }
  
    var value;
  
    if (typeof key === 'function') {
      value = key(item);
    } else if (item == null) {
      value = null;
    } else if (Object.hasOwnProperty.call(item, key)) {
      value = item[key];
    } else if (key.includes('.')) {
      // eslint-disable-next-line @typescript-eslint/no-unsafe-call
      return getNestedValues(key, item);
    } else {
      value = null;
    } // because `value` can also be undefined
  
  
    if (value == null) {
      return [];
    }
  
    if (Array.isArray(value)) {
      return value;
    }
  
    return [String(value)];
  }
  /**
   * Given path: "foo.bar.baz"
   * And item: {foo: {bar: {baz: 'buzz'}}}
   *   -> 'buzz'
   * @param path a dot-separated set of keys
   * @param item the item to get the value from
   */
  
  
  function getNestedValues(path, item) {
    var keys = path.split('.');
    var values = [item];
  
    for (var i = 0, I = keys.length; i < I; i++) {
      var nestedKey = keys[i];
      var nestedValues = [];
  
      for (var j = 0, J = values.length; j < J; j++) {
        var nestedItem = values[j];
        if (nestedItem == null) continue;
  
        if (Object.hasOwnProperty.call(nestedItem, nestedKey)) {
          var nestedValue = nestedItem[nestedKey];
  
          if (nestedValue != null) {
            nestedValues.push(nestedValue);
          }
        } else if (nestedKey === '*') {
          // ensure that values is an array
          nestedValues = nestedValues.concat(nestedItem);
        }
      }
  
      values = nestedValues;
    }
  
    if (Array.isArray(values[0])) {
      // keep allowing the implicit wildcard for an array of strings at the end of
      // the path; don't use `.flat()` because that's not available in node.js v10
      var result = [];
      return result.concat.apply(result, values);
    } // Based on our logic it should be an array of strings by now...
    // assuming the user's path terminated in strings
  
  
    return values;
  }
  /**
   * Gets all the values for the given keys in the given item and returns an array of those values
   * @param item - the item from which the values will be retrieved
   * @param keys - the keys to use to retrieve the values
   * @return objects with {itemValue, attributes}
   */
  
  
  function getAllValuesToRank(item, keys) {
    var allValues = [];
  
    for (var j = 0, J = keys.length; j < J; j++) {
      var key = keys[j];
      var attributes = getKeyAttributes(key);
      var itemValues = getItemValues(item, key);
  
      for (var i = 0, I = itemValues.length; i < I; i++) {
        allValues.push({
          itemValue: itemValues[i],
          attributes: attributes
        });
      }
    }
  
    return allValues;
  }
  
  var defaultKeyAttributes = {
    maxRanking: Infinity,
    minRanking: -Infinity
  };
  /**
   * Gets all the attributes for the given key
   * @param key - the key from which the attributes will be retrieved
   * @return object containing the key's attributes
   */
  
  function getKeyAttributes(key) {
    if (typeof key === 'string') {
      return defaultKeyAttributes;
    }
  
    return _extends({}, defaultKeyAttributes, key);
  }
  
  const useAutocomplete = (all_strings, max_suggestions = 10) => {
    const autocomplete_options = optionsFromStrings_1(all_strings);
  
    function matchAutocomplete(input_val = '', {
      show_on_empty
    }) {
      if (input_val.length > 0 || show_on_empty) {
        const sorted = matchSorter(all_strings, input_val).slice(0, max_suggestions);
        const options = optionsFromStrings_1(sorted);
        return options;
      }
  
      return [];
    }
  
    return [autocomplete_options, matchAutocomplete];
  };
  
  const useBodyRef = () => {
    const ref = react.useRef();
    react.useEffect(() => {
      ref.current = document.body;
      return () => {
        ref.current = null;
      };
    });
    return ref;
  };
  
  const useWindowSize = () => {
    const [width, setWidth] = react.useState(window.innerWidth);
    const [height, setHeight] = react.useState(window.innerHeight);
    react.useEffect(() => {
      const handleResize = () => {
        setWidth(window.innerWidth);
        setHeight(window.innerHeight);
      };
  
      window.addEventListener('resize', handleResize);
      return () => {
        window.removeEventListener('resize', handleResize);
      };
    }, []);
    return {
      width,
      height
    };
  };
  
  const useBreakpoints = (breakpoints = {
    xs: 0,
    sm: 665,
    md: 1080,
    lg: 1489,
    xl: 2000
  }) => {
    const {
      width
    } = useWindowSize();
    return {
      xs: breakpoints.xs < width,
      sm: breakpoints.sm < width,
      md: breakpoints.md < width,
      lg: breakpoints.lg < width,
      xl: breakpoints.xl < width
    };
  };
  
  const useCounter = (initial_value = 0) => {
    const [state, setState] = react.useState(initial_value);
  
    const increment = () => setState(prev_state => prev_state + 1);
  
    const decrement = () => setState(prev_state => prev_state - 1);
  
    const reset = (value = initial_value) => setState(value);
  
    return [state, {
      increment,
      decrement,
      reset
    }];
  };
  
  const useDebounce = (callback, delay, options = {}) => {
    const {
      maxWait,
      leading
    } = options;
    const trailing = options.trailing === undefined ? true : options.trailing;
    const maxWaitHandler = react.useRef();
    const maxWaitArgs = react.useRef([]);
    const leadingCall = react.useRef(false);
    const functionTimeoutHandler = react.useRef();
    const isComponentUnmounted = react.useRef(false);
    const debouncedFunction = react.useRef(callback);
    debouncedFunction.current = callback;
    const cancelDebouncedCallback = react.useCallback(() => {
      clearTimeout(functionTimeoutHandler.current);
      clearTimeout(maxWaitHandler.current);
      maxWaitHandler.current = null;
      maxWaitArgs.current = [];
      functionTimeoutHandler.current = null;
      leadingCall.current = false;
    }, []);
    react.useEffect(() => () => {
      isComponentUnmounted.current = true;
    }, []);
    const debouncedCallback = react.useCallback(args => {
      maxWaitArgs.current = args;
      clearTimeout(functionTimeoutHandler.current);
  
      if (leadingCall.current) {
        leadingCall.current = false;
      }
  
      if (!functionTimeoutHandler.current && leading && !leadingCall.current) {
        debouncedFunction.current(args);
        leadingCall.current = true;
      }
  
      functionTimeoutHandler.current = setTimeout(() => {
        let shouldCallFunction = true;
  
        if (leading && leadingCall.current) {
          shouldCallFunction = false;
        }
  
        cancelDebouncedCallback();
  
        if (!isComponentUnmounted.current && trailing && shouldCallFunction) {
          debouncedFunction.current(args);
        }
      }, delay);
  
      if (maxWait && !maxWaitHandler.current && trailing) {
        maxWaitHandler.current = setTimeout(() => {
          const shadow_args = maxWaitArgs.current;
          cancelDebouncedCallback();
  
          if (!isComponentUnmounted.current) {
            debouncedFunction.current.apply(null, shadow_args);
          }
        }, maxWait);
      }
    }, [maxWait, delay, cancelDebouncedCallback, leading, trailing]);
  
    const callPending = () => {
      if (!functionTimeoutHandler.current) {
        return;
      }
  
      debouncedFunction.current.apply(null, maxWaitArgs.current);
      cancelDebouncedCallback();
    };
  
    return [debouncedCallback, cancelDebouncedCallback, callPending];
  };
  
  const useDebounceState = (initial_state, delay, options = {}) => {
    const [immediate_value, setImmediateValue] = react.useState(initial_state);
    const [debounced_value, setDebouncedValue] = react.useState(initial_state);
    const [setStateDebounce] = useDebounce(new_value => {
      setDebouncedValue(new_value);
    }, delay, options);
  
    const setState = new_state => {
      setImmediateValue(new_state);
      setStateDebounce(new_state);
    };
  
    return [debounced_value, setState, immediate_value];
  };
  
  const useForceUpdate = () => {
    const [value, setValue] = react.useState(true);
    return () => setValue(!value);
  };
  
  function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
  
    if (Object.getOwnPropertySymbols) {
      var symbols = Object.getOwnPropertySymbols(object);
  
      if (enumerableOnly) {
        symbols = symbols.filter(function (sym) {
          return Object.getOwnPropertyDescriptor(object, sym).enumerable;
        });
      }
  
      keys.push.apply(keys, symbols);
    }
  
    return keys;
  }
  
  function _objectSpread2(target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i] != null ? arguments[i] : {};
  
      if (i % 2) {
        ownKeys(Object(source), true).forEach(function (key) {
          _defineProperty(target, key, source[key]);
        });
      } else if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
      } else {
        ownKeys(Object(source)).forEach(function (key) {
          Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
      }
    }
  
    return target;
  }
  
  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }
  
    return obj;
  }
  
  const useMergeState = initial_state => {
    const [state, setState] = react.useState(initial_state);
    const mergeState = react.useCallback(new_state => setState(prev_state => _objectSpread2(_objectSpread2({}, prev_state), new_state)), []);
    return [state, mergeState, setState];
  };
  
  const useHandleInputChange = initial_state => {
    const [state, mergeState, setState] = useMergeState(initial_state);
    const handleInputChange = react.useCallback(e => {
      const {
        name
      } = e.target;
      let value = e.target.type === 'checkbox' ? e.target.checked : e.target.value;
  
      if (name === 'phone' || name === 'company_phone' || e.target.type === 'tel') {
        value = formatPhoneNumber_1(value);
      }
  
      mergeState({
        [name]: value
      });
    }, [mergeState]);
    return [state, handleInputChange, mergeState, setState];
  };
  
  const useHover = () => {
    const [hovered, setHovered] = react.useState(false);
    const ref = react.useRef(null);
  
    const handleMouseOver = () => setHovered(true);
  
    const handleMouseOut = () => setHovered(false);
  
    react.useEffect(() => {
      const node = ref.current;
  
      if (node) {
        node.addEventListener('mouseover', handleMouseOver);
        node.addEventListener('mouseout', handleMouseOut);
        return () => {
          node.removeEventListener('mouseover', handleMouseOver);
          node.removeEventListener('mouseout', handleMouseOut);
        };
      }
  
      return () => undefined;
    }, [ref.current]);
    return [ref, hovered];
  };
  
  const useIdentifier = default_identifier => {
    const [identifier] = react.useState(default_identifier || Math.random().toString(36).substr(2));
    return identifier;
  };
  
  function toInteger(dirtyNumber) {
    if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
      return NaN;
    }
  
    var number = Number(dirtyNumber);
  
    if (isNaN(number)) {
      return number;
    }
  
    return number < 0 ? Math.ceil(number) : Math.floor(number);
  }
  /**
   * @name addMilliseconds
   * @category Millisecond Helpers
   * @summary Add the specified number of milliseconds to the given date.
   *
   * @description
   * Add the specified number of milliseconds to the given date.
   *
   * ### v2.0.0 breaking changes:
   *
   * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
   *
   * @param {Date|Number} date - the date to be changed
   * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
   * @returns {Date} the new date with the milliseconds added
   * @throws {TypeError} 2 arguments required
   *
   * @example
   * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
   * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
   * //=> Thu Jul 10 2014 12:45:30.750
   */
  
  
  function addMilliseconds(dirtyDate, dirtyAmount) {
    requiredArgs$1(2, arguments);
    var timestamp = toDate$1(dirtyDate).getTime();
    var amount = toInteger(dirtyAmount);
    return new Date(timestamp + amount);
  }
  
  const useInterval = (callback, delay) => {
    const [trigger_time, setTriggerTime] = react.useState();
    react.useEffect(() => {
      setTriggerTime(addMilliseconds(new Date(), delay));
      const interval = setInterval(() => {
        setTriggerTime(addMilliseconds(new Date(), delay));
        callback();
      }, delay);
      return () => {
        clearInterval(interval);
        setTriggerTime(null);
      };
    }, [delay]);
    return trigger_time;
  };
  
  const useIsMount = () => {
    const isMountRef = react.useRef(true);
    react.useEffect(() => {
      isMountRef.current = false;
    }, []);
    return isMountRef.current;
  };
  
  const useKeyboardScroll = ({
    initial_options,
    selected_option,
    onEnter
  }) => {
    var _visible_options$; // const selected_option = visible_options && visible_options.find( o => String(o.value) === String(value) )
  
  
    const [visible_options, setVisibleOptions] = react.useState(initial_options || []);
    const [active_index, setActiveIndex] = react.useState(selected_option ? visible_options.indexOf(selected_option) : 0);
  
    if (selected_option && ((_visible_options$ = visible_options[0]) === null || _visible_options$ === void 0 ? void 0 : _visible_options$.text) !== '--') {
      const options_with_empty = [{
        text: '--',
        value: ''
      }].concat(visible_options);
      setVisibleOptions(options_with_empty);
      setActiveIndex(options_with_empty.indexOf(selected_option));
    }
  
    function handleKeyboardScroll(e) {
      if (e.key === 'Enter') {
        e.preventDefault();
        onEnter(active_index);
        e.target.blur();
        return false;
      }
  
      if (e.key === 'ArrowUp') {
        if (active_index > 0) {
          setActiveIndex(active_index - 1);
        } else {
          setActiveIndex(visible_options.length - 1);
        }
  
        return true;
      }
  
      if (e.key === 'ArrowDown') {
        if (active_index < visible_options.length - 1) {
          setActiveIndex(active_index + 1);
        } else {
          setActiveIndex(0);
        }
  
        return true;
      }
  
      if (e.key === 'Tab') {
        e.target.blur();
        return true;
      }
  
      return true; // todo: This might need to be false instead
    }
  
    function updateOptions(options) {
      setVisibleOptions(options);
      setActiveIndex(selected_option ? visible_options.indexOf(selected_option) : 0);
    }
  
    return {
      handleKeyboardScroll,
      active_index,
      visible_options,
      updateOptions,
      selected_option
    };
  };
  
  const useModalLocation = anchor_id => {
    const navigate = reactRouterDom.useNavigate();
    const location = reactRouterDom.useLocation();
    react.useEffect(() => {
      navigate(`${location.pathname}#${anchor_id}`);
      return () => {
        // We have to use window.location in case we're unmounting because we're navigating somewhere else
        navigate(`${window.location.pathname}`);
      };
    }, []);
  };
  
  const useMultiSelect = (default_select = []) => {
    const reducer = (state, action) => {
      switch (action.type) {
        case 'toggle':
          if (state.has(action.item)) {
            const set = new Set(state);
            set.delete(action.item);
            return set;
          }
  
          return new Set(state).add(action.item);
  
        case 'add':
          return new Set(state).add(action.item);
  
        case 'remove':
          return new Set(state).delete(action.item);
  
        default:
          return state;
      }
    };
  
    const [state, dispatch] = react.useReducer(reducer, new Set(default_select));
  
    const toggle = item => dispatch({
      type: 'toggle',
      item
    });
  
    const add = item => dispatch({
      type: 'add',
      item
    });
  
    const remove = item => dispatch({
      type: 'remove',
      item
    });
  
    return [state, toggle, add, remove];
  };
  
  const useOnce = func => {
    const called = react.useRef(false);
    const [results, setResults] = react.useState(undefined);
  
    const call = (...args) => {
      if (!called.current) {
        called.current = true;
        const r = func(args);
        setResults(r);
        return r;
      }
  
      console.warn('useOnce function called again, returning previous results');
      return results;
    };
  
    return call;
  };
  
  const useOnClickOutside = (ref, callback) => {
    const handleOutsideClick = react.useCallback(e => {
      if (ref.current && !ref.current.contains(e.target)) {
        callback();
      }
    }, [callback]);
    react.useEffect(() => {
      window.addEventListener('mousedown', handleOutsideClick);
      return () => {
        window.removeEventListener('mousedown', handleOutsideClick);
      };
    }, [handleOutsideClick]);
  };
  
  const useOnContextClickOutside = (ref, callback) => {
    const handleOutsideClick = react.useCallback(e => {
      if (ref.current && !ref.current.contains(e.target)) {
        callback();
      }
    }, [callback]);
    react.useEffect(() => {
      window.addEventListener('contextmenu', handleOutsideClick);
      return () => {
        window.removeEventListener('contextmenu', handleOutsideClick);
      };
    }, [handleOutsideClick]);
  };
  
  const useParentNode = () => {
    var _ref$current;
  
    const ref = react.useRef();
    const [parent_node, setParentNode] = react.useState((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.parentNode);
    react.useState(() => {
      var _ref$current2;
  
      setParentNode((_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.parent_node);
    }, [ref.current]);
    return [ref, parent_node];
  };
  
  const usePosition = () => {
    var _ref$current;
  
    const ref = react.useRef();
    const [position, setPosition] = react.useState({});
    const bounding_client = JSON.stringify((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect());
    react.useEffect(() => {
      if (ref.current) {
        setPosition(ref.current.getBoundingClientRect());
      }
    }, [bounding_client]);
    return [ref, position];
  };
  
  const usePrevious = value => {
    const ref = react.useRef();
    react.useEffect(() => {
      ref.current = value;
    });
    return ref.current;
  };
  
  const useQueryParams = () => {
    const location = reactRouterDom.useLocation();
    const params = queryVariables_1(location);
    const decoded = {};
    Object.keys(params).forEach(name => {
      let value = decodeURIComponent(params[name]);
  
      try {
        value = JSON.parse(value);
      } catch (err) {
        if (!err.message.includes('JSON')) {
          console.error(err);
        } // Normal to have an error if value isn't json, and most aren't.
  
      }
  
      decoded[decodeURIComponent(name)] = value;
    });
    return decoded;
  };
  
  const useRefCallback = (value, deps) => {
    const ref = react.useRef(value);
    react.useEffect(() => {
      ref.current = value;
    }, deps !== null && deps !== void 0 ? deps : [value]);
    const result = react.useCallback((...args) => {
      var _ref$current;
  
      (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.call(ref, ...args);
    }, []);
    return result;
  };
  
  const useResult = (data, should_update = true) => {
    const [data_state, setState] = react.useState(data);
    const data_key = JSON.stringify(data);
    react.useEffect(() => {
      if (should_update) {
        setState(data);
      }
    }, [data_key]);
    return [data_state, setState];
  };
  
  const useRunAfterUpdate = () => {
    const afterPaintRef = react.useRef(null);
    react.useLayoutEffect(() => {
      if (afterPaintRef.current) {
        afterPaintRef.current();
        afterPaintRef.current = null;
      }
    });
  
    const runAfterUpdate = fn => afterPaintRef.current = fn;
  
    return runAfterUpdate;
  };
  
  const useScroll = () => {
    const [scroll, setScroll] = react.useState({
      scrollX: document.body.getBoundingClientRect().left,
      scrollY: document.body.getBoundingClientRect().top,
      scrollDirection: ''
    });
  
    const listener = () => {
      // `prev` provides us the previous state: https://reactjs.org/docs/hooks-reference.html#functional-updates
      setScroll(prev => ({
        scrollX: document.body.getBoundingClientRect().left,
        scrollY: -document.body.getBoundingClientRect().top,
        // Here we’re comparing the previous state to the current state to get the scroll direction
        scrollDirection: prev.y > -document.body.getBoundingClientRect().top ? 'up' : 'down'
      }));
    };
  
    react.useEffect(() => {
      window.addEventListener('scroll', listener);
      return () => window.removeEventListener('scroll', listener);
    }, []);
    return scroll;
  };
  
  const useSet = (initial_state = []) => {
    const [state, setState] = react.useState(new Set(initial_state));
    const add = react.useCallback(value => setState(prev_state => new Set(prev_state).add(value)), []);
    const remove = react.useCallback(value => setState(prev_state => {
      const new_state = new Set(prev_state);
      new_state.delete(value);
      return new_state;
    }), []);
    return [state, add, remove, react.useCallback(new_state => setState(new Set(new_state)), [])];
  };
  
  const useToggle = (initial_value, toggles) => {
    const [value, setValue] = react.useState(initial_value);
    const initial_index = toggles.indexOf(initial_value);
    const [index, setIndex] = react.useState(initial_index === -1 ? 0 : initial_index);
    return [value, () => {
      const next_index = (index + 1) % toggles.length;
      setValue(toggles[next_index]);
      setIndex(next_index);
      return value;
    }];
  };
  
  const useWhyDidYouUpdate = (name, props) => {
    // Get a mutable ref object where we can store props ...
    // ... for comparison next time this hook runs.
    const previousProps = react.useRef();
    react.useEffect(() => {
      if (previousProps.current) {
        // Get all keys from previous and current props
        const allKeys = Object.keys(_objectSpread2(_objectSpread2({}, previousProps.current), props)); // Use this object to keep track of changed props
  
        const changesObj = {}; // Iterate through keys
  
        allKeys.forEach(key => {
          // If previous is different from current
          if (previousProps.current[key] !== props[key]) {
            // Add to changesObj
            changesObj[key] = {
              from: previousProps.current[key],
              to: props[key]
            };
          }
        }); // If changesObj not empty then output to console
  
        if (Object.keys(changesObj).length) {
          console.log('[why-did-you-update]', new Date().getTime(), name, JSON.stringify(changesObj));
        }
      } // Finally update previousProps with current props for next hook call
  
  
      previousProps.current = props;
    });
  };
  
  const useWindowFocus = () => {
    const [focused, setFocused] = react.useState(true);
    react.useEffect(() => {
      const setFocusedTrue = () => setFocused(true);
  
      const setFocusedFalse = () => setFocused(false);
  
      window.addEventListener('focus', setFocusedTrue);
      window.addEventListener('blur', setFocusedFalse);
      return () => {
        window.removeEventListener('focus', setFocusedTrue);
        window.removeEventListener('blur', setFocusedFalse);
      };
    }, []);
    return focused;
  };
  
  dist$1.useAlarm = useAlarm;
  dist$1.useArcTan = useArcTan;
  var useAutocomplete_1 = dist$1.useAutocomplete = useAutocomplete;
  dist$1.useBodyRef = useBodyRef;
  dist$1.useBreakpoints = useBreakpoints;
  dist$1.useCounter = useCounter;
  dist$1.useDebounce = useDebounce;
  dist$1.useDebounceState = useDebounceState;
  dist$1.useForceUpdate = useForceUpdate;
  dist$1.useHandleInputChange = useHandleInputChange;
  dist$1.useHover = useHover;
  var useIdentifier_1 = dist$1.useIdentifier = useIdentifier;
  dist$1.useInterval = useInterval;
  dist$1.useIsMount = useIsMount;
  var useKeyboardScroll_1 = dist$1.useKeyboardScroll = useKeyboardScroll;
  dist$1.useMergeState = useMergeState;
  dist$1.useModalLocation = useModalLocation;
  dist$1.useMultiSelect = useMultiSelect;
  dist$1.useOnClickOutside = useOnClickOutside;
  dist$1.useOnContextClickOutside = useOnContextClickOutside;
  dist$1.useOnce = useOnce;
  dist$1.useParentNode = useParentNode;
  dist$1.usePosition = usePosition;
  dist$1.usePrevious = usePrevious;
  dist$1.useQueryParams = useQueryParams;
  dist$1.useRefCallback = useRefCallback;
  dist$1.useResult = useResult;
  dist$1.useRunAfterUpdate = useRunAfterUpdate;
  dist$1.useScroll = useScroll;
  dist$1.useSet = useSet;
  dist$1.useToggle = useToggle;
  dist$1.useWhyDidYouUpdate = useWhyDidYouUpdate;
  dist$1.useWindowFocus = useWindowFocus;
  dist$1.useWindowSize = useWindowSize;
  
  function o$1(o, r, t, e) {
    if (void 0 === t && (t = function () {}), void 0 === e && (e = {}), !o) throw new Error("Target element to observe should be a valid DOM Node");
    var n = Object.assign({}, {
      viewport: null,
      modTop: "0px",
      modRight: "0px",
      modBottom: "0px",
      modLeft: "0px",
      threshold: [0]
    }, e),
        i = n.viewport,
        a = n.modTop,
        u = n.modLeft,
        s = n.modBottom,
        f = n.modRight,
        d = n.threshold;
    if (!Array.isArray(d) && "number" != typeof d) throw new Error("threshold should be a number or an array of numbers");
    var h = Array.isArray(d) ? d.map(function (o) {
      return Math.floor(o % 101) / 100;
    }) : [Math.floor(d ? d % 101 : 0) / 100],
        c = Math.min.apply(Math, h),
        m = {
      root: i instanceof Node ? i : null,
      rootMargin: a + " " + f + " " + s + " " + u,
      threshold: h
    },
        l = new IntersectionObserver(function (e, n) {
      var i = e.filter(function (r) {
        return r.target === o;
      })[0],
          a = function () {
        return n.unobserve(o);
      };
  
      i && (i.isInViewport = i.isIntersecting && i.intersectionRatio >= c, i.isInViewport ? r(i, a, o) : t(i, a, o));
    }, m);
    return l.observe(o), function () {
      return l.unobserve(o);
    };
  }
  
  function o(r) {
    return "object" == typeof r && "current" in r;
  }
  
  function c(r) {
    return "function" == typeof r && "function" == typeof r.call;
  }
  
  function useIsInViewPort (i) {
    void 0 === i && (i = {});
  
    var f = React.useState(null),
        p = f[0],
        l = f[1],
        a = i.target,
        v = i.viewport,
        m = function (r, t) {
      var n = {};
  
      for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && -1 === t.indexOf(e) && (n[e] = r[e]);
  
      return n;
    }(i, ["target", "viewport"]),
        w = React.useRef(null),
        y = React.useRef(null),
        b = React.useCallback(function (r) {
      w.current = r, v && (c(v) ? v(r) : o(v) && (v.current = r));
    }, [w, v]),
        s = React.useCallback(function (r) {
      y.current = r, a && (c(a) ? a(r) : o(a) && (a.current = r));
    }, [y, a]);
  
    return React.useEffect(function () {
      if (y.current) return o$1(y.current, function () {
        return l(!0);
      }, function () {
        return l(!1);
      }, Object.assign({}, m, {
        viewport: w.current
      }));
    }, [y.current, m, w]), [p, s, b];
  }
  
  var Option = function Option(_ref) {
    var index = _ref.index,
        active_index = _ref.active_index,
        text = _ref.text,
        input_autofill_id = _ref.input_autofill_id,
        onChange = _ref.onChange,
        setIsVisible = _ref.setIsVisible;
  
    var _useIsInViewPort = useIsInViewPort(),
        _useIsInViewPort2 = _slicedToArray$1(_useIsInViewPort, 2),
        is_visible = _useIsInViewPort2[0],
        is_visible_ref = _useIsInViewPort2[1];
  
    React.useEffect(function () {
      setIsVisible({
        index: index,
        is_visible: is_visible
      });
    }, [is_visible]);
    return /*#__PURE__*/React__default["default"].createElement("li", {
      id: "fl-option-".concat(input_autofill_id, "-").concat(index),
      ref: is_visible_ref,
      className: classNames('fl-input-select-option', {
        'fl-active-option': index === active_index
      })
    }, /*#__PURE__*/React__default["default"].createElement("button", {
      type: "button",
      className: "btn-unstyled fl-input-select-option-button",
      onMouseDown: onChange
    }, text));
  };
  
  Option.propTypes = {
    index: PropTypes.number,
    active_index: PropTypes.number,
    text: PropTypes.string,
    onChange: PropTypes.func,
    input_autofill_id: PropTypes.string,
    setIsVisible: PropTypes.func
  };
  
  var _excluded = ["always_float", "className", "containerClassNames", "containerStyle", "listStyle", "dark", "transparent", "message", "invalid", "input_ref", "label", "onBlur", "onChange", "onFocus", "options", "autocomplete_strings", "prevent_autofill", "show_bar", "value", "wrap_label", "placeholder", "max_suggestions"];
  
  var _templateObject, _templateObject2;
  var DropdownSelect = newStyled.ul(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tdisplay: none;\n\tposition: absolute;\n\tmargin: 0;\n\tbackground-color: #fff;\n\ttop: 99%;\n\twidth: 100%;\n\tz-index: ", ";\n\tlist-style-type: none;\n\tpadding: 0;\n\tbox-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);\n\toverflow-y: scroll;\n\tborder-radius: 0 0 5px 5px;\n\n\t&::-webkit-scrollbar {\n\t\t-webkit-appearance: none;\n\t\twidth: 10px;\n\t\tbackground-color: transparent;\n\t}\n\n\t&::-webkit-scrollbar-thumb {\n\t\tborder-radius: 5px;\n\t\tbackground-color: rgba(0, 0, 0, 0.4);\n\t\t-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n\t}\n\n\t.fl-input-select-option {\n\t\tpadding: 0;\n\t\tcursor: pointer;\n\t\tborder-bottom: 1px solid #eee;\n\t\tcolor: #1b1b1c;\n\t}\n\n\t.fl-input-select-option .fl-input-select-option-button {\n\t\tpadding: 0.5em 1em;\n\t\twidth: 100%;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t\tborder: none;\n\t\tbackground: transparent;\n\t}\n\n\t.fl-input-select-option:hover,\n\t.fl-active-option {\n\t\tbackground-color: #f8f8f8;\n\t}\n"])), Math.pow(10, 10));
  var InputContainer = newStyled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tposition: relative;\n\ttransition: 200ms ease all;\n\toverflow: hidden;\n\n\t// .fl-input-container {\n\t// \t-ms-flex-direction: column;\n\t// \t-webkit-flex-direction: column;\n\t// \tdisplay: -ms-flexbox;\n\t// \tdisplay: -webkit-flex;\n\t// \tdisplay: flex;\n\t// \tflex-direction: column;\n\t// \tposition: relative;\n\t// \ttransition: 200ms ease all;\n\t// \toverflow: hidden;\n\t// }\n\n\t&.fl-input-container-msg-show {\n\t\tpadding-bottom: 1.5em;\n\t}\n\n\tinput:not(:focus):not(.fl-valid):not(.fl-invalid) {\n\t\tcolor: transparent;\n\t}\n\n\tinput,\n\tlabel,\n\t.fl-label,\n\t.fl-msg {\n\t\t-webkit-font-smoothing: antialiased;\n\t\tfont-family: 'Roboto', sans-serif;\n\t\ttext-shadow: none;\n\t}\n\n\tinput:disabled {\n\t\tbackground-color: #e9ecef;\n\t\tcursor: not-allowed;\n\t}\n\n\tinput {\n\t\t-moz-appearance: none;\n\t\t-webkit-appearance: none;\n\t\t-webkit-tap-highlight-color: transparent;\n\t\tborder-radius: 0;\n\t\tdisplay: -moz-flex;\n\t\tdisplay: -ms-flexbox;\n\t\tdisplay: -webkit-flex;\n\t\tdisplay: flex;\n\t\tfont-size: 100%;\n\t\tline-height: 25px;\n\n\t\tbackground-color: #fff;\n\t\tpadding: 0.5em;\n\t\ttext-shadow: 0 0 #000;\n\t}\n\n\tinput[type='date'],\n\tinput[type='time'],\n\tinput[type='datetime-local'],\n\tinput[type='month'] {\n\t\tline-height: 1em;\n\t}\n\n\t.fl-input-dark {\n\t\tborder-radius: 0.25em;\n\t}\n\n\t.fl-transparent {\n\t\tbackground-color: transparent;\n\t\tcolor: #fff;\n\t\tborder-radius: 0;\n\t}\n\n\tinput:-webkit-autofill.fl-transparent {\n\t\t-webkit-box-shadow: 0 0 0px 1000px #16a1d4 inset;\n\t\t-webkit-text-fill-color: #fff;\n\t}\n\n\t.fl-input-select-container input {\n\t\tcursor: pointer;\n\t}\n\n\t.fl-input-group .fl-input-container {\n\t\tdisplay: inline-flex;\n\t\tvertical-align: top;\n\t}\n\n\t.fl-input-group .btn {\n\t\tvertical-align: bottom;\n\t}\n\n\t.fl-input-group .fl-input-container:not(:first-of-type):not(:last-child) input {\n\t\tborder-radius: 0;\n\t}\n\n\t.fl-input-group .fl-input-container:first-of-type input {\n\t\tborder-top-right-radius: 0;\n\t\tborder-bottom-right-radius: 0;\n\t}\n\n\t.fl-input-group .fl-input-container:last-child input {\n\t\tborder-top-left-radius: 0;\n\t\tborder-bottom-left-radius: 0;\n\t}\n\n\t.fl-input-label {\n\t\t-moz-transform-origin: left top;\n\t\t-moz-transform: scale(1) translate3d(0, 2.1em, 0);\n\t\t-moz-transition: 200ms ease all;\n\t\t-ms-flex-order: 1;\n\t\t-webkit-order: 1;\n\t\t-webkit-transform-origin: left top;\n\t\t-webkit-transform: scale(1) translate3d(0, 2.1em, 0);\n\t\t-webkit-transition: 200ms ease all;\n\t\tcolor: #999;\n\t\tfont-weight: normal;\n\t\topacity: 0.75;\n\t\torder: 1;\n\t\tpadding-left: 0.5em;\n\t\tpointer-events: none;\n\t\ttext-transform: capitalize;\n\t\ttransform-origin: left top;\n\t\ttransform: scale(1) translate3d(0, 2.1em, 0);\n\t\ttransition: 200ms ease all;\n\t\tmargin-bottom: 0;\n\t\twhite-space: nowrap;\n\t}\n\n\t#complete-profile input[required] + label {\n\t\tfont-weight: bold;\n\t}\n\n\t#complete-profile input.fl-valid + .fl-input-label {\n\t\tfont-weight: normal;\n\t}\n\n\t.fl-input-label.fl-transparent {\n\t\tcolor: #fff;\n\t\topacity: 1;\n\t}\n\n\t.fl-label {\n\t\tcolor: #3949ab;\n\t\ttransform: scale(0.8) translate3d(0, 5px, 0);\n\t\tmargin-bottom: 0.15em;\n\t\tmargin-left: -0.5em; /* I'm not entirely sure why this is needed to get the label to properly align but w/e */\n\t}\n\n\t.fl-input-label-address::after {\n\t\tcontent: 'Address';\n\t}\n\n\tinput[required] + label:not(:empty)::after {\n\t\tcontent: '*';\n\t}\n\n\tinput:focus + label,\n\t.fl-valid + label,\n\t.fl-invalid + label {\n\t\t-moz-transform: scale(0.8) translate3d(0, 5px, 0);\n\t\t-webkit-transform: scale(0.8) translate3d(0, 5px, 0);\n\t\tcolor: #3949ab;\n\t\tpadding-left: 0.25em;\n\t\topacity: 1;\n\t\ttransform: scale(0.8) translate3d(0, 5px, 0);\n\t}\n\n\tinput:focus + label.fl-input-label-wrap,\n\t.fl-valid + label.fl-input-label-wrap,\n\t.fl-invalid + label.fl-input-label-wrap {\n\t\twhite-space: normal;\n\t}\n\n\tinput:focus + label.fl-input-label-dark,\n\tinput.fl-valid + label.fl-input-label-dark,\n\t.fl-invalid + label.fl-input-label-dark {\n\t\tcolor: #fff;\n\t}\n\n\tinput[required]:focus + label::after,\n\tinput[required].fl-valid + label::after,\n\t.fl-invalid + label::after {\n\t\tcontent: '';\n\t}\n\n\t.fl-input-select-container input:focus ~ .fl-input-select {\n\t\tdisplay: block;\n\t}\n\n\t.fl-input:active,\n\t.fl-input:focus,\n\t.fl-input-label {\n\t\toutline: 0;\n\t}\n\n\t.fl-input {\n\t\t-ms-flex-order: 2;\n\t\t-ms-flex: 1 1 auto;\n\t\t-webkit-flex: 1 1 auto;\n\t\t-webkit-order: 2;\n\t\tborder: 0;\n\t\tborder-bottom: 1px solid rgba(0, 0, 0, 0.15);\n\t\tcolor: #000;\n\t\tflex: 1 1 auto;\n\t\torder: 2;\n\t}\n\n\t.fl-input.fl-transparent {\n\t\tborder-bottom: 1px solid #fff;\n\t}\n\n\t.fl-input-bar {\n\t\t-ms-flex-order: 3;\n\t\t-webkit-order: 3;\n\t\tdisplay: block;\n\t\torder: 3;\n\t\ttop: 0;\n\t\twidth: 100% !important;\n\t}\n\n\t.fl-input-bar::after,\n\t.fl-input-bar::before {\n\t\t-moz-transition: 200ms ease all;\n\t\t-webkit-transition: 200ms ease all;\n\t\tbackground: #3949ab;\n\t\tbottom: 0;\n\t\tcontent: '';\n\t\theight: 2px;\n\t\tposition: absolute;\n\t\ttransition: 200ms ease all;\n\t\twidth: 0;\n\t}\n\n\t.fl-input-bar::before {\n\t\tleft: 50%;\n\t}\n\n\t.fl-input-bar::after {\n\t\tright: 50%;\n\t}\n\n\t.fl-input:focus ~ .fl-input-bar::after,\n\t.fl-input:focus ~ .fl-input-bar::before,\n\t.fl-invalid ~ .fl-input-bar::after,\n\t.fl-invalid ~ .fl-input-bar::before {\n\t\twidth: 50%;\n\t}\n\n\t.fl-input-bar,\n\t.fl-msg {\n\t\tposition: relative;\n\t\twidth: inherit;\n\t}\n\n\t.fl-msg {\n\t\tbottom: 0;\n\t\tdisplay: none;\n\t\tfont-size: 13px;\n\t\toverflow: hidden;\n\t\tposition: absolute;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\twidth: 90%;\n\t\tword-break: break-all;\n\t\tword-wrap: break-word;\n\t}\n\n\t.fl-msg-show {\n\t\tdisplay: inline-block;\n\t}\n\n\t.fl-invalid ~ .fl-input-bar::after,\n\t.fl-invalid ~ .fl-input-bar::before {\n\t\tbackground: #e74c3c;\n\t}\n\n\t.fl-msg {\n\t\tcolor: #1b1b1c;\n\t}\n\n\t.fl-input.fl-invalid + label,\n\t.fl-input.fl-invalid ~ .fl-msg {\n\t\tcolor: #e74c3c;\n\t}\n\n\t.fl-hide-cursor {\n\t\tcolor: transparent;\n\t\ttext-shadow: 0 0 #000;\n\t}\n"]))); // For select, type="select" and options={[{text: "Example object", value: 'ex'}]}
  // For autocomplete, type="text" and autocomplete_strings={['Just strings']}
  
  var FloatingLabel = function FloatingLabel(_ref) {
    var _refs$reference$curre;
  
    var always_float = _ref.always_float,
        className = _ref.className,
        containerClassNames = _ref.containerClassNames,
        containerStyle = _ref.containerStyle,
        listStyle = _ref.listStyle,
        dark = _ref.dark,
        transparent = _ref.transparent,
        message = _ref.message,
        invalid = _ref.invalid,
        input_ref = _ref.input_ref,
        label = _ref.label,
        _onBlur = _ref.onBlur,
        _onChange = _ref.onChange,
        _onFocus = _ref.onFocus,
        options = _ref.options,
        autocomplete_strings = _ref.autocomplete_strings,
        prevent_autofill = _ref.prevent_autofill,
        show_bar = _ref.show_bar,
        value = _ref.value,
        wrap_label = _ref.wrap_label,
        placeholder = _ref.placeholder,
        max_suggestions = _ref.max_suggestions,
        input_props = _objectWithoutProperties$1(_ref, _excluded);
  
    var default_id = useIdentifier_1();
    var input_autofill_id = useIdentifier_1();
    var label_autofill_id = useIdentifier_1();
  
    var _useState = React.useState(false),
        _useState2 = _slicedToArray$1(_useState, 2),
        is_focused = _useState2[0],
        setIsFocused = _useState2[1];
  
    var _useState3 = React.useState({}),
        _useState4 = _slicedToArray$1(_useState3, 2),
        size_data = _useState4[0],
        setSizeData = _useState4[1];
  
    var _useReducer = React.useReducer(function (state, action) {
      if (action.is_visible) {
        state.add(action.index);
      } else {
        state["delete"](action.index);
      }
  
      return state;
    }, new Set()),
        _useReducer2 = _slicedToArray$1(_useReducer, 2),
        visible = _useReducer2[0],
        setVisible = _useReducer2[1];
  
    var _useAutocomplete = useAutocomplete_1(autocomplete_strings, max_suggestions),
        _useAutocomplete2 = _slicedToArray$1(_useAutocomplete, 2),
        all_autocomplete_options = _useAutocomplete2[0],
        matchAutocomplete = _useAutocomplete2[1];
  
    var initial_options = options || all_autocomplete_options;
    var selected_option = initial_options && initial_options.find(function (o) {
      return String(o.value) === String(value);
    });
  
    var _useFloating = useFloating({
      placement: 'bottom-start',
      portaled: true,
      middleware: [size({
        apply: setSizeData
      }), shift()]
    }),
        dropdown_x = _useFloating.x,
        dropdown_y = _useFloating.y,
        dropdown_reference = _useFloating.reference,
        dropdown_floating = _useFloating.floating,
        dropdown_strategy = _useFloating.strategy,
        refs = _useFloating.refs,
        update = _useFloating.update;
  
    var _useKeyboardScroll = useKeyboardScroll_1({
      initial_options: initial_options,
      selected_option: selected_option,
      onEnter: function onEnter(index) {
        _onChange({
          target: {
            name: input_props.name,
            value: visible_options[index].value
          },
          preventDefault:
          /* istanbul ignore next */
          function preventDefault() {
            return null;
          }
        }, true);
      }
    }),
        handleKeyboardScroll = _useKeyboardScroll.handleKeyboardScroll,
        active_index = _useKeyboardScroll.active_index,
        visible_options = _useKeyboardScroll.visible_options,
        updateOptions = _useKeyboardScroll.updateOptions; // Change behavior for select input types or text with autocomplete.
  
  
    var is_autocomplete = !!autocomplete_strings;
    var is_select = input_props.type === 'select';
    var is_list = input_props.type === 'list';
    var display_value = is_select && selected_option ? selected_option.text : value !== null && value !== void 0 ? value : ''; // Prevent autofill if requested or if input is select type or if autocomplete options provided
  
    var should_prevent_autofill = prevent_autofill || is_select || is_autocomplete;
    var has_value = Boolean(display_value) || always_float || Boolean(placeholder) || input_props.type === 'date';
    var has_message = Boolean(message);
    React.useEffect(function () {
      if (options) {
        updateOptions(options);
      }
    }, [JSON.stringify(options)]);
    React.useEffect(function () {
      if (autocomplete_strings && autocomplete_strings.length > 0) {
        var new_autocomplete_options = matchAutocomplete(value, {
          show_on_empty: is_focused
        });
  
        if (new_autocomplete_options) {
          updateOptions(new_autocomplete_options);
        }
      }
    }, [value, is_focused, JSON.stringify(autocomplete_strings)]);
  
    function scrollToActiveItem() {
      var li = document.getElementById("fl-option-".concat(input_autofill_id, "-").concat(active_index));
  
      if (li && window.getComputedStyle(li.parentElement).display !== 'none' && !visible.has(active_index)) {
        scrollIntoView(li);
      }
    }
  
    React.useEffect(function () {
      if (is_select || is_autocomplete) {
        scrollToActiveItem();
      }
    }, [active_index]);
    React.useEffect(function () {
      if (!refs.reference.current || !refs.floating.current) {
        return function () {
          return null;
        };
      }
  
      var parents = [].concat(_toConsumableArray$1(getScrollParents(refs.reference.current)), _toConsumableArray$1(getScrollParents(refs.floating.current)));
      parents.forEach(function (parent) {
        parent.addEventListener('scroll', update);
        parent.addEventListener('resize', update);
      });
      return function () {
        parents.forEach(function (parent) {
          parent.removeEventListener('scroll', update);
          parent.removeEventListener('resize', update);
        });
      };
    }, [refs.reference, refs.floating, update]);
    React.useLayoutEffect(function () {
      update();
    }, [is_focused]);
  
    if (is_select) {
      input_props.type = 'text'; // eslint-disable-line no-param-reassign
    } // Display classes for input and error message
  
  
    var input_classes = classNames('fl-input', {
      'fl-valid': has_value && !invalid,
      'fl-invalid': invalid,
      'fl-hide-cursor': is_select
    });
    var message_classes = classNames({
      clickable: has_message,
      'fl-msg': has_message,
      'fl-msg-show': has_message
    });
  
    var handleInputChange = function handleInputChange(e) {
      e.preventDefault();
  
      if (!is_select && !is_list) {
        if (_onChange) _onChange(e);
      }
  
      return false;
    };
  
    return /*#__PURE__*/React__default["default"].createElement(InputContainer, {
      className: classNames('fl-input-container', containerClassNames, {
        'fl-input-select-container': is_select || is_autocomplete,
        'fl-input-container-msg-show': has_message
      }),
      style: containerStyle,
      ref: dropdown_reference
    }, is_select && /*#__PURE__*/React__default["default"].createElement(FontAwesomeIcon, {
      icon: faAngleDoubleDown.faAngleDoubleDown,
      style: {
        position: 'absolute',
        right: '0.5em',
        bottom: '0.75em',
        pointerEvents: 'none'
      }
    }), /*#__PURE__*/React__default["default"].createElement("input", _extends$3({
      ref: input_ref,
      tab_index: "0",
      className: classNames(input_classes, className, {
        'fl-input-dark': dark,
        'fl-transparent': transparent
      }),
      value: display_value,
      placeholder: placeholder,
      onChange: handleInputChange,
      onFocus: function onFocus(e) {
        setIsFocused(true);
        if (_onFocus) _onFocus(e);
  
        if (is_select || is_autocomplete) {
          setTimeout(scrollToActiveItem, 100);
        }
      },
      onBlur: function onBlur(e) {
        setIsFocused(false);
        if (_onBlur) _onBlur(e);
  
        if ((is_select || is_autocomplete) && !visible.has(active_index)) {
          scrollIntoView(e.target);
        }
      },
      onKeyDown: function onKeyDown(e) {
        if (is_autocomplete) {
          return handleKeyboardScroll(e);
        }
  
        if (is_select) {
          e.preventDefault();
          return handleKeyboardScroll(e);
        }
  
        return true;
      },
      autoComplete: should_prevent_autofill ? 'one-time-code' : 'on'
    }, input_props, {
      id: should_prevent_autofill ? input_autofill_id : input_props.id || default_id
    })), /*#__PURE__*/React__default["default"].createElement("label", {
      htmlFor: should_prevent_autofill ? label_autofill_id : input_props.id || default_id,
      className: classNames('fl-input-label', {
        'fl-input-label-dark': dark,
        'fl-input-label-wrap': wrap_label,
        'fl-transparent': transparent
      })
    }, label), show_bar && /*#__PURE__*/React__default["default"].createElement("span", {
      className: "fl-input-bar"
    }), message && /*#__PURE__*/React__default["default"].createElement("span", {
      role: "button",
      tabIndex: -1,
      onClick: function onClick() {
        _onChange({
          target: {
            name: input_props.name,
            value: message
          }
        });
      },
      onKeyPress: function onKeyPress(e) {
        if (e.key === 'Enter') {
          _onChange({
            target: {
              name: input_props.name,
              value: message
            }
          });
        }
      },
      className: message_classes
    }, message), (is_select || is_autocomplete) && !input_props.disabled && /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default["default"].createElement(DropdownSelect, {
      style: _objectSpread2$2(_objectSpread2$2({}, listStyle), {}, {
        position: dropdown_strategy,
        top: '0',
        left: '0',
        transform: "translate(".concat(Math.round(dropdown_x), "px,").concat(Math.round(dropdown_y), "px)"),
        maxHeight: size_data.height ? size_data.height - 50 : '',
        width: (_refs$reference$curre = refs.reference.current) === null || _refs$reference$curre === void 0 ? void 0 : _refs$reference$curre.getBoundingClientRect().width,
        display: is_focused ? 'block' : 'none'
      }),
      title: "".concat(label, " Dropdown"),
      ref: dropdown_floating
    }, visible_options.map(function (option, index) {
      return /*#__PURE__*/React__default["default"].createElement(Option, {
        key: option.value || "i-".concat(index),
        index: index,
        active_index: active_index,
        text: option.text,
        value: option.value,
        input_autofill_id: input_autofill_id,
        onChange: function onChange() {
          return _onChange({
            target: {
              name: input_props.name,
              value: option.value
            },
            preventDefault:
            /* istanbul ignore next */
            function preventDefault() {
              return null;
            }
          }, true);
        },
        setIsVisible: setVisible
      });
    })), document.body));
  };
  
  FloatingLabel.propTypes = {
    always_float: PropTypes.bool,
    autocomplete_strings: PropTypes.arrayOf(PropTypes.string),
    className: PropTypes.string,
    containerClassNames: PropTypes.string,
    containerStyle: PropTypes.objectOf(PropTypes.any),
    dark: PropTypes.bool,
    input_ref: PropTypes.any,
    // todo: I have no idea what this should be
    invalid: PropTypes.bool,
    label: PropTypes.oneOfType([PropTypes.string, PropTypes.objectOf(PropTypes.any)]),
    listStyle: PropTypes.objectOf(PropTypes.any),
    max_suggestions: PropTypes.number,
    message: PropTypes.string,
    onBlur: PropTypes.func,
    onChange: PropTypes.func,
    onFocus: PropTypes.func,
    options: PropTypes.arrayOf(PropTypes.shape({
      text: PropTypes.any,
      value: PropTypes.any
    })),
    placeholder: PropTypes.string,
    prevent_autofill: PropTypes.bool,
    show_bar: PropTypes.bool,
    transparent: PropTypes.bool,
    value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    wrap_label: PropTypes.bool
  };
  FloatingLabel.defaultProps = {
    always_float: false,
    dark: false,
    invalid: false,
    message: '',
    prevent_autofill: false,
    show_bar: true,
    transparent: false // options: [],
  
  };
  
  module.exports = FloatingLabel;
  