/******/ (function() { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ 1062:
/***/ (function(__unused_webpack_module, exports) {

"use strict";
var __webpack_unused_export__;


__webpack_unused_export__ = ({
  value: true
});
var key = {
  fullscreenEnabled: 0,
  fullscreenElement: 1,
  requestFullscreen: 2,
  exitFullscreen: 3,
  fullscreenchange: 4,
  fullscreenerror: 5,
  fullscreen: 6
};

var webkit = ['webkitFullscreenEnabled', 'webkitFullscreenElement', 'webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitfullscreenchange', 'webkitfullscreenerror', '-webkit-full-screen'];

var moz = ['mozFullScreenEnabled', 'mozFullScreenElement', 'mozRequestFullScreen', 'mozCancelFullScreen', 'mozfullscreenchange', 'mozfullscreenerror', '-moz-full-screen'];

var ms = ['msFullscreenEnabled', 'msFullscreenElement', 'msRequestFullscreen', 'msExitFullscreen', 'MSFullscreenChange', 'MSFullscreenError', '-ms-fullscreen'];

// so it doesn't throw if no window or document
var document = typeof window !== 'undefined' && typeof window.document !== 'undefined' ? window.document : {};

var vendor = 'fullscreenEnabled' in document && Object.keys(key) || webkit[0] in document && webkit || moz[0] in document && moz || ms[0] in document && ms || [];

exports.A = {
  requestFullscreen: function requestFullscreen(element) {
    return element[vendor[key.requestFullscreen]]();
  },
  requestFullscreenFunction: function requestFullscreenFunction(element) {
    return element[vendor[key.requestFullscreen]];
  },
  get exitFullscreen() {
    return document[vendor[key.exitFullscreen]].bind(document);
  },
  get fullscreenPseudoClass() {
    return ':' + vendor[key.fullscreen];
  },
  addEventListener: function addEventListener(type, handler, options) {
    return document.addEventListener(vendor[key[type]], handler, options);
  },
  removeEventListener: function removeEventListener(type, handler, options) {
    return document.removeEventListener(vendor[key[type]], handler, options);
  },
  get fullscreenEnabled() {
    return Boolean(document[vendor[key.fullscreenEnabled]]);
  },
  set fullscreenEnabled(val) {},
  get fullscreenElement() {
    return document[vendor[key.fullscreenElement]];
  },
  set fullscreenElement(val) {},
  get onfullscreenchange() {
    return document[('on' + vendor[key.fullscreenchange]).toLowerCase()];
  },
  set onfullscreenchange(handler) {
    return document[('on' + vendor[key.fullscreenchange]).toLowerCase()] = handler;
  },
  get onfullscreenerror() {
    return document[('on' + vendor[key.fullscreenerror]).toLowerCase()];
  },
  set onfullscreenerror(handler) {
    return document[('on' + vendor[key.fullscreenerror]).toLowerCase()] = handler;
  }
};

/***/ }),

/***/ 9156:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* unused harmony export clsx */
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ __webpack_exports__.A = (clsx);

/***/ }),

/***/ 6112:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: function() { return /* binding */ createCache; }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js
/*

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 () {
  // Using Node instead of HTMLElement since container may be a ShadowRoot
  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 ? "production" === '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 (false) { var 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 (false) {}
      }
    } 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 (false) {}
  };

  return StyleSheet;
}();



;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/stylis/src/Utility.js
/**
 * @param {number}
 * @return {number}
 */
var abs = Math.abs

/**
 * @param {number}
 * @return {string}
 */
var Utility_from = String.fromCharCode

/**
 * @param {object}
 * @return {object}
 */
var Utility_assign = Object.assign

/**
 * @param {string} value
 * @param {number} length
 * @return {number}
 */
function hash (value, length) {
	return Utility_charat(value, 0) ^ 45 ? (((((((length << 2) ^ Utility_charat(value, 0)) << 2) ^ Utility_charat(value, 1)) << 2) ^ Utility_charat(value, 2)) << 2) ^ Utility_charat(value, 3) : 0
}

/**
 * @param {string} value
 * @return {string}
 */
function trim (value) {
	return value.trim()
}

/**
 * @param {string} value
 * @param {RegExp} pattern
 * @return {string?}
 */
function Utility_match (value, pattern) {
	return (value = pattern.exec(value)) ? value[0] : value
}

/**
 * @param {string} value
 * @param {(string|RegExp)} pattern
 * @param {string} replacement
 * @return {string}
 */
function Utility_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 Utility_charat (value, index) {
	return value.charCodeAt(index) | 0
}

/**
 * @param {string} value
 * @param {number} begin
 * @param {number} end
 * @return {string}
 */
function Utility_substr (value, begin, end) {
	return value.slice(begin, end)
}

/**
 * @param {string} value
 * @return {number}
 */
function Utility_strlen (value) {
	return value.length
}

/**
 * @param {any[]} value
 * @return {number}
 */
function Utility_sizeof (value) {
	return value.length
}

/**
 * @param {any} value
 * @param {any[]} array
 * @return {any}
 */
function Utility_append (value, array) {
	return array.push(value), value
}

/**
 * @param {string[]} array
 * @param {function} callback
 * @return {string}
 */
function Utility_combine (array, callback) {
	return array.map(callback).join('')
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/stylis/src/Tokenizer.js


var line = 1
var column = 1
var Tokenizer_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 Tokenizer_copy (root, props) {
	return Utility_assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
}

/**
 * @return {number}
 */
function Tokenizer_char () {
	return character
}

/**
 * @return {number}
 */
function prev () {
	character = position > 0 ? Utility_charat(characters, --position) : 0

	if (column--, character === 10)
		column = 1, line--

	return character
}

/**
 * @return {number}
 */
function next () {
	character = position < Tokenizer_length ? Utility_charat(characters, position++) : 0

	if (column++, character === 10)
		column = 1, line++

	return character
}

/**
 * @return {number}
 */
function peek () {
	return Utility_charat(characters, position)
}

/**
 * @return {number}
 */
function caret () {
	return position
}

/**
 * @param {number} begin
 * @param {number} end
 * @return {string}
 */
function slice (begin, end) {
	return Utility_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, Tokenizer_length = Utility_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 {string} value
 * @return {string[]}
 */
function Tokenizer_tokenize (value) {
	return dealloc(tokenizer(alloc(value)))
}

/**
 * @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 {string[]} children
 * @return {string[]}
 */
function tokenizer (children) {
	while (next())
		switch (token(character)) {
			case 0: append(identifier(position - 1), children)
				break
			case 2: append(delimit(character), children)
				break
			default: append(from(character), children)
		}

	return children
}

/**
 * @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) + '*' + Utility_from(type === 47 ? type : next())
}

/**
 * @param {number} index
 * @return {string}
 */
function identifier (index) {
	while (!token(peek()))
		next()

	return slice(index, position)
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/stylis/src/Enum.js
var Enum_MS = '-ms-'
var Enum_MOZ = '-moz-'
var Enum_WEBKIT = '-webkit-'

var COMMENT = 'comm'
var Enum_RULESET = 'rule'
var Enum_DECLARATION = 'decl'

var PAGE = '@page'
var MEDIA = '@media'
var IMPORT = '@import'
var CHARSET = '@charset'
var VIEWPORT = '@viewport'
var SUPPORTS = '@supports'
var DOCUMENT = '@document'
var NAMESPACE = '@namespace'
var Enum_KEYFRAMES = '@keyframes'
var FONT_FACE = '@font-face'
var COUNTER_STYLE = '@counter-style'
var FONT_FEATURE_VALUES = '@font-feature-values'
var LAYER = '@layer'

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/stylis/src/Serializer.js



/**
 * @param {object[]} children
 * @param {function} callback
 * @return {string}
 */
function Serializer_serialize (children, callback) {
	var output = ''
	var length = Utility_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 LAYER: if (element.children.length) break
		case IMPORT: case Enum_DECLARATION: return element.return = element.return || element.value
		case COMMENT: return ''
		case Enum_KEYFRAMES: return element.return = element.value + '{' + Serializer_serialize(element.children, callback) + '}'
		case Enum_RULESET: element.value = element.props.join(',')
	}

	return Utility_strlen(children = Serializer_serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/stylis/src/Middleware.js






/**
 * @param {function[]} collection
 * @return {function}
 */
function middleware (collection) {
	var length = Utility_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, children)
					return
				case KEYFRAMES:
					return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)
				case RULESET:
					if (element.length)
						return combine(element.props, function (value) {
							switch (match(value, /(::plac\w+|:read-\w+)/)) {
								// :read-(only|write)
								case ':read-only': case ':read-write':
									return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback)
								// :placeholder
								case '::placeholder':
									return serialize([
										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 ''
						})
			}
}

/**
 * @param {object} element
 * @param {number} index
 * @param {object[]} children
 */
function namespace (element) {
	switch (element.type) {
		case RULESET:
			element.props = element.props.map(function (value) {
				return combine(tokenize(value), function (value, index, children) {
					switch (charat(value, 0)) {
						// \f
						case 12:
							return substr(value, 1, strlen(value))
						// \0 ( + > ~
						case 0: case 40: case 43: case 62: case 126:
							return value
						// :
						case 58:
							if (children[++index] === 'global')
								children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1)
						// \s
						case 32:
							return index === 1 ? '' : value
						default:
							switch (index) {
								case 0: element = value
									return sizeof(children) > 1 ? '' : value
								case index = sizeof(children) - 1: case 2:
									return index === 2 ? value + element + element : value + element
								default:
									return value
							}
					}
				})
			})
	}
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/stylis/src/Parser.js




/**
 * @param {string} value
 * @return {object[]}
 */
function compile (value) {
	return dealloc(parse('', 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 (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 && Utility_charat(characters, length - 1) == 58) {
					if (indexof(characters += Utility_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:
						Utility_append(comment(commenter(next(), caret()), root, parent), declarations)
						break
					default:
						characters += '/'
				}
				break
			// {
			case 123 * variable:
				points[index++] = Utility_strlen(characters) * ampersand
			// } ; \0
			case 125 * variable: case 59: case 0:
				switch (character) {
					// \0 }
					case 0: case 125: scanning = 0
					// ;
					case 59 + offset: if (ampersand == -1) characters = Utility_replace(characters, /\f/g, '')
						if (property > 0 && (Utility_strlen(characters) - length))
							Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(Utility_replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)
						break
					// @ ;
					case 59: characters += ';'
					// { rule/at-rule
					default:
						Utility_append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)

						if (character === 123)
							if (offset === 0)
								parse(characters, root, reference, reference, props, rulesets, length, points, children)
							else
								switch (atrule === 99 && Utility_charat(characters, 3) === 110 ? 100 : atrule) {
									// d l m s
									case 100: case 108: case 109: case 115:
										parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)
										break
									default:
										parse(characters, reference, reference, reference, [''], children, 0, points, children)
								}
				}

				index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo
				break
			// :
			case 58:
				length = 1 + Utility_strlen(characters), property = previous
			default:
				if (variable < 1)
					if (character == 123)
						--variable
					else if (character == 125 && variable++ == 0 && prev() == 125)
						continue

				switch (characters += Utility_from(character), character * variable) {
					// &
					case 38:
						ampersand = offset > 0 ? 1 : (characters += '\f', -1)
						break
					// ,
					case 44:
						points[index++] = (Utility_strlen(characters) - 1) * ampersand, ampersand = 1
						break
					// @
					case 64:
						// -
						if (peek() === 45)
							characters += delimit(next())

						atrule = peek(), offset = length = Utility_strlen(type = characters += identifier(caret())), character++
						break
					// -
					case 45:
						if (previous === 45 && Utility_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 = Utility_sizeof(rule)

	for (var i = 0, j = 0, k = 0; i < index; ++i)
		for (var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
			if (z = trim(j > 0 ? rule[x] + ' ' + y : Utility_replace(y, /&\f/g, rule[x])))
				props[k++] = z

	return node(value, root, parent, offset === 0 ? Enum_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, Utility_from(Tokenizer_char()), Utility_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, Enum_DECLARATION, Utility_substr(value, 0, length), Utility_substr(value, length + 1, -1), length)
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js





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] += Utility_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.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
};

var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
  return function (element, index, children) {
    if (element.type !== 'rule' || cache.compat) return;
    var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);

    if (unsafePseudoClasses) {
      var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent`
      //
      // considering this input:
      // .a {
      //   .b /* comm */ {}
      //   color: hotpink;
      // }
      // we get output corresponding to this:
      // .a {
      //   & {
      //     /* comm */
      //     color: hotpink;
      //   }
      //   .b {}
      // }

      var commentContainer = isNested ? element.parent.children : // global rule at the root level
      children;

      for (var i = commentContainer.length - 1; i >= 0; i--) {
        var node = commentContainer[i];

        if (node.line < element.line) {
          break;
        } // it is quite weird but comments are *usually* put at `column: element.column - 1`
        // so we seek *from the end* for the node that is earlier than the rule's `element` and check that
        // this will also match inputs like this:
        // .a {
        //   /* comm */
        //   .b {}
        // }
        //
        // but that is fine
        //
        // it would be the easiest to change the placement of the comment to be the first child of the rule:
        // .a {
        //   .b { /* comm */ }
        // }
        // with such inputs we wouldn't have to search for the comment at all
        // TODO: consider changing this comment placement in the next major version


        if (node.column < element.column) {
          if (isIgnoringComment(node)) {
            return;
          }

          break;
        }
      }

      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);
  }
};

/* eslint-disable no-fallthrough */

function emotion_cache_browser_esm_prefix(value, length) {
  switch (hash(value, length)) {
    // color-adjust
    case 5103:
      return Enum_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 Enum_WEBKIT + value + value;
    // appearance, user-select, transform, hyphens, text-size-adjust

    case 5349:
    case 4246:
    case 4810:
    case 6968:
    case 2756:
      return Enum_WEBKIT + value + Enum_MOZ + value + Enum_MS + value + value;
    // flex, flex-direction

    case 6828:
    case 4268:
      return Enum_WEBKIT + value + Enum_MS + value + value;
    // order

    case 6165:
      return Enum_WEBKIT + value + Enum_MS + 'flex-' + value + value;
    // align-items

    case 5187:
      return Enum_WEBKIT + value + Utility_replace(value, /(\w+).+(:[^]+)/, Enum_WEBKIT + 'box-$1$2' + Enum_MS + 'flex-$1$2') + value;
    // align-self

    case 5443:
      return Enum_WEBKIT + value + Enum_MS + 'flex-item-' + Utility_replace(value, /flex-|-self/, '') + value;
    // align-content

    case 4675:
      return Enum_WEBKIT + value + Enum_MS + 'flex-line-pack' + Utility_replace(value, /align-content|flex-|-self/, '') + value;
    // flex-shrink

    case 5548:
      return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'shrink', 'negative') + value;
    // flex-basis

    case 5292:
      return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'basis', 'preferred-size') + value;
    // flex-grow

    case 6060:
      return Enum_WEBKIT + 'box-' + Utility_replace(value, '-grow', '') + Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'grow', 'positive') + value;
    // transition

    case 4554:
      return Enum_WEBKIT + Utility_replace(value, /([^-])(transform)/g, '$1' + Enum_WEBKIT + '$2') + value;
    // cursor

    case 6187:
      return Utility_replace(Utility_replace(Utility_replace(value, /(zoom-|grab)/, Enum_WEBKIT + '$1'), /(image-set)/, Enum_WEBKIT + '$1'), value, '') + value;
    // background, background-image

    case 5495:
    case 3959:
      return Utility_replace(value, /(image-set\([^]*)/, Enum_WEBKIT + '$1' + '$`$1');
    // justify-content

    case 4968:
      return Utility_replace(Utility_replace(value, /(.+:)(flex-)?(.*)/, Enum_WEBKIT + 'box-pack:$3' + Enum_MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + Enum_WEBKIT + value + value;
    // (margin|padding)-inline-(start|end)

    case 4095:
    case 3583:
    case 4068:
    case 2532:
      return Utility_replace(value, /(.+)-inline(.+)/, Enum_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 (Utility_strlen(value) - 1 - length > 6) switch (Utility_charat(value, length + 1)) {
        // (m)ax-content, (m)in-content
        case 109:
          // -
          if (Utility_charat(value, length + 4) !== 45) break;
        // (f)ill-available, (f)it-content

        case 102:
          return Utility_replace(value, /(.+:)(.+)-([^]+)/, '$1' + Enum_WEBKIT + '$2-$3' + '$1' + Enum_MOZ + (Utility_charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
        // (s)tretch

        case 115:
          return ~indexof(value, 'stretch') ? emotion_cache_browser_esm_prefix(Utility_replace(value, 'stretch', 'fill-available'), length) + value : value;
      }
      break;
    // position: sticky

    case 4949:
      // (s)ticky?
      if (Utility_charat(value, length + 1) !== 115) break;
    // display: (flex|inline-flex)

    case 6444:
      switch (Utility_charat(value, Utility_strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
        // stic(k)y
        case 107:
          return Utility_replace(value, ':', ':' + Enum_WEBKIT) + value;
        // (inline-)?fl(e)x

        case 101:
          return Utility_replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + Enum_WEBKIT + (Utility_charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + Enum_WEBKIT + '$2$3' + '$1' + Enum_MS + '$2box$3') + value;
      }

      break;
    // writing-mode

    case 5936:
      switch (Utility_charat(value, length + 11)) {
        // vertical-l(r)
        case 114:
          return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
        // vertical-r(l)

        case 108:
          return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
        // horizontal(-)tb

        case 45:
          return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
      }

      return Enum_WEBKIT + value + Enum_MS + value + value;
  }

  return value;
}

var emotion_cache_browser_esm_prefixer = function prefixer(element, index, children, callback) {
  if (element.length > -1) if (!element["return"]) switch (element.type) {
    case Enum_DECLARATION:
      element["return"] = emotion_cache_browser_esm_prefix(element.value, element.length);
      break;

    case Enum_KEYFRAMES:
      return Serializer_serialize([Tokenizer_copy(element, {
        value: Utility_replace(element.value, '@', '@' + Enum_WEBKIT)
      })], callback);

    case Enum_RULESET:
      if (element.length) return Utility_combine(element.props, function (value) {
        switch (Utility_match(value, /(::plac\w+|:read-\w+)/)) {
          // :read-(only|write)
          case ':read-only':
          case ':read-write':
            return Serializer_serialize([Tokenizer_copy(element, {
              props: [Utility_replace(value, /:(read-\w+)/, ':' + Enum_MOZ + '$1')]
            })], callback);
          // :placeholder

          case '::placeholder':
            return Serializer_serialize([Tokenizer_copy(element, {
              props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_WEBKIT + 'input-$1')]
            }), Tokenizer_copy(element, {
              props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_MOZ + '$1')]
            }), Tokenizer_copy(element, {
              props: [Utility_replace(value, /:(plac\w+)/, Enum_MS + 'input-$1')]
            })], callback);
        }

        return '';
      });
  }
};

var defaultStylisPlugins = [emotion_cache_browser_esm_prefixer];

var createCache = function createCache(options) {
  var key = options.key;

  if (false) {}

  if (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 (false) {}

  var inserted = {};
  var container;
  var nodesToHydrate = [];

  {
    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 (false) {}

  {
    var currentSheet;
    var finalizingPlugins = [stringify,  false ? 0 : rulesheet(function (rule) {
      currentSheet.insert(rule);
    })];
    var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));

    var stylis = function stylis(styles) {
      return Serializer_serialize(compile(styles), serializer);
    };

    _insert = function insert(selector, serialized, sheet, shouldCache) {
      currentSheet = sheet;

      if (false) {}

      stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);

      if (shouldCache) {
        cache.inserted[serialized.name] = true;
      }
    };
  }

  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;
};




/***/ }),

/***/ 7424:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   C: function() { return /* binding */ CacheProvider; },
/* harmony export */   E: function() { return /* binding */ Emotion$1; },
/* harmony export */   T: function() { return /* binding */ ThemeContext; },
/* harmony export */   c: function() { return /* binding */ createEmotionProps; },
/* harmony export */   h: function() { return /* binding */ hasOwnProperty; },
/* harmony export */   i: function() { return /* binding */ isBrowser; },
/* harmony export */   w: function() { return /* binding */ withEmotionCache; }
/* harmony export */ });
/* unused harmony exports _, a, b, u */
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6540);
/* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6112);
/* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1957);
/* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9095);
/* harmony import */ var _emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6243);










var isBrowser = "object" !== 'undefined';
var hasOwnProperty = {}.hasOwnProperty;

var EmotionCacheContext = /* #__PURE__ */react__WEBPACK_IMPORTED_MODULE_0__.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__ */(0,_emotion_cache__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)({
  key: 'css'
}) : null);

if (false) {}

var CacheProvider = EmotionCacheContext.Provider;
var __unsafe_useEmotionCache = function useEmotionCache() {
  return useContext(EmotionCacheContext);
};

var withEmotionCache = function withEmotionCache(func) {
  // $FlowFixMe
  return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
    // the cache will never be null in the browser
    var cache = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(EmotionCacheContext);
    return func(props, cache, ref);
  });
};

if (!isBrowser) {
  withEmotionCache = function withEmotionCache(func) {
    return function (props) {
      var cache = (0,react__WEBPACK_IMPORTED_MODULE_0__.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 = (0,_emotion_cache__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)({
          key: 'css'
        });
        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(EmotionCacheContext.Provider, {
          value: cache
        }, func(props, cache));
      } else {
        return func(props, cache);
      }
    };
  };
}

var ThemeContext = /* #__PURE__ */react__WEBPACK_IMPORTED_MODULE_0__.createContext({});

if (false) {}

var useTheme = function useTheme() {
  return React.useContext(ThemeContext);
};

var getTheme = function getTheme(outerTheme, theme) {
  if (typeof theme === 'function') {
    var mergedTheme = theme(outerTheme);

    if (false) {}

    return mergedTheme;
  }

  if (false) {}

  return _extends({}, outerTheme, theme);
};

var createCacheWithTheme = /* #__PURE__ */(/* unused pure expression or super */ null && (weakMemoize(function (outerTheme) {
  return weakMemoize(function (theme) {
    return getTheme(outerTheme, theme);
  });
})));
var ThemeProvider = function ThemeProvider(props) {
  var theme = React.useContext(ThemeContext);

  if (props.theme !== theme) {
    theme = createCacheWithTheme(theme)(props.theme);
  }

  return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
    value: theme
  }, props.children);
};
function withTheme(Component) {
  var componentName = Component.displayName || Component.name || 'Component';

  var render = function render(props, ref) {
    var theme = React.useContext(ThemeContext);
    return /*#__PURE__*/React.createElement(Component, _extends({
      theme: theme,
      ref: ref
    }, props));
  }; // $FlowFixMe


  var WithTheme = /*#__PURE__*/React.forwardRef(render);
  WithTheme.displayName = "WithTheme(" + componentName + ")";
  return hoistNonReactStatics(WithTheme, Component);
}

var getLastPart = function getLastPart(functionName) {
  // The match may be something like 'Object.createEmotionProps' or
  // 'Loader.prototype.render'
  var parts = functionName.split('.');
  return parts[parts.length - 1];
};

var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
  // V8
  var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
  if (match) return getLastPart(match[1]); // Safari / Firefox

  match = /^([A-Za-z0-9$.]+)@/.exec(line);
  if (match) return getLastPart(match[1]);
  return undefined;
};

var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
// identifiers, thus we only need to replace what is a valid character for JS,
// but not for CSS.

var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
  return identifier.replace(/\$/g, '-');
};

var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
  if (!stackTrace) return undefined;
  var lines = stackTrace.split('\n');

  for (var i = 0; i < lines.length; i++) {
    var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"

    if (!functionName) continue; // If we reach one of these, we have gone too far and should quit

    if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
    // uppercase letter

    if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
  }

  return undefined;
};

var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
var createEmotionProps = function createEmotionProps(type, props) {
  if (false) {}

  var newProps = {};

  for (var key in props) {
    if (hasOwnProperty.call(props, key)) {
      newProps[key] = props[key];
    }
  }

  newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when
  // the label hasn't already been computed

  if (false) { var label; }

  return newProps;
};

var Insertion = function Insertion(_ref) {
  var cache = _ref.cache,
      serialized = _ref.serialized,
      isStringTag = _ref.isStringTag;
  (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_4__/* .registerStyles */ .SF)(cache, serialized, isStringTag);
  (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_3__/* .useInsertionEffectAlwaysWithSyncFallback */ .s)(function () {
    return (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_4__/* .insertStyles */ .sk)(cache, serialized, isStringTag);
  });

  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 WrappedComponent = props[typePropName];
  var registeredStyles = [cssProp];
  var className = '';

  if (typeof props.className === 'string') {
    className = (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_4__/* .getRegisteredStyles */ .Rk)(cache.registered, registeredStyles, props.className);
  } else if (props.className != null) {
    className = props.className + " ";
  }

  var serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_2__/* .serializeStyles */ .J)(registeredStyles, undefined, react__WEBPACK_IMPORTED_MODULE_0__.useContext(ThemeContext));

  if (false) { var labelFromStack; }

  className += cache.key + "-" + serialized.name;
  var newProps = {};

  for (var key in props) {
    if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || 0)) {
      newProps[key] = props[key];
    }
  }

  newProps.ref = ref;
  newProps.className = className;
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Insertion, {
    cache: cache,
    serialized: serialized,
    isStringTag: typeof WrappedComponent === 'string'
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(WrappedComponent, newProps));
});

if (false) {}

var Emotion$1 = Emotion;




/***/ }),

/***/ 8361:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AH: function() { return /* binding */ css; },
/* harmony export */   Y: function() { return /* binding */ jsx; },
/* harmony export */   i7: function() { return /* binding */ keyframes; },
/* harmony export */   mL: function() { return /* binding */ Global; }
/* harmony export */ });
/* unused harmony exports ClassNames, createElement */
/* harmony import */ var _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7424);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6540);
/* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1957);
/* harmony import */ var _emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6243);
/* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9095);
/* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6112);
/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4146);
/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_4__);












var pkg = {
	name: "@emotion/react",
	version: "11.11.1",
	main: "dist/emotion-react.cjs.js",
	module: "dist/emotion-react.esm.js",
	browser: {
		"./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
	},
	exports: {
		".": {
			module: {
				worker: "./dist/emotion-react.worker.esm.js",
				browser: "./dist/emotion-react.browser.esm.js",
				"default": "./dist/emotion-react.esm.js"
			},
			"import": "./dist/emotion-react.cjs.mjs",
			"default": "./dist/emotion-react.cjs.js"
		},
		"./jsx-runtime": {
			module: {
				worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
				browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
				"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
			},
			"import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
			"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
		},
		"./_isolated-hnrs": {
			module: {
				worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
				browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
				"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
			},
			"import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
			"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
		},
		"./jsx-dev-runtime": {
			module: {
				worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
				browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
				"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
			},
			"import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
			"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
		},
		"./package.json": "./package.json",
		"./types/css-prop": "./types/css-prop.d.ts",
		"./macro": {
			types: {
				"import": "./macro.d.mts",
				"default": "./macro.d.ts"
			},
			"default": "./macro.js"
		}
	},
	types: "types/index.d.ts",
	files: [
		"src",
		"dist",
		"jsx-runtime",
		"jsx-dev-runtime",
		"_isolated-hnrs",
		"types/*.d.ts",
		"macro.*"
	],
	sideEffects: false,
	author: "Emotion Contributors",
	license: "MIT",
	scripts: {
		"test:typescript": "dtslint types"
	},
	dependencies: {
		"@babel/runtime": "^7.18.3",
		"@emotion/babel-plugin": "^11.11.0",
		"@emotion/cache": "^11.11.0",
		"@emotion/serialize": "^1.1.2",
		"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
		"@emotion/utils": "^1.2.1",
		"@emotion/weak-memoize": "^0.3.1",
		"hoist-non-react-statics": "^3.3.1"
	},
	peerDependencies: {
		react: ">=16.8.0"
	},
	peerDependenciesMeta: {
		"@types/react": {
			optional: true
		}
	},
	devDependencies: {
		"@definitelytyped/dtslint": "0.0.112",
		"@emotion/css": "11.11.0",
		"@emotion/css-prettifier": "1.1.3",
		"@emotion/server": "11.11.0",
		"@emotion/styled": "11.11.0",
		"html-tag-names": "^1.1.2",
		react: "16.14.0",
		"svg-tag-names": "^1.1.1",
		typescript: "^4.5.5"
	},
	repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
	publishConfig: {
		access: "public"
	},
	"umd:main": "dist/emotion-react.umd.min.js",
	preconstruct: {
		entrypoints: [
			"./index.js",
			"./jsx-runtime.js",
			"./jsx-dev-runtime.js",
			"./_isolated-hnrs.js"
		],
		umdName: "emotionReact",
		exports: {
			envConditions: [
				"browser",
				"worker"
			],
			extra: {
				"./types/css-prop": "./types/css-prop.d.ts",
				"./macro": {
					types: {
						"import": "./macro.d.mts",
						"default": "./macro.d.ts"
					},
					"default": "./macro.js"
				}
			}
		}
	}
};

var jsx = function jsx(type, props) {
  var args = arguments;

  if (props == null || !_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__.h.call(props, 'css')) {
    // $FlowFixMe
    return react__WEBPACK_IMPORTED_MODULE_0__.createElement.apply(undefined, args);
  }

  var argsLength = args.length;
  var createElementArgArray = new Array(argsLength);
  createElementArgArray[0] = _emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__.E;
  createElementArgArray[1] = (0,_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__.c)(type, props);

  for (var i = 2; i < argsLength; i++) {
    createElementArgArray[i] = args[i];
  } // $FlowFixMe


  return react__WEBPACK_IMPORTED_MODULE_0__.createElement.apply(null, createElementArgArray);
};

var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
// initial client-side render from SSR, use place of hydrating tag

var Global = /* #__PURE__ */(0,_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__.w)(function (props, cache) {
  if (false) {}

  var styles = props.styles;
  var serialized = (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_2__/* .serializeStyles */ .J)([styles], undefined, react__WEBPACK_IMPORTED_MODULE_0__.useContext(_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__.T));

  if (!_emotion_element_c39617d8_browser_esm_js__WEBPACK_IMPORTED_MODULE_5__.i) {
    var _ref;

    var serializedNames = serialized.name;
    var serializedStyles = serialized.styles;
    var next = serialized.next;

    while (next !== undefined) {
      serializedNames += ' ' + next.name;
      serializedStyles += next.styles;
      next = next.next;
    }

    var shouldCache = cache.compat === true;
    var rules = cache.insert("", {
      name: serializedNames,
      styles: serializedStyles
    }, cache.sheet, shouldCache);

    if (shouldCache) {
      return null;
    }

    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = {
      __html: rules
    }, _ref.nonce = cache.sheet.nonce, _ref));
  } // yes, i know these hooks are used conditionally
  // but it is based on a constant that will never change at runtime
  // it's effectively like having two implementations and switching them out
  // so it's not actually breaking anything


  var sheetRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
  (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_1__/* .useInsertionEffectWithLayoutFallback */ .i)(function () {
    var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675

    var sheet = new cache.sheet.constructor({
      key: key,
      nonce: cache.sheet.nonce,
      container: cache.sheet.container,
      speedy: cache.sheet.isSpeedy
    });
    var rehydrating = false; // $FlowFixMe

    var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");

    if (cache.sheet.tags.length) {
      sheet.before = cache.sheet.tags[0];
    }

    if (node !== null) {
      rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s

      node.setAttribute('data-emotion', key);
      sheet.hydrate([node]);
    }

    sheetRef.current = [sheet, rehydrating];
    return function () {
      sheet.flush();
    };
  }, [cache]);
  (0,_emotion_use_insertion_effect_with_fallbacks__WEBPACK_IMPORTED_MODULE_1__/* .useInsertionEffectWithLayoutFallback */ .i)(function () {
    var sheetRefCurrent = sheetRef.current;
    var sheet = sheetRefCurrent[0],
        rehydrating = sheetRefCurrent[1];

    if (rehydrating) {
      sheetRefCurrent[1] = false;
      return;
    }

    if (serialized.next !== undefined) {
      // insert keyframes
      (0,_emotion_utils__WEBPACK_IMPORTED_MODULE_6__/* .insertStyles */ .sk)(cache, serialized.next, true);
    }

    if (sheet.tags.length) {
      // if this doesn't exist then it will be null so the style element will be appended
      var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
      sheet.before = element;
      sheet.flush();
    }

    cache.insert("", serialized, sheet, false);
  }, [cache, serialized.name]);
  return null;
});

if (false) {}

function css() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }

  return (0,_emotion_serialize__WEBPACK_IMPORTED_MODULE_2__/* .serializeStyles */ .J)(args);
}

var keyframes = function keyframes() {
  var insertable = css.apply(void 0, arguments);
  var name = "animation-" + insertable.name; // $FlowFixMe

  return {
    name: name,
    styles: "@keyframes " + name + "{" + insertable.styles + "}",
    anim: 1,
    toString: function toString() {
      return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
    }
  };
};

var classnames = function classnames(args) {
  var len = args.length;
  var i = 0;
  var cls = '';

  for (; i < len; i++) {
    var arg = args[i];
    if (arg == null) continue;
    var toAdd = void 0;

    switch (typeof arg) {
      case 'boolean':
        break;

      case 'object':
        {
          if (Array.isArray(arg)) {
            toAdd = classnames(arg);
          } else {
            if (false) {}

            toAdd = '';

            for (var k in arg) {
              if (arg[k] && k) {
                toAdd && (toAdd += ' ');
                toAdd += k;
              }
            }
          }

          break;
        }

      default:
        {
          toAdd = arg;
        }
    }

    if (toAdd) {
      cls && (cls += ' ');
      cls += toAdd;
    }
  }

  return cls;
};

function merge(registered, css, className) {
  var registeredStyles = [];
  var rawClassName = getRegisteredStyles(registered, registeredStyles, className);

  if (registeredStyles.length < 2) {
    return className;
  }

  return rawClassName + css(registeredStyles);
}

var Insertion = function Insertion(_ref) {
  var cache = _ref.cache,
      serializedArr = _ref.serializedArr;
  useInsertionEffectAlwaysWithSyncFallback(function () {

    for (var i = 0; i < serializedArr.length; i++) {
      insertStyles(cache, serializedArr[i], false);
    }
  });

  return null;
};

var ClassNames = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache) {
  var hasRendered = false;
  var serializedArr = [];

  var css = function css() {
    if (hasRendered && "production" !== 'production') {}

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    var serialized = serializeStyles(args, cache.registered);
    serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`

    registerStyles(cache, serialized, false);
    return cache.key + "-" + serialized.name;
  };

  var cx = function cx() {
    if (hasRendered && "production" !== 'production') {}

    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
      args[_key2] = arguments[_key2];
    }

    return merge(cache.registered, css, classnames(args));
  };

  var content = {
    css: css,
    cx: cx,
    theme: React.useContext(ThemeContext)
  };
  var ele = props.children(content);
  hasRendered = true;
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
    cache: cache,
    serializedArr: serializedArr
  }), ele);
})));

if (false) {}

if (false) { var globalKey, globalContext, isTestEnv, isBrowser; }




/***/ }),

/***/ 9095:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  J: function() { return /* binding */ serializeStyles; }
});

;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@emotion/hash/dist/hash.browser.esm.js
/* 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);
}

/* harmony default export */ var hash_browser_esm = (murmur2);

// EXTERNAL MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js
var unitless_browser_esm = __webpack_require__(7103);
// EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js
var memoize_browser_esm = __webpack_require__(4903);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js




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 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__ */(0,memoize_browser_esm/* default */.A)(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 (unitless_browser_esm/* default */.A[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
    return value + 'px';
  }

  return value;
};

if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; }

var noComponentSelectorMessage = (/* unused pure expression or super */ null && ('Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.'));

function handleInterpolation(mergedProps, registered, interpolation) {
  if (interpolation == null) {
    return '';
  }

  if (interpolation.__emotion_styles !== undefined) {
    if (false) {}

    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 (false) {}

          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 (false) {}

        break;
      }

    case 'string':
      if (false) { var replaced, matched; }

      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' && "production" !== 'production') {}

        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 (false) {}

                string += _key + "{" + interpolated + "}";
              }
          }
        }
      }
    }
  }

  return string;
}

var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
var sourceMapPattern;

if (false) {} // 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 (false) {}

    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 (false) {}

      styles += strings[i];
    }
  }

  var sourceMap;

  if (false) {} // 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 = hash_browser_esm(styles) + identifierName;

  if (false) {}

  return {
    name: name,
    styles: styles,
    next: cursor
  };
};




/***/ }),

/***/ 6243:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
var react__WEBPACK_IMPORTED_MODULE_0___namespace_cache;
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   i: function() { return /* binding */ useInsertionEffectWithLayoutFallback; },
/* harmony export */   s: function() { return /* binding */ useInsertionEffectAlwaysWithSyncFallback; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6540);


var syncFallback = function syncFallback(create) {
  return create();
};

var useInsertionEffect = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))['useInsertion' + 'Effect'] ? /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))['useInsertion' + 'Effect'] : false;
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
var useInsertionEffectWithLayoutFallback = useInsertionEffect || react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect;




/***/ }),

/***/ 1957:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Rk: function() { return /* binding */ getRegisteredStyles; },
/* harmony export */   SF: function() { return /* binding */ registerStyles; },
/* harmony export */   sk: function() { return /* binding */ insertStyles; }
/* harmony export */ });
var isBrowser = "object" !== '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 === false ) && 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 current = serialized;

    do {
      cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);

      current = current.next;
    } while (current !== undefined);
  }
};




/***/ }),

/***/ 1953:
/***/ (function(module, exports) {

var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  Copyright (c) 2017 Jed Watson.
  Licensed under the MIT License (MIT), see
  http://jedwatson.github.io/classnames
*/
/* global define */

(function () {
	'use strict';

	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) && arg.length) {
				var inner = classNames.apply(null, arg);
				if (inner) {
					classes.push(inner);
				}
			} else if (argType === 'object') {
				for (var key in arg) {
					if (hasOwn.call(arg, key) && arg[key]) {
						classes.push(key);
					}
				}
			}
		}

		return classes.join(' ');
	}

	if ( true && module.exports) {
		classNames.default = classNames;
		module.exports = classNames;
	} else if (true) {
		// register as 'classnames', consistent with npm package name
		!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
			return classNames;
		}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	} else {}
}());


/***/ }),

/***/ 2480:
/***/ (function(module) {

var conversions = {
    // length
    'px': {
        'px': 1,
        'cm': 96.0/2.54,
        'mm': 96.0/25.4,
        'in': 96,
        'pt': 96.0/72.0,
        'pc': 16
    },
    'cm': {
        'px': 2.54/96.0,
        'cm': 1,
        'mm': 0.1,
        'in': 2.54,
        'pt': 2.54/72.0,
        'pc': 2.54/6.0
    },
    'mm': {
        'px': 25.4/96.0,
        'cm': 10,
        'mm': 1,
        'in': 25.4,
        'pt': 25.4/72.0,
        'pc': 25.4/6.0
    },
    'in': {
        'px': 1.0/96.0,
        'cm': 1.0/2.54,
        'mm': 1.0/25.4,
        'in': 1,
        'pt': 1.0/72.0,
        'pc': 1.0/6.0
    },
    'pt': {
        'px': 0.75,
        'cm': 72.0/2.54,
        'mm': 72.0/25.4,
        'in': 72,
        'pt': 1,
        'pc': 12
    },
    'pc': {
        'px': 6.0/96.0,
        'cm': 6.0/2.54,
        'mm': 6.0/25.4,
        'in': 6,
        'pt': 6.0/72.0,
        'pc': 1
    },
    // angle
    'deg': {
        'deg': 1,
        'grad': 0.9,
        'rad': 180/Math.PI,
        'turn': 360
    },
    'grad': {
        'deg': 400/360,
        'grad': 1,
        'rad': 200/Math.PI,
        'turn': 400
    },
    'rad': {
        'deg': Math.PI/180,
        'grad': Math.PI/200,
        'rad': 1,
        'turn': Math.PI*2
    },
    'turn': {
        'deg': 1/360,
        'grad': 1/400,
        'rad': 0.5/Math.PI,
        'turn': 1
    },
    // time
    's': {
        's': 1,
        'ms': 1/1000
    },
    'ms': {
        's': 1000,
        'ms': 1
    },
    // frequency
    'Hz': {
        'Hz': 1,
        'kHz': 1000
    },
    'kHz': {
        'Hz': 1/1000,
        'kHz': 1
    },
    // resolution
    'dpi': {
        'dpi': 1,
        'dpcm': 1.0/2.54,
        'dppx': 1/96
    },
    'dpcm': {
        'dpi': 2.54,
        'dpcm': 1,
        'dppx': 2.54/96.0
    },
    'dppx': {
        'dpi': 96,
        'dpcm': 96.0/2.54,
        'dppx': 1
    }
};

module.exports = function (value, sourceUnit, targetUnit, precision) {
    if (!conversions.hasOwnProperty(targetUnit))
        throw new Error("Cannot convert to " + targetUnit);

    if (!conversions[targetUnit].hasOwnProperty(sourceUnit))
        throw new Error("Cannot convert from " + sourceUnit + " to " + targetUnit);
    
    var converted = conversions[targetUnit][sourceUnit] * value;
    
    if (precision !== false) {
        precision = Math.pow(10, parseInt(precision) || 5);
        return Math.round(converted * precision) / precision;
    }
    
    return converted;
};


/***/ }),

/***/ 667:
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_RESULT__;/*! decimal.js-light v2.5.1 https://github.com/MikeMcl/decimal.js-light/LICENCE */
;(function (globalScope) {
  'use strict';


  /*
   *  decimal.js-light v2.5.1
   *  An arbitrary-precision Decimal type for JavaScript.
   *  https://github.com/MikeMcl/decimal.js-light
   *  Copyright (c) 2020 Michael Mclaughlin <M8ch88l@gmail.com>
   *  MIT Expat Licence
   */


  // -----------------------------------  EDITABLE DEFAULTS  ------------------------------------ //


    // The limit on the value of `precision`, and on the value of the first argument to
    // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.
  var MAX_DIGITS = 1e9,                        // 0 to 1e9


    // The initial configuration properties of the Decimal constructor.
    Decimal = {

      // These values must be integers within the stated ranges (inclusive).
      // Most of these values can be changed during run-time using `Decimal.config`.

      // The maximum number of significant digits of the result of a calculation or base conversion.
      // E.g. `Decimal.config({ precision: 20 });`
      precision: 20,                         // 1 to MAX_DIGITS

      // The rounding mode used by default by `toInteger`, `toDecimalPlaces`, `toExponential`,
      // `toFixed`, `toPrecision` and `toSignificantDigits`.
      //
      // ROUND_UP         0 Away from zero.
      // ROUND_DOWN       1 Towards zero.
      // ROUND_CEIL       2 Towards +Infinity.
      // ROUND_FLOOR      3 Towards -Infinity.
      // ROUND_HALF_UP    4 Towards nearest neighbour. If equidistant, up.
      // ROUND_HALF_DOWN  5 Towards nearest neighbour. If equidistant, down.
      // ROUND_HALF_EVEN  6 Towards nearest neighbour. If equidistant, towards even neighbour.
      // ROUND_HALF_CEIL  7 Towards nearest neighbour. If equidistant, towards +Infinity.
      // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
      //
      // E.g.
      // `Decimal.rounding = 4;`
      // `Decimal.rounding = Decimal.ROUND_HALF_UP;`
      rounding: 4,                           // 0 to 8

      // The exponent value at and beneath which `toString` returns exponential notation.
      // JavaScript numbers: -7
      toExpNeg: -7,                          // 0 to -MAX_E

      // The exponent value at and above which `toString` returns exponential notation.
      // JavaScript numbers: 21
      toExpPos:  21,                         // 0 to MAX_E

      // The natural logarithm of 10.
      // 115 digits
      LN10: '2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286'
    },


  // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //


    external = true,

    decimalError = '[DecimalError] ',
    invalidArgument = decimalError + 'Invalid argument: ',
    exponentOutOfRange = decimalError + 'Exponent out of range: ',

    mathfloor = Math.floor,
    mathpow = Math.pow,

    isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,

    ONE,
    BASE = 1e7,
    LOG_BASE = 7,
    MAX_SAFE_INTEGER = 9007199254740991,
    MAX_E = mathfloor(MAX_SAFE_INTEGER / LOG_BASE),    // 1286742750677284

    // Decimal.prototype object
    P = {};


  // Decimal prototype methods


  /*
   *  absoluteValue                       abs
   *  comparedTo                          cmp
   *  decimalPlaces                       dp
   *  dividedBy                           div
   *  dividedToIntegerBy                  idiv
   *  equals                              eq
   *  exponent
   *  greaterThan                         gt
   *  greaterThanOrEqualTo                gte
   *  isInteger                           isint
   *  isNegative                          isneg
   *  isPositive                          ispos
   *  isZero
   *  lessThan                            lt
   *  lessThanOrEqualTo                   lte
   *  logarithm                           log
   *  minus                               sub
   *  modulo                              mod
   *  naturalExponential                  exp
   *  naturalLogarithm                    ln
   *  negated                             neg
   *  plus                                add
   *  precision                           sd
   *  squareRoot                          sqrt
   *  times                               mul
   *  toDecimalPlaces                     todp
   *  toExponential
   *  toFixed
   *  toInteger                           toint
   *  toNumber
   *  toPower                             pow
   *  toPrecision
   *  toSignificantDigits                 tosd
   *  toString
   *  valueOf                             val
   */


  /*
   * Return a new Decimal whose value is the absolute value of this Decimal.
   *
   */
  P.absoluteValue = P.abs = function () {
    var x = new this.constructor(this);
    if (x.s) x.s = 1;
    return x;
  };


  /*
   * Return
   *   1    if the value of this Decimal is greater than the value of `y`,
   *  -1    if the value of this Decimal is less than the value of `y`,
   *   0    if they have the same value
   *
   */
  P.comparedTo = P.cmp = function (y) {
    var i, j, xdL, ydL,
      x = this;

    y = new x.constructor(y);

    // Signs differ?
    if (x.s !== y.s) return x.s || -y.s;

    // Compare exponents.
    if (x.e !== y.e) return x.e > y.e ^ x.s < 0 ? 1 : -1;

    xdL = x.d.length;
    ydL = y.d.length;

    // Compare digit by digit.
    for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {
      if (x.d[i] !== y.d[i]) return x.d[i] > y.d[i] ^ x.s < 0 ? 1 : -1;
    }

    // Compare lengths.
    return xdL === ydL ? 0 : xdL > ydL ^ x.s < 0 ? 1 : -1;
  };


  /*
   * Return the number of decimal places of the value of this Decimal.
   *
   */
  P.decimalPlaces = P.dp = function () {
    var x = this,
      w = x.d.length - 1,
      dp = (w - x.e) * LOG_BASE;

    // Subtract the number of trailing zeros of the last word.
    w = x.d[w];
    if (w) for (; w % 10 == 0; w /= 10) dp--;

    return dp < 0 ? 0 : dp;
  };


  /*
   * Return a new Decimal whose value is the value of this Decimal divided by `y`, truncated to
   * `precision` significant digits.
   *
   */
  P.dividedBy = P.div = function (y) {
    return divide(this, new this.constructor(y));
  };


  /*
   * Return a new Decimal whose value is the integer part of dividing the value of this Decimal
   * by the value of `y`, truncated to `precision` significant digits.
   *
   */
  P.dividedToIntegerBy = P.idiv = function (y) {
    var x = this,
      Ctor = x.constructor;
    return round(divide(x, new Ctor(y), 0, 1), Ctor.precision);
  };


  /*
   * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.
   *
   */
  P.equals = P.eq = function (y) {
    return !this.cmp(y);
  };


  /*
   * Return the (base 10) exponent value of this Decimal (this.e is the base 10000000 exponent).
   *
   */
  P.exponent = function () {
    return getBase10Exponent(this);
  };


  /*
   * Return true if the value of this Decimal is greater than the value of `y`, otherwise return
   * false.
   *
   */
  P.greaterThan = P.gt = function (y) {
    return this.cmp(y) > 0;
  };


  /*
   * Return true if the value of this Decimal is greater than or equal to the value of `y`,
   * otherwise return false.
   *
   */
  P.greaterThanOrEqualTo = P.gte = function (y) {
    return this.cmp(y) >= 0;
  };


  /*
   * Return true if the value of this Decimal is an integer, otherwise return false.
   *
   */
  P.isInteger = P.isint = function () {
    return this.e > this.d.length - 2;
  };


  /*
   * Return true if the value of this Decimal is negative, otherwise return false.
   *
   */
  P.isNegative = P.isneg = function () {
    return this.s < 0;
  };


  /*
   * Return true if the value of this Decimal is positive, otherwise return false.
   *
   */
  P.isPositive = P.ispos = function () {
    return this.s > 0;
  };


  /*
   * Return true if the value of this Decimal is 0, otherwise return false.
   *
   */
  P.isZero = function () {
    return this.s === 0;
  };


  /*
   * Return true if the value of this Decimal is less than `y`, otherwise return false.
   *
   */
  P.lessThan = P.lt = function (y) {
    return this.cmp(y) < 0;
  };


  /*
   * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.
   *
   */
  P.lessThanOrEqualTo = P.lte = function (y) {
    return this.cmp(y) < 1;
  };


  /*
   * Return the logarithm of the value of this Decimal to the specified base, truncated to
   * `precision` significant digits.
   *
   * If no base is specified, return log[10](x).
   *
   * log[base](x) = ln(x) / ln(base)
   *
   * The maximum error of the result is 1 ulp (unit in the last place).
   *
   * [base] {number|string|Decimal} The base of the logarithm.
   *
   */
  P.logarithm = P.log = function (base) {
    var r,
      x = this,
      Ctor = x.constructor,
      pr = Ctor.precision,
      wpr = pr + 5;

    // Default base is 10.
    if (base === void 0) {
      base = new Ctor(10);
    } else {
      base = new Ctor(base);

      // log[-b](x) = NaN
      // log[0](x)  = NaN
      // log[1](x)  = NaN
      if (base.s < 1 || base.eq(ONE)) throw Error(decimalError + 'NaN');
    }

    // log[b](-x) = NaN
    // log[b](0) = -Infinity
    if (x.s < 1) throw Error(decimalError + (x.s ? 'NaN' : '-Infinity'));

    // log[b](1) = 0
    if (x.eq(ONE)) return new Ctor(0);

    external = false;
    r = divide(ln(x, wpr), ln(base, wpr), wpr);
    external = true;

    return round(r, pr);
  };


  /*
   * Return a new Decimal whose value is the value of this Decimal minus `y`, truncated to
   * `precision` significant digits.
   *
   */
  P.minus = P.sub = function (y) {
    var x = this;
    y = new x.constructor(y);
    return x.s == y.s ? subtract(x, y) : add(x, (y.s = -y.s, y));
  };


  /*
   * Return a new Decimal whose value is the value of this Decimal modulo `y`, truncated to
   * `precision` significant digits.
   *
   */
  P.modulo = P.mod = function (y) {
    var q,
      x = this,
      Ctor = x.constructor,
      pr = Ctor.precision;

    y = new Ctor(y);

    // x % 0 = NaN
    if (!y.s) throw Error(decimalError + 'NaN');

    // Return x if x is 0.
    if (!x.s) return round(new Ctor(x), pr);

    // Prevent rounding of intermediate calculations.
    external = false;
    q = divide(x, y, 0, 1).times(y);
    external = true;

    return x.minus(q);
  };


  /*
   * Return a new Decimal whose value is the natural exponential of the value of this Decimal,
   * i.e. the base e raised to the power the value of this Decimal, truncated to `precision`
   * significant digits.
   *
   */
  P.naturalExponential = P.exp = function () {
    return exp(this);
  };


  /*
   * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,
   * truncated to `precision` significant digits.
   *
   */
  P.naturalLogarithm = P.ln = function () {
    return ln(this);
  };


  /*
   * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by
   * -1.
   *
   */
  P.negated = P.neg = function () {
    var x = new this.constructor(this);
    x.s = -x.s || 0;
    return x;
  };


  /*
   * Return a new Decimal whose value is the value of this Decimal plus `y`, truncated to
   * `precision` significant digits.
   *
   */
  P.plus = P.add = function (y) {
    var x = this;
    y = new x.constructor(y);
    return x.s == y.s ? add(x, y) : subtract(x, (y.s = -y.s, y));
  };


  /*
   * Return the number of significant digits of the value of this Decimal.
   *
   * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.
   *
   */
  P.precision = P.sd = function (z) {
    var e, sd, w,
      x = this;

    if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);

    e = getBase10Exponent(x) + 1;
    w = x.d.length - 1;
    sd = w * LOG_BASE + 1;
    w = x.d[w];

    // If non-zero...
    if (w) {

      // Subtract the number of trailing zeros of the last word.
      for (; w % 10 == 0; w /= 10) sd--;

      // Add the number of digits of the first word.
      for (w = x.d[0]; w >= 10; w /= 10) sd++;
    }

    return z && e > sd ? e : sd;
  };


  /*
   * Return a new Decimal whose value is the square root of this Decimal, truncated to `precision`
   * significant digits.
   *
   */
  P.squareRoot = P.sqrt = function () {
    var e, n, pr, r, s, t, wpr,
      x = this,
      Ctor = x.constructor;

    // Negative or zero?
    if (x.s < 1) {
      if (!x.s) return new Ctor(0);

      // sqrt(-x) = NaN
      throw Error(decimalError + 'NaN');
    }

    e = getBase10Exponent(x);
    external = false;

    // Initial estimate.
    s = Math.sqrt(+x);

    // Math.sqrt underflow/overflow?
    // Pass x to Math.sqrt as integer, then adjust the exponent of the result.
    if (s == 0 || s == 1 / 0) {
      n = digitsToString(x.d);
      if ((n.length + e) % 2 == 0) n += '0';
      s = Math.sqrt(n);
      e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);

      if (s == 1 / 0) {
        n = '5e' + e;
      } else {
        n = s.toExponential();
        n = n.slice(0, n.indexOf('e') + 1) + e;
      }

      r = new Ctor(n);
    } else {
      r = new Ctor(s.toString());
    }

    pr = Ctor.precision;
    s = wpr = pr + 3;

    // Newton-Raphson iteration.
    for (;;) {
      t = r;
      r = t.plus(divide(x, t, wpr + 2)).times(0.5);

      if (digitsToString(t.d).slice(0, wpr) === (n = digitsToString(r.d)).slice(0, wpr)) {
        n = n.slice(wpr - 3, wpr + 1);

        // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or
        // 4999, i.e. approaching a rounding boundary, continue the iteration.
        if (s == wpr && n == '4999') {

          // On the first iteration only, check to see if rounding up gives the exact result as the
          // nines may infinitely repeat.
          round(t, pr + 1, 0);

          if (t.times(t).eq(x)) {
            r = t;
            break;
          }
        } else if (n != '9999') {
          break;
        }

        wpr += 4;
      }
    }

    external = true;

    return round(r, pr);
  };


  /*
   * Return a new Decimal whose value is the value of this Decimal times `y`, truncated to
   * `precision` significant digits.
   *
   */
  P.times = P.mul = function (y) {
    var carry, e, i, k, r, rL, t, xdL, ydL,
      x = this,
      Ctor = x.constructor,
      xd = x.d,
      yd = (y = new Ctor(y)).d;

    // Return 0 if either is 0.
    if (!x.s || !y.s) return new Ctor(0);

    y.s *= x.s;
    e = x.e + y.e;
    xdL = xd.length;
    ydL = yd.length;

    // Ensure xd points to the longer array.
    if (xdL < ydL) {
      r = xd;
      xd = yd;
      yd = r;
      rL = xdL;
      xdL = ydL;
      ydL = rL;
    }

    // Initialise the result array with zeros.
    r = [];
    rL = xdL + ydL;
    for (i = rL; i--;) r.push(0);

    // Multiply!
    for (i = ydL; --i >= 0;) {
      carry = 0;
      for (k = xdL + i; k > i;) {
        t = r[k] + yd[i] * xd[k - i - 1] + carry;
        r[k--] = t % BASE | 0;
        carry = t / BASE | 0;
      }

      r[k] = (r[k] + carry) % BASE | 0;
    }

    // Remove trailing zeros.
    for (; !r[--rL];) r.pop();

    if (carry) ++e;
    else r.shift();

    y.d = r;
    y.e = e;

    return external ? round(y, Ctor.precision) : y;
  };


  /*
   * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`
   * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.
   *
   * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.
   *
   * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
   *
   */
  P.toDecimalPlaces = P.todp = function (dp, rm) {
    var x = this,
      Ctor = x.constructor;

    x = new Ctor(x);
    if (dp === void 0) return x;

    checkInt32(dp, 0, MAX_DIGITS);

    if (rm === void 0) rm = Ctor.rounding;
    else checkInt32(rm, 0, 8);

    return round(x, dp + getBase10Exponent(x) + 1, rm);
  };


  /*
   * Return a string representing the value of this Decimal in exponential notation rounded to
   * `dp` fixed decimal places using rounding mode `rounding`.
   *
   * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
   *
   */
  P.toExponential = function (dp, rm) {
    var str,
      x = this,
      Ctor = x.constructor;

    if (dp === void 0) {
      str = toString(x, true);
    } else {
      checkInt32(dp, 0, MAX_DIGITS);

      if (rm === void 0) rm = Ctor.rounding;
      else checkInt32(rm, 0, 8);

      x = round(new Ctor(x), dp + 1, rm);
      str = toString(x, true, dp + 1);
    }

    return str;
  };


  /*
   * Return a string representing the value of this Decimal in normal (fixed-point) notation to
   * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is
   * omitted.
   *
   * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.
   *
   * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
   *
   * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
   * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
   * (-0).toFixed(3) is '0.000'.
   * (-0.5).toFixed(0) is '-0'.
   *
   */
  P.toFixed = function (dp, rm) {
    var str, y,
      x = this,
      Ctor = x.constructor;

    if (dp === void 0) return toString(x);

    checkInt32(dp, 0, MAX_DIGITS);

    if (rm === void 0) rm = Ctor.rounding;
    else checkInt32(rm, 0, 8);

    y = round(new Ctor(x), dp + getBase10Exponent(x) + 1, rm);
    str = toString(y.abs(), false, dp + getBase10Exponent(y) + 1);

    // To determine whether to add the minus sign look at the value before it was rounded,
    // i.e. look at `x` rather than `y`.
    return x.isneg() && !x.isZero() ? '-' + str : str;
  };


  /*
   * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using
   * rounding mode `rounding`.
   *
   */
  P.toInteger = P.toint = function () {
    var x = this,
      Ctor = x.constructor;
    return round(new Ctor(x), getBase10Exponent(x) + 1, Ctor.rounding);
  };


  /*
   * Return the value of this Decimal converted to a number primitive.
   *
   */
  P.toNumber = function () {
    return +this;
  };


  /*
   * Return a new Decimal whose value is the value of this Decimal raised to the power `y`,
   * truncated to `precision` significant digits.
   *
   * For non-integer or very large exponents pow(x, y) is calculated using
   *
   *   x^y = exp(y*ln(x))
   *
   * The maximum error is 1 ulp (unit in last place).
   *
   * y {number|string|Decimal} The power to which to raise this Decimal.
   *
   */
  P.toPower = P.pow = function (y) {
    var e, k, pr, r, sign, yIsInt,
      x = this,
      Ctor = x.constructor,
      guard = 12,
      yn = +(y = new Ctor(y));

    // pow(x, 0) = 1
    if (!y.s) return new Ctor(ONE);

    x = new Ctor(x);

    // pow(0, y > 0) = 0
    // pow(0, y < 0) = Infinity
    if (!x.s) {
      if (y.s < 1) throw Error(decimalError + 'Infinity');
      return x;
    }

    // pow(1, y) = 1
    if (x.eq(ONE)) return x;

    pr = Ctor.precision;

    // pow(x, 1) = x
    if (y.eq(ONE)) return round(x, pr);

    e = y.e;
    k = y.d.length - 1;
    yIsInt = e >= k;
    sign = x.s;

    if (!yIsInt) {

      // pow(x < 0, y non-integer) = NaN
      if (sign < 0) throw Error(decimalError + 'NaN');

    // If y is a small integer use the 'exponentiation by squaring' algorithm.
    } else if ((k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
      r = new Ctor(ONE);

      // Max k of 9007199254740991 takes 53 loop iterations.
      // Maximum digits array length; leaves [28, 34] guard digits.
      e = Math.ceil(pr / LOG_BASE + 4);

      external = false;

      for (;;) {
        if (k % 2) {
          r = r.times(x);
          truncate(r.d, e);
        }

        k = mathfloor(k / 2);
        if (k === 0) break;

        x = x.times(x);
        truncate(x.d, e);
      }

      external = true;

      return y.s < 0 ? new Ctor(ONE).div(r) : round(r, pr);
    }

    // Result is negative if x is negative and the last digit of integer y is odd.
    sign = sign < 0 && y.d[Math.max(e, k)] & 1 ? -1 : 1;

    x.s = 1;
    external = false;
    r = y.times(ln(x, pr + guard));
    external = true;
    r = exp(r);
    r.s = sign;

    return r;
  };


  /*
   * Return a string representing the value of this Decimal rounded to `sd` significant digits
   * using rounding mode `rounding`.
   *
   * Return exponential notation if `sd` is less than the number of digits necessary to represent
   * the integer part of the value in normal notation.
   *
   * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
   *
   */
  P.toPrecision = function (sd, rm) {
    var e, str,
      x = this,
      Ctor = x.constructor;

    if (sd === void 0) {
      e = getBase10Exponent(x);
      str = toString(x, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);
    } else {
      checkInt32(sd, 1, MAX_DIGITS);

      if (rm === void 0) rm = Ctor.rounding;
      else checkInt32(rm, 0, 8);

      x = round(new Ctor(x), sd, rm);
      e = getBase10Exponent(x);
      str = toString(x, sd <= e || e <= Ctor.toExpNeg, sd);
    }

    return str;
  };


  /*
   * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`
   * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if
   * omitted.
   *
   * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
   * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
   *
   */
  P.toSignificantDigits = P.tosd = function (sd, rm) {
    var x = this,
      Ctor = x.constructor;

    if (sd === void 0) {
      sd = Ctor.precision;
      rm = Ctor.rounding;
    } else {
      checkInt32(sd, 1, MAX_DIGITS);

      if (rm === void 0) rm = Ctor.rounding;
      else checkInt32(rm, 0, 8);
    }

    return round(new Ctor(x), sd, rm);
  };


  /*
   * Return a string representing the value of this Decimal.
   *
   * Return exponential notation if this Decimal has a positive exponent equal to or greater than
   * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.
   *
   */
  P.toString = P.valueOf = P.val = P.toJSON = function () {
    var x = this,
      e = getBase10Exponent(x),
      Ctor = x.constructor;

    return toString(x, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);
  };


  // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.


  /*
   *  add                 P.minus, P.plus
   *  checkInt32          P.todp, P.toExponential, P.toFixed, P.toPrecision, P.tosd
   *  digitsToString      P.log, P.sqrt, P.pow, toString, exp, ln
   *  divide              P.div, P.idiv, P.log, P.mod, P.sqrt, exp, ln
   *  exp                 P.exp, P.pow
   *  getBase10Exponent   P.exponent, P.sd, P.toint, P.sqrt, P.todp, P.toFixed, P.toPrecision,
   *                      P.toString, divide, round, toString, exp, ln
   *  getLn10             P.log, ln
   *  getZeroString       digitsToString, toString
   *  ln                  P.log, P.ln, P.pow, exp
   *  parseDecimal        Decimal
   *  round               P.abs, P.idiv, P.log, P.minus, P.mod, P.neg, P.plus, P.toint, P.sqrt,
   *                      P.times, P.todp, P.toExponential, P.toFixed, P.pow, P.toPrecision, P.tosd,
   *                      divide, getLn10, exp, ln
   *  subtract            P.minus, P.plus
   *  toString            P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf
   *  truncate            P.pow
   *
   *  Throws:             P.log, P.mod, P.sd, P.sqrt, P.pow,  checkInt32, divide, round,
   *                      getLn10, exp, ln, parseDecimal, Decimal, config
   */


  function add(x, y) {
    var carry, d, e, i, k, len, xd, yd,
      Ctor = x.constructor,
      pr = Ctor.precision;

    // If either is zero...
    if (!x.s || !y.s) {

      // Return x if y is zero.
      // Return y if y is non-zero.
      if (!y.s) y = new Ctor(x);
      return external ? round(y, pr) : y;
    }

    xd = x.d;
    yd = y.d;

    // x and y are finite, non-zero numbers with the same sign.

    k = x.e;
    e = y.e;
    xd = xd.slice();
    i = k - e;

    // If base 1e7 exponents differ...
    if (i) {
      if (i < 0) {
        d = xd;
        i = -i;
        len = yd.length;
      } else {
        d = yd;
        e = k;
        len = xd.length;
      }

      // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.
      k = Math.ceil(pr / LOG_BASE);
      len = k > len ? k + 1 : len + 1;

      if (i > len) {
        i = len;
        d.length = 1;
      }

      // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.
      d.reverse();
      for (; i--;) d.push(0);
      d.reverse();
    }

    len = xd.length;
    i = yd.length;

    // If yd is longer than xd, swap xd and yd so xd points to the longer array.
    if (len - i < 0) {
      i = len;
      d = yd;
      yd = xd;
      xd = d;
    }

    // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.
    for (carry = 0; i;) {
      carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;
      xd[i] %= BASE;
    }

    if (carry) {
      xd.unshift(carry);
      ++e;
    }

    // Remove trailing zeros.
    // No need to check for zero, as +x + +y != 0 && -x + -y != 0
    for (len = xd.length; xd[--len] == 0;) xd.pop();

    y.d = xd;
    y.e = e;

    return external ? round(y, pr) : y;
  }


  function checkInt32(i, min, max) {
    if (i !== ~~i || i < min || i > max) {
      throw Error(invalidArgument + i);
    }
  }


  function digitsToString(d) {
    var i, k, ws,
      indexOfLastWord = d.length - 1,
      str = '',
      w = d[0];

    if (indexOfLastWord > 0) {
      str += w;
      for (i = 1; i < indexOfLastWord; i++) {
        ws = d[i] + '';
        k = LOG_BASE - ws.length;
        if (k) str += getZeroString(k);
        str += ws;
      }

      w = d[i];
      ws = w + '';
      k = LOG_BASE - ws.length;
      if (k) str += getZeroString(k);
    } else if (w === 0) {
      return '0';
    }

    // Remove trailing zeros of last w.
    for (; w % 10 === 0;) w /= 10;

    return str + w;
  }


  var divide = (function () {

    // Assumes non-zero x and k, and hence non-zero result.
    function multiplyInteger(x, k) {
      var temp,
        carry = 0,
        i = x.length;

      for (x = x.slice(); i--;) {
        temp = x[i] * k + carry;
        x[i] = temp % BASE | 0;
        carry = temp / BASE | 0;
      }

      if (carry) x.unshift(carry);

      return x;
    }

    function compare(a, b, aL, bL) {
      var i, r;

      if (aL != bL) {
        r = aL > bL ? 1 : -1;
      } else {
        for (i = r = 0; i < aL; i++) {
          if (a[i] != b[i]) {
            r = a[i] > b[i] ? 1 : -1;
            break;
          }
        }
      }

      return r;
    }

    function subtract(a, b, aL) {
      var i = 0;

      // Subtract b from a.
      for (; aL--;) {
        a[aL] -= i;
        i = a[aL] < b[aL] ? 1 : 0;
        a[aL] = i * BASE + a[aL] - b[aL];
      }

      // Remove leading zeros.
      for (; !a[0] && a.length > 1;) a.shift();
    }

    return function (x, y, pr, dp) {
      var cmp, e, i, k, prod, prodL, q, qd, rem, remL, rem0, sd, t, xi, xL, yd0, yL, yz,
        Ctor = x.constructor,
        sign = x.s == y.s ? 1 : -1,
        xd = x.d,
        yd = y.d;

      // Either 0?
      if (!x.s) return new Ctor(x);
      if (!y.s) throw Error(decimalError + 'Division by zero');

      e = x.e - y.e;
      yL = yd.length;
      xL = xd.length;
      q = new Ctor(sign);
      qd = q.d = [];

      // Result exponent may be one less than e.
      for (i = 0; yd[i] == (xd[i] || 0); ) ++i;
      if (yd[i] > (xd[i] || 0)) --e;

      if (pr == null) {
        sd = pr = Ctor.precision;
      } else if (dp) {
        sd = pr + (getBase10Exponent(x) - getBase10Exponent(y)) + 1;
      } else {
        sd = pr;
      }

      if (sd < 0) return new Ctor(0);

      // Convert precision in number of base 10 digits to base 1e7 digits.
      sd = sd / LOG_BASE + 2 | 0;
      i = 0;

      // divisor < 1e7
      if (yL == 1) {
        k = 0;
        yd = yd[0];
        sd++;

        // k is the carry.
        for (; (i < xL || k) && sd--; i++) {
          t = k * BASE + (xd[i] || 0);
          qd[i] = t / yd | 0;
          k = t % yd | 0;
        }

      // divisor >= 1e7
      } else {

        // Normalise xd and yd so highest order digit of yd is >= BASE/2
        k = BASE / (yd[0] + 1) | 0;

        if (k > 1) {
          yd = multiplyInteger(yd, k);
          xd = multiplyInteger(xd, k);
          yL = yd.length;
          xL = xd.length;
        }

        xi = yL;
        rem = xd.slice(0, yL);
        remL = rem.length;

        // Add zeros to make remainder as long as divisor.
        for (; remL < yL;) rem[remL++] = 0;

        yz = yd.slice();
        yz.unshift(0);
        yd0 = yd[0];

        if (yd[1] >= BASE / 2) ++yd0;

        do {
          k = 0;

          // Compare divisor and remainder.
          cmp = compare(yd, rem, yL, remL);

          // If divisor < remainder.
          if (cmp < 0) {

            // Calculate trial digit, k.
            rem0 = rem[0];
            if (yL != remL) rem0 = rem0 * BASE + (rem[1] || 0);

            // k will be how many times the divisor goes into the current remainder.
            k = rem0 / yd0 | 0;

            //  Algorithm:
            //  1. product = divisor * trial digit (k)
            //  2. if product > remainder: product -= divisor, k--
            //  3. remainder -= product
            //  4. if product was < remainder at 2:
            //    5. compare new remainder and divisor
            //    6. If remainder > divisor: remainder -= divisor, k++

            if (k > 1) {
              if (k >= BASE) k = BASE - 1;

              // product = divisor * trial digit.
              prod = multiplyInteger(yd, k);
              prodL = prod.length;
              remL = rem.length;

              // Compare product and remainder.
              cmp = compare(prod, rem, prodL, remL);

              // product > remainder.
              if (cmp == 1) {
                k--;

                // Subtract divisor from product.
                subtract(prod, yL < prodL ? yz : yd, prodL);
              }
            } else {

              // cmp is -1.
              // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1
              // to avoid it. If k is 1 there is a need to compare yd and rem again below.
              if (k == 0) cmp = k = 1;
              prod = yd.slice();
            }

            prodL = prod.length;
            if (prodL < remL) prod.unshift(0);

            // Subtract product from remainder.
            subtract(rem, prod, remL);

            // If product was < previous remainder.
            if (cmp == -1) {
              remL = rem.length;

              // Compare divisor and new remainder.
              cmp = compare(yd, rem, yL, remL);

              // If divisor < new remainder, subtract divisor from remainder.
              if (cmp < 1) {
                k++;

                // Subtract divisor from remainder.
                subtract(rem, yL < remL ? yz : yd, remL);
              }
            }

            remL = rem.length;
          } else if (cmp === 0) {
            k++;
            rem = [0];
          }    // if cmp === 1, k will be 0

          // Add the next digit, k, to the result array.
          qd[i++] = k;

          // Update the remainder.
          if (cmp && rem[0]) {
            rem[remL++] = xd[xi] || 0;
          } else {
            rem = [xd[xi]];
            remL = 1;
          }

        } while ((xi++ < xL || rem[0] !== void 0) && sd--);
      }

      // Leading zero?
      if (!qd[0]) qd.shift();

      q.e = e;

      return round(q, dp ? pr + getBase10Exponent(q) + 1 : pr);
    };
  })();


  /*
   * Return a new Decimal whose value is the natural exponential of `x` truncated to `sd`
   * significant digits.
   *
   * Taylor/Maclaurin series.
   *
   * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...
   *
   * Argument reduction:
   *   Repeat x = x / 32, k += 5, until |x| < 0.1
   *   exp(x) = exp(x / 2^k)^(2^k)
   *
   * Previously, the argument was initially reduced by
   * exp(x) = exp(r) * 10^k  where r = x - k * ln10, k = floor(x / ln10)
   * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was
   * found to be slower than just dividing repeatedly by 32 as above.
   *
   * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)
   *
   *  exp(x) is non-terminating for any finite, non-zero x.
   *
   */
  function exp(x, sd) {
    var denominator, guard, pow, sum, t, wpr,
      i = 0,
      k = 0,
      Ctor = x.constructor,
      pr = Ctor.precision;

    if (getBase10Exponent(x) > 16) throw Error(exponentOutOfRange + getBase10Exponent(x));

    // exp(0) = 1
    if (!x.s) return new Ctor(ONE);

    if (sd == null) {
      external = false;
      wpr = pr;
    } else {
      wpr = sd;
    }

    t = new Ctor(0.03125);

    while (x.abs().gte(0.1)) {
      x = x.times(t);    // x = x / 2^5
      k += 5;
    }

    // Estimate the precision increase necessary to ensure the first 4 rounding digits are correct.
    guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;
    wpr += guard;
    denominator = pow = sum = new Ctor(ONE);
    Ctor.precision = wpr;

    for (;;) {
      pow = round(pow.times(x), wpr);
      denominator = denominator.times(++i);
      t = sum.plus(divide(pow, denominator, wpr));

      if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
        while (k--) sum = round(sum.times(sum), wpr);
        Ctor.precision = pr;
        return sd == null ? (external = true, round(sum, pr)) : sum;
      }

      sum = t;
    }
  }


  // Calculate the base 10 exponent from the base 1e7 exponent.
  function getBase10Exponent(x) {
    var e = x.e * LOG_BASE,
      w = x.d[0];

    // Add the number of digits of the first word of the digits array.
    for (; w >= 10; w /= 10) e++;
    return e;
  }


  function getLn10(Ctor, sd, pr) {

    if (sd > Ctor.LN10.sd()) {


      // Reset global state in case the exception is caught.
      external = true;
      if (pr) Ctor.precision = pr;
      throw Error(decimalError + 'LN10 precision limit exceeded');
    }

    return round(new Ctor(Ctor.LN10), sd);
  }


  function getZeroString(k) {
    var zs = '';
    for (; k--;) zs += '0';
    return zs;
  }


  /*
   * Return a new Decimal whose value is the natural logarithm of `x` truncated to `sd` significant
   * digits.
   *
   *  ln(n) is non-terminating (n != 1)
   *
   */
  function ln(y, sd) {
    var c, c0, denominator, e, numerator, sum, t, wpr, x2,
      n = 1,
      guard = 10,
      x = y,
      xd = x.d,
      Ctor = x.constructor,
      pr = Ctor.precision;

    // ln(-x) = NaN
    // ln(0) = -Infinity
    if (x.s < 1) throw Error(decimalError + (x.s ? 'NaN' : '-Infinity'));

    // ln(1) = 0
    if (x.eq(ONE)) return new Ctor(0);

    if (sd == null) {
      external = false;
      wpr = pr;
    } else {
      wpr = sd;
    }

    if (x.eq(10)) {
      if (sd == null) external = true;
      return getLn10(Ctor, wpr);
    }

    wpr += guard;
    Ctor.precision = wpr;
    c = digitsToString(xd);
    c0 = c.charAt(0);
    e = getBase10Exponent(x);

    if (Math.abs(e) < 1.5e15) {

      // Argument reduction.
      // The series converges faster the closer the argument is to 1, so using
      // ln(a^b) = b * ln(a),   ln(a) = ln(a^b) / b
      // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,
      // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can
      // later be divided by this number, then separate out the power of 10 using
      // ln(a*10^b) = ln(a) + b*ln(10).

      // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).
      //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {
      // max n is 6 (gives 0.7 - 1.3)
      while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {
        x = x.times(y);
        c = digitsToString(x.d);
        c0 = c.charAt(0);
        n++;
      }

      e = getBase10Exponent(x);

      if (c0 > 1) {
        x = new Ctor('0.' + c);
        e++;
      } else {
        x = new Ctor(c0 + '.' + c.slice(1));
      }
    } else {

      // The argument reduction method above may result in overflow if the argument y is a massive
      // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this
      // function using ln(x*10^e) = ln(x) + e*ln(10).
      t = getLn10(Ctor, wpr + 2, pr).times(e + '');
      x = ln(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);

      Ctor.precision = pr;
      return sd == null ? (external = true, round(x, pr)) : x;
    }

    // x is reduced to a value near 1.

    // Taylor series.
    // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)
    // where x = (y - 1)/(y + 1)    (|x| < 1)
    sum = numerator = x = divide(x.minus(ONE), x.plus(ONE), wpr);
    x2 = round(x.times(x), wpr);
    denominator = 3;

    for (;;) {
      numerator = round(numerator.times(x2), wpr);
      t = sum.plus(divide(numerator, new Ctor(denominator), wpr));

      if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
        sum = sum.times(2);

        // Reverse the argument reduction.
        if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));
        sum = divide(sum, new Ctor(n), wpr);

        Ctor.precision = pr;
        return sd == null ? (external = true, round(sum, pr)) : sum;
      }

      sum = t;
      denominator += 2;
    }
  }


  /*
   * Parse the value of a new Decimal `x` from string `str`.
   */
  function parseDecimal(x, str) {
    var e, i, len;

    // Decimal point?
    if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');

    // Exponential form?
    if ((i = str.search(/e/i)) > 0) {

      // Determine exponent.
      if (e < 0) e = i;
      e += +str.slice(i + 1);
      str = str.substring(0, i);
    } else if (e < 0) {

      // Integer.
      e = str.length;
    }

    // Determine leading zeros.
    for (i = 0; str.charCodeAt(i) === 48;) ++i;

    // Determine trailing zeros.
    for (len = str.length; str.charCodeAt(len - 1) === 48;) --len;
    str = str.slice(i, len);

    if (str) {
      len -= i;
      e = e - i - 1;
      x.e = mathfloor(e / LOG_BASE);
      x.d = [];

      // Transform base

      // e is the base 10 exponent.
      // i is where to slice str to get the first word of the digits array.
      i = (e + 1) % LOG_BASE;
      if (e < 0) i += LOG_BASE;

      if (i < len) {
        if (i) x.d.push(+str.slice(0, i));
        for (len -= LOG_BASE; i < len;) x.d.push(+str.slice(i, i += LOG_BASE));
        str = str.slice(i);
        i = LOG_BASE - str.length;
      } else {
        i -= len;
      }

      for (; i--;) str += '0';
      x.d.push(+str);

      if (external && (x.e > MAX_E || x.e < -MAX_E)) throw Error(exponentOutOfRange + e);
    } else {

      // Zero.
      x.s = 0;
      x.e = 0;
      x.d = [0];
    }

    return x;
  }


  /*
   * Round `x` to `sd` significant digits, using rounding mode `rm` if present (truncate otherwise).
   */
   function round(x, sd, rm) {
    var i, j, k, n, rd, doRound, w, xdi,
      xd = x.d;

    // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.
    // w: the word of xd which contains the rounding digit, a base 1e7 number.
    // xdi: the index of w within xd.
    // n: the number of digits of w.
    // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if
    // they had leading zeros)
    // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).

    // Get the length of the first word of the digits array xd.
    for (n = 1, k = xd[0]; k >= 10; k /= 10) n++;
    i = sd - n;

    // Is the rounding digit in the first word of xd?
    if (i < 0) {
      i += LOG_BASE;
      j = sd;
      w = xd[xdi = 0];
    } else {
      xdi = Math.ceil((i + 1) / LOG_BASE);
      k = xd.length;
      if (xdi >= k) return x;
      w = k = xd[xdi];

      // Get the number of digits of w.
      for (n = 1; k >= 10; k /= 10) n++;

      // Get the index of rd within w.
      i %= LOG_BASE;

      // Get the index of rd within w, adjusted for leading zeros.
      // The number of leading zeros of w is given by LOG_BASE - n.
      j = i - LOG_BASE + n;
    }

    if (rm !== void 0) {
      k = mathpow(10, n - j - 1);

      // Get the rounding digit at index j of w.
      rd = w / k % 10 | 0;

      // Are there any non-zero digits after the rounding digit?
      doRound = sd < 0 || xd[xdi + 1] !== void 0 || w % k;

      // The expression `w % mathpow(10, n - j - 1)` returns all the digits of w to the right of the
      // digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression will give
      // 714.

      doRound = rm < 4
        ? (rd || doRound) && (rm == 0 || rm == (x.s < 0 ? 3 : 2))
        : rd > 5 || rd == 5 && (rm == 4 || doRound || rm == 6 &&

          // Check whether the digit to the left of the rounding digit is odd.
          ((i > 0 ? j > 0 ? w / mathpow(10, n - j) : 0 : xd[xdi - 1]) % 10) & 1 ||
            rm == (x.s < 0 ? 8 : 7));
    }

    if (sd < 1 || !xd[0]) {
      if (doRound) {
        k = getBase10Exponent(x);
        xd.length = 1;

        // Convert sd to decimal places.
        sd = sd - k - 1;

        // 1, 0.1, 0.01, 0.001, 0.0001 etc.
        xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);
        x.e = mathfloor(-sd / LOG_BASE) || 0;
      } else {
        xd.length = 1;

        // Zero.
        xd[0] = x.e = x.s = 0;
      }

      return x;
    }

    // Remove excess digits.
    if (i == 0) {
      xd.length = xdi;
      k = 1;
      xdi--;
    } else {
      xd.length = xdi + 1;
      k = mathpow(10, LOG_BASE - i);

      // E.g. 56700 becomes 56000 if 7 is the rounding digit.
      // j > 0 means i > number of leading zeros of w.
      xd[xdi] = j > 0 ? (w / mathpow(10, n - j) % mathpow(10, j) | 0) * k : 0;
    }

    if (doRound) {
      for (;;) {

        // Is the digit to be rounded up in the first word of xd?
        if (xdi == 0) {
          if ((xd[0] += k) == BASE) {
            xd[0] = 1;
            ++x.e;
          }

          break;
        } else {
          xd[xdi] += k;
          if (xd[xdi] != BASE) break;
          xd[xdi--] = 0;
          k = 1;
        }
      }
    }

    // Remove trailing zeros.
    for (i = xd.length; xd[--i] === 0;) xd.pop();

    if (external && (x.e > MAX_E || x.e < -MAX_E)) {
      throw Error(exponentOutOfRange + getBase10Exponent(x));
    }

    return x;
  }


  function subtract(x, y) {
    var d, e, i, j, k, len, xd, xe, xLTy, yd,
      Ctor = x.constructor,
      pr = Ctor.precision;

    // Return y negated if x is zero.
    // Return x if y is zero and x is non-zero.
    if (!x.s || !y.s) {
      if (y.s) y.s = -y.s;
      else y = new Ctor(x);
      return external ? round(y, pr) : y;
    }

    xd = x.d;
    yd = y.d;

    // x and y are non-zero numbers with the same sign.

    e = y.e;
    xe = x.e;
    xd = xd.slice();
    k = xe - e;

    // If exponents differ...
    if (k) {
      xLTy = k < 0;

      if (xLTy) {
        d = xd;
        k = -k;
        len = yd.length;
      } else {
        d = yd;
        e = xe;
        len = xd.length;
      }

      // Numbers with massively different exponents would result in a very high number of zeros
      // needing to be prepended, but this can be avoided while still ensuring correct rounding by
      // limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.
      i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;

      if (k > i) {
        k = i;
        d.length = 1;
      }

      // Prepend zeros to equalise exponents.
      d.reverse();
      for (i = k; i--;) d.push(0);
      d.reverse();

    // Base 1e7 exponents equal.
    } else {

      // Check digits to determine which is the bigger number.

      i = xd.length;
      len = yd.length;
      xLTy = i < len;
      if (xLTy) len = i;

      for (i = 0; i < len; i++) {
        if (xd[i] != yd[i]) {
          xLTy = xd[i] < yd[i];
          break;
        }
      }

      k = 0;
    }

    if (xLTy) {
      d = xd;
      xd = yd;
      yd = d;
      y.s = -y.s;
    }

    len = xd.length;

    // Append zeros to xd if shorter.
    // Don't add zeros to yd if shorter as subtraction only needs to start at yd length.
    for (i = yd.length - len; i > 0; --i) xd[len++] = 0;

    // Subtract yd from xd.
    for (i = yd.length; i > k;) {
      if (xd[--i] < yd[i]) {
        for (j = i; j && xd[--j] === 0;) xd[j] = BASE - 1;
        --xd[j];
        xd[i] += BASE;
      }

      xd[i] -= yd[i];
    }

    // Remove trailing zeros.
    for (; xd[--len] === 0;) xd.pop();

    // Remove leading zeros and adjust exponent accordingly.
    for (; xd[0] === 0; xd.shift()) --e;

    // Zero?
    if (!xd[0]) return new Ctor(0);

    y.d = xd;
    y.e = e;

    //return external && xd.length >= pr / LOG_BASE ? round(y, pr) : y;
    return external ? round(y, pr) : y;
  }


  function toString(x, isExp, sd) {
    var k,
      e = getBase10Exponent(x),
      str = digitsToString(x.d),
      len = str.length;

    if (isExp) {
      if (sd && (k = sd - len) > 0) {
        str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);
      } else if (len > 1) {
        str = str.charAt(0) + '.' + str.slice(1);
      }

      str = str + (e < 0 ? 'e' : 'e+') + e;
    } else if (e < 0) {
      str = '0.' + getZeroString(-e - 1) + str;
      if (sd && (k = sd - len) > 0) str += getZeroString(k);
    } else if (e >= len) {
      str += getZeroString(e + 1 - len);
      if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);
    } else {
      if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);
      if (sd && (k = sd - len) > 0) {
        if (e + 1 === len) str += '.';
        str += getZeroString(k);
      }
    }

    return x.s < 0 ? '-' + str : str;
  }


  // Does not strip trailing zeros.
  function truncate(arr, len) {
    if (arr.length > len) {
      arr.length = len;
      return true;
    }
  }


  // Decimal methods


  /*
   *  clone
   *  config/set
   */


  /*
   * Create and return a Decimal constructor with the same configuration properties as this Decimal
   * constructor.
   *
   */
  function clone(obj) {
    var i, p, ps;

    /*
     * The Decimal constructor and exported function.
     * Return a new Decimal instance.
     *
     * value {number|string|Decimal} A numeric value.
     *
     */
    function Decimal(value) {
      var x = this;

      // Decimal called without new.
      if (!(x instanceof Decimal)) return new Decimal(value);

      // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor
      // which points to Object.
      x.constructor = Decimal;

      // Duplicate.
      if (value instanceof Decimal) {
        x.s = value.s;
        x.e = value.e;
        x.d = (value = value.d) ? value.slice() : value;
        return;
      }

      if (typeof value === 'number') {

        // Reject Infinity/NaN.
        if (value * 0 !== 0) {
          throw Error(invalidArgument + value);
        }

        if (value > 0) {
          x.s = 1;
        } else if (value < 0) {
          value = -value;
          x.s = -1;
        } else {
          x.s = 0;
          x.e = 0;
          x.d = [0];
          return;
        }

        // Fast path for small integers.
        if (value === ~~value && value < 1e7) {
          x.e = 0;
          x.d = [value];
          return;
        }

        return parseDecimal(x, value.toString());
      } else if (typeof value !== 'string') {
        throw Error(invalidArgument + value);
      }

      // Minus sign?
      if (value.charCodeAt(0) === 45) {
        value = value.slice(1);
        x.s = -1;
      } else {
        x.s = 1;
      }

      if (isDecimal.test(value)) parseDecimal(x, value);
      else throw Error(invalidArgument + value);
    }

    Decimal.prototype = P;

    Decimal.ROUND_UP = 0;
    Decimal.ROUND_DOWN = 1;
    Decimal.ROUND_CEIL = 2;
    Decimal.ROUND_FLOOR = 3;
    Decimal.ROUND_HALF_UP = 4;
    Decimal.ROUND_HALF_DOWN = 5;
    Decimal.ROUND_HALF_EVEN = 6;
    Decimal.ROUND_HALF_CEIL = 7;
    Decimal.ROUND_HALF_FLOOR = 8;

    Decimal.clone = clone;
    Decimal.config = Decimal.set = config;

    if (obj === void 0) obj = {};
    if (obj) {
      ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'LN10'];
      for (i = 0; i < ps.length;) if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];
    }

    Decimal.config(obj);

    return Decimal;
  }


  /*
   * Configure global settings for a Decimal constructor.
   *
   * `obj` is an object with one or more of the following properties,
   *
   *   precision  {number}
   *   rounding   {number}
   *   toExpNeg   {number}
   *   toExpPos   {number}
   *
   * E.g. Decimal.config({ precision: 20, rounding: 4 })
   *
   */
  function config(obj) {
    if (!obj || typeof obj !== 'object') {
      throw Error(decimalError + 'Object expected');
    }
    var i, p, v,
      ps = [
        'precision', 1, MAX_DIGITS,
        'rounding', 0, 8,
        'toExpNeg', -1 / 0, 0,
        'toExpPos', 0, 1 / 0
      ];

    for (i = 0; i < ps.length; i += 3) {
      if ((v = obj[p = ps[i]]) !== void 0) {
        if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;
        else throw Error(invalidArgument + p + ': ' + v);
      }
    }

    if ((v = obj[p = 'LN10']) !== void 0) {
        if (v == Math.LN10) this[p] = new this(v);
        else throw Error(invalidArgument + p + ': ' + v);
    }

    return this;
  }


  // Create and configure initial Decimal constructor.
  Decimal = clone(Decimal);

  Decimal['default'] = Decimal.Decimal = Decimal;

  // Internal constant.
  ONE = new Decimal(1);


  // Export.


  // AMD.
  if (true) {
    !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
      return Decimal;
    }).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));

  // Node and other environments that support module.exports.
  } else {}
})(this);


/***/ }),

/***/ 1640:
/***/ (function(module) {

"use strict";


var has = Object.prototype.hasOwnProperty
  , prefix = '~';

/**
 * Constructor to create a storage for our `EE` objects.
 * An `Events` instance is a plain object whose properties are event names.
 *
 * @constructor
 * @private
 */
function Events() {}

//
// We try to not inherit from `Object.prototype`. In some engines creating an
// instance in this way is faster than calling `Object.create(null)` directly.
// If `Object.create(null)` is not supported we prefix the event names with a
// character to make sure that the built-in object properties are not
// overridden or used as an attack vector.
//
if (Object.create) {
  Events.prototype = Object.create(null);

  //
  // This hack is needed because the `__proto__` property is still inherited in
  // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
  //
  if (!new Events().__proto__) prefix = false;
}

/**
 * Representation of a single event listener.
 *
 * @param {Function} fn The listener function.
 * @param {*} context The context to invoke the listener with.
 * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
 * @constructor
 * @private
 */
function EE(fn, context, once) {
  this.fn = fn;
  this.context = context;
  this.once = once || false;
}

/**
 * Add a listener for a given event.
 *
 * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
 * @param {(String|Symbol)} event The event name.
 * @param {Function} fn The listener function.
 * @param {*} context The context to invoke the listener with.
 * @param {Boolean} once Specify if the listener is a one-time listener.
 * @returns {EventEmitter}
 * @private
 */
function addListener(emitter, event, fn, context, once) {
  if (typeof fn !== 'function') {
    throw new TypeError('The listener must be a function');
  }

  var listener = new EE(fn, context || emitter, once)
    , evt = prefix ? prefix + event : event;

  if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
  else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
  else emitter._events[evt] = [emitter._events[evt], listener];

  return emitter;
}

/**
 * Clear event by name.
 *
 * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
 * @param {(String|Symbol)} evt The Event name.
 * @private
 */
function clearEvent(emitter, evt) {
  if (--emitter._eventsCount === 0) emitter._events = new Events();
  else delete emitter._events[evt];
}

/**
 * Minimal `EventEmitter` interface that is molded against the Node.js
 * `EventEmitter` interface.
 *
 * @constructor
 * @public
 */
function EventEmitter() {
  this._events = new Events();
  this._eventsCount = 0;
}

/**
 * Return an array listing the events for which the emitter has registered
 * listeners.
 *
 * @returns {Array}
 * @public
 */
EventEmitter.prototype.eventNames = function eventNames() {
  var names = []
    , events
    , name;

  if (this._eventsCount === 0) return names;

  for (name in (events = this._events)) {
    if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
  }

  if (Object.getOwnPropertySymbols) {
    return names.concat(Object.getOwnPropertySymbols(events));
  }

  return names;
};

/**
 * Return the listeners registered for a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @returns {Array} The registered listeners.
 * @public
 */
EventEmitter.prototype.listeners = function listeners(event) {
  var evt = prefix ? prefix + event : event
    , handlers = this._events[evt];

  if (!handlers) return [];
  if (handlers.fn) return [handlers.fn];

  for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
    ee[i] = handlers[i].fn;
  }

  return ee;
};

/**
 * Return the number of listeners listening to a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @returns {Number} The number of listeners.
 * @public
 */
EventEmitter.prototype.listenerCount = function listenerCount(event) {
  var evt = prefix ? prefix + event : event
    , listeners = this._events[evt];

  if (!listeners) return 0;
  if (listeners.fn) return 1;
  return listeners.length;
};

/**
 * Calls each of the listeners registered for a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @returns {Boolean} `true` if the event had listeners, else `false`.
 * @public
 */
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
  var evt = prefix ? prefix + event : event;

  if (!this._events[evt]) return false;

  var listeners = this._events[evt]
    , len = arguments.length
    , args
    , i;

  if (listeners.fn) {
    if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);

    switch (len) {
      case 1: return listeners.fn.call(listeners.context), true;
      case 2: return listeners.fn.call(listeners.context, a1), true;
      case 3: return listeners.fn.call(listeners.context, a1, a2), true;
      case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
      case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
      case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
    }

    for (i = 1, args = new Array(len -1); i < len; i++) {
      args[i - 1] = arguments[i];
    }

    listeners.fn.apply(listeners.context, args);
  } else {
    var length = listeners.length
      , j;

    for (i = 0; i < length; i++) {
      if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);

      switch (len) {
        case 1: listeners[i].fn.call(listeners[i].context); break;
        case 2: listeners[i].fn.call(listeners[i].context, a1); break;
        case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
        case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
        default:
          if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
            args[j - 1] = arguments[j];
          }

          listeners[i].fn.apply(listeners[i].context, args);
      }
    }
  }

  return true;
};

/**
 * Add a listener for a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @param {Function} fn The listener function.
 * @param {*} [context=this] The context to invoke the listener with.
 * @returns {EventEmitter} `this`.
 * @public
 */
EventEmitter.prototype.on = function on(event, fn, context) {
  return addListener(this, event, fn, context, false);
};

/**
 * Add a one-time listener for a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @param {Function} fn The listener function.
 * @param {*} [context=this] The context to invoke the listener with.
 * @returns {EventEmitter} `this`.
 * @public
 */
EventEmitter.prototype.once = function once(event, fn, context) {
  return addListener(this, event, fn, context, true);
};

/**
 * Remove the listeners of a given event.
 *
 * @param {(String|Symbol)} event The event name.
 * @param {Function} fn Only remove the listeners that match this function.
 * @param {*} context Only remove the listeners that have this context.
 * @param {Boolean} once Only remove one-time listeners.
 * @returns {EventEmitter} `this`.
 * @public
 */
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
  var evt = prefix ? prefix + event : event;

  if (!this._events[evt]) return this;
  if (!fn) {
    clearEvent(this, evt);
    return this;
  }

  var listeners = this._events[evt];

  if (listeners.fn) {
    if (
      listeners.fn === fn &&
      (!once || listeners.once) &&
      (!context || listeners.context === context)
    ) {
      clearEvent(this, evt);
    }
  } else {
    for (var i = 0, events = [], length = listeners.length; i < length; i++) {
      if (
        listeners[i].fn !== fn ||
        (once && !listeners[i].once) ||
        (context && listeners[i].context !== context)
      ) {
        events.push(listeners[i]);
      }
    }

    //
    // Reset the array, or remove it completely if we have no more listeners.
    //
    if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
    else clearEvent(this, evt);
  }

  return this;
};

/**
 * Remove all listeners, or those of the specified event.
 *
 * @param {(String|Symbol)} [event] The event name.
 * @returns {EventEmitter} `this`.
 * @public
 */
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
  var evt;

  if (event) {
    evt = prefix ? prefix + event : event;
    if (this._events[evt]) clearEvent(this, evt);
  } else {
    this._events = new Events();
    this._eventsCount = 0;
  }

  return this;
};

//
// Alias methods names because people roll like that.
//
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.addListener = EventEmitter.prototype.on;

//
// Expose the prefix.
//
EventEmitter.prefixed = prefix;

//
// Allow `EventEmitter` to be imported as module namespace.
//
EventEmitter.EventEmitter = EventEmitter;

//
// Expose the module.
//
if (true) {
  module.exports = EventEmitter;
}


/***/ }),

/***/ 3096:
/***/ (function(module) {

/**
 * Copyright (c) 2014-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.
 */

(function (global, factory) {
   true ? module.exports = factory() :
  0;
}(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice;

  function createClass(ctor, superClass) {
    if (superClass) {
      ctor.prototype = Object.create(superClass.prototype);
    }
    ctor.prototype.constructor = ctor;
  }

  function Iterable(value) {
      return isIterable(value) ? value : Seq(value);
    }


  createClass(KeyedIterable, Iterable);
    function KeyedIterable(value) {
      return isKeyed(value) ? value : KeyedSeq(value);
    }


  createClass(IndexedIterable, Iterable);
    function IndexedIterable(value) {
      return isIndexed(value) ? value : IndexedSeq(value);
    }


  createClass(SetIterable, Iterable);
    function SetIterable(value) {
      return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);
    }



  function isIterable(maybeIterable) {
    return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);
  }

  function isKeyed(maybeKeyed) {
    return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);
  }

  function isIndexed(maybeIndexed) {
    return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);
  }

  function isAssociative(maybeAssociative) {
    return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);
  }

  function isOrdered(maybeOrdered) {
    return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);
  }

  Iterable.isIterable = isIterable;
  Iterable.isKeyed = isKeyed;
  Iterable.isIndexed = isIndexed;
  Iterable.isAssociative = isAssociative;
  Iterable.isOrdered = isOrdered;

  Iterable.Keyed = KeyedIterable;
  Iterable.Indexed = IndexedIterable;
  Iterable.Set = SetIterable;


  var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
  var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
  var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
  var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';

  // Used for setting prototype methods that IE8 chokes on.
  var DELETE = 'delete';

  // Constants describing the size of trie nodes.
  var SHIFT = 5; // Resulted in best performance after ______?
  var SIZE = 1 << SHIFT;
  var MASK = SIZE - 1;

  // A consistent shared value representing "not set" which equals nothing other
  // than itself, and nothing that could be provided externally.
  var NOT_SET = {};

  // Boolean references, Rough equivalent of `bool &`.
  var CHANGE_LENGTH = { value: false };
  var DID_ALTER = { value: false };

  function MakeRef(ref) {
    ref.value = false;
    return ref;
  }

  function SetRef(ref) {
    ref && (ref.value = true);
  }

  // A function which returns a value representing an "owner" for transient writes
  // to tries. The return value will only ever equal itself, and will not equal
  // the return of any subsequent call of this function.
  function OwnerID() {}

  // http://jsperf.com/copy-array-inline
  function arrCopy(arr, offset) {
    offset = offset || 0;
    var len = Math.max(0, arr.length - offset);
    var newArr = new Array(len);
    for (var ii = 0; ii < len; ii++) {
      newArr[ii] = arr[ii + offset];
    }
    return newArr;
  }

  function ensureSize(iter) {
    if (iter.size === undefined) {
      iter.size = iter.__iterate(returnTrue);
    }
    return iter.size;
  }

  function wrapIndex(iter, index) {
    // This implements "is array index" which the ECMAString spec defines as:
    //
    //     A String property name P is an array index if and only if
    //     ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal
    //     to 2^32−1.
    //
    // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects
    if (typeof index !== 'number') {
      var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32
      if ('' + uint32Index !== index || uint32Index === 4294967295) {
        return NaN;
      }
      index = uint32Index;
    }
    return index < 0 ? ensureSize(iter) + index : index;
  }

  function returnTrue() {
    return true;
  }

  function wholeSlice(begin, end, size) {
    return (begin === 0 || (size !== undefined && begin <= -size)) &&
      (end === undefined || (size !== undefined && end >= size));
  }

  function resolveBegin(begin, size) {
    return resolveIndex(begin, size, 0);
  }

  function resolveEnd(end, size) {
    return resolveIndex(end, size, size);
  }

  function resolveIndex(index, size, defaultIndex) {
    return index === undefined ?
      defaultIndex :
      index < 0 ?
        Math.max(0, size + index) :
        size === undefined ?
          index :
          Math.min(size, index);
  }

  /* global Symbol */

  var ITERATE_KEYS = 0;
  var ITERATE_VALUES = 1;
  var ITERATE_ENTRIES = 2;

  var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  var FAUX_ITERATOR_SYMBOL = '@@iterator';

  var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;


  function Iterator(next) {
      this.next = next;
    }

    Iterator.prototype.toString = function() {
      return '[Iterator]';
    };


  Iterator.KEYS = ITERATE_KEYS;
  Iterator.VALUES = ITERATE_VALUES;
  Iterator.ENTRIES = ITERATE_ENTRIES;

  Iterator.prototype.inspect =
  Iterator.prototype.toSource = function () { return this.toString(); }
  Iterator.prototype[ITERATOR_SYMBOL] = function () {
    return this;
  };


  function iteratorValue(type, k, v, iteratorResult) {
    var value = type === 0 ? k : type === 1 ? v : [k, v];
    iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {
      value: value, done: false
    });
    return iteratorResult;
  }

  function iteratorDone() {
    return { value: undefined, done: true };
  }

  function hasIterator(maybeIterable) {
    return !!getIteratorFn(maybeIterable);
  }

  function isIterator(maybeIterator) {
    return maybeIterator && typeof maybeIterator.next === 'function';
  }

  function getIterator(iterable) {
    var iteratorFn = getIteratorFn(iterable);
    return iteratorFn && iteratorFn.call(iterable);
  }

  function getIteratorFn(iterable) {
    var iteratorFn = iterable && (
      (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) ||
      iterable[FAUX_ITERATOR_SYMBOL]
    );
    if (typeof iteratorFn === 'function') {
      return iteratorFn;
    }
  }

  function isArrayLike(value) {
    return value && typeof value.length === 'number';
  }

  createClass(Seq, Iterable);
    function Seq(value) {
      return value === null || value === undefined ? emptySequence() :
        isIterable(value) ? value.toSeq() : seqFromValue(value);
    }

    Seq.of = function(/*...values*/) {
      return Seq(arguments);
    };

    Seq.prototype.toSeq = function() {
      return this;
    };

    Seq.prototype.toString = function() {
      return this.__toString('Seq {', '}');
    };

    Seq.prototype.cacheResult = function() {
      if (!this._cache && this.__iterateUncached) {
        this._cache = this.entrySeq().toArray();
        this.size = this._cache.length;
      }
      return this;
    };

    // abstract __iterateUncached(fn, reverse)

    Seq.prototype.__iterate = function(fn, reverse) {
      return seqIterate(this, fn, reverse, true);
    };

    // abstract __iteratorUncached(type, reverse)

    Seq.prototype.__iterator = function(type, reverse) {
      return seqIterator(this, type, reverse, true);
    };



  createClass(KeyedSeq, Seq);
    function KeyedSeq(value) {
      return value === null || value === undefined ?
        emptySequence().toKeyedSeq() :
        isIterable(value) ?
          (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) :
          keyedSeqFromValue(value);
    }

    KeyedSeq.prototype.toKeyedSeq = function() {
      return this;
    };



  createClass(IndexedSeq, Seq);
    function IndexedSeq(value) {
      return value === null || value === undefined ? emptySequence() :
        !isIterable(value) ? indexedSeqFromValue(value) :
        isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();
    }

    IndexedSeq.of = function(/*...values*/) {
      return IndexedSeq(arguments);
    };

    IndexedSeq.prototype.toIndexedSeq = function() {
      return this;
    };

    IndexedSeq.prototype.toString = function() {
      return this.__toString('Seq [', ']');
    };

    IndexedSeq.prototype.__iterate = function(fn, reverse) {
      return seqIterate(this, fn, reverse, false);
    };

    IndexedSeq.prototype.__iterator = function(type, reverse) {
      return seqIterator(this, type, reverse, false);
    };



  createClass(SetSeq, Seq);
    function SetSeq(value) {
      return (
        value === null || value === undefined ? emptySequence() :
        !isIterable(value) ? indexedSeqFromValue(value) :
        isKeyed(value) ? value.entrySeq() : value
      ).toSetSeq();
    }

    SetSeq.of = function(/*...values*/) {
      return SetSeq(arguments);
    };

    SetSeq.prototype.toSetSeq = function() {
      return this;
    };



  Seq.isSeq = isSeq;
  Seq.Keyed = KeyedSeq;
  Seq.Set = SetSeq;
  Seq.Indexed = IndexedSeq;

  var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';

  Seq.prototype[IS_SEQ_SENTINEL] = true;



  createClass(ArraySeq, IndexedSeq);
    function ArraySeq(array) {
      this._array = array;
      this.size = array.length;
    }

    ArraySeq.prototype.get = function(index, notSetValue) {
      return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;
    };

    ArraySeq.prototype.__iterate = function(fn, reverse) {
      var array = this._array;
      var maxIndex = array.length - 1;
      for (var ii = 0; ii <= maxIndex; ii++) {
        if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {
          return ii + 1;
        }
      }
      return ii;
    };

    ArraySeq.prototype.__iterator = function(type, reverse) {
      var array = this._array;
      var maxIndex = array.length - 1;
      var ii = 0;
      return new Iterator(function() 
        {return ii > maxIndex ?
          iteratorDone() :
          iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])}
      );
    };



  createClass(ObjectSeq, KeyedSeq);
    function ObjectSeq(object) {
      var keys = Object.keys(object);
      this._object = object;
      this._keys = keys;
      this.size = keys.length;
    }

    ObjectSeq.prototype.get = function(key, notSetValue) {
      if (notSetValue !== undefined && !this.has(key)) {
        return notSetValue;
      }
      return this._object[key];
    };

    ObjectSeq.prototype.has = function(key) {
      return this._object.hasOwnProperty(key);
    };

    ObjectSeq.prototype.__iterate = function(fn, reverse) {
      var object = this._object;
      var keys = this._keys;
      var maxIndex = keys.length - 1;
      for (var ii = 0; ii <= maxIndex; ii++) {
        var key = keys[reverse ? maxIndex - ii : ii];
        if (fn(object[key], key, this) === false) {
          return ii + 1;
        }
      }
      return ii;
    };

    ObjectSeq.prototype.__iterator = function(type, reverse) {
      var object = this._object;
      var keys = this._keys;
      var maxIndex = keys.length - 1;
      var ii = 0;
      return new Iterator(function()  {
        var key = keys[reverse ? maxIndex - ii : ii];
        return ii++ > maxIndex ?
          iteratorDone() :
          iteratorValue(type, key, object[key]);
      });
    };

  ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;


  createClass(IterableSeq, IndexedSeq);
    function IterableSeq(iterable) {
      this._iterable = iterable;
      this.size = iterable.length || iterable.size;
    }

    IterableSeq.prototype.__iterateUncached = function(fn, reverse) {
      if (reverse) {
        return this.cacheResult().__iterate(fn, reverse);
      }
      var iterable = this._iterable;
      var iterator = getIterator(iterable);
      var iterations = 0;
      if (isIterator(iterator)) {
        var step;
        while (!(step = iterator.next()).done) {
          if (fn(step.value, iterations++, this) === false) {
            break;
          }
        }
      }
      return iterations;
    };

    IterableSeq.prototype.__iteratorUncached = function(type, reverse) {
      if (reverse) {
        return this.cacheResult().__iterator(type, reverse);
      }
      var iterable = this._iterable;
      var iterator = getIterator(iterable);
      if (!isIterator(iterator)) {
        return new Iterator(iteratorDone);
      }
      var iterations = 0;
      return new Iterator(function()  {
        var step = iterator.next();
        return step.done ? step : iteratorValue(type, iterations++, step.value);
      });
    };



  createClass(IteratorSeq, IndexedSeq);
    function IteratorSeq(iterator) {
      this._iterator = iterator;
      this._iteratorCache = [];
    }

    IteratorSeq.prototype.__iterateUncached = function(fn, reverse) {
      if (reverse) {
        return this.cacheResult().__iterate(fn, reverse);
      }
      var iterator = this._iterator;
      var cache = this._iteratorCache;
      var iterations = 0;
      while (iterations < cache.length) {
        if (fn(cache[iterations], iterations++, this) === false) {
          return iterations;
        }
      }
      var step;
      while (!(step = iterator.next()).done) {
        var val = step.value;
        cache[iterations] = val;
        if (fn(val, iterations++, this) === false) {
          break;
        }
      }
      return iterations;
    };

    IteratorSeq.prototype.__iteratorUncached = function(type, reverse) {
      if (reverse) {
        return this.cacheResult().__iterator(type, reverse);
      }
      var iterator = this._iterator;
      var cache = this._iteratorCache;
      var iterations = 0;
      return new Iterator(function()  {
        if (iterations >= cache.length) {
          var step = iterator.next();
          if (step.done) {
            return step;
          }
          cache[iterations] = step.value;
        }
        return iteratorValue(type, iterations, cache[iterations++]);
      });
    };




  // # pragma Helper functions

  function isSeq(maybeSeq) {
    return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);
  }

  var EMPTY_SEQ;

  function emptySequence() {
    return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));
  }

  function keyedSeqFromValue(value) {
    var seq =
      Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() :
      isIterator(value) ? new IteratorSeq(value).fromEntrySeq() :
      hasIterator(value) ? new IterableSeq(value).fromEntrySeq() :
      typeof value === 'object' ? new ObjectSeq(value) :
      undefined;
    if (!seq) {
      throw new TypeError(
        'Expected Array or iterable object of [k, v] entries, '+
        'or keyed object: ' + value
      );
    }
    return seq;
  }

  function indexedSeqFromValue(value) {
    var seq = maybeIndexedSeqFromValue(value);
    if (!seq) {
      throw new TypeError(
        'Expected Array or iterable object of values: ' + value
      );
    }
    return seq;
  }

  function seqFromValue(value) {
    var seq = maybeIndexedSeqFromValue(value) ||
      (typeof value === 'object' && new ObjectSeq(value));
    if (!seq) {
      throw new TypeError(
        'Expected Array or iterable object of values, or keyed object: ' + value
      );
    }
    return seq;
  }

  function maybeIndexedSeqFromValue(value) {
    return (
      isArrayLike(value) ? new ArraySeq(value) :
      isIterator(value) ? new IteratorSeq(value) :
      hasIterator(value) ? new IterableSeq(value) :
      undefined
    );
  }

  function seqIterate(seq, fn, reverse, useKeys) {
    var cache = seq._cache;
    if (cache) {
      var maxIndex = cache.length - 1;
      for (var ii = 0; ii <= maxIndex; ii++) {
        var entry = cache[reverse ? maxIndex - ii : ii];
        if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {
          return ii + 1;
        }
      }
      return ii;
    }
    return seq.__iterateUncached(fn, reverse);
  }

  function seqIterator(seq, type, reverse, useKeys) {
    var cache = seq._cache;
    if (cache) {
      var maxIndex = cache.length - 1;
      var ii = 0;
      return new Iterator(function()  {
        var entry = cache[reverse ? maxIndex - ii : ii];
        return ii++ > maxIndex ?
          iteratorDone() :
          iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);
      });
    }
    return seq.__iteratorUncached(type, reverse);
  }

  function fromJS(json, converter) {
    return converter ?
      fromJSWith(converter, json, '', {'': json}) :
      fromJSDefault(json);
  }

  function fromJSWith(converter, json, key, parentJSON) {
    if (Array.isArray(json)) {
      return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k)  {return fromJSWith(converter, v, k, json)}));
    }
    if (isPlainObj(json)) {
      return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k)  {return fromJSWith(converter, v, k, json)}));
    }
    return json;
  }

  function fromJSDefault(json) {
    if (Array.isArray(json)) {
      return IndexedSeq(json).map(fromJSDefault).toList();
    }
    if (isPlainObj(json)) {
      return KeyedSeq(json).map(fromJSDefault).toMap();
    }
    return json;
  }

  function isPlainObj(value) {
    return value && (value.constructor === Object || value.constructor === undefined);
  }

  /**
   * An extension of the "same-value" algorithm as [described for use by ES6 Map
   * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)
   *
   * NaN is considered the same as NaN, however -0 and 0 are considered the same
   * value, which is different from the algorithm described by
   * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
   *
   * This is extended further to allow Objects to describe the values they
   * represent, by way of `valueOf` or `equals` (and `hashCode`).
   *
   * Note: because of this extension, the key equality of Immutable.Map and the
   * value equality of Immutable.Set will differ from ES6 Map and Set.
   *
   * ### Defining custom values
   *
   * The easiest way to describe the value an object represents is by implementing
   * `valueOf`. For example, `Date` represents a value by returning a unix
   * timestamp for `valueOf`:
   *
   *     var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...
   *     var date2 = new Date(1234567890000);
   *     date1.valueOf(); // 1234567890000
   *     assert( date1 !== date2 );
   *     assert( Immutable.is( date1, date2 ) );
   *
   * Note: overriding `valueOf` may have other implications if you use this object
   * where JavaScript expects a primitive, such as implicit string coercion.
   *
   * For more complex types, especially collections, implementing `valueOf` may
   * not be performant. An alternative is to implement `equals` and `hashCode`.
   *
   * `equals` takes another object, presumably of similar type, and returns true
   * if the it is equal. Equality is symmetrical, so the same result should be
   * returned if this and the argument are flipped.
   *
   *     assert( a.equals(b) === b.equals(a) );
   *
   * `hashCode` returns a 32bit integer number representing the object which will
   * be used to determine how to store the value object in a Map or Set. You must
   * provide both or neither methods, one must not exist without the other.
   *
   * Also, an important relationship between these methods must be upheld: if two
   * values are equal, they *must* return the same hashCode. If the values are not
   * equal, they might have the same hashCode; this is called a hash collision,
   * and while undesirable for performance reasons, it is acceptable.
   *
   *     if (a.equals(b)) {
   *       assert( a.hashCode() === b.hashCode() );
   *     }
   *
   * All Immutable collections implement `equals` and `hashCode`.
   *
   */
  function is(valueA, valueB) {
    if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
      return true;
    }
    if (!valueA || !valueB) {
      return false;
    }
    if (typeof valueA.valueOf === 'function' &&
        typeof valueB.valueOf === 'function') {
      valueA = valueA.valueOf();
      valueB = valueB.valueOf();
      if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {
        return true;
      }
      if (!valueA || !valueB) {
        return false;
      }
    }
    if (typeof valueA.equals === 'function' &&
        typeof valueB.equals === 'function' &&
        valueA.equals(valueB)) {
      return true;
    }
    return false;
  }

  function deepEqual(a, b) {
    if (a === b) {
      return true;
    }

    if (
      !isIterable(b) ||
      a.size !== undefined && b.size !== undefined && a.size !== b.size ||
      a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash ||
      isKeyed(a) !== isKeyed(b) ||
      isIndexed(a) !== isIndexed(b) ||
      isOrdered(a) !== isOrdered(b)
    ) {
      return false;
    }

    if (a.size === 0 && b.size === 0) {
      return true;
    }

    var notAssociative = !isAssociative(a);

    if (isOrdered(a)) {
      var entries = a.entries();
      return b.every(function(v, k)  {
        var entry = entries.next().value;
        return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));
      }) && entries.next().done;
    }

    var flipped = false;

    if (a.size === undefined) {
      if (b.size === undefined) {
        if (typeof a.cacheResult === 'function') {
          a.cacheResult();
        }
      } else {
        flipped = true;
        var _ = a;
        a = b;
        b = _;
      }
    }

    var allEqual = true;
    var bSize = b.__iterate(function(v, k)  {
      if (notAssociative ? !a.has(v) :
          flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {
        allEqual = false;
        return false;
      }
    });

    return allEqual && a.size === bSize;
  }

  createClass(Repeat, IndexedSeq);

    function Repeat(value, times) {
      if (!(this instanceof Repeat)) {
        return new Repeat(value, times);
      }
      this._value = value;
      this.size = times === undefined ? Infinity : Math.max(0, times);
      if (this.size === 0) {
        if (EMPTY_REPEAT) {
          return EMPTY_REPEAT;
        }
        EMPTY_REPEAT = this;
      }
    }

    Repeat.prototype.toString = function() {
      if (this.size === 0) {
        return 'Repeat []';
      }
      return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';
    };

    Repeat.prototype.get = function(index, notSetValue) {
      return this.has(index) ? this._value : notSetValue;
    };

    Repeat.prototype.includes = function(searchValue) {
      return is(this._value, searchValue);
    };

    Repeat.prototype.slice = function(begin, end) {
      var size = this.size;
      return wholeSlice(begin, end, size) ? this :
        new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));
    };

    Repeat.prototype.reverse = function() {
      return this;
    };

    Repeat.prototype.indexOf = function(searchValue) {
      if (is(this._value, searchValue)) {
        return 0;
      }
      return -1;
    };

    Repeat.prototype.lastIndexOf = function(searchValue) {
      if (is(this._value, searchValue)) {
        return this.size;
      }
      return -1;
    };

    Repeat.prototype.__iterate = function(fn, reverse) {
      for (var ii = 0; ii < this.size; ii++) {
        if (fn(this._value, ii, this) === false) {
          return ii + 1;
        }
      }
      return ii;
    };

    Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this;
      var ii = 0;
      return new Iterator(function() 
        {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()}
      );
    };

    Repeat.prototype.equals = function(other) {
      return other instanceof Repeat ?
        is(this._value, other._value) :
        deepEqual(other);
    };


  var EMPTY_REPEAT;

  function invariant(condition, error) {
    if (!condition) throw new Error(error);
  }

  createClass(Range, IndexedSeq);

    function Range(start, end, step) {
      if (!(this instanceof Range)) {
        return new Range(start, end, step);
      }
      invariant(step !== 0, 'Cannot step a Range by 0');
      start = start || 0;
      if (end === undefined) {
        end = Infinity;
      }
      step = step === undefined ? 1 : Math.abs(step);
      if (end < start) {
        step = -step;
      }
      this._start = start;
      this._end = end;
      this._step = step;
      this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);
      if (this.size === 0) {
        if (EMPTY_RANGE) {
          return EMPTY_RANGE;
        }
        EMPTY_RANGE = this;
      }
    }

    Range.prototype.toString = function() {
      if (this.size === 0) {
        return 'Range []';
      }
      return 'Range [ ' +
        this._start + '...' + this._end +
        (this._step !== 1 ? ' by ' + this._step : '') +
      ' ]';
    };

    Range.prototype.get = function(index, notSetValue) {
      return this.has(index) ?
        this._start + wrapIndex(this, index) * this._step :
        notSetValue;
    };

    Range.prototype.includes = function(searchValue) {
      var possibleIndex = (searchValue - this._start) / this._step;
      return possibleIndex >= 0 &&
        possibleIndex < this.size &&
        possibleIndex === Math.floor(possibleIndex);
    };

    Range.prototype.slice = function(begin, end) {
      if (wholeSlice(begin, end, this.size)) {
        return this;
      }
      begin = resolveBegin(begin, this.size);
      end = resolveEnd(end, this.size);
      if (end <= begin) {
        return new Range(0, 0);
      }
      return new Range(this.get(begin, this._end), this.get(end, this._end), this._step);
    };

    Range.prototype.indexOf = function(searchValue) {
      var offsetValue = searchValue - this._start;
      if (offsetValue % this._step === 0) {
        var index = offsetValue / this._step;
        if (index >= 0 && index < this.size) {
          return index
        }
      }
      return -1;
    };

    Range.prototype.lastIndexOf = function(searchValue) {
      return this.indexOf(searchValue);
    };

    Range.prototype.__iterate = function(fn, reverse) {
      var maxIndex = this.size - 1;
      var step = this._step;
      var value = reverse ? this._start + maxIndex * step : this._start;
      for (var ii = 0; ii <= maxIndex; ii++) {
        if (fn(value, ii, this) === false) {
          return ii + 1;
        }
        value += reverse ? -step : step;
      }
      return ii;
    };

    Range.prototype.__iterator = function(type, reverse) {
      var maxIndex = this.size - 1;
      var step = this._step;
      var value = reverse ? this._start + maxIndex * step : this._start;
      var ii = 0;
      return new Iterator(function()  {
        var v = value;
        value += reverse ? -step : step;
        return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);
      });
    };

    Range.prototype.equals = function(other) {
      return other instanceof Range ?
        this._start === other._start &&
        this._end === other._end &&
        this._step === other._step :
        deepEqual(this, other);
    };


  var EMPTY_RANGE;

  createClass(Collection, Iterable);
    function Collection() {
      throw TypeError('Abstract');
    }


  createClass(KeyedCollection, Collection);function KeyedCollection() {}

  createClass(IndexedCollection, Collection);function IndexedCollection() {}

  createClass(SetCollection, Collection);function SetCollection() {}


  Collection.Keyed = KeyedCollection;
  Collection.Indexed = IndexedCollection;
  Collection.Set = SetCollection;

  var imul =
    typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ?
    Math.imul :
    function imul(a, b) {
      a = a | 0; // int
      b = b | 0; // int
      var c = a & 0xffff;
      var d = b & 0xffff;
      // Shift by 0 fixes the sign on the high part.
      return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int
    };

  // v8 has an optimization for storing 31-bit signed numbers.
  // Values which have either 00 or 11 as the high order bits qualify.
  // This function drops the highest order bit in a signed number, maintaining
  // the sign bit.
  function smi(i32) {
    return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);
  }

  function hash(o) {
    if (o === false || o === null || o === undefined) {
      return 0;
    }
    if (typeof o.valueOf === 'function') {
      o = o.valueOf();
      if (o === false || o === null || o === undefined) {
        return 0;
      }
    }
    if (o === true) {
      return 1;
    }
    var type = typeof o;
    if (type === 'number') {
      if (o !== o || o === Infinity) {
        return 0;
      }
      var h = o | 0;
      if (h !== o) {
        h ^= o * 0xFFFFFFFF;
      }
      while (o > 0xFFFFFFFF) {
        o /= 0xFFFFFFFF;
        h ^= o;
      }
      return smi(h);
    }
    if (type === 'string') {
      return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);
    }
    if (typeof o.hashCode === 'function') {
      return o.hashCode();
    }
    if (type === 'object') {
      return hashJSObj(o);
    }
    if (typeof o.toString === 'function') {
      return hashString(o.toString());
    }
    throw new Error('Value type ' + type + ' cannot be hashed.');
  }

  function cachedHashString(string) {
    var hash = stringHashCache[string];
    if (hash === undefined) {
      hash = hashString(string);
      if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {
        STRING_HASH_CACHE_SIZE = 0;
        stringHashCache = {};
      }
      STRING_HASH_CACHE_SIZE++;
      stringHashCache[string] = hash;
    }
    return hash;
  }

  // http://jsperf.com/hashing-strings
  function hashString(string) {
    // This is the hash from JVM
    // The hash code for a string is computed as
    // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],
    // where s[i] is the ith character of the string and n is the length of
    // the string. We "mod" the result to make it between 0 (inclusive) and 2^31
    // (exclusive) by dropping high bits.
    var hash = 0;
    for (var ii = 0; ii < string.length; ii++) {
      hash = 31 * hash + string.charCodeAt(ii) | 0;
    }
    return smi(hash);
  }

  function hashJSObj(obj) {
    var hash;
    if (usingWeakMap) {
      hash = weakMap.get(obj);
      if (hash !== undefined) {
        return hash;
      }
    }

    hash = obj[UID_HASH_KEY];
    if (hash !== undefined) {
      return hash;
    }

    if (!canDefineProperty) {
      hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];
      if (hash !== undefined) {
        return hash;
      }

      hash = getIENodeHash(obj);
      if (hash !== undefined) {
        return hash;
      }
    }

    hash = ++objHashUID;
    if (objHashUID & 0x40000000) {
      objHashUID = 0;
    }

    if (usingWeakMap) {
      weakMap.set(obj, hash);
    } else if (isExtensible !== undefined && isExtensible(obj) === false) {
      throw new Error('Non-extensible objects are not allowed as keys.');
    } else if (canDefineProperty) {
      Object.defineProperty(obj, UID_HASH_KEY, {
        'enumerable': false,
        'configurable': false,
        'writable': false,
        'value': hash
      });
    } else if (obj.propertyIsEnumerable !== undefined &&
               obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {
      // Since we can't define a non-enumerable property on the object
      // we'll hijack one of the less-used non-enumerable properties to
      // save our hash on it. Since this is a function it will not show up in
      // `JSON.stringify` which is what we want.
      obj.propertyIsEnumerable = function() {
        return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);
      };
      obj.propertyIsEnumerable[UID_HASH_KEY] = hash;
    } else if (obj.nodeType !== undefined) {
      // At this point we couldn't get the IE `uniqueID` to use as a hash
      // and we couldn't use a non-enumerable property to exploit the
      // dontEnum bug so we simply add the `UID_HASH_KEY` on the node
      // itself.
      obj[UID_HASH_KEY] = hash;
    } else {
      throw new Error('Unable to set a non-enumerable property on object.');
    }

    return hash;
  }

  // Get references to ES5 object methods.
  var isExtensible = Object.isExtensible;

  // True if Object.defineProperty works as expected. IE8 fails this test.
  var canDefineProperty = (function() {
    try {
      Object.defineProperty({}, '@', {});
      return true;
    } catch (e) {
      return false;
    }
  }());

  // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it
  // and avoid memory leaks from the IE cloneNode bug.
  function getIENodeHash(node) {
    if (node && node.nodeType > 0) {
      switch (node.nodeType) {
        case 1: // Element
          return node.uniqueID;
        case 9: // Document
          return node.documentElement && node.documentElement.uniqueID;
      }
    }
  }

  // If possible, use a WeakMap.
  var usingWeakMap = typeof WeakMap === 'function';
  var weakMap;
  if (usingWeakMap) {
    weakMap = new WeakMap();
  }

  var objHashUID = 0;

  var UID_HASH_KEY = '__immutablehash__';
  if (typeof Symbol === 'function') {
    UID_HASH_KEY = Symbol(UID_HASH_KEY);
  }

  var STRING_HASH_CACHE_MIN_STRLEN = 16;
  var STRING_HASH_CACHE_MAX_SIZE = 255;
  var STRING_HASH_CACHE_SIZE = 0;
  var stringHashCache = {};

  function assertNotInfinite(size) {
    invariant(
      size !== Infinity,
      'Cannot perform this action with an infinite size.'
    );
  }

  createClass(Map, KeyedCollection);

    // @pragma Construction

    function Map(value) {
      return value === null || value === undefined ? emptyMap() :
        isMap(value) && !isOrdered(value) ? value :
        emptyMap().withMutations(function(map ) {
          var iter = KeyedIterable(value);
          assertNotInfinite(iter.size);
          iter.forEach(function(v, k)  {return map.set(k, v)});
        });
    }

    Map.of = function() {var keyValues = SLICE$0.call(arguments, 0);
      return emptyMap().withMutations(function(map ) {
        for (var i = 0; i < keyValues.length; i += 2) {
          if (i + 1 >= keyValues.length) {
            throw new Error('Missing value for key: ' + keyValues[i]);
          }
          map.set(keyValues[i], keyValues[i + 1]);
        }
      });
    };

    Map.prototype.toString = function() {
      return this.__toString('Map {', '}');
    };

    // @pragma Access

    Map.prototype.get = function(k, notSetValue) {
      return this._root ?
        this._root.get(0, undefined, k, notSetValue) :
        notSetValue;
    };

    // @pragma Modification

    Map.prototype.set = function(k, v) {
      return updateMap(this, k, v);
    };

    Map.prototype.setIn = function(keyPath, v) {
      return this.updateIn(keyPath, NOT_SET, function()  {return v});
    };

    Map.prototype.remove = function(k) {
      return updateMap(this, k, NOT_SET);
    };

    Map.prototype.deleteIn = function(keyPath) {
      return this.updateIn(keyPath, function()  {return NOT_SET});
    };

    Map.prototype.update = function(k, notSetValue, updater) {
      return arguments.length === 1 ?
        k(this) :
        this.updateIn([k], notSetValue, updater);
    };

    Map.prototype.updateIn = function(keyPath, notSetValue, updater) {
      if (!updater) {
        updater = notSetValue;
        notSetValue = undefined;
      }
      var updatedValue = updateInDeepMap(
        this,
        forceIterator(keyPath),
        notSetValue,
        updater
      );
      return updatedValue === NOT_SET ? undefined : updatedValue;
    };

    Map.prototype.clear = function() {
      if (this.size === 0) {
        return this;
      }
      if (this.__ownerID) {
        this.size = 0;
        this._root = null;
        this.__hash = undefined;
        this.__altered = true;
        return this;
      }
      return emptyMap();
    };

    // @pragma Composition

    Map.prototype.merge = function(/*...iters*/) {
      return mergeIntoMapWith(this, undefined, arguments);
    };

    Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
      return mergeIntoMapWith(this, merger, iters);
    };

    Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);
      return this.updateIn(
        keyPath,
        emptyMap(),
        function(m ) {return typeof m.merge === 'function' ?
          m.merge.apply(m, iters) :
          iters[iters.length - 1]}
      );
    };

    Map.prototype.mergeDeep = function(/*...iters*/) {
      return mergeIntoMapWith(this, deepMerger, arguments);
    };

    Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
      return mergeIntoMapWith(this, deepMergerWith(merger), iters);
    };

    Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);
      return this.updateIn(
        keyPath,
        emptyMap(),
        function(m ) {return typeof m.mergeDeep === 'function' ?
          m.mergeDeep.apply(m, iters) :
          iters[iters.length - 1]}
      );
    };

    Map.prototype.sort = function(comparator) {
      // Late binding
      return OrderedMap(sortFactory(this, comparator));
    };

    Map.prototype.sortBy = function(mapper, comparator) {
      // Late binding
      return OrderedMap(sortFactory(this, comparator, mapper));
    };

    // @pragma Mutability

    Map.prototype.withMutations = function(fn) {
      var mutable = this.asMutable();
      fn(mutable);
      return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;
    };

    Map.prototype.asMutable = function() {
      return this.__ownerID ? this : this.__ensureOwner(new OwnerID());
    };

    Map.prototype.asImmutable = function() {
      return this.__ensureOwner();
    };

    Map.prototype.wasAltered = function() {
      return this.__altered;
    };

    Map.prototype.__iterator = function(type, reverse) {
      return new MapIterator(this, type, reverse);
    };

    Map.prototype.__iterate = function(fn, reverse) {var this$0 = this;
      var iterations = 0;
      this._root && this._root.iterate(function(entry ) {
        iterations++;
        return fn(entry[1], entry[0], this$0);
      }, reverse);
      return iterations;
    };

    Map.prototype.__ensureOwner = function(ownerID) {
      if (ownerID === this.__ownerID) {
        return this;
      }
      if (!ownerID) {
        this.__ownerID = ownerID;
        this.__altered = false;
        return this;
      }
      return makeMap(this.size, this._root, ownerID, this.__hash);
    };


  function isMap(maybeMap) {
    return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);
  }

  Map.isMap = isMap;

  var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';

  var MapPrototype = Map.prototype;
  MapPrototype[IS_MAP_SENTINEL] = true;
  MapPrototype[DELETE] = MapPrototype.remove;
  MapPrototype.removeIn = MapPrototype.deleteIn;


  // #pragma Trie Nodes



    function ArrayMapNode(ownerID, entries) {
      this.ownerID = ownerID;
      this.entries = entries;
    }

    ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
      var entries = this.entries;
      for (var ii = 0, len = entries.length; ii < len; ii++) {
        if (is(key, entries[ii][0])) {
          return entries[ii][1];
        }
      }
      return notSetValue;
    };

    ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
      var removed = value === NOT_SET;

      var entries = this.entries;
      var idx = 0;
      for (var len = entries.length; idx < len; idx++) {
        if (is(key, entries[idx][0])) {
          break;
        }
      }
      var exists = idx < len;

      if (exists ? entries[idx][1] === value : removed) {
        return this;
      }

      SetRef(didAlter);
      (removed || !exists) && SetRef(didChangeSize);

      if (removed && entries.length === 1) {
        return; // undefined
      }

      if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {
        return createNodes(ownerID, entries, key, value);
      }

      var isEditable = ownerID && ownerID === this.ownerID;
      var newEntries = isEditable ? entries : arrCopy(entries);

      if (exists) {
        if (removed) {
          idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());
        } else {
          newEntries[idx] = [key, value];
        }
      } else {
        newEntries.push([key, value]);
      }

      if (isEditable) {
        this.entries = newEntries;
        return this;
      }

      return new ArrayMapNode(ownerID, newEntries);
    };




    function BitmapIndexedNode(ownerID, bitmap, nodes) {
      this.ownerID = ownerID;
      this.bitmap = bitmap;
      this.nodes = nodes;
    }

    BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) {
      if (keyHash === undefined) {
        keyHash = hash(key);
      }
      var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK));
      var bitmap = this.bitmap;
      return (bitmap & bit) === 0 ? notSetValue :
        this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue);
    };

    BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
      if (keyHash === undefined) {
        keyHash = hash(key);
      }
      var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
      var bit = 1 << keyHashFrag;
      var bitmap = this.bitmap;
      var exists = (bitmap & bit) !== 0;

      if (!exists && value === NOT_SET) {
        return this;
      }

      var idx = popCount(bitmap & (bit - 1));
      var nodes = this.nodes;
      var node = exists ? nodes[idx] : undefined;
      var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);

      if (newNode === node) {
        return this;
      }

      if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {
        return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);
      }

      if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {
        return nodes[idx ^ 1];
      }

      if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {
        return newNode;
      }

      var isEditable = ownerID && ownerID === this.ownerID;
      var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;
      var newNodes = exists ? newNode ?
        setIn(nodes, idx, newNode, isEditable) :
        spliceOut(nodes, idx, isEditable) :
        spliceIn(nodes, idx, newNode, isEditable);

      if (isEditable) {
        this.bitmap = newBitmap;
        this.nodes = newNodes;
        return this;
      }

      return new BitmapIndexedNode(ownerID, newBitmap, newNodes);
    };




    function HashArrayMapNode(ownerID, count, nodes) {
      this.ownerID = ownerID;
      this.count = count;
      this.nodes = nodes;
    }

    HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {
      if (keyHash === undefined) {
        keyHash = hash(key);
      }
      var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
      var node = this.nodes[idx];
      return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;
    };

    HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
      if (keyHash === undefined) {
        keyHash = hash(key);
      }
      var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;
      var removed = value === NOT_SET;
      var nodes = this.nodes;
      var node = nodes[idx];

      if (removed && !node) {
        return this;
      }

      var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);
      if (newNode === node) {
        return this;
      }

      var newCount = this.count;
      if (!node) {
        newCount++;
      } else if (!newNode) {
        newCount--;
        if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {
          return packNodes(ownerID, nodes, newCount, idx);
        }
      }

      var isEditable = ownerID && ownerID === this.ownerID;
      var newNodes = setIn(nodes, idx, newNode, isEditable);

      if (isEditable) {
        this.count = newCount;
        this.nodes = newNodes;
        return this;
      }

      return new HashArrayMapNode(ownerID, newCount, newNodes);
    };




    function HashCollisionNode(ownerID, keyHash, entries) {
      this.ownerID = ownerID;
      this.keyHash = keyHash;
      this.entries = entries;
    }

    HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) {
      var entries = this.entries;
      for (var ii = 0, len = entries.length; ii < len; ii++) {
        if (is(key, entries[ii][0])) {
          return entries[ii][1];
        }
      }
      return notSetValue;
    };

    HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
      if (keyHash === undefined) {
        keyHash = hash(key);
      }

      var removed = value === NOT_SET;

      if (keyHash !== this.keyHash) {
        if (removed) {
          return this;
        }
        SetRef(didAlter);
        SetRef(didChangeSize);
        return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);
      }

      var entries = this.entries;
      var idx = 0;
      for (var len = entries.length; idx < len; idx++) {
        if (is(key, entries[idx][0])) {
          break;
        }
      }
      var exists = idx < len;

      if (exists ? entries[idx][1] === value : removed) {
        return this;
      }

      SetRef(didAlter);
      (removed || !exists) && SetRef(didChangeSize);

      if (removed && len === 2) {
        return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);
      }

      var isEditable = ownerID && ownerID === this.ownerID;
      var newEntries = isEditable ? entries : arrCopy(entries);

      if (exists) {
        if (removed) {
          idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());
        } else {
          newEntries[idx] = [key, value];
        }
      } else {
        newEntries.push([key, value]);
      }

      if (isEditable) {
        this.entries = newEntries;
        return this;
      }

      return new HashCollisionNode(ownerID, this.keyHash, newEntries);
    };




    function ValueNode(ownerID, keyHash, entry) {
      this.ownerID = ownerID;
      this.keyHash = keyHash;
      this.entry = entry;
    }

    ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) {
      return is(key, this.entry[0]) ? this.entry[1] : notSetValue;
    };

    ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
      var removed = value === NOT_SET;
      var keyMatch = is(key, this.entry[0]);
      if (keyMatch ? value === this.entry[1] : removed) {
        return this;
      }

      SetRef(didAlter);

      if (removed) {
        SetRef(didChangeSize);
        return; // undefined
      }

      if (keyMatch) {
        if (ownerID && ownerID === this.ownerID) {
          this.entry[1] = value;
          return this;
        }
        return new ValueNode(ownerID, this.keyHash, [key, value]);
      }

      SetRef(didChangeSize);
      return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);
    };



  // #pragma Iterators

  ArrayMapNode.prototype.iterate =
  HashCollisionNode.prototype.iterate = function (fn, reverse) {
    var entries = this.entries;
    for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {
      if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {
        return false;
      }
    }
  }

  BitmapIndexedNode.prototype.iterate =
  HashArrayMapNode.prototype.iterate = function (fn, reverse) {
    var nodes = this.nodes;
    for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
      var node = nodes[reverse ? maxIndex - ii : ii];
      if (node && node.iterate(fn, reverse) === false) {
        return false;
      }
    }
  }

  ValueNode.prototype.iterate = function (fn, reverse) {
    return fn(this.entry);
  }

  createClass(MapIterator, Iterator);

    function MapIterator(map, type, reverse) {
      this._type = type;
      this._reverse = reverse;
      this._stack = map._root && mapIteratorFrame(map._root);
    }

    MapIterator.prototype.next = function() {
      var type = this._type;
      var stack = this._stack;
      while (stack) {
        var node = stack.node;
        var index = stack.index++;
        var maxIndex;
        if (node.entry) {
          if (index === 0) {
            return mapIteratorValue(type, node.entry);
          }
        } else if (node.entries) {
          maxIndex = node.entries.length - 1;
          if (index <= maxIndex) {
            return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);
          }
        } else {
          maxIndex = node.nodes.length - 1;
          if (index <= maxIndex) {
            var subNode = node.nodes[this._reverse ? maxIndex - index : index];
            if (subNode) {
              if (subNode.entry) {
                return mapIteratorValue(type, subNode.entry);
              }
              stack = this._stack = mapIteratorFrame(subNode, stack);
            }
            continue;
          }
        }
        stack = this._stack = this._stack.__prev;
      }
      return iteratorDone();
    };


  function mapIteratorValue(type, entry) {
    return iteratorValue(type, entry[0], entry[1]);
  }

  function mapIteratorFrame(node, prev) {
    return {
      node: node,
      index: 0,
      __prev: prev
    };
  }

  function makeMap(size, root, ownerID, hash) {
    var map = Object.create(MapPrototype);
    map.size = size;
    map._root = root;
    map.__ownerID = ownerID;
    map.__hash = hash;
    map.__altered = false;
    return map;
  }

  var EMPTY_MAP;
  function emptyMap() {
    return EMPTY_MAP || (EMPTY_MAP = makeMap(0));
  }

  function updateMap(map, k, v) {
    var newRoot;
    var newSize;
    if (!map._root) {
      if (v === NOT_SET) {
        return map;
      }
      newSize = 1;
      newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);
    } else {
      var didChangeSize = MakeRef(CHANGE_LENGTH);
      var didAlter = MakeRef(DID_ALTER);
      newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);
      if (!didAlter.value) {
        return map;
      }
      newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);
    }
    if (map.__ownerID) {
      map.size = newSize;
      map._root = newRoot;
      map.__hash = undefined;
      map.__altered = true;
      return map;
    }
    return newRoot ? makeMap(newSize, newRoot) : emptyMap();
  }

  function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
    if (!node) {
      if (value === NOT_SET) {
        return node;
      }
      SetRef(didAlter);
      SetRef(didChangeSize);
      return new ValueNode(ownerID, keyHash, [key, value]);
    }
    return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);
  }

  function isLeafNode(node) {
    return node.constructor === ValueNode || node.constructor === HashCollisionNode;
  }

  function mergeIntoNode(node, ownerID, shift, keyHash, entry) {
    if (node.keyHash === keyHash) {
      return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);
    }

    var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;
    var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;

    var newNode;
    var nodes = idx1 === idx2 ?
      [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] :
      ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);

    return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);
  }

  function createNodes(ownerID, entries, key, value) {
    if (!ownerID) {
      ownerID = new OwnerID();
    }
    var node = new ValueNode(ownerID, hash(key), [key, value]);
    for (var ii = 0; ii < entries.length; ii++) {
      var entry = entries[ii];
      node = node.update(ownerID, 0, undefined, entry[0], entry[1]);
    }
    return node;
  }

  function packNodes(ownerID, nodes, count, excluding) {
    var bitmap = 0;
    var packedII = 0;
    var packedNodes = new Array(count);
    for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {
      var node = nodes[ii];
      if (node !== undefined && ii !== excluding) {
        bitmap |= bit;
        packedNodes[packedII++] = node;
      }
    }
    return new BitmapIndexedNode(ownerID, bitmap, packedNodes);
  }

  function expandNodes(ownerID, nodes, bitmap, including, node) {
    var count = 0;
    var expandedNodes = new Array(SIZE);
    for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {
      expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;
    }
    expandedNodes[including] = node;
    return new HashArrayMapNode(ownerID, count + 1, expandedNodes);
  }

  function mergeIntoMapWith(map, merger, iterables) {
    var iters = [];
    for (var ii = 0; ii < iterables.length; ii++) {
      var value = iterables[ii];
      var iter = KeyedIterable(value);
      if (!isIterable(value)) {
        iter = iter.map(function(v ) {return fromJS(v)});
      }
      iters.push(iter);
    }
    return mergeIntoCollectionWith(map, merger, iters);
  }

  function deepMerger(existing, value, key) {
    return existing && existing.mergeDeep && isIterable(value) ?
      existing.mergeDeep(value) :
      is(existing, value) ? existing : value;
  }

  function deepMergerWith(merger) {
    return function(existing, value, key)  {
      if (existing && existing.mergeDeepWith && isIterable(value)) {
        return existing.mergeDeepWith(merger, value);
      }
      var nextValue = merger(existing, value, key);
      return is(existing, nextValue) ? existing : nextValue;
    };
  }

  function mergeIntoCollectionWith(collection, merger, iters) {
    iters = iters.filter(function(x ) {return x.size !== 0});
    if (iters.length === 0) {
      return collection;
    }
    if (collection.size === 0 && !collection.__ownerID && iters.length === 1) {
      return collection.constructor(iters[0]);
    }
    return collection.withMutations(function(collection ) {
      var mergeIntoMap = merger ?
        function(value, key)  {
          collection.update(key, NOT_SET, function(existing )
            {return existing === NOT_SET ? value : merger(existing, value, key)}
          );
        } :
        function(value, key)  {
          collection.set(key, value);
        }
      for (var ii = 0; ii < iters.length; ii++) {
        iters[ii].forEach(mergeIntoMap);
      }
    });
  }

  function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {
    var isNotSet = existing === NOT_SET;
    var step = keyPathIter.next();
    if (step.done) {
      var existingValue = isNotSet ? notSetValue : existing;
      var newValue = updater(existingValue);
      return newValue === existingValue ? existing : newValue;
    }
    invariant(
      isNotSet || (existing && existing.set),
      'invalid keyPath'
    );
    var key = step.value;
    var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);
    var nextUpdated = updateInDeepMap(
      nextExisting,
      keyPathIter,
      notSetValue,
      updater
    );
    return nextUpdated === nextExisting ? existing :
      nextUpdated === NOT_SET ? existing.remove(key) :
      (isNotSet ? emptyMap() : existing).set(key, nextUpdated);
  }

  function popCount(x) {
    x = x - ((x >> 1) & 0x55555555);
    x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
    x = (x + (x >> 4)) & 0x0f0f0f0f;
    x = x + (x >> 8);
    x = x + (x >> 16);
    return x & 0x7f;
  }

  function setIn(array, idx, val, canEdit) {
    var newArray = canEdit ? array : arrCopy(array);
    newArray[idx] = val;
    return newArray;
  }

  function spliceIn(array, idx, val, canEdit) {
    var newLen = array.length + 1;
    if (canEdit && idx + 1 === newLen) {
      array[idx] = val;
      return array;
    }
    var newArray = new Array(newLen);
    var after = 0;
    for (var ii = 0; ii < newLen; ii++) {
      if (ii === idx) {
        newArray[ii] = val;
        after = -1;
      } else {
        newArray[ii] = array[ii + after];
      }
    }
    return newArray;
  }

  function spliceOut(array, idx, canEdit) {
    var newLen = array.length - 1;
    if (canEdit && idx === newLen) {
      array.pop();
      return array;
    }
    var newArray = new Array(newLen);
    var after = 0;
    for (var ii = 0; ii < newLen; ii++) {
      if (ii === idx) {
        after = 1;
      }
      newArray[ii] = array[ii + after];
    }
    return newArray;
  }

  var MAX_ARRAY_MAP_SIZE = SIZE / 4;
  var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;
  var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;

  createClass(List, IndexedCollection);

    // @pragma Construction

    function List(value) {
      var empty = emptyList();
      if (value === null || value === undefined) {
        return empty;
      }
      if (isList(value)) {
        return value;
      }
      var iter = IndexedIterable(value);
      var size = iter.size;
      if (size === 0) {
        return empty;
      }
      assertNotInfinite(size);
      if (size > 0 && size < SIZE) {
        return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
      }
      return empty.withMutations(function(list ) {
        list.setSize(size);
        iter.forEach(function(v, i)  {return list.set(i, v)});
      });
    }

    List.of = function(/*...values*/) {
      return this(arguments);
    };

    List.prototype.toString = function() {
      return this.__toString('List [', ']');
    };

    // @pragma Access

    List.prototype.get = function(index, notSetValue) {
      index = wrapIndex(this, index);
      if (index >= 0 && index < this.size) {
        index += this._origin;
        var node = listNodeFor(this, index);
        return node && node.array[index & MASK];
      }
      return notSetValue;
    };

    // @pragma Modification

    List.prototype.set = function(index, value) {
      return updateList(this, index, value);
    };

    List.prototype.remove = function(index) {
      return !this.has(index) ? this :
        index === 0 ? this.shift() :
        index === this.size - 1 ? this.pop() :
        this.splice(index, 1);
    };

    List.prototype.insert = function(index, value) {
      return this.splice(index, 0, value);
    };

    List.prototype.clear = function() {
      if (this.size === 0) {
        return this;
      }
      if (this.__ownerID) {
        this.size = this._origin = this._capacity = 0;
        this._level = SHIFT;
        this._root = this._tail = null;
        this.__hash = undefined;
        this.__altered = true;
        return this;
      }
      return emptyList();
    };

    List.prototype.push = function(/*...values*/) {
      var values = arguments;
      var oldSize = this.size;
      return this.withMutations(function(list ) {
        setListBounds(list, 0, oldSize + values.length);
        for (var ii = 0; ii < values.length; ii++) {
          list.set(oldSize + ii, values[ii]);
        }
      });
    };

    List.prototype.pop = function() {
      return setListBounds(this, 0, -1);
    };

    List.prototype.unshift = function(/*...values*/) {
      var values = arguments;
      return this.withMutations(function(list ) {
        setListBounds(list, -values.length);
        for (var ii = 0; ii < values.length; ii++) {
          list.set(ii, values[ii]);
        }
      });
    };

    List.prototype.shift = function() {
      return setListBounds(this, 1);
    };

    // @pragma Composition

    List.prototype.merge = function(/*...iters*/) {
      return mergeIntoListWith(this, undefined, arguments);
    };

    List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
      return mergeIntoListWith(this, merger, iters);
    };

    List.prototype.mergeDeep = function(/*...iters*/) {
      return mergeIntoListWith(this, deepMerger, arguments);
    };

    List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
      return mergeIntoListWith(this, deepMergerWith(merger), iters);
    };

    List.prototype.setSize = function(size) {
      return setListBounds(this, 0, size);
    };

    // @pragma Iteration

    List.prototype.slice = function(begin, end) {
      var size = this.size;
      if (wholeSlice(begin, end, size)) {
        return this;
      }
      return setListBounds(
        this,
        resolveBegin(begin, size),
        resolveEnd(end, size)
      );
    };

    List.prototype.__iterator = function(type, reverse) {
      var index = 0;
      var values = iterateList(this, reverse);
      return new Iterator(function()  {
        var value = values();
        return value === DONE ?
          iteratorDone() :
          iteratorValue(type, index++, value);
      });
    };

    List.prototype.__iterate = function(fn, reverse) {
      var index = 0;
      var values = iterateList(this, reverse);
      var value;
      while ((value = values()) !== DONE) {
        if (fn(value, index++, this) === false) {
          break;
        }
      }
      return index;
    };

    List.prototype.__ensureOwner = function(ownerID) {
      if (ownerID === this.__ownerID) {
        return this;
      }
      if (!ownerID) {
        this.__ownerID = ownerID;
        return this;
      }
      return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);
    };


  function isList(maybeList) {
    return !!(maybeList && maybeList[IS_LIST_SENTINEL]);
  }

  List.isList = isList;

  var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';

  var ListPrototype = List.prototype;
  ListPrototype[IS_LIST_SENTINEL] = true;
  ListPrototype[DELETE] = ListPrototype.remove;
  ListPrototype.setIn = MapPrototype.setIn;
  ListPrototype.deleteIn =
  ListPrototype.removeIn = MapPrototype.removeIn;
  ListPrototype.update = MapPrototype.update;
  ListPrototype.updateIn = MapPrototype.updateIn;
  ListPrototype.mergeIn = MapPrototype.mergeIn;
  ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
  ListPrototype.withMutations = MapPrototype.withMutations;
  ListPrototype.asMutable = MapPrototype.asMutable;
  ListPrototype.asImmutable = MapPrototype.asImmutable;
  ListPrototype.wasAltered = MapPrototype.wasAltered;



    function VNode(array, ownerID) {
      this.array = array;
      this.ownerID = ownerID;
    }

    // TODO: seems like these methods are very similar

    VNode.prototype.removeBefore = function(ownerID, level, index) {
      if (index === level ? 1 << level :  false || this.array.length === 0) {
        return this;
      }
      var originIndex = (index >>> level) & MASK;
      if (originIndex >= this.array.length) {
        return new VNode([], ownerID);
      }
      var removingFirst = originIndex === 0;
      var newChild;
      if (level > 0) {
        var oldChild = this.array[originIndex];
        newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);
        if (newChild === oldChild && removingFirst) {
          return this;
        }
      }
      if (removingFirst && !newChild) {
        return this;
      }
      var editable = editableVNode(this, ownerID);
      if (!removingFirst) {
        for (var ii = 0; ii < originIndex; ii++) {
          editable.array[ii] = undefined;
        }
      }
      if (newChild) {
        editable.array[originIndex] = newChild;
      }
      return editable;
    };

    VNode.prototype.removeAfter = function(ownerID, level, index) {
      if (index === (level ? 1 << level : 0) || this.array.length === 0) {
        return this;
      }
      var sizeIndex = ((index - 1) >>> level) & MASK;
      if (sizeIndex >= this.array.length) {
        return this;
      }

      var newChild;
      if (level > 0) {
        var oldChild = this.array[sizeIndex];
        newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);
        if (newChild === oldChild && sizeIndex === this.array.length - 1) {
          return this;
        }
      }

      var editable = editableVNode(this, ownerID);
      editable.array.splice(sizeIndex + 1);
      if (newChild) {
        editable.array[sizeIndex] = newChild;
      }
      return editable;
    };



  var DONE = {};

  function iterateList(list, reverse) {
    var left = list._origin;
    var right = list._capacity;
    var tailPos = getTailOffset(right);
    var tail = list._tail;

    return iterateNodeOrLeaf(list._root, list._level, 0);

    function iterateNodeOrLeaf(node, level, offset) {
      return level === 0 ?
        iterateLeaf(node, offset) :
        iterateNode(node, level, offset);
    }

    function iterateLeaf(node, offset) {
      var array = offset === tailPos ? tail && tail.array : node && node.array;
      var from = offset > left ? 0 : left - offset;
      var to = right - offset;
      if (to > SIZE) {
        to = SIZE;
      }
      return function()  {
        if (from === to) {
          return DONE;
        }
        var idx = reverse ? --to : from++;
        return array && array[idx];
      };
    }

    function iterateNode(node, level, offset) {
      var values;
      var array = node && node.array;
      var from = offset > left ? 0 : (left - offset) >> level;
      var to = ((right - offset) >> level) + 1;
      if (to > SIZE) {
        to = SIZE;
      }
      return function()  {
        do {
          if (values) {
            var value = values();
            if (value !== DONE) {
              return value;
            }
            values = null;
          }
          if (from === to) {
            return DONE;
          }
          var idx = reverse ? --to : from++;
          values = iterateNodeOrLeaf(
            array && array[idx], level - SHIFT, offset + (idx << level)
          );
        } while (true);
      };
    }
  }

  function makeList(origin, capacity, level, root, tail, ownerID, hash) {
    var list = Object.create(ListPrototype);
    list.size = capacity - origin;
    list._origin = origin;
    list._capacity = capacity;
    list._level = level;
    list._root = root;
    list._tail = tail;
    list.__ownerID = ownerID;
    list.__hash = hash;
    list.__altered = false;
    return list;
  }

  var EMPTY_LIST;
  function emptyList() {
    return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
  }

  function updateList(list, index, value) {
    index = wrapIndex(list, index);

    if (index !== index) {
      return list;
    }

    if (index >= list.size || index < 0) {
      return list.withMutations(function(list ) {
        index < 0 ?
          setListBounds(list, index).set(0, value) :
          setListBounds(list, 0, index + 1).set(index, value)
      });
    }

    index += list._origin;

    var newTail = list._tail;
    var newRoot = list._root;
    var didAlter = MakeRef(DID_ALTER);
    if (index >= getTailOffset(list._capacity)) {
      newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);
    } else {
      newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);
    }

    if (!didAlter.value) {
      return list;
    }

    if (list.__ownerID) {
      list._root = newRoot;
      list._tail = newTail;
      list.__hash = undefined;
      list.__altered = true;
      return list;
    }
    return makeList(list._origin, list._capacity, list._level, newRoot, newTail);
  }

  function updateVNode(node, ownerID, level, index, value, didAlter) {
    var idx = (index >>> level) & MASK;
    var nodeHas = node && idx < node.array.length;
    if (!nodeHas && value === undefined) {
      return node;
    }

    var newNode;

    if (level > 0) {
      var lowerNode = node && node.array[idx];
      var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);
      if (newLowerNode === lowerNode) {
        return node;
      }
      newNode = editableVNode(node, ownerID);
      newNode.array[idx] = newLowerNode;
      return newNode;
    }

    if (nodeHas && node.array[idx] === value) {
      return node;
    }

    SetRef(didAlter);

    newNode = editableVNode(node, ownerID);
    if (value === undefined && idx === newNode.array.length - 1) {
      newNode.array.pop();
    } else {
      newNode.array[idx] = value;
    }
    return newNode;
  }

  function editableVNode(node, ownerID) {
    if (ownerID && node && ownerID === node.ownerID) {
      return node;
    }
    return new VNode(node ? node.array.slice() : [], ownerID);
  }

  function listNodeFor(list, rawIndex) {
    if (rawIndex >= getTailOffset(list._capacity)) {
      return list._tail;
    }
    if (rawIndex < 1 << (list._level + SHIFT)) {
      var node = list._root;
      var level = list._level;
      while (node && level > 0) {
        node = node.array[(rawIndex >>> level) & MASK];
        level -= SHIFT;
      }
      return node;
    }
  }

  function setListBounds(list, begin, end) {
    // Sanitize begin & end using this shorthand for ToInt32(argument)
    // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
    if (begin !== undefined) {
      begin = begin | 0;
    }
    if (end !== undefined) {
      end = end | 0;
    }
    var owner = list.__ownerID || new OwnerID();
    var oldOrigin = list._origin;
    var oldCapacity = list._capacity;
    var newOrigin = oldOrigin + begin;
    var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;
    if (newOrigin === oldOrigin && newCapacity === oldCapacity) {
      return list;
    }

    // If it's going to end after it starts, it's empty.
    if (newOrigin >= newCapacity) {
      return list.clear();
    }

    var newLevel = list._level;
    var newRoot = list._root;

    // New origin might need creating a higher root.
    var offsetShift = 0;
    while (newOrigin + offsetShift < 0) {
      newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);
      newLevel += SHIFT;
      offsetShift += 1 << newLevel;
    }
    if (offsetShift) {
      newOrigin += offsetShift;
      oldOrigin += offsetShift;
      newCapacity += offsetShift;
      oldCapacity += offsetShift;
    }

    var oldTailOffset = getTailOffset(oldCapacity);
    var newTailOffset = getTailOffset(newCapacity);

    // New size might need creating a higher root.
    while (newTailOffset >= 1 << (newLevel + SHIFT)) {
      newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);
      newLevel += SHIFT;
    }

    // Locate or create the new tail.
    var oldTail = list._tail;
    var newTail = newTailOffset < oldTailOffset ?
      listNodeFor(list, newCapacity - 1) :
      newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;

    // Merge Tail into tree.
    if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {
      newRoot = editableVNode(newRoot, owner);
      var node = newRoot;
      for (var level = newLevel; level > SHIFT; level -= SHIFT) {
        var idx = (oldTailOffset >>> level) & MASK;
        node = node.array[idx] = editableVNode(node.array[idx], owner);
      }
      node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;
    }

    // If the size has been reduced, there's a chance the tail needs to be trimmed.
    if (newCapacity < oldCapacity) {
      newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);
    }

    // If the new origin is within the tail, then we do not need a root.
    if (newOrigin >= newTailOffset) {
      newOrigin -= newTailOffset;
      newCapacity -= newTailOffset;
      newLevel = SHIFT;
      newRoot = null;
      newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);

    // Otherwise, if the root has been trimmed, garbage collect.
    } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {
      offsetShift = 0;

      // Identify the new top root node of the subtree of the old root.
      while (newRoot) {
        var beginIndex = (newOrigin >>> newLevel) & MASK;
        if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {
          break;
        }
        if (beginIndex) {
          offsetShift += (1 << newLevel) * beginIndex;
        }
        newLevel -= SHIFT;
        newRoot = newRoot.array[beginIndex];
      }

      // Trim the new sides of the new root.
      if (newRoot && newOrigin > oldOrigin) {
        newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);
      }
      if (newRoot && newTailOffset < oldTailOffset) {
        newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);
      }
      if (offsetShift) {
        newOrigin -= offsetShift;
        newCapacity -= offsetShift;
      }
    }

    if (list.__ownerID) {
      list.size = newCapacity - newOrigin;
      list._origin = newOrigin;
      list._capacity = newCapacity;
      list._level = newLevel;
      list._root = newRoot;
      list._tail = newTail;
      list.__hash = undefined;
      list.__altered = true;
      return list;
    }
    return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);
  }

  function mergeIntoListWith(list, merger, iterables) {
    var iters = [];
    var maxSize = 0;
    for (var ii = 0; ii < iterables.length; ii++) {
      var value = iterables[ii];
      var iter = IndexedIterable(value);
      if (iter.size > maxSize) {
        maxSize = iter.size;
      }
      if (!isIterable(value)) {
        iter = iter.map(function(v ) {return fromJS(v)});
      }
      iters.push(iter);
    }
    if (maxSize > list.size) {
      list = list.setSize(maxSize);
    }
    return mergeIntoCollectionWith(list, merger, iters);
  }

  function getTailOffset(size) {
    return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);
  }

  createClass(OrderedMap, Map);

    // @pragma Construction

    function OrderedMap(value) {
      return value === null || value === undefined ? emptyOrderedMap() :
        isOrderedMap(value) ? value :
        emptyOrderedMap().withMutations(function(map ) {
          var iter = KeyedIterable(value);
          assertNotInfinite(iter.size);
          iter.forEach(function(v, k)  {return map.set(k, v)});
        });
    }

    OrderedMap.of = function(/*...values*/) {
      return this(arguments);
    };

    OrderedMap.prototype.toString = function() {
      return this.__toString('OrderedMap {', '}');
    };

    // @pragma Access

    OrderedMap.prototype.get = function(k, notSetValue) {
      var index = this._map.get(k);
      return index !== undefined ? this._list.get(index)[1] : notSetValue;
    };

    // @pragma Modification

    OrderedMap.prototype.clear = function() {
      if (this.size === 0) {
        return this;
      }
      if (this.__ownerID) {
        this.size = 0;
        this._map.clear();
        this._list.clear();
        return this;
      }
      return emptyOrderedMap();
    };

    OrderedMap.prototype.set = function(k, v) {
      return updateOrderedMap(this, k, v);
    };

    OrderedMap.prototype.remove = function(k) {
      return updateOrderedMap(this, k, NOT_SET);
    };

    OrderedMap.prototype.wasAltered = function() {
      return this._map.wasAltered() || this._list.wasAltered();
    };

    OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this;
      return this._list.__iterate(
        function(entry ) {return entry && fn(entry[1], entry[0], this$0)},
        reverse
      );
    };

    OrderedMap.prototype.__iterator = function(type, reverse) {
      return this._list.fromEntrySeq().__iterator(type, reverse);
    };

    OrderedMap.prototype.__ensureOwner = function(ownerID) {
      if (ownerID === this.__ownerID) {
        return this;
      }
      var newMap = this._map.__ensureOwner(ownerID);
      var newList = this._list.__ensureOwner(ownerID);
      if (!ownerID) {
        this.__ownerID = ownerID;
        this._map = newMap;
        this._list = newList;
        return this;
      }
      return makeOrderedMap(newMap, newList, ownerID, this.__hash);
    };


  function isOrderedMap(maybeOrderedMap) {
    return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);
  }

  OrderedMap.isOrderedMap = isOrderedMap;

  OrderedMap.prototype[IS_ORDERED_SENTINEL] = true;
  OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;



  function makeOrderedMap(map, list, ownerID, hash) {
    var omap = Object.create(OrderedMap.prototype);
    omap.size = map ? map.size : 0;
    omap._map = map;
    omap._list = list;
    omap.__ownerID = ownerID;
    omap.__hash = hash;
    return omap;
  }

  var EMPTY_ORDERED_MAP;
  function emptyOrderedMap() {
    return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));
  }

  function updateOrderedMap(omap, k, v) {
    var map = omap._map;
    var list = omap._list;
    var i = map.get(k);
    var has = i !== undefined;
    var newMap;
    var newList;
    if (v === NOT_SET) { // removed
      if (!has) {
        return omap;
      }
      if (list.size >= SIZE && list.size >= map.size * 2) {
        newList = list.filter(function(entry, idx)  {return entry !== undefined && i !== idx});
        newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap();
        if (omap.__ownerID) {
          newMap.__ownerID = newList.__ownerID = omap.__ownerID;
        }
      } else {
        newMap = map.remove(k);
        newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);
      }
    } else {
      if (has) {
        if (v === list.get(i)[1]) {
          return omap;
        }
        newMap = map;
        newList = list.set(i, [k, v]);
      } else {
        newMap = map.set(k, list.size);
        newList = list.set(list.size, [k, v]);
      }
    }
    if (omap.__ownerID) {
      omap.size = newMap.size;
      omap._map = newMap;
      omap._list = newList;
      omap.__hash = undefined;
      return omap;
    }
    return makeOrderedMap(newMap, newList);
  }

  createClass(ToKeyedSequence, KeyedSeq);
    function ToKeyedSequence(indexed, useKeys) {
      this._iter = indexed;
      this._useKeys = useKeys;
      this.size = indexed.size;
    }

    ToKeyedSequence.prototype.get = function(key, notSetValue) {
      return this._iter.get(key, notSetValue);
    };

    ToKeyedSequence.prototype.has = function(key) {
      return this._iter.has(key);
    };

    ToKeyedSequence.prototype.valueSeq = function() {
      return this._iter.valueSeq();
    };

    ToKeyedSequence.prototype.reverse = function() {var this$0 = this;
      var reversedSequence = reverseFactory(this, true);
      if (!this._useKeys) {
        reversedSequence.valueSeq = function()  {return this$0._iter.toSeq().reverse()};
      }
      return reversedSequence;
    };

    ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this;
      var mappedSequence = mapFactory(this, mapper, context);
      if (!this._useKeys) {
        mappedSequence.valueSeq = function()  {return this$0._iter.toSeq().map(mapper, context)};
      }
      return mappedSequence;
    };

    ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
      var ii;
      return this._iter.__iterate(
        this._useKeys ?
          function(v, k)  {return fn(v, k, this$0)} :
          ((ii = reverse ? resolveSize(this) : 0),
            function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}),
        reverse
      );
    };

    ToKeyedSequence.prototype.__iterator = function(type, reverse) {
      if (this._useKeys) {
        return this._iter.__iterator(type, reverse);
      }
      var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
      var ii = reverse ? resolveSize(this) : 0;
      return new Iterator(function()  {
        var step = iterator.next();
        return step.done ? step :
          iteratorValue(type, reverse ? --ii : ii++, step.value, step);
      });
    };

  ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;


  createClass(ToIndexedSequence, IndexedSeq);
    function ToIndexedSequence(iter) {
      this._iter = iter;
      this.size = iter.size;
    }

    ToIndexedSequence.prototype.includes = function(value) {
      return this._iter.includes(value);
    };

    ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
      var iterations = 0;
      return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse);
    };

    ToIndexedSequence.prototype.__iterator = function(type, reverse) {
      var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
      var iterations = 0;
      return new Iterator(function()  {
        var step = iterator.next();
        return step.done ? step :
          iteratorValue(type, iterations++, step.value, step)
      });
    };



  createClass(ToSetSequence, SetSeq);
    function ToSetSequence(iter) {
      this._iter = iter;
      this.size = iter.size;
    }

    ToSetSequence.prototype.has = function(key) {
      return this._iter.includes(key);
    };

    ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
      return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse);
    };

    ToSetSequence.prototype.__iterator = function(type, reverse) {
      var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
      return new Iterator(function()  {
        var step = iterator.next();
        return step.done ? step :
          iteratorValue(type, step.value, step.value, step);
      });
    };



  createClass(FromEntriesSequence, KeyedSeq);
    function FromEntriesSequence(entries) {
      this._iter = entries;
      this.size = entries.size;
    }

    FromEntriesSequence.prototype.entrySeq = function() {
      return this._iter.toSeq();
    };

    FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;
      return this._iter.__iterate(function(entry ) {
        // Check if entry exists first so array access doesn't throw for holes
        // in the parent iteration.
        if (entry) {
          validateEntry(entry);
          var indexedIterable = isIterable(entry);
          return fn(
            indexedIterable ? entry.get(1) : entry[1],
            indexedIterable ? entry.get(0) : entry[0],
            this$0
          );
        }
      }, reverse);
    };

    FromEntriesSequence.prototype.__iterator = function(type, reverse) {
      var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
      return new Iterator(function()  {
        while (true) {
          var step = iterator.next();
          if (step.done) {
            return step;
          }
          var entry = step.value;
          // Check if entry exists first so array access doesn't throw for holes
          // in the parent iteration.
          if (entry) {
            validateEntry(entry);
            var indexedIterable = isIterable(entry);
            return iteratorValue(
              type,
              indexedIterable ? entry.get(0) : entry[0],
              indexedIterable ? entry.get(1) : entry[1],
              step
            );
          }
        }
      });
    };


  ToIndexedSequence.prototype.cacheResult =
  ToKeyedSequence.prototype.cacheResult =
  ToSetSequence.prototype.cacheResult =
  FromEntriesSequence.prototype.cacheResult =
    cacheResultThrough;


  function flipFactory(iterable) {
    var flipSequence = makeSequence(iterable);
    flipSequence._iter = iterable;
    flipSequence.size = iterable.size;
    flipSequence.flip = function()  {return iterable};
    flipSequence.reverse = function () {
      var reversedSequence = iterable.reverse.apply(this); // super.reverse()
      reversedSequence.flip = function()  {return iterable.reverse()};
      return reversedSequence;
    };
    flipSequence.has = function(key ) {return iterable.includes(key)};
    flipSequence.includes = function(key ) {return iterable.has(key)};
    flipSequence.cacheResult = cacheResultThrough;
    flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
      return iterable.__iterate(function(v, k)  {return fn(k, v, this$0) !== false}, reverse);
    }
    flipSequence.__iteratorUncached = function(type, reverse) {
      if (type === ITERATE_ENTRIES) {
        var iterator = iterable.__iterator(type, reverse);
        return new Iterator(function()  {
          var step = iterator.next();
          if (!step.done) {
            var k = step.value[0];
            step.value[0] = step.value[1];
            step.value[1] = k;
          }
          return step;
        });
      }
      return iterable.__iterator(
        type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES,
        reverse
      );
    }
    return flipSequence;
  }


  function mapFactory(iterable, mapper, context) {
    var mappedSequence = makeSequence(iterable);
    mappedSequence.size = iterable.size;
    mappedSequence.has = function(key ) {return iterable.has(key)};
    mappedSequence.get = function(key, notSetValue)  {
      var v = iterable.get(key, NOT_SET);
      return v === NOT_SET ?
        notSetValue :
        mapper.call(context, v, key, iterable);
    };
    mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
      return iterable.__iterate(
        function(v, k, c)  {return fn(mapper.call(context, v, k, c), k, this$0) !== false},
        reverse
      );
    }
    mappedSequence.__iteratorUncached = function (type, reverse) {
      var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
      return new Iterator(function()  {
        var step = iterator.next();
        if (step.done) {
          return step;
        }
        var entry = step.value;
        var key = entry[0];
        return iteratorValue(
          type,
          key,
          mapper.call(context, entry[1], key, iterable),
          step
        );
      });
    }
    return mappedSequence;
  }


  function reverseFactory(iterable, useKeys) {
    var reversedSequence = makeSequence(iterable);
    reversedSequence._iter = iterable;
    reversedSequence.size = iterable.size;
    reversedSequence.reverse = function()  {return iterable};
    if (iterable.flip) {
      reversedSequence.flip = function () {
        var flipSequence = flipFactory(iterable);
        flipSequence.reverse = function()  {return iterable.flip()};
        return flipSequence;
      };
    }
    reversedSequence.get = function(key, notSetValue) 
      {return iterable.get(useKeys ? key : -1 - key, notSetValue)};
    reversedSequence.has = function(key )
      {return iterable.has(useKeys ? key : -1 - key)};
    reversedSequence.includes = function(value ) {return iterable.includes(value)};
    reversedSequence.cacheResult = cacheResultThrough;
    reversedSequence.__iterate = function (fn, reverse) {var this$0 = this;
      return iterable.__iterate(function(v, k)  {return fn(v, k, this$0)}, !reverse);
    };
    reversedSequence.__iterator =
      function(type, reverse)  {return iterable.__iterator(type, !reverse)};
    return reversedSequence;
  }


  function filterFactory(iterable, predicate, context, useKeys) {
    var filterSequence = makeSequence(iterable);
    if (useKeys) {
      filterSequence.has = function(key ) {
        var v = iterable.get(key, NOT_SET);
        return v !== NOT_SET && !!predicate.call(context, v, key, iterable);
      };
      filterSequence.get = function(key, notSetValue)  {
        var v = iterable.get(key, NOT_SET);
        return v !== NOT_SET && predicate.call(context, v, key, iterable) ?
          v : notSetValue;
      };
    }
    filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
      var iterations = 0;
      iterable.__iterate(function(v, k, c)  {
        if (predicate.call(context, v, k, c)) {
          iterations++;
          return fn(v, useKeys ? k : iterations - 1, this$0);
        }
      }, reverse);
      return iterations;
    };
    filterSequence.__iteratorUncached = function (type, reverse) {
      var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
      var iterations = 0;
      return new Iterator(function()  {
        while (true) {
          var step = iterator.next();
          if (step.done) {
            return step;
          }
          var entry = step.value;
          var key = entry[0];
          var value = entry[1];
          if (predicate.call(context, value, key, iterable)) {
            return iteratorValue(type, useKeys ? key : iterations++, value, step);
          }
        }
      });
    }
    return filterSequence;
  }


  function countByFactory(iterable, grouper, context) {
    var groups = Map().asMutable();
    iterable.__iterate(function(v, k)  {
      groups.update(
        grouper.call(context, v, k, iterable),
        0,
        function(a ) {return a + 1}
      );
    });
    return groups.asImmutable();
  }


  function groupByFactory(iterable, grouper, context) {
    var isKeyedIter = isKeyed(iterable);
    var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();
    iterable.__iterate(function(v, k)  {
      groups.update(
        grouper.call(context, v, k, iterable),
        function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)}
      );
    });
    var coerce = iterableClass(iterable);
    return groups.map(function(arr ) {return reify(iterable, coerce(arr))});
  }


  function sliceFactory(iterable, begin, end, useKeys) {
    var originalSize = iterable.size;

    // Sanitize begin & end using this shorthand for ToInt32(argument)
    // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
    if (begin !== undefined) {
      begin = begin | 0;
    }
    if (end !== undefined) {
      if (end === Infinity) {
        end = originalSize;
      } else {
        end = end | 0;
      }
    }

    if (wholeSlice(begin, end, originalSize)) {
      return iterable;
    }

    var resolvedBegin = resolveBegin(begin, originalSize);
    var resolvedEnd = resolveEnd(end, originalSize);

    // begin or end will be NaN if they were provided as negative numbers and
    // this iterable's size is unknown. In that case, cache first so there is
    // a known size and these do not resolve to NaN.
    if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {
      return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);
    }

    // Note: resolvedEnd is undefined when the original sequence's length is
    // unknown and this slice did not supply an end and should contain all
    // elements after resolvedBegin.
    // In that case, resolvedSize will be NaN and sliceSize will remain undefined.
    var resolvedSize = resolvedEnd - resolvedBegin;
    var sliceSize;
    if (resolvedSize === resolvedSize) {
      sliceSize = resolvedSize < 0 ? 0 : resolvedSize;
    }

    var sliceSeq = makeSequence(iterable);

    // If iterable.size is undefined, the size of the realized sliceSeq is
    // unknown at this point unless the number of items to slice is 0
    sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined;

    if (!useKeys && isSeq(iterable) && sliceSize >= 0) {
      sliceSeq.get = function (index, notSetValue) {
        index = wrapIndex(this, index);
        return index >= 0 && index < sliceSize ?
          iterable.get(index + resolvedBegin, notSetValue) :
          notSetValue;
      }
    }

    sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this;
      if (sliceSize === 0) {
        return 0;
      }
      if (reverse) {
        return this.cacheResult().__iterate(fn, reverse);
      }
      var skipped = 0;
      var isSkipping = true;
      var iterations = 0;
      iterable.__iterate(function(v, k)  {
        if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {
          iterations++;
          return fn(v, useKeys ? k : iterations - 1, this$0) !== false &&
                 iterations !== sliceSize;
        }
      });
      return iterations;
    };

    sliceSeq.__iteratorUncached = function(type, reverse) {
      if (sliceSize !== 0 && reverse) {
        return this.cacheResult().__iterator(type, reverse);
      }
      // Don't bother instantiating parent iterator if taking 0.
      var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse);
      var skipped = 0;
      var iterations = 0;
      return new Iterator(function()  {
        while (skipped++ < resolvedBegin) {
          iterator.next();
        }
        if (++iterations > sliceSize) {
          return iteratorDone();
        }
        var step = iterator.next();
        if (useKeys || type === ITERATE_VALUES) {
          return step;
        } else if (type === ITERATE_KEYS) {
          return iteratorValue(type, iterations - 1, undefined, step);
        } else {
          return iteratorValue(type, iterations - 1, step.value[1], step);
        }
      });
    }

    return sliceSeq;
  }


  function takeWhileFactory(iterable, predicate, context) {
    var takeSequence = makeSequence(iterable);
    takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
      if (reverse) {
        return this.cacheResult().__iterate(fn, reverse);
      }
      var iterations = 0;
      iterable.__iterate(function(v, k, c) 
        {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)}
      );
      return iterations;
    };
    takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
      if (reverse) {
        return this.cacheResult().__iterator(type, reverse);
      }
      var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
      var iterating = true;
      return new Iterator(function()  {
        if (!iterating) {
          return iteratorDone();
        }
        var step = iterator.next();
        if (step.done) {
          return step;
        }
        var entry = step.value;
        var k = entry[0];
        var v = entry[1];
        if (!predicate.call(context, v, k, this$0)) {
          iterating = false;
          return iteratorDone();
        }
        return type === ITERATE_ENTRIES ? step :
          iteratorValue(type, k, v, step);
      });
    };
    return takeSequence;
  }


  function skipWhileFactory(iterable, predicate, context, useKeys) {
    var skipSequence = makeSequence(iterable);
    skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;
      if (reverse) {
        return this.cacheResult().__iterate(fn, reverse);
      }
      var isSkipping = true;
      var iterations = 0;
      iterable.__iterate(function(v, k, c)  {
        if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {
          iterations++;
          return fn(v, useKeys ? k : iterations - 1, this$0);
        }
      });
      return iterations;
    };
    skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;
      if (reverse) {
        return this.cacheResult().__iterator(type, reverse);
      }
      var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);
      var skipping = true;
      var iterations = 0;
      return new Iterator(function()  {
        var step, k, v;
        do {
          step = iterator.next();
          if (step.done) {
            if (useKeys || type === ITERATE_VALUES) {
              return step;
            } else if (type === ITERATE_KEYS) {
              return iteratorValue(type, iterations++, undefined, step);
            } else {
              return iteratorValue(type, iterations++, step.value[1], step);
            }
          }
          var entry = step.value;
          k = entry[0];
          v = entry[1];
          skipping && (skipping = predicate.call(context, v, k, this$0));
        } while (skipping);
        return type === ITERATE_ENTRIES ? step :
          iteratorValue(type, k, v, step);
      });
    };
    return skipSequence;
  }


  function concatFactory(iterable, values) {
    var isKeyedIterable = isKeyed(iterable);
    var iters = [iterable].concat(values).map(function(v ) {
      if (!isIterable(v)) {
        v = isKeyedIterable ?
          keyedSeqFromValue(v) :
          indexedSeqFromValue(Array.isArray(v) ? v : [v]);
      } else if (isKeyedIterable) {
        v = KeyedIterable(v);
      }
      return v;
    }).filter(function(v ) {return v.size !== 0});

    if (iters.length === 0) {
      return iterable;
    }

    if (iters.length === 1) {
      var singleton = iters[0];
      if (singleton === iterable ||
          isKeyedIterable && isKeyed(singleton) ||
          isIndexed(iterable) && isIndexed(singleton)) {
        return singleton;
      }
    }

    var concatSeq = new ArraySeq(iters);
    if (isKeyedIterable) {
      concatSeq = concatSeq.toKeyedSeq();
    } else if (!isIndexed(iterable)) {
      concatSeq = concatSeq.toSetSeq();
    }
    concatSeq = concatSeq.flatten(true);
    concatSeq.size = iters.reduce(
      function(sum, seq)  {
        if (sum !== undefined) {
          var size = seq.size;
          if (size !== undefined) {
            return sum + size;
          }
        }
      },
      0
    );
    return concatSeq;
  }


  function flattenFactory(iterable, depth, useKeys) {
    var flatSequence = makeSequence(iterable);
    flatSequence.__iterateUncached = function(fn, reverse) {
      var iterations = 0;
      var stopped = false;
      function flatDeep(iter, currentDepth) {var this$0 = this;
        iter.__iterate(function(v, k)  {
          if ((!depth || currentDepth < depth) && isIterable(v)) {
            flatDeep(v, currentDepth + 1);
          } else if (fn(v, useKeys ? k : iterations++, this$0) === false) {
            stopped = true;
          }
          return !stopped;
        }, reverse);
      }
      flatDeep(iterable, 0);
      return iterations;
    }
    flatSequence.__iteratorUncached = function(type, reverse) {
      var iterator = iterable.__iterator(type, reverse);
      var stack = [];
      var iterations = 0;
      return new Iterator(function()  {
        while (iterator) {
          var step = iterator.next();
          if (step.done !== false) {
            iterator = stack.pop();
            continue;
          }
          var v = step.value;
          if (type === ITERATE_ENTRIES) {
            v = v[1];
          }
          if ((!depth || stack.length < depth) && isIterable(v)) {
            stack.push(iterator);
            iterator = v.__iterator(type, reverse);
          } else {
            return useKeys ? step : iteratorValue(type, iterations++, v, step);
          }
        }
        return iteratorDone();
      });
    }
    return flatSequence;
  }


  function flatMapFactory(iterable, mapper, context) {
    var coerce = iterableClass(iterable);
    return iterable.toSeq().map(
      function(v, k)  {return coerce(mapper.call(context, v, k, iterable))}
    ).flatten(true);
  }


  function interposeFactory(iterable, separator) {
    var interposedSequence = makeSequence(iterable);
    interposedSequence.size = iterable.size && iterable.size * 2 -1;
    interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;
      var iterations = 0;
      iterable.__iterate(function(v, k) 
        {return (!iterations || fn(separator, iterations++, this$0) !== false) &&
        fn(v, iterations++, this$0) !== false},
        reverse
      );
      return iterations;
    };
    interposedSequence.__iteratorUncached = function(type, reverse) {
      var iterator = iterable.__iterator(ITERATE_VALUES, reverse);
      var iterations = 0;
      var step;
      return new Iterator(function()  {
        if (!step || iterations % 2) {
          step = iterator.next();
          if (step.done) {
            return step;
          }
        }
        return iterations % 2 ?
          iteratorValue(type, iterations++, separator) :
          iteratorValue(type, iterations++, step.value, step);
      });
    };
    return interposedSequence;
  }


  function sortFactory(iterable, comparator, mapper) {
    if (!comparator) {
      comparator = defaultComparator;
    }
    var isKeyedIterable = isKeyed(iterable);
    var index = 0;
    var entries = iterable.toSeq().map(
      function(v, k)  {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]}
    ).toArray();
    entries.sort(function(a, b)  {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach(
      isKeyedIterable ?
      function(v, i)  { entries[i].length = 2; } :
      function(v, i)  { entries[i] = v[1]; }
    );
    return isKeyedIterable ? KeyedSeq(entries) :
      isIndexed(iterable) ? IndexedSeq(entries) :
      SetSeq(entries);
  }


  function maxFactory(iterable, comparator, mapper) {
    if (!comparator) {
      comparator = defaultComparator;
    }
    if (mapper) {
      var entry = iterable.toSeq()
        .map(function(v, k)  {return [v, mapper(v, k, iterable)]})
        .reduce(function(a, b)  {return maxCompare(comparator, a[1], b[1]) ? b : a});
      return entry && entry[0];
    } else {
      return iterable.reduce(function(a, b)  {return maxCompare(comparator, a, b) ? b : a});
    }
  }

  function maxCompare(comparator, a, b) {
    var comp = comparator(b, a);
    // b is considered the new max if the comparator declares them equal, but
    // they are not equal and b is in fact a nullish value.
    return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0;
  }


  function zipWithFactory(keyIter, zipper, iters) {
    var zipSequence = makeSequence(keyIter);
    zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min();
    // Note: this a generic base implementation of __iterate in terms of
    // __iterator which may be more generically useful in the future.
    zipSequence.__iterate = function(fn, reverse) {
      /* generic:
      var iterator = this.__iterator(ITERATE_ENTRIES, reverse);
      var step;
      var iterations = 0;
      while (!(step = iterator.next()).done) {
        iterations++;
        if (fn(step.value[1], step.value[0], this) === false) {
          break;
        }
      }
      return iterations;
      */
      // indexed:
      var iterator = this.__iterator(ITERATE_VALUES, reverse);
      var step;
      var iterations = 0;
      while (!(step = iterator.next()).done) {
        if (fn(step.value, iterations++, this) === false) {
          break;
        }
      }
      return iterations;
    };
    zipSequence.__iteratorUncached = function(type, reverse) {
      var iterators = iters.map(function(i )
        {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))}
      );
      var iterations = 0;
      var isDone = false;
      return new Iterator(function()  {
        var steps;
        if (!isDone) {
          steps = iterators.map(function(i ) {return i.next()});
          isDone = steps.some(function(s ) {return s.done});
        }
        if (isDone) {
          return iteratorDone();
        }
        return iteratorValue(
          type,
          iterations++,
          zipper.apply(null, steps.map(function(s ) {return s.value}))
        );
      });
    };
    return zipSequence
  }


  // #pragma Helper Functions

  function reify(iter, seq) {
    return isSeq(iter) ? seq : iter.constructor(seq);
  }

  function validateEntry(entry) {
    if (entry !== Object(entry)) {
      throw new TypeError('Expected [K, V] tuple: ' + entry);
    }
  }

  function resolveSize(iter) {
    assertNotInfinite(iter.size);
    return ensureSize(iter);
  }

  function iterableClass(iterable) {
    return isKeyed(iterable) ? KeyedIterable :
      isIndexed(iterable) ? IndexedIterable :
      SetIterable;
  }

  function makeSequence(iterable) {
    return Object.create(
      (
        isKeyed(iterable) ? KeyedSeq :
        isIndexed(iterable) ? IndexedSeq :
        SetSeq
      ).prototype
    );
  }

  function cacheResultThrough() {
    if (this._iter.cacheResult) {
      this._iter.cacheResult();
      this.size = this._iter.size;
      return this;
    } else {
      return Seq.prototype.cacheResult.call(this);
    }
  }

  function defaultComparator(a, b) {
    return a > b ? 1 : a < b ? -1 : 0;
  }

  function forceIterator(keyPath) {
    var iter = getIterator(keyPath);
    if (!iter) {
      // Array might not be iterable in this environment, so we need a fallback
      // to our wrapped type.
      if (!isArrayLike(keyPath)) {
        throw new TypeError('Expected iterable or array-like: ' + keyPath);
      }
      iter = getIterator(Iterable(keyPath));
    }
    return iter;
  }

  createClass(Record, KeyedCollection);

    function Record(defaultValues, name) {
      var hasInitialized;

      var RecordType = function Record(values) {
        if (values instanceof RecordType) {
          return values;
        }
        if (!(this instanceof RecordType)) {
          return new RecordType(values);
        }
        if (!hasInitialized) {
          hasInitialized = true;
          var keys = Object.keys(defaultValues);
          setProps(RecordTypePrototype, keys);
          RecordTypePrototype.size = keys.length;
          RecordTypePrototype._name = name;
          RecordTypePrototype._keys = keys;
          RecordTypePrototype._defaultValues = defaultValues;
        }
        this._map = Map(values);
      };

      var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);
      RecordTypePrototype.constructor = RecordType;

      return RecordType;
    }

    Record.prototype.toString = function() {
      return this.__toString(recordName(this) + ' {', '}');
    };

    // @pragma Access

    Record.prototype.has = function(k) {
      return this._defaultValues.hasOwnProperty(k);
    };

    Record.prototype.get = function(k, notSetValue) {
      if (!this.has(k)) {
        return notSetValue;
      }
      var defaultVal = this._defaultValues[k];
      return this._map ? this._map.get(k, defaultVal) : defaultVal;
    };

    // @pragma Modification

    Record.prototype.clear = function() {
      if (this.__ownerID) {
        this._map && this._map.clear();
        return this;
      }
      var RecordType = this.constructor;
      return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));
    };

    Record.prototype.set = function(k, v) {
      if (!this.has(k)) {
        throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this));
      }
      if (this._map && !this._map.has(k)) {
        var defaultVal = this._defaultValues[k];
        if (v === defaultVal) {
          return this;
        }
      }
      var newMap = this._map && this._map.set(k, v);
      if (this.__ownerID || newMap === this._map) {
        return this;
      }
      return makeRecord(this, newMap);
    };

    Record.prototype.remove = function(k) {
      if (!this.has(k)) {
        return this;
      }
      var newMap = this._map && this._map.remove(k);
      if (this.__ownerID || newMap === this._map) {
        return this;
      }
      return makeRecord(this, newMap);
    };

    Record.prototype.wasAltered = function() {
      return this._map.wasAltered();
    };

    Record.prototype.__iterator = function(type, reverse) {var this$0 = this;
      return KeyedIterable(this._defaultValues).map(function(_, k)  {return this$0.get(k)}).__iterator(type, reverse);
    };

    Record.prototype.__iterate = function(fn, reverse) {var this$0 = this;
      return KeyedIterable(this._defaultValues).map(function(_, k)  {return this$0.get(k)}).__iterate(fn, reverse);
    };

    Record.prototype.__ensureOwner = function(ownerID) {
      if (ownerID === this.__ownerID) {
        return this;
      }
      var newMap = this._map && this._map.__ensureOwner(ownerID);
      if (!ownerID) {
        this.__ownerID = ownerID;
        this._map = newMap;
        return this;
      }
      return makeRecord(this, newMap, ownerID);
    };


  var RecordPrototype = Record.prototype;
  RecordPrototype[DELETE] = RecordPrototype.remove;
  RecordPrototype.deleteIn =
  RecordPrototype.removeIn = MapPrototype.removeIn;
  RecordPrototype.merge = MapPrototype.merge;
  RecordPrototype.mergeWith = MapPrototype.mergeWith;
  RecordPrototype.mergeIn = MapPrototype.mergeIn;
  RecordPrototype.mergeDeep = MapPrototype.mergeDeep;
  RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;
  RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;
  RecordPrototype.setIn = MapPrototype.setIn;
  RecordPrototype.update = MapPrototype.update;
  RecordPrototype.updateIn = MapPrototype.updateIn;
  RecordPrototype.withMutations = MapPrototype.withMutations;
  RecordPrototype.asMutable = MapPrototype.asMutable;
  RecordPrototype.asImmutable = MapPrototype.asImmutable;


  function makeRecord(likeRecord, map, ownerID) {
    var record = Object.create(Object.getPrototypeOf(likeRecord));
    record._map = map;
    record.__ownerID = ownerID;
    return record;
  }

  function recordName(record) {
    return record._name || record.constructor.name || 'Record';
  }

  function setProps(prototype, names) {
    try {
      names.forEach(setProp.bind(undefined, prototype));
    } catch (error) {
      // Object.defineProperty failed. Probably IE8.
    }
  }

  function setProp(prototype, name) {
    Object.defineProperty(prototype, name, {
      get: function() {
        return this.get(name);
      },
      set: function(value) {
        invariant(this.__ownerID, 'Cannot set on an immutable record.');
        this.set(name, value);
      }
    });
  }

  createClass(Set, SetCollection);

    // @pragma Construction

    function Set(value) {
      return value === null || value === undefined ? emptySet() :
        isSet(value) && !isOrdered(value) ? value :
        emptySet().withMutations(function(set ) {
          var iter = SetIterable(value);
          assertNotInfinite(iter.size);
          iter.forEach(function(v ) {return set.add(v)});
        });
    }

    Set.of = function(/*...values*/) {
      return this(arguments);
    };

    Set.fromKeys = function(value) {
      return this(KeyedIterable(value).keySeq());
    };

    Set.prototype.toString = function() {
      return this.__toString('Set {', '}');
    };

    // @pragma Access

    Set.prototype.has = function(value) {
      return this._map.has(value);
    };

    // @pragma Modification

    Set.prototype.add = function(value) {
      return updateSet(this, this._map.set(value, true));
    };

    Set.prototype.remove = function(value) {
      return updateSet(this, this._map.remove(value));
    };

    Set.prototype.clear = function() {
      return updateSet(this, this._map.clear());
    };

    // @pragma Composition

    Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0);
      iters = iters.filter(function(x ) {return x.size !== 0});
      if (iters.length === 0) {
        return this;
      }
      if (this.size === 0 && !this.__ownerID && iters.length === 1) {
        return this.constructor(iters[0]);
      }
      return this.withMutations(function(set ) {
        for (var ii = 0; ii < iters.length; ii++) {
          SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)});
        }
      });
    };

    Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0);
      if (iters.length === 0) {
        return this;
      }
      iters = iters.map(function(iter ) {return SetIterable(iter)});
      var originalSet = this;
      return this.withMutations(function(set ) {
        originalSet.forEach(function(value ) {
          if (!iters.every(function(iter ) {return iter.includes(value)})) {
            set.remove(value);
          }
        });
      });
    };

    Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0);
      if (iters.length === 0) {
        return this;
      }
      iters = iters.map(function(iter ) {return SetIterable(iter)});
      var originalSet = this;
      return this.withMutations(function(set ) {
        originalSet.forEach(function(value ) {
          if (iters.some(function(iter ) {return iter.includes(value)})) {
            set.remove(value);
          }
        });
      });
    };

    Set.prototype.merge = function() {
      return this.union.apply(this, arguments);
    };

    Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);
      return this.union.apply(this, iters);
    };

    Set.prototype.sort = function(comparator) {
      // Late binding
      return OrderedSet(sortFactory(this, comparator));
    };

    Set.prototype.sortBy = function(mapper, comparator) {
      // Late binding
      return OrderedSet(sortFactory(this, comparator, mapper));
    };

    Set.prototype.wasAltered = function() {
      return this._map.wasAltered();
    };

    Set.prototype.__iterate = function(fn, reverse) {var this$0 = this;
      return this._map.__iterate(function(_, k)  {return fn(k, k, this$0)}, reverse);
    };

    Set.prototype.__iterator = function(type, reverse) {
      return this._map.map(function(_, k)  {return k}).__iterator(type, reverse);
    };

    Set.prototype.__ensureOwner = function(ownerID) {
      if (ownerID === this.__ownerID) {
        return this;
      }
      var newMap = this._map.__ensureOwner(ownerID);
      if (!ownerID) {
        this.__ownerID = ownerID;
        this._map = newMap;
        return this;
      }
      return this.__make(newMap, ownerID);
    };


  function isSet(maybeSet) {
    return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);
  }

  Set.isSet = isSet;

  var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';

  var SetPrototype = Set.prototype;
  SetPrototype[IS_SET_SENTINEL] = true;
  SetPrototype[DELETE] = SetPrototype.remove;
  SetPrototype.mergeDeep = SetPrototype.merge;
  SetPrototype.mergeDeepWith = SetPrototype.mergeWith;
  SetPrototype.withMutations = MapPrototype.withMutations;
  SetPrototype.asMutable = MapPrototype.asMutable;
  SetPrototype.asImmutable = MapPrototype.asImmutable;

  SetPrototype.__empty = emptySet;
  SetPrototype.__make = makeSet;

  function updateSet(set, newMap) {
    if (set.__ownerID) {
      set.size = newMap.size;
      set._map = newMap;
      return set;
    }
    return newMap === set._map ? set :
      newMap.size === 0 ? set.__empty() :
      set.__make(newMap);
  }

  function makeSet(map, ownerID) {
    var set = Object.create(SetPrototype);
    set.size = map ? map.size : 0;
    set._map = map;
    set.__ownerID = ownerID;
    return set;
  }

  var EMPTY_SET;
  function emptySet() {
    return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));
  }

  createClass(OrderedSet, Set);

    // @pragma Construction

    function OrderedSet(value) {
      return value === null || value === undefined ? emptyOrderedSet() :
        isOrderedSet(value) ? value :
        emptyOrderedSet().withMutations(function(set ) {
          var iter = SetIterable(value);
          assertNotInfinite(iter.size);
          iter.forEach(function(v ) {return set.add(v)});
        });
    }

    OrderedSet.of = function(/*...values*/) {
      return this(arguments);
    };

    OrderedSet.fromKeys = function(value) {
      return this(KeyedIterable(value).keySeq());
    };

    OrderedSet.prototype.toString = function() {
      return this.__toString('OrderedSet {', '}');
    };


  function isOrderedSet(maybeOrderedSet) {
    return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);
  }

  OrderedSet.isOrderedSet = isOrderedSet;

  var OrderedSetPrototype = OrderedSet.prototype;
  OrderedSetPrototype[IS_ORDERED_SENTINEL] = true;

  OrderedSetPrototype.__empty = emptyOrderedSet;
  OrderedSetPrototype.__make = makeOrderedSet;

  function makeOrderedSet(map, ownerID) {
    var set = Object.create(OrderedSetPrototype);
    set.size = map ? map.size : 0;
    set._map = map;
    set.__ownerID = ownerID;
    return set;
  }

  var EMPTY_ORDERED_SET;
  function emptyOrderedSet() {
    return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));
  }

  createClass(Stack, IndexedCollection);

    // @pragma Construction

    function Stack(value) {
      return value === null || value === undefined ? emptyStack() :
        isStack(value) ? value :
        emptyStack().unshiftAll(value);
    }

    Stack.of = function(/*...values*/) {
      return this(arguments);
    };

    Stack.prototype.toString = function() {
      return this.__toString('Stack [', ']');
    };

    // @pragma Access

    Stack.prototype.get = function(index, notSetValue) {
      var head = this._head;
      index = wrapIndex(this, index);
      while (head && index--) {
        head = head.next;
      }
      return head ? head.value : notSetValue;
    };

    Stack.prototype.peek = function() {
      return this._head && this._head.value;
    };

    // @pragma Modification

    Stack.prototype.push = function(/*...values*/) {
      if (arguments.length === 0) {
        return this;
      }
      var newSize = this.size + arguments.length;
      var head = this._head;
      for (var ii = arguments.length - 1; ii >= 0; ii--) {
        head = {
          value: arguments[ii],
          next: head
        };
      }
      if (this.__ownerID) {
        this.size = newSize;
        this._head = head;
        this.__hash = undefined;
        this.__altered = true;
        return this;
      }
      return makeStack(newSize, head);
    };

    Stack.prototype.pushAll = function(iter) {
      iter = IndexedIterable(iter);
      if (iter.size === 0) {
        return this;
      }
      assertNotInfinite(iter.size);
      var newSize = this.size;
      var head = this._head;
      iter.reverse().forEach(function(value ) {
        newSize++;
        head = {
          value: value,
          next: head
        };
      });
      if (this.__ownerID) {
        this.size = newSize;
        this._head = head;
        this.__hash = undefined;
        this.__altered = true;
        return this;
      }
      return makeStack(newSize, head);
    };

    Stack.prototype.pop = function() {
      return this.slice(1);
    };

    Stack.prototype.unshift = function(/*...values*/) {
      return this.push.apply(this, arguments);
    };

    Stack.prototype.unshiftAll = function(iter) {
      return this.pushAll(iter);
    };

    Stack.prototype.shift = function() {
      return this.pop.apply(this, arguments);
    };

    Stack.prototype.clear = function() {
      if (this.size === 0) {
        return this;
      }
      if (this.__ownerID) {
        this.size = 0;
        this._head = undefined;
        this.__hash = undefined;
        this.__altered = true;
        return this;
      }
      return emptyStack();
    };

    Stack.prototype.slice = function(begin, end) {
      if (wholeSlice(begin, end, this.size)) {
        return this;
      }
      var resolvedBegin = resolveBegin(begin, this.size);
      var resolvedEnd = resolveEnd(end, this.size);
      if (resolvedEnd !== this.size) {
        // super.slice(begin, end);
        return IndexedCollection.prototype.slice.call(this, begin, end);
      }
      var newSize = this.size - resolvedBegin;
      var head = this._head;
      while (resolvedBegin--) {
        head = head.next;
      }
      if (this.__ownerID) {
        this.size = newSize;
        this._head = head;
        this.__hash = undefined;
        this.__altered = true;
        return this;
      }
      return makeStack(newSize, head);
    };

    // @pragma Mutability

    Stack.prototype.__ensureOwner = function(ownerID) {
      if (ownerID === this.__ownerID) {
        return this;
      }
      if (!ownerID) {
        this.__ownerID = ownerID;
        this.__altered = false;
        return this;
      }
      return makeStack(this.size, this._head, ownerID, this.__hash);
    };

    // @pragma Iteration

    Stack.prototype.__iterate = function(fn, reverse) {
      if (reverse) {
        return this.reverse().__iterate(fn);
      }
      var iterations = 0;
      var node = this._head;
      while (node) {
        if (fn(node.value, iterations++, this) === false) {
          break;
        }
        node = node.next;
      }
      return iterations;
    };

    Stack.prototype.__iterator = function(type, reverse) {
      if (reverse) {
        return this.reverse().__iterator(type);
      }
      var iterations = 0;
      var node = this._head;
      return new Iterator(function()  {
        if (node) {
          var value = node.value;
          node = node.next;
          return iteratorValue(type, iterations++, value);
        }
        return iteratorDone();
      });
    };


  function isStack(maybeStack) {
    return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);
  }

  Stack.isStack = isStack;

  var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';

  var StackPrototype = Stack.prototype;
  StackPrototype[IS_STACK_SENTINEL] = true;
  StackPrototype.withMutations = MapPrototype.withMutations;
  StackPrototype.asMutable = MapPrototype.asMutable;
  StackPrototype.asImmutable = MapPrototype.asImmutable;
  StackPrototype.wasAltered = MapPrototype.wasAltered;


  function makeStack(size, head, ownerID, hash) {
    var map = Object.create(StackPrototype);
    map.size = size;
    map._head = head;
    map.__ownerID = ownerID;
    map.__hash = hash;
    map.__altered = false;
    return map;
  }

  var EMPTY_STACK;
  function emptyStack() {
    return EMPTY_STACK || (EMPTY_STACK = makeStack(0));
  }

  /**
   * Contributes additional methods to a constructor
   */
  function mixin(ctor, methods) {
    var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; };
    Object.keys(methods).forEach(keyCopier);
    Object.getOwnPropertySymbols &&
      Object.getOwnPropertySymbols(methods).forEach(keyCopier);
    return ctor;
  }

  Iterable.Iterator = Iterator;

  mixin(Iterable, {

    // ### Conversion to other types

    toArray: function() {
      assertNotInfinite(this.size);
      var array = new Array(this.size || 0);
      this.valueSeq().__iterate(function(v, i)  { array[i] = v; });
      return array;
    },

    toIndexedSeq: function() {
      return new ToIndexedSequence(this);
    },

    toJS: function() {
      return this.toSeq().map(
        function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value}
      ).__toJS();
    },

    toJSON: function() {
      return this.toSeq().map(
        function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value}
      ).__toJS();
    },

    toKeyedSeq: function() {
      return new ToKeyedSequence(this, true);
    },

    toMap: function() {
      // Use Late Binding here to solve the circular dependency.
      return Map(this.toKeyedSeq());
    },

    toObject: function() {
      assertNotInfinite(this.size);
      var object = {};
      this.__iterate(function(v, k)  { object[k] = v; });
      return object;
    },

    toOrderedMap: function() {
      // Use Late Binding here to solve the circular dependency.
      return OrderedMap(this.toKeyedSeq());
    },

    toOrderedSet: function() {
      // Use Late Binding here to solve the circular dependency.
      return OrderedSet(isKeyed(this) ? this.valueSeq() : this);
    },

    toSet: function() {
      // Use Late Binding here to solve the circular dependency.
      return Set(isKeyed(this) ? this.valueSeq() : this);
    },

    toSetSeq: function() {
      return new ToSetSequence(this);
    },

    toSeq: function() {
      return isIndexed(this) ? this.toIndexedSeq() :
        isKeyed(this) ? this.toKeyedSeq() :
        this.toSetSeq();
    },

    toStack: function() {
      // Use Late Binding here to solve the circular dependency.
      return Stack(isKeyed(this) ? this.valueSeq() : this);
    },

    toList: function() {
      // Use Late Binding here to solve the circular dependency.
      return List(isKeyed(this) ? this.valueSeq() : this);
    },


    // ### Common JavaScript methods and properties

    toString: function() {
      return '[Iterable]';
    },

    __toString: function(head, tail) {
      if (this.size === 0) {
        return head + tail;
      }
      return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;
    },


    // ### ES6 Collection methods (ES6 Array and Map)

    concat: function() {var values = SLICE$0.call(arguments, 0);
      return reify(this, concatFactory(this, values));
    },

    includes: function(searchValue) {
      return this.some(function(value ) {return is(value, searchValue)});
    },

    entries: function() {
      return this.__iterator(ITERATE_ENTRIES);
    },

    every: function(predicate, context) {
      assertNotInfinite(this.size);
      var returnValue = true;
      this.__iterate(function(v, k, c)  {
        if (!predicate.call(context, v, k, c)) {
          returnValue = false;
          return false;
        }
      });
      return returnValue;
    },

    filter: function(predicate, context) {
      return reify(this, filterFactory(this, predicate, context, true));
    },

    find: function(predicate, context, notSetValue) {
      var entry = this.findEntry(predicate, context);
      return entry ? entry[1] : notSetValue;
    },

    forEach: function(sideEffect, context) {
      assertNotInfinite(this.size);
      return this.__iterate(context ? sideEffect.bind(context) : sideEffect);
    },

    join: function(separator) {
      assertNotInfinite(this.size);
      separator = separator !== undefined ? '' + separator : ',';
      var joined = '';
      var isFirst = true;
      this.__iterate(function(v ) {
        isFirst ? (isFirst = false) : (joined += separator);
        joined += v !== null && v !== undefined ? v.toString() : '';
      });
      return joined;
    },

    keys: function() {
      return this.__iterator(ITERATE_KEYS);
    },

    map: function(mapper, context) {
      return reify(this, mapFactory(this, mapper, context));
    },

    reduce: function(reducer, initialReduction, context) {
      assertNotInfinite(this.size);
      var reduction;
      var useFirst;
      if (arguments.length < 2) {
        useFirst = true;
      } else {
        reduction = initialReduction;
      }
      this.__iterate(function(v, k, c)  {
        if (useFirst) {
          useFirst = false;
          reduction = v;
        } else {
          reduction = reducer.call(context, reduction, v, k, c);
        }
      });
      return reduction;
    },

    reduceRight: function(reducer, initialReduction, context) {
      var reversed = this.toKeyedSeq().reverse();
      return reversed.reduce.apply(reversed, arguments);
    },

    reverse: function() {
      return reify(this, reverseFactory(this, true));
    },

    slice: function(begin, end) {
      return reify(this, sliceFactory(this, begin, end, true));
    },

    some: function(predicate, context) {
      return !this.every(not(predicate), context);
    },

    sort: function(comparator) {
      return reify(this, sortFactory(this, comparator));
    },

    values: function() {
      return this.__iterator(ITERATE_VALUES);
    },


    // ### More sequential methods

    butLast: function() {
      return this.slice(0, -1);
    },

    isEmpty: function() {
      return this.size !== undefined ? this.size === 0 : !this.some(function()  {return true});
    },

    count: function(predicate, context) {
      return ensureSize(
        predicate ? this.toSeq().filter(predicate, context) : this
      );
    },

    countBy: function(grouper, context) {
      return countByFactory(this, grouper, context);
    },

    equals: function(other) {
      return deepEqual(this, other);
    },

    entrySeq: function() {
      var iterable = this;
      if (iterable._cache) {
        // We cache as an entries array, so we can just return the cache!
        return new ArraySeq(iterable._cache);
      }
      var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();
      entriesSequence.fromEntrySeq = function()  {return iterable.toSeq()};
      return entriesSequence;
    },

    filterNot: function(predicate, context) {
      return this.filter(not(predicate), context);
    },

    findEntry: function(predicate, context, notSetValue) {
      var found = notSetValue;
      this.__iterate(function(v, k, c)  {
        if (predicate.call(context, v, k, c)) {
          found = [k, v];
          return false;
        }
      });
      return found;
    },

    findKey: function(predicate, context) {
      var entry = this.findEntry(predicate, context);
      return entry && entry[0];
    },

    findLast: function(predicate, context, notSetValue) {
      return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
    },

    findLastEntry: function(predicate, context, notSetValue) {
      return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue);
    },

    findLastKey: function(predicate, context) {
      return this.toKeyedSeq().reverse().findKey(predicate, context);
    },

    first: function() {
      return this.find(returnTrue);
    },

    flatMap: function(mapper, context) {
      return reify(this, flatMapFactory(this, mapper, context));
    },

    flatten: function(depth) {
      return reify(this, flattenFactory(this, depth, true));
    },

    fromEntrySeq: function() {
      return new FromEntriesSequence(this);
    },

    get: function(searchKey, notSetValue) {
      return this.find(function(_, key)  {return is(key, searchKey)}, undefined, notSetValue);
    },

    getIn: function(searchKeyPath, notSetValue) {
      var nested = this;
      // Note: in an ES6 environment, we would prefer:
      // for (var key of searchKeyPath) {
      var iter = forceIterator(searchKeyPath);
      var step;
      while (!(step = iter.next()).done) {
        var key = step.value;
        nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;
        if (nested === NOT_SET) {
          return notSetValue;
        }
      }
      return nested;
    },

    groupBy: function(grouper, context) {
      return groupByFactory(this, grouper, context);
    },

    has: function(searchKey) {
      return this.get(searchKey, NOT_SET) !== NOT_SET;
    },

    hasIn: function(searchKeyPath) {
      return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;
    },

    isSubset: function(iter) {
      iter = typeof iter.includes === 'function' ? iter : Iterable(iter);
      return this.every(function(value ) {return iter.includes(value)});
    },

    isSuperset: function(iter) {
      iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter);
      return iter.isSubset(this);
    },

    keyOf: function(searchValue) {
      return this.findKey(function(value ) {return is(value, searchValue)});
    },

    keySeq: function() {
      return this.toSeq().map(keyMapper).toIndexedSeq();
    },

    last: function() {
      return this.toSeq().reverse().first();
    },

    lastKeyOf: function(searchValue) {
      return this.toKeyedSeq().reverse().keyOf(searchValue);
    },

    max: function(comparator) {
      return maxFactory(this, comparator);
    },

    maxBy: function(mapper, comparator) {
      return maxFactory(this, comparator, mapper);
    },

    min: function(comparator) {
      return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);
    },

    minBy: function(mapper, comparator) {
      return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);
    },

    rest: function() {
      return this.slice(1);
    },

    skip: function(amount) {
      return this.slice(Math.max(0, amount));
    },

    skipLast: function(amount) {
      return reify(this, this.toSeq().reverse().skip(amount).reverse());
    },

    skipWhile: function(predicate, context) {
      return reify(this, skipWhileFactory(this, predicate, context, true));
    },

    skipUntil: function(predicate, context) {
      return this.skipWhile(not(predicate), context);
    },

    sortBy: function(mapper, comparator) {
      return reify(this, sortFactory(this, comparator, mapper));
    },

    take: function(amount) {
      return this.slice(0, Math.max(0, amount));
    },

    takeLast: function(amount) {
      return reify(this, this.toSeq().reverse().take(amount).reverse());
    },

    takeWhile: function(predicate, context) {
      return reify(this, takeWhileFactory(this, predicate, context));
    },

    takeUntil: function(predicate, context) {
      return this.takeWhile(not(predicate), context);
    },

    valueSeq: function() {
      return this.toIndexedSeq();
    },


    // ### Hashable Object

    hashCode: function() {
      return this.__hash || (this.__hash = hashIterable(this));
    }


    // ### Internal

    // abstract __iterate(fn, reverse)

    // abstract __iterator(type, reverse)
  });

  // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
  // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
  // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';
  // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';

  var IterablePrototype = Iterable.prototype;
  IterablePrototype[IS_ITERABLE_SENTINEL] = true;
  IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;
  IterablePrototype.__toJS = IterablePrototype.toArray;
  IterablePrototype.__toStringMapper = quoteString;
  IterablePrototype.inspect =
  IterablePrototype.toSource = function() { return this.toString(); };
  IterablePrototype.chain = IterablePrototype.flatMap;
  IterablePrototype.contains = IterablePrototype.includes;

  mixin(KeyedIterable, {

    // ### More sequential methods

    flip: function() {
      return reify(this, flipFactory(this));
    },

    mapEntries: function(mapper, context) {var this$0 = this;
      var iterations = 0;
      return reify(this,
        this.toSeq().map(
          function(v, k)  {return mapper.call(context, [k, v], iterations++, this$0)}
        ).fromEntrySeq()
      );
    },

    mapKeys: function(mapper, context) {var this$0 = this;
      return reify(this,
        this.toSeq().flip().map(
          function(k, v)  {return mapper.call(context, k, v, this$0)}
        ).flip()
      );
    }

  });

  var KeyedIterablePrototype = KeyedIterable.prototype;
  KeyedIterablePrototype[IS_KEYED_SENTINEL] = true;
  KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;
  KeyedIterablePrototype.__toJS = IterablePrototype.toObject;
  KeyedIterablePrototype.__toStringMapper = function(v, k)  {return JSON.stringify(k) + ': ' + quoteString(v)};



  mixin(IndexedIterable, {

    // ### Conversion to other types

    toKeyedSeq: function() {
      return new ToKeyedSequence(this, false);
    },


    // ### ES6 Collection methods (ES6 Array and Map)

    filter: function(predicate, context) {
      return reify(this, filterFactory(this, predicate, context, false));
    },

    findIndex: function(predicate, context) {
      var entry = this.findEntry(predicate, context);
      return entry ? entry[0] : -1;
    },

    indexOf: function(searchValue) {
      var key = this.keyOf(searchValue);
      return key === undefined ? -1 : key;
    },

    lastIndexOf: function(searchValue) {
      var key = this.lastKeyOf(searchValue);
      return key === undefined ? -1 : key;
    },

    reverse: function() {
      return reify(this, reverseFactory(this, false));
    },

    slice: function(begin, end) {
      return reify(this, sliceFactory(this, begin, end, false));
    },

    splice: function(index, removeNum /*, ...values*/) {
      var numArgs = arguments.length;
      removeNum = Math.max(removeNum | 0, 0);
      if (numArgs === 0 || (numArgs === 2 && !removeNum)) {
        return this;
      }
      // If index is negative, it should resolve relative to the size of the
      // collection. However size may be expensive to compute if not cached, so
      // only call count() if the number is in fact negative.
      index = resolveBegin(index, index < 0 ? this.count() : this.size);
      var spliced = this.slice(0, index);
      return reify(
        this,
        numArgs === 1 ?
          spliced :
          spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))
      );
    },


    // ### More collection methods

    findLastIndex: function(predicate, context) {
      var entry = this.findLastEntry(predicate, context);
      return entry ? entry[0] : -1;
    },

    first: function() {
      return this.get(0);
    },

    flatten: function(depth) {
      return reify(this, flattenFactory(this, depth, false));
    },

    get: function(index, notSetValue) {
      index = wrapIndex(this, index);
      return (index < 0 || (this.size === Infinity ||
          (this.size !== undefined && index > this.size))) ?
        notSetValue :
        this.find(function(_, key)  {return key === index}, undefined, notSetValue);
    },

    has: function(index) {
      index = wrapIndex(this, index);
      return index >= 0 && (this.size !== undefined ?
        this.size === Infinity || index < this.size :
        this.indexOf(index) !== -1
      );
    },

    interpose: function(separator) {
      return reify(this, interposeFactory(this, separator));
    },

    interleave: function(/*...iterables*/) {
      var iterables = [this].concat(arrCopy(arguments));
      var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables);
      var interleaved = zipped.flatten(true);
      if (zipped.size) {
        interleaved.size = zipped.size * iterables.length;
      }
      return reify(this, interleaved);
    },

    keySeq: function() {
      return Range(0, this.size);
    },

    last: function() {
      return this.get(-1);
    },

    skipWhile: function(predicate, context) {
      return reify(this, skipWhileFactory(this, predicate, context, false));
    },

    zip: function(/*, ...iterables */) {
      var iterables = [this].concat(arrCopy(arguments));
      return reify(this, zipWithFactory(this, defaultZipper, iterables));
    },

    zipWith: function(zipper/*, ...iterables */) {
      var iterables = arrCopy(arguments);
      iterables[0] = this;
      return reify(this, zipWithFactory(this, zipper, iterables));
    }

  });

  IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;
  IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;



  mixin(SetIterable, {

    // ### ES6 Collection methods (ES6 Array and Map)

    get: function(value, notSetValue) {
      return this.has(value) ? value : notSetValue;
    },

    includes: function(value) {
      return this.has(value);
    },


    // ### More sequential methods

    keySeq: function() {
      return this.valueSeq();
    }

  });

  SetIterable.prototype.has = IterablePrototype.includes;
  SetIterable.prototype.contains = SetIterable.prototype.includes;


  // Mixin subclasses

  mixin(KeyedSeq, KeyedIterable.prototype);
  mixin(IndexedSeq, IndexedIterable.prototype);
  mixin(SetSeq, SetIterable.prototype);

  mixin(KeyedCollection, KeyedIterable.prototype);
  mixin(IndexedCollection, IndexedIterable.prototype);
  mixin(SetCollection, SetIterable.prototype);


  // #pragma Helper functions

  function keyMapper(v, k) {
    return k;
  }

  function entryMapper(v, k) {
    return [k, v];
  }

  function not(predicate) {
    return function() {
      return !predicate.apply(this, arguments);
    }
  }

  function neg(predicate) {
    return function() {
      return -predicate.apply(this, arguments);
    }
  }

  function quoteString(value) {
    return typeof value === 'string' ? JSON.stringify(value) : String(value);
  }

  function defaultZipper() {
    return arrCopy(arguments);
  }

  function defaultNegComparator(a, b) {
    return a < b ? 1 : a > b ? -1 : 0;
  }

  function hashIterable(iterable) {
    if (iterable.size === Infinity) {
      return 0;
    }
    var ordered = isOrdered(iterable);
    var keyed = isKeyed(iterable);
    var h = ordered ? 1 : 0;
    var size = iterable.__iterate(
      keyed ?
        ordered ?
          function(v, k)  { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } :
          function(v, k)  { h = h + hashMerge(hash(v), hash(k)) | 0; } :
        ordered ?
          function(v ) { h = 31 * h + hash(v) | 0; } :
          function(v ) { h = h + hash(v) | 0; }
    );
    return murmurHashOfSize(size, h);
  }

  function murmurHashOfSize(size, h) {
    h = imul(h, 0xCC9E2D51);
    h = imul(h << 15 | h >>> -15, 0x1B873593);
    h = imul(h << 13 | h >>> -13, 5);
    h = (h + 0xE6546B64 | 0) ^ size;
    h = imul(h ^ h >>> 16, 0x85EBCA6B);
    h = imul(h ^ h >>> 13, 0xC2B2AE35);
    h = smi(h ^ h >>> 16);
    return h;
  }

  function hashMerge(a, b) {
    return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int
  }

  var Immutable = {

    Iterable: Iterable,

    Seq: Seq,
    Collection: Collection,
    Map: Map,
    OrderedMap: OrderedMap,
    List: List,
    Stack: Stack,
    Set: Set,
    OrderedSet: OrderedSet,

    Record: Record,
    Range: Range,
    Repeat: Repeat,

    is: is,
    fromJS: fromJS

  };

  return Immutable;

}));

/***/ }),

/***/ 4350:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
var __webpack_unused_export__;


__webpack_unused_export__ = ({ value: true });

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var React = __webpack_require__(6540);
var React__default = _interopDefault(React);

var UAParser = __webpack_require__(6204);

var UA = new UAParser();
var browser = UA.getBrowser();
var cpu = UA.getCPU();
var device = UA.getDevice();
var engine = UA.getEngine();
var os = UA.getOS();
var ua = UA.getUA();

var setDefaults = function setDefaults(p) {
  var d = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'none';
  return p ? p : d;
};
var getNavigatorInstance = function getNavigatorInstance() {
  if (typeof window !== 'undefined') {
    if (window.navigator || navigator) {
      return window.navigator || navigator;
    }
  }

  return false;
};
var isIOS13Check = function isIOS13Check(type) {
  var nav = getNavigatorInstance();
  return nav && nav.platform && (nav.platform.indexOf(type) !== -1 || nav.platform === 'MacIntel' && nav.maxTouchPoints > 1 && !window.MSStream);
};

function _typeof(obj) {
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
    _typeof = function (obj) {
      return typeof obj;
    };
  } else {
    _typeof = function (obj) {
      return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
    };
  }

  return _typeof(obj);
}

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(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() {
  _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);
}

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(source, true).forEach(function (key) {
        _defineProperty(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys(source).forEach(function (key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }

  return target;
}

function _inherits(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }

  subClass.prototype = Object.create(superClass && superClass.prototype, {
    constructor: {
      value: subClass,
      writable: true,
      configurable: true
    }
  });
  if (superClass) _setPrototypeOf(subClass, superClass);
}

function _getPrototypeOf(o) {
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
    return o.__proto__ || Object.getPrototypeOf(o);
  };
  return _getPrototypeOf(o);
}

function _setPrototypeOf(o, p) {
  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
    o.__proto__ = p;
    return o;
  };

  return _setPrototypeOf(o, p);
}

function _assertThisInitialized(self) {
  if (self === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }

  return self;
}

function _possibleConstructorReturn(self, call) {
  if (call && (typeof call === "object" || typeof call === "function")) {
    return call;
  }

  return _assertThisInitialized(self);
}

var DEVICE_TYPES = {
  MOBILE: 'mobile',
  TABLET: 'tablet',
  SMART_TV: 'smarttv',
  CONSOLE: 'console',
  WEARABLE: 'wearable',
  BROWSER: undefined
};
var BROWSER_TYPES = {
  CHROME: 'Chrome',
  FIREFOX: "Firefox",
  OPERA: "Opera",
  YANDEX: "Yandex",
  SAFARI: "Safari",
  INTERNET_EXPLORER: "Internet Explorer",
  EDGE: "Edge",
  CHROMIUM: "Chromium",
  IE: 'IE',
  MOBILE_SAFARI: "Mobile Safari",
  EDGE_CHROMIUM: "Edge Chromium",
  MIUI: "MIUI Browser"
};
var OS_TYPES = {
  IOS: 'iOS',
  ANDROID: "Android",
  WINDOWS_PHONE: "Windows Phone",
  WINDOWS: 'Windows',
  MAC_OS: 'Mac OS'
};
var initialData = {
  isMobile: false,
  isTablet: false,
  isBrowser: false,
  isSmartTV: false,
  isConsole: false,
  isWearable: false
};
var checkType = function checkType(type) {
  switch (type) {
    case DEVICE_TYPES.MOBILE:
      return {
        isMobile: true
      };

    case DEVICE_TYPES.TABLET:
      return {
        isTablet: true
      };

    case DEVICE_TYPES.SMART_TV:
      return {
        isSmartTV: true
      };

    case DEVICE_TYPES.CONSOLE:
      return {
        isConsole: true
      };

    case DEVICE_TYPES.WEARABLE:
      return {
        isWearable: true
      };

    case DEVICE_TYPES.BROWSER:
      return {
        isBrowser: true
      };

    default:
      return initialData;
  }
};
var broPayload = function broPayload(isBrowser, browser, engine, os, ua) {
  return {
    isBrowser: isBrowser,
    browserMajorVersion: setDefaults(browser.major),
    browserFullVersion: setDefaults(browser.version),
    browserName: setDefaults(browser.name),
    engineName: setDefaults(engine.name),
    engineVersion: setDefaults(engine.version),
    osName: setDefaults(os.name),
    osVersion: setDefaults(os.version),
    userAgent: setDefaults(ua)
  };
};
var mobilePayload = function mobilePayload(type, device, os, ua) {
  return _objectSpread2({}, type, {
    vendor: setDefaults(device.vendor),
    model: setDefaults(device.model),
    os: setDefaults(os.name),
    osVersion: setDefaults(os.version),
    ua: setDefaults(ua)
  });
};
var stvPayload = function stvPayload(isSmartTV, engine, os, ua) {
  return {
    isSmartTV: isSmartTV,
    engineName: setDefaults(engine.name),
    engineVersion: setDefaults(engine.version),
    osName: setDefaults(os.name),
    osVersion: setDefaults(os.version),
    userAgent: setDefaults(ua)
  };
};
var consolePayload = function consolePayload(isConsole, engine, os, ua) {
  return {
    isConsole: isConsole,
    engineName: setDefaults(engine.name),
    engineVersion: setDefaults(engine.version),
    osName: setDefaults(os.name),
    osVersion: setDefaults(os.version),
    userAgent: setDefaults(ua)
  };
};
var wearPayload = function wearPayload(isWearable, engine, os, ua) {
  return {
    isWearable: isWearable,
    engineName: setDefaults(engine.name),
    engineVersion: setDefaults(engine.version),
    osName: setDefaults(os.name),
    osVersion: setDefaults(os.version),
    userAgent: setDefaults(ua)
  };
};

var type = checkType(device.type);

function deviceDetect() {
  var isBrowser = type.isBrowser,
      isMobile = type.isMobile,
      isTablet = type.isTablet,
      isSmartTV = type.isSmartTV,
      isConsole = type.isConsole,
      isWearable = type.isWearable;

  if (isBrowser) {
    return broPayload(isBrowser, browser, engine, os, ua);
  }

  if (isSmartTV) {
    return stvPayload(isSmartTV, engine, os, ua);
  }

  if (isConsole) {
    return consolePayload(isConsole, engine, os, ua);
  }

  if (isMobile) {
    return mobilePayload(type, device, os, ua);
  }

  if (isTablet) {
    return mobilePayload(type, device, os, ua);
  }

  if (isWearable) {
    return wearPayload(isWearable, engine, os, ua);
  }
}

var isMobileType = function isMobileType() {
  return device.type === DEVICE_TYPES.MOBILE;
};

var isTabletType = function isTabletType() {
  return device.type === DEVICE_TYPES.TABLET;
};

var isMobileAndTabletType = function isMobileAndTabletType() {
  switch (device.type) {
    case DEVICE_TYPES.MOBILE:
    case DEVICE_TYPES.TABLET:
      return true;

    default:
      return false;
  }
};

var isEdgeChromiumType = function isEdgeChromiumType() {
  return typeof ua === 'string' && ua.indexOf('Edg/') !== -1;
};

var isSmartTVType = function isSmartTVType() {
  return device.type === DEVICE_TYPES.SMART_TV;
};

var isBrowserType = function isBrowserType() {
  return device.type === DEVICE_TYPES.BROWSER;
};

var isWearableType = function isWearableType() {
  return device.type === DEVICE_TYPES.WEARABLE;
};

var isConsoleType = function isConsoleType() {
  return device.type === DEVICE_TYPES.CONSOLE;
};

var isAndroidType = function isAndroidType() {
  return os.name === OS_TYPES.ANDROID;
};

var isWindowsType = function isWindowsType() {
  return os.name === OS_TYPES.WINDOWS;
};

var isMacOsType = function isMacOsType() {
  return os.name === OS_TYPES.MAC_OS;
};

var isWinPhoneType = function isWinPhoneType() {
  return os.name === OS_TYPES.WINDOWS_PHONE;
};

var isIOSType = function isIOSType() {
  return os.name === OS_TYPES.IOS;
};

var isChromeType = function isChromeType() {
  return browser.name === BROWSER_TYPES.CHROME;
};

var isFirefoxType = function isFirefoxType() {
  return browser.name === BROWSER_TYPES.FIREFOX;
};

var isChromiumType = function isChromiumType() {
  return browser.name === BROWSER_TYPES.CHROMIUM;
};

var isEdgeType = function isEdgeType() {
  return browser.name === BROWSER_TYPES.EDGE;
};

var isYandexType = function isYandexType() {
  return browser.name === BROWSER_TYPES.YANDEX;
};

var isSafariType = function isSafariType() {
  return browser.name === BROWSER_TYPES.SAFARI || browser.name === BROWSER_TYPES.MOBILE_SAFARI;
};

var isMobileSafariType = function isMobileSafariType() {
  return browser.name === BROWSER_TYPES.MOBILE_SAFARI;
};

var isOperaType = function isOperaType() {
  return browser.name === BROWSER_TYPES.OPERA;
};

var isIEType = function isIEType() {
  return browser.name === BROWSER_TYPES.INTERNET_EXPLORER || browser.name === BROWSER_TYPES.IE;
};

var isMIUIType = function isMIUIType() {
  return browser.name === BROWSER_TYPES.MIUI;
};

var isElectronType = function isElectronType() {
  var nav = getNavigatorInstance();
  var ua = nav && nav.userAgent.toLowerCase();
  return typeof ua === 'string' ? /electron/.test(ua) : false;
};

var getIOS13 = function getIOS13() {
  var nav = getNavigatorInstance();
  return nav && (/iPad|iPhone|iPod/.test(nav.platform) || nav.platform === 'MacIntel' && nav.maxTouchPoints > 1) && !window.MSStream;
};

var getIPad13 = function getIPad13() {
  return isIOS13Check('iPad');
};

var getIphone13 = function getIphone13() {
  return isIOS13Check('iPhone');
};

var getIPod13 = function getIPod13() {
  return isIOS13Check('iPod');
};

var getBrowserFullVersion = function getBrowserFullVersion() {
  return setDefaults(browser.version);
};

var getBrowserVersion = function getBrowserVersion() {
  return setDefaults(browser.major);
};

var getOsVersion = function getOsVersion() {
  return setDefaults(os.version);
};

var getOsName = function getOsName() {
  return setDefaults(os.name);
};

var getBrowserName = function getBrowserName() {
  return setDefaults(browser.name);
};

var getMobileVendor = function getMobileVendor() {
  return setDefaults(device.vendor);
};

var getMobileModel = function getMobileModel() {
  return setDefaults(device.model);
};

var getEngineName = function getEngineName() {
  return setDefaults(engine.name);
};

var getEngineVersion = function getEngineVersion() {
  return setDefaults(engine.version);
};

var getUseragent = function getUseragent() {
  return setDefaults(ua);
};

var getDeviceType = function getDeviceType() {
  return setDefaults(device.type, 'browser');
};

var isSmartTV = isSmartTVType();
var isConsole = isConsoleType();
var isWearable = isWearableType();
var isMobileSafari = isMobileSafariType() || getIPad13();
var isChromium = isChromiumType();
var isMobile = isMobileAndTabletType() || getIPad13();
var isMobileOnly = isMobileType();
var isTablet = isTabletType() || getIPad13();
var isBrowser = isBrowserType();
var isAndroid = isAndroidType();
var isWinPhone = isWinPhoneType();
var isIOS = isIOSType() || getIPad13();
var isChrome = isChromeType();
var isFirefox = isFirefoxType();
var isSafari = isSafariType();
var isOpera = isOperaType();
var isIE = isIEType();
var osVersion = getOsVersion();
var osName = getOsName();
var fullBrowserVersion = getBrowserFullVersion();
var browserVersion = getBrowserVersion();
var browserName = getBrowserName();
var mobileVendor = getMobileVendor();
var mobileModel = getMobileModel();
var engineName = getEngineName();
var engineVersion = getEngineVersion();
var getUA = getUseragent();
var isEdge = isEdgeType() || isEdgeChromiumType();
var isYandex = isYandexType();
var deviceType = getDeviceType();
var isIOS13 = getIOS13();
var isIPad13 = getIPad13();
var isIPhone13 = getIphone13();
var isIPod13 = getIPod13();
var isElectron = isElectronType();
var isEdgeChromium = isEdgeChromiumType();
var isLegacyEdge = isEdgeType() && !isEdgeChromiumType();
var isWindows = isWindowsType();
var isMacOs = isMacOsType();
var isMIUI = isMIUIType();

var AndroidView = function AndroidView(_ref) {
  var renderWithFragment = _ref.renderWithFragment,
      children = _ref.children,
      viewClassName = _ref.viewClassName,
      style = _ref.style;
  return isAndroid ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var BrowserView = function BrowserView(_ref2) {
  var renderWithFragment = _ref2.renderWithFragment,
      children = _ref2.children,
      viewClassName = _ref2.viewClassName,
      style = _ref2.style;
  return isBrowser ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var IEView = function IEView(_ref3) {
  var renderWithFragment = _ref3.renderWithFragment,
      children = _ref3.children,
      viewClassName = _ref3.viewClassName,
      style = _ref3.style;
  return isIE ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var IOSView = function IOSView(_ref4) {
  var renderWithFragment = _ref4.renderWithFragment,
      children = _ref4.children,
      viewClassName = _ref4.viewClassName,
      style = _ref4.style;
  return isIOS ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var MobileView = function MobileView(_ref5) {
  var renderWithFragment = _ref5.renderWithFragment,
      children = _ref5.children,
      viewClassName = _ref5.viewClassName,
      style = _ref5.style;
  return isMobile ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var TabletView = function TabletView(_ref6) {
  var renderWithFragment = _ref6.renderWithFragment,
      children = _ref6.children,
      viewClassName = _ref6.viewClassName,
      style = _ref6.style;
  return isTablet ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var WinPhoneView = function WinPhoneView(_ref7) {
  var renderWithFragment = _ref7.renderWithFragment,
      children = _ref7.children,
      viewClassName = _ref7.viewClassName,
      style = _ref7.style;
  return isWinPhone ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var MobileOnlyView = function MobileOnlyView(_ref8) {
  var renderWithFragment = _ref8.renderWithFragment,
      children = _ref8.children,
      viewClassName = _ref8.viewClassName,
      style = _ref8.style;
  return isMobileOnly ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var SmartTVView = function SmartTVView(_ref9) {
  var renderWithFragment = _ref9.renderWithFragment,
      children = _ref9.children,
      viewClassName = _ref9.viewClassName,
      style = _ref9.style;
  return isSmartTV ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var ConsoleView = function ConsoleView(_ref10) {
  var renderWithFragment = _ref10.renderWithFragment,
      children = _ref10.children,
      viewClassName = _ref10.viewClassName,
      style = _ref10.style;
  return isConsole ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var WearableView = function WearableView(_ref11) {
  var renderWithFragment = _ref11.renderWithFragment,
      children = _ref11.children,
      viewClassName = _ref11.viewClassName,
      style = _ref11.style;
  return isWearable ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};
var CustomView = function CustomView(_ref12) {
  var renderWithFragment = _ref12.renderWithFragment,
      children = _ref12.children,
      viewClassName = _ref12.viewClassName,
      style = _ref12.style,
      condition = _ref12.condition;
  return condition ? renderWithFragment ? React__default.createElement(React.Fragment, null, children) : React__default.createElement("div", {
    className: viewClassName,
    style: style
  }, children) : null;
};

function withOrientationChange(WrappedComponent) {
  return (
    /*#__PURE__*/
    function (_React$Component) {
      _inherits(_class, _React$Component);

      function _class(props) {
        var _this;

        _classCallCheck(this, _class);

        _this = _possibleConstructorReturn(this, _getPrototypeOf(_class).call(this, props));
        _this.isEventListenerAdded = false;
        _this.handleOrientationChange = _this.handleOrientationChange.bind(_assertThisInitialized(_this));
        _this.onOrientationChange = _this.onOrientationChange.bind(_assertThisInitialized(_this));
        _this.onPageLoad = _this.onPageLoad.bind(_assertThisInitialized(_this));
        _this.state = {
          isLandscape: false,
          isPortrait: false
        };
        return _this;
      }

      _createClass(_class, [{
        key: "handleOrientationChange",
        value: function handleOrientationChange() {
          if (!this.isEventListenerAdded) {
            this.isEventListenerAdded = true;
          }

          var orientation = window.innerWidth > window.innerHeight ? 90 : 0;
          this.setState({
            isPortrait: orientation === 0,
            isLandscape: orientation === 90
          });
        }
      }, {
        key: "onOrientationChange",
        value: function onOrientationChange() {
          this.handleOrientationChange();
        }
      }, {
        key: "onPageLoad",
        value: function onPageLoad() {
          this.handleOrientationChange();
        }
      }, {
        key: "componentDidMount",
        value: function componentDidMount() {
          if ((typeof window === "undefined" ? "undefined" : _typeof(window)) !== undefined && isMobile) {
            if (!this.isEventListenerAdded) {
              this.handleOrientationChange();
              window.addEventListener("load", this.onPageLoad, false);
            } else {
              window.removeEventListener("load", this.onPageLoad, false);
            }

            window.addEventListener("resize", this.onOrientationChange, false);
          }
        }
      }, {
        key: "componentWillUnmount",
        value: function componentWillUnmount() {
          window.removeEventListener("resize", this.onOrientationChange, false);
        }
      }, {
        key: "render",
        value: function render() {
          return React__default.createElement(WrappedComponent, _extends({}, this.props, {
            isLandscape: this.state.isLandscape,
            isPortrait: this.state.isPortrait
          }));
        }
      }]);

      return _class;
    }(React__default.Component)
  );
}

__webpack_unused_export__ = AndroidView;
__webpack_unused_export__ = BrowserView;
__webpack_unused_export__ = ConsoleView;
__webpack_unused_export__ = CustomView;
__webpack_unused_export__ = IEView;
__webpack_unused_export__ = IOSView;
__webpack_unused_export__ = MobileOnlyView;
__webpack_unused_export__ = MobileView;
__webpack_unused_export__ = SmartTVView;
__webpack_unused_export__ = TabletView;
__webpack_unused_export__ = WearableView;
__webpack_unused_export__ = WinPhoneView;
__webpack_unused_export__ = browserName;
__webpack_unused_export__ = browserVersion;
__webpack_unused_export__ = deviceDetect;
__webpack_unused_export__ = deviceType;
__webpack_unused_export__ = engineName;
__webpack_unused_export__ = engineVersion;
__webpack_unused_export__ = fullBrowserVersion;
__webpack_unused_export__ = getUA;
exports.m0 = isAndroid;
__webpack_unused_export__ = isBrowser;
__webpack_unused_export__ = isChrome;
__webpack_unused_export__ = isChromium;
__webpack_unused_export__ = isConsole;
__webpack_unused_export__ = isEdge;
__webpack_unused_export__ = isEdgeChromium;
__webpack_unused_export__ = isElectron;
exports.gm = isFirefox;
__webpack_unused_export__ = isIE;
exports.un = isIOS;
__webpack_unused_export__ = isIOS13;
__webpack_unused_export__ = isIPad13;
__webpack_unused_export__ = isIPhone13;
__webpack_unused_export__ = isIPod13;
__webpack_unused_export__ = isLegacyEdge;
__webpack_unused_export__ = isMIUI;
__webpack_unused_export__ = isMacOs;
exports.Fr = isMobile;
exports.XF = isMobileOnly;
__webpack_unused_export__ = isMobileSafari;
__webpack_unused_export__ = isOpera;
exports.nr = isSafari;
__webpack_unused_export__ = isSmartTV;
exports.v1 = isTablet;
__webpack_unused_export__ = isWearable;
__webpack_unused_export__ = isWinPhone;
__webpack_unused_export__ = isWindows;
__webpack_unused_export__ = isYandex;
__webpack_unused_export__ = mobileModel;
__webpack_unused_export__ = mobileVendor;
__webpack_unused_export__ = osName;
__webpack_unused_export__ = osVersion;
exports.LZ = withOrientationChange;


/***/ }),

/***/ 6302:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

!function(e,t){ true?module.exports=t(__webpack_require__(6540)):0}(this,(e=>(()=>{var t={703:(e,t,n)=>{"use strict";var i=n(414);function r(){}function a(){}a.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,a,o){if(o!==i){var s=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");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:r};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,i="function"==typeof Set,r="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(e,o){if(e===o)return!0;if(e&&o&&"object"==typeof e&&"object"==typeof o){if(e.constructor!==o.constructor)return!1;var s,l,u,c;if(Array.isArray(e)){if((s=e.length)!=o.length)return!1;for(l=s;0!=l--;)if(!a(e[l],o[l]))return!1;return!0}if(n&&e instanceof Map&&o instanceof Map){if(e.size!==o.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!o.has(l.value[0]))return!1;for(c=e.entries();!(l=c.next()).done;)if(!a(l.value[1],o.get(l.value[0])))return!1;return!0}if(i&&e instanceof Set&&o instanceof Set){if(e.size!==o.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!o.has(l.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(o)){if((s=e.length)!=o.length)return!1;for(l=s;0!=l--;)if(e[l]!==o[l])return!1;return!0}if(e.constructor===RegExp)return e.source===o.source&&e.flags===o.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===o.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===o.toString();if((s=(u=Object.keys(e)).length)!==Object.keys(o).length)return!1;for(l=s;0!=l--;)if(!Object.prototype.hasOwnProperty.call(o,u[l]))return!1;if(t&&e instanceof Element)return!1;for(l=s;0!=l--;)if(("_owner"!==u[l]&&"__v"!==u[l]&&"__o"!==u[l]||!e.$$typeof)&&!a(e[u[l]],o[u[l]]))return!1;return!0}return e!=e&&o!=o}e.exports=function(e,t){try{return a(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},359:t=>{"use strict";t.exports=e}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,i),a.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function e(t){var n,i,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(i=e(t[n]))&&(r&&(r+=" "),r+=i);else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function t(){for(var t,n,i=0,r="";i<arguments.length;)(t=arguments[i++])&&(n=e(t))&&(r&&(r+=" "),r+=n);return r}i.r(r),i.d(r,{default:()=>nt});var n=i(359),a=i.n(n);const o=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},s="object"==typeof __webpack_require__.g&&__webpack_require__.g&&__webpack_require__.g.Object===Object&&__webpack_require__.g;var l="object"==typeof self&&self&&self.Object===Object&&self;const u=s||l||Function("return this")(),c=function(){return u.Date.now()};var h=/\s/;var d=/^\s+/;const p=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&h.test(e.charAt(t)););return t}(e)+1).replace(d,""):e},f=u.Symbol;var m=Object.prototype,b=m.hasOwnProperty,g=m.toString,v=f?f.toStringTag:void 0;var y=Object.prototype.toString;var w=f?f.toStringTag:void 0;const S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":w&&w in Object(e)?function(e){var t=b.call(e,v),n=e[v];try{e[v]=void 0;var i=!0}catch(e){}var r=g.call(e);return i&&(t?e[v]=n:delete e[v]),r}(e):function(e){return y.call(e)}(e)};var T=/^[-+]0x[0-9a-f]+$/i,O=/^0b[01]+$/i,E=/^0o[0-7]+$/i,k=parseInt;const I=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==S(e)}(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=p(e);var n=O.test(e);return n||E.test(e)?k(e.slice(2),n?2:8):T.test(e)?NaN:+e};var j=Math.max,x=Math.min;const P=function(e,t,n){var i,r,a,s,l,u,h=0,d=!1,p=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=i,a=r;return i=r=void 0,h=t,s=e.apply(a,n)}function b(e){return h=e,l=setTimeout(v,t),d?m(e):s}function g(e){var n=e-u;return void 0===u||n>=t||n<0||p&&e-h>=a}function v(){var e=c();if(g(e))return y(e);l=setTimeout(v,function(e){var n=t-(e-u);return p?x(n,a-(e-h)):n}(e))}function y(e){return l=void 0,f&&i?m(e):(i=r=void 0,s)}function w(){var e=c(),n=g(e);if(i=arguments,r=this,u=e,n){if(void 0===l)return b(u);if(p)return clearTimeout(l),l=setTimeout(v,t),m(u)}return void 0===l&&(l=setTimeout(v,t)),s}return t=I(t)||0,o(n)&&(d=!!n.leading,a=(p="maxWait"in n)?j(I(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),w.cancel=function(){void 0!==l&&clearTimeout(l),h=0,i=u=r=l=void 0},w.flush=function(){return void 0===l?s:y(c())},w},_=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),P(e,t,{leading:i,maxWait:t,trailing:r})};var R=i(590),M=i.n(R),L=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,i){return e[0]===t&&(n=i,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},t.prototype.set=function(t,n){var i=e(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,i=e(n,t);~i&&n.splice(i,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,i=this.__entries__;n<i.length;n++){var r=i[n];e.call(t,r[1],r[0])}},t}()}(),D="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,W=void 0!==i.g&&i.g.Math===Math?i.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),C="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(W):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},F=["top","right","bottom","left","width","height","size","weight"],z="undefined"!=typeof MutationObserver,N=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,i=!1,r=0;function a(){n&&(n=!1,e()),i&&s()}function o(){C(a)}function s(){var e=Date.now();if(n){if(e-r<2)return;i=!0}else n=!0,i=!1,setTimeout(o,20);r=e}return s}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){D&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),z?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){D&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;F.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),B=function(e,t){for(var n=0,i=Object.keys(t);n<i.length;n++){var r=i[n];Object.defineProperty(e,r,{value:t[r],enumerable:!1,writable:!1,configurable:!0})}return e},A=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||W},U=V(0,0,0,0);function G(e){return parseFloat(e)||0}function q(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+G(e["border-"+n+"-width"])}),0)}var H="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof A(e).SVGGraphicsElement}:function(e){return e instanceof A(e).SVGElement&&"function"==typeof e.getBBox};function K(e){return D?H(e)?function(e){var t=e.getBBox();return V(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return U;var i=A(e).getComputedStyle(e),r=function(e){for(var t={},n=0,i=["top","right","bottom","left"];n<i.length;n++){var r=i[n],a=e["padding-"+r];t[r]=G(a)}return t}(i),a=r.left+r.right,o=r.top+r.bottom,s=G(i.width),l=G(i.height);if("border-box"===i.boxSizing&&(Math.round(s+a)!==t&&(s-=q(i,"left","right")+a),Math.round(l+o)!==n&&(l-=q(i,"top","bottom")+o)),!function(e){return e===A(e).document.documentElement}(e)){var u=Math.round(s+a)-t,c=Math.round(l+o)-n;1!==Math.abs(u)&&(s-=u),1!==Math.abs(c)&&(l-=c)}return V(r.left,r.top,s,l)}(e):U}function V(e,t,n,i){return{x:e,y:t,width:n,height:i}}var X=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=V(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=K(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),$=function(e,t){var n,i,r,a,o,s,l,u=(i=(n=t).x,r=n.y,a=n.width,o=n.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(s.prototype),B(l,{x:i,y:r,width:a,height:o,top:r,right:i+a,bottom:o+r,left:i}),l);B(this,{target:e,contentRect:u})},Y=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new L,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof A(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new X(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof A(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new $(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),J="undefined"!=typeof WeakMap?new WeakMap:new L,Q=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=N.getInstance(),i=new Y(t,n,this);J.set(this,i)};["observe","unobserve","disconnect"].forEach((function(e){Q.prototype[e]=function(){var t;return(t=J.get(this))[e].apply(t,arguments)}}));const Z=void 0!==W.ResizeObserver?W.ResizeObserver:Q,ee="Left",te="Right",ne="Up",ie="Down",re={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},ae={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},oe="mousemove",se="mouseup";function le(e,t){if(0===t)return e;const n=Math.PI/180*t;return[e[0]*Math.cos(n)+e[1]*Math.sin(n),e[1]*Math.cos(n)-e[0]*Math.sin(n)]}function ue(e){const{trackMouse:t}=e,i=n.useRef(Object.assign({},ae)),r=n.useRef(Object.assign({},re)),a=n.useRef(Object.assign({},r.current));let o;for(o in a.current=Object.assign({},r.current),r.current=Object.assign(Object.assign({},re),e),re)void 0===r.current[o]&&(r.current[o]=re[o]);const[s,l]=n.useMemo((()=>function(e,t){const n=t=>{const n="touches"in t;n&&t.touches.length>1||e(((e,r)=>{r.trackMouse&&!n&&(document.addEventListener(oe,i),document.addEventListener(se,a));const{clientX:o,clientY:s}=n?t.touches[0]:t,l=le([o,s],r.rotationAngle);return r.onTouchStartOrOnMouseDown&&r.onTouchStartOrOnMouseDown({event:t}),Object.assign(Object.assign(Object.assign({},e),ae),{initial:l.slice(),xy:l,start:t.timeStamp||0})}))},i=t=>{e(((e,n)=>{const i="touches"in t;if(i&&t.touches.length>1)return e;if(t.timeStamp-e.start>n.swipeDuration)return e.swiping?Object.assign(Object.assign({},e),{swiping:!1}):e;const{clientX:r,clientY:a}=i?t.touches[0]:t,[o,s]=le([r,a],n.rotationAngle),l=o-e.xy[0],u=s-e.xy[1],c=Math.abs(l),h=Math.abs(u),d=(t.timeStamp||0)-e.start,p=Math.sqrt(c*c+h*h)/(d||1),f=[l/(d||1),u/(d||1)],m=function(e,t,n,i){return e>t?n>0?te:ee:i>0?ie:ne}(c,h,l,u),b="number"==typeof n.delta?n.delta:n.delta[m.toLowerCase()]||re.delta;if(c<b&&h<b&&!e.swiping)return e;const g={absX:c,absY:h,deltaX:l,deltaY:u,dir:m,event:t,first:e.first,initial:e.initial,velocity:p,vxvy:f};g.first&&n.onSwipeStart&&n.onSwipeStart(g),n.onSwiping&&n.onSwiping(g);let v=!1;return(n.onSwiping||n.onSwiped||n[`onSwiped${m}`])&&(v=!0),v&&n.preventScrollOnSwipe&&n.trackTouch&&t.cancelable&&t.preventDefault(),Object.assign(Object.assign({},e),{first:!1,eventData:g,swiping:!0})}))},r=t=>{e(((e,n)=>{let i;if(e.swiping&&e.eventData){if(t.timeStamp-e.start<n.swipeDuration){i=Object.assign(Object.assign({},e.eventData),{event:t}),n.onSwiped&&n.onSwiped(i);const r=n[`onSwiped${i.dir}`];r&&r(i)}}else n.onTap&&n.onTap({event:t});return n.onTouchEndOrOnMouseUp&&n.onTouchEndOrOnMouseUp({event:t}),Object.assign(Object.assign(Object.assign({},e),ae),{eventData:i})}))},a=e=>{document.removeEventListener(oe,i),document.removeEventListener(se,a),r(e)},o=(e,t)=>{let a=()=>{};if(e&&e.addEventListener){const o=Object.assign(Object.assign({},re.touchEventOptions),t.touchEventOptions),s=[["touchstart",n,o],["touchmove",i,Object.assign(Object.assign({},o),t.preventScrollOnSwipe?{passive:!1}:{})],["touchend",r,o]];s.forEach((([t,n,i])=>e.addEventListener(t,n,i))),a=()=>s.forEach((([t,n])=>e.removeEventListener(t,n)))}return a},s={ref:t=>{null!==t&&e(((e,n)=>{if(e.el===t)return e;const i={};return e.el&&e.el!==t&&e.cleanUpTouch&&(e.cleanUpTouch(),i.cleanUpTouch=void 0),n.trackTouch&&t&&(i.cleanUpTouch=o(t,n)),Object.assign(Object.assign(Object.assign({},e),{el:t}),i)}))}};return t.trackMouse&&(s.onMouseDown=n),[s,o]}((e=>i.current=e(i.current,r.current)),{trackMouse:t})),[t]);return i.current=function(e,t,n,i){return t.trackTouch&&e.el?e.cleanUpTouch?t.preventScrollOnSwipe!==n.preventScrollOnSwipe||t.touchEventOptions.passive!==n.touchEventOptions.passive?(e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:i(e.el,t)})):e:Object.assign(Object.assign({},e),{cleanUpTouch:i(e.el,t)}):(e.cleanUpTouch&&e.cleanUpTouch(),Object.assign(Object.assign({},e),{cleanUpTouch:void 0}))}(i.current,r.current,a.current,l),s}var ce=i(697);function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function de(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?de(Object(n),!0).forEach((function(t){fe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fe(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==he(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!==he(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===he(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var me={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},be=a().memo((function(e){var t=pe(pe({},me),e),n=t.description,i=t.fullscreen,r=t.handleImageLoaded,o=t.isFullscreen,s=t.onImageError,l=t.original,u=t.originalAlt,c=t.originalHeight,h=t.originalWidth,d=t.originalTitle,p=t.sizes,f=t.srcSet,m=t.loading,b=o&&i||l;return a().createElement(a().Fragment,null,a().createElement("img",{className:"image-gallery-image",src:b,alt:u,srcSet:f,height:c,width:h,sizes:p,title:d,onLoad:function(e){return r(e,l)},onError:s,loading:m}),n&&a().createElement("span",{className:"image-gallery-description"},n))}));be.displayName="Item",be.propTypes={description:ce.string,fullscreen:ce.string,handleImageLoaded:ce.func.isRequired,isFullscreen:ce.bool,onImageError:ce.func.isRequired,original:ce.string.isRequired,originalAlt:ce.string,originalHeight:ce.string,originalWidth:ce.string,originalTitle:ce.string,sizes:ce.string,srcSet:ce.string,loading:ce.string};const ge=be;function ve(e){return ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ve(e)}function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(n),!0).forEach((function(t){Se(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Se(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==ve(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!==ve(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===ve(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Te={left:a().createElement("polyline",{points:"15 18 9 12 15 6"}),right:a().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:a().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:a().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:a().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:a().createElement(a().Fragment,null,a().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),a().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Oe={strokeWidth:1,viewBox:"0 0 24 24"},Ee=function(e){var t=we(we({},Oe),e),n=t.strokeWidth,i=t.viewBox,r=t.icon;return a().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:i,fill:"none",stroke:"currentColor",strokeWidth:n,strokeLinecap:"round",strokeLinejoin:"round"},Te[r])};Ee.propTypes={strokeWidth:ce.number,viewBox:ce.string,icon:(0,ce.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const ke=Ee;var Ie=a().memo((function(e){var t=e.isFullscreen,n=e.onClick;return a().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:n,"aria-label":"Open Fullscreen"},a().createElement(ke,{strokeWidth:2,icon:t?"minimize":"maximize"}))}));Ie.displayName="Fullscreen",Ie.propTypes={isFullscreen:ce.bool.isRequired,onClick:ce.func.isRequired};const je=Ie;var xe=a().memo((function(e){var t=e.disabled,n=e.onClick;return a().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:t,onClick:n,"aria-label":"Previous Slide"},a().createElement(ke,{icon:"left",viewBox:"6 0 12 24"}))}));xe.displayName="LeftNav",xe.propTypes={disabled:ce.bool.isRequired,onClick:ce.func.isRequired};const Pe=xe;var _e=a().memo((function(e){var t=e.disabled,n=e.onClick;return a().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:t,onClick:n,"aria-label":"Next Slide"},a().createElement(ke,{icon:"right",viewBox:"6 0 12 24"}))}));_e.displayName="RightNav",_e.propTypes={disabled:ce.bool.isRequired,onClick:ce.func.isRequired};const Re=_e;var Me=a().memo((function(e){var t=e.isPlaying,n=e.onClick;return a().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:n,"aria-label":"Play or Pause Slideshow"},a().createElement(ke,{strokeWidth:2,icon:t?"pause":"play"}))}));Me.displayName="PlayPause",Me.propTypes={isPlaying:ce.bool.isRequired,onClick:ce.func.isRequired};const Le=Me;function De(e){return De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(e)}function We(){return We=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},We.apply(this,arguments)}function Ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(n),!0).forEach((function(t){ze(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ze(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==De(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!==De(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===De(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ne={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Be=function(e){var t=Fe(Fe({},Ne),e),n=t.children,i=t.className,r=ue({delta:t.delta,onSwiping:t.onSwiping,onSwiped:t.onSwiped});return a().createElement("div",We({},r,{className:i}),n)};Be.propTypes={children:ce.node.isRequired,className:ce.string,delta:ce.number,onSwiped:ce.func,onSwiping:ce.func};const Ae=Be;function Ue(e){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ue(e)}function Ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(n),!0).forEach((function(t){Ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function He(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Je(i.key),i)}}function Ke(e,t){return Ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ke(e,t)}function Ve(e,t){if(t&&("object"===Ue(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xe(e)}function Xe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $e(e){return $e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$e(e)}function Ye(e,t,n){return(t=Je(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Je(e){var t=function(e,t){if("object"!==Ue(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t);if("object"!==Ue(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Ue(t)?t:String(t)}var Qe=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],Ze=(0,ce.arrayOf)((0,ce.shape)({srcSet:ce.string,media:ce.string}));function et(e){var t=parseInt(e.keyCode||e.which||0,10);return 66===t||62===t}var tt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ke(e,t)}(l,e);var n,i,r,o,s=(r=l,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$e(r);if(o){var n=$e(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ve(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),Ye(Xe(t=s.call(this,e)),"onBulletClick",(function(e,n){var i=t.props,r=i.onBulletClick,a=i.items,o=t.state.currentIndex;e.target.blur(),o!==n&&(2===a.length?t.slideToIndexWithStyleReset(n,e):t.slideToIndex(n,e)),r&&r(e,n)})),t.state={currentIndex:e.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(e.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},t.loadedImages={},t.imageGallery=a().createRef(),t.thumbnailsWrapper=a().createRef(),t.thumbnails=a().createRef(),t.imageGallerySlideWrapper=a().createRef(),t.handleImageLoaded=t.handleImageLoaded.bind(Xe(t)),t.handleKeyDown=t.handleKeyDown.bind(Xe(t)),t.handleMouseDown=t.handleMouseDown.bind(Xe(t)),t.handleResize=t.handleResize.bind(Xe(t)),t.handleTouchMove=t.handleTouchMove.bind(Xe(t)),t.handleOnSwiped=t.handleOnSwiped.bind(Xe(t)),t.handleScreenChange=t.handleScreenChange.bind(Xe(t)),t.handleSwiping=t.handleSwiping.bind(Xe(t)),t.handleThumbnailSwiping=t.handleThumbnailSwiping.bind(Xe(t)),t.handleOnThumbnailSwiped=t.handleOnThumbnailSwiped.bind(Xe(t)),t.onThumbnailMouseLeave=t.onThumbnailMouseLeave.bind(Xe(t)),t.handleImageError=t.handleImageError.bind(Xe(t)),t.pauseOrPlay=t.pauseOrPlay.bind(Xe(t)),t.renderThumbInner=t.renderThumbInner.bind(Xe(t)),t.renderItem=t.renderItem.bind(Xe(t)),t.slideLeft=t.slideLeft.bind(Xe(t)),t.slideRight=t.slideRight.bind(Xe(t)),t.toggleFullScreen=t.toggleFullScreen.bind(Xe(t)),t.togglePlay=t.togglePlay.bind(Xe(t)),t.unthrottledSlideToIndex=t.slideToIndex,t.slideToIndex=_(t.unthrottledSlideToIndex,e.slideDuration,{trailing:!1}),e.lazyLoad&&(t.lazyLoaded=[]),t}return n=l,i=[{key:"componentDidMount",value:function(){var e=this.props,t=e.autoPlay,n=e.useWindowKeyDown;t&&this.play(),n?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,i=n.items,r=n.lazyLoad,a=n.slideDuration,o=n.slideInterval,s=n.startIndex,l=n.thumbnailPosition,u=n.showThumbnails,c=n.useWindowKeyDown,h=this.state,d=h.currentIndex,p=h.isPlaying,f=e.items.length!==i.length,m=!M()(e.items,i),b=e.startIndex!==s,g=e.thumbnailPosition!==l,v=e.showThumbnails!==u;o===e.slideInterval&&a===e.slideDuration||p&&(this.pause(),this.play()),g&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),v&&u&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),v&&!u&&this.removeThumbnailsResizeObserver(),(f||v)&&this.handleResize(),t.currentIndex!==d&&this.slideThumbnailBar(),e.slideDuration!==a&&(this.slideToIndex=_(this.unthrottledSlideToIndex,a,{trailing:!1})),!r||e.lazyLoad&&!m||(this.lazyLoaded=[]),c!==e.useWindowKeyDown&&(c?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(b||m)&&this.setState({currentIndex:s,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var e=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),e?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var e=this,t=this.state,n=t.currentIndex,i=t.isTransitioning,r=this.props,a=r.onSlide,o=r.slideDuration;this.transitionTimer=window.setTimeout((function(){i&&(e.setState({isTransitioning:!i,isSwipingThumbnail:!1}),a&&a(n))}),o+50)}},{key:"onThumbnailClick",value:function(e,t){var n=this.props,i=n.onThumbnailClick,r=n.items,a=this.state.currentIndex;e.target.parentNode.parentNode.blur(),a!==t&&(2===r.length?this.slideToIndexWithStyleReset(t,e):this.slideToIndex(t,e)),i&&i(e,t)}},{key:"onThumbnailMouseOver",value:function(e,t){var n=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout((function(){n.slideToIndex(t),n.pause()}),300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var e=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,e&&this.play()}}},{key:"setThumbsTranslate",value:function(e){this.setState({thumbsTranslate:e})}},{key:"setModalFullscreen",value:function(e){var t=this.props.onScreenChange;this.setState({modalFullscreen:e}),t&&t(e)}},{key:"getThumbsTranslate",value:function(e){var t,n=this.props,i=n.disableThumbnailScroll,r=n.items,a=this.state,o=a.thumbnailsWrapperWidth,s=a.thumbnailsWrapperHeight,l=this.thumbnails&&this.thumbnails.current;if(i)return 0;if(l){if(this.isThumbnailVertical()){if(l.scrollHeight<=s)return 0;t=l.scrollHeight-s}else{if(l.scrollWidth<=o||o<=0)return 0;t=l.scrollWidth-o}return e*(t/(r.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(e){switch(e){case"left":e=" ".concat("image-gallery-thumbnails-left");break;case"right":e=" ".concat("image-gallery-thumbnails-right");break;case"bottom":e=" ".concat("image-gallery-thumbnails-bottom");break;case"top":e=" ".concat("image-gallery-thumbnails-top")}return e}},{key:"getAlignmentClassName",value:function(e){var t=this.state.currentIndex,n=this.props,i=n.infinite,r=n.items,a="",o="image-gallery-left",s="image-gallery-right";switch(e){case t-1:a=" ".concat(o);break;case t:a=" ".concat("image-gallery-center");break;case t+1:a=" ".concat(s)}return r.length>=3&&i&&(0===e&&t===r.length-1?a=" ".concat(s):e===r.length-1&&0===t&&(a=" ".concat(o))),a}},{key:"getTranslateXForTwoSlide",value:function(e){var t=this.state,n=t.currentIndex,i=t.currentSlideOffset,r=t.previousIndex,a=n!==r,o=0===e&&0===r,s=1===e&&1===r,l=0===e&&1===n,u=1===e&&0===n,c=0===i,h=-100*n+100*e+i;return i>0?this.direction="left":i<0&&(this.direction="right"),u&&i>0&&(h=-100+i),l&&i<0&&(h=100+i),a?o&&c&&"left"===this.direction?h=100:s&&c&&"right"===this.direction&&(h=-100):(u&&c&&"left"===this.direction&&(h=-100),l&&c&&"right"===this.direction&&(h=100)),h}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(e){var t=this.state,n=t.currentIndex,i=t.currentSlideOffset,r=t.slideStyle,a=this.props,o=a.infinite,s=a.items,l=a.useTranslate3D,u=a.isRTL,c=-100*n,h=s.length-1,d=(c+100*e)*(u?-1:1)+i;o&&s.length>2&&(0===n&&e===h?d=-100*(u?-1:1)+i:n===h&&0===e&&(d=100*(u?-1:1)+i)),o&&2===s.length&&(d=this.getTranslateXForTwoSlide(e));var p="translate(".concat(d,"%, 0)");return l&&(p="translate3d(".concat(d,"%, 0, 0)")),qe({display:this.isSlideVisible(e)?"inherit":"none",WebkitTransform:p,MozTransform:p,msTransform:p,OTransform:p,transform:p},r)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var e,t=this.props,n=t.useTranslate3D,i=t.isRTL,r=this.state,a=r.thumbsTranslate,o=r.thumbsStyle,s=i?-1*a:a;return this.isThumbnailVertical()?(e="translate(0, ".concat(a,"px)"),n&&(e="translate3d(0, ".concat(a,"px, 0)"))):(e="translate(".concat(s,"px, 0)"),n&&(e="translate3d(".concat(s,"px, 0, 0)"))),qe({WebkitTransform:e,MozTransform:e,msTransform:e,OTransform:e,transform:e},o)}},{key:"getSlideItems",value:function(){var e=this,n=this.state.currentIndex,i=this.props,r=i.items,o=i.slideOnThumbnailOver,s=i.onClick,l=i.lazyLoad,u=i.onTouchMove,c=i.onTouchEnd,h=i.onTouchStart,d=i.onMouseOver,p=i.onMouseLeave,f=i.renderItem,m=i.renderThumbInner,b=i.showThumbnails,g=i.showBullets,v=[],y=[],w=[];return r.forEach((function(i,r){var S=e.getAlignmentClassName(r),T=i.originalClass?" ".concat(i.originalClass):"",O=i.thumbnailClass?" ".concat(i.thumbnailClass):"",E=i.renderItem||f||e.renderItem,k=i.renderThumbInner||m||e.renderThumbInner,I=!l||S||e.lazyLoaded[r];I&&l&&!e.lazyLoaded[r]&&(e.lazyLoaded[r]=!0);var j=e.getSlideStyle(r),x=a().createElement("div",{"aria-label":"Go to Slide ".concat(r+1),key:"slide-".concat(r),tabIndex:"-1",className:"image-gallery-slide ".concat(S," ").concat(T),style:j,onClick:s,onKeyUp:e.handleSlideKeyUp,onTouchMove:u,onTouchEnd:c,onTouchStart:h,onMouseOver:d,onFocus:d,onMouseLeave:p,role:"button"},I?E(i):a().createElement("div",{style:{height:"100%"}}));if(v.push(x),b&&i.thumbnail){var P=t("image-gallery-thumbnail",O,{active:n===r});y.push(a().createElement("button",{key:"thumbnail-".concat(r),type:"button",tabIndex:"0","aria-pressed":n===r?"true":"false","aria-label":"Go to Slide ".concat(r+1),className:P,onMouseLeave:o?e.onThumbnailMouseLeave:null,onMouseOver:function(t){return e.handleThumbnailMouseOver(t,r)},onFocus:function(t){return e.handleThumbnailMouseOver(t,r)},onKeyUp:function(t){return e.handleThumbnailKeyUp(t,r)},onClick:function(t){return e.onThumbnailClick(t,r)}},k(i)))}if(g){var _=t("image-gallery-bullet",i.bulletClass,{active:n===r});w.push(a().createElement("button",{type:"button",key:"bullet-".concat(r),className:_,onClick:function(t){return e.onBulletClick(t,r)},"aria-pressed":n===r?"true":"false","aria-label":"Go to Slide ".concat(r+1)}))}})),{slides:v,thumbnails:y,bullets:w}}},{key:"ignoreIsTransitioning",value:function(){var e=this.props.items,t=this.state,n=t.previousIndex,i=t.currentIndex,r=e.length-1;return Math.abs(n-i)>1&&!(0===n&&i===r)&&!(n===r&&0===i)}},{key:"isFirstOrLastSlide",value:function(e){return e===this.props.items.length-1||0===e}},{key:"slideIsTransitioning",value:function(e){var t=this.state,n=t.isTransitioning,i=t.previousIndex,r=t.currentIndex;return n&&!(e===i||e===r)}},{key:"isSlideVisible",value:function(e){return!this.slideIsTransitioning(e)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(e)}},{key:"slideThumbnailBar",value:function(){var e=this.state,t=e.currentIndex,n=e.isSwipingThumbnail,i=-this.getThumbsTranslate(t);n||(0===t?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:i,thumbsSwipedTranslate:i}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(e){var t=e.event,n=e.absX,i=e.dir,r=this.props,a=r.disableSwipe,o=r.stopPropagation,s=this.state,l=s.galleryWidth,u=s.isTransitioning,c=s.swipingUpDown,h=s.swipingLeftRight;if(i!==ne&&i!==ie&&!c||h){if(i!==ee&&i!==te||h||this.setState({swipingLeftRight:!0}),!a){var d=this.props.swipingTransitionDuration;if(o&&t.preventDefault(),u)this.setState({currentSlideOffset:0});else{var p=i===te?1:-1,f=n/l*100;Math.abs(f)>=100&&(f=100);var m={transition:"transform ".concat(d,"ms ease-out")};this.setState({currentSlideOffset:p*f,slideStyle:m})}}}else c||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(e){var t=e.event,n=e.absX,i=e.absY,r=e.dir,a=this.props,o=a.stopPropagation,s=a.swipingThumbnailTransitionDuration,l=this.state,u=l.thumbsSwipedTranslate,c=l.thumbnailsWrapperHeight,h=l.thumbnailsWrapperWidth,d=l.swipingUpDown,p=l.swipingLeftRight;if(this.isThumbnailVertical()){if((r===ee||r===te||p)&&!d)return void(p||this.setState({swipingLeftRight:!0}));r!==ne&&r!==ie||d||this.setState({swipingUpDown:!0})}else{if((r===ne||r===ie||d)&&!p)return void(d||this.setState({swipingUpDown:!0}));r!==ee&&r!==te||p||this.setState({swipingLeftRight:!0})}var f,m,b,g,v,y=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(f=u+(r===ie?i:-i),m=y.scrollHeight-c+20,b=Math.abs(f)>m,g=f>20,v=y.scrollHeight<=c):(f=u+(r===te?n:-n),m=y.scrollWidth-h+20,b=Math.abs(f)>m,g=f>20,v=y.scrollWidth<=h),!v&&(r!==ee&&r!==ne||!b)&&(r!==te&&r!==ie||!g)){o&&t.stopPropagation();var w={transition:"transform ".concat(s,"ms ease-out")};this.setState({thumbsTranslate:f,thumbsStyle:w})}}},{key:"handleOnThumbnailSwiped",value:function(){var e=this.state.thumbsTranslate,t=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:e,thumbsStyle:{transition:"all ".concat(t,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var e=this.state.currentSlideOffset,t=this.props.swipeThreshold;return Math.abs(e)>t}},{key:"resetSwipingDirection",value:function(){var e=this.state,t=e.swipingUpDown,n=e.swipingLeftRight;t&&this.setState({swipingUpDown:!1}),n&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(e){var t=e.event,n=e.dir,i=e.velocity,r=this.props,a=r.disableSwipe,o=r.stopPropagation,s=r.flickThreshold;if(!a){var l=this.props.isRTL;o&&t.stopPropagation(),this.resetSwipingDirection();var u=(n===ee?1:-1)*(l?-1:1),c=i>s&&!(n===ne||n===ie);this.handleOnSwipedTo(u,c)}}},{key:"handleOnSwipedTo",value:function(e,t){var n=this.state,i=n.currentIndex,r=n.isTransitioning,a=i;!this.sufficientSwipe()&&!t||r||(a+=e),(-1===e&&!this.canSlideLeft()||1===e&&!this.canSlideRight())&&(a=i),this.unthrottledSlideToIndex(a)}},{key:"handleTouchMove",value:function(e){this.state.swipingLeftRight&&e.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(e){var t=this.props,n=t.disableKeyDown,i=t.useBrowserFullscreen,r=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!n)switch(parseInt(e.keyCode||e.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(e);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(e);break;case 27:r&&!i&&this.exitFullScreen()}}},{key:"handleImageError",value:function(e){var t=this.props.onErrorImageURL;t&&-1===e.target.src.indexOf(t)&&(e.target.src=t)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var e=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(e)))}},{key:"initSlideWrapperResizeObserver",value:function(e){var t=this;e&&!e.current||(this.resizeSlideWrapperObserver=new Z(P((function(e){e&&e.forEach((function(e){t.setState({thumbnailsWrapperWidth:e.contentRect.width},t.handleResize)}))}),50)),this.resizeSlideWrapperObserver.observe(e.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(e){var t=this;e&&!e.current||(this.resizeThumbnailWrapperObserver=new Z(P((function(e){e&&e.forEach((function(e){t.setState({thumbnailsWrapperHeight:e.contentRect.height},t.handleResize)}))}),50)),this.resizeThumbnailWrapperObserver.observe(e.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var e=this.props,t=e.onScreenChange,n=e.useBrowserFullscreen,i=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,r=this.imageGallery.current===i;t&&t(r),n&&this.setState({isFullscreen:r})}},{key:"slideToIndex",value:function(e,t){var n=this.state,i=n.currentIndex,r=n.isTransitioning,a=this.props,o=a.items,s=a.slideDuration,l=a.onBeforeSlide;if(!r){t&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var u=o.length-1,c=e;e<0?c=u:e>u&&(c=0),l&&c!==i&&l(c),this.setState({previousIndex:i,currentIndex:c,isTransitioning:c!==i,currentSlideOffset:0,slideStyle:{transition:"all ".concat(s,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(e){var t=this.props.isRTL;this.slideTo(e,t?"right":"left")}},{key:"slideRight",value:function(e){var t=this.props.isRTL;this.slideTo(e,t?"left":"right")}},{key:"slideTo",value:function(e,t){var n=this.state,i=n.currentIndex,r=n.isTransitioning,a=this.props.items,o=i+("left"===t?-1:1);r||(2===a.length?this.slideToIndexWithStyleReset(o,e):this.slideToIndex(o,e))}},{key:"slideToIndexWithStyleReset",value:function(e,t){var n=this,i=this.state,r=i.currentIndex,a=i.currentSlideOffset;this.setState({currentSlideOffset:a+(r>e?.001:-.001),slideStyle:{transition:"none"}},(function(){window.setTimeout((function(){return n.slideToIndex(e,t)}),25)}))}},{key:"handleThumbnailMouseOver",value:function(e,t){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(e,t)}},{key:"handleThumbnailKeyUp",value:function(e,t){et(e)&&this.onThumbnailClick(e,t)}},{key:"handleSlideKeyUp",value:function(e){et(e)&&(0,this.props.onClick)(e)}},{key:"isThumbnailVertical",value:function(){var e=this.props.thumbnailPosition;return"left"===e||"right"===e}},{key:"addScreenChangeEvent",value:function(){var e=this;Qe.forEach((function(t){document.addEventListener(t,e.handleScreenChange)}))}},{key:"removeScreenChangeEvent",value:function(){var e=this;Qe.forEach((function(t){document.removeEventListener(t,e.handleScreenChange)}))}},{key:"fullScreen",value:function(){var e=this.props.useBrowserFullscreen,t=this.imageGallery.current;e?t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var e=this.state.isFullscreen,t=this.props.useBrowserFullscreen;e&&(t?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var e=this.props.infinite,t=this.state.currentIndex;e||this.canSlideRight()?this.slideToIndex(t+1):this.pause()}},{key:"play",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.props,n=t.onPlay,i=t.slideInterval,r=t.slideDuration,a=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(i,r)),n&&e&&n(a))}},{key:"pause",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.props.onPause,n=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),t&&e&&t(n))}},{key:"isImageLoaded",value:function(e){return!!this.loadedImages[e.original]||(this.loadedImages[e.original]=!0,!1)}},{key:"handleImageLoaded",value:function(e,t){var n=this.props.onImageLoad;!this.loadedImages[t]&&n&&(this.loadedImages[t]=!0,n(e))}},{key:"renderItem",value:function(e){var t=this.state.isFullscreen,n=this.props.onImageError||this.handleImageError;return a().createElement(ge,{description:e.description,fullscreen:e.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:t,onImageError:n,original:e.original,originalAlt:e.originalAlt,originalHeight:e.originalHeight,originalWidth:e.originalWidth,originalTitle:e.originalTitle,sizes:e.sizes,loading:e.loading,srcSet:e.srcSet})}},{key:"renderThumbInner",value:function(e){var t=this.props.onThumbnailError||this.handleImageError;return a().createElement("span",{className:"image-gallery-thumbnail-inner"},a().createElement("img",{className:"image-gallery-thumbnail-image",src:e.thumbnail,height:e.thumbnailHeight,width:e.thumbnailWidth,alt:e.thumbnailAlt,title:e.thumbnailTitle,loading:e.thumbnailLoading,onError:t}),e.thumbnailLabel&&a().createElement("div",{className:"image-gallery-thumbnail-label"},e.thumbnailLabel))}},{key:"render",value:function(){var e=this.state,n=e.currentIndex,i=e.isFullscreen,r=e.modalFullscreen,o=e.isPlaying,s=this.props,l=s.additionalClass,u=s.disableThumbnailSwipe,c=s.indexSeparator,h=s.isRTL,d=s.items,p=s.thumbnailPosition,f=s.renderFullscreenButton,m=s.renderCustomControls,b=s.renderLeftNav,g=s.renderRightNav,v=s.showBullets,y=s.showFullscreenButton,w=s.showIndex,S=s.showThumbnails,T=s.showNav,O=s.showPlayButton,E=s.renderPlayPauseButton,k=this.getThumbnailStyle(),I=this.getSlideItems(),j=I.slides,x=I.thumbnails,P=I.bullets,_=t("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(p),{"image-gallery-rtl":h}),R=a().createElement("div",{ref:this.imageGallerySlideWrapper,className:_},m&&m(),this.canSlide()?a().createElement(a().Fragment,null,T&&a().createElement(a().Fragment,null,b(this.slideLeft,!this.canSlideLeft()),g(this.slideRight,!this.canSlideRight())),a().createElement(Ae,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},a().createElement("div",{className:"image-gallery-slides"},j))):a().createElement("div",{className:"image-gallery-slides"},j),O&&E(this.togglePlay,o),v&&a().createElement("div",{className:"image-gallery-bullets"},a().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},P)),y&&f(this.toggleFullScreen,i),w&&a().createElement("div",{className:"image-gallery-index"},a().createElement("span",{className:"image-gallery-index-current"},n+1),a().createElement("span",{className:"image-gallery-index-separator"},c),a().createElement("span",{className:"image-gallery-index-total"},d.length))),M=t("image-gallery",l,{"fullscreen-modal":r}),L=t("image-gallery-content",this.getThumbnailPositionClassName(p),{fullscreen:i}),D=t("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(p),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&h},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!u},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!u});return a().createElement("div",{ref:this.imageGallery,className:M,"aria-live":"polite"},a().createElement("div",{className:L},("bottom"===p||"right"===p)&&R,S&&x.length>0?a().createElement(Ae,{className:D,delta:0,onSwiping:!u&&this.handleThumbnailSwiping,onSwiped:!u&&this.handleOnThumbnailSwiped},a().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},a().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:k,"aria-label":"Thumbnail Navigation"},x))):null,("top"===p||"left"===p)&&R))}}],i&&He(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),l}(a().Component);tt.propTypes={flickThreshold:ce.number,items:(0,ce.arrayOf)((0,ce.shape)({bulletClass:ce.string,bulletOnClick:ce.func,description:ce.string,original:ce.string,originalHeight:ce.number,originalWidth:ce.number,loading:ce.string,thumbnailHeight:ce.number,thumbnailWidth:ce.number,thumbnailLoading:ce.string,fullscreen:ce.string,originalAlt:ce.string,originalTitle:ce.string,thumbnail:ce.string,thumbnailAlt:ce.string,thumbnailLabel:ce.string,thumbnailTitle:ce.string,originalClass:ce.string,thumbnailClass:ce.string,renderItem:ce.func,renderThumbInner:ce.func,imageSet:Ze,srcSet:ce.string,sizes:ce.string})).isRequired,showNav:ce.bool,autoPlay:ce.bool,lazyLoad:ce.bool,infinite:ce.bool,showIndex:ce.bool,showBullets:ce.bool,showThumbnails:ce.bool,showPlayButton:ce.bool,showFullscreenButton:ce.bool,disableThumbnailScroll:ce.bool,disableKeyDown:ce.bool,disableSwipe:ce.bool,disableThumbnailSwipe:ce.bool,useBrowserFullscreen:ce.bool,onErrorImageURL:ce.string,indexSeparator:ce.string,thumbnailPosition:(0,ce.oneOf)(["top","bottom","left","right"]),startIndex:ce.number,slideDuration:ce.number,slideInterval:ce.number,slideOnThumbnailOver:ce.bool,swipeThreshold:ce.number,swipingTransitionDuration:ce.number,swipingThumbnailTransitionDuration:ce.number,onSlide:ce.func,onBeforeSlide:ce.func,onScreenChange:ce.func,onPause:ce.func,onPlay:ce.func,onClick:ce.func,onImageLoad:ce.func,onImageError:ce.func,onTouchMove:ce.func,onTouchEnd:ce.func,onTouchStart:ce.func,onMouseOver:ce.func,onMouseLeave:ce.func,onBulletClick:ce.func,onThumbnailError:ce.func,onThumbnailClick:ce.func,renderCustomControls:ce.func,renderLeftNav:ce.func,renderRightNav:ce.func,renderPlayPauseButton:ce.func,renderFullscreenButton:ce.func,renderItem:ce.func,renderThumbInner:ce.func,stopPropagation:ce.bool,additionalClass:ce.string,useTranslate3D:ce.bool,isRTL:ce.bool,useWindowKeyDown:ce.bool},tt.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(e,t){return a().createElement(Pe,{onClick:e,disabled:t})},renderRightNav:function(e,t){return a().createElement(Re,{onClick:e,disabled:t})},renderPlayPauseButton:function(e,t){return a().createElement(Le,{onClick:e,isPlaying:t})},renderFullscreenButton:function(e,t){return a().createElement(je,{onClick:e,isFullscreen:t})},useWindowKeyDown:!0};const nt=tt})(),r})()));

/***/ }),

/***/ 5301:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/**
 * This is a straight rip-off of the React.js ReactPropTypes.js proptype validators,
 * modified to make it possible to validate Immutable.js data.
 *     ImmutableTypes.listOf is patterned after React.PropTypes.arrayOf, but for Immutable.List
 *     ImmutableTypes.shape  is based on React.PropTypes.shape, but for any Immutable.Iterable
 */


var Immutable = __webpack_require__(3096);

var ANONYMOUS = "<<anonymous>>";

var ImmutablePropTypes;

if (false) {} else {
  var productionTypeChecker = function productionTypeChecker() {
    invariant(false, "ImmutablePropTypes type checking code is stripped in production.");
  };
  productionTypeChecker.isRequired = productionTypeChecker;
  var getProductionTypeChecker = function getProductionTypeChecker() {
    return productionTypeChecker;
  };

  ImmutablePropTypes = {
    listOf: getProductionTypeChecker,
    mapOf: getProductionTypeChecker,
    orderedMapOf: getProductionTypeChecker,
    setOf: getProductionTypeChecker,
    orderedSetOf: getProductionTypeChecker,
    stackOf: getProductionTypeChecker,
    iterableOf: getProductionTypeChecker,
    recordOf: getProductionTypeChecker,
    shape: getProductionTypeChecker,
    contains: getProductionTypeChecker,
    mapContains: getProductionTypeChecker,
    orderedMapContains: getProductionTypeChecker,
    // Primitive Types
    list: productionTypeChecker,
    map: productionTypeChecker,
    orderedMap: productionTypeChecker,
    set: productionTypeChecker,
    orderedSet: productionTypeChecker,
    stack: productionTypeChecker,
    seq: productionTypeChecker,
    record: productionTypeChecker,
    iterable: productionTypeChecker
  };
}

ImmutablePropTypes.iterable.indexed = createIterableSubclassTypeChecker("Indexed", Immutable.Iterable.isIndexed);
ImmutablePropTypes.iterable.keyed = createIterableSubclassTypeChecker("Keyed", Immutable.Iterable.isKeyed);

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 (propValue instanceof Immutable.Iterable) {
    return "Immutable." + propValue.toSource().split(" ")[0];
  }
  return propType;
}

function createChainableTypeChecker(validate) {
  function checkType(isRequired, props, propName, componentName, location, propFullName) {
    for (var _len = arguments.length, rest = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {
      rest[_key - 6] = arguments[_key];
    }

    propFullName = propFullName || propName;
    componentName = componentName || ANONYMOUS;
    if (props[propName] == null) {
      var locationName = location;
      if (isRequired) {
        return new Error("Required " + locationName + " `" + propFullName + "` was not specified in " + ("`" + componentName + "`."));
      }
    } else {
      return validate.apply(undefined, [props, propName, componentName, location, propFullName].concat(rest));
    }
  }

  var chainedCheckType = checkType.bind(null, false);
  chainedCheckType.isRequired = checkType.bind(null, true);

  return chainedCheckType;
}

function createImmutableTypeChecker(immutableClassName, immutableClassTypeValidator) {
  function validate(props, propName, componentName, location, propFullName) {
    var propValue = props[propName];
    if (!immutableClassTypeValidator(propValue)) {
      var propType = getPropType(propValue);
      return new Error("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `" + immutableClassName + "`."));
    }
    return null;
  }
  return createChainableTypeChecker(validate);
}

function createIterableSubclassTypeChecker(subclassName, validator) {
  return createImmutableTypeChecker("Iterable." + subclassName, function (propValue) {
    return Immutable.Iterable.isIterable(propValue) && validator(propValue);
  });
}

function createIterableTypeChecker(typeChecker, immutableClassName, immutableClassTypeValidator) {

  function validate(props, propName, componentName, location, propFullName) {
    for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
      rest[_key - 5] = arguments[_key];
    }

    var propValue = props[propName];
    if (!immutableClassTypeValidator(propValue)) {
      var locationName = location;
      var propType = getPropType(propValue);
      return new Error("Invalid " + locationName + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an Immutable.js " + immutableClassName + "."));
    }

    if (typeof typeChecker !== "function") {
      return new Error("Invalid typeChecker supplied to `" + componentName + "` " + ("for propType `" + propFullName + "`, expected a function."));
    }

    var propValues = propValue.valueSeq().toArray();
    for (var i = 0, len = propValues.length; i < len; i++) {
      var error = typeChecker.apply(undefined, [propValues, i, componentName, location, "" + propFullName + "[" + i + "]"].concat(rest));
      if (error instanceof Error) {
        return error;
      }
    }
  }
  return createChainableTypeChecker(validate);
}

function createKeysTypeChecker(typeChecker) {

  function validate(props, propName, componentName, location, propFullName) {
    for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
      rest[_key - 5] = arguments[_key];
    }

    var propValue = props[propName];
    if (typeof typeChecker !== "function") {
      return new Error("Invalid keysTypeChecker (optional second argument) supplied to `" + componentName + "` " + ("for propType `" + propFullName + "`, expected a function."));
    }

    var keys = propValue.keySeq().toArray();
    for (var i = 0, len = keys.length; i < len; i++) {
      var error = typeChecker.apply(undefined, [keys, i, componentName, location, "" + propFullName + " -> key(" + keys[i] + ")"].concat(rest));
      if (error instanceof Error) {
        return error;
      }
    }
  }
  return createChainableTypeChecker(validate);
}

function createListOfTypeChecker(typeChecker) {
  return createIterableTypeChecker(typeChecker, "List", Immutable.List.isList);
}

function createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, immutableClassName, immutableClassTypeValidator) {
  function validate() {
    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return createIterableTypeChecker(valuesTypeChecker, immutableClassName, immutableClassTypeValidator).apply(undefined, args) || keysTypeChecker && createKeysTypeChecker(keysTypeChecker).apply(undefined, args);
  }

  return createChainableTypeChecker(validate);
}

function createMapOfTypeChecker(valuesTypeChecker, keysTypeChecker) {
  return createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, "Map", Immutable.Map.isMap);
}

function createOrderedMapOfTypeChecker(valuesTypeChecker, keysTypeChecker) {
  return createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, "OrderedMap", Immutable.OrderedMap.isOrderedMap);
}

function createSetOfTypeChecker(typeChecker) {
  return createIterableTypeChecker(typeChecker, "Set", Immutable.Set.isSet);
}

function createOrderedSetOfTypeChecker(typeChecker) {
  return createIterableTypeChecker(typeChecker, "OrderedSet", Immutable.OrderedSet.isOrderedSet);
}

function createStackOfTypeChecker(typeChecker) {
  return createIterableTypeChecker(typeChecker, "Stack", Immutable.Stack.isStack);
}

function createIterableOfTypeChecker(typeChecker) {
  return createIterableTypeChecker(typeChecker, "Iterable", Immutable.Iterable.isIterable);
}

function createRecordOfTypeChecker(recordKeys) {
  function validate(props, propName, componentName, location, propFullName) {
    for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
      rest[_key - 5] = arguments[_key];
    }

    var propValue = props[propName];
    if (!(propValue instanceof Immutable.Record)) {
      var propType = getPropType(propValue);
      var locationName = location;
      return new Error("Invalid " + locationName + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected an Immutable.js Record."));
    }
    for (var key in recordKeys) {
      var checker = recordKeys[key];
      if (!checker) {
        continue;
      }
      var mutablePropValue = propValue.toObject();
      var error = checker.apply(undefined, [mutablePropValue, key, componentName, location, "" + propFullName + "." + key].concat(rest));
      if (error) {
        return error;
      }
    }
  }
  return createChainableTypeChecker(validate);
}

// there is some irony in the fact that shapeTypes is a standard hash and not an immutable collection
function createShapeTypeChecker(shapeTypes) {
  var immutableClassName = arguments[1] === undefined ? "Iterable" : arguments[1];
  var immutableClassTypeValidator = arguments[2] === undefined ? Immutable.Iterable.isIterable : arguments[2];

  function validate(props, propName, componentName, location, propFullName) {
    for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
      rest[_key - 5] = arguments[_key];
    }

    var propValue = props[propName];
    if (!immutableClassTypeValidator(propValue)) {
      var propType = getPropType(propValue);
      var locationName = location;
      return new Error("Invalid " + locationName + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected an Immutable.js " + immutableClassName + "."));
    }
    var mutablePropValue = propValue.toObject();
    for (var key in shapeTypes) {
      var checker = shapeTypes[key];
      if (!checker) {
        continue;
      }
      var error = checker.apply(undefined, [mutablePropValue, key, componentName, location, "" + propFullName + "." + key].concat(rest));
      if (error) {
        return error;
      }
    }
  }
  return createChainableTypeChecker(validate);
}

function createShapeChecker(shapeTypes) {
  return createShapeTypeChecker(shapeTypes);
}

function createMapContainsChecker(shapeTypes) {
  return createShapeTypeChecker(shapeTypes, "Map", Immutable.Map.isMap);
}

function createOrderedMapContainsChecker(shapeTypes) {
  return createShapeTypeChecker(shapeTypes, "OrderedMap", Immutable.OrderedMap.isOrderedMap);
}

module.exports = ImmutablePropTypes;

/***/ }),

/***/ 8618:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));

var _postcssValueParser = __webpack_require__(5482);

var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);

var _parser = __webpack_require__(4579);

var _reducer = __webpack_require__(6018);

var _reducer2 = _interopRequireDefault(_reducer);

var _stringifier = __webpack_require__(2459);

var _stringifier2 = _interopRequireDefault(_stringifier);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// eslint-disable-line
var MATCH_CALC = /((?:\-[a-z]+\-)?calc)/;

exports["default"] = function (value) {
  var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;

  return (0, _postcssValueParser2.default)(value).walk(function (node) {
    // skip anything which isn't a calc() function
    if (node.type !== 'function' || !MATCH_CALC.test(node.value)) return;

    // stringify calc expression and produce an AST
    var contents = _postcssValueParser2.default.stringify(node.nodes);

    // skip constant() and env()
    if (contents.indexOf('constant') >= 0 || contents.indexOf('env') >= 0) return;

    var ast = _parser.parser.parse(contents);

    // reduce AST to its simplest form, that is, either to a single value
    // or a simplified calc expression
    var reducedAst = (0, _reducer2.default)(ast, precision);

    // stringify AST and write it back
    node.type = 'word';
    node.value = (0, _stringifier2.default)(node.value, reducedAst, precision);
  }, true).toString();
};

module.exports = exports['default'];

/***/ }),

/***/ 6293:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));

var _cssUnitConverter = __webpack_require__(2480);

var _cssUnitConverter2 = _interopRequireDefault(_cssUnitConverter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function convertNodes(left, right, precision) {
  switch (left.type) {
    case 'LengthValue':
    case 'AngleValue':
    case 'TimeValue':
    case 'FrequencyValue':
    case 'ResolutionValue':
      return convertAbsoluteLength(left, right, precision);
    default:
      return { left: left, right: right };
  }
}

function convertAbsoluteLength(left, right, precision) {
  if (right.type === left.type) {
    right = {
      type: left.type,
      value: (0, _cssUnitConverter2.default)(right.value, right.unit, left.unit, precision),
      unit: left.unit
    };
  }
  return { left: left, right: right };
}

exports["default"] = convertNodes;
module.exports = exports['default'];

/***/ }),

/***/ 6018:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.flip = flip;

var _convert = __webpack_require__(6293);

var _convert2 = _interopRequireDefault(_convert);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function reduce(node, precision) {
  if (node.type === "MathExpression") return reduceMathExpression(node, precision);
  if (node.type === "Calc") return reduce(node.value, precision);

  return node;
}

function isEqual(left, right) {
  return left.type === right.type && left.value === right.value;
}

function isValueType(type) {
  switch (type) {
    case 'LengthValue':
    case 'AngleValue':
    case 'TimeValue':
    case 'FrequencyValue':
    case 'ResolutionValue':
    case 'EmValue':
    case 'ExValue':
    case 'ChValue':
    case 'RemValue':
    case 'VhValue':
    case 'VwValue':
    case 'VminValue':
    case 'VmaxValue':
    case 'PercentageValue':
    case 'Value':
      return true;
  }
  return false;
}

function convertMathExpression(node, precision) {
  var nodes = (0, _convert2.default)(node.left, node.right, precision);
  var left = reduce(nodes.left, precision);
  var right = reduce(nodes.right, precision);

  if (left.type === "MathExpression" && right.type === "MathExpression") {

    if (left.operator === '/' && right.operator === '*' || left.operator === '-' && right.operator === '+' || left.operator === '*' && right.operator === '/' || left.operator === '+' && right.operator === '-') {

      if (isEqual(left.right, right.right)) nodes = (0, _convert2.default)(left.left, right.left, precision);else if (isEqual(left.right, right.left)) nodes = (0, _convert2.default)(left.left, right.right, precision);

      left = reduce(nodes.left, precision);
      right = reduce(nodes.right, precision);
    }
  }

  node.left = left;
  node.right = right;
  return node;
}

function flip(operator) {
  return operator === '+' ? '-' : '+';
}

function flipValue(node) {
  if (isValueType(node.type)) node.value = -node.value;else if (node.type == 'MathExpression') {
    node.left = flipValue(node.left);
    node.right = flipValue(node.right);
  }
  return node;
}

function reduceAddSubExpression(node, precision) {
  var _node = node,
      left = _node.left,
      right = _node.right,
      op = _node.operator;


  if (left.type === 'CssVariable' || right.type === 'CssVariable') return node;

  // something + 0 => something
  // something - 0 => something
  if (right.value === 0) return left;

  // 0 + something => something
  if (left.value === 0 && op === "+") return right;

  // 0 - something => -something
  if (left.value === 0 && op === "-") return flipValue(right);

  // value + value
  // value - value
  if (left.type === right.type && isValueType(left.type)) {
    node = Object.assign({}, left);
    if (op === "+") node.value = left.value + right.value;else node.value = left.value - right.value;
  }

  // value <op> (expr)
  if (isValueType(left.type) && (right.operator === '+' || right.operator === '-') && right.type === 'MathExpression') {
    // value + (value + something) => (value + value) + something
    // value + (value - something) => (value + value) - something
    // value - (value + something) => (value - value) - something
    // value - (value - something) => (value - value) + something
    if (left.type === right.left.type) {
      node = Object.assign({}, node);
      node.left = reduce({
        type: 'MathExpression',
        operator: op,
        left: left,
        right: right.left
      }, precision);
      node.right = right.right;
      node.operator = op === '-' ? flip(right.operator) : right.operator;
      return reduce(node, precision);
    }
    // value + (something + value) => (value + value) + something
    // value + (something - value) => (value - value) + something
    // value - (something + value) => (value - value) - something
    // value - (something - value) => (value + value) - something
    else if (left.type === right.right.type) {
        node = Object.assign({}, node);
        node.left = reduce({
          type: 'MathExpression',
          operator: op === '-' ? flip(right.operator) : right.operator,
          left: left,
          right: right.right
        }, precision);
        node.right = right.left;
        return reduce(node, precision);
      }
  }

  // (expr) <op> value
  if (left.type === 'MathExpression' && (left.operator === '+' || left.operator === '-') && isValueType(right.type)) {
    // (value + something) + value => (value + value) + something
    // (value - something) + value => (value + value) - something
    // (value + something) - value => (value - value) + something
    // (value - something) - value => (value - value) - something
    if (right.type === left.left.type) {
      node = Object.assign({}, left);
      node.left = reduce({
        type: 'MathExpression',
        operator: op,
        left: left.left,
        right: right
      }, precision);
      return reduce(node, precision);
    }
    // (something + value) + value => something + (value + value)
    // (something - value1) + value2 => something - (value2 - value1)
    // (something + value) - value => something + (value - value)
    // (something - value) - value => something - (value + value)
    else if (right.type === left.right.type) {
        node = Object.assign({}, left);
        if (left.operator === '-') {
          node.right = reduce({
            type: 'MathExpression',
            operator: op === '-' ? '+' : '-',
            left: right,
            right: left.right
          }, precision);
          node.operator = op === '-' ? '-' : '+';
        } else {
          node.right = reduce({
            type: 'MathExpression',
            operator: op,
            left: left.right,
            right: right
          }, precision);
        }
        if (node.right.value < 0) {
          node.right.value *= -1;
          node.operator = node.operator === '-' ? '+' : '-';
        }
        return reduce(node, precision);
      }
  }
  return node;
}

function reduceDivisionExpression(node, precision) {
  if (!isValueType(node.right.type)) return node;

  if (node.right.type !== 'Value') throw new Error("Cannot divide by \"" + node.right.unit + "\", number expected");

  if (node.right.value === 0) throw new Error('Cannot divide by zero');

  // (expr) / value
  if (node.left.type === 'MathExpression') {
    if (isValueType(node.left.left.type) && isValueType(node.left.right.type)) {
      node.left.left.value /= node.right.value;
      node.left.right.value /= node.right.value;
      return reduce(node.left, precision);
    }
    return node;
  }
  // something / value
  else if (isValueType(node.left.type)) {
      node.left.value /= node.right.value;
      return node.left;
    }
  return node;
}

function reduceMultiplicationExpression(node) {
  // (expr) * value
  if (node.left.type === 'MathExpression' && node.right.type === 'Value') {
    if (isValueType(node.left.left.type) && isValueType(node.left.right.type)) {
      node.left.left.value *= node.right.value;
      node.left.right.value *= node.right.value;
      return node.left;
    }
  }
  // something * value
  else if (isValueType(node.left.type) && node.right.type === 'Value') {
      node.left.value *= node.right.value;
      return node.left;
    }
    // value * (expr)
    else if (node.left.type === 'Value' && node.right.type === 'MathExpression') {
        if (isValueType(node.right.left.type) && isValueType(node.right.right.type)) {
          node.right.left.value *= node.left.value;
          node.right.right.value *= node.left.value;
          return node.right;
        }
      }
      // value * something
      else if (node.left.type === 'Value' && isValueType(node.right.type)) {
          node.right.value *= node.left.value;
          return node.right;
        }
  return node;
}

function reduceMathExpression(node, precision) {
  node = convertMathExpression(node, precision);

  switch (node.operator) {
    case "+":
    case "-":
      return reduceAddSubExpression(node, precision);
    case "/":
      return reduceDivisionExpression(node, precision);
    case "*":
      return reduceMultiplicationExpression(node);
  }
  return node;
}

exports["default"] = reduce;

/***/ }),

/***/ 2459:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));

exports["default"] = function (calc, node, precision) {
  var str = stringify(node, precision);

  if (node.type === "MathExpression") {
    // if calc expression couldn't be resolved to a single value, re-wrap it as
    // a calc()
    str = calc + "(" + str + ")";
  }
  return str;
};

var _reducer = __webpack_require__(6018);

var order = {
  "*": 0,
  "/": 0,
  "+": 1,
  "-": 1
};

function round(value, prec) {
  if (prec !== false) {
    var precision = Math.pow(10, prec);
    return Math.round(value * precision) / precision;
  }
  return value;
}

function stringify(node, prec) {
  switch (node.type) {
    case "MathExpression":
      {
        var left = node.left,
            right = node.right,
            op = node.operator;

        var str = "";

        if (left.type === 'MathExpression' && order[op] < order[left.operator]) str += "(" + stringify(left, prec) + ")";else str += stringify(left, prec);

        str += " " + node.operator + " ";

        if (right.type === 'MathExpression' && order[op] < order[right.operator]) {
          str += "(" + stringify(right, prec) + ")";
        } else if (right.type === 'MathExpression' && op === "-" && ["+", "-"].includes(right.operator)) {
          // fix #52 : a-(b+c) = a-b-c
          right.operator = (0, _reducer.flip)(right.operator);
          str += stringify(right, prec);
        } else {
          str += stringify(right, prec);
        }

        return str;
      }
    case "Value":
      return round(node.value, prec);
    case 'CssVariable':
      if (node.fallback) {
        return "var(" + node.value + ", " + stringify(node.fallback, prec, true) + ")";
      }
      return "var(" + node.value + ")";
    case 'Calc':
      if (node.prefix) {
        return "-" + node.prefix + "-calc(" + stringify(node.value, prec) + ")";
      }
      return "calc(" + stringify(node.value, prec) + ")";
    default:
      return round(node.value, prec) + node.unit;
  }
}

module.exports = exports["default"];

/***/ }),

/***/ 4579:
/***/ (function(__unused_webpack_module, exports) {


/* parser generated by jison 0.6.1-215 */

/*
 * Returns a Parser object of the following structure:
 *
 *  Parser: {
 *    yy: {}     The so-called "shared state" or rather the *source* of it;
 *               the real "shared state" `yy` passed around to
 *               the rule actions, etc. is a derivative/copy of this one,
 *               not a direct reference!
 *  }
 *
 *  Parser.prototype: {
 *    yy: {},
 *    EOF: 1,
 *    TERROR: 2,
 *
 *    trace: function(errorMessage, ...),
 *
 *    JisonParserError: function(msg, hash),
 *
 *    quoteName: function(name),
 *               Helper function which can be overridden by user code later on: put suitable
 *               quotes around literal IDs in a description string.
 *
 *    originalQuoteName: function(name),
 *               The basic quoteName handler provided by JISON.
 *               `cleanupAfterParse()` will clean up and reset `quoteName()` to reference this function
 *               at the end of the `parse()`.
 *
 *    describeSymbol: function(symbol),
 *               Return a more-or-less human-readable description of the given symbol, when
 *               available, or the symbol itself, serving as its own 'description' for lack
 *               of something better to serve up.
 *
 *               Return NULL when the symbol is unknown to the parser.
 *
 *    symbols_: {associative list: name ==> number},
 *    terminals_: {associative list: number ==> name},
 *    nonterminals: {associative list: rule-name ==> {associative list: number ==> rule-alt}},
 *    terminal_descriptions_: (if there are any) {associative list: number ==> description},
 *    productions_: [...],
 *
 *    performAction: function parser__performAction(yytext, yyleng, yylineno, yyloc, yystate, yysp, yyvstack, yylstack, yystack, yysstack),
 *
 *               The function parameters and `this` have the following value/meaning:
 *               - `this`    : reference to the `yyval` internal object, which has members (`$` and `_$`)
 *                             to store/reference the rule value `$$` and location info `@$`.
 *
 *                 One important thing to note about `this` a.k.a. `yyval`: every *reduce* action gets
 *                 to see the same object via the `this` reference, i.e. if you wish to carry custom
 *                 data from one reduce action through to the next within a single parse run, then you
 *                 may get nasty and use `yyval` a.k.a. `this` for storing you own semi-permanent data.
 *
 *                 `this.yy` is a direct reference to the `yy` shared state object.
 *
 *                 `%parse-param`-specified additional `parse()` arguments have been added to this `yy`
 *                 object at `parse()` start and are therefore available to the action code via the
 *                 same named `yy.xxxx` attributes (where `xxxx` represents a identifier name from
 *                 the %parse-param` list.
 *
 *               - `yytext`  : reference to the lexer value which belongs to the last lexer token used
 *                             to match this rule. This is *not* the look-ahead token, but the last token
 *                             that's actually part of this rule.
 *
 *                 Formulated another way, `yytext` is the value of the token immediately preceeding
 *                 the current look-ahead token.
 *                 Caveats apply for rules which don't require look-ahead, such as epsilon rules.
 *
 *               - `yyleng`  : ditto as `yytext`, only now for the lexer.yyleng value.
 *
 *               - `yylineno`: ditto as `yytext`, only now for the lexer.yylineno value.
 *
 *               - `yyloc`   : ditto as `yytext`, only now for the lexer.yylloc lexer token location info.
 *
 *                               WARNING: since jison 0.4.18-186 this entry may be NULL/UNDEFINED instead
 *                               of an empty object when no suitable location info can be provided.
 *
 *               - `yystate` : the current parser state number, used internally for dispatching and
 *                               executing the action code chunk matching the rule currently being reduced.
 *
 *               - `yysp`    : the current state stack position (a.k.a. 'stack pointer')
 *
 *                 This one comes in handy when you are going to do advanced things to the parser
 *                 stacks, all of which are accessible from your action code (see the next entries below).
 *
 *                 Also note that you can access this and other stack index values using the new double-hash
 *                 syntax, i.e. `##$ === ##0 === yysp`, while `##1` is the stack index for all things
 *                 related to the first rule term, just like you have `$1`, `@1` and `#1`.
 *                 This is made available to write very advanced grammar action rules, e.g. when you want
 *                 to investigate the parse state stack in your action code, which would, for example,
 *                 be relevant when you wish to implement error diagnostics and reporting schemes similar
 *                 to the work described here:
 *
 *                 + Pottier, F., 2016. Reachability and error diagnosis in LR(1) automata.
 *                   In Journées Francophones des Languages Applicatifs.
 *
 *                 + Jeffery, C.L., 2003. Generating LR syntax error messages from examples.
 *                   ACM Transactions on Programming Languages and Systems (TOPLAS), 25(5), pp.631–640.
 *
 *               - `yyrulelength`: the current rule's term count, i.e. the number of entries occupied on the stack.
 *
 *                 This one comes in handy when you are going to do advanced things to the parser
 *                 stacks, all of which are accessible from your action code (see the next entries below).
 *
 *               - `yyvstack`: reference to the parser value stack. Also accessed via the `$1` etc.
 *                             constructs.
 *
 *               - `yylstack`: reference to the parser token location stack. Also accessed via
 *                             the `@1` etc. constructs.
 *
 *                             WARNING: since jison 0.4.18-186 this array MAY contain slots which are
 *                             UNDEFINED rather than an empty (location) object, when the lexer/parser
 *                             action code did not provide a suitable location info object when such a
 *                             slot was filled!
 *
 *               - `yystack` : reference to the parser token id stack. Also accessed via the
 *                             `#1` etc. constructs.
 *
 *                 Note: this is a bit of a **white lie** as we can statically decode any `#n` reference to
 *                 its numeric token id value, hence that code wouldn't need the `yystack` but *you* might
 *                 want access this array for your own purposes, such as error analysis as mentioned above!
 *
 *                 Note that this stack stores the current stack of *tokens*, that is the sequence of
 *                 already parsed=reduced *nonterminals* (tokens representing rules) and *terminals*
 *                 (lexer tokens *shifted* onto the stack until the rule they belong to is found and
 *                 *reduced*.
 *
 *               - `yysstack`: reference to the parser state stack. This one carries the internal parser
 *                             *states* such as the one in `yystate`, which are used to represent
 *                             the parser state machine in the *parse table*. *Very* *internal* stuff,
 *                             what can I say? If you access this one, you're clearly doing wicked things
 *
 *               - `...`     : the extra arguments you specified in the `%parse-param` statement in your
 *                             grammar definition file.
 *
 *    table: [...],
 *               State transition table
 *               ----------------------
 *
 *               index levels are:
 *               - `state`  --> hash table
 *               - `symbol` --> action (number or array)
 *
 *                 If the `action` is an array, these are the elements' meaning:
 *                 - index [0]: 1 = shift, 2 = reduce, 3 = accept
 *                 - index [1]: GOTO `state`
 *
 *                 If the `action` is a number, it is the GOTO `state`
 *
 *    defaultActions: {...},
 *
 *    parseError: function(str, hash, ExceptionClass),
 *    yyError: function(str, ...),
 *    yyRecovering: function(),
 *    yyErrOk: function(),
 *    yyClearIn: function(),
 *
 *    constructParseErrorInfo: function(error_message, exception_object, expected_token_set, is_recoverable),
 *               Helper function **which will be set up during the first invocation of the `parse()` method**.
 *               Produces a new errorInfo 'hash object' which can be passed into `parseError()`.
 *               See it's use in this parser kernel in many places; example usage:
 *
 *                   var infoObj = parser.constructParseErrorInfo('fail!', null,
 *                                     parser.collect_expected_token_set(state), true);
 *                   var retVal = parser.parseError(infoObj.errStr, infoObj, parser.JisonParserError);
 *
 *    originalParseError: function(str, hash, ExceptionClass),
 *               The basic `parseError` handler provided by JISON.
 *               `cleanupAfterParse()` will clean up and reset `parseError()` to reference this function
 *               at the end of the `parse()`.
 *
 *    options: { ... parser %options ... },
 *
 *    parse: function(input[, args...]),
 *               Parse the given `input` and return the parsed value (or `true` when none was provided by
 *               the root action, in which case the parser is acting as a *matcher*).
 *               You MAY use the additional `args...` parameters as per `%parse-param` spec of this grammar:
 *               these extra `args...` are added verbatim to the `yy` object reference as member variables.
 *
 *               WARNING:
 *               Parser's additional `args...` parameters (via `%parse-param`) MAY conflict with
 *               any attributes already added to `yy` by the jison run-time;
 *               when such a collision is detected an exception is thrown to prevent the generated run-time
 *               from silently accepting this confusing and potentially hazardous situation!
 *
 *               The lexer MAY add its own set of additional parameters (via the `%parse-param` line in
 *               the lexer section of the grammar spec): these will be inserted in the `yy` shared state
 *               object and any collision with those will be reported by the lexer via a thrown exception.
 *
 *    cleanupAfterParse: function(resultValue, invoke_post_methods, do_not_nuke_errorinfos),
 *               Helper function **which will be set up during the first invocation of the `parse()` method**.
 *               This helper API is invoked at the end of the `parse()` call, unless an exception was thrown
 *               and `%options no-try-catch` has been defined for this grammar: in that case this helper MAY
 *               be invoked by calling user code to ensure the `post_parse` callbacks are invoked and
 *               the internal parser gets properly garbage collected under these particular circumstances.
 *
 *    yyMergeLocationInfo: function(first_index, last_index, first_yylloc, last_yylloc, dont_look_back),
 *               Helper function **which will be set up during the first invocation of the `parse()` method**.
 *               This helper API can be invoked to calculate a spanning `yylloc` location info object.
 *
 *               Note: %epsilon rules MAY specify no `first_index` and `first_yylloc`, in which case
 *               this function will attempt to obtain a suitable location marker by inspecting the location stack
 *               backwards.
 *
 *               For more info see the documentation comment further below, immediately above this function's
 *               implementation.
 *
 *    lexer: {
 *        yy: {...},           A reference to the so-called "shared state" `yy` once
 *                             received via a call to the `.setInput(input, yy)` lexer API.
 *        EOF: 1,
 *        ERROR: 2,
 *        JisonLexerError: function(msg, hash),
 *        parseError: function(str, hash, ExceptionClass),
 *        setInput: function(input, [yy]),
 *        input: function(),
 *        unput: function(str),
 *        more: function(),
 *        reject: function(),
 *        less: function(n),
 *        pastInput: function(n),
 *        upcomingInput: function(n),
 *        showPosition: function(),
 *        test_match: function(regex_match_array, rule_index, ...),
 *        next: function(...),
 *        lex: function(...),
 *        begin: function(condition),
 *        pushState: function(condition),
 *        popState: function(),
 *        topState: function(),
 *        _currentRules: function(),
 *        stateStackSize: function(),
 *        cleanupAfterLex: function()
 *
 *        options: { ... lexer %options ... },
 *
 *        performAction: function(yy, yy_, $avoiding_name_collisions, YY_START, ...),
 *        rules: [...],
 *        conditions: {associative list: name ==> set},
 *    }
 *  }
 *
 *
 *  token location info (@$, _$, etc.): {
 *    first_line: n,
 *    last_line: n,
 *    first_column: n,
 *    last_column: n,
 *    range: [start_number, end_number]
 *               (where the numbers are indexes into the input string, zero-based)
 *  }
 *
 * ---
 *
 * The `parseError` function receives a 'hash' object with these members for lexer and
 * parser errors:
 *
 *  {
 *    text:        (matched text)
 *    token:       (the produced terminal token, if any)
 *    token_id:    (the produced terminal token numeric ID, if any)
 *    line:        (yylineno)
 *    loc:         (yylloc)
 *  }
 *
 * parser (grammar) errors will also provide these additional members:
 *
 *  {
 *    expected:    (array describing the set of expected tokens;
 *                  may be UNDEFINED when we cannot easily produce such a set)
 *    state:       (integer (or array when the table includes grammar collisions);
 *                  represents the current internal state of the parser kernel.
 *                  can, for example, be used to pass to the `collect_expected_token_set()`
 *                  API to obtain the expected token set)
 *    action:      (integer; represents the current internal action which will be executed)
 *    new_state:   (integer; represents the next/planned internal state, once the current
 *                  action has executed)
 *    recoverable: (boolean: TRUE when the parser MAY have an error recovery rule
 *                  available for this particular error)
 *    state_stack: (array: the current parser LALR/LR internal state stack; this can be used,
 *                  for instance, for advanced error analysis and reporting)
 *    value_stack: (array: the current parser LALR/LR internal `$$` value stack; this can be used,
 *                  for instance, for advanced error analysis and reporting)
 *    location_stack: (array: the current parser LALR/LR internal location stack; this can be used,
 *                  for instance, for advanced error analysis and reporting)
 *    yy:          (object: the current parser internal "shared state" `yy`
 *                  as is also available in the rule actions; this can be used,
 *                  for instance, for advanced error analysis and reporting)
 *    lexer:       (reference to the current lexer instance used by the parser)
 *    parser:      (reference to the current parser instance)
 *  }
 *
 * while `this` will reference the current parser instance.
 *
 * When `parseError` is invoked by the lexer, `this` will still reference the related *parser*
 * instance, while these additional `hash` fields will also be provided:
 *
 *  {
 *    lexer:       (reference to the current lexer instance which reported the error)
 *  }
 *
 * When `parseError` is invoked by the parser due to a **JavaScript exception** being fired
 * from either the parser or lexer, `this` will still reference the related *parser*
 * instance, while these additional `hash` fields will also be provided:
 *
 *  {
 *    exception:   (reference to the exception thrown)
 *  }
 *
 * Please do note that in the latter situation, the `expected` field will be omitted as
 * this type of failure is assumed not to be due to *parse errors* but rather due to user
 * action code in either parser or lexer failing unexpectedly.
 *
 * ---
 *
 * You can specify parser options by setting / modifying the `.yy` object of your Parser instance.
 * These options are available:
 *
 * ### options which are global for all parser instances
 *
 *  Parser.pre_parse: function(yy)
 *                 optional: you can specify a pre_parse() function in the chunk following
 *                 the grammar, i.e. after the last `%%`.
 *  Parser.post_parse: function(yy, retval, parseInfo) { return retval; }
 *                 optional: you can specify a post_parse() function in the chunk following
 *                 the grammar, i.e. after the last `%%`. When it does not return any value,
 *                 the parser will return the original `retval`.
 *
 * ### options which can be set up per parser instance
 *
 *  yy: {
 *      pre_parse:  function(yy)
 *                 optional: is invoked before the parse cycle starts (and before the first
 *                 invocation of `lex()`) but immediately after the invocation of
 *                 `parser.pre_parse()`).
 *      post_parse: function(yy, retval, parseInfo) { return retval; }
 *                 optional: is invoked when the parse terminates due to success ('accept')
 *                 or failure (even when exceptions are thrown).
 *                 `retval` contains the return value to be produced by `Parser.parse()`;
 *                 this function can override the return value by returning another.
 *                 When it does not return any value, the parser will return the original
 *                 `retval`.
 *                 This function is invoked immediately before `parser.post_parse()`.
 *
 *      parseError: function(str, hash, ExceptionClass)
 *                 optional: overrides the default `parseError` function.
 *      quoteName: function(name),
 *                 optional: overrides the default `quoteName` function.
 *  }
 *
 *  parser.lexer.options: {
 *      pre_lex:  function()
 *                 optional: is invoked before the lexer is invoked to produce another token.
 *                 `this` refers to the Lexer object.
 *      post_lex: function(token) { return token; }
 *                 optional: is invoked when the lexer has produced a token `token`;
 *                 this function can override the returned token value by returning another.
 *                 When it does not return any (truthy) value, the lexer will return
 *                 the original `token`.
 *                 `this` refers to the Lexer object.
 *
 *      ranges: boolean
 *                 optional: `true` ==> token location info will include a .range[] member.
 *      flex: boolean
 *                 optional: `true` ==> flex-like lexing behaviour where the rules are tested
 *                 exhaustively to find the longest match.
 *      backtrack_lexer: boolean
 *                 optional: `true` ==> lexer regexes are tested in order and for invoked;
 *                 the lexer terminates the scan when a token is returned by the action code.
 *      xregexp: boolean
 *                 optional: `true` ==> lexer rule regexes are "extended regex format" requiring the
 *                 `XRegExp` library. When this `%option` has not been specified at compile time, all lexer
 *                 rule regexes have been written as standard JavaScript RegExp expressions.
 *  }
 */

        
    
            var parser = (function () {


// See also:
// http://stackoverflow.com/questions/1382107/whats-a-good-way-to-extend-error-in-javascript/#35881508
// but we keep the prototype.constructor and prototype.name assignment lines too for compatibility
// with userland code which might access the derived class in a 'classic' way.
function JisonParserError(msg, hash) {
    Object.defineProperty(this, 'name', {
        enumerable: false,
        writable: false,
        value: 'JisonParserError'
    });

    if (msg == null) msg = '???';

    Object.defineProperty(this, 'message', {
        enumerable: false,
        writable: true,
        value: msg
    });

    this.hash = hash;

    var stacktrace;
    if (hash && hash.exception instanceof Error) {
        var ex2 = hash.exception;
        this.message = ex2.message || msg;
        stacktrace = ex2.stack;
    }
    if (!stacktrace) {
        if (Error.hasOwnProperty('captureStackTrace')) {        // V8/Chrome engine
            Error.captureStackTrace(this, this.constructor);
        } else {
            stacktrace = (new Error(msg)).stack;
        }
    }
    if (stacktrace) {
        Object.defineProperty(this, 'stack', {
            enumerable: false,
            writable: false,
            value: stacktrace
        });
    }
}

if (typeof Object.setPrototypeOf === 'function') {
    Object.setPrototypeOf(JisonParserError.prototype, Error.prototype);
} else {
    JisonParserError.prototype = Object.create(Error.prototype);
}
JisonParserError.prototype.constructor = JisonParserError;
JisonParserError.prototype.name = 'JisonParserError';




        // helper: reconstruct the productions[] table
        function bp(s) {
            var rv = [];
            var p = s.pop;
            var r = s.rule;
            for (var i = 0, l = p.length; i < l; i++) {
                rv.push([
                    p[i],
                    r[i]
                ]);
            }
            return rv;
        }
    


        // helper: reconstruct the defaultActions[] table
        function bda(s) {
            var rv = {};
            var d = s.idx;
            var g = s.goto;
            for (var i = 0, l = d.length; i < l; i++) {
                var j = d[i];
                rv[j] = g[i];
            }
            return rv;
        }
    


        // helper: reconstruct the 'goto' table
        function bt(s) {
            var rv = [];
            var d = s.len;
            var y = s.symbol;
            var t = s.type;
            var a = s.state;
            var m = s.mode;
            var g = s.goto;
            for (var i = 0, l = d.length; i < l; i++) {
                var n = d[i];
                var q = {};
                for (var j = 0; j < n; j++) {
                    var z = y.shift();
                    switch (t.shift()) {
                    case 2:
                        q[z] = [
                            m.shift(),
                            g.shift()
                        ];
                        break;

                    case 0:
                        q[z] = a.shift();
                        break;

                    default:
                        // type === 1: accept
                        q[z] = [
                            3
                        ];
                    }
                }
                rv.push(q);
            }
            return rv;
        }
    


        // helper: runlength encoding with increment step: code, length: step (default step = 0)
        // `this` references an array
        function s(c, l, a) {
            a = a || 0;
            for (var i = 0; i < l; i++) {
                this.push(c);
                c += a;
            }
        }

        // helper: duplicate sequence from *relative* offset and length.
        // `this` references an array
        function c(i, l) {
            i = this.length - i;
            for (l += i; i < l; i++) {
                this.push(this[i]);
            }
        }

        // helper: unpack an array using helpers and data, all passed in an array argument 'a'.
        function u(a) {
            var rv = [];
            for (var i = 0, l = a.length; i < l; i++) {
                var e = a[i];
                // Is this entry a helper function?
                if (typeof e === 'function') {
                    i++;
                    e.apply(rv, a[i]);
                } else {
                    rv.push(e);
                }
            }
            return rv;
        }
    

var parser = {
    // Code Generator Information Report
    // ---------------------------------
    //
    // Options:
    //
    //   default action mode: ............. ["classic","merge"]
    //   test-compile action mode: ........ "parser:*,lexer:*"
    //   try..catch: ...................... true
    //   default resolve on conflict: ..... true
    //   on-demand look-ahead: ............ false
    //   error recovery token skip maximum: 3
    //   yyerror in parse actions is: ..... NOT recoverable,
    //   yyerror in lexer actions and other non-fatal lexer are:
    //   .................................. NOT recoverable,
    //   debug grammar/output: ............ false
    //   has partial LR conflict upgrade:   true
    //   rudimentary token-stack support:   false
    //   parser table compression mode: ... 2
    //   export debug tables: ............. false
    //   export *all* tables: ............. false
    //   module type: ..................... commonjs
    //   parser engine type: .............. lalr
    //   output main() in the module: ..... true
    //   has user-specified main(): ....... false
    //   has user-specified require()/import modules for main():
    //   .................................. false
    //   number of expected conflicts: .... 0
    //
    //
    // Parser Analysis flags:
    //
    //   no significant actions (parser is a language matcher only):
    //   .................................. false
    //   uses yyleng: ..................... false
    //   uses yylineno: ................... false
    //   uses yytext: ..................... false
    //   uses yylloc: ..................... false
    //   uses ParseError API: ............. false
    //   uses YYERROR: .................... false
    //   uses YYRECOVERING: ............... false
    //   uses YYERROK: .................... false
    //   uses YYCLEARIN: .................. false
    //   tracks rule values: .............. true
    //   assigns rule values: ............. true
    //   uses location tracking: .......... false
    //   assigns location: ................ false
    //   uses yystack: .................... false
    //   uses yysstack: ................... false
    //   uses yysp: ....................... true
    //   uses yyrulelength: ............... false
    //   uses yyMergeLocationInfo API: .... false
    //   has error recovery: .............. false
    //   has error reporting: ............. false
    //
    // --------- END OF REPORT -----------

trace: function no_op_trace() { },
JisonParserError: JisonParserError,
yy: {},
options: {
  type: "lalr",
  hasPartialLrUpgradeOnConflict: true,
  errorRecoveryTokenDiscardCount: 3
},
symbols_: {
  "$accept": 0,
  "$end": 1,
  "ADD": 3,
  "ANGLE": 16,
  "CHS": 22,
  "COMMA": 14,
  "CSS_CPROP": 13,
  "CSS_VAR": 12,
  "DIV": 6,
  "EMS": 20,
  "EOF": 1,
  "EXS": 21,
  "FREQ": 18,
  "LENGTH": 15,
  "LPAREN": 7,
  "MUL": 5,
  "NESTED_CALC": 9,
  "NUMBER": 11,
  "PERCENTAGE": 28,
  "PREFIX": 10,
  "REMS": 23,
  "RES": 19,
  "RPAREN": 8,
  "SUB": 4,
  "TIME": 17,
  "VHS": 24,
  "VMAXS": 27,
  "VMINS": 26,
  "VWS": 25,
  "css_value": 33,
  "css_variable": 32,
  "error": 2,
  "expression": 29,
  "math_expression": 30,
  "value": 31
},
terminals_: {
  1: "EOF",
  2: "error",
  3: "ADD",
  4: "SUB",
  5: "MUL",
  6: "DIV",
  7: "LPAREN",
  8: "RPAREN",
  9: "NESTED_CALC",
  10: "PREFIX",
  11: "NUMBER",
  12: "CSS_VAR",
  13: "CSS_CPROP",
  14: "COMMA",
  15: "LENGTH",
  16: "ANGLE",
  17: "TIME",
  18: "FREQ",
  19: "RES",
  20: "EMS",
  21: "EXS",
  22: "CHS",
  23: "REMS",
  24: "VHS",
  25: "VWS",
  26: "VMINS",
  27: "VMAXS",
  28: "PERCENTAGE"
},
TERROR: 2,
    EOF: 1,

    // internals: defined here so the object *structure* doesn't get modified by parse() et al,
    // thus helping JIT compilers like Chrome V8.
    originalQuoteName: null,
    originalParseError: null,
    cleanupAfterParse: null,
    constructParseErrorInfo: null,
    yyMergeLocationInfo: null,

    __reentrant_call_depth: 0,      // INTERNAL USE ONLY
    __error_infos: [],              // INTERNAL USE ONLY: the set of parseErrorInfo objects created since the last cleanup
    __error_recovery_infos: [],     // INTERNAL USE ONLY: the set of parseErrorInfo objects created since the last cleanup

    // APIs which will be set up depending on user action code analysis:
    //yyRecovering: 0,
    //yyErrOk: 0,
    //yyClearIn: 0,

    // Helper APIs
    // -----------

    // Helper function which can be overridden by user code later on: put suitable quotes around
    // literal IDs in a description string.
    quoteName: function parser_quoteName(id_str) {
        return '"' + id_str + '"';
    },

    // Return the name of the given symbol (terminal or non-terminal) as a string, when available.
    //
    // Return NULL when the symbol is unknown to the parser.
    getSymbolName: function parser_getSymbolName(symbol) {
        if (this.terminals_[symbol]) {
            return this.terminals_[symbol];
        }

        // Otherwise... this might refer to a RULE token i.e. a non-terminal: see if we can dig that one up.
        //
        // An example of this may be where a rule's action code contains a call like this:
        //
        //      parser.getSymbolName(#$)
        //
        // to obtain a human-readable name of the current grammar rule.
        var s = this.symbols_;
        for (var key in s) {
            if (s[key] === symbol) {
                return key;
            }
        }
        return null;
    },

    // Return a more-or-less human-readable description of the given symbol, when available,
    // or the symbol itself, serving as its own 'description' for lack of something better to serve up.
    //
    // Return NULL when the symbol is unknown to the parser.
    describeSymbol: function parser_describeSymbol(symbol) {
        if (symbol !== this.EOF && this.terminal_descriptions_ && this.terminal_descriptions_[symbol]) {
            return this.terminal_descriptions_[symbol];
        }
        else if (symbol === this.EOF) {
            return 'end of input';
        }
        var id = this.getSymbolName(symbol);
        if (id) {
            return this.quoteName(id);
        }
        return null;
    },

    // Produce a (more or less) human-readable list of expected tokens at the point of failure.
    //
    // The produced list may contain token or token set descriptions instead of the tokens
    // themselves to help turning this output into something that easier to read by humans
    // unless `do_not_describe` parameter is set, in which case a list of the raw, *numeric*,
    // expected terminals and nonterminals is produced.
    //
    // The returned list (array) will not contain any duplicate entries.
    collect_expected_token_set: function parser_collect_expected_token_set(state, do_not_describe) {
        var TERROR = this.TERROR;
        var tokenset = [];
        var check = {};
        // Has this (error?) state been outfitted with a custom expectations description text for human consumption?
        // If so, use that one instead of the less palatable token set.
        if (!do_not_describe && this.state_descriptions_ && this.state_descriptions_[state]) {
            return [
                this.state_descriptions_[state]
            ];
        }
        for (var p in this.table[state]) {
            p = +p;
            if (p !== TERROR) {
                var d = do_not_describe ? p : this.describeSymbol(p);
                if (d && !check[d]) {
                    tokenset.push(d);
                    check[d] = true;        // Mark this token description as already mentioned to prevent outputting duplicate entries.
                }
            }
        }
        return tokenset;
    },
productions_: bp({
  pop: u([
  29,
  s,
  [30, 10],
  31,
  31,
  32,
  32,
  s,
  [33, 15]
]),
  rule: u([
  2,
  s,
  [3, 5],
  4,
  7,
  s,
  [1, 4],
  2,
  4,
  6,
  s,
  [1, 14],
  2
])
}),
performAction: function parser__PerformAction(yystate /* action[1] */, yysp, yyvstack) {

          /* this == yyval */

          // the JS engine itself can go and remove these statements when `yy` turns out to be unused in any action code!
          var yy = this.yy;
          var yyparser = yy.parser;
          var yylexer = yy.lexer;

          

          switch (yystate) {
case 0:
    /*! Production::    $accept : expression $end */

    // default action (generated by JISON mode classic/merge :: 1,VT,VA,-,-,-,-,-,-):
    this.$ = yyvstack[yysp - 1];
    // END of default action (generated by JISON mode classic/merge :: 1,VT,VA,-,-,-,-,-,-)
    break;

case 1:
    /*! Production::    expression : math_expression EOF */

    // default action (generated by JISON mode classic/merge :: 2,VT,VA,-,-,-,-,-,-):
    this.$ = yyvstack[yysp - 1];
    // END of default action (generated by JISON mode classic/merge :: 2,VT,VA,-,-,-,-,-,-)
    
    
    return yyvstack[yysp - 1];
    break;

case 2:
    /*! Production::    math_expression : math_expression ADD math_expression */
case 3:
    /*! Production::    math_expression : math_expression SUB math_expression */
case 4:
    /*! Production::    math_expression : math_expression MUL math_expression */
case 5:
    /*! Production::    math_expression : math_expression DIV math_expression */

    this.$ = { type: 'MathExpression', operator: yyvstack[yysp - 1], left: yyvstack[yysp - 2], right: yyvstack[yysp] };
    break;

case 6:
    /*! Production::    math_expression : LPAREN math_expression RPAREN */

    this.$ = yyvstack[yysp - 1];
    break;

case 7:
    /*! Production::    math_expression : NESTED_CALC LPAREN math_expression RPAREN */

    this.$ = { type: 'Calc', value: yyvstack[yysp - 1] };
    break;

case 8:
    /*! Production::    math_expression : SUB PREFIX SUB NESTED_CALC LPAREN math_expression RPAREN */

    this.$ = { type: 'Calc', value: yyvstack[yysp - 1], prefix: yyvstack[yysp - 5] };
    break;

case 9:
    /*! Production::    math_expression : css_variable */
case 10:
    /*! Production::    math_expression : css_value */
case 11:
    /*! Production::    math_expression : value */

    this.$ = yyvstack[yysp];
    break;

case 12:
    /*! Production::    value : NUMBER */

    this.$ = { type: 'Value', value: parseFloat(yyvstack[yysp]) };
    break;

case 13:
    /*! Production::    value : SUB NUMBER */

    this.$ = { type: 'Value', value: parseFloat(yyvstack[yysp]) * -1 };
    break;

case 14:
    /*! Production::    css_variable : CSS_VAR LPAREN CSS_CPROP RPAREN */

    this.$ = { type: 'CssVariable', value: yyvstack[yysp - 1] };
    break;

case 15:
    /*! Production::    css_variable : CSS_VAR LPAREN CSS_CPROP COMMA math_expression RPAREN */

    this.$ = { type: 'CssVariable', value: yyvstack[yysp - 3], fallback: yyvstack[yysp - 1] };
    break;

case 16:
    /*! Production::    css_value : LENGTH */

    this.$ = { type: 'LengthValue', value: parseFloat(yyvstack[yysp]), unit: /[a-z]+/.exec(yyvstack[yysp])[0] };
    break;

case 17:
    /*! Production::    css_value : ANGLE */

    this.$ = { type: 'AngleValue', value: parseFloat(yyvstack[yysp]), unit: /[a-z]+/.exec(yyvstack[yysp])[0] };
    break;

case 18:
    /*! Production::    css_value : TIME */

    this.$ = { type: 'TimeValue', value: parseFloat(yyvstack[yysp]), unit: /[a-z]+/.exec(yyvstack[yysp])[0] };
    break;

case 19:
    /*! Production::    css_value : FREQ */

    this.$ = { type: 'FrequencyValue', value: parseFloat(yyvstack[yysp]), unit: /[a-z]+/.exec(yyvstack[yysp])[0] };
    break;

case 20:
    /*! Production::    css_value : RES */

    this.$ = { type: 'ResolutionValue', value: parseFloat(yyvstack[yysp]), unit: /[a-z]+/.exec(yyvstack[yysp])[0] };
    break;

case 21:
    /*! Production::    css_value : EMS */

    this.$ = { type: 'EmValue', value: parseFloat(yyvstack[yysp]), unit: 'em' };
    break;

case 22:
    /*! Production::    css_value : EXS */

    this.$ = { type: 'ExValue', value: parseFloat(yyvstack[yysp]), unit: 'ex' };
    break;

case 23:
    /*! Production::    css_value : CHS */

    this.$ = { type: 'ChValue', value: parseFloat(yyvstack[yysp]), unit: 'ch' };
    break;

case 24:
    /*! Production::    css_value : REMS */

    this.$ = { type: 'RemValue', value: parseFloat(yyvstack[yysp]), unit: 'rem' };
    break;

case 25:
    /*! Production::    css_value : VHS */

    this.$ = { type: 'VhValue', value: parseFloat(yyvstack[yysp]), unit: 'vh' };
    break;

case 26:
    /*! Production::    css_value : VWS */

    this.$ = { type: 'VwValue', value: parseFloat(yyvstack[yysp]), unit: 'vw' };
    break;

case 27:
    /*! Production::    css_value : VMINS */

    this.$ = { type: 'VminValue', value: parseFloat(yyvstack[yysp]), unit: 'vmin' };
    break;

case 28:
    /*! Production::    css_value : VMAXS */

    this.$ = { type: 'VmaxValue', value: parseFloat(yyvstack[yysp]), unit: 'vmax' };
    break;

case 29:
    /*! Production::    css_value : PERCENTAGE */

    this.$ = { type: 'PercentageValue', value: parseFloat(yyvstack[yysp]), unit: '%' };
    break;

case 30:
    /*! Production::    css_value : SUB css_value */

    var prev = yyvstack[yysp]; prev.value *= -1; this.$ = prev;
    break;

}
},
table: bt({
  len: u([
  24,
  1,
  5,
  23,
  1,
  18,
  s,
  [0, 3],
  1,
  s,
  [0, 16],
  s,
  [23, 4],
  c,
  [28, 3],
  0,
  0,
  16,
  1,
  6,
  6,
  s,
  [0, 3],
  5,
  1,
  2,
  c,
  [37, 3],
  c,
  [20, 3],
  5,
  0,
  0
]),
  symbol: u([
  4,
  7,
  9,
  11,
  12,
  s,
  [15, 19, 1],
  1,
  1,
  s,
  [3, 4, 1],
  c,
  [30, 19],
  c,
  [29, 4],
  7,
  4,
  10,
  11,
  c,
  [22, 14],
  c,
  [19, 3],
  c,
  [43, 22],
  c,
  [23, 69],
  c,
  [139, 4],
  8,
  c,
  [51, 24],
  4,
  c,
  [138, 15],
  13,
  c,
  [186, 5],
  8,
  c,
  [6, 6],
  c,
  [5, 5],
  9,
  8,
  14,
  c,
  [159, 47],
  c,
  [60, 10]
]),
  type: u([
  s,
  [2, 19],
  s,
  [0, 5],
  1,
  s,
  [2, 24],
  s,
  [0, 4],
  c,
  [22, 19],
  c,
  [43, 42],
  c,
  [23, 70],
  c,
  [28, 25],
  c,
  [45, 25],
  c,
  [113, 54]
]),
  state: u([
  1,
  2,
  8,
  6,
  7,
  30,
  c,
  [4, 3],
  33,
  37,
  c,
  [5, 3],
  38,
  c,
  [4, 3],
  39,
  c,
  [4, 3],
  40,
  c,
  [4, 3],
  42,
  c,
  [21, 4],
  50,
  c,
  [5, 3],
  51,
  c,
  [4, 3]
]),
  mode: u([
  s,
  [1, 179],
  s,
  [2, 3],
  c,
  [5, 5],
  c,
  [6, 4],
  s,
  [1, 57]
]),
  goto: u([
  5,
  3,
  4,
  24,
  s,
  [9, 15, 1],
  s,
  [25, 5, 1],
  c,
  [24, 19],
  31,
  35,
  32,
  34,
  c,
  [18, 14],
  36,
  c,
  [38, 19],
  c,
  [19, 57],
  c,
  [118, 4],
  41,
  c,
  [24, 19],
  43,
  35,
  c,
  [16, 14],
  44,
  s,
  [2, 3],
  28,
  29,
  2,
  s,
  [3, 3],
  28,
  29,
  3,
  c,
  [53, 4],
  s,
  [45, 5, 1],
  c,
  [100, 42],
  52,
  c,
  [5, 4],
  53
])
}),
defaultActions: bda({
  idx: u([
  6,
  7,
  8,
  s,
  [10, 16, 1],
  33,
  34,
  39,
  40,
  41,
  45,
  47,
  52,
  53
]),
  goto: u([
  9,
  10,
  11,
  s,
  [16, 14, 1],
  12,
  1,
  30,
  13,
  s,
  [4, 4, 1],
  14,
  15,
  8
])
}),
parseError: function parseError(str, hash, ExceptionClass) {
    if (hash.recoverable) {
        if (typeof this.trace === 'function') {
            this.trace(str);
        }
        hash.destroy();             // destroy... well, *almost*!
    } else {
        if (typeof this.trace === 'function') {
            this.trace(str);
        }
        if (!ExceptionClass) {
            ExceptionClass = this.JisonParserError;
        }
        throw new ExceptionClass(str, hash);
    }
},
parse: function parse(input) {
    var self = this;
    var stack = new Array(128);         // token stack: stores token which leads to state at the same index (column storage)
    var sstack = new Array(128);        // state stack: stores states (column storage)

    var vstack = new Array(128);        // semantic value stack

    var table = this.table;
    var sp = 0;                         // 'stack pointer': index into the stacks


    


    var symbol = 0;



    var TERROR = this.TERROR;
    var EOF = this.EOF;
    var ERROR_RECOVERY_TOKEN_DISCARD_COUNT = (this.options.errorRecoveryTokenDiscardCount | 0) || 3;
    var NO_ACTION = [0, 54 /* === table.length :: ensures that anyone using this new state will fail dramatically! */];

    var lexer;
    if (this.__lexer__) {
        lexer = this.__lexer__;
    } else {
        lexer = this.__lexer__ = Object.create(this.lexer);
    }

    var sharedState_yy = {
        parseError: undefined,
        quoteName: undefined,
        lexer: undefined,
        parser: undefined,
        pre_parse: undefined,
        post_parse: undefined,
        pre_lex: undefined,
        post_lex: undefined      // WARNING: must be written this way for the code expanders to work correctly in both ES5 and ES6 modes!
    };

    var ASSERT;
    if (typeof assert !== 'function') {
        ASSERT = function JisonAssert(cond, msg) {
            if (!cond) {
                throw new Error('assertion failed: ' + (msg || '***'));
            }
        };
    } else {
        ASSERT = assert;
    }

    this.yyGetSharedState = function yyGetSharedState() {
        return sharedState_yy;
    };








    function shallow_copy_noclobber(dst, src) {
        for (var k in src) {
            if (typeof dst[k] === 'undefined' && Object.prototype.hasOwnProperty.call(src, k)) {
                dst[k] = src[k];
            }
        }
    }

    // copy state
    shallow_copy_noclobber(sharedState_yy, this.yy);

    sharedState_yy.lexer = lexer;
    sharedState_yy.parser = this;






    // Does the shared state override the default `parseError` that already comes with this instance?
    if (typeof sharedState_yy.parseError === 'function') {
        this.parseError = function parseErrorAlt(str, hash, ExceptionClass) {
            if (!ExceptionClass) {
                ExceptionClass = this.JisonParserError;
            }
            return sharedState_yy.parseError.call(this, str, hash, ExceptionClass);
        };
    } else {
        this.parseError = this.originalParseError;
    }

    // Does the shared state override the default `quoteName` that already comes with this instance?
    if (typeof sharedState_yy.quoteName === 'function') {
        this.quoteName = function quoteNameAlt(id_str) {
            return sharedState_yy.quoteName.call(this, id_str);
        };
    } else {
        this.quoteName = this.originalQuoteName;
    }

    // set up the cleanup function; make it an API so that external code can re-use this one in case of
    // calamities or when the `%options no-try-catch` option has been specified for the grammar, in which
    // case this parse() API method doesn't come with a `finally { ... }` block any more!
    //
    // NOTE: as this API uses parse() as a closure, it MUST be set again on every parse() invocation,
    //       or else your `sharedState`, etc. references will be *wrong*!
    this.cleanupAfterParse = function parser_cleanupAfterParse(resultValue, invoke_post_methods, do_not_nuke_errorinfos) {
        var rv;

        if (invoke_post_methods) {
            var hash;

            if (sharedState_yy.post_parse || this.post_parse) {
                // create an error hash info instance: we re-use this API in a **non-error situation**
                // as this one delivers all parser internals ready for access by userland code.
                hash = this.constructParseErrorInfo(null /* no error! */, null /* no exception! */, null, false);
            }

            if (sharedState_yy.post_parse) {
                rv = sharedState_yy.post_parse.call(this, sharedState_yy, resultValue, hash);
                if (typeof rv !== 'undefined') resultValue = rv;
            }
            if (this.post_parse) {
                rv = this.post_parse.call(this, sharedState_yy, resultValue, hash);
                if (typeof rv !== 'undefined') resultValue = rv;
            }

            // cleanup:
            if (hash && hash.destroy) {
                hash.destroy();
            }
        }

        if (this.__reentrant_call_depth > 1) return resultValue;        // do not (yet) kill the sharedState when this is a reentrant run.

        // clean up the lingering lexer structures as well:
        if (lexer.cleanupAfterLex) {
            lexer.cleanupAfterLex(do_not_nuke_errorinfos);
        }

        // prevent lingering circular references from causing memory leaks:
        if (sharedState_yy) {
            sharedState_yy.lexer = undefined;
            sharedState_yy.parser = undefined;
            if (lexer.yy === sharedState_yy) {
                lexer.yy = undefined;
            }
        }
        sharedState_yy = undefined;
        this.parseError = this.originalParseError;
        this.quoteName = this.originalQuoteName;

        // nuke the vstack[] array at least as that one will still reference obsoleted user values.
        // To be safe, we nuke the other internal stack columns as well...
        stack.length = 0;               // fastest way to nuke an array without overly bothering the GC
        sstack.length = 0;

        vstack.length = 0;
        sp = 0;

        // nuke the error hash info instances created during this run.
        // Userland code must COPY any data/references
        // in the error hash instance(s) it is more permanently interested in.
        if (!do_not_nuke_errorinfos) {
            for (var i = this.__error_infos.length - 1; i >= 0; i--) {
                var el = this.__error_infos[i];
                if (el && typeof el.destroy === 'function') {
                    el.destroy();
                }
            }
            this.__error_infos.length = 0;


        }

        return resultValue;
    };






































































































































    // NOTE: as this API uses parse() as a closure, it MUST be set again on every parse() invocation,
    //       or else your `lexer`, `sharedState`, etc. references will be *wrong*!
    this.constructParseErrorInfo = function parser_constructParseErrorInfo(msg, ex, expected, recoverable) {
        var pei = {
            errStr: msg,
            exception: ex,
            text: lexer.match,
            value: lexer.yytext,
            token: this.describeSymbol(symbol) || symbol,
            token_id: symbol,
            line: lexer.yylineno,

            expected: expected,
            recoverable: recoverable,
            state: state,
            action: action,
            new_state: newState,
            symbol_stack: stack,
            state_stack: sstack,
            value_stack: vstack,

            stack_pointer: sp,
            yy: sharedState_yy,
            lexer: lexer,
            parser: this,

            // and make sure the error info doesn't stay due to potential
            // ref cycle via userland code manipulations.
            // These would otherwise all be memory leak opportunities!
            //
            // Note that only array and object references are nuked as those
            // constitute the set of elements which can produce a cyclic ref.
            // The rest of the members is kept intact as they are harmless.
            destroy: function destructParseErrorInfo() {
                // remove cyclic references added to error info:
                // info.yy = null;
                // info.lexer = null;
                // info.value = null;
                // info.value_stack = null;
                // ...
                var rec = !!this.recoverable;
                for (var key in this) {
                    if (this.hasOwnProperty(key) && typeof key === 'object') {
                        this[key] = undefined;
                    }
                }
                this.recoverable = rec;
            }
        };
        // track this instance so we can `destroy()` it once we deem it superfluous and ready for garbage collection!
        this.__error_infos.push(pei);
        return pei;
    };













    function getNonTerminalFromCode(symbol) {
        var tokenName = self.getSymbolName(symbol);
        if (!tokenName) {
            tokenName = symbol;
        }
        return tokenName;
    }


    function stdLex() {
        var token = lexer.lex();
        // if token isn't its numeric value, convert
        if (typeof token !== 'number') {
            token = self.symbols_[token] || token;
        }

        return token || EOF;
    }

    function fastLex() {
        var token = lexer.fastLex();
        // if token isn't its numeric value, convert
        if (typeof token !== 'number') {
            token = self.symbols_[token] || token;
        }

        return token || EOF;
    }

    var lex = stdLex;


    var state, action, r, t;
    var yyval = {
        $: true,
        _$: undefined,
        yy: sharedState_yy
    };
    var p;
    var yyrulelen;
    var this_production;
    var newState;
    var retval = false;


    try {
        this.__reentrant_call_depth++;

        lexer.setInput(input, sharedState_yy);

        // NOTE: we *assume* no lexer pre/post handlers are set up *after* 
        // this initial `setInput()` call: hence we can now check and decide
        // whether we'll go with the standard, slower, lex() API or the
        // `fast_lex()` one:
        if (typeof lexer.canIUse === 'function') {
            var lexerInfo = lexer.canIUse();
            if (lexerInfo.fastLex && typeof fastLex === 'function') {
                lex = fastLex;
            }
        } 



        vstack[sp] = null;
        sstack[sp] = 0;
        stack[sp] = 0;
        ++sp;





        if (this.pre_parse) {
            this.pre_parse.call(this, sharedState_yy);
        }
        if (sharedState_yy.pre_parse) {
            sharedState_yy.pre_parse.call(this, sharedState_yy);
        }

        newState = sstack[sp - 1];
        for (;;) {
            // retrieve state number from top of stack
            state = newState;               // sstack[sp - 1];

            // use default actions if available
            if (this.defaultActions[state]) {
                action = 2;
                newState = this.defaultActions[state];
            } else {
                // The single `==` condition below covers both these `===` comparisons in a single
                // operation:
                //
                //     if (symbol === null || typeof symbol === 'undefined') ...
                if (!symbol) {
                    symbol = lex();
                }
                // read action for current state and first input
                t = (table[state] && table[state][symbol]) || NO_ACTION;
                newState = t[1];
                action = t[0];











                // handle parse error
                if (!action) {
                    var errStr;
                    var errSymbolDescr = (this.describeSymbol(symbol) || symbol);
                    var expected = this.collect_expected_token_set(state);

                    // Report error
                    if (typeof lexer.yylineno === 'number') {
                        errStr = 'Parse error on line ' + (lexer.yylineno + 1) + ': ';
                    } else {
                        errStr = 'Parse error: ';
                    }
                    if (typeof lexer.showPosition === 'function') {
                        errStr += '\n' + lexer.showPosition(79 - 10, 10) + '\n';
                    }
                    if (expected.length) {
                        errStr += 'Expecting ' + expected.join(', ') + ', got unexpected ' + errSymbolDescr;
                    } else {
                        errStr += 'Unexpected ' + errSymbolDescr;
                    }
                    // we cannot recover from the error!
                    p = this.constructParseErrorInfo(errStr, null, expected, false);
                    r = this.parseError(p.errStr, p, this.JisonParserError);
                    if (typeof r !== 'undefined') {
                        retval = r;
                    }
                    break;
                }


            }










            switch (action) {
            // catch misc. parse failures:
            default:
                // this shouldn't happen, unless resolve defaults are off
                if (action instanceof Array) {
                    p = this.constructParseErrorInfo('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol, null, null, false);
                    r = this.parseError(p.errStr, p, this.JisonParserError);
                    if (typeof r !== 'undefined') {
                        retval = r;
                    }
                    break;
                }
                // Another case of better safe than sorry: in case state transitions come out of another error recovery process
                // or a buggy LUT (LookUp Table):
                p = this.constructParseErrorInfo('Parsing halted. No viable error recovery approach available due to internal system failure.', null, null, false);
                r = this.parseError(p.errStr, p, this.JisonParserError);
                if (typeof r !== 'undefined') {
                    retval = r;
                }
                break;

            // shift:
            case 1:
                stack[sp] = symbol;
                vstack[sp] = lexer.yytext;

                sstack[sp] = newState; // push state

                ++sp;
                symbol = 0;




                // Pick up the lexer details for the current symbol as that one is not 'look-ahead' any more:




                continue;

            // reduce:
            case 2:



                this_production = this.productions_[newState - 1];  // `this.productions_[]` is zero-based indexed while states start from 1 upwards...
                yyrulelen = this_production[1];










                r = this.performAction.call(yyval, newState, sp - 1, vstack);

                if (typeof r !== 'undefined') {
                    retval = r;
                    break;
                }

                // pop off stack
                sp -= yyrulelen;

                // don't overwrite the `symbol` variable: use a local var to speed things up:
                var ntsymbol = this_production[0];    // push nonterminal (reduce)
                stack[sp] = ntsymbol;
                vstack[sp] = yyval.$;

                // goto new state = table[STATE][NONTERMINAL]
                newState = table[sstack[sp - 1]][ntsymbol];
                sstack[sp] = newState;
                ++sp;









                continue;

            // accept:
            case 3:
                if (sp !== -2) {
                    retval = true;
                    // Return the `$accept` rule's `$$` result, if available.
                    //
                    // Also note that JISON always adds this top-most `$accept` rule (with implicit,
                    // default, action):
                    //
                    //     $accept: <startSymbol> $end
                    //                  %{ $$ = $1; @$ = @1; %}
                    //
                    // which, combined with the parse kernel's `$accept` state behaviour coded below,
                    // will produce the `$$` value output of the <startSymbol> rule as the parse result,
                    // IFF that result is *not* `undefined`. (See also the parser kernel code.)
                    //
                    // In code:
                    //
                    //                  %{
                    //                      @$ = @1;            // if location tracking support is included
                    //                      if (typeof $1 !== 'undefined')
                    //                          return $1;
                    //                      else
                    //                          return true;           // the default parse result if the rule actions don't produce anything
                    //                  %}
                    sp--;
                    if (typeof vstack[sp] !== 'undefined') {
                        retval = vstack[sp];
                    }
                }
                break;
            }

            // break out of loop: we accept or fail with error
            break;
        }
    } catch (ex) {
        // report exceptions through the parseError callback too, but keep the exception intact
        // if it is a known parser or lexer error which has been thrown by parseError() already:
        if (ex instanceof this.JisonParserError) {
            throw ex;
        }
        else if (lexer && typeof lexer.JisonLexerError === 'function' && ex instanceof lexer.JisonLexerError) {
            throw ex;
        }

        p = this.constructParseErrorInfo('Parsing aborted due to exception.', ex, null, false);
        retval = false;
        r = this.parseError(p.errStr, p, this.JisonParserError);
        if (typeof r !== 'undefined') {
            retval = r;
        }
    } finally {
        retval = this.cleanupAfterParse(retval, true, true);
        this.__reentrant_call_depth--;
    }   // /finally

    return retval;
}
};
parser.originalParseError = parser.parseError;
parser.originalQuoteName = parser.quoteName;
/* lexer generated by jison-lex 0.6.1-215 */

/*
 * Returns a Lexer object of the following structure:
 *
 *  Lexer: {
 *    yy: {}     The so-called "shared state" or rather the *source* of it;
 *               the real "shared state" `yy` passed around to
 *               the rule actions, etc. is a direct reference!
 *
 *               This "shared context" object was passed to the lexer by way of 
 *               the `lexer.setInput(str, yy)` API before you may use it.
 *
 *               This "shared context" object is passed to the lexer action code in `performAction()`
 *               so userland code in the lexer actions may communicate with the outside world 
 *               and/or other lexer rules' actions in more or less complex ways.
 *
 *  }
 *
 *  Lexer.prototype: {
 *    EOF: 1,
 *    ERROR: 2,
 *
 *    yy:        The overall "shared context" object reference.
 *
 *    JisonLexerError: function(msg, hash),
 *
 *    performAction: function lexer__performAction(yy, yyrulenumber, YY_START),
 *
 *               The function parameters and `this` have the following value/meaning:
 *               - `this`    : reference to the `lexer` instance. 
 *                               `yy_` is an alias for `this` lexer instance reference used internally.
 *
 *               - `yy`      : a reference to the `yy` "shared state" object which was passed to the lexer
 *                             by way of the `lexer.setInput(str, yy)` API before.
 *
 *                             Note:
 *                             The extra arguments you specified in the `%parse-param` statement in your
 *                             **parser** grammar definition file are passed to the lexer via this object
 *                             reference as member variables.
 *
 *               - `yyrulenumber`   : index of the matched lexer rule (regex), used internally.
 *
 *               - `YY_START`: the current lexer "start condition" state.
 *
 *    parseError: function(str, hash, ExceptionClass),
 *
 *    constructLexErrorInfo: function(error_message, is_recoverable),
 *               Helper function.
 *               Produces a new errorInfo 'hash object' which can be passed into `parseError()`.
 *               See it's use in this lexer kernel in many places; example usage:
 *
 *                   var infoObj = lexer.constructParseErrorInfo('fail!', true);
 *                   var retVal = lexer.parseError(infoObj.errStr, infoObj, lexer.JisonLexerError);
 *
 *    options: { ... lexer %options ... },
 *
 *    lex: function(),
 *               Produce one token of lexed input, which was passed in earlier via the `lexer.setInput()` API.
 *               You MAY use the additional `args...` parameters as per `%parse-param` spec of the **lexer** grammar:
 *               these extra `args...` are added verbatim to the `yy` object reference as member variables.
 *
 *               WARNING:
 *               Lexer's additional `args...` parameters (via lexer's `%parse-param`) MAY conflict with
 *               any attributes already added to `yy` by the **parser** or the jison run-time; 
 *               when such a collision is detected an exception is thrown to prevent the generated run-time 
 *               from silently accepting this confusing and potentially hazardous situation! 
 *
 *    cleanupAfterLex: function(do_not_nuke_errorinfos),
 *               Helper function.
 *
 *               This helper API is invoked when the **parse process** has completed: it is the responsibility
 *               of the **parser** (or the calling userland code) to invoke this method once cleanup is desired. 
 *
 *               This helper may be invoked by user code to ensure the internal lexer gets properly garbage collected.
 *
 *    setInput: function(input, [yy]),
 *
 *
 *    input: function(),
 *
 *
 *    unput: function(str),
 *
 *
 *    more: function(),
 *
 *
 *    reject: function(),
 *
 *
 *    less: function(n),
 *
 *
 *    pastInput: function(n),
 *
 *
 *    upcomingInput: function(n),
 *
 *
 *    showPosition: function(),
 *
 *
 *    test_match: function(regex_match_array, rule_index),
 *
 *
 *    next: function(),
 *
 *
 *    begin: function(condition),
 *
 *
 *    pushState: function(condition),
 *
 *
 *    popState: function(),
 *
 *
 *    topState: function(),
 *
 *
 *    _currentRules: function(),
 *
 *
 *    stateStackSize: function(),
 *
 *
 *    performAction: function(yy, yy_, yyrulenumber, YY_START),
 *
 *
 *    rules: [...],
 *
 *
 *    conditions: {associative list: name ==> set},
 *  }
 *
 *
 *  token location info (`yylloc`): {
 *    first_line: n,
 *    last_line: n,
 *    first_column: n,
 *    last_column: n,
 *    range: [start_number, end_number]
 *               (where the numbers are indexes into the input string, zero-based)
 *  }
 *
 * ---
 *
 * The `parseError` function receives a 'hash' object with these members for lexer errors:
 *
 *  {
 *    text:        (matched text)
 *    token:       (the produced terminal token, if any)
 *    token_id:    (the produced terminal token numeric ID, if any)
 *    line:        (yylineno)
 *    loc:         (yylloc)
 *    recoverable: (boolean: TRUE when the parser MAY have an error recovery rule
 *                  available for this particular error)
 *    yy:          (object: the current parser internal "shared state" `yy`
 *                  as is also available in the rule actions; this can be used,
 *                  for instance, for advanced error analysis and reporting)
 *    lexer:       (reference to the current lexer instance used by the parser)
 *  }
 *
 * while `this` will reference the current lexer instance.
 *
 * When `parseError` is invoked by the lexer, the default implementation will
 * attempt to invoke `yy.parser.parseError()`; when this callback is not provided
 * it will try to invoke `yy.parseError()` instead. When that callback is also not
 * provided, a `JisonLexerError` exception will be thrown containing the error
 * message and `hash`, as constructed by the `constructLexErrorInfo()` API.
 *
 * Note that the lexer's `JisonLexerError` error class is passed via the
 * `ExceptionClass` argument, which is invoked to construct the exception
 * instance to be thrown, so technically `parseError` will throw the object
 * produced by the `new ExceptionClass(str, hash)` JavaScript expression.
 *
 * ---
 *
 * You can specify lexer options by setting / modifying the `.options` object of your Lexer instance.
 * These options are available:
 *
 * (Options are permanent.)
 *  
 *  yy: {
 *      parseError: function(str, hash, ExceptionClass)
 *                 optional: overrides the default `parseError` function.
 *  }
 *
 *  lexer.options: {
 *      pre_lex:  function()
 *                 optional: is invoked before the lexer is invoked to produce another token.
 *                 `this` refers to the Lexer object.
 *      post_lex: function(token) { return token; }
 *                 optional: is invoked when the lexer has produced a token `token`;
 *                 this function can override the returned token value by returning another.
 *                 When it does not return any (truthy) value, the lexer will return
 *                 the original `token`.
 *                 `this` refers to the Lexer object.
 *
 * WARNING: the next set of options are not meant to be changed. They echo the abilities of
 * the lexer as per when it was compiled!
 *
 *      ranges: boolean
 *                 optional: `true` ==> token location info will include a .range[] member.
 *      flex: boolean
 *                 optional: `true` ==> flex-like lexing behaviour where the rules are tested
 *                 exhaustively to find the longest match.
 *      backtrack_lexer: boolean
 *                 optional: `true` ==> lexer regexes are tested in order and for invoked;
 *                 the lexer terminates the scan when a token is returned by the action code.
 *      xregexp: boolean
 *                 optional: `true` ==> lexer rule regexes are "extended regex format" requiring the
 *                 `XRegExp` library. When this %option has not been specified at compile time, all lexer
 *                 rule regexes have been written as standard JavaScript RegExp expressions.
 *  }
 */


var lexer = function() {
  /**
   * See also:
   * http://stackoverflow.com/questions/1382107/whats-a-good-way-to-extend-error-in-javascript/#35881508
   * but we keep the prototype.constructor and prototype.name assignment lines too for compatibility
   * with userland code which might access the derived class in a 'classic' way.
   *
   * @public
   * @constructor
   * @nocollapse
   */
  function JisonLexerError(msg, hash) {
    Object.defineProperty(this, 'name', {
      enumerable: false,
      writable: false,
      value: 'JisonLexerError'
    });

    if (msg == null)
      msg = '???';

    Object.defineProperty(this, 'message', {
      enumerable: false,
      writable: true,
      value: msg
    });

    this.hash = hash;
    var stacktrace;

    if (hash && hash.exception instanceof Error) {
      var ex2 = hash.exception;
      this.message = ex2.message || msg;
      stacktrace = ex2.stack;
    }

    if (!stacktrace) {
      if (Error.hasOwnProperty('captureStackTrace')) {
        // V8
        Error.captureStackTrace(this, this.constructor);
      } else {
        stacktrace = new Error(msg).stack;
      }
    }

    if (stacktrace) {
      Object.defineProperty(this, 'stack', {
        enumerable: false,
        writable: false,
        value: stacktrace
      });
    }
  }

  if (typeof Object.setPrototypeOf === 'function') {
    Object.setPrototypeOf(JisonLexerError.prototype, Error.prototype);
  } else {
    JisonLexerError.prototype = Object.create(Error.prototype);
  }

  JisonLexerError.prototype.constructor = JisonLexerError;
  JisonLexerError.prototype.name = 'JisonLexerError';

  var lexer = {
    
// Code Generator Information Report
// ---------------------------------
//
// Options:
//
//   backtracking: .................... false
//   location.ranges: ................. false
//   location line+column tracking: ... true
//
//
// Forwarded Parser Analysis flags:
//
//   uses yyleng: ..................... false
//   uses yylineno: ................... false
//   uses yytext: ..................... false
//   uses yylloc: ..................... false
//   uses lexer values: ............... true / true
//   location tracking: ............... false
//   location assignment: ............. false
//
//
// Lexer Analysis flags:
//
//   uses yyleng: ..................... ???
//   uses yylineno: ................... ???
//   uses yytext: ..................... ???
//   uses yylloc: ..................... ???
//   uses ParseError API: ............. ???
//   uses yyerror: .................... ???
//   uses location tracking & editing:  ???
//   uses more() API: ................. ???
//   uses unput() API: ................ ???
//   uses reject() API: ............... ???
//   uses less() API: ................. ???
//   uses display APIs pastInput(), upcomingInput(), showPosition():
//        ............................. ???
//   uses describeYYLLOC() API: ....... ???
//
// --------- END OF REPORT -----------

EOF: 1,
    ERROR: 2,

    // JisonLexerError: JisonLexerError,        /// <-- injected by the code generator

    // options: {},                             /// <-- injected by the code generator

    // yy: ...,                                 /// <-- injected by setInput()

    __currentRuleSet__: null,                   /// INTERNAL USE ONLY: internal rule set cache for the current lexer state  

    __error_infos: [],                          /// INTERNAL USE ONLY: the set of lexErrorInfo objects created since the last cleanup  
    __decompressed: false,                      /// INTERNAL USE ONLY: mark whether the lexer instance has been 'unfolded' completely and is now ready for use  
    done: false,                                /// INTERNAL USE ONLY  
    _backtrack: false,                          /// INTERNAL USE ONLY  
    _input: '',                                 /// INTERNAL USE ONLY  
    _more: false,                               /// INTERNAL USE ONLY  
    _signaled_error_token: false,               /// INTERNAL USE ONLY  
    conditionStack: [],                         /// INTERNAL USE ONLY; managed via `pushState()`, `popState()`, `topState()` and `stateStackSize()`  
    match: '',                                  /// READ-ONLY EXTERNAL ACCESS - ADVANCED USE ONLY: tracks input which has been matched so far for the lexer token under construction. `match` is identical to `yytext` except that this one still contains the matched input string after `lexer.performAction()` has been invoked, where userland code MAY have changed/replaced the `yytext` value entirely!  
    matched: '',                                /// READ-ONLY EXTERNAL ACCESS - ADVANCED USE ONLY: tracks entire input which has been matched so far  
    matches: false,                             /// READ-ONLY EXTERNAL ACCESS - ADVANCED USE ONLY: tracks RE match result for last (successful) match attempt  
    yytext: '',                                 /// ADVANCED USE ONLY: tracks input which has been matched so far for the lexer token under construction; this value is transferred to the parser as the 'token value' when the parser consumes the lexer token produced through a call to the `lex()` API.  
    offset: 0,                                  /// READ-ONLY EXTERNAL ACCESS - ADVANCED USE ONLY: tracks the 'cursor position' in the input string, i.e. the number of characters matched so far  
    yyleng: 0,                                  /// READ-ONLY EXTERNAL ACCESS - ADVANCED USE ONLY: length of matched input for the token under construction (`yytext`)  
    yylineno: 0,                                /// READ-ONLY EXTERNAL ACCESS - ADVANCED USE ONLY: 'line number' at which the token under construction is located  
    yylloc: null,                               /// READ-ONLY EXTERNAL ACCESS - ADVANCED USE ONLY: tracks location info (lines + columns) for the token under construction  

    /**
     * INTERNAL USE: construct a suitable error info hash object instance for `parseError`.
     * 
     * @public
     * @this {RegExpLexer}
     */
    constructLexErrorInfo: function lexer_constructLexErrorInfo(msg, recoverable, show_input_position) {
      msg = '' + msg;

      // heuristic to determine if the error message already contains a (partial) source code dump
      // as produced by either `showPosition()` or `prettyPrintRange()`:
      if (show_input_position == undefined) {
        show_input_position = !(msg.indexOf('\n') > 0 && msg.indexOf('^') > 0);
      }

      if (this.yylloc && show_input_position) {
        if (typeof this.prettyPrintRange === 'function') {
          var pretty_src = this.prettyPrintRange(this.yylloc);

          if (!/\n\s*$/.test(msg)) {
            msg += '\n';
          }

          msg += '\n  Erroneous area:\n' + this.prettyPrintRange(this.yylloc);
        } else if (typeof this.showPosition === 'function') {
          var pos_str = this.showPosition();

          if (pos_str) {
            if (msg.length && msg[msg.length - 1] !== '\n' && pos_str[0] !== '\n') {
              msg += '\n' + pos_str;
            } else {
              msg += pos_str;
            }
          }
        }
      }

      /** @constructor */
      var pei = {
        errStr: msg,
        recoverable: !!recoverable,
        text: this.match,           // This one MAY be empty; userland code should use the `upcomingInput` API to obtain more text which follows the 'lexer cursor position'...  
        token: null,
        line: this.yylineno,
        loc: this.yylloc,
        yy: this.yy,
        lexer: this,

        /**
         * and make sure the error info doesn't stay due to potential
         * ref cycle via userland code manipulations.
         * These would otherwise all be memory leak opportunities!
         * 
         * Note that only array and object references are nuked as those
         * constitute the set of elements which can produce a cyclic ref.
         * The rest of the members is kept intact as they are harmless.
         * 
         * @public
         * @this {LexErrorInfo}
         */
        destroy: function destructLexErrorInfo() {
          // remove cyclic references added to error info:
          // info.yy = null;
          // info.lexer = null;
          // ...
          var rec = !!this.recoverable;

          for (var key in this) {
            if (this.hasOwnProperty(key) && typeof key === 'object') {
              this[key] = undefined;
            }
          }

          this.recoverable = rec;
        }
      };

      // track this instance so we can `destroy()` it once we deem it superfluous and ready for garbage collection!
      this.__error_infos.push(pei);

      return pei;
    },

    /**
     * handler which is invoked when a lexer error occurs.
     * 
     * @public
     * @this {RegExpLexer}
     */
    parseError: function lexer_parseError(str, hash, ExceptionClass) {
      if (!ExceptionClass) {
        ExceptionClass = this.JisonLexerError;
      }

      if (this.yy) {
        if (this.yy.parser && typeof this.yy.parser.parseError === 'function') {
          return this.yy.parser.parseError.call(this, str, hash, ExceptionClass) || this.ERROR;
        } else if (typeof this.yy.parseError === 'function') {
          return this.yy.parseError.call(this, str, hash, ExceptionClass) || this.ERROR;
        }
      }

      throw new ExceptionClass(str, hash);
    },

    /**
     * method which implements `yyerror(str, ...args)` functionality for use inside lexer actions.
     * 
     * @public
     * @this {RegExpLexer}
     */
    yyerror: function yyError(str /*, ...args */) {
      var lineno_msg = '';

      if (this.yylloc) {
        lineno_msg = ' on line ' + (this.yylineno + 1);
      }

      var p = this.constructLexErrorInfo(
        'Lexical error' + lineno_msg + ': ' + str,
        this.options.lexerErrorsAreRecoverable
      );

      // Add any extra args to the hash under the name `extra_error_attributes`:
      var args = Array.prototype.slice.call(arguments, 1);

      if (args.length) {
        p.extra_error_attributes = args;
      }

      return this.parseError(p.errStr, p, this.JisonLexerError) || this.ERROR;
    },

    /**
     * final cleanup function for when we have completed lexing the input;
     * make it an API so that external code can use this one once userland
     * code has decided it's time to destroy any lingering lexer error
     * hash object instances and the like: this function helps to clean
     * up these constructs, which *may* carry cyclic references which would
     * otherwise prevent the instances from being properly and timely
     * garbage-collected, i.e. this function helps prevent memory leaks!
     * 
     * @public
     * @this {RegExpLexer}
     */
    cleanupAfterLex: function lexer_cleanupAfterLex(do_not_nuke_errorinfos) {
      // prevent lingering circular references from causing memory leaks:
      this.setInput('', {});

      // nuke the error hash info instances created during this run.
      // Userland code must COPY any data/references
      // in the error hash instance(s) it is more permanently interested in.
      if (!do_not_nuke_errorinfos) {
        for (var i = this.__error_infos.length - 1; i >= 0; i--) {
          var el = this.__error_infos[i];

          if (el && typeof el.destroy === 'function') {
            el.destroy();
          }
        }

        this.__error_infos.length = 0;
      }

      return this;
    },

    /**
     * clear the lexer token context; intended for internal use only
     * 
     * @public
     * @this {RegExpLexer}
     */
    clear: function lexer_clear() {
      this.yytext = '';
      this.yyleng = 0;
      this.match = '';

      // - DO NOT reset `this.matched`
      this.matches = false;

      this._more = false;
      this._backtrack = false;
      var col = (this.yylloc ? this.yylloc.last_column : 0);

      this.yylloc = {
        first_line: this.yylineno + 1,
        first_column: col,
        last_line: this.yylineno + 1,
        last_column: col,
        range: [this.offset, this.offset]
      };
    },

    /**
     * resets the lexer, sets new input
     * 
     * @public
     * @this {RegExpLexer}
     */
    setInput: function lexer_setInput(input, yy) {
      this.yy = yy || this.yy || {};

      // also check if we've fully initialized the lexer instance,
      // including expansion work to be done to go from a loaded
      // lexer to a usable lexer:
      if (!this.__decompressed) {
        // step 1: decompress the regex list:
        var rules = this.rules;

        for (var i = 0, len = rules.length; i < len; i++) {
          var rule_re = rules[i];

          // compression: is the RE an xref to another RE slot in the rules[] table?
          if (typeof rule_re === 'number') {
            rules[i] = rules[rule_re];
          }
        }

        // step 2: unfold the conditions[] set to make these ready for use:
        var conditions = this.conditions;

        for (var k in conditions) {
          var spec = conditions[k];
          var rule_ids = spec.rules;
          var len = rule_ids.length;
          var rule_regexes = new Array(len + 1);             // slot 0 is unused; we use a 1-based index approach here to keep the hottest code in `lexer_next()` fast and simple! 
          var rule_new_ids = new Array(len + 1);

          for (var i = 0; i < len; i++) {
            var idx = rule_ids[i];
            var rule_re = rules[idx];
            rule_regexes[i + 1] = rule_re;
            rule_new_ids[i + 1] = idx;
          }

          spec.rules = rule_new_ids;
          spec.__rule_regexes = rule_regexes;
          spec.__rule_count = len;
        }

        this.__decompressed = true;
      }

      this._input = input || '';
      this.clear();
      this._signaled_error_token = false;
      this.done = false;
      this.yylineno = 0;
      this.matched = '';
      this.conditionStack = ['INITIAL'];
      this.__currentRuleSet__ = null;

      this.yylloc = {
        first_line: 1,
        first_column: 0,
        last_line: 1,
        last_column: 0,
        range: [0, 0]
      };

      this.offset = 0;
      return this;
    },

    /**
     * edit the remaining input via user-specified callback.
     * This can be used to forward-adjust the input-to-parse, 
     * e.g. inserting macro expansions and alike in the
     * input which has yet to be lexed.
     * The behaviour of this API contrasts the `unput()` et al
     * APIs as those act on the *consumed* input, while this
     * one allows one to manipulate the future, without impacting
     * the current `yyloc` cursor location or any history. 
     * 
     * Use this API to help implement C-preprocessor-like
     * `#include` statements, etc.
     * 
     * The provided callback must be synchronous and is
     * expected to return the edited input (string).
     *
     * The `cpsArg` argument value is passed to the callback
     * as-is.
     *
     * `callback` interface: 
     * `function callback(input, cpsArg)`
     * 
     * - `input` will carry the remaining-input-to-lex string
     *   from the lexer.
     * - `cpsArg` is `cpsArg` passed into this API.
     * 
     * The `this` reference for the callback will be set to
     * reference this lexer instance so that userland code
     * in the callback can easily and quickly access any lexer
     * API. 
     *
     * When the callback returns a non-string-type falsey value,
     * we assume the callback did not edit the input and we
     * will using the input as-is.
     *
     * When the callback returns a non-string-type value, it
     * is converted to a string for lexing via the `"" + retval`
     * operation. (See also why: http://2ality.com/2012/03/converting-to-string.html 
     * -- that way any returned object's `toValue()` and `toString()`
     * methods will be invoked in a proper/desirable order.)
     * 
     * @public
     * @this {RegExpLexer}
     */
    editRemainingInput: function lexer_editRemainingInput(callback, cpsArg) {
      var rv = callback.call(this, this._input, cpsArg);

      if (typeof rv !== 'string') {
        if (rv) {
          this._input = '' + rv;
        } 
        // else: keep `this._input` as is.  
      } else {
        this._input = rv;
      }

      return this;
    },

    /**
     * consumes and returns one char from the input
     * 
     * @public
     * @this {RegExpLexer}
     */
    input: function lexer_input() {
      if (!this._input) {
        //this.done = true;    -- don't set `done` as we want the lex()/next() API to be able to produce one custom EOF token match after this anyhow. (lexer can match special <<EOF>> tokens and perform user action code for a <<EOF>> match, but only does so *once*)
        return null;
      }

      var ch = this._input[0];
      this.yytext += ch;
      this.yyleng++;
      this.offset++;
      this.match += ch;
      this.matched += ch;

      // Count the linenumber up when we hit the LF (or a stand-alone CR).
      // On CRLF, the linenumber is incremented when you fetch the CR or the CRLF combo
      // and we advance immediately past the LF as well, returning both together as if
      // it was all a single 'character' only.
      var slice_len = 1;

      var lines = false;

      if (ch === '\n') {
        lines = true;
      } else if (ch === '\r') {
        lines = true;
        var ch2 = this._input[1];

        if (ch2 === '\n') {
          slice_len++;
          ch += ch2;
          this.yytext += ch2;
          this.yyleng++;
          this.offset++;
          this.match += ch2;
          this.matched += ch2;
          this.yylloc.range[1]++;
        }
      }

      if (lines) {
        this.yylineno++;
        this.yylloc.last_line++;
        this.yylloc.last_column = 0;
      } else {
        this.yylloc.last_column++;
      }

      this.yylloc.range[1]++;
      this._input = this._input.slice(slice_len);
      return ch;
    },

    /**
     * unshifts one char (or an entire string) into the input
     * 
     * @public
     * @this {RegExpLexer}
     */
    unput: function lexer_unput(ch) {
      var len = ch.length;
      var lines = ch.split(/(?:\r\n?|\n)/g);
      this._input = ch + this._input;
      this.yytext = this.yytext.substr(0, this.yytext.length - len);
      this.yyleng = this.yytext.length;
      this.offset -= len;
      this.match = this.match.substr(0, this.match.length - len);
      this.matched = this.matched.substr(0, this.matched.length - len);

      if (lines.length > 1) {
        this.yylineno -= lines.length - 1;
        this.yylloc.last_line = this.yylineno + 1;

        // Get last entirely matched line into the `pre_lines[]` array's
        // last index slot; we don't mind when other previously 
        // matched lines end up in the array too. 
        var pre = this.match;

        var pre_lines = pre.split(/(?:\r\n?|\n)/g);

        if (pre_lines.length === 1) {
          pre = this.matched;
          pre_lines = pre.split(/(?:\r\n?|\n)/g);
        }

        this.yylloc.last_column = pre_lines[pre_lines.length - 1].length;
      } else {
        this.yylloc.last_column -= len;
      }

      this.yylloc.range[1] = this.yylloc.range[0] + this.yyleng;
      this.done = false;
      return this;
    },

    /**
     * cache matched text and append it on next action
     * 
     * @public
     * @this {RegExpLexer}
     */
    more: function lexer_more() {
      this._more = true;
      return this;
    },

    /**
     * signal the lexer that this rule fails to match the input, so the
     * next matching rule (regex) should be tested instead.
     * 
     * @public
     * @this {RegExpLexer}
     */
    reject: function lexer_reject() {
      if (this.options.backtrack_lexer) {
        this._backtrack = true;
      } else {
        // when the `parseError()` call returns, we MUST ensure that the error is registered.
        // We accomplish this by signaling an 'error' token to be produced for the current
        // `.lex()` run.
        var lineno_msg = '';

        if (this.yylloc) {
          lineno_msg = ' on line ' + (this.yylineno + 1);
        }

        var p = this.constructLexErrorInfo(
          'Lexical error' + lineno_msg + ': You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).',
          false
        );

        this._signaled_error_token = this.parseError(p.errStr, p, this.JisonLexerError) || this.ERROR;
      }

      return this;
    },

    /**
     * retain first n characters of the match
     * 
     * @public
     * @this {RegExpLexer}
     */
    less: function lexer_less(n) {
      return this.unput(this.match.slice(n));
    },

    /**
     * return (part of the) already matched input, i.e. for error
     * messages.
     * 
     * Limit the returned string length to `maxSize` (default: 20).
     * 
     * Limit the returned string to the `maxLines` number of lines of
     * input (default: 1).
     * 
     * Negative limit values equal *unlimited*.
     * 
     * @public
     * @this {RegExpLexer}
     */
    pastInput: function lexer_pastInput(maxSize, maxLines) {
      var past = this.matched.substring(0, this.matched.length - this.match.length);

      if (maxSize < 0)
        maxSize = past.length;
      else if (!maxSize)
        maxSize = 20;

      if (maxLines < 0)
        maxLines = past.length;          // can't ever have more input lines than this! 
      else if (!maxLines)
        maxLines = 1;

      // `substr` anticipation: treat \r\n as a single character and take a little
      // more than necessary so that we can still properly check against maxSize
      // after we've transformed and limited the newLines in here:
      past = past.substr(-maxSize * 2 - 2);

      // now that we have a significantly reduced string to process, transform the newlines
      // and chop them, then limit them:
      var a = past.replace(/\r\n|\r/g, '\n').split('\n');

      a = a.slice(-maxLines);
      past = a.join('\n');

      // When, after limiting to maxLines, we still have too much to return,
      // do add an ellipsis prefix...
      if (past.length > maxSize) {
        past = '...' + past.substr(-maxSize);
      }

      return past;
    },

    /**
     * return (part of the) upcoming input, i.e. for error messages.
     * 
     * Limit the returned string length to `maxSize` (default: 20).
     * 
     * Limit the returned string to the `maxLines` number of lines of input (default: 1).
     * 
     * Negative limit values equal *unlimited*.
     *
     * > ### NOTE ###
     * >
     * > *"upcoming input"* is defined as the whole of the both
     * > the *currently lexed* input, together with any remaining input
     * > following that. *"currently lexed"* input is the input 
     * > already recognized by the lexer but not yet returned with
     * > the lexer token. This happens when you are invoking this API
     * > from inside any lexer rule action code block. 
     * >
     * 
     * @public
     * @this {RegExpLexer}
     */
    upcomingInput: function lexer_upcomingInput(maxSize, maxLines) {
      var next = this.match;

      if (maxSize < 0)
        maxSize = next.length + this._input.length;
      else if (!maxSize)
        maxSize = 20;

      if (maxLines < 0)
        maxLines = maxSize;          // can't ever have more input lines than this! 
      else if (!maxLines)
        maxLines = 1;

      // `substring` anticipation: treat \r\n as a single character and take a little
      // more than necessary so that we can still properly check against maxSize
      // after we've transformed and limited the newLines in here:
      if (next.length < maxSize * 2 + 2) {
        next += this._input.substring(0, maxSize * 2 + 2);   // substring is faster on Chrome/V8 
      }

      // now that we have a significantly reduced string to process, transform the newlines
      // and chop them, then limit them:
      var a = next.replace(/\r\n|\r/g, '\n').split('\n');

      a = a.slice(0, maxLines);
      next = a.join('\n');

      // When, after limiting to maxLines, we still have too much to return,
      // do add an ellipsis postfix...
      if (next.length > maxSize) {
        next = next.substring(0, maxSize) + '...';
      }

      return next;
    },

    /**
     * return a string which displays the character position where the
     * lexing error occurred, i.e. for error messages
     * 
     * @public
     * @this {RegExpLexer}
     */
    showPosition: function lexer_showPosition(maxPrefix, maxPostfix) {
      var pre = this.pastInput(maxPrefix).replace(/\s/g, ' ');
      var c = new Array(pre.length + 1).join('-');
      return pre + this.upcomingInput(maxPostfix).replace(/\s/g, ' ') + '\n' + c + '^';
    },

    /**
     * return an YYLLOC info object derived off the given context (actual, preceding, following, current).
     * Use this method when the given `actual` location is not guaranteed to exist (i.e. when
     * it MAY be NULL) and you MUST have a valid location info object anyway:
     * then we take the given context of the `preceding` and `following` locations, IFF those are available,
     * and reconstruct the `actual` location info from those.
     * If this fails, the heuristic is to take the `current` location, IFF available.
     * If this fails as well, we assume the sought location is at/around the current lexer position
     * and then produce that one as a response. DO NOTE that these heuristic/derived location info
     * values MAY be inaccurate!
     *
     * NOTE: `deriveLocationInfo()` ALWAYS produces a location info object *copy* of `actual`, not just
     * a *reference* hence all input location objects can be assumed to be 'constant' (function has no side-effects).
     * 
     * @public
     * @this {RegExpLexer}
     */
    deriveLocationInfo: function lexer_deriveYYLLOC(actual, preceding, following, current) {
      var loc = {
        first_line: 1,
        first_column: 0,
        last_line: 1,
        last_column: 0,
        range: [0, 0]
      };

      if (actual) {
        loc.first_line = actual.first_line | 0;
        loc.last_line = actual.last_line | 0;
        loc.first_column = actual.first_column | 0;
        loc.last_column = actual.last_column | 0;

        if (actual.range) {
          loc.range[0] = actual.range[0] | 0;
          loc.range[1] = actual.range[1] | 0;
        }
      }

      if (loc.first_line <= 0 || loc.last_line < loc.first_line) {
        // plan B: heuristic using preceding and following:
        if (loc.first_line <= 0 && preceding) {
          loc.first_line = preceding.last_line | 0;
          loc.first_column = preceding.last_column | 0;

          if (preceding.range) {
            loc.range[0] = actual.range[1] | 0;
          }
        }

        if ((loc.last_line <= 0 || loc.last_line < loc.first_line) && following) {
          loc.last_line = following.first_line | 0;
          loc.last_column = following.first_column | 0;

          if (following.range) {
            loc.range[1] = actual.range[0] | 0;
          }
        }

        // plan C?: see if the 'current' location is useful/sane too:
        if (loc.first_line <= 0 && current && (loc.last_line <= 0 || current.last_line <= loc.last_line)) {
          loc.first_line = current.first_line | 0;
          loc.first_column = current.first_column | 0;

          if (current.range) {
            loc.range[0] = current.range[0] | 0;
          }
        }

        if (loc.last_line <= 0 && current && (loc.first_line <= 0 || current.first_line >= loc.first_line)) {
          loc.last_line = current.last_line | 0;
          loc.last_column = current.last_column | 0;

          if (current.range) {
            loc.range[1] = current.range[1] | 0;
          }
        }
      }

      // sanitize: fix last_line BEFORE we fix first_line as we use the 'raw' value of the latter
      // or plan D heuristics to produce a 'sensible' last_line value:
      if (loc.last_line <= 0) {
        if (loc.first_line <= 0) {
          loc.first_line = this.yylloc.first_line;
          loc.last_line = this.yylloc.last_line;
          loc.first_column = this.yylloc.first_column;
          loc.last_column = this.yylloc.last_column;
          loc.range[0] = this.yylloc.range[0];
          loc.range[1] = this.yylloc.range[1];
        } else {
          loc.last_line = this.yylloc.last_line;
          loc.last_column = this.yylloc.last_column;
          loc.range[1] = this.yylloc.range[1];
        }
      }

      if (loc.first_line <= 0) {
        loc.first_line = loc.last_line;
        loc.first_column = 0;  // loc.last_column; 
        loc.range[1] = loc.range[0];
      }

      if (loc.first_column < 0) {
        loc.first_column = 0;
      }

      if (loc.last_column < 0) {
        loc.last_column = (loc.first_column > 0 ? loc.first_column : 80);
      }

      return loc;
    },

    /**
     * return a string which displays the lines & columns of input which are referenced 
     * by the given location info range, plus a few lines of context.
     * 
     * This function pretty-prints the indicated section of the input, with line numbers 
     * and everything!
     * 
     * This function is very useful to provide highly readable error reports, while
     * the location range may be specified in various flexible ways:
     * 
     * - `loc` is the location info object which references the area which should be
     *   displayed and 'marked up': these lines & columns of text are marked up by `^`
     *   characters below each character in the entire input range.
     * 
     * - `context_loc` is the *optional* location info object which instructs this
     *   pretty-printer how much *leading* context should be displayed alongside
     *   the area referenced by `loc`. This can help provide context for the displayed
     *   error, etc.
     * 
     *   When this location info is not provided, a default context of 3 lines is
     *   used.
     * 
     * - `context_loc2` is another *optional* location info object, which serves
     *   a similar purpose to `context_loc`: it specifies the amount of *trailing*
     *   context lines to display in the pretty-print output.
     * 
     *   When this location info is not provided, a default context of 1 line only is
     *   used.
     * 
     * Special Notes:
     * 
     * - when the `loc`-indicated range is very large (about 5 lines or more), then
     *   only the first and last few lines of this block are printed while a
     *   `...continued...` message will be printed between them.
     * 
     *   This serves the purpose of not printing a huge amount of text when the `loc`
     *   range happens to be huge: this way a manageable & readable output results
     *   for arbitrary large ranges.
     * 
     * - this function can display lines of input which whave not yet been lexed.
     *   `prettyPrintRange()` can access the entire input!
     * 
     * @public
     * @this {RegExpLexer}
     */
    prettyPrintRange: function lexer_prettyPrintRange(loc, context_loc, context_loc2) {
      loc = this.deriveLocationInfo(loc, context_loc, context_loc2);
      const CONTEXT = 3;
      const CONTEXT_TAIL = 1;
      const MINIMUM_VISIBLE_NONEMPTY_LINE_COUNT = 2;
      var input = this.matched + this._input;
      var lines = input.split('\n');
      var l0 = Math.max(1, (context_loc ? context_loc.first_line : loc.first_line - CONTEXT));
      var l1 = Math.max(1, (context_loc2 ? context_loc2.last_line : loc.last_line + CONTEXT_TAIL));
      var lineno_display_width = 1 + Math.log10(l1 | 1) | 0;
      var ws_prefix = new Array(lineno_display_width).join(' ');
      var nonempty_line_indexes = [];

      var rv = lines.slice(l0 - 1, l1 + 1).map(function injectLineNumber(line, index) {
        var lno = index + l0;
        var lno_pfx = (ws_prefix + lno).substr(-lineno_display_width);
        var rv = lno_pfx + ': ' + line;
        var errpfx = new Array(lineno_display_width + 1).join('^');
        var offset = 2 + 1;
        var len = 0;

        if (lno === loc.first_line) {
          offset += loc.first_column;

          len = Math.max(
            2,
            ((lno === loc.last_line ? loc.last_column : line.length)) - loc.first_column + 1
          );
        } else if (lno === loc.last_line) {
          len = Math.max(2, loc.last_column + 1);
        } else if (lno > loc.first_line && lno < loc.last_line) {
          len = Math.max(2, line.length + 1);
        }

        if (len) {
          var lead = new Array(offset).join('.');
          var mark = new Array(len).join('^');
          rv += '\n' + errpfx + lead + mark;

          if (line.trim().length > 0) {
            nonempty_line_indexes.push(index);
          }
        }

        rv = rv.replace(/\t/g, ' ');
        return rv;
      });

      // now make sure we don't print an overly large amount of error area: limit it 
      // to the top and bottom line count:
      if (nonempty_line_indexes.length > 2 * MINIMUM_VISIBLE_NONEMPTY_LINE_COUNT) {
        var clip_start = nonempty_line_indexes[MINIMUM_VISIBLE_NONEMPTY_LINE_COUNT - 1] + 1;
        var clip_end = nonempty_line_indexes[nonempty_line_indexes.length - MINIMUM_VISIBLE_NONEMPTY_LINE_COUNT] - 1;
        var intermediate_line = new Array(lineno_display_width + 1).join(' ') + '  (...continued...)';
        intermediate_line += '\n' + new Array(lineno_display_width + 1).join('-') + '  (---------------)';
        rv.splice(clip_start, clip_end - clip_start + 1, intermediate_line);
      }

      return rv.join('\n');
    },

    /**
     * helper function, used to produce a human readable description as a string, given
     * the input `yylloc` location object.
     * 
     * Set `display_range_too` to TRUE to include the string character index position(s)
     * in the description if the `yylloc.range` is available.
     * 
     * @public
     * @this {RegExpLexer}
     */
    describeYYLLOC: function lexer_describe_yylloc(yylloc, display_range_too) {
      var l1 = yylloc.first_line;
      var l2 = yylloc.last_line;
      var c1 = yylloc.first_column;
      var c2 = yylloc.last_column;
      var dl = l2 - l1;
      var dc = c2 - c1;
      var rv;

      if (dl === 0) {
        rv = 'line ' + l1 + ', ';

        if (dc <= 1) {
          rv += 'column ' + c1;
        } else {
          rv += 'columns ' + c1 + ' .. ' + c2;
        }
      } else {
        rv = 'lines ' + l1 + '(column ' + c1 + ') .. ' + l2 + '(column ' + c2 + ')';
      }

      if (yylloc.range && display_range_too) {
        var r1 = yylloc.range[0];
        var r2 = yylloc.range[1] - 1;

        if (r2 <= r1) {
          rv += ' {String Offset: ' + r1 + '}';
        } else {
          rv += ' {String Offset range: ' + r1 + ' .. ' + r2 + '}';
        }
      }

      return rv;
    },

    /**
     * test the lexed token: return FALSE when not a match, otherwise return token.
     * 
     * `match` is supposed to be an array coming out of a regex match, i.e. `match[0]`
     * contains the actually matched text string.
     * 
     * Also move the input cursor forward and update the match collectors:
     * 
     * - `yytext`
     * - `yyleng`
     * - `match`
     * - `matches`
     * - `yylloc`
     * - `offset`
     * 
     * @public
     * @this {RegExpLexer}
     */
    test_match: function lexer_test_match(match, indexed_rule) {
      var token, lines, backup, match_str, match_str_len;

      if (this.options.backtrack_lexer) {
        // save context
        backup = {
          yylineno: this.yylineno,

          yylloc: {
            first_line: this.yylloc.first_line,
            last_line: this.yylloc.last_line,
            first_column: this.yylloc.first_column,
            last_column: this.yylloc.last_column,
            range: this.yylloc.range.slice(0)
          },

          yytext: this.yytext,
          match: this.match,
          matches: this.matches,
          matched: this.matched,
          yyleng: this.yyleng,
          offset: this.offset,
          _more: this._more,
          _input: this._input,

          //_signaled_error_token: this._signaled_error_token,
          yy: this.yy,

          conditionStack: this.conditionStack.slice(0),
          done: this.done
        };
      }

      match_str = match[0];
      match_str_len = match_str.length;

      // if (match_str.indexOf('\n') !== -1 || match_str.indexOf('\r') !== -1) {
      lines = match_str.split(/(?:\r\n?|\n)/g);

      if (lines.length > 1) {
        this.yylineno += lines.length - 1;
        this.yylloc.last_line = this.yylineno + 1;
        this.yylloc.last_column = lines[lines.length - 1].length;
      } else {
        this.yylloc.last_column += match_str_len;
      }

      // }
      this.yytext += match_str;

      this.match += match_str;
      this.matched += match_str;
      this.matches = match;
      this.yyleng = this.yytext.length;
      this.yylloc.range[1] += match_str_len;

      // previous lex rules MAY have invoked the `more()` API rather than producing a token:
      // those rules will already have moved this `offset` forward matching their match lengths,
      // hence we must only add our own match length now:
      this.offset += match_str_len;

      this._more = false;
      this._backtrack = false;
      this._input = this._input.slice(match_str_len);

      // calling this method:
      //
      //   function lexer__performAction(yy, yyrulenumber, YY_START) {...}
      token = this.performAction.call(
        this,
        this.yy,
        indexed_rule,
        this.conditionStack[this.conditionStack.length - 1] /* = YY_START */
      );

      // otherwise, when the action codes are all simple return token statements:
      //token = this.simpleCaseActionClusters[indexed_rule];

      if (this.done && this._input) {
        this.done = false;
      }

      if (token) {
        return token;
      } else if (this._backtrack) {
        // recover context
        for (var k in backup) {
          this[k] = backup[k];
        }

        this.__currentRuleSet__ = null;
        return false;  // rule action called reject() implying the next rule should be tested instead. 
      } else if (this._signaled_error_token) {
        // produce one 'error' token as `.parseError()` in `reject()`
        // did not guarantee a failure signal by throwing an exception!
        token = this._signaled_error_token;

        this._signaled_error_token = false;
        return token;
      }

      return false;
    },

    /**
     * return next match in input
     * 
     * @public
     * @this {RegExpLexer}
     */
    next: function lexer_next() {
      if (this.done) {
        this.clear();
        return this.EOF;
      }

      if (!this._input) {
        this.done = true;
      }

      var token, match, tempMatch, index;

      if (!this._more) {
        this.clear();
      }

      var spec = this.__currentRuleSet__;

      if (!spec) {
        // Update the ruleset cache as we apparently encountered a state change or just started lexing.
        // The cache is set up for fast lookup -- we assume a lexer will switch states much less often than it will
        // invoke the `lex()` token-producing API and related APIs, hence caching the set for direct access helps
        // speed up those activities a tiny bit.
        spec = this.__currentRuleSet__ = this._currentRules();

        // Check whether a *sane* condition has been pushed before: this makes the lexer robust against
        // user-programmer bugs such as https://github.com/zaach/jison-lex/issues/19
        if (!spec || !spec.rules) {
          var lineno_msg = '';

          if (this.options.trackPosition) {
            lineno_msg = ' on line ' + (this.yylineno + 1);
          }

          var p = this.constructLexErrorInfo(
            'Internal lexer engine error' + lineno_msg + ': The lex grammar programmer pushed a non-existing condition name "' + this.topState() + '"; this is a fatal error and should be reported to the application programmer team!',
            false
          );

          // produce one 'error' token until this situation has been resolved, most probably by parse termination!
          return this.parseError(p.errStr, p, this.JisonLexerError) || this.ERROR;
        }
      }

      var rule_ids = spec.rules;
      var regexes = spec.__rule_regexes;
      var len = spec.__rule_count;

      // Note: the arrays are 1-based, while `len` itself is a valid index,
      // hence the non-standard less-or-equal check in the next loop condition!
      for (var i = 1; i <= len; i++) {
        tempMatch = this._input.match(regexes[i]);

        if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
          match = tempMatch;
          index = i;

          if (this.options.backtrack_lexer) {
            token = this.test_match(tempMatch, rule_ids[i]);

            if (token !== false) {
              return token;
            } else if (this._backtrack) {
              match = undefined;
              continue;  // rule action called reject() implying a rule MISmatch. 
            } else {
              // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
              return false;
            }
          } else if (!this.options.flex) {
            break;
          }
        }
      }

      if (match) {
        token = this.test_match(match, rule_ids[index]);

        if (token !== false) {
          return token;
        }

        // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
        return false;
      }

      if (!this._input) {
        this.done = true;
        this.clear();
        return this.EOF;
      } else {
        var lineno_msg = '';

        if (this.options.trackPosition) {
          lineno_msg = ' on line ' + (this.yylineno + 1);
        }

        var p = this.constructLexErrorInfo(
          'Lexical error' + lineno_msg + ': Unrecognized text.',
          this.options.lexerErrorsAreRecoverable
        );

        var pendingInput = this._input;
        var activeCondition = this.topState();
        var conditionStackDepth = this.conditionStack.length;
        token = this.parseError(p.errStr, p, this.JisonLexerError) || this.ERROR;

        if (token === this.ERROR) {
          // we can try to recover from a lexer error that `parseError()` did not 'recover' for us
          // by moving forward at least one character at a time IFF the (user-specified?) `parseError()`
          // has not consumed/modified any pending input or changed state in the error handler:
          if (!this.matches && // and make sure the input has been modified/consumed ...
          pendingInput === this._input && // ...or the lexer state has been modified significantly enough
          // to merit a non-consuming error handling action right now.
          activeCondition === this.topState() && conditionStackDepth === this.conditionStack.length) {
            this.input();
          }
        }

        return token;
      }
    },

    /**
     * return next match that has a token
     * 
     * @public
     * @this {RegExpLexer}
     */
    lex: function lexer_lex() {
      var r;

      // allow the PRE/POST handlers set/modify the return token for maximum flexibility of the generated lexer:
      if (typeof this.pre_lex === 'function') {
        r = this.pre_lex.call(this, 0);
      }

      if (typeof this.options.pre_lex === 'function') {
        // (also account for a userdef function which does not return any value: keep the token as is)
        r = this.options.pre_lex.call(this, r) || r;
      }

      if (this.yy && typeof this.yy.pre_lex === 'function') {
        // (also account for a userdef function which does not return any value: keep the token as is)
        r = this.yy.pre_lex.call(this, r) || r;
      }

      while (!r) {
        r = this.next();
      }

      if (this.yy && typeof this.yy.post_lex === 'function') {
        // (also account for a userdef function which does not return any value: keep the token as is)
        r = this.yy.post_lex.call(this, r) || r;
      }

      if (typeof this.options.post_lex === 'function') {
        // (also account for a userdef function which does not return any value: keep the token as is)
        r = this.options.post_lex.call(this, r) || r;
      }

      if (typeof this.post_lex === 'function') {
        // (also account for a userdef function which does not return any value: keep the token as is)
        r = this.post_lex.call(this, r) || r;
      }

      return r;
    },

    /**
     * return next match that has a token. Identical to the `lex()` API but does not invoke any of the 
     * `pre_lex()` nor any of the `post_lex()` callbacks.
     * 
     * @public
     * @this {RegExpLexer}
     */
    fastLex: function lexer_fastLex() {
      var r;

      while (!r) {
        r = this.next();
      }

      return r;
    },

    /**
     * return info about the lexer state that can help a parser or other lexer API user to use the
     * most efficient means available. This API is provided to aid run-time performance for larger
     * systems which employ this lexer.
     * 
     * @public
     * @this {RegExpLexer}
     */
    canIUse: function lexer_canIUse() {
      var rv = {
        fastLex: !(typeof this.pre_lex === 'function' || typeof this.options.pre_lex === 'function' || this.yy && typeof this.yy.pre_lex === 'function' || this.yy && typeof this.yy.post_lex === 'function' || typeof this.options.post_lex === 'function' || typeof this.post_lex === 'function') && typeof this.fastLex === 'function'
      };

      return rv;
    },

    /**
     * backwards compatible alias for `pushState()`;
     * the latter is symmetrical with `popState()` and we advise to use
     * those APIs in any modern lexer code, rather than `begin()`.
     * 
     * @public
     * @this {RegExpLexer}
     */
    begin: function lexer_begin(condition) {
      return this.pushState(condition);
    },

    /**
     * activates a new lexer condition state (pushes the new lexer
     * condition state onto the condition stack)
     * 
     * @public
     * @this {RegExpLexer}
     */
    pushState: function lexer_pushState(condition) {
      this.conditionStack.push(condition);
      this.__currentRuleSet__ = null;
      return this;
    },

    /**
     * pop the previously active lexer condition state off the condition
     * stack
     * 
     * @public
     * @this {RegExpLexer}
     */
    popState: function lexer_popState() {
      var n = this.conditionStack.length - 1;

      if (n > 0) {
        this.__currentRuleSet__ = null;
        return this.conditionStack.pop();
      } else {
        return this.conditionStack[0];
      }
    },

    /**
     * return the currently active lexer condition state; when an index
     * argument is provided it produces the N-th previous condition state,
     * if available
     * 
     * @public
     * @this {RegExpLexer}
     */
    topState: function lexer_topState(n) {
      n = this.conditionStack.length - 1 - Math.abs(n || 0);

      if (n >= 0) {
        return this.conditionStack[n];
      } else {
        return 'INITIAL';
      }
    },

    /**
     * (internal) determine the lexer rule set which is active for the
     * currently active lexer condition state
     * 
     * @public
     * @this {RegExpLexer}
     */
    _currentRules: function lexer__currentRules() {
      if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
        return this.conditions[this.conditionStack[this.conditionStack.length - 1]];
      } else {
        return this.conditions['INITIAL'];
      }
    },

    /**
     * return the number of states currently on the stack
     * 
     * @public
     * @this {RegExpLexer}
     */
    stateStackSize: function lexer_stateStackSize() {
      return this.conditionStack.length;
    },

    options: {
      trackPosition: true
    },

    JisonLexerError: JisonLexerError,

    performAction: function lexer__performAction(yy, yyrulenumber, YY_START) {
      var yy_ = this;
      var YYSTATE = YY_START;

      switch (yyrulenumber) {
      case 1:
        /*! Conditions:: INITIAL */
        /*! Rule::       \s+ */
        /* skip whitespace */
        break;

      default:
        return this.simpleCaseActionClusters[yyrulenumber];
      }
    },

    simpleCaseActionClusters: {
      /*! Conditions:: INITIAL */
      /*! Rule::       (--[0-9a-z-A-Z-]*) */
      0: 13,

      /*! Conditions:: INITIAL */
      /*! Rule::       \* */
      2: 5,

      /*! Conditions:: INITIAL */
      /*! Rule::       \/ */
      3: 6,

      /*! Conditions:: INITIAL */
      /*! Rule::       \+ */
      4: 3,

      /*! Conditions:: INITIAL */
      /*! Rule::       - */
      5: 4,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)px\b */
      6: 15,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)cm\b */
      7: 15,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)mm\b */
      8: 15,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)in\b */
      9: 15,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)pt\b */
      10: 15,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)pc\b */
      11: 15,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)deg\b */
      12: 16,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)grad\b */
      13: 16,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)rad\b */
      14: 16,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)turn\b */
      15: 16,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)s\b */
      16: 17,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)ms\b */
      17: 17,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)Hz\b */
      18: 18,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)kHz\b */
      19: 18,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)dpi\b */
      20: 19,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)dpcm\b */
      21: 19,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)dppx\b */
      22: 19,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)em\b */
      23: 20,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)ex\b */
      24: 21,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)ch\b */
      25: 22,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)rem\b */
      26: 23,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)vw\b */
      27: 25,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)vh\b */
      28: 24,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)vmin\b */
      29: 26,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)vmax\b */
      30: 27,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)% */
      31: 28,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([0-9]+(\.[0-9]*)?|\.[0-9]+)\b */
      32: 11,

      /*! Conditions:: INITIAL */
      /*! Rule::       (calc) */
      33: 9,

      /*! Conditions:: INITIAL */
      /*! Rule::       (var) */
      34: 12,

      /*! Conditions:: INITIAL */
      /*! Rule::       ([a-z]+) */
      35: 10,

      /*! Conditions:: INITIAL */
      /*! Rule::       \( */
      36: 7,

      /*! Conditions:: INITIAL */
      /*! Rule::       \) */
      37: 8,

      /*! Conditions:: INITIAL */
      /*! Rule::       , */
      38: 14,

      /*! Conditions:: INITIAL */
      /*! Rule::       $ */
      39: 1
    },

    rules: [
      /*  0: */  /^(?:(--[\d\-A-Za-z]*))/,
      /*  1: */  /^(?:\s+)/,
      /*  2: */  /^(?:\*)/,
      /*  3: */  /^(?:\/)/,
      /*  4: */  /^(?:\+)/,
      /*  5: */  /^(?:-)/,
      /*  6: */  /^(?:(\d+(\.\d*)?|\.\d+)px\b)/,
      /*  7: */  /^(?:(\d+(\.\d*)?|\.\d+)cm\b)/,
      /*  8: */  /^(?:(\d+(\.\d*)?|\.\d+)mm\b)/,
      /*  9: */  /^(?:(\d+(\.\d*)?|\.\d+)in\b)/,
      /* 10: */  /^(?:(\d+(\.\d*)?|\.\d+)pt\b)/,
      /* 11: */  /^(?:(\d+(\.\d*)?|\.\d+)pc\b)/,
      /* 12: */  /^(?:(\d+(\.\d*)?|\.\d+)deg\b)/,
      /* 13: */  /^(?:(\d+(\.\d*)?|\.\d+)grad\b)/,
      /* 14: */  /^(?:(\d+(\.\d*)?|\.\d+)rad\b)/,
      /* 15: */  /^(?:(\d+(\.\d*)?|\.\d+)turn\b)/,
      /* 16: */  /^(?:(\d+(\.\d*)?|\.\d+)s\b)/,
      /* 17: */  /^(?:(\d+(\.\d*)?|\.\d+)ms\b)/,
      /* 18: */  /^(?:(\d+(\.\d*)?|\.\d+)Hz\b)/,
      /* 19: */  /^(?:(\d+(\.\d*)?|\.\d+)kHz\b)/,
      /* 20: */  /^(?:(\d+(\.\d*)?|\.\d+)dpi\b)/,
      /* 21: */  /^(?:(\d+(\.\d*)?|\.\d+)dpcm\b)/,
      /* 22: */  /^(?:(\d+(\.\d*)?|\.\d+)dppx\b)/,
      /* 23: */  /^(?:(\d+(\.\d*)?|\.\d+)em\b)/,
      /* 24: */  /^(?:(\d+(\.\d*)?|\.\d+)ex\b)/,
      /* 25: */  /^(?:(\d+(\.\d*)?|\.\d+)ch\b)/,
      /* 26: */  /^(?:(\d+(\.\d*)?|\.\d+)rem\b)/,
      /* 27: */  /^(?:(\d+(\.\d*)?|\.\d+)vw\b)/,
      /* 28: */  /^(?:(\d+(\.\d*)?|\.\d+)vh\b)/,
      /* 29: */  /^(?:(\d+(\.\d*)?|\.\d+)vmin\b)/,
      /* 30: */  /^(?:(\d+(\.\d*)?|\.\d+)vmax\b)/,
      /* 31: */  /^(?:(\d+(\.\d*)?|\.\d+)%)/,
      /* 32: */  /^(?:(\d+(\.\d*)?|\.\d+)\b)/,
      /* 33: */  /^(?:(calc))/,
      /* 34: */  /^(?:(var))/,
      /* 35: */  /^(?:([a-z]+))/,
      /* 36: */  /^(?:\()/,
      /* 37: */  /^(?:\))/,
      /* 38: */  /^(?:,)/,
      /* 39: */  /^(?:$)/
    ],

    conditions: {
      'INITIAL': {
        rules: [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20,
          21,
          22,
          23,
          24,
          25,
          26,
          27,
          28,
          29,
          30,
          31,
          32,
          33,
          34,
          35,
          36,
          37,
          38,
          39
        ],

        inclusive: true
      }
    }
  };

  return lexer;
}();
parser.lexer = lexer;



function Parser() {
  this.yy = {};
}
Parser.prototype = parser;
parser.Parser = Parser;

return new Parser();
})();

        


if (true) {
  exports.parser = parser;
  exports.Parser = parser.Parser;
  exports.parse = function () {
    return parser.parse.apply(parser, arguments);
  };
  
}


/***/ }),

/***/ 6204:
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_RESULT__;/* UAParser.js v0.7.36
   Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
   MIT License */
(function(window,undefined){"use strict";var LIBVERSION="0.7.36",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded",UA_MAX_LENGTH=350;var AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",BROWSER="Browser",CHROME="Chrome",EDGE="Edge",FIREFOX="Firefox",GOOGLE="Google",HUAWEI="Huawei",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",OPERA="Opera",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",VIERA="Viera",XIAOMI="Xiaomi",ZEBRA="Zebra",FACEBOOK="Facebook",CHROMIUM_OS="Chromium OS",MAC_OS="Mac OS";var extend=function(regexes,extensions){var mergedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){mergedRegexes[i]=extensions[i].concat(regexes[i])}else{mergedRegexes[i]=regexes[i]}}return mergedRegexes},enumerize=function(arr){var enums={};for(var i=0;i<arr.length;i++){enums[arr[i].toUpperCase()]=arr[i]}return enums},has=function(str1,str2){return typeof str1===STR_TYPE?lowerize(str2).indexOf(lowerize(str1))!==-1:false},lowerize=function(str){return str.toLowerCase()},majorize=function(version){return typeof version===STR_TYPE?version.replace(/[^\d\.]/g,EMPTY).split(".")[0]:undefined},trim=function(str,len){if(typeof str===STR_TYPE){str=str.replace(/^\s\s*/,EMPTY);return typeof len===UNDEF_TYPE?str:str.substring(0,UA_MAX_LENGTH)}};var rgxMapper=function(ua,arrays){var i=0,j,k,p,q,matches,match;while(i<arrays.length&&!matches){var regex=arrays[i],props=arrays[i+1];j=k=0;while(j<regex.length&&!matches){if(!regex[j]){break}matches=regex[j++].exec(ua);if(!!matches){for(p=0;p<props.length;p++){match=matches[++k];q=props[p];if(typeof q===OBJ_TYPE&&q.length>0){if(q.length===2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length===3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length===4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},strMapper=function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j<map[i].length;j++){if(has(map[i][j],str)){return i===UNKNOWN?undefined:i}}}else if(has(map[i],str)){return i===UNKNOWN?undefined:i}}return str};var oldSafariMap={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},windowsVersionMap={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"};var regexes={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[VERSION,[NAME,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[VERSION,[NAME,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[NAME,VERSION],[/opios[\/ ]+([\w\.]+)/i],[VERSION,[NAME,OPERA+" Mini"]],[/\bopr\/([\w\.]+)/i],[VERSION,[NAME,OPERA]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[NAME,VERSION],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[VERSION,[NAME,"UC"+BROWSER]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[VERSION,[NAME,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[VERSION,[NAME,"WeChat"]],[/konqueror\/([\w\.]+)/i],[VERSION,[NAME,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[VERSION,[NAME,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[VERSION,[NAME,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 Secure "+BROWSER],VERSION],[/\bfocus\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" Focus"]],[/\bopt\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[VERSION,[NAME,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[VERSION,[NAME,"Dolphin"]],[/coast\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[VERSION,[NAME,"MIUI "+BROWSER]],[/fxios\/([-\w\.]+)/i],[VERSION,[NAME,FIREFOX]],[/\bqihu|(qi?ho?o?|360)browser/i],[[NAME,"360 "+BROWSER]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 "+BROWSER],VERSION],[/(comodo_dragon)\/([\w\.]+)/i],[[NAME,/_/g," "],VERSION],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[NAME,VERSION],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[NAME],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[NAME,FACEBOOK],VERSION],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[NAME,VERSION],[/\bgsa\/([\w\.]+) .*safari\//i],[VERSION,[NAME,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[VERSION,[NAME,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[VERSION,[NAME,CHROME+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[NAME,CHROME+" WebView"],VERSION],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[VERSION,[NAME,"Android "+BROWSER]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[NAME,VERSION],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[VERSION,[NAME,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[VERSION,NAME],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[NAME,[VERSION,strMapper,oldSafariMap]],[/(webkit|khtml)\/([\w\.]+)/i],[NAME,VERSION],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[NAME,"Netscape"],VERSION],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[VERSION,[NAME,FIREFOX+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[NAME,VERSION],[/(cobalt)\/([\w\.]+)/i],[NAME,[VERSION,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[ARCHITECTURE,"amd64"]],[/(ia32(?=;))/i],[[ARCHITECTURE,lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[ARCHITECTURE,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[ARCHITECTURE,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[ARCHITECTURE,"armhf"]],[/windows (ce|mobile); ppc;/i],[[ARCHITECTURE,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[ARCHITECTURE,/ower/,EMPTY,lowerize]],[/(sun4\w)[;\)]/i],[[ARCHITECTURE,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[ARCHITECTURE,lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,TABLET]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,MOBILE]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[MODEL,[VENDOR,APPLE],[TYPE,MOBILE]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[MODEL,[VENDOR,APPLE],[TYPE,TABLET]],[/(macintosh);/i],[MODEL,[VENDOR,APPLE]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[MODEL,[VENDOR,SHARP],[TYPE,MOBILE]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,TABLET]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,MOBILE]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,MOBILE]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,TABLET]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[MODEL,[VENDOR,"OPPO"],[TYPE,MOBILE]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[MODEL,[VENDOR,"Vivo"],[TYPE,MOBILE]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[MODEL,[VENDOR,"Realme"],[TYPE,MOBILE]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,MOBILE]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[MODEL,[VENDOR,MOTOROLA],[TYPE,TABLET]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[MODEL,[VENDOR,LG],[TYPE,TABLET]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[MODEL,[VENDOR,LG],[TYPE,MOBILE]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[MODEL,[VENDOR,"Lenovo"],[TYPE,TABLET]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[MODEL,/_/g," "],[VENDOR,"Nokia"],[TYPE,MOBILE]],[/(pixel c)\b/i],[MODEL,[VENDOR,GOOGLE],[TYPE,TABLET]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[MODEL,[VENDOR,GOOGLE],[TYPE,MOBILE]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[MODEL,[VENDOR,SONY],[TYPE,MOBILE]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[MODEL,"Xperia Tablet"],[VENDOR,SONY],[TYPE,TABLET]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[MODEL,[VENDOR,"OnePlus"],[TYPE,MOBILE]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[MODEL,[VENDOR,AMAZON],[TYPE,TABLET]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[MODEL,/(.+)/g,"Fire Phone $1"],[VENDOR,AMAZON],[TYPE,MOBILE]],[/(playbook);[-\w\),; ]+(rim)/i],[MODEL,VENDOR,[TYPE,TABLET]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[MODEL,[VENDOR,BLACKBERRY],[TYPE,MOBILE]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[MODEL,[VENDOR,ASUS],[TYPE,TABLET]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[MODEL,[VENDOR,ASUS],[TYPE,MOBILE]],[/(nexus 9)/i],[MODEL,[VENDOR,"HTC"],[TYPE,TABLET]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[VENDOR,[MODEL,/_/g," "],[TYPE,MOBILE]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[MODEL,[VENDOR,"Acer"],[TYPE,TABLET]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[MODEL,[VENDOR,"Meizu"],[TYPE,MOBILE]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(surface duo)/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,TABLET]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[MODEL,[VENDOR,"Fairphone"],[TYPE,MOBILE]],[/(u304aa)/i],[MODEL,[VENDOR,"AT&T"],[TYPE,MOBILE]],[/\bsie-(\w*)/i],[MODEL,[VENDOR,"Siemens"],[TYPE,MOBILE]],[/\b(rct\w+) b/i],[MODEL,[VENDOR,"RCA"],[TYPE,TABLET]],[/\b(venue[\d ]{2,7}) b/i],[MODEL,[VENDOR,"Dell"],[TYPE,TABLET]],[/\b(q(?:mv|ta)\w+) b/i],[MODEL,[VENDOR,"Verizon"],[TYPE,TABLET]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[MODEL,[VENDOR,"Barnes & Noble"],[TYPE,TABLET]],[/\b(tm\d{3}\w+) b/i],[MODEL,[VENDOR,"NuVision"],[TYPE,TABLET]],[/\b(k88) b/i],[MODEL,[VENDOR,"ZTE"],[TYPE,TABLET]],[/\b(nx\d{3}j) b/i],[MODEL,[VENDOR,"ZTE"],[TYPE,MOBILE]],[/\b(gen\d{3}) b.+49h/i],[MODEL,[VENDOR,"Swiss"],[TYPE,MOBILE]],[/\b(zur\d{3}) b/i],[MODEL,[VENDOR,"Swiss"],[TYPE,TABLET]],[/\b((zeki)?tb.*\b) b/i],[MODEL,[VENDOR,"Zeki"],[TYPE,TABLET]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[VENDOR,"Dragon Touch"],MODEL,[TYPE,TABLET]],[/\b(ns-?\w{0,9}) b/i],[MODEL,[VENDOR,"Insignia"],[TYPE,TABLET]],[/\b((nxa|next)-?\w{0,9}) b/i],[MODEL,[VENDOR,"NextBook"],[TYPE,TABLET]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[VENDOR,"Voice"],MODEL,[TYPE,MOBILE]],[/\b(lvtel\-)?(v1[12]) b/i],[[VENDOR,"LvTel"],MODEL,[TYPE,MOBILE]],[/\b(ph-1) /i],[MODEL,[VENDOR,"Essential"],[TYPE,MOBILE]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[MODEL,[VENDOR,"Envizen"],[TYPE,TABLET]],[/\b(trio[-\w\. ]+) b/i],[MODEL,[VENDOR,"MachSpeed"],[TYPE,TABLET]],[/\btu_(1491) b/i],[MODEL,[VENDOR,"Rotor"],[TYPE,TABLET]],[/(shield[\w ]+) b/i],[MODEL,[VENDOR,"Nvidia"],[TYPE,TABLET]],[/(sprint) (\w+)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kin\.[onetw]{3})/i],[[MODEL,/\./g," "],[VENDOR,MICROSOFT],[TYPE,MOBILE]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,TABLET]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,MOBILE]],[/smart-tv.+(samsung)/i],[VENDOR,[TYPE,SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[MODEL,/^/,"SmartTV"],[VENDOR,SAMSUNG],[TYPE,SMARTTV]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[VENDOR,LG],[TYPE,SMARTTV]],[/(apple) ?tv/i],[VENDOR,[MODEL,APPLE+" TV"],[TYPE,SMARTTV]],[/crkey/i],[[MODEL,CHROME+"cast"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/droid.+aft(\w+)( bui|\))/i],[MODEL,[VENDOR,AMAZON],[TYPE,SMARTTV]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[MODEL,[VENDOR,SHARP],[TYPE,SMARTTV]],[/(bravia[\w ]+)( bui|\))/i],[MODEL,[VENDOR,SONY],[TYPE,SMARTTV]],[/(mitv-\w{5}) bui/i],[MODEL,[VENDOR,XIAOMI],[TYPE,SMARTTV]],[/Hbbtv.*(technisat) (.*);/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[VENDOR,trim],[MODEL,trim],[TYPE,SMARTTV]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[TYPE,SMARTTV]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[VENDOR,MODEL,[TYPE,CONSOLE]],[/droid.+; (shield) bui/i],[MODEL,[VENDOR,"Nvidia"],[TYPE,CONSOLE]],[/(playstation [345portablevi]+)/i],[MODEL,[VENDOR,SONY],[TYPE,CONSOLE]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,CONSOLE]],[/((pebble))app/i],[VENDOR,MODEL,[TYPE,WEARABLE]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[MODEL,[VENDOR,APPLE],[TYPE,WEARABLE]],[/droid.+; (glass) \d/i],[MODEL,[VENDOR,GOOGLE],[TYPE,WEARABLE]],[/droid.+; (wt63?0{2,3})\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,WEARABLE]],[/(quest( 2| pro)?)/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,WEARABLE]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[VENDOR,[TYPE,EMBEDDED]],[/(aeobc)\b/i],[MODEL,[VENDOR,AMAZON],[TYPE,EMBEDDED]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[MODEL,[TYPE,MOBILE]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[MODEL,[TYPE,TABLET]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[TYPE,TABLET]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[TYPE,MOBILE]],[/(android[-\w\. ]{0,9});.+buil/i],[MODEL,[VENDOR,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[VERSION,[NAME,EDGE+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[VERSION,[NAME,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[NAME,VERSION],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[VERSION,NAME]],os:[[/microsoft (windows) (vista|xp)/i],[NAME,VERSION],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[NAME,[VERSION,strMapper,windowsVersionMap]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[NAME,"Windows"],[VERSION,strMapper,windowsVersionMap]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[VERSION,/_/g,"."],[NAME,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[NAME,MAC_OS],[VERSION,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[VERSION,NAME],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[NAME,VERSION],[/\(bb(10);/i],[VERSION,[NAME,BLACKBERRY]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[VERSION,[NAME,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[VERSION,[NAME,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[VERSION,[NAME,"watchOS"]],[/crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROME+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[NAME,CHROMIUM_OS],VERSION],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[NAME,VERSION],[/(sunos) ?([\w\.\d]*)/i],[[NAME,"Solaris"],VERSION],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[NAME,VERSION]]};var UAParser=function(ua,extensions){if(typeof ua===OBJ_TYPE){extensions=ua;ua=undefined}if(!(this instanceof UAParser)){return new UAParser(ua,extensions).getResult()}var _navigator=typeof window!==UNDEF_TYPE&&window.navigator?window.navigator:undefined;var _ua=ua||(_navigator&&_navigator.userAgent?_navigator.userAgent:EMPTY);var _uach=_navigator&&_navigator.userAgentData?_navigator.userAgentData:undefined;var _rgxmap=extensions?extend(regexes,extensions):regexes;var _isSelfNav=_navigator&&_navigator.userAgent==_ua;this.getBrowser=function(){var _browser={};_browser[NAME]=undefined;_browser[VERSION]=undefined;rgxMapper.call(_browser,_ua,_rgxmap.browser);_browser[MAJOR]=majorize(_browser[VERSION]);if(_isSelfNav&&_navigator&&_navigator.brave&&typeof _navigator.brave.isBrave==FUNC_TYPE){_browser[NAME]="Brave"}return _browser};this.getCPU=function(){var _cpu={};_cpu[ARCHITECTURE]=undefined;rgxMapper.call(_cpu,_ua,_rgxmap.cpu);return _cpu};this.getDevice=function(){var _device={};_device[VENDOR]=undefined;_device[MODEL]=undefined;_device[TYPE]=undefined;rgxMapper.call(_device,_ua,_rgxmap.device);if(_isSelfNav&&!_device[TYPE]&&_uach&&_uach.mobile){_device[TYPE]=MOBILE}if(_isSelfNav&&_device[MODEL]=="Macintosh"&&_navigator&&typeof _navigator.standalone!==UNDEF_TYPE&&_navigator.maxTouchPoints&&_navigator.maxTouchPoints>2){_device[MODEL]="iPad";_device[TYPE]=TABLET}return _device};this.getEngine=function(){var _engine={};_engine[NAME]=undefined;_engine[VERSION]=undefined;rgxMapper.call(_engine,_ua,_rgxmap.engine);return _engine};this.getOS=function(){var _os={};_os[NAME]=undefined;_os[VERSION]=undefined;rgxMapper.call(_os,_ua,_rgxmap.os);if(_isSelfNav&&!_os[NAME]&&_uach&&_uach.platform!="Unknown"){_os[NAME]=_uach.platform.replace(/chrome os/i,CHROMIUM_OS).replace(/macos/i,MAC_OS)}return _os};this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}};this.getUA=function(){return _ua};this.setUA=function(ua){_ua=typeof ua===STR_TYPE&&ua.length>UA_MAX_LENGTH?trim(ua,UA_MAX_LENGTH):ua;return this};this.setUA(_ua);return this};UAParser.VERSION=LIBVERSION;UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR]);UAParser.CPU=enumerize([ARCHITECTURE]);UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]);UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);if(typeof exports!==UNDEF_TYPE){if("object"!==UNDEF_TYPE&&module.exports){exports=module.exports=UAParser}exports.UAParser=UAParser}else{if("function"===FUNC_TYPE&&__webpack_require__.amdO){!(__WEBPACK_AMD_DEFINE_RESULT__ = (function(){return UAParser}).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))}else if(typeof window!==UNDEF_TYPE){window.UAParser=UAParser}}var $=typeof window!==UNDEF_TYPE&&(window.jQuery||window.Zepto);if($&&!$.ua){var parser=new UAParser;$.ua=parser.getResult();$.ua.get=function(){return parser.getUA()};$.ua.set=function(ua){parser.setUA(ua);var result=parser.getResult();for(var prop in result){$.ua[prop]=result[prop]}}}})(typeof window==="object"?window:this);

/***/ }),

/***/ 8315:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
var __webpack_unused_export__;

"use client";

var _interopRequireDefault = __webpack_require__(5709);
__webpack_unused_export__ = ({
  value: true
});
exports.A = void 0;
var _createSvgIcon = _interopRequireDefault(__webpack_require__(9650));
var _jsxRuntime = __webpack_require__(4848);
var _default = exports.A = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
  d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
}), 'Close');

/***/ }),

/***/ 9650:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

'use client';

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
Object.defineProperty(exports, "default", ({
  enumerable: true,
  get: function () {
    return _utils.createSvgIcon;
  }
}));
var _utils = __webpack_require__(6147);

/***/ }),

/***/ 4434:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: function() { return /* binding */ styles_createTheme; }
});

// UNUSED EXPORTS: createMuiTheme

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(8168);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
var objectWithoutPropertiesLoose = __webpack_require__(8587);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js
var formatMuiErrorMessage = __webpack_require__(799);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/deepmerge/deepmerge.js
var deepmerge = __webpack_require__(3479);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js + 5 modules
var defaultSxConfig = __webpack_require__(9058);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js
var styleFunctionSx = __webpack_require__(2733);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/createTheme/createTheme.js + 2 modules
var createTheme = __webpack_require__(9731);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/createMixins.js

function createMixins(breakpoints, mixins) {
  return (0,esm_extends/* default */.A)({
    toolbar: {
      minHeight: 56,
      [breakpoints.up('xs')]: {
        '@media (orientation: landscape)': {
          minHeight: 48
        }
      },
      [breakpoints.up('sm')]: {
        minHeight: 64
      }
    }
  }, mixins);
}
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/colorManipulator.js
var colorManipulator = __webpack_require__(2937);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/colors/common.js
const common = {
  black: '#000',
  white: '#fff'
};
/* harmony default export */ var colors_common = (common);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/colors/grey.js
const grey = {
  50: '#fafafa',
  100: '#f5f5f5',
  200: '#eeeeee',
  300: '#e0e0e0',
  400: '#bdbdbd',
  500: '#9e9e9e',
  600: '#757575',
  700: '#616161',
  800: '#424242',
  900: '#212121',
  A100: '#f5f5f5',
  A200: '#eeeeee',
  A400: '#bdbdbd',
  A700: '#616161'
};
/* harmony default export */ var colors_grey = (grey);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/colors/purple.js
const purple = {
  50: '#f3e5f5',
  100: '#e1bee7',
  200: '#ce93d8',
  300: '#ba68c8',
  400: '#ab47bc',
  500: '#9c27b0',
  600: '#8e24aa',
  700: '#7b1fa2',
  800: '#6a1b9a',
  900: '#4a148c',
  A100: '#ea80fc',
  A200: '#e040fb',
  A400: '#d500f9',
  A700: '#aa00ff'
};
/* harmony default export */ var colors_purple = (purple);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/colors/red.js
const red = {
  50: '#ffebee',
  100: '#ffcdd2',
  200: '#ef9a9a',
  300: '#e57373',
  400: '#ef5350',
  500: '#f44336',
  600: '#e53935',
  700: '#d32f2f',
  800: '#c62828',
  900: '#b71c1c',
  A100: '#ff8a80',
  A200: '#ff5252',
  A400: '#ff1744',
  A700: '#d50000'
};
/* harmony default export */ var colors_red = (red);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/colors/orange.js
const orange = {
  50: '#fff3e0',
  100: '#ffe0b2',
  200: '#ffcc80',
  300: '#ffb74d',
  400: '#ffa726',
  500: '#ff9800',
  600: '#fb8c00',
  700: '#f57c00',
  800: '#ef6c00',
  900: '#e65100',
  A100: '#ffd180',
  A200: '#ffab40',
  A400: '#ff9100',
  A700: '#ff6d00'
};
/* harmony default export */ var colors_orange = (orange);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/colors/blue.js
const blue = {
  50: '#e3f2fd',
  100: '#bbdefb',
  200: '#90caf9',
  300: '#64b5f6',
  400: '#42a5f5',
  500: '#2196f3',
  600: '#1e88e5',
  700: '#1976d2',
  800: '#1565c0',
  900: '#0d47a1',
  A100: '#82b1ff',
  A200: '#448aff',
  A400: '#2979ff',
  A700: '#2962ff'
};
/* harmony default export */ var colors_blue = (blue);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/colors/lightBlue.js
const lightBlue = {
  50: '#e1f5fe',
  100: '#b3e5fc',
  200: '#81d4fa',
  300: '#4fc3f7',
  400: '#29b6f6',
  500: '#03a9f4',
  600: '#039be5',
  700: '#0288d1',
  800: '#0277bd',
  900: '#01579b',
  A100: '#80d8ff',
  A200: '#40c4ff',
  A400: '#00b0ff',
  A700: '#0091ea'
};
/* harmony default export */ var colors_lightBlue = (lightBlue);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/colors/green.js
const green = {
  50: '#e8f5e9',
  100: '#c8e6c9',
  200: '#a5d6a7',
  300: '#81c784',
  400: '#66bb6a',
  500: '#4caf50',
  600: '#43a047',
  700: '#388e3c',
  800: '#2e7d32',
  900: '#1b5e20',
  A100: '#b9f6ca',
  A200: '#69f0ae',
  A400: '#00e676',
  A700: '#00c853'
};
/* harmony default export */ var colors_green = (green);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/createPalette.js



const _excluded = ["mode", "contrastThreshold", "tonalOffset"];










const light = {
  // The colors used to style the text.
  text: {
    // The most important text.
    primary: 'rgba(0, 0, 0, 0.87)',
    // Secondary text.
    secondary: 'rgba(0, 0, 0, 0.6)',
    // Disabled text have even lower visual prominence.
    disabled: 'rgba(0, 0, 0, 0.38)'
  },
  // The color used to divide different elements.
  divider: 'rgba(0, 0, 0, 0.12)',
  // The background colors used to style the surfaces.
  // Consistency between these values is important.
  background: {
    paper: colors_common.white,
    default: colors_common.white
  },
  // The colors used to style the action elements.
  action: {
    // The color of an active action like an icon button.
    active: 'rgba(0, 0, 0, 0.54)',
    // The color of an hovered action.
    hover: 'rgba(0, 0, 0, 0.04)',
    hoverOpacity: 0.04,
    // The color of a selected action.
    selected: 'rgba(0, 0, 0, 0.08)',
    selectedOpacity: 0.08,
    // The color of a disabled action.
    disabled: 'rgba(0, 0, 0, 0.26)',
    // The background color of a disabled action.
    disabledBackground: 'rgba(0, 0, 0, 0.12)',
    disabledOpacity: 0.38,
    focus: 'rgba(0, 0, 0, 0.12)',
    focusOpacity: 0.12,
    activatedOpacity: 0.12
  }
};
const dark = {
  text: {
    primary: colors_common.white,
    secondary: 'rgba(255, 255, 255, 0.7)',
    disabled: 'rgba(255, 255, 255, 0.5)',
    icon: 'rgba(255, 255, 255, 0.5)'
  },
  divider: 'rgba(255, 255, 255, 0.12)',
  background: {
    paper: '#121212',
    default: '#121212'
  },
  action: {
    active: colors_common.white,
    hover: 'rgba(255, 255, 255, 0.08)',
    hoverOpacity: 0.08,
    selected: 'rgba(255, 255, 255, 0.16)',
    selectedOpacity: 0.16,
    disabled: 'rgba(255, 255, 255, 0.3)',
    disabledBackground: 'rgba(255, 255, 255, 0.12)',
    disabledOpacity: 0.38,
    focus: 'rgba(255, 255, 255, 0.12)',
    focusOpacity: 0.12,
    activatedOpacity: 0.24
  }
};
function addLightOrDark(intent, direction, shade, tonalOffset) {
  const tonalOffsetLight = tonalOffset.light || tonalOffset;
  const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
  if (!intent[direction]) {
    if (intent.hasOwnProperty(shade)) {
      intent[direction] = intent[shade];
    } else if (direction === 'light') {
      intent.light = (0,colorManipulator/* lighten */.a)(intent.main, tonalOffsetLight);
    } else if (direction === 'dark') {
      intent.dark = (0,colorManipulator/* darken */.e$)(intent.main, tonalOffsetDark);
    }
  }
}
function getDefaultPrimary(mode = 'light') {
  if (mode === 'dark') {
    return {
      main: colors_blue[200],
      light: colors_blue[50],
      dark: colors_blue[400]
    };
  }
  return {
    main: colors_blue[700],
    light: colors_blue[400],
    dark: colors_blue[800]
  };
}
function getDefaultSecondary(mode = 'light') {
  if (mode === 'dark') {
    return {
      main: colors_purple[200],
      light: colors_purple[50],
      dark: colors_purple[400]
    };
  }
  return {
    main: colors_purple[500],
    light: colors_purple[300],
    dark: colors_purple[700]
  };
}
function getDefaultError(mode = 'light') {
  if (mode === 'dark') {
    return {
      main: colors_red[500],
      light: colors_red[300],
      dark: colors_red[700]
    };
  }
  return {
    main: colors_red[700],
    light: colors_red[400],
    dark: colors_red[800]
  };
}
function getDefaultInfo(mode = 'light') {
  if (mode === 'dark') {
    return {
      main: colors_lightBlue[400],
      light: colors_lightBlue[300],
      dark: colors_lightBlue[700]
    };
  }
  return {
    main: colors_lightBlue[700],
    light: colors_lightBlue[500],
    dark: colors_lightBlue[900]
  };
}
function getDefaultSuccess(mode = 'light') {
  if (mode === 'dark') {
    return {
      main: colors_green[400],
      light: colors_green[300],
      dark: colors_green[700]
    };
  }
  return {
    main: colors_green[800],
    light: colors_green[500],
    dark: colors_green[900]
  };
}
function getDefaultWarning(mode = 'light') {
  if (mode === 'dark') {
    return {
      main: colors_orange[400],
      light: colors_orange[300],
      dark: colors_orange[700]
    };
  }
  return {
    main: '#ed6c02',
    // closest to orange[800] that pass 3:1.
    light: colors_orange[500],
    dark: colors_orange[900]
  };
}
function createPalette(palette) {
  const {
      mode = 'light',
      contrastThreshold = 3,
      tonalOffset = 0.2
    } = palette,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(palette, _excluded);
  const primary = palette.primary || getDefaultPrimary(mode);
  const secondary = palette.secondary || getDefaultSecondary(mode);
  const error = palette.error || getDefaultError(mode);
  const info = palette.info || getDefaultInfo(mode);
  const success = palette.success || getDefaultSuccess(mode);
  const warning = palette.warning || getDefaultWarning(mode);

  // Use the same logic as
  // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59
  // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54
  function getContrastText(background) {
    const contrastText = (0,colorManipulator/* getContrastRatio */.eM)(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
    if (false) {}
    return contrastText;
  }
  const augmentColor = ({
    color,
    name,
    mainShade = 500,
    lightShade = 300,
    darkShade = 700
  }) => {
    color = (0,esm_extends/* default */.A)({}, color);
    if (!color.main && color[mainShade]) {
      color.main = color[mainShade];
    }
    if (!color.hasOwnProperty('main')) {
      throw new Error( false ? 0 : (0,formatMuiErrorMessage/* default */.A)(11, name ? ` (${name})` : '', mainShade));
    }
    if (typeof color.main !== 'string') {
      throw new Error( false ? 0 : (0,formatMuiErrorMessage/* default */.A)(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
    }
    addLightOrDark(color, 'light', lightShade, tonalOffset);
    addLightOrDark(color, 'dark', darkShade, tonalOffset);
    if (!color.contrastText) {
      color.contrastText = getContrastText(color.main);
    }
    return color;
  };
  const modes = {
    dark,
    light
  };
  if (false) {}
  const paletteOutput = (0,deepmerge/* default */.A)((0,esm_extends/* default */.A)({
    // A collection of common colors.
    common: (0,esm_extends/* default */.A)({}, colors_common),
    // prevent mutable object.
    // The palette mode, can be light or dark.
    mode,
    // The colors used to represent primary interface elements for a user.
    primary: augmentColor({
      color: primary,
      name: 'primary'
    }),
    // The colors used to represent secondary interface elements for a user.
    secondary: augmentColor({
      color: secondary,
      name: 'secondary',
      mainShade: 'A400',
      lightShade: 'A200',
      darkShade: 'A700'
    }),
    // The colors used to represent interface elements that the user should be made aware of.
    error: augmentColor({
      color: error,
      name: 'error'
    }),
    // The colors used to represent potentially dangerous actions or important messages.
    warning: augmentColor({
      color: warning,
      name: 'warning'
    }),
    // The colors used to present information to the user that is neutral and not necessarily important.
    info: augmentColor({
      color: info,
      name: 'info'
    }),
    // The colors used to indicate the successful completion of an action that user triggered.
    success: augmentColor({
      color: success,
      name: 'success'
    }),
    // The grey colors.
    grey: colors_grey,
    // Used by `getContrastText()` to maximize the contrast between
    // the background and the text.
    contrastThreshold,
    // Takes a background color and returns the text color that maximizes the contrast.
    getContrastText,
    // Generate a rich color object.
    augmentColor,
    // Used by the functions below to shift a color's luminance by approximately
    // two indexes within its tonal palette.
    // E.g., shift from Red 500 to Red 300 or Red 700.
    tonalOffset
  }, modes[mode]), other);
  return paletteOutput;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/createTypography.js


const createTypography_excluded = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];

function round(value) {
  return Math.round(value * 1e5) / 1e5;
}
const caseAllCaps = {
  textTransform: 'uppercase'
};
const defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif';

/**
 * @see @link{https://m2.material.io/design/typography/the-type-system.html}
 * @see @link{https://m2.material.io/design/typography/understanding-typography.html}
 */
function createTypography(palette, typography) {
  const _ref = typeof typography === 'function' ? typography(palette) : typography,
    {
      fontFamily = defaultFontFamily,
      // The default font size of the Material Specification.
      fontSize = 14,
      // px
      fontWeightLight = 300,
      fontWeightRegular = 400,
      fontWeightMedium = 500,
      fontWeightBold = 700,
      // Tell MUI what's the font-size on the html element.
      // 16px is the default font-size used by browsers.
      htmlFontSize = 16,
      // Apply the CSS properties to all the variants.
      allVariants,
      pxToRem: pxToRem2
    } = _ref,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(_ref, createTypography_excluded);
  if (false) {}
  const coef = fontSize / 14;
  const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);
  const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => (0,esm_extends/* default */.A)({
    fontFamily,
    fontWeight,
    fontSize: pxToRem(size),
    // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
    lineHeight
  }, fontFamily === defaultFontFamily ? {
    letterSpacing: `${round(letterSpacing / size)}em`
  } : {}, casing, allVariants);
  const variants = {
    h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
    h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),
    h3: buildVariant(fontWeightRegular, 48, 1.167, 0),
    h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),
    h5: buildVariant(fontWeightRegular, 24, 1.334, 0),
    h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),
    subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),
    subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
    body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
    body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),
    button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
    caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
    overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),
    // TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.
    inherit: {
      fontFamily: 'inherit',
      fontWeight: 'inherit',
      fontSize: 'inherit',
      lineHeight: 'inherit',
      letterSpacing: 'inherit'
    }
  };
  return (0,deepmerge/* default */.A)((0,esm_extends/* default */.A)({
    htmlFontSize,
    pxToRem,
    fontFamily,
    fontSize,
    fontWeightLight,
    fontWeightRegular,
    fontWeightMedium,
    fontWeightBold
  }, variants), other, {
    clone: false // No need to clone deep
  });
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/shadows.js
const shadowKeyUmbraOpacity = 0.2;
const shadowKeyPenumbraOpacity = 0.14;
const shadowAmbientShadowOpacity = 0.12;
function createShadow(...px) {
  return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(',');
}

// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss
const shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
/* harmony default export */ var styles_shadows = (shadows);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/createTransitions.js
var createTransitions = __webpack_require__(4757);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/zIndex.js
// We need to centralize the zIndex definitions as they work
// like global values in the browser.
const zIndex = {
  mobileStepper: 1000,
  fab: 1050,
  speedDial: 1050,
  appBar: 1100,
  drawer: 1200,
  modal: 1300,
  snackbar: 1400,
  tooltip: 1500
};
/* harmony default export */ var styles_zIndex = (zIndex);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/createTheme.js



const createTheme_excluded = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];










function createTheme_createTheme(options = {}, ...args) {
  const {
      mixins: mixinsInput = {},
      palette: paletteInput = {},
      transitions: transitionsInput = {},
      typography: typographyInput = {}
    } = options,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(options, createTheme_excluded);
  if (options.vars) {
    throw new Error( false ? 0 : (0,formatMuiErrorMessage/* default */.A)(18));
  }
  const palette = createPalette(paletteInput);
  const systemTheme = (0,createTheme/* default */.A)(options);
  let muiTheme = (0,deepmerge/* default */.A)(systemTheme, {
    mixins: createMixins(systemTheme.breakpoints, mixinsInput),
    palette,
    // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
    shadows: styles_shadows.slice(),
    typography: createTypography(palette, typographyInput),
    transitions: (0,createTransitions/* default */.Ay)(transitionsInput),
    zIndex: (0,esm_extends/* default */.A)({}, styles_zIndex)
  });
  muiTheme = (0,deepmerge/* default */.A)(muiTheme, other);
  muiTheme = args.reduce((acc, argument) => (0,deepmerge/* default */.A)(acc, argument), muiTheme);
  if (false) {}
  muiTheme.unstable_sxConfig = (0,esm_extends/* default */.A)({}, defaultSxConfig/* default */.A, other == null ? void 0 : other.unstable_sxConfig);
  muiTheme.unstable_sx = function sx(props) {
    return (0,styleFunctionSx/* default */.A)({
      sx: props,
      theme: this
    });
  };
  return muiTheme;
}
let warnedOnce = false;
function createMuiTheme(...args) {
  if (false) {}
  return createTheme_createTheme(...args);
}
/* harmony default export */ var styles_createTheme = (createTheme_createTheme);

/***/ }),

/***/ 4757:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Ay: function() { return /* binding */ createTransitions; },
/* harmony export */   p0: function() { return /* binding */ duration; }
/* harmony export */ });
/* unused harmony export easing */
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8587);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8168);


const _excluded = ["duration", "easing", "delay"];
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
// to learn the context in which each easing should be used.
const easing = {
  // This is the most common easing curve.
  easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
  // Objects enter the screen at full velocity from off-screen and
  // slowly decelerate to a resting point.
  easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
  // Objects leave the screen at full velocity. They do not decelerate when off-screen.
  easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
  // The sharp curve is used by objects that may return to the screen at any time.
  sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'
};

// Follow https://m2.material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations
// to learn when use what timing
const duration = {
  shortest: 150,
  shorter: 200,
  short: 250,
  // most basic recommended timing
  standard: 300,
  // this is to be used in complex animations
  complex: 375,
  // recommended when something is entering screen
  enteringScreen: 225,
  // recommended when something is leaving screen
  leavingScreen: 195
};
function formatMs(milliseconds) {
  return `${Math.round(milliseconds)}ms`;
}
function getAutoHeightDuration(height) {
  if (!height) {
    return 0;
  }
  const constant = height / 36;

  // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10
  return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
}
function createTransitions(inputTransitions) {
  const mergedEasing = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)({}, easing, inputTransitions.easing);
  const mergedDuration = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)({}, duration, inputTransitions.duration);
  const create = (props = ['all'], options = {}) => {
    const {
        duration: durationOption = mergedDuration.standard,
        easing: easingOption = mergedEasing.easeInOut,
        delay = 0
      } = options,
      other = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(options, _excluded);
    if (false) {}
    return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
  };
  return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)({
    getAutoHeightDuration,
    create
  }, inputTransitions, {
    easing: mergedEasing,
    duration: mergedDuration
  });
}

/***/ }),

/***/ 7199:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _createTheme__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4434);
'use client';


const defaultTheme = (0,_createTheme__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)();
/* harmony default export */ __webpack_exports__.A = (defaultTheme);

/***/ }),

/***/ 346:
/***/ (function(__unused_webpack_module, __webpack_exports__) {

"use strict";
/* harmony default export */ __webpack_exports__.A = ('$$material');

/***/ }),

/***/ 5740:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _slotShouldForwardProp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1292);

const rootShouldForwardProp = prop => (0,_slotShouldForwardProp__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(prop) && prop !== 'classes';
/* harmony default export */ __webpack_exports__.A = (rootShouldForwardProp);

/***/ }),

/***/ 1292:
/***/ (function(__unused_webpack_module, __webpack_exports__) {

"use strict";
// copied from @mui/system/createStyled
function slotShouldForwardProp(prop) {
  return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
}
/* harmony default export */ __webpack_exports__.A = (slotShouldForwardProp);

/***/ }),

/***/ 3874:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _mui_system_createStyled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1603);
/* harmony import */ var _defaultTheme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7199);
/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(346);
/* harmony import */ var _rootShouldForwardProp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5740);
'use client';







const styled = (0,_mui_system_createStyled__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)({
  themeId: _identifier__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A,
  defaultTheme: _defaultTheme__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A,
  rootShouldForwardProp: _rootShouldForwardProp__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A
});
/* harmony default export */ __webpack_exports__.Ay = (styled);

/***/ }),

/***/ 1863:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ useThemeProps; }
/* harmony export */ });
/* harmony import */ var _mui_system_useThemeProps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(511);
/* harmony import */ var _defaultTheme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7199);
/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(346);
'use client';




function useThemeProps({
  props,
  name
}) {
  return (0,_mui_system_useThemeProps__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)({
    props,
    name,
    defaultTheme: _defaultTheme__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A,
    themeId: _identifier__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A
  });
}

/***/ }),

/***/ 2040:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _mui_utils_capitalize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(985);

/* harmony default export */ __webpack_exports__.A = (_mui_utils_capitalize__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);

/***/ }),

/***/ 793:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: function() { return /* binding */ createSvgIcon; }
});

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(8168);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(6540);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
var objectWithoutPropertiesLoose = __webpack_require__(8587);
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
var prop_types = __webpack_require__(5556);
// EXTERNAL MODULE: ../../modules/ui/code/content-icons/node_modules/clsx/dist/clsx.m.js
var clsx_m = __webpack_require__(9156);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/composeClasses/composeClasses.js
var composeClasses = __webpack_require__(7453);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/capitalize.js
var capitalize = __webpack_require__(2040);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/useThemeProps.js
var useThemeProps = __webpack_require__(1863);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/styled.js
var styled = __webpack_require__(3874);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js
var generateUtilityClasses = __webpack_require__(7135);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js
var generateUtilityClass = __webpack_require__(6467);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/SvgIcon/svgIconClasses.js


function getSvgIconUtilityClass(slot) {
  return (0,generateUtilityClass/* default */.Ay)('MuiSvgIcon', slot);
}
const svgIconClasses = (0,generateUtilityClasses/* default */.A)('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);
/* harmony default export */ var SvgIcon_svgIconClasses = ((/* unused pure expression or super */ null && (svgIconClasses)));
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(4848);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/SvgIcon/SvgIcon.js
'use client';



const _excluded = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];










const useUtilityClasses = ownerState => {
  const {
    color,
    fontSize,
    classes
  } = ownerState;
  const slots = {
    root: ['root', color !== 'inherit' && `color${(0,capitalize/* default */.A)(color)}`, `fontSize${(0,capitalize/* default */.A)(fontSize)}`]
  };
  return (0,composeClasses/* default */.A)(slots, getSvgIconUtilityClass, classes);
};
const SvgIconRoot = (0,styled/* default */.Ay)('svg', {
  name: 'MuiSvgIcon',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, ownerState.color !== 'inherit' && styles[`color${(0,capitalize/* default */.A)(ownerState.color)}`], styles[`fontSize${(0,capitalize/* default */.A)(ownerState.fontSize)}`]];
  }
})(({
  theme,
  ownerState
}) => {
  var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette2, _palette3;
  return {
    userSelect: 'none',
    width: '1em',
    height: '1em',
    display: 'inline-block',
    // the <svg> will define the property that has `currentColor`
    // for example heroicons uses fill="none" and stroke="currentColor"
    fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',
    flexShrink: 0,
    transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {
      duration: (_theme$transitions2 = theme.transitions) == null || (_theme$transitions2 = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2.shorter
    }),
    fontSize: {
      inherit: 'inherit',
      small: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',
      medium: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',
      large: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'
    }[ownerState.fontSize],
    // TODO v5 deprecate, v6 remove for sx
    color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null || (_palette = _palette[ownerState.color]) == null ? void 0 : _palette.main) != null ? _palette$ownerState$c : {
      action: (_palette2 = (theme.vars || theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active,
      disabled: (_palette3 = (theme.vars || theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled,
      inherit: undefined
    }[ownerState.color]
  };
});
const SvgIcon = /*#__PURE__*/react.forwardRef(function SvgIcon(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiSvgIcon'
  });
  const {
      children,
      className,
      color = 'inherit',
      component = 'svg',
      fontSize = 'medium',
      htmlColor,
      inheritViewBox = false,
      titleAccess,
      viewBox = '0 0 24 24'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, _excluded);
  const hasSvgAsChild = /*#__PURE__*/react.isValidElement(children) && children.type === 'svg';
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    color,
    component,
    fontSize,
    instanceFontSize: inProps.fontSize,
    inheritViewBox,
    viewBox,
    hasSvgAsChild
  });
  const more = {};
  if (!inheritViewBox) {
    more.viewBox = viewBox;
  }
  const classes = useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(SvgIconRoot, (0,esm_extends/* default */.A)({
    as: component,
    className: (0,clsx_m/* default */.A)(classes.root, className),
    focusable: "false",
    color: htmlColor,
    "aria-hidden": titleAccess ? undefined : true,
    role: titleAccess ? 'img' : undefined,
    ref: ref
  }, more, other, hasSvgAsChild && children.props, {
    ownerState: ownerState,
    children: [hasSvgAsChild ? children.props.children : children, titleAccess ? /*#__PURE__*/(0,jsx_runtime.jsx)("title", {
      children: titleAccess
    }) : null]
  }));
});
 false ? 0 : void 0;
SvgIcon.muiName = 'SvgIcon';
/* harmony default export */ var SvgIcon_SvgIcon = (SvgIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/createSvgIcon.js
'use client';





/**
 * Private module reserved for @mui packages.
 */

function createSvgIcon(path, displayName) {
  function Component(props, ref) {
    return /*#__PURE__*/(0,jsx_runtime.jsx)(SvgIcon_SvgIcon, (0,esm_extends/* default */.A)({
      "data-testid": `${displayName}Icon`,
      ref: ref
    }, props, {
      children: path
    }));
  }
  if (false) {}
  Component.muiName = SvgIcon_SvgIcon.muiName;
  return /*#__PURE__*/react.memo( /*#__PURE__*/react.forwardRef(Component));
}

/***/ }),

/***/ 7181:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _mui_utils_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9379);

/* harmony default export */ __webpack_exports__.A = (_mui_utils_debounce__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);

/***/ }),

/***/ 6147:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  capitalize: function() { return /* reexport */ capitalize/* default */.A; },
  createChainedFunction: function() { return /* reexport */ utils_createChainedFunction; },
  createSvgIcon: function() { return /* reexport */ createSvgIcon/* default */.A; },
  debounce: function() { return /* reexport */ debounce/* default */.A; },
  deprecatedPropType: function() { return /* reexport */ utils_deprecatedPropType; },
  isMuiElement: function() { return /* reexport */ isMuiElement/* default */.A; },
  ownerDocument: function() { return /* reexport */ ownerDocument/* default */.A; },
  ownerWindow: function() { return /* reexport */ ownerWindow/* default */.A; },
  requirePropFactory: function() { return /* reexport */ utils_requirePropFactory; },
  setRef: function() { return /* reexport */ utils_setRef; },
  unstable_ClassNameGenerator: function() { return /* binding */ unstable_ClassNameGenerator; },
  unstable_useEnhancedEffect: function() { return /* reexport */ useEnhancedEffect/* default */.A; },
  unstable_useId: function() { return /* reexport */ utils_useId; },
  unsupportedProp: function() { return /* reexport */ utils_unsupportedProp; },
  useControlled: function() { return /* reexport */ useControlled/* default */.A; },
  useEventCallback: function() { return /* reexport */ useEventCallback/* default */.A; },
  useForkRef: function() { return /* reexport */ useForkRef/* default */.A; },
  useIsFocusVisible: function() { return /* reexport */ useIsFocusVisible/* default */.A; }
});

// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js
var ClassNameGenerator = __webpack_require__(913);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/capitalize.js
var capitalize = __webpack_require__(2040);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/createChainedFunction/createChainedFunction.js
var createChainedFunction = __webpack_require__(4067);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/createChainedFunction.js

/* harmony default export */ var utils_createChainedFunction = (createChainedFunction/* default */.A);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/createSvgIcon.js + 2 modules
var createSvgIcon = __webpack_require__(793);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/debounce.js
var debounce = __webpack_require__(7181);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType.js
function deprecatedPropType(validator, reason) {
  if (true) {
    return () => null;
  }
  return (props, propName, componentName, location, propFullName) => {
    const componentNameSafe = componentName || '<<anonymous>>';
    const propFullNameSafe = propFullName || propName;
    if (typeof props[propName] !== 'undefined') {
      return new Error(`The ${location} \`${propFullNameSafe}\` of ` + `\`${componentNameSafe}\` is deprecated. ${reason}`);
    }
    return null;
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/deprecatedPropType.js

/* harmony default export */ var utils_deprecatedPropType = (deprecatedPropType);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/isMuiElement.js + 1 modules
var isMuiElement = __webpack_require__(5223);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/ownerDocument.js
var ownerDocument = __webpack_require__(3294);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/ownerWindow.js
var ownerWindow = __webpack_require__(7375);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(8168);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory.js

function requirePropFactory(componentNameInError, Component) {
  if (true) {
    return () => null;
  }

  // eslint-disable-next-line react/forbid-foreign-prop-types
  const prevPropTypes = Component ? (0,esm_extends/* default */.A)({}, Component.propTypes) : null;
  const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {
    const propFullNameSafe = propFullName || propName;
    const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];
    if (defaultTypeChecker) {
      const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);
      if (typeCheckerResult) {
        return typeCheckerResult;
      }
    }
    if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {
      return new Error(`The prop \`${propFullNameSafe}\` of ` + `\`${componentNameInError}\` can only be used together with the \`${requiredProp}\` prop.`);
    }
    return null;
  };
  return requireProp;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/requirePropFactory.js

/* harmony default export */ var utils_requirePropFactory = (requirePropFactory);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/setRef/setRef.js
var setRef = __webpack_require__(207);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/setRef.js

/* harmony default export */ var utils_setRef = (setRef/* default */.A);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useEnhancedEffect.js
var useEnhancedEffect = __webpack_require__(5504);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useId/useId.js
var useId = __webpack_require__(5311);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useId.js
'use client';


/* harmony default export */ var utils_useId = (useId/* default */.A);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp.js
function unsupportedProp(props, propName, componentName, location, propFullName) {
  if (true) {
    return null;
  }
  const propFullNameSafe = propFullName || propName;
  if (typeof props[propName] !== 'undefined') {
    return new Error(`The prop \`${propFullNameSafe}\` is not supported. Please remove it.`);
  }
  return null;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/unsupportedProp.js

/* harmony default export */ var utils_unsupportedProp = (unsupportedProp);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useControlled.js + 1 modules
var useControlled = __webpack_require__(9727);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useEventCallback.js
var useEventCallback = __webpack_require__(1476);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useForkRef.js
var useForkRef = __webpack_require__(6982);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useIsFocusVisible.js + 1 modules
var useIsFocusVisible = __webpack_require__(7266);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/index.js
'use client';



















// TODO: remove this export once ClassNameGenerator is stable
// eslint-disable-next-line @typescript-eslint/naming-convention
const unstable_ClassNameGenerator = {
  configure: generator => {
    if (false) {}
    ClassNameGenerator/* default */.A.configure(generator);
  }
};

/***/ }),

/***/ 5223:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: function() { return /* binding */ utils_isMuiElement; }
});

// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(6540);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/isMuiElement/isMuiElement.js

function isMuiElement(element, muiNames) {
  var _muiName, _element$type;
  return /*#__PURE__*/react.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName
  // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45
  // eslint-disable-next-line no-underscore-dangle
  (_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/isMuiElement.js

/* harmony default export */ var utils_isMuiElement = (isMuiElement);

/***/ }),

/***/ 3294:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _mui_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8183);

/* harmony default export */ __webpack_exports__.A = (_mui_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);

/***/ }),

/***/ 7375:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _mui_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2327);

/* harmony default export */ __webpack_exports__.A = (_mui_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);

/***/ }),

/***/ 9727:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: function() { return /* binding */ utils_useControlled; }
});

// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(6540);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useControlled/useControlled.js
'use client';

/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */

function useControlled({
  controlled,
  default: defaultProp,
  name,
  state = 'value'
}) {
  // isControlled is ignored in the hook dependency lists as it should never change.
  const {
    current: isControlled
  } = react.useRef(controlled !== undefined);
  const [valueState, setValue] = react.useState(defaultProp);
  const value = isControlled ? controlled : valueState;
  if (false) {}
  const setValueIfUncontrolled = react.useCallback(newValue => {
    if (!isControlled) {
      setValue(newValue);
    }
  }, []);
  return [value, setValueIfUncontrolled];
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useControlled.js
'use client';


/* harmony default export */ var utils_useControlled = (useControlled);

/***/ }),

/***/ 5504:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _mui_utils_useEnhancedEffect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2723);
'use client';


/* harmony default export */ __webpack_exports__.A = (_mui_utils_useEnhancedEffect__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);

/***/ }),

/***/ 1476:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _mui_utils_useEventCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1885);
'use client';


/* harmony default export */ __webpack_exports__.A = (_mui_utils_useEventCallback__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);

/***/ }),

/***/ 6982:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _mui_utils_useForkRef__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4061);
'use client';


/* harmony default export */ __webpack_exports__.A = (_mui_utils_useForkRef__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A);

/***/ }),

/***/ 7266:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: function() { return /* binding */ utils_useIsFocusVisible; }
});

// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(6540);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useTimeout/useTimeout.js + 2 modules
var useTimeout = __webpack_require__(478);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useIsFocusVisible/useIsFocusVisible.js
'use client';

// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js


let hadKeyboardEvent = true;
let hadFocusVisibleRecently = false;
const hadFocusVisibleRecentlyTimeout = new useTimeout/* Timeout */.E();
const inputTypesWhitelist = {
  text: true,
  search: true,
  url: true,
  tel: true,
  email: true,
  password: true,
  number: true,
  date: true,
  month: true,
  week: true,
  time: true,
  datetime: true,
  'datetime-local': true
};

/**
 * Computes whether the given element should automatically trigger the
 * `focus-visible` class being added, i.e. whether it should always match
 * `:focus-visible` when focused.
 * @param {Element} node
 * @returns {boolean}
 */
function focusTriggersKeyboardModality(node) {
  const {
    type,
    tagName
  } = node;
  if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
    return true;
  }
  if (tagName === 'TEXTAREA' && !node.readOnly) {
    return true;
  }
  if (node.isContentEditable) {
    return true;
  }
  return false;
}

/**
 * Keep track of our keyboard modality state with `hadKeyboardEvent`.
 * If the most recent user interaction was via the keyboard;
 * and the key press did not include a meta, alt/option, or control key;
 * then the modality is keyboard. Otherwise, the modality is not keyboard.
 * @param {KeyboardEvent} event
 */
function handleKeyDown(event) {
  if (event.metaKey || event.altKey || event.ctrlKey) {
    return;
  }
  hadKeyboardEvent = true;
}

/**
 * If at any point a user clicks with a pointing device, ensure that we change
 * the modality away from keyboard.
 * This avoids the situation where a user presses a key on an already focused
 * element, and then clicks on a different element, focusing it with a
 * pointing device, while we still think we're in keyboard modality.
 */
function handlePointerDown() {
  hadKeyboardEvent = false;
}
function handleVisibilityChange() {
  if (this.visibilityState === 'hidden') {
    // If the tab becomes active again, the browser will handle calling focus
    // on the element (Safari actually calls it twice).
    // If this tab change caused a blur on an element with focus-visible,
    // re-apply the class when the user switches back to the tab.
    if (hadFocusVisibleRecently) {
      hadKeyboardEvent = true;
    }
  }
}
function prepare(doc) {
  doc.addEventListener('keydown', handleKeyDown, true);
  doc.addEventListener('mousedown', handlePointerDown, true);
  doc.addEventListener('pointerdown', handlePointerDown, true);
  doc.addEventListener('touchstart', handlePointerDown, true);
  doc.addEventListener('visibilitychange', handleVisibilityChange, true);
}
function teardown(doc) {
  doc.removeEventListener('keydown', handleKeyDown, true);
  doc.removeEventListener('mousedown', handlePointerDown, true);
  doc.removeEventListener('pointerdown', handlePointerDown, true);
  doc.removeEventListener('touchstart', handlePointerDown, true);
  doc.removeEventListener('visibilitychange', handleVisibilityChange, true);
}
function isFocusVisible(event) {
  const {
    target
  } = event;
  try {
    return target.matches(':focus-visible');
  } catch (error) {
    // Browsers not implementing :focus-visible will throw a SyntaxError.
    // We use our own heuristic for those browsers.
    // Rethrow might be better if it's not the expected error but do we really
    // want to crash if focus-visible malfunctioned?
  }

  // No need for validFocusTarget check. The user does that by attaching it to
  // focusable events only.
  return hadKeyboardEvent || focusTriggersKeyboardModality(target);
}
function useIsFocusVisible() {
  const ref = react.useCallback(node => {
    if (node != null) {
      prepare(node.ownerDocument);
    }
  }, []);
  const isFocusVisibleRef = react.useRef(false);

  /**
   * Should be called if a blur event is fired
   */
  function handleBlurVisible() {
    // checking against potential state variable does not suffice if we focus and blur synchronously.
    // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.
    // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.
    // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751
    // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).
    if (isFocusVisibleRef.current) {
      // To detect a tab/window switch, we look for a blur event followed
      // rapidly by a visibility change.
      // If we don't see a visibility change within 100ms, it's probably a
      // regular focus change.
      hadFocusVisibleRecently = true;
      hadFocusVisibleRecentlyTimeout.start(100, () => {
        hadFocusVisibleRecently = false;
      });
      isFocusVisibleRef.current = false;
      return true;
    }
    return false;
  }

  /**
   * Should be called if a blur event is fired
   */
  function handleFocusVisible(event) {
    if (isFocusVisible(event)) {
      isFocusVisibleRef.current = true;
      return true;
    }
    return false;
  }
  return {
    isFocusVisibleRef,
    onFocus: handleFocusVisible,
    onBlur: handleBlurVisible,
    ref
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useIsFocusVisible.js
'use client';


/* harmony default export */ var utils_useIsFocusVisible = (useIsFocusVisible);

/***/ }),

/***/ 2722:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ GlobalStyles; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6540);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5556);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _emotion_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8361);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4848);
'use client';





function isEmpty(obj) {
  return obj === undefined || obj === null || Object.keys(obj).length === 0;
}
function GlobalStyles(props) {
  const {
    styles,
    defaultTheme = {}
  } = props;
  const globalStyles = typeof styles === 'function' ? themeInput => styles(isEmpty(themeInput) ? defaultTheme : themeInput) : styles;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_emotion_react__WEBPACK_IMPORTED_MODULE_3__/* .Global */ .mL, {
    styles: globalStyles
  });
}
 false ? 0 : void 0;

/***/ }),

/***/ 3033:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  GlobalStyles: function() { return /* reexport */ GlobalStyles/* default */.A; },
  StyledEngineProvider: function() { return /* reexport */ StyledEngineProvider; },
  ThemeContext: function() { return /* reexport */ emotion_element_c39617d8_browser_esm.T; },
  css: function() { return /* reexport */ emotion_react_browser_esm/* css */.AH; },
  "default": function() { return /* binding */ styled; },
  internal_processStyles: function() { return /* binding */ internal_processStyles; },
  keyframes: function() { return /* reexport */ emotion_react_browser_esm/* keyframes */.i7; }
});

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(8168);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(6540);
// EXTERNAL MODULE: ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js
var is_prop_valid_browser_esm = __webpack_require__(5165);
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js
var emotion_element_c39617d8_browser_esm = __webpack_require__(7424);
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
var emotion_utils_browser_esm = __webpack_require__(1957);
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js + 1 modules
var emotion_serialize_browser_esm = __webpack_require__(9095);
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js
var emotion_use_insertion_effect_with_fallbacks_browser_esm = __webpack_require__(6243);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js








var testOmitPropsOnStringTag = is_prop_valid_browser_esm/* default */.A;

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 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 Insertion = function Insertion(_ref) {
  var cache = _ref.cache,
      serialized = _ref.serialized,
      isStringTag = _ref.isStringTag;
  (0,emotion_utils_browser_esm/* registerStyles */.SF)(cache, serialized, isStringTag);
  (0,emotion_use_insertion_effect_with_fallbacks_browser_esm/* useInsertionEffectAlwaysWithSyncFallback */.s)(function () {
    return (0,emotion_utils_browser_esm/* insertStyles */.sk)(cache, serialized, isStringTag);
  });

  return null;
};

var createStyled = function createStyled(tag, options) {
  if (false) {}

  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 (false) {}

      styles.push(args[0][0]);
      var len = args.length;
      var i = 1;

      for (; i < len; i++) {
        if (false) {}

        styles.push(args[i], args[0][i]);
      }
    } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class


    var Styled = (0,emotion_element_c39617d8_browser_esm.w)(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(emotion_element_c39617d8_browser_esm.T);
      }

      if (typeof props.className === 'string') {
        className = (0,emotion_utils_browser_esm/* getRegisteredStyles */.Rk)(cache.registered, classInterpolations, props.className);
      } else if (props.className != null) {
        className = props.className + " ";
      }

      var serialized = (0,emotion_serialize_browser_esm/* serializeStyles */.J)(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 && "production" !== 'production') {} // $FlowFixMe: coerce undefined to string


        return "." + targetClassName;
      }
    });

    Styled.withComponent = function (nextTag, nextOptions) {
      return createStyled(nextTag, (0,esm_extends/* default */.A)({}, options, nextOptions, {
        shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
      })).apply(void 0, styles);
    };

    return Styled;
  };
};



;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js









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);
});



// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/@emotion/react/dist/emotion-react.browser.esm.js
var emotion_react_browser_esm = __webpack_require__(8361);
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
var prop_types = __webpack_require__(5556);
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js + 7 modules
var emotion_cache_browser_esm = __webpack_require__(6112);
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(4848);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js
'use client';






// prepend: true moves MUI styles to the top of the <head> so they're loaded first.
// It allows developers to easily override MUI styles with other styling solutions, like CSS modules.

let cache;
if (typeof document === 'object') {
  cache = (0,emotion_cache_browser_esm/* default */.A)({
    key: 'css',
    prepend: true
  });
}
function StyledEngineProvider(props) {
  const {
    injectFirst,
    children
  } = props;
  return injectFirst && cache ? /*#__PURE__*/(0,jsx_runtime.jsx)(emotion_element_c39617d8_browser_esm.C, {
    value: cache,
    children: children
  }) : children;
}
 false ? 0 : void 0;
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles.js
var GlobalStyles = __webpack_require__(2722);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/styled-engine/index.js
/**
 * @mui/styled-engine v5.16.6
 *
 * @license MIT
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
'use client';

/* eslint-disable no-underscore-dangle */

function styled(tag, options) {
  const stylesFactory = newStyled(tag, options);
  if (false) {}
  return stylesFactory;
}

// eslint-disable-next-line @typescript-eslint/naming-convention
const internal_processStyles = (tag, processor) => {
  // Emotion attaches all the styles as `__emotion_styles`.
  // Ref: https://github.com/emotion-js/emotion/blob/16d971d0da229596d6bcc39d282ba9753c9ee7cf/packages/styled/src/base.js#L186
  if (Array.isArray(tag.__emotion_styles)) {
    tag.__emotion_styles = processor(tag.__emotion_styles);
  }
};




/***/ }),

/***/ 2937:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
var __webpack_unused_export__;


var _interopRequireDefault = __webpack_require__(5709);
__webpack_unused_export__ = ({
  value: true
});
exports.X4 = alpha;
__webpack_unused_export__ = blend;
__webpack_unused_export__ = void 0;
exports.e$ = darken;
__webpack_unused_export__ = decomposeColor;
__webpack_unused_export__ = emphasize;
exports.eM = getContrastRatio;
__webpack_unused_export__ = getLuminance;
__webpack_unused_export__ = hexToRgb;
__webpack_unused_export__ = hslToRgb;
exports.a = lighten;
__webpack_unused_export__ = private_safeAlpha;
__webpack_unused_export__ = void 0;
__webpack_unused_export__ = private_safeDarken;
__webpack_unused_export__ = private_safeEmphasize;
__webpack_unused_export__ = private_safeLighten;
__webpack_unused_export__ = recomposeColor;
__webpack_unused_export__ = rgbToHex;
var _formatMuiErrorMessage2 = _interopRequireDefault(__webpack_require__(9110));
var _clamp = _interopRequireDefault(__webpack_require__(577));
/* eslint-disable @typescript-eslint/naming-convention */

/**
 * Returns a number whose value is limited to the given range.
 * @param {number} value The value to be clamped
 * @param {number} min The lower boundary of the output range
 * @param {number} max The upper boundary of the output range
 * @returns {number} A number in the range [min, max]
 */
function clampWrapper(value, min = 0, max = 1) {
  if (false) {}
  return (0, _clamp.default)(value, min, max);
}

/**
 * Converts a color from CSS hex format to CSS rgb format.
 * @param {string} color - Hex color, i.e. #nnn or #nnnnnn
 * @returns {string} A CSS rgb color string
 */
function hexToRgb(color) {
  color = color.slice(1);
  const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');
  let colors = color.match(re);
  if (colors && colors[0].length === 1) {
    colors = colors.map(n => n + n);
  }
  return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {
    return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;
  }).join(', ')})` : '';
}
function intToHex(int) {
  const hex = int.toString(16);
  return hex.length === 1 ? `0${hex}` : hex;
}

/**
 * Returns an object with the type and values of a color.
 *
 * Note: Does not support rgb % values.
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
 * @returns {object} - A MUI color object: {type: string, values: number[]}
 */
function decomposeColor(color) {
  // Idempotent
  if (color.type) {
    return color;
  }
  if (color.charAt(0) === '#') {
    return decomposeColor(hexToRgb(color));
  }
  const marker = color.indexOf('(');
  const type = color.substring(0, marker);
  if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {
    throw new Error( false ? 0 : (0, _formatMuiErrorMessage2.default)(9, color));
  }
  let values = color.substring(marker + 1, color.length - 1);
  let colorSpace;
  if (type === 'color') {
    values = values.split(' ');
    colorSpace = values.shift();
    if (values.length === 4 && values[3].charAt(0) === '/') {
      values[3] = values[3].slice(1);
    }
    if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {
      throw new Error( false ? 0 : (0, _formatMuiErrorMessage2.default)(10, colorSpace));
    }
  } else {
    values = values.split(',');
  }
  values = values.map(value => parseFloat(value));
  return {
    type,
    values,
    colorSpace
  };
}

/**
 * Returns a channel created from the input color.
 *
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
 * @returns {string} - The channel for the color, that can be used in rgba or hsla colors
 */
const colorChannel = color => {
  const decomposedColor = decomposeColor(color);
  return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');
};
__webpack_unused_export__ = colorChannel;
const private_safeColorChannel = (color, warning) => {
  try {
    return colorChannel(color);
  } catch (error) {
    if (warning && "production" !== 'production') {}
    return color;
  }
};

/**
 * Converts a color object with type and values to a string.
 * @param {object} color - Decomposed color
 * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'
 * @param {array} color.values - [n,n,n] or [n,n,n,n]
 * @returns {string} A CSS color string
 */
__webpack_unused_export__ = private_safeColorChannel;
function recomposeColor(color) {
  const {
    type,
    colorSpace
  } = color;
  let {
    values
  } = color;
  if (type.indexOf('rgb') !== -1) {
    // Only convert the first 3 values to int (i.e. not alpha)
    values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);
  } else if (type.indexOf('hsl') !== -1) {
    values[1] = `${values[1]}%`;
    values[2] = `${values[2]}%`;
  }
  if (type.indexOf('color') !== -1) {
    values = `${colorSpace} ${values.join(' ')}`;
  } else {
    values = `${values.join(', ')}`;
  }
  return `${type}(${values})`;
}

/**
 * Converts a color from CSS rgb format to CSS hex format.
 * @param {string} color - RGB color, i.e. rgb(n, n, n)
 * @returns {string} A CSS rgb color string, i.e. #nnnnnn
 */
function rgbToHex(color) {
  // Idempotent
  if (color.indexOf('#') === 0) {
    return color;
  }
  const {
    values
  } = decomposeColor(color);
  return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;
}

/**
 * Converts a color from hsl format to rgb format.
 * @param {string} color - HSL color values
 * @returns {string} rgb color values
 */
function hslToRgb(color) {
  color = decomposeColor(color);
  const {
    values
  } = color;
  const h = values[0];
  const s = values[1] / 100;
  const l = values[2] / 100;
  const a = s * Math.min(l, 1 - l);
  const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
  let type = 'rgb';
  const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
  if (color.type === 'hsla') {
    type += 'a';
    rgb.push(values[3]);
  }
  return recomposeColor({
    type,
    values: rgb
  });
}
/**
 * The relative brightness of any point in a color space,
 * normalized to 0 for darkest black and 1 for lightest white.
 *
 * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
 * @returns {number} The relative brightness of the color in the range 0 - 1
 */
function getLuminance(color) {
  color = decomposeColor(color);
  let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;
  rgb = rgb.map(val => {
    if (color.type !== 'color') {
      val /= 255; // normalized
    }
    return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;
  });

  // Truncate at 3 digits
  return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
}

/**
 * Calculates the contrast ratio between two colors.
 *
 * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
 * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @returns {number} A contrast ratio value in the range 0 - 21.
 */
function getContrastRatio(foreground, background) {
  const lumA = getLuminance(foreground);
  const lumB = getLuminance(background);
  return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
}

/**
 * Sets the absolute transparency of a color.
 * Any existing alpha values are overwritten.
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
 * @param {number} value - value to set the alpha channel to in the range 0 - 1
 * @returns {string} A CSS color string. Hex input values are returned as rgb
 */
function alpha(color, value) {
  color = decomposeColor(color);
  value = clampWrapper(value);
  if (color.type === 'rgb' || color.type === 'hsl') {
    color.type += 'a';
  }
  if (color.type === 'color') {
    color.values[3] = `/${value}`;
  } else {
    color.values[3] = value;
  }
  return recomposeColor(color);
}
function private_safeAlpha(color, value, warning) {
  try {
    return alpha(color, value);
  } catch (error) {
    if (warning && "production" !== 'production') {}
    return color;
  }
}

/**
 * Darkens a color.
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
 * @param {number} coefficient - multiplier in the range 0 - 1
 * @returns {string} A CSS color string. Hex input values are returned as rgb
 */
function darken(color, coefficient) {
  color = decomposeColor(color);
  coefficient = clampWrapper(coefficient);
  if (color.type.indexOf('hsl') !== -1) {
    color.values[2] *= 1 - coefficient;
  } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {
    for (let i = 0; i < 3; i += 1) {
      color.values[i] *= 1 - coefficient;
    }
  }
  return recomposeColor(color);
}
function private_safeDarken(color, coefficient, warning) {
  try {
    return darken(color, coefficient);
  } catch (error) {
    if (warning && "production" !== 'production') {}
    return color;
  }
}

/**
 * Lightens a color.
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
 * @param {number} coefficient - multiplier in the range 0 - 1
 * @returns {string} A CSS color string. Hex input values are returned as rgb
 */
function lighten(color, coefficient) {
  color = decomposeColor(color);
  coefficient = clampWrapper(coefficient);
  if (color.type.indexOf('hsl') !== -1) {
    color.values[2] += (100 - color.values[2]) * coefficient;
  } else if (color.type.indexOf('rgb') !== -1) {
    for (let i = 0; i < 3; i += 1) {
      color.values[i] += (255 - color.values[i]) * coefficient;
    }
  } else if (color.type.indexOf('color') !== -1) {
    for (let i = 0; i < 3; i += 1) {
      color.values[i] += (1 - color.values[i]) * coefficient;
    }
  }
  return recomposeColor(color);
}
function private_safeLighten(color, coefficient, warning) {
  try {
    return lighten(color, coefficient);
  } catch (error) {
    if (warning && "production" !== 'production') {}
    return color;
  }
}

/**
 * Darken or lighten a color, depending on its luminance.
 * Light colors are darkened, dark colors are lightened.
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
 * @param {number} coefficient=0.15 - multiplier in the range 0 - 1
 * @returns {string} A CSS color string. Hex input values are returned as rgb
 */
function emphasize(color, coefficient = 0.15) {
  return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);
}
function private_safeEmphasize(color, coefficient, warning) {
  try {
    return emphasize(color, coefficient);
  } catch (error) {
    if (warning && "production" !== 'production') {}
    return color;
  }
}

/**
 * Blend a transparent overlay color with a background color, resulting in a single
 * RGB color.
 * @param {string} background - CSS color
 * @param {string} overlay - CSS color
 * @param {number} opacity - Opacity multiplier in the range 0 - 1
 * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.
 */
function blend(background, overlay, opacity, gamma = 1.0) {
  const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);
  const backgroundColor = decomposeColor(background);
  const overlayColor = decomposeColor(overlay);
  const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];
  return recomposeColor({
    type: 'rgb',
    values: rgb
  });
}

/***/ }),

/***/ 1603:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
var __webpack_unused_export__;


var _interopRequireDefault = __webpack_require__(5709);
__webpack_unused_export__ = ({
  value: true
});
exports.Ay = createStyled;
__webpack_unused_export__ = shouldForwardProp;
__webpack_unused_export__ = void 0;
var _extends2 = _interopRequireDefault(__webpack_require__(6193));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(__webpack_require__(3712));
var _styledEngine = _interopRequireWildcard(__webpack_require__(3033));
var _deepmerge = __webpack_require__(6661);
var _capitalize = _interopRequireDefault(__webpack_require__(2391));
var _getDisplayName = _interopRequireDefault(__webpack_require__(3526));
var _createTheme = _interopRequireDefault(__webpack_require__(7716));
var _styleFunctionSx = _interopRequireDefault(__webpack_require__(4200));
const _excluded = ["ownerState"],
  _excluded2 = ["variants"],
  _excluded3 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
/* eslint-disable no-underscore-dangle */
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function isEmpty(obj) {
  return Object.keys(obj).length === 0;
}

// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40
function isStringTag(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;
}

// Update /system/styled/#api in case if this changes
function shouldForwardProp(prop) {
  return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
}
const systemDefaultTheme = __webpack_unused_export__ = (0, _createTheme.default)();
const lowercaseFirstLetter = string => {
  if (!string) {
    return string;
  }
  return string.charAt(0).toLowerCase() + string.slice(1);
};
function resolveTheme({
  defaultTheme,
  theme,
  themeId
}) {
  return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;
}
function defaultOverridesResolver(slot) {
  if (!slot) {
    return null;
  }
  return (props, styles) => styles[slot];
}
function processStyleArg(callableStyle, _ref) {
  let {
      ownerState
    } = _ref,
    props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
  const resolvedStylesArg = typeof callableStyle === 'function' ? callableStyle((0, _extends2.default)({
    ownerState
  }, props)) : callableStyle;
  if (Array.isArray(resolvedStylesArg)) {
    return resolvedStylesArg.flatMap(resolvedStyle => processStyleArg(resolvedStyle, (0, _extends2.default)({
      ownerState
    }, props)));
  }
  if (!!resolvedStylesArg && typeof resolvedStylesArg === 'object' && Array.isArray(resolvedStylesArg.variants)) {
    const {
        variants = []
      } = resolvedStylesArg,
      otherStyles = (0, _objectWithoutPropertiesLoose2.default)(resolvedStylesArg, _excluded2);
    let result = otherStyles;
    variants.forEach(variant => {
      let isMatch = true;
      if (typeof variant.props === 'function') {
        isMatch = variant.props((0, _extends2.default)({
          ownerState
        }, props, ownerState));
      } else {
        Object.keys(variant.props).forEach(key => {
          if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {
            isMatch = false;
          }
        });
      }
      if (isMatch) {
        if (!Array.isArray(result)) {
          result = [result];
        }
        result.push(typeof variant.style === 'function' ? variant.style((0, _extends2.default)({
          ownerState
        }, props, ownerState)) : variant.style);
      }
    });
    return result;
  }
  return resolvedStylesArg;
}
function createStyled(input = {}) {
  const {
    themeId,
    defaultTheme = systemDefaultTheme,
    rootShouldForwardProp = shouldForwardProp,
    slotShouldForwardProp = shouldForwardProp
  } = input;
  const systemSx = props => {
    return (0, _styleFunctionSx.default)((0, _extends2.default)({}, props, {
      theme: resolveTheme((0, _extends2.default)({}, props, {
        defaultTheme,
        themeId
      }))
    }));
  };
  systemSx.__mui_systemSx = true;
  return (tag, inputOptions = {}) => {
    // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.
    (0, _styledEngine.internal_processStyles)(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));
    const {
        name: componentName,
        slot: componentSlot,
        skipVariantsResolver: inputSkipVariantsResolver,
        skipSx: inputSkipSx,
        // TODO v6: remove `lowercaseFirstLetter()` in the next major release
        // For more details: https://github.com/mui/material-ui/pull/37908
        overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
      } = inputOptions,
      options = (0, _objectWithoutPropertiesLoose2.default)(inputOptions, _excluded3);

    // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
    const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
    // TODO v6: remove `Root` in the next major release
    // For more details: https://github.com/mui/material-ui/pull/37908
    componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
    const skipSx = inputSkipSx || false;
    let label;
    if (false) {}
    let shouldForwardPropOption = shouldForwardProp;

    // TODO v6: remove `Root` in the next major release
    // For more details: https://github.com/mui/material-ui/pull/37908
    if (componentSlot === 'Root' || componentSlot === 'root') {
      shouldForwardPropOption = rootShouldForwardProp;
    } else if (componentSlot) {
      // any other slot specified
      shouldForwardPropOption = slotShouldForwardProp;
    } else if (isStringTag(tag)) {
      // for string (html) tag, preserve the behavior in emotion & styled-components.
      shouldForwardPropOption = undefined;
    }
    const defaultStyledResolver = (0, _styledEngine.default)(tag, (0, _extends2.default)({
      shouldForwardProp: shouldForwardPropOption,
      label
    }, options));
    const transformStyleArg = stylesArg => {
      // On the server Emotion doesn't use React.forwardRef for creating components, so the created
      // component stays as a function. This condition makes sure that we do not interpolate functions
      // which are basically components used as a selectors.
      if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg || (0, _deepmerge.isPlainObject)(stylesArg)) {
        return props => processStyleArg(stylesArg, (0, _extends2.default)({}, props, {
          theme: resolveTheme({
            theme: props.theme,
            defaultTheme,
            themeId
          })
        }));
      }
      return stylesArg;
    };
    const muiStyledResolver = (styleArg, ...expressions) => {
      let transformedStyleArg = transformStyleArg(styleArg);
      const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];
      if (componentName && overridesResolver) {
        expressionsWithDefaultTheme.push(props => {
          const theme = resolveTheme((0, _extends2.default)({}, props, {
            defaultTheme,
            themeId
          }));
          if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {
            return null;
          }
          const styleOverrides = theme.components[componentName].styleOverrides;
          const resolvedStyleOverrides = {};
          // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly
          Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
            resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, (0, _extends2.default)({}, props, {
              theme
            }));
          });
          return overridesResolver(props, resolvedStyleOverrides);
        });
      }
      if (componentName && !skipVariantsResolver) {
        expressionsWithDefaultTheme.push(props => {
          var _theme$components;
          const theme = resolveTheme((0, _extends2.default)({}, props, {
            defaultTheme,
            themeId
          }));
          const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;
          return processStyleArg({
            variants: themeVariants
          }, (0, _extends2.default)({}, props, {
            theme
          }));
        });
      }
      if (!skipSx) {
        expressionsWithDefaultTheme.push(systemSx);
      }
      const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
      if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
        const placeholders = new Array(numOfCustomFnsApplied).fill('');
        // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.
        transformedStyleArg = [...styleArg, ...placeholders];
        transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
      }
      const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
      if (false) {}
      if (tag.muiName) {
        Component.muiName = tag.muiName;
      }
      return Component;
    };
    if (defaultStyledResolver.withConfig) {
      muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
    }
    return muiStyledResolver;
  };
}

/***/ }),

/***/ 8138:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   EU: function() { return /* binding */ createEmptyBreakpointObject; },
/* harmony export */   NI: function() { return /* binding */ handleBreakpoints; },
/* harmony export */   iZ: function() { return /* binding */ mergeBreakpointsInOrder; },
/* harmony export */   kW: function() { return /* binding */ resolveBreakpointValues; },
/* harmony export */   vf: function() { return /* binding */ removeUnusedBreakpoints; },
/* harmony export */   zu: function() { return /* binding */ values; }
/* harmony export */ });
/* unused harmony export computeBreakpointsBase */
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5556);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mui_utils_deepmerge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3479);





// The breakpoint **start** at this value.
// For instance with the first breakpoint xs: [xs, sm[.
const values = {
  xs: 0,
  // phone
  sm: 600,
  // tablet
  md: 900,
  // small laptop
  lg: 1200,
  // desktop
  xl: 1536 // large screen
};
const defaultBreakpoints = {
  // Sorted ASC by size. That's important.
  // It can't be configured as it's used statically for propTypes.
  keys: ['xs', 'sm', 'md', 'lg', 'xl'],
  up: key => `@media (min-width:${values[key]}px)`
};
function handleBreakpoints(props, propValue, styleFromPropValue) {
  const theme = props.theme || {};
  if (Array.isArray(propValue)) {
    const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
    return propValue.reduce((acc, item, index) => {
      acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
      return acc;
    }, {});
  }
  if (typeof propValue === 'object') {
    const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
    return Object.keys(propValue).reduce((acc, breakpoint) => {
      // key is breakpoint
      if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {
        const mediaKey = themeBreakpoints.up(breakpoint);
        acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
      } else {
        const cssKey = breakpoint;
        acc[cssKey] = propValue[cssKey];
      }
      return acc;
    }, {});
  }
  const output = styleFromPropValue(propValue);
  return output;
}
function breakpoints(styleFunction) {
  // false positive
  // eslint-disable-next-line react/function-component-definition
  const newStyleFunction = props => {
    const theme = props.theme || {};
    const base = styleFunction(props);
    const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
    const extended = themeBreakpoints.keys.reduce((acc, key) => {
      if (props[key]) {
        acc = acc || {};
        acc[themeBreakpoints.up(key)] = styleFunction(_extends({
          theme
        }, props[key]));
      }
      return acc;
    }, null);
    return merge(base, extended);
  };
  newStyleFunction.propTypes =  false ? 0 : {};
  newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];
  return newStyleFunction;
}
function createEmptyBreakpointObject(breakpointsInput = {}) {
  var _breakpointsInput$key;
  const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
    const breakpointStyleKey = breakpointsInput.up(key);
    acc[breakpointStyleKey] = {};
    return acc;
  }, {});
  return breakpointsInOrder || {};
}
function removeUnusedBreakpoints(breakpointKeys, style) {
  return breakpointKeys.reduce((acc, key) => {
    const breakpointOutput = acc[key];
    const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
    if (isBreakpointUnused) {
      delete acc[key];
    }
    return acc;
  }, style);
}
function mergeBreakpointsInOrder(breakpointsInput, ...styles) {
  const emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput);
  const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => (0,_mui_utils_deepmerge__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(prev, next), {});
  return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput);
}

// compute base for responsive values; e.g.,
// [1,2,3] => {xs: true, sm: true, md: true}
// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true}
function computeBreakpointsBase(breakpointValues, themeBreakpoints) {
  // fixed value
  if (typeof breakpointValues !== 'object') {
    return {};
  }
  const base = {};
  const breakpointsKeys = Object.keys(themeBreakpoints);
  if (Array.isArray(breakpointValues)) {
    breakpointsKeys.forEach((breakpoint, i) => {
      if (i < breakpointValues.length) {
        base[breakpoint] = true;
      }
    });
  } else {
    breakpointsKeys.forEach(breakpoint => {
      if (breakpointValues[breakpoint] != null) {
        base[breakpoint] = true;
      }
    });
  }
  return base;
}
function resolveBreakpointValues({
  values: breakpointValues,
  breakpoints: themeBreakpoints,
  base: customBase
}) {
  const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);
  const keys = Object.keys(base);
  if (keys.length === 0) {
    return breakpointValues;
  }
  let previous;
  return keys.reduce((acc, breakpoint, i) => {
    if (Array.isArray(breakpointValues)) {
      acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];
      previous = i;
    } else if (typeof breakpointValues === 'object') {
      acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];
      previous = breakpoint;
    } else {
      acc[breakpoint] = breakpointValues;
    }
    return acc;
  }, {});
}
/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (breakpoints)));

/***/ }),

/***/ 8418:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ applyStyles; }
/* harmony export */ });
/**
 * A universal utility to style components with multiple color modes. Always use it from the theme object.
 * It works with:
 *  - [Basic theme](https://mui.com/material-ui/customization/dark-mode/)
 *  - [CSS theme variables](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/)
 *  - Zero-runtime engine
 *
 * Tips: Use an array over object spread and place `theme.applyStyles()` last.
 *
 * ✅ [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })]
 *
 * 🚫 { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })}
 *
 * @example
 * 1. using with `styled`:
 * ```jsx
 *   const Component = styled('div')(({ theme }) => [
 *     { background: '#e5e5e5' },
 *     theme.applyStyles('dark', {
 *       background: '#1c1c1c',
 *       color: '#fff',
 *     }),
 *   ]);
 * ```
 *
 * @example
 * 2. using with `sx` prop:
 * ```jsx
 *   <Box sx={theme => [
 *     { background: '#e5e5e5' },
 *     theme.applyStyles('dark', {
 *        background: '#1c1c1c',
 *        color: '#fff',
 *      }),
 *     ]}
 *   />
 * ```
 *
 * @example
 * 3. theming a component:
 * ```jsx
 *   extendTheme({
 *     components: {
 *       MuiButton: {
 *         styleOverrides: {
 *           root: ({ theme }) => [
 *             { background: '#e5e5e5' },
 *             theme.applyStyles('dark', {
 *               background: '#1c1c1c',
 *               color: '#fff',
 *             }),
 *           ],
 *         },
 *       }
 *     }
 *   })
 *```
 */
function applyStyles(key, styles) {
  // @ts-expect-error this is 'any' type
  const theme = this;
  if (theme.vars && typeof theme.getColorSchemeSelector === 'function') {
    // If CssVarsProvider is used as a provider,
    // returns '* :where([data-mui-color-scheme="light|dark"]) &'
    const selector = theme.getColorSchemeSelector(key).replace(/(\[[^\]]+\])/, '*:where($1)');
    return {
      [selector]: styles
    };
  }
  if (theme.palette.mode === key) {
    return styles;
  }
  return {};
}

/***/ }),

/***/ 4784:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ createBreakpoints; }
/* harmony export */ });
/* unused harmony export breakpointKeys */
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8587);
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8168);


const _excluded = ["values", "unit", "step"];
// Sorted ASC by size. That's important.
// It can't be configured as it's used statically for propTypes.
const breakpointKeys = (/* unused pure expression or super */ null && (['xs', 'sm', 'md', 'lg', 'xl']));
const sortBreakpointsValues = values => {
  const breakpointsAsArray = Object.keys(values).map(key => ({
    key,
    val: values[key]
  })) || [];
  // Sort in ascending order
  breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
  return breakpointsAsArray.reduce((acc, obj) => {
    return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)({}, acc, {
      [obj.key]: obj.val
    });
  }, {});
};

// Keep in mind that @media is inclusive by the CSS specification.
function createBreakpoints(breakpoints) {
  const {
      // The breakpoint **start** at this value.
      // For instance with the first breakpoint xs: [xs, sm).
      values = {
        xs: 0,
        // phone
        sm: 600,
        // tablet
        md: 900,
        // small laptop
        lg: 1200,
        // desktop
        xl: 1536 // large screen
      },
      unit = 'px',
      step = 5
    } = breakpoints,
    other = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(breakpoints, _excluded);
  const sortedValues = sortBreakpointsValues(values);
  const keys = Object.keys(sortedValues);
  function up(key) {
    const value = typeof values[key] === 'number' ? values[key] : key;
    return `@media (min-width:${value}${unit})`;
  }
  function down(key) {
    const value = typeof values[key] === 'number' ? values[key] : key;
    return `@media (max-width:${value - step / 100}${unit})`;
  }
  function between(start, end) {
    const endIndex = keys.indexOf(end);
    return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;
  }
  function only(key) {
    if (keys.indexOf(key) + 1 < keys.length) {
      return between(key, keys[keys.indexOf(key) + 1]);
    }
    return up(key);
  }
  function not(key) {
    // handle first and last key separately, for better readability
    const keyIndex = keys.indexOf(key);
    if (keyIndex === 0) {
      return up(keys[1]);
    }
    if (keyIndex === keys.length - 1) {
      return down(keys[keyIndex]);
    }
    return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
  }
  return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)({
    keys,
    values: sortedValues,
    up,
    down,
    between,
    only,
    not,
    unit
  }, other);
}

/***/ }),

/***/ 9731:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: function() { return /* binding */ createTheme_createTheme; }
});

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(8168);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
var objectWithoutPropertiesLoose = __webpack_require__(8587);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/deepmerge/deepmerge.js
var deepmerge = __webpack_require__(3479);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/createTheme/createBreakpoints.js
var createBreakpoints = __webpack_require__(4784);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/createTheme/shape.js
const shape = {
  borderRadius: 4
};
/* harmony default export */ var createTheme_shape = (shape);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/spacing.js + 1 modules
var esm_spacing = __webpack_require__(2610);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/createTheme/createSpacing.js


// The different signatures imply different meaning for their arguments that can't be expressed structurally.
// We express the difference with variable names.

function createSpacing(spacingInput = 8) {
  // Already transformed.
  if (spacingInput.mui) {
    return spacingInput;
  }

  // Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.
  // Smaller components, such as icons, can align to a 4dp grid.
  // https://m2.material.io/design/layout/understanding-layout.html
  const transform = (0,esm_spacing/* createUnarySpacing */.LX)({
    spacing: spacingInput
  });
  const spacing = (...argsInput) => {
    if (false) {}
    const args = argsInput.length === 0 ? [1] : argsInput;
    return args.map(argument => {
      const output = transform(argument);
      return typeof output === 'number' ? `${output}px` : output;
    }).join(' ');
  };
  spacing.mui = true;
  return spacing;
}
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js
var styleFunctionSx = __webpack_require__(2733);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js + 5 modules
var defaultSxConfig = __webpack_require__(9058);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/createTheme/applyStyles.js
var applyStyles = __webpack_require__(8418);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/createTheme/createTheme.js


const _excluded = ["breakpoints", "palette", "spacing", "shape"];







function createTheme(options = {}, ...args) {
  const {
      breakpoints: breakpointsInput = {},
      palette: paletteInput = {},
      spacing: spacingInput,
      shape: shapeInput = {}
    } = options,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(options, _excluded);
  const breakpoints = (0,createBreakpoints/* default */.A)(breakpointsInput);
  const spacing = createSpacing(spacingInput);
  let muiTheme = (0,deepmerge/* default */.A)({
    breakpoints,
    direction: 'ltr',
    components: {},
    // Inject component definitions.
    palette: (0,esm_extends/* default */.A)({
      mode: 'light'
    }, paletteInput),
    spacing,
    shape: (0,esm_extends/* default */.A)({}, createTheme_shape, shapeInput)
  }, other);
  muiTheme.applyStyles = applyStyles/* default */.A;
  muiTheme = args.reduce((acc, argument) => (0,deepmerge/* default */.A)(acc, argument), muiTheme);
  muiTheme.unstable_sxConfig = (0,esm_extends/* default */.A)({}, defaultSxConfig/* default */.A, other == null ? void 0 : other.unstable_sxConfig);
  muiTheme.unstable_sx = function sx(props) {
    return (0,styleFunctionSx/* default */.A)({
      sx: props,
      theme: this
    });
  };
  return muiTheme;
}
/* harmony default export */ var createTheme_createTheme = (createTheme);

/***/ }),

/***/ 7716:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* reexport safe */ _createTheme__WEBPACK_IMPORTED_MODULE_0__.A; },
/* harmony export */   private_createBreakpoints: function() { return /* reexport safe */ _createBreakpoints__WEBPACK_IMPORTED_MODULE_1__.A; },
/* harmony export */   unstable_applyStyles: function() { return /* reexport safe */ _applyStyles__WEBPACK_IMPORTED_MODULE_2__.A; }
/* harmony export */ });
/* harmony import */ var _createTheme__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9731);
/* harmony import */ var _createBreakpoints__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4784);
/* harmony import */ var _applyStyles__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8418);




/***/ }),

/***/ 1898:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _mui_utils_deepmerge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3479);

function merge(acc, item) {
  if (!item) {
    return acc;
  }
  return (0,_mui_utils_deepmerge__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(acc, item, {
    clone: false // No need to clone deep, it's way faster.
  });
}
/* harmony default export */ __webpack_exports__.A = (merge);

/***/ }),

/***/ 2610:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  LX: function() { return /* binding */ createUnarySpacing; },
  MA: function() { return /* binding */ createUnaryUnit; },
  _W: function() { return /* binding */ getValue; },
  Lc: function() { return /* binding */ margin; },
  Ms: function() { return /* binding */ padding; }
});

// UNUSED EXPORTS: default, getStyleFromPropValue, marginKeys, paddingKeys

// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/breakpoints.js
var breakpoints = __webpack_require__(8138);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/style.js
var style = __webpack_require__(8835);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/merge.js
var merge = __webpack_require__(1898);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/memoize.js
function memoize(fn) {
  const cache = {};
  return arg => {
    if (cache[arg] === undefined) {
      cache[arg] = fn(arg);
    }
    return cache[arg];
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/spacing.js





const properties = {
  m: 'margin',
  p: 'padding'
};
const directions = {
  t: 'Top',
  r: 'Right',
  b: 'Bottom',
  l: 'Left',
  x: ['Left', 'Right'],
  y: ['Top', 'Bottom']
};
const aliases = {
  marginX: 'mx',
  marginY: 'my',
  paddingX: 'px',
  paddingY: 'py'
};

// memoize() impact:
// From 300,000 ops/sec
// To 350,000 ops/sec
const getCssProperties = memoize(prop => {
  // It's not a shorthand notation.
  if (prop.length > 2) {
    if (aliases[prop]) {
      prop = aliases[prop];
    } else {
      return [prop];
    }
  }
  const [a, b] = prop.split('');
  const property = properties[a];
  const direction = directions[b] || '';
  return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];
});
const marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];
const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];
const spacingKeys = [...marginKeys, ...paddingKeys];
function createUnaryUnit(theme, themeKey, defaultValue, propName) {
  var _getPath;
  const themeSpacing = (_getPath = (0,style/* getPath */.Yn)(theme, themeKey, false)) != null ? _getPath : defaultValue;
  if (typeof themeSpacing === 'number') {
    return abs => {
      if (typeof abs === 'string') {
        return abs;
      }
      if (false) {}
      return themeSpacing * abs;
    };
  }
  if (Array.isArray(themeSpacing)) {
    return abs => {
      if (typeof abs === 'string') {
        return abs;
      }
      if (false) {}
      return themeSpacing[abs];
    };
  }
  if (typeof themeSpacing === 'function') {
    return themeSpacing;
  }
  if (false) {}
  return () => undefined;
}
function createUnarySpacing(theme) {
  return createUnaryUnit(theme, 'spacing', 8, 'spacing');
}
function getValue(transformer, propValue) {
  if (typeof propValue === 'string' || propValue == null) {
    return propValue;
  }
  const abs = Math.abs(propValue);
  const transformed = transformer(abs);
  if (propValue >= 0) {
    return transformed;
  }
  if (typeof transformed === 'number') {
    return -transformed;
  }
  return `-${transformed}`;
}
function getStyleFromPropValue(cssProperties, transformer) {
  return propValue => cssProperties.reduce((acc, cssProperty) => {
    acc[cssProperty] = getValue(transformer, propValue);
    return acc;
  }, {});
}
function resolveCssProperty(props, keys, prop, transformer) {
  // Using a hash computation over an array iteration could be faster, but with only 28 items,
  // it's doesn't worth the bundle size.
  if (keys.indexOf(prop) === -1) {
    return null;
  }
  const cssProperties = getCssProperties(prop);
  const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
  const propValue = props[prop];
  return (0,breakpoints/* handleBreakpoints */.NI)(props, propValue, styleFromPropValue);
}
function spacing_style(props, keys) {
  const transformer = createUnarySpacing(props.theme);
  return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge/* default */.A, {});
}
function margin(props) {
  return spacing_style(props, marginKeys);
}
margin.propTypes =  false ? 0 : {};
margin.filterProps = marginKeys;
function padding(props) {
  return spacing_style(props, paddingKeys);
}
padding.propTypes =  false ? 0 : {};
padding.filterProps = paddingKeys;
function spacing(props) {
  return spacing_style(props, spacingKeys);
}
spacing.propTypes =  false ? 0 : {};
spacing.filterProps = spacingKeys;
/* harmony default export */ var esm_spacing = ((/* unused pure expression or super */ null && (spacing)));

/***/ }),

/***/ 8835:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BO: function() { return /* binding */ getStyleValue; },
/* harmony export */   Yn: function() { return /* binding */ getPath; }
/* harmony export */ });
/* harmony import */ var _mui_utils_capitalize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(985);
/* harmony import */ var _breakpoints__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8138);



function getPath(obj, path, checkVars = true) {
  if (!path || typeof path !== 'string') {
    return null;
  }

  // Check if CSS variables are used
  if (obj && obj.vars && checkVars) {
    const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
    if (val != null) {
      return val;
    }
  }
  return path.split('.').reduce((acc, item) => {
    if (acc && acc[item] != null) {
      return acc[item];
    }
    return null;
  }, obj);
}
function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {
  let value;
  if (typeof themeMapping === 'function') {
    value = themeMapping(propValueFinal);
  } else if (Array.isArray(themeMapping)) {
    value = themeMapping[propValueFinal] || userValue;
  } else {
    value = getPath(themeMapping, propValueFinal) || userValue;
  }
  if (transform) {
    value = transform(value, userValue, themeMapping);
  }
  return value;
}
function style(options) {
  const {
    prop,
    cssProperty = options.prop,
    themeKey,
    transform
  } = options;

  // false positive
  // eslint-disable-next-line react/function-component-definition
  const fn = props => {
    if (props[prop] == null) {
      return null;
    }
    const propValue = props[prop];
    const theme = props.theme;
    const themeMapping = getPath(theme, themeKey) || {};
    const styleFromPropValue = propValueFinal => {
      let value = getStyleValue(themeMapping, transform, propValueFinal);
      if (propValueFinal === value && typeof propValueFinal === 'string') {
        // Haven't found value
        value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : (0,_mui_utils_capitalize__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(propValueFinal)}`, propValueFinal);
      }
      if (cssProperty === false) {
        return value;
      }
      return {
        [cssProperty]: value
      };
    };
    return (0,_breakpoints__WEBPACK_IMPORTED_MODULE_1__/* .handleBreakpoints */ .NI)(props, propValue, styleFromPropValue);
  };
  fn.propTypes =  false ? 0 : {};
  fn.filterProps = [prop];
  return fn;
}
/* harmony default export */ __webpack_exports__.Ay = (style);

/***/ }),

/***/ 9058:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: function() { return /* binding */ styleFunctionSx_defaultSxConfig; }
});

// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/spacing.js + 1 modules
var spacing = __webpack_require__(2610);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/style.js
var style = __webpack_require__(8835);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/merge.js
var merge = __webpack_require__(1898);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/compose.js

function compose(...styles) {
  const handlers = styles.reduce((acc, style) => {
    style.filterProps.forEach(prop => {
      acc[prop] = style;
    });
    return acc;
  }, {});

  // false positive
  // eslint-disable-next-line react/function-component-definition
  const fn = props => {
    return Object.keys(props).reduce((acc, prop) => {
      if (handlers[prop]) {
        return (0,merge/* default */.A)(acc, handlers[prop](props));
      }
      return acc;
    }, {});
  };
  fn.propTypes =  false ? 0 : {};
  fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);
  return fn;
}
/* harmony default export */ var esm_compose = (compose);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/breakpoints.js
var breakpoints = __webpack_require__(8138);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/borders.js





function borderTransform(value) {
  if (typeof value !== 'number') {
    return value;
  }
  return `${value}px solid`;
}
function createBorderStyle(prop, transform) {
  return (0,style/* default */.Ay)({
    prop,
    themeKey: 'borders',
    transform
  });
}
const border = createBorderStyle('border', borderTransform);
const borderTop = createBorderStyle('borderTop', borderTransform);
const borderRight = createBorderStyle('borderRight', borderTransform);
const borderBottom = createBorderStyle('borderBottom', borderTransform);
const borderLeft = createBorderStyle('borderLeft', borderTransform);
const borderColor = createBorderStyle('borderColor');
const borderTopColor = createBorderStyle('borderTopColor');
const borderRightColor = createBorderStyle('borderRightColor');
const borderBottomColor = createBorderStyle('borderBottomColor');
const borderLeftColor = createBorderStyle('borderLeftColor');
const outline = createBorderStyle('outline', borderTransform);
const outlineColor = createBorderStyle('outlineColor');

// false positive
// eslint-disable-next-line react/function-component-definition
const borderRadius = props => {
  if (props.borderRadius !== undefined && props.borderRadius !== null) {
    const transformer = (0,spacing/* createUnaryUnit */.MA)(props.theme, 'shape.borderRadius', 4, 'borderRadius');
    const styleFromPropValue = propValue => ({
      borderRadius: (0,spacing/* getValue */._W)(transformer, propValue)
    });
    return (0,breakpoints/* handleBreakpoints */.NI)(props, props.borderRadius, styleFromPropValue);
  }
  return null;
};
borderRadius.propTypes =  false ? 0 : {};
borderRadius.filterProps = ['borderRadius'];
const borders = esm_compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius, outline, outlineColor);
/* harmony default export */ var esm_borders = ((/* unused pure expression or super */ null && (borders)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/cssGrid.js






// false positive
// eslint-disable-next-line react/function-component-definition
const gap = props => {
  if (props.gap !== undefined && props.gap !== null) {
    const transformer = (0,spacing/* createUnaryUnit */.MA)(props.theme, 'spacing', 8, 'gap');
    const styleFromPropValue = propValue => ({
      gap: (0,spacing/* getValue */._W)(transformer, propValue)
    });
    return (0,breakpoints/* handleBreakpoints */.NI)(props, props.gap, styleFromPropValue);
  }
  return null;
};
gap.propTypes =  false ? 0 : {};
gap.filterProps = ['gap'];

// false positive
// eslint-disable-next-line react/function-component-definition
const columnGap = props => {
  if (props.columnGap !== undefined && props.columnGap !== null) {
    const transformer = (0,spacing/* createUnaryUnit */.MA)(props.theme, 'spacing', 8, 'columnGap');
    const styleFromPropValue = propValue => ({
      columnGap: (0,spacing/* getValue */._W)(transformer, propValue)
    });
    return (0,breakpoints/* handleBreakpoints */.NI)(props, props.columnGap, styleFromPropValue);
  }
  return null;
};
columnGap.propTypes =  false ? 0 : {};
columnGap.filterProps = ['columnGap'];

// false positive
// eslint-disable-next-line react/function-component-definition
const rowGap = props => {
  if (props.rowGap !== undefined && props.rowGap !== null) {
    const transformer = (0,spacing/* createUnaryUnit */.MA)(props.theme, 'spacing', 8, 'rowGap');
    const styleFromPropValue = propValue => ({
      rowGap: (0,spacing/* getValue */._W)(transformer, propValue)
    });
    return (0,breakpoints/* handleBreakpoints */.NI)(props, props.rowGap, styleFromPropValue);
  }
  return null;
};
rowGap.propTypes =  false ? 0 : {};
rowGap.filterProps = ['rowGap'];
const gridColumn = (0,style/* default */.Ay)({
  prop: 'gridColumn'
});
const gridRow = (0,style/* default */.Ay)({
  prop: 'gridRow'
});
const gridAutoFlow = (0,style/* default */.Ay)({
  prop: 'gridAutoFlow'
});
const gridAutoColumns = (0,style/* default */.Ay)({
  prop: 'gridAutoColumns'
});
const gridAutoRows = (0,style/* default */.Ay)({
  prop: 'gridAutoRows'
});
const gridTemplateColumns = (0,style/* default */.Ay)({
  prop: 'gridTemplateColumns'
});
const gridTemplateRows = (0,style/* default */.Ay)({
  prop: 'gridTemplateRows'
});
const gridTemplateAreas = (0,style/* default */.Ay)({
  prop: 'gridTemplateAreas'
});
const gridArea = (0,style/* default */.Ay)({
  prop: 'gridArea'
});
const grid = esm_compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
/* harmony default export */ var cssGrid = ((/* unused pure expression or super */ null && (grid)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/palette.js


function paletteTransform(value, userValue) {
  if (userValue === 'grey') {
    return userValue;
  }
  return value;
}
const color = (0,style/* default */.Ay)({
  prop: 'color',
  themeKey: 'palette',
  transform: paletteTransform
});
const bgcolor = (0,style/* default */.Ay)({
  prop: 'bgcolor',
  cssProperty: 'backgroundColor',
  themeKey: 'palette',
  transform: paletteTransform
});
const backgroundColor = (0,style/* default */.Ay)({
  prop: 'backgroundColor',
  themeKey: 'palette',
  transform: paletteTransform
});
const palette = esm_compose(color, bgcolor, backgroundColor);
/* harmony default export */ var esm_palette = ((/* unused pure expression or super */ null && (palette)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/sizing.js



function sizingTransform(value) {
  return value <= 1 && value !== 0 ? `${value * 100}%` : value;
}
const width = (0,style/* default */.Ay)({
  prop: 'width',
  transform: sizingTransform
});
const maxWidth = props => {
  if (props.maxWidth !== undefined && props.maxWidth !== null) {
    const styleFromPropValue = propValue => {
      var _props$theme, _props$theme2;
      const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || breakpoints/* values */.zu[propValue];
      if (!breakpoint) {
        return {
          maxWidth: sizingTransform(propValue)
        };
      }
      if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {
        return {
          maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
        };
      }
      return {
        maxWidth: breakpoint
      };
    };
    return (0,breakpoints/* handleBreakpoints */.NI)(props, props.maxWidth, styleFromPropValue);
  }
  return null;
};
maxWidth.filterProps = ['maxWidth'];
const minWidth = (0,style/* default */.Ay)({
  prop: 'minWidth',
  transform: sizingTransform
});
const height = (0,style/* default */.Ay)({
  prop: 'height',
  transform: sizingTransform
});
const maxHeight = (0,style/* default */.Ay)({
  prop: 'maxHeight',
  transform: sizingTransform
});
const minHeight = (0,style/* default */.Ay)({
  prop: 'minHeight',
  transform: sizingTransform
});
const sizeWidth = (0,style/* default */.Ay)({
  prop: 'size',
  cssProperty: 'width',
  transform: sizingTransform
});
const sizeHeight = (0,style/* default */.Ay)({
  prop: 'size',
  cssProperty: 'height',
  transform: sizingTransform
});
const boxSizing = (0,style/* default */.Ay)({
  prop: 'boxSizing'
});
const sizing = esm_compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
/* harmony default export */ var esm_sizing = ((/* unused pure expression or super */ null && (sizing)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js





const defaultSxConfig = {
  // borders
  border: {
    themeKey: 'borders',
    transform: borderTransform
  },
  borderTop: {
    themeKey: 'borders',
    transform: borderTransform
  },
  borderRight: {
    themeKey: 'borders',
    transform: borderTransform
  },
  borderBottom: {
    themeKey: 'borders',
    transform: borderTransform
  },
  borderLeft: {
    themeKey: 'borders',
    transform: borderTransform
  },
  borderColor: {
    themeKey: 'palette'
  },
  borderTopColor: {
    themeKey: 'palette'
  },
  borderRightColor: {
    themeKey: 'palette'
  },
  borderBottomColor: {
    themeKey: 'palette'
  },
  borderLeftColor: {
    themeKey: 'palette'
  },
  outline: {
    themeKey: 'borders',
    transform: borderTransform
  },
  outlineColor: {
    themeKey: 'palette'
  },
  borderRadius: {
    themeKey: 'shape.borderRadius',
    style: borderRadius
  },
  // palette
  color: {
    themeKey: 'palette',
    transform: paletteTransform
  },
  bgcolor: {
    themeKey: 'palette',
    cssProperty: 'backgroundColor',
    transform: paletteTransform
  },
  backgroundColor: {
    themeKey: 'palette',
    transform: paletteTransform
  },
  // spacing
  p: {
    style: spacing/* padding */.Ms
  },
  pt: {
    style: spacing/* padding */.Ms
  },
  pr: {
    style: spacing/* padding */.Ms
  },
  pb: {
    style: spacing/* padding */.Ms
  },
  pl: {
    style: spacing/* padding */.Ms
  },
  px: {
    style: spacing/* padding */.Ms
  },
  py: {
    style: spacing/* padding */.Ms
  },
  padding: {
    style: spacing/* padding */.Ms
  },
  paddingTop: {
    style: spacing/* padding */.Ms
  },
  paddingRight: {
    style: spacing/* padding */.Ms
  },
  paddingBottom: {
    style: spacing/* padding */.Ms
  },
  paddingLeft: {
    style: spacing/* padding */.Ms
  },
  paddingX: {
    style: spacing/* padding */.Ms
  },
  paddingY: {
    style: spacing/* padding */.Ms
  },
  paddingInline: {
    style: spacing/* padding */.Ms
  },
  paddingInlineStart: {
    style: spacing/* padding */.Ms
  },
  paddingInlineEnd: {
    style: spacing/* padding */.Ms
  },
  paddingBlock: {
    style: spacing/* padding */.Ms
  },
  paddingBlockStart: {
    style: spacing/* padding */.Ms
  },
  paddingBlockEnd: {
    style: spacing/* padding */.Ms
  },
  m: {
    style: spacing/* margin */.Lc
  },
  mt: {
    style: spacing/* margin */.Lc
  },
  mr: {
    style: spacing/* margin */.Lc
  },
  mb: {
    style: spacing/* margin */.Lc
  },
  ml: {
    style: spacing/* margin */.Lc
  },
  mx: {
    style: spacing/* margin */.Lc
  },
  my: {
    style: spacing/* margin */.Lc
  },
  margin: {
    style: spacing/* margin */.Lc
  },
  marginTop: {
    style: spacing/* margin */.Lc
  },
  marginRight: {
    style: spacing/* margin */.Lc
  },
  marginBottom: {
    style: spacing/* margin */.Lc
  },
  marginLeft: {
    style: spacing/* margin */.Lc
  },
  marginX: {
    style: spacing/* margin */.Lc
  },
  marginY: {
    style: spacing/* margin */.Lc
  },
  marginInline: {
    style: spacing/* margin */.Lc
  },
  marginInlineStart: {
    style: spacing/* margin */.Lc
  },
  marginInlineEnd: {
    style: spacing/* margin */.Lc
  },
  marginBlock: {
    style: spacing/* margin */.Lc
  },
  marginBlockStart: {
    style: spacing/* margin */.Lc
  },
  marginBlockEnd: {
    style: spacing/* margin */.Lc
  },
  // display
  displayPrint: {
    cssProperty: false,
    transform: value => ({
      '@media print': {
        display: value
      }
    })
  },
  display: {},
  overflow: {},
  textOverflow: {},
  visibility: {},
  whiteSpace: {},
  // flexbox
  flexBasis: {},
  flexDirection: {},
  flexWrap: {},
  justifyContent: {},
  alignItems: {},
  alignContent: {},
  order: {},
  flex: {},
  flexGrow: {},
  flexShrink: {},
  alignSelf: {},
  justifyItems: {},
  justifySelf: {},
  // grid
  gap: {
    style: gap
  },
  rowGap: {
    style: rowGap
  },
  columnGap: {
    style: columnGap
  },
  gridColumn: {},
  gridRow: {},
  gridAutoFlow: {},
  gridAutoColumns: {},
  gridAutoRows: {},
  gridTemplateColumns: {},
  gridTemplateRows: {},
  gridTemplateAreas: {},
  gridArea: {},
  // positions
  position: {},
  zIndex: {
    themeKey: 'zIndex'
  },
  top: {},
  right: {},
  bottom: {},
  left: {},
  // shadows
  boxShadow: {
    themeKey: 'shadows'
  },
  // sizing
  width: {
    transform: sizingTransform
  },
  maxWidth: {
    style: maxWidth
  },
  minWidth: {
    transform: sizingTransform
  },
  height: {
    transform: sizingTransform
  },
  maxHeight: {
    transform: sizingTransform
  },
  minHeight: {
    transform: sizingTransform
  },
  boxSizing: {},
  // typography
  fontFamily: {
    themeKey: 'typography'
  },
  fontSize: {
    themeKey: 'typography'
  },
  fontStyle: {
    themeKey: 'typography'
  },
  fontWeight: {
    themeKey: 'typography'
  },
  letterSpacing: {},
  textTransform: {},
  lineHeight: {},
  textAlign: {},
  typography: {
    cssProperty: false,
    themeKey: 'typography'
  }
};
/* harmony default export */ var styleFunctionSx_defaultSxConfig = (defaultSxConfig);

/***/ }),

/***/ 449:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ extendSxProp; }
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8168);
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8587);
/* harmony import */ var _mui_utils_deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3479);
/* harmony import */ var _defaultSxConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9058);


const _excluded = ["sx"];


const splitProps = props => {
  var _props$theme$unstable, _props$theme;
  const result = {
    systemProps: {},
    otherProps: {}
  };
  const config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : _defaultSxConfig__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A;
  Object.keys(props).forEach(prop => {
    if (config[prop]) {
      result.systemProps[prop] = props[prop];
    } else {
      result.otherProps[prop] = props[prop];
    }
  });
  return result;
};
function extendSxProp(props) {
  const {
      sx: inSx
    } = props,
    other = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(props, _excluded);
  const {
    systemProps,
    otherProps
  } = splitProps(other);
  let finalSx;
  if (Array.isArray(inSx)) {
    finalSx = [systemProps, ...inSx];
  } else if (typeof inSx === 'function') {
    finalSx = (...args) => {
      const result = inSx(...args);
      if (!(0,_mui_utils_deepmerge__WEBPACK_IMPORTED_MODULE_2__/* .isPlainObject */ .Q)(result)) {
        return systemProps;
      }
      return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)({}, systemProps, result);
    };
  } else {
    finalSx = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)({}, systemProps, inSx);
  }
  return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)({}, otherProps, {
    sx: finalSx
  });
}

/***/ }),

/***/ 4200:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* reexport safe */ _styleFunctionSx__WEBPACK_IMPORTED_MODULE_0__.A; },
/* harmony export */   extendSxProp: function() { return /* reexport safe */ _extendSxProp__WEBPACK_IMPORTED_MODULE_1__.A; },
/* harmony export */   unstable_createStyleFunctionSx: function() { return /* reexport safe */ _styleFunctionSx__WEBPACK_IMPORTED_MODULE_0__.k; },
/* harmony export */   unstable_defaultSxConfig: function() { return /* reexport safe */ _defaultSxConfig__WEBPACK_IMPORTED_MODULE_2__.A; }
/* harmony export */ });
/* harmony import */ var _styleFunctionSx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2733);
/* harmony import */ var _extendSxProp__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(449);
/* harmony import */ var _defaultSxConfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9058);





/***/ }),

/***/ 2733:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   k: function() { return /* binding */ unstable_createStyleFunctionSx; }
/* harmony export */ });
/* harmony import */ var _mui_utils_capitalize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(985);
/* harmony import */ var _merge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1898);
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8835);
/* harmony import */ var _breakpoints__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8138);
/* harmony import */ var _defaultSxConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9058);





function objectsHaveSameKeys(...objects) {
  const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);
  const union = new Set(allKeys);
  return objects.every(object => union.size === Object.keys(object).length);
}
function callIfFn(maybeFn, arg) {
  return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;
}

// eslint-disable-next-line @typescript-eslint/naming-convention
function unstable_createStyleFunctionSx() {
  function getThemeValue(prop, val, theme, config) {
    const props = {
      [prop]: val,
      theme
    };
    const options = config[prop];
    if (!options) {
      return {
        [prop]: val
      };
    }
    const {
      cssProperty = prop,
      themeKey,
      transform,
      style
    } = options;
    if (val == null) {
      return null;
    }

    // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123
    if (themeKey === 'typography' && val === 'inherit') {
      return {
        [prop]: val
      };
    }
    const themeMapping = (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .getPath */ .Yn)(theme, themeKey) || {};
    if (style) {
      return style(props);
    }
    const styleFromPropValue = propValueFinal => {
      let value = (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .getStyleValue */ .BO)(themeMapping, transform, propValueFinal);
      if (propValueFinal === value && typeof propValueFinal === 'string') {
        // Haven't found value
        value = (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .getStyleValue */ .BO)(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : (0,_mui_utils_capitalize__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(propValueFinal)}`, propValueFinal);
      }
      if (cssProperty === false) {
        return value;
      }
      return {
        [cssProperty]: value
      };
    };
    return (0,_breakpoints__WEBPACK_IMPORTED_MODULE_2__/* .handleBreakpoints */ .NI)(props, val, styleFromPropValue);
  }
  function styleFunctionSx(props) {
    var _theme$unstable_sxCon;
    const {
      sx,
      theme = {}
    } = props || {};
    if (!sx) {
      return null; // Emotion & styled-components will neglect null
    }
    const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : _defaultSxConfig__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A;

    /*
     * Receive `sxInput` as object or callback
     * and then recursively check keys & values to create media query object styles.
     * (the result will be used in `styled`)
     */
    function traverse(sxInput) {
      let sxObject = sxInput;
      if (typeof sxInput === 'function') {
        sxObject = sxInput(theme);
      } else if (typeof sxInput !== 'object') {
        // value
        return sxInput;
      }
      if (!sxObject) {
        return null;
      }
      const emptyBreakpoints = (0,_breakpoints__WEBPACK_IMPORTED_MODULE_2__/* .createEmptyBreakpointObject */ .EU)(theme.breakpoints);
      const breakpointsKeys = Object.keys(emptyBreakpoints);
      let css = emptyBreakpoints;
      Object.keys(sxObject).forEach(styleKey => {
        const value = callIfFn(sxObject[styleKey], theme);
        if (value !== null && value !== undefined) {
          if (typeof value === 'object') {
            if (config[styleKey]) {
              css = (0,_merge__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(css, getThemeValue(styleKey, value, theme, config));
            } else {
              const breakpointsValues = (0,_breakpoints__WEBPACK_IMPORTED_MODULE_2__/* .handleBreakpoints */ .NI)({
                theme
              }, value, x => ({
                [styleKey]: x
              }));
              if (objectsHaveSameKeys(breakpointsValues, value)) {
                css[styleKey] = styleFunctionSx({
                  sx: value,
                  theme
                });
              } else {
                css = (0,_merge__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(css, breakpointsValues);
              }
            }
          } else {
            css = (0,_merge__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(css, getThemeValue(styleKey, value, theme, config));
          }
        }
      });
      return (0,_breakpoints__WEBPACK_IMPORTED_MODULE_2__/* .removeUnusedBreakpoints */ .vf)(breakpointsKeys, css);
    }
    return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
  }
  return styleFunctionSx;
}
const styleFunctionSx = unstable_createStyleFunctionSx();
styleFunctionSx.filterProps = ['sx'];
/* harmony default export */ __webpack_exports__.A = (styleFunctionSx);

/***/ }),

/***/ 7133:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: function() { return /* binding */ esm_useTheme; }
});

// UNUSED EXPORTS: systemDefaultTheme

// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/createTheme/createTheme.js + 2 modules
var createTheme = __webpack_require__(9731);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(6540);
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/@emotion/react/dist/emotion-element-c39617d8.browser.esm.js
var emotion_element_c39617d8_browser_esm = __webpack_require__(7424);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/useThemeWithoutDefault.js
'use client';



function isObjectEmpty(obj) {
  return Object.keys(obj).length === 0;
}
function useTheme(defaultTheme = null) {
  const contextTheme = react.useContext(emotion_element_c39617d8_browser_esm.T);
  return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
}
/* harmony default export */ var useThemeWithoutDefault = (useTheme);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/useTheme.js
'use client';



const systemDefaultTheme = (0,createTheme/* default */.A)();
function useTheme_useTheme(defaultTheme = systemDefaultTheme) {
  return useThemeWithoutDefault(defaultTheme);
}
/* harmony default export */ var esm_useTheme = (useTheme_useTheme);

/***/ }),

/***/ 511:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  A: function() { return /* binding */ useThemeProps; }
});

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(8168);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/resolveProps/resolveProps.js

/**
 * Add keys, values of `defaultProps` that does not exist in `props`
 * @param {object} defaultProps
 * @param {object} props
 * @returns {object} resolved props
 */
function resolveProps(defaultProps, props) {
  const output = (0,esm_extends/* default */.A)({}, props);
  Object.keys(defaultProps).forEach(propName => {
    if (propName.toString().match(/^(components|slots)$/)) {
      output[propName] = (0,esm_extends/* default */.A)({}, defaultProps[propName], output[propName]);
    } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
      const defaultSlotProps = defaultProps[propName] || {};
      const slotProps = props[propName];
      output[propName] = {};
      if (!slotProps || !Object.keys(slotProps)) {
        // Reduce the iteration if the slot props is empty
        output[propName] = defaultSlotProps;
      } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
        // Reduce the iteration if the default slot props is empty
        output[propName] = slotProps;
      } else {
        output[propName] = (0,esm_extends/* default */.A)({}, slotProps);
        Object.keys(defaultSlotProps).forEach(slotPropName => {
          output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
        });
      }
    } else if (output[propName] === undefined) {
      output[propName] = defaultProps[propName];
    }
  });
  return output;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/useThemeProps/getThemeProps.js

function getThemeProps(params) {
  const {
    theme,
    name,
    props
  } = params;
  if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
    return props;
  }
  return resolveProps(theme.components[name].defaultProps, props);
}
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/useTheme.js + 1 modules
var useTheme = __webpack_require__(7133);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/useThemeProps/useThemeProps.js
'use client';



function useThemeProps({
  props,
  name,
  defaultTheme,
  themeId
}) {
  let theme = (0,useTheme/* default */.A)(defaultTheme);
  if (themeId) {
    theme = theme[themeId] || theme;
  }
  const mergedProps = getThemeProps({
    theme,
    name,
    props
  });
  return mergedProps;
}

/***/ }),

/***/ 913:
/***/ (function(__unused_webpack_module, __webpack_exports__) {

"use strict";
const defaultGenerator = componentName => componentName;
const createClassNameGenerator = () => {
  let generate = defaultGenerator;
  return {
    configure(generator) {
      generate = generator;
    },
    generate(componentName) {
      return generate(componentName);
    },
    reset() {
      generate = defaultGenerator;
    }
  };
};
const ClassNameGenerator = createClassNameGenerator();
/* harmony default export */ __webpack_exports__.A = (ClassNameGenerator);

/***/ }),

/***/ 985:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ capitalize; }
/* harmony export */ });
/* harmony import */ var _mui_utils_formatMuiErrorMessage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(799);

// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
//
// A strict capitalization should uppercase the first letter of each word in the sentence.
// We only handle the first word.
function capitalize(string) {
  if (typeof string !== 'string') {
    throw new Error( false ? 0 : (0,_mui_utils_formatMuiErrorMessage__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(7));
  }
  return string.charAt(0).toUpperCase() + string.slice(1);
}

/***/ }),

/***/ 2391:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* reexport safe */ _capitalize__WEBPACK_IMPORTED_MODULE_0__.A; }
/* harmony export */ });
/* harmony import */ var _capitalize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(985);


/***/ }),

/***/ 577:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* reexport */ clamp_clamp; }
});

;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/clamp/clamp.js
function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
  return Math.max(min, Math.min(val, max));
}
/* harmony default export */ var clamp_clamp = (clamp);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/clamp/index.js


/***/ }),

/***/ 7453:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ composeClasses; }
/* harmony export */ });
function composeClasses(slots, getUtilityClass, classes = undefined) {
  const output = {};
  Object.keys(slots).forEach(
  // `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
  // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
  slot => {
    output[slot] = slots[slot].reduce((acc, key) => {
      if (key) {
        const utilityClass = getUtilityClass(key);
        if (utilityClass !== '') {
          acc.push(utilityClass);
        }
        if (classes && classes[key]) {
          acc.push(classes[key]);
        }
      }
      return acc;
    }, []).join(' ');
  });
  return output;
}

/***/ }),

/***/ 4067:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ createChainedFunction; }
/* harmony export */ });
/**
 * Safe chained function.
 *
 * Will only create a new function if needed,
 * otherwise will pass back existing functions or null.
 */
function createChainedFunction(...funcs) {
  return funcs.reduce((acc, func) => {
    if (func == null) {
      return acc;
    }
    return function chainedFunction(...args) {
      acc.apply(this, args);
      func.apply(this, args);
    };
  }, () => {});
}

/***/ }),

/***/ 9379:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ debounce; }
/* harmony export */ });
// Corresponds to 10 frames at 60 Hz.
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
function debounce(func, wait = 166) {
  let timeout;
  function debounced(...args) {
    const later = () => {
      // @ts-ignore
      func.apply(this, args);
    };
    clearTimeout(timeout);
    timeout = setTimeout(later, wait);
  }
  debounced.clear = () => {
    clearTimeout(timeout);
  };
  return debounced;
}

/***/ }),

/***/ 3479:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ deepmerge; },
/* harmony export */   Q: function() { return /* binding */ isPlainObject; }
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8168);

// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
function isPlainObject(item) {
  if (typeof item !== 'object' || item === null) {
    return false;
  }
  const prototype = Object.getPrototypeOf(item);
  return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
}
function deepClone(source) {
  if (!isPlainObject(source)) {
    return source;
  }
  const output = {};
  Object.keys(source).forEach(key => {
    output[key] = deepClone(source[key]);
  });
  return output;
}
function deepmerge(target, source, options = {
  clone: true
}) {
  const output = options.clone ? (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)({}, target) : target;
  if (isPlainObject(target) && isPlainObject(source)) {
    Object.keys(source).forEach(key => {
      if (isPlainObject(source[key]) &&
      // Avoid prototype pollution
      Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
        // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
        output[key] = deepmerge(target[key], source[key], options);
      } else if (options.clone) {
        output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];
      } else {
        output[key] = source[key];
      }
    });
  }
  return output;
}

/***/ }),

/***/ 6661:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* reexport safe */ _deepmerge__WEBPACK_IMPORTED_MODULE_0__.A; },
/* harmony export */   isPlainObject: function() { return /* reexport safe */ _deepmerge__WEBPACK_IMPORTED_MODULE_0__.Q; }
/* harmony export */ });
/* harmony import */ var _deepmerge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3479);



/***/ }),

/***/ 799:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ formatMuiErrorMessage; }
/* harmony export */ });
/**
 * WARNING: Don't import this directly.
 * Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.
 * @param {number} code
 */
function formatMuiErrorMessage(code) {
  // Apply babel-plugin-transform-template-literals in loose mode
  // loose mode is safe if we're concatenating primitives
  // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose
  /* eslint-disable prefer-template */
  let url = 'https://mui.com/production-error/?code=' + code;
  for (let i = 1; i < arguments.length; i += 1) {
    // rest params over-transpile for this case
    // eslint-disable-next-line prefer-rest-params
    url += '&args[]=' + encodeURIComponent(arguments[i]);
  }
  return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';
  /* eslint-enable prefer-template */
}

/***/ }),

/***/ 9110:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": function() { return /* reexport safe */ _formatMuiErrorMessage__WEBPACK_IMPORTED_MODULE_0__.A; }
/* harmony export */ });
/* harmony import */ var _formatMuiErrorMessage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(799);


/***/ }),

/***/ 6467:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Ay: function() { return /* binding */ generateUtilityClass; }
/* harmony export */ });
/* unused harmony exports globalStateClasses, isGlobalState */
/* harmony import */ var _ClassNameGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(913);

const globalStateClasses = {
  active: 'active',
  checked: 'checked',
  completed: 'completed',
  disabled: 'disabled',
  error: 'error',
  expanded: 'expanded',
  focused: 'focused',
  focusVisible: 'focusVisible',
  open: 'open',
  readOnly: 'readOnly',
  required: 'required',
  selected: 'selected'
};
function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
  const globalStateClass = globalStateClasses[slot];
  return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${_ClassNameGenerator__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.generate(componentName)}-${slot}`;
}
function isGlobalState(slot) {
  return globalStateClasses[slot] !== undefined;
}

/***/ }),

/***/ 7135:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ generateUtilityClasses; }
/* harmony export */ });
/* harmony import */ var _generateUtilityClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6467);

function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {
  const result = {};
  slots.forEach(slot => {
    result[slot] = (0,_generateUtilityClass__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)(componentName, slot, globalStatePrefix);
  });
  return result;
}

/***/ }),

/***/ 3526:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* reexport */ getDisplayName; },
  getFunctionName: function() { return /* reexport */ getFunctionName; }
});

// EXTERNAL MODULE: ./node_modules/react-is/cjs/react-is.production.js
var react_is_production = __webpack_require__(4405);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/getDisplayName/getDisplayName.js


// Simplified polyfill for IE11 support
// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3
const fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
function getFunctionName(fn) {
  const match = `${fn}`.match(fnNameMatchRegex);
  const name = match && match[1];
  return name || '';
}
function getFunctionComponentName(Component, fallback = '') {
  return Component.displayName || Component.name || getFunctionName(Component) || fallback;
}
function getWrappedName(outerType, innerType, wrapperName) {
  const functionName = getFunctionComponentName(innerType);
  return outerType.displayName || (functionName !== '' ? `${wrapperName}(${functionName})` : wrapperName);
}

/**
 * cherry-pick from
 * https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
 * originally forked from recompose/getDisplayName with added IE11 support
 */
function getDisplayName(Component) {
  if (Component == null) {
    return undefined;
  }
  if (typeof Component === 'string') {
    return Component;
  }
  if (typeof Component === 'function') {
    return getFunctionComponentName(Component, 'Component');
  }

  // TypeScript can't have components as objects but they exist in the form of `memo` or `Suspense`
  if (typeof Component === 'object') {
    switch (Component.$$typeof) {
      case react_is_production.ForwardRef:
        return getWrappedName(Component, Component.render, 'ForwardRef');
      case react_is_production.Memo:
        return getWrappedName(Component, Component.type, 'memo');
      default:
        return undefined;
    }
  }
  return undefined;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/getDisplayName/index.js



/***/ }),

/***/ 8183:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ ownerDocument; }
/* harmony export */ });
function ownerDocument(node) {
  return node && node.ownerDocument || document;
}

/***/ }),

/***/ 2327:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ ownerWindow; }
/* harmony export */ });
/* harmony import */ var _ownerDocument__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8183);

function ownerWindow(node) {
  const doc = (0,_ownerDocument__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(node);
  return doc.defaultView || window;
}

/***/ }),

/***/ 207:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ setRef; }
/* harmony export */ });
/**
 * TODO v5: consider making it private
 *
 * passes {value} to {ref}
 *
 * WARNING: Be sure to only call this inside a callback that is passed as a ref.
 * Otherwise, make sure to cleanup the previous {ref} if it changes. See
 * https://github.com/mui/material-ui/issues/13539
 *
 * Useful if you want to expose the ref of an inner component to the public API
 * while still using it inside the component.
 * @param ref A ref callback or ref object. If anything falsy, this is a no-op.
 */
function setRef(ref, value) {
  if (typeof ref === 'function') {
    ref(value);
  } else if (ref) {
    ref.current = value;
  }
}

/***/ }),

/***/ 2723:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6540);
'use client';



/**
 * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.
 * This is useful for effects that are only needed for client-side rendering but not for SSR.
 *
 * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
 * and confirm it doesn't apply to your use-case.
 */
const useEnhancedEffect = typeof window !== 'undefined' ? react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_0__.useEffect;
/* harmony default export */ __webpack_exports__.A = (useEnhancedEffect);

/***/ }),

/***/ 1885:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6540);
/* harmony import */ var _useEnhancedEffect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2723);
'use client';




/**
 * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892
 * See RFC in https://github.com/reactjs/rfcs/pull/220
 */

function useEventCallback(fn) {
  const ref = react__WEBPACK_IMPORTED_MODULE_0__.useRef(fn);
  (0,_useEnhancedEffect__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(() => {
    ref.current = fn;
  });
  return react__WEBPACK_IMPORTED_MODULE_0__.useRef((...args) =>
  // @ts-expect-error hide `this`
  (0, ref.current)(...args)).current;
}
/* harmony default export */ __webpack_exports__.A = (useEventCallback);

/***/ }),

/***/ 4061:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ useForkRef; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6540);
/* harmony import */ var _setRef__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(207);
'use client';



function useForkRef(...refs) {
  /**
   * This will create a new function if the refs passed to this hook change and are all defined.
   * This means react will call the old forkRef with `null` and the new forkRef
   * with the ref. Cleanup naturally emerges from this behavior.
   */
  return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {
    if (refs.every(ref => ref == null)) {
      return null;
    }
    return instance => {
      refs.forEach(ref => {
        (0,_setRef__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(ref, instance);
      });
    };
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, refs);
}

/***/ }),

/***/ 5311:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
var react__WEBPACK_IMPORTED_MODULE_0___namespace_cache;
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ useId; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6540);
'use client';


let globalId = 0;
function useGlobalId(idOverride) {
  const [defaultId, setDefaultId] = react__WEBPACK_IMPORTED_MODULE_0__.useState(idOverride);
  const id = idOverride || defaultId;
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    if (defaultId == null) {
      // Fallback to this default id when possible.
      // Use the incrementing value for client-side rendering only.
      // We can't use it server-side.
      // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem
      globalId += 1;
      setDefaultId(`mui-${globalId}`);
    }
  }, [defaultId]);
  return id;
}

// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814
const maybeReactUseId = /*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_0___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_0__, 2)))['useId'.toString()];
/**
 *
 * @example <div id={useId()} />
 * @param idOverride
 * @returns {string}
 */
function useId(idOverride) {
  if (maybeReactUseId !== undefined) {
    const reactId = maybeReactUseId();
    return idOverride != null ? idOverride : reactId;
  }
  // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.
  return useGlobalId(idOverride);
}

/***/ }),

/***/ 478:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  E: function() { return /* binding */ Timeout; },
  A: function() { return /* binding */ useTimeout; }
});

// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(6540);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useLazyRef/useLazyRef.js
'use client';


const UNINITIALIZED = {};

/**
 * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional
 * initialization argument, so the initialization function doesn't need to be an inline closure.
 *
 * @usage
 *   const ref = useLazyRef(sortColumns, columns)
 */
function useLazyRef(init, initArg) {
  const ref = react.useRef(UNINITIALIZED);
  if (ref.current === UNINITIALIZED) {
    ref.current = init(initArg);
  }
  return ref;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useOnMount/useOnMount.js
'use client';


const EMPTY = [];

/**
 * A React.useEffect equivalent that runs once, when the component is mounted.
 */
function useOnMount(fn) {
  /* eslint-disable react-hooks/exhaustive-deps */
  react.useEffect(fn, EMPTY);
  /* eslint-enable react-hooks/exhaustive-deps */
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useTimeout/useTimeout.js
'use client';



class Timeout {
  constructor() {
    this.currentId = null;
    this.clear = () => {
      if (this.currentId !== null) {
        clearTimeout(this.currentId);
        this.currentId = null;
      }
    };
    this.disposeEffect = () => {
      return this.clear;
    };
  }
  static create() {
    return new Timeout();
  }
  /**
   * Executes `fn` after `delay`, clearing any previously scheduled call.
   */
  start(delay, fn) {
    this.clear();
    this.currentId = setTimeout(() => {
      this.currentId = null;
      fn();
    }, delay);
  }
}
function useTimeout() {
  const timeout = useLazyRef(Timeout.create).current;
  useOnMount(timeout.disposeEffect);
  return timeout;
}

/***/ }),

/***/ 7839:
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_RESULT__;/*
 * JavaScript MD5
 * https://github.com/blueimp/JavaScript-MD5
 *
 * Copyright 2011, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * https://opensource.org/licenses/MIT
 *
 * Based on
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for more info.
 */

/* global define */

/* eslint-disable strict */

;(function ($) {
  'use strict'

  /**
   * Add integers, wrapping at 2^32.
   * This uses 16-bit operations internally to work around bugs in interpreters.
   *
   * @param {number} x First integer
   * @param {number} y Second integer
   * @returns {number} Sum
   */
  function safeAdd(x, y) {
    var lsw = (x & 0xffff) + (y & 0xffff)
    var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
    return (msw << 16) | (lsw & 0xffff)
  }

  /**
   * Bitwise rotate a 32-bit number to the left.
   *
   * @param {number} num 32-bit number
   * @param {number} cnt Rotation count
   * @returns {number} Rotated number
   */
  function bitRotateLeft(num, cnt) {
    return (num << cnt) | (num >>> (32 - cnt))
  }

  /**
   * Basic operation the algorithm uses.
   *
   * @param {number} q q
   * @param {number} a a
   * @param {number} b b
   * @param {number} x x
   * @param {number} s s
   * @param {number} t t
   * @returns {number} Result
   */
  function md5cmn(q, a, b, x, s, t) {
    return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)
  }
  /**
   * Basic operation the algorithm uses.
   *
   * @param {number} a a
   * @param {number} b b
   * @param {number} c c
   * @param {number} d d
   * @param {number} x x
   * @param {number} s s
   * @param {number} t t
   * @returns {number} Result
   */
  function md5ff(a, b, c, d, x, s, t) {
    return md5cmn((b & c) | (~b & d), a, b, x, s, t)
  }
  /**
   * Basic operation the algorithm uses.
   *
   * @param {number} a a
   * @param {number} b b
   * @param {number} c c
   * @param {number} d d
   * @param {number} x x
   * @param {number} s s
   * @param {number} t t
   * @returns {number} Result
   */
  function md5gg(a, b, c, d, x, s, t) {
    return md5cmn((b & d) | (c & ~d), a, b, x, s, t)
  }
  /**
   * Basic operation the algorithm uses.
   *
   * @param {number} a a
   * @param {number} b b
   * @param {number} c c
   * @param {number} d d
   * @param {number} x x
   * @param {number} s s
   * @param {number} t t
   * @returns {number} Result
   */
  function md5hh(a, b, c, d, x, s, t) {
    return md5cmn(b ^ c ^ d, a, b, x, s, t)
  }
  /**
   * Basic operation the algorithm uses.
   *
   * @param {number} a a
   * @param {number} b b
   * @param {number} c c
   * @param {number} d d
   * @param {number} x x
   * @param {number} s s
   * @param {number} t t
   * @returns {number} Result
   */
  function md5ii(a, b, c, d, x, s, t) {
    return md5cmn(c ^ (b | ~d), a, b, x, s, t)
  }

  /**
   * Calculate the MD5 of an array of little-endian words, and a bit length.
   *
   * @param {Array} x Array of little-endian words
   * @param {number} len Bit length
   * @returns {Array<number>} MD5 Array
   */
  function binlMD5(x, len) {
    /* append padding */
    x[len >> 5] |= 0x80 << len % 32
    x[(((len + 64) >>> 9) << 4) + 14] = len

    var i
    var olda
    var oldb
    var oldc
    var oldd
    var a = 1732584193
    var b = -271733879
    var c = -1732584194
    var d = 271733878

    for (i = 0; i < x.length; i += 16) {
      olda = a
      oldb = b
      oldc = c
      oldd = d

      a = md5ff(a, b, c, d, x[i], 7, -680876936)
      d = md5ff(d, a, b, c, x[i + 1], 12, -389564586)
      c = md5ff(c, d, a, b, x[i + 2], 17, 606105819)
      b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330)
      a = md5ff(a, b, c, d, x[i + 4], 7, -176418897)
      d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426)
      c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341)
      b = md5ff(b, c, d, a, x[i + 7], 22, -45705983)
      a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416)
      d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417)
      c = md5ff(c, d, a, b, x[i + 10], 17, -42063)
      b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162)
      a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682)
      d = md5ff(d, a, b, c, x[i + 13], 12, -40341101)
      c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290)
      b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329)

      a = md5gg(a, b, c, d, x[i + 1], 5, -165796510)
      d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632)
      c = md5gg(c, d, a, b, x[i + 11], 14, 643717713)
      b = md5gg(b, c, d, a, x[i], 20, -373897302)
      a = md5gg(a, b, c, d, x[i + 5], 5, -701558691)
      d = md5gg(d, a, b, c, x[i + 10], 9, 38016083)
      c = md5gg(c, d, a, b, x[i + 15], 14, -660478335)
      b = md5gg(b, c, d, a, x[i + 4], 20, -405537848)
      a = md5gg(a, b, c, d, x[i + 9], 5, 568446438)
      d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690)
      c = md5gg(c, d, a, b, x[i + 3], 14, -187363961)
      b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501)
      a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467)
      d = md5gg(d, a, b, c, x[i + 2], 9, -51403784)
      c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473)
      b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734)

      a = md5hh(a, b, c, d, x[i + 5], 4, -378558)
      d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463)
      c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562)
      b = md5hh(b, c, d, a, x[i + 14], 23, -35309556)
      a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060)
      d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353)
      c = md5hh(c, d, a, b, x[i + 7], 16, -155497632)
      b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640)
      a = md5hh(a, b, c, d, x[i + 13], 4, 681279174)
      d = md5hh(d, a, b, c, x[i], 11, -358537222)
      c = md5hh(c, d, a, b, x[i + 3], 16, -722521979)
      b = md5hh(b, c, d, a, x[i + 6], 23, 76029189)
      a = md5hh(a, b, c, d, x[i + 9], 4, -640364487)
      d = md5hh(d, a, b, c, x[i + 12], 11, -421815835)
      c = md5hh(c, d, a, b, x[i + 15], 16, 530742520)
      b = md5hh(b, c, d, a, x[i + 2], 23, -995338651)

      a = md5ii(a, b, c, d, x[i], 6, -198630844)
      d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415)
      c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905)
      b = md5ii(b, c, d, a, x[i + 5], 21, -57434055)
      a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571)
      d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606)
      c = md5ii(c, d, a, b, x[i + 10], 15, -1051523)
      b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799)
      a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359)
      d = md5ii(d, a, b, c, x[i + 15], 10, -30611744)
      c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380)
      b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649)
      a = md5ii(a, b, c, d, x[i + 4], 6, -145523070)
      d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379)
      c = md5ii(c, d, a, b, x[i + 2], 15, 718787259)
      b = md5ii(b, c, d, a, x[i + 9], 21, -343485551)

      a = safeAdd(a, olda)
      b = safeAdd(b, oldb)
      c = safeAdd(c, oldc)
      d = safeAdd(d, oldd)
    }
    return [a, b, c, d]
  }

  /**
   * Convert an array of little-endian words to a string
   *
   * @param {Array<number>} input MD5 Array
   * @returns {string} MD5 string
   */
  function binl2rstr(input) {
    var i
    var output = ''
    var length32 = input.length * 32
    for (i = 0; i < length32; i += 8) {
      output += String.fromCharCode((input[i >> 5] >>> i % 32) & 0xff)
    }
    return output
  }

  /**
   * Convert a raw string to an array of little-endian words
   * Characters >255 have their high-byte silently ignored.
   *
   * @param {string} input Raw input string
   * @returns {Array<number>} Array of little-endian words
   */
  function rstr2binl(input) {
    var i
    var output = []
    output[(input.length >> 2) - 1] = undefined
    for (i = 0; i < output.length; i += 1) {
      output[i] = 0
    }
    var length8 = input.length * 8
    for (i = 0; i < length8; i += 8) {
      output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32
    }
    return output
  }

  /**
   * Calculate the MD5 of a raw string
   *
   * @param {string} s Input string
   * @returns {string} Raw MD5 string
   */
  function rstrMD5(s) {
    return binl2rstr(binlMD5(rstr2binl(s), s.length * 8))
  }

  /**
   * Calculates the HMAC-MD5 of a key and some data (raw strings)
   *
   * @param {string} key HMAC key
   * @param {string} data Raw input string
   * @returns {string} Raw MD5 string
   */
  function rstrHMACMD5(key, data) {
    var i
    var bkey = rstr2binl(key)
    var ipad = []
    var opad = []
    var hash
    ipad[15] = opad[15] = undefined
    if (bkey.length > 16) {
      bkey = binlMD5(bkey, key.length * 8)
    }
    for (i = 0; i < 16; i += 1) {
      ipad[i] = bkey[i] ^ 0x36363636
      opad[i] = bkey[i] ^ 0x5c5c5c5c
    }
    hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)
    return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))
  }

  /**
   * Convert a raw string to a hex string
   *
   * @param {string} input Raw input string
   * @returns {string} Hex encoded string
   */
  function rstr2hex(input) {
    var hexTab = '0123456789abcdef'
    var output = ''
    var x
    var i
    for (i = 0; i < input.length; i += 1) {
      x = input.charCodeAt(i)
      output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f)
    }
    return output
  }

  /**
   * Encode a string as UTF-8
   *
   * @param {string} input Input string
   * @returns {string} UTF8 string
   */
  function str2rstrUTF8(input) {
    return unescape(encodeURIComponent(input))
  }

  /**
   * Encodes input string as raw MD5 string
   *
   * @param {string} s Input string
   * @returns {string} Raw MD5 string
   */
  function rawMD5(s) {
    return rstrMD5(str2rstrUTF8(s))
  }
  /**
   * Encodes input string as Hex encoded string
   *
   * @param {string} s Input string
   * @returns {string} Hex encoded string
   */
  function hexMD5(s) {
    return rstr2hex(rawMD5(s))
  }
  /**
   * Calculates the raw HMAC-MD5 for the given key and data
   *
   * @param {string} k HMAC key
   * @param {string} d Input string
   * @returns {string} Raw MD5 string
   */
  function rawHMACMD5(k, d) {
    return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d))
  }
  /**
   * Calculates the Hex encoded HMAC-MD5 for the given key and data
   *
   * @param {string} k HMAC key
   * @param {string} d Input string
   * @returns {string} Raw MD5 string
   */
  function hexHMACMD5(k, d) {
    return rstr2hex(rawHMACMD5(k, d))
  }

  /**
   * Calculates MD5 value for a given string.
   * If a key is provided, calculates the HMAC-MD5 value.
   * Returns a Hex encoded string unless the raw argument is given.
   *
   * @param {string} string Input string
   * @param {string} [key] HMAC key
   * @param {boolean} [raw] Raw output switch
   * @returns {string} MD5 output
   */
  function md5(string, key, raw) {
    if (!key) {
      if (!raw) {
        return hexMD5(string)
      }
      return rawMD5(string)
    }
    if (!raw) {
      return hexHMACMD5(key, string)
    }
    return rawHMACMD5(key, string)
  }

  if (true) {
    !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
      return md5
    }).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))
  } else {}
})(this)


/***/ }),

/***/ 1981:
/***/ (function(module) {

!function(e,t){ true?module.exports=t():0}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=90)}({17:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var r=t.match(e);return r&&r.length>0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),s=e.getVersionPrecision(r),a=Math.max(i,s),o=0,u=e.map([t,r],(function(t){var r=a-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(o=a-Math.min(i,s)),a-=1;a>=o;){if(u[0][a]>u[1][a])return 1;if(u[0][a]===u[1][a]){if(a===o)return 0;a-=1}else if(u[0][a]<u[1][a])return-1}},e.map=function(e,t){var r,n=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r+=1)n.push(t(e[r]));return n},e.find=function(e,t){var r,n;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(r=0,n=e.length;r<n;r+=1){var i=e[r];if(t(i,r))return i}},e.assign=function(e){for(var t,r,n=e,i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];if(Object.assign)return Object.assign.apply(Object,[e].concat(s));var o=function(){var e=s[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){n[t]=e[t]}))};for(t=0,r=s.length;t<r;t+=1)o();return e},e.getBrowserAlias=function(e){return n.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return n.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,r){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0;t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"};t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"};t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"};t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"};t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(91))&&n.__esModule?n:{default:n},s=r(18);function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var o=function(){function e(){}var t,r,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,n=[{key:"BROWSER_MAP",get:function(){return s.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return s.ENGINE_MAP}},{key:"OS_MAP",get:function(){return s.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return s.PLATFORMS_MAP}}],(r=null)&&a(t.prototype,r),n&&a(t,n),e}();t.default=o,e.exports=t.default},91:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=u(r(92)),i=u(r(93)),s=u(r(94)),a=u(r(95)),o=u(r(17));function u(e){return e&&e.__esModule?e:{default:e}}var d=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=o.default.find(n.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=o.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=o.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=o.default.find(a.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return o.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,r={},n=0,i={},s=0;if(Object.keys(e).forEach((function(t){var a=e[t];"string"==typeof a?(i[t]=a,s+=1):"object"==typeof a&&(r[t]=a,n+=1)})),n>0){var a=Object.keys(r),u=o.default.find(a,(function(e){return t.isOS(e)}));if(u){var d=this.satisfies(r[u]);if(void 0!==d)return d}var c=o.default.find(a,(function(e){return t.isPlatform(e)}));if(c){var f=this.satisfies(r[c]);if(void 0!==f)return f}}if(s>0){var l=Object.keys(i),h=o.default.find(l,(function(e){return t.isBrowser(e,!0)}));if(void 0!==h)return this.compareVersion(i[h])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=o.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(o.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=d,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n};var s=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(s,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(s,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=a,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:s.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:s.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:s.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:s.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:s.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:s.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:s.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:s.OS_MAP.PlayStation4,version:t}}}];t.default=a,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];t.default=a,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},s=r(18);var a=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:s.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:s.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:s.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:s.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:s.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:s.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=a,e.exports=t.default}})}));

/***/ }),

/***/ 3348:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(362);

var callBind = __webpack_require__(3784);

var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));

module.exports = function callBoundIntrinsic(name, allowMissing) {
	var intrinsic = GetIntrinsic(name, !!allowMissing);
	if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
		return callBind(intrinsic);
	}
	return intrinsic;
};


/***/ }),

/***/ 3784:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var bind = __webpack_require__(6743);
var GetIntrinsic = __webpack_require__(362);
var setFunctionLength = __webpack_require__(7238);

var $TypeError = __webpack_require__(3502);
var $apply = GetIntrinsic('%Function.prototype.apply%');
var $call = GetIntrinsic('%Function.prototype.call%');
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);

var $defineProperty = __webpack_require__(466);
var $max = GetIntrinsic('%Math.max%');

module.exports = function callBind(originalFunction) {
	if (typeof originalFunction !== 'function') {
		throw new $TypeError('a function is required');
	}
	var func = $reflectApply(bind, $call, arguments);
	return setFunctionLength(
		func,
		1 + $max(0, originalFunction.length - (arguments.length - 1)),
		true
	);
};

var applyBind = function applyBind() {
	return $reflectApply(bind, $apply, arguments);
};

if ($defineProperty) {
	$defineProperty(module.exports, 'apply', { value: applyBind });
} else {
	module.exports.apply = applyBind;
}


/***/ }),

/***/ 6504:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var $defineProperty = __webpack_require__(466);

var $SyntaxError = __webpack_require__(5125);
var $TypeError = __webpack_require__(3502);

var gopd = __webpack_require__(6270);

/** @type {import('.')} */
module.exports = function defineDataProperty(
	obj,
	property,
	value
) {
	if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
		throw new $TypeError('`obj` must be an object or a function`');
	}
	if (typeof property !== 'string' && typeof property !== 'symbol') {
		throw new $TypeError('`property` must be a string or a symbol`');
	}
	if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
		throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');
	}
	if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
		throw new $TypeError('`nonWritable`, if provided, must be a boolean or null');
	}
	if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
		throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');
	}
	if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
		throw new $TypeError('`loose`, if provided, must be a boolean');
	}

	var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
	var nonWritable = arguments.length > 4 ? arguments[4] : null;
	var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
	var loose = arguments.length > 6 ? arguments[6] : false;

	/* @type {false | TypedPropertyDescriptor<unknown>} */
	var desc = !!gopd && gopd(obj, property);

	if ($defineProperty) {
		$defineProperty(obj, property, {
			configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
			enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
			value: value,
			writable: nonWritable === null && desc ? desc.writable : !nonWritable
		});
	} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
		// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
		obj[property] = value; // eslint-disable-line no-param-reassign
	} else {
		throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
	}
};


/***/ }),

/***/ 466:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(362);

/** @type {import('.')} */
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;
if ($defineProperty) {
	try {
		$defineProperty({}, 'a', { value: 1 });
	} catch (e) {
		// IE 8 has a broken defineProperty
		$defineProperty = false;
	}
}

module.exports = $defineProperty;


/***/ }),

/***/ 3780:
/***/ (function(module) {

"use strict";


/** @type {import('./eval')} */
module.exports = EvalError;


/***/ }),

/***/ 2016:
/***/ (function(module) {

"use strict";


/** @type {import('.')} */
module.exports = Error;


/***/ }),

/***/ 7893:
/***/ (function(module) {

"use strict";


/** @type {import('./range')} */
module.exports = RangeError;


/***/ }),

/***/ 6637:
/***/ (function(module) {

"use strict";


/** @type {import('./ref')} */
module.exports = ReferenceError;


/***/ }),

/***/ 5125:
/***/ (function(module) {

"use strict";


/** @type {import('./syntax')} */
module.exports = SyntaxError;


/***/ }),

/***/ 3502:
/***/ (function(module) {

"use strict";


/** @type {import('./type')} */
module.exports = TypeError;


/***/ }),

/***/ 9950:
/***/ (function(module) {

"use strict";


/** @type {import('./uri')} */
module.exports = URIError;


/***/ }),

/***/ 6441:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


const validator = __webpack_require__(8741);
const XMLParser = __webpack_require__(3856);
const XMLBuilder = __webpack_require__(2863);

module.exports = {
  XMLParser: XMLParser,
  XMLValidator: validator,
  XMLBuilder: XMLBuilder
}

/***/ }),

/***/ 9055:
/***/ (function(__unused_webpack_module, exports) {

"use strict";


const nameStartChar = ':A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
const nameChar = nameStartChar + '\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
const nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*'
const regexName = new RegExp('^' + nameRegexp + '$');

const getAllMatches = function(string, regex) {
  const matches = [];
  let match = regex.exec(string);
  while (match) {
    const allmatches = [];
    allmatches.startIndex = regex.lastIndex - match[0].length;
    const len = match.length;
    for (let index = 0; index < len; index++) {
      allmatches.push(match[index]);
    }
    matches.push(allmatches);
    match = regex.exec(string);
  }
  return matches;
};

const isName = function(string) {
  const match = regexName.exec(string);
  return !(match === null || typeof match === 'undefined');
};

exports.isExist = function(v) {
  return typeof v !== 'undefined';
};

exports.isEmptyObject = function(obj) {
  return Object.keys(obj).length === 0;
};

/**
 * Copy all the properties of a into b.
 * @param {*} target
 * @param {*} a
 */
exports.merge = function(target, a, arrayMode) {
  if (a) {
    const keys = Object.keys(a); // will return an array of own properties
    const len = keys.length; //don't make it inline
    for (let i = 0; i < len; i++) {
      if (arrayMode === 'strict') {
        target[keys[i]] = [ a[keys[i]] ];
      } else {
        target[keys[i]] = a[keys[i]];
      }
    }
  }
};
/* exports.merge =function (b,a){
  return Object.assign(b,a);
} */

exports.getValue = function(v) {
  if (exports.isExist(v)) {
    return v;
  } else {
    return '';
  }
};

// const fakeCall = function(a) {return a;};
// const fakeCallNoReturn = function() {};

exports.isName = isName;
exports.getAllMatches = getAllMatches;
exports.nameRegexp = nameRegexp;


/***/ }),

/***/ 8741:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


const util = __webpack_require__(9055);

const defaultOptions = {
  allowBooleanAttributes: false, //A tag can have attributes without any value
  unpairedTags: []
};

//const tagsPattern = new RegExp("<\\/?([\\w:\\-_\.]+)\\s*\/?>","g");
exports.validate = function (xmlData, options) {
  options = Object.assign({}, defaultOptions, options);

  //xmlData = xmlData.replace(/(\r\n|\n|\r)/gm,"");//make it single line
  //xmlData = xmlData.replace(/(^\s*<\?xml.*?\?>)/g,"");//Remove XML starting tag
  //xmlData = xmlData.replace(/(<!DOCTYPE[\s\w\"\.\/\-\:]+(\[.*\])*\s*>)/g,"");//Remove DOCTYPE
  const tags = [];
  let tagFound = false;

  //indicates that the root tag has been closed (aka. depth 0 has been reached)
  let reachedRoot = false;

  if (xmlData[0] === '\ufeff') {
    // check for byte order mark (BOM)
    xmlData = xmlData.substr(1);
  }
  
  for (let i = 0; i < xmlData.length; i++) {

    if (xmlData[i] === '<' && xmlData[i+1] === '?') {
      i+=2;
      i = readPI(xmlData,i);
      if (i.err) return i;
    }else if (xmlData[i] === '<') {
      //starting of tag
      //read until you reach to '>' avoiding any '>' in attribute value
      let tagStartPos = i;
      i++;
      
      if (xmlData[i] === '!') {
        i = readCommentAndCDATA(xmlData, i);
        continue;
      } else {
        let closingTag = false;
        if (xmlData[i] === '/') {
          //closing tag
          closingTag = true;
          i++;
        }
        //read tagname
        let tagName = '';
        for (; i < xmlData.length &&
          xmlData[i] !== '>' &&
          xmlData[i] !== ' ' &&
          xmlData[i] !== '\t' &&
          xmlData[i] !== '\n' &&
          xmlData[i] !== '\r'; i++
        ) {
          tagName += xmlData[i];
        }
        tagName = tagName.trim();
        //console.log(tagName);

        if (tagName[tagName.length - 1] === '/') {
          //self closing tag without attributes
          tagName = tagName.substring(0, tagName.length - 1);
          //continue;
          i--;
        }
        if (!validateTagName(tagName)) {
          let msg;
          if (tagName.trim().length === 0) {
            msg = "Invalid space after '<'.";
          } else {
            msg = "Tag '"+tagName+"' is an invalid name.";
          }
          return getErrorObject('InvalidTag', msg, getLineNumberForPosition(xmlData, i));
        }

        const result = readAttributeStr(xmlData, i);
        if (result === false) {
          return getErrorObject('InvalidAttr', "Attributes for '"+tagName+"' have open quote.", getLineNumberForPosition(xmlData, i));
        }
        let attrStr = result.value;
        i = result.index;

        if (attrStr[attrStr.length - 1] === '/') {
          //self closing tag
          const attrStrStart = i - attrStr.length;
          attrStr = attrStr.substring(0, attrStr.length - 1);
          const isValid = validateAttributeString(attrStr, options);
          if (isValid === true) {
            tagFound = true;
            //continue; //text may presents after self closing tag
          } else {
            //the result from the nested function returns the position of the error within the attribute
            //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute
            //this gives us the absolute index in the entire xml, which we can use to find the line at last
            return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));
          }
        } else if (closingTag) {
          if (!result.tagClosed) {
            return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' doesn't have proper closing.", getLineNumberForPosition(xmlData, i));
          } else if (attrStr.trim().length > 0) {
            return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos));
          } else if (tags.length === 0) {
            return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos));
          } else {
            const otg = tags.pop();
            if (tagName !== otg.tagName) {
              let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);
              return getErrorObject('InvalidTag',
                "Expected closing tag '"+otg.tagName+"' (opened in line "+openPos.line+", col "+openPos.col+") instead of closing tag '"+tagName+"'.",
                getLineNumberForPosition(xmlData, tagStartPos));
            }

            //when there are no more tags, we reached the root level.
            if (tags.length == 0) {
              reachedRoot = true;
            }
          }
        } else {
          const isValid = validateAttributeString(attrStr, options);
          if (isValid !== true) {
            //the result from the nested function returns the position of the error within the attribute
            //in order to get the 'true' error line, we need to calculate the position where the attribute begins (i - attrStr.length) and then add the position within the attribute
            //this gives us the absolute index in the entire xml, which we can use to find the line at last
            return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line));
          }

          //if the root level has been reached before ...
          if (reachedRoot === true) {
            return getErrorObject('InvalidXml', 'Multiple possible root nodes found.', getLineNumberForPosition(xmlData, i));
          } else if(options.unpairedTags.indexOf(tagName) !== -1){
            //don't push into stack
          } else {
            tags.push({tagName, tagStartPos});
          }
          tagFound = true;
        }

        //skip tag text value
        //It may include comments and CDATA value
        for (i++; i < xmlData.length; i++) {
          if (xmlData[i] === '<') {
            if (xmlData[i + 1] === '!') {
              //comment or CADATA
              i++;
              i = readCommentAndCDATA(xmlData, i);
              continue;
            } else if (xmlData[i+1] === '?') {
              i = readPI(xmlData, ++i);
              if (i.err) return i;
            } else{
              break;
            }
          } else if (xmlData[i] === '&') {
            const afterAmp = validateAmpersand(xmlData, i);
            if (afterAmp == -1)
              return getErrorObject('InvalidChar', "char '&' is not expected.", getLineNumberForPosition(xmlData, i));
            i = afterAmp;
          }else{
            if (reachedRoot === true && !isWhiteSpace(xmlData[i])) {
              return getErrorObject('InvalidXml', "Extra text at the end", getLineNumberForPosition(xmlData, i));
            }
          }
        } //end of reading tag text value
        if (xmlData[i] === '<') {
          i--;
        }
      }
    } else {
      if ( isWhiteSpace(xmlData[i])) {
        continue;
      }
      return getErrorObject('InvalidChar', "char '"+xmlData[i]+"' is not expected.", getLineNumberForPosition(xmlData, i));
    }
  }

  if (!tagFound) {
    return getErrorObject('InvalidXml', 'Start tag expected.', 1);
  }else if (tags.length == 1) {
      return getErrorObject('InvalidTag', "Unclosed tag '"+tags[0].tagName+"'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
  }else if (tags.length > 0) {
      return getErrorObject('InvalidXml', "Invalid '"+
          JSON.stringify(tags.map(t => t.tagName), null, 4).replace(/\r?\n/g, '')+
          "' found.", {line: 1, col: 1});
  }

  return true;
};

function isWhiteSpace(char){
  return char === ' ' || char === '\t' || char === '\n'  || char === '\r';
}
/**
 * Read Processing insstructions and skip
 * @param {*} xmlData
 * @param {*} i
 */
function readPI(xmlData, i) {
  const start = i;
  for (; i < xmlData.length; i++) {
    if (xmlData[i] == '?' || xmlData[i] == ' ') {
      //tagname
      const tagname = xmlData.substr(start, i - start);
      if (i > 5 && tagname === 'xml') {
        return getErrorObject('InvalidXml', 'XML declaration allowed only at the start of the document.', getLineNumberForPosition(xmlData, i));
      } else if (xmlData[i] == '?' && xmlData[i + 1] == '>') {
        //check if valid attribut string
        i++;
        break;
      } else {
        continue;
      }
    }
  }
  return i;
}

function readCommentAndCDATA(xmlData, i) {
  if (xmlData.length > i + 5 && xmlData[i + 1] === '-' && xmlData[i + 2] === '-') {
    //comment
    for (i += 3; i < xmlData.length; i++) {
      if (xmlData[i] === '-' && xmlData[i + 1] === '-' && xmlData[i + 2] === '>') {
        i += 2;
        break;
      }
    }
  } else if (
    xmlData.length > i + 8 &&
    xmlData[i + 1] === 'D' &&
    xmlData[i + 2] === 'O' &&
    xmlData[i + 3] === 'C' &&
    xmlData[i + 4] === 'T' &&
    xmlData[i + 5] === 'Y' &&
    xmlData[i + 6] === 'P' &&
    xmlData[i + 7] === 'E'
  ) {
    let angleBracketsCount = 1;
    for (i += 8; i < xmlData.length; i++) {
      if (xmlData[i] === '<') {
        angleBracketsCount++;
      } else if (xmlData[i] === '>') {
        angleBracketsCount--;
        if (angleBracketsCount === 0) {
          break;
        }
      }
    }
  } else if (
    xmlData.length > i + 9 &&
    xmlData[i + 1] === '[' &&
    xmlData[i + 2] === 'C' &&
    xmlData[i + 3] === 'D' &&
    xmlData[i + 4] === 'A' &&
    xmlData[i + 5] === 'T' &&
    xmlData[i + 6] === 'A' &&
    xmlData[i + 7] === '['
  ) {
    for (i += 8; i < xmlData.length; i++) {
      if (xmlData[i] === ']' && xmlData[i + 1] === ']' && xmlData[i + 2] === '>') {
        i += 2;
        break;
      }
    }
  }

  return i;
}

const doubleQuote = '"';
const singleQuote = "'";

/**
 * Keep reading xmlData until '<' is found outside the attribute value.
 * @param {string} xmlData
 * @param {number} i
 */
function readAttributeStr(xmlData, i) {
  let attrStr = '';
  let startChar = '';
  let tagClosed = false;
  for (; i < xmlData.length; i++) {
    if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) {
      if (startChar === '') {
        startChar = xmlData[i];
      } else if (startChar !== xmlData[i]) {
        //if vaue is enclosed with double quote then single quotes are allowed inside the value and vice versa
      } else {
        startChar = '';
      }
    } else if (xmlData[i] === '>') {
      if (startChar === '') {
        tagClosed = true;
        break;
      }
    }
    attrStr += xmlData[i];
  }
  if (startChar !== '') {
    return false;
  }

  return {
    value: attrStr,
    index: i,
    tagClosed: tagClosed
  };
}

/**
 * Select all the attributes whether valid or invalid.
 */
const validAttrStrRegxp = new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?', 'g');

//attr, ="sd", a="amit's", a="sd"b="saf", ab  cd=""

function validateAttributeString(attrStr, options) {
  //console.log("start:"+attrStr+":end");

  //if(attrStr.trim().length === 0) return true; //empty string

  const matches = util.getAllMatches(attrStr, validAttrStrRegxp);
  const attrNames = {};

  for (let i = 0; i < matches.length; i++) {
    if (matches[i][1].length === 0) {
      //nospace before attribute name: a="sd"b="saf"
      return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' has no space in starting.", getPositionFromMatch(matches[i]))
    } else if (matches[i][3] !== undefined && matches[i][4] === undefined) {
      return getErrorObject('InvalidAttr', "Attribute '"+matches[i][2]+"' is without value.", getPositionFromMatch(matches[i]));
    } else if (matches[i][3] === undefined && !options.allowBooleanAttributes) {
      //independent attribute: ab
      return getErrorObject('InvalidAttr', "boolean attribute '"+matches[i][2]+"' is not allowed.", getPositionFromMatch(matches[i]));
    }
    /* else if(matches[i][6] === undefined){//attribute without value: ab=
                    return { err: { code:"InvalidAttr",msg:"attribute " + matches[i][2] + " has no value assigned."}};
                } */
    const attrName = matches[i][2];
    if (!validateAttrName(attrName)) {
      return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is an invalid name.", getPositionFromMatch(matches[i]));
    }
    if (!attrNames.hasOwnProperty(attrName)) {
      //check for duplicate attribute.
      attrNames[attrName] = 1;
    } else {
      return getErrorObject('InvalidAttr', "Attribute '"+attrName+"' is repeated.", getPositionFromMatch(matches[i]));
    }
  }

  return true;
}

function validateNumberAmpersand(xmlData, i) {
  let re = /\d/;
  if (xmlData[i] === 'x') {
    i++;
    re = /[\da-fA-F]/;
  }
  for (; i < xmlData.length; i++) {
    if (xmlData[i] === ';')
      return i;
    if (!xmlData[i].match(re))
      break;
  }
  return -1;
}

function validateAmpersand(xmlData, i) {
  // https://www.w3.org/TR/xml/#dt-charref
  i++;
  if (xmlData[i] === ';')
    return -1;
  if (xmlData[i] === '#') {
    i++;
    return validateNumberAmpersand(xmlData, i);
  }
  let count = 0;
  for (; i < xmlData.length; i++, count++) {
    if (xmlData[i].match(/\w/) && count < 20)
      continue;
    if (xmlData[i] === ';')
      break;
    return -1;
  }
  return i;
}

function getErrorObject(code, message, lineNumber) {
  return {
    err: {
      code: code,
      msg: message,
      line: lineNumber.line || lineNumber,
      col: lineNumber.col,
    },
  };
}

function validateAttrName(attrName) {
  return util.isName(attrName);
}

// const startsWithXML = /^xml/i;

function validateTagName(tagname) {
  return util.isName(tagname) /* && !tagname.match(startsWithXML) */;
}

//this function returns the line number for the character at the given index
function getLineNumberForPosition(xmlData, index) {
  const lines = xmlData.substring(0, index).split(/\r?\n/);
  return {
    line: lines.length,

    // column number is last line's length + 1, because column numbering starts at 1:
    col: lines[lines.length - 1].length + 1
  };
}

//this function returns the position of the first character of match within attrStr
function getPositionFromMatch(match) {
  return match.startIndex + match[1].length;
}


/***/ }),

/***/ 2863:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";

//parse Empty Node as self closing node
const buildFromOrderedJs = __webpack_require__(3977);

const defaultOptions = {
  attributeNamePrefix: '@_',
  attributesGroupName: false,
  textNodeName: '#text',
  ignoreAttributes: true,
  cdataPropName: false,
  format: false,
  indentBy: '  ',
  suppressEmptyNode: false,
  suppressUnpairedNode: true,
  suppressBooleanAttributes: true,
  tagValueProcessor: function(key, a) {
    return a;
  },
  attributeValueProcessor: function(attrName, a) {
    return a;
  },
  preserveOrder: false,
  commentPropName: false,
  unpairedTags: [],
  entities: [
    { regex: new RegExp("&", "g"), val: "&amp;" },//it must be on top
    { regex: new RegExp(">", "g"), val: "&gt;" },
    { regex: new RegExp("<", "g"), val: "&lt;" },
    { regex: new RegExp("\'", "g"), val: "&apos;" },
    { regex: new RegExp("\"", "g"), val: "&quot;" }
  ],
  processEntities: true,
  stopNodes: [],
  // transformTagName: false,
  // transformAttributeName: false,
  oneListGroup: false
};

function Builder(options) {
  this.options = Object.assign({}, defaultOptions, options);
  if (this.options.ignoreAttributes || this.options.attributesGroupName) {
    this.isAttribute = function(/*a*/) {
      return false;
    };
  } else {
    this.attrPrefixLen = this.options.attributeNamePrefix.length;
    this.isAttribute = isAttribute;
  }

  this.processTextOrObjNode = processTextOrObjNode

  if (this.options.format) {
    this.indentate = indentate;
    this.tagEndChar = '>\n';
    this.newLine = '\n';
  } else {
    this.indentate = function() {
      return '';
    };
    this.tagEndChar = '>';
    this.newLine = '';
  }
}

Builder.prototype.build = function(jObj) {
  if(this.options.preserveOrder){
    return buildFromOrderedJs(jObj, this.options);
  }else {
    if(Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1){
      jObj = {
        [this.options.arrayNodeName] : jObj
      }
    }
    return this.j2x(jObj, 0).val;
  }
};

Builder.prototype.j2x = function(jObj, level) {
  let attrStr = '';
  let val = '';
  for (let key in jObj) {
    if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
    if (typeof jObj[key] === 'undefined') {
      // supress undefined node only if it is not an attribute
      if (this.isAttribute(key)) {
        val += '';
      }
    } else if (jObj[key] === null) {
      // null attribute should be ignored by the attribute list, but should not cause the tag closing
      if (this.isAttribute(key)) {
        val += '';
      } else if (key[0] === '?') {
        val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;
      } else {
        val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
      }
      // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
    } else if (jObj[key] instanceof Date) {
      val += this.buildTextValNode(jObj[key], key, '', level);
    } else if (typeof jObj[key] !== 'object') {
      //premitive type
      const attr = this.isAttribute(key);
      if (attr) {
        attrStr += this.buildAttrPairStr(attr, '' + jObj[key]);
      }else {
        //tag value
        if (key === this.options.textNodeName) {
          let newval = this.options.tagValueProcessor(key, '' + jObj[key]);
          val += this.replaceEntitiesValue(newval);
        } else {
          val += this.buildTextValNode(jObj[key], key, '', level);
        }
      }
    } else if (Array.isArray(jObj[key])) {
      //repeated nodes
      const arrLen = jObj[key].length;
      let listTagVal = "";
      let listTagAttr = "";
      for (let j = 0; j < arrLen; j++) {
        const item = jObj[key][j];
        if (typeof item === 'undefined') {
          // supress undefined node
        } else if (item === null) {
          if(key[0] === "?") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;
          else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
          // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
        } else if (typeof item === 'object') {
          if(this.options.oneListGroup){
            const result = this.j2x(item, level + 1);
            listTagVal += result.val;
            if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) {
              listTagAttr += result.attrStr
            }
          }else{
            listTagVal += this.processTextOrObjNode(item, key, level)
          }
        } else {
          if (this.options.oneListGroup) {
            let textValue = this.options.tagValueProcessor(key, item);
            textValue = this.replaceEntitiesValue(textValue);
            listTagVal += textValue;
          } else {
            listTagVal += this.buildTextValNode(item, key, '', level);
          }
        }
      }
      if(this.options.oneListGroup){
        listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level);
      }
      val += listTagVal;
    } else {
      //nested node
      if (this.options.attributesGroupName && key === this.options.attributesGroupName) {
        const Ks = Object.keys(jObj[key]);
        const L = Ks.length;
        for (let j = 0; j < L; j++) {
          attrStr += this.buildAttrPairStr(Ks[j], '' + jObj[key][Ks[j]]);
        }
      } else {
        val += this.processTextOrObjNode(jObj[key], key, level)
      }
    }
  }
  return {attrStr: attrStr, val: val};
};

Builder.prototype.buildAttrPairStr = function(attrName, val){
  val = this.options.attributeValueProcessor(attrName, '' + val);
  val = this.replaceEntitiesValue(val);
  if (this.options.suppressBooleanAttributes && val === "true") {
    return ' ' + attrName;
  } else return ' ' + attrName + '="' + val + '"';
}

function processTextOrObjNode (object, key, level) {
  const result = this.j2x(object, level + 1);
  if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {
    return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level);
  } else {
    return this.buildObjectNode(result.val, key, result.attrStr, level);
  }
}

Builder.prototype.buildObjectNode = function(val, key, attrStr, level) {
  if(val === ""){
    if(key[0] === "?") return  this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
    else {
      return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;
    }
  }else{

    let tagEndExp = '</' + key + this.tagEndChar;
    let piClosingChar = "";
    
    if(key[0] === "?") {
      piClosingChar = "?";
      tagEndExp = "";
    }
  
    // attrStr is an empty string in case the attribute came as undefined or null
    if ((attrStr || attrStr === '') && val.indexOf('<') === -1) {
      return ( this.indentate(level) + '<' +  key + attrStr + piClosingChar + '>' + val + tagEndExp );
    } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) {
      return this.indentate(level) + `<!--${val}-->` + this.newLine;
    }else {
      return (
        this.indentate(level) + '<' + key + attrStr + piClosingChar + this.tagEndChar +
        val +
        this.indentate(level) + tagEndExp    );
    }
  }
}

Builder.prototype.closeTag = function(key){
  let closeTag = "";
  if(this.options.unpairedTags.indexOf(key) !== -1){ //unpaired
    if(!this.options.suppressUnpairedNode) closeTag = "/"
  }else if(this.options.suppressEmptyNode){ //empty
    closeTag = "/";
  }else{
    closeTag = `></${key}`
  }
  return closeTag;
}

function buildEmptyObjNode(val, key, attrStr, level) {
  if (val !== '') {
    return this.buildObjectNode(val, key, attrStr, level);
  } else {
    if(key[0] === "?") return  this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;
    else {
      return  this.indentate(level) + '<' + key + attrStr + '/' + this.tagEndChar;
      // return this.buildTagStr(level,key, attrStr);
    }
  }
}

Builder.prototype.buildTextValNode = function(val, key, attrStr, level) {
  if (this.options.cdataPropName !== false && key === this.options.cdataPropName) {
    return this.indentate(level) + `<![CDATA[${val}]]>` +  this.newLine;
  }else if (this.options.commentPropName !== false && key === this.options.commentPropName) {
    return this.indentate(level) + `<!--${val}-->` +  this.newLine;
  }else if(key[0] === "?") {//PI tag
    return  this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; 
  }else{
    let textValue = this.options.tagValueProcessor(key, val);
    textValue = this.replaceEntitiesValue(textValue);
  
    if( textValue === ''){
      return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;
    }else{
      return this.indentate(level) + '<' + key + attrStr + '>' +
         textValue +
        '</' + key + this.tagEndChar;
    }
  }
}

Builder.prototype.replaceEntitiesValue = function(textValue){
  if(textValue && textValue.length > 0 && this.options.processEntities){
    for (let i=0; i<this.options.entities.length; i++) {
      const entity = this.options.entities[i];
      textValue = textValue.replace(entity.regex, entity.val);
    }
  }
  return textValue;
}

function indentate(level) {
  return this.options.indentBy.repeat(level);
}

function isAttribute(name /*, options*/) {
  if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) {
    return name.substr(this.attrPrefixLen);
  } else {
    return false;
  }
}

module.exports = Builder;


/***/ }),

/***/ 3977:
/***/ (function(module) {

const EOL = "\n";

/**
 * 
 * @param {array} jArray 
 * @param {any} options 
 * @returns 
 */
function toXml(jArray, options) {
    let indentation = "";
    if (options.format && options.indentBy.length > 0) {
        indentation = EOL;
    }
    return arrToStr(jArray, options, "", indentation);
}

function arrToStr(arr, options, jPath, indentation) {
    let xmlStr = "";
    let isPreviousElementTag = false;

    for (let i = 0; i < arr.length; i++) {
        const tagObj = arr[i];
        const tagName = propName(tagObj);
        if(tagName === undefined) continue;

        let newJPath = "";
        if (jPath.length === 0) newJPath = tagName
        else newJPath = `${jPath}.${tagName}`;

        if (tagName === options.textNodeName) {
            let tagText = tagObj[tagName];
            if (!isStopNode(newJPath, options)) {
                tagText = options.tagValueProcessor(tagName, tagText);
                tagText = replaceEntitiesValue(tagText, options);
            }
            if (isPreviousElementTag) {
                xmlStr += indentation;
            }
            xmlStr += tagText;
            isPreviousElementTag = false;
            continue;
        } else if (tagName === options.cdataPropName) {
            if (isPreviousElementTag) {
                xmlStr += indentation;
            }
            xmlStr += `<![CDATA[${tagObj[tagName][0][options.textNodeName]}]]>`;
            isPreviousElementTag = false;
            continue;
        } else if (tagName === options.commentPropName) {
            xmlStr += indentation + `<!--${tagObj[tagName][0][options.textNodeName]}-->`;
            isPreviousElementTag = true;
            continue;
        } else if (tagName[0] === "?") {
            const attStr = attr_to_str(tagObj[":@"], options);
            const tempInd = tagName === "?xml" ? "" : indentation;
            let piTextNodeName = tagObj[tagName][0][options.textNodeName];
            piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; //remove extra spacing
            xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr}?>`;
            isPreviousElementTag = true;
            continue;
        }
        let newIdentation = indentation;
        if (newIdentation !== "") {
            newIdentation += options.indentBy;
        }
        const attStr = attr_to_str(tagObj[":@"], options);
        const tagStart = indentation + `<${tagName}${attStr}`;
        const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation);
        if (options.unpairedTags.indexOf(tagName) !== -1) {
            if (options.suppressUnpairedNode) xmlStr += tagStart + ">";
            else xmlStr += tagStart + "/>";
        } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) {
            xmlStr += tagStart + "/>";
        } else if (tagValue && tagValue.endsWith(">")) {
            xmlStr += tagStart + `>${tagValue}${indentation}</${tagName}>`;
        } else {
            xmlStr += tagStart + ">";
            if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("</"))) {
                xmlStr += indentation + options.indentBy + tagValue + indentation;
            } else {
                xmlStr += tagValue;
            }
            xmlStr += `</${tagName}>`;
        }
        isPreviousElementTag = true;
    }

    return xmlStr;
}

function propName(obj) {
    const keys = Object.keys(obj);
    for (let i = 0; i < keys.length; i++) {
        const key = keys[i];
        if(!obj.hasOwnProperty(key)) continue;
        if (key !== ":@") return key;
    }
}

function attr_to_str(attrMap, options) {
    let attrStr = "";
    if (attrMap && !options.ignoreAttributes) {
        for (let attr in attrMap) {
            if(!attrMap.hasOwnProperty(attr)) continue;
            let attrVal = options.attributeValueProcessor(attr, attrMap[attr]);
            attrVal = replaceEntitiesValue(attrVal, options);
            if (attrVal === true && options.suppressBooleanAttributes) {
                attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`;
            } else {
                attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`;
            }
        }
    }
    return attrStr;
}

function isStopNode(jPath, options) {
    jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1);
    let tagName = jPath.substr(jPath.lastIndexOf(".") + 1);
    for (let index in options.stopNodes) {
        if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true;
    }
    return false;
}

function replaceEntitiesValue(textValue, options) {
    if (textValue && textValue.length > 0 && options.processEntities) {
        for (let i = 0; i < options.entities.length; i++) {
            const entity = options.entities[i];
            textValue = textValue.replace(entity.regex, entity.val);
        }
    }
    return textValue;
}
module.exports = toXml;


/***/ }),

/***/ 6755:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

const util = __webpack_require__(9055);

//TODO: handle comments
function readDocType(xmlData, i){
    
    const entities = {};
    if( xmlData[i + 3] === 'O' &&
         xmlData[i + 4] === 'C' &&
         xmlData[i + 5] === 'T' &&
         xmlData[i + 6] === 'Y' &&
         xmlData[i + 7] === 'P' &&
         xmlData[i + 8] === 'E')
    {    
        i = i+9;
        let angleBracketsCount = 1;
        let hasBody = false, comment = false;
        let exp = "";
        for(;i<xmlData.length;i++){
            if (xmlData[i] === '<' && !comment) { //Determine the tag type
                if( hasBody && isEntity(xmlData, i)){
                    i += 7; 
                    [entityName, val,i] = readEntityExp(xmlData,i+1);
                    if(val.indexOf("&") === -1) //Parameter entities are not supported
                        entities[ validateEntityName(entityName) ] = {
                            regx : RegExp( `&${entityName};`,"g"),
                            val: val
                        };
                }
                else if( hasBody && isElement(xmlData, i))  i += 8;//Not supported
                else if( hasBody && isAttlist(xmlData, i))  i += 8;//Not supported
                else if( hasBody && isNotation(xmlData, i)) i += 9;//Not supported
                else if( isComment)                         comment = true;
                else                                        throw new Error("Invalid DOCTYPE");

                angleBracketsCount++;
                exp = "";
            } else if (xmlData[i] === '>') { //Read tag content
                if(comment){
                    if( xmlData[i - 1] === "-" && xmlData[i - 2] === "-"){
                        comment = false;
                        angleBracketsCount--;
                    }
                }else{
                    angleBracketsCount--;
                }
                if (angleBracketsCount === 0) {
                  break;
                }
            }else if( xmlData[i] === '['){
                hasBody = true;
            }else{
                exp += xmlData[i];
            }
        }
        if(angleBracketsCount !== 0){
            throw new Error(`Unclosed DOCTYPE`);
        }
    }else{
        throw new Error(`Invalid Tag instead of DOCTYPE`);
    }
    return {entities, i};
}

function readEntityExp(xmlData,i){
    //External entities are not supported
    //    <!ENTITY ext SYSTEM "http://normal-website.com" >

    //Parameter entities are not supported
    //    <!ENTITY entityname "&anotherElement;">

    //Internal entities are supported
    //    <!ENTITY entityname "replacement text">
    
    //read EntityName
    let entityName = "";
    for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"' ); i++) {
        // if(xmlData[i] === " ") continue;
        // else 
        entityName += xmlData[i];
    }
    entityName = entityName.trim();
    if(entityName.indexOf(" ") !== -1) throw new Error("External entites are not supported");

    //read Entity Value
    const startChar = xmlData[i++];
    let val = ""
    for (; i < xmlData.length && xmlData[i] !== startChar ; i++) {
        val += xmlData[i];
    }
    return [entityName, val, i];
}

function isComment(xmlData, i){
    if(xmlData[i+1] === '!' &&
    xmlData[i+2] === '-' &&
    xmlData[i+3] === '-') return true
    return false
}
function isEntity(xmlData, i){
    if(xmlData[i+1] === '!' &&
    xmlData[i+2] === 'E' &&
    xmlData[i+3] === 'N' &&
    xmlData[i+4] === 'T' &&
    xmlData[i+5] === 'I' &&
    xmlData[i+6] === 'T' &&
    xmlData[i+7] === 'Y') return true
    return false
}
function isElement(xmlData, i){
    if(xmlData[i+1] === '!' &&
    xmlData[i+2] === 'E' &&
    xmlData[i+3] === 'L' &&
    xmlData[i+4] === 'E' &&
    xmlData[i+5] === 'M' &&
    xmlData[i+6] === 'E' &&
    xmlData[i+7] === 'N' &&
    xmlData[i+8] === 'T') return true
    return false
}

function isAttlist(xmlData, i){
    if(xmlData[i+1] === '!' &&
    xmlData[i+2] === 'A' &&
    xmlData[i+3] === 'T' &&
    xmlData[i+4] === 'T' &&
    xmlData[i+5] === 'L' &&
    xmlData[i+6] === 'I' &&
    xmlData[i+7] === 'S' &&
    xmlData[i+8] === 'T') return true
    return false
}
function isNotation(xmlData, i){
    if(xmlData[i+1] === '!' &&
    xmlData[i+2] === 'N' &&
    xmlData[i+3] === 'O' &&
    xmlData[i+4] === 'T' &&
    xmlData[i+5] === 'A' &&
    xmlData[i+6] === 'T' &&
    xmlData[i+7] === 'I' &&
    xmlData[i+8] === 'O' &&
    xmlData[i+9] === 'N') return true
    return false
}

function validateEntityName(name){
    if (util.isName(name))
	return name;
    else
        throw new Error(`Invalid entity name ${name}`);
}

module.exports = readDocType;


/***/ }),

/***/ 7773:
/***/ (function(__unused_webpack_module, exports) {


const defaultOptions = {
    preserveOrder: false,
    attributeNamePrefix: '@_',
    attributesGroupName: false,
    textNodeName: '#text',
    ignoreAttributes: true,
    removeNSPrefix: false, // remove NS from tag name or attribute name if true
    allowBooleanAttributes: false, //a tag can have attributes without any value
    //ignoreRootElement : false,
    parseTagValue: true,
    parseAttributeValue: false,
    trimValues: true, //Trim string values of tag and attributes
    cdataPropName: false,
    numberParseOptions: {
      hex: true,
      leadingZeros: true,
      eNotation: true
    },
    tagValueProcessor: function(tagName, val) {
      return val;
    },
    attributeValueProcessor: function(attrName, val) {
      return val;
    },
    stopNodes: [], //nested tags will not be parsed even for errors
    alwaysCreateTextNode: false,
    isArray: () => false,
    commentPropName: false,
    unpairedTags: [],
    processEntities: true,
    htmlEntities: false,
    ignoreDeclaration: false,
    ignorePiTags: false,
    transformTagName: false,
    transformAttributeName: false,
    updateTag: function(tagName, jPath, attrs){
      return tagName
    },
    // skipEmptyListItem: false
};
   
const buildOptions = function(options) {
    return Object.assign({}, defaultOptions, options);
};

exports.buildOptions = buildOptions;
exports.defaultOptions = defaultOptions;

/***/ }),

/***/ 3949:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";

///@ts-check

const util = __webpack_require__(9055);
const xmlNode = __webpack_require__(9935);
const readDocType = __webpack_require__(6755);
const toNumber = __webpack_require__(9620);

// const regx =
//   '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)'
//   .replace(/NAME/g, util.nameRegexp);

//const tagsRegx = new RegExp("<(\\/?[\\w:\\-\._]+)([^>]*)>(\\s*"+cdataRegx+")*([^<]+)?","g");
//const tagsRegx = new RegExp("<(\\/?)((\\w*:)?([\\w:\\-\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g");

class OrderedObjParser{
  constructor(options){
    this.options = options;
    this.currentNode = null;
    this.tagsNodeStack = [];
    this.docTypeEntities = {};
    this.lastEntities = {
      "apos" : { regex: /&(apos|#39|#x27);/g, val : "'"},
      "gt" : { regex: /&(gt|#62|#x3E);/g, val : ">"},
      "lt" : { regex: /&(lt|#60|#x3C);/g, val : "<"},
      "quot" : { regex: /&(quot|#34|#x22);/g, val : "\""},
    };
    this.ampEntity = { regex: /&(amp|#38|#x26);/g, val : "&"};
    this.htmlEntities = {
      "space": { regex: /&(nbsp|#160);/g, val: " " },
      // "lt" : { regex: /&(lt|#60);/g, val: "<" },
      // "gt" : { regex: /&(gt|#62);/g, val: ">" },
      // "amp" : { regex: /&(amp|#38);/g, val: "&" },
      // "quot" : { regex: /&(quot|#34);/g, val: "\"" },
      // "apos" : { regex: /&(apos|#39);/g, val: "'" },
      "cent" : { regex: /&(cent|#162);/g, val: "¢" },
      "pound" : { regex: /&(pound|#163);/g, val: "£" },
      "yen" : { regex: /&(yen|#165);/g, val: "¥" },
      "euro" : { regex: /&(euro|#8364);/g, val: "€" },
      "copyright" : { regex: /&(copy|#169);/g, val: "©" },
      "reg" : { regex: /&(reg|#174);/g, val: "®" },
      "inr" : { regex: /&(inr|#8377);/g, val: "₹" },
      "num_dec": { regex: /&#([0-9]{1,7});/g, val : (_, str) => String.fromCharCode(Number.parseInt(str, 10)) },
      "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val : (_, str) => String.fromCharCode(Number.parseInt(str, 16)) },
    };
    this.addExternalEntities = addExternalEntities;
    this.parseXml = parseXml;
    this.parseTextData = parseTextData;
    this.resolveNameSpace = resolveNameSpace;
    this.buildAttributesMap = buildAttributesMap;
    this.isItStopNode = isItStopNode;
    this.replaceEntitiesValue = replaceEntitiesValue;
    this.readStopNodeData = readStopNodeData;
    this.saveTextToParentTag = saveTextToParentTag;
    this.addChild = addChild;
  }

}

function addExternalEntities(externalEntities){
  const entKeys = Object.keys(externalEntities);
  for (let i = 0; i < entKeys.length; i++) {
    const ent = entKeys[i];
    this.lastEntities[ent] = {
       regex: new RegExp("&"+ent+";","g"),
       val : externalEntities[ent]
    }
  }
}

/**
 * @param {string} val
 * @param {string} tagName
 * @param {string} jPath
 * @param {boolean} dontTrim
 * @param {boolean} hasAttributes
 * @param {boolean} isLeafNode
 * @param {boolean} escapeEntities
 */
function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {
  if (val !== undefined) {
    if (this.options.trimValues && !dontTrim) {
      val = val.trim();
    }
    if(val.length > 0){
      if(!escapeEntities) val = this.replaceEntitiesValue(val);
      
      const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode);
      if(newval === null || newval === undefined){
        //don't parse
        return val;
      }else if(typeof newval !== typeof val || newval !== val){
        //overwrite
        return newval;
      }else if(this.options.trimValues){
        return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);
      }else{
        const trimmedVal = val.trim();
        if(trimmedVal === val){
          return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);
        }else{
          return val;
        }
      }
    }
  }
}

function resolveNameSpace(tagname) {
  if (this.options.removeNSPrefix) {
    const tags = tagname.split(':');
    const prefix = tagname.charAt(0) === '/' ? '/' : '';
    if (tags[0] === 'xmlns') {
      return '';
    }
    if (tags.length === 2) {
      tagname = prefix + tags[1];
    }
  }
  return tagname;
}

//TODO: change regex to capture NS
//const attrsRegx = new RegExp("([\\w\\-\\.\\:]+)\\s*=\\s*(['\"])((.|\n)*?)\\2","gm");
const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');

function buildAttributesMap(attrStr, jPath, tagName) {
  if (!this.options.ignoreAttributes && typeof attrStr === 'string') {
    // attrStr = attrStr.replace(/\r?\n/g, ' ');
    //attrStr = attrStr || attrStr.trim();

    const matches = util.getAllMatches(attrStr, attrsRegx);
    const len = matches.length; //don't make it inline
    const attrs = {};
    for (let i = 0; i < len; i++) {
      const attrName = this.resolveNameSpace(matches[i][1]);
      let oldVal = matches[i][4];
      let aName = this.options.attributeNamePrefix + attrName;
      if (attrName.length) {
        if (this.options.transformAttributeName) {
          aName = this.options.transformAttributeName(aName);
        }
        if(aName === "__proto__") aName  = "#__proto__";
        if (oldVal !== undefined) {
          if (this.options.trimValues) {
            oldVal = oldVal.trim();
          }
          oldVal = this.replaceEntitiesValue(oldVal);
          const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);
          if(newVal === null || newVal === undefined){
            //don't parse
            attrs[aName] = oldVal;
          }else if(typeof newVal !== typeof oldVal || newVal !== oldVal){
            //overwrite
            attrs[aName] = newVal;
          }else{
            //parse
            attrs[aName] = parseValue(
              oldVal,
              this.options.parseAttributeValue,
              this.options.numberParseOptions
            );
          }
        } else if (this.options.allowBooleanAttributes) {
          attrs[aName] = true;
        }
      }
    }
    if (!Object.keys(attrs).length) {
      return;
    }
    if (this.options.attributesGroupName) {
      const attrCollection = {};
      attrCollection[this.options.attributesGroupName] = attrs;
      return attrCollection;
    }
    return attrs
  }
}

const parseXml = function(xmlData) {
  xmlData = xmlData.replace(/\r\n?/g, "\n"); //TODO: remove this line
  const xmlObj = new xmlNode('!xml');
  let currentNode = xmlObj;
  let textData = "";
  let jPath = "";
  for(let i=0; i< xmlData.length; i++){//for each char in XML data
    const ch = xmlData[i];
    if(ch === '<'){
      // const nextIndex = i+1;
      // const _2ndChar = xmlData[nextIndex];
      if( xmlData[i+1] === '/') {//Closing Tag
        const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed.")
        let tagName = xmlData.substring(i+2,closeIndex).trim();

        if(this.options.removeNSPrefix){
          const colonIndex = tagName.indexOf(":");
          if(colonIndex !== -1){
            tagName = tagName.substr(colonIndex+1);
          }
        }

        if(this.options.transformTagName) {
          tagName = this.options.transformTagName(tagName);
        }

        if(currentNode){
          textData = this.saveTextToParentTag(textData, currentNode, jPath);
        }

        //check if last tag of nested tag was unpaired tag
        const lastTagName = jPath.substring(jPath.lastIndexOf(".")+1);
        if(tagName && this.options.unpairedTags.indexOf(tagName) !== -1 ){
          throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);
        }
        let propIndex = 0
        if(lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1 ){
          propIndex = jPath.lastIndexOf('.', jPath.lastIndexOf('.')-1)
          this.tagsNodeStack.pop();
        }else{
          propIndex = jPath.lastIndexOf(".");
        }
        jPath = jPath.substring(0, propIndex);

        currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope
        textData = "";
        i = closeIndex;
      } else if( xmlData[i+1] === '?') {

        let tagData = readTagExp(xmlData,i, false, "?>");
        if(!tagData) throw new Error("Pi Tag is not closed.");

        textData = this.saveTextToParentTag(textData, currentNode, jPath);
        if( (this.options.ignoreDeclaration && tagData.tagName === "?xml") || this.options.ignorePiTags){

        }else{
  
          const childNode = new xmlNode(tagData.tagName);
          childNode.add(this.options.textNodeName, "");
          
          if(tagData.tagName !== tagData.tagExp && tagData.attrExpPresent){
            childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName);
          }
          this.addChild(currentNode, childNode, jPath)

        }


        i = tagData.closeIndex + 1;
      } else if(xmlData.substr(i + 1, 3) === '!--') {
        const endIndex = findClosingIndex(xmlData, "-->", i+4, "Comment is not closed.")
        if(this.options.commentPropName){
          const comment = xmlData.substring(i + 4, endIndex - 2);

          textData = this.saveTextToParentTag(textData, currentNode, jPath);

          currentNode.add(this.options.commentPropName, [ { [this.options.textNodeName] : comment } ]);
        }
        i = endIndex;
      } else if( xmlData.substr(i + 1, 2) === '!D') {
        const result = readDocType(xmlData, i);
        this.docTypeEntities = result.entities;
        i = result.i;
      }else if(xmlData.substr(i + 1, 2) === '![') {
        const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2;
        const tagExp = xmlData.substring(i + 9,closeIndex);

        textData = this.saveTextToParentTag(textData, currentNode, jPath);

        let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true);
        if(val == undefined) val = "";

        //cdata should be set even if it is 0 length string
        if(this.options.cdataPropName){
          currentNode.add(this.options.cdataPropName, [ { [this.options.textNodeName] : tagExp } ]);
        }else{
          currentNode.add(this.options.textNodeName, val);
        }
        
        i = closeIndex + 2;
      }else {//Opening tag
        let result = readTagExp(xmlData,i, this.options.removeNSPrefix);
        let tagName= result.tagName;
        const rawTagName = result.rawTagName;
        let tagExp = result.tagExp;
        let attrExpPresent = result.attrExpPresent;
        let closeIndex = result.closeIndex;

        if (this.options.transformTagName) {
          tagName = this.options.transformTagName(tagName);
        }
        
        //save text as child node
        if (currentNode && textData) {
          if(currentNode.tagname !== '!xml'){
            //when nested tag is found
            textData = this.saveTextToParentTag(textData, currentNode, jPath, false);
          }
        }

        //check if last tag was unpaired tag
        const lastTag = currentNode;
        if(lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1 ){
          currentNode = this.tagsNodeStack.pop();
          jPath = jPath.substring(0, jPath.lastIndexOf("."));
        }
        if(tagName !== xmlObj.tagname){
          jPath += jPath ? "." + tagName : tagName;
        }
        if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) {
          let tagContent = "";
          //self-closing tag
          if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){
            if(tagName[tagName.length - 1] === "/"){ //remove trailing '/'
              tagName = tagName.substr(0, tagName.length - 1);
              jPath = jPath.substr(0, jPath.length - 1);
              tagExp = tagName;
            }else{
              tagExp = tagExp.substr(0, tagExp.length - 1);
            }
            i = result.closeIndex;
          }
          //unpaired tag
          else if(this.options.unpairedTags.indexOf(tagName) !== -1){
            
            i = result.closeIndex;
          }
          //normal tag
          else{
            //read until closing tag is found
            const result = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);
            if(!result) throw new Error(`Unexpected end of ${rawTagName}`);
            i = result.i;
            tagContent = result.tagContent;
          }

          const childNode = new xmlNode(tagName);
          if(tagName !== tagExp && attrExpPresent){
            childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
          }
          if(tagContent) {
            tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);
          }
          
          jPath = jPath.substr(0, jPath.lastIndexOf("."));
          childNode.add(this.options.textNodeName, tagContent);
          
          this.addChild(currentNode, childNode, jPath)
        }else{
  //selfClosing tag
          if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){
            if(tagName[tagName.length - 1] === "/"){ //remove trailing '/'
              tagName = tagName.substr(0, tagName.length - 1);
              jPath = jPath.substr(0, jPath.length - 1);
              tagExp = tagName;
            }else{
              tagExp = tagExp.substr(0, tagExp.length - 1);
            }
            
            if(this.options.transformTagName) {
              tagName = this.options.transformTagName(tagName);
            }

            const childNode = new xmlNode(tagName);
            if(tagName !== tagExp && attrExpPresent){
              childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
            }
            this.addChild(currentNode, childNode, jPath)
            jPath = jPath.substr(0, jPath.lastIndexOf("."));
          }
    //opening tag
          else{
            const childNode = new xmlNode( tagName);
            this.tagsNodeStack.push(currentNode);
            
            if(tagName !== tagExp && attrExpPresent){
              childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
            }
            this.addChild(currentNode, childNode, jPath)
            currentNode = childNode;
          }
          textData = "";
          i = closeIndex;
        }
      }
    }else{
      textData += xmlData[i];
    }
  }
  return xmlObj.child;
}

function addChild(currentNode, childNode, jPath){
  const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"])
  if(result === false){
  }else if(typeof result === "string"){
    childNode.tagname = result
    currentNode.addChild(childNode);
  }else{
    currentNode.addChild(childNode);
  }
}

const replaceEntitiesValue = function(val){

  if(this.options.processEntities){
    for(let entityName in this.docTypeEntities){
      const entity = this.docTypeEntities[entityName];
      val = val.replace( entity.regx, entity.val);
    }
    for(let entityName in this.lastEntities){
      const entity = this.lastEntities[entityName];
      val = val.replace( entity.regex, entity.val);
    }
    if(this.options.htmlEntities){
      for(let entityName in this.htmlEntities){
        const entity = this.htmlEntities[entityName];
        val = val.replace( entity.regex, entity.val);
      }
    }
    val = val.replace( this.ampEntity.regex, this.ampEntity.val);
  }
  return val;
}
function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {
  if (textData) { //store previously collected data as textNode
    if(isLeafNode === undefined) isLeafNode = Object.keys(currentNode.child).length === 0
    
    textData = this.parseTextData(textData,
      currentNode.tagname,
      jPath,
      false,
      currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false,
      isLeafNode);

    if (textData !== undefined && textData !== "")
      currentNode.add(this.options.textNodeName, textData);
    textData = "";
  }
  return textData;
}

//TODO: use jPath to simplify the logic
/**
 * 
 * @param {string[]} stopNodes 
 * @param {string} jPath
 * @param {string} currentTagName 
 */
function isItStopNode(stopNodes, jPath, currentTagName){
  const allNodesExp = "*." + currentTagName;
  for (const stopNodePath in stopNodes) {
    const stopNodeExp = stopNodes[stopNodePath];
    if( allNodesExp === stopNodeExp || jPath === stopNodeExp  ) return true;
  }
  return false;
}

/**
 * Returns the tag Expression and where it is ending handling single-double quotes situation
 * @param {string} xmlData 
 * @param {number} i starting index
 * @returns 
 */
function tagExpWithClosingIndex(xmlData, i, closingChar = ">"){
  let attrBoundary;
  let tagExp = "";
  for (let index = i; index < xmlData.length; index++) {
    let ch = xmlData[index];
    if (attrBoundary) {
        if (ch === attrBoundary) attrBoundary = "";//reset
    } else if (ch === '"' || ch === "'") {
        attrBoundary = ch;
    } else if (ch === closingChar[0]) {
      if(closingChar[1]){
        if(xmlData[index + 1] === closingChar[1]){
          return {
            data: tagExp,
            index: index
          }
        }
      }else{
        return {
          data: tagExp,
          index: index
        }
      }
    } else if (ch === '\t') {
      ch = " "
    }
    tagExp += ch;
  }
}

function findClosingIndex(xmlData, str, i, errMsg){
  const closingIndex = xmlData.indexOf(str, i);
  if(closingIndex === -1){
    throw new Error(errMsg)
  }else{
    return closingIndex + str.length - 1;
  }
}

function readTagExp(xmlData,i, removeNSPrefix, closingChar = ">"){
  const result = tagExpWithClosingIndex(xmlData, i+1, closingChar);
  if(!result) return;
  let tagExp = result.data;
  const closeIndex = result.index;
  const separatorIndex = tagExp.search(/\s/);
  let tagName = tagExp;
  let attrExpPresent = true;
  if(separatorIndex !== -1){//separate tag name and attributes expression
    tagName = tagExp.substring(0, separatorIndex);
    tagExp = tagExp.substring(separatorIndex + 1).trimStart();
  }

  const rawTagName = tagName;
  if(removeNSPrefix){
    const colonIndex = tagName.indexOf(":");
    if(colonIndex !== -1){
      tagName = tagName.substr(colonIndex+1);
      attrExpPresent = tagName !== result.data.substr(colonIndex + 1);
    }
  }

  return {
    tagName: tagName,
    tagExp: tagExp,
    closeIndex: closeIndex,
    attrExpPresent: attrExpPresent,
    rawTagName: rawTagName,
  }
}
/**
 * find paired tag for a stop node
 * @param {string} xmlData 
 * @param {string} tagName 
 * @param {number} i 
 */
function readStopNodeData(xmlData, tagName, i){
  const startIndex = i;
  // Starting at 1 since we already have an open tag
  let openTagCount = 1;

  for (; i < xmlData.length; i++) {
    if( xmlData[i] === "<"){ 
      if (xmlData[i+1] === "/") {//close tag
          const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`);
          let closeTagName = xmlData.substring(i+2,closeIndex).trim();
          if(closeTagName === tagName){
            openTagCount--;
            if (openTagCount === 0) {
              return {
                tagContent: xmlData.substring(startIndex, i),
                i : closeIndex
              }
            }
          }
          i=closeIndex;
        } else if(xmlData[i+1] === '?') { 
          const closeIndex = findClosingIndex(xmlData, "?>", i+1, "StopNode is not closed.")
          i=closeIndex;
        } else if(xmlData.substr(i + 1, 3) === '!--') { 
          const closeIndex = findClosingIndex(xmlData, "-->", i+3, "StopNode is not closed.")
          i=closeIndex;
        } else if(xmlData.substr(i + 1, 2) === '![') { 
          const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
          i=closeIndex;
        } else {
          const tagData = readTagExp(xmlData, i, '>')

          if (tagData) {
            const openTagName = tagData && tagData.tagName;
            if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length-1] !== "/") {
              openTagCount++;
            }
            i=tagData.closeIndex;
          }
        }
      }
  }//end for loop
}

function parseValue(val, shouldParse, options) {
  if (shouldParse && typeof val === 'string') {
    //console.log(options)
    const newval = val.trim();
    if(newval === 'true' ) return true;
    else if(newval === 'false' ) return false;
    else return toNumber(val, options);
  } else {
    if (util.isExist(val)) {
      return val;
    } else {
      return '';
    }
  }
}


module.exports = OrderedObjParser;


/***/ }),

/***/ 3856:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

const { buildOptions} = __webpack_require__(7773);
const OrderedObjParser = __webpack_require__(3949);
const { prettify} = __webpack_require__(4366);
const validator = __webpack_require__(8741);

class XMLParser{
    
    constructor(options){
        this.externalEntities = {};
        this.options = buildOptions(options);
        
    }
    /**
     * Parse XML dats to JS object 
     * @param {string|Buffer} xmlData 
     * @param {boolean|Object} validationOption 
     */
    parse(xmlData,validationOption){
        if(typeof xmlData === "string"){
        }else if( xmlData.toString){
            xmlData = xmlData.toString();
        }else{
            throw new Error("XML data is accepted in String or Bytes[] form.")
        }
        if( validationOption){
            if(validationOption === true) validationOption = {}; //validate with default options
            
            const result = validator.validate(xmlData, validationOption);
            if (result !== true) {
              throw Error( `${result.err.msg}:${result.err.line}:${result.err.col}` )
            }
          }
        const orderedObjParser = new OrderedObjParser(this.options);
        orderedObjParser.addExternalEntities(this.externalEntities);
        const orderedResult = orderedObjParser.parseXml(xmlData);
        if(this.options.preserveOrder || orderedResult === undefined) return orderedResult;
        else return prettify(orderedResult, this.options);
    }

    /**
     * Add Entity which is not by default supported by this library
     * @param {string} key 
     * @param {string} value 
     */
    addEntity(key, value){
        if(value.indexOf("&") !== -1){
            throw new Error("Entity value can't have '&'")
        }else if(key.indexOf("&") !== -1 || key.indexOf(";") !== -1){
            throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'")
        }else if(value === "&"){
            throw new Error("An entity with value '&' is not permitted");
        }else{
            this.externalEntities[key] = value;
        }
    }
}

module.exports = XMLParser;

/***/ }),

/***/ 4366:
/***/ (function(__unused_webpack_module, exports) {

"use strict";


/**
 * 
 * @param {array} node 
 * @param {any} options 
 * @returns 
 */
function prettify(node, options){
  return compress( node, options);
}

/**
 * 
 * @param {array} arr 
 * @param {object} options 
 * @param {string} jPath 
 * @returns object
 */
function compress(arr, options, jPath){
  let text;
  const compressedObj = {};
  for (let i = 0; i < arr.length; i++) {
    const tagObj = arr[i];
    const property = propName(tagObj);
    let newJpath = "";
    if(jPath === undefined) newJpath = property;
    else newJpath = jPath + "." + property;

    if(property === options.textNodeName){
      if(text === undefined) text = tagObj[property];
      else text += "" + tagObj[property];
    }else if(property === undefined){
      continue;
    }else if(tagObj[property]){
      
      let val = compress(tagObj[property], options, newJpath);
      const isLeaf = isLeafTag(val, options);

      if(tagObj[":@"]){
        assignAttributes( val, tagObj[":@"], newJpath, options);
      }else if(Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode){
        val = val[options.textNodeName];
      }else if(Object.keys(val).length === 0){
        if(options.alwaysCreateTextNode) val[options.textNodeName] = "";
        else val = "";
      }

      if(compressedObj[property] !== undefined && compressedObj.hasOwnProperty(property)) {
        if(!Array.isArray(compressedObj[property])) {
            compressedObj[property] = [ compressedObj[property] ];
        }
        compressedObj[property].push(val);
      }else{
        //TODO: if a node is not an array, then check if it should be an array
        //also determine if it is a leaf node
        if (options.isArray(property, newJpath, isLeaf )) {
          compressedObj[property] = [val];
        }else{
          compressedObj[property] = val;
        }
      }
    }
    
  }
  // if(text && text.length > 0) compressedObj[options.textNodeName] = text;
  if(typeof text === "string"){
    if(text.length > 0) compressedObj[options.textNodeName] = text;
  }else if(text !== undefined) compressedObj[options.textNodeName] = text;
  return compressedObj;
}

function propName(obj){
  const keys = Object.keys(obj);
  for (let i = 0; i < keys.length; i++) {
    const key = keys[i];
    if(key !== ":@") return key;
  }
}

function assignAttributes(obj, attrMap, jpath, options){
  if (attrMap) {
    const keys = Object.keys(attrMap);
    const len = keys.length; //don't make it inline
    for (let i = 0; i < len; i++) {
      const atrrName = keys[i];
      if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) {
        obj[atrrName] = [ attrMap[atrrName] ];
      } else {
        obj[atrrName] = attrMap[atrrName];
      }
    }
  }
}

function isLeafTag(obj, options){
  const { textNodeName } = options;
  const propCount = Object.keys(obj).length;
  
  if (propCount === 0) {
    return true;
  }

  if (
    propCount === 1 &&
    (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)
  ) {
    return true;
  }

  return false;
}
exports.prettify = prettify;


/***/ }),

/***/ 9935:
/***/ (function(module) {

"use strict";


class XmlNode{
  constructor(tagname) {
    this.tagname = tagname;
    this.child = []; //nested tags, text, cdata, comments in order
    this[":@"] = {}; //attributes map
  }
  add(key,val){
    // this.child.push( {name : key, val: val, isCdata: isCdata });
    if(key === "__proto__") key = "#__proto__";
    this.child.push( {[key]: val });
  }
  addChild(node) {
    if(node.tagname === "__proto__") node.tagname = "#__proto__";
    if(node[":@"] && Object.keys(node[":@"]).length > 0){
      this.child.push( { [node.tagname]: node.child, [":@"]: node[":@"] });
    }else{
      this.child.push( { [node.tagname]: node.child });
    }
  };
};


module.exports = XmlNode;

/***/ }),

/***/ 8535:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var isCallable = __webpack_require__(5575);

var toStr = Object.prototype.toString;
var hasOwnProperty = Object.prototype.hasOwnProperty;

var forEachArray = function forEachArray(array, iterator, receiver) {
    for (var i = 0, len = array.length; i < len; i++) {
        if (hasOwnProperty.call(array, i)) {
            if (receiver == null) {
                iterator(array[i], i, array);
            } else {
                iterator.call(receiver, array[i], i, array);
            }
        }
    }
};

var forEachString = function forEachString(string, iterator, receiver) {
    for (var i = 0, len = string.length; i < len; i++) {
        // no such thing as a sparse string.
        if (receiver == null) {
            iterator(string.charAt(i), i, string);
        } else {
            iterator.call(receiver, string.charAt(i), i, string);
        }
    }
};

var forEachObject = function forEachObject(object, iterator, receiver) {
    for (var k in object) {
        if (hasOwnProperty.call(object, k)) {
            if (receiver == null) {
                iterator(object[k], k, object);
            } else {
                iterator.call(receiver, object[k], k, object);
            }
        }
    }
};

var forEach = function forEach(list, iterator, thisArg) {
    if (!isCallable(iterator)) {
        throw new TypeError('iterator must be a function');
    }

    var receiver;
    if (arguments.length >= 3) {
        receiver = thisArg;
    }

    if (toStr.call(list) === '[object Array]') {
        forEachArray(list, iterator, receiver);
    } else if (typeof list === 'string') {
        forEachString(list, iterator, receiver);
    } else {
        forEachObject(list, iterator, receiver);
    }
};

module.exports = forEach;


/***/ }),

/***/ 362:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var undefined;

var $Error = __webpack_require__(2016);
var $EvalError = __webpack_require__(3780);
var $RangeError = __webpack_require__(7893);
var $ReferenceError = __webpack_require__(6637);
var $SyntaxError = __webpack_require__(5125);
var $TypeError = __webpack_require__(3502);
var $URIError = __webpack_require__(9950);

var $Function = Function;

// eslint-disable-next-line consistent-return
var getEvalledConstructor = function (expressionSyntax) {
	try {
		return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
	} catch (e) {}
};

var $gOPD = Object.getOwnPropertyDescriptor;
if ($gOPD) {
	try {
		$gOPD({}, '');
	} catch (e) {
		$gOPD = null; // this is IE 8, which has a broken gOPD
	}
}

var throwTypeError = function () {
	throw new $TypeError();
};
var ThrowTypeError = $gOPD
	? (function () {
		try {
			// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
			arguments.callee; // IE 8 does not throw here
			return throwTypeError;
		} catch (calleeThrows) {
			try {
				// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
				return $gOPD(arguments, 'callee').get;
			} catch (gOPDthrows) {
				return throwTypeError;
			}
		}
	}())
	: throwTypeError;

var hasSymbols = __webpack_require__(68)();
var hasProto = __webpack_require__(5695)();

var getProto = Object.getPrototypeOf || (
	hasProto
		? function (x) { return x.__proto__; } // eslint-disable-line no-proto
		: null
);

var needsEval = {};

var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);

var INTRINSICS = {
	__proto__: null,
	'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
	'%Array%': Array,
	'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
	'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
	'%AsyncFromSyncIteratorPrototype%': undefined,
	'%AsyncFunction%': needsEval,
	'%AsyncGenerator%': needsEval,
	'%AsyncGeneratorFunction%': needsEval,
	'%AsyncIteratorPrototype%': needsEval,
	'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
	'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
	'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
	'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
	'%Boolean%': Boolean,
	'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
	'%Date%': Date,
	'%decodeURI%': decodeURI,
	'%decodeURIComponent%': decodeURIComponent,
	'%encodeURI%': encodeURI,
	'%encodeURIComponent%': encodeURIComponent,
	'%Error%': $Error,
	'%eval%': eval, // eslint-disable-line no-eval
	'%EvalError%': $EvalError,
	'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
	'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
	'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
	'%Function%': $Function,
	'%GeneratorFunction%': needsEval,
	'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
	'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
	'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
	'%isFinite%': isFinite,
	'%isNaN%': isNaN,
	'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
	'%JSON%': typeof JSON === 'object' ? JSON : undefined,
	'%Map%': typeof Map === 'undefined' ? undefined : Map,
	'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
	'%Math%': Math,
	'%Number%': Number,
	'%Object%': Object,
	'%parseFloat%': parseFloat,
	'%parseInt%': parseInt,
	'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
	'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
	'%RangeError%': $RangeError,
	'%ReferenceError%': $ReferenceError,
	'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
	'%RegExp%': RegExp,
	'%Set%': typeof Set === 'undefined' ? undefined : Set,
	'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
	'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
	'%String%': String,
	'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
	'%Symbol%': hasSymbols ? Symbol : undefined,
	'%SyntaxError%': $SyntaxError,
	'%ThrowTypeError%': ThrowTypeError,
	'%TypedArray%': TypedArray,
	'%TypeError%': $TypeError,
	'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
	'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
	'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
	'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
	'%URIError%': $URIError,
	'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
	'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
	'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
};

if (getProto) {
	try {
		null.error; // eslint-disable-line no-unused-expressions
	} catch (e) {
		// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
		var errorProto = getProto(getProto(e));
		INTRINSICS['%Error.prototype%'] = errorProto;
	}
}

var doEval = function doEval(name) {
	var value;
	if (name === '%AsyncFunction%') {
		value = getEvalledConstructor('async function () {}');
	} else if (name === '%GeneratorFunction%') {
		value = getEvalledConstructor('function* () {}');
	} else if (name === '%AsyncGeneratorFunction%') {
		value = getEvalledConstructor('async function* () {}');
	} else if (name === '%AsyncGenerator%') {
		var fn = doEval('%AsyncGeneratorFunction%');
		if (fn) {
			value = fn.prototype;
		}
	} else if (name === '%AsyncIteratorPrototype%') {
		var gen = doEval('%AsyncGenerator%');
		if (gen && getProto) {
			value = getProto(gen.prototype);
		}
	}

	INTRINSICS[name] = value;

	return value;
};

var LEGACY_ALIASES = {
	__proto__: null,
	'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
	'%ArrayPrototype%': ['Array', 'prototype'],
	'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
	'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
	'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
	'%ArrayProto_values%': ['Array', 'prototype', 'values'],
	'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
	'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
	'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
	'%BooleanPrototype%': ['Boolean', 'prototype'],
	'%DataViewPrototype%': ['DataView', 'prototype'],
	'%DatePrototype%': ['Date', 'prototype'],
	'%ErrorPrototype%': ['Error', 'prototype'],
	'%EvalErrorPrototype%': ['EvalError', 'prototype'],
	'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
	'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
	'%FunctionPrototype%': ['Function', 'prototype'],
	'%Generator%': ['GeneratorFunction', 'prototype'],
	'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
	'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
	'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
	'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
	'%JSONParse%': ['JSON', 'parse'],
	'%JSONStringify%': ['JSON', 'stringify'],
	'%MapPrototype%': ['Map', 'prototype'],
	'%NumberPrototype%': ['Number', 'prototype'],
	'%ObjectPrototype%': ['Object', 'prototype'],
	'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
	'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
	'%PromisePrototype%': ['Promise', 'prototype'],
	'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
	'%Promise_all%': ['Promise', 'all'],
	'%Promise_reject%': ['Promise', 'reject'],
	'%Promise_resolve%': ['Promise', 'resolve'],
	'%RangeErrorPrototype%': ['RangeError', 'prototype'],
	'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
	'%RegExpPrototype%': ['RegExp', 'prototype'],
	'%SetPrototype%': ['Set', 'prototype'],
	'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
	'%StringPrototype%': ['String', 'prototype'],
	'%SymbolPrototype%': ['Symbol', 'prototype'],
	'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
	'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
	'%TypeErrorPrototype%': ['TypeError', 'prototype'],
	'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
	'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
	'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
	'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
	'%URIErrorPrototype%': ['URIError', 'prototype'],
	'%WeakMapPrototype%': ['WeakMap', 'prototype'],
	'%WeakSetPrototype%': ['WeakSet', 'prototype']
};

var bind = __webpack_require__(6743);
var hasOwn = __webpack_require__(9957);
var $concat = bind.call(Function.call, Array.prototype.concat);
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
var $replace = bind.call(Function.call, String.prototype.replace);
var $strSlice = bind.call(Function.call, String.prototype.slice);
var $exec = bind.call(Function.call, RegExp.prototype.exec);

/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
var stringToPath = function stringToPath(string) {
	var first = $strSlice(string, 0, 1);
	var last = $strSlice(string, -1);
	if (first === '%' && last !== '%') {
		throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
	} else if (last === '%' && first !== '%') {
		throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
	}
	var result = [];
	$replace(string, rePropName, function (match, number, quote, subString) {
		result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
	});
	return result;
};
/* end adaptation */

var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
	var intrinsicName = name;
	var alias;
	if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
		alias = LEGACY_ALIASES[intrinsicName];
		intrinsicName = '%' + alias[0] + '%';
	}

	if (hasOwn(INTRINSICS, intrinsicName)) {
		var value = INTRINSICS[intrinsicName];
		if (value === needsEval) {
			value = doEval(intrinsicName);
		}
		if (typeof value === 'undefined' && !allowMissing) {
			throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
		}

		return {
			alias: alias,
			name: intrinsicName,
			value: value
		};
	}

	throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
};

module.exports = function GetIntrinsic(name, allowMissing) {
	if (typeof name !== 'string' || name.length === 0) {
		throw new $TypeError('intrinsic name must be a non-empty string');
	}
	if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
		throw new $TypeError('"allowMissing" argument must be a boolean');
	}

	if ($exec(/^%?[^%]*%?$/, name) === null) {
		throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
	}
	var parts = stringToPath(name);
	var intrinsicBaseName = parts.length > 0 ? parts[0] : '';

	var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
	var intrinsicRealName = intrinsic.name;
	var value = intrinsic.value;
	var skipFurtherCaching = false;

	var alias = intrinsic.alias;
	if (alias) {
		intrinsicBaseName = alias[0];
		$spliceApply(parts, $concat([0, 1], alias));
	}

	for (var i = 1, isOwn = true; i < parts.length; i += 1) {
		var part = parts[i];
		var first = $strSlice(part, 0, 1);
		var last = $strSlice(part, -1);
		if (
			(
				(first === '"' || first === "'" || first === '`')
				|| (last === '"' || last === "'" || last === '`')
			)
			&& first !== last
		) {
			throw new $SyntaxError('property names with quotes must have matching quotes');
		}
		if (part === 'constructor' || !isOwn) {
			skipFurtherCaching = true;
		}

		intrinsicBaseName += '.' + part;
		intrinsicRealName = '%' + intrinsicBaseName + '%';

		if (hasOwn(INTRINSICS, intrinsicRealName)) {
			value = INTRINSICS[intrinsicRealName];
		} else if (value != null) {
			if (!(part in value)) {
				if (!allowMissing) {
					throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
				}
				return void undefined;
			}
			if ($gOPD && (i + 1) >= parts.length) {
				var desc = $gOPD(value, part);
				isOwn = !!desc;

				// By convention, when a data property is converted to an accessor
				// property to emulate a data property that does not suffer from
				// the override mistake, that accessor's getter is marked with
				// an `originalValue` property. Here, when we detect this, we
				// uphold the illusion by pretending to see that original data
				// property, i.e., returning the value rather than the getter
				// itself.
				if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
					value = desc.get;
				} else {
					value = value[part];
				}
			} else {
				isOwn = hasOwn(value, part);
				value = value[part];
			}

			if (isOwn && !skipFurtherCaching) {
				INTRINSICS[intrinsicRealName] = value;
			}
		}
	}
	return value;
};


/***/ }),

/***/ 6270:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(362);

var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);

if ($gOPD) {
	try {
		$gOPD([], 'length');
	} catch (e) {
		// IE 8 has a broken gOPD
		$gOPD = null;
	}
}

module.exports = $gOPD;


/***/ }),

/***/ 4205:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var $defineProperty = __webpack_require__(466);

var hasPropertyDescriptors = function hasPropertyDescriptors() {
	return !!$defineProperty;
};

hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
	// node v0.6 has a bug where array lengths can be Set but not Defined
	if (!$defineProperty) {
		return null;
	}
	try {
		return $defineProperty([], 'length', { value: 1 }).length !== 1;
	} catch (e) {
		// In Firefox 4-22, defining length on an array throws an exception.
		return true;
	}
};

module.exports = hasPropertyDescriptors;


/***/ }),

/***/ 5695:
/***/ (function(module) {

"use strict";


var test = {
	__proto__: null,
	foo: {}
};

var $Object = Object;

/** @type {import('.')} */
module.exports = function hasProto() {
	// @ts-expect-error: TS errors on an inherited property for some reason
	return { __proto__: test }.foo === test.foo
		&& !(test instanceof $Object);
};


/***/ }),

/***/ 68:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var origSymbol = typeof Symbol !== 'undefined' && Symbol;
var hasSymbolSham = __webpack_require__(598);

module.exports = function hasNativeSymbols() {
	if (typeof origSymbol !== 'function') { return false; }
	if (typeof Symbol !== 'function') { return false; }
	if (typeof origSymbol('foo') !== 'symbol') { return false; }
	if (typeof Symbol('bar') !== 'symbol') { return false; }

	return hasSymbolSham();
};


/***/ }),

/***/ 598:
/***/ (function(module) {

"use strict";


/* eslint complexity: [2, 18], max-statements: [2, 33] */
module.exports = function hasSymbols() {
	if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
	if (typeof Symbol.iterator === 'symbol') { return true; }

	var obj = {};
	var sym = Symbol('test');
	var symObj = Object(sym);
	if (typeof sym === 'string') { return false; }

	if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
	if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }

	// temp disabled per https://github.com/ljharb/object.assign/issues/17
	// if (sym instanceof Symbol) { return false; }
	// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
	// if (!(symObj instanceof Symbol)) { return false; }

	// if (typeof Symbol.prototype.toString !== 'function') { return false; }
	// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }

	var symVal = 42;
	obj[sym] = symVal;
	for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
	if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }

	if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }

	var syms = Object.getOwnPropertySymbols(obj);
	if (syms.length !== 1 || syms[0] !== sym) { return false; }

	if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }

	if (typeof Object.getOwnPropertyDescriptor === 'function') {
		var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
		if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
	}

	return true;
};


/***/ }),

/***/ 4163:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var hasSymbols = __webpack_require__(598);

/** @type {import('.')} */
module.exports = function hasToStringTagShams() {
	return hasSymbols() && !!Symbol.toStringTag;
};


/***/ }),

/***/ 6245:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var hasToStringTag = __webpack_require__(4163)();
var callBound = __webpack_require__(3348);

var $toString = callBound('Object.prototype.toString');

var isStandardArguments = function isArguments(value) {
	if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {
		return false;
	}
	return $toString(value) === '[object Arguments]';
};

var isLegacyArguments = function isArguments(value) {
	if (isStandardArguments(value)) {
		return true;
	}
	return value !== null &&
		typeof value === 'object' &&
		typeof value.length === 'number' &&
		value.length >= 0 &&
		$toString(value) !== '[object Array]' &&
		$toString(value.callee) === '[object Function]';
};

var supportsStandardArguments = (function () {
	return isStandardArguments(arguments);
}());

isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests

module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;


/***/ }),

/***/ 5575:
/***/ (function(module) {

"use strict";


var fnToStr = Function.prototype.toString;
var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
var badArrayLike;
var isCallableMarker;
if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
	try {
		badArrayLike = Object.defineProperty({}, 'length', {
			get: function () {
				throw isCallableMarker;
			}
		});
		isCallableMarker = {};
		// eslint-disable-next-line no-throw-literal
		reflectApply(function () { throw 42; }, null, badArrayLike);
	} catch (_) {
		if (_ !== isCallableMarker) {
			reflectApply = null;
		}
	}
} else {
	reflectApply = null;
}

var constructorRegex = /^\s*class\b/;
var isES6ClassFn = function isES6ClassFunction(value) {
	try {
		var fnStr = fnToStr.call(value);
		return constructorRegex.test(fnStr);
	} catch (e) {
		return false; // not a function
	}
};

var tryFunctionObject = function tryFunctionToStr(value) {
	try {
		if (isES6ClassFn(value)) { return false; }
		fnToStr.call(value);
		return true;
	} catch (e) {
		return false;
	}
};
var toStr = Object.prototype.toString;
var objectClass = '[object Object]';
var fnClass = '[object Function]';
var genClass = '[object GeneratorFunction]';
var ddaClass = '[object HTMLAllCollection]'; // IE 11
var ddaClass2 = '[object HTML document.all class]';
var ddaClass3 = '[object HTMLCollection]'; // IE 9-10
var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`

var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing

var isDDA = function isDocumentDotAll() { return false; };
if (typeof document === 'object') {
	// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly
	var all = document.all;
	if (toStr.call(all) === toStr.call(document.all)) {
		isDDA = function isDocumentDotAll(value) {
			/* globals document: false */
			// in IE 6-8, typeof document.all is "object" and it's truthy
			if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {
				try {
					var str = toStr.call(value);
					return (
						str === ddaClass
						|| str === ddaClass2
						|| str === ddaClass3 // opera 12.16
						|| str === objectClass // IE 6-8
					) && value('') == null; // eslint-disable-line eqeqeq
				} catch (e) { /**/ }
			}
			return false;
		};
	}
}

module.exports = reflectApply
	? function isCallable(value) {
		if (isDDA(value)) { return true; }
		if (!value) { return false; }
		if (typeof value !== 'function' && typeof value !== 'object') { return false; }
		try {
			reflectApply(value, null, badArrayLike);
		} catch (e) {
			if (e !== isCallableMarker) { return false; }
		}
		return !isES6ClassFn(value) && tryFunctionObject(value);
	}
	: function isCallable(value) {
		if (isDDA(value)) { return true; }
		if (!value) { return false; }
		if (typeof value !== 'function' && typeof value !== 'object') { return false; }
		if (hasToStringTag) { return tryFunctionObject(value); }
		if (isES6ClassFn(value)) { return false; }
		var strClass = toStr.call(value);
		if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; }
		return tryFunctionObject(value);
	};


/***/ }),

/***/ 3415:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var toStr = Object.prototype.toString;
var fnToStr = Function.prototype.toString;
var isFnRegex = /^\s*(?:function)?\*/;
var hasToStringTag = __webpack_require__(4163)();
var getProto = Object.getPrototypeOf;
var getGeneratorFunc = function () { // eslint-disable-line consistent-return
	if (!hasToStringTag) {
		return false;
	}
	try {
		return Function('return function*() {}')();
	} catch (e) {
	}
};
var GeneratorFunction;

module.exports = function isGeneratorFunction(fn) {
	if (typeof fn !== 'function') {
		return false;
	}
	if (isFnRegex.test(fnToStr.call(fn))) {
		return true;
	}
	if (!hasToStringTag) {
		var str = toStr.call(fn);
		return str === '[object GeneratorFunction]';
	}
	if (!getProto) {
		return false;
	}
	if (typeof GeneratorFunction === 'undefined') {
		var generatorFunc = getGeneratorFunc();
		GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;
	}
	return getProto(fn) === GeneratorFunction;
};


/***/ }),

/***/ 7953:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var whichTypedArray = __webpack_require__(6556);

/** @type {import('.')} */
module.exports = function isTypedArray(value) {
	return !!whichTypedArray(value);
};


/***/ }),

/***/ 4044:
/***/ (function(module, exports) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* globals define */
(function (root, factory) {
  
  if (true) {
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
		__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
		(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else {}

  }(this, function () {

    var owasp = {};

    // These are configuration settings that will be used when testing password
    // strength
    owasp.configs = {
      allowPassphrases       : true,
      maxLength              : 128,
      minLength              : 10,
      minPhraseLength        : 20,
      minOptionalTestsToPass : 4,
    };

    // This method makes it more convenient to set config parameters
    owasp.config = function(params) {
      for (var prop in params) {
        if (params.hasOwnProperty(prop) && this.configs.hasOwnProperty(prop)) {
          this.configs[prop] = params[prop];
        }
      }
    };

    // This is an object containing the tests to run against all passwords.
    owasp.tests = {

      // An array of required tests. A password *must* pass these tests in order
      // to be considered strong.
      required: [

        // enforce a minimum length
        function(password) {
          if (password.length < owasp.configs.minLength) {
            return 'The password must be at least ' + owasp.configs.minLength + ' characters long.';
          }
        },

        // enforce a maximum length
        function(password) {
          if (password.length > owasp.configs.maxLength) {
            return 'The password must be fewer than ' + owasp.configs.maxLength + ' characters.';
          }
        },

        // forbid repeating characters
        function(password) {
          if (/(.)\1{2,}/.test(password)) {
            return 'The password may not contain sequences of three or more repeated characters.';
          }
        },

      ],

      // An array of optional tests. These tests are "optional" in two senses:
      //
      // 1. Passphrases (passwords whose length exceeds
      //    this.configs.minPhraseLength) are not obligated to pass these tests
      //    provided that this.configs.allowPassphrases is set to Boolean true
      //    (which it is by default).
      //
      // 2. A password need only to pass this.configs.minOptionalTestsToPass
      //    number of these optional tests in order to be considered strong.
      optional: [

        // require at least one lowercase letter
        function(password) {
          if (!/[a-z]/.test(password)) {
            return 'The password must contain at least one lowercase letter.';
          }
        },

        // require at least one uppercase letter
        function(password) {
          if (!/[A-Z]/.test(password)) {
            return 'The password must contain at least one uppercase letter.';
          }
        },

        // require at least one number
        function(password) {
          if (!/[0-9]/.test(password)) {
            return 'The password must contain at least one number.';
          }
        },

        // require at least one special character
        function(password) {
          if (!/[^A-Za-z0-9]/.test(password)) {
            return 'The password must contain at least one special character.';
          }
        },

      ],
    };

    // This method tests password strength
    owasp.test = function(password) {

      // create an object to store the test results
      var result = {
        errors              : [],
        failedTests         : [],
        passedTests         : [],
        requiredTestErrors  : [],
        optionalTestErrors  : [],
        isPassphrase        : false,
        strong              : true,
        optionalTestsPassed : 0,
      };

      // Always submit the password/passphrase to the required tests
      var i = 0;
      this.tests.required.forEach(function(test) {
        var err = test(password);
        if (typeof err === 'string') {
          result.strong = false;
          result.errors.push(err);
          result.requiredTestErrors.push(err);
          result.failedTests.push(i);
        } else {
          result.passedTests.push(i);
        }
        i++;
      });

      // If configured to allow passphrases, and if the password is of a
      // sufficient length to consider it a passphrase, exempt it from the
      // optional tests.
      if (
        this.configs.allowPassphrases === true &&
        password.length >= this.configs.minPhraseLength
      ) {
        result.isPassphrase = true;
      }

      if (!result.isPassphrase) {
        var j = this.tests.required.length;
        this.tests.optional.forEach(function(test) {
          var err = test(password);
          if (typeof err === 'string') {
            result.errors.push(err);
            result.optionalTestErrors.push(err);
            result.failedTests.push(j);
          } else {
            result.optionalTestsPassed++;
            result.passedTests.push(j);
          }
          j++;
        });
      }

      // If the password is not a passphrase, assert that it has passed a
      // sufficient number of the optional tests, per the configuration
      if (
        !result.isPassphrase &&
        result.optionalTestsPassed < this.configs.minOptionalTestsToPass
      ) {
        result.strong = false;
      }

      // return the result
      return result;
    };

    return owasp;
  }
));


/***/ }),

/***/ 6707:
/***/ (function(module) {

"use strict";


/** @type {import('.')} */
module.exports = [
	'Float32Array',
	'Float64Array',
	'Int8Array',
	'Int16Array',
	'Int32Array',
	'Uint8Array',
	'Uint8ClampedArray',
	'Uint16Array',
	'Uint32Array',
	'BigInt64Array',
	'BigUint64Array'
];


/***/ }),

/***/ 7238:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(362);
var define = __webpack_require__(6504);
var hasDescriptors = __webpack_require__(4205)();
var gOPD = __webpack_require__(6270);

var $TypeError = __webpack_require__(3502);
var $floor = GetIntrinsic('%Math.floor%');

/** @type {import('.')} */
module.exports = function setFunctionLength(fn, length) {
	if (typeof fn !== 'function') {
		throw new $TypeError('`fn` is not a function');
	}
	if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {
		throw new $TypeError('`length` must be a positive 32-bit integer');
	}

	var loose = arguments.length > 2 && !!arguments[2];

	var functionLengthIsConfigurable = true;
	var functionLengthIsWritable = true;
	if ('length' in fn && gOPD) {
		var desc = gOPD(fn, 'length');
		if (desc && !desc.configurable) {
			functionLengthIsConfigurable = false;
		}
		if (desc && !desc.writable) {
			functionLengthIsWritable = false;
		}
	}

	if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
		if (hasDescriptors) {
			define(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);
		} else {
			define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
		}
	}
	return fn;
};


/***/ }),

/***/ 9620:
/***/ (function(module) {

const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;
const numRegex = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
// const octRegex = /^0x[a-z0-9]+/;
// const binRegex = /0x[a-z0-9]+/;

 
const consider = {
    hex :  true,
    // oct: false,
    leadingZeros: true,
    decimalPoint: "\.",
    eNotation: true,
    //skipLike: /regex/
};

function toNumber(str, options = {}){
    options = Object.assign({}, consider, options );
    if(!str || typeof str !== "string" ) return str;
    
    let trimmedStr  = str.trim();
    
    if(options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str;
    else if(str==="0") return 0;
    else if (options.hex && hexRegex.test(trimmedStr)) {
        return parse_int(trimmedStr, 16);
    // }else if (options.oct && octRegex.test(str)) {
    //     return Number.parseInt(val, 8);
    }else if (trimmedStr.search(/[eE]/)!== -1) { //eNotation
        const notation = trimmedStr.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/); 
        // +00.123 => [ , '+', '00', '.123', ..
        if(notation){
            // console.log(notation)
            if(options.leadingZeros){ //accept with leading zeros
                trimmedStr = (notation[1] || "") + notation[3];
            }else{
                if(notation[2] === "0" && notation[3][0]=== "."){ //valid number
                }else{
                    return str;
                }
            }
            return options.eNotation ? Number(trimmedStr) : str;
        }else{
            return str;
        }
    // }else if (options.parseBin && binRegex.test(str)) {
    //     return Number.parseInt(val, 2);
    }else{
        //separate negative sign, leading zeros, and rest number
        const match = numRegex.exec(trimmedStr);
        // +00.123 => [ , '+', '00', '.123', ..
        if(match){
            const sign = match[1];
            const leadingZeros = match[2];
            let numTrimmedByZeros = trimZeros(match[3]); //complete num without leading zeros
            //trim ending zeros for floating number
            
            if(!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str; //-0123
            else if(!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str; //0123
            else if(options.leadingZeros && leadingZeros===str) return 0; //00
            
            else{//no leading zeros or leading zeros are allowed
                const num = Number(trimmedStr);
                const numStr = "" + num;

                if(numStr.search(/[eE]/) !== -1){ //given number is long and parsed to eNotation
                    if(options.eNotation) return num;
                    else return str;
                }else if(trimmedStr.indexOf(".") !== -1){ //floating number
                    if(numStr === "0" && (numTrimmedByZeros === "") ) return num; //0.0
                    else if(numStr === numTrimmedByZeros) return num; //0.456. 0.79000
                    else if( sign && numStr === "-"+numTrimmedByZeros) return num;
                    else return str;
                }
                
                if(leadingZeros){
                    return (numTrimmedByZeros === numStr) || (sign+numTrimmedByZeros === numStr) ? num : str
                }else  {
                    return (trimmedStr === numStr) || (trimmedStr === sign+numStr) ? num : str
                }
            }
        }else{ //non-numeric string
            return str;
        }
    }
}

/**
 * 
 * @param {string} numStr without leading zeros
 * @returns 
 */
function trimZeros(numStr){
    if(numStr && numStr.indexOf(".") !== -1){//float
        numStr = numStr.replace(/0+$/, ""); //remove ending zeros
        if(numStr === ".")  numStr = "0";
        else if(numStr[0] === ".")  numStr = "0"+numStr;
        else if(numStr[numStr.length-1] === ".")  numStr = numStr.substr(0,numStr.length-1);
        return numStr;
    }
    return numStr;
}

function parse_int(numStr, base){
    //polyfill
    if(parseInt) return parseInt(numStr, base);
    else if(Number.parseInt) return Number.parseInt(numStr, base);
    else if(window && window.parseInt) return window.parseInt(numStr, base);
    else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")
}

module.exports = toNumber;

/***/ }),

/***/ 3598:
/***/ (function(module) {

module.exports = function isBuffer(arg) {
  return arg && typeof arg === 'object'
    && typeof arg.copy === 'function'
    && typeof arg.fill === 'function'
    && typeof arg.readUInt8 === 'function';
}

/***/ }),

/***/ 7473:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
// Currently in sync with Node.js lib/internal/util/types.js
// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9



var isArgumentsObject = __webpack_require__(6245);
var isGeneratorFunction = __webpack_require__(3415);
var whichTypedArray = __webpack_require__(6556);
var isTypedArray = __webpack_require__(7953);

function uncurryThis(f) {
  return f.call.bind(f);
}

var BigIntSupported = typeof BigInt !== 'undefined';
var SymbolSupported = typeof Symbol !== 'undefined';

var ObjectToString = uncurryThis(Object.prototype.toString);

var numberValue = uncurryThis(Number.prototype.valueOf);
var stringValue = uncurryThis(String.prototype.valueOf);
var booleanValue = uncurryThis(Boolean.prototype.valueOf);

if (BigIntSupported) {
  var bigIntValue = uncurryThis(BigInt.prototype.valueOf);
}

if (SymbolSupported) {
  var symbolValue = uncurryThis(Symbol.prototype.valueOf);
}

function checkBoxedPrimitive(value, prototypeValueOf) {
  if (typeof value !== 'object') {
    return false;
  }
  try {
    prototypeValueOf(value);
    return true;
  } catch(e) {
    return false;
  }
}

exports.isArgumentsObject = isArgumentsObject;
exports.isGeneratorFunction = isGeneratorFunction;
exports.isTypedArray = isTypedArray;

// Taken from here and modified for better browser support
// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js
function isPromise(input) {
	return (
		(
			typeof Promise !== 'undefined' &&
			input instanceof Promise
		) ||
		(
			input !== null &&
			typeof input === 'object' &&
			typeof input.then === 'function' &&
			typeof input.catch === 'function'
		)
	);
}
exports.isPromise = isPromise;

function isArrayBufferView(value) {
  if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
    return ArrayBuffer.isView(value);
  }

  return (
    isTypedArray(value) ||
    isDataView(value)
  );
}
exports.isArrayBufferView = isArrayBufferView;


function isUint8Array(value) {
  return whichTypedArray(value) === 'Uint8Array';
}
exports.isUint8Array = isUint8Array;

function isUint8ClampedArray(value) {
  return whichTypedArray(value) === 'Uint8ClampedArray';
}
exports.isUint8ClampedArray = isUint8ClampedArray;

function isUint16Array(value) {
  return whichTypedArray(value) === 'Uint16Array';
}
exports.isUint16Array = isUint16Array;

function isUint32Array(value) {
  return whichTypedArray(value) === 'Uint32Array';
}
exports.isUint32Array = isUint32Array;

function isInt8Array(value) {
  return whichTypedArray(value) === 'Int8Array';
}
exports.isInt8Array = isInt8Array;

function isInt16Array(value) {
  return whichTypedArray(value) === 'Int16Array';
}
exports.isInt16Array = isInt16Array;

function isInt32Array(value) {
  return whichTypedArray(value) === 'Int32Array';
}
exports.isInt32Array = isInt32Array;

function isFloat32Array(value) {
  return whichTypedArray(value) === 'Float32Array';
}
exports.isFloat32Array = isFloat32Array;

function isFloat64Array(value) {
  return whichTypedArray(value) === 'Float64Array';
}
exports.isFloat64Array = isFloat64Array;

function isBigInt64Array(value) {
  return whichTypedArray(value) === 'BigInt64Array';
}
exports.isBigInt64Array = isBigInt64Array;

function isBigUint64Array(value) {
  return whichTypedArray(value) === 'BigUint64Array';
}
exports.isBigUint64Array = isBigUint64Array;

function isMapToString(value) {
  return ObjectToString(value) === '[object Map]';
}
isMapToString.working = (
  typeof Map !== 'undefined' &&
  isMapToString(new Map())
);

function isMap(value) {
  if (typeof Map === 'undefined') {
    return false;
  }

  return isMapToString.working
    ? isMapToString(value)
    : value instanceof Map;
}
exports.isMap = isMap;

function isSetToString(value) {
  return ObjectToString(value) === '[object Set]';
}
isSetToString.working = (
  typeof Set !== 'undefined' &&
  isSetToString(new Set())
);
function isSet(value) {
  if (typeof Set === 'undefined') {
    return false;
  }

  return isSetToString.working
    ? isSetToString(value)
    : value instanceof Set;
}
exports.isSet = isSet;

function isWeakMapToString(value) {
  return ObjectToString(value) === '[object WeakMap]';
}
isWeakMapToString.working = (
  typeof WeakMap !== 'undefined' &&
  isWeakMapToString(new WeakMap())
);
function isWeakMap(value) {
  if (typeof WeakMap === 'undefined') {
    return false;
  }

  return isWeakMapToString.working
    ? isWeakMapToString(value)
    : value instanceof WeakMap;
}
exports.isWeakMap = isWeakMap;

function isWeakSetToString(value) {
  return ObjectToString(value) === '[object WeakSet]';
}
isWeakSetToString.working = (
  typeof WeakSet !== 'undefined' &&
  isWeakSetToString(new WeakSet())
);
function isWeakSet(value) {
  return isWeakSetToString(value);
}
exports.isWeakSet = isWeakSet;

function isArrayBufferToString(value) {
  return ObjectToString(value) === '[object ArrayBuffer]';
}
isArrayBufferToString.working = (
  typeof ArrayBuffer !== 'undefined' &&
  isArrayBufferToString(new ArrayBuffer())
);
function isArrayBuffer(value) {
  if (typeof ArrayBuffer === 'undefined') {
    return false;
  }

  return isArrayBufferToString.working
    ? isArrayBufferToString(value)
    : value instanceof ArrayBuffer;
}
exports.isArrayBuffer = isArrayBuffer;

function isDataViewToString(value) {
  return ObjectToString(value) === '[object DataView]';
}
isDataViewToString.working = (
  typeof ArrayBuffer !== 'undefined' &&
  typeof DataView !== 'undefined' &&
  isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1))
);
function isDataView(value) {
  if (typeof DataView === 'undefined') {
    return false;
  }

  return isDataViewToString.working
    ? isDataViewToString(value)
    : value instanceof DataView;
}
exports.isDataView = isDataView;

function isSharedArrayBufferToString(value) {
  return ObjectToString(value) === '[object SharedArrayBuffer]';
}
isSharedArrayBufferToString.working = (
  typeof SharedArrayBuffer !== 'undefined' &&
  isSharedArrayBufferToString(new SharedArrayBuffer())
);
function isSharedArrayBuffer(value) {
  if (typeof SharedArrayBuffer === 'undefined') {
    return false;
  }

  return isSharedArrayBufferToString.working
    ? isSharedArrayBufferToString(value)
    : value instanceof SharedArrayBuffer;
}
exports.isSharedArrayBuffer = isSharedArrayBuffer;

function isAsyncFunction(value) {
  return ObjectToString(value) === '[object AsyncFunction]';
}
exports.isAsyncFunction = isAsyncFunction;

function isMapIterator(value) {
  return ObjectToString(value) === '[object Map Iterator]';
}
exports.isMapIterator = isMapIterator;

function isSetIterator(value) {
  return ObjectToString(value) === '[object Set Iterator]';
}
exports.isSetIterator = isSetIterator;

function isGeneratorObject(value) {
  return ObjectToString(value) === '[object Generator]';
}
exports.isGeneratorObject = isGeneratorObject;

function isWebAssemblyCompiledModule(value) {
  return ObjectToString(value) === '[object WebAssembly.Module]';
}
exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;

function isNumberObject(value) {
  return checkBoxedPrimitive(value, numberValue);
}
exports.isNumberObject = isNumberObject;

function isStringObject(value) {
  return checkBoxedPrimitive(value, stringValue);
}
exports.isStringObject = isStringObject;

function isBooleanObject(value) {
  return checkBoxedPrimitive(value, booleanValue);
}
exports.isBooleanObject = isBooleanObject;

function isBigIntObject(value) {
  return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);
}
exports.isBigIntObject = isBigIntObject;

function isSymbolObject(value) {
  return SymbolSupported && checkBoxedPrimitive(value, symbolValue);
}
exports.isSymbolObject = isSymbolObject;

function isBoxedPrimitive(value) {
  return (
    isNumberObject(value) ||
    isStringObject(value) ||
    isBooleanObject(value) ||
    isBigIntObject(value) ||
    isSymbolObject(value)
  );
}
exports.isBoxedPrimitive = isBoxedPrimitive;

function isAnyArrayBuffer(value) {
  return typeof Uint8Array !== 'undefined' && (
    isArrayBuffer(value) ||
    isSharedArrayBuffer(value)
  );
}
exports.isAnyArrayBuffer = isAnyArrayBuffer;

['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) {
  Object.defineProperty(exports, method, {
    enumerable: false,
    value: function() {
      throw new Error(method + ' is not supported in userland');
    }
  });
});


/***/ }),

/***/ 166:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

/* provided dependency */ var process = __webpack_require__(5606);
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||
  function getOwnPropertyDescriptors(obj) {
    var keys = Object.keys(obj);
    var descriptors = {};
    for (var i = 0; i < keys.length; i++) {
      descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
    }
    return descriptors;
  };

var formatRegExp = /%[sdj%]/g;
exports.format = function(f) {
  if (!isString(f)) {
    var objects = [];
    for (var i = 0; i < arguments.length; i++) {
      objects.push(inspect(arguments[i]));
    }
    return objects.join(' ');
  }

  var i = 1;
  var args = arguments;
  var len = args.length;
  var str = String(f).replace(formatRegExp, function(x) {
    if (x === '%%') return '%';
    if (i >= len) return x;
    switch (x) {
      case '%s': return String(args[i++]);
      case '%d': return Number(args[i++]);
      case '%j':
        try {
          return JSON.stringify(args[i++]);
        } catch (_) {
          return '[Circular]';
        }
      default:
        return x;
    }
  });
  for (var x = args[i]; i < len; x = args[++i]) {
    if (isNull(x) || !isObject(x)) {
      str += ' ' + x;
    } else {
      str += ' ' + inspect(x);
    }
  }
  return str;
};


// Mark that a method should not be used.
// Returns a modified function which warns once by default.
// If --no-deprecation is set, then it is a no-op.
exports.deprecate = function(fn, msg) {
  if (typeof process !== 'undefined' && process.noDeprecation === true) {
    return fn;
  }

  // Allow for deprecating things in the process of starting up.
  if (typeof process === 'undefined') {
    return function() {
      return exports.deprecate(fn, msg).apply(this, arguments);
    };
  }

  var warned = false;
  function deprecated() {
    if (!warned) {
      if (process.throwDeprecation) {
        throw new Error(msg);
      } else if (process.traceDeprecation) {
        console.trace(msg);
      } else {
        console.error(msg);
      }
      warned = true;
    }
    return fn.apply(this, arguments);
  }

  return deprecated;
};


var debugs = {};
var debugEnvRegex = /^$/;

if (({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).NODE_DEBUG) {
  var debugEnv = ({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).NODE_DEBUG;
  debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&')
    .replace(/\*/g, '.*')
    .replace(/,/g, '$|^')
    .toUpperCase();
  debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');
}
exports.debuglog = function(set) {
  set = set.toUpperCase();
  if (!debugs[set]) {
    if (debugEnvRegex.test(set)) {
      var pid = process.pid;
      debugs[set] = function() {
        var msg = exports.format.apply(exports, arguments);
        console.error('%s %d: %s', set, pid, msg);
      };
    } else {
      debugs[set] = function() {};
    }
  }
  return debugs[set];
};


/**
 * Echos the value of a value. Trys to print the value out
 * in the best way possible given the different types.
 *
 * @param {Object} obj The object to print out.
 * @param {Object} opts Optional options object that alters the output.
 */
/* legacy: obj, showHidden, depth, colors*/
function inspect(obj, opts) {
  // default options
  var ctx = {
    seen: [],
    stylize: stylizeNoColor
  };
  // legacy...
  if (arguments.length >= 3) ctx.depth = arguments[2];
  if (arguments.length >= 4) ctx.colors = arguments[3];
  if (isBoolean(opts)) {
    // legacy...
    ctx.showHidden = opts;
  } else if (opts) {
    // got an "options" object
    exports._extend(ctx, opts);
  }
  // set default options
  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  if (isUndefined(ctx.depth)) ctx.depth = 2;
  if (isUndefined(ctx.colors)) ctx.colors = false;
  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  if (ctx.colors) ctx.stylize = stylizeWithColor;
  return formatValue(ctx, obj, ctx.depth);
}
exports.inspect = inspect;


// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
inspect.colors = {
  'bold' : [1, 22],
  'italic' : [3, 23],
  'underline' : [4, 24],
  'inverse' : [7, 27],
  'white' : [37, 39],
  'grey' : [90, 39],
  'black' : [30, 39],
  'blue' : [34, 39],
  'cyan' : [36, 39],
  'green' : [32, 39],
  'magenta' : [35, 39],
  'red' : [31, 39],
  'yellow' : [33, 39]
};

// Don't use 'blue' not visible on cmd.exe
inspect.styles = {
  'special': 'cyan',
  'number': 'yellow',
  'boolean': 'yellow',
  'undefined': 'grey',
  'null': 'bold',
  'string': 'green',
  'date': 'magenta',
  // "name": intentionally not styling
  'regexp': 'red'
};


function stylizeWithColor(str, styleType) {
  var style = inspect.styles[styleType];

  if (style) {
    return '\u001b[' + inspect.colors[style][0] + 'm' + str +
           '\u001b[' + inspect.colors[style][1] + 'm';
  } else {
    return str;
  }
}


function stylizeNoColor(str, styleType) {
  return str;
}


function arrayToHash(array) {
  var hash = {};

  array.forEach(function(val, idx) {
    hash[val] = true;
  });

  return hash;
}


function formatValue(ctx, value, recurseTimes) {
  // Provide a hook for user-specified inspect functions.
  // Check that value is an object with an inspect function on it
  if (ctx.customInspect &&
      value &&
      isFunction(value.inspect) &&
      // Filter out the util module, it's inspect function is special
      value.inspect !== exports.inspect &&
      // Also filter out any prototype objects using the circular check.
      !(value.constructor && value.constructor.prototype === value)) {
    var ret = value.inspect(recurseTimes, ctx);
    if (!isString(ret)) {
      ret = formatValue(ctx, ret, recurseTimes);
    }
    return ret;
  }

  // Primitive types cannot have properties
  var primitive = formatPrimitive(ctx, value);
  if (primitive) {
    return primitive;
  }

  // Look up the keys of the object.
  var keys = Object.keys(value);
  var visibleKeys = arrayToHash(keys);

  if (ctx.showHidden) {
    keys = Object.getOwnPropertyNames(value);
  }

  // IE doesn't make error fields non-enumerable
  // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  if (isError(value)
      && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
    return formatError(value);
  }

  // Some type of object without properties can be shortcutted.
  if (keys.length === 0) {
    if (isFunction(value)) {
      var name = value.name ? ': ' + value.name : '';
      return ctx.stylize('[Function' + name + ']', 'special');
    }
    if (isRegExp(value)) {
      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
    }
    if (isDate(value)) {
      return ctx.stylize(Date.prototype.toString.call(value), 'date');
    }
    if (isError(value)) {
      return formatError(value);
    }
  }

  var base = '', array = false, braces = ['{', '}'];

  // Make Array say that they are Array
  if (isArray(value)) {
    array = true;
    braces = ['[', ']'];
  }

  // Make functions say that they are functions
  if (isFunction(value)) {
    var n = value.name ? ': ' + value.name : '';
    base = ' [Function' + n + ']';
  }

  // Make RegExps say that they are RegExps
  if (isRegExp(value)) {
    base = ' ' + RegExp.prototype.toString.call(value);
  }

  // Make dates with properties first say the date
  if (isDate(value)) {
    base = ' ' + Date.prototype.toUTCString.call(value);
  }

  // Make error with message first say the error
  if (isError(value)) {
    base = ' ' + formatError(value);
  }

  if (keys.length === 0 && (!array || value.length == 0)) {
    return braces[0] + base + braces[1];
  }

  if (recurseTimes < 0) {
    if (isRegExp(value)) {
      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
    } else {
      return ctx.stylize('[Object]', 'special');
    }
  }

  ctx.seen.push(value);

  var output;
  if (array) {
    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  } else {
    output = keys.map(function(key) {
      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
    });
  }

  ctx.seen.pop();

  return reduceToSingleString(output, base, braces);
}


function formatPrimitive(ctx, value) {
  if (isUndefined(value))
    return ctx.stylize('undefined', 'undefined');
  if (isString(value)) {
    var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
                                             .replace(/'/g, "\\'")
                                             .replace(/\\"/g, '"') + '\'';
    return ctx.stylize(simple, 'string');
  }
  if (isNumber(value))
    return ctx.stylize('' + value, 'number');
  if (isBoolean(value))
    return ctx.stylize('' + value, 'boolean');
  // For some reason typeof null is "object", so special case here.
  if (isNull(value))
    return ctx.stylize('null', 'null');
}


function formatError(value) {
  return '[' + Error.prototype.toString.call(value) + ']';
}


function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  var output = [];
  for (var i = 0, l = value.length; i < l; ++i) {
    if (hasOwnProperty(value, String(i))) {
      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
          String(i), true));
    } else {
      output.push('');
    }
  }
  keys.forEach(function(key) {
    if (!key.match(/^\d+$/)) {
      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
          key, true));
    }
  });
  return output;
}


function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  var name, str, desc;
  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  if (desc.get) {
    if (desc.set) {
      str = ctx.stylize('[Getter/Setter]', 'special');
    } else {
      str = ctx.stylize('[Getter]', 'special');
    }
  } else {
    if (desc.set) {
      str = ctx.stylize('[Setter]', 'special');
    }
  }
  if (!hasOwnProperty(visibleKeys, key)) {
    name = '[' + key + ']';
  }
  if (!str) {
    if (ctx.seen.indexOf(desc.value) < 0) {
      if (isNull(recurseTimes)) {
        str = formatValue(ctx, desc.value, null);
      } else {
        str = formatValue(ctx, desc.value, recurseTimes - 1);
      }
      if (str.indexOf('\n') > -1) {
        if (array) {
          str = str.split('\n').map(function(line) {
            return '  ' + line;
          }).join('\n').substr(2);
        } else {
          str = '\n' + str.split('\n').map(function(line) {
            return '   ' + line;
          }).join('\n');
        }
      }
    } else {
      str = ctx.stylize('[Circular]', 'special');
    }
  }
  if (isUndefined(name)) {
    if (array && key.match(/^\d+$/)) {
      return str;
    }
    name = JSON.stringify('' + key);
    if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
      name = name.substr(1, name.length - 2);
      name = ctx.stylize(name, 'name');
    } else {
      name = name.replace(/'/g, "\\'")
                 .replace(/\\"/g, '"')
                 .replace(/(^"|"$)/g, "'");
      name = ctx.stylize(name, 'string');
    }
  }

  return name + ': ' + str;
}


function reduceToSingleString(output, base, braces) {
  var numLinesEst = 0;
  var length = output.reduce(function(prev, cur) {
    numLinesEst++;
    if (cur.indexOf('\n') >= 0) numLinesEst++;
    return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  }, 0);

  if (length > 60) {
    return braces[0] +
           (base === '' ? '' : base + '\n ') +
           ' ' +
           output.join(',\n  ') +
           ' ' +
           braces[1];
  }

  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
}


// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
exports.types = __webpack_require__(7473);

function isArray(ar) {
  return Array.isArray(ar);
}
exports.isArray = isArray;

function isBoolean(arg) {
  return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;

function isNull(arg) {
  return arg === null;
}
exports.isNull = isNull;

function isNullOrUndefined(arg) {
  return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;

function isNumber(arg) {
  return typeof arg === 'number';
}
exports.isNumber = isNumber;

function isString(arg) {
  return typeof arg === 'string';
}
exports.isString = isString;

function isSymbol(arg) {
  return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;

function isUndefined(arg) {
  return arg === void 0;
}
exports.isUndefined = isUndefined;

function isRegExp(re) {
  return isObject(re) && objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
exports.types.isRegExp = isRegExp;

function isObject(arg) {
  return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;

function isDate(d) {
  return isObject(d) && objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
exports.types.isDate = isDate;

function isError(e) {
  return isObject(e) &&
      (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
exports.types.isNativeError = isError;

function isFunction(arg) {
  return typeof arg === 'function';
}
exports.isFunction = isFunction;

function isPrimitive(arg) {
  return arg === null ||
         typeof arg === 'boolean' ||
         typeof arg === 'number' ||
         typeof arg === 'string' ||
         typeof arg === 'symbol' ||  // ES6 symbol
         typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;

exports.isBuffer = __webpack_require__(3598);

function objectToString(o) {
  return Object.prototype.toString.call(o);
}


function pad(n) {
  return n < 10 ? '0' + n.toString(10) : n.toString(10);
}


var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
              'Oct', 'Nov', 'Dec'];

// 26 Feb 16:19:34
function timestamp() {
  var d = new Date();
  var time = [pad(d.getHours()),
              pad(d.getMinutes()),
              pad(d.getSeconds())].join(':');
  return [d.getDate(), months[d.getMonth()], time].join(' ');
}


// log is just a thin wrapper to console.log that prepends a timestamp
exports.log = function() {
  console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
};


/**
 * Inherit the prototype methods from one constructor into another.
 *
 * The Function.prototype.inherits from lang.js rewritten as a standalone
 * function (not on Function.prototype). NOTE: If this file is to be loaded
 * during bootstrapping this function needs to be rewritten using some native
 * functions as prototype setup using normal JavaScript does not work as
 * expected during bootstrapping (see mirror.js in r114903).
 *
 * @param {function} ctor Constructor function which needs to inherit the
 *     prototype.
 * @param {function} superCtor Constructor function to inherit prototype from.
 */
exports.inherits = __webpack_require__(6698);

exports._extend = function(origin, add) {
  // Don't do anything if add isn't an object
  if (!add || !isObject(add)) return origin;

  var keys = Object.keys(add);
  var i = keys.length;
  while (i--) {
    origin[keys[i]] = add[keys[i]];
  }
  return origin;
};

function hasOwnProperty(obj, prop) {
  return Object.prototype.hasOwnProperty.call(obj, prop);
}

var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;

exports.promisify = function promisify(original) {
  if (typeof original !== 'function')
    throw new TypeError('The "original" argument must be of type Function');

  if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
    var fn = original[kCustomPromisifiedSymbol];
    if (typeof fn !== 'function') {
      throw new TypeError('The "util.promisify.custom" argument must be of type Function');
    }
    Object.defineProperty(fn, kCustomPromisifiedSymbol, {
      value: fn, enumerable: false, writable: false, configurable: true
    });
    return fn;
  }

  function fn() {
    var promiseResolve, promiseReject;
    var promise = new Promise(function (resolve, reject) {
      promiseResolve = resolve;
      promiseReject = reject;
    });

    var args = [];
    for (var i = 0; i < arguments.length; i++) {
      args.push(arguments[i]);
    }
    args.push(function (err, value) {
      if (err) {
        promiseReject(err);
      } else {
        promiseResolve(value);
      }
    });

    try {
      original.apply(this, args);
    } catch (err) {
      promiseReject(err);
    }

    return promise;
  }

  Object.setPrototypeOf(fn, Object.getPrototypeOf(original));

  if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {
    value: fn, enumerable: false, writable: false, configurable: true
  });
  return Object.defineProperties(
    fn,
    getOwnPropertyDescriptors(original)
  );
}

exports.promisify.custom = kCustomPromisifiedSymbol

function callbackifyOnRejected(reason, cb) {
  // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).
  // Because `null` is a special error value in callbacks which means "no error
  // occurred", we error-wrap so the callback consumer can distinguish between
  // "the promise rejected with null" or "the promise fulfilled with undefined".
  if (!reason) {
    var newReason = new Error('Promise was rejected with a falsy value');
    newReason.reason = reason;
    reason = newReason;
  }
  return cb(reason);
}

function callbackify(original) {
  if (typeof original !== 'function') {
    throw new TypeError('The "original" argument must be of type Function');
  }

  // We DO NOT return the promise as it gives the user a false sense that
  // the promise is actually somehow related to the callback's execution
  // and that the callback throwing will reject the promise.
  function callbackified() {
    var args = [];
    for (var i = 0; i < arguments.length; i++) {
      args.push(arguments[i]);
    }

    var maybeCb = args.pop();
    if (typeof maybeCb !== 'function') {
      throw new TypeError('The last argument must be of type Function');
    }
    var self = this;
    var cb = function() {
      return maybeCb.apply(self, arguments);
    };
    // In true node style we process the callback on `nextTick` with all the
    // implications (stack, `uncaughtException`, `async_hooks`)
    original.apply(this, args)
      .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) },
            function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) });
  }

  Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
  Object.defineProperties(callbackified,
                          getOwnPropertyDescriptors(original));
  return callbackified;
}
exports.callbackify = callbackify;


/***/ }),

/***/ 6556:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var forEach = __webpack_require__(8535);
var availableTypedArrays = __webpack_require__(7374);
var callBind = __webpack_require__(3784);
var callBound = __webpack_require__(3348);
var gOPD = __webpack_require__(6270);

/** @type {(O: object) => string} */
var $toString = callBound('Object.prototype.toString');
var hasToStringTag = __webpack_require__(4163)();

var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis;
var typedArrays = availableTypedArrays();

var $slice = callBound('String.prototype.slice');
var getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');

/** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */
var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {
	for (var i = 0; i < array.length; i += 1) {
		if (array[i] === value) {
			return i;
		}
	}
	return -1;
};

/** @typedef {(receiver: import('.').TypedArray) => string | typeof Uint8Array.prototype.slice.call | typeof Uint8Array.prototype.set.call} Getter */
/** @type {{ [k in `\$${import('.').TypedArrayName}`]?: Getter } & { __proto__: null }} */
var cache = { __proto__: null };
if (hasToStringTag && gOPD && getPrototypeOf) {
	forEach(typedArrays, function (typedArray) {
		var arr = new g[typedArray]();
		if (Symbol.toStringTag in arr) {
			var proto = getPrototypeOf(arr);
			// @ts-expect-error TS won't narrow inside a closure
			var descriptor = gOPD(proto, Symbol.toStringTag);
			if (!descriptor) {
				var superProto = getPrototypeOf(proto);
				// @ts-expect-error TS won't narrow inside a closure
				descriptor = gOPD(superProto, Symbol.toStringTag);
			}
			// @ts-expect-error TODO: fix
			cache['$' + typedArray] = callBind(descriptor.get);
		}
	});
} else {
	forEach(typedArrays, function (typedArray) {
		var arr = new g[typedArray]();
		var fn = arr.slice || arr.set;
		if (fn) {
			// @ts-expect-error TODO: fix
			cache['$' + typedArray] = callBind(fn);
		}
	});
}

/** @type {(value: object) => false | import('.').TypedArrayName} */
var tryTypedArrays = function tryAllTypedArrays(value) {
	/** @type {ReturnType<typeof tryAllTypedArrays>} */ var found = false;
	forEach(
		// eslint-disable-next-line no-extra-parens
		/** @type {Record<`\$${TypedArrayName}`, Getter>} */ /** @type {any} */ (cache),
		/** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
		function (getter, typedArray) {
			if (!found) {
				try {
				// @ts-expect-error TODO: fix
					if ('$' + getter(value) === typedArray) {
						found = $slice(typedArray, 1);
					}
				} catch (e) { /**/ }
			}
		}
	);
	return found;
};

/** @type {(value: object) => false | import('.').TypedArrayName} */
var trySlices = function tryAllSlices(value) {
	/** @type {ReturnType<typeof tryAllSlices>} */ var found = false;
	forEach(
		// eslint-disable-next-line no-extra-parens
		/** @type {Record<`\$${TypedArrayName}`, Getter>} */ /** @type {any} */ (cache),
		/** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) {
			if (!found) {
				try {
					// @ts-expect-error TODO: fix
					getter(value);
					found = $slice(name, 1);
				} catch (e) { /**/ }
			}
		}
	);
	return found;
};

/** @type {import('.')} */
module.exports = function whichTypedArray(value) {
	if (!value || typeof value !== 'object') { return false; }
	if (!hasToStringTag) {
		/** @type {string} */
		var tag = $slice($toString(value), 8, -1);
		if ($indexOf(typedArrays, tag) > -1) {
			return tag;
		}
		if (tag !== 'Object') {
			return false;
		}
		// node < 0.6 hits here on real Typed Arrays
		return trySlices(value);
	}
	if (!gOPD) { return null; } // unknown engine
	return tryTypedArrays(value);
};


/***/ }),

/***/ 2630:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/* provided dependency */ var process = __webpack_require__(5606);
// Currently in sync with Node.js lib/assert.js
// https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b
// Originally from narwhal.js (http://narwhaljs.org)
// Copyright (c) 2009 Thomas Robinson <280north.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the 'Software'), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var _require = __webpack_require__(3467),
    _require$codes = _require.codes,
    ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT,
    ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
    ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE,
    ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE,
    ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;

var AssertionError = __webpack_require__(2344);

var _require2 = __webpack_require__(166),
    inspect = _require2.inspect;

var _require$types = (__webpack_require__(166).types),
    isPromise = _require$types.isPromise,
    isRegExp = _require$types.isRegExp;

var objectAssign = Object.assign ? Object.assign : (__webpack_require__(9737).assign);
var objectIs = Object.is ? Object.is : __webpack_require__(911);
var errorCache = new Map();
var isDeepEqual;
var isDeepStrictEqual;
var parseExpressionAt;
var findNodeAround;
var decoder;

function lazyLoadComparison() {
  var comparison = __webpack_require__(1101);

  isDeepEqual = comparison.isDeepEqual;
  isDeepStrictEqual = comparison.isDeepStrictEqual;
} // Escape control characters but not \n and \t to keep the line breaks and
// indentation intact.
// eslint-disable-next-line no-control-regex


var escapeSequencesRegExp = /[\x00-\x08\x0b\x0c\x0e-\x1f]/g;
var meta = (/* unused pure expression or super */ null && (["\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", "\\u0006", "\\u0007", '\\b', '', '', "\\u000b", '\\f', '', "\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013", "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", "\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f"]));

var escapeFn = function escapeFn(str) {
  return meta[str.charCodeAt(0)];
};

var warned = false; // The assert module provides functions that throw
// AssertionError's when particular conditions are not met. The
// assert module must conform to the following interface.

var assert = module.exports = ok;
var NO_EXCEPTION_SENTINEL = {}; // All of the following functions must throw an AssertionError
// when a corresponding condition is not met, with a message that
// may be undefined if not provided. All assertion methods provide
// both the actual and expected values to the assertion error for
// display purposes.

function innerFail(obj) {
  if (obj.message instanceof Error) throw obj.message;
  throw new AssertionError(obj);
}

function fail(actual, expected, message, operator, stackStartFn) {
  var argsLen = arguments.length;
  var internalMessage;

  if (argsLen === 0) {
    internalMessage = 'Failed';
  } else if (argsLen === 1) {
    message = actual;
    actual = undefined;
  } else {
    if (warned === false) {
      warned = true;
      var warn = process.emitWarning ? process.emitWarning : console.warn.bind(console);
      warn('assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', 'DEP0094');
    }

    if (argsLen === 2) operator = '!=';
  }

  if (message instanceof Error) throw message;
  var errArgs = {
    actual: actual,
    expected: expected,
    operator: operator === undefined ? 'fail' : operator,
    stackStartFn: stackStartFn || fail
  };

  if (message !== undefined) {
    errArgs.message = message;
  }

  var err = new AssertionError(errArgs);

  if (internalMessage) {
    err.message = internalMessage;
    err.generatedMessage = true;
  }

  throw err;
}

assert.fail = fail; // The AssertionError is defined in internal/error.

assert.AssertionError = AssertionError;

function innerOk(fn, argLen, value, message) {
  if (!value) {
    var generatedMessage = false;

    if (argLen === 0) {
      generatedMessage = true;
      message = 'No value argument passed to `assert.ok()`';
    } else if (message instanceof Error) {
      throw message;
    }

    var err = new AssertionError({
      actual: value,
      expected: true,
      message: message,
      operator: '==',
      stackStartFn: fn
    });
    err.generatedMessage = generatedMessage;
    throw err;
  }
} // Pure assertion tests whether a value is truthy, as determined
// by !!value.


function ok() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }

  innerOk.apply(void 0, [ok, args.length].concat(args));
}

assert.ok = ok; // The equality assertion tests shallow, coercive equality with ==.

/* eslint-disable no-restricted-properties */

assert.equal = function equal(actual, expected, message) {
  if (arguments.length < 2) {
    throw new ERR_MISSING_ARGS('actual', 'expected');
  } // eslint-disable-next-line eqeqeq


  if (actual != expected) {
    innerFail({
      actual: actual,
      expected: expected,
      message: message,
      operator: '==',
      stackStartFn: equal
    });
  }
}; // The non-equality assertion tests for whether two objects are not
// equal with !=.


assert.notEqual = function notEqual(actual, expected, message) {
  if (arguments.length < 2) {
    throw new ERR_MISSING_ARGS('actual', 'expected');
  } // eslint-disable-next-line eqeqeq


  if (actual == expected) {
    innerFail({
      actual: actual,
      expected: expected,
      message: message,
      operator: '!=',
      stackStartFn: notEqual
    });
  }
}; // The equivalence assertion tests a deep equality relation.


assert.deepEqual = function deepEqual(actual, expected, message) {
  if (arguments.length < 2) {
    throw new ERR_MISSING_ARGS('actual', 'expected');
  }

  if (isDeepEqual === undefined) lazyLoadComparison();

  if (!isDeepEqual(actual, expected)) {
    innerFail({
      actual: actual,
      expected: expected,
      message: message,
      operator: 'deepEqual',
      stackStartFn: deepEqual
    });
  }
}; // The non-equivalence assertion tests for any deep inequality.


assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
  if (arguments.length < 2) {
    throw new ERR_MISSING_ARGS('actual', 'expected');
  }

  if (isDeepEqual === undefined) lazyLoadComparison();

  if (isDeepEqual(actual, expected)) {
    innerFail({
      actual: actual,
      expected: expected,
      message: message,
      operator: 'notDeepEqual',
      stackStartFn: notDeepEqual
    });
  }
};
/* eslint-enable */


assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
  if (arguments.length < 2) {
    throw new ERR_MISSING_ARGS('actual', 'expected');
  }

  if (isDeepEqual === undefined) lazyLoadComparison();

  if (!isDeepStrictEqual(actual, expected)) {
    innerFail({
      actual: actual,
      expected: expected,
      message: message,
      operator: 'deepStrictEqual',
      stackStartFn: deepStrictEqual
    });
  }
};

assert.notDeepStrictEqual = notDeepStrictEqual;

function notDeepStrictEqual(actual, expected, message) {
  if (arguments.length < 2) {
    throw new ERR_MISSING_ARGS('actual', 'expected');
  }

  if (isDeepEqual === undefined) lazyLoadComparison();

  if (isDeepStrictEqual(actual, expected)) {
    innerFail({
      actual: actual,
      expected: expected,
      message: message,
      operator: 'notDeepStrictEqual',
      stackStartFn: notDeepStrictEqual
    });
  }
}

assert.strictEqual = function strictEqual(actual, expected, message) {
  if (arguments.length < 2) {
    throw new ERR_MISSING_ARGS('actual', 'expected');
  }

  if (!objectIs(actual, expected)) {
    innerFail({
      actual: actual,
      expected: expected,
      message: message,
      operator: 'strictEqual',
      stackStartFn: strictEqual
    });
  }
};

assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
  if (arguments.length < 2) {
    throw new ERR_MISSING_ARGS('actual', 'expected');
  }

  if (objectIs(actual, expected)) {
    innerFail({
      actual: actual,
      expected: expected,
      message: message,
      operator: 'notStrictEqual',
      stackStartFn: notStrictEqual
    });
  }
};

var Comparison = function Comparison(obj, keys, actual) {
  var _this = this;

  _classCallCheck(this, Comparison);

  keys.forEach(function (key) {
    if (key in obj) {
      if (actual !== undefined && typeof actual[key] === 'string' && isRegExp(obj[key]) && obj[key].test(actual[key])) {
        _this[key] = actual[key];
      } else {
        _this[key] = obj[key];
      }
    }
  });
};

function compareExceptionKey(actual, expected, key, message, keys, fn) {
  if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {
    if (!message) {
      // Create placeholder objects to create a nice output.
      var a = new Comparison(actual, keys);
      var b = new Comparison(expected, keys, actual);
      var err = new AssertionError({
        actual: a,
        expected: b,
        operator: 'deepStrictEqual',
        stackStartFn: fn
      });
      err.actual = actual;
      err.expected = expected;
      err.operator = fn.name;
      throw err;
    }

    innerFail({
      actual: actual,
      expected: expected,
      message: message,
      operator: fn.name,
      stackStartFn: fn
    });
  }
}

function expectedException(actual, expected, msg, fn) {
  if (typeof expected !== 'function') {
    if (isRegExp(expected)) return expected.test(actual); // assert.doesNotThrow does not accept objects.

    if (arguments.length === 2) {
      throw new ERR_INVALID_ARG_TYPE('expected', ['Function', 'RegExp'], expected);
    } // Handle primitives properly.


    if (_typeof(actual) !== 'object' || actual === null) {
      var err = new AssertionError({
        actual: actual,
        expected: expected,
        message: msg,
        operator: 'deepStrictEqual',
        stackStartFn: fn
      });
      err.operator = fn.name;
      throw err;
    }

    var keys = Object.keys(expected); // Special handle errors to make sure the name and the message are compared
    // as well.

    if (expected instanceof Error) {
      keys.push('name', 'message');
    } else if (keys.length === 0) {
      throw new ERR_INVALID_ARG_VALUE('error', expected, 'may not be an empty object');
    }

    if (isDeepEqual === undefined) lazyLoadComparison();
    keys.forEach(function (key) {
      if (typeof actual[key] === 'string' && isRegExp(expected[key]) && expected[key].test(actual[key])) {
        return;
      }

      compareExceptionKey(actual, expected, key, msg, keys, fn);
    });
    return true;
  } // Guard instanceof against arrow functions as they don't have a prototype.


  if (expected.prototype !== undefined && actual instanceof expected) {
    return true;
  }

  if (Error.isPrototypeOf(expected)) {
    return false;
  }

  return expected.call({}, actual) === true;
}

function getActual(fn) {
  if (typeof fn !== 'function') {
    throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn);
  }

  try {
    fn();
  } catch (e) {
    return e;
  }

  return NO_EXCEPTION_SENTINEL;
}

function checkIsPromise(obj) {
  // Accept native ES6 promises and promises that are implemented in a similar
  // way. Do not accept thenables that use a function as `obj` and that have no
  // `catch` handler.
  // TODO: thenables are checked up until they have the correct methods,
  // but according to documentation, the `then` method should receive
  // the `fulfill` and `reject` arguments as well or it may be never resolved.
  return isPromise(obj) || obj !== null && _typeof(obj) === 'object' && typeof obj.then === 'function' && typeof obj.catch === 'function';
}

function waitForActual(promiseFn) {
  return Promise.resolve().then(function () {
    var resultPromise;

    if (typeof promiseFn === 'function') {
      // Return a rejected promise if `promiseFn` throws synchronously.
      resultPromise = promiseFn(); // Fail in case no promise is returned.

      if (!checkIsPromise(resultPromise)) {
        throw new ERR_INVALID_RETURN_VALUE('instance of Promise', 'promiseFn', resultPromise);
      }
    } else if (checkIsPromise(promiseFn)) {
      resultPromise = promiseFn;
    } else {
      throw new ERR_INVALID_ARG_TYPE('promiseFn', ['Function', 'Promise'], promiseFn);
    }

    return Promise.resolve().then(function () {
      return resultPromise;
    }).then(function () {
      return NO_EXCEPTION_SENTINEL;
    }).catch(function (e) {
      return e;
    });
  });
}

function expectsError(stackStartFn, actual, error, message) {
  if (typeof error === 'string') {
    if (arguments.length === 4) {
      throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);
    }

    if (_typeof(actual) === 'object' && actual !== null) {
      if (actual.message === error) {
        throw new ERR_AMBIGUOUS_ARGUMENT('error/message', "The error message \"".concat(actual.message, "\" is identical to the message."));
      }
    } else if (actual === error) {
      throw new ERR_AMBIGUOUS_ARGUMENT('error/message', "The error \"".concat(actual, "\" is identical to the message."));
    }

    message = error;
    error = undefined;
  } else if (error != null && _typeof(error) !== 'object' && typeof error !== 'function') {
    throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error);
  }

  if (actual === NO_EXCEPTION_SENTINEL) {
    var details = '';

    if (error && error.name) {
      details += " (".concat(error.name, ")");
    }

    details += message ? ": ".concat(message) : '.';
    var fnType = stackStartFn.name === 'rejects' ? 'rejection' : 'exception';
    innerFail({
      actual: undefined,
      expected: error,
      operator: stackStartFn.name,
      message: "Missing expected ".concat(fnType).concat(details),
      stackStartFn: stackStartFn
    });
  }

  if (error && !expectedException(actual, error, message, stackStartFn)) {
    throw actual;
  }
}

function expectsNoError(stackStartFn, actual, error, message) {
  if (actual === NO_EXCEPTION_SENTINEL) return;

  if (typeof error === 'string') {
    message = error;
    error = undefined;
  }

  if (!error || expectedException(actual, error)) {
    var details = message ? ": ".concat(message) : '.';
    var fnType = stackStartFn.name === 'doesNotReject' ? 'rejection' : 'exception';
    innerFail({
      actual: actual,
      expected: error,
      operator: stackStartFn.name,
      message: "Got unwanted ".concat(fnType).concat(details, "\n") + "Actual message: \"".concat(actual && actual.message, "\""),
      stackStartFn: stackStartFn
    });
  }

  throw actual;
}

assert.throws = function throws(promiseFn) {
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
    args[_key2 - 1] = arguments[_key2];
  }

  expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));
};

assert.rejects = function rejects(promiseFn) {
  for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
    args[_key3 - 1] = arguments[_key3];
  }

  return waitForActual(promiseFn).then(function (result) {
    return expectsError.apply(void 0, [rejects, result].concat(args));
  });
};

assert.doesNotThrow = function doesNotThrow(fn) {
  for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
    args[_key4 - 1] = arguments[_key4];
  }

  expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));
};

assert.doesNotReject = function doesNotReject(fn) {
  for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
    args[_key5 - 1] = arguments[_key5];
  }

  return waitForActual(fn).then(function (result) {
    return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));
  });
};

assert.ifError = function ifError(err) {
  if (err !== null && err !== undefined) {
    var message = 'ifError got unwanted exception: ';

    if (_typeof(err) === 'object' && typeof err.message === 'string') {
      if (err.message.length === 0 && err.constructor) {
        message += err.constructor.name;
      } else {
        message += err.message;
      }
    } else {
      message += inspect(err);
    }

    var newErr = new AssertionError({
      actual: err,
      expected: null,
      operator: 'ifError',
      message: message,
      stackStartFn: ifError
    }); // Make sure we actually have a stack trace!

    var origStack = err.stack;

    if (typeof origStack === 'string') {
      // This will remove any duplicated frames from the error frames taken
      // from within `ifError` and add the original error frames to the newly
      // created ones.
      var tmp2 = origStack.split('\n');
      tmp2.shift(); // Filter all frames existing in err.stack.

      var tmp1 = newErr.stack.split('\n');

      for (var i = 0; i < tmp2.length; i++) {
        // Find the first occurrence of the frame.
        var pos = tmp1.indexOf(tmp2[i]);

        if (pos !== -1) {
          // Only keep new frames.
          tmp1 = tmp1.slice(0, pos);
          break;
        }
      }

      newErr.stack = "".concat(tmp1.join('\n'), "\n").concat(tmp2.join('\n'));
    }

    throw newErr;
  }
}; // Expose a strict only variant of assert


function strict() {
  for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
    args[_key6] = arguments[_key6];
  }

  innerOk.apply(void 0, [strict, args.length].concat(args));
}

assert.strict = objectAssign(strict, assert, {
  equal: assert.strictEqual,
  deepEqual: assert.deepStrictEqual,
  notEqual: assert.notStrictEqual,
  notDeepEqual: assert.notDeepStrictEqual
});
assert.strict.strict = assert.strict;

/***/ }),

/***/ 2344:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/* provided dependency */ var process = __webpack_require__(5606);
// Currently in sync with Node.js lib/internal/assert/assertion_error.js
// https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c


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(target, key, 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; }

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 _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }

function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }

function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

var _require = __webpack_require__(166),
    inspect = _require.inspect;

var _require2 = __webpack_require__(3467),
    ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE; // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith


function endsWith(str, search, this_len) {
  if (this_len === undefined || this_len > str.length) {
    this_len = str.length;
  }

  return str.substring(this_len - search.length, this_len) === search;
} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat


function repeat(str, count) {
  count = Math.floor(count);
  if (str.length == 0 || count == 0) return '';
  var maxCount = str.length * count;
  count = Math.floor(Math.log(count) / Math.log(2));

  while (count) {
    str += str;
    count--;
  }

  str += str.substring(0, maxCount - str.length);
  return str;
}

var blue = '';
var green = '';
var red = '';
var white = '';
var kReadableOperator = {
  deepStrictEqual: 'Expected values to be strictly deep-equal:',
  strictEqual: 'Expected values to be strictly equal:',
  strictEqualObject: 'Expected "actual" to be reference-equal to "expected":',
  deepEqual: 'Expected values to be loosely deep-equal:',
  equal: 'Expected values to be loosely equal:',
  notDeepStrictEqual: 'Expected "actual" not to be strictly deep-equal to:',
  notStrictEqual: 'Expected "actual" to be strictly unequal to:',
  notStrictEqualObject: 'Expected "actual" not to be reference-equal to "expected":',
  notDeepEqual: 'Expected "actual" not to be loosely deep-equal to:',
  notEqual: 'Expected "actual" to be loosely unequal to:',
  notIdentical: 'Values identical but not reference-equal:'
}; // Comparing short primitives should just show === / !== instead of using the
// diff.

var kMaxShortLength = 10;

function copyError(source) {
  var keys = Object.keys(source);
  var target = Object.create(Object.getPrototypeOf(source));
  keys.forEach(function (key) {
    target[key] = source[key];
  });
  Object.defineProperty(target, 'message', {
    value: source.message
  });
  return target;
}

function inspectValue(val) {
  // The util.inspect default values could be changed. This makes sure the
  // error messages contain the necessary information nevertheless.
  return inspect(val, {
    compact: false,
    customInspect: false,
    depth: 1000,
    maxArrayLength: Infinity,
    // Assert compares only enumerable properties (with a few exceptions).
    showHidden: false,
    // Having a long line as error is better than wrapping the line for
    // comparison for now.
    // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we
    // have meta information about the inspected properties (i.e., know where
    // in what line the property starts and ends).
    breakLength: Infinity,
    // Assert does not detect proxies currently.
    showProxy: false,
    sorted: true,
    // Inspect getters as we also check them when comparing entries.
    getters: true
  });
}

function createErrDiff(actual, expected, operator) {
  var other = '';
  var res = '';
  var lastPos = 0;
  var end = '';
  var skipped = false;
  var actualInspected = inspectValue(actual);
  var actualLines = actualInspected.split('\n');
  var expectedLines = inspectValue(expected).split('\n');
  var i = 0;
  var indicator = ''; // In case both values are objects explicitly mark them as not reference equal
  // for the `strictEqual` operator.

  if (operator === 'strictEqual' && _typeof(actual) === 'object' && _typeof(expected) === 'object' && actual !== null && expected !== null) {
    operator = 'strictEqualObject';
  } // If "actual" and "expected" fit on a single line and they are not strictly
  // equal, check further special handling.


  if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {
    var inputLength = actualLines[0].length + expectedLines[0].length; // If the character length of "actual" and "expected" together is less than
    // kMaxShortLength and if neither is an object and at least one of them is
    // not `zero`, use the strict equal comparison to visualize the output.

    if (inputLength <= kMaxShortLength) {
      if ((_typeof(actual) !== 'object' || actual === null) && (_typeof(expected) !== 'object' || expected === null) && (actual !== 0 || expected !== 0)) {
        // -0 === +0
        return "".concat(kReadableOperator[operator], "\n\n") + "".concat(actualLines[0], " !== ").concat(expectedLines[0], "\n");
      }
    } else if (operator !== 'strictEqualObject') {
      // If the stderr is a tty and the input length is lower than the current
      // columns per line, add a mismatch indicator below the output. If it is
      // not a tty, use a default value of 80 characters.
      var maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;

      if (inputLength < maxLength) {
        while (actualLines[0][i] === expectedLines[0][i]) {
          i++;
        } // Ignore the first characters.


        if (i > 2) {
          // Add position indicator for the first mismatch in case it is a
          // single line and the input length is less than the column length.
          indicator = "\n  ".concat(repeat(' ', i), "^");
          i = 0;
        }
      }
    }
  } // Remove all ending lines that match (this optimizes the output for
  // readability by reducing the number of total changed lines).


  var a = actualLines[actualLines.length - 1];
  var b = expectedLines[expectedLines.length - 1];

  while (a === b) {
    if (i++ < 2) {
      end = "\n  ".concat(a).concat(end);
    } else {
      other = a;
    }

    actualLines.pop();
    expectedLines.pop();
    if (actualLines.length === 0 || expectedLines.length === 0) break;
    a = actualLines[actualLines.length - 1];
    b = expectedLines[expectedLines.length - 1];
  }

  var maxLines = Math.max(actualLines.length, expectedLines.length); // Strict equal with identical objects that are not identical by reference.
  // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })

  if (maxLines === 0) {
    // We have to get the result again. The lines were all removed before.
    var _actualLines = actualInspected.split('\n'); // Only remove lines in case it makes sense to collapse those.
    // TODO: Accept env to always show the full error.


    if (_actualLines.length > 30) {
      _actualLines[26] = "".concat(blue, "...").concat(white);

      while (_actualLines.length > 27) {
        _actualLines.pop();
      }
    }

    return "".concat(kReadableOperator.notIdentical, "\n\n").concat(_actualLines.join('\n'), "\n");
  }

  if (i > 3) {
    end = "\n".concat(blue, "...").concat(white).concat(end);
    skipped = true;
  }

  if (other !== '') {
    end = "\n  ".concat(other).concat(end);
    other = '';
  }

  var printedLines = 0;
  var msg = kReadableOperator[operator] + "\n".concat(green, "+ actual").concat(white, " ").concat(red, "- expected").concat(white);
  var skippedMsg = " ".concat(blue, "...").concat(white, " Lines skipped");

  for (i = 0; i < maxLines; i++) {
    // Only extra expected lines exist
    var cur = i - lastPos;

    if (actualLines.length < i + 1) {
      // If the last diverging line is more than one line above and the
      // current line is at least line three, add some of the former lines and
      // also add dots to indicate skipped entries.
      if (cur > 1 && i > 2) {
        if (cur > 4) {
          res += "\n".concat(blue, "...").concat(white);
          skipped = true;
        } else if (cur > 3) {
          res += "\n  ".concat(expectedLines[i - 2]);
          printedLines++;
        }

        res += "\n  ".concat(expectedLines[i - 1]);
        printedLines++;
      } // Mark the current line as the last diverging one.


      lastPos = i; // Add the expected line to the cache.

      other += "\n".concat(red, "-").concat(white, " ").concat(expectedLines[i]);
      printedLines++; // Only extra actual lines exist
    } else if (expectedLines.length < i + 1) {
      // If the last diverging line is more than one line above and the
      // current line is at least line three, add some of the former lines and
      // also add dots to indicate skipped entries.
      if (cur > 1 && i > 2) {
        if (cur > 4) {
          res += "\n".concat(blue, "...").concat(white);
          skipped = true;
        } else if (cur > 3) {
          res += "\n  ".concat(actualLines[i - 2]);
          printedLines++;
        }

        res += "\n  ".concat(actualLines[i - 1]);
        printedLines++;
      } // Mark the current line as the last diverging one.


      lastPos = i; // Add the actual line to the result.

      res += "\n".concat(green, "+").concat(white, " ").concat(actualLines[i]);
      printedLines++; // Lines diverge
    } else {
      var expectedLine = expectedLines[i];
      var actualLine = actualLines[i]; // If the lines diverge, specifically check for lines that only diverge by
      // a trailing comma. In that case it is actually identical and we should
      // mark it as such.

      var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ',') || actualLine.slice(0, -1) !== expectedLine); // If the expected line has a trailing comma but is otherwise identical,
      // add a comma at the end of the actual line. Otherwise the output could
      // look weird as in:
      //
      //   [
      //     1         // No comma at the end!
      // +   2
      //   ]
      //

      if (divergingLines && endsWith(expectedLine, ',') && expectedLine.slice(0, -1) === actualLine) {
        divergingLines = false;
        actualLine += ',';
      }

      if (divergingLines) {
        // If the last diverging line is more than one line above and the
        // current line is at least line three, add some of the former lines and
        // also add dots to indicate skipped entries.
        if (cur > 1 && i > 2) {
          if (cur > 4) {
            res += "\n".concat(blue, "...").concat(white);
            skipped = true;
          } else if (cur > 3) {
            res += "\n  ".concat(actualLines[i - 2]);
            printedLines++;
          }

          res += "\n  ".concat(actualLines[i - 1]);
          printedLines++;
        } // Mark the current line as the last diverging one.


        lastPos = i; // Add the actual line to the result and cache the expected diverging
        // line so consecutive diverging lines show up as +++--- and not +-+-+-.

        res += "\n".concat(green, "+").concat(white, " ").concat(actualLine);
        other += "\n".concat(red, "-").concat(white, " ").concat(expectedLine);
        printedLines += 2; // Lines are identical
      } else {
        // Add all cached information to the result before adding other things
        // and reset the cache.
        res += other;
        other = ''; // If the last diverging line is exactly one line above or if it is the
        // very first line, add the line to the result.

        if (cur === 1 || i === 0) {
          res += "\n  ".concat(actualLine);
          printedLines++;
        }
      }
    } // Inspected object to big (Show ~20 rows max)


    if (printedLines > 20 && i < maxLines - 2) {
      return "".concat(msg).concat(skippedMsg, "\n").concat(res, "\n").concat(blue, "...").concat(white).concat(other, "\n") + "".concat(blue, "...").concat(white);
    }
  }

  return "".concat(msg).concat(skipped ? skippedMsg : '', "\n").concat(res).concat(other).concat(end).concat(indicator);
}

var AssertionError =
/*#__PURE__*/
function (_Error) {
  _inherits(AssertionError, _Error);

  function AssertionError(options) {
    var _this;

    _classCallCheck(this, AssertionError);

    if (_typeof(options) !== 'object' || options === null) {
      throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
    }

    var message = options.message,
        operator = options.operator,
        stackStartFn = options.stackStartFn;
    var actual = options.actual,
        expected = options.expected;
    var limit = Error.stackTraceLimit;
    Error.stackTraceLimit = 0;

    if (message != null) {
      _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, String(message)));
    } else {
      if (process.stderr && process.stderr.isTTY) {
        // Reset on each call to make sure we handle dynamically set environment
        // variables correct.
        if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) {
          blue = "\x1B[34m";
          green = "\x1B[32m";
          white = "\x1B[39m";
          red = "\x1B[31m";
        } else {
          blue = '';
          green = '';
          white = '';
          red = '';
        }
      } // Prevent the error stack from being visible by duplicating the error
      // in a very close way to the original in case both sides are actually
      // instances of Error.


      if (_typeof(actual) === 'object' && actual !== null && _typeof(expected) === 'object' && expected !== null && 'stack' in actual && actual instanceof Error && 'stack' in expected && expected instanceof Error) {
        actual = copyError(actual);
        expected = copyError(expected);
      }

      if (operator === 'deepStrictEqual' || operator === 'strictEqual') {
        _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, createErrDiff(actual, expected, operator)));
      } else if (operator === 'notDeepStrictEqual' || operator === 'notStrictEqual') {
        // In case the objects are equal but the operator requires unequal, show
        // the first object and say A equals B
        var base = kReadableOperator[operator];
        var res = inspectValue(actual).split('\n'); // In case "actual" is an object, it should not be reference equal.

        if (operator === 'notStrictEqual' && _typeof(actual) === 'object' && actual !== null) {
          base = kReadableOperator.notStrictEqualObject;
        } // Only remove lines in case it makes sense to collapse those.
        // TODO: Accept env to always show the full error.


        if (res.length > 30) {
          res[26] = "".concat(blue, "...").concat(white);

          while (res.length > 27) {
            res.pop();
          }
        } // Only print a single input.


        if (res.length === 1) {
          _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, "".concat(base, " ").concat(res[0])));
        } else {
          _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, "".concat(base, "\n\n").concat(res.join('\n'), "\n")));
        }
      } else {
        var _res = inspectValue(actual);

        var other = '';
        var knownOperators = kReadableOperator[operator];

        if (operator === 'notDeepEqual' || operator === 'notEqual') {
          _res = "".concat(kReadableOperator[operator], "\n\n").concat(_res);

          if (_res.length > 1024) {
            _res = "".concat(_res.slice(0, 1021), "...");
          }
        } else {
          other = "".concat(inspectValue(expected));

          if (_res.length > 512) {
            _res = "".concat(_res.slice(0, 509), "...");
          }

          if (other.length > 512) {
            other = "".concat(other.slice(0, 509), "...");
          }

          if (operator === 'deepEqual' || operator === 'equal') {
            _res = "".concat(knownOperators, "\n\n").concat(_res, "\n\nshould equal\n\n");
          } else {
            other = " ".concat(operator, " ").concat(other);
          }
        }

        _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, "".concat(_res).concat(other)));
      }
    }

    Error.stackTraceLimit = limit;
    _this.generatedMessage = !message;
    Object.defineProperty(_assertThisInitialized(_this), 'name', {
      value: 'AssertionError [ERR_ASSERTION]',
      enumerable: false,
      writable: true,
      configurable: true
    });
    _this.code = 'ERR_ASSERTION';
    _this.actual = actual;
    _this.expected = expected;
    _this.operator = operator;

    if (Error.captureStackTrace) {
      // eslint-disable-next-line no-restricted-syntax
      Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn);
    } // Create error message including the error code in the name.


    _this.stack; // Reset the name.

    _this.name = 'AssertionError';
    return _possibleConstructorReturn(_this);
  }

  _createClass(AssertionError, [{
    key: "toString",
    value: function toString() {
      return "".concat(this.name, " [").concat(this.code, "]: ").concat(this.message);
    }
  }, {
    key: inspect.custom,
    value: function value(recurseTimes, ctx) {
      // This limits the `actual` and `expected` property default inspection to
      // the minimum depth. Otherwise those values would be too verbose compared
      // to the actual error message which contains a combined view of these two
      // input values.
      return inspect(this, _objectSpread({}, ctx, {
        customInspect: false,
        depth: 0
      }));
    }
  }]);

  return AssertionError;
}(_wrapNativeSuper(Error));

module.exports = AssertionError;

/***/ }),

/***/ 3467:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
// Currently in sync with Node.js lib/internal/errors.js
// https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f

/* eslint node-core/documented-errors: "error" */

/* eslint node-core/alphabetize-errors: "error" */

/* eslint node-core/prefer-util-format-errors: "error" */
 // The whole point behind this internal module is to allow Node.js to no
// longer be forced to treat every error message change as a semver-major
// change. The NodeError classes here all expose a `code` property whose
// value statically and permanently identifies the error. While the error
// message may change, the code should not.

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

var codes = {}; // Lazy loaded

var assert;
var util;

function createErrorType(code, message, Base) {
  if (!Base) {
    Base = Error;
  }

  function getMessage(arg1, arg2, arg3) {
    if (typeof message === 'string') {
      return message;
    } else {
      return message(arg1, arg2, arg3);
    }
  }

  var NodeError =
  /*#__PURE__*/
  function (_Base) {
    _inherits(NodeError, _Base);

    function NodeError(arg1, arg2, arg3) {
      var _this;

      _classCallCheck(this, NodeError);

      _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError).call(this, getMessage(arg1, arg2, arg3)));
      _this.code = code;
      return _this;
    }

    return NodeError;
  }(Base);

  codes[code] = NodeError;
} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js


function oneOf(expected, thing) {
  if (Array.isArray(expected)) {
    var len = expected.length;
    expected = expected.map(function (i) {
      return String(i);
    });

    if (len > 2) {
      return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1];
    } else if (len === 2) {
      return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
    } else {
      return "of ".concat(thing, " ").concat(expected[0]);
    }
  } else {
    return "of ".concat(thing, " ").concat(String(expected));
  }
} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith


function startsWith(str, search, pos) {
  return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith


function endsWith(str, search, this_len) {
  if (this_len === undefined || this_len > str.length) {
    this_len = str.length;
  }

  return str.substring(this_len - search.length, this_len) === search;
} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes


function includes(str, search, start) {
  if (typeof start !== 'number') {
    start = 0;
  }

  if (start + search.length > str.length) {
    return false;
  } else {
    return str.indexOf(search, start) !== -1;
  }
}

createErrorType('ERR_AMBIGUOUS_ARGUMENT', 'The "%s" argument is ambiguous. %s', TypeError);
createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
  if (assert === undefined) assert = __webpack_require__(2630);
  assert(typeof name === 'string', "'name' must be a string"); // determiner: 'must be' or 'must not be'

  var determiner;

  if (typeof expected === 'string' && startsWith(expected, 'not ')) {
    determiner = 'must not be';
    expected = expected.replace(/^not /, '');
  } else {
    determiner = 'must be';
  }

  var msg;

  if (endsWith(name, ' argument')) {
    // For cases like 'first argument'
    msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
  } else {
    var type = includes(name, '.') ? 'property' : 'argument';
    msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
  } // TODO(BridgeAR): Improve the output by showing `null` and similar.


  msg += ". Received type ".concat(_typeof(actual));
  return msg;
}, TypeError);
createErrorType('ERR_INVALID_ARG_VALUE', function (name, value) {
  var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid';
  if (util === undefined) util = __webpack_require__(166);
  var inspected = util.inspect(value);

  if (inspected.length > 128) {
    inspected = "".concat(inspected.slice(0, 128), "...");
  }

  return "The argument '".concat(name, "' ").concat(reason, ". Received ").concat(inspected);
}, TypeError, RangeError);
createErrorType('ERR_INVALID_RETURN_VALUE', function (input, name, value) {
  var type;

  if (value && value.constructor && value.constructor.name) {
    type = "instance of ".concat(value.constructor.name);
  } else {
    type = "type ".concat(_typeof(value));
  }

  return "Expected ".concat(input, " to be returned from the \"").concat(name, "\"") + " function but got ".concat(type, ".");
}, TypeError);
createErrorType('ERR_MISSING_ARGS', function () {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }

  if (assert === undefined) assert = __webpack_require__(2630);
  assert(args.length > 0, 'At least one arg needs to be specified');
  var msg = 'The ';
  var len = args.length;
  args = args.map(function (a) {
    return "\"".concat(a, "\"");
  });

  switch (len) {
    case 1:
      msg += "".concat(args[0], " argument");
      break;

    case 2:
      msg += "".concat(args[0], " and ").concat(args[1], " arguments");
      break;

    default:
      msg += args.slice(0, len - 1).join(', ');
      msg += ", and ".concat(args[len - 1], " arguments");
      break;
  }

  return "".concat(msg, " must be specified");
}, TypeError);
module.exports.codes = codes;

/***/ }),

/***/ 1101:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
// Currently in sync with Node.js lib/internal/util/comparisons.js
// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9


function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }

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 _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

var regexFlagsSupported = /a/g.flags !== undefined;

var arrayFromSet = function arrayFromSet(set) {
  var array = [];
  set.forEach(function (value) {
    return array.push(value);
  });
  return array;
};

var arrayFromMap = function arrayFromMap(map) {
  var array = [];
  map.forEach(function (value, key) {
    return array.push([key, value]);
  });
  return array;
};

var objectIs = Object.is ? Object.is : __webpack_require__(911);
var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function () {
  return [];
};
var numberIsNaN = Number.isNaN ? Number.isNaN : __webpack_require__(5179);

function uncurryThis(f) {
  return f.call.bind(f);
}

var hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);
var propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable);
var objectToString = uncurryThis(Object.prototype.toString);

var _require$types = (__webpack_require__(166).types),
    isAnyArrayBuffer = _require$types.isAnyArrayBuffer,
    isArrayBufferView = _require$types.isArrayBufferView,
    isDate = _require$types.isDate,
    isMap = _require$types.isMap,
    isRegExp = _require$types.isRegExp,
    isSet = _require$types.isSet,
    isNativeError = _require$types.isNativeError,
    isBoxedPrimitive = _require$types.isBoxedPrimitive,
    isNumberObject = _require$types.isNumberObject,
    isStringObject = _require$types.isStringObject,
    isBooleanObject = _require$types.isBooleanObject,
    isBigIntObject = _require$types.isBigIntObject,
    isSymbolObject = _require$types.isSymbolObject,
    isFloat32Array = _require$types.isFloat32Array,
    isFloat64Array = _require$types.isFloat64Array;

function isNonIndex(key) {
  if (key.length === 0 || key.length > 10) return true;

  for (var i = 0; i < key.length; i++) {
    var code = key.charCodeAt(i);
    if (code < 48 || code > 57) return true;
  } // The maximum size for an array is 2 ** 32 -1.


  return key.length === 10 && key >= Math.pow(2, 32);
}

function getOwnNonIndexProperties(value) {
  return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));
} // Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
// original notice:

/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */


function compare(a, b) {
  if (a === b) {
    return 0;
  }

  var x = a.length;
  var y = b.length;

  for (var i = 0, len = Math.min(x, y); i < len; ++i) {
    if (a[i] !== b[i]) {
      x = a[i];
      y = b[i];
      break;
    }
  }

  if (x < y) {
    return -1;
  }

  if (y < x) {
    return 1;
  }

  return 0;
}

var ONLY_ENUMERABLE = undefined;
var kStrict = true;
var kLoose = false;
var kNoIterator = 0;
var kIsArray = 1;
var kIsSet = 2;
var kIsMap = 3; // Check if they have the same source and flags

function areSimilarRegExps(a, b) {
  return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);
}

function areSimilarFloatArrays(a, b) {
  if (a.byteLength !== b.byteLength) {
    return false;
  }

  for (var offset = 0; offset < a.byteLength; offset++) {
    if (a[offset] !== b[offset]) {
      return false;
    }
  }

  return true;
}

function areSimilarTypedArrays(a, b) {
  if (a.byteLength !== b.byteLength) {
    return false;
  }

  return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;
}

function areEqualArrayBuffers(buf1, buf2) {
  return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;
}

function isEqualBoxedPrimitive(val1, val2) {
  if (isNumberObject(val1)) {
    return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));
  }

  if (isStringObject(val1)) {
    return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);
  }

  if (isBooleanObject(val1)) {
    return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);
  }

  if (isBigIntObject(val1)) {
    return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);
  }

  return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);
} // Notes: Type tags are historical [[Class]] properties that can be set by
// FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS
// and retrieved using Object.prototype.toString.call(obj) in JS
// See https://tc39.github.io/ecma262/#sec-object.prototype.tostring
// for a list of tags pre-defined in the spec.
// There are some unspecified tags in the wild too (e.g. typed array tags).
// Since tags can be altered, they only serve fast failures
//
// Typed arrays and buffers are checked by comparing the content in their
// underlying ArrayBuffer. This optimization requires that it's
// reasonable to interpret their underlying memory in the same way,
// which is checked by comparing their type tags.
// (e.g. a Uint8Array and a Uint16Array with the same memory content
// could still be different because they will be interpreted differently).
//
// For strict comparison, objects should have
// a) The same built-in type tags
// b) The same prototypes.


function innerDeepEqual(val1, val2, strict, memos) {
  // All identical values are equivalent, as determined by ===.
  if (val1 === val2) {
    if (val1 !== 0) return true;
    return strict ? objectIs(val1, val2) : true;
  } // Check more closely if val1 and val2 are equal.


  if (strict) {
    if (_typeof(val1) !== 'object') {
      return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2);
    }

    if (_typeof(val2) !== 'object' || val1 === null || val2 === null) {
      return false;
    }

    if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {
      return false;
    }
  } else {
    if (val1 === null || _typeof(val1) !== 'object') {
      if (val2 === null || _typeof(val2) !== 'object') {
        // eslint-disable-next-line eqeqeq
        return val1 == val2;
      }

      return false;
    }

    if (val2 === null || _typeof(val2) !== 'object') {
      return false;
    }
  }

  var val1Tag = objectToString(val1);
  var val2Tag = objectToString(val2);

  if (val1Tag !== val2Tag) {
    return false;
  }

  if (Array.isArray(val1)) {
    // Check for sparse arrays and general fast path
    if (val1.length !== val2.length) {
      return false;
    }

    var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);
    var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);

    if (keys1.length !== keys2.length) {
      return false;
    }

    return keyCheck(val1, val2, strict, memos, kIsArray, keys1);
  } // [browserify] This triggers on certain types in IE (Map/Set) so we don't
  // wan't to early return out of the rest of the checks. However we can check
  // if the second value is one of these values and the first isn't.


  if (val1Tag === '[object Object]') {
    // return keyCheck(val1, val2, strict, memos, kNoIterator);
    if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {
      return false;
    }
  }

  if (isDate(val1)) {
    if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {
      return false;
    }
  } else if (isRegExp(val1)) {
    if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {
      return false;
    }
  } else if (isNativeError(val1) || val1 instanceof Error) {
    // Do not compare the stack as it might differ even though the error itself
    // is otherwise identical.
    if (val1.message !== val2.message || val1.name !== val2.name) {
      return false;
    }
  } else if (isArrayBufferView(val1)) {
    if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {
      if (!areSimilarFloatArrays(val1, val2)) {
        return false;
      }
    } else if (!areSimilarTypedArrays(val1, val2)) {
      return false;
    } // Buffer.compare returns true, so val1.length === val2.length. If they both
    // only contain numeric keys, we don't need to exam further than checking
    // the symbols.


    var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);

    var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);

    if (_keys.length !== _keys2.length) {
      return false;
    }

    return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);
  } else if (isSet(val1)) {
    if (!isSet(val2) || val1.size !== val2.size) {
      return false;
    }

    return keyCheck(val1, val2, strict, memos, kIsSet);
  } else if (isMap(val1)) {
    if (!isMap(val2) || val1.size !== val2.size) {
      return false;
    }

    return keyCheck(val1, val2, strict, memos, kIsMap);
  } else if (isAnyArrayBuffer(val1)) {
    if (!areEqualArrayBuffers(val1, val2)) {
      return false;
    }
  } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {
    return false;
  }

  return keyCheck(val1, val2, strict, memos, kNoIterator);
}

function getEnumerables(val, keys) {
  return keys.filter(function (k) {
    return propertyIsEnumerable(val, k);
  });
}

function keyCheck(val1, val2, strict, memos, iterationType, aKeys) {
  // For all remaining Object pairs, including Array, objects and Maps,
  // equivalence is determined by having:
  // a) The same number of owned enumerable properties
  // b) The same set of keys/indexes (although not necessarily the same order)
  // c) Equivalent values for every corresponding key/index
  // d) For Sets and Maps, equal contents
  // Note: this accounts for both named and indexed properties on Arrays.
  if (arguments.length === 5) {
    aKeys = Object.keys(val1);
    var bKeys = Object.keys(val2); // The pair must have the same number of owned properties.

    if (aKeys.length !== bKeys.length) {
      return false;
    }
  } // Cheap key test


  var i = 0;

  for (; i < aKeys.length; i++) {
    if (!hasOwnProperty(val2, aKeys[i])) {
      return false;
    }
  }

  if (strict && arguments.length === 5) {
    var symbolKeysA = objectGetOwnPropertySymbols(val1);

    if (symbolKeysA.length !== 0) {
      var count = 0;

      for (i = 0; i < symbolKeysA.length; i++) {
        var key = symbolKeysA[i];

        if (propertyIsEnumerable(val1, key)) {
          if (!propertyIsEnumerable(val2, key)) {
            return false;
          }

          aKeys.push(key);
          count++;
        } else if (propertyIsEnumerable(val2, key)) {
          return false;
        }
      }

      var symbolKeysB = objectGetOwnPropertySymbols(val2);

      if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) {
        return false;
      }
    } else {
      var _symbolKeysB = objectGetOwnPropertySymbols(val2);

      if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) {
        return false;
      }
    }
  }

  if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) {
    return true;
  } // Use memos to handle cycles.


  if (memos === undefined) {
    memos = {
      val1: new Map(),
      val2: new Map(),
      position: 0
    };
  } else {
    // We prevent up to two map.has(x) calls by directly retrieving the value
    // and checking for undefined. The map can only contain numbers, so it is
    // safe to check for undefined only.
    var val2MemoA = memos.val1.get(val1);

    if (val2MemoA !== undefined) {
      var val2MemoB = memos.val2.get(val2);

      if (val2MemoB !== undefined) {
        return val2MemoA === val2MemoB;
      }
    }

    memos.position++;
  }

  memos.val1.set(val1, memos.position);
  memos.val2.set(val2, memos.position);
  var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);
  memos.val1.delete(val1);
  memos.val2.delete(val2);
  return areEq;
}

function setHasEqualElement(set, val1, strict, memo) {
  // Go looking.
  var setValues = arrayFromSet(set);

  for (var i = 0; i < setValues.length; i++) {
    var val2 = setValues[i];

    if (innerDeepEqual(val1, val2, strict, memo)) {
      // Remove the matching element to make sure we do not check that again.
      set.delete(val2);
      return true;
    }
  }

  return false;
} // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using
// Sadly it is not possible to detect corresponding values properly in case the
// type is a string, number, bigint or boolean. The reason is that those values
// can match lots of different string values (e.g., 1n == '+00001').


function findLooseMatchingPrimitives(prim) {
  switch (_typeof(prim)) {
    case 'undefined':
      return null;

    case 'object':
      // Only pass in null as object!
      return undefined;

    case 'symbol':
      return false;

    case 'string':
      prim = +prim;
    // Loose equal entries exist only if the string is possible to convert to
    // a regular number and not NaN.
    // Fall through

    case 'number':
      if (numberIsNaN(prim)) {
        return false;
      }

  }

  return true;
}

function setMightHaveLoosePrim(a, b, prim) {
  var altValue = findLooseMatchingPrimitives(prim);
  if (altValue != null) return altValue;
  return b.has(altValue) && !a.has(altValue);
}

function mapMightHaveLoosePrim(a, b, prim, item, memo) {
  var altValue = findLooseMatchingPrimitives(prim);

  if (altValue != null) {
    return altValue;
  }

  var curB = b.get(altValue);

  if (curB === undefined && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) {
    return false;
  }

  return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);
}

function setEquiv(a, b, strict, memo) {
  // This is a lazily initiated Set of entries which have to be compared
  // pairwise.
  var set = null;
  var aValues = arrayFromSet(a);

  for (var i = 0; i < aValues.length; i++) {
    var val = aValues[i]; // Note: Checking for the objects first improves the performance for object
    // heavy sets but it is a minor slow down for primitives. As they are fast
    // to check this improves the worst case scenario instead.

    if (_typeof(val) === 'object' && val !== null) {
      if (set === null) {
        set = new Set();
      } // If the specified value doesn't exist in the second set its an not null
      // object (or non strict only: a not matching primitive) we'll need to go
      // hunting for something thats deep-(strict-)equal to it. To make this
      // O(n log n) complexity we have to copy these values in a new set first.


      set.add(val);
    } else if (!b.has(val)) {
      if (strict) return false; // Fast path to detect missing string, symbol, undefined and null values.

      if (!setMightHaveLoosePrim(a, b, val)) {
        return false;
      }

      if (set === null) {
        set = new Set();
      }

      set.add(val);
    }
  }

  if (set !== null) {
    var bValues = arrayFromSet(b);

    for (var _i = 0; _i < bValues.length; _i++) {
      var _val = bValues[_i]; // We have to check if a primitive value is already
      // matching and only if it's not, go hunting for it.

      if (_typeof(_val) === 'object' && _val !== null) {
        if (!setHasEqualElement(set, _val, strict, memo)) return false;
      } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) {
        return false;
      }
    }

    return set.size === 0;
  }

  return true;
}

function mapHasEqualEntry(set, map, key1, item1, strict, memo) {
  // To be able to handle cases like:
  //   Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])
  // ... we need to consider *all* matching keys, not just the first we find.
  var setValues = arrayFromSet(set);

  for (var i = 0; i < setValues.length; i++) {
    var key2 = setValues[i];

    if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) {
      set.delete(key2);
      return true;
    }
  }

  return false;
}

function mapEquiv(a, b, strict, memo) {
  var set = null;
  var aEntries = arrayFromMap(a);

  for (var i = 0; i < aEntries.length; i++) {
    var _aEntries$i = _slicedToArray(aEntries[i], 2),
        key = _aEntries$i[0],
        item1 = _aEntries$i[1];

    if (_typeof(key) === 'object' && key !== null) {
      if (set === null) {
        set = new Set();
      }

      set.add(key);
    } else {
      // By directly retrieving the value we prevent another b.has(key) check in
      // almost all possible cases.
      var item2 = b.get(key);

      if (item2 === undefined && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) {
        if (strict) return false; // Fast path to detect missing string, symbol, undefined and null
        // keys.

        if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;

        if (set === null) {
          set = new Set();
        }

        set.add(key);
      }
    }
  }

  if (set !== null) {
    var bEntries = arrayFromMap(b);

    for (var _i2 = 0; _i2 < bEntries.length; _i2++) {
      var _bEntries$_i = _slicedToArray(bEntries[_i2], 2),
          key = _bEntries$_i[0],
          item = _bEntries$_i[1];

      if (_typeof(key) === 'object' && key !== null) {
        if (!mapHasEqualEntry(set, a, key, item, strict, memo)) return false;
      } else if (!strict && (!a.has(key) || !innerDeepEqual(a.get(key), item, false, memo)) && !mapHasEqualEntry(set, a, key, item, false, memo)) {
        return false;
      }
    }

    return set.size === 0;
  }

  return true;
}

function objEquiv(a, b, strict, keys, memos, iterationType) {
  // Sets and maps don't have their entries accessible via normal object
  // properties.
  var i = 0;

  if (iterationType === kIsSet) {
    if (!setEquiv(a, b, strict, memos)) {
      return false;
    }
  } else if (iterationType === kIsMap) {
    if (!mapEquiv(a, b, strict, memos)) {
      return false;
    }
  } else if (iterationType === kIsArray) {
    for (; i < a.length; i++) {
      if (hasOwnProperty(a, i)) {
        if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) {
          return false;
        }
      } else if (hasOwnProperty(b, i)) {
        return false;
      } else {
        // Array is sparse.
        var keysA = Object.keys(a);

        for (; i < keysA.length; i++) {
          var key = keysA[i];

          if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) {
            return false;
          }
        }

        if (keysA.length !== Object.keys(b).length) {
          return false;
        }

        return true;
      }
    }
  } // The pair must have equivalent values for every corresponding key.
  // Possibly expensive deep test:


  for (i = 0; i < keys.length; i++) {
    var _key = keys[i];

    if (!innerDeepEqual(a[_key], b[_key], strict, memos)) {
      return false;
    }
  }

  return true;
}

function isDeepEqual(val1, val2) {
  return innerDeepEqual(val1, val2, kLoose);
}

function isDeepStrictEqual(val1, val2) {
  return innerDeepEqual(val1, val2, kStrict);
}

module.exports = {
  isDeepEqual: isDeepEqual,
  isDeepStrictEqual: isDeepStrictEqual
};

/***/ }),

/***/ 9464:
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */
;(function(root) {

	// Detect free variables `exports`.
	var freeExports =  true && exports;

	// Detect free variable `module`.
	var freeModule =  true && module &&
		module.exports == freeExports && module;

	// Detect free variable `global`, from Node.js or Browserified code, and use
	// it as `root`.
	var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g;
	if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
		root = freeGlobal;
	}

	/*--------------------------------------------------------------------------*/

	var InvalidCharacterError = function(message) {
		this.message = message;
	};
	InvalidCharacterError.prototype = new Error;
	InvalidCharacterError.prototype.name = 'InvalidCharacterError';

	var error = function(message) {
		// Note: the error messages used throughout this file match those used by
		// the native `atob`/`btoa` implementation in Chromium.
		throw new InvalidCharacterError(message);
	};

	var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
	// http://whatwg.org/html/common-microsyntaxes.html#space-character
	var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g;

	// `decode` is designed to be fully compatible with `atob` as described in the
	// HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob
	// The optimized base64-decoding algorithm used is based on @atk’s excellent
	// implementation. https://gist.github.com/atk/1020396
	var decode = function(input) {
		input = String(input)
			.replace(REGEX_SPACE_CHARACTERS, '');
		var length = input.length;
		if (length % 4 == 0) {
			input = input.replace(/==?$/, '');
			length = input.length;
		}
		if (
			length % 4 == 1 ||
			// http://whatwg.org/C#alphanumeric-ascii-characters
			/[^+a-zA-Z0-9/]/.test(input)
		) {
			error(
				'Invalid character: the string to be decoded is not correctly encoded.'
			);
		}
		var bitCounter = 0;
		var bitStorage;
		var buffer;
		var output = '';
		var position = -1;
		while (++position < length) {
			buffer = TABLE.indexOf(input.charAt(position));
			bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;
			// Unless this is the first of a group of 4 characters…
			if (bitCounter++ % 4) {
				// …convert the first 8 bits to a single ASCII character.
				output += String.fromCharCode(
					0xFF & bitStorage >> (-2 * bitCounter & 6)
				);
			}
		}
		return output;
	};

	// `encode` is designed to be fully compatible with `btoa` as described in the
	// HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa
	var encode = function(input) {
		input = String(input);
		if (/[^\0-\xFF]/.test(input)) {
			// Note: no need to special-case astral symbols here, as surrogates are
			// matched, and the input is supposed to only contain ASCII anyway.
			error(
				'The string to be encoded contains characters outside of the ' +
				'Latin1 range.'
			);
		}
		var padding = input.length % 3;
		var output = '';
		var position = -1;
		var a;
		var b;
		var c;
		var buffer;
		// Make sure any padding is handled outside of the loop.
		var length = input.length - padding;

		while (++position < length) {
			// Read three bytes, i.e. 24 bits.
			a = input.charCodeAt(position) << 16;
			b = input.charCodeAt(++position) << 8;
			c = input.charCodeAt(++position);
			buffer = a + b + c;
			// Turn the 24 bits into four chunks of 6 bits each, and append the
			// matching character for each of them to the output.
			output += (
				TABLE.charAt(buffer >> 18 & 0x3F) +
				TABLE.charAt(buffer >> 12 & 0x3F) +
				TABLE.charAt(buffer >> 6 & 0x3F) +
				TABLE.charAt(buffer & 0x3F)
			);
		}

		if (padding == 2) {
			a = input.charCodeAt(position) << 8;
			b = input.charCodeAt(++position);
			buffer = a + b;
			output += (
				TABLE.charAt(buffer >> 10) +
				TABLE.charAt((buffer >> 4) & 0x3F) +
				TABLE.charAt((buffer << 2) & 0x3F) +
				'='
			);
		} else if (padding == 1) {
			buffer = input.charCodeAt(position);
			output += (
				TABLE.charAt(buffer >> 2) +
				TABLE.charAt((buffer << 4) & 0x3F) +
				'=='
			);
		}

		return output;
	};

	var base64 = {
		'encode': encode,
		'decode': decode,
		'version': '1.0.0'
	};

	// Some AMD build optimizers, like r.js, check for specific condition patterns
	// like the following:
	if (
		true
	) {
		!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
			return base64;
		}).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	}	else { var key; }

}(this));


/***/ }),

/***/ 3938:
/***/ (function(module) {

"use strict";


var isMergeableObject = function isMergeableObject(value) {
	return isNonNullObject(value)
		&& !isSpecial(value)
};

function isNonNullObject(value) {
	return !!value && typeof value === 'object'
}

function isSpecial(value) {
	var stringValue = Object.prototype.toString.call(value);

	return stringValue === '[object RegExp]'
		|| stringValue === '[object Date]'
		|| isReactElement(value)
}

// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;

function isReactElement(value) {
	return value.$$typeof === REACT_ELEMENT_TYPE
}

function emptyTarget(val) {
	return Array.isArray(val) ? [] : {}
}

function cloneUnlessOtherwiseSpecified(value, options) {
	return (options.clone !== false && options.isMergeableObject(value))
		? deepmerge(emptyTarget(value), value, options)
		: value
}

function defaultArrayMerge(target, source, options) {
	return target.concat(source).map(function(element) {
		return cloneUnlessOtherwiseSpecified(element, options)
	})
}

function getMergeFunction(key, options) {
	if (!options.customMerge) {
		return deepmerge
	}
	var customMerge = options.customMerge(key);
	return typeof customMerge === 'function' ? customMerge : deepmerge
}

function getEnumerableOwnPropertySymbols(target) {
	return Object.getOwnPropertySymbols
		? Object.getOwnPropertySymbols(target).filter(function(symbol) {
			return Object.propertyIsEnumerable.call(target, symbol)
		})
		: []
}

function getKeys(target) {
	return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
}

function propertyIsOnObject(object, property) {
	try {
		return property in object
	} catch(_) {
		return false
	}
}

// Protects from prototype poisoning and unexpected merging up the prototype chain.
function propertyIsUnsafe(target, key) {
	return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
		&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
			&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
}

function mergeObject(target, source, options) {
	var destination = {};
	if (options.isMergeableObject(target)) {
		getKeys(target).forEach(function(key) {
			destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
		});
	}
	getKeys(source).forEach(function(key) {
		if (propertyIsUnsafe(target, key)) {
			return
		}

		if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
			destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
		} else {
			destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
		}
	});
	return destination
}

function deepmerge(target, source, options) {
	options = options || {};
	options.arrayMerge = options.arrayMerge || defaultArrayMerge;
	options.isMergeableObject = options.isMergeableObject || isMergeableObject;
	// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
	// implementations can use it. The caller may not replace it.
	options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;

	var sourceIsArray = Array.isArray(source);
	var targetIsArray = Array.isArray(target);
	var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;

	if (!sourceAndTargetTypesMatch) {
		return cloneUnlessOtherwiseSpecified(source, options)
	} else if (sourceIsArray) {
		return options.arrayMerge(target, source, options)
	} else {
		return mergeObject(target, source, options)
	}
}

deepmerge.all = function deepmergeAll(array, options) {
	if (!Array.isArray(array)) {
		throw new Error('first argument should be an array')
	}

	return array.reduce(function(prev, next) {
		return deepmerge(prev, next, options)
	}, {})
};

var deepmerge_1 = deepmerge;

module.exports = deepmerge_1;


/***/ }),

/***/ 9517:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var keys = __webpack_require__(8555);
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';

var toStr = Object.prototype.toString;
var concat = Array.prototype.concat;
var defineDataProperty = __webpack_require__(6504);

var isFunction = function (fn) {
	return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
};

var supportsDescriptors = __webpack_require__(4205)();

var defineProperty = function (object, name, value, predicate) {
	if (name in object) {
		if (predicate === true) {
			if (object[name] === value) {
				return;
			}
		} else if (!isFunction(predicate) || !predicate()) {
			return;
		}
	}

	if (supportsDescriptors) {
		defineDataProperty(object, name, value, true);
	} else {
		defineDataProperty(object, name, value);
	}
};

var defineProperties = function (object, map) {
	var predicates = arguments.length > 2 ? arguments[2] : {};
	var props = keys(map);
	if (hasSymbols) {
		props = concat.call(props, Object.getOwnPropertySymbols(map));
	}
	for (var i = 0; i < props.length; i += 1) {
		defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
	}
};

defineProperties.supportsDescriptors = !!supportsDescriptors;

module.exports = defineProperties;


/***/ }),

/***/ 9737:
/***/ (function(module) {

"use strict";
/**
 * Code refactored from Mozilla Developer Network:
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
 */



function assign(target, firstSource) {
  if (target === undefined || target === null) {
    throw new TypeError('Cannot convert first argument to object');
  }

  var to = Object(target);
  for (var i = 1; i < arguments.length; i++) {
    var nextSource = arguments[i];
    if (nextSource === undefined || nextSource === null) {
      continue;
    }

    var keysArray = Object.keys(Object(nextSource));
    for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
      var nextKey = keysArray[nextIndex];
      var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
      if (desc !== undefined && desc.enumerable) {
        to[nextKey] = nextSource[nextKey];
      }
    }
  }
  return to;
}

function polyfill() {
  if (!Object.assign) {
    Object.defineProperty(Object, 'assign', {
      enumerable: false,
      configurable: true,
      writable: true,
      value: assign
    });
  }
}

module.exports = {
  assign: assign,
  polyfill: polyfill
};


/***/ }),

/***/ 1741:
/***/ (function(module) {

"use strict";


/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */

module.exports = function isNaN(value) {
	return value !== value;
};


/***/ }),

/***/ 5179:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var callBind = __webpack_require__(3784);
var define = __webpack_require__(9517);

var implementation = __webpack_require__(1741);
var getPolyfill = __webpack_require__(6728);
var shim = __webpack_require__(7138);

var polyfill = callBind(getPolyfill(), Number);

/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */

define(polyfill, {
	getPolyfill: getPolyfill,
	implementation: implementation,
	shim: shim
});

module.exports = polyfill;


/***/ }),

/***/ 6728:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var implementation = __webpack_require__(1741);

module.exports = function getPolyfill() {
	if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) {
		return Number.isNaN;
	}
	return implementation;
};


/***/ }),

/***/ 7138:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var define = __webpack_require__(9517);
var getPolyfill = __webpack_require__(6728);

/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */

module.exports = function shimNumberIsNaN() {
	var polyfill = getPolyfill();
	define(Number, { isNaN: polyfill }, {
		isNaN: function testIsNaN() {
			return Number.isNaN !== polyfill;
		}
	});
	return polyfill;
};


/***/ }),

/***/ 4658:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

(function (global, factory) {
   true ? factory(exports) :
  0;
}(this, function (exports) { 'use strict';

  var domain;

  // This constructor is used to store event handlers. Instantiating this is
  // faster than explicitly calling `Object.create(null)` to get a "clean" empty
  // object (tested with v8 v4.9).
  function EventHandlers() {}
  EventHandlers.prototype = Object.create(null);

  function EventEmitter() {
    EventEmitter.init.call(this);
  }

  // nodejs oddity
  // require('events') === require('events').EventEmitter
  EventEmitter.EventEmitter = EventEmitter;

  EventEmitter.usingDomains = false;

  EventEmitter.prototype.domain = undefined;
  EventEmitter.prototype._events = undefined;
  EventEmitter.prototype._maxListeners = undefined;

  // By default EventEmitters will print a warning if more than 10 listeners are
  // added to it. This is a useful default which helps finding memory leaks.
  EventEmitter.defaultMaxListeners = 10;

  EventEmitter.init = function() {
    this.domain = null;
    if (EventEmitter.usingDomains) {
      // if there is an active domain, then attach to it.
      if (domain.active && !(this instanceof domain.Domain)) ;
    }

    if (!this._events || this._events === Object.getPrototypeOf(this)._events) {
      this._events = new EventHandlers();
      this._eventsCount = 0;
    }

    this._maxListeners = this._maxListeners || undefined;
  };

  // Obviously not all Emitters should be limited to 10. This function allows
  // that to be increased. Set to zero for unlimited.
  EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
    if (typeof n !== 'number' || n < 0 || isNaN(n))
      throw new TypeError('"n" argument must be a positive number');
    this._maxListeners = n;
    return this;
  };

  function $getMaxListeners(that) {
    if (that._maxListeners === undefined)
      return EventEmitter.defaultMaxListeners;
    return that._maxListeners;
  }

  EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
    return $getMaxListeners(this);
  };

  // These standalone emit* functions are used to optimize calling of event
  // handlers for fast cases because emit() itself often has a variable number of
  // arguments and can be deoptimized because of that. These functions always have
  // the same number of arguments and thus do not get deoptimized, so the code
  // inside them can execute faster.
  function emitNone(handler, isFn, self) {
    if (isFn)
      handler.call(self);
    else {
      var len = handler.length;
      var listeners = arrayClone(handler, len);
      for (var i = 0; i < len; ++i)
        listeners[i].call(self);
    }
  }
  function emitOne(handler, isFn, self, arg1) {
    if (isFn)
      handler.call(self, arg1);
    else {
      var len = handler.length;
      var listeners = arrayClone(handler, len);
      for (var i = 0; i < len; ++i)
        listeners[i].call(self, arg1);
    }
  }
  function emitTwo(handler, isFn, self, arg1, arg2) {
    if (isFn)
      handler.call(self, arg1, arg2);
    else {
      var len = handler.length;
      var listeners = arrayClone(handler, len);
      for (var i = 0; i < len; ++i)
        listeners[i].call(self, arg1, arg2);
    }
  }
  function emitThree(handler, isFn, self, arg1, arg2, arg3) {
    if (isFn)
      handler.call(self, arg1, arg2, arg3);
    else {
      var len = handler.length;
      var listeners = arrayClone(handler, len);
      for (var i = 0; i < len; ++i)
        listeners[i].call(self, arg1, arg2, arg3);
    }
  }

  function emitMany(handler, isFn, self, args) {
    if (isFn)
      handler.apply(self, args);
    else {
      var len = handler.length;
      var listeners = arrayClone(handler, len);
      for (var i = 0; i < len; ++i)
        listeners[i].apply(self, args);
    }
  }

  EventEmitter.prototype.emit = function emit(type) {
    var er, handler, len, args, i, events, domain;
    var doError = (type === 'error');

    events = this._events;
    if (events)
      doError = (doError && events.error == null);
    else if (!doError)
      return false;

    domain = this.domain;

    // If there is no 'error' event listener then throw.
    if (doError) {
      er = arguments[1];
      if (domain) {
        if (!er)
          er = new Error('Uncaught, unspecified "error" event');
        er.domainEmitter = this;
        er.domain = domain;
        er.domainThrown = false;
        domain.emit('error', er);
      } else if (er instanceof Error) {
        throw er; // Unhandled 'error' event
      } else {
        // At least give some kind of context to the user
        var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
        err.context = er;
        throw err;
      }
      return false;
    }

    handler = events[type];

    if (!handler)
      return false;

    var isFn = typeof handler === 'function';
    len = arguments.length;
    switch (len) {
      // fast cases
      case 1:
        emitNone(handler, isFn, this);
        break;
      case 2:
        emitOne(handler, isFn, this, arguments[1]);
        break;
      case 3:
        emitTwo(handler, isFn, this, arguments[1], arguments[2]);
        break;
      case 4:
        emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);
        break;
      // slower
      default:
        args = new Array(len - 1);
        for (i = 1; i < len; i++)
          args[i - 1] = arguments[i];
        emitMany(handler, isFn, this, args);
    }

    return true;
  };

  function _addListener(target, type, listener, prepend) {
    var m;
    var events;
    var existing;

    if (typeof listener !== 'function')
      throw new TypeError('"listener" argument must be a function');

    events = target._events;
    if (!events) {
      events = target._events = new EventHandlers();
      target._eventsCount = 0;
    } else {
      // To avoid recursion in the case that type === "newListener"! Before
      // adding it to the listeners, first emit "newListener".
      if (events.newListener) {
        target.emit('newListener', type,
                    listener.listener ? listener.listener : listener);

        // Re-assign `events` because a newListener handler could have caused the
        // this._events to be assigned to a new object
        events = target._events;
      }
      existing = events[type];
    }

    if (!existing) {
      // Optimize the case of one listener. Don't need the extra array object.
      existing = events[type] = listener;
      ++target._eventsCount;
    } else {
      if (typeof existing === 'function') {
        // Adding the second element, need to change to array.
        existing = events[type] = prepend ? [listener, existing] :
                                            [existing, listener];
      } else {
        // If we've already got an array, just append.
        if (prepend) {
          existing.unshift(listener);
        } else {
          existing.push(listener);
        }
      }

      // Check for listener leak
      if (!existing.warned) {
        m = $getMaxListeners(target);
        if (m && m > 0 && existing.length > m) {
          existing.warned = true;
          var w = new Error('Possible EventEmitter memory leak detected. ' +
                              existing.length + ' ' + type + ' listeners added. ' +
                              'Use emitter.setMaxListeners() to increase limit');
          w.name = 'MaxListenersExceededWarning';
          w.emitter = target;
          w.type = type;
          w.count = existing.length;
          emitWarning(w);
        }
      }
    }

    return target;
  }
  function emitWarning(e) {
    typeof console.warn === 'function' ? console.warn(e) : console.log(e);
  }
  EventEmitter.prototype.addListener = function addListener(type, listener) {
    return _addListener(this, type, listener, false);
  };

  EventEmitter.prototype.on = EventEmitter.prototype.addListener;

  EventEmitter.prototype.prependListener =
      function prependListener(type, listener) {
        return _addListener(this, type, listener, true);
      };

  function _onceWrap(target, type, listener) {
    var fired = false;
    function g() {
      target.removeListener(type, g);
      if (!fired) {
        fired = true;
        listener.apply(target, arguments);
      }
    }
    g.listener = listener;
    return g;
  }

  EventEmitter.prototype.once = function once(type, listener) {
    if (typeof listener !== 'function')
      throw new TypeError('"listener" argument must be a function');
    this.on(type, _onceWrap(this, type, listener));
    return this;
  };

  EventEmitter.prototype.prependOnceListener =
      function prependOnceListener(type, listener) {
        if (typeof listener !== 'function')
          throw new TypeError('"listener" argument must be a function');
        this.prependListener(type, _onceWrap(this, type, listener));
        return this;
      };

  // emits a 'removeListener' event iff the listener was removed
  EventEmitter.prototype.removeListener =
      function removeListener(type, listener) {
        var list, events, position, i, originalListener;

        if (typeof listener !== 'function')
          throw new TypeError('"listener" argument must be a function');

        events = this._events;
        if (!events)
          return this;

        list = events[type];
        if (!list)
          return this;

        if (list === listener || (list.listener && list.listener === listener)) {
          if (--this._eventsCount === 0)
            this._events = new EventHandlers();
          else {
            delete events[type];
            if (events.removeListener)
              this.emit('removeListener', type, list.listener || listener);
          }
        } else if (typeof list !== 'function') {
          position = -1;

          for (i = list.length; i-- > 0;) {
            if (list[i] === listener ||
                (list[i].listener && list[i].listener === listener)) {
              originalListener = list[i].listener;
              position = i;
              break;
            }
          }

          if (position < 0)
            return this;

          if (list.length === 1) {
            list[0] = undefined;
            if (--this._eventsCount === 0) {
              this._events = new EventHandlers();
              return this;
            } else {
              delete events[type];
            }
          } else {
            spliceOne(list, position);
          }

          if (events.removeListener)
            this.emit('removeListener', type, originalListener || listener);
        }

        return this;
      };

  EventEmitter.prototype.removeAllListeners =
      function removeAllListeners(type) {
        var listeners, events;

        events = this._events;
        if (!events)
          return this;

        // not listening for removeListener, no need to emit
        if (!events.removeListener) {
          if (arguments.length === 0) {
            this._events = new EventHandlers();
            this._eventsCount = 0;
          } else if (events[type]) {
            if (--this._eventsCount === 0)
              this._events = new EventHandlers();
            else
              delete events[type];
          }
          return this;
        }

        // emit removeListener for all listeners on all events
        if (arguments.length === 0) {
          var keys = Object.keys(events);
          for (var i = 0, key; i < keys.length; ++i) {
            key = keys[i];
            if (key === 'removeListener') continue;
            this.removeAllListeners(key);
          }
          this.removeAllListeners('removeListener');
          this._events = new EventHandlers();
          this._eventsCount = 0;
          return this;
        }

        listeners = events[type];

        if (typeof listeners === 'function') {
          this.removeListener(type, listeners);
        } else if (listeners) {
          // LIFO order
          do {
            this.removeListener(type, listeners[listeners.length - 1]);
          } while (listeners[0]);
        }

        return this;
      };

  EventEmitter.prototype.listeners = function listeners(type) {
    var evlistener;
    var ret;
    var events = this._events;

    if (!events)
      ret = [];
    else {
      evlistener = events[type];
      if (!evlistener)
        ret = [];
      else if (typeof evlistener === 'function')
        ret = [evlistener.listener || evlistener];
      else
        ret = unwrapListeners(evlistener);
    }

    return ret;
  };

  EventEmitter.listenerCount = function(emitter, type) {
    if (typeof emitter.listenerCount === 'function') {
      return emitter.listenerCount(type);
    } else {
      return listenerCount.call(emitter, type);
    }
  };

  EventEmitter.prototype.listenerCount = listenerCount;
  function listenerCount(type) {
    var events = this._events;

    if (events) {
      var evlistener = events[type];

      if (typeof evlistener === 'function') {
        return 1;
      } else if (evlistener) {
        return evlistener.length;
      }
    }

    return 0;
  }

  EventEmitter.prototype.eventNames = function eventNames() {
    return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
  };

  // About 1.5x faster than the two-arg version of Array#splice().
  function spliceOne(list, index) {
    for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
      list[i] = list[k];
    list.pop();
  }

  function arrayClone(arr, i) {
    var copy = new Array(i);
    while (i--)
      copy[i] = arr[i];
    return copy;
  }

  function unwrapListeners(arr) {
    var ret = new Array(arr.length);
    for (var i = 0; i < ret.length; ++i) {
      ret[i] = arr[i].listener || arr[i];
    }
    return ret;
  }

  var global$1 = (typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g :
              typeof self !== "undefined" ? self :
              typeof window !== "undefined" ? window : {});

  var lookup = [];
  var revLookup = [];
  var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
  var inited = false;
  function init () {
    inited = true;
    var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
    for (var i = 0, len = code.length; i < len; ++i) {
      lookup[i] = code[i];
      revLookup[code.charCodeAt(i)] = i;
    }

    revLookup['-'.charCodeAt(0)] = 62;
    revLookup['_'.charCodeAt(0)] = 63;
  }

  function toByteArray (b64) {
    if (!inited) {
      init();
    }
    var i, j, l, tmp, placeHolders, arr;
    var len = b64.length;

    if (len % 4 > 0) {
      throw new Error('Invalid string. Length must be a multiple of 4')
    }

    // the number of equal signs (place holders)
    // if there are two placeholders, than the two characters before it
    // represent one byte
    // if there is only one, then the three characters before it represent 2 bytes
    // this is just a cheap hack to not do indexOf twice
    placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;

    // base64 is 4/3 + up to two characters of the original data
    arr = new Arr(len * 3 / 4 - placeHolders);

    // if there are placeholders, only get up to the last complete 4 chars
    l = placeHolders > 0 ? len - 4 : len;

    var L = 0;

    for (i = 0, j = 0; i < l; i += 4, j += 3) {
      tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)];
      arr[L++] = (tmp >> 16) & 0xFF;
      arr[L++] = (tmp >> 8) & 0xFF;
      arr[L++] = tmp & 0xFF;
    }

    if (placeHolders === 2) {
      tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4);
      arr[L++] = tmp & 0xFF;
    } else if (placeHolders === 1) {
      tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2);
      arr[L++] = (tmp >> 8) & 0xFF;
      arr[L++] = tmp & 0xFF;
    }

    return arr
  }

  function tripletToBase64 (num) {
    return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
  }

  function encodeChunk (uint8, start, end) {
    var tmp;
    var output = [];
    for (var i = start; i < end; i += 3) {
      tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
      output.push(tripletToBase64(tmp));
    }
    return output.join('')
  }

  function fromByteArray (uint8) {
    if (!inited) {
      init();
    }
    var tmp;
    var len = uint8.length;
    var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
    var output = '';
    var parts = [];
    var maxChunkLength = 16383; // must be multiple of 3

    // go through the array every three bytes, we'll deal with trailing stuff later
    for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
      parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)));
    }

    // pad the end with zeros, but make sure to not forget the extra bytes
    if (extraBytes === 1) {
      tmp = uint8[len - 1];
      output += lookup[tmp >> 2];
      output += lookup[(tmp << 4) & 0x3F];
      output += '==';
    } else if (extraBytes === 2) {
      tmp = (uint8[len - 2] << 8) + (uint8[len - 1]);
      output += lookup[tmp >> 10];
      output += lookup[(tmp >> 4) & 0x3F];
      output += lookup[(tmp << 2) & 0x3F];
      output += '=';
    }

    parts.push(output);

    return parts.join('')
  }

  function read (buffer, offset, isLE, mLen, nBytes) {
    var e, m;
    var eLen = nBytes * 8 - mLen - 1;
    var eMax = (1 << eLen) - 1;
    var eBias = eMax >> 1;
    var nBits = -7;
    var i = isLE ? (nBytes - 1) : 0;
    var d = isLE ? -1 : 1;
    var s = buffer[offset + i];

    i += d;

    e = s & ((1 << (-nBits)) - 1);
    s >>= (-nBits);
    nBits += eLen;
    for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}

    m = e & ((1 << (-nBits)) - 1);
    e >>= (-nBits);
    nBits += mLen;
    for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}

    if (e === 0) {
      e = 1 - eBias;
    } else if (e === eMax) {
      return m ? NaN : ((s ? -1 : 1) * Infinity)
    } else {
      m = m + Math.pow(2, mLen);
      e = e - eBias;
    }
    return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  }

  function write (buffer, value, offset, isLE, mLen, nBytes) {
    var e, m, c;
    var eLen = nBytes * 8 - mLen - 1;
    var eMax = (1 << eLen) - 1;
    var eBias = eMax >> 1;
    var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0);
    var i = isLE ? 0 : (nBytes - 1);
    var d = isLE ? 1 : -1;
    var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;

    value = Math.abs(value);

    if (isNaN(value) || value === Infinity) {
      m = isNaN(value) ? 1 : 0;
      e = eMax;
    } else {
      e = Math.floor(Math.log(value) / Math.LN2);
      if (value * (c = Math.pow(2, -e)) < 1) {
        e--;
        c *= 2;
      }
      if (e + eBias >= 1) {
        value += rt / c;
      } else {
        value += rt * Math.pow(2, 1 - eBias);
      }
      if (value * c >= 2) {
        e++;
        c /= 2;
      }

      if (e + eBias >= eMax) {
        m = 0;
        e = eMax;
      } else if (e + eBias >= 1) {
        m = (value * c - 1) * Math.pow(2, mLen);
        e = e + eBias;
      } else {
        m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
        e = 0;
      }
    }

    for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}

    e = (e << mLen) | m;
    eLen += mLen;
    for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}

    buffer[offset + i - d] |= s * 128;
  }

  var toString = {}.toString;

  var isArray = Array.isArray || function (arr) {
    return toString.call(arr) == '[object Array]';
  };

  var INSPECT_MAX_BYTES = 50;

  /**
   * If `Buffer.TYPED_ARRAY_SUPPORT`:
   *   === true    Use Uint8Array implementation (fastest)
   *   === false   Use Object implementation (most compatible, even IE6)
   *
   * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
   * Opera 11.6+, iOS 4.2+.
   *
   * Due to various browser bugs, sometimes the Object implementation will be used even
   * when the browser supports typed arrays.
   *
   * Note:
   *
   *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
   *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
   *
   *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
   *
   *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
   *     incorrect length in some situations.

   * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
   * get the Object implementation, which is slower but behaves correctly.
   */
  Buffer.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined
    ? global$1.TYPED_ARRAY_SUPPORT
    : true;

  function kMaxLength () {
    return Buffer.TYPED_ARRAY_SUPPORT
      ? 0x7fffffff
      : 0x3fffffff
  }

  function createBuffer (that, length) {
    if (kMaxLength() < length) {
      throw new RangeError('Invalid typed array length')
    }
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      // Return an augmented `Uint8Array` instance, for best performance
      that = new Uint8Array(length);
      that.__proto__ = Buffer.prototype;
    } else {
      // Fallback: Return an object instance of the Buffer class
      if (that === null) {
        that = new Buffer(length);
      }
      that.length = length;
    }

    return that
  }

  /**
   * The Buffer constructor returns instances of `Uint8Array` that have their
   * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
   * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
   * and the `Uint8Array` methods. Square bracket notation works as expected -- it
   * returns a single octet.
   *
   * The `Uint8Array` prototype remains unmodified.
   */

  function Buffer (arg, encodingOrOffset, length) {
    if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
      return new Buffer(arg, encodingOrOffset, length)
    }

    // Common case.
    if (typeof arg === 'number') {
      if (typeof encodingOrOffset === 'string') {
        throw new Error(
          'If encoding is specified then the first argument must be a string'
        )
      }
      return allocUnsafe(this, arg)
    }
    return from(this, arg, encodingOrOffset, length)
  }

  Buffer.poolSize = 8192; // not used by this implementation

  // TODO: Legacy, not needed anymore. Remove in next major version.
  Buffer._augment = function (arr) {
    arr.__proto__ = Buffer.prototype;
    return arr
  };

  function from (that, value, encodingOrOffset, length) {
    if (typeof value === 'number') {
      throw new TypeError('"value" argument must not be a number')
    }

    if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
      return fromArrayBuffer(that, value, encodingOrOffset, length)
    }

    if (typeof value === 'string') {
      return fromString(that, value, encodingOrOffset)
    }

    return fromObject(that, value)
  }

  /**
   * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
   * if value is a number.
   * Buffer.from(str[, encoding])
   * Buffer.from(array)
   * Buffer.from(buffer)
   * Buffer.from(arrayBuffer[, byteOffset[, length]])
   **/
  Buffer.from = function (value, encodingOrOffset, length) {
    return from(null, value, encodingOrOffset, length)
  };

  if (Buffer.TYPED_ARRAY_SUPPORT) {
    Buffer.prototype.__proto__ = Uint8Array.prototype;
    Buffer.__proto__ = Uint8Array;
  }

  function assertSize (size) {
    if (typeof size !== 'number') {
      throw new TypeError('"size" argument must be a number')
    } else if (size < 0) {
      throw new RangeError('"size" argument must not be negative')
    }
  }

  function alloc (that, size, fill, encoding) {
    assertSize(size);
    if (size <= 0) {
      return createBuffer(that, size)
    }
    if (fill !== undefined) {
      // Only pay attention to encoding if it's a string. This
      // prevents accidentally sending in a number that would
      // be interpretted as a start offset.
      return typeof encoding === 'string'
        ? createBuffer(that, size).fill(fill, encoding)
        : createBuffer(that, size).fill(fill)
    }
    return createBuffer(that, size)
  }

  /**
   * Creates a new filled Buffer instance.
   * alloc(size[, fill[, encoding]])
   **/
  Buffer.alloc = function (size, fill, encoding) {
    return alloc(null, size, fill, encoding)
  };

  function allocUnsafe (that, size) {
    assertSize(size);
    that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
    if (!Buffer.TYPED_ARRAY_SUPPORT) {
      for (var i = 0; i < size; ++i) {
        that[i] = 0;
      }
    }
    return that
  }

  /**
   * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
   * */
  Buffer.allocUnsafe = function (size) {
    return allocUnsafe(null, size)
  };
  /**
   * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
   */
  Buffer.allocUnsafeSlow = function (size) {
    return allocUnsafe(null, size)
  };

  function fromString (that, string, encoding) {
    if (typeof encoding !== 'string' || encoding === '') {
      encoding = 'utf8';
    }

    if (!Buffer.isEncoding(encoding)) {
      throw new TypeError('"encoding" must be a valid string encoding')
    }

    var length = byteLength(string, encoding) | 0;
    that = createBuffer(that, length);

    var actual = that.write(string, encoding);

    if (actual !== length) {
      // Writing a hex string, for example, that contains invalid characters will
      // cause everything after the first invalid character to be ignored. (e.g.
      // 'abxxcd' will be treated as 'ab')
      that = that.slice(0, actual);
    }

    return that
  }

  function fromArrayLike (that, array) {
    var length = array.length < 0 ? 0 : checked(array.length) | 0;
    that = createBuffer(that, length);
    for (var i = 0; i < length; i += 1) {
      that[i] = array[i] & 255;
    }
    return that
  }

  function fromArrayBuffer (that, array, byteOffset, length) {
    array.byteLength; // this throws if `array` is not a valid ArrayBuffer

    if (byteOffset < 0 || array.byteLength < byteOffset) {
      throw new RangeError('\'offset\' is out of bounds')
    }

    if (array.byteLength < byteOffset + (length || 0)) {
      throw new RangeError('\'length\' is out of bounds')
    }

    if (byteOffset === undefined && length === undefined) {
      array = new Uint8Array(array);
    } else if (length === undefined) {
      array = new Uint8Array(array, byteOffset);
    } else {
      array = new Uint8Array(array, byteOffset, length);
    }

    if (Buffer.TYPED_ARRAY_SUPPORT) {
      // Return an augmented `Uint8Array` instance, for best performance
      that = array;
      that.__proto__ = Buffer.prototype;
    } else {
      // Fallback: Return an object instance of the Buffer class
      that = fromArrayLike(that, array);
    }
    return that
  }

  function fromObject (that, obj) {
    if (internalIsBuffer(obj)) {
      var len = checked(obj.length) | 0;
      that = createBuffer(that, len);

      if (that.length === 0) {
        return that
      }

      obj.copy(that, 0, 0, len);
      return that
    }

    if (obj) {
      if ((typeof ArrayBuffer !== 'undefined' &&
          obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
        if (typeof obj.length !== 'number' || isnan(obj.length)) {
          return createBuffer(that, 0)
        }
        return fromArrayLike(that, obj)
      }

      if (obj.type === 'Buffer' && isArray(obj.data)) {
        return fromArrayLike(that, obj.data)
      }
    }

    throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  }

  function checked (length) {
    // Note: cannot use `length < kMaxLength()` here because that fails when
    // length is NaN (which is otherwise coerced to zero.)
    if (length >= kMaxLength()) {
      throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
                           'size: 0x' + kMaxLength().toString(16) + ' bytes')
    }
    return length | 0
  }
  Buffer.isBuffer = isBuffer;
  function internalIsBuffer (b) {
    return !!(b != null && b._isBuffer)
  }

  Buffer.compare = function compare (a, b) {
    if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
      throw new TypeError('Arguments must be Buffers')
    }

    if (a === b) return 0

    var x = a.length;
    var y = b.length;

    for (var i = 0, len = Math.min(x, y); i < len; ++i) {
      if (a[i] !== b[i]) {
        x = a[i];
        y = b[i];
        break
      }
    }

    if (x < y) return -1
    if (y < x) return 1
    return 0
  };

  Buffer.isEncoding = function isEncoding (encoding) {
    switch (String(encoding).toLowerCase()) {
      case 'hex':
      case 'utf8':
      case 'utf-8':
      case 'ascii':
      case 'latin1':
      case 'binary':
      case 'base64':
      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return true
      default:
        return false
    }
  };

  Buffer.concat = function concat (list, length) {
    if (!isArray(list)) {
      throw new TypeError('"list" argument must be an Array of Buffers')
    }

    if (list.length === 0) {
      return Buffer.alloc(0)
    }

    var i;
    if (length === undefined) {
      length = 0;
      for (i = 0; i < list.length; ++i) {
        length += list[i].length;
      }
    }

    var buffer = Buffer.allocUnsafe(length);
    var pos = 0;
    for (i = 0; i < list.length; ++i) {
      var buf = list[i];
      if (!internalIsBuffer(buf)) {
        throw new TypeError('"list" argument must be an Array of Buffers')
      }
      buf.copy(buffer, pos);
      pos += buf.length;
    }
    return buffer
  };

  function byteLength (string, encoding) {
    if (internalIsBuffer(string)) {
      return string.length
    }
    if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
        (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
      return string.byteLength
    }
    if (typeof string !== 'string') {
      string = '' + string;
    }

    var len = string.length;
    if (len === 0) return 0

    // Use a for loop to avoid recursion
    var loweredCase = false;
    for (;;) {
      switch (encoding) {
        case 'ascii':
        case 'latin1':
        case 'binary':
          return len
        case 'utf8':
        case 'utf-8':
        case undefined:
          return utf8ToBytes(string).length
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return len * 2
        case 'hex':
          return len >>> 1
        case 'base64':
          return base64ToBytes(string).length
        default:
          if (loweredCase) return utf8ToBytes(string).length // assume utf8
          encoding = ('' + encoding).toLowerCase();
          loweredCase = true;
      }
    }
  }
  Buffer.byteLength = byteLength;

  function slowToString (encoding, start, end) {
    var loweredCase = false;

    // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
    // property of a typed array.

    // This behaves neither like String nor Uint8Array in that we set start/end
    // to their upper/lower bounds if the value passed is out of range.
    // undefined is handled specially as per ECMA-262 6th Edition,
    // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
    if (start === undefined || start < 0) {
      start = 0;
    }
    // Return early if start > this.length. Done here to prevent potential uint32
    // coercion fail below.
    if (start > this.length) {
      return ''
    }

    if (end === undefined || end > this.length) {
      end = this.length;
    }

    if (end <= 0) {
      return ''
    }

    // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
    end >>>= 0;
    start >>>= 0;

    if (end <= start) {
      return ''
    }

    if (!encoding) encoding = 'utf8';

    while (true) {
      switch (encoding) {
        case 'hex':
          return hexSlice(this, start, end)

        case 'utf8':
        case 'utf-8':
          return utf8Slice(this, start, end)

        case 'ascii':
          return asciiSlice(this, start, end)

        case 'latin1':
        case 'binary':
          return latin1Slice(this, start, end)

        case 'base64':
          return base64Slice(this, start, end)

        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return utf16leSlice(this, start, end)

        default:
          if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
          encoding = (encoding + '').toLowerCase();
          loweredCase = true;
      }
    }
  }

  // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  // Buffer instances.
  Buffer.prototype._isBuffer = true;

  function swap (b, n, m) {
    var i = b[n];
    b[n] = b[m];
    b[m] = i;
  }

  Buffer.prototype.swap16 = function swap16 () {
    var len = this.length;
    if (len % 2 !== 0) {
      throw new RangeError('Buffer size must be a multiple of 16-bits')
    }
    for (var i = 0; i < len; i += 2) {
      swap(this, i, i + 1);
    }
    return this
  };

  Buffer.prototype.swap32 = function swap32 () {
    var len = this.length;
    if (len % 4 !== 0) {
      throw new RangeError('Buffer size must be a multiple of 32-bits')
    }
    for (var i = 0; i < len; i += 4) {
      swap(this, i, i + 3);
      swap(this, i + 1, i + 2);
    }
    return this
  };

  Buffer.prototype.swap64 = function swap64 () {
    var len = this.length;
    if (len % 8 !== 0) {
      throw new RangeError('Buffer size must be a multiple of 64-bits')
    }
    for (var i = 0; i < len; i += 8) {
      swap(this, i, i + 7);
      swap(this, i + 1, i + 6);
      swap(this, i + 2, i + 5);
      swap(this, i + 3, i + 4);
    }
    return this
  };

  Buffer.prototype.toString = function toString () {
    var length = this.length | 0;
    if (length === 0) return ''
    if (arguments.length === 0) return utf8Slice(this, 0, length)
    return slowToString.apply(this, arguments)
  };

  Buffer.prototype.equals = function equals (b) {
    if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')
    if (this === b) return true
    return Buffer.compare(this, b) === 0
  };

  Buffer.prototype.inspect = function inspect () {
    var str = '';
    var max = INSPECT_MAX_BYTES;
    if (this.length > 0) {
      str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
      if (this.length > max) str += ' ... ';
    }
    return '<Buffer ' + str + '>'
  };

  Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
    if (!internalIsBuffer(target)) {
      throw new TypeError('Argument must be a Buffer')
    }

    if (start === undefined) {
      start = 0;
    }
    if (end === undefined) {
      end = target ? target.length : 0;
    }
    if (thisStart === undefined) {
      thisStart = 0;
    }
    if (thisEnd === undefined) {
      thisEnd = this.length;
    }

    if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
      throw new RangeError('out of range index')
    }

    if (thisStart >= thisEnd && start >= end) {
      return 0
    }
    if (thisStart >= thisEnd) {
      return -1
    }
    if (start >= end) {
      return 1
    }

    start >>>= 0;
    end >>>= 0;
    thisStart >>>= 0;
    thisEnd >>>= 0;

    if (this === target) return 0

    var x = thisEnd - thisStart;
    var y = end - start;
    var len = Math.min(x, y);

    var thisCopy = this.slice(thisStart, thisEnd);
    var targetCopy = target.slice(start, end);

    for (var i = 0; i < len; ++i) {
      if (thisCopy[i] !== targetCopy[i]) {
        x = thisCopy[i];
        y = targetCopy[i];
        break
      }
    }

    if (x < y) return -1
    if (y < x) return 1
    return 0
  };

  // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  //
  // Arguments:
  // - buffer - a Buffer to search
  // - val - a string, Buffer, or number
  // - byteOffset - an index into `buffer`; will be clamped to an int32
  // - encoding - an optional encoding, relevant is val is a string
  // - dir - true for indexOf, false for lastIndexOf
  function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
    // Empty buffer means no match
    if (buffer.length === 0) return -1

    // Normalize byteOffset
    if (typeof byteOffset === 'string') {
      encoding = byteOffset;
      byteOffset = 0;
    } else if (byteOffset > 0x7fffffff) {
      byteOffset = 0x7fffffff;
    } else if (byteOffset < -0x80000000) {
      byteOffset = -0x80000000;
    }
    byteOffset = +byteOffset;  // Coerce to Number.
    if (isNaN(byteOffset)) {
      // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
      byteOffset = dir ? 0 : (buffer.length - 1);
    }

    // Normalize byteOffset: negative offsets start from the end of the buffer
    if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
    if (byteOffset >= buffer.length) {
      if (dir) return -1
      else byteOffset = buffer.length - 1;
    } else if (byteOffset < 0) {
      if (dir) byteOffset = 0;
      else return -1
    }

    // Normalize val
    if (typeof val === 'string') {
      val = Buffer.from(val, encoding);
    }

    // Finally, search either indexOf (if dir is true) or lastIndexOf
    if (internalIsBuffer(val)) {
      // Special case: looking for empty string/buffer always fails
      if (val.length === 0) {
        return -1
      }
      return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
    } else if (typeof val === 'number') {
      val = val & 0xFF; // Search for a byte value [0-255]
      if (Buffer.TYPED_ARRAY_SUPPORT &&
          typeof Uint8Array.prototype.indexOf === 'function') {
        if (dir) {
          return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
        } else {
          return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
        }
      }
      return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
    }

    throw new TypeError('val must be string, number or Buffer')
  }

  function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
    var indexSize = 1;
    var arrLength = arr.length;
    var valLength = val.length;

    if (encoding !== undefined) {
      encoding = String(encoding).toLowerCase();
      if (encoding === 'ucs2' || encoding === 'ucs-2' ||
          encoding === 'utf16le' || encoding === 'utf-16le') {
        if (arr.length < 2 || val.length < 2) {
          return -1
        }
        indexSize = 2;
        arrLength /= 2;
        valLength /= 2;
        byteOffset /= 2;
      }
    }

    function read (buf, i) {
      if (indexSize === 1) {
        return buf[i]
      } else {
        return buf.readUInt16BE(i * indexSize)
      }
    }

    var i;
    if (dir) {
      var foundIndex = -1;
      for (i = byteOffset; i < arrLength; i++) {
        if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
          if (foundIndex === -1) foundIndex = i;
          if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
        } else {
          if (foundIndex !== -1) i -= i - foundIndex;
          foundIndex = -1;
        }
      }
    } else {
      if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
      for (i = byteOffset; i >= 0; i--) {
        var found = true;
        for (var j = 0; j < valLength; j++) {
          if (read(arr, i + j) !== read(val, j)) {
            found = false;
            break
          }
        }
        if (found) return i
      }
    }

    return -1
  }

  Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
    return this.indexOf(val, byteOffset, encoding) !== -1
  };

  Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
    return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  };

  Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
    return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  };

  function hexWrite (buf, string, offset, length) {
    offset = Number(offset) || 0;
    var remaining = buf.length - offset;
    if (!length) {
      length = remaining;
    } else {
      length = Number(length);
      if (length > remaining) {
        length = remaining;
      }
    }

    // must be an even number of digits
    var strLen = string.length;
    if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')

    if (length > strLen / 2) {
      length = strLen / 2;
    }
    for (var i = 0; i < length; ++i) {
      var parsed = parseInt(string.substr(i * 2, 2), 16);
      if (isNaN(parsed)) return i
      buf[offset + i] = parsed;
    }
    return i
  }

  function utf8Write (buf, string, offset, length) {
    return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  }

  function asciiWrite (buf, string, offset, length) {
    return blitBuffer(asciiToBytes(string), buf, offset, length)
  }

  function latin1Write (buf, string, offset, length) {
    return asciiWrite(buf, string, offset, length)
  }

  function base64Write (buf, string, offset, length) {
    return blitBuffer(base64ToBytes(string), buf, offset, length)
  }

  function ucs2Write (buf, string, offset, length) {
    return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  }

  Buffer.prototype.write = function write (string, offset, length, encoding) {
    // Buffer#write(string)
    if (offset === undefined) {
      encoding = 'utf8';
      length = this.length;
      offset = 0;
    // Buffer#write(string, encoding)
    } else if (length === undefined && typeof offset === 'string') {
      encoding = offset;
      length = this.length;
      offset = 0;
    // Buffer#write(string, offset[, length][, encoding])
    } else if (isFinite(offset)) {
      offset = offset | 0;
      if (isFinite(length)) {
        length = length | 0;
        if (encoding === undefined) encoding = 'utf8';
      } else {
        encoding = length;
        length = undefined;
      }
    // legacy write(string, encoding, offset, length) - remove in v0.13
    } else {
      throw new Error(
        'Buffer.write(string, encoding, offset[, length]) is no longer supported'
      )
    }

    var remaining = this.length - offset;
    if (length === undefined || length > remaining) length = remaining;

    if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
      throw new RangeError('Attempt to write outside buffer bounds')
    }

    if (!encoding) encoding = 'utf8';

    var loweredCase = false;
    for (;;) {
      switch (encoding) {
        case 'hex':
          return hexWrite(this, string, offset, length)

        case 'utf8':
        case 'utf-8':
          return utf8Write(this, string, offset, length)

        case 'ascii':
          return asciiWrite(this, string, offset, length)

        case 'latin1':
        case 'binary':
          return latin1Write(this, string, offset, length)

        case 'base64':
          // Warning: maxLength not taken into account in base64Write
          return base64Write(this, string, offset, length)

        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return ucs2Write(this, string, offset, length)

        default:
          if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
          encoding = ('' + encoding).toLowerCase();
          loweredCase = true;
      }
    }
  };

  Buffer.prototype.toJSON = function toJSON () {
    return {
      type: 'Buffer',
      data: Array.prototype.slice.call(this._arr || this, 0)
    }
  };

  function base64Slice (buf, start, end) {
    if (start === 0 && end === buf.length) {
      return fromByteArray(buf)
    } else {
      return fromByteArray(buf.slice(start, end))
    }
  }

  function utf8Slice (buf, start, end) {
    end = Math.min(buf.length, end);
    var res = [];

    var i = start;
    while (i < end) {
      var firstByte = buf[i];
      var codePoint = null;
      var bytesPerSequence = (firstByte > 0xEF) ? 4
        : (firstByte > 0xDF) ? 3
        : (firstByte > 0xBF) ? 2
        : 1;

      if (i + bytesPerSequence <= end) {
        var secondByte, thirdByte, fourthByte, tempCodePoint;

        switch (bytesPerSequence) {
          case 1:
            if (firstByte < 0x80) {
              codePoint = firstByte;
            }
            break
          case 2:
            secondByte = buf[i + 1];
            if ((secondByte & 0xC0) === 0x80) {
              tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F);
              if (tempCodePoint > 0x7F) {
                codePoint = tempCodePoint;
              }
            }
            break
          case 3:
            secondByte = buf[i + 1];
            thirdByte = buf[i + 2];
            if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
              tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F);
              if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
                codePoint = tempCodePoint;
              }
            }
            break
          case 4:
            secondByte = buf[i + 1];
            thirdByte = buf[i + 2];
            fourthByte = buf[i + 3];
            if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
              tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F);
              if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
                codePoint = tempCodePoint;
              }
            }
        }
      }

      if (codePoint === null) {
        // we did not generate a valid codePoint so insert a
        // replacement char (U+FFFD) and advance only 1 byte
        codePoint = 0xFFFD;
        bytesPerSequence = 1;
      } else if (codePoint > 0xFFFF) {
        // encode to utf16 (surrogate pair dance)
        codePoint -= 0x10000;
        res.push(codePoint >>> 10 & 0x3FF | 0xD800);
        codePoint = 0xDC00 | codePoint & 0x3FF;
      }

      res.push(codePoint);
      i += bytesPerSequence;
    }

    return decodeCodePointsArray(res)
  }

  // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  // the lowest limit is Chrome, with 0x10000 args.
  // We go 1 magnitude less, for safety
  var MAX_ARGUMENTS_LENGTH = 0x1000;

  function decodeCodePointsArray (codePoints) {
    var len = codePoints.length;
    if (len <= MAX_ARGUMENTS_LENGTH) {
      return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
    }

    // Decode in chunks to avoid "call stack size exceeded".
    var res = '';
    var i = 0;
    while (i < len) {
      res += String.fromCharCode.apply(
        String,
        codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
      );
    }
    return res
  }

  function asciiSlice (buf, start, end) {
    var ret = '';
    end = Math.min(buf.length, end);

    for (var i = start; i < end; ++i) {
      ret += String.fromCharCode(buf[i] & 0x7F);
    }
    return ret
  }

  function latin1Slice (buf, start, end) {
    var ret = '';
    end = Math.min(buf.length, end);

    for (var i = start; i < end; ++i) {
      ret += String.fromCharCode(buf[i]);
    }
    return ret
  }

  function hexSlice (buf, start, end) {
    var len = buf.length;

    if (!start || start < 0) start = 0;
    if (!end || end < 0 || end > len) end = len;

    var out = '';
    for (var i = start; i < end; ++i) {
      out += toHex(buf[i]);
    }
    return out
  }

  function utf16leSlice (buf, start, end) {
    var bytes = buf.slice(start, end);
    var res = '';
    for (var i = 0; i < bytes.length; i += 2) {
      res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
    }
    return res
  }

  Buffer.prototype.slice = function slice (start, end) {
    var len = this.length;
    start = ~~start;
    end = end === undefined ? len : ~~end;

    if (start < 0) {
      start += len;
      if (start < 0) start = 0;
    } else if (start > len) {
      start = len;
    }

    if (end < 0) {
      end += len;
      if (end < 0) end = 0;
    } else if (end > len) {
      end = len;
    }

    if (end < start) end = start;

    var newBuf;
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      newBuf = this.subarray(start, end);
      newBuf.__proto__ = Buffer.prototype;
    } else {
      var sliceLen = end - start;
      newBuf = new Buffer(sliceLen, undefined);
      for (var i = 0; i < sliceLen; ++i) {
        newBuf[i] = this[i + start];
      }
    }

    return newBuf
  };

  /*
   * Need to make sure that buffer isn't trying to write out of bounds.
   */
  function checkOffset (offset, ext, length) {
    if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
    if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  }

  Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
    offset = offset | 0;
    byteLength = byteLength | 0;
    if (!noAssert) checkOffset(offset, byteLength, this.length);

    var val = this[offset];
    var mul = 1;
    var i = 0;
    while (++i < byteLength && (mul *= 0x100)) {
      val += this[offset + i] * mul;
    }

    return val
  };

  Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
    offset = offset | 0;
    byteLength = byteLength | 0;
    if (!noAssert) {
      checkOffset(offset, byteLength, this.length);
    }

    var val = this[offset + --byteLength];
    var mul = 1;
    while (byteLength > 0 && (mul *= 0x100)) {
      val += this[offset + --byteLength] * mul;
    }

    return val
  };

  Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 1, this.length);
    return this[offset]
  };

  Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length);
    return this[offset] | (this[offset + 1] << 8)
  };

  Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length);
    return (this[offset] << 8) | this[offset + 1]
  };

  Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);

    return ((this[offset]) |
        (this[offset + 1] << 8) |
        (this[offset + 2] << 16)) +
        (this[offset + 3] * 0x1000000)
  };

  Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);

    return (this[offset] * 0x1000000) +
      ((this[offset + 1] << 16) |
      (this[offset + 2] << 8) |
      this[offset + 3])
  };

  Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
    offset = offset | 0;
    byteLength = byteLength | 0;
    if (!noAssert) checkOffset(offset, byteLength, this.length);

    var val = this[offset];
    var mul = 1;
    var i = 0;
    while (++i < byteLength && (mul *= 0x100)) {
      val += this[offset + i] * mul;
    }
    mul *= 0x80;

    if (val >= mul) val -= Math.pow(2, 8 * byteLength);

    return val
  };

  Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
    offset = offset | 0;
    byteLength = byteLength | 0;
    if (!noAssert) checkOffset(offset, byteLength, this.length);

    var i = byteLength;
    var mul = 1;
    var val = this[offset + --i];
    while (i > 0 && (mul *= 0x100)) {
      val += this[offset + --i] * mul;
    }
    mul *= 0x80;

    if (val >= mul) val -= Math.pow(2, 8 * byteLength);

    return val
  };

  Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 1, this.length);
    if (!(this[offset] & 0x80)) return (this[offset])
    return ((0xff - this[offset] + 1) * -1)
  };

  Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length);
    var val = this[offset] | (this[offset + 1] << 8);
    return (val & 0x8000) ? val | 0xFFFF0000 : val
  };

  Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length);
    var val = this[offset + 1] | (this[offset] << 8);
    return (val & 0x8000) ? val | 0xFFFF0000 : val
  };

  Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);

    return (this[offset]) |
      (this[offset + 1] << 8) |
      (this[offset + 2] << 16) |
      (this[offset + 3] << 24)
  };

  Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);

    return (this[offset] << 24) |
      (this[offset + 1] << 16) |
      (this[offset + 2] << 8) |
      (this[offset + 3])
  };

  Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);
    return read(this, offset, true, 23, 4)
  };

  Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);
    return read(this, offset, false, 23, 4)
  };

  Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 8, this.length);
    return read(this, offset, true, 52, 8)
  };

  Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
    if (!noAssert) checkOffset(offset, 8, this.length);
    return read(this, offset, false, 52, 8)
  };

  function checkInt (buf, value, offset, ext, max, min) {
    if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
    if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
    if (offset + ext > buf.length) throw new RangeError('Index out of range')
  }

  Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
    value = +value;
    offset = offset | 0;
    byteLength = byteLength | 0;
    if (!noAssert) {
      var maxBytes = Math.pow(2, 8 * byteLength) - 1;
      checkInt(this, value, offset, byteLength, maxBytes, 0);
    }

    var mul = 1;
    var i = 0;
    this[offset] = value & 0xFF;
    while (++i < byteLength && (mul *= 0x100)) {
      this[offset + i] = (value / mul) & 0xFF;
    }

    return offset + byteLength
  };

  Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
    value = +value;
    offset = offset | 0;
    byteLength = byteLength | 0;
    if (!noAssert) {
      var maxBytes = Math.pow(2, 8 * byteLength) - 1;
      checkInt(this, value, offset, byteLength, maxBytes, 0);
    }

    var i = byteLength - 1;
    var mul = 1;
    this[offset + i] = value & 0xFF;
    while (--i >= 0 && (mul *= 0x100)) {
      this[offset + i] = (value / mul) & 0xFF;
    }

    return offset + byteLength
  };

  Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
    if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
    this[offset] = (value & 0xff);
    return offset + 1
  };

  function objectWriteUInt16 (buf, value, offset, littleEndian) {
    if (value < 0) value = 0xffff + value + 1;
    for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
      buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
        (littleEndian ? i : 1 - i) * 8;
    }
  }

  Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value & 0xff);
      this[offset + 1] = (value >>> 8);
    } else {
      objectWriteUInt16(this, value, offset, true);
    }
    return offset + 2
  };

  Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value >>> 8);
      this[offset + 1] = (value & 0xff);
    } else {
      objectWriteUInt16(this, value, offset, false);
    }
    return offset + 2
  };

  function objectWriteUInt32 (buf, value, offset, littleEndian) {
    if (value < 0) value = 0xffffffff + value + 1;
    for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
      buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff;
    }
  }

  Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset + 3] = (value >>> 24);
      this[offset + 2] = (value >>> 16);
      this[offset + 1] = (value >>> 8);
      this[offset] = (value & 0xff);
    } else {
      objectWriteUInt32(this, value, offset, true);
    }
    return offset + 4
  };

  Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value >>> 24);
      this[offset + 1] = (value >>> 16);
      this[offset + 2] = (value >>> 8);
      this[offset + 3] = (value & 0xff);
    } else {
      objectWriteUInt32(this, value, offset, false);
    }
    return offset + 4
  };

  Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) {
      var limit = Math.pow(2, 8 * byteLength - 1);

      checkInt(this, value, offset, byteLength, limit - 1, -limit);
    }

    var i = 0;
    var mul = 1;
    var sub = 0;
    this[offset] = value & 0xFF;
    while (++i < byteLength && (mul *= 0x100)) {
      if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
        sub = 1;
      }
      this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
    }

    return offset + byteLength
  };

  Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) {
      var limit = Math.pow(2, 8 * byteLength - 1);

      checkInt(this, value, offset, byteLength, limit - 1, -limit);
    }

    var i = byteLength - 1;
    var mul = 1;
    var sub = 0;
    this[offset + i] = value & 0xFF;
    while (--i >= 0 && (mul *= 0x100)) {
      if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
        sub = 1;
      }
      this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
    }

    return offset + byteLength
  };

  Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
    if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
    if (value < 0) value = 0xff + value + 1;
    this[offset] = (value & 0xff);
    return offset + 1
  };

  Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value & 0xff);
      this[offset + 1] = (value >>> 8);
    } else {
      objectWriteUInt16(this, value, offset, true);
    }
    return offset + 2
  };

  Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value >>> 8);
      this[offset + 1] = (value & 0xff);
    } else {
      objectWriteUInt16(this, value, offset, false);
    }
    return offset + 2
  };

  Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value & 0xff);
      this[offset + 1] = (value >>> 8);
      this[offset + 2] = (value >>> 16);
      this[offset + 3] = (value >>> 24);
    } else {
      objectWriteUInt32(this, value, offset, true);
    }
    return offset + 4
  };

  Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
    if (value < 0) value = 0xffffffff + value + 1;
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = (value >>> 24);
      this[offset + 1] = (value >>> 16);
      this[offset + 2] = (value >>> 8);
      this[offset + 3] = (value & 0xff);
    } else {
      objectWriteUInt32(this, value, offset, false);
    }
    return offset + 4
  };

  function checkIEEE754 (buf, value, offset, ext, max, min) {
    if (offset + ext > buf.length) throw new RangeError('Index out of range')
    if (offset < 0) throw new RangeError('Index out of range')
  }

  function writeFloat (buf, value, offset, littleEndian, noAssert) {
    if (!noAssert) {
      checkIEEE754(buf, value, offset, 4);
    }
    write(buf, value, offset, littleEndian, 23, 4);
    return offset + 4
  }

  Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
    return writeFloat(this, value, offset, true, noAssert)
  };

  Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
    return writeFloat(this, value, offset, false, noAssert)
  };

  function writeDouble (buf, value, offset, littleEndian, noAssert) {
    if (!noAssert) {
      checkIEEE754(buf, value, offset, 8);
    }
    write(buf, value, offset, littleEndian, 52, 8);
    return offset + 8
  }

  Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
    return writeDouble(this, value, offset, true, noAssert)
  };

  Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
    return writeDouble(this, value, offset, false, noAssert)
  };

  // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  Buffer.prototype.copy = function copy (target, targetStart, start, end) {
    if (!start) start = 0;
    if (!end && end !== 0) end = this.length;
    if (targetStart >= target.length) targetStart = target.length;
    if (!targetStart) targetStart = 0;
    if (end > 0 && end < start) end = start;

    // Copy 0 bytes; we're done
    if (end === start) return 0
    if (target.length === 0 || this.length === 0) return 0

    // Fatal error conditions
    if (targetStart < 0) {
      throw new RangeError('targetStart out of bounds')
    }
    if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
    if (end < 0) throw new RangeError('sourceEnd out of bounds')

    // Are we oob?
    if (end > this.length) end = this.length;
    if (target.length - targetStart < end - start) {
      end = target.length - targetStart + start;
    }

    var len = end - start;
    var i;

    if (this === target && start < targetStart && targetStart < end) {
      // descending copy from end
      for (i = len - 1; i >= 0; --i) {
        target[i + targetStart] = this[i + start];
      }
    } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
      // ascending copy from start
      for (i = 0; i < len; ++i) {
        target[i + targetStart] = this[i + start];
      }
    } else {
      Uint8Array.prototype.set.call(
        target,
        this.subarray(start, start + len),
        targetStart
      );
    }

    return len
  };

  // Usage:
  //    buffer.fill(number[, offset[, end]])
  //    buffer.fill(buffer[, offset[, end]])
  //    buffer.fill(string[, offset[, end]][, encoding])
  Buffer.prototype.fill = function fill (val, start, end, encoding) {
    // Handle string cases:
    if (typeof val === 'string') {
      if (typeof start === 'string') {
        encoding = start;
        start = 0;
        end = this.length;
      } else if (typeof end === 'string') {
        encoding = end;
        end = this.length;
      }
      if (val.length === 1) {
        var code = val.charCodeAt(0);
        if (code < 256) {
          val = code;
        }
      }
      if (encoding !== undefined && typeof encoding !== 'string') {
        throw new TypeError('encoding must be a string')
      }
      if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
        throw new TypeError('Unknown encoding: ' + encoding)
      }
    } else if (typeof val === 'number') {
      val = val & 255;
    }

    // Invalid ranges are not set to a default, so can range check early.
    if (start < 0 || this.length < start || this.length < end) {
      throw new RangeError('Out of range index')
    }

    if (end <= start) {
      return this
    }

    start = start >>> 0;
    end = end === undefined ? this.length : end >>> 0;

    if (!val) val = 0;

    var i;
    if (typeof val === 'number') {
      for (i = start; i < end; ++i) {
        this[i] = val;
      }
    } else {
      var bytes = internalIsBuffer(val)
        ? val
        : utf8ToBytes(new Buffer(val, encoding).toString());
      var len = bytes.length;
      for (i = 0; i < end - start; ++i) {
        this[i + start] = bytes[i % len];
      }
    }

    return this
  };

  // HELPER FUNCTIONS
  // ================

  var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;

  function base64clean (str) {
    // Node strips out invalid characters like \n and \t from the string, base64-js does not
    str = stringtrim(str).replace(INVALID_BASE64_RE, '');
    // Node converts strings with length < 2 to ''
    if (str.length < 2) return ''
    // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
    while (str.length % 4 !== 0) {
      str = str + '=';
    }
    return str
  }

  function stringtrim (str) {
    if (str.trim) return str.trim()
    return str.replace(/^\s+|\s+$/g, '')
  }

  function toHex (n) {
    if (n < 16) return '0' + n.toString(16)
    return n.toString(16)
  }

  function utf8ToBytes (string, units) {
    units = units || Infinity;
    var codePoint;
    var length = string.length;
    var leadSurrogate = null;
    var bytes = [];

    for (var i = 0; i < length; ++i) {
      codePoint = string.charCodeAt(i);

      // is surrogate component
      if (codePoint > 0xD7FF && codePoint < 0xE000) {
        // last char was a lead
        if (!leadSurrogate) {
          // no lead yet
          if (codePoint > 0xDBFF) {
            // unexpected trail
            if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
            continue
          } else if (i + 1 === length) {
            // unpaired lead
            if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
            continue
          }

          // valid lead
          leadSurrogate = codePoint;

          continue
        }

        // 2 leads in a row
        if (codePoint < 0xDC00) {
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
          leadSurrogate = codePoint;
          continue
        }

        // valid surrogate pair
        codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
      } else if (leadSurrogate) {
        // valid bmp char, but last char was a lead
        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
      }

      leadSurrogate = null;

      // encode utf8
      if (codePoint < 0x80) {
        if ((units -= 1) < 0) break
        bytes.push(codePoint);
      } else if (codePoint < 0x800) {
        if ((units -= 2) < 0) break
        bytes.push(
          codePoint >> 0x6 | 0xC0,
          codePoint & 0x3F | 0x80
        );
      } else if (codePoint < 0x10000) {
        if ((units -= 3) < 0) break
        bytes.push(
          codePoint >> 0xC | 0xE0,
          codePoint >> 0x6 & 0x3F | 0x80,
          codePoint & 0x3F | 0x80
        );
      } else if (codePoint < 0x110000) {
        if ((units -= 4) < 0) break
        bytes.push(
          codePoint >> 0x12 | 0xF0,
          codePoint >> 0xC & 0x3F | 0x80,
          codePoint >> 0x6 & 0x3F | 0x80,
          codePoint & 0x3F | 0x80
        );
      } else {
        throw new Error('Invalid code point')
      }
    }

    return bytes
  }

  function asciiToBytes (str) {
    var byteArray = [];
    for (var i = 0; i < str.length; ++i) {
      // Node's code seems to be doing this and not & 0x7F..
      byteArray.push(str.charCodeAt(i) & 0xFF);
    }
    return byteArray
  }

  function utf16leToBytes (str, units) {
    var c, hi, lo;
    var byteArray = [];
    for (var i = 0; i < str.length; ++i) {
      if ((units -= 2) < 0) break

      c = str.charCodeAt(i);
      hi = c >> 8;
      lo = c % 256;
      byteArray.push(lo);
      byteArray.push(hi);
    }

    return byteArray
  }


  function base64ToBytes (str) {
    return toByteArray(base64clean(str))
  }

  function blitBuffer (src, dst, offset, length) {
    for (var i = 0; i < length; ++i) {
      if ((i + offset >= dst.length) || (i >= src.length)) break
      dst[i + offset] = src[i];
    }
    return i
  }

  function isnan (val) {
    return val !== val // eslint-disable-line no-self-compare
  }


  // the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence
  // The _isBuffer check is for Safari 5-7 support, because it's missing
  // Object.prototype.constructor. Remove this eventually
  function isBuffer(obj) {
    return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))
  }

  function isFastBuffer (obj) {
    return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
  }

  // For Node v0.10 support. Remove this eventually.
  function isSlowBuffer (obj) {
    return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))
  }

  // shim for using process in browser
  // based off https://github.com/defunctzombie/node-process/blob/master/browser.js

  function defaultSetTimout() {
      throw new Error('setTimeout has not been defined');
  }
  function defaultClearTimeout () {
      throw new Error('clearTimeout has not been defined');
  }
  var cachedSetTimeout = defaultSetTimout;
  var cachedClearTimeout = defaultClearTimeout;
  if (typeof global$1.setTimeout === 'function') {
      cachedSetTimeout = setTimeout;
  }
  if (typeof global$1.clearTimeout === 'function') {
      cachedClearTimeout = clearTimeout;
  }

  function runTimeout(fun) {
      if (cachedSetTimeout === setTimeout) {
          //normal enviroments in sane situations
          return setTimeout(fun, 0);
      }
      // if setTimeout wasn't available but was latter defined
      if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
          cachedSetTimeout = setTimeout;
          return setTimeout(fun, 0);
      }
      try {
          // when when somebody has screwed with setTimeout but no I.E. maddness
          return cachedSetTimeout(fun, 0);
      } catch(e){
          try {
              // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
              return cachedSetTimeout.call(null, fun, 0);
          } catch(e){
              // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
              return cachedSetTimeout.call(this, fun, 0);
          }
      }


  }
  function runClearTimeout(marker) {
      if (cachedClearTimeout === clearTimeout) {
          //normal enviroments in sane situations
          return clearTimeout(marker);
      }
      // if clearTimeout wasn't available but was latter defined
      if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
          cachedClearTimeout = clearTimeout;
          return clearTimeout(marker);
      }
      try {
          // when when somebody has screwed with setTimeout but no I.E. maddness
          return cachedClearTimeout(marker);
      } catch (e){
          try {
              // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
              return cachedClearTimeout.call(null, marker);
          } catch (e){
              // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
              // Some versions of I.E. have different rules for clearTimeout vs setTimeout
              return cachedClearTimeout.call(this, marker);
          }
      }



  }
  var queue = [];
  var draining = false;
  var currentQueue;
  var queueIndex = -1;

  function cleanUpNextTick() {
      if (!draining || !currentQueue) {
          return;
      }
      draining = false;
      if (currentQueue.length) {
          queue = currentQueue.concat(queue);
      } else {
          queueIndex = -1;
      }
      if (queue.length) {
          drainQueue();
      }
  }

  function drainQueue() {
      if (draining) {
          return;
      }
      var timeout = runTimeout(cleanUpNextTick);
      draining = true;

      var len = queue.length;
      while(len) {
          currentQueue = queue;
          queue = [];
          while (++queueIndex < len) {
              if (currentQueue) {
                  currentQueue[queueIndex].run();
              }
          }
          queueIndex = -1;
          len = queue.length;
      }
      currentQueue = null;
      draining = false;
      runClearTimeout(timeout);
  }
  function nextTick(fun) {
      var args = new Array(arguments.length - 1);
      if (arguments.length > 1) {
          for (var i = 1; i < arguments.length; i++) {
              args[i - 1] = arguments[i];
          }
      }
      queue.push(new Item(fun, args));
      if (queue.length === 1 && !draining) {
          runTimeout(drainQueue);
      }
  }
  // v8 likes predictible objects
  function Item(fun, array) {
      this.fun = fun;
      this.array = array;
  }
  Item.prototype.run = function () {
      this.fun.apply(null, this.array);
  };

  // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
  var performance = global$1.performance || {};
  var performanceNow =
    performance.now        ||
    performance.mozNow     ||
    performance.msNow      ||
    performance.oNow       ||
    performance.webkitNow  ||
    function(){ return (new Date()).getTime() };

  var inherits;
  if (typeof Object.create === 'function'){
    inherits = function inherits(ctor, superCtor) {
      // implementation from standard node.js 'util' module
      ctor.super_ = superCtor;
      ctor.prototype = Object.create(superCtor.prototype, {
        constructor: {
          value: ctor,
          enumerable: false,
          writable: true,
          configurable: true
        }
      });
    };
  } else {
    inherits = function inherits(ctor, superCtor) {
      ctor.super_ = superCtor;
      var TempCtor = function () {};
      TempCtor.prototype = superCtor.prototype;
      ctor.prototype = new TempCtor();
      ctor.prototype.constructor = ctor;
    };
  }
  var inherits$1 = inherits;

  var formatRegExp = /%[sdj%]/g;
  function format(f) {
    if (!isString(f)) {
      var objects = [];
      for (var i = 0; i < arguments.length; i++) {
        objects.push(inspect(arguments[i]));
      }
      return objects.join(' ');
    }

    var i = 1;
    var args = arguments;
    var len = args.length;
    var str = String(f).replace(formatRegExp, function(x) {
      if (x === '%%') return '%';
      if (i >= len) return x;
      switch (x) {
        case '%s': return String(args[i++]);
        case '%d': return Number(args[i++]);
        case '%j':
          try {
            return JSON.stringify(args[i++]);
          } catch (_) {
            return '[Circular]';
          }
        default:
          return x;
      }
    });
    for (var x = args[i]; i < len; x = args[++i]) {
      if (isNull(x) || !isObject(x)) {
        str += ' ' + x;
      } else {
        str += ' ' + inspect(x);
      }
    }
    return str;
  }

  // Mark that a method should not be used.
  // Returns a modified function which warns once by default.
  // If --no-deprecation is set, then it is a no-op.
  function deprecate(fn, msg) {
    // Allow for deprecating things in the process of starting up.
    if (isUndefined(global$1.process)) {
      return function() {
        return deprecate(fn, msg).apply(this, arguments);
      };
    }

    var warned = false;
    function deprecated() {
      if (!warned) {
        {
          console.error(msg);
        }
        warned = true;
      }
      return fn.apply(this, arguments);
    }

    return deprecated;
  }

  var debugs = {};
  var debugEnviron;
  function debuglog(set) {
    if (isUndefined(debugEnviron))
      debugEnviron =  '';
    set = set.toUpperCase();
    if (!debugs[set]) {
      if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
        var pid = 0;
        debugs[set] = function() {
          var msg = format.apply(null, arguments);
          console.error('%s %d: %s', set, pid, msg);
        };
      } else {
        debugs[set] = function() {};
      }
    }
    return debugs[set];
  }

  /**
   * Echos the value of a value. Trys to print the value out
   * in the best way possible given the different types.
   *
   * @param {Object} obj The object to print out.
   * @param {Object} opts Optional options object that alters the output.
   */
  /* legacy: obj, showHidden, depth, colors*/
  function inspect(obj, opts) {
    // default options
    var ctx = {
      seen: [],
      stylize: stylizeNoColor
    };
    // legacy...
    if (arguments.length >= 3) ctx.depth = arguments[2];
    if (arguments.length >= 4) ctx.colors = arguments[3];
    if (isBoolean(opts)) {
      // legacy...
      ctx.showHidden = opts;
    } else if (opts) {
      // got an "options" object
      _extend(ctx, opts);
    }
    // set default options
    if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
    if (isUndefined(ctx.depth)) ctx.depth = 2;
    if (isUndefined(ctx.colors)) ctx.colors = false;
    if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
    if (ctx.colors) ctx.stylize = stylizeWithColor;
    return formatValue(ctx, obj, ctx.depth);
  }

  // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  inspect.colors = {
    'bold' : [1, 22],
    'italic' : [3, 23],
    'underline' : [4, 24],
    'inverse' : [7, 27],
    'white' : [37, 39],
    'grey' : [90, 39],
    'black' : [30, 39],
    'blue' : [34, 39],
    'cyan' : [36, 39],
    'green' : [32, 39],
    'magenta' : [35, 39],
    'red' : [31, 39],
    'yellow' : [33, 39]
  };

  // Don't use 'blue' not visible on cmd.exe
  inspect.styles = {
    'special': 'cyan',
    'number': 'yellow',
    'boolean': 'yellow',
    'undefined': 'grey',
    'null': 'bold',
    'string': 'green',
    'date': 'magenta',
    // "name": intentionally not styling
    'regexp': 'red'
  };


  function stylizeWithColor(str, styleType) {
    var style = inspect.styles[styleType];

    if (style) {
      return '\u001b[' + inspect.colors[style][0] + 'm' + str +
             '\u001b[' + inspect.colors[style][1] + 'm';
    } else {
      return str;
    }
  }


  function stylizeNoColor(str, styleType) {
    return str;
  }


  function arrayToHash(array) {
    var hash = {};

    array.forEach(function(val, idx) {
      hash[val] = true;
    });

    return hash;
  }


  function formatValue(ctx, value, recurseTimes) {
    // Provide a hook for user-specified inspect functions.
    // Check that value is an object with an inspect function on it
    if (ctx.customInspect &&
        value &&
        isFunction(value.inspect) &&
        // Filter out the util module, it's inspect function is special
        value.inspect !== inspect &&
        // Also filter out any prototype objects using the circular check.
        !(value.constructor && value.constructor.prototype === value)) {
      var ret = value.inspect(recurseTimes, ctx);
      if (!isString(ret)) {
        ret = formatValue(ctx, ret, recurseTimes);
      }
      return ret;
    }

    // Primitive types cannot have properties
    var primitive = formatPrimitive(ctx, value);
    if (primitive) {
      return primitive;
    }

    // Look up the keys of the object.
    var keys = Object.keys(value);
    var visibleKeys = arrayToHash(keys);

    if (ctx.showHidden) {
      keys = Object.getOwnPropertyNames(value);
    }

    // IE doesn't make error fields non-enumerable
    // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
    if (isError(value)
        && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
      return formatError(value);
    }

    // Some type of object without properties can be shortcutted.
    if (keys.length === 0) {
      if (isFunction(value)) {
        var name = value.name ? ': ' + value.name : '';
        return ctx.stylize('[Function' + name + ']', 'special');
      }
      if (isRegExp(value)) {
        return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
      }
      if (isDate(value)) {
        return ctx.stylize(Date.prototype.toString.call(value), 'date');
      }
      if (isError(value)) {
        return formatError(value);
      }
    }

    var base = '', array = false, braces = ['{', '}'];

    // Make Array say that they are Array
    if (isArray$1(value)) {
      array = true;
      braces = ['[', ']'];
    }

    // Make functions say that they are functions
    if (isFunction(value)) {
      var n = value.name ? ': ' + value.name : '';
      base = ' [Function' + n + ']';
    }

    // Make RegExps say that they are RegExps
    if (isRegExp(value)) {
      base = ' ' + RegExp.prototype.toString.call(value);
    }

    // Make dates with properties first say the date
    if (isDate(value)) {
      base = ' ' + Date.prototype.toUTCString.call(value);
    }

    // Make error with message first say the error
    if (isError(value)) {
      base = ' ' + formatError(value);
    }

    if (keys.length === 0 && (!array || value.length == 0)) {
      return braces[0] + base + braces[1];
    }

    if (recurseTimes < 0) {
      if (isRegExp(value)) {
        return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
      } else {
        return ctx.stylize('[Object]', 'special');
      }
    }

    ctx.seen.push(value);

    var output;
    if (array) {
      output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
    } else {
      output = keys.map(function(key) {
        return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
      });
    }

    ctx.seen.pop();

    return reduceToSingleString(output, base, braces);
  }


  function formatPrimitive(ctx, value) {
    if (isUndefined(value))
      return ctx.stylize('undefined', 'undefined');
    if (isString(value)) {
      var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
                                               .replace(/'/g, "\\'")
                                               .replace(/\\"/g, '"') + '\'';
      return ctx.stylize(simple, 'string');
    }
    if (isNumber(value))
      return ctx.stylize('' + value, 'number');
    if (isBoolean(value))
      return ctx.stylize('' + value, 'boolean');
    // For some reason typeof null is "object", so special case here.
    if (isNull(value))
      return ctx.stylize('null', 'null');
  }


  function formatError(value) {
    return '[' + Error.prototype.toString.call(value) + ']';
  }


  function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
    var output = [];
    for (var i = 0, l = value.length; i < l; ++i) {
      if (hasOwnProperty(value, String(i))) {
        output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
            String(i), true));
      } else {
        output.push('');
      }
    }
    keys.forEach(function(key) {
      if (!key.match(/^\d+$/)) {
        output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
            key, true));
      }
    });
    return output;
  }


  function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
    var name, str, desc;
    desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
    if (desc.get) {
      if (desc.set) {
        str = ctx.stylize('[Getter/Setter]', 'special');
      } else {
        str = ctx.stylize('[Getter]', 'special');
      }
    } else {
      if (desc.set) {
        str = ctx.stylize('[Setter]', 'special');
      }
    }
    if (!hasOwnProperty(visibleKeys, key)) {
      name = '[' + key + ']';
    }
    if (!str) {
      if (ctx.seen.indexOf(desc.value) < 0) {
        if (isNull(recurseTimes)) {
          str = formatValue(ctx, desc.value, null);
        } else {
          str = formatValue(ctx, desc.value, recurseTimes - 1);
        }
        if (str.indexOf('\n') > -1) {
          if (array) {
            str = str.split('\n').map(function(line) {
              return '  ' + line;
            }).join('\n').substr(2);
          } else {
            str = '\n' + str.split('\n').map(function(line) {
              return '   ' + line;
            }).join('\n');
          }
        }
      } else {
        str = ctx.stylize('[Circular]', 'special');
      }
    }
    if (isUndefined(name)) {
      if (array && key.match(/^\d+$/)) {
        return str;
      }
      name = JSON.stringify('' + key);
      if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
        name = name.substr(1, name.length - 2);
        name = ctx.stylize(name, 'name');
      } else {
        name = name.replace(/'/g, "\\'")
                   .replace(/\\"/g, '"')
                   .replace(/(^"|"$)/g, "'");
        name = ctx.stylize(name, 'string');
      }
    }

    return name + ': ' + str;
  }


  function reduceToSingleString(output, base, braces) {
    var length = output.reduce(function(prev, cur) {
      if (cur.indexOf('\n') >= 0) ;
      return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
    }, 0);

    if (length > 60) {
      return braces[0] +
             (base === '' ? '' : base + '\n ') +
             ' ' +
             output.join(',\n  ') +
             ' ' +
             braces[1];
    }

    return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  }


  // NOTE: These type checking functions intentionally don't use `instanceof`
  // because it is fragile and can be easily faked with `Object.create()`.
  function isArray$1(ar) {
    return Array.isArray(ar);
  }

  function isBoolean(arg) {
    return typeof arg === 'boolean';
  }

  function isNull(arg) {
    return arg === null;
  }

  function isNumber(arg) {
    return typeof arg === 'number';
  }

  function isString(arg) {
    return typeof arg === 'string';
  }

  function isUndefined(arg) {
    return arg === void 0;
  }

  function isRegExp(re) {
    return isObject(re) && objectToString(re) === '[object RegExp]';
  }

  function isObject(arg) {
    return typeof arg === 'object' && arg !== null;
  }

  function isDate(d) {
    return isObject(d) && objectToString(d) === '[object Date]';
  }

  function isError(e) {
    return isObject(e) &&
        (objectToString(e) === '[object Error]' || e instanceof Error);
  }

  function isFunction(arg) {
    return typeof arg === 'function';
  }

  function objectToString(o) {
    return Object.prototype.toString.call(o);
  }

  function _extend(origin, add) {
    // Don't do anything if add isn't an object
    if (!add || !isObject(add)) return origin;

    var keys = Object.keys(add);
    var i = keys.length;
    while (i--) {
      origin[keys[i]] = add[keys[i]];
    }
    return origin;
  }
  function hasOwnProperty(obj, prop) {
    return Object.prototype.hasOwnProperty.call(obj, prop);
  }

  function BufferList() {
    this.head = null;
    this.tail = null;
    this.length = 0;
  }

  BufferList.prototype.push = function (v) {
    var entry = { data: v, next: null };
    if (this.length > 0) this.tail.next = entry;else this.head = entry;
    this.tail = entry;
    ++this.length;
  };

  BufferList.prototype.unshift = function (v) {
    var entry = { data: v, next: this.head };
    if (this.length === 0) this.tail = entry;
    this.head = entry;
    ++this.length;
  };

  BufferList.prototype.shift = function () {
    if (this.length === 0) return;
    var ret = this.head.data;
    if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
    --this.length;
    return ret;
  };

  BufferList.prototype.clear = function () {
    this.head = this.tail = null;
    this.length = 0;
  };

  BufferList.prototype.join = function (s) {
    if (this.length === 0) return '';
    var p = this.head;
    var ret = '' + p.data;
    while (p = p.next) {
      ret += s + p.data;
    }return ret;
  };

  BufferList.prototype.concat = function (n) {
    if (this.length === 0) return Buffer.alloc(0);
    if (this.length === 1) return this.head.data;
    var ret = Buffer.allocUnsafe(n >>> 0);
    var p = this.head;
    var i = 0;
    while (p) {
      p.data.copy(ret, i);
      i += p.data.length;
      p = p.next;
    }
    return ret;
  };

  // Copyright Joyent, Inc. and other Node contributors.
  var isBufferEncoding = Buffer.isEncoding
    || function(encoding) {
         switch (encoding && encoding.toLowerCase()) {
           case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
           default: return false;
         }
       };


  function assertEncoding(encoding) {
    if (encoding && !isBufferEncoding(encoding)) {
      throw new Error('Unknown encoding: ' + encoding);
    }
  }

  // StringDecoder provides an interface for efficiently splitting a series of
  // buffers into a series of JS strings without breaking apart multi-byte
  // characters. CESU-8 is handled as part of the UTF-8 encoding.
  //
  // @TODO Handling all encodings inside a single object makes it very difficult
  // to reason about this code, so it should be split up in the future.
  // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
  // points as used by CESU-8.
  function StringDecoder(encoding) {
    this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
    assertEncoding(encoding);
    switch (this.encoding) {
      case 'utf8':
        // CESU-8 represents each of Surrogate Pair by 3-bytes
        this.surrogateSize = 3;
        break;
      case 'ucs2':
      case 'utf16le':
        // UTF-16 represents each of Surrogate Pair by 2-bytes
        this.surrogateSize = 2;
        this.detectIncompleteChar = utf16DetectIncompleteChar;
        break;
      case 'base64':
        // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
        this.surrogateSize = 3;
        this.detectIncompleteChar = base64DetectIncompleteChar;
        break;
      default:
        this.write = passThroughWrite;
        return;
    }

    // Enough space to store all bytes of a single character. UTF-8 needs 4
    // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
    this.charBuffer = new Buffer(6);
    // Number of bytes received for the current incomplete multi-byte character.
    this.charReceived = 0;
    // Number of bytes expected for the current incomplete multi-byte character.
    this.charLength = 0;
  }

  // write decodes the given buffer and returns it as JS string that is
  // guaranteed to not contain any partial multi-byte characters. Any partial
  // character found at the end of the buffer is buffered up, and will be
  // returned when calling write again with the remaining bytes.
  //
  // Note: Converting a Buffer containing an orphan surrogate to a String
  // currently works, but converting a String to a Buffer (via `new Buffer`, or
  // Buffer#write) will replace incomplete surrogates with the unicode
  // replacement character. See https://codereview.chromium.org/121173009/ .
  StringDecoder.prototype.write = function(buffer) {
    var charStr = '';
    // if our last write ended with an incomplete multibyte character
    while (this.charLength) {
      // determine how many remaining bytes this buffer has to offer for this char
      var available = (buffer.length >= this.charLength - this.charReceived) ?
          this.charLength - this.charReceived :
          buffer.length;

      // add the new bytes to the char buffer
      buffer.copy(this.charBuffer, this.charReceived, 0, available);
      this.charReceived += available;

      if (this.charReceived < this.charLength) {
        // still not enough chars in this buffer? wait for more ...
        return '';
      }

      // remove bytes belonging to the current character from the buffer
      buffer = buffer.slice(available, buffer.length);

      // get the character that was split
      charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);

      // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
      var charCode = charStr.charCodeAt(charStr.length - 1);
      if (charCode >= 0xD800 && charCode <= 0xDBFF) {
        this.charLength += this.surrogateSize;
        charStr = '';
        continue;
      }
      this.charReceived = this.charLength = 0;

      // if there are no more bytes in this buffer, just emit our char
      if (buffer.length === 0) {
        return charStr;
      }
      break;
    }

    // determine and set charLength / charReceived
    this.detectIncompleteChar(buffer);

    var end = buffer.length;
    if (this.charLength) {
      // buffer the incomplete character bytes we got
      buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
      end -= this.charReceived;
    }

    charStr += buffer.toString(this.encoding, 0, end);

    var end = charStr.length - 1;
    var charCode = charStr.charCodeAt(end);
    // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
    if (charCode >= 0xD800 && charCode <= 0xDBFF) {
      var size = this.surrogateSize;
      this.charLength += size;
      this.charReceived += size;
      this.charBuffer.copy(this.charBuffer, size, 0, size);
      buffer.copy(this.charBuffer, 0, 0, size);
      return charStr.substring(0, end);
    }

    // or just emit the charStr
    return charStr;
  };

  // detectIncompleteChar determines if there is an incomplete UTF-8 character at
  // the end of the given buffer. If so, it sets this.charLength to the byte
  // length that character, and sets this.charReceived to the number of bytes
  // that are available for this character.
  StringDecoder.prototype.detectIncompleteChar = function(buffer) {
    // determine how many bytes we have to check at the end of this buffer
    var i = (buffer.length >= 3) ? 3 : buffer.length;

    // Figure out if one of the last i bytes of our buffer announces an
    // incomplete char.
    for (; i > 0; i--) {
      var c = buffer[buffer.length - i];

      // See http://en.wikipedia.org/wiki/UTF-8#Description

      // 110XXXXX
      if (i == 1 && c >> 5 == 0x06) {
        this.charLength = 2;
        break;
      }

      // 1110XXXX
      if (i <= 2 && c >> 4 == 0x0E) {
        this.charLength = 3;
        break;
      }

      // 11110XXX
      if (i <= 3 && c >> 3 == 0x1E) {
        this.charLength = 4;
        break;
      }
    }
    this.charReceived = i;
  };

  StringDecoder.prototype.end = function(buffer) {
    var res = '';
    if (buffer && buffer.length)
      res = this.write(buffer);

    if (this.charReceived) {
      var cr = this.charReceived;
      var buf = this.charBuffer;
      var enc = this.encoding;
      res += buf.slice(0, cr).toString(enc);
    }

    return res;
  };

  function passThroughWrite(buffer) {
    return buffer.toString(this.encoding);
  }

  function utf16DetectIncompleteChar(buffer) {
    this.charReceived = buffer.length % 2;
    this.charLength = this.charReceived ? 2 : 0;
  }

  function base64DetectIncompleteChar(buffer) {
    this.charReceived = buffer.length % 3;
    this.charLength = this.charReceived ? 3 : 0;
  }

  Readable.ReadableState = ReadableState;

  var debug = debuglog('stream');
  inherits$1(Readable, EventEmitter);

  function prependListener(emitter, event, fn) {
    // Sadly this is not cacheable as some libraries bundle their own
    // event emitter implementation with them.
    if (typeof emitter.prependListener === 'function') {
      return emitter.prependListener(event, fn);
    } else {
      // This is a hack to make sure that our error handler is attached before any
      // userland ones.  NEVER DO THIS. This is here only because this code needs
      // to continue to work with older versions of Node.js that do not include
      // the prependListener() method. The goal is to eventually remove this hack.
      if (!emitter._events || !emitter._events[event])
        emitter.on(event, fn);
      else if (Array.isArray(emitter._events[event]))
        emitter._events[event].unshift(fn);
      else
        emitter._events[event] = [fn, emitter._events[event]];
    }
  }
  function listenerCount$1 (emitter, type) {
    return emitter.listeners(type).length;
  }
  function ReadableState(options, stream) {

    options = options || {};

    // object stream flag. Used to make read(n) ignore n and to
    // make all the buffer merging and length checks go away
    this.objectMode = !!options.objectMode;

    if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;

    // the point at which it stops calling _read() to fill the buffer
    // Note: 0 is a valid value, means "don't call _read preemptively ever"
    var hwm = options.highWaterMark;
    var defaultHwm = this.objectMode ? 16 : 16 * 1024;
    this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;

    // cast to ints.
    this.highWaterMark = ~ ~this.highWaterMark;

    // A linked list is used to store data chunks instead of an array because the
    // linked list can remove elements from the beginning faster than
    // array.shift()
    this.buffer = new BufferList();
    this.length = 0;
    this.pipes = null;
    this.pipesCount = 0;
    this.flowing = null;
    this.ended = false;
    this.endEmitted = false;
    this.reading = false;

    // a flag to be able to tell if the onwrite cb is called immediately,
    // or on a later tick.  We set this to true at first, because any
    // actions that shouldn't happen until "later" should generally also
    // not happen before the first write call.
    this.sync = true;

    // whenever we return null, then we set a flag to say
    // that we're awaiting a 'readable' event emission.
    this.needReadable = false;
    this.emittedReadable = false;
    this.readableListening = false;
    this.resumeScheduled = false;

    // Crypto is kind of old and crusty.  Historically, its default string
    // encoding is 'binary' so we have to make this configurable.
    // Everything else in the universe uses 'utf8', though.
    this.defaultEncoding = options.defaultEncoding || 'utf8';

    // when piping, we only care about 'readable' events that happen
    // after read()ing all the bytes and not getting any pushback.
    this.ranOut = false;

    // the number of writers that are awaiting a drain event in .pipe()s
    this.awaitDrain = 0;

    // if true, a maybeReadMore has been scheduled
    this.readingMore = false;

    this.decoder = null;
    this.encoding = null;
    if (options.encoding) {
      this.decoder = new StringDecoder(options.encoding);
      this.encoding = options.encoding;
    }
  }
  function Readable(options) {

    if (!(this instanceof Readable)) return new Readable(options);

    this._readableState = new ReadableState(options, this);

    // legacy
    this.readable = true;

    if (options && typeof options.read === 'function') this._read = options.read;

    EventEmitter.call(this);
  }

  // Manually shove something into the read() buffer.
  // This returns true if the highWaterMark has not been hit yet,
  // similar to how Writable.write() returns true if you should
  // write() some more.
  Readable.prototype.push = function (chunk, encoding) {
    var state = this._readableState;

    if (!state.objectMode && typeof chunk === 'string') {
      encoding = encoding || state.defaultEncoding;
      if (encoding !== state.encoding) {
        chunk = Buffer.from(chunk, encoding);
        encoding = '';
      }
    }

    return readableAddChunk(this, state, chunk, encoding, false);
  };

  // Unshift should *always* be something directly out of read()
  Readable.prototype.unshift = function (chunk) {
    var state = this._readableState;
    return readableAddChunk(this, state, chunk, '', true);
  };

  Readable.prototype.isPaused = function () {
    return this._readableState.flowing === false;
  };

  function readableAddChunk(stream, state, chunk, encoding, addToFront) {
    var er = chunkInvalid(state, chunk);
    if (er) {
      stream.emit('error', er);
    } else if (chunk === null) {
      state.reading = false;
      onEofChunk(stream, state);
    } else if (state.objectMode || chunk && chunk.length > 0) {
      if (state.ended && !addToFront) {
        var e = new Error('stream.push() after EOF');
        stream.emit('error', e);
      } else if (state.endEmitted && addToFront) {
        var _e = new Error('stream.unshift() after end event');
        stream.emit('error', _e);
      } else {
        var skipAdd;
        if (state.decoder && !addToFront && !encoding) {
          chunk = state.decoder.write(chunk);
          skipAdd = !state.objectMode && chunk.length === 0;
        }

        if (!addToFront) state.reading = false;

        // Don't add to the buffer if we've decoded to an empty string chunk and
        // we're not in object mode
        if (!skipAdd) {
          // if we want the data now, just emit it.
          if (state.flowing && state.length === 0 && !state.sync) {
            stream.emit('data', chunk);
            stream.read(0);
          } else {
            // update the buffer info.
            state.length += state.objectMode ? 1 : chunk.length;
            if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);

            if (state.needReadable) emitReadable(stream);
          }
        }

        maybeReadMore(stream, state);
      }
    } else if (!addToFront) {
      state.reading = false;
    }

    return needMoreData(state);
  }

  // if it's past the high water mark, we can push in some more.
  // Also, if we have no data yet, we can stand some
  // more bytes.  This is to work around cases where hwm=0,
  // such as the repl.  Also, if the push() triggered a
  // readable event, and the user called read(largeNumber) such that
  // needReadable was set, then we ought to push more, so that another
  // 'readable' event will be triggered.
  function needMoreData(state) {
    return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  }

  // backwards compatibility.
  Readable.prototype.setEncoding = function (enc) {
    this._readableState.decoder = new StringDecoder(enc);
    this._readableState.encoding = enc;
    return this;
  };

  // Don't raise the hwm > 8MB
  var MAX_HWM = 0x800000;
  function computeNewHighWaterMark(n) {
    if (n >= MAX_HWM) {
      n = MAX_HWM;
    } else {
      // Get the next highest power of 2 to prevent increasing hwm excessively in
      // tiny amounts
      n--;
      n |= n >>> 1;
      n |= n >>> 2;
      n |= n >>> 4;
      n |= n >>> 8;
      n |= n >>> 16;
      n++;
    }
    return n;
  }

  // This function is designed to be inlinable, so please take care when making
  // changes to the function body.
  function howMuchToRead(n, state) {
    if (n <= 0 || state.length === 0 && state.ended) return 0;
    if (state.objectMode) return 1;
    if (n !== n) {
      // Only flow one buffer at a time
      if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
    }
    // If we're asking for more than the current hwm, then raise the hwm.
    if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
    if (n <= state.length) return n;
    // Don't have enough
    if (!state.ended) {
      state.needReadable = true;
      return 0;
    }
    return state.length;
  }

  // you can override either this method, or the async _read(n) below.
  Readable.prototype.read = function (n) {
    debug('read', n);
    n = parseInt(n, 10);
    var state = this._readableState;
    var nOrig = n;

    if (n !== 0) state.emittedReadable = false;

    // if we're doing read(0) to trigger a readable event, but we
    // already have a bunch of data in the buffer, then just trigger
    // the 'readable' event and move on.
    if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
      debug('read: emitReadable', state.length, state.ended);
      if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
      return null;
    }

    n = howMuchToRead(n, state);

    // if we've ended, and we're now clear, then finish it up.
    if (n === 0 && state.ended) {
      if (state.length === 0) endReadable(this);
      return null;
    }

    // All the actual chunk generation logic needs to be
    // *below* the call to _read.  The reason is that in certain
    // synthetic stream cases, such as passthrough streams, _read
    // may be a completely synchronous operation which may change
    // the state of the read buffer, providing enough data when
    // before there was *not* enough.
    //
    // So, the steps are:
    // 1. Figure out what the state of things will be after we do
    // a read from the buffer.
    //
    // 2. If that resulting state will trigger a _read, then call _read.
    // Note that this may be asynchronous, or synchronous.  Yes, it is
    // deeply ugly to write APIs this way, but that still doesn't mean
    // that the Readable class should behave improperly, as streams are
    // designed to be sync/async agnostic.
    // Take note if the _read call is sync or async (ie, if the read call
    // has returned yet), so that we know whether or not it's safe to emit
    // 'readable' etc.
    //
    // 3. Actually pull the requested chunks out of the buffer and return.

    // if we need a readable event, then we need to do some reading.
    var doRead = state.needReadable;
    debug('need readable', doRead);

    // if we currently have less than the highWaterMark, then also read some
    if (state.length === 0 || state.length - n < state.highWaterMark) {
      doRead = true;
      debug('length less than watermark', doRead);
    }

    // however, if we've ended, then there's no point, and if we're already
    // reading, then it's unnecessary.
    if (state.ended || state.reading) {
      doRead = false;
      debug('reading or ended', doRead);
    } else if (doRead) {
      debug('do read');
      state.reading = true;
      state.sync = true;
      // if the length is currently zero, then we *need* a readable event.
      if (state.length === 0) state.needReadable = true;
      // call internal read method
      this._read(state.highWaterMark);
      state.sync = false;
      // If _read pushed data synchronously, then `reading` will be false,
      // and we need to re-evaluate how much data we can return to the user.
      if (!state.reading) n = howMuchToRead(nOrig, state);
    }

    var ret;
    if (n > 0) ret = fromList(n, state);else ret = null;

    if (ret === null) {
      state.needReadable = true;
      n = 0;
    } else {
      state.length -= n;
    }

    if (state.length === 0) {
      // If we have nothing in the buffer, then we want to know
      // as soon as we *do* get something into the buffer.
      if (!state.ended) state.needReadable = true;

      // If we tried to read() past the EOF, then emit end on the next tick.
      if (nOrig !== n && state.ended) endReadable(this);
    }

    if (ret !== null) this.emit('data', ret);

    return ret;
  };

  function chunkInvalid(state, chunk) {
    var er = null;
    if (!isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
      er = new TypeError('Invalid non-string/buffer chunk');
    }
    return er;
  }

  function onEofChunk(stream, state) {
    if (state.ended) return;
    if (state.decoder) {
      var chunk = state.decoder.end();
      if (chunk && chunk.length) {
        state.buffer.push(chunk);
        state.length += state.objectMode ? 1 : chunk.length;
      }
    }
    state.ended = true;

    // emit 'readable' now to make sure it gets picked up.
    emitReadable(stream);
  }

  // Don't emit readable right away in sync mode, because this can trigger
  // another read() call => stack overflow.  This way, it might trigger
  // a nextTick recursion warning, but that's not so bad.
  function emitReadable(stream) {
    var state = stream._readableState;
    state.needReadable = false;
    if (!state.emittedReadable) {
      debug('emitReadable', state.flowing);
      state.emittedReadable = true;
      if (state.sync) nextTick(emitReadable_, stream);else emitReadable_(stream);
    }
  }

  function emitReadable_(stream) {
    debug('emit readable');
    stream.emit('readable');
    flow(stream);
  }

  // at this point, the user has presumably seen the 'readable' event,
  // and called read() to consume some data.  that may have triggered
  // in turn another _read(n) call, in which case reading = true if
  // it's in progress.
  // However, if we're not ended, or reading, and the length < hwm,
  // then go ahead and try to read some more preemptively.
  function maybeReadMore(stream, state) {
    if (!state.readingMore) {
      state.readingMore = true;
      nextTick(maybeReadMore_, stream, state);
    }
  }

  function maybeReadMore_(stream, state) {
    var len = state.length;
    while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
      debug('maybeReadMore read 0');
      stream.read(0);
      if (len === state.length)
        // didn't get any data, stop spinning.
        break;else len = state.length;
    }
    state.readingMore = false;
  }

  // abstract method.  to be overridden in specific implementation classes.
  // call cb(er, data) where data is <= n in length.
  // for virtual (non-string, non-buffer) streams, "length" is somewhat
  // arbitrary, and perhaps not very meaningful.
  Readable.prototype._read = function (n) {
    this.emit('error', new Error('not implemented'));
  };

  Readable.prototype.pipe = function (dest, pipeOpts) {
    var src = this;
    var state = this._readableState;

    switch (state.pipesCount) {
      case 0:
        state.pipes = dest;
        break;
      case 1:
        state.pipes = [state.pipes, dest];
        break;
      default:
        state.pipes.push(dest);
        break;
    }
    state.pipesCount += 1;
    debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);

    var doEnd = (!pipeOpts || pipeOpts.end !== false);

    var endFn = doEnd ? onend : cleanup;
    if (state.endEmitted) nextTick(endFn);else src.once('end', endFn);

    dest.on('unpipe', onunpipe);
    function onunpipe(readable) {
      debug('onunpipe');
      if (readable === src) {
        cleanup();
      }
    }

    function onend() {
      debug('onend');
      dest.end();
    }

    // when the dest drains, it reduces the awaitDrain counter
    // on the source.  This would be more elegant with a .once()
    // handler in flow(), but adding and removing repeatedly is
    // too slow.
    var ondrain = pipeOnDrain(src);
    dest.on('drain', ondrain);

    var cleanedUp = false;
    function cleanup() {
      debug('cleanup');
      // cleanup event handlers once the pipe is broken
      dest.removeListener('close', onclose);
      dest.removeListener('finish', onfinish);
      dest.removeListener('drain', ondrain);
      dest.removeListener('error', onerror);
      dest.removeListener('unpipe', onunpipe);
      src.removeListener('end', onend);
      src.removeListener('end', cleanup);
      src.removeListener('data', ondata);

      cleanedUp = true;

      // if the reader is waiting for a drain event from this
      // specific writer, then it would cause it to never start
      // flowing again.
      // So, if this is awaiting a drain, then we just call it now.
      // If we don't know, then assume that we are waiting for one.
      if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
    }

    // If the user pushes more data while we're writing to dest then we'll end up
    // in ondata again. However, we only want to increase awaitDrain once because
    // dest will only emit one 'drain' event for the multiple writes.
    // => Introduce a guard on increasing awaitDrain.
    var increasedAwaitDrain = false;
    src.on('data', ondata);
    function ondata(chunk) {
      debug('ondata');
      increasedAwaitDrain = false;
      var ret = dest.write(chunk);
      if (false === ret && !increasedAwaitDrain) {
        // If the user unpiped during `dest.write()`, it is possible
        // to get stuck in a permanently paused state if that write
        // also returned false.
        // => Check whether `dest` is still a piping destination.
        if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
          debug('false write response, pause', src._readableState.awaitDrain);
          src._readableState.awaitDrain++;
          increasedAwaitDrain = true;
        }
        src.pause();
      }
    }

    // if the dest has an error, then stop piping into it.
    // however, don't suppress the throwing behavior for this.
    function onerror(er) {
      debug('onerror', er);
      unpipe();
      dest.removeListener('error', onerror);
      if (listenerCount$1(dest, 'error') === 0) dest.emit('error', er);
    }

    // Make sure our error handler is attached before userland ones.
    prependListener(dest, 'error', onerror);

    // Both close and finish should trigger unpipe, but only once.
    function onclose() {
      dest.removeListener('finish', onfinish);
      unpipe();
    }
    dest.once('close', onclose);
    function onfinish() {
      debug('onfinish');
      dest.removeListener('close', onclose);
      unpipe();
    }
    dest.once('finish', onfinish);

    function unpipe() {
      debug('unpipe');
      src.unpipe(dest);
    }

    // tell the dest that it's being piped to
    dest.emit('pipe', src);

    // start the flow if it hasn't been started already.
    if (!state.flowing) {
      debug('pipe resume');
      src.resume();
    }

    return dest;
  };

  function pipeOnDrain(src) {
    return function () {
      var state = src._readableState;
      debug('pipeOnDrain', state.awaitDrain);
      if (state.awaitDrain) state.awaitDrain--;
      if (state.awaitDrain === 0 && src.listeners('data').length) {
        state.flowing = true;
        flow(src);
      }
    };
  }

  Readable.prototype.unpipe = function (dest) {
    var state = this._readableState;

    // if we're not piping anywhere, then do nothing.
    if (state.pipesCount === 0) return this;

    // just one destination.  most common case.
    if (state.pipesCount === 1) {
      // passed in one, but it's not the right one.
      if (dest && dest !== state.pipes) return this;

      if (!dest) dest = state.pipes;

      // got a match.
      state.pipes = null;
      state.pipesCount = 0;
      state.flowing = false;
      if (dest) dest.emit('unpipe', this);
      return this;
    }

    // slow case. multiple pipe destinations.

    if (!dest) {
      // remove all.
      var dests = state.pipes;
      var len = state.pipesCount;
      state.pipes = null;
      state.pipesCount = 0;
      state.flowing = false;

      for (var _i = 0; _i < len; _i++) {
        dests[_i].emit('unpipe', this);
      }return this;
    }

    // try to find the right one.
    var i = indexOf(state.pipes, dest);
    if (i === -1) return this;

    state.pipes.splice(i, 1);
    state.pipesCount -= 1;
    if (state.pipesCount === 1) state.pipes = state.pipes[0];

    dest.emit('unpipe', this);

    return this;
  };

  // set up data events if they are asked for
  // Ensure readable listeners eventually get something
  Readable.prototype.on = function (ev, fn) {
    var res = EventEmitter.prototype.on.call(this, ev, fn);

    if (ev === 'data') {
      // Start flowing on next tick if stream isn't explicitly paused
      if (this._readableState.flowing !== false) this.resume();
    } else if (ev === 'readable') {
      var state = this._readableState;
      if (!state.endEmitted && !state.readableListening) {
        state.readableListening = state.needReadable = true;
        state.emittedReadable = false;
        if (!state.reading) {
          nextTick(nReadingNextTick, this);
        } else if (state.length) {
          emitReadable(this);
        }
      }
    }

    return res;
  };
  Readable.prototype.addListener = Readable.prototype.on;

  function nReadingNextTick(self) {
    debug('readable nexttick read 0');
    self.read(0);
  }

  // pause() and resume() are remnants of the legacy readable stream API
  // If the user uses them, then switch into old mode.
  Readable.prototype.resume = function () {
    var state = this._readableState;
    if (!state.flowing) {
      debug('resume');
      state.flowing = true;
      resume(this, state);
    }
    return this;
  };

  function resume(stream, state) {
    if (!state.resumeScheduled) {
      state.resumeScheduled = true;
      nextTick(resume_, stream, state);
    }
  }

  function resume_(stream, state) {
    if (!state.reading) {
      debug('resume read 0');
      stream.read(0);
    }

    state.resumeScheduled = false;
    state.awaitDrain = 0;
    stream.emit('resume');
    flow(stream);
    if (state.flowing && !state.reading) stream.read(0);
  }

  Readable.prototype.pause = function () {
    debug('call pause flowing=%j', this._readableState.flowing);
    if (false !== this._readableState.flowing) {
      debug('pause');
      this._readableState.flowing = false;
      this.emit('pause');
    }
    return this;
  };

  function flow(stream) {
    var state = stream._readableState;
    debug('flow', state.flowing);
    while (state.flowing && stream.read() !== null) {}
  }

  // wrap an old-style stream as the async data source.
  // This is *not* part of the readable stream interface.
  // It is an ugly unfortunate mess of history.
  Readable.prototype.wrap = function (stream) {
    var state = this._readableState;
    var paused = false;

    var self = this;
    stream.on('end', function () {
      debug('wrapped end');
      if (state.decoder && !state.ended) {
        var chunk = state.decoder.end();
        if (chunk && chunk.length) self.push(chunk);
      }

      self.push(null);
    });

    stream.on('data', function (chunk) {
      debug('wrapped data');
      if (state.decoder) chunk = state.decoder.write(chunk);

      // don't skip over falsy values in objectMode
      if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;

      var ret = self.push(chunk);
      if (!ret) {
        paused = true;
        stream.pause();
      }
    });

    // proxy all the other methods.
    // important when wrapping filters and duplexes.
    for (var i in stream) {
      if (this[i] === undefined && typeof stream[i] === 'function') {
        this[i] = function (method) {
          return function () {
            return stream[method].apply(stream, arguments);
          };
        }(i);
      }
    }

    // proxy certain important events.
    var events = ['error', 'close', 'destroy', 'pause', 'resume'];
    forEach(events, function (ev) {
      stream.on(ev, self.emit.bind(self, ev));
    });

    // when we try to consume some more bytes, simply unpause the
    // underlying stream.
    self._read = function (n) {
      debug('wrapped _read', n);
      if (paused) {
        paused = false;
        stream.resume();
      }
    };

    return self;
  };

  // exposed for testing purposes only.
  Readable._fromList = fromList;

  // Pluck off n bytes from an array of buffers.
  // Length is the combined lengths of all the buffers in the list.
  // This function is designed to be inlinable, so please take care when making
  // changes to the function body.
  function fromList(n, state) {
    // nothing buffered
    if (state.length === 0) return null;

    var ret;
    if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
      // read it all, truncate the list
      if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
      state.buffer.clear();
    } else {
      // read part of list
      ret = fromListPartial(n, state.buffer, state.decoder);
    }

    return ret;
  }

  // Extracts only enough buffered data to satisfy the amount requested.
  // This function is designed to be inlinable, so please take care when making
  // changes to the function body.
  function fromListPartial(n, list, hasStrings) {
    var ret;
    if (n < list.head.data.length) {
      // slice is the same for buffers and strings
      ret = list.head.data.slice(0, n);
      list.head.data = list.head.data.slice(n);
    } else if (n === list.head.data.length) {
      // first chunk is a perfect match
      ret = list.shift();
    } else {
      // result spans more than one buffer
      ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
    }
    return ret;
  }

  // Copies a specified amount of characters from the list of buffered data
  // chunks.
  // This function is designed to be inlinable, so please take care when making
  // changes to the function body.
  function copyFromBufferString(n, list) {
    var p = list.head;
    var c = 1;
    var ret = p.data;
    n -= ret.length;
    while (p = p.next) {
      var str = p.data;
      var nb = n > str.length ? str.length : n;
      if (nb === str.length) ret += str;else ret += str.slice(0, n);
      n -= nb;
      if (n === 0) {
        if (nb === str.length) {
          ++c;
          if (p.next) list.head = p.next;else list.head = list.tail = null;
        } else {
          list.head = p;
          p.data = str.slice(nb);
        }
        break;
      }
      ++c;
    }
    list.length -= c;
    return ret;
  }

  // Copies a specified amount of bytes from the list of buffered data chunks.
  // This function is designed to be inlinable, so please take care when making
  // changes to the function body.
  function copyFromBuffer(n, list) {
    var ret = Buffer.allocUnsafe(n);
    var p = list.head;
    var c = 1;
    p.data.copy(ret);
    n -= p.data.length;
    while (p = p.next) {
      var buf = p.data;
      var nb = n > buf.length ? buf.length : n;
      buf.copy(ret, ret.length - n, 0, nb);
      n -= nb;
      if (n === 0) {
        if (nb === buf.length) {
          ++c;
          if (p.next) list.head = p.next;else list.head = list.tail = null;
        } else {
          list.head = p;
          p.data = buf.slice(nb);
        }
        break;
      }
      ++c;
    }
    list.length -= c;
    return ret;
  }

  function endReadable(stream) {
    var state = stream._readableState;

    // If we get here before consuming all the bytes, then that is a
    // bug in node.  Should never happen.
    if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');

    if (!state.endEmitted) {
      state.ended = true;
      nextTick(endReadableNT, state, stream);
    }
  }

  function endReadableNT(state, stream) {
    // Check that we didn't get one last unshift.
    if (!state.endEmitted && state.length === 0) {
      state.endEmitted = true;
      stream.readable = false;
      stream.emit('end');
    }
  }

  function forEach(xs, f) {
    for (var i = 0, l = xs.length; i < l; i++) {
      f(xs[i], i);
    }
  }

  function indexOf(xs, x) {
    for (var i = 0, l = xs.length; i < l; i++) {
      if (xs[i] === x) return i;
    }
    return -1;
  }

  // A bit simpler than readable streams.
  Writable.WritableState = WritableState;
  inherits$1(Writable, EventEmitter);

  function nop() {}

  function WriteReq(chunk, encoding, cb) {
    this.chunk = chunk;
    this.encoding = encoding;
    this.callback = cb;
    this.next = null;
  }

  function WritableState(options, stream) {
    Object.defineProperty(this, 'buffer', {
      get: deprecate(function () {
        return this.getBuffer();
      }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
    });
    options = options || {};

    // object stream flag to indicate whether or not this stream
    // contains buffers or objects.
    this.objectMode = !!options.objectMode;

    if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;

    // the point at which write() starts returning false
    // Note: 0 is a valid value, means that we always return false if
    // the entire buffer is not flushed immediately on write()
    var hwm = options.highWaterMark;
    var defaultHwm = this.objectMode ? 16 : 16 * 1024;
    this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;

    // cast to ints.
    this.highWaterMark = ~ ~this.highWaterMark;

    this.needDrain = false;
    // at the start of calling end()
    this.ending = false;
    // when end() has been called, and returned
    this.ended = false;
    // when 'finish' is emitted
    this.finished = false;

    // should we decode strings into buffers before passing to _write?
    // this is here so that some node-core streams can optimize string
    // handling at a lower level.
    var noDecode = options.decodeStrings === false;
    this.decodeStrings = !noDecode;

    // Crypto is kind of old and crusty.  Historically, its default string
    // encoding is 'binary' so we have to make this configurable.
    // Everything else in the universe uses 'utf8', though.
    this.defaultEncoding = options.defaultEncoding || 'utf8';

    // not an actual buffer we keep track of, but a measurement
    // of how much we're waiting to get pushed to some underlying
    // socket or file.
    this.length = 0;

    // a flag to see when we're in the middle of a write.
    this.writing = false;

    // when true all writes will be buffered until .uncork() call
    this.corked = 0;

    // a flag to be able to tell if the onwrite cb is called immediately,
    // or on a later tick.  We set this to true at first, because any
    // actions that shouldn't happen until "later" should generally also
    // not happen before the first write call.
    this.sync = true;

    // a flag to know if we're processing previously buffered items, which
    // may call the _write() callback in the same tick, so that we don't
    // end up in an overlapped onwrite situation.
    this.bufferProcessing = false;

    // the callback that's passed to _write(chunk,cb)
    this.onwrite = function (er) {
      onwrite(stream, er);
    };

    // the callback that the user supplies to write(chunk,encoding,cb)
    this.writecb = null;

    // the amount that is being written when _write is called.
    this.writelen = 0;

    this.bufferedRequest = null;
    this.lastBufferedRequest = null;

    // number of pending user-supplied write callbacks
    // this must be 0 before 'finish' can be emitted
    this.pendingcb = 0;

    // emit prefinish if the only thing we're waiting for is _write cbs
    // This is relevant for synchronous Transform streams
    this.prefinished = false;

    // True if the error was already emitted and should not be thrown again
    this.errorEmitted = false;

    // count buffered requests
    this.bufferedRequestCount = 0;

    // allocate the first CorkedRequest, there is always
    // one allocated and free to use, and we maintain at most two
    this.corkedRequestsFree = new CorkedRequest(this);
  }

  WritableState.prototype.getBuffer = function writableStateGetBuffer() {
    var current = this.bufferedRequest;
    var out = [];
    while (current) {
      out.push(current);
      current = current.next;
    }
    return out;
  };
  function Writable(options) {

    // Writable ctor is applied to Duplexes, though they're not
    // instanceof Writable, they're instanceof Readable.
    if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options);

    this._writableState = new WritableState(options, this);

    // legacy.
    this.writable = true;

    if (options) {
      if (typeof options.write === 'function') this._write = options.write;

      if (typeof options.writev === 'function') this._writev = options.writev;
    }

    EventEmitter.call(this);
  }

  // Otherwise people can pipe Writable streams, which is just wrong.
  Writable.prototype.pipe = function () {
    this.emit('error', new Error('Cannot pipe, not readable'));
  };

  function writeAfterEnd(stream, cb) {
    var er = new Error('write after end');
    // TODO: defer error events consistently everywhere, not just the cb
    stream.emit('error', er);
    nextTick(cb, er);
  }

  // If we get something that is not a buffer, string, null, or undefined,
  // and we're not in objectMode, then that's an error.
  // Otherwise stream chunks are all considered to be of length=1, and the
  // watermarks determine how many objects to keep in the buffer, rather than
  // how many bytes or characters.
  function validChunk(stream, state, chunk, cb) {
    var valid = true;
    var er = false;
    // Always throw error if a null is written
    // if we are not in object mode then throw
    // if it is not a buffer, string, or undefined.
    if (chunk === null) {
      er = new TypeError('May not write null values to stream');
    } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
      er = new TypeError('Invalid non-string/buffer chunk');
    }
    if (er) {
      stream.emit('error', er);
      nextTick(cb, er);
      valid = false;
    }
    return valid;
  }

  Writable.prototype.write = function (chunk, encoding, cb) {
    var state = this._writableState;
    var ret = false;

    if (typeof encoding === 'function') {
      cb = encoding;
      encoding = null;
    }

    if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;

    if (typeof cb !== 'function') cb = nop;

    if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) {
      state.pendingcb++;
      ret = writeOrBuffer(this, state, chunk, encoding, cb);
    }

    return ret;
  };

  Writable.prototype.cork = function () {
    var state = this._writableState;

    state.corked++;
  };

  Writable.prototype.uncork = function () {
    var state = this._writableState;

    if (state.corked) {
      state.corked--;

      if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
    }
  };

  Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
    // node::ParseEncoding() requires lower case.
    if (typeof encoding === 'string') encoding = encoding.toLowerCase();
    if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
    this._writableState.defaultEncoding = encoding;
    return this;
  };

  function decodeChunk(state, chunk, encoding) {
    if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
      chunk = Buffer.from(chunk, encoding);
    }
    return chunk;
  }

  // if we're already writing something, then just put this
  // in the queue, and wait our turn.  Otherwise, call _write
  // If we return false, then we need a drain event, so set that flag.
  function writeOrBuffer(stream, state, chunk, encoding, cb) {
    chunk = decodeChunk(state, chunk, encoding);

    if (Buffer.isBuffer(chunk)) encoding = 'buffer';
    var len = state.objectMode ? 1 : chunk.length;

    state.length += len;

    var ret = state.length < state.highWaterMark;
    // we must ensure that previous needDrain will not be reset to false.
    if (!ret) state.needDrain = true;

    if (state.writing || state.corked) {
      var last = state.lastBufferedRequest;
      state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
      if (last) {
        last.next = state.lastBufferedRequest;
      } else {
        state.bufferedRequest = state.lastBufferedRequest;
      }
      state.bufferedRequestCount += 1;
    } else {
      doWrite(stream, state, false, len, chunk, encoding, cb);
    }

    return ret;
  }

  function doWrite(stream, state, writev, len, chunk, encoding, cb) {
    state.writelen = len;
    state.writecb = cb;
    state.writing = true;
    state.sync = true;
    if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
    state.sync = false;
  }

  function onwriteError(stream, state, sync, er, cb) {
    --state.pendingcb;
    if (sync) nextTick(cb, er);else cb(er);

    stream._writableState.errorEmitted = true;
    stream.emit('error', er);
  }

  function onwriteStateUpdate(state) {
    state.writing = false;
    state.writecb = null;
    state.length -= state.writelen;
    state.writelen = 0;
  }

  function onwrite(stream, er) {
    var state = stream._writableState;
    var sync = state.sync;
    var cb = state.writecb;

    onwriteStateUpdate(state);

    if (er) onwriteError(stream, state, sync, er, cb);else {
      // Check if we're actually ready to finish, but don't emit yet
      var finished = needFinish(state);

      if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
        clearBuffer(stream, state);
      }

      if (sync) {
        /*<replacement>*/
          nextTick(afterWrite, stream, state, finished, cb);
        /*</replacement>*/
      } else {
          afterWrite(stream, state, finished, cb);
        }
    }
  }

  function afterWrite(stream, state, finished, cb) {
    if (!finished) onwriteDrain(stream, state);
    state.pendingcb--;
    cb();
    finishMaybe(stream, state);
  }

  // Must force callback to be called on nextTick, so that we don't
  // emit 'drain' before the write() consumer gets the 'false' return
  // value, and has a chance to attach a 'drain' listener.
  function onwriteDrain(stream, state) {
    if (state.length === 0 && state.needDrain) {
      state.needDrain = false;
      stream.emit('drain');
    }
  }

  // if there's something in the buffer waiting, then process it
  function clearBuffer(stream, state) {
    state.bufferProcessing = true;
    var entry = state.bufferedRequest;

    if (stream._writev && entry && entry.next) {
      // Fast case, write everything using _writev()
      var l = state.bufferedRequestCount;
      var buffer = new Array(l);
      var holder = state.corkedRequestsFree;
      holder.entry = entry;

      var count = 0;
      while (entry) {
        buffer[count] = entry;
        entry = entry.next;
        count += 1;
      }

      doWrite(stream, state, true, state.length, buffer, '', holder.finish);

      // doWrite is almost always async, defer these to save a bit of time
      // as the hot path ends with doWrite
      state.pendingcb++;
      state.lastBufferedRequest = null;
      if (holder.next) {
        state.corkedRequestsFree = holder.next;
        holder.next = null;
      } else {
        state.corkedRequestsFree = new CorkedRequest(state);
      }
    } else {
      // Slow case, write chunks one-by-one
      while (entry) {
        var chunk = entry.chunk;
        var encoding = entry.encoding;
        var cb = entry.callback;
        var len = state.objectMode ? 1 : chunk.length;

        doWrite(stream, state, false, len, chunk, encoding, cb);
        entry = entry.next;
        // if we didn't call the onwrite immediately, then
        // it means that we need to wait until it does.
        // also, that means that the chunk and cb are currently
        // being processed, so move the buffer counter past them.
        if (state.writing) {
          break;
        }
      }

      if (entry === null) state.lastBufferedRequest = null;
    }

    state.bufferedRequestCount = 0;
    state.bufferedRequest = entry;
    state.bufferProcessing = false;
  }

  Writable.prototype._write = function (chunk, encoding, cb) {
    cb(new Error('not implemented'));
  };

  Writable.prototype._writev = null;

  Writable.prototype.end = function (chunk, encoding, cb) {
    var state = this._writableState;

    if (typeof chunk === 'function') {
      cb = chunk;
      chunk = null;
      encoding = null;
    } else if (typeof encoding === 'function') {
      cb = encoding;
      encoding = null;
    }

    if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);

    // .end() fully uncorks
    if (state.corked) {
      state.corked = 1;
      this.uncork();
    }

    // ignore unnecessary end() calls.
    if (!state.ending && !state.finished) endWritable(this, state, cb);
  };

  function needFinish(state) {
    return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  }

  function prefinish(stream, state) {
    if (!state.prefinished) {
      state.prefinished = true;
      stream.emit('prefinish');
    }
  }

  function finishMaybe(stream, state) {
    var need = needFinish(state);
    if (need) {
      if (state.pendingcb === 0) {
        prefinish(stream, state);
        state.finished = true;
        stream.emit('finish');
      } else {
        prefinish(stream, state);
      }
    }
    return need;
  }

  function endWritable(stream, state, cb) {
    state.ending = true;
    finishMaybe(stream, state);
    if (cb) {
      if (state.finished) nextTick(cb);else stream.once('finish', cb);
    }
    state.ended = true;
    stream.writable = false;
  }

  // It seems a linked list but it is not
  // there will be only 2 of these for each stream
  function CorkedRequest(state) {
    var _this = this;

    this.next = null;
    this.entry = null;

    this.finish = function (err) {
      var entry = _this.entry;
      _this.entry = null;
      while (entry) {
        var cb = entry.callback;
        state.pendingcb--;
        cb(err);
        entry = entry.next;
      }
      if (state.corkedRequestsFree) {
        state.corkedRequestsFree.next = _this;
      } else {
        state.corkedRequestsFree = _this;
      }
    };
  }

  inherits$1(Duplex, Readable);

  var keys = Object.keys(Writable.prototype);
  for (var v = 0; v < keys.length; v++) {
    var method = keys[v];
    if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  }
  function Duplex(options) {
    if (!(this instanceof Duplex)) return new Duplex(options);

    Readable.call(this, options);
    Writable.call(this, options);

    if (options && options.readable === false) this.readable = false;

    if (options && options.writable === false) this.writable = false;

    this.allowHalfOpen = true;
    if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;

    this.once('end', onend);
  }

  // the no-half-open enforcer
  function onend() {
    // if we allow half-open state, or if the writable side ended,
    // then we're ok.
    if (this.allowHalfOpen || this._writableState.ended) return;

    // no more data can be written.
    // But allow more writes to happen in this tick.
    nextTick(onEndNT, this);
  }

  function onEndNT(self) {
    self.end();
  }

  // a transform stream is a readable/writable stream where you do
  inherits$1(Transform, Duplex);

  function TransformState(stream) {
    this.afterTransform = function (er, data) {
      return afterTransform(stream, er, data);
    };

    this.needTransform = false;
    this.transforming = false;
    this.writecb = null;
    this.writechunk = null;
    this.writeencoding = null;
  }

  function afterTransform(stream, er, data) {
    var ts = stream._transformState;
    ts.transforming = false;

    var cb = ts.writecb;

    if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));

    ts.writechunk = null;
    ts.writecb = null;

    if (data !== null && data !== undefined) stream.push(data);

    cb(er);

    var rs = stream._readableState;
    rs.reading = false;
    if (rs.needReadable || rs.length < rs.highWaterMark) {
      stream._read(rs.highWaterMark);
    }
  }
  function Transform(options) {
    if (!(this instanceof Transform)) return new Transform(options);

    Duplex.call(this, options);

    this._transformState = new TransformState(this);

    // when the writable side finishes, then flush out anything remaining.
    var stream = this;

    // start out asking for a readable event once data is transformed.
    this._readableState.needReadable = true;

    // we have implemented the _read method, and done the other things
    // that Readable wants before the first _read call, so unset the
    // sync guard flag.
    this._readableState.sync = false;

    if (options) {
      if (typeof options.transform === 'function') this._transform = options.transform;

      if (typeof options.flush === 'function') this._flush = options.flush;
    }

    this.once('prefinish', function () {
      if (typeof this._flush === 'function') this._flush(function (er) {
        done(stream, er);
      });else done(stream);
    });
  }

  Transform.prototype.push = function (chunk, encoding) {
    this._transformState.needTransform = false;
    return Duplex.prototype.push.call(this, chunk, encoding);
  };

  // This is the part where you do stuff!
  // override this function in implementation classes.
  // 'chunk' is an input chunk.
  //
  // Call `push(newChunk)` to pass along transformed output
  // to the readable side.  You may call 'push' zero or more times.
  //
  // Call `cb(err)` when you are done with this chunk.  If you pass
  // an error, then that'll put the hurt on the whole operation.  If you
  // never call cb(), then you'll never get another chunk.
  Transform.prototype._transform = function (chunk, encoding, cb) {
    throw new Error('Not implemented');
  };

  Transform.prototype._write = function (chunk, encoding, cb) {
    var ts = this._transformState;
    ts.writecb = cb;
    ts.writechunk = chunk;
    ts.writeencoding = encoding;
    if (!ts.transforming) {
      var rs = this._readableState;
      if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
    }
  };

  // Doesn't matter what the args are here.
  // _transform does all the work.
  // That we got here means that the readable side wants more data.
  Transform.prototype._read = function (n) {
    var ts = this._transformState;

    if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
      ts.transforming = true;
      this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
    } else {
      // mark that we need a transform, so that any data that comes in
      // will get processed, now that we've asked for it.
      ts.needTransform = true;
    }
  };

  function done(stream, er) {
    if (er) return stream.emit('error', er);

    // if there's nothing in the write buffer, then that means
    // that nothing more will ever be provided
    var ws = stream._writableState;
    var ts = stream._transformState;

    if (ws.length) throw new Error('Calling transform done when ws.length != 0');

    if (ts.transforming) throw new Error('Calling transform done when still transforming');

    return stream.push(null);
  }

  inherits$1(PassThrough, Transform);
  function PassThrough(options) {
    if (!(this instanceof PassThrough)) return new PassThrough(options);

    Transform.call(this, options);
  }

  PassThrough.prototype._transform = function (chunk, encoding, cb) {
    cb(null, chunk);
  };

  inherits$1(Stream, EventEmitter);
  Stream.Readable = Readable;
  Stream.Writable = Writable;
  Stream.Duplex = Duplex;
  Stream.Transform = Transform;
  Stream.PassThrough = PassThrough;

  // Backwards-compat with node 0.4.x
  Stream.Stream = Stream;

  // old-style streams.  Note that the pipe method (the only relevant
  // part of this class) is overridden in the Readable class.

  function Stream() {
    EventEmitter.call(this);
  }

  Stream.prototype.pipe = function(dest, options) {
    var source = this;

    function ondata(chunk) {
      if (dest.writable) {
        if (false === dest.write(chunk) && source.pause) {
          source.pause();
        }
      }
    }

    source.on('data', ondata);

    function ondrain() {
      if (source.readable && source.resume) {
        source.resume();
      }
    }

    dest.on('drain', ondrain);

    // If the 'end' option is not supplied, dest.end() will be called when
    // source gets the 'end' or 'close' events.  Only dest.end() once.
    if (!dest._isStdio && (!options || options.end !== false)) {
      source.on('end', onend);
      source.on('close', onclose);
    }

    var didOnEnd = false;
    function onend() {
      if (didOnEnd) return;
      didOnEnd = true;

      dest.end();
    }


    function onclose() {
      if (didOnEnd) return;
      didOnEnd = true;

      if (typeof dest.destroy === 'function') dest.destroy();
    }

    // don't leave dangling pipes when there are errors.
    function onerror(er) {
      cleanup();
      if (EventEmitter.listenerCount(this, 'error') === 0) {
        throw er; // Unhandled stream error in pipe.
      }
    }

    source.on('error', onerror);
    dest.on('error', onerror);

    // remove all the event listeners that were added.
    function cleanup() {
      source.removeListener('data', ondata);
      dest.removeListener('drain', ondrain);

      source.removeListener('end', onend);
      source.removeListener('close', onclose);

      source.removeListener('error', onerror);
      dest.removeListener('error', onerror);

      source.removeListener('end', cleanup);
      source.removeListener('close', cleanup);

      dest.removeListener('close', cleanup);
    }

    source.on('end', cleanup);
    source.on('close', cleanup);

    dest.on('close', cleanup);

    dest.emit('pipe', source);

    // Allow for unix-like usage: A.pipe(B).pipe(C)
    return dest;
  };

  function _typeof(obj) {
    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
      _typeof = function (obj) {
        return typeof obj;
      };
    } else {
      _typeof = function (obj) {
        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
      };
    }

    return _typeof(obj);
  }

  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(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(target, key, source[key]);
      });
    }

    return target;
  }

  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }

    subClass.prototype = Object.create(superClass && superClass.prototype, {
      constructor: {
        value: subClass,
        writable: true,
        configurable: true
      }
    });
    if (superClass) _setPrototypeOf(subClass, superClass);
  }

  function _getPrototypeOf(o) {
    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
      return o.__proto__ || Object.getPrototypeOf(o);
    };
    return _getPrototypeOf(o);
  }

  function _setPrototypeOf(o, p) {
    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
      o.__proto__ = p;
      return o;
    };

    return _setPrototypeOf(o, p);
  }

  function _assertThisInitialized(self) {
    if (self === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }

    return self;
  }

  function _possibleConstructorReturn(self, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    }

    return _assertThisInitialized(self);
  }

  function _toArray(arr) {
    return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest();
  }

  function _toConsumableArray(arr) {
    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
  }

  function _arrayWithoutHoles(arr) {
    if (Array.isArray(arr)) {
      for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];

      return arr2;
    }
  }

  function _arrayWithHoles(arr) {
    if (Array.isArray(arr)) return arr;
  }

  function _iterableToArray(iter) {
    if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
  }

  function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance");
  }

  function _nonIterableRest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance");
  }

  /*
  The MIT License (MIT)

  Copyright (c) 2016 CoderPuppy

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.

  */
  var _endianness;
  function endianness() {
    if (typeof _endianness === 'undefined') {
      var a = new ArrayBuffer(2);
      var b = new Uint8Array(a);
      var c = new Uint16Array(a);
      b[0] = 1;
      b[1] = 2;
      if (c[0] === 258) {
        _endianness = 'BE';
      } else if (c[0] === 513){
        _endianness = 'LE';
      } else {
        throw new Error('unable to figure out endianess');
      }
    }
    return _endianness;
  }

  function hostname() {
    if (typeof global$1.location !== 'undefined') {
      return global$1.location.hostname
    } else return '';
  }

  function loadavg() {
    return [];
  }

  function uptime() {
    return 0;
  }

  function freemem() {
    return Number.MAX_VALUE;
  }

  function totalmem() {
    return Number.MAX_VALUE;
  }

  function cpus() {
    return [];
  }

  function type() {
    return 'Browser';
  }

  function release () {
    if (typeof global$1.navigator !== 'undefined') {
      return global$1.navigator.appVersion;
    }
    return '';
  }

  function networkInterfaces(){}
  function getNetworkInterfaces(){}

  function tmpDir() {
    return '/tmp';
  }
  var tmpdir = tmpDir;

  var EOL = '\n';
  var os = {
    EOL: EOL,
    tmpdir: tmpdir,
    tmpDir: tmpDir,
    networkInterfaces:networkInterfaces,
    getNetworkInterfaces: getNetworkInterfaces,
    release: release,
    type: type,
    cpus: cpus,
    totalmem: totalmem,
    freemem: freemem,
    uptime: uptime,
    loadavg: loadavg,
    hostname: hostname,
    endianness: endianness,
  };

  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof self !== 'undefined' ? self : {};

  /**
   * lodash (Custom Build) <https://lodash.com/>
   * Build: `lodash modularize exports="npm" -o ./`
   * Copyright jQuery Foundation and other contributors <https://jquery.org/>
   * Released under MIT license <https://lodash.com/license>
   * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
   * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
   */

  /** Used as the `TypeError` message for "Functions" methods. */
  var FUNC_ERROR_TEXT = 'Expected a function';

  /** Used to stand-in for `undefined` hash values. */
  var HASH_UNDEFINED = '__lodash_hash_undefined__';

  /** Used as references for various `Number` constants. */
  var INFINITY = 1 / 0;

  /** `Object#toString` result references. */
  var funcTag = '[object Function]',
      genTag = '[object GeneratorFunction]',
      symbolTag = '[object Symbol]';

  /** Used to match property names within property paths. */
  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
      reIsPlainProp = /^\w*$/,
      reLeadingDot = /^\./,
      rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;

  /**
   * Used to match `RegExp`
   * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
   */
  var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;

  /** Used to match backslashes in property paths. */
  var reEscapeChar = /\\(\\)?/g;

  /** Used to detect host constructors (Safari). */
  var reIsHostCtor = /^\[object .+?Constructor\]$/;

  /** Detect free variable `global` from Node.js. */
  var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;

  /** Detect free variable `self`. */
  var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

  /** Used as a reference to the global object. */
  var root = freeGlobal || freeSelf || Function('return this')();

  /**
   * Gets the value at `key` of `object`.
   *
   * @private
   * @param {Object} [object] The object to query.
   * @param {string} key The key of the property to get.
   * @returns {*} Returns the property value.
   */
  function getValue(object, key) {
    return object == null ? undefined : object[key];
  }

  /**
   * Checks if `value` is a host object in IE < 9.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
   */
  function isHostObject(value) {
    // Many host objects are `Object` objects that can coerce to strings
    // despite having improperly defined `toString` methods.
    var result = false;
    if (value != null && typeof value.toString != 'function') {
      try {
        result = !!(value + '');
      } catch (e) {}
    }
    return result;
  }

  /** Used for built-in method references. */
  var arrayProto = Array.prototype,
      funcProto = Function.prototype,
      objectProto = Object.prototype;

  /** Used to detect overreaching core-js shims. */
  var coreJsData = root['__core-js_shared__'];

  /** Used to detect methods masquerading as native. */
  var maskSrcKey = (function() {
    var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
    return uid ? ('Symbol(src)_1.' + uid) : '';
  }());

  /** Used to resolve the decompiled source of functions. */
  var funcToString = funcProto.toString;

  /** Used to check objects for own properties. */
  var hasOwnProperty$1 = objectProto.hasOwnProperty;

  /**
   * Used to resolve the
   * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
   * of values.
   */
  var objectToString$1 = objectProto.toString;

  /** Used to detect if a method is native. */
  var reIsNative = RegExp('^' +
    funcToString.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&')
    .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  );

  /** Built-in value references. */
  var Symbol$1 = root.Symbol,
      splice = arrayProto.splice;

  /* Built-in method references that are verified to be native. */
  var Map = getNative(root, 'Map'),
      nativeCreate = getNative(Object, 'create');

  /** Used to convert symbols to primitives and strings. */
  var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined,
      symbolToString = symbolProto ? symbolProto.toString : undefined;

  /**
   * Creates a hash object.
   *
   * @private
   * @constructor
   * @param {Array} [entries] The key-value pairs to cache.
   */
  function Hash(entries) {
    var index = -1,
        length = entries ? entries.length : 0;

    this.clear();
    while (++index < length) {
      var entry = entries[index];
      this.set(entry[0], entry[1]);
    }
  }

  /**
   * Removes all key-value entries from the hash.
   *
   * @private
   * @name clear
   * @memberOf Hash
   */
  function hashClear() {
    this.__data__ = nativeCreate ? nativeCreate(null) : {};
  }

  /**
   * Removes `key` and its value from the hash.
   *
   * @private
   * @name delete
   * @memberOf Hash
   * @param {Object} hash The hash to modify.
   * @param {string} key The key of the value to remove.
   * @returns {boolean} Returns `true` if the entry was removed, else `false`.
   */
  function hashDelete(key) {
    return this.has(key) && delete this.__data__[key];
  }

  /**
   * Gets the hash value for `key`.
   *
   * @private
   * @name get
   * @memberOf Hash
   * @param {string} key The key of the value to get.
   * @returns {*} Returns the entry value.
   */
  function hashGet(key) {
    var data = this.__data__;
    if (nativeCreate) {
      var result = data[key];
      return result === HASH_UNDEFINED ? undefined : result;
    }
    return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
  }

  /**
   * Checks if a hash value for `key` exists.
   *
   * @private
   * @name has
   * @memberOf Hash
   * @param {string} key The key of the entry to check.
   * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
   */
  function hashHas(key) {
    var data = this.__data__;
    return nativeCreate ? data[key] !== undefined : hasOwnProperty$1.call(data, key);
  }

  /**
   * Sets the hash `key` to `value`.
   *
   * @private
   * @name set
   * @memberOf Hash
   * @param {string} key The key of the value to set.
   * @param {*} value The value to set.
   * @returns {Object} Returns the hash instance.
   */
  function hashSet(key, value) {
    var data = this.__data__;
    data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
    return this;
  }

  // Add methods to `Hash`.
  Hash.prototype.clear = hashClear;
  Hash.prototype['delete'] = hashDelete;
  Hash.prototype.get = hashGet;
  Hash.prototype.has = hashHas;
  Hash.prototype.set = hashSet;

  /**
   * Creates an list cache object.
   *
   * @private
   * @constructor
   * @param {Array} [entries] The key-value pairs to cache.
   */
  function ListCache(entries) {
    var index = -1,
        length = entries ? entries.length : 0;

    this.clear();
    while (++index < length) {
      var entry = entries[index];
      this.set(entry[0], entry[1]);
    }
  }

  /**
   * Removes all key-value entries from the list cache.
   *
   * @private
   * @name clear
   * @memberOf ListCache
   */
  function listCacheClear() {
    this.__data__ = [];
  }

  /**
   * Removes `key` and its value from the list cache.
   *
   * @private
   * @name delete
   * @memberOf ListCache
   * @param {string} key The key of the value to remove.
   * @returns {boolean} Returns `true` if the entry was removed, else `false`.
   */
  function listCacheDelete(key) {
    var data = this.__data__,
        index = assocIndexOf(data, key);

    if (index < 0) {
      return false;
    }
    var lastIndex = data.length - 1;
    if (index == lastIndex) {
      data.pop();
    } else {
      splice.call(data, index, 1);
    }
    return true;
  }

  /**
   * Gets the list cache value for `key`.
   *
   * @private
   * @name get
   * @memberOf ListCache
   * @param {string} key The key of the value to get.
   * @returns {*} Returns the entry value.
   */
  function listCacheGet(key) {
    var data = this.__data__,
        index = assocIndexOf(data, key);

    return index < 0 ? undefined : data[index][1];
  }

  /**
   * Checks if a list cache value for `key` exists.
   *
   * @private
   * @name has
   * @memberOf ListCache
   * @param {string} key The key of the entry to check.
   * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
   */
  function listCacheHas(key) {
    return assocIndexOf(this.__data__, key) > -1;
  }

  /**
   * Sets the list cache `key` to `value`.
   *
   * @private
   * @name set
   * @memberOf ListCache
   * @param {string} key The key of the value to set.
   * @param {*} value The value to set.
   * @returns {Object} Returns the list cache instance.
   */
  function listCacheSet(key, value) {
    var data = this.__data__,
        index = assocIndexOf(data, key);

    if (index < 0) {
      data.push([key, value]);
    } else {
      data[index][1] = value;
    }
    return this;
  }

  // Add methods to `ListCache`.
  ListCache.prototype.clear = listCacheClear;
  ListCache.prototype['delete'] = listCacheDelete;
  ListCache.prototype.get = listCacheGet;
  ListCache.prototype.has = listCacheHas;
  ListCache.prototype.set = listCacheSet;

  /**
   * Creates a map cache object to store key-value pairs.
   *
   * @private
   * @constructor
   * @param {Array} [entries] The key-value pairs to cache.
   */
  function MapCache(entries) {
    var index = -1,
        length = entries ? entries.length : 0;

    this.clear();
    while (++index < length) {
      var entry = entries[index];
      this.set(entry[0], entry[1]);
    }
  }

  /**
   * Removes all key-value entries from the map.
   *
   * @private
   * @name clear
   * @memberOf MapCache
   */
  function mapCacheClear() {
    this.__data__ = {
      'hash': new Hash,
      'map': new (Map || ListCache),
      'string': new Hash
    };
  }

  /**
   * Removes `key` and its value from the map.
   *
   * @private
   * @name delete
   * @memberOf MapCache
   * @param {string} key The key of the value to remove.
   * @returns {boolean} Returns `true` if the entry was removed, else `false`.
   */
  function mapCacheDelete(key) {
    return getMapData(this, key)['delete'](key);
  }

  /**
   * Gets the map value for `key`.
   *
   * @private
   * @name get
   * @memberOf MapCache
   * @param {string} key The key of the value to get.
   * @returns {*} Returns the entry value.
   */
  function mapCacheGet(key) {
    return getMapData(this, key).get(key);
  }

  /**
   * Checks if a map value for `key` exists.
   *
   * @private
   * @name has
   * @memberOf MapCache
   * @param {string} key The key of the entry to check.
   * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
   */
  function mapCacheHas(key) {
    return getMapData(this, key).has(key);
  }

  /**
   * Sets the map `key` to `value`.
   *
   * @private
   * @name set
   * @memberOf MapCache
   * @param {string} key The key of the value to set.
   * @param {*} value The value to set.
   * @returns {Object} Returns the map cache instance.
   */
  function mapCacheSet(key, value) {
    getMapData(this, key).set(key, value);
    return this;
  }

  // Add methods to `MapCache`.
  MapCache.prototype.clear = mapCacheClear;
  MapCache.prototype['delete'] = mapCacheDelete;
  MapCache.prototype.get = mapCacheGet;
  MapCache.prototype.has = mapCacheHas;
  MapCache.prototype.set = mapCacheSet;

  /**
   * Gets the index at which the `key` is found in `array` of key-value pairs.
   *
   * @private
   * @param {Array} array The array to inspect.
   * @param {*} key The key to search for.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function assocIndexOf(array, key) {
    var length = array.length;
    while (length--) {
      if (eq(array[length][0], key)) {
        return length;
      }
    }
    return -1;
  }

  /**
   * The base implementation of `_.get` without support for default values.
   *
   * @private
   * @param {Object} object The object to query.
   * @param {Array|string} path The path of the property to get.
   * @returns {*} Returns the resolved value.
   */
  function baseGet(object, path) {
    path = isKey(path, object) ? [path] : castPath(path);

    var index = 0,
        length = path.length;

    while (object != null && index < length) {
      object = object[toKey(path[index++])];
    }
    return (index && index == length) ? object : undefined;
  }

  /**
   * The base implementation of `_.isNative` without bad shim checks.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a native function,
   *  else `false`.
   */
  function baseIsNative(value) {
    if (!isObject$1(value) || isMasked(value)) {
      return false;
    }
    var pattern = (isFunction$1(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
    return pattern.test(toSource(value));
  }

  /**
   * The base implementation of `_.toString` which doesn't convert nullish
   * values to empty strings.
   *
   * @private
   * @param {*} value The value to process.
   * @returns {string} Returns the string.
   */
  function baseToString(value) {
    // Exit early for strings to avoid a performance hit in some environments.
    if (typeof value == 'string') {
      return value;
    }
    if (isSymbol(value)) {
      return symbolToString ? symbolToString.call(value) : '';
    }
    var result = (value + '');
    return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  }

  /**
   * Casts `value` to a path array if it's not one.
   *
   * @private
   * @param {*} value The value to inspect.
   * @returns {Array} Returns the cast property path array.
   */
  function castPath(value) {
    return isArray$2(value) ? value : stringToPath(value);
  }

  /**
   * Gets the data for `map`.
   *
   * @private
   * @param {Object} map The map to query.
   * @param {string} key The reference key.
   * @returns {*} Returns the map data.
   */
  function getMapData(map, key) {
    var data = map.__data__;
    return isKeyable(key)
      ? data[typeof key == 'string' ? 'string' : 'hash']
      : data.map;
  }

  /**
   * Gets the native function at `key` of `object`.
   *
   * @private
   * @param {Object} object The object to query.
   * @param {string} key The key of the method to get.
   * @returns {*} Returns the function if it's native, else `undefined`.
   */
  function getNative(object, key) {
    var value = getValue(object, key);
    return baseIsNative(value) ? value : undefined;
  }

  /**
   * Checks if `value` is a property name and not a property path.
   *
   * @private
   * @param {*} value The value to check.
   * @param {Object} [object] The object to query keys on.
   * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
   */
  function isKey(value, object) {
    if (isArray$2(value)) {
      return false;
    }
    var type = typeof value;
    if (type == 'number' || type == 'symbol' || type == 'boolean' ||
        value == null || isSymbol(value)) {
      return true;
    }
    return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
      (object != null && value in Object(object));
  }

  /**
   * Checks if `value` is suitable for use as unique object key.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
   */
  function isKeyable(value) {
    var type = typeof value;
    return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
      ? (value !== '__proto__')
      : (value === null);
  }

  /**
   * Checks if `func` has its source masked.
   *
   * @private
   * @param {Function} func The function to check.
   * @returns {boolean} Returns `true` if `func` is masked, else `false`.
   */
  function isMasked(func) {
    return !!maskSrcKey && (maskSrcKey in func);
  }

  /**
   * Converts `string` to a property path array.
   *
   * @private
   * @param {string} string The string to convert.
   * @returns {Array} Returns the property path array.
   */
  var stringToPath = memoize(function(string) {
    string = toString$1(string);

    var result = [];
    if (reLeadingDot.test(string)) {
      result.push('');
    }
    string.replace(rePropName, function(match, number, quote, string) {
      result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
    });
    return result;
  });

  /**
   * Converts `value` to a string key if it's not a string or symbol.
   *
   * @private
   * @param {*} value The value to inspect.
   * @returns {string|symbol} Returns the key.
   */
  function toKey(value) {
    if (typeof value == 'string' || isSymbol(value)) {
      return value;
    }
    var result = (value + '');
    return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  }

  /**
   * Converts `func` to its source code.
   *
   * @private
   * @param {Function} func The function to process.
   * @returns {string} Returns the source code.
   */
  function toSource(func) {
    if (func != null) {
      try {
        return funcToString.call(func);
      } catch (e) {}
      try {
        return (func + '');
      } catch (e) {}
    }
    return '';
  }

  /**
   * Creates a function that memoizes the result of `func`. If `resolver` is
   * provided, it determines the cache key for storing the result based on the
   * arguments provided to the memoized function. By default, the first argument
   * provided to the memoized function is used as the map cache key. The `func`
   * is invoked with the `this` binding of the memoized function.
   *
   * **Note:** The cache is exposed as the `cache` property on the memoized
   * function. Its creation may be customized by replacing the `_.memoize.Cache`
   * constructor with one whose instances implement the
   * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
   * method interface of `delete`, `get`, `has`, and `set`.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Function
   * @param {Function} func The function to have its output memoized.
   * @param {Function} [resolver] The function to resolve the cache key.
   * @returns {Function} Returns the new memoized function.
   * @example
   *
   * var object = { 'a': 1, 'b': 2 };
   * var other = { 'c': 3, 'd': 4 };
   *
   * var values = _.memoize(_.values);
   * values(object);
   * // => [1, 2]
   *
   * values(other);
   * // => [3, 4]
   *
   * object.a = 2;
   * values(object);
   * // => [1, 2]
   *
   * // Modify the result cache.
   * values.cache.set(object, ['a', 'b']);
   * values(object);
   * // => ['a', 'b']
   *
   * // Replace `_.memoize.Cache`.
   * _.memoize.Cache = WeakMap;
   */
  function memoize(func, resolver) {
    if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
      throw new TypeError(FUNC_ERROR_TEXT);
    }
    var memoized = function() {
      var args = arguments,
          key = resolver ? resolver.apply(this, args) : args[0],
          cache = memoized.cache;

      if (cache.has(key)) {
        return cache.get(key);
      }
      var result = func.apply(this, args);
      memoized.cache = cache.set(key, result);
      return result;
    };
    memoized.cache = new (memoize.Cache || MapCache);
    return memoized;
  }

  // Assign cache to `_.memoize`.
  memoize.Cache = MapCache;

  /**
   * Performs a
   * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
   * comparison between two values to determine if they are equivalent.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to compare.
   * @param {*} other The other value to compare.
   * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
   * @example
   *
   * var object = { 'a': 1 };
   * var other = { 'a': 1 };
   *
   * _.eq(object, object);
   * // => true
   *
   * _.eq(object, other);
   * // => false
   *
   * _.eq('a', 'a');
   * // => true
   *
   * _.eq('a', Object('a'));
   * // => false
   *
   * _.eq(NaN, NaN);
   * // => true
   */
  function eq(value, other) {
    return value === other || (value !== value && other !== other);
  }

  /**
   * Checks if `value` is classified as an `Array` object.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is an array, else `false`.
   * @example
   *
   * _.isArray([1, 2, 3]);
   * // => true
   *
   * _.isArray(document.body.children);
   * // => false
   *
   * _.isArray('abc');
   * // => false
   *
   * _.isArray(_.noop);
   * // => false
   */
  var isArray$2 = Array.isArray;

  /**
   * Checks if `value` is classified as a `Function` object.
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a function, else `false`.
   * @example
   *
   * _.isFunction(_);
   * // => true
   *
   * _.isFunction(/abc/);
   * // => false
   */
  function isFunction$1(value) {
    // The use of `Object#toString` avoids issues with the `typeof` operator
    // in Safari 8-9 which returns 'object' for typed array and other constructors.
    var tag = isObject$1(value) ? objectToString$1.call(value) : '';
    return tag == funcTag || tag == genTag;
  }

  /**
   * Checks if `value` is the
   * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
   * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
   *
   * @static
   * @memberOf _
   * @since 0.1.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is an object, else `false`.
   * @example
   *
   * _.isObject({});
   * // => true
   *
   * _.isObject([1, 2, 3]);
   * // => true
   *
   * _.isObject(_.noop);
   * // => true
   *
   * _.isObject(null);
   * // => false
   */
  function isObject$1(value) {
    var type = typeof value;
    return !!value && (type == 'object' || type == 'function');
  }

  /**
   * Checks if `value` is object-like. A value is object-like if it's not `null`
   * and has a `typeof` result of "object".
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
   * @example
   *
   * _.isObjectLike({});
   * // => true
   *
   * _.isObjectLike([1, 2, 3]);
   * // => true
   *
   * _.isObjectLike(_.noop);
   * // => false
   *
   * _.isObjectLike(null);
   * // => false
   */
  function isObjectLike(value) {
    return !!value && typeof value == 'object';
  }

  /**
   * Checks if `value` is classified as a `Symbol` primitive or object.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
   * @example
   *
   * _.isSymbol(Symbol.iterator);
   * // => true
   *
   * _.isSymbol('abc');
   * // => false
   */
  function isSymbol(value) {
    return typeof value == 'symbol' ||
      (isObjectLike(value) && objectToString$1.call(value) == symbolTag);
  }

  /**
   * Converts `value` to a string. An empty string is returned for `null`
   * and `undefined` values. The sign of `-0` is preserved.
   *
   * @static
   * @memberOf _
   * @since 4.0.0
   * @category Lang
   * @param {*} value The value to process.
   * @returns {string} Returns the string.
   * @example
   *
   * _.toString(null);
   * // => ''
   *
   * _.toString(-0);
   * // => '-0'
   *
   * _.toString([1, 2, 3]);
   * // => '1,2,3'
   */
  function toString$1(value) {
    return value == null ? '' : baseToString(value);
  }

  /**
   * Gets the value at `path` of `object`. If the resolved value is
   * `undefined`, the `defaultValue` is returned in its place.
   *
   * @static
   * @memberOf _
   * @since 3.7.0
   * @category Object
   * @param {Object} object The object to query.
   * @param {Array|string} path The path of the property to get.
   * @param {*} [defaultValue] The value returned for `undefined` resolved values.
   * @returns {*} Returns the resolved value.
   * @example
   *
   * var object = { 'a': [{ 'b': { 'c': 3 } }] };
   *
   * _.get(object, 'a[0].b.c');
   * // => 3
   *
   * _.get(object, ['a', '0', 'b', 'c']);
   * // => 3
   *
   * _.get(object, 'a.b.c', 'default');
   * // => 'default'
   */
  function get(object, path, defaultValue) {
    var result = object == null ? undefined : baseGet(object, path);
    return result === undefined ? defaultValue : result;
  }

  var lodash_get = get;

  function getProp(obj, path, defaultValue) {
    return obj[path] === undefined ? defaultValue : obj[path];
  }

  function setProp(obj, path, value) {
    var pathArray = Array.isArray(path) ? path : path.split('.');

    var _pathArray = _toArray(pathArray),
        key = _pathArray[0],
        restPath = _pathArray.slice(1);

    return _objectSpread({}, obj, _defineProperty({}, key, pathArray.length > 1 ? setProp(obj[key] || {}, restPath, value) : value));
  }

  function unsetProp(obj, path) {
    var pathArray = Array.isArray(path) ? path : path.split('.');

    var _pathArray2 = _toArray(pathArray),
        key = _pathArray2[0],
        restPath = _pathArray2.slice(1);

    if (_typeof(obj[key]) !== 'object') {
      // This will never be hit in the current code because unwind does the check before calling unsetProp

      /* istanbul ignore next */
      return obj;
    }

    if (pathArray.length === 1) {
      return Object.keys(obj).filter(function (prop) {
        return prop !== key;
      }).reduce(function (acc, prop) {
        return Object.assign(acc, _defineProperty({}, prop, obj[prop]));
      }, {});
    }

    return Object.keys(obj).reduce(function (acc, prop) {
      return _objectSpread({}, acc, _defineProperty({}, prop, prop !== key ? obj[prop] : unsetProp(obj[key], restPath)));
    }, {});
  }

  function flattenReducer(acc, arr) {
    try {
      // This is faster but susceptible to `RangeError: Maximum call stack size exceeded`
      acc.push.apply(acc, _toConsumableArray(arr));
      return acc;
    } catch (err) {
      // Fallback to a slower but safer option
      return acc.concat(arr);
    }
  }

  function fastJoin(arr, separator) {
    var isFirst = true;
    return arr.reduce(function (acc, elem) {
      if (elem === null || elem === undefined) {
        elem = '';
      }

      if (isFirst) {
        isFirst = false;
        return "".concat(elem);
      }

      return "".concat(acc).concat(separator).concat(elem);
    }, '');
  }

  var utils = {
    getProp: getProp,
    setProp: setProp,
    unsetProp: unsetProp,
    fastJoin: fastJoin,
    flattenReducer: flattenReducer
  };

  var getProp$1 = utils.getProp,
      fastJoin$1 = utils.fastJoin,
      flattenReducer$1 = utils.flattenReducer;

  var JSON2CSVBase =
  /*#__PURE__*/
  function () {
    function JSON2CSVBase(opts) {
      _classCallCheck(this, JSON2CSVBase);

      this.opts = this.preprocessOpts(opts);
    }
    /**
     * Check passing opts and set defaults.
     *
     * @param {Json2CsvOptions} opts Options object containing fields,
     * delimiter, default value, quote mark, header, etc.
     */


    _createClass(JSON2CSVBase, [{
      key: "preprocessOpts",
      value: function preprocessOpts(opts) {
        var processedOpts = Object.assign({}, opts);
        processedOpts.transforms = !Array.isArray(processedOpts.transforms) ? processedOpts.transforms ? [processedOpts.transforms] : [] : processedOpts.transforms;
        processedOpts.delimiter = processedOpts.delimiter || ',';
        processedOpts.eol = processedOpts.eol || os.EOL;
        processedOpts.quote = typeof processedOpts.quote === 'string' ? processedOpts.quote : '"';
        processedOpts.escapedQuote = typeof processedOpts.escapedQuote === 'string' ? processedOpts.escapedQuote : "".concat(processedOpts.quote).concat(processedOpts.quote);
        processedOpts.header = processedOpts.header !== false;
        processedOpts.includeEmptyRows = processedOpts.includeEmptyRows || false;
        processedOpts.withBOM = processedOpts.withBOM || false;
        return processedOpts;
      }
      /**
       * Check and normalize the fields configuration.
       *
       * @param {(string|object)[]} fields Fields configuration provided by the user
       * or inferred from the data
       * @returns {object[]} preprocessed FieldsInfo array
       */

    }, {
      key: "preprocessFieldsInfo",
      value: function preprocessFieldsInfo(fields) {
        var _this = this;

        return fields.map(function (fieldInfo) {
          if (typeof fieldInfo === 'string') {
            return {
              label: fieldInfo,
              value: fieldInfo.includes('.') || fieldInfo.includes('[') ? function (row) {
                return lodash_get(row, fieldInfo, _this.opts.defaultValue);
              } : function (row) {
                return getProp$1(row, fieldInfo, _this.opts.defaultValue);
              }
            };
          }

          if (_typeof(fieldInfo) === 'object') {
            var defaultValue = 'default' in fieldInfo ? fieldInfo.default : _this.opts.defaultValue;

            if (typeof fieldInfo.value === 'string') {
              return {
                label: fieldInfo.label || fieldInfo.value,
                value: fieldInfo.value.includes('.') || fieldInfo.value.includes('[') ? function (row) {
                  return lodash_get(row, fieldInfo.value, defaultValue);
                } : function (row) {
                  return getProp$1(row, fieldInfo.value, defaultValue);
                }
              };
            }

            if (typeof fieldInfo.value === 'function') {
              var label = fieldInfo.label || fieldInfo.value.name || '';
              var field = {
                label: label,
                default: defaultValue
              };
              return {
                label: label,
                value: function value(row) {
                  var value = fieldInfo.value(row, field);
                  return value === null || value === undefined ? defaultValue : value;
                }
              };
            }
          }

          throw new Error('Invalid field info option. ' + JSON.stringify(fieldInfo));
        });
      }
      /**
       * Create the title row with all the provided fields as column headings
       *
       * @returns {String} titles as a string
       */

    }, {
      key: "getHeader",
      value: function getHeader() {
        var _this2 = this;

        return fastJoin$1(this.opts.fields.map(function (fieldInfo) {
          return _this2.processValue(fieldInfo.label);
        }), this.opts.delimiter);
      }
      /**
       * Preprocess each object according to the given transforms (unwind, flatten, etc.).
       * @param {Object} row JSON object to be converted in a CSV row
       */

    }, {
      key: "preprocessRow",
      value: function preprocessRow(row) {
        return this.opts.transforms.reduce(function (rows, transform) {
          return rows.map(function (row) {
            return transform(row);
          }).reduce(flattenReducer$1, []);
        }, [row]);
      }
      /**
       * Create the content of a specific CSV row
       *
       * @param {Object} row JSON object to be converted in a CSV row
       * @returns {String} CSV string (row)
       */

    }, {
      key: "processRow",
      value: function processRow(row) {
        var _this3 = this;

        if (!row) {
          return undefined;
        }

        var processedRow = this.opts.fields.map(function (fieldInfo) {
          return _this3.processCell(row, fieldInfo);
        });

        if (!this.opts.includeEmptyRows && processedRow.every(function (field) {
          return field === undefined;
        })) {
          return undefined;
        }

        return fastJoin$1(processedRow, this.opts.delimiter);
      }
      /**
       * Create the content of a specfic CSV row cell
       *
       * @param {Object} row JSON object representing the  CSV row that the cell belongs to
       * @param {FieldInfo} fieldInfo Details of the field to process to be a CSV cell
       * @returns {String} CSV string (cell)
       */

    }, {
      key: "processCell",
      value: function processCell(row, fieldInfo) {
        return this.processValue(fieldInfo.value(row));
      }
      /**
       * Create the content of a specfic CSV row cell
       *
       * @param {Any} value Value to be included in a CSV cell
       * @returns {String} Value stringified and processed
       */

    }, {
      key: "processValue",
      value: function processValue(value) {
        if (value === null || value === undefined) {
          return undefined;
        }

        var valueType = _typeof(value);

        if (valueType !== 'boolean' && valueType !== 'number' && valueType !== 'string') {
          value = JSON.stringify(value);

          if (value === undefined) {
            return undefined;
          }

          if (value[0] === '"') {
            value = value.replace(/^"(.+)"$/, '$1');
          }
        }

        if (typeof value === 'string') {
          if (this.opts.excelStrings) {
            if (value.includes(this.opts.quote)) {
              value = value.replace(new RegExp(this.opts.quote, 'g'), "".concat(this.opts.escapedQuote).concat(this.opts.escapedQuote));
            }

            value = "\"=\"\"".concat(value, "\"\"\"");
          } else {
            if (value.includes(this.opts.quote)) {
              value = value.replace(new RegExp(this.opts.quote, 'g'), this.opts.escapedQuote);
            }

            value = "".concat(this.opts.quote).concat(value).concat(this.opts.quote);
          }
        }

        return value;
      }
    }]);

    return JSON2CSVBase;
  }();

  var JSON2CSVBase_1 = JSON2CSVBase;

  var fastJoin$2 = utils.fastJoin,
      flattenReducer$2 = utils.flattenReducer;

  var JSON2CSVParser =
  /*#__PURE__*/
  function (_JSON2CSVBase) {
    _inherits(JSON2CSVParser, _JSON2CSVBase);

    function JSON2CSVParser(opts) {
      var _this;

      _classCallCheck(this, JSON2CSVParser);

      _this = _possibleConstructorReturn(this, _getPrototypeOf(JSON2CSVParser).call(this, opts));

      if (_this.opts.fields) {
        _this.opts.fields = _this.preprocessFieldsInfo(_this.opts.fields);
      }

      return _this;
    }
    /**
     * Main function that converts json to csv.
     *
     * @param {Array|Object} data Array of JSON objects to be converted to CSV
     * @returns {String} The CSV formated data as a string
     */


    _createClass(JSON2CSVParser, [{
      key: "parse",
      value: function parse(data) {
        var processedData = this.preprocessData(data);

        if (!this.opts.fields) {
          this.opts.fields = processedData.reduce(function (fields, item) {
            Object.keys(item).forEach(function (field) {
              if (!fields.includes(field)) {
                fields.push(field);
              }
            });
            return fields;
          }, []);
          this.opts.fields = this.preprocessFieldsInfo(this.opts.fields);
        }

        var header = this.opts.header ? this.getHeader() : '';
        var rows = this.processData(processedData);
        var csv = (this.opts.withBOM ? "\uFEFF" : '') + header + (header && rows ? this.opts.eol : '') + rows;
        return csv;
      }
      /**
       * Preprocess the data according to the give opts (unwind, flatten, etc.)
        and calculate the fields and field names if they are not provided.
       *
       * @param {Array|Object} data Array or object to be converted to CSV
       */

    }, {
      key: "preprocessData",
      value: function preprocessData(data) {
        var _this2 = this;

        var processedData = Array.isArray(data) ? data : [data];

        if (!this.opts.fields && (processedData.length === 0 || _typeof(processedData[0]) !== 'object')) {
          throw new Error('Data should not be empty or the "fields" option should be included');
        }

        if (this.opts.transforms.length === 0) return processedData;
        return processedData.map(function (row) {
          return _this2.preprocessRow(row);
        }).reduce(flattenReducer$2, []);
      }
      /**
       * Create the content row by row below the header
       *
       * @param {Array} data Array of JSON objects to be converted to CSV
       * @returns {String} CSV string (body)
       */

    }, {
      key: "processData",
      value: function processData(data) {
        var _this3 = this;

        return fastJoin$2(data.map(function (row) {
          return _this3.processRow(row);
        }).filter(function (row) {
          return row;
        }), // Filter empty rows
        this.opts.eol);
      }
    }]);

    return JSON2CSVParser;
  }(JSON2CSVBase_1);

  var JSON2CSVParser_1 = JSON2CSVParser;

  /*global Buffer*/
  // Named constants with unique integer values
  var C = {};
  // Tokens
  var LEFT_BRACE    = C.LEFT_BRACE    = 0x1;
  var RIGHT_BRACE   = C.RIGHT_BRACE   = 0x2;
  var LEFT_BRACKET  = C.LEFT_BRACKET  = 0x3;
  var RIGHT_BRACKET = C.RIGHT_BRACKET = 0x4;
  var COLON         = C.COLON         = 0x5;
  var COMMA         = C.COMMA         = 0x6;
  var TRUE          = C.TRUE          = 0x7;
  var FALSE         = C.FALSE         = 0x8;
  var NULL          = C.NULL          = 0x9;
  var STRING        = C.STRING        = 0xa;
  var NUMBER        = C.NUMBER        = 0xb;
  // Tokenizer States
  var START   = C.START   = 0x11;
  var STOP    = C.STOP    = 0x12;
  var TRUE1   = C.TRUE1   = 0x21;
  var TRUE2   = C.TRUE2   = 0x22;
  var TRUE3   = C.TRUE3   = 0x23;
  var FALSE1  = C.FALSE1  = 0x31;
  var FALSE2  = C.FALSE2  = 0x32;
  var FALSE3  = C.FALSE3  = 0x33;
  var FALSE4  = C.FALSE4  = 0x34;
  var NULL1   = C.NULL1   = 0x41;
  var NULL2   = C.NULL2   = 0x42;
  var NULL3   = C.NULL3   = 0x43;
  var NUMBER1 = C.NUMBER1 = 0x51;
  var NUMBER3 = C.NUMBER3 = 0x53;
  var STRING1 = C.STRING1 = 0x61;
  var STRING2 = C.STRING2 = 0x62;
  var STRING3 = C.STRING3 = 0x63;
  var STRING4 = C.STRING4 = 0x64;
  var STRING5 = C.STRING5 = 0x65;
  var STRING6 = C.STRING6 = 0x66;
  // Parser States
  var VALUE   = C.VALUE   = 0x71;
  var KEY     = C.KEY     = 0x72;
  // Parser Modes
  var OBJECT  = C.OBJECT  = 0x81;
  var ARRAY   = C.ARRAY   = 0x82;
  // Character constants
  var BACK_SLASH =      "\\".charCodeAt(0);
  var FORWARD_SLASH =   "\/".charCodeAt(0);
  var BACKSPACE =       "\b".charCodeAt(0);
  var FORM_FEED =       "\f".charCodeAt(0);
  var NEWLINE =         "\n".charCodeAt(0);
  var CARRIAGE_RETURN = "\r".charCodeAt(0);
  var TAB =             "\t".charCodeAt(0);

  var STRING_BUFFER_SIZE = 64 * 1024;

  function Parser() {
    this.tState = START;
    this.value = undefined;

    this.string = undefined; // string data
    this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE);
    this.stringBufferOffset = 0;
    this.unicode = undefined; // unicode escapes
    this.highSurrogate = undefined;

    this.key = undefined;
    this.mode = undefined;
    this.stack = [];
    this.state = VALUE;
    this.bytes_remaining = 0; // number of bytes remaining in multi byte utf8 char to read after split boundary
    this.bytes_in_sequence = 0; // bytes in multi byte utf8 char to read
    this.temp_buffs = { "2": new Buffer(2), "3": new Buffer(3), "4": new Buffer(4) }; // for rebuilding chars split before boundary is reached

    // Stream offset
    this.offset = -1;
  }

  // Slow code to string converter (only used when throwing syntax errors)
  Parser.toknam = function (code) {
    var keys = Object.keys(C);
    for (var i = 0, l = keys.length; i < l; i++) {
      var key = keys[i];
      if (C[key] === code) { return key; }
    }
    return code && ("0x" + code.toString(16));
  };

  var proto = Parser.prototype;
  proto.onError = function (err) { throw err; };
  proto.charError = function (buffer, i) {
    this.tState = STOP;
    this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer[i])) + " at position " + i + " in state " + Parser.toknam(this.tState)));
  };
  proto.appendStringChar = function (char) {
    if (this.stringBufferOffset >= STRING_BUFFER_SIZE) {
      this.string += this.stringBuffer.toString('utf8');
      this.stringBufferOffset = 0;
    }

    this.stringBuffer[this.stringBufferOffset++] = char;
  };
  proto.appendStringBuf = function (buf, start, end) {
    var size = buf.length;
    if (typeof start === 'number') {
      if (typeof end === 'number') {
        if (end < 0) {
          // adding a negative end decreeses the size
          size = buf.length - start + end;
        } else {
          size = end - start;
        }
      } else {
        size = buf.length - start;
      }
    }

    if (size < 0) {
      size = 0;
    }

    if (this.stringBufferOffset + size > STRING_BUFFER_SIZE) {
      this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset);
      this.stringBufferOffset = 0;
    }

    buf.copy(this.stringBuffer, this.stringBufferOffset, start, end);
    this.stringBufferOffset += size;
  };
  proto.write = function (buffer) {
    if (typeof buffer === "string") buffer = new Buffer(buffer);
    var n;
    for (var i = 0, l = buffer.length; i < l; i++) {
      if (this.tState === START){
        n = buffer[i];
        this.offset++;
        if(n === 0x7b){ this.onToken(LEFT_BRACE, "{"); // {
        }else if(n === 0x7d){ this.onToken(RIGHT_BRACE, "}"); // }
        }else if(n === 0x5b){ this.onToken(LEFT_BRACKET, "["); // [
        }else if(n === 0x5d){ this.onToken(RIGHT_BRACKET, "]"); // ]
        }else if(n === 0x3a){ this.onToken(COLON, ":");  // :
        }else if(n === 0x2c){ this.onToken(COMMA, ","); // ,
        }else if(n === 0x74){ this.tState = TRUE1;  // t
        }else if(n === 0x66){ this.tState = FALSE1;  // f
        }else if(n === 0x6e){ this.tState = NULL1; // n
        }else if(n === 0x22){ // "
          this.string = "";
          this.stringBufferOffset = 0;
          this.tState = STRING1;
        }else if(n === 0x2d){ this.string = "-"; this.tState = NUMBER1; // -
        }else{
          if (n >= 0x30 && n < 0x40) { // 1-9
            this.string = String.fromCharCode(n); this.tState = NUMBER3;
          } else if (n === 0x20 || n === 0x09 || n === 0x0a || n === 0x0d) ; else {
            return this.charError(buffer, i);
          }
        }
      }else if (this.tState === STRING1){ // After open quote
        n = buffer[i]; // get current byte from buffer
        // check for carry over of a multi byte char split between data chunks
        // & fill temp buffer it with start of this data chunk up to the boundary limit set in the last iteration
        if (this.bytes_remaining > 0) {
          for (var j = 0; j < this.bytes_remaining; j++) {
            this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j];
          }

          this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]);
          this.bytes_in_sequence = this.bytes_remaining = 0;
          i = i + j - 1;
        } else if (this.bytes_remaining === 0 && n >= 128) { // else if no remainder bytes carried over, parse multi byte (>=128) chars one at a time
          if (n <= 193 || n > 244) {
            return this.onError(new Error("Invalid UTF-8 character at position " + i + " in state " + Parser.toknam(this.tState)));
          }
          if ((n >= 194) && (n <= 223)) this.bytes_in_sequence = 2;
          if ((n >= 224) && (n <= 239)) this.bytes_in_sequence = 3;
          if ((n >= 240) && (n <= 244)) this.bytes_in_sequence = 4;
          if ((this.bytes_in_sequence + i) > buffer.length) { // if bytes needed to complete char fall outside buffer length, we have a boundary split
            for (var k = 0; k <= (buffer.length - 1 - i); k++) {
              this.temp_buffs[this.bytes_in_sequence][k] = buffer[i + k]; // fill temp buffer of correct size with bytes available in this chunk
            }
            this.bytes_remaining = (i + this.bytes_in_sequence) - buffer.length;
            i = buffer.length - 1;
          } else {
            this.appendStringBuf(buffer, i, i + this.bytes_in_sequence);
            i = i + this.bytes_in_sequence - 1;
          }
        } else if (n === 0x22) {
          this.tState = START;
          this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset);
          this.stringBufferOffset = 0;
          this.onToken(STRING, this.string);
          this.offset += Buffer.byteLength(this.string, 'utf8') + 1;
          this.string = undefined;
        }
        else if (n === 0x5c) {
          this.tState = STRING2;
        }
        else if (n >= 0x20) { this.appendStringChar(n); }
        else {
            return this.charError(buffer, i);
        }
      }else if (this.tState === STRING2){ // After backslash
        n = buffer[i];
        if(n === 0x22){ this.appendStringChar(n); this.tState = STRING1;
        }else if(n === 0x5c){ this.appendStringChar(BACK_SLASH); this.tState = STRING1;
        }else if(n === 0x2f){ this.appendStringChar(FORWARD_SLASH); this.tState = STRING1;
        }else if(n === 0x62){ this.appendStringChar(BACKSPACE); this.tState = STRING1;
        }else if(n === 0x66){ this.appendStringChar(FORM_FEED); this.tState = STRING1;
        }else if(n === 0x6e){ this.appendStringChar(NEWLINE); this.tState = STRING1;
        }else if(n === 0x72){ this.appendStringChar(CARRIAGE_RETURN); this.tState = STRING1;
        }else if(n === 0x74){ this.appendStringChar(TAB); this.tState = STRING1;
        }else if(n === 0x75){ this.unicode = ""; this.tState = STRING3;
        }else{
          return this.charError(buffer, i);
        }
      }else if (this.tState === STRING3 || this.tState === STRING4 || this.tState === STRING5 || this.tState === STRING6){ // unicode hex codes
        n = buffer[i];
        // 0-9 A-F a-f
        if ((n >= 0x30 && n < 0x40) || (n > 0x40 && n <= 0x46) || (n > 0x60 && n <= 0x66)) {
          this.unicode += String.fromCharCode(n);
          if (this.tState++ === STRING6) {
            var intVal = parseInt(this.unicode, 16);
            this.unicode = undefined;
            if (this.highSurrogate !== undefined && intVal >= 0xDC00 && intVal < (0xDFFF + 1)) { //<56320,57343> - lowSurrogate
              this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate, intVal)));
              this.highSurrogate = undefined;
            } else if (this.highSurrogate === undefined && intVal >= 0xD800 && intVal < (0xDBFF + 1)) { //<55296,56319> - highSurrogate
              this.highSurrogate = intVal;
            } else {
              if (this.highSurrogate !== undefined) {
                this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate)));
                this.highSurrogate = undefined;
              }
              this.appendStringBuf(new Buffer(String.fromCharCode(intVal)));
            }
            this.tState = STRING1;
          }
        } else {
          return this.charError(buffer, i);
        }
      } else if (this.tState === NUMBER1 || this.tState === NUMBER3) {
          n = buffer[i];

          switch (n) {
            case 0x30: // 0
            case 0x31: // 1
            case 0x32: // 2
            case 0x33: // 3
            case 0x34: // 4
            case 0x35: // 5
            case 0x36: // 6
            case 0x37: // 7
            case 0x38: // 8
            case 0x39: // 9
            case 0x2e: // .
            case 0x65: // e
            case 0x45: // E
            case 0x2b: // +
            case 0x2d: // -
              this.string += String.fromCharCode(n);
              this.tState = NUMBER3;
              break;
            default:
              this.tState = START;
              var result = Number(this.string);

              if (isNaN(result)){
                return this.charError(buffer, i);
              }

              if ((this.string.match(/[0-9]+/) == this.string) && (result.toString() != this.string)) {
                // Long string of digits which is an ID string and not valid and/or safe JavaScript integer Number
                this.onToken(STRING, this.string);
              } else {
                this.onToken(NUMBER, result);
              }

              this.offset += this.string.length - 1;
              this.string = undefined;
              i--;
              break;
          }
      }else if (this.tState === TRUE1){ // r
        if (buffer[i] === 0x72) { this.tState = TRUE2; }
        else { return this.charError(buffer, i); }
      }else if (this.tState === TRUE2){ // u
        if (buffer[i] === 0x75) { this.tState = TRUE3; }
        else { return this.charError(buffer, i); }
      }else if (this.tState === TRUE3){ // e
        if (buffer[i] === 0x65) { this.tState = START; this.onToken(TRUE, true); this.offset+= 3; }
        else { return this.charError(buffer, i); }
      }else if (this.tState === FALSE1){ // a
        if (buffer[i] === 0x61) { this.tState = FALSE2; }
        else { return this.charError(buffer, i); }
      }else if (this.tState === FALSE2){ // l
        if (buffer[i] === 0x6c) { this.tState = FALSE3; }
        else { return this.charError(buffer, i); }
      }else if (this.tState === FALSE3){ // s
        if (buffer[i] === 0x73) { this.tState = FALSE4; }
        else { return this.charError(buffer, i); }
      }else if (this.tState === FALSE4){ // e
        if (buffer[i] === 0x65) { this.tState = START; this.onToken(FALSE, false); this.offset+= 4; }
        else { return this.charError(buffer, i); }
      }else if (this.tState === NULL1){ // u
        if (buffer[i] === 0x75) { this.tState = NULL2; }
        else { return this.charError(buffer, i); }
      }else if (this.tState === NULL2){ // l
        if (buffer[i] === 0x6c) { this.tState = NULL3; }
        else { return this.charError(buffer, i); }
      }else if (this.tState === NULL3){ // l
        if (buffer[i] === 0x6c) { this.tState = START; this.onToken(NULL, null); this.offset += 3; }
        else { return this.charError(buffer, i); }
      }
    }
  };
  proto.onToken = function (token, value) {
    // Override this to get events
  };

  proto.parseError = function (token, value) {
    this.tState = STOP;
    this.onError(new Error("Unexpected " + Parser.toknam(token) + (value ? ("(" + JSON.stringify(value) + ")") : "") + " in state " + Parser.toknam(this.state)));
  };
  proto.push = function () {
    this.stack.push({value: this.value, key: this.key, mode: this.mode});
  };
  proto.pop = function () {
    var value = this.value;
    var parent = this.stack.pop();
    this.value = parent.value;
    this.key = parent.key;
    this.mode = parent.mode;
    this.emit(value);
    if (!this.mode) { this.state = VALUE; }
  };
  proto.emit = function (value) {
    if (this.mode) { this.state = COMMA; }
    this.onValue(value);
  };
  proto.onValue = function (value) {
    // Override me
  };
  proto.onToken = function (token, value) {
    if(this.state === VALUE){
      if(token === STRING || token === NUMBER || token === TRUE || token === FALSE || token === NULL){
        if (this.value) {
          this.value[this.key] = value;
        }
        this.emit(value);
      }else if(token === LEFT_BRACE){
        this.push();
        if (this.value) {
          this.value = this.value[this.key] = {};
        } else {
          this.value = {};
        }
        this.key = undefined;
        this.state = KEY;
        this.mode = OBJECT;
      }else if(token === LEFT_BRACKET){
        this.push();
        if (this.value) {
          this.value = this.value[this.key] = [];
        } else {
          this.value = [];
        }
        this.key = 0;
        this.mode = ARRAY;
        this.state = VALUE;
      }else if(token === RIGHT_BRACE){
        if (this.mode === OBJECT) {
          this.pop();
        } else {
          return this.parseError(token, value);
        }
      }else if(token === RIGHT_BRACKET){
        if (this.mode === ARRAY) {
          this.pop();
        } else {
          return this.parseError(token, value);
        }
      }else{
        return this.parseError(token, value);
      }
    }else if(this.state === KEY){
      if (token === STRING) {
        this.key = value;
        this.state = COLON;
      } else if (token === RIGHT_BRACE) {
        this.pop();
      } else {
        return this.parseError(token, value);
      }
    }else if(this.state === COLON){
      if (token === COLON) { this.state = VALUE; }
      else { return this.parseError(token, value); }
    }else if(this.state === COMMA){
      if (token === COMMA) {
        if (this.mode === ARRAY) { this.key++; this.state = VALUE; }
        else if (this.mode === OBJECT) { this.state = KEY; }

      } else if (token === RIGHT_BRACKET && this.mode === ARRAY || token === RIGHT_BRACE && this.mode === OBJECT) {
        this.pop();
      } else {
        return this.parseError(token, value);
      }
    }else{
      return this.parseError(token, value);
    }
  };

  Parser.C = C;

  var jsonparse = Parser;

  var Transform$1 = Stream.Transform;

  var JSON2CSVTransform =
  /*#__PURE__*/
  function (_Transform) {
    _inherits(JSON2CSVTransform, _Transform);

    function JSON2CSVTransform(opts, transformOpts) {
      var _this;

      _classCallCheck(this, JSON2CSVTransform);

      _this = _possibleConstructorReturn(this, _getPrototypeOf(JSON2CSVTransform).call(this, transformOpts)); // Inherit methods from JSON2CSVBase since extends doesn't
      // allow multiple inheritance and manually preprocess opts

      Object.getOwnPropertyNames(JSON2CSVBase_1.prototype).forEach(function (key) {
        return _this[key] = JSON2CSVBase_1.prototype[key];
      });
      _this.opts = _this.preprocessOpts(opts);
      _this._data = '';
      _this._hasWritten = false;

      if (_this._readableState.objectMode) {
        _this.initObjectModeParse();
      } else if (_this.opts.ndjson) {
        _this.initNDJSONParse();
      } else {
        _this.initJSONParser();
      }

      if (_this.opts.withBOM) {
        _this.push("\uFEFF");
      }

      if (_this.opts.fields) {
        _this.opts.fields = _this.preprocessFieldsInfo(_this.opts.fields);

        _this.pushHeader();
      }

      return _this;
    }
    /**
     * Init the transform with a parser to process data in object mode.
     * It receives JSON objects one by one and send them to `pushLine for processing.
     */


    _createClass(JSON2CSVTransform, [{
      key: "initObjectModeParse",
      value: function initObjectModeParse() {
        var transform = this;
        this.parser = {
          write: function write(line) {
            transform.pushLine(line);
          },
          getPendingData: function getPendingData() {
            return undefined;
          }
        };
      }
      /**
       * Init the transform with a parser to process NDJSON data.
       * It maintains a buffer of received data, parses each line
       * as JSON and send it to `pushLine for processing.
       */

    }, {
      key: "initNDJSONParse",
      value: function initNDJSONParse() {
        var transform = this;
        this.parser = {
          _data: '',
          write: function write(chunk) {
            this._data += chunk.toString();

            var lines = this._data.split('\n').map(function (line) {
              return line.trim();
            }).filter(function (line) {
              return line !== '';
            });

            var pendingData = false;
            lines.forEach(function (line, i) {
              try {
                transform.pushLine(JSON.parse(line));
              } catch (e) {
                if (i === lines.length - 1) {
                  pendingData = true;
                } else {
                  e.message = "Invalid JSON (".concat(line, ")");
                  transform.emit('error', e);
                }
              }
            });
            this._data = pendingData ? this._data.slice(this._data.lastIndexOf('\n')) : '';
          },
          getPendingData: function getPendingData() {
            return this._data;
          }
        };
      }
      /**
       * Init the transform with a parser to process JSON data.
       * It maintains a buffer of received data, parses each as JSON 
       * item if the data is an array or the data itself otherwise
       * and send it to `pushLine` for processing.
       */

    }, {
      key: "initJSONParser",
      value: function initJSONParser() {
        var transform = this;
        this.parser = new jsonparse();

        this.parser.onValue = function (value) {
          if (this.stack.length !== this.depthToEmit) return;
          transform.pushLine(value);
        };

        this.parser._onToken = this.parser.onToken;

        this.parser.onToken = function (token, value) {
          transform.parser._onToken(token, value);

          if (this.stack.length === 0 && !transform.opts.fields && this.mode !== jsonparse.C.ARRAY && this.mode !== jsonparse.C.OBJECT) {
            this.onError(new Error('Data should not be empty or the "fields" option should be included'));
          }

          if (this.stack.length === 1) {
            if (this.depthToEmit === undefined) {
              // If Array emit its content, else emit itself
              this.depthToEmit = this.mode === jsonparse.C.ARRAY ? 1 : 0;
            }

            if (this.depthToEmit !== 0 && this.stack.length === 1) {
              // No need to store the whole root array in memory
              this.value = undefined;
            }
          }
        };

        this.parser.getPendingData = function () {
          return this.value;
        };

        this.parser.onError = function (err) {
          if (err.message.includes('Unexpected')) {
            err.message = "Invalid JSON (".concat(err.message, ")");
          }

          transform.emit('error', err);
        };
      }
      /**
       * Main function that send data to the parse to be processed.
       *
       * @param {Buffer} chunk Incoming data
       * @param {String} encoding Encoding of the incoming data. Defaults to 'utf8'
       * @param {Function} done Called when the proceesing of the supplied chunk is done
       */

    }, {
      key: "_transform",
      value: function _transform(chunk, encoding, done) {
        this.parser.write(chunk);
        done();
      }
    }, {
      key: "_flush",
      value: function _flush(done) {
        if (this.parser.getPendingData()) {
          done(new Error('Invalid data received from stdin', this.parser.getPendingData()));
        }

        done();
      }
      /**
       * Generate the csv header and pushes it downstream.
       */

    }, {
      key: "pushHeader",
      value: function pushHeader() {
        if (this.opts.header) {
          var header = this.getHeader();
          this.emit('header', header);
          this.push(header);
          this._hasWritten = true;
        }
      }
      /**
       * Transforms an incoming json data to csv and pushes it downstream.
       *
       * @param {Object} data JSON object to be converted in a CSV row
       */

    }, {
      key: "pushLine",
      value: function pushLine(data) {
        var _this2 = this;

        var processedData = this.preprocessRow(data);

        if (!this._hasWritten) {
          this.opts.fields = this.opts.fields || this.preprocessFieldsInfo(Object.keys(processedData[0]));
          this.pushHeader();
        }

        processedData.forEach(function (row) {
          var line = _this2.processRow(row, _this2.opts);

          if (line === undefined) return;

          _this2.emit('line', line);

          _this2.push(_this2._hasWritten ? _this2.opts.eol + line : line);

          _this2._hasWritten = true;
        });
      }
    }]);

    return JSON2CSVTransform;
  }(Transform$1);

  var JSON2CSVTransform_1 = JSON2CSVTransform;

  var Transform$2 = Stream.Transform;
  var fastJoin$3 = utils.fastJoin;

  var JSON2CSVAsyncParser =
  /*#__PURE__*/
  function () {
    function JSON2CSVAsyncParser(opts, transformOpts) {
      _classCallCheck(this, JSON2CSVAsyncParser);

      this.input = new Transform$2(transformOpts);

      this.input._read = function () {};

      this.transform = new JSON2CSVTransform_1(opts, transformOpts);
      this.processor = this.input.pipe(this.transform);
    }

    _createClass(JSON2CSVAsyncParser, [{
      key: "fromInput",
      value: function fromInput(input) {
        if (this._input) {
          throw new Error('Async parser already has an input.');
        }

        this._input = input;
        this.input = this._input.pipe(this.processor);
        return this;
      }
    }, {
      key: "throughTransform",
      value: function throughTransform(transform) {
        if (this._output) {
          throw new Error('Can\'t add transforms once an output has been added.');
        }

        this.processor = this.processor.pipe(transform);
        return this;
      }
    }, {
      key: "toOutput",
      value: function toOutput(output) {
        if (this._output) {
          throw new Error('Async parser already has an output.');
        }

        this._output = output;
        this.processor = this.processor.pipe(output);
        return this;
      }
    }, {
      key: "promise",
      value: function promise() {
        var _this = this;

        var returnCSV = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
        return new Promise(function (resolve, reject) {
          if (!returnCSV) {
            _this.processor.on('finish', function () {
              return resolve();
            }).on('error', function (err) {
              return reject(err);
            });

            return;
          }

          var csvBuffer = [];

          _this.processor.on('data', function (chunk) {
            return csvBuffer.push(chunk.toString());
          }).on('finish', function () {
            return resolve(fastJoin$3(csvBuffer, ''));
          }).on('error', function (err) {
            return reject(err);
          });
        });
      }
    }]);

    return JSON2CSVAsyncParser;
  }();

  var JSON2CSVAsyncParser_1 = JSON2CSVAsyncParser;

  /**
   * Performs the flattening of a data row recursively
   *
   * @param {String} separator Separator to be used as the flattened field name
   * @returns {Object => Object} Flattened object
   */
  function flatten() {
    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
        _ref$objects = _ref.objects,
        objects = _ref$objects === void 0 ? true : _ref$objects,
        _ref$arrays = _ref.arrays,
        arrays = _ref$arrays === void 0 ? false : _ref$arrays,
        _ref$separator = _ref.separator,
        separator = _ref$separator === void 0 ? '.' : _ref$separator;

    function step(obj, flatDataRow, currentPath) {
      Object.keys(obj).forEach(function (key) {
        var newPath = currentPath ? "".concat(currentPath).concat(separator).concat(key) : key;
        var value = obj[key];

        if (objects && _typeof(value) === 'object' && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value.toJSON) !== '[object Function]' && Object.keys(value).length) {
          step(value, flatDataRow, newPath);
          return;
        }

        if (arrays && Array.isArray(value)) {
          step(value, flatDataRow, newPath);
          return;
        }

        flatDataRow[newPath] = value;
      });
      return flatDataRow;
    }

    return function (dataRow) {
      return step(dataRow, {});
    };
  }

  var flatten_1 = flatten;

  var setProp$1 = utils.setProp,
      unsetProp$1 = utils.unsetProp,
      flattenReducer$3 = utils.flattenReducer;

  function getUnwindablePaths(obj, currentPath) {
    return Object.keys(obj).reduce(function (unwindablePaths, key) {
      var newPath = currentPath ? "".concat(currentPath, ".").concat(key) : key;
      var value = obj[key];

      if (_typeof(value) === 'object' && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value.toJSON) !== '[object Function]' && Object.keys(value).length) {
        unwindablePaths = unwindablePaths.concat(getUnwindablePaths(value, newPath));
      } else if (Array.isArray(value)) {
        unwindablePaths.push(newPath);
        unwindablePaths = unwindablePaths.concat(value.map(function (arrObj) {
          return getUnwindablePaths(arrObj, newPath);
        }).reduce(flattenReducer$3, []).filter(function (item, index, arr) {
          return arr.indexOf(item) !== index;
        }));
      }

      return unwindablePaths;
    }, []);
  }
  /**
   * Performs the unwind recursively in specified sequence
   *
   * @param {String[]} unwindPaths The paths as strings to be used to deconstruct the array
   * @returns {Object => Array} Array of objects containing all rows after unwind of chosen paths
  */


  function unwind() {
    var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
        _ref$paths = _ref.paths,
        paths = _ref$paths === void 0 ? undefined : _ref$paths,
        _ref$blankOut = _ref.blankOut,
        blankOut = _ref$blankOut === void 0 ? false : _ref$blankOut;

    function unwindReducer(rows, unwindPath) {
      return rows.map(function (row) {
        var unwindArray = lodash_get(row, unwindPath);

        if (!Array.isArray(unwindArray)) {
          return row;
        }

        if (!unwindArray.length) {
          return unsetProp$1(row, unwindPath);
        }

        return unwindArray.map(function (unwindRow, index) {
          var clonedRow = blankOut && index > 0 ? {} : row;
          return setProp$1(clonedRow, unwindPath, unwindRow);
        });
      }).reduce(flattenReducer$3, []);
    }

    paths = Array.isArray(paths) ? paths : paths ? [paths] : undefined;
    return function (dataRow) {
      return (paths || getUnwindablePaths(dataRow)).reduce(unwindReducer, [dataRow]);
    };
  }

  var unwind_1 = unwind;

  var Readable$1 = Stream.Readable;
  var Parser$1 = JSON2CSVParser_1;
  var AsyncParser = JSON2CSVAsyncParser_1;
  var Transform$3 = JSON2CSVTransform_1; // Convenience method to keep the API similar to version 3.X

  var parse = function parse(data, opts) {
    return new JSON2CSVParser_1(opts).parse(data);
  };

  var parseAsync = function parseAsync(data, opts, transformOpts) {
    try {
      if (!(data instanceof Readable$1)) {
        transformOpts = Object.assign({}, transformOpts, {
          objectMode: true
        });
      }

      var asyncParser = new JSON2CSVAsyncParser_1(opts, transformOpts);
      var promise = asyncParser.promise();

      if (Array.isArray(data)) {
        data.forEach(function (item) {
          return asyncParser.input.push(item);
        });
        asyncParser.input.push(null);
      } else if (data instanceof Readable$1) {
        asyncParser.fromInput(data);
      } else {
        asyncParser.input.push(data);
        asyncParser.input.push(null);
      }

      return promise;
    } catch (err) {
      return Promise.reject(err);
    }
  };

  var transforms = {
    flatten: flatten_1,
    unwind: unwind_1
  };
  var json2csv = {
    Parser: Parser$1,
    AsyncParser: AsyncParser,
    Transform: Transform$3,
    parse: parse,
    parseAsync: parseAsync,
    transforms: transforms
  };

  exports.AsyncParser = AsyncParser;
  exports.Parser = Parser$1;
  exports.Transform = Transform$3;
  exports.default = json2csv;
  exports.parse = parse;
  exports.parseAsync = parseAsync;
  exports.transforms = transforms;

  Object.defineProperty(exports, '__esModule', { value: true });

}));


/***/ }),

/***/ 4241:
/***/ (function(module) {


module.exports = function load (src, opts, cb) {
  var head = document.head || document.getElementsByTagName('head')[0]
  var script = document.createElement('script')

  if (typeof opts === 'function') {
    cb = opts
    opts = {}
  }

  opts = opts || {}
  cb = cb || function() {}

  script.type = opts.type || 'text/javascript'
  script.charset = opts.charset || 'utf8';
  script.async = 'async' in opts ? !!opts.async : true
  script.src = src

  if (opts.attrs) {
    setAttributes(script, opts.attrs)
  }

  if (opts.text) {
    script.text = '' + opts.text
  }

  var onend = 'onload' in script ? stdOnEnd : ieOnEnd
  onend(script, cb)

  // some good legacy browsers (firefox) fail the 'in' detection above
  // so as a fallback we always set onload
  // old IE will ignore this and new IE will set onload
  if (!script.onload) {
    stdOnEnd(script, cb);
  }

  head.appendChild(script)
}

function setAttributes(script, attrs) {
  for (var attr in attrs) {
    script.setAttribute(attr, attrs[attr]);
  }
}

function stdOnEnd (script, cb) {
  script.onload = function () {
    this.onerror = this.onload = null
    cb(null, script)
  }
  script.onerror = function () {
    // this.onload = null here is necessary
    // because even IE9 works not like others
    this.onerror = this.onload = null
    cb(new Error('Failed to load ' + this.src), script)
  }
}

function ieOnEnd (script, cb) {
  script.onreadystatechange = function () {
    if (this.readyState != 'complete' && this.readyState != 'loaded') return
    this.onreadystatechange = null
    cb(null, script) // there is no way to catch loading errors in IE8
  }
}


/***/ }),

/***/ 3097:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
var safeIsNaN = Number.isNaN ||
    function ponyfill(value) {
        return typeof value === 'number' && value !== value;
    };
function isEqual(first, second) {
    if (first === second) {
        return true;
    }
    if (safeIsNaN(first) && safeIsNaN(second)) {
        return true;
    }
    return false;
}
function areInputsEqual(newInputs, lastInputs) {
    if (newInputs.length !== lastInputs.length) {
        return false;
    }
    for (var i = 0; i < newInputs.length; i++) {
        if (!isEqual(newInputs[i], lastInputs[i])) {
            return false;
        }
    }
    return true;
}

function memoizeOne(resultFn, isEqual) {
    if (isEqual === void 0) { isEqual = areInputsEqual; }
    var lastThis;
    var lastArgs = [];
    var lastResult;
    var calledOnce = false;
    function memoized() {
        var newArgs = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            newArgs[_i] = arguments[_i];
        }
        if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
            return lastResult;
        }
        lastResult = resultFn.apply(this, newArgs);
        calledOnce = true;
        lastThis = this;
        lastArgs = newArgs;
        return lastResult;
    }
    return memoized;
}

/* harmony default export */ __webpack_exports__["default"] = (memoizeOne);


/***/ }),

/***/ 9921:
/***/ (function(module) {

"use strict";


var numberIsNaN = function (value) {
	return value !== value;
};

module.exports = function is(a, b) {
	if (a === 0 && b === 0) {
		return 1 / a === 1 / b;
	}
	if (a === b) {
		return true;
	}
	if (numberIsNaN(a) && numberIsNaN(b)) {
		return true;
	}
	return false;
};



/***/ }),

/***/ 911:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var define = __webpack_require__(9517);
var callBind = __webpack_require__(3784);

var implementation = __webpack_require__(9921);
var getPolyfill = __webpack_require__(4836);
var shim = __webpack_require__(3726);

var polyfill = callBind(getPolyfill(), Object);

define(polyfill, {
	getPolyfill: getPolyfill,
	implementation: implementation,
	shim: shim
});

module.exports = polyfill;


/***/ }),

/***/ 4836:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var implementation = __webpack_require__(9921);

module.exports = function getPolyfill() {
	return typeof Object.is === 'function' ? Object.is : implementation;
};


/***/ }),

/***/ 3726:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var getPolyfill = __webpack_require__(4836);
var define = __webpack_require__(9517);

module.exports = function shimObjectIs() {
	var polyfill = getPolyfill();
	define(Object, { is: polyfill }, {
		is: function testObjectIs() {
			return Object.is !== polyfill;
		}
	});
	return polyfill;
};


/***/ }),

/***/ 8541:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var keysShim;
if (!Object.keys) {
	// modified from https://github.com/es-shims/es5-shim
	var has = Object.prototype.hasOwnProperty;
	var toStr = Object.prototype.toString;
	var isArgs = __webpack_require__(7411); // eslint-disable-line global-require
	var isEnumerable = Object.prototype.propertyIsEnumerable;
	var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
	var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
	var dontEnums = [
		'toString',
		'toLocaleString',
		'valueOf',
		'hasOwnProperty',
		'isPrototypeOf',
		'propertyIsEnumerable',
		'constructor'
	];
	var equalsConstructorPrototype = function (o) {
		var ctor = o.constructor;
		return ctor && ctor.prototype === o;
	};
	var excludedKeys = {
		$applicationCache: true,
		$console: true,
		$external: true,
		$frame: true,
		$frameElement: true,
		$frames: true,
		$innerHeight: true,
		$innerWidth: true,
		$onmozfullscreenchange: true,
		$onmozfullscreenerror: true,
		$outerHeight: true,
		$outerWidth: true,
		$pageXOffset: true,
		$pageYOffset: true,
		$parent: true,
		$scrollLeft: true,
		$scrollTop: true,
		$scrollX: true,
		$scrollY: true,
		$self: true,
		$webkitIndexedDB: true,
		$webkitStorageInfo: true,
		$window: true
	};
	var hasAutomationEqualityBug = (function () {
		/* global window */
		if (typeof window === 'undefined') { return false; }
		for (var k in window) {
			try {
				if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
					try {
						equalsConstructorPrototype(window[k]);
					} catch (e) {
						return true;
					}
				}
			} catch (e) {
				return true;
			}
		}
		return false;
	}());
	var equalsConstructorPrototypeIfNotBuggy = function (o) {
		/* global window */
		if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
			return equalsConstructorPrototype(o);
		}
		try {
			return equalsConstructorPrototype(o);
		} catch (e) {
			return false;
		}
	};

	keysShim = function keys(object) {
		var isObject = object !== null && typeof object === 'object';
		var isFunction = toStr.call(object) === '[object Function]';
		var isArguments = isArgs(object);
		var isString = isObject && toStr.call(object) === '[object String]';
		var theKeys = [];

		if (!isObject && !isFunction && !isArguments) {
			throw new TypeError('Object.keys called on a non-object');
		}

		var skipProto = hasProtoEnumBug && isFunction;
		if (isString && object.length > 0 && !has.call(object, 0)) {
			for (var i = 0; i < object.length; ++i) {
				theKeys.push(String(i));
			}
		}

		if (isArguments && object.length > 0) {
			for (var j = 0; j < object.length; ++j) {
				theKeys.push(String(j));
			}
		} else {
			for (var name in object) {
				if (!(skipProto && name === 'prototype') && has.call(object, name)) {
					theKeys.push(String(name));
				}
			}
		}

		if (hasDontEnumBug) {
			var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);

			for (var k = 0; k < dontEnums.length; ++k) {
				if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
					theKeys.push(dontEnums[k]);
				}
			}
		}
		return theKeys;
	};
}
module.exports = keysShim;


/***/ }),

/***/ 8555:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var slice = Array.prototype.slice;
var isArgs = __webpack_require__(7411);

var origKeys = Object.keys;
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(8541);

var originalKeys = Object.keys;

keysShim.shim = function shimObjectKeys() {
	if (Object.keys) {
		var keysWorksWithArguments = (function () {
			// Safari 5.0 bug
			var args = Object.keys(arguments);
			return args && args.length === arguments.length;
		}(1, 2));
		if (!keysWorksWithArguments) {
			Object.keys = function keys(object) { // eslint-disable-line func-name-matching
				if (isArgs(object)) {
					return originalKeys(slice.call(object));
				}
				return originalKeys(object);
			};
		}
	} else {
		Object.keys = keysShim;
	}
	return Object.keys || keysShim;
};

module.exports = keysShim;


/***/ }),

/***/ 7411:
/***/ (function(module) {

"use strict";


var toStr = Object.prototype.toString;

module.exports = function isArguments(value) {
	var str = toStr.call(value);
	var isArgs = str === '[object Arguments]';
	if (!isArgs) {
		isArgs = str !== '[object Array]' &&
			value !== null &&
			typeof value === 'object' &&
			typeof value.length === 'number' &&
			value.length >= 0 &&
			toStr.call(value.callee) === '[object Function]';
	}
	return isArgs;
};


/***/ }),

/***/ 8745:
/***/ (function(module) {

/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */

var hasElementType = typeof Element !== 'undefined';
var hasMap = typeof Map === 'function';
var hasSet = typeof Set === 'function';
var hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView;

// Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js

function equal(a, b) {
  // START: fast-deep-equal es6/index.js 3.1.3
  if (a === b) return true;

  if (a && b && typeof a == 'object' && typeof b == 'object') {
    if (a.constructor !== b.constructor) return false;

    var length, i, keys;
    if (Array.isArray(a)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (!equal(a[i], b[i])) return false;
      return true;
    }

    // START: Modifications:
    // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code
    //    to co-exist with es5.
    // 2. Replace `for of` with es5 compliant iteration using `for`.
    //    Basically, take:
    //
    //    ```js
    //    for (i of a.entries())
    //      if (!b.has(i[0])) return false;
    //    ```
    //
    //    ... and convert to:
    //
    //    ```js
    //    it = a.entries();
    //    while (!(i = it.next()).done)
    //      if (!b.has(i.value[0])) return false;
    //    ```
    //
    //    **Note**: `i` access switches to `i.value`.
    var it;
    if (hasMap && (a instanceof Map) && (b instanceof Map)) {
      if (a.size !== b.size) return false;
      it = a.entries();
      while (!(i = it.next()).done)
        if (!b.has(i.value[0])) return false;
      it = a.entries();
      while (!(i = it.next()).done)
        if (!equal(i.value[1], b.get(i.value[0]))) return false;
      return true;
    }

    if (hasSet && (a instanceof Set) && (b instanceof Set)) {
      if (a.size !== b.size) return false;
      it = a.entries();
      while (!(i = it.next()).done)
        if (!b.has(i.value[0])) return false;
      return true;
    }
    // END: Modifications

    if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (a[i] !== b[i]) return false;
      return true;
    }

    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
    // START: Modifications:
    // Apply guards for `Object.create(null)` handling. See:
    // - https://github.com/FormidableLabs/react-fast-compare/issues/64
    // - https://github.com/epoberezkin/fast-deep-equal/issues/49
    if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === 'function' && typeof b.valueOf === 'function') return a.valueOf() === b.valueOf();
    if (a.toString !== Object.prototype.toString && typeof a.toString === 'function' && typeof b.toString === 'function') return a.toString() === b.toString();
    // END: Modifications

    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;
    // END: fast-deep-equal

    // START: react-fast-compare
    // custom handling for DOM elements
    if (hasElementType && a instanceof Element) return false;

    // custom handling for React/Preact
    for (i = length; i-- !== 0;) {
      if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {
        // React-specific: avoid traversing React elements' _owner
        // Preact-specific: avoid traversing Preact elements' __v and __o
        //    __v = $_original / $_vnode
        //    __o = $_owner
        // These properties contain circular references and are not needed when
        // comparing the actual elements (and not their owners)
        // .$$typeof and ._store on just reasonable markers of elements

        continue;
      }

      // all other properties should be traversed as usual
      if (!equal(a[keys[i]], b[keys[i]])) return false;
    }
    // END: react-fast-compare

    // START: fast-deep-equal
    return true;
  }

  return a !== a && b !== b;
}
// end fast-deep-equal

module.exports = function isEqual(a, b) {
  try {
    return equal(a, b);
  } catch (error) {
    if (((error.message || '').match(/stack|recursion/i))) {
      // warn on circular references, don't crash
      // browsers give this different errors name and messages:
      // chrome/safari: "RangeError", "Maximum call stack size exceeded"
      // firefox: "InternalError", too much recursion"
      // edge: "Error", "Out of stack space"
      console.warn('react-fast-compare cannot handle circular refs');
      return false;
    }
    // some other error. we should definitely know about these
    throw error;
  }
};


/***/ }),

/***/ 8357:
/***/ (function(__unused_webpack_module, exports) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = format;
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
function toTitleCase(string) {
  return string.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
    if (index > 0 && index + match.length !== title.length && match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" && (title.charAt(index + match.length) !== "-" || title.charAt(index - 1) === "-") && title.charAt(index - 1).search(/[^\s-]/) < 0) {
      return match.toLowerCase();
    }
    if (match.substr(1).search(/[A-Z]|\../) > -1) {
      return match;
    }
    return match.charAt(0).toUpperCase() + match.substr(1);
  });
}

// See if s could be an email address. We don't want to send personal data like email.
// https://support.google.com/analytics/answer/2795983?hl=en
function mightBeEmail(s) {
  // There's no point trying to validate rfc822 fully, just look for ...@...
  return typeof s === "string" && s.indexOf("@") !== -1;
}
var redacted = "REDACTED (Potential Email Address)";
function redactEmail(string) {
  if (mightBeEmail(string)) {
    console.warn("This arg looks like an email address, redacting.");
    return redacted;
  }
  return string;
}
function format() {
  var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  var _str = s || "";
  if (titleCase) {
    _str = toTitleCase(s);
  }
  if (redactingEmail) {
    _str = redactEmail(_str);
  }
  return _str;
}

/***/ }),

/***/ 416:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = exports.GA4 = void 0;
var _gtag = _interopRequireDefault(__webpack_require__(5529));
var _format = _interopRequireDefault(__webpack_require__(8357));
var _excluded = ["eventCategory", "eventAction", "eventLabel", "eventValue", "hitType"],
  _excluded2 = ["title", "location"],
  _excluded3 = ["page", "hitType"];
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(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 _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; }
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
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."); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function ownKeys(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 _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { 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 _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 _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
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, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/*
Links
https://developers.google.com/gtagjs/reference/api
https://developers.google.com/tag-platform/gtagjs/reference
*/
/**
 * @typedef GaOptions
 * @type {Object}
 * @property {boolean} [cookieUpdate=true]
 * @property {number} [cookieExpires=63072000] Default two years
 * @property {string} [cookieDomain="auto"]
 * @property {string} [cookieFlags]
 * @property {string} [userId]
 * @property {string} [clientId]
 * @property {boolean} [anonymizeIp]
 * @property {string} [contentGroup1]
 * @property {string} [contentGroup2]
 * @property {string} [contentGroup3]
 * @property {string} [contentGroup4]
 * @property {string} [contentGroup5]
 * @property {boolean} [allowAdFeatures=true]
 * @property {boolean} [allowAdPersonalizationSignals]
 * @property {boolean} [nonInteraction]
 * @property {string} [page]
 */
/**
 * @typedef UaEventOptions
 * @type {Object}
 * @property {string} action
 * @property {string} category
 * @property {string} [label]
 * @property {number} [value]
 * @property {boolean} [nonInteraction]
 * @property {('beacon'|'xhr'|'image')} [transport]
 */
/**
 * @typedef InitOptions
 * @type {Object}
 * @property {string} trackingId
 * @property {GaOptions|any} [gaOptions]
 * @property {Object} [gtagOptions] New parameter
 */
var GA4 = /*#__PURE__*/function () {
  function GA4() {
    var _this = this;
    _classCallCheck(this, GA4);
    _defineProperty(this, "reset", function () {
      _this.isInitialized = false;
      _this._testMode = false;
      _this._currentMeasurementId;
      _this._hasLoadedGA = false;
      _this._isQueuing = false;
      _this._queueGtag = [];
    });
    _defineProperty(this, "_gtag", function () {
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      if (!_this._testMode) {
        if (_this._isQueuing) {
          _this._queueGtag.push(args);
        } else {
          _gtag["default"].apply(void 0, args);
        }
      } else {
        _this._queueGtag.push(args);
      }
    });
    _defineProperty(this, "_loadGA", function (GA_MEASUREMENT_ID, nonce) {
      var gtagUrl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "https://www.googletagmanager.com/gtag/js";
      if (typeof window === "undefined" || typeof document === "undefined") {
        return;
      }
      if (!_this._hasLoadedGA) {
        // Global Site Tag (gtag.js) - Google Analytics
        var script = document.createElement("script");
        script.async = true;
        script.src = "".concat(gtagUrl, "?id=").concat(GA_MEASUREMENT_ID);
        if (nonce) {
          script.setAttribute("nonce", nonce);
        }
        document.body.appendChild(script);
        window.dataLayer = window.dataLayer || [];
        window.gtag = function gtag() {
          window.dataLayer.push(arguments);
        };
        _this._hasLoadedGA = true;
      }
    });
    _defineProperty(this, "_toGtagOptions", function (gaOptions) {
      if (!gaOptions) {
        return;
      }
      var mapFields = {
        // Old https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#cookieUpdate
        // New https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#cookie_update
        cookieUpdate: "cookie_update",
        cookieExpires: "cookie_expires",
        cookieDomain: "cookie_domain",
        cookieFlags: "cookie_flags",
        // must be in set method?
        userId: "user_id",
        clientId: "client_id",
        anonymizeIp: "anonymize_ip",
        // https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article
        contentGroup1: "content_group1",
        contentGroup2: "content_group2",
        contentGroup3: "content_group3",
        contentGroup4: "content_group4",
        contentGroup5: "content_group5",
        // https://support.google.com/analytics/answer/9050852?hl=en
        allowAdFeatures: "allow_google_signals",
        allowAdPersonalizationSignals: "allow_ad_personalization_signals",
        nonInteraction: "non_interaction",
        page: "page_path",
        hitCallback: "event_callback"
      };
      var gtagOptions = Object.entries(gaOptions).reduce(function (prev, _ref) {
        var _ref2 = _slicedToArray(_ref, 2),
          key = _ref2[0],
          value = _ref2[1];
        if (mapFields[key]) {
          prev[mapFields[key]] = value;
        } else {
          prev[key] = value;
        }
        return prev;
      }, {});
      return gtagOptions;
    });
    _defineProperty(this, "initialize", function (GA_MEASUREMENT_ID) {
      var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      if (!GA_MEASUREMENT_ID) {
        throw new Error("Require GA_MEASUREMENT_ID");
      }
      var initConfigs = typeof GA_MEASUREMENT_ID === "string" ? [{
        trackingId: GA_MEASUREMENT_ID
      }] : GA_MEASUREMENT_ID;
      _this._currentMeasurementId = initConfigs[0].trackingId;
      var gaOptions = options.gaOptions,
        gtagOptions = options.gtagOptions,
        nonce = options.nonce,
        _options$testMode = options.testMode,
        testMode = _options$testMode === void 0 ? false : _options$testMode,
        gtagUrl = options.gtagUrl;
      _this._testMode = testMode;
      if (!testMode) {
        _this._loadGA(_this._currentMeasurementId, nonce, gtagUrl);
      }
      if (!_this.isInitialized) {
        _this._gtag("js", new Date());
        initConfigs.forEach(function (config) {
          var mergedGtagOptions = _objectSpread(_objectSpread(_objectSpread({}, _this._toGtagOptions(_objectSpread(_objectSpread({}, gaOptions), config.gaOptions))), gtagOptions), config.gtagOptions);
          if (Object.keys(mergedGtagOptions).length) {
            _this._gtag("config", config.trackingId, mergedGtagOptions);
          } else {
            _this._gtag("config", config.trackingId);
          }
        });
      }
      _this.isInitialized = true;
      if (!testMode) {
        var queues = _toConsumableArray(_this._queueGtag);
        _this._queueGtag = [];
        _this._isQueuing = false;
        while (queues.length) {
          var queue = queues.shift();
          _this._gtag.apply(_this, _toConsumableArray(queue));
          if (queue[0] === "get") {
            _this._isQueuing = true;
          }
        }
      }
    });
    _defineProperty(this, "set", function (fieldsObject) {
      if (!fieldsObject) {
        console.warn("`fieldsObject` is required in .set()");
        return;
      }
      if (_typeof(fieldsObject) !== "object") {
        console.warn("Expected `fieldsObject` arg to be an Object");
        return;
      }
      if (Object.keys(fieldsObject).length === 0) {
        console.warn("empty `fieldsObject` given to .set()");
      }
      _this._gaCommand("set", fieldsObject);
    });
    _defineProperty(this, "_gaCommandSendEvent", function (eventCategory, eventAction, eventLabel, eventValue, fieldsObject) {
      _this._gtag("event", eventAction, _objectSpread(_objectSpread({
        event_category: eventCategory,
        event_label: eventLabel,
        value: eventValue
      }, fieldsObject && {
        non_interaction: fieldsObject.nonInteraction
      }), _this._toGtagOptions(fieldsObject)));
    });
    _defineProperty(this, "_gaCommandSendEventParameters", function () {
      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        args[_key2] = arguments[_key2];
      }
      if (typeof args[0] === "string") {
        _this._gaCommandSendEvent.apply(_this, _toConsumableArray(args.slice(1)));
      } else {
        var _args$ = args[0],
          eventCategory = _args$.eventCategory,
          eventAction = _args$.eventAction,
          eventLabel = _args$.eventLabel,
          eventValue = _args$.eventValue,
          hitType = _args$.hitType,
          rest = _objectWithoutProperties(_args$, _excluded);
        _this._gaCommandSendEvent(eventCategory, eventAction, eventLabel, eventValue, rest);
      }
    });
    _defineProperty(this, "_gaCommandSendTiming", function (timingCategory, timingVar, timingValue, timingLabel) {
      _this._gtag("event", "timing_complete", {
        name: timingVar,
        value: timingValue,
        event_category: timingCategory,
        event_label: timingLabel
      });
    });
    _defineProperty(this, "_gaCommandSendPageview", function (page, fieldsObject) {
      if (fieldsObject && Object.keys(fieldsObject).length) {
        var _this$_toGtagOptions = _this._toGtagOptions(fieldsObject),
          title = _this$_toGtagOptions.title,
          location = _this$_toGtagOptions.location,
          rest = _objectWithoutProperties(_this$_toGtagOptions, _excluded2);
        _this._gtag("event", "page_view", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, page && {
          page_path: page
        }), title && {
          page_title: title
        }), location && {
          page_location: location
        }), rest));
      } else if (page) {
        _this._gtag("event", "page_view", {
          page_path: page
        });
      } else {
        _this._gtag("event", "page_view");
      }
    });
    _defineProperty(this, "_gaCommandSendPageviewParameters", function () {
      for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
        args[_key3] = arguments[_key3];
      }
      if (typeof args[0] === "string") {
        _this._gaCommandSendPageview.apply(_this, _toConsumableArray(args.slice(1)));
      } else {
        var _args$2 = args[0],
          page = _args$2.page,
          hitType = _args$2.hitType,
          rest = _objectWithoutProperties(_args$2, _excluded3);
        _this._gaCommandSendPageview(page, rest);
      }
    });
    _defineProperty(this, "_gaCommandSend", function () {
      for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
        args[_key4] = arguments[_key4];
      }
      var hitType = typeof args[0] === "string" ? args[0] : args[0].hitType;
      switch (hitType) {
        case "event":
          _this._gaCommandSendEventParameters.apply(_this, args);
          break;
        case "pageview":
          _this._gaCommandSendPageviewParameters.apply(_this, args);
          break;
        case "timing":
          _this._gaCommandSendTiming.apply(_this, _toConsumableArray(args.slice(1)));
          break;
        case "screenview":
        case "transaction":
        case "item":
        case "social":
        case "exception":
          console.warn("Unsupported send command: ".concat(hitType));
          break;
        default:
          console.warn("Send command doesn't exist: ".concat(hitType));
      }
    });
    _defineProperty(this, "_gaCommandSet", function () {
      for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
        args[_key5] = arguments[_key5];
      }
      if (typeof args[0] === "string") {
        args[0] = _defineProperty({}, args[0], args[1]);
      }
      _this._gtag("set", _this._toGtagOptions(args[0]));
    });
    _defineProperty(this, "_gaCommand", function (command) {
      for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
        args[_key6 - 1] = arguments[_key6];
      }
      switch (command) {
        case "send":
          _this._gaCommandSend.apply(_this, args);
          break;
        case "set":
          _this._gaCommandSet.apply(_this, args);
          break;
        default:
          console.warn("Command doesn't exist: ".concat(command));
      }
    });
    _defineProperty(this, "ga", function () {
      for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
        args[_key7] = arguments[_key7];
      }
      if (typeof args[0] === "string") {
        _this._gaCommand.apply(_this, args);
      } else {
        var readyCallback = args[0];
        _this._gtag("get", _this._currentMeasurementId, "client_id", function (clientId) {
          _this._isQueuing = false;
          var queues = _this._queueGtag;
          readyCallback({
            get: function get(property) {
              return property === "clientId" ? clientId : property === "trackingId" ? _this._currentMeasurementId : property === "apiVersion" ? "1" : undefined;
            }
          });
          while (queues.length) {
            var queue = queues.shift();
            _this._gtag.apply(_this, _toConsumableArray(queue));
          }
        });
        _this._isQueuing = true;
      }
      return _this.ga;
    });
    _defineProperty(this, "event", function (optionsOrName, params) {
      if (typeof optionsOrName === "string") {
        _this._gtag("event", optionsOrName, _this._toGtagOptions(params));
      } else {
        var action = optionsOrName.action,
          category = optionsOrName.category,
          label = optionsOrName.label,
          value = optionsOrName.value,
          nonInteraction = optionsOrName.nonInteraction,
          transport = optionsOrName.transport;
        if (!category || !action) {
          console.warn("args.category AND args.action are required in event()");
          return;
        }

        // Required Fields
        var fieldObject = {
          hitType: "event",
          eventCategory: (0, _format["default"])(category),
          eventAction: (0, _format["default"])(action)
        };

        // Optional Fields
        if (label) {
          fieldObject.eventLabel = (0, _format["default"])(label);
        }
        if (typeof value !== "undefined") {
          if (typeof value !== "number") {
            console.warn("Expected `args.value` arg to be a Number.");
          } else {
            fieldObject.eventValue = value;
          }
        }
        if (typeof nonInteraction !== "undefined") {
          if (typeof nonInteraction !== "boolean") {
            console.warn("`args.nonInteraction` must be a boolean.");
          } else {
            fieldObject.nonInteraction = nonInteraction;
          }
        }
        if (typeof transport !== "undefined") {
          if (typeof transport !== "string") {
            console.warn("`args.transport` must be a string.");
          } else {
            if (["beacon", "xhr", "image"].indexOf(transport) === -1) {
              console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`");
            }
            fieldObject.transport = transport;
          }
        }
        _this._gaCommand("send", fieldObject);
      }
    });
    _defineProperty(this, "send", function (fieldObject) {
      _this._gaCommand("send", fieldObject);
    });
    this.reset();
  }
  _createClass(GA4, [{
    key: "gtag",
    value: function gtag() {
      this._gtag.apply(this, arguments);
    }
  }]);
  return GA4;
}();
exports.GA4 = GA4;
var _default = new GA4();
exports["default"] = _default;

/***/ }),

/***/ 5529:
/***/ (function(__unused_webpack_module, exports) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;
var gtag = function gtag() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  if (typeof window !== "undefined") {
    var _window;
    if (typeof window.gtag === "undefined") {
      window.dataLayer = window.dataLayer || [];
      window.gtag = function gtag() {
        window.dataLayer.push(arguments);
      };
    }
    (_window = window).gtag.apply(_window, args);
  }
};
var _default = gtag;
exports["default"] = _default;

/***/ }),

/***/ 7088:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
var __webpack_unused_export__;


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); }
__webpack_unused_export__ = ({
  value: true
});
exports.Ay = __webpack_unused_export__ = void 0;
var _ga = _interopRequireWildcard(__webpack_require__(416));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var ReactGAImplementation = _ga.GA4;
__webpack_unused_export__ = ReactGAImplementation;
var _default = _ga["default"];
exports.Ay = _default;

/***/ }),

/***/ 7604:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var _warn = __webpack_require__(8571);

var _warn2 = _interopRequireDefault(_warn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// https://developers.google.com/tag-manager/quickstart

var Snippets = {
  tags: function tags(_ref) {
    var id = _ref.id,
        events = _ref.events,
        dataLayer = _ref.dataLayer,
        dataLayerName = _ref.dataLayerName,
        preview = _ref.preview,
        auth = _ref.auth;

    var gtm_auth = '&gtm_auth=' + auth;
    var gtm_preview = '&gtm_preview=' + preview;

    if (!id) (0, _warn2.default)('GTM Id is required');

    var iframe = '\n      <iframe src="https://www.googletagmanager.com/ns.html?id=' + id + gtm_auth + gtm_preview + '&gtm_cookies_win=x"\n        height="0" width="0" style="display:none;visibility:hidden" id="tag-manager"></iframe>';

    var script = '\n      (function(w,d,s,l,i){w[l]=w[l]||[];\n        w[l].push({\'gtm.start\': new Date().getTime(),event:\'gtm.js\', ' + JSON.stringify(events).slice(1, -1) + '});\n        var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!=\'dataLayer\'?\'&l=\'+l:\'\';\n        j.async=true;j.src=\'https://www.googletagmanager.com/gtm.js?id=\'+i+dl+\'' + gtm_auth + gtm_preview + '&gtm_cookies_win=x\';\n        f.parentNode.insertBefore(j,f);\n      })(window,document,\'script\',\'' + dataLayerName + '\',\'' + id + '\');';

    var dataLayerVar = this.dataLayer(dataLayer, dataLayerName);

    return {
      iframe: iframe,
      script: script,
      dataLayerVar: dataLayerVar
    };
  },
  dataLayer: function dataLayer(_dataLayer, dataLayerName) {
    return '\n      window.' + dataLayerName + ' = window.' + dataLayerName + ' || [];\n      window.' + dataLayerName + '.push(' + JSON.stringify(_dataLayer) + ')';
  }
};

module.exports = Snippets;

/***/ }),

/***/ 2706:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var _Snippets = __webpack_require__(7604);

var _Snippets2 = _interopRequireDefault(_Snippets);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TagManager = {
  dataScript: function dataScript(dataLayer) {
    var script = document.createElement('script');
    script.innerHTML = dataLayer;
    return script;
  },
  gtm: function gtm(args) {
    var snippets = _Snippets2.default.tags(args);

    var noScript = function noScript() {
      var noscript = document.createElement('noscript');
      noscript.innerHTML = snippets.iframe;
      return noscript;
    };

    var script = function script() {
      var script = document.createElement('script');
      script.innerHTML = snippets.script;
      return script;
    };

    var dataScript = this.dataScript(snippets.dataLayerVar);

    return {
      noScript: noScript,
      script: script,
      dataScript: dataScript
    };
  },
  initialize: function initialize(_ref) {
    var gtmId = _ref.gtmId,
        _ref$events = _ref.events,
        events = _ref$events === undefined ? {} : _ref$events,
        dataLayer = _ref.dataLayer,
        _ref$dataLayerName = _ref.dataLayerName,
        dataLayerName = _ref$dataLayerName === undefined ? 'dataLayer' : _ref$dataLayerName,
        _ref$auth = _ref.auth,
        auth = _ref$auth === undefined ? '' : _ref$auth,
        _ref$preview = _ref.preview,
        preview = _ref$preview === undefined ? '' : _ref$preview;

    var gtm = this.gtm({
      id: gtmId,
      events: events,
      dataLayer: dataLayer || undefined,
      dataLayerName: dataLayerName,
      auth: auth,
      preview: preview
    });
    if (dataLayer) document.head.appendChild(gtm.dataScript);
    document.head.insertBefore(gtm.script(), document.head.childNodes[0]);
    document.body.insertBefore(gtm.noScript(), document.body.childNodes[0]);
  },
  dataLayer: function dataLayer(_ref2) {
    var _dataLayer = _ref2.dataLayer,
        _ref2$dataLayerName = _ref2.dataLayerName,
        dataLayerName = _ref2$dataLayerName === undefined ? 'dataLayer' : _ref2$dataLayerName;

    if (window[dataLayerName]) return window[dataLayerName].push(_dataLayer);
    var snippets = _Snippets2.default.dataLayer(_dataLayer, dataLayerName);
    var dataScript = this.dataScript(snippets);
    document.head.insertBefore(dataScript, document.head.childNodes[0]);
  }
};

module.exports = TagManager;

/***/ }),

/***/ 2201:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var _TagManager = __webpack_require__(2706);

var _TagManager2 = _interopRequireDefault(_TagManager);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = _TagManager2.default;

/***/ }),

/***/ 8571:
/***/ (function(__unused_webpack_module, exports) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
var warn = function warn(s) {
  console.warn('[react-gtm]', s);
};

exports["default"] = warn;

/***/ }),

/***/ 7775:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _reactFastCompare = _interopRequireDefault(__webpack_require__(8745));

var _props = __webpack_require__(2938);

var _utils = __webpack_require__(3273);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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); }

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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SEEK_ON_PLAY_EXPIRY = 5000;

var Player = /*#__PURE__*/function (_Component) {
  _inherits(Player, _Component);

  var _super = _createSuper(Player);

  function Player() {
    var _this;

    _classCallCheck(this, Player);

    for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
      _args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(_args));

    _defineProperty(_assertThisInitialized(_this), "mounted", false);

    _defineProperty(_assertThisInitialized(_this), "isReady", false);

    _defineProperty(_assertThisInitialized(_this), "isPlaying", false);

    _defineProperty(_assertThisInitialized(_this), "isLoading", true);

    _defineProperty(_assertThisInitialized(_this), "loadOnReady", null);

    _defineProperty(_assertThisInitialized(_this), "startOnPlay", true);

    _defineProperty(_assertThisInitialized(_this), "seekOnPlay", null);

    _defineProperty(_assertThisInitialized(_this), "onDurationCalled", false);

    _defineProperty(_assertThisInitialized(_this), "handlePlayerMount", function (player) {
      if (_this.player) {
        _this.progress(); // Ensure onProgress is still called in strict mode


        return; // Return here to prevent loading twice in strict mode
      }

      _this.player = player;

      _this.player.load(_this.props.url);

      _this.progress();
    });

    _defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function (key) {
      if (!_this.player) return null;
      return _this.player[key];
    });

    _defineProperty(_assertThisInitialized(_this), "progress", function () {
      if (_this.props.url && _this.player && _this.isReady) {
        var playedSeconds = _this.getCurrentTime() || 0;

        var loadedSeconds = _this.getSecondsLoaded();

        var duration = _this.getDuration();

        if (duration) {
          var progress = {
            playedSeconds: playedSeconds,
            played: playedSeconds / duration
          };

          if (loadedSeconds !== null) {
            progress.loadedSeconds = loadedSeconds;
            progress.loaded = loadedSeconds / duration;
          } // Only call onProgress if values have changed


          if (progress.playedSeconds !== _this.prevPlayed || progress.loadedSeconds !== _this.prevLoaded) {
            _this.props.onProgress(progress);
          }

          _this.prevPlayed = progress.playedSeconds;
          _this.prevLoaded = progress.loadedSeconds;
        }
      }

      _this.progressTimeout = setTimeout(_this.progress, _this.props.progressFrequency || _this.props.progressInterval);
    });

    _defineProperty(_assertThisInitialized(_this), "handleReady", function () {
      if (!_this.mounted) return;
      _this.isReady = true;
      _this.isLoading = false;
      var _this$props = _this.props,
          onReady = _this$props.onReady,
          playing = _this$props.playing,
          volume = _this$props.volume,
          muted = _this$props.muted;
      onReady();

      if (!muted && volume !== null) {
        _this.player.setVolume(volume);
      }

      if (_this.loadOnReady) {
        _this.player.load(_this.loadOnReady, true);

        _this.loadOnReady = null;
      } else if (playing) {
        _this.player.play();
      }

      _this.handleDurationCheck();
    });

    _defineProperty(_assertThisInitialized(_this), "handlePlay", function () {
      _this.isPlaying = true;
      _this.isLoading = false;
      var _this$props2 = _this.props,
          onStart = _this$props2.onStart,
          onPlay = _this$props2.onPlay,
          playbackRate = _this$props2.playbackRate;

      if (_this.startOnPlay) {
        if (_this.player.setPlaybackRate && playbackRate !== 1) {
          _this.player.setPlaybackRate(playbackRate);
        }

        onStart();
        _this.startOnPlay = false;
      }

      onPlay();

      if (_this.seekOnPlay) {
        _this.seekTo(_this.seekOnPlay);

        _this.seekOnPlay = null;
      }

      _this.handleDurationCheck();
    });

    _defineProperty(_assertThisInitialized(_this), "handlePause", function (e) {
      _this.isPlaying = false;

      if (!_this.isLoading) {
        _this.props.onPause(e);
      }
    });

    _defineProperty(_assertThisInitialized(_this), "handleEnded", function () {
      var _this$props3 = _this.props,
          activePlayer = _this$props3.activePlayer,
          loop = _this$props3.loop,
          onEnded = _this$props3.onEnded;

      if (activePlayer.loopOnEnded && loop) {
        _this.seekTo(0);
      }

      if (!loop) {
        _this.isPlaying = false;
        onEnded();
      }
    });

    _defineProperty(_assertThisInitialized(_this), "handleError", function () {
      var _this$props4;

      _this.isLoading = false;

      (_this$props4 = _this.props).onError.apply(_this$props4, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "handleDurationCheck", function () {
      clearTimeout(_this.durationCheckTimeout);

      var duration = _this.getDuration();

      if (duration) {
        if (!_this.onDurationCalled) {
          _this.props.onDuration(duration);

          _this.onDurationCalled = true;
        }
      } else {
        _this.durationCheckTimeout = setTimeout(_this.handleDurationCheck, 100);
      }
    });

    _defineProperty(_assertThisInitialized(_this), "handleLoaded", function () {
      // Sometimes we know loading has stopped but onReady/onPlay are never called
      // so this provides a way for players to avoid getting stuck
      _this.isLoading = false;
    });

    return _this;
  }

  _createClass(Player, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.mounted = true;
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      clearTimeout(this.progressTimeout);
      clearTimeout(this.durationCheckTimeout);

      if (this.isReady && this.props.stopOnUnmount) {
        this.player.stop();

        if (this.player.disablePIP) {
          this.player.disablePIP();
        }
      }

      this.mounted = false;
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate(prevProps) {
      var _this2 = this;

      // If there isn’t a player available, don’t do anything
      if (!this.player) {
        return;
      } // Invoke player methods based on changed props


      var _this$props5 = this.props,
          url = _this$props5.url,
          playing = _this$props5.playing,
          volume = _this$props5.volume,
          muted = _this$props5.muted,
          playbackRate = _this$props5.playbackRate,
          pip = _this$props5.pip,
          loop = _this$props5.loop,
          activePlayer = _this$props5.activePlayer,
          disableDeferredLoading = _this$props5.disableDeferredLoading;

      if (!(0, _reactFastCompare["default"])(prevProps.url, url)) {
        if (this.isLoading && !activePlayer.forceLoad && !disableDeferredLoading && !(0, _utils.isMediaStream)(url)) {
          console.warn("ReactPlayer: the attempt to load ".concat(url, " is being deferred until the player has loaded"));
          this.loadOnReady = url;
          return;
        }

        this.isLoading = true;
        this.startOnPlay = true;
        this.onDurationCalled = false;
        this.player.load(url, this.isReady);
      }

      if (!prevProps.playing && playing && !this.isPlaying) {
        this.player.play();
      }

      if (prevProps.playing && !playing && this.isPlaying) {
        this.player.pause();
      }

      if (!prevProps.pip && pip && this.player.enablePIP) {
        this.player.enablePIP();
      }

      if (prevProps.pip && !pip && this.player.disablePIP) {
        this.player.disablePIP();
      }

      if (prevProps.volume !== volume && volume !== null) {
        this.player.setVolume(volume);
      }

      if (prevProps.muted !== muted) {
        if (muted) {
          this.player.mute();
        } else {
          this.player.unmute();

          if (volume !== null) {
            // Set volume next tick to fix a bug with DailyMotion
            setTimeout(function () {
              return _this2.player.setVolume(volume);
            });
          }
        }
      }

      if (prevProps.playbackRate !== playbackRate && this.player.setPlaybackRate) {
        this.player.setPlaybackRate(playbackRate);
      }

      if (prevProps.loop !== loop && this.player.setLoop) {
        this.player.setLoop(loop);
      }
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      if (!this.isReady) return null;
      return this.player.getDuration();
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      if (!this.isReady) return null;
      return this.player.getCurrentTime();
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      if (!this.isReady) return null;
      return this.player.getSecondsLoaded();
    }
  }, {
    key: "seekTo",
    value: function seekTo(amount, type, keepPlaying) {
      var _this3 = this;

      // When seeking before player is ready, store value and seek later
      if (!this.isReady) {
        if (amount !== 0) {
          this.seekOnPlay = amount;
          setTimeout(function () {
            _this3.seekOnPlay = null;
          }, SEEK_ON_PLAY_EXPIRY);
        }

        return;
      }

      var isFraction = !type ? amount > 0 && amount < 1 : type === 'fraction';

      if (isFraction) {
        // Convert fraction to seconds based on duration
        var duration = this.player.getDuration();

        if (!duration) {
          console.warn('ReactPlayer: could not seek using fraction – duration not yet available');
          return;
        }

        this.player.seekTo(duration * amount, keepPlaying);
        return;
      }

      this.player.seekTo(amount, keepPlaying);
    }
  }, {
    key: "render",
    value: function render() {
      var Player = this.props.activePlayer;

      if (!Player) {
        return null;
      }

      return /*#__PURE__*/_react["default"].createElement(Player, _extends({}, this.props, {
        onMount: this.handlePlayerMount,
        onReady: this.handleReady,
        onPlay: this.handlePlay,
        onPause: this.handlePause,
        onEnded: this.handleEnded,
        onLoaded: this.handleLoaded,
        onError: this.handleError
      }));
    }
  }]);

  return Player;
}(_react.Component);

exports["default"] = Player;

_defineProperty(Player, "displayName", 'Player');

_defineProperty(Player, "propTypes", _props.propTypes);

_defineProperty(Player, "defaultProps", _props.defaultProps);

/***/ }),

/***/ 6476:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _objectSpread(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 _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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var ICON_SIZE = '64px';
var cache = {};

var Preview = /*#__PURE__*/function (_Component) {
  _inherits(Preview, _Component);

  var _super = _createSuper(Preview);

  function Preview() {
    var _this;

    _classCallCheck(this, Preview);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "mounted", false);

    _defineProperty(_assertThisInitialized(_this), "state", {
      image: null
    });

    _defineProperty(_assertThisInitialized(_this), "handleKeyPress", function (e) {
      if (e.key === 'Enter' || e.key === ' ') {
        _this.props.onClick();
      }
    });

    return _this;
  }

  _createClass(Preview, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.mounted = true;
      this.fetchImage(this.props);
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate(prevProps) {
      var _this$props = this.props,
          url = _this$props.url,
          light = _this$props.light;

      if (prevProps.url !== url || prevProps.light !== light) {
        this.fetchImage(this.props);
      }
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.mounted = false;
    }
  }, {
    key: "fetchImage",
    value: function fetchImage(_ref) {
      var _this2 = this;

      var url = _ref.url,
          light = _ref.light,
          oEmbedUrl = _ref.oEmbedUrl;

      if ( /*#__PURE__*/_react["default"].isValidElement(light)) {
        return;
      }

      if (typeof light === 'string') {
        this.setState({
          image: light
        });
        return;
      }

      if (cache[url]) {
        this.setState({
          image: cache[url]
        });
        return;
      }

      this.setState({
        image: null
      });
      return window.fetch(oEmbedUrl.replace('{url}', url)).then(function (response) {
        return response.json();
      }).then(function (data) {
        if (data.thumbnail_url && _this2.mounted) {
          var image = data.thumbnail_url.replace('height=100', 'height=480').replace('-d_295x166', '-d_640');

          _this2.setState({
            image: image
          });

          cache[url] = image;
        }
      });
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props2 = this.props,
          light = _this$props2.light,
          onClick = _this$props2.onClick,
          playIcon = _this$props2.playIcon,
          previewTabIndex = _this$props2.previewTabIndex;
      var image = this.state.image;

      var isElement = /*#__PURE__*/_react["default"].isValidElement(light);

      var flexCenter = {
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center'
      };
      var styles = {
        preview: _objectSpread({
          width: '100%',
          height: '100%',
          backgroundImage: image && !isElement ? "url(".concat(image, ")") : undefined,
          backgroundSize: 'cover',
          backgroundPosition: 'center',
          cursor: 'pointer'
        }, flexCenter),
        shadow: _objectSpread({
          background: 'radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)',
          borderRadius: ICON_SIZE,
          width: ICON_SIZE,
          height: ICON_SIZE,
          position: isElement ? 'absolute' : undefined
        }, flexCenter),
        playIcon: {
          borderStyle: 'solid',
          borderWidth: '16px 0 16px 26px',
          borderColor: 'transparent transparent transparent white',
          marginLeft: '7px'
        }
      };

      var defaultPlayIcon = /*#__PURE__*/_react["default"].createElement("div", {
        style: styles.shadow,
        className: "react-player__shadow"
      }, /*#__PURE__*/_react["default"].createElement("div", {
        style: styles.playIcon,
        className: "react-player__play-icon"
      }));

      return /*#__PURE__*/_react["default"].createElement("div", {
        style: styles.preview,
        className: "react-player__preview",
        onClick: onClick,
        tabIndex: previewTabIndex,
        onKeyPress: this.handleKeyPress
      }, isElement ? light : null, playIcon || defaultPlayIcon);
    }
  }]);

  return Preview;
}(_react.Component);

exports["default"] = Preview;

/***/ }),

/***/ 6770:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.createReactPlayer = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _deepmerge = _interopRequireDefault(__webpack_require__(3938));

var _memoizeOne = _interopRequireDefault(__webpack_require__(3097));

var _reactFastCompare = _interopRequireDefault(__webpack_require__(8745));

var _props = __webpack_require__(2938);

var _utils = __webpack_require__(3273);

var _Player3 = _interopRequireDefault(__webpack_require__(7775));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

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 _objectSpread(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 _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); }

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

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."); }

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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }

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 _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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var Preview = /*#__PURE__*/(0, _react.lazy)(function () {
  return Promise.resolve().then(function () {
    return _interopRequireWildcard(__webpack_require__(6476));
  });
});
var IS_BROWSER = typeof window !== 'undefined' && window.document;
var IS_GLOBAL = typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.window && __webpack_require__.g.window.document;
var SUPPORTED_PROPS = Object.keys(_props.propTypes); // Return null when rendering on the server
// as Suspense is not supported yet

var UniversalSuspense = IS_BROWSER || IS_GLOBAL ? _react.Suspense : function () {
  return null;
};
var customPlayers = [];

var createReactPlayer = function createReactPlayer(players, fallback) {
  var _class, _temp;

  return _temp = _class = /*#__PURE__*/function (_Component) {
    _inherits(ReactPlayer, _Component);

    var _super = _createSuper(ReactPlayer);

    function ReactPlayer() {
      var _this;

      _classCallCheck(this, ReactPlayer);

      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }

      _this = _super.call.apply(_super, [this].concat(args));

      _defineProperty(_assertThisInitialized(_this), "state", {
        showPreview: !!_this.props.light
      });

      _defineProperty(_assertThisInitialized(_this), "references", {
        wrapper: function wrapper(_wrapper) {
          _this.wrapper = _wrapper;
        },
        player: function player(_player) {
          _this.player = _player;
        }
      });

      _defineProperty(_assertThisInitialized(_this), "handleClickPreview", function (e) {
        _this.setState({
          showPreview: false
        });

        _this.props.onClickPreview(e);
      });

      _defineProperty(_assertThisInitialized(_this), "showPreview", function () {
        _this.setState({
          showPreview: true
        });
      });

      _defineProperty(_assertThisInitialized(_this), "getDuration", function () {
        if (!_this.player) return null;
        return _this.player.getDuration();
      });

      _defineProperty(_assertThisInitialized(_this), "getCurrentTime", function () {
        if (!_this.player) return null;
        return _this.player.getCurrentTime();
      });

      _defineProperty(_assertThisInitialized(_this), "getSecondsLoaded", function () {
        if (!_this.player) return null;
        return _this.player.getSecondsLoaded();
      });

      _defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function () {
        var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';
        if (!_this.player) return null;
        return _this.player.getInternalPlayer(key);
      });

      _defineProperty(_assertThisInitialized(_this), "seekTo", function (fraction, type, keepPlaying) {
        if (!_this.player) return null;

        _this.player.seekTo(fraction, type, keepPlaying);
      });

      _defineProperty(_assertThisInitialized(_this), "handleReady", function () {
        _this.props.onReady(_assertThisInitialized(_this));
      });

      _defineProperty(_assertThisInitialized(_this), "getActivePlayer", (0, _memoizeOne["default"])(function (url) {
        for (var _i = 0, _arr = [].concat(customPlayers, _toConsumableArray(players)); _i < _arr.length; _i++) {
          var player = _arr[_i];

          if (player.canPlay(url)) {
            return player;
          }
        }

        if (fallback) {
          return fallback;
        }

        return null;
      }));

      _defineProperty(_assertThisInitialized(_this), "getConfig", (0, _memoizeOne["default"])(function (url, key) {
        var config = _this.props.config;
        return _deepmerge["default"].all([_props.defaultProps.config, _props.defaultProps.config[key] || {}, config, config[key] || {}]);
      }));

      _defineProperty(_assertThisInitialized(_this), "getAttributes", (0, _memoizeOne["default"])(function (url) {
        return (0, _utils.omit)(_this.props, SUPPORTED_PROPS);
      }));

      _defineProperty(_assertThisInitialized(_this), "renderActivePlayer", function (url) {
        if (!url) return null;

        var player = _this.getActivePlayer(url);

        if (!player) return null;

        var config = _this.getConfig(url, player.key);

        return /*#__PURE__*/_react["default"].createElement(_Player3["default"], _extends({}, _this.props, {
          key: player.key,
          ref: _this.references.player,
          config: config,
          activePlayer: player.lazyPlayer || player,
          onReady: _this.handleReady
        }));
      });

      return _this;
    }

    _createClass(ReactPlayer, [{
      key: "shouldComponentUpdate",
      value: function shouldComponentUpdate(nextProps, nextState) {
        return !(0, _reactFastCompare["default"])(this.props, nextProps) || !(0, _reactFastCompare["default"])(this.state, nextState);
      }
    }, {
      key: "componentDidUpdate",
      value: function componentDidUpdate(prevProps) {
        var light = this.props.light;

        if (!prevProps.light && light) {
          this.setState({
            showPreview: true
          });
        }

        if (prevProps.light && !light) {
          this.setState({
            showPreview: false
          });
        }
      }
    }, {
      key: "renderPreview",
      value: function renderPreview(url) {
        if (!url) return null;
        var _this$props = this.props,
            light = _this$props.light,
            playIcon = _this$props.playIcon,
            previewTabIndex = _this$props.previewTabIndex,
            oEmbedUrl = _this$props.oEmbedUrl;
        return /*#__PURE__*/_react["default"].createElement(Preview, {
          url: url,
          light: light,
          playIcon: playIcon,
          previewTabIndex: previewTabIndex,
          oEmbedUrl: oEmbedUrl,
          onClick: this.handleClickPreview
        });
      }
    }, {
      key: "render",
      value: function render() {
        var _this$props2 = this.props,
            url = _this$props2.url,
            style = _this$props2.style,
            width = _this$props2.width,
            height = _this$props2.height,
            fallback = _this$props2.fallback,
            Wrapper = _this$props2.wrapper;
        var showPreview = this.state.showPreview;
        var attributes = this.getAttributes(url);
        var wrapperRef = typeof Wrapper === 'string' ? this.references.wrapper : undefined;
        return /*#__PURE__*/_react["default"].createElement(Wrapper, _extends({
          ref: wrapperRef,
          style: _objectSpread(_objectSpread({}, style), {}, {
            width: width,
            height: height
          })
        }, attributes), /*#__PURE__*/_react["default"].createElement(UniversalSuspense, {
          fallback: fallback
        }, showPreview ? this.renderPreview(url) : this.renderActivePlayer(url)));
      }
    }]);

    return ReactPlayer;
  }(_react.Component), _defineProperty(_class, "displayName", 'ReactPlayer'), _defineProperty(_class, "propTypes", _props.propTypes), _defineProperty(_class, "defaultProps", _props.defaultProps), _defineProperty(_class, "addCustomPlayer", function (player) {
    customPlayers.push(player);
  }), _defineProperty(_class, "removeCustomPlayers", function () {
    customPlayers.length = 0;
  }), _defineProperty(_class, "canPlay", function (url) {
    for (var _i2 = 0, _arr2 = [].concat(customPlayers, _toConsumableArray(players)); _i2 < _arr2.length; _i2++) {
      var _Player = _arr2[_i2];

      if (_Player.canPlay(url)) {
        return true;
      }
    }

    return false;
  }), _defineProperty(_class, "canEnablePIP", function (url) {
    for (var _i3 = 0, _arr3 = [].concat(customPlayers, _toConsumableArray(players)); _i3 < _arr3.length; _i3++) {
      var _Player2 = _arr3[_i3];

      if (_Player2.canEnablePIP && _Player2.canEnablePIP(url)) {
        return true;
      }
    }

    return false;
  }), _temp;
};

exports.createReactPlayer = createReactPlayer;

/***/ }),

/***/ 6880:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
var __webpack_unused_export__;


__webpack_unused_export__ = ({
  value: true
});
exports.A = void 0;

var _players = _interopRequireDefault(__webpack_require__(8105));

var _ReactPlayer = __webpack_require__(6770);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

// Fall back to FilePlayer if nothing else can play the URL
var fallback = _players["default"][_players["default"].length - 1];

var _default = (0, _ReactPlayer.createReactPlayer)(_players["default"], fallback);

exports.A = _default;

/***/ }),

/***/ 9257:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.canPlay = exports.FLV_EXTENSIONS = exports.DASH_EXTENSIONS = exports.HLS_EXTENSIONS = exports.VIDEO_EXTENSIONS = exports.AUDIO_EXTENSIONS = exports.MATCH_URL_KALTURA = exports.MATCH_URL_VIDYARD = exports.MATCH_URL_MIXCLOUD = exports.MATCH_URL_DAILYMOTION = exports.MATCH_URL_TWITCH_CHANNEL = exports.MATCH_URL_TWITCH_VIDEO = exports.MATCH_URL_WISTIA = exports.MATCH_URL_STREAMABLE = exports.MATCH_URL_FACEBOOK_WATCH = exports.MATCH_URL_FACEBOOK = exports.MATCH_URL_VIMEO = exports.MATCH_URL_SOUNDCLOUD = exports.MATCH_URL_YOUTUBE = void 0;

var _utils = __webpack_require__(3273);

function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }

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; }

var MATCH_URL_YOUTUBE = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//;
exports.MATCH_URL_YOUTUBE = MATCH_URL_YOUTUBE;
var MATCH_URL_SOUNDCLOUD = /(?:soundcloud\.com|snd\.sc)\/[^.]+$/;
exports.MATCH_URL_SOUNDCLOUD = MATCH_URL_SOUNDCLOUD;
var MATCH_URL_VIMEO = /vimeo\.com\/(?!progressive_redirect).+/;
exports.MATCH_URL_VIMEO = MATCH_URL_VIMEO;
var MATCH_URL_FACEBOOK = /^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/;
exports.MATCH_URL_FACEBOOK = MATCH_URL_FACEBOOK;
var MATCH_URL_FACEBOOK_WATCH = /^https?:\/\/fb\.watch\/.+$/;
exports.MATCH_URL_FACEBOOK_WATCH = MATCH_URL_FACEBOOK_WATCH;
var MATCH_URL_STREAMABLE = /streamable\.com\/([a-z0-9]+)$/;
exports.MATCH_URL_STREAMABLE = MATCH_URL_STREAMABLE;
var MATCH_URL_WISTIA = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/;
exports.MATCH_URL_WISTIA = MATCH_URL_WISTIA;
var MATCH_URL_TWITCH_VIDEO = /(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/;
exports.MATCH_URL_TWITCH_VIDEO = MATCH_URL_TWITCH_VIDEO;
var MATCH_URL_TWITCH_CHANNEL = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/;
exports.MATCH_URL_TWITCH_CHANNEL = MATCH_URL_TWITCH_CHANNEL;
var MATCH_URL_DAILYMOTION = /^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/;
exports.MATCH_URL_DAILYMOTION = MATCH_URL_DAILYMOTION;
var MATCH_URL_MIXCLOUD = /mixcloud\.com\/([^/]+\/[^/]+)/;
exports.MATCH_URL_MIXCLOUD = MATCH_URL_MIXCLOUD;
var MATCH_URL_VIDYARD = /vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/;
exports.MATCH_URL_VIDYARD = MATCH_URL_VIDYARD;
var MATCH_URL_KALTURA = /^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/;
exports.MATCH_URL_KALTURA = MATCH_URL_KALTURA;
var AUDIO_EXTENSIONS = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
exports.AUDIO_EXTENSIONS = AUDIO_EXTENSIONS;
var VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i;
exports.VIDEO_EXTENSIONS = VIDEO_EXTENSIONS;
var HLS_EXTENSIONS = /\.(m3u8)($|\?)/i;
exports.HLS_EXTENSIONS = HLS_EXTENSIONS;
var DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
exports.DASH_EXTENSIONS = DASH_EXTENSIONS;
var FLV_EXTENSIONS = /\.(flv)($|\?)/i;
exports.FLV_EXTENSIONS = FLV_EXTENSIONS;

var canPlayFile = function canPlayFile(url) {
  if (url instanceof Array) {
    var _iterator = _createForOfIteratorHelper(url),
        _step;

    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var item = _step.value;

        if (typeof item === 'string' && canPlayFile(item)) {
          return true;
        }

        if (canPlayFile(item.src)) {
          return true;
        }
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }

    return false;
  }

  if ((0, _utils.isMediaStream)(url) || (0, _utils.isBlobUrl)(url)) {
    return true;
  }

  return AUDIO_EXTENSIONS.test(url) || VIDEO_EXTENSIONS.test(url) || HLS_EXTENSIONS.test(url) || DASH_EXTENSIONS.test(url) || FLV_EXTENSIONS.test(url);
};

var canPlay = {
  youtube: function youtube(url) {
    if (url instanceof Array) {
      return url.every(function (item) {
        return MATCH_URL_YOUTUBE.test(item);
      });
    }

    return MATCH_URL_YOUTUBE.test(url);
  },
  soundcloud: function soundcloud(url) {
    return MATCH_URL_SOUNDCLOUD.test(url) && !AUDIO_EXTENSIONS.test(url);
  },
  vimeo: function vimeo(url) {
    return MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url);
  },
  facebook: function facebook(url) {
    return MATCH_URL_FACEBOOK.test(url) || MATCH_URL_FACEBOOK_WATCH.test(url);
  },
  streamable: function streamable(url) {
    return MATCH_URL_STREAMABLE.test(url);
  },
  wistia: function wistia(url) {
    return MATCH_URL_WISTIA.test(url);
  },
  twitch: function twitch(url) {
    return MATCH_URL_TWITCH_VIDEO.test(url) || MATCH_URL_TWITCH_CHANNEL.test(url);
  },
  dailymotion: function dailymotion(url) {
    return MATCH_URL_DAILYMOTION.test(url);
  },
  mixcloud: function mixcloud(url) {
    return MATCH_URL_MIXCLOUD.test(url);
  },
  vidyard: function vidyard(url) {
    return MATCH_URL_VIDYARD.test(url);
  },
  kaltura: function kaltura(url) {
    return MATCH_URL_KALTURA.test(url);
  },
  file: canPlayFile
};
exports.canPlay = canPlay;

/***/ }),

/***/ 8630:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _objectSpread(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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { 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 _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 _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 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 _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://api.dmcdn.net/all.js';
var SDK_GLOBAL = 'DM';
var SDK_GLOBAL_READY = 'dmAsyncInit';

var DailyMotion = /*#__PURE__*/function (_Component) {
  _inherits(DailyMotion, _Component);

  var _super = _createSuper(DailyMotion);

  function DailyMotion() {
    var _this;

    _classCallCheck(this, DailyMotion);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "onDurationChange", function () {
      var duration = _this.getDuration();

      _this.props.onDuration(duration);
    });

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.callPlayer('setMuted', true);
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      _this.callPlayer('setMuted', false);
    });

    _defineProperty(_assertThisInitialized(_this), "ref", function (container) {
      _this.container = container;
    });

    return _this;
  }

  _createClass(DailyMotion, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "load",
    value: function load(url) {
      var _this2 = this;

      var _this$props = this.props,
          controls = _this$props.controls,
          config = _this$props.config,
          onError = _this$props.onError,
          playing = _this$props.playing;

      var _url$match = url.match(_patterns.MATCH_URL_DAILYMOTION),
          _url$match2 = _slicedToArray(_url$match, 2),
          id = _url$match2[1];

      if (this.player) {
        this.player.load(id, {
          start: (0, _utils.parseStartTime)(url),
          autoplay: playing
        });
        return;
      }

      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (DM) {
        return DM.player;
      }).then(function (DM) {
        if (!_this2.container) return;
        var Player = DM.player;
        _this2.player = new Player(_this2.container, {
          width: '100%',
          height: '100%',
          video: id,
          params: _objectSpread({
            controls: controls,
            autoplay: _this2.props.playing,
            mute: _this2.props.muted,
            start: (0, _utils.parseStartTime)(url),
            origin: window.location.origin
          }, config.params),
          events: {
            apiready: _this2.props.onReady,
            seeked: function seeked() {
              return _this2.props.onSeek(_this2.player.currentTime);
            },
            video_end: _this2.props.onEnded,
            durationchange: _this2.onDurationChange,
            pause: _this2.props.onPause,
            playing: _this2.props.onPlay,
            waiting: _this2.props.onBuffer,
            error: function error(event) {
              return onError(event);
            }
          }
        });
      }, onError);
    }
  }, {
    key: "play",
    value: function play() {
      this.callPlayer('play');
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pause');
    }
  }, {
    key: "stop",
    value: function stop() {// Nothing to do
    }
  }, {
    key: "seekTo",
    value: function seekTo(seconds) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.callPlayer('seek', seconds);

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.callPlayer('setVolume', fraction);
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.player.duration || null;
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.player.currentTime;
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return this.player.bufferedTime;
    }
  }, {
    key: "render",
    value: function render() {
      var display = this.props.display;
      var style = {
        width: '100%',
        height: '100%',
        display: display
      };
      return /*#__PURE__*/_react["default"].createElement("div", {
        style: style
      }, /*#__PURE__*/_react["default"].createElement("div", {
        ref: this.ref
      }));
    }
  }]);

  return DailyMotion;
}(_react.Component);

exports["default"] = DailyMotion;

_defineProperty(DailyMotion, "displayName", 'DailyMotion');

_defineProperty(DailyMotion, "canPlay", _patterns.canPlay.dailymotion);

_defineProperty(DailyMotion, "loopOnEnded", true);

/***/ }),

/***/ 1481:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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); }

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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://connect.facebook.net/en_US/sdk.js';
var SDK_GLOBAL = 'FB';
var SDK_GLOBAL_READY = 'fbAsyncInit';
var PLAYER_ID_PREFIX = 'facebook-player-';

var Facebook = /*#__PURE__*/function (_Component) {
  _inherits(Facebook, _Component);

  var _super = _createSuper(Facebook);

  function Facebook() {
    var _this;

    _classCallCheck(this, Facebook);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "playerID", _this.props.config.playerId || "".concat(PLAYER_ID_PREFIX).concat((0, _utils.randomString)()));

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.callPlayer('mute');
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      _this.callPlayer('unmute');
    });

    return _this;
  }

  _createClass(Facebook, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "load",
    value: function load(url, isReady) {
      var _this2 = this;

      if (isReady) {
        (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {
          return FB.XFBML.parse();
        });
        return;
      }

      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {
        FB.init({
          appId: _this2.props.config.appId,
          xfbml: true,
          version: _this2.props.config.version
        });
        FB.Event.subscribe('xfbml.render', function (msg) {
          // Here we know the SDK has loaded, even if onReady/onPlay
          // is not called due to a video that cannot be embedded
          _this2.props.onLoaded();
        });
        FB.Event.subscribe('xfbml.ready', function (msg) {
          if (msg.type === 'video' && msg.id === _this2.playerID) {
            _this2.player = msg.instance;

            _this2.player.subscribe('startedPlaying', _this2.props.onPlay);

            _this2.player.subscribe('paused', _this2.props.onPause);

            _this2.player.subscribe('finishedPlaying', _this2.props.onEnded);

            _this2.player.subscribe('startedBuffering', _this2.props.onBuffer);

            _this2.player.subscribe('finishedBuffering', _this2.props.onBufferEnd);

            _this2.player.subscribe('error', _this2.props.onError);

            if (_this2.props.muted) {
              _this2.callPlayer('mute');
            } else {
              _this2.callPlayer('unmute');
            }

            _this2.props.onReady(); // For some reason Facebook have added `visibility: hidden`
            // to the iframe when autoplay fails, so here we set it back


            document.getElementById(_this2.playerID).querySelector('iframe').style.visibility = 'visible';
          }
        });
      });
    }
  }, {
    key: "play",
    value: function play() {
      this.callPlayer('play');
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pause');
    }
  }, {
    key: "stop",
    value: function stop() {// Nothing to do
    }
  }, {
    key: "seekTo",
    value: function seekTo(seconds) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.callPlayer('seek', seconds);

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.callPlayer('setVolume', fraction);
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.callPlayer('getDuration');
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.callPlayer('getCurrentPosition');
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return null;
    }
  }, {
    key: "render",
    value: function render() {
      var attributes = this.props.config.attributes;
      var style = {
        width: '100%',
        height: '100%'
      };
      return /*#__PURE__*/_react["default"].createElement("div", _extends({
        style: style,
        id: this.playerID,
        className: "fb-video",
        "data-href": this.props.url,
        "data-autoplay": this.props.playing ? 'true' : 'false',
        "data-allowfullscreen": "true",
        "data-controls": this.props.controls ? 'true' : 'false'
      }, attributes));
    }
  }]);

  return Facebook;
}(_react.Component);

exports["default"] = Facebook;

_defineProperty(Facebook, "displayName", 'Facebook');

_defineProperty(Facebook, "canPlay", _patterns.canPlay.facebook);

_defineProperty(Facebook, "loopOnEnded", true);

/***/ }),

/***/ 4466:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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); }

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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var HAS_NAVIGATOR = typeof navigator !== 'undefined';
var IS_IPAD_PRO = HAS_NAVIGATOR && navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;
var IS_IOS = HAS_NAVIGATOR && (/iPad|iPhone|iPod/.test(navigator.userAgent) || IS_IPAD_PRO) && !window.MSStream;
var IS_SAFARI = HAS_NAVIGATOR && /^((?!chrome|android).)*safari/i.test(navigator.userAgent) && !window.MSStream;
var HLS_SDK_URL = 'https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js';
var HLS_GLOBAL = 'Hls';
var DASH_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js';
var DASH_GLOBAL = 'dashjs';
var FLV_SDK_URL = 'https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js';
var FLV_GLOBAL = 'flvjs';
var MATCH_DROPBOX_URL = /www\.dropbox\.com\/.+/;
var MATCH_CLOUDFLARE_STREAM = /https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/;
var REPLACE_CLOUDFLARE_STREAM = 'https://videodelivery.net/{id}/manifest/video.m3u8';

var FilePlayer = /*#__PURE__*/function (_Component) {
  _inherits(FilePlayer, _Component);

  var _super = _createSuper(FilePlayer);

  function FilePlayer() {
    var _this;

    _classCallCheck(this, FilePlayer);

    for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
      _args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(_args));

    _defineProperty(_assertThisInitialized(_this), "onReady", function () {
      var _this$props;

      return (_this$props = _this.props).onReady.apply(_this$props, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onPlay", function () {
      var _this$props2;

      return (_this$props2 = _this.props).onPlay.apply(_this$props2, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onBuffer", function () {
      var _this$props3;

      return (_this$props3 = _this.props).onBuffer.apply(_this$props3, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onBufferEnd", function () {
      var _this$props4;

      return (_this$props4 = _this.props).onBufferEnd.apply(_this$props4, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onPause", function () {
      var _this$props5;

      return (_this$props5 = _this.props).onPause.apply(_this$props5, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onEnded", function () {
      var _this$props6;

      return (_this$props6 = _this.props).onEnded.apply(_this$props6, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onError", function () {
      var _this$props7;

      return (_this$props7 = _this.props).onError.apply(_this$props7, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onPlayBackRateChange", function (event) {
      return _this.props.onPlaybackRateChange(event.target.playbackRate);
    });

    _defineProperty(_assertThisInitialized(_this), "onEnablePIP", function () {
      var _this$props8;

      return (_this$props8 = _this.props).onEnablePIP.apply(_this$props8, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onDisablePIP", function (e) {
      var _this$props9 = _this.props,
          onDisablePIP = _this$props9.onDisablePIP,
          playing = _this$props9.playing;
      onDisablePIP(e);

      if (playing) {
        _this.play();
      }
    });

    _defineProperty(_assertThisInitialized(_this), "onPresentationModeChange", function (e) {
      if (_this.player && (0, _utils.supportsWebKitPresentationMode)(_this.player)) {
        var webkitPresentationMode = _this.player.webkitPresentationMode;

        if (webkitPresentationMode === 'picture-in-picture') {
          _this.onEnablePIP(e);
        } else if (webkitPresentationMode === 'inline') {
          _this.onDisablePIP(e);
        }
      }
    });

    _defineProperty(_assertThisInitialized(_this), "onSeek", function (e) {
      _this.props.onSeek(e.target.currentTime);
    });

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.player.muted = true;
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      _this.player.muted = false;
    });

    _defineProperty(_assertThisInitialized(_this), "renderSourceElement", function (source, index) {
      if (typeof source === 'string') {
        return /*#__PURE__*/_react["default"].createElement("source", {
          key: index,
          src: source
        });
      }

      return /*#__PURE__*/_react["default"].createElement("source", _extends({
        key: index
      }, source));
    });

    _defineProperty(_assertThisInitialized(_this), "renderTrack", function (track, index) {
      return /*#__PURE__*/_react["default"].createElement("track", _extends({
        key: index
      }, track));
    });

    _defineProperty(_assertThisInitialized(_this), "ref", function (player) {
      if (_this.player) {
        // Store previous player to be used by removeListeners()
        _this.prevPlayer = _this.player;
      }

      _this.player = player;
    });

    return _this;
  }

  _createClass(FilePlayer, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
      this.addListeners(this.player);
      var src = this.getSource(this.props.url); // Ensure src is set in strict mode

      if (src) {
        this.player.src = src;
      }

      if (IS_IOS || this.props.config.forceDisableHls) {
        this.player.load();
      }
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate(prevProps) {
      if (this.shouldUseAudio(this.props) !== this.shouldUseAudio(prevProps)) {
        this.removeListeners(this.prevPlayer, prevProps.url);
        this.addListeners(this.player);
      }

      if (this.props.url !== prevProps.url && !(0, _utils.isMediaStream)(this.props.url) && !(this.props.url instanceof Array) // Avoid infinite loop
      ) {
          this.player.srcObject = null;
        }
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.player.removeAttribute('src');
      this.removeListeners(this.player);

      if (this.hls) {
        this.hls.destroy();
      }
    }
  }, {
    key: "addListeners",
    value: function addListeners(player) {
      var _this$props10 = this.props,
          url = _this$props10.url,
          playsinline = _this$props10.playsinline;
      player.addEventListener('play', this.onPlay);
      player.addEventListener('waiting', this.onBuffer);
      player.addEventListener('playing', this.onBufferEnd);
      player.addEventListener('pause', this.onPause);
      player.addEventListener('seeked', this.onSeek);
      player.addEventListener('ended', this.onEnded);
      player.addEventListener('error', this.onError);
      player.addEventListener('ratechange', this.onPlayBackRateChange);
      player.addEventListener('enterpictureinpicture', this.onEnablePIP);
      player.addEventListener('leavepictureinpicture', this.onDisablePIP);
      player.addEventListener('webkitpresentationmodechanged', this.onPresentationModeChange);

      if (!this.shouldUseHLS(url)) {
        // onReady is handled by hls.js
        player.addEventListener('canplay', this.onReady);
      }

      if (playsinline) {
        player.setAttribute('playsinline', '');
        player.setAttribute('webkit-playsinline', '');
        player.setAttribute('x5-playsinline', '');
      }
    }
  }, {
    key: "removeListeners",
    value: function removeListeners(player, url) {
      player.removeEventListener('canplay', this.onReady);
      player.removeEventListener('play', this.onPlay);
      player.removeEventListener('waiting', this.onBuffer);
      player.removeEventListener('playing', this.onBufferEnd);
      player.removeEventListener('pause', this.onPause);
      player.removeEventListener('seeked', this.onSeek);
      player.removeEventListener('ended', this.onEnded);
      player.removeEventListener('error', this.onError);
      player.removeEventListener('ratechange', this.onPlayBackRateChange);
      player.removeEventListener('enterpictureinpicture', this.onEnablePIP);
      player.removeEventListener('leavepictureinpicture', this.onDisablePIP);
      player.removeEventListener('webkitpresentationmodechanged', this.onPresentationModeChange);

      if (!this.shouldUseHLS(url)) {
        // onReady is handled by hls.js
        player.removeEventListener('canplay', this.onReady);
      }
    } // Proxy methods to prevent listener leaks

  }, {
    key: "shouldUseAudio",
    value: function shouldUseAudio(props) {
      if (props.config.forceVideo) {
        return false;
      }

      if (props.config.attributes.poster) {
        return false; // Use <video> so that poster is shown
      }

      return _patterns.AUDIO_EXTENSIONS.test(props.url) || props.config.forceAudio;
    }
  }, {
    key: "shouldUseHLS",
    value: function shouldUseHLS(url) {
      if (IS_SAFARI && this.props.config.forceSafariHLS || this.props.config.forceHLS) {
        return true;
      }

      if (IS_IOS || this.props.config.forceDisableHls) {
        return false;
      }

      return _patterns.HLS_EXTENSIONS.test(url) || MATCH_CLOUDFLARE_STREAM.test(url);
    }
  }, {
    key: "shouldUseDASH",
    value: function shouldUseDASH(url) {
      return _patterns.DASH_EXTENSIONS.test(url) || this.props.config.forceDASH;
    }
  }, {
    key: "shouldUseFLV",
    value: function shouldUseFLV(url) {
      return _patterns.FLV_EXTENSIONS.test(url) || this.props.config.forceFLV;
    }
  }, {
    key: "load",
    value: function load(url) {
      var _this2 = this;

      var _this$props$config = this.props.config,
          hlsVersion = _this$props$config.hlsVersion,
          hlsOptions = _this$props$config.hlsOptions,
          dashVersion = _this$props$config.dashVersion,
          flvVersion = _this$props$config.flvVersion;

      if (this.hls) {
        this.hls.destroy();
      }

      if (this.dash) {
        this.dash.reset();
      }

      if (this.shouldUseHLS(url)) {
        (0, _utils.getSDK)(HLS_SDK_URL.replace('VERSION', hlsVersion), HLS_GLOBAL).then(function (Hls) {
          _this2.hls = new Hls(hlsOptions);

          _this2.hls.on(Hls.Events.MANIFEST_PARSED, function () {
            _this2.props.onReady();
          });

          _this2.hls.on(Hls.Events.ERROR, function (e, data) {
            _this2.props.onError(e, data, _this2.hls, Hls);
          });

          if (MATCH_CLOUDFLARE_STREAM.test(url)) {
            var id = url.match(MATCH_CLOUDFLARE_STREAM)[1];

            _this2.hls.loadSource(REPLACE_CLOUDFLARE_STREAM.replace('{id}', id));
          } else {
            _this2.hls.loadSource(url);
          }

          _this2.hls.attachMedia(_this2.player);

          _this2.props.onLoaded();
        });
      }

      if (this.shouldUseDASH(url)) {
        (0, _utils.getSDK)(DASH_SDK_URL.replace('VERSION', dashVersion), DASH_GLOBAL).then(function (dashjs) {
          _this2.dash = dashjs.MediaPlayer().create();

          _this2.dash.initialize(_this2.player, url, _this2.props.playing);

          _this2.dash.on('error', _this2.props.onError);

          if (parseInt(dashVersion) < 3) {
            _this2.dash.getDebug().setLogToBrowserConsole(false);
          } else {
            _this2.dash.updateSettings({
              debug: {
                logLevel: dashjs.Debug.LOG_LEVEL_NONE
              }
            });
          }

          _this2.props.onLoaded();
        });
      }

      if (this.shouldUseFLV(url)) {
        (0, _utils.getSDK)(FLV_SDK_URL.replace('VERSION', flvVersion), FLV_GLOBAL).then(function (flvjs) {
          _this2.flv = flvjs.createPlayer({
            type: 'flv',
            url: url
          });

          _this2.flv.attachMediaElement(_this2.player);

          _this2.flv.on(flvjs.Events.ERROR, function (e, data) {
            _this2.props.onError(e, data, _this2.flv, flvjs);
          });

          _this2.flv.load();

          _this2.props.onLoaded();
        });
      }

      if (url instanceof Array) {
        // When setting new urls (<source>) on an already loaded video,
        // HTMLMediaElement.load() is needed to reset the media element
        // and restart the media resource. Just replacing children source
        // dom nodes is not enough
        this.player.load();
      } else if ((0, _utils.isMediaStream)(url)) {
        try {
          this.player.srcObject = url;
        } catch (e) {
          this.player.src = window.URL.createObjectURL(url);
        }
      }
    }
  }, {
    key: "play",
    value: function play() {
      var promise = this.player.play();

      if (promise) {
        promise["catch"](this.props.onError);
      }
    }
  }, {
    key: "pause",
    value: function pause() {
      this.player.pause();
    }
  }, {
    key: "stop",
    value: function stop() {
      this.player.removeAttribute('src');

      if (this.dash) {
        this.dash.reset();
      }
    }
  }, {
    key: "seekTo",
    value: function seekTo(seconds) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.player.currentTime = seconds;

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.player.volume = fraction;
    }
  }, {
    key: "enablePIP",
    value: function enablePIP() {
      if (this.player.requestPictureInPicture && document.pictureInPictureElement !== this.player) {
        this.player.requestPictureInPicture();
      } else if ((0, _utils.supportsWebKitPresentationMode)(this.player) && this.player.webkitPresentationMode !== 'picture-in-picture') {
        this.player.webkitSetPresentationMode('picture-in-picture');
      }
    }
  }, {
    key: "disablePIP",
    value: function disablePIP() {
      if (document.exitPictureInPicture && document.pictureInPictureElement === this.player) {
        document.exitPictureInPicture();
      } else if ((0, _utils.supportsWebKitPresentationMode)(this.player) && this.player.webkitPresentationMode !== 'inline') {
        this.player.webkitSetPresentationMode('inline');
      }
    }
  }, {
    key: "setPlaybackRate",
    value: function setPlaybackRate(rate) {
      try {
        this.player.playbackRate = rate;
      } catch (error) {
        this.props.onError(error);
      }
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      if (!this.player) return null;
      var _this$player = this.player,
          duration = _this$player.duration,
          seekable = _this$player.seekable; // on iOS, live streams return Infinity for the duration
      // so instead we use the end of the seekable timerange

      if (duration === Infinity && seekable.length > 0) {
        return seekable.end(seekable.length - 1);
      }

      return duration;
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      if (!this.player) return null;
      return this.player.currentTime;
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      if (!this.player) return null;
      var buffered = this.player.buffered;

      if (buffered.length === 0) {
        return 0;
      }

      var end = buffered.end(buffered.length - 1);
      var duration = this.getDuration();

      if (end > duration) {
        return duration;
      }

      return end;
    }
  }, {
    key: "getSource",
    value: function getSource(url) {
      var useHLS = this.shouldUseHLS(url);
      var useDASH = this.shouldUseDASH(url);
      var useFLV = this.shouldUseFLV(url);

      if (url instanceof Array || (0, _utils.isMediaStream)(url) || useHLS || useDASH || useFLV) {
        return undefined;
      }

      if (MATCH_DROPBOX_URL.test(url)) {
        return url.replace('www.dropbox.com', 'dl.dropboxusercontent.com');
      }

      return url;
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props11 = this.props,
          url = _this$props11.url,
          playing = _this$props11.playing,
          loop = _this$props11.loop,
          controls = _this$props11.controls,
          muted = _this$props11.muted,
          config = _this$props11.config,
          width = _this$props11.width,
          height = _this$props11.height;
      var useAudio = this.shouldUseAudio(this.props);
      var Element = useAudio ? 'audio' : 'video';
      var style = {
        width: width === 'auto' ? width : '100%',
        height: height === 'auto' ? height : '100%'
      };
      return /*#__PURE__*/_react["default"].createElement(Element, _extends({
        ref: this.ref,
        src: this.getSource(url),
        style: style,
        preload: "auto",
        autoPlay: playing || undefined,
        controls: controls,
        muted: muted,
        loop: loop
      }, config.attributes), url instanceof Array && url.map(this.renderSourceElement), config.tracks.map(this.renderTrack));
    }
  }]);

  return FilePlayer;
}(_react.Component);

exports["default"] = FilePlayer;

_defineProperty(FilePlayer, "displayName", 'FilePlayer');

_defineProperty(FilePlayer, "canPlay", _patterns.canPlay.file);

/***/ }),

/***/ 1444:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://cdn.embed.ly/player-0.1.0.min.js';
var SDK_GLOBAL = 'playerjs';

var Kaltura = /*#__PURE__*/function (_Component) {
  _inherits(Kaltura, _Component);

  var _super = _createSuper(Kaltura);

  function Kaltura() {
    var _this;

    _classCallCheck(this, Kaltura);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "duration", null);

    _defineProperty(_assertThisInitialized(_this), "currentTime", null);

    _defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.callPlayer('mute');
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      _this.callPlayer('unmute');
    });

    _defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
      _this.iframe = iframe;
    });

    return _this;
  }

  _createClass(Kaltura, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "load",
    value: function load(url) {
      var _this2 = this;

      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (playerjs) {
        if (!_this2.iframe) return;
        _this2.player = new playerjs.Player(_this2.iframe);

        _this2.player.on('ready', function () {
          // An arbitrary timeout is required otherwise
          // the event listeners won’t work
          setTimeout(function () {
            _this2.player.isReady = true;

            _this2.player.setLoop(_this2.props.loop);

            if (_this2.props.muted) {
              _this2.player.mute();
            }

            _this2.addListeners(_this2.player, _this2.props);

            _this2.props.onReady();
          }, 500);
        });
      }, this.props.onError);
    }
  }, {
    key: "addListeners",
    value: function addListeners(player, props) {
      var _this3 = this;

      player.on('play', props.onPlay);
      player.on('pause', props.onPause);
      player.on('ended', props.onEnded);
      player.on('error', props.onError);
      player.on('timeupdate', function (_ref) {
        var duration = _ref.duration,
            seconds = _ref.seconds;
        _this3.duration = duration;
        _this3.currentTime = seconds;
      });
    }
  }, {
    key: "play",
    value: function play() {
      this.callPlayer('play');
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pause');
    }
  }, {
    key: "stop",
    value: function stop() {// Nothing to do
    }
  }, {
    key: "seekTo",
    value: function seekTo(seconds) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.callPlayer('setCurrentTime', seconds);

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.callPlayer('setVolume', fraction);
    }
  }, {
    key: "setLoop",
    value: function setLoop(loop) {
      this.callPlayer('setLoop', loop);
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.duration;
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.currentTime;
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return this.secondsLoaded;
    }
  }, {
    key: "render",
    value: function render() {
      var style = {
        width: '100%',
        height: '100%'
      };
      return /*#__PURE__*/_react["default"].createElement("iframe", {
        ref: this.ref,
        src: this.props.url,
        frameBorder: "0",
        scrolling: "no",
        style: style,
        allow: "encrypted-media; autoplay; fullscreen;",
        referrerPolicy: "no-referrer-when-downgrade"
      });
    }
  }]);

  return Kaltura;
}(_react.Component);

exports["default"] = Kaltura;

_defineProperty(Kaltura, "displayName", 'Kaltura');

_defineProperty(Kaltura, "canPlay", _patterns.canPlay.kaltura);

/***/ }),

/***/ 3622:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _objectSpread(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 _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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://widget.mixcloud.com/media/js/widgetApi.js';
var SDK_GLOBAL = 'Mixcloud';

var Mixcloud = /*#__PURE__*/function (_Component) {
  _inherits(Mixcloud, _Component);

  var _super = _createSuper(Mixcloud);

  function Mixcloud() {
    var _this;

    _classCallCheck(this, Mixcloud);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "duration", null);

    _defineProperty(_assertThisInitialized(_this), "currentTime", null);

    _defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);

    _defineProperty(_assertThisInitialized(_this), "mute", function () {// No volume support
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {// No volume support
    });

    _defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
      _this.iframe = iframe;
    });

    return _this;
  }

  _createClass(Mixcloud, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "load",
    value: function load(url) {
      var _this2 = this;

      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Mixcloud) {
        _this2.player = Mixcloud.PlayerWidget(_this2.iframe);

        _this2.player.ready.then(function () {
          _this2.player.events.play.on(_this2.props.onPlay);

          _this2.player.events.pause.on(_this2.props.onPause);

          _this2.player.events.ended.on(_this2.props.onEnded);

          _this2.player.events.error.on(_this2.props.error);

          _this2.player.events.progress.on(function (seconds, duration) {
            _this2.currentTime = seconds;
            _this2.duration = duration;
          });

          _this2.props.onReady();
        });
      }, this.props.onError);
    }
  }, {
    key: "play",
    value: function play() {
      this.callPlayer('play');
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pause');
    }
  }, {
    key: "stop",
    value: function stop() {// Nothing to do
    }
  }, {
    key: "seekTo",
    value: function seekTo(seconds) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.callPlayer('seek', seconds);

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {// No volume support
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.duration;
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.currentTime;
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return null;
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props = this.props,
          url = _this$props.url,
          config = _this$props.config;
      var id = url.match(_patterns.MATCH_URL_MIXCLOUD)[1];
      var style = {
        width: '100%',
        height: '100%'
      };
      var query = (0, _utils.queryString)(_objectSpread(_objectSpread({}, config.options), {}, {
        feed: "/".concat(id, "/")
      })); // We have to give the iframe a key here to prevent a
      // weird dialog appearing when loading a new track

      return /*#__PURE__*/_react["default"].createElement("iframe", {
        key: id,
        ref: this.ref,
        style: style,
        src: "https://www.mixcloud.com/widget/iframe/?".concat(query),
        frameBorder: "0",
        allow: "autoplay"
      });
    }
  }]);

  return Mixcloud;
}(_react.Component);

exports["default"] = Mixcloud;

_defineProperty(Mixcloud, "displayName", 'Mixcloud');

_defineProperty(Mixcloud, "canPlay", _patterns.canPlay.mixcloud);

_defineProperty(Mixcloud, "loopOnEnded", true);

/***/ }),

/***/ 8885:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _objectSpread(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 _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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://w.soundcloud.com/player/api.js';
var SDK_GLOBAL = 'SC';

var SoundCloud = /*#__PURE__*/function (_Component) {
  _inherits(SoundCloud, _Component);

  var _super = _createSuper(SoundCloud);

  function SoundCloud() {
    var _this;

    _classCallCheck(this, SoundCloud);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "duration", null);

    _defineProperty(_assertThisInitialized(_this), "currentTime", null);

    _defineProperty(_assertThisInitialized(_this), "fractionLoaded", null);

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.setVolume(0);
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      if (_this.props.volume !== null) {
        _this.setVolume(_this.props.volume);
      }
    });

    _defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
      _this.iframe = iframe;
    });

    return _this;
  }

  _createClass(SoundCloud, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "load",
    value: function load(url, isReady) {
      var _this2 = this;

      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (SC) {
        if (!_this2.iframe) return;
        var _SC$Widget$Events = SC.Widget.Events,
            PLAY = _SC$Widget$Events.PLAY,
            PLAY_PROGRESS = _SC$Widget$Events.PLAY_PROGRESS,
            PAUSE = _SC$Widget$Events.PAUSE,
            FINISH = _SC$Widget$Events.FINISH,
            ERROR = _SC$Widget$Events.ERROR;

        if (!isReady) {
          _this2.player = SC.Widget(_this2.iframe);

          _this2.player.bind(PLAY, _this2.props.onPlay);

          _this2.player.bind(PAUSE, function () {
            var remaining = _this2.duration - _this2.currentTime;

            if (remaining < 0.05) {
              // Prevent onPause firing right before onEnded
              return;
            }

            _this2.props.onPause();
          });

          _this2.player.bind(PLAY_PROGRESS, function (e) {
            _this2.currentTime = e.currentPosition / 1000;
            _this2.fractionLoaded = e.loadedProgress;
          });

          _this2.player.bind(FINISH, function () {
            return _this2.props.onEnded();
          });

          _this2.player.bind(ERROR, function (e) {
            return _this2.props.onError(e);
          });
        }

        _this2.player.load(url, _objectSpread(_objectSpread({}, _this2.props.config.options), {}, {
          callback: function callback() {
            _this2.player.getDuration(function (duration) {
              _this2.duration = duration / 1000;

              _this2.props.onReady();
            });
          }
        }));
      });
    }
  }, {
    key: "play",
    value: function play() {
      this.callPlayer('play');
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pause');
    }
  }, {
    key: "stop",
    value: function stop() {// Nothing to do
    }
  }, {
    key: "seekTo",
    value: function seekTo(seconds) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.callPlayer('seekTo', seconds * 1000);

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.callPlayer('setVolume', fraction * 100);
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.duration;
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.currentTime;
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return this.fractionLoaded * this.duration;
    }
  }, {
    key: "render",
    value: function render() {
      var display = this.props.display;
      var style = {
        width: '100%',
        height: '100%',
        display: display
      };
      return /*#__PURE__*/_react["default"].createElement("iframe", {
        ref: this.ref,
        src: "https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),
        style: style,
        frameBorder: 0,
        allow: "autoplay"
      });
    }
  }]);

  return SoundCloud;
}(_react.Component);

exports["default"] = SoundCloud;

_defineProperty(SoundCloud, "displayName", 'SoundCloud');

_defineProperty(SoundCloud, "canPlay", _patterns.canPlay.soundcloud);

_defineProperty(SoundCloud, "loopOnEnded", true);

/***/ }),

/***/ 5369:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://cdn.embed.ly/player-0.1.0.min.js';
var SDK_GLOBAL = 'playerjs';

var Streamable = /*#__PURE__*/function (_Component) {
  _inherits(Streamable, _Component);

  var _super = _createSuper(Streamable);

  function Streamable() {
    var _this;

    _classCallCheck(this, Streamable);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "duration", null);

    _defineProperty(_assertThisInitialized(_this), "currentTime", null);

    _defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.callPlayer('mute');
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      _this.callPlayer('unmute');
    });

    _defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
      _this.iframe = iframe;
    });

    return _this;
  }

  _createClass(Streamable, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "load",
    value: function load(url) {
      var _this2 = this;

      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (playerjs) {
        if (!_this2.iframe) return;
        _this2.player = new playerjs.Player(_this2.iframe);

        _this2.player.setLoop(_this2.props.loop);

        _this2.player.on('ready', _this2.props.onReady);

        _this2.player.on('play', _this2.props.onPlay);

        _this2.player.on('pause', _this2.props.onPause);

        _this2.player.on('seeked', _this2.props.onSeek);

        _this2.player.on('ended', _this2.props.onEnded);

        _this2.player.on('error', _this2.props.onError);

        _this2.player.on('timeupdate', function (_ref) {
          var duration = _ref.duration,
              seconds = _ref.seconds;
          _this2.duration = duration;
          _this2.currentTime = seconds;
        });

        _this2.player.on('buffered', function (_ref2) {
          var percent = _ref2.percent;

          if (_this2.duration) {
            _this2.secondsLoaded = _this2.duration * percent;
          }
        });

        if (_this2.props.muted) {
          _this2.player.mute();
        }
      }, this.props.onError);
    }
  }, {
    key: "play",
    value: function play() {
      this.callPlayer('play');
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pause');
    }
  }, {
    key: "stop",
    value: function stop() {// Nothing to do
    }
  }, {
    key: "seekTo",
    value: function seekTo(seconds) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.callPlayer('setCurrentTime', seconds);

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.callPlayer('setVolume', fraction * 100);
    }
  }, {
    key: "setLoop",
    value: function setLoop(loop) {
      this.callPlayer('setLoop', loop);
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.duration;
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.currentTime;
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return this.secondsLoaded;
    }
  }, {
    key: "render",
    value: function render() {
      var id = this.props.url.match(_patterns.MATCH_URL_STREAMABLE)[1];
      var style = {
        width: '100%',
        height: '100%'
      };
      return /*#__PURE__*/_react["default"].createElement("iframe", {
        ref: this.ref,
        src: "https://streamable.com/o/".concat(id),
        frameBorder: "0",
        scrolling: "no",
        style: style,
        allow: "encrypted-media; autoplay; fullscreen;"
      });
    }
  }]);

  return Streamable;
}(_react.Component);

exports["default"] = Streamable;

_defineProperty(Streamable, "displayName", 'Streamable');

_defineProperty(Streamable, "canPlay", _patterns.canPlay.streamable);

/***/ }),

/***/ 74:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _objectSpread(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 _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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://player.twitch.tv/js/embed/v1.js';
var SDK_GLOBAL = 'Twitch';
var PLAYER_ID_PREFIX = 'twitch-player-';

var Twitch = /*#__PURE__*/function (_Component) {
  _inherits(Twitch, _Component);

  var _super = _createSuper(Twitch);

  function Twitch() {
    var _this;

    _classCallCheck(this, Twitch);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "playerID", _this.props.config.playerId || "".concat(PLAYER_ID_PREFIX).concat((0, _utils.randomString)()));

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.callPlayer('setMuted', true);
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      _this.callPlayer('setMuted', false);
    });

    return _this;
  }

  _createClass(Twitch, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "load",
    value: function load(url, isReady) {
      var _this2 = this;

      var _this$props = this.props,
          playsinline = _this$props.playsinline,
          onError = _this$props.onError,
          config = _this$props.config,
          controls = _this$props.controls;

      var isChannel = _patterns.MATCH_URL_TWITCH_CHANNEL.test(url);

      var id = isChannel ? url.match(_patterns.MATCH_URL_TWITCH_CHANNEL)[1] : url.match(_patterns.MATCH_URL_TWITCH_VIDEO)[1];

      if (isReady) {
        if (isChannel) {
          this.player.setChannel(id);
        } else {
          this.player.setVideo('v' + id);
        }

        return;
      }

      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Twitch) {
        _this2.player = new Twitch.Player(_this2.playerID, _objectSpread({
          video: isChannel ? '' : id,
          channel: isChannel ? id : '',
          height: '100%',
          width: '100%',
          playsinline: playsinline,
          autoplay: _this2.props.playing,
          muted: _this2.props.muted,
          // https://github.com/CookPete/react-player/issues/733#issuecomment-549085859
          controls: isChannel ? true : controls,
          time: (0, _utils.parseStartTime)(url)
        }, config.options));
        var _Twitch$Player = Twitch.Player,
            READY = _Twitch$Player.READY,
            PLAYING = _Twitch$Player.PLAYING,
            PAUSE = _Twitch$Player.PAUSE,
            ENDED = _Twitch$Player.ENDED,
            ONLINE = _Twitch$Player.ONLINE,
            OFFLINE = _Twitch$Player.OFFLINE,
            SEEK = _Twitch$Player.SEEK;

        _this2.player.addEventListener(READY, _this2.props.onReady);

        _this2.player.addEventListener(PLAYING, _this2.props.onPlay);

        _this2.player.addEventListener(PAUSE, _this2.props.onPause);

        _this2.player.addEventListener(ENDED, _this2.props.onEnded);

        _this2.player.addEventListener(SEEK, _this2.props.onSeek); // Prevent weird isLoading behaviour when streams are offline


        _this2.player.addEventListener(ONLINE, _this2.props.onLoaded);

        _this2.player.addEventListener(OFFLINE, _this2.props.onLoaded);
      }, onError);
    }
  }, {
    key: "play",
    value: function play() {
      this.callPlayer('play');
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pause');
    }
  }, {
    key: "stop",
    value: function stop() {
      this.callPlayer('pause');
    }
  }, {
    key: "seekTo",
    value: function seekTo(seconds) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.callPlayer('seek', seconds);

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.callPlayer('setVolume', fraction);
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.callPlayer('getDuration');
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.callPlayer('getCurrentTime');
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return null;
    }
  }, {
    key: "render",
    value: function render() {
      var style = {
        width: '100%',
        height: '100%'
      };
      return /*#__PURE__*/_react["default"].createElement("div", {
        style: style,
        id: this.playerID
      });
    }
  }]);

  return Twitch;
}(_react.Component);

exports["default"] = Twitch;

_defineProperty(Twitch, "displayName", 'Twitch');

_defineProperty(Twitch, "canPlay", _patterns.canPlay.twitch);

_defineProperty(Twitch, "loopOnEnded", true);

/***/ }),

/***/ 6166:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _objectSpread(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 _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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://play.vidyard.com/embed/v4.js';
var SDK_GLOBAL = 'VidyardV4';
var SDK_GLOBAL_READY = 'onVidyardAPI';

var Vidyard = /*#__PURE__*/function (_Component) {
  _inherits(Vidyard, _Component);

  var _super = _createSuper(Vidyard);

  function Vidyard() {
    var _this;

    _classCallCheck(this, Vidyard);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.setVolume(0);
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      if (_this.props.volume !== null) {
        _this.setVolume(_this.props.volume);
      }
    });

    _defineProperty(_assertThisInitialized(_this), "ref", function (container) {
      _this.container = container;
    });

    return _this;
  }

  _createClass(Vidyard, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "load",
    value: function load(url) {
      var _this2 = this;

      var _this$props = this.props,
          playing = _this$props.playing,
          config = _this$props.config,
          onError = _this$props.onError,
          onDuration = _this$props.onDuration;
      var id = url && url.match(_patterns.MATCH_URL_VIDYARD)[1];

      if (this.player) {
        this.stop();
      }

      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (Vidyard) {
        if (!_this2.container) return;
        Vidyard.api.addReadyListener(function (data, player) {
          if (_this2.player) {
            return;
          }

          _this2.player = player;

          _this2.player.on('ready', _this2.props.onReady);

          _this2.player.on('play', _this2.props.onPlay);

          _this2.player.on('pause', _this2.props.onPause);

          _this2.player.on('seek', _this2.props.onSeek);

          _this2.player.on('playerComplete', _this2.props.onEnded);
        }, id);
        Vidyard.api.renderPlayer(_objectSpread({
          uuid: id,
          container: _this2.container,
          autoplay: playing ? 1 : 0
        }, config.options));
        Vidyard.api.getPlayerMetadata(id).then(function (meta) {
          _this2.duration = meta.length_in_seconds;
          onDuration(meta.length_in_seconds);
        });
      }, onError);
    }
  }, {
    key: "play",
    value: function play() {
      this.callPlayer('play');
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pause');
    }
  }, {
    key: "stop",
    value: function stop() {
      window.VidyardV4.api.destroyPlayer(this.player);
    }
  }, {
    key: "seekTo",
    value: function seekTo(amount) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.callPlayer('seek', amount);

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.callPlayer('setVolume', fraction);
    }
  }, {
    key: "setPlaybackRate",
    value: function setPlaybackRate(rate) {
      this.callPlayer('setPlaybackSpeed', rate);
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.duration;
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.callPlayer('currentTime');
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return null;
    }
  }, {
    key: "render",
    value: function render() {
      var display = this.props.display;
      var style = {
        width: '100%',
        height: '100%',
        display: display
      };
      return /*#__PURE__*/_react["default"].createElement("div", {
        style: style
      }, /*#__PURE__*/_react["default"].createElement("div", {
        ref: this.ref
      }));
    }
  }]);

  return Vidyard;
}(_react.Component);

exports["default"] = Vidyard;

_defineProperty(Vidyard, "displayName", 'Vidyard');

_defineProperty(Vidyard, "canPlay", _patterns.canPlay.vidyard);

/***/ }),

/***/ 4677:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _objectSpread(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 _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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://player.vimeo.com/api/player.js';
var SDK_GLOBAL = 'Vimeo';

var cleanUrl = function cleanUrl(url) {
  return url.replace('/manage/videos', '');
};

var Vimeo = /*#__PURE__*/function (_Component) {
  _inherits(Vimeo, _Component);

  var _super = _createSuper(Vimeo);

  function Vimeo() {
    var _this;

    _classCallCheck(this, Vimeo);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "duration", null);

    _defineProperty(_assertThisInitialized(_this), "currentTime", null);

    _defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.setMuted(true);
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      _this.setMuted(false);
    });

    _defineProperty(_assertThisInitialized(_this), "ref", function (container) {
      _this.container = container;
    });

    return _this;
  }

  _createClass(Vimeo, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "load",
    value: function load(url) {
      var _this2 = this;

      this.duration = null;
      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Vimeo) {
        if (!_this2.container) return;
        var _this2$props$config = _this2.props.config,
            playerOptions = _this2$props$config.playerOptions,
            title = _this2$props$config.title;
        _this2.player = new Vimeo.Player(_this2.container, _objectSpread({
          url: cleanUrl(url),
          autoplay: _this2.props.playing,
          muted: _this2.props.muted,
          loop: _this2.props.loop,
          playsinline: _this2.props.playsinline,
          controls: _this2.props.controls
        }, playerOptions));

        _this2.player.ready().then(function () {
          var iframe = _this2.container.querySelector('iframe');

          iframe.style.width = '100%';
          iframe.style.height = '100%';

          if (title) {
            iframe.title = title;
          }
        })["catch"](_this2.props.onError);

        _this2.player.on('loaded', function () {
          _this2.props.onReady();

          _this2.refreshDuration();
        });

        _this2.player.on('play', function () {
          _this2.props.onPlay();

          _this2.refreshDuration();
        });

        _this2.player.on('pause', _this2.props.onPause);

        _this2.player.on('seeked', function (e) {
          return _this2.props.onSeek(e.seconds);
        });

        _this2.player.on('ended', _this2.props.onEnded);

        _this2.player.on('error', _this2.props.onError);

        _this2.player.on('timeupdate', function (_ref) {
          var seconds = _ref.seconds;
          _this2.currentTime = seconds;
        });

        _this2.player.on('progress', function (_ref2) {
          var seconds = _ref2.seconds;
          _this2.secondsLoaded = seconds;
        });

        _this2.player.on('bufferstart', _this2.props.onBuffer);

        _this2.player.on('bufferend', _this2.props.onBufferEnd);

        _this2.player.on('playbackratechange', function (e) {
          return _this2.props.onPlaybackRateChange(e.playbackRate);
        });
      }, this.props.onError);
    }
  }, {
    key: "refreshDuration",
    value: function refreshDuration() {
      var _this3 = this;

      this.player.getDuration().then(function (duration) {
        _this3.duration = duration;
      });
    }
  }, {
    key: "play",
    value: function play() {
      var promise = this.callPlayer('play');

      if (promise) {
        promise["catch"](this.props.onError);
      }
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pause');
    }
  }, {
    key: "stop",
    value: function stop() {
      this.callPlayer('unload');
    }
  }, {
    key: "seekTo",
    value: function seekTo(seconds) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.callPlayer('setCurrentTime', seconds);

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.callPlayer('setVolume', fraction);
    }
  }, {
    key: "setMuted",
    value: function setMuted(muted) {
      this.callPlayer('setMuted', muted);
    }
  }, {
    key: "setLoop",
    value: function setLoop(loop) {
      this.callPlayer('setLoop', loop);
    }
  }, {
    key: "setPlaybackRate",
    value: function setPlaybackRate(rate) {
      this.callPlayer('setPlaybackRate', rate);
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.duration;
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.currentTime;
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return this.secondsLoaded;
    }
  }, {
    key: "render",
    value: function render() {
      var display = this.props.display;
      var style = {
        width: '100%',
        height: '100%',
        overflow: 'hidden',
        display: display
      };
      return /*#__PURE__*/_react["default"].createElement("div", {
        key: this.props.url,
        ref: this.ref,
        style: style
      });
    }
  }]);

  return Vimeo;
}(_react.Component);

exports["default"] = Vimeo;

_defineProperty(Vimeo, "displayName", 'Vimeo');

_defineProperty(Vimeo, "canPlay", _patterns.canPlay.vimeo);

_defineProperty(Vimeo, "forceLoad", true);

/***/ }),

/***/ 8900:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _objectSpread(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 _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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://fast.wistia.com/assets/external/E-v1.js';
var SDK_GLOBAL = 'Wistia';
var PLAYER_ID_PREFIX = 'wistia-player-';

var Wistia = /*#__PURE__*/function (_Component) {
  _inherits(Wistia, _Component);

  var _super = _createSuper(Wistia);

  function Wistia() {
    var _this;

    _classCallCheck(this, Wistia);

    for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
      _args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(_args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "playerID", _this.props.config.playerId || "".concat(PLAYER_ID_PREFIX).concat((0, _utils.randomString)()));

    _defineProperty(_assertThisInitialized(_this), "onPlay", function () {
      var _this$props;

      return (_this$props = _this.props).onPlay.apply(_this$props, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onPause", function () {
      var _this$props2;

      return (_this$props2 = _this.props).onPause.apply(_this$props2, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onSeek", function () {
      var _this$props3;

      return (_this$props3 = _this.props).onSeek.apply(_this$props3, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onEnded", function () {
      var _this$props4;

      return (_this$props4 = _this.props).onEnded.apply(_this$props4, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "onPlaybackRateChange", function () {
      var _this$props5;

      return (_this$props5 = _this.props).onPlaybackRateChange.apply(_this$props5, arguments);
    });

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.callPlayer('mute');
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      _this.callPlayer('unmute');
    });

    return _this;
  }

  _createClass(Wistia, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "load",
    value: function load(url) {
      var _this2 = this;

      var _this$props6 = this.props,
          playing = _this$props6.playing,
          muted = _this$props6.muted,
          controls = _this$props6.controls,
          _onReady = _this$props6.onReady,
          config = _this$props6.config,
          onError = _this$props6.onError;
      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Wistia) {
        if (config.customControls) {
          config.customControls.forEach(function (control) {
            return Wistia.defineControl(control);
          });
        }

        window._wq = window._wq || [];

        window._wq.push({
          id: _this2.playerID,
          options: _objectSpread({
            autoPlay: playing,
            silentAutoPlay: 'allow',
            muted: muted,
            controlsVisibleOnLoad: controls,
            fullscreenButton: controls,
            playbar: controls,
            playbackRateControl: controls,
            qualityControl: controls,
            volumeControl: controls,
            settingsControl: controls,
            smallPlayButton: controls
          }, config.options),
          onReady: function onReady(player) {
            _this2.player = player;

            _this2.unbind();

            _this2.player.bind('play', _this2.onPlay);

            _this2.player.bind('pause', _this2.onPause);

            _this2.player.bind('seek', _this2.onSeek);

            _this2.player.bind('end', _this2.onEnded);

            _this2.player.bind('playbackratechange', _this2.onPlaybackRateChange);

            _onReady();
          }
        });
      }, onError);
    }
  }, {
    key: "unbind",
    value: function unbind() {
      this.player.unbind('play', this.onPlay);
      this.player.unbind('pause', this.onPause);
      this.player.unbind('seek', this.onSeek);
      this.player.unbind('end', this.onEnded);
      this.player.unbind('playbackratechange', this.onPlaybackRateChange);
    } // Proxy methods to prevent listener leaks

  }, {
    key: "play",
    value: function play() {
      this.callPlayer('play');
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pause');
    }
  }, {
    key: "stop",
    value: function stop() {
      this.unbind();
      this.callPlayer('remove');
    }
  }, {
    key: "seekTo",
    value: function seekTo(seconds) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
      this.callPlayer('time', seconds);

      if (!keepPlaying) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.callPlayer('volume', fraction);
    }
  }, {
    key: "setPlaybackRate",
    value: function setPlaybackRate(rate) {
      this.callPlayer('playbackRate', rate);
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.callPlayer('duration');
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.callPlayer('time');
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return null;
    }
  }, {
    key: "render",
    value: function render() {
      var url = this.props.url;
      var videoID = url && url.match(_patterns.MATCH_URL_WISTIA)[1];
      var className = "wistia_embed wistia_async_".concat(videoID);
      var style = {
        width: '100%',
        height: '100%'
      };
      return /*#__PURE__*/_react["default"].createElement("div", {
        id: this.playerID,
        key: videoID,
        className: className,
        style: style
      });
    }
  }]);

  return Wistia;
}(_react.Component);

exports["default"] = Wistia;

_defineProperty(Wistia, "displayName", 'Wistia');

_defineProperty(Wistia, "canPlay", _patterns.canPlay.wistia);

_defineProperty(Wistia, "loopOnEnded", true);

/***/ }),

/***/ 4140:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = _interopRequireWildcard(__webpack_require__(6540));

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

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 _objectSpread(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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { 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 _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 _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 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 _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

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 _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

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; }

var SDK_URL = 'https://www.youtube.com/iframe_api';
var SDK_GLOBAL = 'YT';
var SDK_GLOBAL_READY = 'onYouTubeIframeAPIReady';
var MATCH_PLAYLIST = /[?&](?:list|channel)=([a-zA-Z0-9_-]+)/;
var MATCH_USER_UPLOADS = /user\/([a-zA-Z0-9_-]+)\/?/;
var MATCH_NOCOOKIE = /youtube-nocookie\.com/;
var NOCOOKIE_HOST = 'https://www.youtube-nocookie.com';

var YouTube = /*#__PURE__*/function (_Component) {
  _inherits(YouTube, _Component);

  var _super = _createSuper(YouTube);

  function YouTube() {
    var _this;

    _classCallCheck(this, YouTube);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    _defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);

    _defineProperty(_assertThisInitialized(_this), "parsePlaylist", function (url) {
      if (url instanceof Array) {
        return {
          listType: 'playlist',
          playlist: url.map(_this.getID).join(',')
        };
      }

      if (MATCH_PLAYLIST.test(url)) {
        var _url$match = url.match(MATCH_PLAYLIST),
            _url$match2 = _slicedToArray(_url$match, 2),
            playlistId = _url$match2[1];

        return {
          listType: 'playlist',
          list: playlistId.replace(/^UC/, 'UU')
        };
      }

      if (MATCH_USER_UPLOADS.test(url)) {
        var _url$match3 = url.match(MATCH_USER_UPLOADS),
            _url$match4 = _slicedToArray(_url$match3, 2),
            username = _url$match4[1];

        return {
          listType: 'user_uploads',
          list: username
        };
      }

      return {};
    });

    _defineProperty(_assertThisInitialized(_this), "onStateChange", function (event) {
      var data = event.data;
      var _this$props = _this.props,
          onPlay = _this$props.onPlay,
          onPause = _this$props.onPause,
          onBuffer = _this$props.onBuffer,
          onBufferEnd = _this$props.onBufferEnd,
          onEnded = _this$props.onEnded,
          onReady = _this$props.onReady,
          loop = _this$props.loop,
          _this$props$config = _this$props.config,
          playerVars = _this$props$config.playerVars,
          onUnstarted = _this$props$config.onUnstarted;
      var _window$SDK_GLOBAL$Pl = window[SDK_GLOBAL].PlayerState,
          UNSTARTED = _window$SDK_GLOBAL$Pl.UNSTARTED,
          PLAYING = _window$SDK_GLOBAL$Pl.PLAYING,
          PAUSED = _window$SDK_GLOBAL$Pl.PAUSED,
          BUFFERING = _window$SDK_GLOBAL$Pl.BUFFERING,
          ENDED = _window$SDK_GLOBAL$Pl.ENDED,
          CUED = _window$SDK_GLOBAL$Pl.CUED;
      if (data === UNSTARTED) onUnstarted();

      if (data === PLAYING) {
        onPlay();
        onBufferEnd();
      }

      if (data === PAUSED) onPause();
      if (data === BUFFERING) onBuffer();

      if (data === ENDED) {
        var isPlaylist = !!_this.callPlayer('getPlaylist'); // Only loop manually if not playing a playlist

        if (loop && !isPlaylist) {
          if (playerVars.start) {
            _this.seekTo(playerVars.start);
          } else {
            _this.play();
          }
        }

        onEnded();
      }

      if (data === CUED) onReady();
    });

    _defineProperty(_assertThisInitialized(_this), "mute", function () {
      _this.callPlayer('mute');
    });

    _defineProperty(_assertThisInitialized(_this), "unmute", function () {
      _this.callPlayer('unMute');
    });

    _defineProperty(_assertThisInitialized(_this), "ref", function (container) {
      _this.container = container;
    });

    return _this;
  }

  _createClass(YouTube, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onMount && this.props.onMount(this);
    }
  }, {
    key: "getID",
    value: function getID(url) {
      if (!url || url instanceof Array || MATCH_PLAYLIST.test(url)) {
        return null;
      }

      return url.match(_patterns.MATCH_URL_YOUTUBE)[1];
    }
  }, {
    key: "load",
    value: function load(url, isReady) {
      var _this2 = this;

      var _this$props2 = this.props,
          playing = _this$props2.playing,
          muted = _this$props2.muted,
          playsinline = _this$props2.playsinline,
          controls = _this$props2.controls,
          loop = _this$props2.loop,
          config = _this$props2.config,
          _onError = _this$props2.onError;
      var playerVars = config.playerVars,
          embedOptions = config.embedOptions;
      var id = this.getID(url);

      if (isReady) {
        if (MATCH_PLAYLIST.test(url) || MATCH_USER_UPLOADS.test(url) || url instanceof Array) {
          this.player.loadPlaylist(this.parsePlaylist(url));
          return;
        }

        this.player.cueVideoById({
          videoId: id,
          startSeconds: (0, _utils.parseStartTime)(url) || playerVars.start,
          endSeconds: (0, _utils.parseEndTime)(url) || playerVars.end
        });
        return;
      }

      (0, _utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (YT) {
        return YT.loaded;
      }).then(function (YT) {
        if (!_this2.container) return;
        _this2.player = new YT.Player(_this2.container, _objectSpread({
          width: '100%',
          height: '100%',
          videoId: id,
          playerVars: _objectSpread(_objectSpread({
            autoplay: playing ? 1 : 0,
            mute: muted ? 1 : 0,
            controls: controls ? 1 : 0,
            start: (0, _utils.parseStartTime)(url),
            end: (0, _utils.parseEndTime)(url),
            origin: window.location.origin,
            playsinline: playsinline ? 1 : 0
          }, _this2.parsePlaylist(url)), playerVars),
          events: {
            onReady: function onReady() {
              if (loop) {
                _this2.player.setLoop(true); // Enable playlist looping

              }

              _this2.props.onReady();
            },
            onPlaybackRateChange: function onPlaybackRateChange(event) {
              return _this2.props.onPlaybackRateChange(event.data);
            },
            onPlaybackQualityChange: function onPlaybackQualityChange(event) {
              return _this2.props.onPlaybackQualityChange(event);
            },
            onStateChange: _this2.onStateChange,
            onError: function onError(event) {
              return _onError(event.data);
            }
          },
          host: MATCH_NOCOOKIE.test(url) ? NOCOOKIE_HOST : undefined
        }, embedOptions));
      }, _onError);

      if (embedOptions.events) {
        console.warn('Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause');
      }
    }
  }, {
    key: "play",
    value: function play() {
      this.callPlayer('playVideo');
    }
  }, {
    key: "pause",
    value: function pause() {
      this.callPlayer('pauseVideo');
    }
  }, {
    key: "stop",
    value: function stop() {
      if (!document.body.contains(this.callPlayer('getIframe'))) return;
      this.callPlayer('stopVideo');
    }
  }, {
    key: "seekTo",
    value: function seekTo(amount) {
      var keepPlaying = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
      this.callPlayer('seekTo', amount);

      if (!keepPlaying && !this.props.playing) {
        this.pause();
      }
    }
  }, {
    key: "setVolume",
    value: function setVolume(fraction) {
      this.callPlayer('setVolume', fraction * 100);
    }
  }, {
    key: "setPlaybackRate",
    value: function setPlaybackRate(rate) {
      this.callPlayer('setPlaybackRate', rate);
    }
  }, {
    key: "setLoop",
    value: function setLoop(loop) {
      this.callPlayer('setLoop', loop);
    }
  }, {
    key: "getDuration",
    value: function getDuration() {
      return this.callPlayer('getDuration');
    }
  }, {
    key: "getCurrentTime",
    value: function getCurrentTime() {
      return this.callPlayer('getCurrentTime');
    }
  }, {
    key: "getSecondsLoaded",
    value: function getSecondsLoaded() {
      return this.callPlayer('getVideoLoadedFraction') * this.getDuration();
    }
  }, {
    key: "render",
    value: function render() {
      var display = this.props.display;
      var style = {
        width: '100%',
        height: '100%',
        display: display
      };
      return /*#__PURE__*/_react["default"].createElement("div", {
        style: style
      }, /*#__PURE__*/_react["default"].createElement("div", {
        ref: this.ref
      }));
    }
  }]);

  return YouTube;
}(_react.Component);

exports["default"] = YouTube;

_defineProperty(YouTube, "displayName", 'YouTube');

_defineProperty(YouTube, "canPlay", _patterns.canPlay.youtube);

/***/ }),

/***/ 8105:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports["default"] = void 0;

var _react = __webpack_require__(6540);

var _utils = __webpack_require__(3273);

var _patterns = __webpack_require__(9257);

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var _default = [{
  key: 'youtube',
  name: 'YouTube',
  canPlay: _patterns.canPlay.youtube,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(4140));
    });
  })
}, {
  key: 'soundcloud',
  name: 'SoundCloud',
  canPlay: _patterns.canPlay.soundcloud,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(8885));
    });
  })
}, {
  key: 'vimeo',
  name: 'Vimeo',
  canPlay: _patterns.canPlay.vimeo,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(4677));
    });
  })
}, {
  key: 'facebook',
  name: 'Facebook',
  canPlay: _patterns.canPlay.facebook,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(1481));
    });
  })
}, {
  key: 'streamable',
  name: 'Streamable',
  canPlay: _patterns.canPlay.streamable,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(5369));
    });
  })
}, {
  key: 'wistia',
  name: 'Wistia',
  canPlay: _patterns.canPlay.wistia,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(8900));
    });
  })
}, {
  key: 'twitch',
  name: 'Twitch',
  canPlay: _patterns.canPlay.twitch,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(74));
    });
  })
}, {
  key: 'dailymotion',
  name: 'DailyMotion',
  canPlay: _patterns.canPlay.dailymotion,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(8630));
    });
  })
}, {
  key: 'mixcloud',
  name: 'Mixcloud',
  canPlay: _patterns.canPlay.mixcloud,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(3622));
    });
  })
}, {
  key: 'vidyard',
  name: 'Vidyard',
  canPlay: _patterns.canPlay.vidyard,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(6166));
    });
  })
}, {
  key: 'kaltura',
  name: 'Kaltura',
  canPlay: _patterns.canPlay.kaltura,
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(1444));
    });
  })
}, {
  key: 'file',
  name: 'FilePlayer',
  canPlay: _patterns.canPlay.file,
  canEnablePIP: function canEnablePIP(url) {
    return _patterns.canPlay.file(url) && (document.pictureInPictureEnabled || (0, _utils.supportsWebKitPresentationMode)()) && !_patterns.AUDIO_EXTENSIONS.test(url);
  },
  lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
    return Promise.resolve().then(function () {
      return _interopRequireWildcard(__webpack_require__(4466));
    });
  })
}];
exports["default"] = _default;

/***/ }),

/***/ 2938:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.defaultProps = exports.propTypes = void 0;

var _propTypes = _interopRequireDefault(__webpack_require__(5556));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var string = _propTypes["default"].string,
    bool = _propTypes["default"].bool,
    number = _propTypes["default"].number,
    array = _propTypes["default"].array,
    oneOfType = _propTypes["default"].oneOfType,
    shape = _propTypes["default"].shape,
    object = _propTypes["default"].object,
    func = _propTypes["default"].func,
    node = _propTypes["default"].node;
var propTypes = {
  url: oneOfType([string, array, object]),
  playing: bool,
  loop: bool,
  controls: bool,
  volume: number,
  muted: bool,
  playbackRate: number,
  width: oneOfType([string, number]),
  height: oneOfType([string, number]),
  style: object,
  progressInterval: number,
  playsinline: bool,
  pip: bool,
  stopOnUnmount: bool,
  light: oneOfType([bool, string, object]),
  playIcon: node,
  previewTabIndex: number,
  fallback: node,
  oEmbedUrl: string,
  wrapper: oneOfType([string, func, shape({
    render: func.isRequired
  })]),
  config: shape({
    soundcloud: shape({
      options: object
    }),
    youtube: shape({
      playerVars: object,
      embedOptions: object,
      onUnstarted: func
    }),
    facebook: shape({
      appId: string,
      version: string,
      playerId: string,
      attributes: object
    }),
    dailymotion: shape({
      params: object
    }),
    vimeo: shape({
      playerOptions: object,
      title: string
    }),
    file: shape({
      attributes: object,
      tracks: array,
      forceVideo: bool,
      forceAudio: bool,
      forceHLS: bool,
      forceSafariHLS: bool,
      forceDisableHls: bool,
      forceDASH: bool,
      forceFLV: bool,
      hlsOptions: object,
      hlsVersion: string,
      dashVersion: string,
      flvVersion: string
    }),
    wistia: shape({
      options: object,
      playerId: string,
      customControls: array
    }),
    mixcloud: shape({
      options: object
    }),
    twitch: shape({
      options: object,
      playerId: string
    }),
    vidyard: shape({
      options: object
    })
  }),
  onReady: func,
  onStart: func,
  onPlay: func,
  onPause: func,
  onBuffer: func,
  onBufferEnd: func,
  onEnded: func,
  onError: func,
  onDuration: func,
  onSeek: func,
  onPlaybackRateChange: func,
  onPlaybackQualityChange: func,
  onProgress: func,
  onClickPreview: func,
  onEnablePIP: func,
  onDisablePIP: func
};
exports.propTypes = propTypes;

var noop = function noop() {};

var defaultProps = {
  playing: false,
  loop: false,
  controls: false,
  volume: null,
  muted: false,
  playbackRate: 1,
  width: '640px',
  height: '360px',
  style: {},
  progressInterval: 1000,
  playsinline: false,
  pip: false,
  stopOnUnmount: true,
  light: false,
  fallback: null,
  wrapper: 'div',
  previewTabIndex: 0,
  oEmbedUrl: 'https://noembed.com/embed?url={url}',
  config: {
    soundcloud: {
      options: {
        visual: true,
        // Undocumented, but makes player fill container and look better
        buying: false,
        liking: false,
        download: false,
        sharing: false,
        show_comments: false,
        show_playcount: false
      }
    },
    youtube: {
      playerVars: {
        playsinline: 1,
        showinfo: 0,
        rel: 0,
        iv_load_policy: 3,
        modestbranding: 1
      },
      embedOptions: {},
      onUnstarted: noop
    },
    facebook: {
      appId: '1309697205772819',
      version: 'v3.3',
      playerId: null,
      attributes: {}
    },
    dailymotion: {
      params: {
        api: 1,
        'endscreen-enable': false
      }
    },
    vimeo: {
      playerOptions: {
        autopause: false,
        byline: false,
        portrait: false,
        title: false
      },
      title: null
    },
    file: {
      attributes: {},
      tracks: [],
      forceVideo: false,
      forceAudio: false,
      forceHLS: false,
      forceDASH: false,
      forceFLV: false,
      hlsOptions: {},
      hlsVersion: '1.1.4',
      dashVersion: '3.1.3',
      flvVersion: '1.5.0',
      forceDisableHls: false
    },
    wistia: {
      options: {},
      playerId: null,
      customControls: null
    },
    mixcloud: {
      options: {
        hide_cover: 1
      }
    },
    twitch: {
      options: {},
      playerId: null
    },
    vidyard: {
      options: {}
    }
  },
  onReady: noop,
  onStart: noop,
  onPlay: noop,
  onPause: noop,
  onBuffer: noop,
  onBufferEnd: noop,
  onEnded: noop,
  onError: noop,
  onDuration: noop,
  onSeek: noop,
  onPlaybackRateChange: noop,
  onPlaybackQualityChange: noop,
  onProgress: noop,
  onClickPreview: noop,
  onEnablePIP: noop,
  onDisablePIP: noop
};
exports.defaultProps = defaultProps;

/***/ }),

/***/ 3273:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true
}));
exports.parseStartTime = parseStartTime;
exports.parseEndTime = parseEndTime;
exports.randomString = randomString;
exports.queryString = queryString;
exports.getSDK = getSDK;
exports.getConfig = getConfig;
exports.omit = omit;
exports.callPlayer = callPlayer;
exports.isMediaStream = isMediaStream;
exports.isBlobUrl = isBlobUrl;
exports.supportsWebKitPresentationMode = supportsWebKitPresentationMode;

var _loadScript = _interopRequireDefault(__webpack_require__(4241));

var _deepmerge = _interopRequireDefault(__webpack_require__(3938));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { 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 _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 _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 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 _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

var MATCH_START_QUERY = /[?&#](?:start|t)=([0-9hms]+)/;
var MATCH_END_QUERY = /[?&#]end=([0-9hms]+)/;
var MATCH_START_STAMP = /(\d+)(h|m|s)/g;
var MATCH_NUMERIC = /^\d+$/; // Parse YouTube URL for a start time param, ie ?t=1h14m30s
// and return the start time in seconds

function parseTimeParam(url, pattern) {
  if (url instanceof Array) {
    return undefined;
  }

  var match = url.match(pattern);

  if (match) {
    var stamp = match[1];

    if (stamp.match(MATCH_START_STAMP)) {
      return parseTimeString(stamp);
    }

    if (MATCH_NUMERIC.test(stamp)) {
      return parseInt(stamp);
    }
  }

  return undefined;
}

function parseTimeString(stamp) {
  var seconds = 0;
  var array = MATCH_START_STAMP.exec(stamp);

  while (array !== null) {
    var _array = array,
        _array2 = _slicedToArray(_array, 3),
        count = _array2[1],
        period = _array2[2];

    if (period === 'h') seconds += parseInt(count, 10) * 60 * 60;
    if (period === 'm') seconds += parseInt(count, 10) * 60;
    if (period === 's') seconds += parseInt(count, 10);
    array = MATCH_START_STAMP.exec(stamp);
  }

  return seconds;
}

function parseStartTime(url) {
  return parseTimeParam(url, MATCH_START_QUERY);
}

function parseEndTime(url) {
  return parseTimeParam(url, MATCH_END_QUERY);
} // http://stackoverflow.com/a/38622545


function randomString() {
  return Math.random().toString(36).substr(2, 5);
}

function queryString(object) {
  return Object.keys(object).map(function (key) {
    return "".concat(key, "=").concat(object[key]);
  }).join('&');
}

function getGlobal(key) {
  if (window[key]) {
    return window[key];
  }

  if (window.exports && window.exports[key]) {
    return window.exports[key];
  }

  if (window.module && window.module.exports && window.module.exports[key]) {
    return window.module.exports[key];
  }

  return null;
} // Util function to load an external SDK
// or return the SDK if it is already loaded


var requests = {};

function getSDK(url, sdkGlobal) {
  var sdkReady = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  var isLoaded = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
    return true;
  };
  var fetchScript = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _loadScript["default"];
  var existingGlobal = getGlobal(sdkGlobal);

  if (existingGlobal && isLoaded(existingGlobal)) {
    return Promise.resolve(existingGlobal);
  }

  return new Promise(function (resolve, reject) {
    // If we are already loading the SDK, add the resolve and reject
    // functions to the existing array of requests
    if (requests[url]) {
      requests[url].push({
        resolve: resolve,
        reject: reject
      });
      return;
    }

    requests[url] = [{
      resolve: resolve,
      reject: reject
    }];

    var onLoaded = function onLoaded(sdk) {
      // When loaded, resolve all pending request promises
      requests[url].forEach(function (request) {
        return request.resolve(sdk);
      });
    };

    if (sdkReady) {
      var previousOnReady = window[sdkReady];

      window[sdkReady] = function () {
        if (previousOnReady) previousOnReady();
        onLoaded(getGlobal(sdkGlobal));
      };
    }

    fetchScript(url, function (err) {
      if (err) {
        // Loading the SDK failed – reject all requests and
        // reset the array of requests for this SDK
        requests[url].forEach(function (request) {
          return request.reject(err);
        });
        requests[url] = null;
      } else if (!sdkReady) {
        onLoaded(getGlobal(sdkGlobal));
      }
    });
  });
}

function getConfig(props, defaultProps) {
  return (0, _deepmerge["default"])(defaultProps.config, props.config);
}

function omit(object) {
  var _ref;

  for (var _len = arguments.length, arrays = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    arrays[_key - 1] = arguments[_key];
  }

  var omitKeys = (_ref = []).concat.apply(_ref, arrays);

  var output = {};
  var keys = Object.keys(object);

  for (var _i2 = 0, _keys = keys; _i2 < _keys.length; _i2++) {
    var key = _keys[_i2];

    if (omitKeys.indexOf(key) === -1) {
      output[key] = object[key];
    }
  }

  return output;
}

function callPlayer(method) {
  var _this$player;

  // Util method for calling a method on this.player
  // but guard against errors and console.warn instead
  if (!this.player || !this.player[method]) {
    var message = "ReactPlayer: ".concat(this.constructor.displayName, " player could not call %c").concat(method, "%c \u2013 ");

    if (!this.player) {
      message += 'The player was not available';
    } else if (!this.player[method]) {
      message += 'The method was not available';
    }

    console.warn(message, 'font-weight: bold', '');
    return null;
  }

  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
    args[_key2 - 1] = arguments[_key2];
  }

  return (_this$player = this.player)[method].apply(_this$player, args);
}

function isMediaStream(url) {
  return typeof window !== 'undefined' && typeof window.MediaStream !== 'undefined' && url instanceof window.MediaStream;
}

function isBlobUrl(url) {
  return /^blob:/.test(url);
}

function supportsWebKitPresentationMode() {
  var video = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.createElement('video');
  // Check if Safari supports PiP, and is not on mobile (other than iPad)
  // iPhone safari appears to "support" PiP through the check, however PiP does not function
  var notMobile = /iPhone|iPod/.test(navigator.userAgent) === false;
  return video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function' && notMobile;
}

/***/ }),

/***/ 6193:
/***/ (function(module) {

function _extends() {
  module.exports = _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;
  }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  return _extends.apply(this, arguments);
}

module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ 5709:
/***/ (function(module) {

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : {
    "default": obj
  };
}

module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ 3712:
/***/ (function(module) {

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;
}

module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;

/***/ }),

/***/ 5165:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4903);


var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|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|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|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|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 index = (0,_emotion_memoize__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A)(function (prop) {
  return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
  /* o */
  && prop.charCodeAt(1) === 110
  /* n */
  && prop.charCodeAt(2) < 91;
}
/* Z+1 */
);

/* harmony default export */ __webpack_exports__.A = (index);


/***/ }),

/***/ 4903:
/***/ (function(__unused_webpack_module, __webpack_exports__) {

"use strict";
function memoize(fn) {
  var cache = {};
  return function (arg) {
    if (cache[arg] === undefined) cache[arg] = fn(arg);
    return cache[arg];
  };
}

/* harmony default export */ __webpack_exports__.A = (memoize);


/***/ }),

/***/ 7103:
/***/ (function(__unused_webpack_module, __webpack_exports__) {

"use strict";
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
};

/* harmony default export */ __webpack_exports__.A = (unitlessKeys);


/***/ }),

/***/ 9716:
/***/ (function() {



/***/ }),

/***/ 1819:
/***/ (function() {



/***/ }),

/***/ 3764:
/***/ (function() {



/***/ }),

/***/ 3259:
/***/ (function() {



/***/ }),

/***/ 697:
/***/ (function() {



/***/ }),

/***/ 9682:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   n: function() { return /* binding */ CartIconTypes; }
/* harmony export */ });
var CartIconTypes = {
  CART_ICON: 'cartIcon',
  STAR_ICON: 'starIcon',
  FAVORITE_ICON: 'favoriteIcon',
  BAG_ICON: 'bagIcon'
};

/***/ }),

/***/ 4236:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6540);
/* eslint-disable max-len */

var RemoveItemIcon = function RemoveItemIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#ffffff' : _ref$fill;
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "16",
    height: "16",
    fill: fill
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
    d: "M7.333 11.586c0 .229-.484.413-.692.413-.206 0-.641-.184-.641-.413l.007-5.174c0-.23.425-.413.634-.413.209 0 .682.184.682.413l.01 5.174ZM10 6.412v5.174c0 .229-.463.413-.675.413-.212 0-.658-.184-.658-.413V6.412c0-.23.46-.413.672-.413.211 0 .66.184.66.413Z",
    fill: "#fff"
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "m10.647 3.317 2.463.025c.207 0 .223.46.223.666 0 .206-.032.655-.239.655h-.443l-.004 8.023c0 1.09-.557 1.98-1.654 1.98H5.017c-1.097 0-1.657-.89-1.657-1.981l.002-8.045-.433-.013c-.207 0-.262-.414-.262-.62 0-.205.09-.675.297-.675l2.395.004.008-.544c0-.81.253-1.448 1.346-1.448l2.607-.012c1.17 0 1.315.65 1.315 1.46l.012.525Zm-3.319-.66c-.402 0-.675.139-.675.34l.008.337 2.66-.003.017-.333c0-.203-.28-.343-.682-.343l-1.328.003Zm-1.59 10.716 4.523.007c.686 0 1.081-.012 1.084-.752l-.014-7.964-6.647-.004.027 7.968c0 .739.34.745 1.027.745Z"
  }));
};
/* harmony default export */ __webpack_exports__.A = (RemoveItemIcon);

/***/ }),

/***/ 9854:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  AccessabilityIcon: function() { return /* reexport */ src_AccessabilityIcon; },
  AiAccesibilityIcon: function() { return /* reexport */ AiAccesibilityIcon; },
  AiCreditsIcon: function() { return /* reexport */ src_AiCreditsIcon; },
  AiTranslateIcon: function() { return /* reexport */ src_AiTranslateIcon; },
  ArrowDropdownDown: function() { return /* reexport */ src_ArrowDropdownDown; },
  ArrowLeftIcon: function() { return /* reexport */ src_ArrowLeftIcon; },
  ArrowRightIcon: function() { return /* reexport */ src_ArrowRightIcon; },
  AudioIcon: function() { return /* reexport */ src_AudioIcon; },
  BackgroundSoundOffIcon: function() { return /* reexport */ src_BackgroundSoundOffIcon; },
  BackgroundSoundOnIcon: function() { return /* reexport */ src_BackgroundSoundOnIcon; },
  BehanceIcon: function() { return /* reexport */ src_BehanceIcon; },
  CartElementIcons: function() { return /* reexport */ CartElementIcons; },
  CartIcon: function() { return /* reexport */ src_CartIcon; },
  CartIconTypes: function() { return /* reexport */ CartIconTypes/* CartIconTypes */.n; },
  ClearSearchIcon: function() { return /* reexport */ src_ClearSearchIcon; },
  CloseIcon: function() { return /* reexport */ src_CloseIcon; },
  CopyLinkIcon: function() { return /* reexport */ src_CopyLinkIcon; },
  CreditCardIcon: function() { return /* reexport */ src_CreditCardIcon; },
  DecreaseFontSizeIcon: function() { return /* reexport */ src_DecreaseFontSizeIcon; },
  DownloadIcon: function() { return /* reexport */ src_DownloadIcon; },
  EditorSearchIcon: function() { return /* reexport */ src_EditorSearchIcon; },
  EmbedIcon: function() { return /* reexport */ src_EmbedIcon; },
  EmbedViewIcon: function() { return /* reexport */ src_EmbedViewIcon; },
  EnterFullScreenIcon: function() { return /* reexport */ src_EnterFullScreenIcon; },
  ErrorIcon: function() { return /* reexport */ src_ErrorIcon; },
  ExitFullScreenIcon: function() { return /* reexport */ src_ExitFullScreenIcon; },
  FacebookIcon: function() { return /* reexport */ src_FacebookIcon; },
  FailedIcon: function() { return /* reexport */ src_FailedIcon; },
  FirstPageIcon: function() { return /* reexport */ src_FirstPageIcon; },
  FlipbookLogo: function() { return /* reexport */ src_FlipbookLogo; },
  FormIcon: function() { return /* reexport */ src_FormIcon; },
  GlobalSvgDefs: function() { return /* reexport */ src_GlobalSvgDefs; },
  GoToPageIcon: function() { return /* reexport */ src_GoToPageIcon; },
  HyperlinkIcon: function() { return /* reexport */ src_HyperlinkIcon; },
  IconSizes: function() { return /* reexport */ IconSizes; },
  IncreaseFontSizeIcon: function() { return /* reexport */ src_IncreaseFontSizeIcon; },
  InfoIcon: function() { return /* reexport */ src_InfoIcon; },
  InstagramIcon: function() { return /* reexport */ src_InstagramIcon; },
  LastPageIcon: function() { return /* reexport */ src_LastPageIcon; },
  LinkIcon: function() { return /* reexport */ src_LinkIcon; },
  LinkedinIcon: function() { return /* reexport */ src_LinkedinIcon; },
  LockIcon: function() { return /* reexport */ src_LockIcon; },
  MessengerIcon: function() { return /* reexport */ src_MessengerIcon; },
  MinusIcon: function() { return /* reexport */ src_MinusIcon; },
  NextPageIcon: function() { return /* reexport */ src_NextPageIcon; },
  NoAudioIcon: function() { return /* reexport */ NoAudioIcon; },
  PageMoveDownIcon: function() { return /* reexport */ src_PageMoveDownIcon; },
  PageMoveUpIcon: function() { return /* reexport */ src_PageMoveUpIcon; },
  PagesOverviewIcon: function() { return /* reexport */ src_PagesOverviewIcon; },
  PinterestIcon: function() { return /* reexport */ src_PinterestIcon; },
  PlusIcon: function() { return /* reexport */ src_PlusIcon; },
  PrevPageIcon: function() { return /* reexport */ src_PrevPageIcon; },
  PrintIcon: function() { return /* reexport */ src_PrintIcon; },
  ProductTagIcon: function() { return /* reexport */ src_ProductTagIcon; },
  ProductTagViewIcon: function() { return /* reexport */ src_ProductTagViewIcon; },
  RedditIcon: function() { return /* reexport */ src_RedditIcon; },
  RemoveItemIcon: function() { return /* reexport */ RemoveItemIcon/* default */.A; },
  SearchIcon: function() { return /* reexport */ src_SearchIcon; },
  SearchIconNoResults: function() { return /* reexport */ src_SearchIconNoResults; },
  ShareEmailIcon: function() { return /* reexport */ src_ShareEmailIcon; },
  ShareFacebookIcon: function() { return /* reexport */ src_ShareFacebookIcon; },
  ShareIcon: function() { return /* reexport */ src_ShareIcon; },
  ShareLinkedinIcon: function() { return /* reexport */ src_ShareLinkedinIcon; },
  SharePinterestIcon: function() { return /* reexport */ src_SharePinterestIcon; },
  ShareTwitterIcon: function() { return /* reexport */ src_ShareTwitterIcon; },
  SnapchatIcon: function() { return /* reexport */ src_SnapchatIcon; },
  Social: function() { return /* reexport */ Social; },
  SparkleAiIcon: function() { return /* reexport */ src_SparkleAiIcon; },
  SpotifyIcon: function() { return /* reexport */ src_SpotifyIcon; },
  SuccessfulIcon: function() { return /* reexport */ SuccessfulIcon; },
  TagIcon: function() { return /* reexport */ src_TagIcon; },
  TagViewIcon: function() { return /* reexport */ src_TagViewIcon; },
  TickIcon: function() { return /* reexport */ src_TickIcon; },
  TiktokIcon: function() { return /* reexport */ src_TiktokIcon; },
  TocIcon: function() { return /* reexport */ src_TocIcon; },
  Toggle: function() { return /* reexport */ Toggle; },
  TwitterIcon: function() { return /* reexport */ src_TwitterIcon; },
  UnavailableImage: function() { return /* reexport */ src_UnavailableImage; },
  VideoIcon: function() { return /* reexport */ src_VideoIcon; },
  VideoWidgetIcon: function() { return /* reexport */ src_VideoWidgetIcon; },
  VideoWidgetViewIcon: function() { return /* reexport */ src_VideoWidgetViewIcon; },
  WhatsAppIcon: function() { return /* reexport */ src_WhatsAppIcon; },
  WidgetNextPage: function() { return /* reexport */ src_WidgetNextPage; },
  WidgetPreviousPage: function() { return /* reexport */ src_WidgetPreviousPage; },
  YoutubeIcon: function() { return /* reexport */ src_YoutubeIcon; },
  ZoomIcon: function() { return /* reexport */ src_ZoomIcon; }
});

// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(6540);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/HyperlinkIcon.tsx
/* eslint-disable max-len */

var HyperlinkIcon = function HyperlinkIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M4.57350272 11.0881805c.44888083 0 .66908651-.2202057.8215366-.6521476l.92317-2.58318208c.11010284-.29643074.18632789-.49969752.20326678-.73684211 0-.34724743-.22867513-.63520871-.66908651-.63520871-.31336963 0-.54204476.16938899-.62673926.46581972l-.64367816 2.14277072h-.0169389L3.97217181 7.234581c-.11010284-.34724742-.23714459-.753781-.71143376-.753781-.47428917 0-.60133091.40653358-.71143375.753781l-.59286147 1.85480944h-.0169389l-.64367816-2.14277072C1.21113128 6.65018899.98245614 6.4808.66908651 6.4808.22867514 6.4808 0 6.76876128 0 7.11600871c.0169389.23714459.09316394.44041137.20326679.73684211l.92316999 2.58318208c.15245009.4319419.37265578.6521476.8215366.6521476.47428917 0 .63520871-.245614.7876588-.6944948l.51663642-1.55837874h.0169389l.51663642 1.55837874c.15245009.4488808.31336963.6944948.7876588.6944948zm6.73926198 0c.4488808 0 .6690865-.2202057.8215366-.6521476l.92317-2.58318208c.1101028-.29643074.1863279-.49969752.2032668-.73684211 0-.34724743-.2286752-.63520871-.6690866-.63520871-.3133696 0-.5420447.16938899-.6267392.46581972l-.6436782 2.14277072h-.0169389L10.7114338 7.234581C10.6013309 6.88733358 10.4742892 6.4808 10 6.4808c-.47428917 0-.60133091.40653358-.71143376.753781l-.59286146 1.85480944h-.0169389l-.64367816-2.14277072C7.95039322 6.65018899 7.72171809 6.4808 7.40834846 6.4808c-.44041138 0-.66908651.28796128-.66908651.63520871.0169389.23714459.09316394.44041137.20326679.73684211l.92316999 2.58318208c.15245009.4319419.37265578.6521476.8215366.6521476.47428917 0 .63520871-.245614.7876588-.6944948l.51663642-1.55837874h.01693885l.5166365 1.55837874c.1524501.4488808.3133696.6944948.7876588.6944948zM19 13c.5522847 0 1 .4477153 1 1s-.4477153 1-1 1H1c-.55228475 0-1-.4477153-1-1s.44771525-1 1-1h18zm.3309135-6.5192c.4404114 0 .6690865.28796128.6690865.63520871-.0169389.23714459-.0931639.44041137-.2032668.73684211l-.92317 2.58318208c-.1524501.4319419-.3726558.6521476-.8215366.6521476-.4742892 0-.6352087-.245614-.7876588-.6944948l-.5166364-1.55837874h-.0169389l-.5166364 1.55837874c-.1524501.4488808-.3133697.6944948-.7876588.6944948-.4488808 0-.6690865-.2202057-.8215366-.6521476l-.92317-2.58318208c-.1101029-.29643074-.1863279-.49969752-.2032668-.73684211 0-.34724743.2286751-.63520871.6690865-.63520871.3133696 0 .5420448.16938899.6267393.46581972l.6436781 2.14277072h.0169389l.5928615-1.85480944c.1101028-.34724742.2371446-.753781.7114337-.753781.4742892 0 .601331.40653358.7114338.753781l.5928615 1.85480944h.0169389l.6436781-2.14277072c.0846945-.29643073.3133697-.46581972.6267393-.46581972z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_HyperlinkIcon = (HyperlinkIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/LinkIcon.tsx
/* eslint-disable max-len */

var LinkIcon = function LinkIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M9.1232 7.10186667c.63786667 0 1.3813333.21333333 2.0192.64106666.2133333.10666667.4266667.21333334.6378667.42666667.2133333.2144.32 1.0688-.1066667 1.49653333-.4245333.42666667-1.0624.42666667-1.488 0-.63786667-.64106666-1.59466667-.64106666-2.23253333 0l-3.4016 3.41866667c-.63786667.6410667-.63786667 1.6032 0 2.2442667.63786666.64 1.59466666.64 2.23253333 0L8.80426667 13.2992c.10666666-.1066667.21333333-.1066667.31893333-.1066667.5312.2133334 1.1690667.32 1.7002667.32h.1066666c.1066667 0 .32.1066667.32.2133334 0 .1066666 0 .1066666-.1066666.2133333l-2.76480003 2.9930667C7.63413333 17.68 6.784 18 5.72053333 18 3.70133333 18 2 16.2901333 2 14.2602667c0-.9610667.4256-1.9232 1.06346667-2.6709334l3.4016-3.41866663c.74453333-.7488 1.59466666-1.0688 2.65813333-1.0688zm7.76-4.05973334c1.4890667 1.49546667 1.4890667 3.8464 0 5.2352L13.4816 11.696c-.4256.4266667-1.0634667.8544-1.7013333.9621333-.4213334.0533334-.8469334.0618667-1.2757334.0266667-.6421333-.0533333-.69546663.0042667-1.2757333-.2410667-.5792-.2453333-.74346667-.4266666-1.0624-.7466666-.32-.3210667-.32-.9621334.10666667-1.3898667.42453333-.42666667 1.0624-.42666667 1.488 0 .63786663.6410667 1.59466663.6410667 2.23253333 0l.8501333-.8544 2.4448-2.4576c.6378667-.64106667.6378667-1.6032 0-2.24426667-.6378666-.64-1.5946666-.64-2.2325333 0l-2.0192 1.81653334c0 .10666666-.1066667.10666666-.2133333.10666666-.5312-.21333333-1.06240003-.32-1.7002667-.32h-.10666667c-.10666666 0-.21333333-.10666666-.21333333-.21333333 0-.10666667 0-.21333333.10666667-.32106667l2.65813333-2.7776c1.488-1.38986666 3.8272-1.38986666 5.3152 0z",
    fillRule: "evenodd"
  }));
};
/* harmony default export */ var src_LinkIcon = (LinkIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/PrevPageIcon.tsx
/* eslint-disable max-len */

var PrevPageIcon = function PrevPageIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M10,0 C15.5228475,0 20,4.4771525 20,10 C20,15.5228475 15.5228475,20 10,20 C4.4771525,20 0,15.5228475 0,10 C0,4.4771525 4.4771525,0 10,0 Z M10,2 C5.581722,2 2,5.581722 2,10 C2,14.418278 5.581722,18 10,18 C14.418278,18 18,14.418278 18,10 C18,5.581722 14.418278,2 10,2 Z M9.69703156,6.28784078 L12.7099564,9.2536831 C12.9177208,9.4582008 13.013922,9.73325872 12.9979632,10.0030892 C13.0121646,10.2656804 12.919978,10.5328985 12.7211598,10.7351071 C12.7174559,10.7388741 12.7137213,10.7426108 12.7099564,10.7463169 L9.69703156,13.7121592 C9.30688053,14.0962134 8.68081755,14.0963947 8.29044421,13.7125664 C7.90820811,13.336739 7.90301284,12.7222071 8.27884026,12.339971 C8.28254413,12.336204 8.2862787,12.3324673 8.29004358,12.3287612 L10.655,9.999 L8.29004358,7.6712388 C7.90802516,7.29519012 7.90318572,6.68065531 8.2792344,6.29863689 L8.29044421,6.28743357 L8.29044421,6.28743357 C8.68081755,5.90360534 9.30688053,5.90378659 9.69703156,6.28784078 Z",
    transform: "translate(10.000000, 10.000000) scale(-1, 1) translate(-10.000000, -10.000000) "
  }));
};
/* harmony default export */ var src_PrevPageIcon = (PrevPageIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/NextPageIcon.tsx
/* eslint-disable max-len */

var NextPageIcon = function NextPageIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    d: "M10 0c5.523 0 10 4.477 10 10s-4.477 10-10 10S0 15.523 0 10 4.477 0 10 0zm0 2c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zm-.303 4.288l3.013 2.966c.208.204.304.48.288.75.014.262-.078.529-.277.731l-.011.011-3.013 2.966c-.39.384-1.016.384-1.407 0-.382-.375-.387-.99-.011-1.372l.011-.011 2.365-2.33L8.29 7.671c-.382-.376-.387-.99-.01-1.372l.01-.012c.39-.383 1.017-.383 1.407 0z"
  }));
};
/* harmony default export */ var src_NextPageIcon = (NextPageIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/FirstPageIcon.tsx
/* eslint-disable max-len */

var FirstPageIcon = function FirstPageIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M10,0 C15.5228475,0 20,4.4771525 20,10 C20,15.5228475 15.5228475,20 10,20 C4.4771525,20 0,15.5228475 0,10 C0,4.4771525 4.4771525,0 10,0 Z M10,2 C5.581722,2 2,5.581722 2,10 C2,14.418278 5.581722,18 10,18 C14.418278,18 18,14.418278 18,10 C18,5.581722 14.418278,2 10,2 Z M13,6 C13.5522847,6 14,6.44771525 14,7 L14,13 C14,13.5522847 13.5522847,14 13,14 C12.4477153,14 12,13.5522847 12,13 L12,7 C12,6.44771525 12.4477153,6 13,6 Z M7.69703156,6.28784078 L10.7099564,9.2536831 C10.9177208,9.4582008 11.013922,9.73325872 10.9979632,10.0030892 C11.0121646,10.2656804 10.919978,10.5328985 10.7211598,10.7351071 C10.7174559,10.7388741 10.7137213,10.7426108 10.7099564,10.7463169 L7.69703156,13.7121592 C7.30688053,14.0962134 6.68081755,14.0963947 6.29044421,13.7125664 C5.90820811,13.336739 5.90301284,12.7222071 6.27884026,12.339971 C6.28254413,12.336204 6.2862787,12.3324673 6.29004358,12.3287612 L8.655,9.999 L6.29004358,7.6712388 C5.90802516,7.29519012 5.90318572,6.68065531 6.2792344,6.29863689 L6.29044421,6.28743357 L6.29044421,6.28743357 C6.68081755,5.90360534 7.30688053,5.90378659 7.69703156,6.28784078 Z",
    transform: "translate(10.000000, 10.000000) scale(-1, 1) translate(-10.000000, -10.000000) "
  }));
};
/* harmony default export */ var src_FirstPageIcon = (FirstPageIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/LastPageIcon.tsx
/* eslint-disable max-len */

var LastPageIcon = function LastPageIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    d: "M10 0c5.523 0 10 4.477 10 10s-4.477 10-10 10S0 15.523 0 10 4.477 0 10 0zm0 2c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zm3 4c.552 0 1 .448 1 1v6c0 .552-.448 1-1 1s-1-.448-1-1V7c0-.552.448-1 1-1zm-5.303.288l3.013 2.966c.208.204.304.48.288.75.014.262-.078.529-.277.731l-.011.011-3.013 2.966c-.39.384-1.016.384-1.407 0-.382-.375-.387-.99-.011-1.372l.011-.011 2.365-2.33L6.29 7.671c-.382-.376-.387-.99-.01-1.372l.01-.012c.39-.383 1.017-.383 1.407 0z"
  }));
};
/* harmony default export */ var src_LastPageIcon = (LastPageIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/GoToPageIcon.tsx
/* eslint-disable max-len */

var GoToPageIcon = function GoToPageIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M14,0 C13.5555556,0 13.2222222,0 13,0 C11,0 8,0 4,0 C2.8954305,0 2,0.8954305 2,2 L2,18 C2,19.1045695 2.8954305,20 4,20 L16,20 C17.1045695,20 18,19.1045695 18,18 L18,4 L14,0 Z M12,2 L12,6 C12,6.55228475 12.3837559,7 12.8571429,7 L12.8571429,7 L16,7 L16,17 C16,17.5522847 15.5522847,18 15,18 L5,18 C4.44771525,18 4,17.5522847 4,17 L4,3 C4,2.44771525 4.44771525,2 5,2 L12,2 Z M14,3 L16,5 L14,5 L14,3 Z M9.178362,7.2850957 L12.2062808,10.2662069 C12.4115339,10.468287 12.5066852,10.73997 12.4911532,11.006572 C12.5020611,11.2618945 12.4106878,11.52069 12.2173665,11.7173444 C12.2137015,11.7210725 12.2100062,11.7247707 12.2062808,11.7284385 L9.178362,14.7095497 C8.79247419,15.0894722 8.17320089,15.0897066 7.78702553,14.7100764 C7.40890346,14.3383629 7.40370823,13.7305012 7.77542167,13.3523791 C7.77908663,13.3486509 7.78278199,13.3449528 7.78650736,13.341285 L10.167,10.997 L7.78650736,8.65336038 C7.40866682,8.28136076 7.40393183,7.67349521 7.77593145,7.29565468 C7.77959923,7.29192931 7.78329738,7.28823395 7.78702553,7.28456899 C8.17320089,6.90493876 8.79247419,6.9051732 9.178362,7.2850957 Z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_GoToPageIcon = (GoToPageIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/VideoIcon.tsx
/* eslint-disable max-len */

var VideoIcon = function VideoIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M19.03792963 8.3111519L6.8117099 1.2488222C6.5293021 1.08569273 6.2107427 1 5.8867228 1 4.8447146 1 4 1.86744762 4 2.93749848V17.0621579c0 .3327399.083447.6598725.2423014.9498804.5108562.9326302 1.6612196 1.2634003 2.5694085.7387959l12.22621973-7.0623297c.30116717-.1739656.55002786-.4295237.71943439-.7387959.51085625-.9326302.1887545-2.1139522-.71943439-2.6385567zM6 3l12 7-12 7V3z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_VideoIcon = (VideoIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/VideoWidgetIcon.tsx
/* eslint-disable max-len */

var VideoWidgetIcon = function VideoWidgetIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M3 18c.55228475 0 1 .4477153 1 1s-.44771525 1-1 1H1c-.55228475 0-1-.4477153-1-1s.44771525-1 1-1h2zm5 0c.55228475 0 1 .4477153 1 1s-.44771525 1-1 1H6c-.55228475 0-1-.4477153-1-1s.44771525-1 1-1h2zm5 0c.5522847 0 1 .4477153 1 1s-.4477153 1-1 1h-2c-.5522847 0-1-.4477153-1-1s.4477153-1 1-1h2zm5 0c.5522847 0 1 .4477153 1 1s-.4477153 1-1 1h-2c-.5522847 0-1-.4477153-1-1s.4477153-1 1-1h2zM6.90800298 5c.15192613 0 .30142387.03949107.43479915.11485582l7.18382227 4.05927503c.4402438.24876317.6024656.82013994.3623327 1.27620575-.0834867.1585597-.2092738.2888675-.3623327.3753546l-7.18382227 4.0592751c-.44024373.2487631-.991798.0807111-1.23193095-.3753547C6.03812103 14.3714429 6 14.2165723 6 14.0591861V5.94063601C6 5.42113709 6.40652678 5 6.90800298 5zM8 7.52509769v4.94868611l4-2.47387276-4-2.47481335zM3 0c.55228475 0 1 .44771525 1 1s-.44771525 1-1 1H1c-.55228475 0-1-.44771525-1-1s.44771525-1 1-1h2zm5 0c.55228475 0 1 .44771525 1 1s-.44771525 1-1 1H6c-.55228475 0-1-.44771525-1-1s.44771525-1 1-1h2zm5 0c.5522847 0 1 .44771525 1 1s-.4477153 1-1 1h-2c-.5522847 0-1-.44771525-1-1s.4477153-1 1-1h2zm5 0c.5522847 0 1 .44771525 1 1s-.4477153 1-1 1h-2c-.5522847 0-1-.44771525-1-1s.4477153-1 1-1h2z",
    fillRule: "evenodd"
  }));
};
/* harmony default export */ var src_VideoWidgetIcon = (VideoWidgetIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/VideoWidgetViewIcon.tsx
/* eslint-disable max-len */

var VideoWidgetViewIcon = function VideoWidgetViewIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 72 71",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M0.405457 35.8101C0.405457 16.5375 16.3447 0.91394 36.0068 0.91394C55.6689 0.91394 71.6082 16.5375 71.6082 35.8101C71.6082 55.0827 55.6689 70.7062 36.0068 70.7062C16.3447 70.7062 0.405457 55.0827 0.405457 35.8101ZM65.912 35.8101C65.912 19.6211 52.523 6.49732 36.0068 6.49732C19.4907 6.49732 6.10168 19.6211 6.10168 35.8101C6.10168 51.9991 19.4907 65.1228 36.0068 65.1228C52.523 65.1228 65.912 51.9991 65.912 35.8101ZM28.0089 49.5682L49.5628 36.9878C49.7563 36.8748 49.9189 36.7195 50.0373 36.5346C50.4491 35.8909 50.2371 35.05 49.5638 34.6563L28.0099 22.0524C27.7854 21.9211 27.5273 21.8516 27.2642 21.8516C26.4749 21.8516 25.8351 22.4633 25.8351 23.2178V48.4022C25.8351 48.6534 25.9075 48.8997 26.0444 49.1141C26.4557 49.7581 27.3352 49.9614 28.0089 49.5682Z"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M49.5628 36.9878L49.6889 37.2037L49.6889 37.2037L49.5628 36.9878ZM28.0089 49.5682L28.1349 49.7841L28.1349 49.7841L28.0089 49.5682ZM50.0373 36.5346L50.2478 36.6693L50.2478 36.6693L50.0373 36.5346ZM49.5638 34.6563L49.69 34.4404L49.69 34.4404L49.5638 34.6563ZM28.0099 22.0524L28.1361 21.8366L28.1361 21.8366L28.0099 22.0524ZM26.0444 49.1141L26.2551 48.9795L26.2551 48.9795L26.0444 49.1141ZM36.0068 0.66394C16.2114 0.66394 0.155457 16.3947 0.155457 35.8101H0.655457C0.655457 16.6802 16.4781 1.16394 36.0068 1.16394V0.66394ZM71.8582 35.8101C71.8582 16.3947 55.8023 0.66394 36.0068 0.66394V1.16394C55.5356 1.16394 71.3582 16.6802 71.3582 35.8101H71.8582ZM36.0068 70.9562C55.8023 70.9562 71.8582 55.2255 71.8582 35.8101H71.3582C71.3582 54.9399 55.5356 70.4562 36.0068 70.4562V70.9562ZM0.155457 35.8101C0.155457 55.2255 16.2114 70.9562 36.0068 70.9562V70.4562C16.4781 70.4562 0.655457 54.9399 0.655457 35.8101H0.155457ZM36.0068 6.74732C52.3897 6.74732 65.662 19.7639 65.662 35.8101H66.162C66.162 19.4783 52.6563 6.24732 36.0068 6.24732V6.74732ZM6.35168 35.8101C6.35168 19.7639 19.624 6.74732 36.0068 6.74732V6.24732C19.3573 6.24732 5.85168 19.4783 5.85168 35.8101H6.35168ZM36.0068 64.8728C19.624 64.8728 6.35168 51.8563 6.35168 35.8101H5.85168C5.85168 52.1418 19.3573 65.3728 36.0068 65.3728V64.8728ZM65.662 35.8101C65.662 51.8563 52.3897 64.8728 36.0068 64.8728V65.3728C52.6563 65.3728 66.162 52.1418 66.162 35.8101H65.662ZM49.4368 36.7718L27.8829 49.3523L28.1349 49.7841L49.6889 37.2037L49.4368 36.7718ZM49.8267 36.3999C49.7302 36.5507 49.5968 36.6784 49.4368 36.7718L49.6889 37.2037C49.9158 37.0712 50.1077 36.8883 50.2478 36.6693L49.8267 36.3999ZM49.4376 34.8721C49.9928 35.1967 50.1592 35.8801 49.8267 36.3999L50.2478 36.6693C50.739 35.9018 50.4815 34.9032 49.69 34.4404L49.4376 34.8721ZM27.8837 22.2682L49.4376 34.8721L49.69 34.4404L28.1361 21.8366L27.8837 22.2682ZM27.2642 22.1016C27.4835 22.1016 27.698 22.1596 27.8837 22.2682L28.1361 21.8366C27.8728 21.6826 27.5711 21.6016 27.2642 21.6016V22.1016ZM26.0851 23.2178C26.0851 22.6118 26.6023 22.1016 27.2642 22.1016V21.6016C26.3476 21.6016 25.5851 22.3147 25.5851 23.2178H26.0851ZM26.0851 48.4022V23.2178H25.5851V48.4022H26.0851ZM26.2551 48.9795C26.1435 48.8048 26.0851 48.605 26.0851 48.4022H25.5851C25.5851 48.7017 25.6715 48.9946 25.8338 49.2486L26.2551 48.9795ZM27.8829 49.3523C27.3211 49.6801 26.5918 49.5066 26.2551 48.9795L25.8338 49.2486C26.3197 50.0095 27.3493 50.2426 28.1349 49.7841L27.8829 49.3523Z"
  }));
};
/* harmony default export */ var src_VideoWidgetViewIcon = (VideoWidgetViewIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/AudioIcon.tsx
/* eslint-disable max-len */

var AudioIcon = function AudioIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M12.4638799 3.14406199L7.82942088 5.93044304c-.07652995.04573984-.16550303.07043748-.25489712.07043748h-3.5786171C2.89389412 6.00088052 2 6.89641597 2 8.00045198V11.999548c0 1.104036.89389412 1.9995715 1.99590666 1.9995715h3.5786171c.08939409 0 .17836717.0246976.25714249.0717965l4.63221365 2.785022c.6651463.3998956 1.5114665-.0800916 1.5114665-.8572471V4.00130907c0-.77715549-.8463202-1.25714262-1.5114665-.85724708zm2.9976725 1.99750941c.4736811-.28226542 1.0861078-.12634693 1.3678091.34825077.158954.26783113.3779251.72171468.5920312 1.33198537.8490801 2.42004056.8490801 5.07773146-.5763603 7.66100136-.2666854.4832208-.8738729.6584475-1.356208.3912725-.4823352-.2671751-.6571939-.8754774-.3905554-1.3586982 1.1159994-2.0223945 1.1159994-4.10435393.4401876-6.03048857-.1670935-.47628483-.3293688-.81267886-.4245167-.97300262-.2817481-.47455084-.1261154-1.08810205.3476125-1.37032061zm-3.4821126.62578287v8.46529143l-3.12299263-1.8776298c-.38947943-.2327764-.8315849-.3554679-1.28192341-.3554679h-3.5786171V8.00045198h3.5786171c.45033851 0 .89249076-.1226915 1.27967803-.35410884l3.12523801-1.87898887z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_AudioIcon = (AudioIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/NoAudioIcon.tsx
/* eslint-disable max-len */

var NoAudioIcon_AudioIcon = function AudioIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    fill: fill,
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M5.841 5.93l4.644-2.786A1 1 0 0112 4.001V16a1 1 0 01-1.515.857L5.844 14.07a.504.504 0 00-.258-.072H2a2 2 0 01-2-2V8a2 2 0 012-2h3.586c.09 0 .179-.024.255-.07zm1.04 6.425l3.136 1.878V5.767l-3.139 1.88A2.513 2.513 0 015.593 8H2v4h3.593c.453 0 .897.122 1.288.355z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    d: "M13.318 7.317a1.084 1.084 0 011.532 0L16 8.467l1.15-1.15a1.084 1.084 0 111.533 1.533L17.533 10l1.15 1.15c.39.39.42 1.005.09 1.43l-.09.102a1.084 1.084 0 01-1.533 0L16 11.532l-1.15 1.15a1.084 1.084 0 11-1.532-1.532L14.466 10l-1.15-1.15a1.084 1.084 0 01-.09-1.43l.09-.103z",
    fill: "nonzero"
  }));
};
/* harmony default export */ var NoAudioIcon = (NoAudioIcon_AudioIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/PlusIcon.tsx
/* eslint-disable max-len */

var PlusIcon = function PlusIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M10 1c.5522847 0 1 .44771525 1 1v7h7c.5522847 0 1 .44771525 1 1 0 .5522847-.4477153 1-1 1h-7.001L11 18c0 .5522847-.4477153 1-1 1-.55228475 0-1-.4477153-1-1l-.001-7H2c-.55228475 0-1-.4477153-1-1 0-.55228475.44771525-1 1-1h7V2c0-.55228475.44771525-1 1-1z",
    fillRule: "evenodd"
  }));
};
/* harmony default export */ var src_PlusIcon = (PlusIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/MinusIcon.tsx
/* eslint-disable max-len */

var MinusIcon = function MinusIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("rect", {
    x: "1",
    y: "9",
    width: "18",
    height: "2",
    rx: "1",
    fillRule: "evenodd"
  }));
};
/* harmony default export */ var src_MinusIcon = (MinusIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/TagIcon.tsx
/* eslint-disable max-len */

var TagIcon = function TagIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M10 1c4.9705627 0 9 4.02943725 9 9 0 4.9705627-4.0294373 9-9 9-4.97056275 0-9-4.0294373-9-9 0-4.97056275 4.02943725-9 9-9zm0 2c-3.86599325 0-7 3.13400675-7 7 0 3.8659932 3.13400675 7 7 7 3.8659932 0 7-3.1340068 7-7 0-3.86599325-3.1340068-7-7-7z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_TagIcon = (TagIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/TagViewIcon.tsx
/* eslint-disable max-len */

var TagViewIcon = function TagViewIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "0 0 12 12",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    d: "M6 12A6 6 0 1 0 6 0a6 6 0 0 0 0 12zm0-2.25a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5z"
  }));
};
/* harmony default export */ var src_TagViewIcon = (TagViewIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ProductTagIcon.tsx
/* eslint-disable max-len */

var ProductTagIcon = function ProductTagIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M17.1250117 0h-4.7572734c-1.1668711 0-2.269433.45645766-3.0943568 1.2813815L.93259872 9.62293772C.33820218 10.2173343 0 11.0343611 0 11.8765c0 .8396878.3386051 1.656529.93260092 2.2505762l4.94103058 4.9410306C6.46752335 19.6619472 7.28459447 20 8.12648828 20c.83968784 0 1.656529-.3386051 2.25057622-.9326009l8.3415188-8.3415189C19.5433581 9.90206087 20 8.79933445 20 7.63226172V2.87498828C20 1.28847697 18.711523 0 17.1250117 0zm0 2C17.6069535 2 18 2.39304647 18 2.87498828v4.75727344c0 .63651449-.2458059 1.23010126-.6952204 1.67899539L8.9628815 17.6531549C8.74378442 17.8722331 8.43556317 18 8.12648828 18c-.3117675 0-.6200764-.1275589-.83867385-.3461374l-4.94096937-4.9409694C2.12776693 12.4937961 2 12.1855749 2 11.8765c0-.3118723.12760625-.6201427.34684506-.8393815l8.34078274-8.34155622C11.1373522 2.24583793 11.7311675 2 12.3677383 2h4.7572734zM14.5 4c-.8284271 0-1.5.67157288-1.5 1.5S13.6715729 7 14.5 7 16 6.32842712 16 5.5 15.3284271 4 14.5 4z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_ProductTagIcon = (ProductTagIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ProductTagViewIcon.tsx
/* eslint-disable max-len */

var ProductTagViewIcon = function ProductTagViewIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M16.875 10a6.875 6.875 0 11-13.75 0 6.875 6.875 0 0113.75 0zM20 10c0 5.523-4.477 10-10 10S0 15.523 0 10 4.477 0 10 0s10 4.477 10 10zm-10 2.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z"
  }));
};
/* harmony default export */ var src_ProductTagViewIcon = (ProductTagViewIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/FormIcon.tsx
/* eslint-disable max-len */

var FormIcon = function FormIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M19 14c.5522847 0 1 .4477153 1 1s-.4477153 1-1 1h-9c-.55228475 0-1-.4477153-1-1s.44771525-1 1-1h9zm0-5c.5522847 0 1 .44771525 1 1 0 .5522847-.4477153 1-1 1H1c-.55228475 0-1-.4477153-1-1 0-.55228475.44771525-1 1-1h18zm0-5c.5522847 0 1 .44771525 1 1s-.4477153 1-1 1H1c-.55228475 0-1-.44771525-1-1s.44771525-1 1-1h18z",
    fillRule: "evenodd"
  }));
};
/* harmony default export */ var src_FormIcon = (FormIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/EmbedIcon.tsx
/* eslint-disable max-len */

var EmbedIcon = function EmbedIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M5.48577522,3.94289296 C5.89353586,4.13804491 6.06588925,4.62680214 5.8707373,5.03456278 C5.85164747,5.07445005 5.82935671,5.11272475 5.80408385,5.14901109 L2.164,10.375 L5.80408385,15.6015876 C6.06244386,15.9725366 5.97117249,16.4826923 5.60022354,16.7410523 C5.56393719,16.7663252 5.52566249,16.7886159 5.48577522,16.8077057 C4.98483254,17.0474541 4.38395873,16.8888765 4.06655792,16.4331578 L0.31112345,11.0448719 C0.102924844,10.8782032 -0.00905613789,10.6204785 0.00595457264,10.3589664 C0.000895582438,10.1123631 0.107655086,9.86881563 0.311114188,9.70592835 L4.06655792,4.31744094 C4.38395873,3.86172221 4.98483254,3.7031446 5.48577522,3.94289296 Z M14.5142248,3.94289296 C15.0151675,3.7031446 15.6160413,3.86172221 15.9334421,4.31744094 L15.9334421,4.31744094 L19.6888858,9.70592835 C19.8924777,9.86892195 19.9992437,10.1126811 19.9940454,10.3589664 C20.0090868,10.6210134 19.8966165,10.8792575 19.6875978,11.0458935 L19.6875978,11.0458935 L15.9334421,16.4331578 C15.6160413,16.8888765 15.0151675,17.0474541 14.5142248,16.8077057 C14.4743375,16.7886159 14.4360628,16.7663252 14.3997765,16.7410523 C14.0288275,16.4826923 13.9375561,15.9725366 14.1959162,15.6015876 L14.1959162,15.6015876 L17.8367781,10.3753448 L14.1959162,5.14901109 C14.1706433,5.11272475 14.1483525,5.07445005 14.1292627,5.03456278 C13.9341107,4.62680214 14.1064641,4.13804491 14.5142248,3.94289296 Z M11.4033238,0.726228476 C11.5176584,0.256404361 12.0550658,-0.0745250391 12.6036567,-0.0129230279 C13.1130626,0.0442788395 13.4529885,0.419824958 13.4074077,0.849350042 L13.3899474,0.949309092 L8.93057563,19.2737715 C8.81624102,19.7435956 8.27883367,20.074525 7.73024272,20.012923 C7.22083684,19.9557212 6.88091092,19.580175 6.92649177,19.15065 L6.94395208,19.0506909 L11.4033238,0.726228476 Z"
  }));
};
/* harmony default export */ var src_EmbedIcon = (EmbedIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/EmbedViewIcon.tsx
/* eslint-disable max-len */

var EmbedViewIcon = function EmbedViewIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "0 0 54 40",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M6.963 20.053L18 25.349v7.378L0 23.11v-6.218l18-9.618v7.378L6.963 20.053zM24.28 40H18L29.824 0H36L24.28 40zm22.488-20.053L36 14.598V7.273l18 9.618v6.192l-18 9.644v-7.352l10.768-5.428z"
  }));
};
/* harmony default export */ var src_EmbedViewIcon = (EmbedViewIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/CartIcon.tsx
/* eslint-disable max-len */

var CartIcon = function CartIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M19.582882 4.24737631c-.3597362-.44358491-.9055429-.69048595-1.4720241-.69048595H5.81780299c-.35146642 0-.68639325.10043432-.97583618.28037914l-.62850466-2.2221093C4.11008967 1.2510858 3.78343265 1 3.41129173 1H.63263955C.28530805 1 0 1.2845639 0 1.64026878v.06695621c0 .35152012.28117314.64026879.63263956.64026879h2.38997166l1.21979522 4.3647081 1.67876903 6.02187432c-.95516169.2427163-1.66222943 1.1173318-1.66222943 2.1551531 0 1.1759185.9055429 2.1425988 2.05090994 2.2179246-.09510268.2761943-.14058657.5816821-.11577717.8955393.08269798 1.0629299.93862208 1.9208064 1.98888645 1.9919473 1.25287442.0878801 2.29900384-.9206479 2.29900384-2.1677073 0-.2510858-.041349-.4896174-.119912-.7155946h2.5140186c-.1033725.2971182-.1447215.6277145-.1075074.9666803.1157772 1.0294518.9551617 1.8412959 1.9806167 1.9166216 1.2528744.0878801 2.3031388-.9164631 2.3031388-2.1677073 0-1.2093966-.9923758-2.176077-2.1832267-2.176077H6.47111704c-.40935501 0-.75668653-.3222267-.77322612-.7323335-.0165396-.4352154.32665702-.7909203.75255163-.7909203H16.469303c.8517892 0 1.596071-.5900516 1.802816-1.4270043l1.6704992-6.80442506c.1447215-.58586686.0124047-1.18428801-.3597362-1.64879673zM14.9063111 17.1071539c.3886806 0 .7070678.3222267.7070678.7155945 0 .3933677-.3183872.7155945-.7070678.7155945-.3886805 0-.7070677-.3222268-.7070677-.7155945 0-.3933678.3142523-.7155945.7070677-.7155945zm-6.57035458 0c.38868052 0 .70706774.3222267.70706774.7155945 0 .3933677-.31838722.7155945-.70706774.7155945-.38868051 0-.70706774-.3222268-.70706774-.7155945 0-.3933678.31425233-.7155945.70706774-.7155945zM5.73923991 6.70383235l-.32252213-1.1508099c-.04961879-.17576006.0206745-.30548772.07029328-.36825917.04548389-.06277145.15299127-.16739053.33079193-.16739053h1.3479771l.36800601 1.69064436H5.73923991v-.00418476zm.40522011 1.45629762h1.70357841l.33906173 1.56510147H6.57862442l-.4341644-1.56510147zm1.56712674 4.50280533c-.18607045 0-.35146642-.1255429-.40108521-.3096725l-.32665702-1.1717337h1.51750796l.32252212 1.4772214H7.71158676v.0041848zm3.60149714 0h-1.0171852l-.32252215-1.4772215H11.308949v1.4772215h.0041349zm0-2.93770386H9.65912422L9.3200625 8.16012997h1.9930214v1.56510147zm0-3.02139909H9.00581017l-.36800602-1.69064436h2.67527975v1.69064436zm2.580177 5.95910295h-1.1370973v-1.4772215h1.4430798l-.3059825 1.4772215zm.611965-2.93770386h-1.7490623V8.16012997h2.0757194l-.3266571 1.56510147zm-1.7490623-3.02139909V5.01318799h2.7290334l-.3514664 1.69064436h-2.377567zm4.1224944 5.64106095c-.0454839.1883143-.2108799.3222267-.4052201.3222267h-1.108153l.3101175-1.4772214h1.4885636l-.285308 1.1549947zm.6409094-2.61966186H15.97725l.326657-1.56510147h1.600206l-.3845456 1.56510147zm1.0254549-4.18894804l-.285308 1.16336419h-1.6539596l.3514664-1.69064437h1.1825811c.1778007 0 .2811732.10043432.326657.16320577.0496188.06277145.124047.19249911.0785631.36407441z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_CartIcon = (CartIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/CreditCardIcon.tsx
/* eslint-disable max-len */

var CreditCardIcon = function CreditCardIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M17.3011769 3H2.69882308C1.21067639 3 0 4.36290384 0 6.03816642v7.92366718C0 15.6370962 1.21067639 17 2.69882308 17H17.3011769C18.7893236 17 20 15.6370962 20 13.9618336V6.03816642C20 4.36290384 18.7893236 3 17.3011769 3zM3.01091886 5H16.9890811C17.5465093 5 18 5.55901968 18 6.24616343V7H2v-.75383657C2 5.55901968 2.45349071 5 3.01091886 5zM17.9890886 9L18 13.8992816C18 14.5062259 17.5468186 15 16.9897705 15H3.02114086c-.557048 0-1.01022945-.4937741-1.01022945-1.1007184L2 9h15.9890886zM5.14864865 10h-1.2972973C3.38116216 10 3 10.4477143 3 11s.38116216 1 .85135135 1h1.2972973C5.61883784 12 6 11.5522857 6 11s-.38116216-1-.85135135-1z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_CreditCardIcon = (CreditCardIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/InstagramIcon.tsx
/* eslint-disable max-len */

var InstagramIcon = function InstagramIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M14.0173188 0C17.2968478 0 19.965 2.66811594 19.965 5.94768116v8.06963764c0 3.2795653-2.6681159 5.9476812-5.9476812 5.9476812H5.94768116C2.66811594 19.965 0 17.2968841 0 14.0173188V5.94768116C0 2.66811594 2.66811594 0 5.94768116 0zm0 2.00847826H5.94768116c-2.17554348 0-3.9392029 1.76362319-3.9392029 3.9392029v8.06963764c0 2.1755435 1.76365942 3.9392029 3.9392029 3.9392029h8.06963764c2.1755435 0 3.9392029-1.7636594 3.9392029-3.9392029V5.94768116c0-2.17557971-1.7636594-3.9392029-3.9392029-3.9392029zM9.9825 4.81884058c2.8472464 0 5.1636594 2.31637681 5.1636594 5.16362319 0 2.84724633-2.316413 5.16365943-5.1636594 5.16365943-2.84724638 0-5.16365942-2.3164493-5.16365942-5.16365943 0-2.84721015 2.31641304-5.16362319 5.16365942-5.16362319zm0 2.00847826c-1.74253623 0-3.15518116 1.4126087-3.15518116 3.15518116 0 1.7425725 1.4126087 3.1551812 3.15518116 3.1551812 1.7425362 0 3.1551812-1.412645 3.1551812-3.1551812 0-1.74257246-1.4126087-3.15518116-3.1551812-3.15518116zm5.1736594-3.20702898c.6833523 0 1.2373189.55396651 1.2373189 1.23731884 0 .68335232-.5539666 1.23731884-1.2373189 1.23731884s-1.2373188-.55396652-1.2373188-1.23731884c0-.68335233.5539665-1.23731884 1.2373188-1.23731884z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_InstagramIcon = (InstagramIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/YoutubeIcon.tsx
/* eslint-disable max-len */

var YoutubeIcon = function YoutubeIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M19.15 5.25272727c-.5425-.91236363-1.13125-1.08018182-2.33-1.144C15.6225 4.03190909 12.61125 4 10.0025 4c-2.61375 0-5.62625.03190909-6.8225.10754545-1.19625.065-1.78625.23163637-2.33375 1.14518182C.2875 6.16390909 0 7.73336364 0 10.4964545v.0094546c0 2.7512727.2875 4.3325454.84625 5.2342727.5475.9123637 1.13625 1.0778182 2.3325 1.1546364C4.37625 16.961 7.38875 17 10.0025 17c2.60875 0 5.62-.039 6.81875-.104 1.19875-.0768182 1.7875-.2422727 2.33-1.1546364.56375-.9017272.84875-2.483.84875-5.2342727v-.0059091-.0035454c0-2.76427276-.285-4.33372731-.85-5.24490913zM7.5 14.0454545V6.95454545L13.75 10.5 7.5 14.0454545z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_YoutubeIcon = (YoutubeIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/FacebookIcon.tsx
/* eslint-disable max-len */

var FacebookIcon = function FacebookIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M11.25 6.875v-2.5c0-.69.56-1.25 1.25-1.25h1.25V0h-2.5C9.17875 0 7.5 1.67875 7.5 3.75v3.125H5V10h2.5v10h3.75V10h2.5L15 6.875h-3.75z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_FacebookIcon = (FacebookIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/MessengerIcon.tsx
/* eslint-disable max-len */

var MessengerIcon = function MessengerIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M10 0c5.6338028 0 10 4.12681288 10 9.70032417 0 5.57351133-4.3661972 9.70032413-10 9.70032413-1.01207243 0-1.98390342-.1327984-2.89537223-.3843107-.17706238-.0482903-.36418511-.0342056-.5331992.040242l-1.98390342.8752626c-.51911469.2273671-1.10462777-.1408469-1.12273642-.7082585l-.05432595-1.7786946c-.00804829-.2193186-.10663984-.4225405-.26961771-.5694237C1.19517103 15.1350007 0 12.6158541 0 9.70032417 0 4.12681288 4.36619718 0 10 0zm5.9224704 7.46814307c.2823356-.44591213-.2663166-.95007404-.684814-.63070454l-3.1397318 2.3902497c-.2122523.16068905-.5045998.16269767-.7188545.00200861L9.05430694 7.48019475c-.69682825-.52424804-1.6940135-.33945563-2.15856566.39971403L3.97226646 12.5318569c-.28233558.4459122.26631654.9500741.68481397.6307046l3.14173424-2.3922583c.21225228-.1606891.50459976-.1626977.71885442-.0020087l2.32476321 1.7495021c.6968282.5242481 1.6940135.3394557 2.1585656-.399714z",
    fillRule: "evenodd"
  }));
};
/* harmony default export */ var src_MessengerIcon = (MessengerIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/TwitterIcon.tsx
/* eslint-disable max-len */

var TwitterIcon = function TwitterIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M1.016.667 7.89 9.859.972 17.333H2.53l6.057-6.543 4.894 6.543h5.3l-7.263-9.71 6.44-6.956H16.4l-5.578 6.026L6.314.667H1.016Zm2.29 1.147H5.74l10.749 14.372h-2.434L3.305 1.814Z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_TwitterIcon = (TwitterIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/PinterestIcon.tsx
/* eslint-disable max-len */

var PinterestIcon = function PinterestIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M10.3964063 0C4.91515625 0 2.00015625 3.5125 2.00015625 7.3425c0 1.77625.9925 3.99125 2.58125 4.69375.24125.10875.3725.0625.42625-.16125.0475-.17.25625-.98875.3575-1.375.03125-.12375.015-.23125-.085-.3475-.5275-.61-.94625-1.72125-.94625-2.76375 0-2.67125 2.12375-5.265 5.73750005-5.265 3.125 0 5.31125 2.03 5.31125 4.93375 0 3.28125-1.73625 5.55125-3.9925 5.55125-1.24875 0-2.17875005-.98-1.88375005-2.1925.35625-1.44375 1.05500005-2.99625 1.05500005-4.0375 0-.93375-.5275-1.70625-1.60500005-1.70625-1.27125 0-2.3025 1.25875-2.3025 2.94875 0 1.07375.38 1.79875.38 1.79875s-1.2575 5.08-1.49125 6.02875c-.395 1.60625.05375 4.2075.0925 4.43125.02375.12375.1625.1625.24.06125.12375-.1625 1.64375-2.33125 2.07-3.89875.155-.57125.79125-2.8875.79125-2.8875.41875.75625 1.62750005 1.39 2.91500005 1.39 3.83 0 6.5975-3.36625 6.5975-7.54375-.01375-4.005-3.44125-7.00125-7.8525-7.00125z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_PinterestIcon = (PinterestIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/SpotifyIcon.tsx
/* eslint-disable max-len */

var SpotifyIcon = function SpotifyIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M10 0C4.48625 0 0 4.48625 0 10s4.48625 10 10 10 10-4.48625 10-10S15.51375 0 10 0zm4.5875 14.435c-.1225.17375-.315.26625-.51125.26625-.125 0-.25-.03625-.35875-.11375-2.34375-1.6475-6.2425-1.73875-8.875-1.125-.33375.07875-.6725-.13125-.75-.4675-.0775-.33625.13-.6725.4675-.75125 2.89375-.67 7.21875-.5475 9.875 1.32125.2825.19875.35.5875.1525.87zm1.22-2.43875c-.1225.17-.31375.26-.5075.26-.1275 0-.25375-.0375-.365-.1175C12.21625 10.1875 8.87625 9.7025 4.41875 10.6125c-.33625.06625-.66875-.14875-.7375-.4875-.07-.3375.14875-.66875.48625-.7375 4.82125-.98375 8.47375-.43375 11.49625 1.735.28.2025.345.5925.14375.87375zm1.2325-3.275c-.12125.17875-.31875.27375-.5175.27375-.12125 0-.24375-.035-.35125-.1075-3.44625-2.33875-8.685-2.35-12.07625-1.15-.325.1125-.6825-.05625-.7975-.3825-.115-.325.055-.6825.38125-.7975 3.68875-1.30375 9.405-1.27625 13.19625 1.295.285.19375.3575.5825.165.86875z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_SpotifyIcon = (SpotifyIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/LinkedinIcon.tsx
/* eslint-disable max-len */

var LinkedinIcon = function LinkedinIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "-1 0 14 15",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    fillOpacity: "1",
    fillRule: "evenodd",
    d: "M4.9 7.465c0-1.208-.035-2.22-.07-3.09h2.31l.123 1.346h.052c.35-.633 1.207-1.564 2.643-1.564 1.75 0 3.062 1.328 3.062 4.18v5.728h-2.66v-5.37c0-1.25-.385-2.1-1.348-2.1-.735 0-1.172.574-1.364 1.13-.07.197-.088.475-.088.752v5.588H4.9v-6.6zm-1.975-5.94c0 .842-.563 1.525-1.49 1.525C.563 3.05 0 2.367 0 1.525 0 .662.58 0 1.47 0s1.437.662 1.455 1.525zM.073 14.065V4.253h2.8v9.81h-2.8z"
  }));
};
/* harmony default export */ var src_LinkedinIcon = (LinkedinIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/SnapchatIcon.tsx
/* eslint-disable max-len */

var SnapchatIcon = function SnapchatIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M19.9082668 14.3927015c-.1385415-.3785499-.4039167-.5795326-.704415-.7473434-.0565874-.0331719-.1092722-.0604899-.1522005-.0800028-.0897593-.0468309-.1814698-.0917106-.2731803-.1385415-.9385697-.4975785-1.672254-1.1258932-2.1795889-1.869334-.1717134-.2517162-.290742-.4780656-.3746473-.663438-.0429284-.1248824-.0409771-.1951288-.0097565-.2595213.0234155-.0487822.0858567-.0995157.1209799-.1248825.1619569-.1073208.3278164-.2146417.4409911-.2868393.2009827-.1307363.3609883-.23415461.4624553-.30440099.3863551-.26927776.6556328-.55611712.8234436-.87612838.2380572-.45074756.2673265-.96588764.0839054-1.4498071-.2536675-.67124313-.8897874-1.08881879-1.6585949-1.08881879-.1600057 0-.3219626.01756159-.4819682.05268478-.0429284.00975644-.0839054.01951288-.1248825.02926932.0078052-.45660143-.0039025-.94442347-.0448796-1.42053778-.1443953-1.67810782-.731733-2.55813878-1.3444375-3.25865123-.2556188-.29269322-.7005125-.72002533-1.367853-1.1024778C12.1928734.26927776 11.1391778 0 9.98986908 0c-1.14540615 0-2.19910175.26927777-3.1298662.80197943-.67124313.38245248-1.11613683.81173588-1.36980429 1.10247781-.61270448.70051245-1.20004222 1.58054341-1.34443754 3.25865123-.04097705.47611431-.0507335.96393635-.04487963 1.42053778-.04097705-.00975644-.08390539-.01951288-.12488244-.02926932-.16000563-.03512319-.32391384-.05268478-.48196818-.05268478-.76880753 0-1.40492747.41757566-1.65859493 1.08881879-.18342109.48391946-.15415177.99905954.08390539 1.4498071.16781078.32001126.43903983.60685062.8234436.87612839.10341827.07219766.26147261.17561597.46245529.30440097.10927214.0702464.26732648.1736646.42342953.2770829.02341546.0156103.10732085.0780515.13659018.1365902.03317189.0663438.03317189.1385414-.01561031.271229-.0819541.1814698-.20098268.4039167-.36879346.649779-.49757848.7278305-1.20979866 1.3444375-2.11714765 1.8361621-.48196818.2556188-.98149795.4253809-1.19223707.9990596-.16000563.4331859-.05463607.9268619.34928058 1.3424862.1326876.1424441.30049838.2692778.5112375.3863551.49562719.2731803.91710543.4078192 1.24882442.4995298.05853864.0175615.19317753.0604899.25171617.1131747.1482979.128785.12683373.3239138.32391384.6088019.11902857.1775672.25561875.2985471.36879346.3765986.4117218.2848881.87612838.3024497 1.367853.3219625.44294241.0175616.94637476.0370745 1.52005348.2263495.23805715.0780515.48587075.230252.77075882.4058679.68685343.4234295 1.62932561 1.0010108 3.20401516 1.0010108 1.5766408 0 2.5230156-.5814838 3.2157229-1.0049134.2848881-.1736646.5307504-.3258651.7610024-.4019653.5736787-.189275 1.077111-.2087879 1.5200534-.2263495.4917247-.0195128.95418-.0370744 1.367853-.3219625.1287851-.0897593.2926933-.2361059.4214783-.4585527.1404927-.2400085.1385414-.4097705.271229-.5248965.0546361-.046831.1736647-.087808.2380572-.1073209.3336703-.0917105.7610024-.2263494 1.266386-.5053836.2243981-.1229312.3980628-.2575701.5366043-.4117218l.0058538-.0058539c.3765986-.4097705.4722118-.8878361.3161087-1.3112656z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_SnapchatIcon = (SnapchatIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/TiktokIcon.tsx
/* eslint-disable max-len */

var TiktokIcon = function TiktokIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M17.9971687 8.09164113c-.162333.01588057-.3253081.02420317-.4884041.02494121-1.7889453.00025143-3.4574423-.90754798-4.4373985-2.41430913v8.22133539C13.0713661 17.2795069 10.3690988 20 7.03568306 20 3.70226735 20 1 17.2795069 1 13.9236086c0-3.3558982 2.70226735-6.07639133 6.03568306-6.07639133.12599409 0 .24915685.0114017.37302744.01924037V10.860828c-.12387059-.0149647-.24561769-.0377681-.37302744-.0377681-1.7013047 0-3.08048466 1.388482-3.08048466 3.1012613 0 1.7127794 1.37917996 3.1012614 3.08048466 3.1012614 1.70162801 0 3.20435524-1.3496758 3.20435524-3.0627806L10.2697672 0h2.8454845C13.3835704 2.56889818 15.4410719 4.57544293 18 4.76377111v3.32787002",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_TiktokIcon = (TiktokIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/RedditIcon.tsx
/* eslint-disable max-len */

var RedditIcon = function RedditIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M20 10.1594488c0-1.22244093-.9841828-2.21456691-2.1968366-2.21456691-.5975395 0-1.1247803.23031496-1.5114235.62007874-1.4938489-1.08070866-3.5676626-1.78937008-5.8523726-1.87795276l1.0017575-4.73031496 3.2513181.69094489c.0351494.83267716.7205624 1.50590551 1.5641476 1.50590551.8611599 0 1.5641476-.70866142 1.5641476-1.57677166C17.8207381 1.70866142 17.1177504 1 16.2565905 1c-.6151142 0-1.142355.35433071-1.3884007.88582677l-3.6379613-.77952756c-.1054482-.01771653-.2108963 0-.2987698.05314961-.0878735.05314961-.1405975.14173228-.1757469.24803149L9.64850615 6.68700787c-2.33743409.07086615-4.42882249.76181103-5.94024604 1.87795276-.38664324-.37204724-.9314587-.62007874-1.51142355-.62007874C.98418278 7.94488189 0 8.93700787 0 10.1594488c0 .9035433.52724077 1.6653543 1.30052724 2.0196851-.03514938.2125984-.05272408.4429133-.05272408.6732283C1.24780316 16.253937 5.16695958 19 10.0175747 19c4.8506151 0 8.7697715-2.746063 8.7697715-6.1476378 0-.230315-.0175747-.4429134-.0527241-.6555118C19.4551845 11.8425197 20 11.0629921 20 10.1594488zM4.97363796 11.7362205c0-.8681103.7029877-1.5767717 1.56414763-1.5767717.86115993 0 1.56414763.7086614 1.56414763 1.5767717 0 .8681102-.7029877 1.5767716-1.56414763 1.5767716-.86115993 0-1.56414763-.7086614-1.56414763-1.5767716zm8.73462214 4.1633858C12.6362039 16.980315 10.5975395 17.0511811 10 17.0511811c-.59753954 0-2.65377856-.0885827-3.70826011-1.1515748-.15817223-.1594488-.15817223-.4251969 0-.5846457.15817224-.1594488.42179262-.1594488.57996486 0 .66783831.6732284 2.10896309.9212599 3.14586995.9212599 1.0369068 0 2.4604569-.2480315 3.1458699-.9212599.1581723-.1594488.4217927-.1594488.5799649 0 .1230228.1771654.1230228.4251969-.0351494.5846457zm-.2811951-2.5866142c-.8611599 0-1.5641476-.7086614-1.5641476-1.5767716 0-.8681103.7029877-1.5767717 1.5641476-1.5767717.86116 0 1.5641477.7086614 1.5641477 1.5767717 0 .8681102-.7029877 1.5767716-1.5641477 1.5767716z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_RedditIcon = (RedditIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/BehanceIcon.tsx
/* eslint-disable max-len */

var BehanceIcon = function BehanceIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M15.45875 6.97573396c.7975-.00124177 1.51375.14000823 2.15.42250823.63875.28125 1.16375.72625 1.5775 1.33375.3775.53625.62 1.1575.73 1.86375001.065.4125.09 1.01125.08 1.79H13.3375c.04.90375.355 1.53875.9575 1.90125.365.22625.8025.34 1.31875.34.5425 0 .985-.1375 1.325-.4125.1875-.15.35125-.35625.4925-.62h2.44c-.065.53375-.36125 1.0775-.885 1.63-.81875.875-1.965 1.31375-3.43875 1.31375-1.2175 0-2.29-.36875-3.21875-1.10875-.9325-.73875-1.39625-1.9425-1.39625-3.60875 0-1.5625.42-2.76125001 1.25875-3.59500001.84125-.83125 1.92875-1.25000823 3.2675-1.25000823zM5.9725 4.03824219c1.5075.0225 2.57375.455 3.20375 1.3.3775.51875.56625 1.1375.56625 1.86125 0 .74375-.18875 1.34375-.57125 1.79625-.215.25125-.52875.48375-.94375.6925.63.2275 1.105.58625001 1.42875 1.07625001.32.49.48125 1.08625.48125 1.78625 0 .7225-.18375 1.37125-.55125 1.94375-.2325.37875-.525.7-.875.95875-.39375.2975-.85875.50125-1.39625.6125-.5375.11-1.11875.16375-1.74625.16375H0V4.03824219zm-.46625 6.82500001h-3.0425v3.25125H5.465c.53625 0 .955-.07125 1.2525-.215.5425-.2675.8125-.7725.8125-1.5225 0-.63625-.26125-1.07125-.78625-1.30875-.295-.13125-.7075-.20125-1.2375-.205zm9.955-1.94500001c-.61125.00125-1.08875.17375-1.42625.51625-.3375.34375-.55.80875001-.6375 1.39500001h4.11875c-.04375-.62625-.2575-1.10000001-.63625-1.42625001-.38375-.32375-.855-.485-1.41875-.485zm-10.3075-2.7625h-2.69v2.69h3.005c.535 0 .97125-.10125 1.3075-.3025.33375-.20125.5025-.55875.5025-1.07 0-.57-.22125-.94375-.66375-1.1275-.3825-.12625-.87-.19-1.46125-.19zm12.9225-1.54875v1.5175H12.78v-1.5175h5.29625z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_BehanceIcon = (BehanceIcon);
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
var prop_types = __webpack_require__(5556);
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/WidgetNextPage.tsx
/* eslint-disable max-len */


var WidgetNextPage = function WidgetNextPage(_ref) {
  var color = _ref.color,
    borderColor = _ref.borderColor;
  return /*#__PURE__*/react.createElement("svg", {
    "aria-hidden": true,
    width: "44",
    height: "44",
    viewBox: "0 0 44 44",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    fill: color,
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M12.6864 4.5552C13.4264 3.81523 14.6262 3.81526 15.3662 4.55528L31.2028 20.3929C32.0908 21.2809 32.0908 22.7206 31.2028 23.6086L15.3661 39.4452C14.6261 40.1852 13.4263 40.1852 12.6863 39.4452C11.9463 38.7052 11.9463 37.5055 12.6863 36.7655L27.4512 22.0007L12.6863 7.23497C11.9463 6.49495 11.9464 5.29518 12.6864 4.5552Z"
  }), /*#__PURE__*/react.createElement("path", {
    fill: borderColor,
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M11.2721 40.8595C9.75109 39.3384 9.75108 36.8723 11.2721 35.3513L24.6228 22.0006L11.2721 8.64915C9.75105 7.12806 9.75112 4.66195 11.2722 3.14095C12.7933 1.61995 15.2594 1.62002 16.7804 3.14111L32.6171 18.9787C34.2861 20.6478 34.286 23.3538 32.617 25.0228L16.7803 40.8595C15.2593 42.3805 12.7932 42.3805 11.2721 40.8595ZM12.6863 36.7655C11.9463 37.5055 11.9463 38.7052 12.6863 39.4452C13.4263 40.1852 14.6261 40.1852 15.3661 39.4452L31.2028 23.6086C32.0908 22.7206 32.0908 21.2809 31.2028 20.3929L15.3662 4.55528C14.6262 3.81526 13.4264 3.81523 12.6864 4.5552C11.9464 5.29518 11.9463 6.49495 12.6863 7.23497L27.4512 22.0007L12.6863 36.7655Z",
    fillOpacity: "0.2"
  }));
};
WidgetNextPage.propTypes = {
  color: (prop_types_default()).string.isRequired,
  borderColor: (prop_types_default()).string.isRequired
};
/* harmony default export */ var src_WidgetNextPage = (WidgetNextPage);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/WidgetPreviousPage.tsx
/* eslint-disable max-len */


var WidgetPreviousPage = function WidgetPreviousPage(_ref) {
  var color = _ref.color,
    borderColor = _ref.borderColor;
  return /*#__PURE__*/react.createElement("svg", {
    "aria-hidden": true,
    width: "44",
    height: "44",
    viewBox: "0 0 44 44",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    fill: color,
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M31.3138 39.4453C30.5737 40.1853 29.374 40.1852 28.634 39.4452L12.7973 23.6076C11.9093 22.7196 11.9094 21.2799 12.7973 20.3919L28.634 4.55524C29.374 3.81524 30.5738 3.81524 31.3138 4.55524C32.0538 5.29524 32.0538 6.49502 31.3138 7.23501L16.549 21.9998L31.3138 36.7655C32.0538 37.5055 32.0538 38.7053 31.3138 39.4453Z"
  }), /*#__PURE__*/react.createElement("path", {
    fill: borderColor,
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M32.7279 40.8595C31.2068 42.3805 28.7407 42.3805 27.2197 40.8594L11.383 25.0218C9.71408 23.3527 9.71412 20.6467 11.3831 18.9777L27.2198 3.14103C28.7409 1.61998 31.207 1.61998 32.728 3.14103L31.3138 4.55524C30.5738 3.81524 29.374 3.81524 28.634 4.55524L12.7973 20.3919C11.9094 21.2799 11.9093 22.7196 12.7973 23.6076L28.634 39.4452C29.374 40.1852 30.5737 40.1853 31.3138 39.4453C32.0538 38.7053 32.0538 37.5055 31.3138 36.7655L16.549 21.9998L31.3138 7.23501C32.0538 6.49502 32.0538 5.29524 31.3138 4.55524L32.728 3.14103C34.2491 4.66208 34.2491 7.12818 32.728 8.64923L19.3774 21.9999L32.7281 35.3513C34.2491 36.8724 34.249 39.3385 32.7279 40.8595Z",
    fillOpacity: "0.2"
  }));
};
WidgetPreviousPage.propTypes = {
  color: (prop_types_default()).string.isRequired,
  borderColor: (prop_types_default()).string.isRequired
};
/* harmony default export */ var src_WidgetPreviousPage = (WidgetPreviousPage);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/EnterFullScreenIcon.tsx
/* eslint-disable max-len */

var EnterFullScreenIcon = function EnterFullScreenIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    fill: fill,
    viewBox: "0 0 25 25",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("g", {
    clipPath: "url(#clip0)",
    fill: "#fff"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M0 1.366a1 1 0 011-1h6a1 1 0 010 2H2v5a1 1 0 11-2 0v-6zM23 .366a1 1 0 011 1v6a1 1 0 11-2 0v-5h-5a1 1 0 110-2h6zM22 17.366a1 1 0 112 0v6a1 1 0 01-1 1h-6a1 1 0 110-2h5v-5zM0 17.366a1 1 0 112 0v5h5a1 1 0 110 2H1a1 1 0 01-1-1v-6z"
  })), /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("clipPath", {
    id: "clip0"
  }, /*#__PURE__*/react.createElement("path", {
    fill: "#fff",
    transform: "translate(0 .366)",
    d: "M0 0h24v24H0z"
  }))));
};
/* harmony default export */ var src_EnterFullScreenIcon = (EnterFullScreenIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ExitFullScreenIcon.tsx
/* eslint-disable max-len */

var ExitFullScreenIcon = function ExitFullScreenIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "100%",
    height: "100%",
    fill: fill,
    viewBox: "0 0 25 25",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "m8.1338 0.11328c0.26522 0 0.51957 0.10536 0.70711 0.29289 0.18753 0.18754 0.29289 0.44189 0.29289 0.7071v7c0 0.26522-0.10536 0.51957-0.29289 0.70711-0.18754 0.18753-0.44189 0.29289-0.70711 0.29289h-7c-0.26522 0-0.51957-0.10536-0.70711-0.29289-0.18754-0.18754-0.29289-0.44189-0.29289-0.70711s0.10536-0.51957 0.29289-0.70711c0.18754-0.18753 0.44189-0.29289 0.70711-0.29289h6v-6c0-0.26522 0.10536-0.51957 0.29289-0.7071 0.18754-0.18754 0.44189-0.29289 0.70711-0.29289zm8 0c0.2652 0 0.5196 0.10536 0.7071 0.29289 0.1875 0.18754 0.2929 0.44189 0.2929 0.7071v6h6c0.2652 0 0.5196 0.10536 0.7071 0.29289 0.1875 0.18754 0.2929 0.44189 0.2929 0.70711s-0.1054 0.51957-0.2929 0.70711c-0.1875 0.18753-0.4419 0.29289-0.7071 0.29289h-7c-0.2652 0-0.5196-0.10536-0.7071-0.29289-0.1876-0.18754-0.2929-0.44189-0.2929-0.70711v-7c0-0.26522 0.1053-0.51957 0.2929-0.7071 0.1875-0.18754 0.4419-0.29289 0.7071-0.29289zm-16 16c0-0.2652 0.10536-0.5196 0.29289-0.7071 0.18754-0.1876 0.44189-0.2929 0.70711-0.2929h7c0.26522 0 0.51957 0.1053 0.70711 0.2929 0.18753 0.1875 0.29289 0.4419 0.29289 0.7071v7c0 0.2652-0.10536 0.5196-0.29289 0.7071-0.18754 0.1875-0.44189 0.2929-0.70711 0.2929s-0.51957-0.1054-0.70711-0.2929c-0.18753-0.1875-0.29289-0.4419-0.29289-0.7071v-6h-6c-0.26522 0-0.51957-0.1054-0.70711-0.2929-0.18754-0.1875-0.29289-0.4419-0.29289-0.7071zm15 0c0-0.2652 0.1053-0.5196 0.2929-0.7071 0.1875-0.1876 0.4419-0.2929 0.7071-0.2929h7c0.2652 0 0.5196 0.1053 0.7071 0.2929 0.1875 0.1875 0.2929 0.4419 0.2929 0.7071s-0.1054 0.5196-0.2929 0.7071-0.4419 0.2929-0.7071 0.2929h-6v6c0 0.2652-0.1054 0.5196-0.2929 0.7071s-0.4419 0.2929-0.7071 0.2929-0.5196-0.1054-0.7071-0.2929c-0.1876-0.1875-0.2929-0.4419-0.2929-0.7071v-7z",
    clipRule: "evenodd",
    fillRule: "evenodd"
  }));
};
/* harmony default export */ var src_ExitFullScreenIcon = (ExitFullScreenIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/DownloadIcon.tsx
/* eslint-disable max-len */

var DownloadIcon = function DownloadIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    fill: "none",
    viewBox: "0 0 26 26"
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "M13 1c-.602 0-1 .488-1 1.09v14.364l-3.231-3.319a1.091 1.091 0 0 0-1.543 1.543L12 19.454s.603.546 1 .546c.371 0 1-.546 1-.546.097-.097 4.852-4.776 4.852-4.776a1.09 1.09 0 1 0-1.543-1.543L14 16.455V2.09C14 1.488 13.602 1 13 1Z"
  }), /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "M25 9.91a1.09 1.09 0 0 0-1.09-1.092h-2.82a1.09 1.09 0 1 0 0 2.182H23v12H3V11h1.91a1.09 1.09 0 1 0 0-2.182H2.09A1.09 1.09 0 0 0 1 9.91v14A1.091 1.091 0 0 0 2.09 25h21.82A1.09 1.09 0 0 0 25 23.91v-14Z"
  }), /*#__PURE__*/react.createElement("path", {
    stroke: "#000",
    strokeOpacity: ".2",
    d: "m14 19.454.328.378.013-.011.013-.013c.046-.047 1.257-1.238 2.46-2.422l1.644-1.62.54-.53.151-.15.04-.038.01-.01.003-.003-.35-.357.35.356.003-.003a1.59 1.59 0 1 0-2.25-2.25v.001L14.5 15.245V2.09C14.5 1.27 13.934.5 13 .5s-1.5.772-1.5 1.59v13.134l-2.373-2.438-.005-.005a1.591 1.591 0 0 0-2.25 2.25l4.774 4.777.01.009.008.008.336-.37-.335.37v.002l.003.002.007.006.025.021a4.053 4.053 0 0 0 .37.285c.114.077.252.162.4.229.14.064.327.13.53.13.2 0 .387-.07.522-.131.144-.066.281-.15.395-.226a4.634 4.634 0 0 0 .375-.28l.025-.021.007-.007.002-.002h.001L14 19.454ZM25.5 9.91a1.59 1.59 0 0 0-1.59-1.59h-2.82a1.59 1.59 0 0 0 0 3.181h1.41v11h-19v-11h1.41a1.59 1.59 0 0 0 0-3.182H2.09A1.59 1.59 0 0 0 .5 9.91v14A1.591 1.591 0 0 0 2.09 25.5h21.82a1.59 1.59 0 0 0 1.59-1.59v-14Z"
  }));
};
/* harmony default export */ var src_DownloadIcon = (DownloadIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/PrintIcon.tsx
/* eslint-disable max-len */

var PrintIcon = function PrintIcon() {
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "0 0 26 26",
    fill: "none"
  }, /*#__PURE__*/react.createElement("mask", {
    id: "path-1-outside-1_1672_5262",
    maskUnits: "userSpaceOnUse",
    x: "0",
    y: "0",
    width: "26",
    height: "26",
    fill: "black"
  }, /*#__PURE__*/react.createElement("rect", {
    fill: "white",
    width: "26",
    height: "26"
  }), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M5 1.96824C5 1.43349 5.43349 1 5.96824 1H20.0318C20.5665 1 21 1.43349 21 1.96824V6.06134H24.0318C24.5665 6.06134 25 6.49483 25 7.02957V20.0318C25 20.5665 24.5665 21 24.0318 21H21V24.0318C21 24.5665 20.5665 25 20.0318 25H6.33187C5.79713 25 5.36364 24.5665 5.36364 24.0318V21H1.96824C1.43349 21 1 20.5665 1 20.0318V7.02957C1 6.49483 1.43349 6.06134 1.96824 6.06134H5V1.96824ZM7 6H19V3H7V6ZM3 8V19H5V15.0591C5 14.5244 5.43349 14.0909 5.96824 14.0909H20.0318C20.5665 14.0909 21 14.5244 21 15.0591V19H23V8.18182L3 8ZM19 19V16H7V19H19ZM7 21V23H19V21H7Z"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M16 11C16 10.3975 16.3975 10 17 10H20C20.6025 10 20.9545 10.3975 20.9545 11C20.9545 11.6025 20.6025 12 20 12H17C16.3975 12 16 11.6025 16 11Z"
  })), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M5 1.96824C5 1.43349 5.43349 1 5.96824 1H20.0318C20.5665 1 21 1.43349 21 1.96824V6.06134H24.0318C24.5665 6.06134 25 6.49483 25 7.02957V20.0318C25 20.5665 24.5665 21 24.0318 21H21V24.0318C21 24.5665 20.5665 25 20.0318 25H6.33187C5.79713 25 5.36364 24.5665 5.36364 24.0318V21H1.96824C1.43349 21 1 20.5665 1 20.0318V7.02957C1 6.49483 1.43349 6.06134 1.96824 6.06134H5V1.96824ZM7 6H19V3H7V6ZM3 8V19H5V15.0591C5 14.5244 5.43349 14.0909 5.96824 14.0909H20.0318C20.5665 14.0909 21 14.5244 21 15.0591V19H23V8.18182L3 8ZM19 19V16H7V19H19ZM7 21V23H19V21H7Z",
    fill: "white"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M16 11C16 10.3975 16.3975 10 17 10H20C20.6025 10 20.9545 10.3975 20.9545 11C20.9545 11.6025 20.6025 12 20 12H17C16.3975 12 16 11.6025 16 11Z",
    fill: "white"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M21 6.06134H20V7.06134H21V6.06134ZM21 21V20H20V21H21ZM5.36364 21H6.36364V20H5.36364V21ZM5 6.06134V7.06134H6V6.06134H5ZM7 6H6V7H7V6ZM19 6V7H20V6H19ZM19 3H20V2H19V3ZM7 3V2H6V3H7ZM3 8L3.00909 7.00004L2 6.99087V8H3ZM3 19H2V20H3V19ZM5 19V20H6V19H5ZM21 19H20V20H21V19ZM23 19V20H24V19H23ZM23 8.18182H24V7.19087L23.0091 7.18186L23 8.18182ZM19 19V20H20V19H19ZM19 16H20V15H19V16ZM7 16V15H6V16H7ZM7 19H6V20H7V19ZM7 21V20H6V21H7ZM7 23H6V24H7V23ZM19 23V24H20V23H19ZM19 21H20V20H19V21ZM6 1.96824C6 1.97078 5.99929 1.97572 5.99709 1.98091C5.99518 1.98543 5.99284 1.98855 5.9907 1.9907C5.98855 1.99284 5.98543 1.99518 5.98091 1.99709C5.97572 1.99929 5.97078 2 5.96824 2V0C4.88121 0 4 0.881209 4 1.96824H6ZM5.96824 2H20.0318V0H5.96824V2ZM20.0318 2C20.0292 2 20.0243 1.99929 20.0191 1.99709C20.0146 1.99518 20.0115 1.99284 20.0093 1.9907C20.0072 1.98855 20.0048 1.98543 20.0029 1.98091C20.0007 1.97572 20 1.97078 20 1.96824H22C22 0.881209 21.1188 0 20.0318 0V2ZM20 1.96824V6.06134H22V1.96824H20ZM21 7.06134H24.0318V5.06134H21V7.06134ZM24.0318 7.06134C24.0292 7.06134 24.0243 7.06063 24.0191 7.05843C24.0146 7.05652 24.0115 7.05418 24.0093 7.05203C24.0072 7.04989 24.0048 7.04677 24.0029 7.04224C24.0007 7.03705 24 7.03211 24 7.02957H26C26 5.94255 25.1188 5.06134 24.0318 5.06134V7.06134ZM24 7.02957V20.0318H26V7.02957H24ZM24 20.0318C24 20.0292 24.0007 20.0243 24.0029 20.0191C24.0048 20.0146 24.0072 20.0115 24.0093 20.0093C24.0115 20.0072 24.0146 20.0048 24.0191 20.0029C24.0243 20.0007 24.0292 20 24.0318 20V22C25.1188 22 26 21.1188 26 20.0318H24ZM24.0318 20H21V22H24.0318V20ZM20 21V24.0318H22V21H20ZM20 24.0318C20 24.0292 20.0007 24.0243 20.0029 24.0191C20.0048 24.0146 20.0072 24.0115 20.0093 24.0093C20.0115 24.0072 20.0146 24.0048 20.0191 24.0029C20.0243 24.0007 20.0292 24 20.0318 24V26C21.1188 26 22 25.1188 22 24.0318H20ZM20.0318 24H6.33187V26H20.0318V24ZM6.33187 24C6.33441 24 6.33935 24.0007 6.34454 24.0029C6.34907 24.0048 6.35219 24.0072 6.35433 24.0093C6.35648 24.0115 6.35882 24.0146 6.36073 24.0191C6.36292 24.0243 6.36364 24.0292 6.36364 24.0318H4.36364C4.36364 25.1188 5.24484 26 6.33187 26V24ZM6.36364 24.0318V21H4.36364V24.0318H6.36364ZM5.36364 20H1.96824V22H5.36364V20ZM1.96824 20C1.97078 20 1.97572 20.0007 1.98091 20.0029C1.98543 20.0048 1.98855 20.0072 1.9907 20.0093C1.99284 20.0115 1.99518 20.0146 1.99709 20.0191C1.99929 20.0243 2 20.0292 2 20.0318H0C0 21.1188 0.881209 22 1.96824 22V20ZM2 20.0318V7.02957H0V20.0318H2ZM2 7.02957C2 7.03211 1.99929 7.03705 1.99709 7.04224C1.99518 7.04677 1.99284 7.04989 1.9907 7.05203C1.98855 7.05418 1.98543 7.05652 1.98091 7.05843C1.97572 7.06063 1.97078 7.06134 1.96824 7.06134V5.06134C0.881209 5.06134 0 5.94255 0 7.02957H2ZM1.96824 7.06134H5V5.06134H1.96824V7.06134ZM6 6.06134V1.96824H4V6.06134H6ZM7 7H19V5H7V7ZM20 6V3H18V6H20ZM19 2H7V4H19V2ZM6 3V6H8V3H6ZM2 8V19H4V8H2ZM3 20H5V18H3V20ZM6 19V15.0591H4V19H6ZM6 15.0591C6 15.0617 5.99929 15.0666 5.99709 15.0718C5.99518 15.0763 5.99284 15.0795 5.9907 15.0816C5.98855 15.0838 5.98543 15.0861 5.98091 15.088C5.97572 15.0902 5.97078 15.0909 5.96824 15.0909V13.0909C4.88121 13.0909 4 13.9721 4 15.0591H6ZM5.96824 15.0909H20.0318V13.0909H5.96824V15.0909ZM20.0318 15.0909C20.0292 15.0909 20.0243 15.0902 20.0191 15.088C20.0146 15.0861 20.0114 15.0838 20.0093 15.0816C20.0072 15.0795 20.0048 15.0763 20.0029 15.0718C20.0007 15.0666 20 15.0617 20 15.0591H22C22 13.9721 21.1188 13.0909 20.0318 13.0909V15.0909ZM20 15.0591V19H22V15.0591H20ZM21 20H23V18H21V20ZM24 19V8.18182H22V19H24ZM23.0091 7.18186L3.00909 7.00004L2.99091 8.99996L22.9909 9.18178L23.0091 7.18186ZM20 19V16H18V19H20ZM19 15H7V17H19V15ZM6 16V19H8V16H6ZM7 20H19V18H7V20ZM6 21V23H8V21H6ZM7 24H19V22H7V24ZM20 23V21H18V23H20ZM19 20H7V22H19V20ZM17 11C17 10.9594 17.0066 10.9441 17.0055 10.947C17.005 10.9482 17.0031 10.9528 16.9987 10.9596C16.9944 10.9663 16.9885 10.9738 16.9812 10.9812C16.9738 10.9885 16.9663 10.9944 16.9596 10.9987C16.9528 11.0031 16.9482 11.005 16.947 11.0055C16.9441 11.0066 16.9594 11 17 11V9C16.4741 9 15.9561 9.17786 15.567 9.56696C15.1779 9.95606 15 10.4741 15 11H17ZM17 11H20V9H17V11ZM20 11C20.0406 11 20.0485 11.0066 20.0347 11.0011C20.0281 10.9985 20.018 10.9936 20.0062 10.9856C19.9943 10.9776 19.9829 10.9679 19.9727 10.957C19.9626 10.9462 19.9556 10.9362 19.951 10.9284C19.9464 10.9208 19.9452 10.9168 19.9456 10.918C19.9466 10.9208 19.9545 10.9459 19.9545 11H21.9545C21.9545 10.5074 21.8085 9.99197 21.4337 9.59112C21.0506 9.18144 20.5299 9 20 9V11ZM19.9545 11C19.9545 11.0541 19.9466 11.0792 19.9456 11.082C19.9452 11.0832 19.9464 11.0792 19.951 11.0716C19.9556 11.0638 19.9626 11.0538 19.9727 11.043C19.9829 11.0321 19.9943 11.0224 20.0062 11.0144C20.018 11.0064 20.0281 11.0015 20.0347 10.9989C20.0485 10.9934 20.0406 11 20 11V13C20.5299 13 21.0506 12.8186 21.4337 12.4089C21.8085 12.008 21.9545 11.4926 21.9545 11H19.9545ZM20 11H17V13H20V11ZM17 11C16.9594 11 16.9441 10.9934 16.947 10.9945C16.9482 10.995 16.9528 10.9969 16.9596 11.0013C16.9663 11.0056 16.9738 11.0115 16.9812 11.0188C16.9885 11.0262 16.9944 11.0337 16.9987 11.0404C17.0031 11.0472 17.005 11.0518 17.0055 11.053C17.0066 11.0559 17 11.0406 17 11H15C15 11.5259 15.1779 12.0439 15.567 12.433C15.9561 12.8221 16.4741 13 17 13V11Z",
    fill: "black",
    fillOpacity: "0.2",
    mask: "url(#path-1-outside-1_1672_5262)"
  }));
};
/* harmony default export */ var src_PrintIcon = (PrintIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ShareIcon.tsx
/* eslint-disable max-len */

var ShareIcon = function ShareIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "0 0 26 26",
    fill: "none"
  }, /*#__PURE__*/react.createElement("mask", {
    id: "path-1-outside-1_1682_5275",
    maskUnits: "userSpaceOnUse",
    x: "-9.91821e-05",
    y: "0",
    width: "27",
    height: "26",
    fill: "black"
  }, /*#__PURE__*/react.createElement("rect", {
    fill: fill,
    x: "-9.91821e-05",
    width: "27",
    height: "26"
  }), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M21.0001 7C22.1047 7 23.0001 6.10457 23.0001 5C23.0001 3.89543 22.1047 3 21.0001 3C19.8955 3 19.0001 3.89543 19.0001 5C19.0001 6.10457 19.8955 7 21.0001 7ZM21.0001 9C23.2092 9 25.0001 7.20914 25.0001 5C25.0001 2.79086 23.2092 1 21.0001 1C18.791 1 17.0001 2.79086 17.0001 5C17.0001 5.22784 17.0191 5.45124 17.0557 5.66867L10.2797 10.4133C9.40351 8.96673 7.8146 7.99998 5.9999 7.99998C3.23848 7.99998 0.999901 10.2386 0.999901 13C0.999901 15.7614 3.23848 18 5.9999 18C7.83004 18 9.43053 17.0167 10.3019 15.5496L17.0639 20.2844C17.022 20.5166 17.0001 20.7557 17.0001 21C17.0001 23.2091 18.791 25 21.0001 25C23.2092 25 25.0001 23.2091 25.0001 21C25.0001 18.7908 23.2092 17 21.0001 17C19.7627 17 18.6566 17.5618 17.9228 18.4443L10.9673 13.574C10.9888 13.3856 10.9999 13.1941 10.9999 13C10.9999 12.7892 10.9869 12.5814 10.9615 12.3774L17.8954 7.52228C18.6288 8.42396 19.7472 9 21.0001 9ZM5.9999 16C7.65675 16 8.9999 14.6568 8.9999 13C8.9999 11.3431 7.65675 9.99998 5.9999 9.99998C4.34305 9.99998 2.9999 11.3431 2.9999 13C2.9999 14.6568 4.34305 16 5.9999 16ZM23.0001 21C23.0001 22.1045 22.1047 23 21.0001 23C19.8955 23 19.0001 22.1045 19.0001 21C19.0001 19.8954 19.8955 19 21.0001 19C22.1047 19 23.0001 19.8954 23.0001 21Z"
  })), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M21.0001 7C22.1047 7 23.0001 6.10457 23.0001 5C23.0001 3.89543 22.1047 3 21.0001 3C19.8955 3 19.0001 3.89543 19.0001 5C19.0001 6.10457 19.8955 7 21.0001 7ZM21.0001 9C23.2092 9 25.0001 7.20914 25.0001 5C25.0001 2.79086 23.2092 1 21.0001 1C18.791 1 17.0001 2.79086 17.0001 5C17.0001 5.22784 17.0191 5.45124 17.0557 5.66867L10.2797 10.4133C9.40351 8.96673 7.8146 7.99998 5.9999 7.99998C3.23848 7.99998 0.999901 10.2386 0.999901 13C0.999901 15.7614 3.23848 18 5.9999 18C7.83004 18 9.43053 17.0167 10.3019 15.5496L17.0639 20.2844C17.022 20.5166 17.0001 20.7557 17.0001 21C17.0001 23.2091 18.791 25 21.0001 25C23.2092 25 25.0001 23.2091 25.0001 21C25.0001 18.7908 23.2092 17 21.0001 17C19.7627 17 18.6566 17.5618 17.9228 18.4443L10.9673 13.574C10.9888 13.3856 10.9999 13.1941 10.9999 13C10.9999 12.7892 10.9869 12.5814 10.9615 12.3774L17.8954 7.52228C18.6288 8.42396 19.7472 9 21.0001 9ZM5.9999 16C7.65675 16 8.9999 14.6568 8.9999 13C8.9999 11.3431 7.65675 9.99998 5.9999 9.99998C4.34305 9.99998 2.9999 11.3431 2.9999 13C2.9999 14.6568 4.34305 16 5.9999 16ZM23.0001 21C23.0001 22.1045 22.1047 23 21.0001 23C19.8955 23 19.0001 22.1045 19.0001 21C19.0001 19.8954 19.8955 19 21.0001 19C22.1047 19 23.0001 19.8954 23.0001 21Z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    d: "M17.0557 5.66867L17.6293 6.48783L18.1467 6.12555L18.0419 5.50271L17.0557 5.66867ZM10.2797 10.4133L9.42435 10.9314L9.97794 11.8454L10.8533 11.2325L10.2797 10.4133ZM10.3019 15.5496L10.8755 14.7305L9.99253 14.1122L9.44211 15.039L10.3019 15.5496ZM17.0639 20.2844L18.048 20.4622L18.1617 19.8324L17.6375 19.4653L17.0639 20.2844ZM17.9228 18.4443L17.3493 19.2635L18.1033 19.7914L18.6918 19.0836L17.9228 18.4443ZM10.9673 13.574L9.97378 13.4604L9.90619 14.0518L10.3937 14.3931L10.9673 13.574ZM10.9615 12.3774L10.3879 11.5583L9.89498 11.9035L9.96915 12.5007L10.9615 12.3774ZM17.8954 7.52228L18.6712 6.89127L18.084 6.16943L17.3218 6.70313L17.8954 7.52228ZM22.0001 5C22.0001 5.55228 21.5524 6 21.0001 6V8C22.6569 8 24.0001 6.65685 24.0001 5H22.0001ZM21.0001 4C21.5524 4 22.0001 4.44772 22.0001 5H24.0001C24.0001 3.34315 22.6569 2 21.0001 2V4ZM20.0001 5C20.0001 4.44772 20.4478 4 21.0001 4V2C19.3432 2 18.0001 3.34315 18.0001 5H20.0001ZM21.0001 6C20.4478 6 20.0001 5.55228 20.0001 5H18.0001C18.0001 6.65685 19.3432 8 21.0001 8V6ZM24.0001 5C24.0001 6.65685 22.6569 8 21.0001 8V10C23.7615 10 26.0001 7.76142 26.0001 5H24.0001ZM21.0001 2C22.6569 2 24.0001 3.34315 24.0001 5H26.0001C26.0001 2.23858 23.7615 0 21.0001 0V2ZM18.0001 5C18.0001 3.34315 19.3432 2 21.0001 2V0C18.2387 0 16.0001 2.23858 16.0001 5H18.0001ZM18.0419 5.50271C18.0145 5.33989 18.0001 5.17201 18.0001 5H16.0001C16.0001 5.28368 16.0238 5.56258 16.0696 5.83464L18.0419 5.50271ZM10.8533 11.2325L17.6293 6.48783L16.4822 4.84952L9.70611 9.59416L10.8533 11.2325ZM5.9999 8.99998C7.45049 8.99998 8.72183 9.77151 9.42435 10.9314L11.135 9.89525C10.0852 8.16196 8.17872 6.99998 5.9999 6.99998V8.99998ZM1.9999 13C1.9999 10.7908 3.79076 8.99998 5.9999 8.99998V6.99998C2.68619 6.99998 -9.91821e-05 9.68627 -9.91821e-05 13H1.9999ZM5.9999 17C3.79076 17 1.9999 15.2091 1.9999 13H-9.91821e-05C-9.91821e-05 16.3137 2.68619 19 5.9999 19V17ZM9.44211 15.039C8.74346 16.2152 7.4628 17 5.9999 17V19C8.19728 19 10.1176 17.8182 11.1617 16.0603L9.44211 15.039ZM17.6375 19.4653L10.8755 14.7305L9.72832 16.3688L16.4903 21.1036L17.6375 19.4653ZM18.0001 21C18.0001 20.8156 18.0166 20.6359 18.048 20.4622L16.0798 20.1067C16.0274 20.3973 16.0001 20.6959 16.0001 21H18.0001ZM21.0001 24C19.3432 24 18.0001 22.6568 18.0001 21H16.0001C16.0001 23.7614 18.2387 26 21.0001 26V24ZM24.0001 21C24.0001 22.6568 22.6569 24 21.0001 24V26C23.7615 26 26.0001 23.7614 26.0001 21H24.0001ZM21.0001 18C22.6569 18 24.0001 19.3431 24.0001 21H26.0001C26.0001 18.2386 23.7615 16 21.0001 16V18ZM18.6918 19.0836C19.2437 18.4199 20.0724 18 21.0001 18V16C19.453 16 18.0695 16.7038 17.1539 17.805L18.6918 19.0836ZM10.3937 14.3931L17.3493 19.2635L18.4964 17.6252L11.5409 12.7548L10.3937 14.3931ZM9.9999 13C9.9999 13.1561 9.99101 13.3097 9.97378 13.4604L11.9608 13.6876C11.9867 13.4616 11.9999 13.2321 11.9999 13H9.9999ZM9.96915 12.5007C9.98941 12.6639 9.9999 12.8305 9.9999 13H11.9999C11.9999 12.7479 11.9843 12.4989 11.9539 12.2542L9.96915 12.5007ZM17.3218 6.70313L10.3879 11.5583L11.5351 13.1966L18.469 8.34144L17.3218 6.70313ZM21.0001 8C20.0608 8 19.2229 7.56952 18.6712 6.89127L17.1196 8.1533C18.0348 9.27841 19.4336 10 21.0001 10V8ZM7.9999 13C7.9999 14.1045 7.10447 15 5.9999 15V17C8.20904 17 9.9999 15.2091 9.9999 13H7.9999ZM5.9999 11C7.10447 11 7.9999 11.8954 7.9999 13H9.9999C9.9999 10.7908 8.20904 8.99998 5.9999 8.99998V11ZM3.9999 13C3.9999 11.8954 4.89533 11 5.9999 11V8.99998C3.79076 8.99998 1.9999 10.7908 1.9999 13H3.9999ZM5.9999 15C4.89533 15 3.9999 14.1045 3.9999 13H1.9999C1.9999 15.2091 3.79076 17 5.9999 17V15ZM21.0001 24C22.6569 24 24.0001 22.6568 24.0001 21H22.0001C22.0001 21.5523 21.5524 22 21.0001 22V24ZM18.0001 21C18.0001 22.6568 19.3432 24 21.0001 24V22C20.4478 22 20.0001 21.5523 20.0001 21H18.0001ZM21.0001 18C19.3432 18 18.0001 19.3431 18.0001 21H20.0001C20.0001 20.4477 20.4478 20 21.0001 20V18ZM24.0001 21C24.0001 19.3431 22.6569 18 21.0001 18V20C21.5524 20 22.0001 20.4477 22.0001 21H24.0001Z",
    fill: "black",
    fillOpacity: "0.2",
    mask: "url(#path-1-outside-1_1682_5275)"
  }));
};
/* harmony default export */ var src_ShareIcon = (ShareIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/TocIcon.tsx
/* eslint-disable max-len */

var TocIcon = function TocIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    fill: "none",
    viewBox: "0 0 26 18"
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "M1 16c0-.552.488-1 1.09-1h2.82c.602 0 1.09.448 1.09 1s-.488 1-1.09 1H2.09C1.489 17 1 16.552 1 16ZM1 9c0-.552.488-1 1.09-1h2.82C5.511 8 6 8.448 6 9s-.488 1-1.09 1H2.09C1.489 10 1 9.552 1 9ZM1 2c0-.552.488-1 1.09-1h2.82C5.511 1 6 1.448 6 2s-.488 1-1.09 1H2.09C1.489 3 1 2.552 1 2ZM9 16c0-.552.488-1 1.09-1h13.82c.602 0 1.09.448 1.09 1s-.488 1-1.09 1H10.09C9.489 17 9 16.552 9 16ZM9 9c0-.552.488-1 1.09-1h9.456c.602 0 1.09.448 1.09 1s-.488 1-1.09 1H10.09C9.488 10 9 9.552 9 9ZM9 2c0-.552.488-1 1.09-1h13.82c.602 0 1.09.448 1.09 1s-.488 1-1.09 1H10.09C9.489 3 9 2.552 9 2Z"
  }), /*#__PURE__*/react.createElement("path", {
    stroke: "#000",
    strokeOpacity: ".2",
    d: "M2.09 14.5C1.255 14.5.5 15.132.5 16c0 .869.754 1.5 1.59 1.5h2.82c.836 0 1.59-.631 1.59-1.5 0-.868-.754-1.5-1.59-1.5H2.09Zm0-7C1.255 7.5.5 8.132.5 9s.754 1.5 1.59 1.5h2.82c.836 0 1.59-.632 1.59-1.5s-.754-1.5-1.59-1.5H2.09Zm0-7C1.255.5.5 1.132.5 2s.754 1.5 1.59 1.5h2.82c.836 0 1.59-.632 1.59-1.5S5.746.5 4.91.5H2.09Zm8 14c-.836 0-1.59.632-1.59 1.5 0 .869.754 1.5 1.59 1.5h13.82c.836 0 1.59-.631 1.59-1.5 0-.868-.754-1.5-1.59-1.5H10.09Zm0-7c-.836 0-1.59.632-1.59 1.5s.754 1.5 1.59 1.5h9.456c.836 0 1.59-.632 1.59-1.5s-.754-1.5-1.59-1.5H10.09Zm0-7C9.255.5 8.5 1.132 8.5 2s.754 1.5 1.59 1.5h13.82c.836 0 1.59-.632 1.59-1.5S24.746.5 23.91.5H10.09Z"
  }));
};
/* harmony default export */ var src_TocIcon = (TocIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/SearchIcon.tsx
/* eslint-disable max-len */

var SearchIcon = function SearchIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "0 0 26 26",
    fill: "none"
  }, /*#__PURE__*/react.createElement("mask", {
    id: "path-1-outside-1_1672_5282",
    maskUnits: "userSpaceOnUse",
    x: "0",
    y: "0",
    width: "26",
    height: "26",
    fill: "black"
  }, /*#__PURE__*/react.createElement("rect", {
    fill: fill,
    width: "26",
    height: "26"
  }), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M18 10.5C18 14.6421 14.6421 18 10.5 18C6.35786 18 3 14.6421 3 10.5C3 6.35786 6.35786 3 10.5 3C14.6421 3 18 6.35786 18 10.5ZM16.2411 18.0696C14.6464 19.281 12.6571 20 10.5 20C5.25329 20 1 15.7467 1 10.5C1 5.25329 5.25329 1 10.5 1C15.7467 1 20 5.25329 20 10.5C20 12.8689 19.133 15.0352 17.6989 16.6991L24.2929 23.2929C24.6834 23.6834 24.6834 24.3165 24.2929 24.7071C23.9023 25.0976 23.2692 25.0976 22.8786 24.7071L16.2411 18.0696Z"
  })), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M18 10.5C18 14.6421 14.6421 18 10.5 18C6.35786 18 3 14.6421 3 10.5C3 6.35786 6.35786 3 10.5 3C14.6421 3 18 6.35786 18 10.5ZM16.2411 18.0696C14.6464 19.281 12.6571 20 10.5 20C5.25329 20 1 15.7467 1 10.5C1 5.25329 5.25329 1 10.5 1C15.7467 1 20 5.25329 20 10.5C20 12.8689 19.133 15.0352 17.6989 16.6991L24.2929 23.2929C24.6834 23.6834 24.6834 24.3165 24.2929 24.7071C23.9023 25.0976 23.2692 25.0976 22.8786 24.7071L16.2411 18.0696Z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    d: "M16.2411 18.0696L16.9482 17.3625C16.5947 17.009 16.0344 16.9709 15.6362 17.2733L16.2411 18.0696ZM17.6989 16.6991L16.9415 16.0462C16.5996 16.4428 16.6216 17.0359 16.9918 17.4062L17.6989 16.6991ZM24.2929 23.2929L25 22.5857L25 22.5857L24.2929 23.2929ZM24.2929 24.7071L23.5857 24L23.5857 24L24.2929 24.7071ZM22.8786 24.7071L23.5857 24L23.5857 24L22.8786 24.7071ZM10.5 19C15.1944 19 19 15.1944 19 10.5H17C17 14.0899 14.0899 17 10.5 17V19ZM2 10.5C2 15.1944 5.80558 19 10.5 19V17C6.91015 17 4 14.0899 4 10.5H2ZM10.5 2C5.80558 2 2 5.80558 2 10.5H4C4 6.91015 6.91015 4 10.5 4V2ZM19 10.5C19 5.80558 15.1944 2 10.5 2V4C14.0899 4 17 6.91015 17 10.5H19ZM10.5 21C12.8831 21 15.0833 20.2049 16.846 18.866L15.6362 17.2733C14.2094 18.3572 12.4312 19 10.5 19V21ZM0 10.5C0 16.299 4.70101 21 10.5 21V19C5.80558 19 2 15.1944 2 10.5H0ZM10.5 0C4.70101 0 0 4.70101 0 10.5H2C2 5.80558 5.80558 2 10.5 2V0ZM21 10.5C21 4.70101 16.299 0 10.5 0V2C15.1944 2 19 5.80558 19 10.5H21ZM18.4564 17.3519C20.041 15.5135 21 13.1175 21 10.5H19C19 12.6203 18.225 14.557 16.9415 16.0462L18.4564 17.3519ZM16.9918 17.4062L23.5858 24L25 22.5857L18.406 15.9919L16.9918 17.4062ZM23.5857 24V24L25 25.4142C25.781 24.6331 25.781 23.3668 25 22.5857L23.5857 24ZM23.5857 24L23.5857 24L22.1715 25.4142C22.9526 26.1952 24.2189 26.1952 25 25.4142L23.5857 24ZM23.5857 24L16.9482 17.3625L15.534 18.7768L22.1715 25.4142L23.5857 24Z",
    fill: "black",
    fillOpacity: "0.2",
    mask: "url(#path-1-outside-1_1672_5282)"
  }));
};
/* harmony default export */ var src_SearchIcon = (SearchIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/UnavailableImage.tsx

var UnavailableImage = function UnavailableImage() {
  return /*#__PURE__*/react.createElement("svg", {
    width: "79",
    height: "79",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M7.905.206h62.87a7.86 7.86 0 017.86 7.859v47.153a7.859 7.859 0 01-7.86 7.858H55.058L39.34 78.794 23.622 63.076H7.905a7.859 7.859 0 01-7.86-7.858V8.065a7.859 7.859 0 017.86-7.86zm0 7.859v47.153h18.979L39.34 67.674l12.456-12.456h18.98V8.065H7.904zm13.753 7.859a5.894 5.894 0 110 11.787 5.894 5.894 0 010-11.787zm-5.895 31.435l19.648-19.647 7.858 7.859 19.648-19.647v31.435H15.762z",
    fill: "#000"
  }));
};
/* harmony default export */ var src_UnavailableImage = (UnavailableImage);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ShareFacebookIcon.tsx
/* eslint-disable max-len */

var ShareFacebookIcon = function ShareFacebookIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "14",
    height: "24",
    fill: fill,
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M12.867.005L9.825 0c-3.42 0-5.63 2.318-5.63 5.906V8.63h-3.06a.484.484 0 00-.479.49v3.945c0 .27.215.49.479.49h3.06v9.956c0 .27.214.489.479.489h3.993c.264 0 .478-.22.478-.49v-9.956h3.579a.484.484 0 00.478-.489l.002-3.946c0-.13-.05-.254-.14-.346a.474.474 0 00-.34-.143H9.145V6.32c0-1.11.259-1.673 1.672-1.673h2.051c.264 0 .478-.22.478-.49V.494a.484.484 0 00-.478-.489z"
  }));
};
/* harmony default export */ var src_ShareFacebookIcon = (ShareFacebookIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ShareTwitterIcon.tsx
/* eslint-disable max-len */

var ShareTwitterIcon = function ShareTwitterIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "24",
    height: "24",
    fill: fill,
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 -3 20 24"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M1.016.667 7.89 9.859.972 17.333H2.53l6.057-6.543 4.894 6.543h5.3l-7.263-9.71 6.44-6.956H16.4l-5.578 6.026L6.314.667H1.016Zm2.29 1.147H5.74l10.749 14.372h-2.434L3.305 1.814Z"
  }));
};
/* harmony default export */ var src_ShareTwitterIcon = (ShareTwitterIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/SharePinterestIcon.tsx
/* eslint-disable max-len */

var SharePinterestIcon = function SharePinterestIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "24",
    height: "24",
    fill: fill,
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M22.392 5.977a11.95 11.95 0 00-4.367-4.368C16.186.536 14.178 0 12 0S7.816.536 5.977 1.61A11.945 11.945 0 001.61 5.976C.536 7.815 0 9.823 0 12c0 2.427.661 4.63 1.984 6.61 1.323 1.98 3.058 3.443 5.204 4.39-.042-1.114.026-2.036.203-2.765l1.547-6.532c-.26-.51-.39-1.145-.39-1.906 0-.885.223-1.625.671-2.219.448-.594.995-.89 1.64-.89.521 0 .922.171 1.204.515.281.344.422.776.422 1.297 0 .323-.06.716-.18 1.18-.12.463-.276 1-.469 1.61-.193.609-.33 1.096-.414 1.46-.146.635-.026 1.18.36 1.633.385.453.895.68 1.53.68 1.116 0 2.03-.62 2.743-1.86.714-1.24 1.07-2.744 1.07-4.515 0-1.365-.44-2.474-1.32-3.328-.88-.855-2.107-1.282-3.68-1.282-1.76 0-3.185.565-4.274 1.696-1.088 1.13-1.633 2.482-1.633 4.054 0 .938.266 1.725.797 2.36.177.208.235.432.172.672a8.95 8.95 0 00-.125.468c-.062.25-.104.412-.125.485-.083.333-.281.437-.594.312-.802-.333-1.411-.911-1.828-1.734-.416-.823-.625-1.776-.625-2.86 0-.697.112-1.395.336-2.093a7.141 7.141 0 011.047-2.024 8.222 8.222 0 011.703-1.726c.662-.5 1.466-.901 2.414-1.203a10.032 10.032 0 013.063-.453c1.48 0 2.808.328 3.985.984 1.177.656 2.075 1.505 2.695 2.547a6.43 6.43 0 01.93 3.344c0 1.562-.27 2.968-.812 4.219-.542 1.25-1.308 2.231-2.298 2.945-.99.713-2.114 1.07-3.375 1.07a3.707 3.707 0 01-1.782-.445c-.551-.297-.932-.648-1.14-1.055a561.21 561.21 0 01-.844 3.297c-.198.74-.604 1.594-1.219 2.562 1.115.334 2.25.5 3.406.5 2.178 0 4.186-.536 6.024-1.61a11.943 11.943 0 004.367-4.366C23.465 16.184 24 14.177 24 12s-.535-4.185-1.608-6.023z"
  }));
};
/* harmony default export */ var src_SharePinterestIcon = (SharePinterestIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ShareLinkedinIcon.tsx
/* eslint-disable max-len */

var ShareLinkedinIcon = function ShareLinkedinIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "24",
    height: "24",
    fill: fill,
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M5.373 24H.397V7.977h4.976V24zM2.882 5.79C1.29 5.79 0 4.474 0 2.883a2.882 2.882 0 015.764 0c0 1.59-1.291 2.909-2.882 2.909zM23.996 24H19.03v-7.8c0-1.86-.038-4.243-2.587-4.243-2.587 0-2.984 2.02-2.984 4.11V24H8.49V7.977h4.771v2.185h.07c.664-1.259 2.287-2.587 4.707-2.587 5.036 0 5.962 3.316 5.962 7.623V24h-.004z"
  }));
};
/* harmony default export */ var src_ShareLinkedinIcon = (ShareLinkedinIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ShareEmailIcon.tsx
/* eslint-disable max-len */

var ShareEmailIcon = function ShareEmailIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "24",
    height: "24",
    fill: fill,
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 -4 24 24"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M22 0H2a2 2 0 00-2 2v14a2 2 0 002 2h20a2 2 0 002-2V2a2 2 0 00-2-2zm-1.54 16H3.66l6.84-5.133L9.12 9.35 2 14.84V3.52l8.43 8.37a2 2 0 002.82 0L22 3.21v11.5l-7.392-5.403-1.335 1.463L20.46 16zM3.31 2h17.07l-8.54 8.47L3.31 2z"
  }));
};
/* harmony default export */ var src_ShareEmailIcon = (ShareEmailIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/CloseIcon.tsx
/* eslint-disable max-len */

var IconSizes = {
  SMALL: 'small',
  MEDIUM: 'medium',
  LARGE: 'large',
  AUTO: 'auto'
};
var CloseIcon = function CloseIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill,
    _ref$size = _ref.size,
    size = _ref$size === void 0 ? IconSizes.SMALL : _ref$size,
    className = _ref.className;
  if (size === IconSizes.AUTO) {
    return /*#__PURE__*/react.createElement("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      width: "100%",
      height: "100%",
      viewBox: "0 0 26 26",
      fill: "none",
      "aria-hidden": true
    }, /*#__PURE__*/react.createElement("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M1.74078 1.34147C2.18839 0.886176 2.91412 0.886176 3.36174 1.34147L24.6643 23.0095C25.1119 23.4648 25.1119 24.203 24.6643 24.6583C24.2167 25.1136 23.4909 25.1136 23.0433 24.6583L1.74078 2.99024C1.29316 2.53495 1.29316 1.79677 1.74078 1.34147Z",
      fill: "white"
    }), /*#__PURE__*/react.createElement("path", {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M1.33571 24.6585C0.888096 24.2032 0.888096 23.4651 1.33571 23.0098L22.6383 1.34174C23.0859 0.886441 23.8116 0.88644 24.2592 1.34174C24.7068 1.79703 24.7068 2.53521 24.2592 2.99051L2.95667 24.6585C2.50906 25.1138 1.78333 25.1138 1.33571 24.6585Z",
      fill: "white"
    }), /*#__PURE__*/react.createElement("path", {
      d: "M1.38423 3.34078L10.678 12.794L0.979164 22.6592C0.340278 23.3091 0.340279 24.3592 0.979165 25.0091C1.62271 25.6636 2.66968 25.6636 3.31322 25.0091L13.0001 15.156L22.6868 25.0088C23.3303 25.6634 24.3773 25.6634 25.0208 25.0088C25.6597 24.3589 25.6597 23.3088 25.0208 22.659L15.3223 12.794L24.6158 3.34104C25.2547 2.69119 25.2547 1.64105 24.6158 0.991202C23.9722 0.336618 22.9253 0.336619 22.2817 0.991202L22.2817 0.991203L13.0001 10.432L3.71829 0.990938C3.07474 0.336354 2.02777 0.336354 1.38423 0.990938C0.745344 1.64078 0.745344 2.69093 1.38423 3.34078Z",
      stroke: "black",
      strokeOpacity: "0.2",
      strokeLinecap: "round"
    }));
  }
  if (size === IconSizes.MEDIUM) {
    return /*#__PURE__*/react.createElement("svg", {
      width: "24",
      height: "24",
      viewBox: "0 0 24 24",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg"
    }, /*#__PURE__*/react.createElement("path", {
      d: "M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",
      fill: fill
    }));
  }
  if (size === IconSizes.SMALL) {
    return /*#__PURE__*/react.createElement("svg", {
      xmlns: "http://www.w3.org/2000/svg",
      width: "14",
      height: "14",
      viewBox: "0 0 14 14",
      fill: "none",
      className: className,
      "aria-hidden": true
    }, /*#__PURE__*/react.createElement("path", {
      d: "M10.3279 2.56324C10.6342 2.25693 11.1308 2.25693 11.4371 2.56324C11.7434 2.86955 11.7434 3.36617 11.4371 3.67247L3.67246 11.4371C3.36615 11.7434 2.86953 11.7434 2.56323 11.4371C2.25692 11.1308 2.25692 10.6342 2.56323 10.3279L10.3279 2.56324Z",
      fill: fill
    }), /*#__PURE__*/react.createElement("path", {
      d: "M11.4371 10.3279C11.7434 10.6342 11.7434 11.1308 11.4371 11.4371C11.1308 11.7434 10.6342 11.7434 10.3279 11.4371L2.56323 3.67246C2.25692 3.36615 2.25692 2.86953 2.56323 2.56323C2.86953 2.25692 3.36616 2.25692 3.67246 2.56323L11.4371 10.3279Z",
      fill: fill
    }));
  }
  return /*#__PURE__*/react.createElement("svg", {
    width: "24",
    height: "24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    className: className,
    "aria-hidden": true
  }, /*#__PURE__*/react.createElement("path", {
    d: "M.74.341a1.133 1.133 0 011.622 0L23.664 22.01a1.18 1.18 0 010 1.65 1.133 1.133 0 01-1.62 0L.74 1.99a1.18 1.18 0 010-1.649z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    d: "M.336 23.659a1.18 1.18 0 010-1.65L21.638.343a1.132 1.132 0 011.621 0 1.18 1.18 0 010 1.649L1.957 23.659a1.133 1.133 0 01-1.621 0z",
    fill: fill
  }));
};
/* harmony default export */ var src_CloseIcon = (CloseIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/AccessabilityIcon.tsx
/* eslint-disable max-len */

var AccessabilityIcon = function AccessabilityIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#ffffff' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "24",
    height: "24",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "M20.5 6c-2.61.7-5.67 1-8.5 1s-5.89-.3-8.5-1L3 8c1.86.5 4 .83 6 1v13h2v-6h2v6h2V9c2-.17 4.14-.5 6-1l-.5-2ZM12 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2Z"
  }));
};
/* harmony default export */ var src_AccessabilityIcon = (AccessabilityIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/FlipbookLogo.tsx

var FlipbookLogo = function FlipbookLogo(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "104",
    height: "20",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M94.463 1.825c0-1.009.624-1.609 1.464-1.609.839 0 1.463.624 1.463 1.609v6.818l3.214-3.073c.456-.456.911-.624 1.295-.624.696 0 1.223.696 1.223 1.296 0 .457-.144.769-.527 1.153L99.98 9.7l3.454 3.985c.24.313.384.625.384 1.009 0 .768-.624 1.368-1.367 1.368-.528 0-.912-.312-1.367-.912l-3.526-4.37h-.072v3.554c0 1.008-.624 1.608-1.464 1.608s-1.463-.624-1.463-1.608l-.096-12.51zm-2.374 6.05c-.696 0-1.367-.528-2.303-.528-1.679 0-2.447 1.465-2.447 3.001 0 1.465.84 2.905 2.447 2.905.696 0 1.847-.624 2.135-.624.695 0 1.223.624 1.223 1.297 0 1.536-2.519 1.992-3.526 1.992-3.142 0-5.205-2.52-5.205-5.594 0-3.001 2.135-5.666 5.205-5.666 1.151 0 3.526.456 3.526 1.849.096.6-.36 1.368-1.055 1.368zm-8.947 5.979c0 .768 0 1.92-1.367 1.92-.84 0-1.224-.456-1.368-1.224-.767.912-1.679 1.368-2.758 1.368-2.758 0-4.821-2.305-4.821-5.594 0-3.217 2.135-5.666 4.821-5.666 1.08 0 2.135.456 2.758 1.296.072-.696.696-1.224 1.368-1.224 1.367 0 1.367 1.152 1.367 1.92v7.204zm-5.133-.673c1.535 0 2.23-1.536 2.23-2.905 0-1.368-.695-3.001-2.23-3.001-1.607 0-2.303 1.609-2.303 3.001-.072 1.369.696 2.905 2.303 2.905zm-16.31-6.818c0-1.009.623-1.61 1.462-1.61.768 0 1.224.385 1.296 1.081.527-.768 1.463-1.224 2.83-1.224 2.303 0 3.982 1.464 3.982 3.913v5.57c0 1.009-.624 1.61-1.464 1.61s-1.463-.625-1.463-1.61V9.029c0-1.369-.84-1.993-1.919-1.993-1.223 0-1.847.84-1.847 1.993v5.066c0 1.008-.623 1.608-1.463 1.608-.84 0-1.463-.624-1.463-1.608V6.363h.048zm-20.989 0c0-1.009.624-1.61 1.463-1.61.84 0 1.295.457 1.463 1.225.528-.912 1.68-1.296 2.759-1.296 3.142 0 4.677 2.905 4.677 5.738 0 2.761-1.847 5.45-4.821 5.45-.911 0-1.919-.312-2.686-1.008v3.53C43.565 19.4 42.94 20 42.1 20s-1.463-.624-1.463-1.609V6.363h.072zm5.205 6.818c1.535 0 2.303-1.608 2.303-2.905 0-1.368-.768-3.001-2.303-3.001s-2.303 1.464-2.303 2.833c0 1.465.696 3.073 2.303 3.073zm-9.738-6.674c0-1.009.623-1.61 1.463-1.61.84 0 1.463.625 1.463 1.61v7.755c0 1.008-.624 1.608-1.463 1.608-.84 0-1.463-.624-1.463-1.608V6.507zm3.142-4.37c0 .912-.696 1.68-1.607 1.68-.84 0-1.607-.768-1.607-1.68 0-.84.767-1.609 1.607-1.609s1.607.769 1.607 1.609zm-7.892-.456c0-1.009.624-1.609 1.464-1.609s1.463.624 1.463 1.609v12.413c0 1.008-.624 1.608-1.463 1.608-.84 0-1.464-.624-1.464-1.608V1.68zm-6.044 5.738h-.624c-.767 0-1.295-.456-1.295-1.297 0-.696.528-1.296 1.295-1.296h.624V3.289c0-2.137 1.295-3.289 3.07-3.289.768 0 1.751.312 1.751 1.297 0 .84-.384 1.224-1.08 1.224-.455 0-.839 0-.839 1.08v1.225h.696c.84 0 1.367.312 1.367 1.296 0 1.297-.528 1.297-1.367 1.297h-.696v6.747c0 1.008-.623 1.608-1.463 1.608-.84 0-1.463-.624-1.463-1.608V7.419h.024zm33.317.624c-.528 0-1.68-.84-2.615-.84-.527 0-1.007.24-1.007.84 0 1.369 5.061 1.153 5.061 4.442 0 1.92-1.607 3.457-4.126 3.457-1.607 0-4.053-.912-4.053-2.232 0-.457.455-1.297 1.223-1.297 1.151 0 1.607 1.008 2.998 1.008.912 0 1.152-.312 1.152-.84 0-1.296-5.061-1.152-5.061-4.442 0-1.993 1.607-3.385 3.91-3.385 1.534-.072 3.741.528 3.741 1.993 0 .672-.528 1.296-1.223 1.296zM.557 2.45c-.696 3.457-.312 8.043.24 11.573.24 1.752.384 1.992 1.679 1.608 4.99-1.368 9.427 1.369 14.392.144 1.679-.384 2.302-1.224 2.374-2.76l.24-10.133c-2.518.096-8.275-.888-9.954.72C7.081 2.377 3.1 1.921.558 2.45zm9.139 3.986c-.144-4.61 5.829-2.377 8.97-2.69v.073c-1.678 3.073-5.06 6.986-7.123 8.667 2.446 1.753 2.518 2.833 1.535 2.833h-.072c-1.103-.072-2.183-.144-3.166-.384.072-1.753-.072-6.219-.144-8.5zm4.581 8.883c.84-1.368 3.214-6.747 4.294-10.132v7.515c0 .936-.24 1.849-1.296 2.16-.839.241-1.846.385-2.998.457z",
    fillRule: "nonzero"
  }));
};
/* harmony default export */ var src_FlipbookLogo = (FlipbookLogo);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/IncreaseFontSizeIcon.tsx
/* eslint-disable max-len */

var IncreaseFontSizeIcon = function IncreaseFontSizeIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "30",
    height: "18",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M16.825 15.664c.097.21.145.42.145.631 0 .372-.153.688-.461.947a1.486 1.486 0 01-1.02.388c-.259 0-.501-.064-.728-.194a1.453 1.453 0 01-.534-.655l-1.457-3.254H4.224l-1.456 3.254c-.13.29-.308.51-.534.655a1.546 1.546 0 01-1.772-.194c-.308-.26-.462-.575-.462-.947 0-.21.049-.42.146-.631l6.7-14.397c.146-.324.365-.567.656-.728A1.91 1.91 0 018.473.27c.34 0 .656.09.947.268.307.161.534.404.68.728l6.725 14.397zM5.293 11.1h6.409L8.497 3.889l-3.204 7.21zM25.12 5.37c1.651 0 2.873.413 3.666 1.238.81.81 1.214 2.047 1.214 3.715v5.923c0 .437-.13.785-.388 1.044-.26.243-.615.364-1.069.364-.42 0-.768-.129-1.044-.388-.259-.259-.388-.599-.388-1.02v-.534a3.149 3.149 0 01-1.311 1.481c-.583.356-1.262.534-2.04.534-.793 0-1.513-.162-2.16-.485a3.844 3.844 0 01-1.53-1.336 3.374 3.374 0 01-.558-1.893c0-.874.218-1.562.655-2.064.454-.502 1.182-.866 2.185-1.092 1.004-.227 2.388-.34 4.152-.34h.607v-.559c0-.793-.17-1.367-.51-1.723-.34-.373-.89-.559-1.65-.559-.47 0-.948.073-1.433.219-.486.13-1.06.323-1.724.582-.42.21-.728.316-.922.316a.95.95 0 01-.729-.316c-.178-.21-.267-.485-.267-.825 0-.275.065-.51.194-.704.146-.21.38-.405.704-.583.567-.307 1.238-.55 2.015-.728.793-.178 1.57-.267 2.331-.267zm-.753 10.172c.81 0 1.465-.267 1.967-.8.518-.551.777-1.255.777-2.113v-.51h-.437c-1.084 0-1.926.049-2.525.146-.599.097-1.028.267-1.287.51-.259.242-.388.574-.388.995 0 .518.178.947.534 1.287.372.323.825.485 1.36.485z",
    fill: fill
  }));
};
/* harmony default export */ var src_IncreaseFontSizeIcon = (IncreaseFontSizeIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/DecreaseFontSizeIcon.tsx
/* eslint-disable max-len */

var DecreaseFontSizeIcon = function DecreaseFontSizeIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "18",
    height: "12",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M10.064 9.887a.873.873 0 01.085.368c0 .217-.09.401-.269.552a.867.867 0 01-.595.227.842.842 0 01-.424-.113.847.847 0 01-.312-.382l-.85-1.898H2.714l-.85 1.898a.847.847 0 01-.311.382.902.902 0 01-1.034-.113.697.697 0 01-.269-.553c0-.123.028-.245.085-.368l3.909-8.398a.886.886 0 01.382-.425c.18-.104.368-.156.567-.156.198 0 .382.052.552.156.18.094.311.236.396.425l3.923 8.398zM3.337 7.225h3.74l-1.87-4.207-1.87 4.207zM14.903 3.882c.963 0 1.676.241 2.139.723.472.472.708 1.194.708 2.166v3.456c0 .255-.076.458-.227.609-.15.141-.358.212-.623.212a.853.853 0 01-.609-.226.804.804 0 01-.226-.595v-.312c-.16.369-.416.657-.765.864-.34.208-.737.312-1.19.312-.462 0-.882-.095-1.26-.284a2.24 2.24 0 01-.892-.778 1.968 1.968 0 01-.326-1.105c0-.51.127-.911.382-1.204.265-.292.69-.505 1.275-.637s1.393-.198 2.422-.198h.354v-.326c0-.463-.1-.798-.298-1.006-.198-.217-.519-.325-.963-.325-.274 0-.552.042-.835.127a9.743 9.743 0 00-1.006.34c-.245.123-.425.184-.538.184A.554.554 0 0112 5.695a.72.72 0 01-.156-.482c0-.16.038-.297.114-.41.085-.123.222-.236.41-.34.33-.18.723-.321 1.176-.425a6.197 6.197 0 011.36-.156zm-.439 5.934c.473 0 .855-.156 1.147-.467.303-.321.454-.732.454-1.232v-.298h-.255c-.633 0-1.124.029-1.473.085-.35.057-.6.156-.75.298-.152.141-.227.335-.227.58 0 .302.104.553.311.75.218.19.482.284.793.284z",
    fill: fill
  }));
};
/* harmony default export */ var src_DecreaseFontSizeIcon = (DecreaseFontSizeIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ArrowLeftIcon.tsx
/* eslint-disable max-len */

var ArrowLeftIcon = function ArrowLeftIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#fff' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20"
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M14.233 17.93a.861.861 0 0 1-1.218 0l-7.198-7.2a1.034 1.034 0 0 1 0-1.461l7.198-7.199a.861.861 0 0 1 1.218 1.219l-6.71 6.71 6.71 6.713a.861.861 0 0 1 0 1.218Z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M14.876 18.572a1.77 1.77 0 0 1-2.503 0l-7.199-7.199a1.943 1.943 0 0 1 0-2.747l7.199-7.198a1.77 1.77 0 0 1 2.503 0l-.643.642a.861.861 0 0 0-1.218 0L5.817 9.27a1.034 1.034 0 0 0 0 1.462l7.198 7.199a.861.861 0 1 0 1.218-1.218L7.523 10l6.71-6.711a.861.861 0 0 0 0-1.219l.643-.642a1.77 1.77 0 0 1 0 2.503L8.808 10l6.068 6.069a1.77 1.77 0 0 1 0 2.503Z",
    fill: "#000",
    fillOpacity: "0.2"
  }));
};
/* harmony default export */ var src_ArrowLeftIcon = (ArrowLeftIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ArrowRightIcon.tsx
/* eslint-disable max-len */

var ArrowRightIcon = function ArrowRightIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#fff' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "0 0 20 20"
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M5.766 2.07a.861.861 0 0 1 1.219 0l7.198 7.2a1.034 1.034 0 0 1 0 1.461L6.985 17.93a.861.861 0 0 1-1.219-1.218L12.478 10 5.766 3.29a.861.861 0 0 1 0-1.219Z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M5.124 18.572a1.77 1.77 0 0 1 0-2.503L11.192 10 5.124 3.931a1.77 1.77 0 1 1 2.503-2.503l7.199 7.199a1.943 1.943 0 0 1 0 2.747l-7.199 7.198a1.77 1.77 0 0 1-2.503 0Zm.642-1.86a.861.861 0 0 0 1.219 1.218l7.198-7.199a1.034 1.034 0 0 0 0-1.462L6.985 2.07A.861.861 0 0 0 5.766 3.29L12.478 10l-6.712 6.712Z",
    fill: "#000",
    fillOpacity: "0.2"
  }));
};
/* harmony default export */ var src_ArrowRightIcon = (ArrowRightIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/CopyLinkIcon.tsx
/* eslint-disable max-len */

var CopyLinkIcon = function CopyLinkIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    role: "presentation",
    width: "20",
    height: "10",
    viewBox: "0 0 20 10",
    xmlns: "http://www.w3.org/2000/svg",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M15 0H11V2H15C16.65 2 18 3.35 18 5C18 6.65 16.65 8 15 8H11V10H15C17.76 10 20 7.76 20 5C20 2.24 17.76 0 15 0ZM9 8H5C3.35 8 2 6.65 2 5C2 3.35 3.35 2 5 2H9V0H5C2.24 0 0 2.24 0 5C0 7.76 2.24 10 5 10H9V8ZM6 4H14V6H6V4Z",
    fill: "black"
  }));
};
/* harmony default export */ var src_CopyLinkIcon = (CopyLinkIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/TickIcon.tsx
/* eslint-disable max-len */

var TickIcon = function TickIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    role: "presentation",
    width: "19",
    height: "14",
    viewBox: "0 0 19 14",
    fill: fill,
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M6.49991 11.1698L2.32991 6.99984L0.909912 8.40984L6.49991 13.9998L18.4999 1.99984L17.0899 0.589844L6.49991 11.1698Z",
    fill: fill
  }));
};
/* harmony default export */ var src_TickIcon = (TickIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/PageMoveUpIcon.tsx
/* eslint-disable max-len */

var PageMoveUpIcon = function PageMoveUpIcon(_ref) {
  var fill = _ref.fill,
    className = _ref.className,
    isDisabled = _ref.isDisabled;
  return isDisabled === true ? /*#__PURE__*/react.createElement("svg", {
    width: "16px",
    height: "16px",
    viewBox: "0 0 16 16",
    version: "1.1",
    xmlns: "http://www.w3.org/2000/svg",
    className: className
  }, /*#__PURE__*/react.createElement("title", null, "pagemove-disable-menu-icon"), /*#__PURE__*/react.createElement("g", {
    id: "pagemove-disable-menu-icon",
    stroke: "none",
    strokeWidth: "1",
    fill: "none",
    fillRule: "evenodd",
    fillOpacity: "0.2"
  }, /*#__PURE__*/react.createElement("g", {
    fill: fill,
    id: "panel-move-page-arrow-icon"
  }, /*#__PURE__*/react.createElement("g", null, /*#__PURE__*/react.createElement("path", {
    d: "M2.86520684,3.8823519 L7.70257662,8.94681762 C7.89331032,9.14650554 8.20980958,9.15376436 8.4094975,8.96303066 C8.41634021,8.95649478 8.42299601,8.94976597 8.42945684,8.94285236 L13.1369563,3.90545029 C13.3255001,3.70369334 13.6419013,3.69298194 13.8436583,3.8815257 C13.8511432,3.88852047 13.8584115,3.89574364 13.8654527,3.90318496 L14.6764107,4.76022788 C14.8581859,4.95233299 14.8589191,5.25276937 14.6780835,5.44575932 L8.42943695,12.1143929 C8.24062325,12.3158973 7.92420797,12.3261851 7.72270363,12.1373714 C7.71597912,12.1310704 7.7094301,12.1245847 7.70306406,12.1179217 L1.32667698,5.44412023 C1.14338786,5.25228194 1.1418575,4.95068273 1.32319039,4.7569943 L2.13863627,3.88598609 C2.32736287,3.68440017 2.64377368,3.67397562 2.8453596,3.86270222 C2.85215702,3.86906603 2.85877535,3.87561847 2.86520684,3.8823519 Z",
    transform: "translate(8.000000, 8.000000) scale(1, -1) translate(-8.000000, -8.000000) "
  }))))) : /*#__PURE__*/react.createElement("svg", {
    width: "16px",
    height: "16px",
    viewBox: "0 0 16 16",
    version: "1.1",
    xmlns: "http://www.w3.org/2000/svg",
    className: className
  }, /*#__PURE__*/react.createElement("title", null, "pagemove-menu-icon"), /*#__PURE__*/react.createElement("g", {
    id: "pagemove-menu-icon",
    stroke: "none",
    strokeWidth: "1",
    fill: "none",
    fillRule: "evenodd",
    fillOpacity: "0.87",
    transform: "scale(1, -1) translate(0, -16)"
  }, /*#__PURE__*/react.createElement("g", {
    fill: fill,
    id: "panel-move-page-arrow-icon"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M2.86520684,3.8823519 L7.70257662,8.94681762 C7.89331032,9.14650554 8.20980958,9.15376436 8.4094975,8.96303066 C8.41634021,8.95649478 8.42299601,8.94976597 8.42945684,8.94285236 L13.1369563,3.90545029 C13.3255001,3.70369334 13.6419013,3.69298194 13.8436583,3.8815257 C13.8511432,3.88852047 13.8584115,3.89574364 13.8654527,3.90318496 L14.6764107,4.76022788 C14.8581859,4.95233299 14.8589191,5.25276937 14.6780835,5.44575932 L8.42943695,12.1143929 C8.24062325,12.3158973 7.92420797,12.3261851 7.72270363,12.1373714 C7.71597912,12.1310704 7.7094301,12.1245847 7.70306406,12.1179217 L1.32667698,5.44412023 C1.14338786,5.25228194 1.1418575,4.95068273 1.32319039,4.7569943 L2.13863627,3.88598609 C2.32736287,3.68440017 2.64377368,3.67397562 2.8453596,3.86270222 C2.85215702,3.86906603 2.85877535,3.87561847 2.86520684,3.8823519 Z"
  }))));
};
/* harmony default export */ var src_PageMoveUpIcon = (PageMoveUpIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/PageMoveDownIcon.tsx
/* eslint-disable max-len */

var PageMoveDownIcon = function PageMoveDownIcon(_ref) {
  var fill = _ref.fill,
    className = _ref.className,
    isDisabled = _ref.isDisabled;
  return isDisabled === true ? /*#__PURE__*/react.createElement("svg", {
    width: "16",
    height: "16",
    xmlns: "http://www.w3.org/2000/svg",
    className: className
  }, /*#__PURE__*/react.createElement("title", null, "pagemove-disable-menu-icon"), /*#__PURE__*/react.createElement("g", null, /*#__PURE__*/react.createElement("title", null, "background"), /*#__PURE__*/react.createElement("rect", {
    fill: "none",
    id: "canvas_background",
    height: "402",
    width: "582",
    y: "-1",
    x: "-1"
  })), /*#__PURE__*/react.createElement("g", null, /*#__PURE__*/react.createElement("title", null, "Layer 1"), /*#__PURE__*/react.createElement("g", {
    transform: "rotate(-180 8.000711441040039,7.999889373779296) ",
    fillOpacity: "0.2",
    fillRule: "evenodd",
    fill: "none",
    id: "pagemove-disable-menu-icon"
  }, /*#__PURE__*/react.createElement("g", {
    id: "panel-move-page-arrow-icon",
    fill: fill
  }, /*#__PURE__*/react.createElement("g", {
    id: "svg_1"
  }, /*#__PURE__*/react.createElement("path", {
    id: "svg_2",
    d: "m2.865207,12.117648l4.83737,-5.064466c0.190733,-0.199688 0.507233,-0.206946 0.706921,-0.016213c0.006842,0.006536 0.013498,0.013265 0.019959,0.020179l4.707499,5.037402c0.188544,0.201757 0.504945,0.212468 0.706702,0.023924c0.007485,-0.006994 0.014754,-0.014218 0.021795,-0.021659l0.810958,-0.857043c0.181775,-0.192105 0.182508,-0.492541 0.001672,-0.685531l-6.248646,-6.668634c-0.188814,-0.201504 -0.505229,-0.211792 -0.706733,-0.022978c-0.006725,0.006301 -0.013274,0.012786 -0.01964,0.019449l-6.376387,6.673802c-0.183289,0.191838 -0.18482,0.493437 -0.003487,0.687126l0.815446,0.871008c0.188727,0.201586 0.505138,0.21201 0.706724,0.023284c0.006797,-0.006364 0.013415,-0.012916 0.019847,-0.01965z"
  })))))) : /*#__PURE__*/react.createElement("svg", {
    width: "16px",
    height: "16px",
    viewBox: "0 0 16 16",
    version: "1.1",
    xmlns: "http://www.w3.org/2000/svg",
    className: className
  }, /*#__PURE__*/react.createElement("title", null, "pagemove-menu-icon"), /*#__PURE__*/react.createElement("g", {
    id: "pagemove-menu-icon",
    stroke: "none",
    strokeWidth: "1",
    fill: "none",
    fillRule: "evenodd",
    fillOpacity: "0.87"
  }, /*#__PURE__*/react.createElement("g", {
    fill: fill,
    id: "panel-move-page-arrow-icon"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M2.86520684,3.8823519 L7.70257662,8.94681762 C7.89331032,9.14650554 8.20980958,9.15376436 8.4094975,8.96303066 C8.41634021,8.95649478 8.42299601,8.94976597 8.42945684,8.94285236 L13.1369563,3.90545029 C13.3255001,3.70369334 13.6419013,3.69298194 13.8436583,3.8815257 C13.8511432,3.88852047 13.8584115,3.89574364 13.8654527,3.90318496 L14.6764107,4.76022788 C14.8581859,4.95233299 14.8589191,5.25276937 14.6780835,5.44575932 L8.42943695,12.1143929 C8.24062325,12.3158973 7.92420797,12.3261851 7.72270363,12.1373714 C7.71597912,12.1310704 7.7094301,12.1245847 7.70306406,12.1179217 L1.32667698,5.44412023 C1.14338786,5.25228194 1.1418575,4.95068273 1.32319039,4.7569943 L2.13863627,3.88598609 C2.32736287,3.68440017 2.64377368,3.67397562 2.8453596,3.86270222 C2.85215702,3.86906603 2.85877535,3.87561847 2.86520684,3.8823519 Z"
  }))));
};
/* harmony default export */ var src_PageMoveDownIcon = (PageMoveDownIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Toggle/CheckBox/index.tsx
/* eslint-disable max-len */

var CheckBox = function CheckBox() {
  return /*#__PURE__*/react.createElement("svg", {
    width: "26",
    height: "26",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M20.583 3.25H5.417A2.173 2.173 0 0 0 3.25 5.417v15.166c0 1.192.975 2.167 2.167 2.167h15.166a2.173 2.173 0 0 0 2.167-2.167V5.417a2.173 2.173 0 0 0-2.167-2.167Zm0 17.333H5.417V5.417h15.166v15.166ZM19.49 9.75l-1.527-1.538-7.14 7.139-2.794-2.784-1.539 1.527 4.333 4.323L19.49 9.75Z",
    fill: "#fff"
  }));
};
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Toggle/CheckBoxIndeterminate/index.tsx
/* eslint-disable max-len */

var CheckBoxIndeterminate = function CheckBoxIndeterminate() {
  return /*#__PURE__*/react.createElement("svg", {
    width: "26",
    height: "26",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M20.583 3.25H5.417A2.173 2.173 0 0 0 3.25 5.417v15.166c0 1.192.975 2.167 2.167 2.167h15.166a2.173 2.173 0 0 0 2.167-2.167V5.417a2.173 2.173 0 0 0-2.167-2.167Zm0 17.333H5.417V5.417h15.166v15.166Zm-13-8.666h10.834v2.166H7.583v-2.166Z",
    fill: "#fff"
  }));
};
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Toggle/CheckBoxOutlineBlank/index.tsx
/* eslint-disable max-len */

var CheckBoxOutlineBlank = function CheckBoxOutlineBlank() {
  return /*#__PURE__*/react.createElement("svg", {
    width: "26",
    height: "26",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M20.583 5.417v15.166H5.417V5.417h15.166Zm0-2.167H5.417A2.173 2.173 0 0 0 3.25 5.417v15.166c0 1.192.975 2.167 2.167 2.167h15.166a2.173 2.173 0 0 0 2.167-2.167V5.417a2.173 2.173 0 0 0-2.167-2.167Z",
    fill: "#fff"
  }));
};
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Toggle/index.ts



var Toggle = {
  CheckBox: CheckBox,
  CheckBoxIndeterminate: CheckBoxIndeterminate,
  CheckBoxOutlineBlank: CheckBoxOutlineBlank
};
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Social/Team/index.tsx
/* eslint-disable max-len */

var Team = function Team(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#fff' : _ref$fill,
    _ref$size = _ref.size,
    size = _ref$size === void 0 ? 20 : _ref$size;
  return /*#__PURE__*/react.createElement("svg", {
    width: size,
    height: size,
    viewBox: "0 0 18 18",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    stroke: fill,
    strokeOpacity: "0.87",
    strokeWidth: "0.5",
    d: "M15.3215 12.8056C14.8147 12.2983 14.2224 11.8843 13.5719 11.5825C14.0418 11.2032 14.4208 10.7235 14.6809 10.1785C14.941 9.63355 15.0756 9.03722 15.0749 8.43337C15.0749 6.18967 13.2038 4.34917 10.9601 4.38337C10.1281 4.39638 9.32029 4.66525 8.64642 5.15343C7.97256 5.64161 7.46533 6.32542 7.19369 7.11195C6.92204 7.89848 6.89914 8.74957 7.12811 9.54957C7.35707 10.3496 7.8268 11.0597 8.47344 11.5834C7.8229 11.8847 7.23062 12.2984 6.72384 12.8056C5.62303 13.9023 4.98764 15.3813 4.94994 16.9348C4.94946 16.9563 4.9533 16.9778 4.96123 16.9979C4.96915 17.0179 4.98101 17.0362 4.9961 17.0517C5.01119 17.0671 5.02921 17.0793 5.0491 17.0877C5.069 17.0961 5.09036 17.1004 5.11194 17.1004H6.24594C6.28784 17.1004 6.32812 17.0842 6.35832 17.0552C6.38853 17.0261 6.40631 16.9865 6.40794 16.9447C6.44364 15.7739 6.92679 14.6614 7.75794 13.8361C8.18602 13.4058 8.69518 13.0647 9.25596 12.8325C9.81674 12.6003 10.418 12.4816 11.0249 12.4834C11.6319 12.4816 12.2331 12.6003 12.7939 12.8325C13.3547 13.0647 13.8639 13.4058 14.2919 13.8361C15.1216 14.6624 15.6044 15.7743 15.6419 16.9447C15.6436 16.9865 15.6614 17.0261 15.6916 17.0552C15.7218 17.0842 15.762 17.1004 15.8039 17.1004H16.9379C16.9595 17.1004 16.9809 17.0961 17.0008 17.0877C17.0207 17.0793 17.0387 17.0671 17.0538 17.0517C17.0689 17.0362 17.0807 17.0179 17.0887 16.9979C17.0966 16.9778 17.1004 16.9563 17.0999 16.9348C17.0624 15.3804 16.4252 13.9008 15.3215 12.8056ZM11.0249 11.0263C10.3319 11.0263 9.68034 10.7563 9.19254 10.2667C8.94745 10.0235 8.75386 9.73348 8.62335 9.41385C8.49284 9.09423 8.42809 8.75158 8.43294 8.40637C8.44089 7.72856 8.71368 7.08075 9.193 6.60143C9.67232 6.12211 10.3201 5.84932 10.9979 5.84137C11.686 5.83528 12.3486 6.10154 12.8411 6.58207C13.3433 7.07437 13.6187 7.73227 13.6187 8.43247C13.6187 9.12547 13.3496 9.77527 12.86 10.2658C12.6196 10.5074 12.3336 10.699 12.0186 10.8293C11.7036 10.9597 11.3659 11.0264 11.0249 11.0254V11.0263ZM5.95254 8.96707C5.90107 8.47481 5.92078 7.97771 6.01104 7.49107C6.01786 7.45549 6.01263 7.41865 5.99617 7.38637C5.9797 7.3541 5.95295 7.32824 5.92014 7.31287C5.64295 7.18903 5.39 7.01685 5.17314 6.80437C4.91547 6.55456 4.71269 6.25379 4.57772 5.92126C4.44275 5.58872 4.37856 5.2317 4.38924 4.87297C4.40724 4.22317 4.66824 3.60577 5.12454 3.13957C5.36918 2.88735 5.66278 2.6878 5.98732 2.55315C6.31187 2.4185 6.66051 2.35161 7.01184 2.35657C7.44136 2.36062 7.86313 2.47149 8.23911 2.6792C8.61509 2.88691 8.93347 3.18492 9.16554 3.54637C9.18527 3.57674 9.2146 3.59963 9.24886 3.61138C9.28312 3.62312 9.32033 3.62305 9.35454 3.61117C9.71693 3.48499 10.0926 3.40074 10.4741 3.36007C10.5002 3.35734 10.5253 3.34832 10.5471 3.33378C10.5689 3.31924 10.5869 3.29962 10.5994 3.2766C10.612 3.25359 10.6188 3.22787 10.6192 3.20165C10.6197 3.17543 10.6137 3.14949 10.6019 3.12607C10.2681 2.46603 9.76026 1.9098 9.13321 1.51751C8.50616 1.12523 7.7838 0.911826 7.04424 0.900371C4.79694 0.866171 2.92674 2.70757 2.92674 4.94857C2.92606 5.55242 3.06072 6.14875 3.32082 6.69371C3.58092 7.23867 3.95985 7.71842 4.42974 8.09767C3.77841 8.39895 3.18549 8.81303 2.67834 9.32077C1.57435 10.4165 0.937075 11.8968 0.899942 13.4518C0.899463 13.4733 0.903299 13.4948 0.911225 13.5149C0.919151 13.5349 0.931008 13.5532 0.946099 13.5687C0.96119 13.5841 0.979212 13.5963 0.999105 13.6047C1.019 13.6131 1.04036 13.6174 1.06194 13.6174H2.19774C2.23964 13.6174 2.27992 13.6012 2.31012 13.5722C2.34033 13.5431 2.35811 13.5035 2.35974 13.4617C2.39559 12.2908 2.87908 11.1782 3.71064 10.3531C4.29486 9.76547 5.02777 9.34768 5.83104 9.14437C5.86929 9.13479 5.90274 9.11159 5.92511 9.07912C5.94747 9.04664 5.95723 9.00622 5.95254 8.96707Z"
  }));
};
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Social/index.ts

var Social = {
  Team: Team
};
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Cart/CartBagIcon.tsx
/* eslint-disable max-len */


var CartBagIcon = function CartBagIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#fff' : _ref$fill,
    _ref$stroke = _ref.stroke,
    stroke = _ref$stroke === void 0 ? '' : _ref$stroke,
    _ref$width = _ref.width,
    width = _ref$width === void 0 ? '100%' : _ref$width,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? '100%' : _ref$height;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: width,
    height: height,
    viewBox: "0 0 24 24",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    stroke: stroke,
    d: "M18 6h-2c0-2.21-1.79-4-4-4S8 3.79 8 6H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2Zm-6-2c1.1 0 2 .9 2 2h-4c0-1.1.9-2 2-2Zm6 16H6V8h2v2c0 .55.45 1 1 1s1-.45 1-1V8h4v2c0 .55.45 1 1 1s1-.45 1-1V8h2v12Z"
  }));
};
CartBagIcon.propTypes = {
  fill: (prop_types_default()).string,
  stroke: (prop_types_default()).string
};
/* harmony default export */ var Cart_CartBagIcon = (CartBagIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Cart/CartButtonIcon.tsx
/* eslint-disable max-len */

var CartButtonIcon = function CartButtonIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#fff' : _ref$fill,
    _ref$stroke = _ref.stroke,
    stroke = _ref$stroke === void 0 ? '#000' : _ref$stroke;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    fill: "none",
    viewBox: "0 0 23 28"
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "M21.046 7h-4.057v-.48C16.989 3.472 14.53 1 11.5 1 8.47 1 6.011 3.472 6.011 6.52V7H1.955A.956.956 0 0 0 1 7.96v16.08c0 .531.427.96.955.96h19.09a.956.956 0 0 0 .955-.96V7.96a.956.956 0 0 0-.954-.96ZM8.159 6.52A3.349 3.349 0 0 1 11.5 3.16a3.349 3.349 0 0 1 3.34 3.36V7H8.16v-.48Zm11.693 16.32H3.148V9.16H6.01v2.64c0 .132.108.24.239.24h1.67a.24.24 0 0 0 .24-.24V9.16h6.68v2.64c0 .132.108.24.24.24h1.67a.24.24 0 0 0 .239-.24V9.16h2.863v13.68Z"
  }), /*#__PURE__*/react.createElement("path", {
    stroke: stroke,
    strokeOpacity: ".2",
    d: "M21.046 6.5h-3.557c-.011-3.312-2.686-6-5.989-6s-5.978 2.688-5.989 6H1.955C1.148 6.5.5 7.156.5 7.96v16.08c0 .805.648 1.46 1.455 1.46h19.09c.807 0 1.455-.655 1.455-1.46V7.96c0-.804-.648-1.46-1.454-1.46Zm-12.387 0A2.849 2.849 0 0 1 11.5 3.66a2.849 2.849 0 0 1 2.84 2.84H8.66ZM3.648 22.34V9.66H5.51v2.14c0 .405.329.74.739.74h1.67a.74.74 0 0 0 .74-.74V9.66h5.68v2.14c0 .405.33.74.74.74h1.67a.74.74 0 0 0 .739-.74V9.66h1.863v12.68H3.648Z"
  }));
};
/* harmony default export */ var Cart_CartButtonIcon = (CartButtonIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Cart/CartFavoriteIcon.tsx
/* eslint-disable max-len */

var CartFavoriteIcon = function CartFavoriteIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#fff' : _ref$fill,
    _ref$stroke = _ref.stroke,
    stroke = _ref$stroke === void 0 ? '' : _ref$stroke,
    _ref$width = _ref.width,
    width = _ref$width === void 0 ? '100%' : _ref$width,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? '100%' : _ref$height;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: width,
    height: height,
    viewBox: "0 0 24 24"
  }, /*#__PURE__*/react.createElement("path", {
    stroke: stroke,
    fill: fill,
    d: "M16.5 2.82495c-1.74 0-3.41.81-4.5 2.09-1.09-1.28-2.76-2.09-4.5-2.09-3.08 0-5.5 2.42-5.5 5.5C2 12.105 5.4 15.185 10.55 19.865l1.45 1.31 1.45-1.32C18.6 15.185 22 12.105 22 8.32495c0-3.08-2.42-5.5-5.5-5.5ZM12.1 18.375l-.1.1-.1-.1C7.14 14.065 4 11.215 4 8.32495c0-2 1.5-3.5 3.5-3.5 1.54 0 3.04.99 3.57 2.36h1.87c.52-1.37 2.02-2.36 3.56-2.36 2 0 3.5 1.5 3.5 3.5C20 11.215 16.86 14.065 12.1 18.375Z"
  }));
};
/* harmony default export */ var Cart_CartFavoriteIcon = (CartFavoriteIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Cart/CartStarIcon.tsx
/* eslint-disable max-len */

var CartStarIcon = function CartStarIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#fff' : _ref$fill,
    _ref$width = _ref.width,
    width = _ref$width === void 0 ? '100%' : _ref$width,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? '100%' : _ref$height;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: width,
    height: height,
    viewBox: "0 0 24 24",
    fill: "none"
  }, /*#__PURE__*/react.createElement("clipPath", {
    id: "a"
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "M0 0h24v24H0z"
  })), /*#__PURE__*/react.createElement("g", {
    clipPath: "url(#a)"
  }, /*#__PURE__*/react.createElement("path", {
    fill: "none",
    stroke: fill,
    strokeWidth: "2",
    d: "m12.375 3.08858 2.3216 4.2569c.2876.52746.7972.89765 1.3877 1.00824l4.766.8925-3.3312 3.52338c-.4127.4366-.6074 1.0356-.53 1.6314l.6239 4.8085-4.3803-2.0793c-.5428-.2577-1.1726-.2577-1.7154 0L7.137 19.2095l.62394-4.8085c.07731-.5958-.11731-1.1948-.53006-1.6314L3.89974 9.24622l4.76596-.8925c.59053-.11059 1.10006-.48079 1.3877-1.00824l2.3216-4.2569Z"
  })));
};
/* harmony default export */ var Cart_CartStarIcon = (CartStarIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Cart/CartIcon.tsx
/* eslint-disable max-len */

var CartIcon_CartIcon = function CartIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#fff' : _ref$fill,
    _ref$stroke = _ref.stroke,
    stroke = _ref$stroke === void 0 ? '' : _ref$stroke,
    _ref$width = _ref.width,
    width = _ref$width === void 0 ? '100%' : _ref$width,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? '100%' : _ref$height;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: width,
    height: height,
    viewBox: "0 0 24 24",
    fill: "none"
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    stroke: stroke,
    d: "M16.5463 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H6.20634l-.94-2h-3.27v2h2l3.6 7.59-1.35 2.44c-.73 1.34.23 2.97 1.75 2.97H19.9963v-2H7.99634l1.1-2h7.44996ZM7.15634 6H19.3063l-2.76 5H9.52634l-2.37-5Zm.84 12c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2Zm9.99996 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2Z"
  }));
};
/* harmony default export */ var Cart_CartIcon = (CartIcon_CartIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/Cart/index.ts





var CartElementIcons = {
  CartBagIcon: Cart_CartBagIcon,
  CartFavoriteIcon: Cart_CartFavoriteIcon,
  CartStarIcon: Cart_CartStarIcon,
  CartIcon: Cart_CartIcon,
  CartButtonIcon: Cart_CartButtonIcon
};
// EXTERNAL MODULE: ../../modules/ui/code/constants/CartIconTypes.ts
var CartIconTypes = __webpack_require__(9682);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/SuccessfulIcon.tsx
/* eslint-disable max-len */

var SuccesfullIcon = function SuccesfullIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill,
    ariaLabel = _ref.ariaLabel;
  return /*#__PURE__*/react.createElement("svg", {
    width: "48",
    height: "48",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    "aria-label": ariaLabel
  }, /*#__PURE__*/react.createElement("path", {
    d: "M34.71 14.853 21.667 27.896l-7.21-7.186-3.29 3.29 10.5 10.5L38 18.166l-3.29-3.313ZM24 .667C11.12.667.667 11.12.667 24 .667 36.88 11.12 47.333 24 47.333c12.88 0 23.333-10.453 23.333-23.333C47.333 11.12 36.88.667 24 .667Zm0 42C13.687 42.666 5.333 34.313 5.333 24 5.333 13.687 13.687 5.333 24 5.333c10.313 0 18.667 8.354 18.667 18.667 0 10.313-8.354 18.666-18.667 18.666Z",
    fill: fill
  }));
};
/* harmony default export */ var SuccessfulIcon = (SuccesfullIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/EditorSearchIcon.tsx
/* eslint-disable max-len */

var EditorSearchIcon = function EditorSearchIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill,
    _ref$className = _ref.className,
    className = _ref$className === void 0 ? '' : _ref$className;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "17",
    height: "18",
    className: className
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "M16.742 16.395L12.55 11.94a7.347 7.347 0 001.668-4.673C14.219 3.26 11.029 0 7.109 0 3.19 0 0 3.26 0 7.267c0 4.008 3.19 7.268 7.11 7.268a6.929 6.929 0 004.072-1.315l4.223 4.49a.91.91 0 001.311.026.965.965 0 00.026-1.34zM7.247 1.98c2.911 0 5.28 2.422 5.28 5.4s-2.369 5.4-5.28 5.4c-2.91 0-5.279-2.422-5.279-5.4s2.368-5.4 5.28-5.4z"
  }));
};
/* harmony default export */ var src_EditorSearchIcon = (EditorSearchIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/InfoIcon.tsx
/* eslint-disable max-len */

var InfoIcon = function InfoIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000' : _ref$fill,
    _ref$stroke = _ref.stroke,
    stroke = _ref$stroke === void 0 ? '#000' : _ref$stroke;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "17",
    height: "17"
  }, /*#__PURE__*/react.createElement("g", {
    fill: "none",
    transform: "translate(1 1)"
  }, /*#__PURE__*/react.createElement("circle", {
    cx: "7.5",
    cy: "7.5",
    r: "7.5",
    stroke: stroke
  }), /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "M8.325 3c-.572 0-.883.55-.883.94.013.47.272.74.675.74.506 0 .883-.444.883-.941C8.987 3.349 8.78 3 8.325 3zm.233 7.227.208.322C8.026 11.422 7.013 12 6.584 12c-.32 0-.547-.23-.335-1.255l.777-3.393.038-.201c.027-.172.017-.255-.051-.255-.104 0-.494.228-.844.51L6 7.07c.87-.846 1.818-1.397 2.234-1.397.363 0 .402.497.22 1.25l-.805 3.384c-.09.377-.065.51.026.51.143 0 .52-.268.883-.59z"
  })));
};
/* harmony default export */ var src_InfoIcon = (InfoIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ZoomIcon.tsx
/* eslint-disable max-len */

var ZoomIcon = function ZoomIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#fff' : _ref$fill,
    _ref$stroke = _ref.stroke,
    stroke = _ref$stroke === void 0 ? '#000' : _ref$stroke;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "26",
    height: "26",
    viewBox: "0 0 26 26",
    fill: "none"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M10.1969 5.08794C10.7613 5.08794 11.2188 5.54547 11.2188 6.10986V9.17559H14.2854C14.8498 9.17559 15.3074 9.63311 15.3074 10.1975C15.3074 10.7619 14.8498 11.2194 14.2854 11.2194H11.2188V14.2852C11.2188 14.8496 10.7613 15.3071 10.1969 15.3071C9.63251 15.3071 9.17499 14.8496 9.17499 14.2852V11.2194H6.11008C5.54569 11.2194 5.08816 10.7619 5.08816 10.1975C5.08816 9.63311 5.54569 9.17559 6.11008 9.17559H9.17499V6.10986C9.17499 5.54547 9.63252 5.08794 10.1969 5.08794Z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M15.9441 17.3786C14.3698 18.6401 12.3717 19.3946 10.1974 19.3946C5.11784 19.3946 1.00008 15.2768 1.00008 10.1973C1.00008 5.11776 5.11784 1 10.1974 1C15.2769 1 19.3946 5.11776 19.3946 10.1973C19.3946 12.3719 18.6399 14.3703 17.3781 15.9447C17.4115 15.9707 17.4437 15.999 17.4744 16.0297L24.7005 23.2558C25.0996 23.6549 25.0996 24.3019 24.7005 24.701C24.3014 25.1001 23.6544 25.1001 23.2553 24.701L16.0292 17.475C15.9985 17.4442 15.9701 17.412 15.9441 17.3786ZM17.3946 10.1973C17.3946 14.1722 14.1723 17.3946 10.1974 17.3946C6.22241 17.3946 3.00008 14.1722 3.00008 10.1973C3.00008 6.22234 6.22241 3.00001 10.1974 3.00001C14.1723 3.00001 17.3946 6.22234 17.3946 10.1973Z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    d: "M18.0458 15.894C19.2085 14.2946 19.8946 12.3255 19.8946 10.1973C19.8946 4.84162 15.553 0.5 10.1974 0.5C4.8417 0.5 0.500076 4.84162 0.500076 10.1973C0.500076 15.5529 4.8417 19.8946 10.1974 19.8946C12.3253 19.8946 14.2941 19.2087 15.8934 18.0462L22.9017 25.0546C23.4961 25.6489 24.4597 25.6489 25.0541 25.0546C25.6484 24.4602 25.6484 23.4966 25.0541 22.9023L18.0458 15.894ZM11.7188 6.10986C11.7188 5.26933 11.0374 4.58794 10.1969 4.58794C9.35637 4.58794 8.67499 5.26933 8.67499 6.10986V8.67559H6.11008C5.26955 8.67559 4.58816 9.35697 4.58816 10.1975C4.58816 11.038 5.26955 11.7194 6.11008 11.7194H8.67499V14.2852C8.67499 15.1258 9.35637 15.8071 10.1969 15.8071C11.0374 15.8071 11.7188 15.1258 11.7188 14.2852V11.7194H14.2854C15.126 11.7194 15.8074 11.038 15.8074 10.1975C15.8074 9.35697 15.126 8.67559 14.2854 8.67559H11.7188V6.10986ZM16.8946 10.1973C16.8946 13.8961 13.8962 16.8946 10.1974 16.8946C6.49856 16.8946 3.50008 13.8961 3.50008 10.1973C3.50008 6.49848 6.49856 3.50001 10.1974 3.50001C13.8962 3.50001 16.8946 6.49848 16.8946 10.1973Z",
    stroke: stroke,
    strokeOpacity: "0.2"
  }));
};
/* harmony default export */ var src_ZoomIcon = (ZoomIcon);
// EXTERNAL MODULE: ../../modules/ui/code/content-icons/src/RemoveItemIcon.tsx
var RemoveItemIcon = __webpack_require__(4236);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ClearSearchIcon.tsx
/* eslint-disable max-len */

var ClearSearchIcon = function ClearSearchIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#ffffff' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "18",
    height: "18",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    "aria-hidden": true
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    fill: fill,
    d: "M13.653 2.347C12.088.782 10.203 0 8 0 5.797 0 3.912.782 2.347 2.347.782 3.912 0 5.797 0 8c0 2.203.782 4.088 2.347 5.653C3.912 15.217 5.797 16 8 16c2.203 0 4.088-.783 5.653-2.347C15.217 12.088 16 10.203 16 8c0-2.203-.783-4.088-2.347-5.653zM3.586 11.471c-.166.166-.089.511.172.772.26.26.605.337.77.171L8 8.943l3.472 3.471c.165.166.51.09.77-.171.261-.26.338-.606.172-.771L8.943 8l3.471-3.471c.166-.166.09-.511-.171-.771-.26-.26-.606-.338-.772-.172l-3.47 3.471-3.472-3.47c-.166-.166-.511-.09-.771.17-.26.261-.337.606-.172.772L7.057 8l-3.47 3.471z"
  }));
};
/* harmony default export */ var src_ClearSearchIcon = (ClearSearchIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/PagesOverviewIcon.tsx

/* eslint-disable max-len */

var PagesOverviewIcon = function PagesOverviewIcon() {
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    viewBox: "0 0 26 26",
    fill: "none"
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M1 3C1 1.89543 1.89543 1 3 1H10C11.1046 1 12 1.89543 12 3V10C12 11.1046 11.1046 12 10 12H3C1.89543 12 1 11.1046 1 10V3ZM10 3H3V10H10V3Z",
    fill: "white"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M3 0.5C1.61929 0.5 0.5 1.61929 0.5 3V10C0.5 11.3807 1.61929 12.5 3 12.5H10C11.3807 12.5 12.5 11.3807 12.5 10V3C12.5 1.61929 11.3807 0.5 10 0.5H3ZM3.5 9.5V3.5H9.5V9.5H3.5Z",
    stroke: "black",
    strokeOpacity: "0.2"
  }), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M1 16C1 14.8954 1.89543 14 3 14H10C11.1046 14 12 14.8954 12 16V23C12 24.1046 11.1046 25 10 25H3C1.89543 25 1 24.1046 1 23V16ZM10 16H3V23H10V16Z",
    fill: "white"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M3 13.5C1.61929 13.5 0.5 14.6193 0.5 16V23C0.5 24.3807 1.61929 25.5 3 25.5H10C11.3807 25.5 12.5 24.3807 12.5 23V16C12.5 14.6193 11.3807 13.5 10 13.5H3ZM3.5 22.5V16.5H9.5V22.5H3.5Z",
    stroke: "black",
    strokeOpacity: "0.2"
  }), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M14 3C14 1.89543 14.8954 1 16 1H23C24.1046 1 25 1.89543 25 3V10C25 11.1046 24.1046 12 23 12H16C14.8954 12 14 11.1046 14 10V3ZM23 3H16V10H23V3Z",
    fill: "white"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M16 0.5C14.6193 0.5 13.5 1.61929 13.5 3V10C13.5 11.3807 14.6193 12.5 16 12.5H23C24.3807 12.5 25.5 11.3807 25.5 10V3C25.5 1.61929 24.3807 0.5 23 0.5H16ZM16.5 9.5V3.5H22.5V9.5H16.5Z",
    stroke: "black",
    strokeOpacity: "0.2"
  }), /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M14 16C14 14.8954 14.8954 14 16 14H23C24.1046 14 25 14.8954 25 16V23C25 24.1046 24.1046 25 23 25H16C14.8954 25 14 24.1046 14 23V16ZM23 16H16V23H23V16Z",
    fill: "white"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M16 13.5C14.6193 13.5 13.5 14.6193 13.5 16V23C13.5 24.3807 14.6193 25.5 16 25.5H23C24.3807 25.5 25.5 24.3807 25.5 23V16C25.5 14.6193 24.3807 13.5 23 13.5H16ZM16.5 22.5V16.5H22.5V22.5H16.5Z",
    stroke: "black",
    strokeOpacity: "0.2"
  }));
};
/* harmony default export */ var src_PagesOverviewIcon = (PagesOverviewIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/BackgroundSoundOnIcon.tsx
/* eslint-disable max-len */

var BackgroundSoundOnIcon = function BackgroundSoundOnIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    viewBox: "0 0 24 22",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M16 1a1 1 0 0 0-1.651-.759L8.472 5.278A3 3 0 0 1 6.52 6H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h4.52a3 3 0 0 1 1.952.722l5.877 5.037a1 1 0 0 0 1.65-.76V1ZM9.773 6.796l4.225-3.621v15.65l-4.225-3.621A5 5 0 0 0 6.52 14H2V8h4.52a5 5 0 0 0 3.254-1.204Z",
    clipRule: "evenodd",
    fill: fill,
    fillRule: "evenodd"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M20.451 4.81a1 1 0 0 1 1.397.222l.628.867a8 8 0 0 1 0 9.393l-.628.866a1 1 0 1 1-1.62-1.174l.63-.866a6 6 0 0 0 0-7.045l-.63-.867a1 1 0 0 1 .223-1.396Z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    d: "M17.78 5.69a1 1 0 0 1 1.386.281l.136.206a8 8 0 0 1-.014 8.858l-.124.186a1 1 0 0 1-1.664-1.11l.124-.186a6 6 0 0 0 .01-6.643l-.136-.206a1 1 0 0 1 .282-1.386Z",
    fill: fill
  }));
};
/* harmony default export */ var src_BackgroundSoundOnIcon = (BackgroundSoundOnIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/BackgroundSoundOffIcon.tsx
/* eslint-disable max-len */

var BackgroundSoundOffIcon = function BackgroundSoundOffIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    viewBox: "0 0 25 22",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M16.5 1a1 1 0 0 0-1.651-.759L8.972 5.278A3 3 0 0 1 7.02 6H2.5a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h4.52a3 3 0 0 1 1.952.722l5.877 5.037a1 1 0 0 0 1.65-.76V1Zm-6.226 5.796 4.225-3.621v15.65l-4.225-3.621A5 5 0 0 0 7.02 14H2.5V8h4.52a5 5 0 0 0 3.254-1.204Z",
    clipRule: "evenodd",
    fill: fill,
    fillRule: "evenodd"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M20.951 4.81a1 1 0 0 1 1.397.222l.628.867a8 8 0 0 1 0 9.393l-.628.866a1 1 0 1 1-1.62-1.174l.63-.866a6 6 0 0 0 0-7.045l-.63-.867a1 1 0 0 1 .223-1.396Z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    d: "M18.28 5.69a1 1 0 0 1 1.386.281l.136.206a8 8 0 0 1-.014 8.858l-.124.186A1 1 0 0 1 18 14.111l.124-.186a6 6 0 0 0 .01-6.643l-.136-.206a1 1 0 0 1 .282-1.386ZM1.207.708a1 1 0 0 1 1.414 0l19.09 19.089a1 1 0 1 1-1.415 1.414L1.207 2.12a1 1 0 0 1 0-1.413Z",
    fill: fill
  }));
};
/* harmony default export */ var src_BackgroundSoundOffIcon = (BackgroundSoundOffIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/SearchIconNoResults.tsx
/* eslint-disable max-len */

var SearchIconNoResults = function SearchIconNoResults(_ref) {
  var fill = _ref.fill,
    size = _ref.size;
  return /*#__PURE__*/react.createElement("svg", {
    width: size,
    height: size,
    viewBox: "0 0 201 201",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("g", {
    id: "Search icon",
    clipPath: "url(#clip0_1837_18367)"
  }, /*#__PURE__*/react.createElement("path", {
    id: "Vector",
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M113.259 112.539C113.509 112.287 113.807 112.088 114.135 111.952C114.463 111.816 114.814 111.746 115.169 111.746C115.524 111.746 115.875 111.816 116.203 111.952C116.531 112.088 116.828 112.287 117.079 112.539L176.923 172.533C177.43 173.042 177.714 173.731 177.714 174.448C177.714 175.166 177.43 175.855 176.923 176.363C176.673 176.615 176.375 176.814 176.047 176.95C175.719 177.086 175.368 177.156 175.013 177.156C174.658 177.156 174.307 177.086 173.979 176.95C173.652 176.814 173.354 176.615 173.103 176.363L113.259 116.369C112.752 115.861 112.467 115.172 112.467 114.454C112.467 113.736 112.752 113.047 113.259 112.539Z",
    fill: fill
  }), /*#__PURE__*/react.createElement("path", {
    id: "Vector_2",
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M68.5823 130.476C102.893 130.476 130.707 102.591 130.707 68.1956C130.707 33.7989 102.892 5.91556 68.5823 5.91556C34.2712 5.91556 6.45789 33.7989 6.45789 68.1956C6.45789 102.591 34.2712 130.476 68.5823 130.476ZM68.5823 135.891C105.876 135.891 136.109 105.582 136.109 68.1956C136.109 30.8078 105.876 0.5 68.5823 0.5C31.2879 0.5 1.05566 30.8078 1.05566 68.1956C1.05566 105.582 31.289 135.891 68.5823 135.891Z",
    fill: fill
  })), /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("clipPath", {
    id: "clip0_1837_18367"
  }, /*#__PURE__*/react.createElement("rect", {
    width: "200",
    height: "200",
    fill: fill,
    transform: "translate(0.5 0.5)"
  }))));
};
/* harmony default export */ var src_SearchIconNoResults = (SearchIconNoResults);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/SparkleAiIcon.tsx
/* eslint-disable max-len */

var SparkleAiIcon = function SparkleAiIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    width: "20px",
    height: "20px"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M9.496 8.922c2.12-.345 3.581-1.805 3.926-3.926C13.51 4.451 13.948 4 14.5 4s.99.451 1.078.996c.345 2.12 1.805 3.581 3.926 3.926.545.088.996.526.996 1.078s-.451.99-.996 1.078c-2.12.345-3.581 1.805-3.926 3.926-.088.545-.526.996-1.078.996s-.99-.451-1.078-.996c-.345-2.12-1.805-3.581-3.926-3.926C8.951 10.99 8.5 10.552 8.5 10s.451-.99.996-1.078Z",
    fill: fill || 'url(#sparkle-icon-gr-1)'
  }), /*#__PURE__*/react.createElement("path", {
    d: "M1.164 15.281c1.414-.23 2.387-1.203 2.617-2.617.06-.363.35-.664.719-.664.368 0 .66.3.719.664.23 1.414 1.203 2.387 2.617 2.617.363.06.664.35.664.719 0 .368-.3.66-.664.719-1.414.23-2.387 1.203-2.617 2.617-.06.363-.35.664-.719.664-.368 0-.66-.3-.719-.664-.23-1.414-1.203-2.387-2.617-2.617C.801 16.659.5 16.369.5 16c0-.368.3-.66.664-.719Z",
    fill: fill || 'url(#sparkle-icon-gr-2)'
  }), /*#__PURE__*/react.createElement("path", {
    d: "M2.998 2.46c1.06-.171 1.79-.902 1.963-1.962C5.005.226 5.224 0 5.5 0s.495.226.54.498c.171 1.06.902 1.79 1.962 1.963.272.044.498.263.498.539s-.226.495-.498.54c-1.06.171-1.79.902-1.963 1.962C5.995 5.774 5.776 6 5.5 6s-.495-.226-.54-.498c-.171-1.06-.902-1.79-1.962-1.963C2.726 3.495 2.5 3.276 2.5 3s.226-.495.498-.54Z",
    fill: fill || 'url(#sparkle-icon-gr-3)'
  }));
};
/* harmony default export */ var src_SparkleAiIcon = (SparkleAiIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/AiCreditsIcon.tsx
/* eslint-disable max-len */

var AiCreditsIcon = function AiCreditsIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    width: "23",
    height: "14",
    viewBox: "0 0 23 14",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M7 14c-1.95 0-3.604-.68-4.963-2.037C.68 10.604 0 8.95 0 7c0-1.95.68-3.604 2.038-4.963C3.396.68 5.05 0 7 0h8c1.95 0 3.604.68 4.962 2.038C21.322 3.396 22 5.05 22 7c0 1.95-.68 3.604-2.038 4.963C18.604 13.32 16.95 14 15 14H7Zm0-2h8c1.383 0 2.563-.488 3.538-1.463C19.512 9.563 20 8.383 20 7s-.488-2.563-1.462-3.538C17.562 2.487 16.383 2 15 2H7c-1.383 0-2.563.487-3.538 1.462C2.487 4.438 2 5.617 2 7s.487 2.563 1.462 3.537C4.438 11.512 5.617 12 7 12Z",
    fill: fill || 'url(#ai-credits-gr-1)'
  }), /*#__PURE__*/react.createElement("path", {
    d: "M8.498 6.46c1.06-.171 1.79-.902 1.963-1.962.044-.272.263-.498.539-.498s.495.226.54.498c.171 1.06.902 1.79 1.962 1.963.272.044.498.263.498.539s-.226.495-.498.54c-1.06.171-1.79.902-1.963 1.962-.044.272-.263.498-.539.498s-.495-.226-.54-.498c-.171-1.06-.902-1.79-1.962-1.963C8.226 7.495 8 7.276 8 7s.226-.495.498-.54Z",
    fill: fill || 'url(#ai-credits-gr-2)'
  }), /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("linearGradient", {
    id: "ai-credits-gr-1",
    x1: "11",
    y1: "0",
    x2: "11",
    y2: "14",
    gradientUnits: "userSpaceOnUse"
  }, /*#__PURE__*/react.createElement("stop", {
    stopColor: "#4557FA"
  }), /*#__PURE__*/react.createElement("stop", {
    offset: "1",
    stopColor: "#FF45C0"
  })), /*#__PURE__*/react.createElement("linearGradient", {
    id: "ai-credits-gr-2",
    x1: "11",
    y1: "0",
    x2: "11",
    y2: "14",
    gradientUnits: "userSpaceOnUse"
  }, /*#__PURE__*/react.createElement("stop", {
    stopColor: "#4557FA"
  }), /*#__PURE__*/react.createElement("stop", {
    offset: "1",
    stopColor: "#FF45C0"
  }))));
};
/* harmony default export */ var src_AiCreditsIcon = (AiCreditsIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/WhatsAppIcon.tsx
/* eslint-disable max-len */

var WhatsAppIcon = function WhatsAppIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#fff' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "100%",
    height: "100%",
    fill: "none",
    viewBox: "0 0 22 22"
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    fillRule: "evenodd",
    d: "M17.586 3.872a9.892 9.892 0 0 0-7.044-2.92C5.052.952.585 5.419.584 10.909a9.937 9.937 0 0 0 1.329 4.979L.5 21.048l5.28-1.384a9.945 9.945 0 0 0 4.758 1.211h.004c5.488 0 9.956-4.467 9.958-9.958a9.897 9.897 0 0 0-2.914-7.044Zm-7.044 15.322h-.003c-1.485 0-2.942-.4-4.213-1.154l-.302-.18-3.133.822.836-3.054-.197-.313a8.256 8.256 0 0 1-1.265-4.405c.002-4.564 3.715-8.277 8.28-8.277a8.22 8.22 0 0 1 5.852 2.428 8.226 8.226 0 0 1 2.422 5.855c-.002 4.564-3.715 8.277-8.277 8.277Zm4.54-6.2c-.249-.124-1.472-.725-1.7-.808-.229-.084-.394-.125-.56.124-.166.25-.643.81-.788.976-.145.166-.29.186-.539.062-.249-.125-1.05-.387-2.001-1.235-.74-.66-1.24-1.474-1.384-1.724-.145-.249-.016-.384.109-.507.111-.112.248-.291.373-.436.125-.145.166-.25.249-.415.083-.166.041-.311-.02-.436-.063-.125-.56-1.35-.768-1.848-.202-.485-.407-.419-.56-.427-.145-.007-.31-.008-.477-.008a.914.914 0 0 0-.663.31c-.229.25-.871.852-.871 2.076 0 1.225.891 2.409 1.016 2.575.124.166 1.754 2.679 4.25 3.757.594.256 1.057.41 1.419.524.596.19 1.138.163 1.567.1.478-.072 1.472-.603 1.68-1.184.207-.581.207-1.08.145-1.183-.063-.104-.229-.167-.477-.291v-.001Z",
    clipRule: "evenodd"
  }));
};
/* harmony default export */ var src_WhatsAppIcon = (WhatsAppIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ArrowDropdownDown.tsx

var ArrowDropdownDown = function ArrowDropdownDown() {
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "16",
    height: "16",
    viewBox: "0 0 16 16",
    fill: "none"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M4.6665 6.3335L7.99984 9.66683L11.3332 6.3335H4.6665Z",
    fill: "black"
  }));
};
/* harmony default export */ var src_ArrowDropdownDown = (ArrowDropdownDown);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/ErrorIcon.tsx
/* eslint-disable max-len */

var ErrorIcon = function ErrorIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#DB2B3A' : _ref$fill,
    ariaLabel = _ref.ariaLabel;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "42",
    height: "42",
    fill: "none",
    "aria-label": ariaLabel
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "M29.703 0H12.297L0 12.297v17.406L12.297 42h17.406L42 29.703V12.297L29.703 0Zm7.63 27.767-9.566 9.566H14.233l-9.566-9.566V14.233l9.566-9.566h13.534l9.566 9.566v13.534Zm-9.73-16.66L21 17.71l-6.603-6.603-3.29 3.29L17.71 21l-6.603 6.603 3.29 3.29L21 24.29l6.603 6.603 3.29-3.29L24.29 21l6.603-6.603-3.29-3.29Z"
  }));
};
/* harmony default export */ var src_ErrorIcon = (ErrorIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/LockIcon.tsx
/* eslint-disable max-len */

var LockIcon = function LockIcon(_ref) {
  var fill = _ref.fill,
    _ref$width = _ref.width,
    width = _ref$width === void 0 ? '22' : _ref$width,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? '29' : _ref$height;
  return /*#__PURE__*/react.createElement("svg", {
    width: width,
    height: height,
    fill: fill,
    viewBox: "0 0 22 29",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    d: "m19 9.6666h-1.3334v-2.6667c0-3.68-2.9866-6.6667-6.6666-6.6667-3.68 0-6.6667 2.9867-6.6667 6.6667v2.6667h-1.3333c-1.4667 0-2.6667 1.2-2.6667 2.6666v13.333c0 1.4667 1.2 2.6667 2.6667 2.6667h16c1.4666 0 2.6666-1.2 2.6666-2.6667v-13.333c0-1.4667-1.2-2.6666-2.6666-2.6666zm-12-2.6667c0-2.2133 1.7867-4 4-4 2.2133 0 4 1.7867 4 4v2.6667h-8v-2.6667zm12 18.667h-16v-13.333h16v13.333zm-8-4c1.4666 0 2.6666-1.2 2.6666-2.6666 0-1.4667-1.2-2.6667-2.6666-2.6667-1.4667 0-2.6667 1.2-2.6667 2.6667 0 1.4666 1.2 2.6666 2.6667 2.6666z"
  }));
};
/* harmony default export */ var src_LockIcon = (LockIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/FailedIcon.tsx
/* eslint-disable max-len */

var FailedIcon = function FailedIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill,
    ariaLabel = _ref.ariaLabel;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "48",
    height: "48",
    fill: "none",
    "aria-label": ariaLabel
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "M21.667 31h4.666v4.667h-4.666V31Zm0-18.667h4.666v14h-4.666v-14ZM23.977.667C11.097.667.667 11.12.667 24c0 12.88 10.43 23.333 23.31 23.333C36.88 47.333 47.333 36.88 47.333 24 47.333 11.12 36.88.667 23.977.667Zm.023 42C13.687 42.667 5.333 34.313 5.333 24 5.333 13.687 13.687 5.333 24 5.333c10.313 0 18.667 8.354 18.667 18.667 0 10.313-8.354 18.667-18.667 18.667Z"
  }));
};
/* harmony default export */ var src_FailedIcon = (FailedIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/AiAccesibilityIcon.tsx
/* eslint-disable max-len */

var AiAccessibilityIcon = function AiAccessibilityIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    fill: "none"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M17.0833 4.99996C14.9083 5.58329 12.3583 5.83329 10 5.83329C7.64167 5.83329 5.09167 5.58329 2.91667 4.99996L2.5 6.66663C4.05 7.08329 5.83333 7.35829 7.5 7.49996V18.3333H9.16667V13.3333H10.8333V18.3333H12.5V7.49996C14.1667 7.35829 15.95 7.08329 17.5 6.66663L17.0833 4.99996ZM10 4.99996C10.9167 4.99996 11.6667 4.24996 11.6667 3.33329C11.6667 2.41663 10.9167 1.66663 10 1.66663C9.08333 1.66663 8.33333 2.41663 8.33333 3.33329C8.33333 4.24996 9.08333 4.99996 10 4.99996Z",
    fill: fill || 'url(#paint0_linear_200_6332)'
  }), /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("linearGradient", {
    id: "paint0_linear_200_6332",
    x1: "10",
    y1: "1.66663",
    x2: "10",
    y2: "18.3333",
    gradientUnits: "userSpaceOnUse"
  }, /*#__PURE__*/react.createElement("stop", {
    stopColor: "#4557FA"
  }), /*#__PURE__*/react.createElement("stop", {
    offset: "1",
    stopColor: "#FF45C0"
  }))));
};
/* harmony default export */ var AiAccesibilityIcon = (AiAccessibilityIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/AiTranslateIcon.tsx
/* eslint-disable max-len */

var AiTranslateIcon = function AiTranslateIcon(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "20",
    height: "20",
    viewBox: "0 0 20 20",
    fill: "none"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M10.7252 12.5583L8.6085 10.4666L8.63349 10.4416C10.0835 8.82496 11.1168 6.96663 11.7252 4.99996H14.1668V3.33329H8.3335V1.66663H6.66683V3.33329H0.833496V4.99163H10.1418C9.5835 6.59996 8.70016 8.12496 7.50016 9.45829C6.72516 8.59996 6.0835 7.65829 5.57516 6.66663H3.9085C4.51683 8.02496 5.35016 9.30829 6.39183 10.4666L2.15016 14.65L3.3335 15.8333L7.50016 11.6666L10.0918 14.2583L10.7252 12.5583ZM15.4168 8.33329H13.7502L10.0002 18.3333H11.6668L12.6002 15.8333H16.5585L17.5002 18.3333H19.1668L15.4168 8.33329ZM13.2335 14.1666L14.5835 10.5583L15.9335 14.1666H13.2335Z",
    fill: fill || 'url(#paint0_linear_200_6271)'
  }));
};
/* harmony default export */ var src_AiTranslateIcon = (AiTranslateIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/GlobalSvgDefs/SparkleAiIcon.tsx

var SparkleAiIcon_SparkleAiIcon = function SparkleAiIcon() {
  return /*#__PURE__*/react.createElement("svg", {
    width: "0",
    height: "0",
    style: {
      position: 'absolute'
    }
  }, /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("linearGradient", {
    id: "sparkle-icon-gr-1",
    x1: "14.5",
    y1: "4",
    x2: "14.5",
    y2: "16",
    gradientUnits: "userSpaceOnUse"
  }, /*#__PURE__*/react.createElement("stop", {
    stopColor: "#4557FA"
  }), /*#__PURE__*/react.createElement("stop", {
    offset: "1",
    stopColor: "#FF45C0"
  })), /*#__PURE__*/react.createElement("linearGradient", {
    id: "sparkle-icon-gr-2",
    x1: "4.5",
    y1: "12",
    x2: "4.5",
    y2: "20",
    gradientUnits: "userSpaceOnUse"
  }, /*#__PURE__*/react.createElement("stop", {
    stopColor: "#4557FA"
  }), /*#__PURE__*/react.createElement("stop", {
    offset: "1",
    stopColor: "#FF45C0"
  })), /*#__PURE__*/react.createElement("linearGradient", {
    id: "sparkle-icon-gr-3",
    x1: "5.5",
    y1: "0",
    x2: "5.5",
    y2: "6",
    gradientUnits: "userSpaceOnUse"
  }, /*#__PURE__*/react.createElement("stop", {
    stopColor: "#4557FA"
  }), /*#__PURE__*/react.createElement("stop", {
    offset: "1",
    stopColor: "#FF45C0"
  }))));
};
/* harmony default export */ var GlobalSvgDefs_SparkleAiIcon = (SparkleAiIcon_SparkleAiIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/GlobalSvgDefs/AiTranslateIcon.tsx

var AiTranslateIcon_AiTranslateIcon = function AiTranslateIcon() {
  return /*#__PURE__*/react.createElement("svg", {
    width: "0",
    height: "0",
    style: {
      position: 'absolute'
    }
  }, /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("linearGradient", {
    id: "paint0_linear_200_6271",
    x1: "10.0002",
    y1: "1.66663",
    x2: "10.0002",
    y2: "18.3333",
    gradientUnits: "userSpaceOnUse"
  }, /*#__PURE__*/react.createElement("stop", {
    stopColor: "#4557FA"
  }), /*#__PURE__*/react.createElement("stop", {
    offset: "1",
    stopColor: "#FF45C0"
  }))));
};
/* harmony default export */ var GlobalSvgDefs_AiTranslateIcon = (AiTranslateIcon_AiTranslateIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/GlobalSvgDefs/index.tsx




// Add here all svg defs with id's
var GlobalSvgDefs = function GlobalSvgDefs() {
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(GlobalSvgDefs_SparkleAiIcon, null), /*#__PURE__*/react.createElement(GlobalSvgDefs_AiTranslateIcon, null));
};
/* harmony default export */ var src_GlobalSvgDefs = (GlobalSvgDefs);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/index.tsx






















































































// This is important for global app svg defs with id's


/***/ }),

/***/ 8404:
/***/ (function() {



/***/ }),

/***/ 7592:
/***/ (function() {



/***/ }),

/***/ 8184:
/***/ (function() {



/***/ }),

/***/ 7526:
/***/ (function(__unused_webpack_module, exports) {

"use strict";


exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray

var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array

var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
  lookup[i] = code[i]
  revLookup[code.charCodeAt(i)] = i
}

// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63

function getLens (b64) {
  var len = b64.length

  if (len % 4 > 0) {
    throw new Error('Invalid string. Length must be a multiple of 4')
  }

  // Trim off extra bytes after placeholder bytes are found
  // See: https://github.com/beatgammit/base64-js/issues/42
  var validLen = b64.indexOf('=')
  if (validLen === -1) validLen = len

  var placeHoldersLen = validLen === len
    ? 0
    : 4 - (validLen % 4)

  return [validLen, placeHoldersLen]
}

// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
  var lens = getLens(b64)
  var validLen = lens[0]
  var placeHoldersLen = lens[1]
  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}

function _byteLength (b64, validLen, placeHoldersLen) {
  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}

function toByteArray (b64) {
  var tmp
  var lens = getLens(b64)
  var validLen = lens[0]
  var placeHoldersLen = lens[1]

  var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))

  var curByte = 0

  // if there are placeholders, only get up to the last complete 4 chars
  var len = placeHoldersLen > 0
    ? validLen - 4
    : validLen

  var i
  for (i = 0; i < len; i += 4) {
    tmp =
      (revLookup[b64.charCodeAt(i)] << 18) |
      (revLookup[b64.charCodeAt(i + 1)] << 12) |
      (revLookup[b64.charCodeAt(i + 2)] << 6) |
      revLookup[b64.charCodeAt(i + 3)]
    arr[curByte++] = (tmp >> 16) & 0xFF
    arr[curByte++] = (tmp >> 8) & 0xFF
    arr[curByte++] = tmp & 0xFF
  }

  if (placeHoldersLen === 2) {
    tmp =
      (revLookup[b64.charCodeAt(i)] << 2) |
      (revLookup[b64.charCodeAt(i + 1)] >> 4)
    arr[curByte++] = tmp & 0xFF
  }

  if (placeHoldersLen === 1) {
    tmp =
      (revLookup[b64.charCodeAt(i)] << 10) |
      (revLookup[b64.charCodeAt(i + 1)] << 4) |
      (revLookup[b64.charCodeAt(i + 2)] >> 2)
    arr[curByte++] = (tmp >> 8) & 0xFF
    arr[curByte++] = tmp & 0xFF
  }

  return arr
}

function tripletToBase64 (num) {
  return lookup[num >> 18 & 0x3F] +
    lookup[num >> 12 & 0x3F] +
    lookup[num >> 6 & 0x3F] +
    lookup[num & 0x3F]
}

function encodeChunk (uint8, start, end) {
  var tmp
  var output = []
  for (var i = start; i < end; i += 3) {
    tmp =
      ((uint8[i] << 16) & 0xFF0000) +
      ((uint8[i + 1] << 8) & 0xFF00) +
      (uint8[i + 2] & 0xFF)
    output.push(tripletToBase64(tmp))
  }
  return output.join('')
}

function fromByteArray (uint8) {
  var tmp
  var len = uint8.length
  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  var parts = []
  var maxChunkLength = 16383 // must be multiple of 3

  // go through the array every three bytes, we'll deal with trailing stuff later
  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
    parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  }

  // pad the end with zeros, but make sure to not forget the extra bytes
  if (extraBytes === 1) {
    tmp = uint8[len - 1]
    parts.push(
      lookup[tmp >> 2] +
      lookup[(tmp << 4) & 0x3F] +
      '=='
    )
  } else if (extraBytes === 2) {
    tmp = (uint8[len - 2] << 8) + uint8[len - 1]
    parts.push(
      lookup[tmp >> 10] +
      lookup[(tmp >> 4) & 0x3F] +
      lookup[(tmp << 2) & 0x3F] +
      '='
    )
  }

  return parts.join('')
}


/***/ }),

/***/ 5974:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
/* provided dependency */ var Buffer = __webpack_require__(8287)["Buffer"];
/* provided dependency */ var process = __webpack_require__(5606);

/* eslint camelcase: "off" */

var assert = __webpack_require__(2630);

var Zstream = __webpack_require__(4442);
var zlib_deflate = __webpack_require__(8411);
var zlib_inflate = __webpack_require__(1447);
var constants = __webpack_require__(9681);

for (var key in constants) {
  exports[key] = constants[key];
}

// zlib modes
exports.NONE = 0;
exports.DEFLATE = 1;
exports.INFLATE = 2;
exports.GZIP = 3;
exports.GUNZIP = 4;
exports.DEFLATERAW = 5;
exports.INFLATERAW = 6;
exports.UNZIP = 7;

var GZIP_HEADER_ID1 = 0x1f;
var GZIP_HEADER_ID2 = 0x8b;

/**
 * Emulate Node's zlib C++ layer for use by the JS layer in index.js
 */
function Zlib(mode) {
  if (typeof mode !== 'number' || mode < exports.DEFLATE || mode > exports.UNZIP) {
    throw new TypeError('Bad argument');
  }

  this.dictionary = null;
  this.err = 0;
  this.flush = 0;
  this.init_done = false;
  this.level = 0;
  this.memLevel = 0;
  this.mode = mode;
  this.strategy = 0;
  this.windowBits = 0;
  this.write_in_progress = false;
  this.pending_close = false;
  this.gzip_id_bytes_read = 0;
}

Zlib.prototype.close = function () {
  if (this.write_in_progress) {
    this.pending_close = true;
    return;
  }

  this.pending_close = false;

  assert(this.init_done, 'close before init');
  assert(this.mode <= exports.UNZIP);

  if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) {
    zlib_deflate.deflateEnd(this.strm);
  } else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP) {
    zlib_inflate.inflateEnd(this.strm);
  }

  this.mode = exports.NONE;

  this.dictionary = null;
};

Zlib.prototype.write = function (flush, input, in_off, in_len, out, out_off, out_len) {
  return this._write(true, flush, input, in_off, in_len, out, out_off, out_len);
};

Zlib.prototype.writeSync = function (flush, input, in_off, in_len, out, out_off, out_len) {
  return this._write(false, flush, input, in_off, in_len, out, out_off, out_len);
};

Zlib.prototype._write = function (async, flush, input, in_off, in_len, out, out_off, out_len) {
  assert.equal(arguments.length, 8);

  assert(this.init_done, 'write before init');
  assert(this.mode !== exports.NONE, 'already finalized');
  assert.equal(false, this.write_in_progress, 'write already in progress');
  assert.equal(false, this.pending_close, 'close is pending');

  this.write_in_progress = true;

  assert.equal(false, flush === undefined, 'must provide flush value');

  this.write_in_progress = true;

  if (flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK) {
    throw new Error('Invalid flush value');
  }

  if (input == null) {
    input = Buffer.alloc(0);
    in_len = 0;
    in_off = 0;
  }

  this.strm.avail_in = in_len;
  this.strm.input = input;
  this.strm.next_in = in_off;
  this.strm.avail_out = out_len;
  this.strm.output = out;
  this.strm.next_out = out_off;
  this.flush = flush;

  if (!async) {
    // sync version
    this._process();

    if (this._checkError()) {
      return this._afterSync();
    }
    return;
  }

  // async version
  var self = this;
  process.nextTick(function () {
    self._process();
    self._after();
  });

  return this;
};

Zlib.prototype._afterSync = function () {
  var avail_out = this.strm.avail_out;
  var avail_in = this.strm.avail_in;

  this.write_in_progress = false;

  return [avail_in, avail_out];
};

Zlib.prototype._process = function () {
  var next_expected_header_byte = null;

  // If the avail_out is left at 0, then it means that it ran out
  // of room.  If there was avail_out left over, then it means
  // that all of the input was consumed.
  switch (this.mode) {
    case exports.DEFLATE:
    case exports.GZIP:
    case exports.DEFLATERAW:
      this.err = zlib_deflate.deflate(this.strm, this.flush);
      break;
    case exports.UNZIP:
      if (this.strm.avail_in > 0) {
        next_expected_header_byte = this.strm.next_in;
      }

      switch (this.gzip_id_bytes_read) {
        case 0:
          if (next_expected_header_byte === null) {
            break;
          }

          if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {
            this.gzip_id_bytes_read = 1;
            next_expected_header_byte++;

            if (this.strm.avail_in === 1) {
              // The only available byte was already read.
              break;
            }
          } else {
            this.mode = exports.INFLATE;
            break;
          }

        // fallthrough
        case 1:
          if (next_expected_header_byte === null) {
            break;
          }

          if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2) {
            this.gzip_id_bytes_read = 2;
            this.mode = exports.GUNZIP;
          } else {
            // There is no actual difference between INFLATE and INFLATERAW
            // (after initialization).
            this.mode = exports.INFLATE;
          }

          break;
        default:
          throw new Error('invalid number of gzip magic number bytes read');
      }

    // fallthrough
    case exports.INFLATE:
    case exports.GUNZIP:
    case exports.INFLATERAW:
      this.err = zlib_inflate.inflate(this.strm, this.flush

      // If data was encoded with dictionary
      );if (this.err === exports.Z_NEED_DICT && this.dictionary) {
        // Load it
        this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary);
        if (this.err === exports.Z_OK) {
          // And try to decode again
          this.err = zlib_inflate.inflate(this.strm, this.flush);
        } else if (this.err === exports.Z_DATA_ERROR) {
          // Both inflateSetDictionary() and inflate() return Z_DATA_ERROR.
          // Make it possible for After() to tell a bad dictionary from bad
          // input.
          this.err = exports.Z_NEED_DICT;
        }
      }
      while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0x00) {
        // Bytes remain in input buffer. Perhaps this is another compressed
        // member in the same archive, or just trailing garbage.
        // Trailing zero bytes are okay, though, since they are frequently
        // used for padding.

        this.reset();
        this.err = zlib_inflate.inflate(this.strm, this.flush);
      }
      break;
    default:
      throw new Error('Unknown mode ' + this.mode);
  }
};

Zlib.prototype._checkError = function () {
  // Acceptable error states depend on the type of zlib stream.
  switch (this.err) {
    case exports.Z_OK:
    case exports.Z_BUF_ERROR:
      if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH) {
        this._error('unexpected end of file');
        return false;
      }
      break;
    case exports.Z_STREAM_END:
      // normal statuses, not fatal
      break;
    case exports.Z_NEED_DICT:
      if (this.dictionary == null) {
        this._error('Missing dictionary');
      } else {
        this._error('Bad dictionary');
      }
      return false;
    default:
      // something else.
      this._error('Zlib error');
      return false;
  }

  return true;
};

Zlib.prototype._after = function () {
  if (!this._checkError()) {
    return;
  }

  var avail_out = this.strm.avail_out;
  var avail_in = this.strm.avail_in;

  this.write_in_progress = false;

  // call the write() cb
  this.callback(avail_in, avail_out);

  if (this.pending_close) {
    this.close();
  }
};

Zlib.prototype._error = function (message) {
  if (this.strm.msg) {
    message = this.strm.msg;
  }
  this.onerror(message, this.err

  // no hope of rescue.
  );this.write_in_progress = false;
  if (this.pending_close) {
    this.close();
  }
};

Zlib.prototype.init = function (windowBits, level, memLevel, strategy, dictionary) {
  assert(arguments.length === 4 || arguments.length === 5, 'init(windowBits, level, memLevel, strategy, [dictionary])');

  assert(windowBits >= 8 && windowBits <= 15, 'invalid windowBits');
  assert(level >= -1 && level <= 9, 'invalid compression level');

  assert(memLevel >= 1 && memLevel <= 9, 'invalid memlevel');

  assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, 'invalid strategy');

  this._init(level, windowBits, memLevel, strategy, dictionary);
  this._setDictionary();
};

Zlib.prototype.params = function () {
  throw new Error('deflateParams Not supported');
};

Zlib.prototype.reset = function () {
  this._reset();
  this._setDictionary();
};

Zlib.prototype._init = function (level, windowBits, memLevel, strategy, dictionary) {
  this.level = level;
  this.windowBits = windowBits;
  this.memLevel = memLevel;
  this.strategy = strategy;

  this.flush = exports.Z_NO_FLUSH;

  this.err = exports.Z_OK;

  if (this.mode === exports.GZIP || this.mode === exports.GUNZIP) {
    this.windowBits += 16;
  }

  if (this.mode === exports.UNZIP) {
    this.windowBits += 32;
  }

  if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW) {
    this.windowBits = -1 * this.windowBits;
  }

  this.strm = new Zstream();

  switch (this.mode) {
    case exports.DEFLATE:
    case exports.GZIP:
    case exports.DEFLATERAW:
      this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);
      break;
    case exports.INFLATE:
    case exports.GUNZIP:
    case exports.INFLATERAW:
    case exports.UNZIP:
      this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);
      break;
    default:
      throw new Error('Unknown mode ' + this.mode);
  }

  if (this.err !== exports.Z_OK) {
    this._error('Init error');
  }

  this.dictionary = dictionary;

  this.write_in_progress = false;
  this.init_done = true;
};

Zlib.prototype._setDictionary = function () {
  if (this.dictionary == null) {
    return;
  }

  this.err = exports.Z_OK;

  switch (this.mode) {
    case exports.DEFLATE:
    case exports.DEFLATERAW:
      this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);
      break;
    default:
      break;
  }

  if (this.err !== exports.Z_OK) {
    this._error('Failed to set dictionary');
  }
};

Zlib.prototype._reset = function () {
  this.err = exports.Z_OK;

  switch (this.mode) {
    case exports.DEFLATE:
    case exports.DEFLATERAW:
    case exports.GZIP:
      this.err = zlib_deflate.deflateReset(this.strm);
      break;
    case exports.INFLATE:
    case exports.INFLATERAW:
    case exports.GUNZIP:
      this.err = zlib_inflate.inflateReset(this.strm);
      break;
    default:
      break;
  }

  if (this.err !== exports.Z_OK) {
    this._error('Failed to reset stream');
  }
};

exports.Zlib = Zlib;

/***/ }),

/***/ 8559:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
/* provided dependency */ var process = __webpack_require__(5606);


var Buffer = (__webpack_require__(8287).Buffer);
var Transform = (__webpack_require__(8310).Transform);
var binding = __webpack_require__(5974);
var util = __webpack_require__(166);
var assert = (__webpack_require__(2630).ok);
var kMaxLength = (__webpack_require__(8287).kMaxLength);
var kRangeErrorMessage = 'Cannot create final Buffer. It would be larger ' + 'than 0x' + kMaxLength.toString(16) + ' bytes';

// zlib doesn't provide these, so kludge them in following the same
// const naming scheme zlib uses.
binding.Z_MIN_WINDOWBITS = 8;
binding.Z_MAX_WINDOWBITS = 15;
binding.Z_DEFAULT_WINDOWBITS = 15;

// fewer than 64 bytes per chunk is stupid.
// technically it could work with as few as 8, but even 64 bytes
// is absurdly low.  Usually a MB or more is best.
binding.Z_MIN_CHUNK = 64;
binding.Z_MAX_CHUNK = Infinity;
binding.Z_DEFAULT_CHUNK = 16 * 1024;

binding.Z_MIN_MEMLEVEL = 1;
binding.Z_MAX_MEMLEVEL = 9;
binding.Z_DEFAULT_MEMLEVEL = 8;

binding.Z_MIN_LEVEL = -1;
binding.Z_MAX_LEVEL = 9;
binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;

// expose all the zlib constants
var bkeys = Object.keys(binding);
for (var bk = 0; bk < bkeys.length; bk++) {
  var bkey = bkeys[bk];
  if (bkey.match(/^Z/)) {
    Object.defineProperty(exports, bkey, {
      enumerable: true, value: binding[bkey], writable: false
    });
  }
}

// translation table for return codes.
var codes = {
  Z_OK: binding.Z_OK,
  Z_STREAM_END: binding.Z_STREAM_END,
  Z_NEED_DICT: binding.Z_NEED_DICT,
  Z_ERRNO: binding.Z_ERRNO,
  Z_STREAM_ERROR: binding.Z_STREAM_ERROR,
  Z_DATA_ERROR: binding.Z_DATA_ERROR,
  Z_MEM_ERROR: binding.Z_MEM_ERROR,
  Z_BUF_ERROR: binding.Z_BUF_ERROR,
  Z_VERSION_ERROR: binding.Z_VERSION_ERROR
};

var ckeys = Object.keys(codes);
for (var ck = 0; ck < ckeys.length; ck++) {
  var ckey = ckeys[ck];
  codes[codes[ckey]] = ckey;
}

Object.defineProperty(exports, "codes", ({
  enumerable: true, value: Object.freeze(codes), writable: false
}));

exports.Deflate = Deflate;
exports.Inflate = Inflate;
exports.Gzip = Gzip;
exports.Gunzip = Gunzip;
exports.DeflateRaw = DeflateRaw;
exports.InflateRaw = InflateRaw;
exports.Unzip = Unzip;

exports.createDeflate = function (o) {
  return new Deflate(o);
};

exports.createInflate = function (o) {
  return new Inflate(o);
};

exports.createDeflateRaw = function (o) {
  return new DeflateRaw(o);
};

exports.createInflateRaw = function (o) {
  return new InflateRaw(o);
};

exports.createGzip = function (o) {
  return new Gzip(o);
};

exports.createGunzip = function (o) {
  return new Gunzip(o);
};

exports.createUnzip = function (o) {
  return new Unzip(o);
};

// Convenience methods.
// compress/decompress a string or buffer in one step.
exports.deflate = function (buffer, opts, callback) {
  if (typeof opts === 'function') {
    callback = opts;
    opts = {};
  }
  return zlibBuffer(new Deflate(opts), buffer, callback);
};

exports.deflateSync = function (buffer, opts) {
  return zlibBufferSync(new Deflate(opts), buffer);
};

exports.gzip = function (buffer, opts, callback) {
  if (typeof opts === 'function') {
    callback = opts;
    opts = {};
  }
  return zlibBuffer(new Gzip(opts), buffer, callback);
};

exports.gzipSync = function (buffer, opts) {
  return zlibBufferSync(new Gzip(opts), buffer);
};

exports.deflateRaw = function (buffer, opts, callback) {
  if (typeof opts === 'function') {
    callback = opts;
    opts = {};
  }
  return zlibBuffer(new DeflateRaw(opts), buffer, callback);
};

exports.deflateRawSync = function (buffer, opts) {
  return zlibBufferSync(new DeflateRaw(opts), buffer);
};

exports.unzip = function (buffer, opts, callback) {
  if (typeof opts === 'function') {
    callback = opts;
    opts = {};
  }
  return zlibBuffer(new Unzip(opts), buffer, callback);
};

exports.unzipSync = function (buffer, opts) {
  return zlibBufferSync(new Unzip(opts), buffer);
};

exports.inflate = function (buffer, opts, callback) {
  if (typeof opts === 'function') {
    callback = opts;
    opts = {};
  }
  return zlibBuffer(new Inflate(opts), buffer, callback);
};

exports.inflateSync = function (buffer, opts) {
  return zlibBufferSync(new Inflate(opts), buffer);
};

exports.gunzip = function (buffer, opts, callback) {
  if (typeof opts === 'function') {
    callback = opts;
    opts = {};
  }
  return zlibBuffer(new Gunzip(opts), buffer, callback);
};

exports.gunzipSync = function (buffer, opts) {
  return zlibBufferSync(new Gunzip(opts), buffer);
};

exports.inflateRaw = function (buffer, opts, callback) {
  if (typeof opts === 'function') {
    callback = opts;
    opts = {};
  }
  return zlibBuffer(new InflateRaw(opts), buffer, callback);
};

exports.inflateRawSync = function (buffer, opts) {
  return zlibBufferSync(new InflateRaw(opts), buffer);
};

function zlibBuffer(engine, buffer, callback) {
  var buffers = [];
  var nread = 0;

  engine.on('error', onError);
  engine.on('end', onEnd);

  engine.end(buffer);
  flow();

  function flow() {
    var chunk;
    while (null !== (chunk = engine.read())) {
      buffers.push(chunk);
      nread += chunk.length;
    }
    engine.once('readable', flow);
  }

  function onError(err) {
    engine.removeListener('end', onEnd);
    engine.removeListener('readable', flow);
    callback(err);
  }

  function onEnd() {
    var buf;
    var err = null;

    if (nread >= kMaxLength) {
      err = new RangeError(kRangeErrorMessage);
    } else {
      buf = Buffer.concat(buffers, nread);
    }

    buffers = [];
    engine.close();
    callback(err, buf);
  }
}

function zlibBufferSync(engine, buffer) {
  if (typeof buffer === 'string') buffer = Buffer.from(buffer);

  if (!Buffer.isBuffer(buffer)) throw new TypeError('Not a string or buffer');

  var flushFlag = engine._finishFlushFlag;

  return engine._processChunk(buffer, flushFlag);
}

// generic zlib
// minimal 2-byte header
function Deflate(opts) {
  if (!(this instanceof Deflate)) return new Deflate(opts);
  Zlib.call(this, opts, binding.DEFLATE);
}

function Inflate(opts) {
  if (!(this instanceof Inflate)) return new Inflate(opts);
  Zlib.call(this, opts, binding.INFLATE);
}

// gzip - bigger header, same deflate compression
function Gzip(opts) {
  if (!(this instanceof Gzip)) return new Gzip(opts);
  Zlib.call(this, opts, binding.GZIP);
}

function Gunzip(opts) {
  if (!(this instanceof Gunzip)) return new Gunzip(opts);
  Zlib.call(this, opts, binding.GUNZIP);
}

// raw - no header
function DeflateRaw(opts) {
  if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts);
  Zlib.call(this, opts, binding.DEFLATERAW);
}

function InflateRaw(opts) {
  if (!(this instanceof InflateRaw)) return new InflateRaw(opts);
  Zlib.call(this, opts, binding.INFLATERAW);
}

// auto-detect header.
function Unzip(opts) {
  if (!(this instanceof Unzip)) return new Unzip(opts);
  Zlib.call(this, opts, binding.UNZIP);
}

function isValidFlushFlag(flag) {
  return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;
}

// the Zlib class they all inherit from
// This thing manages the queue of requests, and returns
// true or false if there is anything in the queue when
// you call the .write() method.

function Zlib(opts, mode) {
  var _this = this;

  this._opts = opts = opts || {};
  this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK;

  Transform.call(this, opts);

  if (opts.flush && !isValidFlushFlag(opts.flush)) {
    throw new Error('Invalid flush flag: ' + opts.flush);
  }
  if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush)) {
    throw new Error('Invalid flush flag: ' + opts.finishFlush);
  }

  this._flushFlag = opts.flush || binding.Z_NO_FLUSH;
  this._finishFlushFlag = typeof opts.finishFlush !== 'undefined' ? opts.finishFlush : binding.Z_FINISH;

  if (opts.chunkSize) {
    if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK) {
      throw new Error('Invalid chunk size: ' + opts.chunkSize);
    }
  }

  if (opts.windowBits) {
    if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS) {
      throw new Error('Invalid windowBits: ' + opts.windowBits);
    }
  }

  if (opts.level) {
    if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL) {
      throw new Error('Invalid compression level: ' + opts.level);
    }
  }

  if (opts.memLevel) {
    if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL) {
      throw new Error('Invalid memLevel: ' + opts.memLevel);
    }
  }

  if (opts.strategy) {
    if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY) {
      throw new Error('Invalid strategy: ' + opts.strategy);
    }
  }

  if (opts.dictionary) {
    if (!Buffer.isBuffer(opts.dictionary)) {
      throw new Error('Invalid dictionary: it should be a Buffer instance');
    }
  }

  this._handle = new binding.Zlib(mode);

  var self = this;
  this._hadError = false;
  this._handle.onerror = function (message, errno) {
    // there is no way to cleanly recover.
    // continuing only obscures problems.
    _close(self);
    self._hadError = true;

    var error = new Error(message);
    error.errno = errno;
    error.code = exports.codes[errno];
    self.emit('error', error);
  };

  var level = exports.Z_DEFAULT_COMPRESSION;
  if (typeof opts.level === 'number') level = opts.level;

  var strategy = exports.Z_DEFAULT_STRATEGY;
  if (typeof opts.strategy === 'number') strategy = opts.strategy;

  this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary);

  this._buffer = Buffer.allocUnsafe(this._chunkSize);
  this._offset = 0;
  this._level = level;
  this._strategy = strategy;

  this.once('end', this.close);

  Object.defineProperty(this, '_closed', {
    get: function () {
      return !_this._handle;
    },
    configurable: true,
    enumerable: true
  });
}

util.inherits(Zlib, Transform);

Zlib.prototype.params = function (level, strategy, callback) {
  if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL) {
    throw new RangeError('Invalid compression level: ' + level);
  }
  if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY) {
    throw new TypeError('Invalid strategy: ' + strategy);
  }

  if (this._level !== level || this._strategy !== strategy) {
    var self = this;
    this.flush(binding.Z_SYNC_FLUSH, function () {
      assert(self._handle, 'zlib binding closed');
      self._handle.params(level, strategy);
      if (!self._hadError) {
        self._level = level;
        self._strategy = strategy;
        if (callback) callback();
      }
    });
  } else {
    process.nextTick(callback);
  }
};

Zlib.prototype.reset = function () {
  assert(this._handle, 'zlib binding closed');
  return this._handle.reset();
};

// This is the _flush function called by the transform class,
// internally, when the last chunk has been written.
Zlib.prototype._flush = function (callback) {
  this._transform(Buffer.alloc(0), '', callback);
};

Zlib.prototype.flush = function (kind, callback) {
  var _this2 = this;

  var ws = this._writableState;

  if (typeof kind === 'function' || kind === undefined && !callback) {
    callback = kind;
    kind = binding.Z_FULL_FLUSH;
  }

  if (ws.ended) {
    if (callback) process.nextTick(callback);
  } else if (ws.ending) {
    if (callback) this.once('end', callback);
  } else if (ws.needDrain) {
    if (callback) {
      this.once('drain', function () {
        return _this2.flush(kind, callback);
      });
    }
  } else {
    this._flushFlag = kind;
    this.write(Buffer.alloc(0), '', callback);
  }
};

Zlib.prototype.close = function (callback) {
  _close(this, callback);
  process.nextTick(emitCloseNT, this);
};

function _close(engine, callback) {
  if (callback) process.nextTick(callback);

  // Caller may invoke .close after a zlib error (which will null _handle).
  if (!engine._handle) return;

  engine._handle.close();
  engine._handle = null;
}

function emitCloseNT(self) {
  self.emit('close');
}

Zlib.prototype._transform = function (chunk, encoding, cb) {
  var flushFlag;
  var ws = this._writableState;
  var ending = ws.ending || ws.ended;
  var last = ending && (!chunk || ws.length === chunk.length);

  if (chunk !== null && !Buffer.isBuffer(chunk)) return cb(new Error('invalid input'));

  if (!this._handle) return cb(new Error('zlib binding closed'));

  // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag
  // (or whatever flag was provided using opts.finishFlush).
  // If it's explicitly flushing at some other time, then we use
  // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression
  // goodness.
  if (last) flushFlag = this._finishFlushFlag;else {
    flushFlag = this._flushFlag;
    // once we've flushed the last of the queue, stop flushing and
    // go back to the normal behavior.
    if (chunk.length >= ws.length) {
      this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;
    }
  }

  this._processChunk(chunk, flushFlag, cb);
};

Zlib.prototype._processChunk = function (chunk, flushFlag, cb) {
  var availInBefore = chunk && chunk.length;
  var availOutBefore = this._chunkSize - this._offset;
  var inOff = 0;

  var self = this;

  var async = typeof cb === 'function';

  if (!async) {
    var buffers = [];
    var nread = 0;

    var error;
    this.on('error', function (er) {
      error = er;
    });

    assert(this._handle, 'zlib binding closed');
    do {
      var res = this._handle.writeSync(flushFlag, chunk, // in
      inOff, // in_off
      availInBefore, // in_len
      this._buffer, // out
      this._offset, //out_off
      availOutBefore); // out_len
    } while (!this._hadError && callback(res[0], res[1]));

    if (this._hadError) {
      throw error;
    }

    if (nread >= kMaxLength) {
      _close(this);
      throw new RangeError(kRangeErrorMessage);
    }

    var buf = Buffer.concat(buffers, nread);
    _close(this);

    return buf;
  }

  assert(this._handle, 'zlib binding closed');
  var req = this._handle.write(flushFlag, chunk, // in
  inOff, // in_off
  availInBefore, // in_len
  this._buffer, // out
  this._offset, //out_off
  availOutBefore); // out_len

  req.buffer = chunk;
  req.callback = callback;

  function callback(availInAfter, availOutAfter) {
    // When the callback is used in an async write, the callback's
    // context is the `req` object that was created. The req object
    // is === this._handle, and that's why it's important to null
    // out the values after they are done being used. `this._handle`
    // can stay in memory longer than the callback and buffer are needed.
    if (this) {
      this.buffer = null;
      this.callback = null;
    }

    if (self._hadError) return;

    var have = availOutBefore - availOutAfter;
    assert(have >= 0, 'have should not go down');

    if (have > 0) {
      var out = self._buffer.slice(self._offset, self._offset + have);
      self._offset += have;
      // serve some output to the consumer.
      if (async) {
        self.push(out);
      } else {
        buffers.push(out);
        nread += out.length;
      }
    }

    // exhausted the output buffer, or used all the input create a new one.
    if (availOutAfter === 0 || self._offset >= self._chunkSize) {
      availOutBefore = self._chunkSize;
      self._offset = 0;
      self._buffer = Buffer.allocUnsafe(self._chunkSize);
    }

    if (availOutAfter === 0) {
      // Not actually done.  Need to reprocess.
      // Also, update the availInBefore to the availInAfter value,
      // so that if we have to hit it a third (fourth, etc.) time,
      // it'll have the correct byte counts.
      inOff += availInBefore - availInAfter;
      availInBefore = availInAfter;

      if (!async) return true;

      var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);
      newReq.callback = callback; // this same function
      newReq.buffer = chunk;
      return;
    }

    if (!async) return false;

    // finished with the chunk.
    cb();
  }
};

util.inherits(Deflate, Zlib);
util.inherits(Inflate, Zlib);
util.inherits(Gzip, Zlib);
util.inherits(Gunzip, Zlib);
util.inherits(DeflateRaw, Zlib);
util.inherits(InflateRaw, Zlib);
util.inherits(Unzip, Zlib);

/***/ }),

/***/ 8287:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
/* eslint-disable no-proto */



const base64 = __webpack_require__(7526)
const ieee754 = __webpack_require__(251)
const customInspectSymbol =
  (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation
    ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
    : null

exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50

const K_MAX_LENGTH = 0x7fffffff
exports.kMaxLength = K_MAX_LENGTH

/**
 * If `Buffer.TYPED_ARRAY_SUPPORT`:
 *   === true    Use Uint8Array implementation (fastest)
 *   === false   Print warning and recommend using `buffer` v4.x which has an Object
 *               implementation (most compatible, even IE6)
 *
 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
 * Opera 11.6+, iOS 4.2+.
 *
 * We report that the browser does not support typed arrays if the are not subclassable
 * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
 * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
 * for __proto__ and has a buggy typed array implementation.
 */
Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport()

if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&
    typeof console.error === 'function') {
  console.error(
    'This browser lacks typed array (Uint8Array) support which is required by ' +
    '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'
  )
}

function typedArraySupport () {
  // Can typed array instances can be augmented?
  try {
    const arr = new Uint8Array(1)
    const proto = { foo: function () { return 42 } }
    Object.setPrototypeOf(proto, Uint8Array.prototype)
    Object.setPrototypeOf(arr, proto)
    return arr.foo() === 42
  } catch (e) {
    return false
  }
}

Object.defineProperty(Buffer.prototype, 'parent', {
  enumerable: true,
  get: function () {
    if (!Buffer.isBuffer(this)) return undefined
    return this.buffer
  }
})

Object.defineProperty(Buffer.prototype, 'offset', {
  enumerable: true,
  get: function () {
    if (!Buffer.isBuffer(this)) return undefined
    return this.byteOffset
  }
})

function createBuffer (length) {
  if (length > K_MAX_LENGTH) {
    throw new RangeError('The value "' + length + '" is invalid for option "size"')
  }
  // Return an augmented `Uint8Array` instance
  const buf = new Uint8Array(length)
  Object.setPrototypeOf(buf, Buffer.prototype)
  return buf
}

/**
 * The Buffer constructor returns instances of `Uint8Array` that have their
 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
 * returns a single octet.
 *
 * The `Uint8Array` prototype remains unmodified.
 */

function Buffer (arg, encodingOrOffset, length) {
  // Common case.
  if (typeof arg === 'number') {
    if (typeof encodingOrOffset === 'string') {
      throw new TypeError(
        'The "string" argument must be of type string. Received type number'
      )
    }
    return allocUnsafe(arg)
  }
  return from(arg, encodingOrOffset, length)
}

Buffer.poolSize = 8192 // not used by this implementation

function from (value, encodingOrOffset, length) {
  if (typeof value === 'string') {
    return fromString(value, encodingOrOffset)
  }

  if (ArrayBuffer.isView(value)) {
    return fromArrayView(value)
  }

  if (value == null) {
    throw new TypeError(
      'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
      'or Array-like Object. Received type ' + (typeof value)
    )
  }

  if (isInstance(value, ArrayBuffer) ||
      (value && isInstance(value.buffer, ArrayBuffer))) {
    return fromArrayBuffer(value, encodingOrOffset, length)
  }

  if (typeof SharedArrayBuffer !== 'undefined' &&
      (isInstance(value, SharedArrayBuffer) ||
      (value && isInstance(value.buffer, SharedArrayBuffer)))) {
    return fromArrayBuffer(value, encodingOrOffset, length)
  }

  if (typeof value === 'number') {
    throw new TypeError(
      'The "value" argument must not be of type number. Received type number'
    )
  }

  const valueOf = value.valueOf && value.valueOf()
  if (valueOf != null && valueOf !== value) {
    return Buffer.from(valueOf, encodingOrOffset, length)
  }

  const b = fromObject(value)
  if (b) return b

  if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&
      typeof value[Symbol.toPrimitive] === 'function') {
    return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)
  }

  throw new TypeError(
    'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +
    'or Array-like Object. Received type ' + (typeof value)
  )
}

/**
 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
 * if value is a number.
 * Buffer.from(str[, encoding])
 * Buffer.from(array)
 * Buffer.from(buffer)
 * Buffer.from(arrayBuffer[, byteOffset[, length]])
 **/
Buffer.from = function (value, encodingOrOffset, length) {
  return from(value, encodingOrOffset, length)
}

// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:
// https://github.com/feross/buffer/pull/148
Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)
Object.setPrototypeOf(Buffer, Uint8Array)

function assertSize (size) {
  if (typeof size !== 'number') {
    throw new TypeError('"size" argument must be of type number')
  } else if (size < 0) {
    throw new RangeError('The value "' + size + '" is invalid for option "size"')
  }
}

function alloc (size, fill, encoding) {
  assertSize(size)
  if (size <= 0) {
    return createBuffer(size)
  }
  if (fill !== undefined) {
    // Only pay attention to encoding if it's a string. This
    // prevents accidentally sending in a number that would
    // be interpreted as a start offset.
    return typeof encoding === 'string'
      ? createBuffer(size).fill(fill, encoding)
      : createBuffer(size).fill(fill)
  }
  return createBuffer(size)
}

/**
 * Creates a new filled Buffer instance.
 * alloc(size[, fill[, encoding]])
 **/
Buffer.alloc = function (size, fill, encoding) {
  return alloc(size, fill, encoding)
}

function allocUnsafe (size) {
  assertSize(size)
  return createBuffer(size < 0 ? 0 : checked(size) | 0)
}

/**
 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
 * */
Buffer.allocUnsafe = function (size) {
  return allocUnsafe(size)
}
/**
 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
 */
Buffer.allocUnsafeSlow = function (size) {
  return allocUnsafe(size)
}

function fromString (string, encoding) {
  if (typeof encoding !== 'string' || encoding === '') {
    encoding = 'utf8'
  }

  if (!Buffer.isEncoding(encoding)) {
    throw new TypeError('Unknown encoding: ' + encoding)
  }

  const length = byteLength(string, encoding) | 0
  let buf = createBuffer(length)

  const actual = buf.write(string, encoding)

  if (actual !== length) {
    // Writing a hex string, for example, that contains invalid characters will
    // cause everything after the first invalid character to be ignored. (e.g.
    // 'abxxcd' will be treated as 'ab')
    buf = buf.slice(0, actual)
  }

  return buf
}

function fromArrayLike (array) {
  const length = array.length < 0 ? 0 : checked(array.length) | 0
  const buf = createBuffer(length)
  for (let i = 0; i < length; i += 1) {
    buf[i] = array[i] & 255
  }
  return buf
}

function fromArrayView (arrayView) {
  if (isInstance(arrayView, Uint8Array)) {
    const copy = new Uint8Array(arrayView)
    return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
  }
  return fromArrayLike(arrayView)
}

function fromArrayBuffer (array, byteOffset, length) {
  if (byteOffset < 0 || array.byteLength < byteOffset) {
    throw new RangeError('"offset" is outside of buffer bounds')
  }

  if (array.byteLength < byteOffset + (length || 0)) {
    throw new RangeError('"length" is outside of buffer bounds')
  }

  let buf
  if (byteOffset === undefined && length === undefined) {
    buf = new Uint8Array(array)
  } else if (length === undefined) {
    buf = new Uint8Array(array, byteOffset)
  } else {
    buf = new Uint8Array(array, byteOffset, length)
  }

  // Return an augmented `Uint8Array` instance
  Object.setPrototypeOf(buf, Buffer.prototype)

  return buf
}

function fromObject (obj) {
  if (Buffer.isBuffer(obj)) {
    const len = checked(obj.length) | 0
    const buf = createBuffer(len)

    if (buf.length === 0) {
      return buf
    }

    obj.copy(buf, 0, 0, len)
    return buf
  }

  if (obj.length !== undefined) {
    if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {
      return createBuffer(0)
    }
    return fromArrayLike(obj)
  }

  if (obj.type === 'Buffer' && Array.isArray(obj.data)) {
    return fromArrayLike(obj.data)
  }
}

function checked (length) {
  // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
  // length is NaN (which is otherwise coerced to zero.)
  if (length >= K_MAX_LENGTH) {
    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
                         'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')
  }
  return length | 0
}

function SlowBuffer (length) {
  if (+length != length) { // eslint-disable-line eqeqeq
    length = 0
  }
  return Buffer.alloc(+length)
}

Buffer.isBuffer = function isBuffer (b) {
  return b != null && b._isBuffer === true &&
    b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false
}

Buffer.compare = function compare (a, b) {
  if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)
  if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)
  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
    throw new TypeError(
      'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
    )
  }

  if (a === b) return 0

  let x = a.length
  let y = b.length

  for (let i = 0, len = Math.min(x, y); i < len; ++i) {
    if (a[i] !== b[i]) {
      x = a[i]
      y = b[i]
      break
    }
  }

  if (x < y) return -1
  if (y < x) return 1
  return 0
}

Buffer.isEncoding = function isEncoding (encoding) {
  switch (String(encoding).toLowerCase()) {
    case 'hex':
    case 'utf8':
    case 'utf-8':
    case 'ascii':
    case 'latin1':
    case 'binary':
    case 'base64':
    case 'ucs2':
    case 'ucs-2':
    case 'utf16le':
    case 'utf-16le':
      return true
    default:
      return false
  }
}

Buffer.concat = function concat (list, length) {
  if (!Array.isArray(list)) {
    throw new TypeError('"list" argument must be an Array of Buffers')
  }

  if (list.length === 0) {
    return Buffer.alloc(0)
  }

  let i
  if (length === undefined) {
    length = 0
    for (i = 0; i < list.length; ++i) {
      length += list[i].length
    }
  }

  const buffer = Buffer.allocUnsafe(length)
  let pos = 0
  for (i = 0; i < list.length; ++i) {
    let buf = list[i]
    if (isInstance(buf, Uint8Array)) {
      if (pos + buf.length > buffer.length) {
        if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
        buf.copy(buffer, pos)
      } else {
        Uint8Array.prototype.set.call(
          buffer,
          buf,
          pos
        )
      }
    } else if (!Buffer.isBuffer(buf)) {
      throw new TypeError('"list" argument must be an Array of Buffers')
    } else {
      buf.copy(buffer, pos)
    }
    pos += buf.length
  }
  return buffer
}

function byteLength (string, encoding) {
  if (Buffer.isBuffer(string)) {
    return string.length
  }
  if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {
    return string.byteLength
  }
  if (typeof string !== 'string') {
    throw new TypeError(
      'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' +
      'Received type ' + typeof string
    )
  }

  const len = string.length
  const mustMatch = (arguments.length > 2 && arguments[2] === true)
  if (!mustMatch && len === 0) return 0

  // Use a for loop to avoid recursion
  let loweredCase = false
  for (;;) {
    switch (encoding) {
      case 'ascii':
      case 'latin1':
      case 'binary':
        return len
      case 'utf8':
      case 'utf-8':
        return utf8ToBytes(string).length
      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return len * 2
      case 'hex':
        return len >>> 1
      case 'base64':
        return base64ToBytes(string).length
      default:
        if (loweredCase) {
          return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8
        }
        encoding = ('' + encoding).toLowerCase()
        loweredCase = true
    }
  }
}
Buffer.byteLength = byteLength

function slowToString (encoding, start, end) {
  let loweredCase = false

  // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  // property of a typed array.

  // This behaves neither like String nor Uint8Array in that we set start/end
  // to their upper/lower bounds if the value passed is out of range.
  // undefined is handled specially as per ECMA-262 6th Edition,
  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  if (start === undefined || start < 0) {
    start = 0
  }
  // Return early if start > this.length. Done here to prevent potential uint32
  // coercion fail below.
  if (start > this.length) {
    return ''
  }

  if (end === undefined || end > this.length) {
    end = this.length
  }

  if (end <= 0) {
    return ''
  }

  // Force coercion to uint32. This will also coerce falsey/NaN values to 0.
  end >>>= 0
  start >>>= 0

  if (end <= start) {
    return ''
  }

  if (!encoding) encoding = 'utf8'

  while (true) {
    switch (encoding) {
      case 'hex':
        return hexSlice(this, start, end)

      case 'utf8':
      case 'utf-8':
        return utf8Slice(this, start, end)

      case 'ascii':
        return asciiSlice(this, start, end)

      case 'latin1':
      case 'binary':
        return latin1Slice(this, start, end)

      case 'base64':
        return base64Slice(this, start, end)

      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return utf16leSlice(this, start, end)

      default:
        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
        encoding = (encoding + '').toLowerCase()
        loweredCase = true
    }
  }
}

// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)
// to detect a Buffer instance. It's not possible to use `instanceof Buffer`
// reliably in a browserify context because there could be multiple different
// copies of the 'buffer' package in use. This method works even for Buffer
// instances that were created from another copy of the `buffer` package.
// See: https://github.com/feross/buffer/issues/154
Buffer.prototype._isBuffer = true

function swap (b, n, m) {
  const i = b[n]
  b[n] = b[m]
  b[m] = i
}

Buffer.prototype.swap16 = function swap16 () {
  const len = this.length
  if (len % 2 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 16-bits')
  }
  for (let i = 0; i < len; i += 2) {
    swap(this, i, i + 1)
  }
  return this
}

Buffer.prototype.swap32 = function swap32 () {
  const len = this.length
  if (len % 4 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 32-bits')
  }
  for (let i = 0; i < len; i += 4) {
    swap(this, i, i + 3)
    swap(this, i + 1, i + 2)
  }
  return this
}

Buffer.prototype.swap64 = function swap64 () {
  const len = this.length
  if (len % 8 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 64-bits')
  }
  for (let i = 0; i < len; i += 8) {
    swap(this, i, i + 7)
    swap(this, i + 1, i + 6)
    swap(this, i + 2, i + 5)
    swap(this, i + 3, i + 4)
  }
  return this
}

Buffer.prototype.toString = function toString () {
  const length = this.length
  if (length === 0) return ''
  if (arguments.length === 0) return utf8Slice(this, 0, length)
  return slowToString.apply(this, arguments)
}

Buffer.prototype.toLocaleString = Buffer.prototype.toString

Buffer.prototype.equals = function equals (b) {
  if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  if (this === b) return true
  return Buffer.compare(this, b) === 0
}

Buffer.prototype.inspect = function inspect () {
  let str = ''
  const max = exports.INSPECT_MAX_BYTES
  str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()
  if (this.length > max) str += ' ... '
  return '<Buffer ' + str + '>'
}
if (customInspectSymbol) {
  Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect
}

Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  if (isInstance(target, Uint8Array)) {
    target = Buffer.from(target, target.offset, target.byteLength)
  }
  if (!Buffer.isBuffer(target)) {
    throw new TypeError(
      'The "target" argument must be one of type Buffer or Uint8Array. ' +
      'Received type ' + (typeof target)
    )
  }

  if (start === undefined) {
    start = 0
  }
  if (end === undefined) {
    end = target ? target.length : 0
  }
  if (thisStart === undefined) {
    thisStart = 0
  }
  if (thisEnd === undefined) {
    thisEnd = this.length
  }

  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
    throw new RangeError('out of range index')
  }

  if (thisStart >= thisEnd && start >= end) {
    return 0
  }
  if (thisStart >= thisEnd) {
    return -1
  }
  if (start >= end) {
    return 1
  }

  start >>>= 0
  end >>>= 0
  thisStart >>>= 0
  thisEnd >>>= 0

  if (this === target) return 0

  let x = thisEnd - thisStart
  let y = end - start
  const len = Math.min(x, y)

  const thisCopy = this.slice(thisStart, thisEnd)
  const targetCopy = target.slice(start, end)

  for (let i = 0; i < len; ++i) {
    if (thisCopy[i] !== targetCopy[i]) {
      x = thisCopy[i]
      y = targetCopy[i]
      break
    }
  }

  if (x < y) return -1
  if (y < x) return 1
  return 0
}

// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  // Empty buffer means no match
  if (buffer.length === 0) return -1

  // Normalize byteOffset
  if (typeof byteOffset === 'string') {
    encoding = byteOffset
    byteOffset = 0
  } else if (byteOffset > 0x7fffffff) {
    byteOffset = 0x7fffffff
  } else if (byteOffset < -0x80000000) {
    byteOffset = -0x80000000
  }
  byteOffset = +byteOffset // Coerce to Number.
  if (numberIsNaN(byteOffset)) {
    // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
    byteOffset = dir ? 0 : (buffer.length - 1)
  }

  // Normalize byteOffset: negative offsets start from the end of the buffer
  if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  if (byteOffset >= buffer.length) {
    if (dir) return -1
    else byteOffset = buffer.length - 1
  } else if (byteOffset < 0) {
    if (dir) byteOffset = 0
    else return -1
  }

  // Normalize val
  if (typeof val === 'string') {
    val = Buffer.from(val, encoding)
  }

  // Finally, search either indexOf (if dir is true) or lastIndexOf
  if (Buffer.isBuffer(val)) {
    // Special case: looking for empty string/buffer always fails
    if (val.length === 0) {
      return -1
    }
    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  } else if (typeof val === 'number') {
    val = val & 0xFF // Search for a byte value [0-255]
    if (typeof Uint8Array.prototype.indexOf === 'function') {
      if (dir) {
        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
      } else {
        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
      }
    }
    return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
  }

  throw new TypeError('val must be string, number or Buffer')
}

function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  let indexSize = 1
  let arrLength = arr.length
  let valLength = val.length

  if (encoding !== undefined) {
    encoding = String(encoding).toLowerCase()
    if (encoding === 'ucs2' || encoding === 'ucs-2' ||
        encoding === 'utf16le' || encoding === 'utf-16le') {
      if (arr.length < 2 || val.length < 2) {
        return -1
      }
      indexSize = 2
      arrLength /= 2
      valLength /= 2
      byteOffset /= 2
    }
  }

  function read (buf, i) {
    if (indexSize === 1) {
      return buf[i]
    } else {
      return buf.readUInt16BE(i * indexSize)
    }
  }

  let i
  if (dir) {
    let foundIndex = -1
    for (i = byteOffset; i < arrLength; i++) {
      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
        if (foundIndex === -1) foundIndex = i
        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
      } else {
        if (foundIndex !== -1) i -= i - foundIndex
        foundIndex = -1
      }
    }
  } else {
    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
    for (i = byteOffset; i >= 0; i--) {
      let found = true
      for (let j = 0; j < valLength; j++) {
        if (read(arr, i + j) !== read(val, j)) {
          found = false
          break
        }
      }
      if (found) return i
    }
  }

  return -1
}

Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  return this.indexOf(val, byteOffset, encoding) !== -1
}

Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}

Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}

function hexWrite (buf, string, offset, length) {
  offset = Number(offset) || 0
  const remaining = buf.length - offset
  if (!length) {
    length = remaining
  } else {
    length = Number(length)
    if (length > remaining) {
      length = remaining
    }
  }

  const strLen = string.length

  if (length > strLen / 2) {
    length = strLen / 2
  }
  let i
  for (i = 0; i < length; ++i) {
    const parsed = parseInt(string.substr(i * 2, 2), 16)
    if (numberIsNaN(parsed)) return i
    buf[offset + i] = parsed
  }
  return i
}

function utf8Write (buf, string, offset, length) {
  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}

function asciiWrite (buf, string, offset, length) {
  return blitBuffer(asciiToBytes(string), buf, offset, length)
}

function base64Write (buf, string, offset, length) {
  return blitBuffer(base64ToBytes(string), buf, offset, length)
}

function ucs2Write (buf, string, offset, length) {
  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}

Buffer.prototype.write = function write (string, offset, length, encoding) {
  // Buffer#write(string)
  if (offset === undefined) {
    encoding = 'utf8'
    length = this.length
    offset = 0
  // Buffer#write(string, encoding)
  } else if (length === undefined && typeof offset === 'string') {
    encoding = offset
    length = this.length
    offset = 0
  // Buffer#write(string, offset[, length][, encoding])
  } else if (isFinite(offset)) {
    offset = offset >>> 0
    if (isFinite(length)) {
      length = length >>> 0
      if (encoding === undefined) encoding = 'utf8'
    } else {
      encoding = length
      length = undefined
    }
  } else {
    throw new Error(
      'Buffer.write(string, encoding, offset[, length]) is no longer supported'
    )
  }

  const remaining = this.length - offset
  if (length === undefined || length > remaining) length = remaining

  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
    throw new RangeError('Attempt to write outside buffer bounds')
  }

  if (!encoding) encoding = 'utf8'

  let loweredCase = false
  for (;;) {
    switch (encoding) {
      case 'hex':
        return hexWrite(this, string, offset, length)

      case 'utf8':
      case 'utf-8':
        return utf8Write(this, string, offset, length)

      case 'ascii':
      case 'latin1':
      case 'binary':
        return asciiWrite(this, string, offset, length)

      case 'base64':
        // Warning: maxLength not taken into account in base64Write
        return base64Write(this, string, offset, length)

      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return ucs2Write(this, string, offset, length)

      default:
        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
        encoding = ('' + encoding).toLowerCase()
        loweredCase = true
    }
  }
}

Buffer.prototype.toJSON = function toJSON () {
  return {
    type: 'Buffer',
    data: Array.prototype.slice.call(this._arr || this, 0)
  }
}

function base64Slice (buf, start, end) {
  if (start === 0 && end === buf.length) {
    return base64.fromByteArray(buf)
  } else {
    return base64.fromByteArray(buf.slice(start, end))
  }
}

function utf8Slice (buf, start, end) {
  end = Math.min(buf.length, end)
  const res = []

  let i = start
  while (i < end) {
    const firstByte = buf[i]
    let codePoint = null
    let bytesPerSequence = (firstByte > 0xEF)
      ? 4
      : (firstByte > 0xDF)
          ? 3
          : (firstByte > 0xBF)
              ? 2
              : 1

    if (i + bytesPerSequence <= end) {
      let secondByte, thirdByte, fourthByte, tempCodePoint

      switch (bytesPerSequence) {
        case 1:
          if (firstByte < 0x80) {
            codePoint = firstByte
          }
          break
        case 2:
          secondByte = buf[i + 1]
          if ((secondByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
            if (tempCodePoint > 0x7F) {
              codePoint = tempCodePoint
            }
          }
          break
        case 3:
          secondByte = buf[i + 1]
          thirdByte = buf[i + 2]
          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
              codePoint = tempCodePoint
            }
          }
          break
        case 4:
          secondByte = buf[i + 1]
          thirdByte = buf[i + 2]
          fourthByte = buf[i + 3]
          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
              codePoint = tempCodePoint
            }
          }
      }
    }

    if (codePoint === null) {
      // we did not generate a valid codePoint so insert a
      // replacement char (U+FFFD) and advance only 1 byte
      codePoint = 0xFFFD
      bytesPerSequence = 1
    } else if (codePoint > 0xFFFF) {
      // encode to utf16 (surrogate pair dance)
      codePoint -= 0x10000
      res.push(codePoint >>> 10 & 0x3FF | 0xD800)
      codePoint = 0xDC00 | codePoint & 0x3FF
    }

    res.push(codePoint)
    i += bytesPerSequence
  }

  return decodeCodePointsArray(res)
}

// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
const MAX_ARGUMENTS_LENGTH = 0x1000

function decodeCodePointsArray (codePoints) {
  const len = codePoints.length
  if (len <= MAX_ARGUMENTS_LENGTH) {
    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  }

  // Decode in chunks to avoid "call stack size exceeded".
  let res = ''
  let i = 0
  while (i < len) {
    res += String.fromCharCode.apply(
      String,
      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
    )
  }
  return res
}

function asciiSlice (buf, start, end) {
  let ret = ''
  end = Math.min(buf.length, end)

  for (let i = start; i < end; ++i) {
    ret += String.fromCharCode(buf[i] & 0x7F)
  }
  return ret
}

function latin1Slice (buf, start, end) {
  let ret = ''
  end = Math.min(buf.length, end)

  for (let i = start; i < end; ++i) {
    ret += String.fromCharCode(buf[i])
  }
  return ret
}

function hexSlice (buf, start, end) {
  const len = buf.length

  if (!start || start < 0) start = 0
  if (!end || end < 0 || end > len) end = len

  let out = ''
  for (let i = start; i < end; ++i) {
    out += hexSliceLookupTable[buf[i]]
  }
  return out
}

function utf16leSlice (buf, start, end) {
  const bytes = buf.slice(start, end)
  let res = ''
  // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)
  for (let i = 0; i < bytes.length - 1; i += 2) {
    res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))
  }
  return res
}

Buffer.prototype.slice = function slice (start, end) {
  const len = this.length
  start = ~~start
  end = end === undefined ? len : ~~end

  if (start < 0) {
    start += len
    if (start < 0) start = 0
  } else if (start > len) {
    start = len
  }

  if (end < 0) {
    end += len
    if (end < 0) end = 0
  } else if (end > len) {
    end = len
  }

  if (end < start) end = start

  const newBuf = this.subarray(start, end)
  // Return an augmented `Uint8Array` instance
  Object.setPrototypeOf(newBuf, Buffer.prototype)

  return newBuf
}

/*
 * Need to make sure that buffer isn't trying to write out of bounds.
 */
function checkOffset (offset, ext, length) {
  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}

Buffer.prototype.readUintLE =
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  let val = this[offset]
  let mul = 1
  let i = 0
  while (++i < byteLength && (mul *= 0x100)) {
    val += this[offset + i] * mul
  }

  return val
}

Buffer.prototype.readUintBE =
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) {
    checkOffset(offset, byteLength, this.length)
  }

  let val = this[offset + --byteLength]
  let mul = 1
  while (byteLength > 0 && (mul *= 0x100)) {
    val += this[offset + --byteLength] * mul
  }

  return val
}

Buffer.prototype.readUint8 =
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 1, this.length)
  return this[offset]
}

Buffer.prototype.readUint16LE =
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 2, this.length)
  return this[offset] | (this[offset + 1] << 8)
}

Buffer.prototype.readUint16BE =
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 2, this.length)
  return (this[offset] << 8) | this[offset + 1]
}

Buffer.prototype.readUint32LE =
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)

  return ((this[offset]) |
      (this[offset + 1] << 8) |
      (this[offset + 2] << 16)) +
      (this[offset + 3] * 0x1000000)
}

Buffer.prototype.readUint32BE =
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset] * 0x1000000) +
    ((this[offset + 1] << 16) |
    (this[offset + 2] << 8) |
    this[offset + 3])
}

Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {
  offset = offset >>> 0
  validateNumber(offset, 'offset')
  const first = this[offset]
  const last = this[offset + 7]
  if (first === undefined || last === undefined) {
    boundsError(offset, this.length - 8)
  }

  const lo = first +
    this[++offset] * 2 ** 8 +
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 24

  const hi = this[++offset] +
    this[++offset] * 2 ** 8 +
    this[++offset] * 2 ** 16 +
    last * 2 ** 24

  return BigInt(lo) + (BigInt(hi) << BigInt(32))
})

Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {
  offset = offset >>> 0
  validateNumber(offset, 'offset')
  const first = this[offset]
  const last = this[offset + 7]
  if (first === undefined || last === undefined) {
    boundsError(offset, this.length - 8)
  }

  const hi = first * 2 ** 24 +
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 8 +
    this[++offset]

  const lo = this[++offset] * 2 ** 24 +
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 8 +
    last

  return (BigInt(hi) << BigInt(32)) + BigInt(lo)
})

Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  let val = this[offset]
  let mul = 1
  let i = 0
  while (++i < byteLength && (mul *= 0x100)) {
    val += this[offset + i] * mul
  }
  mul *= 0x80

  if (val >= mul) val -= Math.pow(2, 8 * byteLength)

  return val
}

Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  let i = byteLength
  let mul = 1
  let val = this[offset + --i]
  while (i > 0 && (mul *= 0x100)) {
    val += this[offset + --i] * mul
  }
  mul *= 0x80

  if (val >= mul) val -= Math.pow(2, 8 * byteLength)

  return val
}

Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 1, this.length)
  if (!(this[offset] & 0x80)) return (this[offset])
  return ((0xff - this[offset] + 1) * -1)
}

Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 2, this.length)
  const val = this[offset] | (this[offset + 1] << 8)
  return (val & 0x8000) ? val | 0xFFFF0000 : val
}

Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 2, this.length)
  const val = this[offset + 1] | (this[offset] << 8)
  return (val & 0x8000) ? val | 0xFFFF0000 : val
}

Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset]) |
    (this[offset + 1] << 8) |
    (this[offset + 2] << 16) |
    (this[offset + 3] << 24)
}

Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset] << 24) |
    (this[offset + 1] << 16) |
    (this[offset + 2] << 8) |
    (this[offset + 3])
}

Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {
  offset = offset >>> 0
  validateNumber(offset, 'offset')
  const first = this[offset]
  const last = this[offset + 7]
  if (first === undefined || last === undefined) {
    boundsError(offset, this.length - 8)
  }

  const val = this[offset + 4] +
    this[offset + 5] * 2 ** 8 +
    this[offset + 6] * 2 ** 16 +
    (last << 24) // Overflow

  return (BigInt(val) << BigInt(32)) +
    BigInt(first +
    this[++offset] * 2 ** 8 +
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 24)
})

Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {
  offset = offset >>> 0
  validateNumber(offset, 'offset')
  const first = this[offset]
  const last = this[offset + 7]
  if (first === undefined || last === undefined) {
    boundsError(offset, this.length - 8)
  }

  const val = (first << 24) + // Overflow
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 8 +
    this[++offset]

  return (BigInt(val) << BigInt(32)) +
    BigInt(this[++offset] * 2 ** 24 +
    this[++offset] * 2 ** 16 +
    this[++offset] * 2 ** 8 +
    last)
})

Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)
  return ieee754.read(this, offset, true, 23, 4)
}

Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 4, this.length)
  return ieee754.read(this, offset, false, 23, 4)
}

Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 8, this.length)
  return ieee754.read(this, offset, true, 52, 8)
}

Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  offset = offset >>> 0
  if (!noAssert) checkOffset(offset, 8, this.length)
  return ieee754.read(this, offset, false, 52, 8)
}

function checkInt (buf, value, offset, ext, max, min) {
  if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
}

Buffer.prototype.writeUintLE =
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) {
    const maxBytes = Math.pow(2, 8 * byteLength) - 1
    checkInt(this, value, offset, byteLength, maxBytes, 0)
  }

  let mul = 1
  let i = 0
  this[offset] = value & 0xFF
  while (++i < byteLength && (mul *= 0x100)) {
    this[offset + i] = (value / mul) & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeUintBE =
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset >>> 0
  byteLength = byteLength >>> 0
  if (!noAssert) {
    const maxBytes = Math.pow(2, 8 * byteLength) - 1
    checkInt(this, value, offset, byteLength, maxBytes, 0)
  }

  let i = byteLength - 1
  let mul = 1
  this[offset + i] = value & 0xFF
  while (--i >= 0 && (mul *= 0x100)) {
    this[offset + i] = (value / mul) & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeUint8 =
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  this[offset] = (value & 0xff)
  return offset + 1
}

Buffer.prototype.writeUint16LE =
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  this[offset] = (value & 0xff)
  this[offset + 1] = (value >>> 8)
  return offset + 2
}

Buffer.prototype.writeUint16BE =
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  this[offset] = (value >>> 8)
  this[offset + 1] = (value & 0xff)
  return offset + 2
}

Buffer.prototype.writeUint32LE =
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  this[offset + 3] = (value >>> 24)
  this[offset + 2] = (value >>> 16)
  this[offset + 1] = (value >>> 8)
  this[offset] = (value & 0xff)
  return offset + 4
}

Buffer.prototype.writeUint32BE =
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  this[offset] = (value >>> 24)
  this[offset + 1] = (value >>> 16)
  this[offset + 2] = (value >>> 8)
  this[offset + 3] = (value & 0xff)
  return offset + 4
}

function wrtBigUInt64LE (buf, value, offset, min, max) {
  checkIntBI(value, min, max, buf, offset, 7)

  let lo = Number(value & BigInt(0xffffffff))
  buf[offset++] = lo
  lo = lo >> 8
  buf[offset++] = lo
  lo = lo >> 8
  buf[offset++] = lo
  lo = lo >> 8
  buf[offset++] = lo
  let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))
  buf[offset++] = hi
  hi = hi >> 8
  buf[offset++] = hi
  hi = hi >> 8
  buf[offset++] = hi
  hi = hi >> 8
  buf[offset++] = hi
  return offset
}

function wrtBigUInt64BE (buf, value, offset, min, max) {
  checkIntBI(value, min, max, buf, offset, 7)

  let lo = Number(value & BigInt(0xffffffff))
  buf[offset + 7] = lo
  lo = lo >> 8
  buf[offset + 6] = lo
  lo = lo >> 8
  buf[offset + 5] = lo
  lo = lo >> 8
  buf[offset + 4] = lo
  let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))
  buf[offset + 3] = hi
  hi = hi >> 8
  buf[offset + 2] = hi
  hi = hi >> 8
  buf[offset + 1] = hi
  hi = hi >> 8
  buf[offset] = hi
  return offset + 8
}

Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {
  return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))
})

Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {
  return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))
})

Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) {
    const limit = Math.pow(2, (8 * byteLength) - 1)

    checkInt(this, value, offset, byteLength, limit - 1, -limit)
  }

  let i = 0
  let mul = 1
  let sub = 0
  this[offset] = value & 0xFF
  while (++i < byteLength && (mul *= 0x100)) {
    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
      sub = 1
    }
    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) {
    const limit = Math.pow(2, (8 * byteLength) - 1)

    checkInt(this, value, offset, byteLength, limit - 1, -limit)
  }

  let i = byteLength - 1
  let mul = 1
  let sub = 0
  this[offset + i] = value & 0xFF
  while (--i >= 0 && (mul *= 0x100)) {
    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
      sub = 1
    }
    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  if (value < 0) value = 0xff + value + 1
  this[offset] = (value & 0xff)
  return offset + 1
}

Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  this[offset] = (value & 0xff)
  this[offset + 1] = (value >>> 8)
  return offset + 2
}

Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  this[offset] = (value >>> 8)
  this[offset + 1] = (value & 0xff)
  return offset + 2
}

Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  this[offset] = (value & 0xff)
  this[offset + 1] = (value >>> 8)
  this[offset + 2] = (value >>> 16)
  this[offset + 3] = (value >>> 24)
  return offset + 4
}

Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  if (value < 0) value = 0xffffffff + value + 1
  this[offset] = (value >>> 24)
  this[offset + 1] = (value >>> 16)
  this[offset + 2] = (value >>> 8)
  this[offset + 3] = (value & 0xff)
  return offset + 4
}

Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {
  return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))
})

Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {
  return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))
})

function checkIEEE754 (buf, value, offset, ext, max, min) {
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
  if (offset < 0) throw new RangeError('Index out of range')
}

function writeFloat (buf, value, offset, littleEndian, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) {
    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  }
  ieee754.write(buf, value, offset, littleEndian, 23, 4)
  return offset + 4
}

Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  return writeFloat(this, value, offset, true, noAssert)
}

Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  return writeFloat(this, value, offset, false, noAssert)
}

function writeDouble (buf, value, offset, littleEndian, noAssert) {
  value = +value
  offset = offset >>> 0
  if (!noAssert) {
    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  }
  ieee754.write(buf, value, offset, littleEndian, 52, 8)
  return offset + 8
}

Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  return writeDouble(this, value, offset, true, noAssert)
}

Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  return writeDouble(this, value, offset, false, noAssert)
}

// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
  if (!start) start = 0
  if (!end && end !== 0) end = this.length
  if (targetStart >= target.length) targetStart = target.length
  if (!targetStart) targetStart = 0
  if (end > 0 && end < start) end = start

  // Copy 0 bytes; we're done
  if (end === start) return 0
  if (target.length === 0 || this.length === 0) return 0

  // Fatal error conditions
  if (targetStart < 0) {
    throw new RangeError('targetStart out of bounds')
  }
  if (start < 0 || start >= this.length) throw new RangeError('Index out of range')
  if (end < 0) throw new RangeError('sourceEnd out of bounds')

  // Are we oob?
  if (end > this.length) end = this.length
  if (target.length - targetStart < end - start) {
    end = target.length - targetStart + start
  }

  const len = end - start

  if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {
    // Use built-in when available, missing from IE11
    this.copyWithin(targetStart, start, end)
  } else {
    Uint8Array.prototype.set.call(
      target,
      this.subarray(start, end),
      targetStart
    )
  }

  return len
}

// Usage:
//    buffer.fill(number[, offset[, end]])
//    buffer.fill(buffer[, offset[, end]])
//    buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
  // Handle string cases:
  if (typeof val === 'string') {
    if (typeof start === 'string') {
      encoding = start
      start = 0
      end = this.length
    } else if (typeof end === 'string') {
      encoding = end
      end = this.length
    }
    if (encoding !== undefined && typeof encoding !== 'string') {
      throw new TypeError('encoding must be a string')
    }
    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
      throw new TypeError('Unknown encoding: ' + encoding)
    }
    if (val.length === 1) {
      const code = val.charCodeAt(0)
      if ((encoding === 'utf8' && code < 128) ||
          encoding === 'latin1') {
        // Fast path: If `val` fits into a single byte, use that numeric value.
        val = code
      }
    }
  } else if (typeof val === 'number') {
    val = val & 255
  } else if (typeof val === 'boolean') {
    val = Number(val)
  }

  // Invalid ranges are not set to a default, so can range check early.
  if (start < 0 || this.length < start || this.length < end) {
    throw new RangeError('Out of range index')
  }

  if (end <= start) {
    return this
  }

  start = start >>> 0
  end = end === undefined ? this.length : end >>> 0

  if (!val) val = 0

  let i
  if (typeof val === 'number') {
    for (i = start; i < end; ++i) {
      this[i] = val
    }
  } else {
    const bytes = Buffer.isBuffer(val)
      ? val
      : Buffer.from(val, encoding)
    const len = bytes.length
    if (len === 0) {
      throw new TypeError('The value "' + val +
        '" is invalid for argument "value"')
    }
    for (i = 0; i < end - start; ++i) {
      this[i + start] = bytes[i % len]
    }
  }

  return this
}

// CUSTOM ERRORS
// =============

// Simplified versions from Node, changed for Buffer-only usage
const errors = {}
function E (sym, getMessage, Base) {
  errors[sym] = class NodeError extends Base {
    constructor () {
      super()

      Object.defineProperty(this, 'message', {
        value: getMessage.apply(this, arguments),
        writable: true,
        configurable: true
      })

      // Add the error code to the name to include it in the stack trace.
      this.name = `${this.name} [${sym}]`
      // Access the stack to generate the error message including the error code
      // from the name.
      this.stack // eslint-disable-line no-unused-expressions
      // Reset the name to the actual name.
      delete this.name
    }

    get code () {
      return sym
    }

    set code (value) {
      Object.defineProperty(this, 'code', {
        configurable: true,
        enumerable: true,
        value,
        writable: true
      })
    }

    toString () {
      return `${this.name} [${sym}]: ${this.message}`
    }
  }
}

E('ERR_BUFFER_OUT_OF_BOUNDS',
  function (name) {
    if (name) {
      return `${name} is outside of buffer bounds`
    }

    return 'Attempt to access memory outside buffer bounds'
  }, RangeError)
E('ERR_INVALID_ARG_TYPE',
  function (name, actual) {
    return `The "${name}" argument must be of type number. Received type ${typeof actual}`
  }, TypeError)
E('ERR_OUT_OF_RANGE',
  function (str, range, input) {
    let msg = `The value of "${str}" is out of range.`
    let received = input
    if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {
      received = addNumericalSeparator(String(input))
    } else if (typeof input === 'bigint') {
      received = String(input)
      if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {
        received = addNumericalSeparator(received)
      }
      received += 'n'
    }
    msg += ` It must be ${range}. Received ${received}`
    return msg
  }, RangeError)

function addNumericalSeparator (val) {
  let res = ''
  let i = val.length
  const start = val[0] === '-' ? 1 : 0
  for (; i >= start + 4; i -= 3) {
    res = `_${val.slice(i - 3, i)}${res}`
  }
  return `${val.slice(0, i)}${res}`
}

// CHECK FUNCTIONS
// ===============

function checkBounds (buf, offset, byteLength) {
  validateNumber(offset, 'offset')
  if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {
    boundsError(offset, buf.length - (byteLength + 1))
  }
}

function checkIntBI (value, min, max, buf, offset, byteLength) {
  if (value > max || value < min) {
    const n = typeof min === 'bigint' ? 'n' : ''
    let range
    if (byteLength > 3) {
      if (min === 0 || min === BigInt(0)) {
        range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`
      } else {
        range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +
                `${(byteLength + 1) * 8 - 1}${n}`
      }
    } else {
      range = `>= ${min}${n} and <= ${max}${n}`
    }
    throw new errors.ERR_OUT_OF_RANGE('value', range, value)
  }
  checkBounds(buf, offset, byteLength)
}

function validateNumber (value, name) {
  if (typeof value !== 'number') {
    throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)
  }
}

function boundsError (value, length, type) {
  if (Math.floor(value) !== value) {
    validateNumber(value, type)
    throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)
  }

  if (length < 0) {
    throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()
  }

  throw new errors.ERR_OUT_OF_RANGE(type || 'offset',
                                    `>= ${type ? 1 : 0} and <= ${length}`,
                                    value)
}

// HELPER FUNCTIONS
// ================

const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g

function base64clean (str) {
  // Node takes equal signs as end of the Base64 encoding
  str = str.split('=')[0]
  // Node strips out invalid characters like \n and \t from the string, base64-js does not
  str = str.trim().replace(INVALID_BASE64_RE, '')
  // Node converts strings with length < 2 to ''
  if (str.length < 2) return ''
  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  while (str.length % 4 !== 0) {
    str = str + '='
  }
  return str
}

function utf8ToBytes (string, units) {
  units = units || Infinity
  let codePoint
  const length = string.length
  let leadSurrogate = null
  const bytes = []

  for (let i = 0; i < length; ++i) {
    codePoint = string.charCodeAt(i)

    // is surrogate component
    if (codePoint > 0xD7FF && codePoint < 0xE000) {
      // last char was a lead
      if (!leadSurrogate) {
        // no lead yet
        if (codePoint > 0xDBFF) {
          // unexpected trail
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
          continue
        } else if (i + 1 === length) {
          // unpaired lead
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
          continue
        }

        // valid lead
        leadSurrogate = codePoint

        continue
      }

      // 2 leads in a row
      if (codePoint < 0xDC00) {
        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
        leadSurrogate = codePoint
        continue
      }

      // valid surrogate pair
      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
    } else if (leadSurrogate) {
      // valid bmp char, but last char was a lead
      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
    }

    leadSurrogate = null

    // encode utf8
    if (codePoint < 0x80) {
      if ((units -= 1) < 0) break
      bytes.push(codePoint)
    } else if (codePoint < 0x800) {
      if ((units -= 2) < 0) break
      bytes.push(
        codePoint >> 0x6 | 0xC0,
        codePoint & 0x3F | 0x80
      )
    } else if (codePoint < 0x10000) {
      if ((units -= 3) < 0) break
      bytes.push(
        codePoint >> 0xC | 0xE0,
        codePoint >> 0x6 & 0x3F | 0x80,
        codePoint & 0x3F | 0x80
      )
    } else if (codePoint < 0x110000) {
      if ((units -= 4) < 0) break
      bytes.push(
        codePoint >> 0x12 | 0xF0,
        codePoint >> 0xC & 0x3F | 0x80,
        codePoint >> 0x6 & 0x3F | 0x80,
        codePoint & 0x3F | 0x80
      )
    } else {
      throw new Error('Invalid code point')
    }
  }

  return bytes
}

function asciiToBytes (str) {
  const byteArray = []
  for (let i = 0; i < str.length; ++i) {
    // Node's code seems to be doing this and not & 0x7F..
    byteArray.push(str.charCodeAt(i) & 0xFF)
  }
  return byteArray
}

function utf16leToBytes (str, units) {
  let c, hi, lo
  const byteArray = []
  for (let i = 0; i < str.length; ++i) {
    if ((units -= 2) < 0) break

    c = str.charCodeAt(i)
    hi = c >> 8
    lo = c % 256
    byteArray.push(lo)
    byteArray.push(hi)
  }

  return byteArray
}

function base64ToBytes (str) {
  return base64.toByteArray(base64clean(str))
}

function blitBuffer (src, dst, offset, length) {
  let i
  for (i = 0; i < length; ++i) {
    if ((i + offset >= dst.length) || (i >= src.length)) break
    dst[i + offset] = src[i]
  }
  return i
}

// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass
// the `instanceof` check but they should be treated as of that type.
// See: https://github.com/feross/buffer/issues/166
function isInstance (obj, type) {
  return obj instanceof type ||
    (obj != null && obj.constructor != null && obj.constructor.name != null &&
      obj.constructor.name === type.name)
}
function numberIsNaN (obj) {
  // For IE11 support
  return obj !== obj // eslint-disable-line no-self-compare
}

// Create lookup table for `toString('hex')`
// See: https://github.com/feross/buffer/issues/219
const hexSliceLookupTable = (function () {
  const alphabet = '0123456789abcdef'
  const table = new Array(256)
  for (let i = 0; i < 16; ++i) {
    const i16 = i * 16
    for (let j = 0; j < 16; ++j) {
      table[i16 + j] = alphabet[i] + alphabet[j]
    }
  }
  return table
})()

// Return not function with Error if BigInt not supported
function defineBigIntMethod (fn) {
  return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn
}

function BufferBigIntNotDefined () {
  throw new Error('BigInt not supported')
}


/***/ }),

/***/ 8101:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _reader_code_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1601);
/* harmony import */ var _reader_code_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reader_code_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _reader_code_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6314);
/* harmony import */ var _reader_code_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_reader_code_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _reader_code_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_reader_code_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, ".image-gallery-icon{color:#fff;transition:all .3s ease-out;appearance:none;background-color:transparent;border:0;cursor:pointer;outline:none;position:absolute;z-index:4;filter:drop-shadow(0 2px 2px #1a1a1a)}@media(hover: hover)and (pointer: fine){.image-gallery-icon:hover{color:#337ab7}.image-gallery-icon:hover .image-gallery-svg{transform:scale(1.1)}}.image-gallery-icon:focus{outline:2px solid #337ab7}.image-gallery-using-mouse .image-gallery-icon:focus{outline:none}.image-gallery-fullscreen-button,.image-gallery-play-button{bottom:0;padding:20px}.image-gallery-fullscreen-button .image-gallery-svg,.image-gallery-play-button .image-gallery-svg{height:28px;width:28px}@media(max-width: 768px){.image-gallery-fullscreen-button,.image-gallery-play-button{padding:15px}.image-gallery-fullscreen-button .image-gallery-svg,.image-gallery-play-button .image-gallery-svg{height:24px;width:24px}}@media(max-width: 480px){.image-gallery-fullscreen-button,.image-gallery-play-button{padding:10px}.image-gallery-fullscreen-button .image-gallery-svg,.image-gallery-play-button .image-gallery-svg{height:16px;width:16px}}.image-gallery-fullscreen-button{right:0}.image-gallery-play-button{left:0}.image-gallery-left-nav,.image-gallery-right-nav{padding:50px 10px;top:50%;transform:translateY(-50%)}.image-gallery-left-nav .image-gallery-svg,.image-gallery-right-nav .image-gallery-svg{height:120px;width:60px}@media(max-width: 768px){.image-gallery-left-nav .image-gallery-svg,.image-gallery-right-nav .image-gallery-svg{height:72px;width:36px}}@media(max-width: 480px){.image-gallery-left-nav .image-gallery-svg,.image-gallery-right-nav .image-gallery-svg{height:48px;width:24px}}.image-gallery-left-nav[disabled],.image-gallery-right-nav[disabled]{cursor:disabled;opacity:.6;pointer-events:none}.image-gallery-left-nav{left:0}.image-gallery-right-nav{right:0}.image-gallery{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:relative}.image-gallery.fullscreen-modal{background:#000;bottom:0;height:100%;left:0;position:fixed;right:0;top:0;width:100%;z-index:5}.image-gallery.fullscreen-modal .image-gallery-content{top:50%;transform:translateY(-50%)}.image-gallery-content{position:relative;line-height:0;top:0}.image-gallery-content.fullscreen{background:#000}.image-gallery-content .image-gallery-slide .image-gallery-image{max-height:calc(100vh - 80px)}.image-gallery-content.image-gallery-thumbnails-left .image-gallery-slide .image-gallery-image,.image-gallery-content.image-gallery-thumbnails-right .image-gallery-slide .image-gallery-image{max-height:100vh}.image-gallery-slide-wrapper{position:relative}.image-gallery-slide-wrapper.image-gallery-thumbnails-left,.image-gallery-slide-wrapper.image-gallery-thumbnails-right{display:inline-block;width:calc(100% - 110px)}@media(max-width: 768px){.image-gallery-slide-wrapper.image-gallery-thumbnails-left,.image-gallery-slide-wrapper.image-gallery-thumbnails-right{width:calc(100% - 87px)}}.image-gallery-slide-wrapper.image-gallery-rtl{direction:rtl}.image-gallery-slides{line-height:0;overflow:hidden;position:relative;white-space:nowrap;text-align:center}.image-gallery-slide{left:0;position:absolute;top:0;width:100%}.image-gallery-slide.image-gallery-center{position:relative}.image-gallery-slide .image-gallery-image{width:100%;object-fit:contain}.image-gallery-slide .image-gallery-description{background:rgba(0,0,0,.4);bottom:70px;color:#fff;left:0;line-height:1;padding:10px 20px;position:absolute;white-space:normal}@media(max-width: 768px){.image-gallery-slide .image-gallery-description{bottom:45px;font-size:.8em;padding:8px 15px}}.image-gallery-bullets{bottom:20px;left:0;margin:0 auto;position:absolute;right:0;width:80%;z-index:4}.image-gallery-bullets .image-gallery-bullets-container{margin:0;padding:0;text-align:center}.image-gallery-bullets .image-gallery-bullet{appearance:none;background-color:transparent;border:1px solid #fff;border-radius:50%;box-shadow:0 2px 2px #1a1a1a;cursor:pointer;display:inline-block;margin:0 5px;outline:none;padding:5px;transition:all .2s ease-out}@media(max-width: 768px){.image-gallery-bullets .image-gallery-bullet{margin:0 3px;padding:3px}}@media(max-width: 480px){.image-gallery-bullets .image-gallery-bullet{padding:2.7px}}.image-gallery-bullets .image-gallery-bullet:focus{transform:scale(1.2);background:#337ab7;border:1px solid #337ab7}.image-gallery-bullets .image-gallery-bullet.active{transform:scale(1.2);border:1px solid #fff;background:#fff}@media(hover: hover)and (pointer: fine){.image-gallery-bullets .image-gallery-bullet:hover{background:#337ab7;border:1px solid #337ab7}.image-gallery-bullets .image-gallery-bullet.active:hover{background:#337ab7}}.image-gallery-thumbnails-wrapper{position:relative}.image-gallery-thumbnails-wrapper.thumbnails-swipe-horizontal{touch-action:pan-y}.image-gallery-thumbnails-wrapper.thumbnails-swipe-vertical{touch-action:pan-x}.image-gallery-thumbnails-wrapper.thumbnails-wrapper-rtl{direction:rtl}.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right{display:inline-block;vertical-align:top;width:100px}@media(max-width: 768px){.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right{width:81px}}.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left .image-gallery-thumbnails,.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right .image-gallery-thumbnails{height:100%;width:100%;left:0;padding:0;position:absolute;top:0}.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left .image-gallery-thumbnails .image-gallery-thumbnail,.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right .image-gallery-thumbnails .image-gallery-thumbnail{display:block;margin-right:0;padding:0}.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left .image-gallery-thumbnails .image-gallery-thumbnail+.image-gallery-thumbnail,.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right .image-gallery-thumbnails .image-gallery-thumbnail+.image-gallery-thumbnail{margin-left:0;margin-top:2px}.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right{margin:0 5px}@media(max-width: 768px){.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-left,.image-gallery-thumbnails-wrapper.image-gallery-thumbnails-right{margin:0 3px}}.image-gallery-thumbnails{overflow:hidden;padding:5px 0}@media(max-width: 768px){.image-gallery-thumbnails{padding:3px 0}}.image-gallery-thumbnails .image-gallery-thumbnails-container{cursor:pointer;text-align:center;white-space:nowrap}.image-gallery-thumbnail{display:inline-block;border:4px solid transparent;transition:border .3s ease-out;width:100px;background:transparent;padding:0}@media(max-width: 768px){.image-gallery-thumbnail{border:3px solid transparent;width:81px}}.image-gallery-thumbnail+.image-gallery-thumbnail{margin-left:2px}.image-gallery-thumbnail .image-gallery-thumbnail-inner{display:block;position:relative}.image-gallery-thumbnail .image-gallery-thumbnail-image{vertical-align:middle;width:100%;line-height:0}.image-gallery-thumbnail.active,.image-gallery-thumbnail:focus{outline:none;border:4px solid #337ab7}@media(max-width: 768px){.image-gallery-thumbnail.active,.image-gallery-thumbnail:focus{border:3px solid #337ab7}}@media(hover: hover)and (pointer: fine){.image-gallery-thumbnail:hover{outline:none;border:4px solid #337ab7}}@media(hover: hover)and (pointer: fine)and (max-width: 768px){.image-gallery-thumbnail:hover{border:3px solid #337ab7}}.image-gallery-thumbnail-label{box-sizing:border-box;color:#fff;font-size:1em;left:0;line-height:1em;padding:5%;position:absolute;top:50%;text-shadow:0 2px 2px #1a1a1a;transform:translateY(-50%);white-space:normal;width:100%}@media(max-width: 768px){.image-gallery-thumbnail-label{font-size:.8em;line-height:.8em}}.image-gallery-index{background:rgba(0,0,0,.4);color:#fff;line-height:1;padding:10px 20px;position:absolute;right:0;top:0;z-index:4}@media(max-width: 768px){.image-gallery-index{font-size:.8em;padding:5px 10px}}\n", ""]);
// Exports
/* harmony default export */ __webpack_exports__.A = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ 6314:
/***/ (function(module) {

"use strict";


/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
module.exports = function (cssWithMappingToString) {
  var list = [];

  // return the list of modules as css string
  list.toString = function toString() {
    return this.map(function (item) {
      var content = "";
      var needLayer = typeof item[5] !== "undefined";
      if (item[4]) {
        content += "@supports (".concat(item[4], ") {");
      }
      if (item[2]) {
        content += "@media ".concat(item[2], " {");
      }
      if (needLayer) {
        content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
      }
      content += cssWithMappingToString(item);
      if (needLayer) {
        content += "}";
      }
      if (item[2]) {
        content += "}";
      }
      if (item[4]) {
        content += "}";
      }
      return content;
    }).join("");
  };

  // import a list of modules into the list
  list.i = function i(modules, media, dedupe, supports, layer) {
    if (typeof modules === "string") {
      modules = [[null, modules, undefined]];
    }
    var alreadyImportedModules = {};
    if (dedupe) {
      for (var k = 0; k < this.length; k++) {
        var id = this[k][0];
        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }
    for (var _k = 0; _k < modules.length; _k++) {
      var item = [].concat(modules[_k]);
      if (dedupe && alreadyImportedModules[item[0]]) {
        continue;
      }
      if (typeof layer !== "undefined") {
        if (typeof item[5] === "undefined") {
          item[5] = layer;
        } else {
          item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
          item[5] = layer;
        }
      }
      if (media) {
        if (!item[2]) {
          item[2] = media;
        } else {
          item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
          item[2] = media;
        }
      }
      if (supports) {
        if (!item[4]) {
          item[4] = "".concat(supports);
        } else {
          item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
          item[4] = supports;
        }
      }
      list.push(item);
    }
  };
  return list;
};

/***/ }),

/***/ 1601:
/***/ (function(module) {

"use strict";


module.exports = function (i) {
  return i[1];
};

/***/ }),

/***/ 454:
/***/ (function(module) {

"use strict";

var token = '%[a-f0-9]{2}';
var singleMatcher = new RegExp('(' + token + ')|([^%]+?)', 'gi');
var multiMatcher = new RegExp('(' + token + ')+', 'gi');

function decodeComponents(components, split) {
	try {
		// Try to decode the entire string first
		return [decodeURIComponent(components.join(''))];
	} catch (err) {
		// Do nothing
	}

	if (components.length === 1) {
		return components;
	}

	split = split || 1;

	// Split the array in 2 parts
	var left = components.slice(0, split);
	var right = components.slice(split);

	return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
}

function decode(input) {
	try {
		return decodeURIComponent(input);
	} catch (err) {
		var tokens = input.match(singleMatcher) || [];

		for (var i = 1; i < tokens.length; i++) {
			input = decodeComponents(tokens, i).join('');

			tokens = input.match(singleMatcher) || [];
		}

		return input;
	}
}

function customDecodeURIComponent(input) {
	// Keep track of all the replacements and prefill the map with the `BOM`
	var replaceMap = {
		'%FE%FF': '\uFFFD\uFFFD',
		'%FF%FE': '\uFFFD\uFFFD'
	};

	var match = multiMatcher.exec(input);
	while (match) {
		try {
			// Decode as big chunks as possible
			replaceMap[match[0]] = decodeURIComponent(match[0]);
		} catch (err) {
			var result = decode(match[0]);

			if (result !== match[0]) {
				replaceMap[match[0]] = result;
			}
		}

		match = multiMatcher.exec(input);
	}

	// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
	replaceMap['%C2'] = '\uFFFD';

	var entries = Object.keys(replaceMap);

	for (var i = 0; i < entries.length; i++) {
		// Replace all decoded components
		var key = entries[i];
		input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
	}

	return input;
}

module.exports = function (encodedURI) {
	if (typeof encodedURI !== 'string') {
		throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
	}

	try {
		encodedURI = encodedURI.replace(/\+/g, ' ');

		// Try the built in decoder first
		return decodeURIComponent(encodedURI);
	} catch (err) {
		// Fallback to a more advanced decoder
		return customDecodeURIComponent(encodedURI);
	}
};


/***/ }),

/***/ 7007:
/***/ (function(module) {

"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.



var R = typeof Reflect === 'object' ? Reflect : null
var ReflectApply = R && typeof R.apply === 'function'
  ? R.apply
  : function ReflectApply(target, receiver, args) {
    return Function.prototype.apply.call(target, receiver, args);
  }

var ReflectOwnKeys
if (R && typeof R.ownKeys === 'function') {
  ReflectOwnKeys = R.ownKeys
} else if (Object.getOwnPropertySymbols) {
  ReflectOwnKeys = function ReflectOwnKeys(target) {
    return Object.getOwnPropertyNames(target)
      .concat(Object.getOwnPropertySymbols(target));
  };
} else {
  ReflectOwnKeys = function ReflectOwnKeys(target) {
    return Object.getOwnPropertyNames(target);
  };
}

function ProcessEmitWarning(warning) {
  if (console && console.warn) console.warn(warning);
}

var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
  return value !== value;
}

function EventEmitter() {
  EventEmitter.init.call(this);
}
module.exports = EventEmitter;
module.exports.once = once;

// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;

EventEmitter.prototype._events = undefined;
EventEmitter.prototype._eventsCount = 0;
EventEmitter.prototype._maxListeners = undefined;

// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
var defaultMaxListeners = 10;

function checkListener(listener) {
  if (typeof listener !== 'function') {
    throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  }
}

Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
  enumerable: true,
  get: function() {
    return defaultMaxListeners;
  },
  set: function(arg) {
    if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
      throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
    }
    defaultMaxListeners = arg;
  }
});

EventEmitter.init = function() {

  if (this._events === undefined ||
      this._events === Object.getPrototypeOf(this)._events) {
    this._events = Object.create(null);
    this._eventsCount = 0;
  }

  this._maxListeners = this._maxListeners || undefined;
};

// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
    throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
  }
  this._maxListeners = n;
  return this;
};

function _getMaxListeners(that) {
  if (that._maxListeners === undefined)
    return EventEmitter.defaultMaxListeners;
  return that._maxListeners;
}

EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  return _getMaxListeners(this);
};

EventEmitter.prototype.emit = function emit(type) {
  var args = [];
  for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
  var doError = (type === 'error');

  var events = this._events;
  if (events !== undefined)
    doError = (doError && events.error === undefined);
  else if (!doError)
    return false;

  // If there is no 'error' event listener then throw.
  if (doError) {
    var er;
    if (args.length > 0)
      er = args[0];
    if (er instanceof Error) {
      // Note: The comments on the `throw` lines are intentional, they show
      // up in Node's output if this results in an unhandled exception.
      throw er; // Unhandled 'error' event
    }
    // At least give some kind of context to the user
    var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
    err.context = er;
    throw err; // Unhandled 'error' event
  }

  var handler = events[type];

  if (handler === undefined)
    return false;

  if (typeof handler === 'function') {
    ReflectApply(handler, this, args);
  } else {
    var len = handler.length;
    var listeners = arrayClone(handler, len);
    for (var i = 0; i < len; ++i)
      ReflectApply(listeners[i], this, args);
  }

  return true;
};

function _addListener(target, type, listener, prepend) {
  var m;
  var events;
  var existing;

  checkListener(listener);

  events = target._events;
  if (events === undefined) {
    events = target._events = Object.create(null);
    target._eventsCount = 0;
  } else {
    // To avoid recursion in the case that type === "newListener"! Before
    // adding it to the listeners, first emit "newListener".
    if (events.newListener !== undefined) {
      target.emit('newListener', type,
                  listener.listener ? listener.listener : listener);

      // Re-assign `events` because a newListener handler could have caused the
      // this._events to be assigned to a new object
      events = target._events;
    }
    existing = events[type];
  }

  if (existing === undefined) {
    // Optimize the case of one listener. Don't need the extra array object.
    existing = events[type] = listener;
    ++target._eventsCount;
  } else {
    if (typeof existing === 'function') {
      // Adding the second element, need to change to array.
      existing = events[type] =
        prepend ? [listener, existing] : [existing, listener];
      // If we've already got an array, just append.
    } else if (prepend) {
      existing.unshift(listener);
    } else {
      existing.push(listener);
    }

    // Check for listener leak
    m = _getMaxListeners(target);
    if (m > 0 && existing.length > m && !existing.warned) {
      existing.warned = true;
      // No error code for this since it is a Warning
      // eslint-disable-next-line no-restricted-syntax
      var w = new Error('Possible EventEmitter memory leak detected. ' +
                          existing.length + ' ' + String(type) + ' listeners ' +
                          'added. Use emitter.setMaxListeners() to ' +
                          'increase limit');
      w.name = 'MaxListenersExceededWarning';
      w.emitter = target;
      w.type = type;
      w.count = existing.length;
      ProcessEmitWarning(w);
    }
  }

  return target;
}

EventEmitter.prototype.addListener = function addListener(type, listener) {
  return _addListener(this, type, listener, false);
};

EventEmitter.prototype.on = EventEmitter.prototype.addListener;

EventEmitter.prototype.prependListener =
    function prependListener(type, listener) {
      return _addListener(this, type, listener, true);
    };

function onceWrapper() {
  if (!this.fired) {
    this.target.removeListener(this.type, this.wrapFn);
    this.fired = true;
    if (arguments.length === 0)
      return this.listener.call(this.target);
    return this.listener.apply(this.target, arguments);
  }
}

function _onceWrap(target, type, listener) {
  var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
  var wrapped = onceWrapper.bind(state);
  wrapped.listener = listener;
  state.wrapFn = wrapped;
  return wrapped;
}

EventEmitter.prototype.once = function once(type, listener) {
  checkListener(listener);
  this.on(type, _onceWrap(this, type, listener));
  return this;
};

EventEmitter.prototype.prependOnceListener =
    function prependOnceListener(type, listener) {
      checkListener(listener);
      this.prependListener(type, _onceWrap(this, type, listener));
      return this;
    };

// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener =
    function removeListener(type, listener) {
      var list, events, position, i, originalListener;

      checkListener(listener);

      events = this._events;
      if (events === undefined)
        return this;

      list = events[type];
      if (list === undefined)
        return this;

      if (list === listener || list.listener === listener) {
        if (--this._eventsCount === 0)
          this._events = Object.create(null);
        else {
          delete events[type];
          if (events.removeListener)
            this.emit('removeListener', type, list.listener || listener);
        }
      } else if (typeof list !== 'function') {
        position = -1;

        for (i = list.length - 1; i >= 0; i--) {
          if (list[i] === listener || list[i].listener === listener) {
            originalListener = list[i].listener;
            position = i;
            break;
          }
        }

        if (position < 0)
          return this;

        if (position === 0)
          list.shift();
        else {
          spliceOne(list, position);
        }

        if (list.length === 1)
          events[type] = list[0];

        if (events.removeListener !== undefined)
          this.emit('removeListener', type, originalListener || listener);
      }

      return this;
    };

EventEmitter.prototype.off = EventEmitter.prototype.removeListener;

EventEmitter.prototype.removeAllListeners =
    function removeAllListeners(type) {
      var listeners, events, i;

      events = this._events;
      if (events === undefined)
        return this;

      // not listening for removeListener, no need to emit
      if (events.removeListener === undefined) {
        if (arguments.length === 0) {
          this._events = Object.create(null);
          this._eventsCount = 0;
        } else if (events[type] !== undefined) {
          if (--this._eventsCount === 0)
            this._events = Object.create(null);
          else
            delete events[type];
        }
        return this;
      }

      // emit removeListener for all listeners on all events
      if (arguments.length === 0) {
        var keys = Object.keys(events);
        var key;
        for (i = 0; i < keys.length; ++i) {
          key = keys[i];
          if (key === 'removeListener') continue;
          this.removeAllListeners(key);
        }
        this.removeAllListeners('removeListener');
        this._events = Object.create(null);
        this._eventsCount = 0;
        return this;
      }

      listeners = events[type];

      if (typeof listeners === 'function') {
        this.removeListener(type, listeners);
      } else if (listeners !== undefined) {
        // LIFO order
        for (i = listeners.length - 1; i >= 0; i--) {
          this.removeListener(type, listeners[i]);
        }
      }

      return this;
    };

function _listeners(target, type, unwrap) {
  var events = target._events;

  if (events === undefined)
    return [];

  var evlistener = events[type];
  if (evlistener === undefined)
    return [];

  if (typeof evlistener === 'function')
    return unwrap ? [evlistener.listener || evlistener] : [evlistener];

  return unwrap ?
    unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
}

EventEmitter.prototype.listeners = function listeners(type) {
  return _listeners(this, type, true);
};

EventEmitter.prototype.rawListeners = function rawListeners(type) {
  return _listeners(this, type, false);
};

EventEmitter.listenerCount = function(emitter, type) {
  if (typeof emitter.listenerCount === 'function') {
    return emitter.listenerCount(type);
  } else {
    return listenerCount.call(emitter, type);
  }
};

EventEmitter.prototype.listenerCount = listenerCount;
function listenerCount(type) {
  var events = this._events;

  if (events !== undefined) {
    var evlistener = events[type];

    if (typeof evlistener === 'function') {
      return 1;
    } else if (evlistener !== undefined) {
      return evlistener.length;
    }
  }

  return 0;
}

EventEmitter.prototype.eventNames = function eventNames() {
  return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
};

function arrayClone(arr, n) {
  var copy = new Array(n);
  for (var i = 0; i < n; ++i)
    copy[i] = arr[i];
  return copy;
}

function spliceOne(list, index) {
  for (; index + 1 < list.length; index++)
    list[index] = list[index + 1];
  list.pop();
}

function unwrapListeners(arr) {
  var ret = new Array(arr.length);
  for (var i = 0; i < ret.length; ++i) {
    ret[i] = arr[i].listener || arr[i];
  }
  return ret;
}

function once(emitter, name) {
  return new Promise(function (resolve, reject) {
    function errorListener(err) {
      emitter.removeListener(name, resolver);
      reject(err);
    }

    function resolver() {
      if (typeof emitter.removeListener === 'function') {
        emitter.removeListener('error', errorListener);
      }
      resolve([].slice.call(arguments));
    };

    eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
    if (name !== 'error') {
      addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
    }
  });
}

function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  if (typeof emitter.on === 'function') {
    eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
  }
}

function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  if (typeof emitter.on === 'function') {
    if (flags.once) {
      emitter.once(name, listener);
    } else {
      emitter.on(name, listener);
    }
  } else if (typeof emitter.addEventListener === 'function') {
    // EventTarget does not have `error` event semantics like Node
    // EventEmitters, we do not listen for `error` events here.
    emitter.addEventListener(name, function wrapListener(arg) {
      // IE does not have builtin `{ once: true }` support so we
      // have to do it manually.
      if (flags.once) {
        emitter.removeEventListener(name, wrapListener);
      }
      listener(arg);
    });
  } else {
    throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  }
}


/***/ }),

/***/ 9353:
/***/ (function(module) {

"use strict";


/* eslint no-invalid-this: 1 */

var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var toStr = Object.prototype.toString;
var max = Math.max;
var funcType = '[object Function]';

var concatty = function concatty(a, b) {
    var arr = [];

    for (var i = 0; i < a.length; i += 1) {
        arr[i] = a[i];
    }
    for (var j = 0; j < b.length; j += 1) {
        arr[j + a.length] = b[j];
    }

    return arr;
};

var slicy = function slicy(arrLike, offset) {
    var arr = [];
    for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
        arr[j] = arrLike[i];
    }
    return arr;
};

var joiny = function (arr, joiner) {
    var str = '';
    for (var i = 0; i < arr.length; i += 1) {
        str += arr[i];
        if (i + 1 < arr.length) {
            str += joiner;
        }
    }
    return str;
};

module.exports = function bind(that) {
    var target = this;
    if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
        throw new TypeError(ERROR_MESSAGE + target);
    }
    var args = slicy(arguments, 1);

    var bound;
    var binder = function () {
        if (this instanceof bound) {
            var result = target.apply(
                this,
                concatty(args, arguments)
            );
            if (Object(result) === result) {
                return result;
            }
            return this;
        }
        return target.apply(
            that,
            concatty(args, arguments)
        );

    };

    var boundLength = max(0, target.length - args.length);
    var boundArgs = [];
    for (var i = 0; i < boundLength; i++) {
        boundArgs[i] = '$' + i;
    }

    bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);

    if (target.prototype) {
        var Empty = function Empty() {};
        Empty.prototype = target.prototype;
        bound.prototype = new Empty();
        Empty.prototype = null;
    }

    return bound;
};


/***/ }),

/***/ 6743:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var implementation = __webpack_require__(9353);

module.exports = Function.prototype.bind || implementation;


/***/ }),

/***/ 9957:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var call = Function.prototype.call;
var $hasOwn = Object.prototype.hasOwnProperty;
var bind = __webpack_require__(6743);

/** @type {import('.')} */
module.exports = bind.call(call, $hasOwn);


/***/ }),

/***/ 4146:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var reactIs = __webpack_require__(4363);

/**
 * Copyright 2015, Yahoo! Inc.
 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
 */
var REACT_STATICS = {
  childContextTypes: true,
  contextType: true,
  contextTypes: true,
  defaultProps: true,
  displayName: true,
  getDefaultProps: true,
  getDerivedStateFromError: true,
  getDerivedStateFromProps: true,
  mixins: true,
  propTypes: true,
  type: true
};
var KNOWN_STATICS = {
  name: true,
  length: true,
  prototype: true,
  caller: true,
  callee: true,
  arguments: true,
  arity: true
};
var FORWARD_REF_STATICS = {
  '$$typeof': true,
  render: true,
  defaultProps: true,
  displayName: true,
  propTypes: true
};
var MEMO_STATICS = {
  '$$typeof': true,
  compare: true,
  defaultProps: true,
  displayName: true,
  propTypes: true,
  type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;

function getStatics(component) {
  // React v16.11 and below
  if (reactIs.isMemo(component)) {
    return MEMO_STATICS;
  } // React v16.12 and above


  return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
}

var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
  if (typeof sourceComponent !== 'string') {
    // don't hoist over string (html) components
    if (objectPrototype) {
      var inheritedComponent = getPrototypeOf(sourceComponent);

      if (inheritedComponent && inheritedComponent !== objectPrototype) {
        hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
      }
    }

    var keys = getOwnPropertyNames(sourceComponent);

    if (getOwnPropertySymbols) {
      keys = keys.concat(getOwnPropertySymbols(sourceComponent));
    }

    var targetStatics = getStatics(targetComponent);
    var sourceStatics = getStatics(sourceComponent);

    for (var i = 0; i < keys.length; ++i) {
      var key = keys[i];

      if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
        var descriptor = getOwnPropertyDescriptor(sourceComponent, key);

        try {
          // Avoid failures from read-only properties
          defineProperty(targetComponent, key, descriptor);
        } catch (e) {}
      }
    }
  }

  return targetComponent;
}

module.exports = hoistNonReactStatics;


/***/ }),

/***/ 251:
/***/ (function(__unused_webpack_module, exports) {

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  var e, m
  var eLen = (nBytes * 8) - mLen - 1
  var eMax = (1 << eLen) - 1
  var eBias = eMax >> 1
  var nBits = -7
  var i = isLE ? (nBytes - 1) : 0
  var d = isLE ? -1 : 1
  var s = buffer[offset + i]

  i += d

  e = s & ((1 << (-nBits)) - 1)
  s >>= (-nBits)
  nBits += eLen
  for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}

  m = e & ((1 << (-nBits)) - 1)
  e >>= (-nBits)
  nBits += mLen
  for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}

  if (e === 0) {
    e = 1 - eBias
  } else if (e === eMax) {
    return m ? NaN : ((s ? -1 : 1) * Infinity)
  } else {
    m = m + Math.pow(2, mLen)
    e = e - eBias
  }
  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}

exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  var e, m, c
  var eLen = (nBytes * 8) - mLen - 1
  var eMax = (1 << eLen) - 1
  var eBias = eMax >> 1
  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  var i = isLE ? 0 : (nBytes - 1)
  var d = isLE ? 1 : -1
  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0

  value = Math.abs(value)

  if (isNaN(value) || value === Infinity) {
    m = isNaN(value) ? 1 : 0
    e = eMax
  } else {
    e = Math.floor(Math.log(value) / Math.LN2)
    if (value * (c = Math.pow(2, -e)) < 1) {
      e--
      c *= 2
    }
    if (e + eBias >= 1) {
      value += rt / c
    } else {
      value += rt * Math.pow(2, 1 - eBias)
    }
    if (value * c >= 2) {
      e++
      c /= 2
    }

    if (e + eBias >= eMax) {
      m = 0
      e = eMax
    } else if (e + eBias >= 1) {
      m = ((value * c) - 1) * Math.pow(2, mLen)
      e = e + eBias
    } else {
      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
      e = 0
    }
  }

  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}

  e = (e << mLen) | m
  eLen += mLen
  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}

  buffer[offset + i - d] |= s * 128
}


/***/ }),

/***/ 6698:
/***/ (function(module) {

if (typeof Object.create === 'function') {
  // implementation from standard node.js 'util' module
  module.exports = function inherits(ctor, superCtor) {
    if (superCtor) {
      ctor.super_ = superCtor
      ctor.prototype = Object.create(superCtor.prototype, {
        constructor: {
          value: ctor,
          enumerable: false,
          writable: true,
          configurable: true
        }
      })
    }
  };
} else {
  // old school shim for old browsers
  module.exports = function inherits(ctor, superCtor) {
    if (superCtor) {
      ctor.super_ = superCtor
      var TempCtor = function () {}
      TempCtor.prototype = superCtor.prototype
      ctor.prototype = new TempCtor()
      ctor.prototype.constructor = ctor
    }
  }
}


/***/ }),

/***/ 2215:
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
 * JavaScript Cookie v2.2.1
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */
;(function (factory) {
	var registeredInModuleLoader;
	if (true) {
		!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
		__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
		(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
		__WEBPACK_AMD_DEFINE_FACTORY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		registeredInModuleLoader = true;
	}
	if (true) {
		module.exports = factory();
		registeredInModuleLoader = true;
	}
	if (!registeredInModuleLoader) {
		var OldCookies = window.Cookies;
		var api = window.Cookies = factory();
		api.noConflict = function () {
			window.Cookies = OldCookies;
			return api;
		};
	}
}(function () {
	function extend () {
		var i = 0;
		var result = {};
		for (; i < arguments.length; i++) {
			var attributes = arguments[ i ];
			for (var key in attributes) {
				result[key] = attributes[key];
			}
		}
		return result;
	}

	function decode (s) {
		return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
	}

	function init (converter) {
		function api() {}

		function set (key, value, attributes) {
			if (typeof document === 'undefined') {
				return;
			}

			attributes = extend({
				path: '/'
			}, api.defaults, attributes);

			if (typeof attributes.expires === 'number') {
				attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
			}

			// We're using "expires" because "max-age" is not supported by IE
			attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';

			try {
				var result = JSON.stringify(value);
				if (/^[\{\[]/.test(result)) {
					value = result;
				}
			} catch (e) {}

			value = converter.write ?
				converter.write(value, key) :
				encodeURIComponent(String(value))
					.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);

			key = encodeURIComponent(String(key))
				.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
				.replace(/[\(\)]/g, escape);

			var stringifiedAttributes = '';
			for (var attributeName in attributes) {
				if (!attributes[attributeName]) {
					continue;
				}
				stringifiedAttributes += '; ' + attributeName;
				if (attributes[attributeName] === true) {
					continue;
				}

				// Considers RFC 6265 section 5.2:
				// ...
				// 3.  If the remaining unparsed-attributes contains a %x3B (";")
				//     character:
				// Consume the characters of the unparsed-attributes up to,
				// not including, the first %x3B (";") character.
				// ...
				stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
			}

			return (document.cookie = key + '=' + value + stringifiedAttributes);
		}

		function get (key, json) {
			if (typeof document === 'undefined') {
				return;
			}

			var jar = {};
			// To prevent the for loop in the first place assign an empty array
			// in case there are no cookies at all.
			var cookies = document.cookie ? document.cookie.split('; ') : [];
			var i = 0;

			for (; i < cookies.length; i++) {
				var parts = cookies[i].split('=');
				var cookie = parts.slice(1).join('=');

				if (!json && cookie.charAt(0) === '"') {
					cookie = cookie.slice(1, -1);
				}

				try {
					var name = decode(parts[0]);
					cookie = (converter.read || converter)(cookie, name) ||
						decode(cookie);

					if (json) {
						try {
							cookie = JSON.parse(cookie);
						} catch (e) {}
					}

					jar[name] = cookie;

					if (key === name) {
						break;
					}
				} catch (e) {}
			}

			return key ? jar[key] : jar;
		}

		api.set = set;
		api.get = function (key) {
			return get(key, false /* read as raw */);
		};
		api.getJSON = function (key) {
			return get(key, true /* read as json */);
		};
		api.remove = function (key, attributes) {
			set(key, '', extend(attributes, {
				expires: -1
			}));
		};

		api.defaults = {};

		api.withConverter = init;

		return api;
	}

	return init(function () {});
}));


/***/ }),

/***/ 181:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

/**
 * lodash (Custom Build) <https://lodash.com/>
 * Build: `lodash modularize exports="npm" -o ./`
 * Copyright jQuery Foundation and other contributors <https://jquery.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */

/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';

/** Used as references for various `Number` constants. */
var NAN = 0 / 0;

/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';

/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g;

/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;

/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;

/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;

/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;

/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;

/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();

/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var objectToString = objectProto.toString;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
    nativeMin = Math.min;

/**
 * Gets the timestamp of the number of milliseconds that have elapsed since
 * the Unix epoch (1 January 1970 00:00:00 UTC).
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Date
 * @returns {number} Returns the timestamp.
 * @example
 *
 * _.defer(function(stamp) {
 *   console.log(_.now() - stamp);
 * }, _.now());
 * // => Logs the number of milliseconds it took for the deferred invocation.
 */
var now = function() {
  return root.Date.now();
};

/**
 * Creates a debounced function that delays invoking `func` until after `wait`
 * milliseconds have elapsed since the last time the debounced function was
 * invoked. The debounced function comes with a `cancel` method to cancel
 * delayed `func` invocations and a `flush` method to immediately invoke them.
 * Provide `options` to indicate whether `func` should be invoked on the
 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
 * with the last arguments provided to the debounced function. Subsequent
 * calls to the debounced function return the result of the last `func`
 * invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the debounced function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.debounce` and `_.throttle`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to debounce.
 * @param {number} [wait=0] The number of milliseconds to delay.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=false]
 *  Specify invoking on the leading edge of the timeout.
 * @param {number} [options.maxWait]
 *  The maximum time `func` is allowed to be delayed before it's invoked.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new debounced function.
 * @example
 *
 * // Avoid costly calculations while the window size is in flux.
 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
 *
 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
 * jQuery(element).on('click', _.debounce(sendMail, 300, {
 *   'leading': true,
 *   'trailing': false
 * }));
 *
 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
 * var source = new EventSource('/stream');
 * jQuery(source).on('message', debounced);
 *
 * // Cancel the trailing debounced invocation.
 * jQuery(window).on('popstate', debounced.cancel);
 */
function debounce(func, wait, options) {
  var lastArgs,
      lastThis,
      maxWait,
      result,
      timerId,
      lastCallTime,
      lastInvokeTime = 0,
      leading = false,
      maxing = false,
      trailing = true;

  if (typeof func != 'function') {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  wait = toNumber(wait) || 0;
  if (isObject(options)) {
    leading = !!options.leading;
    maxing = 'maxWait' in options;
    maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
    trailing = 'trailing' in options ? !!options.trailing : trailing;
  }

  function invokeFunc(time) {
    var args = lastArgs,
        thisArg = lastThis;

    lastArgs = lastThis = undefined;
    lastInvokeTime = time;
    result = func.apply(thisArg, args);
    return result;
  }

  function leadingEdge(time) {
    // Reset any `maxWait` timer.
    lastInvokeTime = time;
    // Start the timer for the trailing edge.
    timerId = setTimeout(timerExpired, wait);
    // Invoke the leading edge.
    return leading ? invokeFunc(time) : result;
  }

  function remainingWait(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime,
        result = wait - timeSinceLastCall;

    return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
  }

  function shouldInvoke(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime;

    // Either this is the first call, activity has stopped and we're at the
    // trailing edge, the system time has gone backwards and we're treating
    // it as the trailing edge, or we've hit the `maxWait` limit.
    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  }

  function timerExpired() {
    var time = now();
    if (shouldInvoke(time)) {
      return trailingEdge(time);
    }
    // Restart the timer.
    timerId = setTimeout(timerExpired, remainingWait(time));
  }

  function trailingEdge(time) {
    timerId = undefined;

    // Only invoke if we have `lastArgs` which means `func` has been
    // debounced at least once.
    if (trailing && lastArgs) {
      return invokeFunc(time);
    }
    lastArgs = lastThis = undefined;
    return result;
  }

  function cancel() {
    if (timerId !== undefined) {
      clearTimeout(timerId);
    }
    lastInvokeTime = 0;
    lastArgs = lastCallTime = lastThis = timerId = undefined;
  }

  function flush() {
    return timerId === undefined ? result : trailingEdge(now());
  }

  function debounced() {
    var time = now(),
        isInvoking = shouldInvoke(time);

    lastArgs = arguments;
    lastThis = this;
    lastCallTime = time;

    if (isInvoking) {
      if (timerId === undefined) {
        return leadingEdge(lastCallTime);
      }
      if (maxing) {
        // Handle invocations in a tight loop.
        timerId = setTimeout(timerExpired, wait);
        return invokeFunc(lastCallTime);
      }
    }
    if (timerId === undefined) {
      timerId = setTimeout(timerExpired, wait);
    }
    return result;
  }
  debounced.cancel = cancel;
  debounced.flush = flush;
  return debounced;
}

/**
 * Checks if `value` is the
 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
 * @example
 *
 * _.isObject({});
 * // => true
 *
 * _.isObject([1, 2, 3]);
 * // => true
 *
 * _.isObject(_.noop);
 * // => true
 *
 * _.isObject(null);
 * // => false
 */
function isObject(value) {
  var type = typeof value;
  return !!value && (type == 'object' || type == 'function');
}

/**
 * Checks if `value` is object-like. A value is object-like if it's not `null`
 * and has a `typeof` result of "object".
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 * @example
 *
 * _.isObjectLike({});
 * // => true
 *
 * _.isObjectLike([1, 2, 3]);
 * // => true
 *
 * _.isObjectLike(_.noop);
 * // => false
 *
 * _.isObjectLike(null);
 * // => false
 */
function isObjectLike(value) {
  return !!value && typeof value == 'object';
}

/**
 * Checks if `value` is classified as a `Symbol` primitive or object.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
 * @example
 *
 * _.isSymbol(Symbol.iterator);
 * // => true
 *
 * _.isSymbol('abc');
 * // => false
 */
function isSymbol(value) {
  return typeof value == 'symbol' ||
    (isObjectLike(value) && objectToString.call(value) == symbolTag);
}

/**
 * Converts `value` to a number.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to process.
 * @returns {number} Returns the number.
 * @example
 *
 * _.toNumber(3.2);
 * // => 3.2
 *
 * _.toNumber(Number.MIN_VALUE);
 * // => 5e-324
 *
 * _.toNumber(Infinity);
 * // => Infinity
 *
 * _.toNumber('3.2');
 * // => 3.2
 */
function toNumber(value) {
  if (typeof value == 'number') {
    return value;
  }
  if (isSymbol(value)) {
    return NAN;
  }
  if (isObject(value)) {
    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
    value = isObject(other) ? (other + '') : other;
  }
  if (typeof value != 'string') {
    return value === 0 ? value : +value;
  }
  value = value.replace(reTrim, '');
  var isBinary = reIsBinary.test(value);
  return (isBinary || reIsOctal.test(value))
    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
    : (reIsBadHex.test(value) ? NAN : +value);
}

module.exports = debounce;


/***/ }),

/***/ 5580:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getNative = __webpack_require__(6110),
    root = __webpack_require__(9325);

/* Built-in method references that are verified to be native. */
var DataView = getNative(root, 'DataView');

module.exports = DataView;


/***/ }),

/***/ 1549:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var hashClear = __webpack_require__(2032),
    hashDelete = __webpack_require__(3862),
    hashGet = __webpack_require__(6721),
    hashHas = __webpack_require__(2749),
    hashSet = __webpack_require__(5749);

/**
 * Creates a hash object.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function Hash(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

// Add methods to `Hash`.
Hash.prototype.clear = hashClear;
Hash.prototype['delete'] = hashDelete;
Hash.prototype.get = hashGet;
Hash.prototype.has = hashHas;
Hash.prototype.set = hashSet;

module.exports = Hash;


/***/ }),

/***/ 79:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var listCacheClear = __webpack_require__(3702),
    listCacheDelete = __webpack_require__(80),
    listCacheGet = __webpack_require__(4739),
    listCacheHas = __webpack_require__(8655),
    listCacheSet = __webpack_require__(1175);

/**
 * Creates an list cache object.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function ListCache(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

// Add methods to `ListCache`.
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;

module.exports = ListCache;


/***/ }),

/***/ 8223:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getNative = __webpack_require__(6110),
    root = __webpack_require__(9325);

/* Built-in method references that are verified to be native. */
var Map = getNative(root, 'Map');

module.exports = Map;


/***/ }),

/***/ 3661:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var mapCacheClear = __webpack_require__(3040),
    mapCacheDelete = __webpack_require__(7670),
    mapCacheGet = __webpack_require__(289),
    mapCacheHas = __webpack_require__(4509),
    mapCacheSet = __webpack_require__(2949);

/**
 * Creates a map cache object to store key-value pairs.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function MapCache(entries) {
  var index = -1,
      length = entries == null ? 0 : entries.length;

  this.clear();
  while (++index < length) {
    var entry = entries[index];
    this.set(entry[0], entry[1]);
  }
}

// Add methods to `MapCache`.
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;

module.exports = MapCache;


/***/ }),

/***/ 2804:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getNative = __webpack_require__(6110),
    root = __webpack_require__(9325);

/* Built-in method references that are verified to be native. */
var Promise = getNative(root, 'Promise');

module.exports = Promise;


/***/ }),

/***/ 6545:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getNative = __webpack_require__(6110),
    root = __webpack_require__(9325);

/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');

module.exports = Set;


/***/ }),

/***/ 8859:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var MapCache = __webpack_require__(3661),
    setCacheAdd = __webpack_require__(1380),
    setCacheHas = __webpack_require__(1459);

/**
 *
 * Creates an array cache object to store unique values.
 *
 * @private
 * @constructor
 * @param {Array} [values] The values to cache.
 */
function SetCache(values) {
  var index = -1,
      length = values == null ? 0 : values.length;

  this.__data__ = new MapCache;
  while (++index < length) {
    this.add(values[index]);
  }
}

// Add methods to `SetCache`.
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;

module.exports = SetCache;


/***/ }),

/***/ 7217:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var ListCache = __webpack_require__(79),
    stackClear = __webpack_require__(1420),
    stackDelete = __webpack_require__(938),
    stackGet = __webpack_require__(3605),
    stackHas = __webpack_require__(9817),
    stackSet = __webpack_require__(945);

/**
 * Creates a stack cache object to store key-value pairs.
 *
 * @private
 * @constructor
 * @param {Array} [entries] The key-value pairs to cache.
 */
function Stack(entries) {
  var data = this.__data__ = new ListCache(entries);
  this.size = data.size;
}

// Add methods to `Stack`.
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;

module.exports = Stack;


/***/ }),

/***/ 1873:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var root = __webpack_require__(9325);

/** Built-in value references. */
var Symbol = root.Symbol;

module.exports = Symbol;


/***/ }),

/***/ 7828:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var root = __webpack_require__(9325);

/** Built-in value references. */
var Uint8Array = root.Uint8Array;

module.exports = Uint8Array;


/***/ }),

/***/ 8303:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getNative = __webpack_require__(6110),
    root = __webpack_require__(9325);

/* Built-in method references that are verified to be native. */
var WeakMap = getNative(root, 'WeakMap');

module.exports = WeakMap;


/***/ }),

/***/ 1033:
/***/ (function(module) {

/**
 * A faster alternative to `Function#apply`, this function invokes `func`
 * with the `this` binding of `thisArg` and the arguments of `args`.
 *
 * @private
 * @param {Function} func The function to invoke.
 * @param {*} thisArg The `this` binding of `func`.
 * @param {Array} args The arguments to invoke `func` with.
 * @returns {*} Returns the result of `func`.
 */
function apply(func, thisArg, args) {
  switch (args.length) {
    case 0: return func.call(thisArg);
    case 1: return func.call(thisArg, args[0]);
    case 2: return func.call(thisArg, args[0], args[1]);
    case 3: return func.call(thisArg, args[0], args[1], args[2]);
  }
  return func.apply(thisArg, args);
}

module.exports = apply;


/***/ }),

/***/ 7277:
/***/ (function(module) {

/**
 * A specialized version of `_.every` for arrays without support for
 * iteratee shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {boolean} Returns `true` if all elements pass the predicate check,
 *  else `false`.
 */
function arrayEvery(array, predicate) {
  var index = -1,
      length = array == null ? 0 : array.length;

  while (++index < length) {
    if (!predicate(array[index], index, array)) {
      return false;
    }
  }
  return true;
}

module.exports = arrayEvery;


/***/ }),

/***/ 9770:
/***/ (function(module) {

/**
 * A specialized version of `_.filter` for arrays without support for
 * iteratee shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {Array} Returns the new filtered array.
 */
function arrayFilter(array, predicate) {
  var index = -1,
      length = array == null ? 0 : array.length,
      resIndex = 0,
      result = [];

  while (++index < length) {
    var value = array[index];
    if (predicate(value, index, array)) {
      result[resIndex++] = value;
    }
  }
  return result;
}

module.exports = arrayFilter;


/***/ }),

/***/ 5325:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseIndexOf = __webpack_require__(6131);

/**
 * A specialized version of `_.includes` for arrays without support for
 * specifying an index to search from.
 *
 * @private
 * @param {Array} [array] The array to inspect.
 * @param {*} target The value to search for.
 * @returns {boolean} Returns `true` if `target` is found, else `false`.
 */
function arrayIncludes(array, value) {
  var length = array == null ? 0 : array.length;
  return !!length && baseIndexOf(array, value, 0) > -1;
}

module.exports = arrayIncludes;


/***/ }),

/***/ 9905:
/***/ (function(module) {

/**
 * This function is like `arrayIncludes` except that it accepts a comparator.
 *
 * @private
 * @param {Array} [array] The array to inspect.
 * @param {*} target The value to search for.
 * @param {Function} comparator The comparator invoked per element.
 * @returns {boolean} Returns `true` if `target` is found, else `false`.
 */
function arrayIncludesWith(array, value, comparator) {
  var index = -1,
      length = array == null ? 0 : array.length;

  while (++index < length) {
    if (comparator(value, array[index])) {
      return true;
    }
  }
  return false;
}

module.exports = arrayIncludesWith;


/***/ }),

/***/ 695:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseTimes = __webpack_require__(8096),
    isArguments = __webpack_require__(2428),
    isArray = __webpack_require__(6449),
    isBuffer = __webpack_require__(3656),
    isIndex = __webpack_require__(361),
    isTypedArray = __webpack_require__(7167);

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Creates an array of the enumerable property names of the array-like `value`.
 *
 * @private
 * @param {*} value The value to query.
 * @param {boolean} inherited Specify returning inherited property names.
 * @returns {Array} Returns the array of property names.
 */
function arrayLikeKeys(value, inherited) {
  var isArr = isArray(value),
      isArg = !isArr && isArguments(value),
      isBuff = !isArr && !isArg && isBuffer(value),
      isType = !isArr && !isArg && !isBuff && isTypedArray(value),
      skipIndexes = isArr || isArg || isBuff || isType,
      result = skipIndexes ? baseTimes(value.length, String) : [],
      length = result.length;

  for (var key in value) {
    if ((inherited || hasOwnProperty.call(value, key)) &&
        !(skipIndexes && (
           // Safari 9 has enumerable `arguments.length` in strict mode.
           key == 'length' ||
           // Node.js 0.10 has enumerable non-index properties on buffers.
           (isBuff && (key == 'offset' || key == 'parent')) ||
           // PhantomJS 2 has enumerable non-index properties on typed arrays.
           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
           // Skip index properties.
           isIndex(key, length)
        ))) {
      result.push(key);
    }
  }
  return result;
}

module.exports = arrayLikeKeys;


/***/ }),

/***/ 4932:
/***/ (function(module) {

/**
 * A specialized version of `_.map` for arrays without support for iteratee
 * shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns the new mapped array.
 */
function arrayMap(array, iteratee) {
  var index = -1,
      length = array == null ? 0 : array.length,
      result = Array(length);

  while (++index < length) {
    result[index] = iteratee(array[index], index, array);
  }
  return result;
}

module.exports = arrayMap;


/***/ }),

/***/ 4528:
/***/ (function(module) {

/**
 * Appends the elements of `values` to `array`.
 *
 * @private
 * @param {Array} array The array to modify.
 * @param {Array} values The values to append.
 * @returns {Array} Returns `array`.
 */
function arrayPush(array, values) {
  var index = -1,
      length = values.length,
      offset = array.length;

  while (++index < length) {
    array[offset + index] = values[index];
  }
  return array;
}

module.exports = arrayPush;


/***/ }),

/***/ 4248:
/***/ (function(module) {

/**
 * A specialized version of `_.some` for arrays without support for iteratee
 * shorthands.
 *
 * @private
 * @param {Array} [array] The array to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {boolean} Returns `true` if any element passes the predicate check,
 *  else `false`.
 */
function arraySome(array, predicate) {
  var index = -1,
      length = array == null ? 0 : array.length;

  while (++index < length) {
    if (predicate(array[index], index, array)) {
      return true;
    }
  }
  return false;
}

module.exports = arraySome;


/***/ }),

/***/ 1074:
/***/ (function(module) {

/**
 * Converts an ASCII `string` to an array.
 *
 * @private
 * @param {string} string The string to convert.
 * @returns {Array} Returns the converted array.
 */
function asciiToArray(string) {
  return string.split('');
}

module.exports = asciiToArray;


/***/ }),

/***/ 6025:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var eq = __webpack_require__(5288);

/**
 * Gets the index at which the `key` is found in `array` of key-value pairs.
 *
 * @private
 * @param {Array} array The array to inspect.
 * @param {*} key The key to search for.
 * @returns {number} Returns the index of the matched value, else `-1`.
 */
function assocIndexOf(array, key) {
  var length = array.length;
  while (length--) {
    if (eq(array[length][0], key)) {
      return length;
    }
  }
  return -1;
}

module.exports = assocIndexOf;


/***/ }),

/***/ 3360:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var defineProperty = __webpack_require__(3243);

/**
 * The base implementation of `assignValue` and `assignMergeValue` without
 * value checks.
 *
 * @private
 * @param {Object} object The object to modify.
 * @param {string} key The key of the property to assign.
 * @param {*} value The value to assign.
 */
function baseAssignValue(object, key, value) {
  if (key == '__proto__' && defineProperty) {
    defineProperty(object, key, {
      'configurable': true,
      'enumerable': true,
      'value': value,
      'writable': true
    });
  } else {
    object[key] = value;
  }
}

module.exports = baseAssignValue;


/***/ }),

/***/ 909:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseForOwn = __webpack_require__(641),
    createBaseEach = __webpack_require__(8329);

/**
 * The base implementation of `_.forEach` without support for iteratee shorthands.
 *
 * @private
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array|Object} Returns `collection`.
 */
var baseEach = createBaseEach(baseForOwn);

module.exports = baseEach;


/***/ }),

/***/ 3777:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseEach = __webpack_require__(909);

/**
 * The base implementation of `_.every` without support for iteratee shorthands.
 *
 * @private
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {boolean} Returns `true` if all elements pass the predicate check,
 *  else `false`
 */
function baseEvery(collection, predicate) {
  var result = true;
  baseEach(collection, function(value, index, collection) {
    result = !!predicate(value, index, collection);
    return result;
  });
  return result;
}

module.exports = baseEvery;


/***/ }),

/***/ 3599:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isSymbol = __webpack_require__(4394);

/**
 * The base implementation of methods like `_.max` and `_.min` which accepts a
 * `comparator` to determine the extremum value.
 *
 * @private
 * @param {Array} array The array to iterate over.
 * @param {Function} iteratee The iteratee invoked per iteration.
 * @param {Function} comparator The comparator used to compare values.
 * @returns {*} Returns the extremum value.
 */
function baseExtremum(array, iteratee, comparator) {
  var index = -1,
      length = array.length;

  while (++index < length) {
    var value = array[index],
        current = iteratee(value);

    if (current != null && (computed === undefined
          ? (current === current && !isSymbol(current))
          : comparator(current, computed)
        )) {
      var computed = current,
          result = value;
    }
  }
  return result;
}

module.exports = baseExtremum;


/***/ }),

/***/ 2523:
/***/ (function(module) {

/**
 * The base implementation of `_.findIndex` and `_.findLastIndex` without
 * support for iteratee shorthands.
 *
 * @private
 * @param {Array} array The array to inspect.
 * @param {Function} predicate The function invoked per iteration.
 * @param {number} fromIndex The index to search from.
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {number} Returns the index of the matched value, else `-1`.
 */
function baseFindIndex(array, predicate, fromIndex, fromRight) {
  var length = array.length,
      index = fromIndex + (fromRight ? 1 : -1);

  while ((fromRight ? index-- : ++index < length)) {
    if (predicate(array[index], index, array)) {
      return index;
    }
  }
  return -1;
}

module.exports = baseFindIndex;


/***/ }),

/***/ 3120:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var arrayPush = __webpack_require__(4528),
    isFlattenable = __webpack_require__(5891);

/**
 * The base implementation of `_.flatten` with support for restricting flattening.
 *
 * @private
 * @param {Array} array The array to flatten.
 * @param {number} depth The maximum recursion depth.
 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
 * @param {Array} [result=[]] The initial result value.
 * @returns {Array} Returns the new flattened array.
 */
function baseFlatten(array, depth, predicate, isStrict, result) {
  var index = -1,
      length = array.length;

  predicate || (predicate = isFlattenable);
  result || (result = []);

  while (++index < length) {
    var value = array[index];
    if (depth > 0 && predicate(value)) {
      if (depth > 1) {
        // Recursively flatten arrays (susceptible to call stack limits).
        baseFlatten(value, depth - 1, predicate, isStrict, result);
      } else {
        arrayPush(result, value);
      }
    } else if (!isStrict) {
      result[result.length] = value;
    }
  }
  return result;
}

module.exports = baseFlatten;


/***/ }),

/***/ 6649:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var createBaseFor = __webpack_require__(3221);

/**
 * The base implementation of `baseForOwn` which iterates over `object`
 * properties returned by `keysFunc` and invokes `iteratee` for each property.
 * Iteratee functions may exit iteration early by explicitly returning `false`.
 *
 * @private
 * @param {Object} object The object to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @param {Function} keysFunc The function to get the keys of `object`.
 * @returns {Object} Returns `object`.
 */
var baseFor = createBaseFor();

module.exports = baseFor;


/***/ }),

/***/ 641:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseFor = __webpack_require__(6649),
    keys = __webpack_require__(5950);

/**
 * The base implementation of `_.forOwn` without support for iteratee shorthands.
 *
 * @private
 * @param {Object} object The object to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Object} Returns `object`.
 */
function baseForOwn(object, iteratee) {
  return object && baseFor(object, iteratee, keys);
}

module.exports = baseForOwn;


/***/ }),

/***/ 7422:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var castPath = __webpack_require__(1769),
    toKey = __webpack_require__(7797);

/**
 * The base implementation of `_.get` without support for default values.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Array|string} path The path of the property to get.
 * @returns {*} Returns the resolved value.
 */
function baseGet(object, path) {
  path = castPath(path, object);

  var index = 0,
      length = path.length;

  while (object != null && index < length) {
    object = object[toKey(path[index++])];
  }
  return (index && index == length) ? object : undefined;
}

module.exports = baseGet;


/***/ }),

/***/ 2199:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var arrayPush = __webpack_require__(4528),
    isArray = __webpack_require__(6449);

/**
 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
 * symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Function} keysFunc The function to get the keys of `object`.
 * @param {Function} symbolsFunc The function to get the symbols of `object`.
 * @returns {Array} Returns the array of property names and symbols.
 */
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  var result = keysFunc(object);
  return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}

module.exports = baseGetAllKeys;


/***/ }),

/***/ 2552:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var Symbol = __webpack_require__(1873),
    getRawTag = __webpack_require__(659),
    objectToString = __webpack_require__(9350);

/** `Object#toString` result references. */
var nullTag = '[object Null]',
    undefinedTag = '[object Undefined]';

/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;

/**
 * The base implementation of `getTag` without fallbacks for buggy environments.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */
function baseGetTag(value) {
  if (value == null) {
    return value === undefined ? undefinedTag : nullTag;
  }
  return (symToStringTag && symToStringTag in Object(value))
    ? getRawTag(value)
    : objectToString(value);
}

module.exports = baseGetTag;


/***/ }),

/***/ 3335:
/***/ (function(module) {

/**
 * The base implementation of `_.gt` which doesn't coerce arguments.
 *
 * @private
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if `value` is greater than `other`,
 *  else `false`.
 */
function baseGt(value, other) {
  return value > other;
}

module.exports = baseGt;


/***/ }),

/***/ 8077:
/***/ (function(module) {

/**
 * The base implementation of `_.hasIn` without support for deep paths.
 *
 * @private
 * @param {Object} [object] The object to query.
 * @param {Array|string} key The key to check.
 * @returns {boolean} Returns `true` if `key` exists, else `false`.
 */
function baseHasIn(object, key) {
  return object != null && key in Object(object);
}

module.exports = baseHasIn;


/***/ }),

/***/ 6131:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseFindIndex = __webpack_require__(2523),
    baseIsNaN = __webpack_require__(5463),
    strictIndexOf = __webpack_require__(6959);

/**
 * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
 *
 * @private
 * @param {Array} array The array to inspect.
 * @param {*} value The value to search for.
 * @param {number} fromIndex The index to search from.
 * @returns {number} Returns the index of the matched value, else `-1`.
 */
function baseIndexOf(array, value, fromIndex) {
  return value === value
    ? strictIndexOf(array, value, fromIndex)
    : baseFindIndex(array, baseIsNaN, fromIndex);
}

module.exports = baseIndexOf;


/***/ }),

/***/ 7534:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGetTag = __webpack_require__(2552),
    isObjectLike = __webpack_require__(7965);

/** `Object#toString` result references. */
var argsTag = '[object Arguments]';

/**
 * The base implementation of `_.isArguments`.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
 */
function baseIsArguments(value) {
  return isObjectLike(value) && baseGetTag(value) == argsTag;
}

module.exports = baseIsArguments;


/***/ }),

/***/ 270:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseIsEqualDeep = __webpack_require__(7068),
    isObjectLike = __webpack_require__(7965);

/**
 * The base implementation of `_.isEqual` which supports partial comparisons
 * and tracks traversed objects.
 *
 * @private
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @param {boolean} bitmask The bitmask flags.
 *  1 - Unordered comparison
 *  2 - Partial comparison
 * @param {Function} [customizer] The function to customize comparisons.
 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 */
function baseIsEqual(value, other, bitmask, customizer, stack) {
  if (value === other) {
    return true;
  }
  if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
    return value !== value && other !== other;
  }
  return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
}

module.exports = baseIsEqual;


/***/ }),

/***/ 7068:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var Stack = __webpack_require__(7217),
    equalArrays = __webpack_require__(5911),
    equalByTag = __webpack_require__(1986),
    equalObjects = __webpack_require__(689),
    getTag = __webpack_require__(5861),
    isArray = __webpack_require__(6449),
    isBuffer = __webpack_require__(3656),
    isTypedArray = __webpack_require__(7167);

/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;

/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
    arrayTag = '[object Array]',
    objectTag = '[object Object]';

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * A specialized version of `baseIsEqual` for arrays and objects which performs
 * deep comparisons and tracks traversed objects enabling objects with circular
 * references to be compared.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  var objIsArr = isArray(object),
      othIsArr = isArray(other),
      objTag = objIsArr ? arrayTag : getTag(object),
      othTag = othIsArr ? arrayTag : getTag(other);

  objTag = objTag == argsTag ? objectTag : objTag;
  othTag = othTag == argsTag ? objectTag : othTag;

  var objIsObj = objTag == objectTag,
      othIsObj = othTag == objectTag,
      isSameTag = objTag == othTag;

  if (isSameTag && isBuffer(object)) {
    if (!isBuffer(other)) {
      return false;
    }
    objIsArr = true;
    objIsObj = false;
  }
  if (isSameTag && !objIsObj) {
    stack || (stack = new Stack);
    return (objIsArr || isTypedArray(object))
      ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
      : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  }
  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');

    if (objIsWrapped || othIsWrapped) {
      var objUnwrapped = objIsWrapped ? object.value() : object,
          othUnwrapped = othIsWrapped ? other.value() : other;

      stack || (stack = new Stack);
      return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
    }
  }
  if (!isSameTag) {
    return false;
  }
  stack || (stack = new Stack);
  return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
}

module.exports = baseIsEqualDeep;


/***/ }),

/***/ 1799:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var Stack = __webpack_require__(7217),
    baseIsEqual = __webpack_require__(270);

/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
    COMPARE_UNORDERED_FLAG = 2;

/**
 * The base implementation of `_.isMatch` without support for iteratee shorthands.
 *
 * @private
 * @param {Object} object The object to inspect.
 * @param {Object} source The object of property values to match.
 * @param {Array} matchData The property names, values, and compare flags to match.
 * @param {Function} [customizer] The function to customize comparisons.
 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
 */
function baseIsMatch(object, source, matchData, customizer) {
  var index = matchData.length,
      length = index,
      noCustomizer = !customizer;

  if (object == null) {
    return !length;
  }
  object = Object(object);
  while (index--) {
    var data = matchData[index];
    if ((noCustomizer && data[2])
          ? data[1] !== object[data[0]]
          : !(data[0] in object)
        ) {
      return false;
    }
  }
  while (++index < length) {
    data = matchData[index];
    var key = data[0],
        objValue = object[key],
        srcValue = data[1];

    if (noCustomizer && data[2]) {
      if (objValue === undefined && !(key in object)) {
        return false;
      }
    } else {
      var stack = new Stack;
      if (customizer) {
        var result = customizer(objValue, srcValue, key, object, source, stack);
      }
      if (!(result === undefined
            ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
            : result
          )) {
        return false;
      }
    }
  }
  return true;
}

module.exports = baseIsMatch;


/***/ }),

/***/ 5463:
/***/ (function(module) {

/**
 * The base implementation of `_.isNaN` without support for number objects.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
 */
function baseIsNaN(value) {
  return value !== value;
}

module.exports = baseIsNaN;


/***/ }),

/***/ 5083:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isFunction = __webpack_require__(1882),
    isMasked = __webpack_require__(7296),
    isObject = __webpack_require__(3805),
    toSource = __webpack_require__(2235);

/**
 * Used to match `RegExp`
 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
 */
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;

/** Used to detect host constructors (Safari). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;

/** Used for built-in method references. */
var funcProto = Function.prototype,
    objectProto = Object.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);

/**
 * The base implementation of `_.isNative` without bad shim checks.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a native function,
 *  else `false`.
 */
function baseIsNative(value) {
  if (!isObject(value) || isMasked(value)) {
    return false;
  }
  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  return pattern.test(toSource(value));
}

module.exports = baseIsNative;


/***/ }),

/***/ 4901:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGetTag = __webpack_require__(2552),
    isLength = __webpack_require__(294),
    isObjectLike = __webpack_require__(7965);

/** `Object#toString` result references. */
var argsTag = '[object Arguments]',
    arrayTag = '[object Array]',
    boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    errorTag = '[object Error]',
    funcTag = '[object Function]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    objectTag = '[object Object]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    weakMapTag = '[object WeakMap]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]',
    float32Tag = '[object Float32Array]',
    float64Tag = '[object Float64Array]',
    int8Tag = '[object Int8Array]',
    int16Tag = '[object Int16Array]',
    int32Tag = '[object Int32Array]',
    uint8Tag = '[object Uint8Array]',
    uint8ClampedTag = '[object Uint8ClampedArray]',
    uint16Tag = '[object Uint16Array]',
    uint32Tag = '[object Uint32Array]';

/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
typedArrayTags[uint32Tag] = true;
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
typedArrayTags[setTag] = typedArrayTags[stringTag] =
typedArrayTags[weakMapTag] = false;

/**
 * The base implementation of `_.isTypedArray` without Node.js optimizations.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
 */
function baseIsTypedArray(value) {
  return isObjectLike(value) &&
    isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
}

module.exports = baseIsTypedArray;


/***/ }),

/***/ 5389:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseMatches = __webpack_require__(3663),
    baseMatchesProperty = __webpack_require__(7978),
    identity = __webpack_require__(3488),
    isArray = __webpack_require__(6449),
    property = __webpack_require__(583);

/**
 * The base implementation of `_.iteratee`.
 *
 * @private
 * @param {*} [value=_.identity] The value to convert to an iteratee.
 * @returns {Function} Returns the iteratee.
 */
function baseIteratee(value) {
  // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  if (typeof value == 'function') {
    return value;
  }
  if (value == null) {
    return identity;
  }
  if (typeof value == 'object') {
    return isArray(value)
      ? baseMatchesProperty(value[0], value[1])
      : baseMatches(value);
  }
  return property(value);
}

module.exports = baseIteratee;


/***/ }),

/***/ 8984:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isPrototype = __webpack_require__(5527),
    nativeKeys = __webpack_require__(3650);

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function baseKeys(object) {
  if (!isPrototype(object)) {
    return nativeKeys(object);
  }
  var result = [];
  for (var key in Object(object)) {
    if (hasOwnProperty.call(object, key) && key != 'constructor') {
      result.push(key);
    }
  }
  return result;
}

module.exports = baseKeys;


/***/ }),

/***/ 6176:
/***/ (function(module) {

/**
 * The base implementation of `_.lt` which doesn't coerce arguments.
 *
 * @private
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if `value` is less than `other`,
 *  else `false`.
 */
function baseLt(value, other) {
  return value < other;
}

module.exports = baseLt;


/***/ }),

/***/ 5128:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseEach = __webpack_require__(909),
    isArrayLike = __webpack_require__(4894);

/**
 * The base implementation of `_.map` without support for iteratee shorthands.
 *
 * @private
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns the new mapped array.
 */
function baseMap(collection, iteratee) {
  var index = -1,
      result = isArrayLike(collection) ? Array(collection.length) : [];

  baseEach(collection, function(value, key, collection) {
    result[++index] = iteratee(value, key, collection);
  });
  return result;
}

module.exports = baseMap;


/***/ }),

/***/ 3663:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseIsMatch = __webpack_require__(1799),
    getMatchData = __webpack_require__(776),
    matchesStrictComparable = __webpack_require__(7197);

/**
 * The base implementation of `_.matches` which doesn't clone `source`.
 *
 * @private
 * @param {Object} source The object of property values to match.
 * @returns {Function} Returns the new spec function.
 */
function baseMatches(source) {
  var matchData = getMatchData(source);
  if (matchData.length == 1 && matchData[0][2]) {
    return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  }
  return function(object) {
    return object === source || baseIsMatch(object, source, matchData);
  };
}

module.exports = baseMatches;


/***/ }),

/***/ 7978:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseIsEqual = __webpack_require__(270),
    get = __webpack_require__(8156),
    hasIn = __webpack_require__(631),
    isKey = __webpack_require__(8586),
    isStrictComparable = __webpack_require__(756),
    matchesStrictComparable = __webpack_require__(7197),
    toKey = __webpack_require__(7797);

/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
    COMPARE_UNORDERED_FLAG = 2;

/**
 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
 *
 * @private
 * @param {string} path The path of the property to get.
 * @param {*} srcValue The value to match.
 * @returns {Function} Returns the new spec function.
 */
function baseMatchesProperty(path, srcValue) {
  if (isKey(path) && isStrictComparable(srcValue)) {
    return matchesStrictComparable(toKey(path), srcValue);
  }
  return function(object) {
    var objValue = get(object, path);
    return (objValue === undefined && objValue === srcValue)
      ? hasIn(object, path)
      : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  };
}

module.exports = baseMatchesProperty;


/***/ }),

/***/ 6155:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var arrayMap = __webpack_require__(4932),
    baseGet = __webpack_require__(7422),
    baseIteratee = __webpack_require__(5389),
    baseMap = __webpack_require__(5128),
    baseSortBy = __webpack_require__(3937),
    baseUnary = __webpack_require__(7301),
    compareMultiple = __webpack_require__(3714),
    identity = __webpack_require__(3488),
    isArray = __webpack_require__(6449);

/**
 * The base implementation of `_.orderBy` without param guards.
 *
 * @private
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
 * @param {string[]} orders The sort orders of `iteratees`.
 * @returns {Array} Returns the new sorted array.
 */
function baseOrderBy(collection, iteratees, orders) {
  if (iteratees.length) {
    iteratees = arrayMap(iteratees, function(iteratee) {
      if (isArray(iteratee)) {
        return function(value) {
          return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
        }
      }
      return iteratee;
    });
  } else {
    iteratees = [identity];
  }

  var index = -1;
  iteratees = arrayMap(iteratees, baseUnary(baseIteratee));

  var result = baseMap(collection, function(value, key, collection) {
    var criteria = arrayMap(iteratees, function(iteratee) {
      return iteratee(value);
    });
    return { 'criteria': criteria, 'index': ++index, 'value': value };
  });

  return baseSortBy(result, function(object, other) {
    return compareMultiple(object, other, orders);
  });
}

module.exports = baseOrderBy;


/***/ }),

/***/ 7237:
/***/ (function(module) {

/**
 * The base implementation of `_.property` without support for deep paths.
 *
 * @private
 * @param {string} key The key of the property to get.
 * @returns {Function} Returns the new accessor function.
 */
function baseProperty(key) {
  return function(object) {
    return object == null ? undefined : object[key];
  };
}

module.exports = baseProperty;


/***/ }),

/***/ 7255:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGet = __webpack_require__(7422);

/**
 * A specialized version of `baseProperty` which supports deep paths.
 *
 * @private
 * @param {Array|string} path The path of the property to get.
 * @returns {Function} Returns the new accessor function.
 */
function basePropertyDeep(path) {
  return function(object) {
    return baseGet(object, path);
  };
}

module.exports = basePropertyDeep;


/***/ }),

/***/ 6151:
/***/ (function(module) {

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeCeil = Math.ceil,
    nativeMax = Math.max;

/**
 * The base implementation of `_.range` and `_.rangeRight` which doesn't
 * coerce arguments.
 *
 * @private
 * @param {number} start The start of the range.
 * @param {number} end The end of the range.
 * @param {number} step The value to increment or decrement by.
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {Array} Returns the range of numbers.
 */
function baseRange(start, end, step, fromRight) {
  var index = -1,
      length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
      result = Array(length);

  while (length--) {
    result[fromRight ? length : ++index] = start;
    start += step;
  }
  return result;
}

module.exports = baseRange;


/***/ }),

/***/ 9302:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var identity = __webpack_require__(3488),
    overRest = __webpack_require__(6757),
    setToString = __webpack_require__(2865);

/**
 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
 *
 * @private
 * @param {Function} func The function to apply a rest parameter to.
 * @param {number} [start=func.length-1] The start position of the rest parameter.
 * @returns {Function} Returns the new function.
 */
function baseRest(func, start) {
  return setToString(overRest(func, start, identity), func + '');
}

module.exports = baseRest;


/***/ }),

/***/ 9570:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var constant = __webpack_require__(7334),
    defineProperty = __webpack_require__(3243),
    identity = __webpack_require__(3488);

/**
 * The base implementation of `setToString` without support for hot loop shorting.
 *
 * @private
 * @param {Function} func The function to modify.
 * @param {Function} string The `toString` result.
 * @returns {Function} Returns `func`.
 */
var baseSetToString = !defineProperty ? identity : function(func, string) {
  return defineProperty(func, 'toString', {
    'configurable': true,
    'enumerable': false,
    'value': constant(string),
    'writable': true
  });
};

module.exports = baseSetToString;


/***/ }),

/***/ 5160:
/***/ (function(module) {

/**
 * The base implementation of `_.slice` without an iteratee call guard.
 *
 * @private
 * @param {Array} array The array to slice.
 * @param {number} [start=0] The start position.
 * @param {number} [end=array.length] The end position.
 * @returns {Array} Returns the slice of `array`.
 */
function baseSlice(array, start, end) {
  var index = -1,
      length = array.length;

  if (start < 0) {
    start = -start > length ? 0 : (length + start);
  }
  end = end > length ? length : end;
  if (end < 0) {
    end += length;
  }
  length = start > end ? 0 : ((end - start) >>> 0);
  start >>>= 0;

  var result = Array(length);
  while (++index < length) {
    result[index] = array[index + start];
  }
  return result;
}

module.exports = baseSlice;


/***/ }),

/***/ 916:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseEach = __webpack_require__(909);

/**
 * The base implementation of `_.some` without support for iteratee shorthands.
 *
 * @private
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} predicate The function invoked per iteration.
 * @returns {boolean} Returns `true` if any element passes the predicate check,
 *  else `false`.
 */
function baseSome(collection, predicate) {
  var result;

  baseEach(collection, function(value, index, collection) {
    result = predicate(value, index, collection);
    return !result;
  });
  return !!result;
}

module.exports = baseSome;


/***/ }),

/***/ 3937:
/***/ (function(module) {

/**
 * The base implementation of `_.sortBy` which uses `comparer` to define the
 * sort order of `array` and replaces criteria objects with their corresponding
 * values.
 *
 * @private
 * @param {Array} array The array to sort.
 * @param {Function} comparer The function to define sort order.
 * @returns {Array} Returns `array`.
 */
function baseSortBy(array, comparer) {
  var length = array.length;

  array.sort(comparer);
  while (length--) {
    array[length] = array[length].value;
  }
  return array;
}

module.exports = baseSortBy;


/***/ }),

/***/ 8096:
/***/ (function(module) {

/**
 * The base implementation of `_.times` without support for iteratee shorthands
 * or max array length checks.
 *
 * @private
 * @param {number} n The number of times to invoke `iteratee`.
 * @param {Function} iteratee The function invoked per iteration.
 * @returns {Array} Returns the array of results.
 */
function baseTimes(n, iteratee) {
  var index = -1,
      result = Array(n);

  while (++index < n) {
    result[index] = iteratee(index);
  }
  return result;
}

module.exports = baseTimes;


/***/ }),

/***/ 7556:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var Symbol = __webpack_require__(1873),
    arrayMap = __webpack_require__(4932),
    isArray = __webpack_require__(6449),
    isSymbol = __webpack_require__(4394);

/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
    symbolToString = symbolProto ? symbolProto.toString : undefined;

/**
 * The base implementation of `_.toString` which doesn't convert nullish
 * values to empty strings.
 *
 * @private
 * @param {*} value The value to process.
 * @returns {string} Returns the string.
 */
function baseToString(value) {
  // Exit early for strings to avoid a performance hit in some environments.
  if (typeof value == 'string') {
    return value;
  }
  if (isArray(value)) {
    // Recursively convert values (susceptible to call stack limits).
    return arrayMap(value, baseToString) + '';
  }
  if (isSymbol(value)) {
    return symbolToString ? symbolToString.call(value) : '';
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}

module.exports = baseToString;


/***/ }),

/***/ 4128:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var trimmedEndIndex = __webpack_require__(1800);

/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;

/**
 * The base implementation of `_.trim`.
 *
 * @private
 * @param {string} string The string to trim.
 * @returns {string} Returns the trimmed string.
 */
function baseTrim(string) {
  return string
    ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
    : string;
}

module.exports = baseTrim;


/***/ }),

/***/ 7301:
/***/ (function(module) {

/**
 * The base implementation of `_.unary` without support for storing metadata.
 *
 * @private
 * @param {Function} func The function to cap arguments for.
 * @returns {Function} Returns the new capped function.
 */
function baseUnary(func) {
  return function(value) {
    return func(value);
  };
}

module.exports = baseUnary;


/***/ }),

/***/ 5765:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var SetCache = __webpack_require__(8859),
    arrayIncludes = __webpack_require__(5325),
    arrayIncludesWith = __webpack_require__(9905),
    cacheHas = __webpack_require__(9219),
    createSet = __webpack_require__(4517),
    setToArray = __webpack_require__(4247);

/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;

/**
 * The base implementation of `_.uniqBy` without support for iteratee shorthands.
 *
 * @private
 * @param {Array} array The array to inspect.
 * @param {Function} [iteratee] The iteratee invoked per element.
 * @param {Function} [comparator] The comparator invoked per element.
 * @returns {Array} Returns the new duplicate free array.
 */
function baseUniq(array, iteratee, comparator) {
  var index = -1,
      includes = arrayIncludes,
      length = array.length,
      isCommon = true,
      result = [],
      seen = result;

  if (comparator) {
    isCommon = false;
    includes = arrayIncludesWith;
  }
  else if (length >= LARGE_ARRAY_SIZE) {
    var set = iteratee ? null : createSet(array);
    if (set) {
      return setToArray(set);
    }
    isCommon = false;
    includes = cacheHas;
    seen = new SetCache;
  }
  else {
    seen = iteratee ? [] : result;
  }
  outer:
  while (++index < length) {
    var value = array[index],
        computed = iteratee ? iteratee(value) : value;

    value = (comparator || value !== 0) ? value : 0;
    if (isCommon && computed === computed) {
      var seenIndex = seen.length;
      while (seenIndex--) {
        if (seen[seenIndex] === computed) {
          continue outer;
        }
      }
      if (iteratee) {
        seen.push(computed);
      }
      result.push(value);
    }
    else if (!includes(seen, computed, comparator)) {
      if (seen !== result) {
        seen.push(computed);
      }
      result.push(value);
    }
  }
  return result;
}

module.exports = baseUniq;


/***/ }),

/***/ 9219:
/***/ (function(module) {

/**
 * Checks if a `cache` value for `key` exists.
 *
 * @private
 * @param {Object} cache The cache to query.
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function cacheHas(cache, key) {
  return cache.has(key);
}

module.exports = cacheHas;


/***/ }),

/***/ 1769:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isArray = __webpack_require__(6449),
    isKey = __webpack_require__(8586),
    stringToPath = __webpack_require__(1802),
    toString = __webpack_require__(3222);

/**
 * Casts `value` to a path array if it's not one.
 *
 * @private
 * @param {*} value The value to inspect.
 * @param {Object} [object] The object to query keys on.
 * @returns {Array} Returns the cast property path array.
 */
function castPath(value, object) {
  if (isArray(value)) {
    return value;
  }
  return isKey(value, object) ? [value] : stringToPath(toString(value));
}

module.exports = castPath;


/***/ }),

/***/ 8754:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseSlice = __webpack_require__(5160);

/**
 * Casts `array` to a slice if it's needed.
 *
 * @private
 * @param {Array} array The array to inspect.
 * @param {number} start The start position.
 * @param {number} [end=array.length] The end position.
 * @returns {Array} Returns the cast slice.
 */
function castSlice(array, start, end) {
  var length = array.length;
  end = end === undefined ? length : end;
  return (!start && end >= length) ? array : baseSlice(array, start, end);
}

module.exports = castSlice;


/***/ }),

/***/ 3730:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isSymbol = __webpack_require__(4394);

/**
 * Compares values to sort them in ascending order.
 *
 * @private
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {number} Returns the sort order indicator for `value`.
 */
function compareAscending(value, other) {
  if (value !== other) {
    var valIsDefined = value !== undefined,
        valIsNull = value === null,
        valIsReflexive = value === value,
        valIsSymbol = isSymbol(value);

    var othIsDefined = other !== undefined,
        othIsNull = other === null,
        othIsReflexive = other === other,
        othIsSymbol = isSymbol(other);

    if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
        (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
        (valIsNull && othIsDefined && othIsReflexive) ||
        (!valIsDefined && othIsReflexive) ||
        !valIsReflexive) {
      return 1;
    }
    if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
        (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
        (othIsNull && valIsDefined && valIsReflexive) ||
        (!othIsDefined && valIsReflexive) ||
        !othIsReflexive) {
      return -1;
    }
  }
  return 0;
}

module.exports = compareAscending;


/***/ }),

/***/ 3714:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var compareAscending = __webpack_require__(3730);

/**
 * Used by `_.orderBy` to compare multiple properties of a value to another
 * and stable sort them.
 *
 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
 * specify an order of "desc" for descending or "asc" for ascending sort order
 * of corresponding values.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {boolean[]|string[]} orders The order to sort by for each property.
 * @returns {number} Returns the sort order indicator for `object`.
 */
function compareMultiple(object, other, orders) {
  var index = -1,
      objCriteria = object.criteria,
      othCriteria = other.criteria,
      length = objCriteria.length,
      ordersLength = orders.length;

  while (++index < length) {
    var result = compareAscending(objCriteria[index], othCriteria[index]);
    if (result) {
      if (index >= ordersLength) {
        return result;
      }
      var order = orders[index];
      return result * (order == 'desc' ? -1 : 1);
    }
  }
  // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  // that causes it, under certain circumstances, to provide the same value for
  // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  // for more details.
  //
  // This also ensures a stable sort in V8 and other engines.
  // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  return object.index - other.index;
}

module.exports = compareMultiple;


/***/ }),

/***/ 5481:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var root = __webpack_require__(9325);

/** Used to detect overreaching core-js shims. */
var coreJsData = root['__core-js_shared__'];

module.exports = coreJsData;


/***/ }),

/***/ 8329:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isArrayLike = __webpack_require__(4894);

/**
 * Creates a `baseEach` or `baseEachRight` function.
 *
 * @private
 * @param {Function} eachFunc The function to iterate over a collection.
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {Function} Returns the new base function.
 */
function createBaseEach(eachFunc, fromRight) {
  return function(collection, iteratee) {
    if (collection == null) {
      return collection;
    }
    if (!isArrayLike(collection)) {
      return eachFunc(collection, iteratee);
    }
    var length = collection.length,
        index = fromRight ? length : -1,
        iterable = Object(collection);

    while ((fromRight ? index-- : ++index < length)) {
      if (iteratee(iterable[index], index, iterable) === false) {
        break;
      }
    }
    return collection;
  };
}

module.exports = createBaseEach;


/***/ }),

/***/ 3221:
/***/ (function(module) {

/**
 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
 *
 * @private
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {Function} Returns the new base function.
 */
function createBaseFor(fromRight) {
  return function(object, iteratee, keysFunc) {
    var index = -1,
        iterable = Object(object),
        props = keysFunc(object),
        length = props.length;

    while (length--) {
      var key = props[fromRight ? length : ++index];
      if (iteratee(iterable[key], key, iterable) === false) {
        break;
      }
    }
    return object;
  };
}

module.exports = createBaseFor;


/***/ }),

/***/ 2507:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var castSlice = __webpack_require__(8754),
    hasUnicode = __webpack_require__(9698),
    stringToArray = __webpack_require__(3912),
    toString = __webpack_require__(3222);

/**
 * Creates a function like `_.lowerFirst`.
 *
 * @private
 * @param {string} methodName The name of the `String` case method to use.
 * @returns {Function} Returns the new case function.
 */
function createCaseFirst(methodName) {
  return function(string) {
    string = toString(string);

    var strSymbols = hasUnicode(string)
      ? stringToArray(string)
      : undefined;

    var chr = strSymbols
      ? strSymbols[0]
      : string.charAt(0);

    var trailing = strSymbols
      ? castSlice(strSymbols, 1).join('')
      : string.slice(1);

    return chr[methodName]() + trailing;
  };
}

module.exports = createCaseFirst;


/***/ }),

/***/ 2006:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseIteratee = __webpack_require__(5389),
    isArrayLike = __webpack_require__(4894),
    keys = __webpack_require__(5950);

/**
 * Creates a `_.find` or `_.findLast` function.
 *
 * @private
 * @param {Function} findIndexFunc The function to find the collection index.
 * @returns {Function} Returns the new find function.
 */
function createFind(findIndexFunc) {
  return function(collection, predicate, fromIndex) {
    var iterable = Object(collection);
    if (!isArrayLike(collection)) {
      var iteratee = baseIteratee(predicate, 3);
      collection = keys(collection);
      predicate = function(key) { return iteratee(iterable[key], key, iterable); };
    }
    var index = findIndexFunc(collection, predicate, fromIndex);
    return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  };
}

module.exports = createFind;


/***/ }),

/***/ 5508:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseRange = __webpack_require__(6151),
    isIterateeCall = __webpack_require__(6800),
    toFinite = __webpack_require__(7400);

/**
 * Creates a `_.range` or `_.rangeRight` function.
 *
 * @private
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {Function} Returns the new range function.
 */
function createRange(fromRight) {
  return function(start, end, step) {
    if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
      end = step = undefined;
    }
    // Ensure the sign of `-0` is preserved.
    start = toFinite(start);
    if (end === undefined) {
      end = start;
      start = 0;
    } else {
      end = toFinite(end);
    }
    step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
    return baseRange(start, end, step, fromRight);
  };
}

module.exports = createRange;


/***/ }),

/***/ 4517:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var Set = __webpack_require__(6545),
    noop = __webpack_require__(3950),
    setToArray = __webpack_require__(4247);

/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

/**
 * Creates a set object of `values`.
 *
 * @private
 * @param {Array} values The values to add to the set.
 * @returns {Object} Returns the new set.
 */
var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  return new Set(values);
};

module.exports = createSet;


/***/ }),

/***/ 3243:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getNative = __webpack_require__(6110);

var defineProperty = (function() {
  try {
    var func = getNative(Object, 'defineProperty');
    func({}, '', {});
    return func;
  } catch (e) {}
}());

module.exports = defineProperty;


/***/ }),

/***/ 5911:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var SetCache = __webpack_require__(8859),
    arraySome = __webpack_require__(4248),
    cacheHas = __webpack_require__(9219);

/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
    COMPARE_UNORDERED_FLAG = 2;

/**
 * A specialized version of `baseIsEqualDeep` for arrays with support for
 * partial deep comparisons.
 *
 * @private
 * @param {Array} array The array to compare.
 * @param {Array} other The other array to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `array` and `other` objects.
 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
 */
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
      arrLength = array.length,
      othLength = other.length;

  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
    return false;
  }
  // Check that cyclic values are equal.
  var arrStacked = stack.get(array);
  var othStacked = stack.get(other);
  if (arrStacked && othStacked) {
    return arrStacked == other && othStacked == array;
  }
  var index = -1,
      result = true,
      seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;

  stack.set(array, other);
  stack.set(other, array);

  // Ignore non-index properties.
  while (++index < arrLength) {
    var arrValue = array[index],
        othValue = other[index];

    if (customizer) {
      var compared = isPartial
        ? customizer(othValue, arrValue, index, other, array, stack)
        : customizer(arrValue, othValue, index, array, other, stack);
    }
    if (compared !== undefined) {
      if (compared) {
        continue;
      }
      result = false;
      break;
    }
    // Recursively compare arrays (susceptible to call stack limits).
    if (seen) {
      if (!arraySome(other, function(othValue, othIndex) {
            if (!cacheHas(seen, othIndex) &&
                (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
              return seen.push(othIndex);
            }
          })) {
        result = false;
        break;
      }
    } else if (!(
          arrValue === othValue ||
            equalFunc(arrValue, othValue, bitmask, customizer, stack)
        )) {
      result = false;
      break;
    }
  }
  stack['delete'](array);
  stack['delete'](other);
  return result;
}

module.exports = equalArrays;


/***/ }),

/***/ 1986:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var Symbol = __webpack_require__(1873),
    Uint8Array = __webpack_require__(7828),
    eq = __webpack_require__(5288),
    equalArrays = __webpack_require__(5911),
    mapToArray = __webpack_require__(317),
    setToArray = __webpack_require__(4247);

/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
    COMPARE_UNORDERED_FLAG = 2;

/** `Object#toString` result references. */
var boolTag = '[object Boolean]',
    dateTag = '[object Date]',
    errorTag = '[object Error]',
    mapTag = '[object Map]',
    numberTag = '[object Number]',
    regexpTag = '[object RegExp]',
    setTag = '[object Set]',
    stringTag = '[object String]',
    symbolTag = '[object Symbol]';

var arrayBufferTag = '[object ArrayBuffer]',
    dataViewTag = '[object DataView]';

/** Used to convert symbols to primitives and strings. */
var symbolProto = Symbol ? Symbol.prototype : undefined,
    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;

/**
 * A specialized version of `baseIsEqualDeep` for comparing objects of
 * the same `toStringTag`.
 *
 * **Note:** This function only supports comparing values with tags of
 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {string} tag The `toStringTag` of the objects to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  switch (tag) {
    case dataViewTag:
      if ((object.byteLength != other.byteLength) ||
          (object.byteOffset != other.byteOffset)) {
        return false;
      }
      object = object.buffer;
      other = other.buffer;

    case arrayBufferTag:
      if ((object.byteLength != other.byteLength) ||
          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
        return false;
      }
      return true;

    case boolTag:
    case dateTag:
    case numberTag:
      // Coerce booleans to `1` or `0` and dates to milliseconds.
      // Invalid dates are coerced to `NaN`.
      return eq(+object, +other);

    case errorTag:
      return object.name == other.name && object.message == other.message;

    case regexpTag:
    case stringTag:
      // Coerce regexes to strings and treat strings, primitives and objects,
      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
      // for more details.
      return object == (other + '');

    case mapTag:
      var convert = mapToArray;

    case setTag:
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
      convert || (convert = setToArray);

      if (object.size != other.size && !isPartial) {
        return false;
      }
      // Assume cyclic values are equal.
      var stacked = stack.get(object);
      if (stacked) {
        return stacked == other;
      }
      bitmask |= COMPARE_UNORDERED_FLAG;

      // Recursively compare objects (susceptible to call stack limits).
      stack.set(object, other);
      var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
      stack['delete'](object);
      return result;

    case symbolTag:
      if (symbolValueOf) {
        return symbolValueOf.call(object) == symbolValueOf.call(other);
      }
  }
  return false;
}

module.exports = equalByTag;


/***/ }),

/***/ 689:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getAllKeys = __webpack_require__(2);

/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1;

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * A specialized version of `baseIsEqualDeep` for objects with support for
 * partial deep comparisons.
 *
 * @private
 * @param {Object} object The object to compare.
 * @param {Object} other The other object to compare.
 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
 * @param {Function} customizer The function to customize comparisons.
 * @param {Function} equalFunc The function to determine equivalents of values.
 * @param {Object} stack Tracks traversed `object` and `other` objects.
 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
 */
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
      objProps = getAllKeys(object),
      objLength = objProps.length,
      othProps = getAllKeys(other),
      othLength = othProps.length;

  if (objLength != othLength && !isPartial) {
    return false;
  }
  var index = objLength;
  while (index--) {
    var key = objProps[index];
    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
      return false;
    }
  }
  // Check that cyclic values are equal.
  var objStacked = stack.get(object);
  var othStacked = stack.get(other);
  if (objStacked && othStacked) {
    return objStacked == other && othStacked == object;
  }
  var result = true;
  stack.set(object, other);
  stack.set(other, object);

  var skipCtor = isPartial;
  while (++index < objLength) {
    key = objProps[index];
    var objValue = object[key],
        othValue = other[key];

    if (customizer) {
      var compared = isPartial
        ? customizer(othValue, objValue, key, other, object, stack)
        : customizer(objValue, othValue, key, object, other, stack);
    }
    // Recursively compare objects (susceptible to call stack limits).
    if (!(compared === undefined
          ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
          : compared
        )) {
      result = false;
      break;
    }
    skipCtor || (skipCtor = key == 'constructor');
  }
  if (result && !skipCtor) {
    var objCtor = object.constructor,
        othCtor = other.constructor;

    // Non `Object` object instances with different constructors are not equal.
    if (objCtor != othCtor &&
        ('constructor' in object && 'constructor' in other) &&
        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
          typeof othCtor == 'function' && othCtor instanceof othCtor)) {
      result = false;
    }
  }
  stack['delete'](object);
  stack['delete'](other);
  return result;
}

module.exports = equalObjects;


/***/ }),

/***/ 4840:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;

module.exports = freeGlobal;


/***/ }),

/***/ 2:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGetAllKeys = __webpack_require__(2199),
    getSymbols = __webpack_require__(4664),
    keys = __webpack_require__(5950);

/**
 * Creates an array of own enumerable property names and symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names and symbols.
 */
function getAllKeys(object) {
  return baseGetAllKeys(object, keys, getSymbols);
}

module.exports = getAllKeys;


/***/ }),

/***/ 2651:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isKeyable = __webpack_require__(4218);

/**
 * Gets the data for `map`.
 *
 * @private
 * @param {Object} map The map to query.
 * @param {string} key The reference key.
 * @returns {*} Returns the map data.
 */
function getMapData(map, key) {
  var data = map.__data__;
  return isKeyable(key)
    ? data[typeof key == 'string' ? 'string' : 'hash']
    : data.map;
}

module.exports = getMapData;


/***/ }),

/***/ 776:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isStrictComparable = __webpack_require__(756),
    keys = __webpack_require__(5950);

/**
 * Gets the property names, values, and compare flags of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the match data of `object`.
 */
function getMatchData(object) {
  var result = keys(object),
      length = result.length;

  while (length--) {
    var key = result[length],
        value = object[key];

    result[length] = [key, value, isStrictComparable(value)];
  }
  return result;
}

module.exports = getMatchData;


/***/ }),

/***/ 6110:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseIsNative = __webpack_require__(5083),
    getValue = __webpack_require__(392);

/**
 * Gets the native function at `key` of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {string} key The key of the method to get.
 * @returns {*} Returns the function if it's native, else `undefined`.
 */
function getNative(object, key) {
  var value = getValue(object, key);
  return baseIsNative(value) ? value : undefined;
}

module.exports = getNative;


/***/ }),

/***/ 8879:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var overArg = __webpack_require__(4335);

/** Built-in value references. */
var getPrototype = overArg(Object.getPrototypeOf, Object);

module.exports = getPrototype;


/***/ }),

/***/ 659:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var Symbol = __webpack_require__(1873);

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;

/**
 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the raw `toStringTag`.
 */
function getRawTag(value) {
  var isOwn = hasOwnProperty.call(value, symToStringTag),
      tag = value[symToStringTag];

  try {
    value[symToStringTag] = undefined;
    var unmasked = true;
  } catch (e) {}

  var result = nativeObjectToString.call(value);
  if (unmasked) {
    if (isOwn) {
      value[symToStringTag] = tag;
    } else {
      delete value[symToStringTag];
    }
  }
  return result;
}

module.exports = getRawTag;


/***/ }),

/***/ 4664:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var arrayFilter = __webpack_require__(9770),
    stubArray = __webpack_require__(3345);

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeGetSymbols = Object.getOwnPropertySymbols;

/**
 * Creates an array of the own enumerable symbols of `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of symbols.
 */
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  if (object == null) {
    return [];
  }
  object = Object(object);
  return arrayFilter(nativeGetSymbols(object), function(symbol) {
    return propertyIsEnumerable.call(object, symbol);
  });
};

module.exports = getSymbols;


/***/ }),

/***/ 5861:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var DataView = __webpack_require__(5580),
    Map = __webpack_require__(8223),
    Promise = __webpack_require__(2804),
    Set = __webpack_require__(6545),
    WeakMap = __webpack_require__(8303),
    baseGetTag = __webpack_require__(2552),
    toSource = __webpack_require__(2235);

/** `Object#toString` result references. */
var mapTag = '[object Map]',
    objectTag = '[object Object]',
    promiseTag = '[object Promise]',
    setTag = '[object Set]',
    weakMapTag = '[object WeakMap]';

var dataViewTag = '[object DataView]';

/** Used to detect maps, sets, and weakmaps. */
var dataViewCtorString = toSource(DataView),
    mapCtorString = toSource(Map),
    promiseCtorString = toSource(Promise),
    setCtorString = toSource(Set),
    weakMapCtorString = toSource(WeakMap);

/**
 * Gets the `toStringTag` of `value`.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */
var getTag = baseGetTag;

// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
    (Map && getTag(new Map) != mapTag) ||
    (Promise && getTag(Promise.resolve()) != promiseTag) ||
    (Set && getTag(new Set) != setTag) ||
    (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  getTag = function(value) {
    var result = baseGetTag(value),
        Ctor = result == objectTag ? value.constructor : undefined,
        ctorString = Ctor ? toSource(Ctor) : '';

    if (ctorString) {
      switch (ctorString) {
        case dataViewCtorString: return dataViewTag;
        case mapCtorString: return mapTag;
        case promiseCtorString: return promiseTag;
        case setCtorString: return setTag;
        case weakMapCtorString: return weakMapTag;
      }
    }
    return result;
  };
}

module.exports = getTag;


/***/ }),

/***/ 392:
/***/ (function(module) {

/**
 * Gets the value at `key` of `object`.
 *
 * @private
 * @param {Object} [object] The object to query.
 * @param {string} key The key of the property to get.
 * @returns {*} Returns the property value.
 */
function getValue(object, key) {
  return object == null ? undefined : object[key];
}

module.exports = getValue;


/***/ }),

/***/ 9326:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var castPath = __webpack_require__(1769),
    isArguments = __webpack_require__(2428),
    isArray = __webpack_require__(6449),
    isIndex = __webpack_require__(361),
    isLength = __webpack_require__(294),
    toKey = __webpack_require__(7797);

/**
 * Checks if `path` exists on `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Array|string} path The path to check.
 * @param {Function} hasFunc The function to check properties.
 * @returns {boolean} Returns `true` if `path` exists, else `false`.
 */
function hasPath(object, path, hasFunc) {
  path = castPath(path, object);

  var index = -1,
      length = path.length,
      result = false;

  while (++index < length) {
    var key = toKey(path[index]);
    if (!(result = object != null && hasFunc(object, key))) {
      break;
    }
    object = object[key];
  }
  if (result || ++index != length) {
    return result;
  }
  length = object == null ? 0 : object.length;
  return !!length && isLength(length) && isIndex(key, length) &&
    (isArray(object) || isArguments(object));
}

module.exports = hasPath;


/***/ }),

/***/ 9698:
/***/ (function(module) {

/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
    rsComboMarksRange = '\\u0300-\\u036f',
    reComboHalfMarksRange = '\\ufe20-\\ufe2f',
    rsComboSymbolsRange = '\\u20d0-\\u20ff',
    rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
    rsVarRange = '\\ufe0e\\ufe0f';

/** Used to compose unicode capture groups. */
var rsZWJ = '\\u200d';

/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange  + rsComboRange + rsVarRange + ']');

/**
 * Checks if `string` contains Unicode symbols.
 *
 * @private
 * @param {string} string The string to inspect.
 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
 */
function hasUnicode(string) {
  return reHasUnicode.test(string);
}

module.exports = hasUnicode;


/***/ }),

/***/ 2032:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var nativeCreate = __webpack_require__(1042);

/**
 * Removes all key-value entries from the hash.
 *
 * @private
 * @name clear
 * @memberOf Hash
 */
function hashClear() {
  this.__data__ = nativeCreate ? nativeCreate(null) : {};
  this.size = 0;
}

module.exports = hashClear;


/***/ }),

/***/ 3862:
/***/ (function(module) {

/**
 * Removes `key` and its value from the hash.
 *
 * @private
 * @name delete
 * @memberOf Hash
 * @param {Object} hash The hash to modify.
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function hashDelete(key) {
  var result = this.has(key) && delete this.__data__[key];
  this.size -= result ? 1 : 0;
  return result;
}

module.exports = hashDelete;


/***/ }),

/***/ 6721:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var nativeCreate = __webpack_require__(1042);

/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Gets the hash value for `key`.
 *
 * @private
 * @name get
 * @memberOf Hash
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function hashGet(key) {
  var data = this.__data__;
  if (nativeCreate) {
    var result = data[key];
    return result === HASH_UNDEFINED ? undefined : result;
  }
  return hasOwnProperty.call(data, key) ? data[key] : undefined;
}

module.exports = hashGet;


/***/ }),

/***/ 2749:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var nativeCreate = __webpack_require__(1042);

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Checks if a hash value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf Hash
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function hashHas(key) {
  var data = this.__data__;
  return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}

module.exports = hashHas;


/***/ }),

/***/ 5749:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var nativeCreate = __webpack_require__(1042);

/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';

/**
 * Sets the hash `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf Hash
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the hash instance.
 */
function hashSet(key, value) {
  var data = this.__data__;
  this.size += this.has(key) ? 0 : 1;
  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  return this;
}

module.exports = hashSet;


/***/ }),

/***/ 5891:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var Symbol = __webpack_require__(1873),
    isArguments = __webpack_require__(2428),
    isArray = __webpack_require__(6449);

/** Built-in value references. */
var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;

/**
 * Checks if `value` is a flattenable `arguments` object or array.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
 */
function isFlattenable(value) {
  return isArray(value) || isArguments(value) ||
    !!(spreadableSymbol && value && value[spreadableSymbol]);
}

module.exports = isFlattenable;


/***/ }),

/***/ 361:
/***/ (function(module) {

/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/** Used to detect unsigned integer values. */
var reIsUint = /^(?:0|[1-9]\d*)$/;

/**
 * Checks if `value` is a valid array-like index.
 *
 * @private
 * @param {*} value The value to check.
 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
 */
function isIndex(value, length) {
  var type = typeof value;
  length = length == null ? MAX_SAFE_INTEGER : length;

  return !!length &&
    (type == 'number' ||
      (type != 'symbol' && reIsUint.test(value))) &&
        (value > -1 && value % 1 == 0 && value < length);
}

module.exports = isIndex;


/***/ }),

/***/ 6800:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var eq = __webpack_require__(5288),
    isArrayLike = __webpack_require__(4894),
    isIndex = __webpack_require__(361),
    isObject = __webpack_require__(3805);

/**
 * Checks if the given arguments are from an iteratee call.
 *
 * @private
 * @param {*} value The potential iteratee value argument.
 * @param {*} index The potential iteratee index or key argument.
 * @param {*} object The potential iteratee object argument.
 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
 *  else `false`.
 */
function isIterateeCall(value, index, object) {
  if (!isObject(object)) {
    return false;
  }
  var type = typeof index;
  if (type == 'number'
        ? (isArrayLike(object) && isIndex(index, object.length))
        : (type == 'string' && index in object)
      ) {
    return eq(object[index], value);
  }
  return false;
}

module.exports = isIterateeCall;


/***/ }),

/***/ 8586:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isArray = __webpack_require__(6449),
    isSymbol = __webpack_require__(4394);

/** Used to match property names within property paths. */
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
    reIsPlainProp = /^\w*$/;

/**
 * Checks if `value` is a property name and not a property path.
 *
 * @private
 * @param {*} value The value to check.
 * @param {Object} [object] The object to query keys on.
 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
 */
function isKey(value, object) {
  if (isArray(value)) {
    return false;
  }
  var type = typeof value;
  if (type == 'number' || type == 'symbol' || type == 'boolean' ||
      value == null || isSymbol(value)) {
    return true;
  }
  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
    (object != null && value in Object(object));
}

module.exports = isKey;


/***/ }),

/***/ 4218:
/***/ (function(module) {

/**
 * Checks if `value` is suitable for use as unique object key.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
 */
function isKeyable(value) {
  var type = typeof value;
  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
    ? (value !== '__proto__')
    : (value === null);
}

module.exports = isKeyable;


/***/ }),

/***/ 7296:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var coreJsData = __webpack_require__(5481);

/** Used to detect methods masquerading as native. */
var maskSrcKey = (function() {
  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  return uid ? ('Symbol(src)_1.' + uid) : '';
}());

/**
 * Checks if `func` has its source masked.
 *
 * @private
 * @param {Function} func The function to check.
 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
 */
function isMasked(func) {
  return !!maskSrcKey && (maskSrcKey in func);
}

module.exports = isMasked;


/***/ }),

/***/ 5527:
/***/ (function(module) {

/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Checks if `value` is likely a prototype object.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
 */
function isPrototype(value) {
  var Ctor = value && value.constructor,
      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;

  return value === proto;
}

module.exports = isPrototype;


/***/ }),

/***/ 756:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isObject = __webpack_require__(3805);

/**
 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
 *
 * @private
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` if suitable for strict
 *  equality comparisons, else `false`.
 */
function isStrictComparable(value) {
  return value === value && !isObject(value);
}

module.exports = isStrictComparable;


/***/ }),

/***/ 3702:
/***/ (function(module) {

/**
 * Removes all key-value entries from the list cache.
 *
 * @private
 * @name clear
 * @memberOf ListCache
 */
function listCacheClear() {
  this.__data__ = [];
  this.size = 0;
}

module.exports = listCacheClear;


/***/ }),

/***/ 80:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var assocIndexOf = __webpack_require__(6025);

/** Used for built-in method references. */
var arrayProto = Array.prototype;

/** Built-in value references. */
var splice = arrayProto.splice;

/**
 * Removes `key` and its value from the list cache.
 *
 * @private
 * @name delete
 * @memberOf ListCache
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function listCacheDelete(key) {
  var data = this.__data__,
      index = assocIndexOf(data, key);

  if (index < 0) {
    return false;
  }
  var lastIndex = data.length - 1;
  if (index == lastIndex) {
    data.pop();
  } else {
    splice.call(data, index, 1);
  }
  --this.size;
  return true;
}

module.exports = listCacheDelete;


/***/ }),

/***/ 4739:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var assocIndexOf = __webpack_require__(6025);

/**
 * Gets the list cache value for `key`.
 *
 * @private
 * @name get
 * @memberOf ListCache
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function listCacheGet(key) {
  var data = this.__data__,
      index = assocIndexOf(data, key);

  return index < 0 ? undefined : data[index][1];
}

module.exports = listCacheGet;


/***/ }),

/***/ 8655:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var assocIndexOf = __webpack_require__(6025);

/**
 * Checks if a list cache value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf ListCache
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function listCacheHas(key) {
  return assocIndexOf(this.__data__, key) > -1;
}

module.exports = listCacheHas;


/***/ }),

/***/ 1175:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var assocIndexOf = __webpack_require__(6025);

/**
 * Sets the list cache `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf ListCache
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the list cache instance.
 */
function listCacheSet(key, value) {
  var data = this.__data__,
      index = assocIndexOf(data, key);

  if (index < 0) {
    ++this.size;
    data.push([key, value]);
  } else {
    data[index][1] = value;
  }
  return this;
}

module.exports = listCacheSet;


/***/ }),

/***/ 3040:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var Hash = __webpack_require__(1549),
    ListCache = __webpack_require__(79),
    Map = __webpack_require__(8223);

/**
 * Removes all key-value entries from the map.
 *
 * @private
 * @name clear
 * @memberOf MapCache
 */
function mapCacheClear() {
  this.size = 0;
  this.__data__ = {
    'hash': new Hash,
    'map': new (Map || ListCache),
    'string': new Hash
  };
}

module.exports = mapCacheClear;


/***/ }),

/***/ 7670:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getMapData = __webpack_require__(2651);

/**
 * Removes `key` and its value from the map.
 *
 * @private
 * @name delete
 * @memberOf MapCache
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function mapCacheDelete(key) {
  var result = getMapData(this, key)['delete'](key);
  this.size -= result ? 1 : 0;
  return result;
}

module.exports = mapCacheDelete;


/***/ }),

/***/ 289:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getMapData = __webpack_require__(2651);

/**
 * Gets the map value for `key`.
 *
 * @private
 * @name get
 * @memberOf MapCache
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function mapCacheGet(key) {
  return getMapData(this, key).get(key);
}

module.exports = mapCacheGet;


/***/ }),

/***/ 4509:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getMapData = __webpack_require__(2651);

/**
 * Checks if a map value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf MapCache
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function mapCacheHas(key) {
  return getMapData(this, key).has(key);
}

module.exports = mapCacheHas;


/***/ }),

/***/ 2949:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getMapData = __webpack_require__(2651);

/**
 * Sets the map `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf MapCache
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the map cache instance.
 */
function mapCacheSet(key, value) {
  var data = getMapData(this, key),
      size = data.size;

  data.set(key, value);
  this.size += data.size == size ? 0 : 1;
  return this;
}

module.exports = mapCacheSet;


/***/ }),

/***/ 317:
/***/ (function(module) {

/**
 * Converts `map` to its key-value pairs.
 *
 * @private
 * @param {Object} map The map to convert.
 * @returns {Array} Returns the key-value pairs.
 */
function mapToArray(map) {
  var index = -1,
      result = Array(map.size);

  map.forEach(function(value, key) {
    result[++index] = [key, value];
  });
  return result;
}

module.exports = mapToArray;


/***/ }),

/***/ 7197:
/***/ (function(module) {

/**
 * A specialized version of `matchesProperty` for source values suitable
 * for strict equality comparisons, i.e. `===`.
 *
 * @private
 * @param {string} key The key of the property to get.
 * @param {*} srcValue The value to match.
 * @returns {Function} Returns the new spec function.
 */
function matchesStrictComparable(key, srcValue) {
  return function(object) {
    if (object == null) {
      return false;
    }
    return object[key] === srcValue &&
      (srcValue !== undefined || (key in Object(object)));
  };
}

module.exports = matchesStrictComparable;


/***/ }),

/***/ 2224:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var memoize = __webpack_require__(104);

/** Used as the maximum memoize cache size. */
var MAX_MEMOIZE_SIZE = 500;

/**
 * A specialized version of `_.memoize` which clears the memoized function's
 * cache when it exceeds `MAX_MEMOIZE_SIZE`.
 *
 * @private
 * @param {Function} func The function to have its output memoized.
 * @returns {Function} Returns the new memoized function.
 */
function memoizeCapped(func) {
  var result = memoize(func, function(key) {
    if (cache.size === MAX_MEMOIZE_SIZE) {
      cache.clear();
    }
    return key;
  });

  var cache = result.cache;
  return result;
}

module.exports = memoizeCapped;


/***/ }),

/***/ 1042:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var getNative = __webpack_require__(6110);

/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');

module.exports = nativeCreate;


/***/ }),

/***/ 3650:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var overArg = __webpack_require__(4335);

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeKeys = overArg(Object.keys, Object);

module.exports = nativeKeys;


/***/ }),

/***/ 6009:
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
var freeGlobal = __webpack_require__(4840);

/** Detect free variable `exports`. */
var freeExports =  true && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Detect free variable `process` from Node.js. */
var freeProcess = moduleExports && freeGlobal.process;

/** Used to access faster Node.js helpers. */
var nodeUtil = (function() {
  try {
    // Use `util.types` for Node.js 10+.
    var types = freeModule && freeModule.require && freeModule.require('util').types;

    if (types) {
      return types;
    }

    // Legacy `process.binding('util')` for Node.js < 10.
    return freeProcess && freeProcess.binding && freeProcess.binding('util');
  } catch (e) {}
}());

module.exports = nodeUtil;


/***/ }),

/***/ 9350:
/***/ (function(module) {

/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/**
 * Converts `value` to a string using `Object.prototype.toString`.
 *
 * @private
 * @param {*} value The value to convert.
 * @returns {string} Returns the converted string.
 */
function objectToString(value) {
  return nativeObjectToString.call(value);
}

module.exports = objectToString;


/***/ }),

/***/ 4335:
/***/ (function(module) {

/**
 * Creates a unary function that invokes `func` with its argument transformed.
 *
 * @private
 * @param {Function} func The function to wrap.
 * @param {Function} transform The argument transform.
 * @returns {Function} Returns the new function.
 */
function overArg(func, transform) {
  return function(arg) {
    return func(transform(arg));
  };
}

module.exports = overArg;


/***/ }),

/***/ 6757:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var apply = __webpack_require__(1033);

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;

/**
 * A specialized version of `baseRest` which transforms the rest array.
 *
 * @private
 * @param {Function} func The function to apply a rest parameter to.
 * @param {number} [start=func.length-1] The start position of the rest parameter.
 * @param {Function} transform The rest array transform.
 * @returns {Function} Returns the new function.
 */
function overRest(func, start, transform) {
  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  return function() {
    var args = arguments,
        index = -1,
        length = nativeMax(args.length - start, 0),
        array = Array(length);

    while (++index < length) {
      array[index] = args[start + index];
    }
    index = -1;
    var otherArgs = Array(start + 1);
    while (++index < start) {
      otherArgs[index] = args[index];
    }
    otherArgs[start] = transform(array);
    return apply(func, this, otherArgs);
  };
}

module.exports = overRest;


/***/ }),

/***/ 9325:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var freeGlobal = __webpack_require__(4840);

/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();

module.exports = root;


/***/ }),

/***/ 1380:
/***/ (function(module) {

/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';

/**
 * Adds `value` to the array cache.
 *
 * @private
 * @name add
 * @memberOf SetCache
 * @alias push
 * @param {*} value The value to cache.
 * @returns {Object} Returns the cache instance.
 */
function setCacheAdd(value) {
  this.__data__.set(value, HASH_UNDEFINED);
  return this;
}

module.exports = setCacheAdd;


/***/ }),

/***/ 1459:
/***/ (function(module) {

/**
 * Checks if `value` is in the array cache.
 *
 * @private
 * @name has
 * @memberOf SetCache
 * @param {*} value The value to search for.
 * @returns {number} Returns `true` if `value` is found, else `false`.
 */
function setCacheHas(value) {
  return this.__data__.has(value);
}

module.exports = setCacheHas;


/***/ }),

/***/ 4247:
/***/ (function(module) {

/**
 * Converts `set` to an array of its values.
 *
 * @private
 * @param {Object} set The set to convert.
 * @returns {Array} Returns the values.
 */
function setToArray(set) {
  var index = -1,
      result = Array(set.size);

  set.forEach(function(value) {
    result[++index] = value;
  });
  return result;
}

module.exports = setToArray;


/***/ }),

/***/ 2865:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseSetToString = __webpack_require__(9570),
    shortOut = __webpack_require__(1811);

/**
 * Sets the `toString` method of `func` to return `string`.
 *
 * @private
 * @param {Function} func The function to modify.
 * @param {Function} string The `toString` result.
 * @returns {Function} Returns `func`.
 */
var setToString = shortOut(baseSetToString);

module.exports = setToString;


/***/ }),

/***/ 1811:
/***/ (function(module) {

/** Used to detect hot functions by number of calls within a span of milliseconds. */
var HOT_COUNT = 800,
    HOT_SPAN = 16;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeNow = Date.now;

/**
 * Creates a function that'll short out and invoke `identity` instead
 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
 * milliseconds.
 *
 * @private
 * @param {Function} func The function to restrict.
 * @returns {Function} Returns the new shortable function.
 */
function shortOut(func) {
  var count = 0,
      lastCalled = 0;

  return function() {
    var stamp = nativeNow(),
        remaining = HOT_SPAN - (stamp - lastCalled);

    lastCalled = stamp;
    if (remaining > 0) {
      if (++count >= HOT_COUNT) {
        return arguments[0];
      }
    } else {
      count = 0;
    }
    return func.apply(undefined, arguments);
  };
}

module.exports = shortOut;


/***/ }),

/***/ 1420:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var ListCache = __webpack_require__(79);

/**
 * Removes all key-value entries from the stack.
 *
 * @private
 * @name clear
 * @memberOf Stack
 */
function stackClear() {
  this.__data__ = new ListCache;
  this.size = 0;
}

module.exports = stackClear;


/***/ }),

/***/ 938:
/***/ (function(module) {

/**
 * Removes `key` and its value from the stack.
 *
 * @private
 * @name delete
 * @memberOf Stack
 * @param {string} key The key of the value to remove.
 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
 */
function stackDelete(key) {
  var data = this.__data__,
      result = data['delete'](key);

  this.size = data.size;
  return result;
}

module.exports = stackDelete;


/***/ }),

/***/ 3605:
/***/ (function(module) {

/**
 * Gets the stack value for `key`.
 *
 * @private
 * @name get
 * @memberOf Stack
 * @param {string} key The key of the value to get.
 * @returns {*} Returns the entry value.
 */
function stackGet(key) {
  return this.__data__.get(key);
}

module.exports = stackGet;


/***/ }),

/***/ 9817:
/***/ (function(module) {

/**
 * Checks if a stack value for `key` exists.
 *
 * @private
 * @name has
 * @memberOf Stack
 * @param {string} key The key of the entry to check.
 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
 */
function stackHas(key) {
  return this.__data__.has(key);
}

module.exports = stackHas;


/***/ }),

/***/ 945:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var ListCache = __webpack_require__(79),
    Map = __webpack_require__(8223),
    MapCache = __webpack_require__(3661);

/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;

/**
 * Sets the stack `key` to `value`.
 *
 * @private
 * @name set
 * @memberOf Stack
 * @param {string} key The key of the value to set.
 * @param {*} value The value to set.
 * @returns {Object} Returns the stack cache instance.
 */
function stackSet(key, value) {
  var data = this.__data__;
  if (data instanceof ListCache) {
    var pairs = data.__data__;
    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
      pairs.push([key, value]);
      this.size = ++data.size;
      return this;
    }
    data = this.__data__ = new MapCache(pairs);
  }
  data.set(key, value);
  this.size = data.size;
  return this;
}

module.exports = stackSet;


/***/ }),

/***/ 6959:
/***/ (function(module) {

/**
 * A specialized version of `_.indexOf` which performs strict equality
 * comparisons of values, i.e. `===`.
 *
 * @private
 * @param {Array} array The array to inspect.
 * @param {*} value The value to search for.
 * @param {number} fromIndex The index to search from.
 * @returns {number} Returns the index of the matched value, else `-1`.
 */
function strictIndexOf(array, value, fromIndex) {
  var index = fromIndex - 1,
      length = array.length;

  while (++index < length) {
    if (array[index] === value) {
      return index;
    }
  }
  return -1;
}

module.exports = strictIndexOf;


/***/ }),

/***/ 3912:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var asciiToArray = __webpack_require__(1074),
    hasUnicode = __webpack_require__(9698),
    unicodeToArray = __webpack_require__(2054);

/**
 * Converts `string` to an array.
 *
 * @private
 * @param {string} string The string to convert.
 * @returns {Array} Returns the converted array.
 */
function stringToArray(string) {
  return hasUnicode(string)
    ? unicodeToArray(string)
    : asciiToArray(string);
}

module.exports = stringToArray;


/***/ }),

/***/ 1802:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var memoizeCapped = __webpack_require__(2224);

/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;

/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;

/**
 * Converts `string` to a property path array.
 *
 * @private
 * @param {string} string The string to convert.
 * @returns {Array} Returns the property path array.
 */
var stringToPath = memoizeCapped(function(string) {
  var result = [];
  if (string.charCodeAt(0) === 46 /* . */) {
    result.push('');
  }
  string.replace(rePropName, function(match, number, quote, subString) {
    result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  });
  return result;
});

module.exports = stringToPath;


/***/ }),

/***/ 7797:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isSymbol = __webpack_require__(4394);

/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0;

/**
 * Converts `value` to a string key if it's not a string or symbol.
 *
 * @private
 * @param {*} value The value to inspect.
 * @returns {string|symbol} Returns the key.
 */
function toKey(value) {
  if (typeof value == 'string' || isSymbol(value)) {
    return value;
  }
  var result = (value + '');
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
}

module.exports = toKey;


/***/ }),

/***/ 2235:
/***/ (function(module) {

/** Used for built-in method references. */
var funcProto = Function.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/**
 * Converts `func` to its source code.
 *
 * @private
 * @param {Function} func The function to convert.
 * @returns {string} Returns the source code.
 */
function toSource(func) {
  if (func != null) {
    try {
      return funcToString.call(func);
    } catch (e) {}
    try {
      return (func + '');
    } catch (e) {}
  }
  return '';
}

module.exports = toSource;


/***/ }),

/***/ 1800:
/***/ (function(module) {

/** Used to match a single whitespace character. */
var reWhitespace = /\s/;

/**
 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
 * character of `string`.
 *
 * @private
 * @param {string} string The string to inspect.
 * @returns {number} Returns the index of the last non-whitespace character.
 */
function trimmedEndIndex(string) {
  var index = string.length;

  while (index-- && reWhitespace.test(string.charAt(index))) {}
  return index;
}

module.exports = trimmedEndIndex;


/***/ }),

/***/ 2054:
/***/ (function(module) {

/** Used to compose unicode character classes. */
var rsAstralRange = '\\ud800-\\udfff',
    rsComboMarksRange = '\\u0300-\\u036f',
    reComboHalfMarksRange = '\\ufe20-\\ufe2f',
    rsComboSymbolsRange = '\\u20d0-\\u20ff',
    rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
    rsVarRange = '\\ufe0e\\ufe0f';

/** Used to compose unicode capture groups. */
var rsAstral = '[' + rsAstralRange + ']',
    rsCombo = '[' + rsComboRange + ']',
    rsFitz = '\\ud83c[\\udffb-\\udfff]',
    rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
    rsNonAstral = '[^' + rsAstralRange + ']',
    rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
    rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
    rsZWJ = '\\u200d';

/** Used to compose unicode regexes. */
var reOptMod = rsModifier + '?',
    rsOptVar = '[' + rsVarRange + ']?',
    rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
    rsSeq = rsOptVar + reOptMod + rsOptJoin,
    rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';

/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');

/**
 * Converts a Unicode `string` to an array.
 *
 * @private
 * @param {string} string The string to convert.
 * @returns {Array} Returns the converted array.
 */
function unicodeToArray(string) {
  return string.match(reUnicode) || [];
}

module.exports = unicodeToArray;


/***/ }),

/***/ 7334:
/***/ (function(module) {

/**
 * Creates a function that returns `value`.
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Util
 * @param {*} value The value to return from the new function.
 * @returns {Function} Returns the new constant function.
 * @example
 *
 * var objects = _.times(2, _.constant({ 'a': 1 }));
 *
 * console.log(objects);
 * // => [{ 'a': 1 }, { 'a': 1 }]
 *
 * console.log(objects[0] === objects[1]);
 * // => true
 */
function constant(value) {
  return function() {
    return value;
  };
}

module.exports = constant;


/***/ }),

/***/ 8221:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isObject = __webpack_require__(3805),
    now = __webpack_require__(124),
    toNumber = __webpack_require__(9374);

/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
    nativeMin = Math.min;

/**
 * Creates a debounced function that delays invoking `func` until after `wait`
 * milliseconds have elapsed since the last time the debounced function was
 * invoked. The debounced function comes with a `cancel` method to cancel
 * delayed `func` invocations and a `flush` method to immediately invoke them.
 * Provide `options` to indicate whether `func` should be invoked on the
 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
 * with the last arguments provided to the debounced function. Subsequent
 * calls to the debounced function return the result of the last `func`
 * invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the debounced function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.debounce` and `_.throttle`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to debounce.
 * @param {number} [wait=0] The number of milliseconds to delay.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=false]
 *  Specify invoking on the leading edge of the timeout.
 * @param {number} [options.maxWait]
 *  The maximum time `func` is allowed to be delayed before it's invoked.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new debounced function.
 * @example
 *
 * // Avoid costly calculations while the window size is in flux.
 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
 *
 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
 * jQuery(element).on('click', _.debounce(sendMail, 300, {
 *   'leading': true,
 *   'trailing': false
 * }));
 *
 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
 * var source = new EventSource('/stream');
 * jQuery(source).on('message', debounced);
 *
 * // Cancel the trailing debounced invocation.
 * jQuery(window).on('popstate', debounced.cancel);
 */
function debounce(func, wait, options) {
  var lastArgs,
      lastThis,
      maxWait,
      result,
      timerId,
      lastCallTime,
      lastInvokeTime = 0,
      leading = false,
      maxing = false,
      trailing = true;

  if (typeof func != 'function') {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  wait = toNumber(wait) || 0;
  if (isObject(options)) {
    leading = !!options.leading;
    maxing = 'maxWait' in options;
    maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
    trailing = 'trailing' in options ? !!options.trailing : trailing;
  }

  function invokeFunc(time) {
    var args = lastArgs,
        thisArg = lastThis;

    lastArgs = lastThis = undefined;
    lastInvokeTime = time;
    result = func.apply(thisArg, args);
    return result;
  }

  function leadingEdge(time) {
    // Reset any `maxWait` timer.
    lastInvokeTime = time;
    // Start the timer for the trailing edge.
    timerId = setTimeout(timerExpired, wait);
    // Invoke the leading edge.
    return leading ? invokeFunc(time) : result;
  }

  function remainingWait(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime,
        timeWaiting = wait - timeSinceLastCall;

    return maxing
      ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
      : timeWaiting;
  }

  function shouldInvoke(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime;

    // Either this is the first call, activity has stopped and we're at the
    // trailing edge, the system time has gone backwards and we're treating
    // it as the trailing edge, or we've hit the `maxWait` limit.
    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  }

  function timerExpired() {
    var time = now();
    if (shouldInvoke(time)) {
      return trailingEdge(time);
    }
    // Restart the timer.
    timerId = setTimeout(timerExpired, remainingWait(time));
  }

  function trailingEdge(time) {
    timerId = undefined;

    // Only invoke if we have `lastArgs` which means `func` has been
    // debounced at least once.
    if (trailing && lastArgs) {
      return invokeFunc(time);
    }
    lastArgs = lastThis = undefined;
    return result;
  }

  function cancel() {
    if (timerId !== undefined) {
      clearTimeout(timerId);
    }
    lastInvokeTime = 0;
    lastArgs = lastCallTime = lastThis = timerId = undefined;
  }

  function flush() {
    return timerId === undefined ? result : trailingEdge(now());
  }

  function debounced() {
    var time = now(),
        isInvoking = shouldInvoke(time);

    lastArgs = arguments;
    lastThis = this;
    lastCallTime = time;

    if (isInvoking) {
      if (timerId === undefined) {
        return leadingEdge(lastCallTime);
      }
      if (maxing) {
        // Handle invocations in a tight loop.
        clearTimeout(timerId);
        timerId = setTimeout(timerExpired, wait);
        return invokeFunc(lastCallTime);
      }
    }
    if (timerId === undefined) {
      timerId = setTimeout(timerExpired, wait);
    }
    return result;
  }
  debounced.cancel = cancel;
  debounced.flush = flush;
  return debounced;
}

module.exports = debounce;


/***/ }),

/***/ 5288:
/***/ (function(module) {

/**
 * Performs a
 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
 * comparison between two values to determine if they are equivalent.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 * @example
 *
 * var object = { 'a': 1 };
 * var other = { 'a': 1 };
 *
 * _.eq(object, object);
 * // => true
 *
 * _.eq(object, other);
 * // => false
 *
 * _.eq('a', 'a');
 * // => true
 *
 * _.eq('a', Object('a'));
 * // => false
 *
 * _.eq(NaN, NaN);
 * // => true
 */
function eq(value, other) {
  return value === other || (value !== value && other !== other);
}

module.exports = eq;


/***/ }),

/***/ 9747:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var arrayEvery = __webpack_require__(7277),
    baseEvery = __webpack_require__(3777),
    baseIteratee = __webpack_require__(5389),
    isArray = __webpack_require__(6449),
    isIterateeCall = __webpack_require__(6800);

/**
 * Checks if `predicate` returns truthy for **all** elements of `collection`.
 * Iteration is stopped once `predicate` returns falsey. The predicate is
 * invoked with three arguments: (value, index|key, collection).
 *
 * **Note:** This method returns `true` for
 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
 * elements of empty collections.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Collection
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} [predicate=_.identity] The function invoked per iteration.
 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
 * @returns {boolean} Returns `true` if all elements pass the predicate check,
 *  else `false`.
 * @example
 *
 * _.every([true, 1, null, 'yes'], Boolean);
 * // => false
 *
 * var users = [
 *   { 'user': 'barney', 'age': 36, 'active': false },
 *   { 'user': 'fred',   'age': 40, 'active': false }
 * ];
 *
 * // The `_.matches` iteratee shorthand.
 * _.every(users, { 'user': 'barney', 'active': false });
 * // => false
 *
 * // The `_.matchesProperty` iteratee shorthand.
 * _.every(users, ['active', false]);
 * // => true
 *
 * // The `_.property` iteratee shorthand.
 * _.every(users, 'active');
 * // => false
 */
function every(collection, predicate, guard) {
  var func = isArray(collection) ? arrayEvery : baseEvery;
  if (guard && isIterateeCall(collection, predicate, guard)) {
    predicate = undefined;
  }
  return func(collection, baseIteratee(predicate, 3));
}

module.exports = every;


/***/ }),

/***/ 7309:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var createFind = __webpack_require__(2006),
    findIndex = __webpack_require__(4713);

/**
 * Iterates over elements of `collection`, returning the first element
 * `predicate` returns truthy for. The predicate is invoked with three
 * arguments: (value, index|key, collection).
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Collection
 * @param {Array|Object} collection The collection to inspect.
 * @param {Function} [predicate=_.identity] The function invoked per iteration.
 * @param {number} [fromIndex=0] The index to search from.
 * @returns {*} Returns the matched element, else `undefined`.
 * @example
 *
 * var users = [
 *   { 'user': 'barney',  'age': 36, 'active': true },
 *   { 'user': 'fred',    'age': 40, 'active': false },
 *   { 'user': 'pebbles', 'age': 1,  'active': true }
 * ];
 *
 * _.find(users, function(o) { return o.age < 40; });
 * // => object for 'barney'
 *
 * // The `_.matches` iteratee shorthand.
 * _.find(users, { 'age': 1, 'active': true });
 * // => object for 'pebbles'
 *
 * // The `_.matchesProperty` iteratee shorthand.
 * _.find(users, ['active', false]);
 * // => object for 'fred'
 *
 * // The `_.property` iteratee shorthand.
 * _.find(users, 'active');
 * // => object for 'barney'
 */
var find = createFind(findIndex);

module.exports = find;


/***/ }),

/***/ 4713:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseFindIndex = __webpack_require__(2523),
    baseIteratee = __webpack_require__(5389),
    toInteger = __webpack_require__(1489);

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;

/**
 * This method is like `_.find` except that it returns the index of the first
 * element `predicate` returns truthy for instead of the element itself.
 *
 * @static
 * @memberOf _
 * @since 1.1.0
 * @category Array
 * @param {Array} array The array to inspect.
 * @param {Function} [predicate=_.identity] The function invoked per iteration.
 * @param {number} [fromIndex=0] The index to search from.
 * @returns {number} Returns the index of the found element, else `-1`.
 * @example
 *
 * var users = [
 *   { 'user': 'barney',  'active': false },
 *   { 'user': 'fred',    'active': false },
 *   { 'user': 'pebbles', 'active': true }
 * ];
 *
 * _.findIndex(users, function(o) { return o.user == 'barney'; });
 * // => 0
 *
 * // The `_.matches` iteratee shorthand.
 * _.findIndex(users, { 'user': 'fred', 'active': false });
 * // => 1
 *
 * // The `_.matchesProperty` iteratee shorthand.
 * _.findIndex(users, ['active', false]);
 * // => 0
 *
 * // The `_.property` iteratee shorthand.
 * _.findIndex(users, 'active');
 * // => 2
 */
function findIndex(array, predicate, fromIndex) {
  var length = array == null ? 0 : array.length;
  if (!length) {
    return -1;
  }
  var index = fromIndex == null ? 0 : toInteger(fromIndex);
  if (index < 0) {
    index = nativeMax(length + index, 0);
  }
  return baseFindIndex(array, baseIteratee(predicate, 3), index);
}

module.exports = findIndex;


/***/ }),

/***/ 7307:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseFlatten = __webpack_require__(3120),
    map = __webpack_require__(5378);

/**
 * Creates a flattened array of values by running each element in `collection`
 * thru `iteratee` and flattening the mapped results. The iteratee is invoked
 * with three arguments: (value, index|key, collection).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Collection
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
 * @returns {Array} Returns the new flattened array.
 * @example
 *
 * function duplicate(n) {
 *   return [n, n];
 * }
 *
 * _.flatMap([1, 2], duplicate);
 * // => [1, 1, 2, 2]
 */
function flatMap(collection, iteratee) {
  return baseFlatten(map(collection, iteratee), 1);
}

module.exports = flatMap;


/***/ }),

/***/ 8156:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGet = __webpack_require__(7422);

/**
 * Gets the value at `path` of `object`. If the resolved value is
 * `undefined`, the `defaultValue` is returned in its place.
 *
 * @static
 * @memberOf _
 * @since 3.7.0
 * @category Object
 * @param {Object} object The object to query.
 * @param {Array|string} path The path of the property to get.
 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
 * @returns {*} Returns the resolved value.
 * @example
 *
 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
 *
 * _.get(object, 'a[0].b.c');
 * // => 3
 *
 * _.get(object, ['a', '0', 'b', 'c']);
 * // => 3
 *
 * _.get(object, 'a.b.c', 'default');
 * // => 'default'
 */
function get(object, path, defaultValue) {
  var result = object == null ? undefined : baseGet(object, path);
  return result === undefined ? defaultValue : result;
}

module.exports = get;


/***/ }),

/***/ 631:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseHasIn = __webpack_require__(8077),
    hasPath = __webpack_require__(9326);

/**
 * Checks if `path` is a direct or inherited property of `object`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Object
 * @param {Object} object The object to query.
 * @param {Array|string} path The path to check.
 * @returns {boolean} Returns `true` if `path` exists, else `false`.
 * @example
 *
 * var object = _.create({ 'a': _.create({ 'b': 2 }) });
 *
 * _.hasIn(object, 'a');
 * // => true
 *
 * _.hasIn(object, 'a.b');
 * // => true
 *
 * _.hasIn(object, ['a', 'b']);
 * // => true
 *
 * _.hasIn(object, 'b');
 * // => false
 */
function hasIn(object, path) {
  return object != null && hasPath(object, path, baseHasIn);
}

module.exports = hasIn;


/***/ }),

/***/ 3488:
/***/ (function(module) {

/**
 * This method returns the first argument it receives.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Util
 * @param {*} value Any value.
 * @returns {*} Returns `value`.
 * @example
 *
 * var object = { 'a': 1 };
 *
 * console.log(_.identity(object) === object);
 * // => true
 */
function identity(value) {
  return value;
}

module.exports = identity;


/***/ }),

/***/ 2428:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseIsArguments = __webpack_require__(7534),
    isObjectLike = __webpack_require__(7965);

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Built-in value references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;

/**
 * Checks if `value` is likely an `arguments` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
 *  else `false`.
 * @example
 *
 * _.isArguments(function() { return arguments; }());
 * // => true
 *
 * _.isArguments([1, 2, 3]);
 * // => false
 */
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
    !propertyIsEnumerable.call(value, 'callee');
};

module.exports = isArguments;


/***/ }),

/***/ 6449:
/***/ (function(module) {

/**
 * Checks if `value` is classified as an `Array` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
 * @example
 *
 * _.isArray([1, 2, 3]);
 * // => true
 *
 * _.isArray(document.body.children);
 * // => false
 *
 * _.isArray('abc');
 * // => false
 *
 * _.isArray(_.noop);
 * // => false
 */
var isArray = Array.isArray;

module.exports = isArray;


/***/ }),

/***/ 4894:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isFunction = __webpack_require__(1882),
    isLength = __webpack_require__(294);

/**
 * Checks if `value` is array-like. A value is considered array-like if it's
 * not a function and has a `value.length` that's an integer greater than or
 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
 * @example
 *
 * _.isArrayLike([1, 2, 3]);
 * // => true
 *
 * _.isArrayLike(document.body.children);
 * // => true
 *
 * _.isArrayLike('abc');
 * // => true
 *
 * _.isArrayLike(_.noop);
 * // => false
 */
function isArrayLike(value) {
  return value != null && isLength(value.length) && !isFunction(value);
}

module.exports = isArrayLike;


/***/ }),

/***/ 3812:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGetTag = __webpack_require__(2552),
    isObjectLike = __webpack_require__(7965);

/** `Object#toString` result references. */
var boolTag = '[object Boolean]';

/**
 * Checks if `value` is classified as a boolean primitive or object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
 * @example
 *
 * _.isBoolean(false);
 * // => true
 *
 * _.isBoolean(null);
 * // => false
 */
function isBoolean(value) {
  return value === true || value === false ||
    (isObjectLike(value) && baseGetTag(value) == boolTag);
}

module.exports = isBoolean;


/***/ }),

/***/ 3656:
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
var root = __webpack_require__(9325),
    stubFalse = __webpack_require__(5964);

/** Detect free variable `exports`. */
var freeExports =  true && exports && !exports.nodeType && exports;

/** Detect free variable `module`. */
var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;

/** Detect the popular CommonJS extension `module.exports`. */
var moduleExports = freeModule && freeModule.exports === freeExports;

/** Built-in value references. */
var Buffer = moduleExports ? root.Buffer : undefined;

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;

/**
 * Checks if `value` is a buffer.
 *
 * @static
 * @memberOf _
 * @since 4.3.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
 * @example
 *
 * _.isBuffer(new Buffer(2));
 * // => true
 *
 * _.isBuffer(new Uint8Array(2));
 * // => false
 */
var isBuffer = nativeIsBuffer || stubFalse;

module.exports = isBuffer;


/***/ }),

/***/ 2404:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseIsEqual = __webpack_require__(270);

/**
 * Performs a deep comparison between two values to determine if they are
 * equivalent.
 *
 * **Note:** This method supports comparing arrays, array buffers, booleans,
 * date objects, error objects, maps, numbers, `Object` objects, regexes,
 * sets, strings, symbols, and typed arrays. `Object` objects are compared
 * by their own, not inherited, enumerable properties. Functions and DOM
 * nodes are compared by strict equality, i.e. `===`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 * @example
 *
 * var object = { 'a': 1 };
 * var other = { 'a': 1 };
 *
 * _.isEqual(object, other);
 * // => true
 *
 * object === other;
 * // => false
 */
function isEqual(value, other) {
  return baseIsEqual(value, other);
}

module.exports = isEqual;


/***/ }),

/***/ 1882:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGetTag = __webpack_require__(2552),
    isObject = __webpack_require__(3805);

/** `Object#toString` result references. */
var asyncTag = '[object AsyncFunction]',
    funcTag = '[object Function]',
    genTag = '[object GeneratorFunction]',
    proxyTag = '[object Proxy]';

/**
 * Checks if `value` is classified as a `Function` object.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
 * @example
 *
 * _.isFunction(_);
 * // => true
 *
 * _.isFunction(/abc/);
 * // => false
 */
function isFunction(value) {
  if (!isObject(value)) {
    return false;
  }
  // The use of `Object#toString` avoids issues with the `typeof` operator
  // in Safari 9 which returns 'object' for typed arrays and other constructors.
  var tag = baseGetTag(value);
  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}

module.exports = isFunction;


/***/ }),

/***/ 294:
/***/ (function(module) {

/** Used as references for various `Number` constants. */
var MAX_SAFE_INTEGER = 9007199254740991;

/**
 * Checks if `value` is a valid array-like length.
 *
 * **Note:** This method is loosely based on
 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
 * @example
 *
 * _.isLength(3);
 * // => true
 *
 * _.isLength(Number.MIN_VALUE);
 * // => false
 *
 * _.isLength(Infinity);
 * // => false
 *
 * _.isLength('3');
 * // => false
 */
function isLength(value) {
  return typeof value == 'number' &&
    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}

module.exports = isLength;


/***/ }),

/***/ 4122:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var isNumber = __webpack_require__(8023);

/**
 * Checks if `value` is `NaN`.
 *
 * **Note:** This method is based on
 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
 * `undefined` and other non-number values.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
 * @example
 *
 * _.isNaN(NaN);
 * // => true
 *
 * _.isNaN(new Number(NaN));
 * // => true
 *
 * isNaN(undefined);
 * // => true
 *
 * _.isNaN(undefined);
 * // => false
 */
function isNaN(value) {
  // An `NaN` primitive is the only value that is not equal to itself.
  // Perform the `toStringTag` check first to avoid errors with some
  // ActiveX objects in IE.
  return isNumber(value) && value != +value;
}

module.exports = isNaN;


/***/ }),

/***/ 9843:
/***/ (function(module) {

/**
 * Checks if `value` is `null` or `undefined`.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
 * @example
 *
 * _.isNil(null);
 * // => true
 *
 * _.isNil(void 0);
 * // => true
 *
 * _.isNil(NaN);
 * // => false
 */
function isNil(value) {
  return value == null;
}

module.exports = isNil;


/***/ }),

/***/ 8023:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGetTag = __webpack_require__(2552),
    isObjectLike = __webpack_require__(7965);

/** `Object#toString` result references. */
var numberTag = '[object Number]';

/**
 * Checks if `value` is classified as a `Number` primitive or object.
 *
 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
 * classified as numbers, use the `_.isFinite` method.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a number, else `false`.
 * @example
 *
 * _.isNumber(3);
 * // => true
 *
 * _.isNumber(Number.MIN_VALUE);
 * // => true
 *
 * _.isNumber(Infinity);
 * // => true
 *
 * _.isNumber('3');
 * // => false
 */
function isNumber(value) {
  return typeof value == 'number' ||
    (isObjectLike(value) && baseGetTag(value) == numberTag);
}

module.exports = isNumber;


/***/ }),

/***/ 3805:
/***/ (function(module) {

/**
 * Checks if `value` is the
 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
 * @example
 *
 * _.isObject({});
 * // => true
 *
 * _.isObject([1, 2, 3]);
 * // => true
 *
 * _.isObject(_.noop);
 * // => true
 *
 * _.isObject(null);
 * // => false
 */
function isObject(value) {
  var type = typeof value;
  return value != null && (type == 'object' || type == 'function');
}

module.exports = isObject;


/***/ }),

/***/ 7965:
/***/ (function(module) {

/**
 * Checks if `value` is object-like. A value is object-like if it's not `null`
 * and has a `typeof` result of "object".
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 * @example
 *
 * _.isObjectLike({});
 * // => true
 *
 * _.isObjectLike([1, 2, 3]);
 * // => true
 *
 * _.isObjectLike(_.noop);
 * // => false
 *
 * _.isObjectLike(null);
 * // => false
 */
function isObjectLike(value) {
  return value != null && typeof value == 'object';
}

module.exports = isObjectLike;


/***/ }),

/***/ 1331:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGetTag = __webpack_require__(2552),
    getPrototype = __webpack_require__(8879),
    isObjectLike = __webpack_require__(7965);

/** `Object#toString` result references. */
var objectTag = '[object Object]';

/** Used for built-in method references. */
var funcProto = Function.prototype,
    objectProto = Object.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);

/**
 * Checks if `value` is a plain object, that is, an object created by the
 * `Object` constructor or one with a `[[Prototype]]` of `null`.
 *
 * @static
 * @memberOf _
 * @since 0.8.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 * }
 *
 * _.isPlainObject(new Foo);
 * // => false
 *
 * _.isPlainObject([1, 2, 3]);
 * // => false
 *
 * _.isPlainObject({ 'x': 0, 'y': 0 });
 * // => true
 *
 * _.isPlainObject(Object.create(null));
 * // => true
 */
function isPlainObject(value) {
  if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
    return false;
  }
  var proto = getPrototype(value);
  if (proto === null) {
    return true;
  }
  var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  return typeof Ctor == 'function' && Ctor instanceof Ctor &&
    funcToString.call(Ctor) == objectCtorString;
}

module.exports = isPlainObject;


/***/ }),

/***/ 5015:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGetTag = __webpack_require__(2552),
    isArray = __webpack_require__(6449),
    isObjectLike = __webpack_require__(7965);

/** `Object#toString` result references. */
var stringTag = '[object String]';

/**
 * Checks if `value` is classified as a `String` primitive or object.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a string, else `false`.
 * @example
 *
 * _.isString('abc');
 * // => true
 *
 * _.isString(1);
 * // => false
 */
function isString(value) {
  return typeof value == 'string' ||
    (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
}

module.exports = isString;


/***/ }),

/***/ 4394:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseGetTag = __webpack_require__(2552),
    isObjectLike = __webpack_require__(7965);

/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';

/**
 * Checks if `value` is classified as a `Symbol` primitive or object.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
 * @example
 *
 * _.isSymbol(Symbol.iterator);
 * // => true
 *
 * _.isSymbol('abc');
 * // => false
 */
function isSymbol(value) {
  return typeof value == 'symbol' ||
    (isObjectLike(value) && baseGetTag(value) == symbolTag);
}

module.exports = isSymbol;


/***/ }),

/***/ 7167:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseIsTypedArray = __webpack_require__(4901),
    baseUnary = __webpack_require__(7301),
    nodeUtil = __webpack_require__(6009);

/* Node.js helper references. */
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;

/**
 * Checks if `value` is classified as a typed array.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
 * @example
 *
 * _.isTypedArray(new Uint8Array);
 * // => true
 *
 * _.isTypedArray([]);
 * // => false
 */
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;

module.exports = isTypedArray;


/***/ }),

/***/ 5950:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var arrayLikeKeys = __webpack_require__(695),
    baseKeys = __webpack_require__(8984),
    isArrayLike = __webpack_require__(4894);

/**
 * Creates an array of the own enumerable property names of `object`.
 *
 * **Note:** Non-object values are coerced to objects. See the
 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
 * for more details.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Object
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 *   this.b = 2;
 * }
 *
 * Foo.prototype.c = 3;
 *
 * _.keys(new Foo);
 * // => ['a', 'b'] (iteration order is not guaranteed)
 *
 * _.keys('hi');
 * // => ['0', '1']
 */
function keys(object) {
  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}

module.exports = keys;


/***/ }),

/***/ 8090:
/***/ (function(module) {

/**
 * Gets the last element of `array`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Array
 * @param {Array} array The array to query.
 * @returns {*} Returns the last element of `array`.
 * @example
 *
 * _.last([1, 2, 3]);
 * // => 3
 */
function last(array) {
  var length = array == null ? 0 : array.length;
  return length ? array[length - 1] : undefined;
}

module.exports = last;


/***/ }),

/***/ 2543:
/***/ (function(module, exports, __webpack_require__) {

/* module decorator */ module = __webpack_require__.nmd(module);
var __WEBPACK_AMD_DEFINE_RESULT__;/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */
;(function() {

  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  var undefined;

  /** Used as the semantic version number. */
  var VERSION = '4.17.21';

  /** Used as the size to enable large array optimizations. */
  var LARGE_ARRAY_SIZE = 200;

  /** Error message constants. */
  var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
      FUNC_ERROR_TEXT = 'Expected a function',
      INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';

  /** Used to stand-in for `undefined` hash values. */
  var HASH_UNDEFINED = '__lodash_hash_undefined__';

  /** Used as the maximum memoize cache size. */
  var MAX_MEMOIZE_SIZE = 500;

  /** Used as the internal argument placeholder. */
  var PLACEHOLDER = '__lodash_placeholder__';

  /** Used to compose bitmasks for cloning. */
  var CLONE_DEEP_FLAG = 1,
      CLONE_FLAT_FLAG = 2,
      CLONE_SYMBOLS_FLAG = 4;

  /** Used to compose bitmasks for value comparisons. */
  var COMPARE_PARTIAL_FLAG = 1,
      COMPARE_UNORDERED_FLAG = 2;

  /** Used to compose bitmasks for function metadata. */
  var WRAP_BIND_FLAG = 1,
      WRAP_BIND_KEY_FLAG = 2,
      WRAP_CURRY_BOUND_FLAG = 4,
      WRAP_CURRY_FLAG = 8,
      WRAP_CURRY_RIGHT_FLAG = 16,
      WRAP_PARTIAL_FLAG = 32,
      WRAP_PARTIAL_RIGHT_FLAG = 64,
      WRAP_ARY_FLAG = 128,
      WRAP_REARG_FLAG = 256,
      WRAP_FLIP_FLAG = 512;

  /** Used as default options for `_.truncate`. */
  var DEFAULT_TRUNC_LENGTH = 30,
      DEFAULT_TRUNC_OMISSION = '...';

  /** Used to detect hot functions by number of calls within a span of milliseconds. */
  var HOT_COUNT = 800,
      HOT_SPAN = 16;

  /** Used to indicate the type of lazy iteratees. */
  var LAZY_FILTER_FLAG = 1,
      LAZY_MAP_FLAG = 2,
      LAZY_WHILE_FLAG = 3;

  /** Used as references for various `Number` constants. */
  var INFINITY = 1 / 0,
      MAX_SAFE_INTEGER = 9007199254740991,
      MAX_INTEGER = 1.7976931348623157e+308,
      NAN = 0 / 0;

  /** Used as references for the maximum length and index of an array. */
  var MAX_ARRAY_LENGTH = 4294967295,
      MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
      HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;

  /** Used to associate wrap methods with their bit flags. */
  var wrapFlags = [
    ['ary', WRAP_ARY_FLAG],
    ['bind', WRAP_BIND_FLAG],
    ['bindKey', WRAP_BIND_KEY_FLAG],
    ['curry', WRAP_CURRY_FLAG],
    ['curryRight', WRAP_CURRY_RIGHT_FLAG],
    ['flip', WRAP_FLIP_FLAG],
    ['partial', WRAP_PARTIAL_FLAG],
    ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
    ['rearg', WRAP_REARG_FLAG]
  ];

  /** `Object#toString` result references. */
  var argsTag = '[object Arguments]',
      arrayTag = '[object Array]',
      asyncTag = '[object AsyncFunction]',
      boolTag = '[object Boolean]',
      dateTag = '[object Date]',
      domExcTag = '[object DOMException]',
      errorTag = '[object Error]',
      funcTag = '[object Function]',
      genTag = '[object GeneratorFunction]',
      mapTag = '[object Map]',
      numberTag = '[object Number]',
      nullTag = '[object Null]',
      objectTag = '[object Object]',
      promiseTag = '[object Promise]',
      proxyTag = '[object Proxy]',
      regexpTag = '[object RegExp]',
      setTag = '[object Set]',
      stringTag = '[object String]',
      symbolTag = '[object Symbol]',
      undefinedTag = '[object Undefined]',
      weakMapTag = '[object WeakMap]',
      weakSetTag = '[object WeakSet]';

  var arrayBufferTag = '[object ArrayBuffer]',
      dataViewTag = '[object DataView]',
      float32Tag = '[object Float32Array]',
      float64Tag = '[object Float64Array]',
      int8Tag = '[object Int8Array]',
      int16Tag = '[object Int16Array]',
      int32Tag = '[object Int32Array]',
      uint8Tag = '[object Uint8Array]',
      uint8ClampedTag = '[object Uint8ClampedArray]',
      uint16Tag = '[object Uint16Array]',
      uint32Tag = '[object Uint32Array]';

  /** Used to match empty string literals in compiled template source. */
  var reEmptyStringLeading = /\b__p \+= '';/g,
      reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
      reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;

  /** Used to match HTML entities and HTML characters. */
  var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
      reUnescapedHtml = /[&<>"']/g,
      reHasEscapedHtml = RegExp(reEscapedHtml.source),
      reHasUnescapedHtml = RegExp(reUnescapedHtml.source);

  /** Used to match template delimiters. */
  var reEscape = /<%-([\s\S]+?)%>/g,
      reEvaluate = /<%([\s\S]+?)%>/g,
      reInterpolate = /<%=([\s\S]+?)%>/g;

  /** Used to match property names within property paths. */
  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
      reIsPlainProp = /^\w*$/,
      rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;

  /**
   * Used to match `RegExp`
   * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
   */
  var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
      reHasRegExpChar = RegExp(reRegExpChar.source);

  /** Used to match leading whitespace. */
  var reTrimStart = /^\s+/;

  /** Used to match a single whitespace character. */
  var reWhitespace = /\s/;

  /** Used to match wrap detail comments. */
  var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
      reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
      reSplitDetails = /,? & /;

  /** Used to match words composed of alphanumeric characters. */
  var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;

  /**
   * Used to validate the `validate` option in `_.template` variable.
   *
   * Forbids characters which could potentially change the meaning of the function argument definition:
   * - "()," (modification of function parameters)
   * - "=" (default value)
   * - "[]{}" (destructuring of function parameters)
   * - "/" (beginning of a comment)
   * - whitespace
   */
  var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;

  /** Used to match backslashes in property paths. */
  var reEscapeChar = /\\(\\)?/g;

  /**
   * Used to match
   * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
   */
  var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;

  /** Used to match `RegExp` flags from their coerced string values. */
  var reFlags = /\w*$/;

  /** Used to detect bad signed hexadecimal string values. */
  var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;

  /** Used to detect binary string values. */
  var reIsBinary = /^0b[01]+$/i;

  /** Used to detect host constructors (Safari). */
  var reIsHostCtor = /^\[object .+?Constructor\]$/;

  /** Used to detect octal string values. */
  var reIsOctal = /^0o[0-7]+$/i;

  /** Used to detect unsigned integer values. */
  var reIsUint = /^(?:0|[1-9]\d*)$/;

  /** Used to match Latin Unicode letters (excluding mathematical operators). */
  var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;

  /** Used to ensure capturing order of template delimiters. */
  var reNoMatch = /($^)/;

  /** Used to match unescaped characters in compiled string literals. */
  var reUnescapedString = /['\n\r\u2028\u2029\\]/g;

  /** Used to compose unicode character classes. */
  var rsAstralRange = '\\ud800-\\udfff',
      rsComboMarksRange = '\\u0300-\\u036f',
      reComboHalfMarksRange = '\\ufe20-\\ufe2f',
      rsComboSymbolsRange = '\\u20d0-\\u20ff',
      rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
      rsDingbatRange = '\\u2700-\\u27bf',
      rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
      rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
      rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
      rsPunctuationRange = '\\u2000-\\u206f',
      rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
      rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
      rsVarRange = '\\ufe0e\\ufe0f',
      rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;

  /** Used to compose unicode capture groups. */
  var rsApos = "['\u2019]",
      rsAstral = '[' + rsAstralRange + ']',
      rsBreak = '[' + rsBreakRange + ']',
      rsCombo = '[' + rsComboRange + ']',
      rsDigits = '\\d+',
      rsDingbat = '[' + rsDingbatRange + ']',
      rsLower = '[' + rsLowerRange + ']',
      rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
      rsFitz = '\\ud83c[\\udffb-\\udfff]',
      rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
      rsNonAstral = '[^' + rsAstralRange + ']',
      rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
      rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
      rsUpper = '[' + rsUpperRange + ']',
      rsZWJ = '\\u200d';

  /** Used to compose unicode regexes. */
  var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
      rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
      rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
      rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
      reOptMod = rsModifier + '?',
      rsOptVar = '[' + rsVarRange + ']?',
      rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
      rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
      rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
      rsSeq = rsOptVar + reOptMod + rsOptJoin,
      rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
      rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';

  /** Used to match apostrophes. */
  var reApos = RegExp(rsApos, 'g');

  /**
   * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
   * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
   */
  var reComboMark = RegExp(rsCombo, 'g');

  /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');

  /** Used to match complex or compound words. */
  var reUnicodeWord = RegExp([
    rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
    rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
    rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
    rsUpper + '+' + rsOptContrUpper,
    rsOrdUpper,
    rsOrdLower,
    rsDigits,
    rsEmoji
  ].join('|'), 'g');

  /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange  + rsComboRange + rsVarRange + ']');

  /** Used to detect strings that need a more robust regexp to match words. */
  var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;

  /** Used to assign default `context` object properties. */
  var contextProps = [
    'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
    'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
    'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
    'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
    '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  ];

  /** Used to make template sourceURLs easier to identify. */
  var templateCounter = -1;

  /** Used to identify `toStringTag` values of typed arrays. */
  var typedArrayTags = {};
  typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  typedArrayTags[uint32Tag] = true;
  typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  typedArrayTags[setTag] = typedArrayTags[stringTag] =
  typedArrayTags[weakMapTag] = false;

  /** Used to identify `toStringTag` values supported by `_.clone`. */
  var cloneableTags = {};
  cloneableTags[argsTag] = cloneableTags[arrayTag] =
  cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  cloneableTags[boolTag] = cloneableTags[dateTag] =
  cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  cloneableTags[int32Tag] = cloneableTags[mapTag] =
  cloneableTags[numberTag] = cloneableTags[objectTag] =
  cloneableTags[regexpTag] = cloneableTags[setTag] =
  cloneableTags[stringTag] = cloneableTags[symbolTag] =
  cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  cloneableTags[errorTag] = cloneableTags[funcTag] =
  cloneableTags[weakMapTag] = false;

  /** Used to map Latin Unicode letters to basic Latin letters. */
  var deburredLetters = {
    // Latin-1 Supplement block.
    '\xc0': 'A',  '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
    '\xe0': 'a',  '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
    '\xc7': 'C',  '\xe7': 'c',
    '\xd0': 'D',  '\xf0': 'd',
    '\xc8': 'E',  '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
    '\xe8': 'e',  '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
    '\xcc': 'I',  '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
    '\xec': 'i',  '\xed': 'i', '\xee': 'i', '\xef': 'i',
    '\xd1': 'N',  '\xf1': 'n',
    '\xd2': 'O',  '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
    '\xf2': 'o',  '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
    '\xd9': 'U',  '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
    '\xf9': 'u',  '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
    '\xdd': 'Y',  '\xfd': 'y', '\xff': 'y',
    '\xc6': 'Ae', '\xe6': 'ae',
    '\xde': 'Th', '\xfe': 'th',
    '\xdf': 'ss',
    // Latin Extended-A block.
    '\u0100': 'A',  '\u0102': 'A', '\u0104': 'A',
    '\u0101': 'a',  '\u0103': 'a', '\u0105': 'a',
    '\u0106': 'C',  '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
    '\u0107': 'c',  '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
    '\u010e': 'D',  '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
    '\u0112': 'E',  '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
    '\u0113': 'e',  '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
    '\u011c': 'G',  '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
    '\u011d': 'g',  '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
    '\u0124': 'H',  '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
    '\u0128': 'I',  '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
    '\u0129': 'i',  '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
    '\u0134': 'J',  '\u0135': 'j',
    '\u0136': 'K',  '\u0137': 'k', '\u0138': 'k',
    '\u0139': 'L',  '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
    '\u013a': 'l',  '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
    '\u0143': 'N',  '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
    '\u0144': 'n',  '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
    '\u014c': 'O',  '\u014e': 'O', '\u0150': 'O',
    '\u014d': 'o',  '\u014f': 'o', '\u0151': 'o',
    '\u0154': 'R',  '\u0156': 'R', '\u0158': 'R',
    '\u0155': 'r',  '\u0157': 'r', '\u0159': 'r',
    '\u015a': 'S',  '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
    '\u015b': 's',  '\u015d': 's', '\u015f': 's', '\u0161': 's',
    '\u0162': 'T',  '\u0164': 'T', '\u0166': 'T',
    '\u0163': 't',  '\u0165': 't', '\u0167': 't',
    '\u0168': 'U',  '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
    '\u0169': 'u',  '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
    '\u0174': 'W',  '\u0175': 'w',
    '\u0176': 'Y',  '\u0177': 'y', '\u0178': 'Y',
    '\u0179': 'Z',  '\u017b': 'Z', '\u017d': 'Z',
    '\u017a': 'z',  '\u017c': 'z', '\u017e': 'z',
    '\u0132': 'IJ', '\u0133': 'ij',
    '\u0152': 'Oe', '\u0153': 'oe',
    '\u0149': "'n", '\u017f': 's'
  };

  /** Used to map characters to HTML entities. */
  var htmlEscapes = {
    '&': '&amp;',
    '<': '&lt;',
    '>': '&gt;',
    '"': '&quot;',
    "'": '&#39;'
  };

  /** Used to map HTML entities to characters. */
  var htmlUnescapes = {
    '&amp;': '&',
    '&lt;': '<',
    '&gt;': '>',
    '&quot;': '"',
    '&#39;': "'"
  };

  /** Used to escape characters for inclusion in compiled string literals. */
  var stringEscapes = {
    '\\': '\\',
    "'": "'",
    '\n': 'n',
    '\r': 'r',
    '\u2028': 'u2028',
    '\u2029': 'u2029'
  };

  /** Built-in method references without a dependency on `root`. */
  var freeParseFloat = parseFloat,
      freeParseInt = parseInt;

  /** Detect free variable `global` from Node.js. */
  var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;

  /** Detect free variable `self`. */
  var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

  /** Used as a reference to the global object. */
  var root = freeGlobal || freeSelf || Function('return this')();

  /** Detect free variable `exports`. */
  var freeExports =  true && exports && !exports.nodeType && exports;

  /** Detect free variable `module`. */
  var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;

  /** Detect the popular CommonJS extension `module.exports`. */
  var moduleExports = freeModule && freeModule.exports === freeExports;

  /** Detect free variable `process` from Node.js. */
  var freeProcess = moduleExports && freeGlobal.process;

  /** Used to access faster Node.js helpers. */
  var nodeUtil = (function() {
    try {
      // Use `util.types` for Node.js 10+.
      var types = freeModule && freeModule.require && freeModule.require('util').types;

      if (types) {
        return types;
      }

      // Legacy `process.binding('util')` for Node.js < 10.
      return freeProcess && freeProcess.binding && freeProcess.binding('util');
    } catch (e) {}
  }());

  /* Node.js helper references. */
  var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
      nodeIsDate = nodeUtil && nodeUtil.isDate,
      nodeIsMap = nodeUtil && nodeUtil.isMap,
      nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
      nodeIsSet = nodeUtil && nodeUtil.isSet,
      nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;

  /*--------------------------------------------------------------------------*/

  /**
   * A faster alternative to `Function#apply`, this function invokes `func`
   * with the `this` binding of `thisArg` and the arguments of `args`.
   *
   * @private
   * @param {Function} func The function to invoke.
   * @param {*} thisArg The `this` binding of `func`.
   * @param {Array} args The arguments to invoke `func` with.
   * @returns {*} Returns the result of `func`.
   */
  function apply(func, thisArg, args) {
    switch (args.length) {
      case 0: return func.call(thisArg);
      case 1: return func.call(thisArg, args[0]);
      case 2: return func.call(thisArg, args[0], args[1]);
      case 3: return func.call(thisArg, args[0], args[1], args[2]);
    }
    return func.apply(thisArg, args);
  }

  /**
   * A specialized version of `baseAggregator` for arrays.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} setter The function to set `accumulator` values.
   * @param {Function} iteratee The iteratee to transform keys.
   * @param {Object} accumulator The initial aggregated object.
   * @returns {Function} Returns `accumulator`.
   */
  function arrayAggregator(array, setter, iteratee, accumulator) {
    var index = -1,
        length = array == null ? 0 : array.length;

    while (++index < length) {
      var value = array[index];
      setter(accumulator, value, iteratee(value), array);
    }
    return accumulator;
  }

  /**
   * A specialized version of `_.forEach` for arrays without support for
   * iteratee shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Array} Returns `array`.
   */
  function arrayEach(array, iteratee) {
    var index = -1,
        length = array == null ? 0 : array.length;

    while (++index < length) {
      if (iteratee(array[index], index, array) === false) {
        break;
      }
    }
    return array;
  }

  /**
   * A specialized version of `_.forEachRight` for arrays without support for
   * iteratee shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Array} Returns `array`.
   */
  function arrayEachRight(array, iteratee) {
    var length = array == null ? 0 : array.length;

    while (length--) {
      if (iteratee(array[length], length, array) === false) {
        break;
      }
    }
    return array;
  }

  /**
   * A specialized version of `_.every` for arrays without support for
   * iteratee shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} predicate The function invoked per iteration.
   * @returns {boolean} Returns `true` if all elements pass the predicate check,
   *  else `false`.
   */
  function arrayEvery(array, predicate) {
    var index = -1,
        length = array == null ? 0 : array.length;

    while (++index < length) {
      if (!predicate(array[index], index, array)) {
        return false;
      }
    }
    return true;
  }

  /**
   * A specialized version of `_.filter` for arrays without support for
   * iteratee shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} predicate The function invoked per iteration.
   * @returns {Array} Returns the new filtered array.
   */
  function arrayFilter(array, predicate) {
    var index = -1,
        length = array == null ? 0 : array.length,
        resIndex = 0,
        result = [];

    while (++index < length) {
      var value = array[index];
      if (predicate(value, index, array)) {
        result[resIndex++] = value;
      }
    }
    return result;
  }

  /**
   * A specialized version of `_.includes` for arrays without support for
   * specifying an index to search from.
   *
   * @private
   * @param {Array} [array] The array to inspect.
   * @param {*} target The value to search for.
   * @returns {boolean} Returns `true` if `target` is found, else `false`.
   */
  function arrayIncludes(array, value) {
    var length = array == null ? 0 : array.length;
    return !!length && baseIndexOf(array, value, 0) > -1;
  }

  /**
   * This function is like `arrayIncludes` except that it accepts a comparator.
   *
   * @private
   * @param {Array} [array] The array to inspect.
   * @param {*} target The value to search for.
   * @param {Function} comparator The comparator invoked per element.
   * @returns {boolean} Returns `true` if `target` is found, else `false`.
   */
  function arrayIncludesWith(array, value, comparator) {
    var index = -1,
        length = array == null ? 0 : array.length;

    while (++index < length) {
      if (comparator(value, array[index])) {
        return true;
      }
    }
    return false;
  }

  /**
   * A specialized version of `_.map` for arrays without support for iteratee
   * shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Array} Returns the new mapped array.
   */
  function arrayMap(array, iteratee) {
    var index = -1,
        length = array == null ? 0 : array.length,
        result = Array(length);

    while (++index < length) {
      result[index] = iteratee(array[index], index, array);
    }
    return result;
  }

  /**
   * Appends the elements of `values` to `array`.
   *
   * @private
   * @param {Array} array The array to modify.
   * @param {Array} values The values to append.
   * @returns {Array} Returns `array`.
   */
  function arrayPush(array, values) {
    var index = -1,
        length = values.length,
        offset = array.length;

    while (++index < length) {
      array[offset + index] = values[index];
    }
    return array;
  }

  /**
   * A specialized version of `_.reduce` for arrays without support for
   * iteratee shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @param {*} [accumulator] The initial value.
   * @param {boolean} [initAccum] Specify using the first element of `array` as
   *  the initial value.
   * @returns {*} Returns the accumulated value.
   */
  function arrayReduce(array, iteratee, accumulator, initAccum) {
    var index = -1,
        length = array == null ? 0 : array.length;

    if (initAccum && length) {
      accumulator = array[++index];
    }
    while (++index < length) {
      accumulator = iteratee(accumulator, array[index], index, array);
    }
    return accumulator;
  }

  /**
   * A specialized version of `_.reduceRight` for arrays without support for
   * iteratee shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @param {*} [accumulator] The initial value.
   * @param {boolean} [initAccum] Specify using the last element of `array` as
   *  the initial value.
   * @returns {*} Returns the accumulated value.
   */
  function arrayReduceRight(array, iteratee, accumulator, initAccum) {
    var length = array == null ? 0 : array.length;
    if (initAccum && length) {
      accumulator = array[--length];
    }
    while (length--) {
      accumulator = iteratee(accumulator, array[length], length, array);
    }
    return accumulator;
  }

  /**
   * A specialized version of `_.some` for arrays without support for iteratee
   * shorthands.
   *
   * @private
   * @param {Array} [array] The array to iterate over.
   * @param {Function} predicate The function invoked per iteration.
   * @returns {boolean} Returns `true` if any element passes the predicate check,
   *  else `false`.
   */
  function arraySome(array, predicate) {
    var index = -1,
        length = array == null ? 0 : array.length;

    while (++index < length) {
      if (predicate(array[index], index, array)) {
        return true;
      }
    }
    return false;
  }

  /**
   * Gets the size of an ASCII `string`.
   *
   * @private
   * @param {string} string The string inspect.
   * @returns {number} Returns the string size.
   */
  var asciiSize = baseProperty('length');

  /**
   * Converts an ASCII `string` to an array.
   *
   * @private
   * @param {string} string The string to convert.
   * @returns {Array} Returns the converted array.
   */
  function asciiToArray(string) {
    return string.split('');
  }

  /**
   * Splits an ASCII `string` into an array of its words.
   *
   * @private
   * @param {string} The string to inspect.
   * @returns {Array} Returns the words of `string`.
   */
  function asciiWords(string) {
    return string.match(reAsciiWord) || [];
  }

  /**
   * The base implementation of methods like `_.findKey` and `_.findLastKey`,
   * without support for iteratee shorthands, which iterates over `collection`
   * using `eachFunc`.
   *
   * @private
   * @param {Array|Object} collection The collection to inspect.
   * @param {Function} predicate The function invoked per iteration.
   * @param {Function} eachFunc The function to iterate over `collection`.
   * @returns {*} Returns the found element or its key, else `undefined`.
   */
  function baseFindKey(collection, predicate, eachFunc) {
    var result;
    eachFunc(collection, function(value, key, collection) {
      if (predicate(value, key, collection)) {
        result = key;
        return false;
      }
    });
    return result;
  }

  /**
   * The base implementation of `_.findIndex` and `_.findLastIndex` without
   * support for iteratee shorthands.
   *
   * @private
   * @param {Array} array The array to inspect.
   * @param {Function} predicate The function invoked per iteration.
   * @param {number} fromIndex The index to search from.
   * @param {boolean} [fromRight] Specify iterating from right to left.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function baseFindIndex(array, predicate, fromIndex, fromRight) {
    var length = array.length,
        index = fromIndex + (fromRight ? 1 : -1);

    while ((fromRight ? index-- : ++index < length)) {
      if (predicate(array[index], index, array)) {
        return index;
      }
    }
    return -1;
  }

  /**
   * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
   *
   * @private
   * @param {Array} array The array to inspect.
   * @param {*} value The value to search for.
   * @param {number} fromIndex The index to search from.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function baseIndexOf(array, value, fromIndex) {
    return value === value
      ? strictIndexOf(array, value, fromIndex)
      : baseFindIndex(array, baseIsNaN, fromIndex);
  }

  /**
   * This function is like `baseIndexOf` except that it accepts a comparator.
   *
   * @private
   * @param {Array} array The array to inspect.
   * @param {*} value The value to search for.
   * @param {number} fromIndex The index to search from.
   * @param {Function} comparator The comparator invoked per element.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function baseIndexOfWith(array, value, fromIndex, comparator) {
    var index = fromIndex - 1,
        length = array.length;

    while (++index < length) {
      if (comparator(array[index], value)) {
        return index;
      }
    }
    return -1;
  }

  /**
   * The base implementation of `_.isNaN` without support for number objects.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
   */
  function baseIsNaN(value) {
    return value !== value;
  }

  /**
   * The base implementation of `_.mean` and `_.meanBy` without support for
   * iteratee shorthands.
   *
   * @private
   * @param {Array} array The array to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {number} Returns the mean.
   */
  function baseMean(array, iteratee) {
    var length = array == null ? 0 : array.length;
    return length ? (baseSum(array, iteratee) / length) : NAN;
  }

  /**
   * The base implementation of `_.property` without support for deep paths.
   *
   * @private
   * @param {string} key The key of the property to get.
   * @returns {Function} Returns the new accessor function.
   */
  function baseProperty(key) {
    return function(object) {
      return object == null ? undefined : object[key];
    };
  }

  /**
   * The base implementation of `_.propertyOf` without support for deep paths.
   *
   * @private
   * @param {Object} object The object to query.
   * @returns {Function} Returns the new accessor function.
   */
  function basePropertyOf(object) {
    return function(key) {
      return object == null ? undefined : object[key];
    };
  }

  /**
   * The base implementation of `_.reduce` and `_.reduceRight`, without support
   * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
   *
   * @private
   * @param {Array|Object} collection The collection to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @param {*} accumulator The initial value.
   * @param {boolean} initAccum Specify using the first or last element of
   *  `collection` as the initial value.
   * @param {Function} eachFunc The function to iterate over `collection`.
   * @returns {*} Returns the accumulated value.
   */
  function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
    eachFunc(collection, function(value, index, collection) {
      accumulator = initAccum
        ? (initAccum = false, value)
        : iteratee(accumulator, value, index, collection);
    });
    return accumulator;
  }

  /**
   * The base implementation of `_.sortBy` which uses `comparer` to define the
   * sort order of `array` and replaces criteria objects with their corresponding
   * values.
   *
   * @private
   * @param {Array} array The array to sort.
   * @param {Function} comparer The function to define sort order.
   * @returns {Array} Returns `array`.
   */
  function baseSortBy(array, comparer) {
    var length = array.length;

    array.sort(comparer);
    while (length--) {
      array[length] = array[length].value;
    }
    return array;
  }

  /**
   * The base implementation of `_.sum` and `_.sumBy` without support for
   * iteratee shorthands.
   *
   * @private
   * @param {Array} array The array to iterate over.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {number} Returns the sum.
   */
  function baseSum(array, iteratee) {
    var result,
        index = -1,
        length = array.length;

    while (++index < length) {
      var current = iteratee(array[index]);
      if (current !== undefined) {
        result = result === undefined ? current : (result + current);
      }
    }
    return result;
  }

  /**
   * The base implementation of `_.times` without support for iteratee shorthands
   * or max array length checks.
   *
   * @private
   * @param {number} n The number of times to invoke `iteratee`.
   * @param {Function} iteratee The function invoked per iteration.
   * @returns {Array} Returns the array of results.
   */
  function baseTimes(n, iteratee) {
    var index = -1,
        result = Array(n);

    while (++index < n) {
      result[index] = iteratee(index);
    }
    return result;
  }

  /**
   * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
   * of key-value pairs for `object` corresponding to the property names of `props`.
   *
   * @private
   * @param {Object} object The object to query.
   * @param {Array} props The property names to get values for.
   * @returns {Object} Returns the key-value pairs.
   */
  function baseToPairs(object, props) {
    return arrayMap(props, function(key) {
      return [key, object[key]];
    });
  }

  /**
   * The base implementation of `_.trim`.
   *
   * @private
   * @param {string} string The string to trim.
   * @returns {string} Returns the trimmed string.
   */
  function baseTrim(string) {
    return string
      ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
      : string;
  }

  /**
   * The base implementation of `_.unary` without support for storing metadata.
   *
   * @private
   * @param {Function} func The function to cap arguments for.
   * @returns {Function} Returns the new capped function.
   */
  function baseUnary(func) {
    return function(value) {
      return func(value);
    };
  }

  /**
   * The base implementation of `_.values` and `_.valuesIn` which creates an
   * array of `object` property values corresponding to the property names
   * of `props`.
   *
   * @private
   * @param {Object} object The object to query.
   * @param {Array} props The property names to get values for.
   * @returns {Object} Returns the array of property values.
   */
  function baseValues(object, props) {
    return arrayMap(props, function(key) {
      return object[key];
    });
  }

  /**
   * Checks if a `cache` value for `key` exists.
   *
   * @private
   * @param {Object} cache The cache to query.
   * @param {string} key The key of the entry to check.
   * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
   */
  function cacheHas(cache, key) {
    return cache.has(key);
  }

  /**
   * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
   * that is not found in the character symbols.
   *
   * @private
   * @param {Array} strSymbols The string symbols to inspect.
   * @param {Array} chrSymbols The character symbols to find.
   * @returns {number} Returns the index of the first unmatched string symbol.
   */
  function charsStartIndex(strSymbols, chrSymbols) {
    var index = -1,
        length = strSymbols.length;

    while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
    return index;
  }

  /**
   * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
   * that is not found in the character symbols.
   *
   * @private
   * @param {Array} strSymbols The string symbols to inspect.
   * @param {Array} chrSymbols The character symbols to find.
   * @returns {number} Returns the index of the last unmatched string symbol.
   */
  function charsEndIndex(strSymbols, chrSymbols) {
    var index = strSymbols.length;

    while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
    return index;
  }

  /**
   * Gets the number of `placeholder` occurrences in `array`.
   *
   * @private
   * @param {Array} array The array to inspect.
   * @param {*} placeholder The placeholder to search for.
   * @returns {number} Returns the placeholder count.
   */
  function countHolders(array, placeholder) {
    var length = array.length,
        result = 0;

    while (length--) {
      if (array[length] === placeholder) {
        ++result;
      }
    }
    return result;
  }

  /**
   * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
   * letters to basic Latin letters.
   *
   * @private
   * @param {string} letter The matched letter to deburr.
   * @returns {string} Returns the deburred letter.
   */
  var deburrLetter = basePropertyOf(deburredLetters);

  /**
   * Used by `_.escape` to convert characters to HTML entities.
   *
   * @private
   * @param {string} chr The matched character to escape.
   * @returns {string} Returns the escaped character.
   */
  var escapeHtmlChar = basePropertyOf(htmlEscapes);

  /**
   * Used by `_.template` to escape characters for inclusion in compiled string literals.
   *
   * @private
   * @param {string} chr The matched character to escape.
   * @returns {string} Returns the escaped character.
   */
  function escapeStringChar(chr) {
    return '\\' + stringEscapes[chr];
  }

  /**
   * Gets the value at `key` of `object`.
   *
   * @private
   * @param {Object} [object] The object to query.
   * @param {string} key The key of the property to get.
   * @returns {*} Returns the property value.
   */
  function getValue(object, key) {
    return object == null ? undefined : object[key];
  }

  /**
   * Checks if `string` contains Unicode symbols.
   *
   * @private
   * @param {string} string The string to inspect.
   * @returns {boolean} Returns `true` if a symbol is found, else `false`.
   */
  function hasUnicode(string) {
    return reHasUnicode.test(string);
  }

  /**
   * Checks if `string` contains a word composed of Unicode symbols.
   *
   * @private
   * @param {string} string The string to inspect.
   * @returns {boolean} Returns `true` if a word is found, else `false`.
   */
  function hasUnicodeWord(string) {
    return reHasUnicodeWord.test(string);
  }

  /**
   * Converts `iterator` to an array.
   *
   * @private
   * @param {Object} iterator The iterator to convert.
   * @returns {Array} Returns the converted array.
   */
  function iteratorToArray(iterator) {
    var data,
        result = [];

    while (!(data = iterator.next()).done) {
      result.push(data.value);
    }
    return result;
  }

  /**
   * Converts `map` to its key-value pairs.
   *
   * @private
   * @param {Object} map The map to convert.
   * @returns {Array} Returns the key-value pairs.
   */
  function mapToArray(map) {
    var index = -1,
        result = Array(map.size);

    map.forEach(function(value, key) {
      result[++index] = [key, value];
    });
    return result;
  }

  /**
   * Creates a unary function that invokes `func` with its argument transformed.
   *
   * @private
   * @param {Function} func The function to wrap.
   * @param {Function} transform The argument transform.
   * @returns {Function} Returns the new function.
   */
  function overArg(func, transform) {
    return function(arg) {
      return func(transform(arg));
    };
  }

  /**
   * Replaces all `placeholder` elements in `array` with an internal placeholder
   * and returns an array of their indexes.
   *
   * @private
   * @param {Array} array The array to modify.
   * @param {*} placeholder The placeholder to replace.
   * @returns {Array} Returns the new array of placeholder indexes.
   */
  function replaceHolders(array, placeholder) {
    var index = -1,
        length = array.length,
        resIndex = 0,
        result = [];

    while (++index < length) {
      var value = array[index];
      if (value === placeholder || value === PLACEHOLDER) {
        array[index] = PLACEHOLDER;
        result[resIndex++] = index;
      }
    }
    return result;
  }

  /**
   * Converts `set` to an array of its values.
   *
   * @private
   * @param {Object} set The set to convert.
   * @returns {Array} Returns the values.
   */
  function setToArray(set) {
    var index = -1,
        result = Array(set.size);

    set.forEach(function(value) {
      result[++index] = value;
    });
    return result;
  }

  /**
   * Converts `set` to its value-value pairs.
   *
   * @private
   * @param {Object} set The set to convert.
   * @returns {Array} Returns the value-value pairs.
   */
  function setToPairs(set) {
    var index = -1,
        result = Array(set.size);

    set.forEach(function(value) {
      result[++index] = [value, value];
    });
    return result;
  }

  /**
   * A specialized version of `_.indexOf` which performs strict equality
   * comparisons of values, i.e. `===`.
   *
   * @private
   * @param {Array} array The array to inspect.
   * @param {*} value The value to search for.
   * @param {number} fromIndex The index to search from.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function strictIndexOf(array, value, fromIndex) {
    var index = fromIndex - 1,
        length = array.length;

    while (++index < length) {
      if (array[index] === value) {
        return index;
      }
    }
    return -1;
  }

  /**
   * A specialized version of `_.lastIndexOf` which performs strict equality
   * comparisons of values, i.e. `===`.
   *
   * @private
   * @param {Array} array The array to inspect.
   * @param {*} value The value to search for.
   * @param {number} fromIndex The index to search from.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function strictLastIndexOf(array, value, fromIndex) {
    var index = fromIndex + 1;
    while (index--) {
      if (array[index] === value) {
        return index;
      }
    }
    return index;
  }

  /**
   * Gets the number of symbols in `string`.
   *
   * @private
   * @param {string} string The string to inspect.
   * @returns {number} Returns the string size.
   */
  function stringSize(string) {
    return hasUnicode(string)
      ? unicodeSize(string)
      : asciiSize(string);
  }

  /**
   * Converts `string` to an array.
   *
   * @private
   * @param {string} string The string to convert.
   * @returns {Array} Returns the converted array.
   */
  function stringToArray(string) {
    return hasUnicode(string)
      ? unicodeToArray(string)
      : asciiToArray(string);
  }

  /**
   * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
   * character of `string`.
   *
   * @private
   * @param {string} string The string to inspect.
   * @returns {number} Returns the index of the last non-whitespace character.
   */
  function trimmedEndIndex(string) {
    var index = string.length;

    while (index-- && reWhitespace.test(string.charAt(index))) {}
    return index;
  }

  /**
   * Used by `_.unescape` to convert HTML entities to characters.
   *
   * @private
   * @param {string} chr The matched character to unescape.
   * @returns {string} Returns the unescaped character.
   */
  var unescapeHtmlChar = basePropertyOf(htmlUnescapes);

  /**
   * Gets the size of a Unicode `string`.
   *
   * @private
   * @param {string} string The string inspect.
   * @returns {number} Returns the string size.
   */
  function unicodeSize(string) {
    var result = reUnicode.lastIndex = 0;
    while (reUnicode.test(string)) {
      ++result;
    }
    return result;
  }

  /**
   * Converts a Unicode `string` to an array.
   *
   * @private
   * @param {string} string The string to convert.
   * @returns {Array} Returns the converted array.
   */
  function unicodeToArray(string) {
    return string.match(reUnicode) || [];
  }

  /**
   * Splits a Unicode `string` into an array of its words.
   *
   * @private
   * @param {string} The string to inspect.
   * @returns {Array} Returns the words of `string`.
   */
  function unicodeWords(string) {
    return string.match(reUnicodeWord) || [];
  }

  /*--------------------------------------------------------------------------*/

  /**
   * Create a new pristine `lodash` function using the `context` object.
   *
   * @static
   * @memberOf _
   * @since 1.1.0
   * @category Util
   * @param {Object} [context=root] The context object.
   * @returns {Function} Returns a new `lodash` function.
   * @example
   *
   * _.mixin({ 'foo': _.constant('foo') });
   *
   * var lodash = _.runInContext();
   * lodash.mixin({ 'bar': lodash.constant('bar') });
   *
   * _.isFunction(_.foo);
   * // => true
   * _.isFunction(_.bar);
   * // => false
   *
   * lodash.isFunction(lodash.foo);
   * // => false
   * lodash.isFunction(lodash.bar);
   * // => true
   *
   * // Create a suped-up `defer` in Node.js.
   * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
   */
  var runInContext = (function runInContext(context) {
    context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));

    /** Built-in constructor references. */
    var Array = context.Array,
        Date = context.Date,
        Error = context.Error,
        Function = context.Function,
        Math = context.Math,
        Object = context.Object,
        RegExp = context.RegExp,
        String = context.String,
        TypeError = context.TypeError;

    /** Used for built-in method references. */
    var arrayProto = Array.prototype,
        funcProto = Function.prototype,
        objectProto = Object.prototype;

    /** Used to detect overreaching core-js shims. */
    var coreJsData = context['__core-js_shared__'];

    /** Used to resolve the decompiled source of functions. */
    var funcToString = funcProto.toString;

    /** Used to check objects for own properties. */
    var hasOwnProperty = objectProto.hasOwnProperty;

    /** Used to generate unique IDs. */
    var idCounter = 0;

    /** Used to detect methods masquerading as native. */
    var maskSrcKey = (function() {
      var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
      return uid ? ('Symbol(src)_1.' + uid) : '';
    }());

    /**
     * Used to resolve the
     * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
     * of values.
     */
    var nativeObjectToString = objectProto.toString;

    /** Used to infer the `Object` constructor. */
    var objectCtorString = funcToString.call(Object);

    /** Used to restore the original `_` reference in `_.noConflict`. */
    var oldDash = root._;

    /** Used to detect if a method is native. */
    var reIsNative = RegExp('^' +
      funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
      .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
    );

    /** Built-in value references. */
    var Buffer = moduleExports ? context.Buffer : undefined,
        Symbol = context.Symbol,
        Uint8Array = context.Uint8Array,
        allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
        getPrototype = overArg(Object.getPrototypeOf, Object),
        objectCreate = Object.create,
        propertyIsEnumerable = objectProto.propertyIsEnumerable,
        splice = arrayProto.splice,
        spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
        symIterator = Symbol ? Symbol.iterator : undefined,
        symToStringTag = Symbol ? Symbol.toStringTag : undefined;

    var defineProperty = (function() {
      try {
        var func = getNative(Object, 'defineProperty');
        func({}, '', {});
        return func;
      } catch (e) {}
    }());

    /** Mocked built-ins. */
    var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
        ctxNow = Date && Date.now !== root.Date.now && Date.now,
        ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;

    /* Built-in method references for those with the same name as other `lodash` methods. */
    var nativeCeil = Math.ceil,
        nativeFloor = Math.floor,
        nativeGetSymbols = Object.getOwnPropertySymbols,
        nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
        nativeIsFinite = context.isFinite,
        nativeJoin = arrayProto.join,
        nativeKeys = overArg(Object.keys, Object),
        nativeMax = Math.max,
        nativeMin = Math.min,
        nativeNow = Date.now,
        nativeParseInt = context.parseInt,
        nativeRandom = Math.random,
        nativeReverse = arrayProto.reverse;

    /* Built-in method references that are verified to be native. */
    var DataView = getNative(context, 'DataView'),
        Map = getNative(context, 'Map'),
        Promise = getNative(context, 'Promise'),
        Set = getNative(context, 'Set'),
        WeakMap = getNative(context, 'WeakMap'),
        nativeCreate = getNative(Object, 'create');

    /** Used to store function metadata. */
    var metaMap = WeakMap && new WeakMap;

    /** Used to lookup unminified function names. */
    var realNames = {};

    /** Used to detect maps, sets, and weakmaps. */
    var dataViewCtorString = toSource(DataView),
        mapCtorString = toSource(Map),
        promiseCtorString = toSource(Promise),
        setCtorString = toSource(Set),
        weakMapCtorString = toSource(WeakMap);

    /** Used to convert symbols to primitives and strings. */
    var symbolProto = Symbol ? Symbol.prototype : undefined,
        symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
        symbolToString = symbolProto ? symbolProto.toString : undefined;

    /*------------------------------------------------------------------------*/

    /**
     * Creates a `lodash` object which wraps `value` to enable implicit method
     * chain sequences. Methods that operate on and return arrays, collections,
     * and functions can be chained together. Methods that retrieve a single value
     * or may return a primitive value will automatically end the chain sequence
     * and return the unwrapped value. Otherwise, the value must be unwrapped
     * with `_#value`.
     *
     * Explicit chain sequences, which must be unwrapped with `_#value`, may be
     * enabled using `_.chain`.
     *
     * The execution of chained methods is lazy, that is, it's deferred until
     * `_#value` is implicitly or explicitly called.
     *
     * Lazy evaluation allows several methods to support shortcut fusion.
     * Shortcut fusion is an optimization to merge iteratee calls; this avoids
     * the creation of intermediate arrays and can greatly reduce the number of
     * iteratee executions. Sections of a chain sequence qualify for shortcut
     * fusion if the section is applied to an array and iteratees accept only
     * one argument. The heuristic for whether a section qualifies for shortcut
     * fusion is subject to change.
     *
     * Chaining is supported in custom builds as long as the `_#value` method is
     * directly or indirectly included in the build.
     *
     * In addition to lodash methods, wrappers have `Array` and `String` methods.
     *
     * The wrapper `Array` methods are:
     * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
     *
     * The wrapper `String` methods are:
     * `replace` and `split`
     *
     * The wrapper methods that support shortcut fusion are:
     * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
     * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
     * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
     *
     * The chainable wrapper methods are:
     * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
     * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
     * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
     * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
     * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
     * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
     * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
     * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
     * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
     * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
     * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
     * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
     * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
     * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
     * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
     * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
     * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
     * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
     * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
     * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
     * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
     * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
     * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
     * `zipObject`, `zipObjectDeep`, and `zipWith`
     *
     * The wrapper methods that are **not** chainable by default are:
     * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
     * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
     * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
     * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
     * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
     * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
     * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
     * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
     * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
     * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
     * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
     * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
     * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
     * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
     * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
     * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
     * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
     * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
     * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
     * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
     * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
     * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
     * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
     * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
     * `upperFirst`, `value`, and `words`
     *
     * @name _
     * @constructor
     * @category Seq
     * @param {*} value The value to wrap in a `lodash` instance.
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * function square(n) {
     *   return n * n;
     * }
     *
     * var wrapped = _([1, 2, 3]);
     *
     * // Returns an unwrapped value.
     * wrapped.reduce(_.add);
     * // => 6
     *
     * // Returns a wrapped value.
     * var squares = wrapped.map(square);
     *
     * _.isArray(squares);
     * // => false
     *
     * _.isArray(squares.value());
     * // => true
     */
    function lodash(value) {
      if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
        if (value instanceof LodashWrapper) {
          return value;
        }
        if (hasOwnProperty.call(value, '__wrapped__')) {
          return wrapperClone(value);
        }
      }
      return new LodashWrapper(value);
    }

    /**
     * The base implementation of `_.create` without support for assigning
     * properties to the created object.
     *
     * @private
     * @param {Object} proto The object to inherit from.
     * @returns {Object} Returns the new object.
     */
    var baseCreate = (function() {
      function object() {}
      return function(proto) {
        if (!isObject(proto)) {
          return {};
        }
        if (objectCreate) {
          return objectCreate(proto);
        }
        object.prototype = proto;
        var result = new object;
        object.prototype = undefined;
        return result;
      };
    }());

    /**
     * The function whose prototype chain sequence wrappers inherit from.
     *
     * @private
     */
    function baseLodash() {
      // No operation performed.
    }

    /**
     * The base constructor for creating `lodash` wrapper objects.
     *
     * @private
     * @param {*} value The value to wrap.
     * @param {boolean} [chainAll] Enable explicit method chain sequences.
     */
    function LodashWrapper(value, chainAll) {
      this.__wrapped__ = value;
      this.__actions__ = [];
      this.__chain__ = !!chainAll;
      this.__index__ = 0;
      this.__values__ = undefined;
    }

    /**
     * By default, the template delimiters used by lodash are like those in
     * embedded Ruby (ERB) as well as ES2015 template strings. Change the
     * following template settings to use alternative delimiters.
     *
     * @static
     * @memberOf _
     * @type {Object}
     */
    lodash.templateSettings = {

      /**
       * Used to detect `data` property values to be HTML-escaped.
       *
       * @memberOf _.templateSettings
       * @type {RegExp}
       */
      'escape': reEscape,

      /**
       * Used to detect code to be evaluated.
       *
       * @memberOf _.templateSettings
       * @type {RegExp}
       */
      'evaluate': reEvaluate,

      /**
       * Used to detect `data` property values to inject.
       *
       * @memberOf _.templateSettings
       * @type {RegExp}
       */
      'interpolate': reInterpolate,

      /**
       * Used to reference the data object in the template text.
       *
       * @memberOf _.templateSettings
       * @type {string}
       */
      'variable': '',

      /**
       * Used to import variables into the compiled template.
       *
       * @memberOf _.templateSettings
       * @type {Object}
       */
      'imports': {

        /**
         * A reference to the `lodash` function.
         *
         * @memberOf _.templateSettings.imports
         * @type {Function}
         */
        '_': lodash
      }
    };

    // Ensure wrappers are instances of `baseLodash`.
    lodash.prototype = baseLodash.prototype;
    lodash.prototype.constructor = lodash;

    LodashWrapper.prototype = baseCreate(baseLodash.prototype);
    LodashWrapper.prototype.constructor = LodashWrapper;

    /*------------------------------------------------------------------------*/

    /**
     * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
     *
     * @private
     * @constructor
     * @param {*} value The value to wrap.
     */
    function LazyWrapper(value) {
      this.__wrapped__ = value;
      this.__actions__ = [];
      this.__dir__ = 1;
      this.__filtered__ = false;
      this.__iteratees__ = [];
      this.__takeCount__ = MAX_ARRAY_LENGTH;
      this.__views__ = [];
    }

    /**
     * Creates a clone of the lazy wrapper object.
     *
     * @private
     * @name clone
     * @memberOf LazyWrapper
     * @returns {Object} Returns the cloned `LazyWrapper` object.
     */
    function lazyClone() {
      var result = new LazyWrapper(this.__wrapped__);
      result.__actions__ = copyArray(this.__actions__);
      result.__dir__ = this.__dir__;
      result.__filtered__ = this.__filtered__;
      result.__iteratees__ = copyArray(this.__iteratees__);
      result.__takeCount__ = this.__takeCount__;
      result.__views__ = copyArray(this.__views__);
      return result;
    }

    /**
     * Reverses the direction of lazy iteration.
     *
     * @private
     * @name reverse
     * @memberOf LazyWrapper
     * @returns {Object} Returns the new reversed `LazyWrapper` object.
     */
    function lazyReverse() {
      if (this.__filtered__) {
        var result = new LazyWrapper(this);
        result.__dir__ = -1;
        result.__filtered__ = true;
      } else {
        result = this.clone();
        result.__dir__ *= -1;
      }
      return result;
    }

    /**
     * Extracts the unwrapped value from its lazy wrapper.
     *
     * @private
     * @name value
     * @memberOf LazyWrapper
     * @returns {*} Returns the unwrapped value.
     */
    function lazyValue() {
      var array = this.__wrapped__.value(),
          dir = this.__dir__,
          isArr = isArray(array),
          isRight = dir < 0,
          arrLength = isArr ? array.length : 0,
          view = getView(0, arrLength, this.__views__),
          start = view.start,
          end = view.end,
          length = end - start,
          index = isRight ? end : (start - 1),
          iteratees = this.__iteratees__,
          iterLength = iteratees.length,
          resIndex = 0,
          takeCount = nativeMin(length, this.__takeCount__);

      if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
        return baseWrapperValue(array, this.__actions__);
      }
      var result = [];

      outer:
      while (length-- && resIndex < takeCount) {
        index += dir;

        var iterIndex = -1,
            value = array[index];

        while (++iterIndex < iterLength) {
          var data = iteratees[iterIndex],
              iteratee = data.iteratee,
              type = data.type,
              computed = iteratee(value);

          if (type == LAZY_MAP_FLAG) {
            value = computed;
          } else if (!computed) {
            if (type == LAZY_FILTER_FLAG) {
              continue outer;
            } else {
              break outer;
            }
          }
        }
        result[resIndex++] = value;
      }
      return result;
    }

    // Ensure `LazyWrapper` is an instance of `baseLodash`.
    LazyWrapper.prototype = baseCreate(baseLodash.prototype);
    LazyWrapper.prototype.constructor = LazyWrapper;

    /*------------------------------------------------------------------------*/

    /**
     * Creates a hash object.
     *
     * @private
     * @constructor
     * @param {Array} [entries] The key-value pairs to cache.
     */
    function Hash(entries) {
      var index = -1,
          length = entries == null ? 0 : entries.length;

      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }

    /**
     * Removes all key-value entries from the hash.
     *
     * @private
     * @name clear
     * @memberOf Hash
     */
    function hashClear() {
      this.__data__ = nativeCreate ? nativeCreate(null) : {};
      this.size = 0;
    }

    /**
     * Removes `key` and its value from the hash.
     *
     * @private
     * @name delete
     * @memberOf Hash
     * @param {Object} hash The hash to modify.
     * @param {string} key The key of the value to remove.
     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
     */
    function hashDelete(key) {
      var result = this.has(key) && delete this.__data__[key];
      this.size -= result ? 1 : 0;
      return result;
    }

    /**
     * Gets the hash value for `key`.
     *
     * @private
     * @name get
     * @memberOf Hash
     * @param {string} key The key of the value to get.
     * @returns {*} Returns the entry value.
     */
    function hashGet(key) {
      var data = this.__data__;
      if (nativeCreate) {
        var result = data[key];
        return result === HASH_UNDEFINED ? undefined : result;
      }
      return hasOwnProperty.call(data, key) ? data[key] : undefined;
    }

    /**
     * Checks if a hash value for `key` exists.
     *
     * @private
     * @name has
     * @memberOf Hash
     * @param {string} key The key of the entry to check.
     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
     */
    function hashHas(key) {
      var data = this.__data__;
      return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
    }

    /**
     * Sets the hash `key` to `value`.
     *
     * @private
     * @name set
     * @memberOf Hash
     * @param {string} key The key of the value to set.
     * @param {*} value The value to set.
     * @returns {Object} Returns the hash instance.
     */
    function hashSet(key, value) {
      var data = this.__data__;
      this.size += this.has(key) ? 0 : 1;
      data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
      return this;
    }

    // Add methods to `Hash`.
    Hash.prototype.clear = hashClear;
    Hash.prototype['delete'] = hashDelete;
    Hash.prototype.get = hashGet;
    Hash.prototype.has = hashHas;
    Hash.prototype.set = hashSet;

    /*------------------------------------------------------------------------*/

    /**
     * Creates an list cache object.
     *
     * @private
     * @constructor
     * @param {Array} [entries] The key-value pairs to cache.
     */
    function ListCache(entries) {
      var index = -1,
          length = entries == null ? 0 : entries.length;

      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }

    /**
     * Removes all key-value entries from the list cache.
     *
     * @private
     * @name clear
     * @memberOf ListCache
     */
    function listCacheClear() {
      this.__data__ = [];
      this.size = 0;
    }

    /**
     * Removes `key` and its value from the list cache.
     *
     * @private
     * @name delete
     * @memberOf ListCache
     * @param {string} key The key of the value to remove.
     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
     */
    function listCacheDelete(key) {
      var data = this.__data__,
          index = assocIndexOf(data, key);

      if (index < 0) {
        return false;
      }
      var lastIndex = data.length - 1;
      if (index == lastIndex) {
        data.pop();
      } else {
        splice.call(data, index, 1);
      }
      --this.size;
      return true;
    }

    /**
     * Gets the list cache value for `key`.
     *
     * @private
     * @name get
     * @memberOf ListCache
     * @param {string} key The key of the value to get.
     * @returns {*} Returns the entry value.
     */
    function listCacheGet(key) {
      var data = this.__data__,
          index = assocIndexOf(data, key);

      return index < 0 ? undefined : data[index][1];
    }

    /**
     * Checks if a list cache value for `key` exists.
     *
     * @private
     * @name has
     * @memberOf ListCache
     * @param {string} key The key of the entry to check.
     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
     */
    function listCacheHas(key) {
      return assocIndexOf(this.__data__, key) > -1;
    }

    /**
     * Sets the list cache `key` to `value`.
     *
     * @private
     * @name set
     * @memberOf ListCache
     * @param {string} key The key of the value to set.
     * @param {*} value The value to set.
     * @returns {Object} Returns the list cache instance.
     */
    function listCacheSet(key, value) {
      var data = this.__data__,
          index = assocIndexOf(data, key);

      if (index < 0) {
        ++this.size;
        data.push([key, value]);
      } else {
        data[index][1] = value;
      }
      return this;
    }

    // Add methods to `ListCache`.
    ListCache.prototype.clear = listCacheClear;
    ListCache.prototype['delete'] = listCacheDelete;
    ListCache.prototype.get = listCacheGet;
    ListCache.prototype.has = listCacheHas;
    ListCache.prototype.set = listCacheSet;

    /*------------------------------------------------------------------------*/

    /**
     * Creates a map cache object to store key-value pairs.
     *
     * @private
     * @constructor
     * @param {Array} [entries] The key-value pairs to cache.
     */
    function MapCache(entries) {
      var index = -1,
          length = entries == null ? 0 : entries.length;

      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }

    /**
     * Removes all key-value entries from the map.
     *
     * @private
     * @name clear
     * @memberOf MapCache
     */
    function mapCacheClear() {
      this.size = 0;
      this.__data__ = {
        'hash': new Hash,
        'map': new (Map || ListCache),
        'string': new Hash
      };
    }

    /**
     * Removes `key` and its value from the map.
     *
     * @private
     * @name delete
     * @memberOf MapCache
     * @param {string} key The key of the value to remove.
     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
     */
    function mapCacheDelete(key) {
      var result = getMapData(this, key)['delete'](key);
      this.size -= result ? 1 : 0;
      return result;
    }

    /**
     * Gets the map value for `key`.
     *
     * @private
     * @name get
     * @memberOf MapCache
     * @param {string} key The key of the value to get.
     * @returns {*} Returns the entry value.
     */
    function mapCacheGet(key) {
      return getMapData(this, key).get(key);
    }

    /**
     * Checks if a map value for `key` exists.
     *
     * @private
     * @name has
     * @memberOf MapCache
     * @param {string} key The key of the entry to check.
     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
     */
    function mapCacheHas(key) {
      return getMapData(this, key).has(key);
    }

    /**
     * Sets the map `key` to `value`.
     *
     * @private
     * @name set
     * @memberOf MapCache
     * @param {string} key The key of the value to set.
     * @param {*} value The value to set.
     * @returns {Object} Returns the map cache instance.
     */
    function mapCacheSet(key, value) {
      var data = getMapData(this, key),
          size = data.size;

      data.set(key, value);
      this.size += data.size == size ? 0 : 1;
      return this;
    }

    // Add methods to `MapCache`.
    MapCache.prototype.clear = mapCacheClear;
    MapCache.prototype['delete'] = mapCacheDelete;
    MapCache.prototype.get = mapCacheGet;
    MapCache.prototype.has = mapCacheHas;
    MapCache.prototype.set = mapCacheSet;

    /*------------------------------------------------------------------------*/

    /**
     *
     * Creates an array cache object to store unique values.
     *
     * @private
     * @constructor
     * @param {Array} [values] The values to cache.
     */
    function SetCache(values) {
      var index = -1,
          length = values == null ? 0 : values.length;

      this.__data__ = new MapCache;
      while (++index < length) {
        this.add(values[index]);
      }
    }

    /**
     * Adds `value` to the array cache.
     *
     * @private
     * @name add
     * @memberOf SetCache
     * @alias push
     * @param {*} value The value to cache.
     * @returns {Object} Returns the cache instance.
     */
    function setCacheAdd(value) {
      this.__data__.set(value, HASH_UNDEFINED);
      return this;
    }

    /**
     * Checks if `value` is in the array cache.
     *
     * @private
     * @name has
     * @memberOf SetCache
     * @param {*} value The value to search for.
     * @returns {number} Returns `true` if `value` is found, else `false`.
     */
    function setCacheHas(value) {
      return this.__data__.has(value);
    }

    // Add methods to `SetCache`.
    SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
    SetCache.prototype.has = setCacheHas;

    /*------------------------------------------------------------------------*/

    /**
     * Creates a stack cache object to store key-value pairs.
     *
     * @private
     * @constructor
     * @param {Array} [entries] The key-value pairs to cache.
     */
    function Stack(entries) {
      var data = this.__data__ = new ListCache(entries);
      this.size = data.size;
    }

    /**
     * Removes all key-value entries from the stack.
     *
     * @private
     * @name clear
     * @memberOf Stack
     */
    function stackClear() {
      this.__data__ = new ListCache;
      this.size = 0;
    }

    /**
     * Removes `key` and its value from the stack.
     *
     * @private
     * @name delete
     * @memberOf Stack
     * @param {string} key The key of the value to remove.
     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
     */
    function stackDelete(key) {
      var data = this.__data__,
          result = data['delete'](key);

      this.size = data.size;
      return result;
    }

    /**
     * Gets the stack value for `key`.
     *
     * @private
     * @name get
     * @memberOf Stack
     * @param {string} key The key of the value to get.
     * @returns {*} Returns the entry value.
     */
    function stackGet(key) {
      return this.__data__.get(key);
    }

    /**
     * Checks if a stack value for `key` exists.
     *
     * @private
     * @name has
     * @memberOf Stack
     * @param {string} key The key of the entry to check.
     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
     */
    function stackHas(key) {
      return this.__data__.has(key);
    }

    /**
     * Sets the stack `key` to `value`.
     *
     * @private
     * @name set
     * @memberOf Stack
     * @param {string} key The key of the value to set.
     * @param {*} value The value to set.
     * @returns {Object} Returns the stack cache instance.
     */
    function stackSet(key, value) {
      var data = this.__data__;
      if (data instanceof ListCache) {
        var pairs = data.__data__;
        if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
          pairs.push([key, value]);
          this.size = ++data.size;
          return this;
        }
        data = this.__data__ = new MapCache(pairs);
      }
      data.set(key, value);
      this.size = data.size;
      return this;
    }

    // Add methods to `Stack`.
    Stack.prototype.clear = stackClear;
    Stack.prototype['delete'] = stackDelete;
    Stack.prototype.get = stackGet;
    Stack.prototype.has = stackHas;
    Stack.prototype.set = stackSet;

    /*------------------------------------------------------------------------*/

    /**
     * Creates an array of the enumerable property names of the array-like `value`.
     *
     * @private
     * @param {*} value The value to query.
     * @param {boolean} inherited Specify returning inherited property names.
     * @returns {Array} Returns the array of property names.
     */
    function arrayLikeKeys(value, inherited) {
      var isArr = isArray(value),
          isArg = !isArr && isArguments(value),
          isBuff = !isArr && !isArg && isBuffer(value),
          isType = !isArr && !isArg && !isBuff && isTypedArray(value),
          skipIndexes = isArr || isArg || isBuff || isType,
          result = skipIndexes ? baseTimes(value.length, String) : [],
          length = result.length;

      for (var key in value) {
        if ((inherited || hasOwnProperty.call(value, key)) &&
            !(skipIndexes && (
               // Safari 9 has enumerable `arguments.length` in strict mode.
               key == 'length' ||
               // Node.js 0.10 has enumerable non-index properties on buffers.
               (isBuff && (key == 'offset' || key == 'parent')) ||
               // PhantomJS 2 has enumerable non-index properties on typed arrays.
               (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
               // Skip index properties.
               isIndex(key, length)
            ))) {
          result.push(key);
        }
      }
      return result;
    }

    /**
     * A specialized version of `_.sample` for arrays.
     *
     * @private
     * @param {Array} array The array to sample.
     * @returns {*} Returns the random element.
     */
    function arraySample(array) {
      var length = array.length;
      return length ? array[baseRandom(0, length - 1)] : undefined;
    }

    /**
     * A specialized version of `_.sampleSize` for arrays.
     *
     * @private
     * @param {Array} array The array to sample.
     * @param {number} n The number of elements to sample.
     * @returns {Array} Returns the random elements.
     */
    function arraySampleSize(array, n) {
      return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
    }

    /**
     * A specialized version of `_.shuffle` for arrays.
     *
     * @private
     * @param {Array} array The array to shuffle.
     * @returns {Array} Returns the new shuffled array.
     */
    function arrayShuffle(array) {
      return shuffleSelf(copyArray(array));
    }

    /**
     * This function is like `assignValue` except that it doesn't assign
     * `undefined` values.
     *
     * @private
     * @param {Object} object The object to modify.
     * @param {string} key The key of the property to assign.
     * @param {*} value The value to assign.
     */
    function assignMergeValue(object, key, value) {
      if ((value !== undefined && !eq(object[key], value)) ||
          (value === undefined && !(key in object))) {
        baseAssignValue(object, key, value);
      }
    }

    /**
     * Assigns `value` to `key` of `object` if the existing value is not equivalent
     * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * for equality comparisons.
     *
     * @private
     * @param {Object} object The object to modify.
     * @param {string} key The key of the property to assign.
     * @param {*} value The value to assign.
     */
    function assignValue(object, key, value) {
      var objValue = object[key];
      if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
          (value === undefined && !(key in object))) {
        baseAssignValue(object, key, value);
      }
    }

    /**
     * Gets the index at which the `key` is found in `array` of key-value pairs.
     *
     * @private
     * @param {Array} array The array to inspect.
     * @param {*} key The key to search for.
     * @returns {number} Returns the index of the matched value, else `-1`.
     */
    function assocIndexOf(array, key) {
      var length = array.length;
      while (length--) {
        if (eq(array[length][0], key)) {
          return length;
        }
      }
      return -1;
    }

    /**
     * Aggregates elements of `collection` on `accumulator` with keys transformed
     * by `iteratee` and values set by `setter`.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} setter The function to set `accumulator` values.
     * @param {Function} iteratee The iteratee to transform keys.
     * @param {Object} accumulator The initial aggregated object.
     * @returns {Function} Returns `accumulator`.
     */
    function baseAggregator(collection, setter, iteratee, accumulator) {
      baseEach(collection, function(value, key, collection) {
        setter(accumulator, value, iteratee(value), collection);
      });
      return accumulator;
    }

    /**
     * The base implementation of `_.assign` without support for multiple sources
     * or `customizer` functions.
     *
     * @private
     * @param {Object} object The destination object.
     * @param {Object} source The source object.
     * @returns {Object} Returns `object`.
     */
    function baseAssign(object, source) {
      return object && copyObject(source, keys(source), object);
    }

    /**
     * The base implementation of `_.assignIn` without support for multiple sources
     * or `customizer` functions.
     *
     * @private
     * @param {Object} object The destination object.
     * @param {Object} source The source object.
     * @returns {Object} Returns `object`.
     */
    function baseAssignIn(object, source) {
      return object && copyObject(source, keysIn(source), object);
    }

    /**
     * The base implementation of `assignValue` and `assignMergeValue` without
     * value checks.
     *
     * @private
     * @param {Object} object The object to modify.
     * @param {string} key The key of the property to assign.
     * @param {*} value The value to assign.
     */
    function baseAssignValue(object, key, value) {
      if (key == '__proto__' && defineProperty) {
        defineProperty(object, key, {
          'configurable': true,
          'enumerable': true,
          'value': value,
          'writable': true
        });
      } else {
        object[key] = value;
      }
    }

    /**
     * The base implementation of `_.at` without support for individual paths.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {string[]} paths The property paths to pick.
     * @returns {Array} Returns the picked elements.
     */
    function baseAt(object, paths) {
      var index = -1,
          length = paths.length,
          result = Array(length),
          skip = object == null;

      while (++index < length) {
        result[index] = skip ? undefined : get(object, paths[index]);
      }
      return result;
    }

    /**
     * The base implementation of `_.clamp` which doesn't coerce arguments.
     *
     * @private
     * @param {number} number The number to clamp.
     * @param {number} [lower] The lower bound.
     * @param {number} upper The upper bound.
     * @returns {number} Returns the clamped number.
     */
    function baseClamp(number, lower, upper) {
      if (number === number) {
        if (upper !== undefined) {
          number = number <= upper ? number : upper;
        }
        if (lower !== undefined) {
          number = number >= lower ? number : lower;
        }
      }
      return number;
    }

    /**
     * The base implementation of `_.clone` and `_.cloneDeep` which tracks
     * traversed objects.
     *
     * @private
     * @param {*} value The value to clone.
     * @param {boolean} bitmask The bitmask flags.
     *  1 - Deep clone
     *  2 - Flatten inherited properties
     *  4 - Clone symbols
     * @param {Function} [customizer] The function to customize cloning.
     * @param {string} [key] The key of `value`.
     * @param {Object} [object] The parent object of `value`.
     * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
     * @returns {*} Returns the cloned value.
     */
    function baseClone(value, bitmask, customizer, key, object, stack) {
      var result,
          isDeep = bitmask & CLONE_DEEP_FLAG,
          isFlat = bitmask & CLONE_FLAT_FLAG,
          isFull = bitmask & CLONE_SYMBOLS_FLAG;

      if (customizer) {
        result = object ? customizer(value, key, object, stack) : customizer(value);
      }
      if (result !== undefined) {
        return result;
      }
      if (!isObject(value)) {
        return value;
      }
      var isArr = isArray(value);
      if (isArr) {
        result = initCloneArray(value);
        if (!isDeep) {
          return copyArray(value, result);
        }
      } else {
        var tag = getTag(value),
            isFunc = tag == funcTag || tag == genTag;

        if (isBuffer(value)) {
          return cloneBuffer(value, isDeep);
        }
        if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
          result = (isFlat || isFunc) ? {} : initCloneObject(value);
          if (!isDeep) {
            return isFlat
              ? copySymbolsIn(value, baseAssignIn(result, value))
              : copySymbols(value, baseAssign(result, value));
          }
        } else {
          if (!cloneableTags[tag]) {
            return object ? value : {};
          }
          result = initCloneByTag(value, tag, isDeep);
        }
      }
      // Check for circular references and return its corresponding clone.
      stack || (stack = new Stack);
      var stacked = stack.get(value);
      if (stacked) {
        return stacked;
      }
      stack.set(value, result);

      if (isSet(value)) {
        value.forEach(function(subValue) {
          result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
        });
      } else if (isMap(value)) {
        value.forEach(function(subValue, key) {
          result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
        });
      }

      var keysFunc = isFull
        ? (isFlat ? getAllKeysIn : getAllKeys)
        : (isFlat ? keysIn : keys);

      var props = isArr ? undefined : keysFunc(value);
      arrayEach(props || value, function(subValue, key) {
        if (props) {
          key = subValue;
          subValue = value[key];
        }
        // Recursively populate clone (susceptible to call stack limits).
        assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
      });
      return result;
    }

    /**
     * The base implementation of `_.conforms` which doesn't clone `source`.
     *
     * @private
     * @param {Object} source The object of property predicates to conform to.
     * @returns {Function} Returns the new spec function.
     */
    function baseConforms(source) {
      var props = keys(source);
      return function(object) {
        return baseConformsTo(object, source, props);
      };
    }

    /**
     * The base implementation of `_.conformsTo` which accepts `props` to check.
     *
     * @private
     * @param {Object} object The object to inspect.
     * @param {Object} source The object of property predicates to conform to.
     * @returns {boolean} Returns `true` if `object` conforms, else `false`.
     */
    function baseConformsTo(object, source, props) {
      var length = props.length;
      if (object == null) {
        return !length;
      }
      object = Object(object);
      while (length--) {
        var key = props[length],
            predicate = source[key],
            value = object[key];

        if ((value === undefined && !(key in object)) || !predicate(value)) {
          return false;
        }
      }
      return true;
    }

    /**
     * The base implementation of `_.delay` and `_.defer` which accepts `args`
     * to provide to `func`.
     *
     * @private
     * @param {Function} func The function to delay.
     * @param {number} wait The number of milliseconds to delay invocation.
     * @param {Array} args The arguments to provide to `func`.
     * @returns {number|Object} Returns the timer id or timeout object.
     */
    function baseDelay(func, wait, args) {
      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      return setTimeout(function() { func.apply(undefined, args); }, wait);
    }

    /**
     * The base implementation of methods like `_.difference` without support
     * for excluding multiple arrays or iteratee shorthands.
     *
     * @private
     * @param {Array} array The array to inspect.
     * @param {Array} values The values to exclude.
     * @param {Function} [iteratee] The iteratee invoked per element.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns the new array of filtered values.
     */
    function baseDifference(array, values, iteratee, comparator) {
      var index = -1,
          includes = arrayIncludes,
          isCommon = true,
          length = array.length,
          result = [],
          valuesLength = values.length;

      if (!length) {
        return result;
      }
      if (iteratee) {
        values = arrayMap(values, baseUnary(iteratee));
      }
      if (comparator) {
        includes = arrayIncludesWith;
        isCommon = false;
      }
      else if (values.length >= LARGE_ARRAY_SIZE) {
        includes = cacheHas;
        isCommon = false;
        values = new SetCache(values);
      }
      outer:
      while (++index < length) {
        var value = array[index],
            computed = iteratee == null ? value : iteratee(value);

        value = (comparator || value !== 0) ? value : 0;
        if (isCommon && computed === computed) {
          var valuesIndex = valuesLength;
          while (valuesIndex--) {
            if (values[valuesIndex] === computed) {
              continue outer;
            }
          }
          result.push(value);
        }
        else if (!includes(values, computed, comparator)) {
          result.push(value);
        }
      }
      return result;
    }

    /**
     * The base implementation of `_.forEach` without support for iteratee shorthands.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array|Object} Returns `collection`.
     */
    var baseEach = createBaseEach(baseForOwn);

    /**
     * The base implementation of `_.forEachRight` without support for iteratee shorthands.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array|Object} Returns `collection`.
     */
    var baseEachRight = createBaseEach(baseForOwnRight, true);

    /**
     * The base implementation of `_.every` without support for iteratee shorthands.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} predicate The function invoked per iteration.
     * @returns {boolean} Returns `true` if all elements pass the predicate check,
     *  else `false`
     */
    function baseEvery(collection, predicate) {
      var result = true;
      baseEach(collection, function(value, index, collection) {
        result = !!predicate(value, index, collection);
        return result;
      });
      return result;
    }

    /**
     * The base implementation of methods like `_.max` and `_.min` which accepts a
     * `comparator` to determine the extremum value.
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} iteratee The iteratee invoked per iteration.
     * @param {Function} comparator The comparator used to compare values.
     * @returns {*} Returns the extremum value.
     */
    function baseExtremum(array, iteratee, comparator) {
      var index = -1,
          length = array.length;

      while (++index < length) {
        var value = array[index],
            current = iteratee(value);

        if (current != null && (computed === undefined
              ? (current === current && !isSymbol(current))
              : comparator(current, computed)
            )) {
          var computed = current,
              result = value;
        }
      }
      return result;
    }

    /**
     * The base implementation of `_.fill` without an iteratee call guard.
     *
     * @private
     * @param {Array} array The array to fill.
     * @param {*} value The value to fill `array` with.
     * @param {number} [start=0] The start position.
     * @param {number} [end=array.length] The end position.
     * @returns {Array} Returns `array`.
     */
    function baseFill(array, value, start, end) {
      var length = array.length;

      start = toInteger(start);
      if (start < 0) {
        start = -start > length ? 0 : (length + start);
      }
      end = (end === undefined || end > length) ? length : toInteger(end);
      if (end < 0) {
        end += length;
      }
      end = start > end ? 0 : toLength(end);
      while (start < end) {
        array[start++] = value;
      }
      return array;
    }

    /**
     * The base implementation of `_.filter` without support for iteratee shorthands.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} predicate The function invoked per iteration.
     * @returns {Array} Returns the new filtered array.
     */
    function baseFilter(collection, predicate) {
      var result = [];
      baseEach(collection, function(value, index, collection) {
        if (predicate(value, index, collection)) {
          result.push(value);
        }
      });
      return result;
    }

    /**
     * The base implementation of `_.flatten` with support for restricting flattening.
     *
     * @private
     * @param {Array} array The array to flatten.
     * @param {number} depth The maximum recursion depth.
     * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
     * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
     * @param {Array} [result=[]] The initial result value.
     * @returns {Array} Returns the new flattened array.
     */
    function baseFlatten(array, depth, predicate, isStrict, result) {
      var index = -1,
          length = array.length;

      predicate || (predicate = isFlattenable);
      result || (result = []);

      while (++index < length) {
        var value = array[index];
        if (depth > 0 && predicate(value)) {
          if (depth > 1) {
            // Recursively flatten arrays (susceptible to call stack limits).
            baseFlatten(value, depth - 1, predicate, isStrict, result);
          } else {
            arrayPush(result, value);
          }
        } else if (!isStrict) {
          result[result.length] = value;
        }
      }
      return result;
    }

    /**
     * The base implementation of `baseForOwn` which iterates over `object`
     * properties returned by `keysFunc` and invokes `iteratee` for each property.
     * Iteratee functions may exit iteration early by explicitly returning `false`.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {Function} keysFunc The function to get the keys of `object`.
     * @returns {Object} Returns `object`.
     */
    var baseFor = createBaseFor();

    /**
     * This function is like `baseFor` except that it iterates over properties
     * in the opposite order.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {Function} keysFunc The function to get the keys of `object`.
     * @returns {Object} Returns `object`.
     */
    var baseForRight = createBaseFor(true);

    /**
     * The base implementation of `_.forOwn` without support for iteratee shorthands.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Object} Returns `object`.
     */
    function baseForOwn(object, iteratee) {
      return object && baseFor(object, iteratee, keys);
    }

    /**
     * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Object} Returns `object`.
     */
    function baseForOwnRight(object, iteratee) {
      return object && baseForRight(object, iteratee, keys);
    }

    /**
     * The base implementation of `_.functions` which creates an array of
     * `object` function property names filtered from `props`.
     *
     * @private
     * @param {Object} object The object to inspect.
     * @param {Array} props The property names to filter.
     * @returns {Array} Returns the function names.
     */
    function baseFunctions(object, props) {
      return arrayFilter(props, function(key) {
        return isFunction(object[key]);
      });
    }

    /**
     * The base implementation of `_.get` without support for default values.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {Array|string} path The path of the property to get.
     * @returns {*} Returns the resolved value.
     */
    function baseGet(object, path) {
      path = castPath(path, object);

      var index = 0,
          length = path.length;

      while (object != null && index < length) {
        object = object[toKey(path[index++])];
      }
      return (index && index == length) ? object : undefined;
    }

    /**
     * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
     * `keysFunc` and `symbolsFunc` to get the enumerable property names and
     * symbols of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {Function} keysFunc The function to get the keys of `object`.
     * @param {Function} symbolsFunc The function to get the symbols of `object`.
     * @returns {Array} Returns the array of property names and symbols.
     */
    function baseGetAllKeys(object, keysFunc, symbolsFunc) {
      var result = keysFunc(object);
      return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
    }

    /**
     * The base implementation of `getTag` without fallbacks for buggy environments.
     *
     * @private
     * @param {*} value The value to query.
     * @returns {string} Returns the `toStringTag`.
     */
    function baseGetTag(value) {
      if (value == null) {
        return value === undefined ? undefinedTag : nullTag;
      }
      return (symToStringTag && symToStringTag in Object(value))
        ? getRawTag(value)
        : objectToString(value);
    }

    /**
     * The base implementation of `_.gt` which doesn't coerce arguments.
     *
     * @private
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if `value` is greater than `other`,
     *  else `false`.
     */
    function baseGt(value, other) {
      return value > other;
    }

    /**
     * The base implementation of `_.has` without support for deep paths.
     *
     * @private
     * @param {Object} [object] The object to query.
     * @param {Array|string} key The key to check.
     * @returns {boolean} Returns `true` if `key` exists, else `false`.
     */
    function baseHas(object, key) {
      return object != null && hasOwnProperty.call(object, key);
    }

    /**
     * The base implementation of `_.hasIn` without support for deep paths.
     *
     * @private
     * @param {Object} [object] The object to query.
     * @param {Array|string} key The key to check.
     * @returns {boolean} Returns `true` if `key` exists, else `false`.
     */
    function baseHasIn(object, key) {
      return object != null && key in Object(object);
    }

    /**
     * The base implementation of `_.inRange` which doesn't coerce arguments.
     *
     * @private
     * @param {number} number The number to check.
     * @param {number} start The start of the range.
     * @param {number} end The end of the range.
     * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
     */
    function baseInRange(number, start, end) {
      return number >= nativeMin(start, end) && number < nativeMax(start, end);
    }

    /**
     * The base implementation of methods like `_.intersection`, without support
     * for iteratee shorthands, that accepts an array of arrays to inspect.
     *
     * @private
     * @param {Array} arrays The arrays to inspect.
     * @param {Function} [iteratee] The iteratee invoked per element.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns the new array of shared values.
     */
    function baseIntersection(arrays, iteratee, comparator) {
      var includes = comparator ? arrayIncludesWith : arrayIncludes,
          length = arrays[0].length,
          othLength = arrays.length,
          othIndex = othLength,
          caches = Array(othLength),
          maxLength = Infinity,
          result = [];

      while (othIndex--) {
        var array = arrays[othIndex];
        if (othIndex && iteratee) {
          array = arrayMap(array, baseUnary(iteratee));
        }
        maxLength = nativeMin(array.length, maxLength);
        caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
          ? new SetCache(othIndex && array)
          : undefined;
      }
      array = arrays[0];

      var index = -1,
          seen = caches[0];

      outer:
      while (++index < length && result.length < maxLength) {
        var value = array[index],
            computed = iteratee ? iteratee(value) : value;

        value = (comparator || value !== 0) ? value : 0;
        if (!(seen
              ? cacheHas(seen, computed)
              : includes(result, computed, comparator)
            )) {
          othIndex = othLength;
          while (--othIndex) {
            var cache = caches[othIndex];
            if (!(cache
                  ? cacheHas(cache, computed)
                  : includes(arrays[othIndex], computed, comparator))
                ) {
              continue outer;
            }
          }
          if (seen) {
            seen.push(computed);
          }
          result.push(value);
        }
      }
      return result;
    }

    /**
     * The base implementation of `_.invert` and `_.invertBy` which inverts
     * `object` with values transformed by `iteratee` and set by `setter`.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} setter The function to set `accumulator` values.
     * @param {Function} iteratee The iteratee to transform values.
     * @param {Object} accumulator The initial inverted object.
     * @returns {Function} Returns `accumulator`.
     */
    function baseInverter(object, setter, iteratee, accumulator) {
      baseForOwn(object, function(value, key, object) {
        setter(accumulator, iteratee(value), key, object);
      });
      return accumulator;
    }

    /**
     * The base implementation of `_.invoke` without support for individual
     * method arguments.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {Array|string} path The path of the method to invoke.
     * @param {Array} args The arguments to invoke the method with.
     * @returns {*} Returns the result of the invoked method.
     */
    function baseInvoke(object, path, args) {
      path = castPath(path, object);
      object = parent(object, path);
      var func = object == null ? object : object[toKey(last(path))];
      return func == null ? undefined : apply(func, object, args);
    }

    /**
     * The base implementation of `_.isArguments`.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an `arguments` object,
     */
    function baseIsArguments(value) {
      return isObjectLike(value) && baseGetTag(value) == argsTag;
    }

    /**
     * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
     */
    function baseIsArrayBuffer(value) {
      return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
    }

    /**
     * The base implementation of `_.isDate` without Node.js optimizations.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
     */
    function baseIsDate(value) {
      return isObjectLike(value) && baseGetTag(value) == dateTag;
    }

    /**
     * The base implementation of `_.isEqual` which supports partial comparisons
     * and tracks traversed objects.
     *
     * @private
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @param {boolean} bitmask The bitmask flags.
     *  1 - Unordered comparison
     *  2 - Partial comparison
     * @param {Function} [customizer] The function to customize comparisons.
     * @param {Object} [stack] Tracks traversed `value` and `other` objects.
     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
     */
    function baseIsEqual(value, other, bitmask, customizer, stack) {
      if (value === other) {
        return true;
      }
      if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
        return value !== value && other !== other;
      }
      return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
    }

    /**
     * A specialized version of `baseIsEqual` for arrays and objects which performs
     * deep comparisons and tracks traversed objects enabling objects with circular
     * references to be compared.
     *
     * @private
     * @param {Object} object The object to compare.
     * @param {Object} other The other object to compare.
     * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
     * @param {Function} customizer The function to customize comparisons.
     * @param {Function} equalFunc The function to determine equivalents of values.
     * @param {Object} [stack] Tracks traversed `object` and `other` objects.
     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
     */
    function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
      var objIsArr = isArray(object),
          othIsArr = isArray(other),
          objTag = objIsArr ? arrayTag : getTag(object),
          othTag = othIsArr ? arrayTag : getTag(other);

      objTag = objTag == argsTag ? objectTag : objTag;
      othTag = othTag == argsTag ? objectTag : othTag;

      var objIsObj = objTag == objectTag,
          othIsObj = othTag == objectTag,
          isSameTag = objTag == othTag;

      if (isSameTag && isBuffer(object)) {
        if (!isBuffer(other)) {
          return false;
        }
        objIsArr = true;
        objIsObj = false;
      }
      if (isSameTag && !objIsObj) {
        stack || (stack = new Stack);
        return (objIsArr || isTypedArray(object))
          ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
          : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
      }
      if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
        var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
            othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');

        if (objIsWrapped || othIsWrapped) {
          var objUnwrapped = objIsWrapped ? object.value() : object,
              othUnwrapped = othIsWrapped ? other.value() : other;

          stack || (stack = new Stack);
          return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
        }
      }
      if (!isSameTag) {
        return false;
      }
      stack || (stack = new Stack);
      return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
    }

    /**
     * The base implementation of `_.isMap` without Node.js optimizations.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a map, else `false`.
     */
    function baseIsMap(value) {
      return isObjectLike(value) && getTag(value) == mapTag;
    }

    /**
     * The base implementation of `_.isMatch` without support for iteratee shorthands.
     *
     * @private
     * @param {Object} object The object to inspect.
     * @param {Object} source The object of property values to match.
     * @param {Array} matchData The property names, values, and compare flags to match.
     * @param {Function} [customizer] The function to customize comparisons.
     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
     */
    function baseIsMatch(object, source, matchData, customizer) {
      var index = matchData.length,
          length = index,
          noCustomizer = !customizer;

      if (object == null) {
        return !length;
      }
      object = Object(object);
      while (index--) {
        var data = matchData[index];
        if ((noCustomizer && data[2])
              ? data[1] !== object[data[0]]
              : !(data[0] in object)
            ) {
          return false;
        }
      }
      while (++index < length) {
        data = matchData[index];
        var key = data[0],
            objValue = object[key],
            srcValue = data[1];

        if (noCustomizer && data[2]) {
          if (objValue === undefined && !(key in object)) {
            return false;
          }
        } else {
          var stack = new Stack;
          if (customizer) {
            var result = customizer(objValue, srcValue, key, object, source, stack);
          }
          if (!(result === undefined
                ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
                : result
              )) {
            return false;
          }
        }
      }
      return true;
    }

    /**
     * The base implementation of `_.isNative` without bad shim checks.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a native function,
     *  else `false`.
     */
    function baseIsNative(value) {
      if (!isObject(value) || isMasked(value)) {
        return false;
      }
      var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
      return pattern.test(toSource(value));
    }

    /**
     * The base implementation of `_.isRegExp` without Node.js optimizations.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
     */
    function baseIsRegExp(value) {
      return isObjectLike(value) && baseGetTag(value) == regexpTag;
    }

    /**
     * The base implementation of `_.isSet` without Node.js optimizations.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a set, else `false`.
     */
    function baseIsSet(value) {
      return isObjectLike(value) && getTag(value) == setTag;
    }

    /**
     * The base implementation of `_.isTypedArray` without Node.js optimizations.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
     */
    function baseIsTypedArray(value) {
      return isObjectLike(value) &&
        isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
    }

    /**
     * The base implementation of `_.iteratee`.
     *
     * @private
     * @param {*} [value=_.identity] The value to convert to an iteratee.
     * @returns {Function} Returns the iteratee.
     */
    function baseIteratee(value) {
      // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
      // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
      if (typeof value == 'function') {
        return value;
      }
      if (value == null) {
        return identity;
      }
      if (typeof value == 'object') {
        return isArray(value)
          ? baseMatchesProperty(value[0], value[1])
          : baseMatches(value);
      }
      return property(value);
    }

    /**
     * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     */
    function baseKeys(object) {
      if (!isPrototype(object)) {
        return nativeKeys(object);
      }
      var result = [];
      for (var key in Object(object)) {
        if (hasOwnProperty.call(object, key) && key != 'constructor') {
          result.push(key);
        }
      }
      return result;
    }

    /**
     * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     */
    function baseKeysIn(object) {
      if (!isObject(object)) {
        return nativeKeysIn(object);
      }
      var isProto = isPrototype(object),
          result = [];

      for (var key in object) {
        if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
          result.push(key);
        }
      }
      return result;
    }

    /**
     * The base implementation of `_.lt` which doesn't coerce arguments.
     *
     * @private
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if `value` is less than `other`,
     *  else `false`.
     */
    function baseLt(value, other) {
      return value < other;
    }

    /**
     * The base implementation of `_.map` without support for iteratee shorthands.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array} Returns the new mapped array.
     */
    function baseMap(collection, iteratee) {
      var index = -1,
          result = isArrayLike(collection) ? Array(collection.length) : [];

      baseEach(collection, function(value, key, collection) {
        result[++index] = iteratee(value, key, collection);
      });
      return result;
    }

    /**
     * The base implementation of `_.matches` which doesn't clone `source`.
     *
     * @private
     * @param {Object} source The object of property values to match.
     * @returns {Function} Returns the new spec function.
     */
    function baseMatches(source) {
      var matchData = getMatchData(source);
      if (matchData.length == 1 && matchData[0][2]) {
        return matchesStrictComparable(matchData[0][0], matchData[0][1]);
      }
      return function(object) {
        return object === source || baseIsMatch(object, source, matchData);
      };
    }

    /**
     * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
     *
     * @private
     * @param {string} path The path of the property to get.
     * @param {*} srcValue The value to match.
     * @returns {Function} Returns the new spec function.
     */
    function baseMatchesProperty(path, srcValue) {
      if (isKey(path) && isStrictComparable(srcValue)) {
        return matchesStrictComparable(toKey(path), srcValue);
      }
      return function(object) {
        var objValue = get(object, path);
        return (objValue === undefined && objValue === srcValue)
          ? hasIn(object, path)
          : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
      };
    }

    /**
     * The base implementation of `_.merge` without support for multiple sources.
     *
     * @private
     * @param {Object} object The destination object.
     * @param {Object} source The source object.
     * @param {number} srcIndex The index of `source`.
     * @param {Function} [customizer] The function to customize merged values.
     * @param {Object} [stack] Tracks traversed source values and their merged
     *  counterparts.
     */
    function baseMerge(object, source, srcIndex, customizer, stack) {
      if (object === source) {
        return;
      }
      baseFor(source, function(srcValue, key) {
        stack || (stack = new Stack);
        if (isObject(srcValue)) {
          baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
        }
        else {
          var newValue = customizer
            ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
            : undefined;

          if (newValue === undefined) {
            newValue = srcValue;
          }
          assignMergeValue(object, key, newValue);
        }
      }, keysIn);
    }

    /**
     * A specialized version of `baseMerge` for arrays and objects which performs
     * deep merges and tracks traversed objects enabling objects with circular
     * references to be merged.
     *
     * @private
     * @param {Object} object The destination object.
     * @param {Object} source The source object.
     * @param {string} key The key of the value to merge.
     * @param {number} srcIndex The index of `source`.
     * @param {Function} mergeFunc The function to merge values.
     * @param {Function} [customizer] The function to customize assigned values.
     * @param {Object} [stack] Tracks traversed source values and their merged
     *  counterparts.
     */
    function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
      var objValue = safeGet(object, key),
          srcValue = safeGet(source, key),
          stacked = stack.get(srcValue);

      if (stacked) {
        assignMergeValue(object, key, stacked);
        return;
      }
      var newValue = customizer
        ? customizer(objValue, srcValue, (key + ''), object, source, stack)
        : undefined;

      var isCommon = newValue === undefined;

      if (isCommon) {
        var isArr = isArray(srcValue),
            isBuff = !isArr && isBuffer(srcValue),
            isTyped = !isArr && !isBuff && isTypedArray(srcValue);

        newValue = srcValue;
        if (isArr || isBuff || isTyped) {
          if (isArray(objValue)) {
            newValue = objValue;
          }
          else if (isArrayLikeObject(objValue)) {
            newValue = copyArray(objValue);
          }
          else if (isBuff) {
            isCommon = false;
            newValue = cloneBuffer(srcValue, true);
          }
          else if (isTyped) {
            isCommon = false;
            newValue = cloneTypedArray(srcValue, true);
          }
          else {
            newValue = [];
          }
        }
        else if (isPlainObject(srcValue) || isArguments(srcValue)) {
          newValue = objValue;
          if (isArguments(objValue)) {
            newValue = toPlainObject(objValue);
          }
          else if (!isObject(objValue) || isFunction(objValue)) {
            newValue = initCloneObject(srcValue);
          }
        }
        else {
          isCommon = false;
        }
      }
      if (isCommon) {
        // Recursively merge objects and arrays (susceptible to call stack limits).
        stack.set(srcValue, newValue);
        mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
        stack['delete'](srcValue);
      }
      assignMergeValue(object, key, newValue);
    }

    /**
     * The base implementation of `_.nth` which doesn't coerce arguments.
     *
     * @private
     * @param {Array} array The array to query.
     * @param {number} n The index of the element to return.
     * @returns {*} Returns the nth element of `array`.
     */
    function baseNth(array, n) {
      var length = array.length;
      if (!length) {
        return;
      }
      n += n < 0 ? length : 0;
      return isIndex(n, length) ? array[n] : undefined;
    }

    /**
     * The base implementation of `_.orderBy` without param guards.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
     * @param {string[]} orders The sort orders of `iteratees`.
     * @returns {Array} Returns the new sorted array.
     */
    function baseOrderBy(collection, iteratees, orders) {
      if (iteratees.length) {
        iteratees = arrayMap(iteratees, function(iteratee) {
          if (isArray(iteratee)) {
            return function(value) {
              return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
            }
          }
          return iteratee;
        });
      } else {
        iteratees = [identity];
      }

      var index = -1;
      iteratees = arrayMap(iteratees, baseUnary(getIteratee()));

      var result = baseMap(collection, function(value, key, collection) {
        var criteria = arrayMap(iteratees, function(iteratee) {
          return iteratee(value);
        });
        return { 'criteria': criteria, 'index': ++index, 'value': value };
      });

      return baseSortBy(result, function(object, other) {
        return compareMultiple(object, other, orders);
      });
    }

    /**
     * The base implementation of `_.pick` without support for individual
     * property identifiers.
     *
     * @private
     * @param {Object} object The source object.
     * @param {string[]} paths The property paths to pick.
     * @returns {Object} Returns the new object.
     */
    function basePick(object, paths) {
      return basePickBy(object, paths, function(value, path) {
        return hasIn(object, path);
      });
    }

    /**
     * The base implementation of  `_.pickBy` without support for iteratee shorthands.
     *
     * @private
     * @param {Object} object The source object.
     * @param {string[]} paths The property paths to pick.
     * @param {Function} predicate The function invoked per property.
     * @returns {Object} Returns the new object.
     */
    function basePickBy(object, paths, predicate) {
      var index = -1,
          length = paths.length,
          result = {};

      while (++index < length) {
        var path = paths[index],
            value = baseGet(object, path);

        if (predicate(value, path)) {
          baseSet(result, castPath(path, object), value);
        }
      }
      return result;
    }

    /**
     * A specialized version of `baseProperty` which supports deep paths.
     *
     * @private
     * @param {Array|string} path The path of the property to get.
     * @returns {Function} Returns the new accessor function.
     */
    function basePropertyDeep(path) {
      return function(object) {
        return baseGet(object, path);
      };
    }

    /**
     * The base implementation of `_.pullAllBy` without support for iteratee
     * shorthands.
     *
     * @private
     * @param {Array} array The array to modify.
     * @param {Array} values The values to remove.
     * @param {Function} [iteratee] The iteratee invoked per element.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns `array`.
     */
    function basePullAll(array, values, iteratee, comparator) {
      var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
          index = -1,
          length = values.length,
          seen = array;

      if (array === values) {
        values = copyArray(values);
      }
      if (iteratee) {
        seen = arrayMap(array, baseUnary(iteratee));
      }
      while (++index < length) {
        var fromIndex = 0,
            value = values[index],
            computed = iteratee ? iteratee(value) : value;

        while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
          if (seen !== array) {
            splice.call(seen, fromIndex, 1);
          }
          splice.call(array, fromIndex, 1);
        }
      }
      return array;
    }

    /**
     * The base implementation of `_.pullAt` without support for individual
     * indexes or capturing the removed elements.
     *
     * @private
     * @param {Array} array The array to modify.
     * @param {number[]} indexes The indexes of elements to remove.
     * @returns {Array} Returns `array`.
     */
    function basePullAt(array, indexes) {
      var length = array ? indexes.length : 0,
          lastIndex = length - 1;

      while (length--) {
        var index = indexes[length];
        if (length == lastIndex || index !== previous) {
          var previous = index;
          if (isIndex(index)) {
            splice.call(array, index, 1);
          } else {
            baseUnset(array, index);
          }
        }
      }
      return array;
    }

    /**
     * The base implementation of `_.random` without support for returning
     * floating-point numbers.
     *
     * @private
     * @param {number} lower The lower bound.
     * @param {number} upper The upper bound.
     * @returns {number} Returns the random number.
     */
    function baseRandom(lower, upper) {
      return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
    }

    /**
     * The base implementation of `_.range` and `_.rangeRight` which doesn't
     * coerce arguments.
     *
     * @private
     * @param {number} start The start of the range.
     * @param {number} end The end of the range.
     * @param {number} step The value to increment or decrement by.
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Array} Returns the range of numbers.
     */
    function baseRange(start, end, step, fromRight) {
      var index = -1,
          length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
          result = Array(length);

      while (length--) {
        result[fromRight ? length : ++index] = start;
        start += step;
      }
      return result;
    }

    /**
     * The base implementation of `_.repeat` which doesn't coerce arguments.
     *
     * @private
     * @param {string} string The string to repeat.
     * @param {number} n The number of times to repeat the string.
     * @returns {string} Returns the repeated string.
     */
    function baseRepeat(string, n) {
      var result = '';
      if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
        return result;
      }
      // Leverage the exponentiation by squaring algorithm for a faster repeat.
      // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
      do {
        if (n % 2) {
          result += string;
        }
        n = nativeFloor(n / 2);
        if (n) {
          string += string;
        }
      } while (n);

      return result;
    }

    /**
     * The base implementation of `_.rest` which doesn't validate or coerce arguments.
     *
     * @private
     * @param {Function} func The function to apply a rest parameter to.
     * @param {number} [start=func.length-1] The start position of the rest parameter.
     * @returns {Function} Returns the new function.
     */
    function baseRest(func, start) {
      return setToString(overRest(func, start, identity), func + '');
    }

    /**
     * The base implementation of `_.sample`.
     *
     * @private
     * @param {Array|Object} collection The collection to sample.
     * @returns {*} Returns the random element.
     */
    function baseSample(collection) {
      return arraySample(values(collection));
    }

    /**
     * The base implementation of `_.sampleSize` without param guards.
     *
     * @private
     * @param {Array|Object} collection The collection to sample.
     * @param {number} n The number of elements to sample.
     * @returns {Array} Returns the random elements.
     */
    function baseSampleSize(collection, n) {
      var array = values(collection);
      return shuffleSelf(array, baseClamp(n, 0, array.length));
    }

    /**
     * The base implementation of `_.set`.
     *
     * @private
     * @param {Object} object The object to modify.
     * @param {Array|string} path The path of the property to set.
     * @param {*} value The value to set.
     * @param {Function} [customizer] The function to customize path creation.
     * @returns {Object} Returns `object`.
     */
    function baseSet(object, path, value, customizer) {
      if (!isObject(object)) {
        return object;
      }
      path = castPath(path, object);

      var index = -1,
          length = path.length,
          lastIndex = length - 1,
          nested = object;

      while (nested != null && ++index < length) {
        var key = toKey(path[index]),
            newValue = value;

        if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
          return object;
        }

        if (index != lastIndex) {
          var objValue = nested[key];
          newValue = customizer ? customizer(objValue, key, nested) : undefined;
          if (newValue === undefined) {
            newValue = isObject(objValue)
              ? objValue
              : (isIndex(path[index + 1]) ? [] : {});
          }
        }
        assignValue(nested, key, newValue);
        nested = nested[key];
      }
      return object;
    }

    /**
     * The base implementation of `setData` without support for hot loop shorting.
     *
     * @private
     * @param {Function} func The function to associate metadata with.
     * @param {*} data The metadata.
     * @returns {Function} Returns `func`.
     */
    var baseSetData = !metaMap ? identity : function(func, data) {
      metaMap.set(func, data);
      return func;
    };

    /**
     * The base implementation of `setToString` without support for hot loop shorting.
     *
     * @private
     * @param {Function} func The function to modify.
     * @param {Function} string The `toString` result.
     * @returns {Function} Returns `func`.
     */
    var baseSetToString = !defineProperty ? identity : function(func, string) {
      return defineProperty(func, 'toString', {
        'configurable': true,
        'enumerable': false,
        'value': constant(string),
        'writable': true
      });
    };

    /**
     * The base implementation of `_.shuffle`.
     *
     * @private
     * @param {Array|Object} collection The collection to shuffle.
     * @returns {Array} Returns the new shuffled array.
     */
    function baseShuffle(collection) {
      return shuffleSelf(values(collection));
    }

    /**
     * The base implementation of `_.slice` without an iteratee call guard.
     *
     * @private
     * @param {Array} array The array to slice.
     * @param {number} [start=0] The start position.
     * @param {number} [end=array.length] The end position.
     * @returns {Array} Returns the slice of `array`.
     */
    function baseSlice(array, start, end) {
      var index = -1,
          length = array.length;

      if (start < 0) {
        start = -start > length ? 0 : (length + start);
      }
      end = end > length ? length : end;
      if (end < 0) {
        end += length;
      }
      length = start > end ? 0 : ((end - start) >>> 0);
      start >>>= 0;

      var result = Array(length);
      while (++index < length) {
        result[index] = array[index + start];
      }
      return result;
    }

    /**
     * The base implementation of `_.some` without support for iteratee shorthands.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} predicate The function invoked per iteration.
     * @returns {boolean} Returns `true` if any element passes the predicate check,
     *  else `false`.
     */
    function baseSome(collection, predicate) {
      var result;

      baseEach(collection, function(value, index, collection) {
        result = predicate(value, index, collection);
        return !result;
      });
      return !!result;
    }

    /**
     * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
     * performs a binary search of `array` to determine the index at which `value`
     * should be inserted into `array` in order to maintain its sort order.
     *
     * @private
     * @param {Array} array The sorted array to inspect.
     * @param {*} value The value to evaluate.
     * @param {boolean} [retHighest] Specify returning the highest qualified index.
     * @returns {number} Returns the index at which `value` should be inserted
     *  into `array`.
     */
    function baseSortedIndex(array, value, retHighest) {
      var low = 0,
          high = array == null ? low : array.length;

      if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
        while (low < high) {
          var mid = (low + high) >>> 1,
              computed = array[mid];

          if (computed !== null && !isSymbol(computed) &&
              (retHighest ? (computed <= value) : (computed < value))) {
            low = mid + 1;
          } else {
            high = mid;
          }
        }
        return high;
      }
      return baseSortedIndexBy(array, value, identity, retHighest);
    }

    /**
     * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
     * which invokes `iteratee` for `value` and each element of `array` to compute
     * their sort ranking. The iteratee is invoked with one argument; (value).
     *
     * @private
     * @param {Array} array The sorted array to inspect.
     * @param {*} value The value to evaluate.
     * @param {Function} iteratee The iteratee invoked per element.
     * @param {boolean} [retHighest] Specify returning the highest qualified index.
     * @returns {number} Returns the index at which `value` should be inserted
     *  into `array`.
     */
    function baseSortedIndexBy(array, value, iteratee, retHighest) {
      var low = 0,
          high = array == null ? 0 : array.length;
      if (high === 0) {
        return 0;
      }

      value = iteratee(value);
      var valIsNaN = value !== value,
          valIsNull = value === null,
          valIsSymbol = isSymbol(value),
          valIsUndefined = value === undefined;

      while (low < high) {
        var mid = nativeFloor((low + high) / 2),
            computed = iteratee(array[mid]),
            othIsDefined = computed !== undefined,
            othIsNull = computed === null,
            othIsReflexive = computed === computed,
            othIsSymbol = isSymbol(computed);

        if (valIsNaN) {
          var setLow = retHighest || othIsReflexive;
        } else if (valIsUndefined) {
          setLow = othIsReflexive && (retHighest || othIsDefined);
        } else if (valIsNull) {
          setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
        } else if (valIsSymbol) {
          setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
        } else if (othIsNull || othIsSymbol) {
          setLow = false;
        } else {
          setLow = retHighest ? (computed <= value) : (computed < value);
        }
        if (setLow) {
          low = mid + 1;
        } else {
          high = mid;
        }
      }
      return nativeMin(high, MAX_ARRAY_INDEX);
    }

    /**
     * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
     * support for iteratee shorthands.
     *
     * @private
     * @param {Array} array The array to inspect.
     * @param {Function} [iteratee] The iteratee invoked per element.
     * @returns {Array} Returns the new duplicate free array.
     */
    function baseSortedUniq(array, iteratee) {
      var index = -1,
          length = array.length,
          resIndex = 0,
          result = [];

      while (++index < length) {
        var value = array[index],
            computed = iteratee ? iteratee(value) : value;

        if (!index || !eq(computed, seen)) {
          var seen = computed;
          result[resIndex++] = value === 0 ? 0 : value;
        }
      }
      return result;
    }

    /**
     * The base implementation of `_.toNumber` which doesn't ensure correct
     * conversions of binary, hexadecimal, or octal string values.
     *
     * @private
     * @param {*} value The value to process.
     * @returns {number} Returns the number.
     */
    function baseToNumber(value) {
      if (typeof value == 'number') {
        return value;
      }
      if (isSymbol(value)) {
        return NAN;
      }
      return +value;
    }

    /**
     * The base implementation of `_.toString` which doesn't convert nullish
     * values to empty strings.
     *
     * @private
     * @param {*} value The value to process.
     * @returns {string} Returns the string.
     */
    function baseToString(value) {
      // Exit early for strings to avoid a performance hit in some environments.
      if (typeof value == 'string') {
        return value;
      }
      if (isArray(value)) {
        // Recursively convert values (susceptible to call stack limits).
        return arrayMap(value, baseToString) + '';
      }
      if (isSymbol(value)) {
        return symbolToString ? symbolToString.call(value) : '';
      }
      var result = (value + '');
      return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
    }

    /**
     * The base implementation of `_.uniqBy` without support for iteratee shorthands.
     *
     * @private
     * @param {Array} array The array to inspect.
     * @param {Function} [iteratee] The iteratee invoked per element.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns the new duplicate free array.
     */
    function baseUniq(array, iteratee, comparator) {
      var index = -1,
          includes = arrayIncludes,
          length = array.length,
          isCommon = true,
          result = [],
          seen = result;

      if (comparator) {
        isCommon = false;
        includes = arrayIncludesWith;
      }
      else if (length >= LARGE_ARRAY_SIZE) {
        var set = iteratee ? null : createSet(array);
        if (set) {
          return setToArray(set);
        }
        isCommon = false;
        includes = cacheHas;
        seen = new SetCache;
      }
      else {
        seen = iteratee ? [] : result;
      }
      outer:
      while (++index < length) {
        var value = array[index],
            computed = iteratee ? iteratee(value) : value;

        value = (comparator || value !== 0) ? value : 0;
        if (isCommon && computed === computed) {
          var seenIndex = seen.length;
          while (seenIndex--) {
            if (seen[seenIndex] === computed) {
              continue outer;
            }
          }
          if (iteratee) {
            seen.push(computed);
          }
          result.push(value);
        }
        else if (!includes(seen, computed, comparator)) {
          if (seen !== result) {
            seen.push(computed);
          }
          result.push(value);
        }
      }
      return result;
    }

    /**
     * The base implementation of `_.unset`.
     *
     * @private
     * @param {Object} object The object to modify.
     * @param {Array|string} path The property path to unset.
     * @returns {boolean} Returns `true` if the property is deleted, else `false`.
     */
    function baseUnset(object, path) {
      path = castPath(path, object);
      object = parent(object, path);
      return object == null || delete object[toKey(last(path))];
    }

    /**
     * The base implementation of `_.update`.
     *
     * @private
     * @param {Object} object The object to modify.
     * @param {Array|string} path The path of the property to update.
     * @param {Function} updater The function to produce the updated value.
     * @param {Function} [customizer] The function to customize path creation.
     * @returns {Object} Returns `object`.
     */
    function baseUpdate(object, path, updater, customizer) {
      return baseSet(object, path, updater(baseGet(object, path)), customizer);
    }

    /**
     * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
     * without support for iteratee shorthands.
     *
     * @private
     * @param {Array} array The array to query.
     * @param {Function} predicate The function invoked per iteration.
     * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Array} Returns the slice of `array`.
     */
    function baseWhile(array, predicate, isDrop, fromRight) {
      var length = array.length,
          index = fromRight ? length : -1;

      while ((fromRight ? index-- : ++index < length) &&
        predicate(array[index], index, array)) {}

      return isDrop
        ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
        : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
    }

    /**
     * The base implementation of `wrapperValue` which returns the result of
     * performing a sequence of actions on the unwrapped `value`, where each
     * successive action is supplied the return value of the previous.
     *
     * @private
     * @param {*} value The unwrapped value.
     * @param {Array} actions Actions to perform to resolve the unwrapped value.
     * @returns {*} Returns the resolved value.
     */
    function baseWrapperValue(value, actions) {
      var result = value;
      if (result instanceof LazyWrapper) {
        result = result.value();
      }
      return arrayReduce(actions, function(result, action) {
        return action.func.apply(action.thisArg, arrayPush([result], action.args));
      }, result);
    }

    /**
     * The base implementation of methods like `_.xor`, without support for
     * iteratee shorthands, that accepts an array of arrays to inspect.
     *
     * @private
     * @param {Array} arrays The arrays to inspect.
     * @param {Function} [iteratee] The iteratee invoked per element.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns the new array of values.
     */
    function baseXor(arrays, iteratee, comparator) {
      var length = arrays.length;
      if (length < 2) {
        return length ? baseUniq(arrays[0]) : [];
      }
      var index = -1,
          result = Array(length);

      while (++index < length) {
        var array = arrays[index],
            othIndex = -1;

        while (++othIndex < length) {
          if (othIndex != index) {
            result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
          }
        }
      }
      return baseUniq(baseFlatten(result, 1), iteratee, comparator);
    }

    /**
     * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
     *
     * @private
     * @param {Array} props The property identifiers.
     * @param {Array} values The property values.
     * @param {Function} assignFunc The function to assign values.
     * @returns {Object} Returns the new object.
     */
    function baseZipObject(props, values, assignFunc) {
      var index = -1,
          length = props.length,
          valsLength = values.length,
          result = {};

      while (++index < length) {
        var value = index < valsLength ? values[index] : undefined;
        assignFunc(result, props[index], value);
      }
      return result;
    }

    /**
     * Casts `value` to an empty array if it's not an array like object.
     *
     * @private
     * @param {*} value The value to inspect.
     * @returns {Array|Object} Returns the cast array-like object.
     */
    function castArrayLikeObject(value) {
      return isArrayLikeObject(value) ? value : [];
    }

    /**
     * Casts `value` to `identity` if it's not a function.
     *
     * @private
     * @param {*} value The value to inspect.
     * @returns {Function} Returns cast function.
     */
    function castFunction(value) {
      return typeof value == 'function' ? value : identity;
    }

    /**
     * Casts `value` to a path array if it's not one.
     *
     * @private
     * @param {*} value The value to inspect.
     * @param {Object} [object] The object to query keys on.
     * @returns {Array} Returns the cast property path array.
     */
    function castPath(value, object) {
      if (isArray(value)) {
        return value;
      }
      return isKey(value, object) ? [value] : stringToPath(toString(value));
    }

    /**
     * A `baseRest` alias which can be replaced with `identity` by module
     * replacement plugins.
     *
     * @private
     * @type {Function}
     * @param {Function} func The function to apply a rest parameter to.
     * @returns {Function} Returns the new function.
     */
    var castRest = baseRest;

    /**
     * Casts `array` to a slice if it's needed.
     *
     * @private
     * @param {Array} array The array to inspect.
     * @param {number} start The start position.
     * @param {number} [end=array.length] The end position.
     * @returns {Array} Returns the cast slice.
     */
    function castSlice(array, start, end) {
      var length = array.length;
      end = end === undefined ? length : end;
      return (!start && end >= length) ? array : baseSlice(array, start, end);
    }

    /**
     * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
     *
     * @private
     * @param {number|Object} id The timer id or timeout object of the timer to clear.
     */
    var clearTimeout = ctxClearTimeout || function(id) {
      return root.clearTimeout(id);
    };

    /**
     * Creates a clone of  `buffer`.
     *
     * @private
     * @param {Buffer} buffer The buffer to clone.
     * @param {boolean} [isDeep] Specify a deep clone.
     * @returns {Buffer} Returns the cloned buffer.
     */
    function cloneBuffer(buffer, isDeep) {
      if (isDeep) {
        return buffer.slice();
      }
      var length = buffer.length,
          result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);

      buffer.copy(result);
      return result;
    }

    /**
     * Creates a clone of `arrayBuffer`.
     *
     * @private
     * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
     * @returns {ArrayBuffer} Returns the cloned array buffer.
     */
    function cloneArrayBuffer(arrayBuffer) {
      var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
      new Uint8Array(result).set(new Uint8Array(arrayBuffer));
      return result;
    }

    /**
     * Creates a clone of `dataView`.
     *
     * @private
     * @param {Object} dataView The data view to clone.
     * @param {boolean} [isDeep] Specify a deep clone.
     * @returns {Object} Returns the cloned data view.
     */
    function cloneDataView(dataView, isDeep) {
      var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
      return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
    }

    /**
     * Creates a clone of `regexp`.
     *
     * @private
     * @param {Object} regexp The regexp to clone.
     * @returns {Object} Returns the cloned regexp.
     */
    function cloneRegExp(regexp) {
      var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
      result.lastIndex = regexp.lastIndex;
      return result;
    }

    /**
     * Creates a clone of the `symbol` object.
     *
     * @private
     * @param {Object} symbol The symbol object to clone.
     * @returns {Object} Returns the cloned symbol object.
     */
    function cloneSymbol(symbol) {
      return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
    }

    /**
     * Creates a clone of `typedArray`.
     *
     * @private
     * @param {Object} typedArray The typed array to clone.
     * @param {boolean} [isDeep] Specify a deep clone.
     * @returns {Object} Returns the cloned typed array.
     */
    function cloneTypedArray(typedArray, isDeep) {
      var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
      return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
    }

    /**
     * Compares values to sort them in ascending order.
     *
     * @private
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {number} Returns the sort order indicator for `value`.
     */
    function compareAscending(value, other) {
      if (value !== other) {
        var valIsDefined = value !== undefined,
            valIsNull = value === null,
            valIsReflexive = value === value,
            valIsSymbol = isSymbol(value);

        var othIsDefined = other !== undefined,
            othIsNull = other === null,
            othIsReflexive = other === other,
            othIsSymbol = isSymbol(other);

        if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
            (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
            (valIsNull && othIsDefined && othIsReflexive) ||
            (!valIsDefined && othIsReflexive) ||
            !valIsReflexive) {
          return 1;
        }
        if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
            (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
            (othIsNull && valIsDefined && valIsReflexive) ||
            (!othIsDefined && valIsReflexive) ||
            !othIsReflexive) {
          return -1;
        }
      }
      return 0;
    }

    /**
     * Used by `_.orderBy` to compare multiple properties of a value to another
     * and stable sort them.
     *
     * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
     * specify an order of "desc" for descending or "asc" for ascending sort order
     * of corresponding values.
     *
     * @private
     * @param {Object} object The object to compare.
     * @param {Object} other The other object to compare.
     * @param {boolean[]|string[]} orders The order to sort by for each property.
     * @returns {number} Returns the sort order indicator for `object`.
     */
    function compareMultiple(object, other, orders) {
      var index = -1,
          objCriteria = object.criteria,
          othCriteria = other.criteria,
          length = objCriteria.length,
          ordersLength = orders.length;

      while (++index < length) {
        var result = compareAscending(objCriteria[index], othCriteria[index]);
        if (result) {
          if (index >= ordersLength) {
            return result;
          }
          var order = orders[index];
          return result * (order == 'desc' ? -1 : 1);
        }
      }
      // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
      // that causes it, under certain circumstances, to provide the same value for
      // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
      // for more details.
      //
      // This also ensures a stable sort in V8 and other engines.
      // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
      return object.index - other.index;
    }

    /**
     * Creates an array that is the composition of partially applied arguments,
     * placeholders, and provided arguments into a single array of arguments.
     *
     * @private
     * @param {Array} args The provided arguments.
     * @param {Array} partials The arguments to prepend to those provided.
     * @param {Array} holders The `partials` placeholder indexes.
     * @params {boolean} [isCurried] Specify composing for a curried function.
     * @returns {Array} Returns the new array of composed arguments.
     */
    function composeArgs(args, partials, holders, isCurried) {
      var argsIndex = -1,
          argsLength = args.length,
          holdersLength = holders.length,
          leftIndex = -1,
          leftLength = partials.length,
          rangeLength = nativeMax(argsLength - holdersLength, 0),
          result = Array(leftLength + rangeLength),
          isUncurried = !isCurried;

      while (++leftIndex < leftLength) {
        result[leftIndex] = partials[leftIndex];
      }
      while (++argsIndex < holdersLength) {
        if (isUncurried || argsIndex < argsLength) {
          result[holders[argsIndex]] = args[argsIndex];
        }
      }
      while (rangeLength--) {
        result[leftIndex++] = args[argsIndex++];
      }
      return result;
    }

    /**
     * This function is like `composeArgs` except that the arguments composition
     * is tailored for `_.partialRight`.
     *
     * @private
     * @param {Array} args The provided arguments.
     * @param {Array} partials The arguments to append to those provided.
     * @param {Array} holders The `partials` placeholder indexes.
     * @params {boolean} [isCurried] Specify composing for a curried function.
     * @returns {Array} Returns the new array of composed arguments.
     */
    function composeArgsRight(args, partials, holders, isCurried) {
      var argsIndex = -1,
          argsLength = args.length,
          holdersIndex = -1,
          holdersLength = holders.length,
          rightIndex = -1,
          rightLength = partials.length,
          rangeLength = nativeMax(argsLength - holdersLength, 0),
          result = Array(rangeLength + rightLength),
          isUncurried = !isCurried;

      while (++argsIndex < rangeLength) {
        result[argsIndex] = args[argsIndex];
      }
      var offset = argsIndex;
      while (++rightIndex < rightLength) {
        result[offset + rightIndex] = partials[rightIndex];
      }
      while (++holdersIndex < holdersLength) {
        if (isUncurried || argsIndex < argsLength) {
          result[offset + holders[holdersIndex]] = args[argsIndex++];
        }
      }
      return result;
    }

    /**
     * Copies the values of `source` to `array`.
     *
     * @private
     * @param {Array} source The array to copy values from.
     * @param {Array} [array=[]] The array to copy values to.
     * @returns {Array} Returns `array`.
     */
    function copyArray(source, array) {
      var index = -1,
          length = source.length;

      array || (array = Array(length));
      while (++index < length) {
        array[index] = source[index];
      }
      return array;
    }

    /**
     * Copies properties of `source` to `object`.
     *
     * @private
     * @param {Object} source The object to copy properties from.
     * @param {Array} props The property identifiers to copy.
     * @param {Object} [object={}] The object to copy properties to.
     * @param {Function} [customizer] The function to customize copied values.
     * @returns {Object} Returns `object`.
     */
    function copyObject(source, props, object, customizer) {
      var isNew = !object;
      object || (object = {});

      var index = -1,
          length = props.length;

      while (++index < length) {
        var key = props[index];

        var newValue = customizer
          ? customizer(object[key], source[key], key, object, source)
          : undefined;

        if (newValue === undefined) {
          newValue = source[key];
        }
        if (isNew) {
          baseAssignValue(object, key, newValue);
        } else {
          assignValue(object, key, newValue);
        }
      }
      return object;
    }

    /**
     * Copies own symbols of `source` to `object`.
     *
     * @private
     * @param {Object} source The object to copy symbols from.
     * @param {Object} [object={}] The object to copy symbols to.
     * @returns {Object} Returns `object`.
     */
    function copySymbols(source, object) {
      return copyObject(source, getSymbols(source), object);
    }

    /**
     * Copies own and inherited symbols of `source` to `object`.
     *
     * @private
     * @param {Object} source The object to copy symbols from.
     * @param {Object} [object={}] The object to copy symbols to.
     * @returns {Object} Returns `object`.
     */
    function copySymbolsIn(source, object) {
      return copyObject(source, getSymbolsIn(source), object);
    }

    /**
     * Creates a function like `_.groupBy`.
     *
     * @private
     * @param {Function} setter The function to set accumulator values.
     * @param {Function} [initializer] The accumulator object initializer.
     * @returns {Function} Returns the new aggregator function.
     */
    function createAggregator(setter, initializer) {
      return function(collection, iteratee) {
        var func = isArray(collection) ? arrayAggregator : baseAggregator,
            accumulator = initializer ? initializer() : {};

        return func(collection, setter, getIteratee(iteratee, 2), accumulator);
      };
    }

    /**
     * Creates a function like `_.assign`.
     *
     * @private
     * @param {Function} assigner The function to assign values.
     * @returns {Function} Returns the new assigner function.
     */
    function createAssigner(assigner) {
      return baseRest(function(object, sources) {
        var index = -1,
            length = sources.length,
            customizer = length > 1 ? sources[length - 1] : undefined,
            guard = length > 2 ? sources[2] : undefined;

        customizer = (assigner.length > 3 && typeof customizer == 'function')
          ? (length--, customizer)
          : undefined;

        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
          customizer = length < 3 ? undefined : customizer;
          length = 1;
        }
        object = Object(object);
        while (++index < length) {
          var source = sources[index];
          if (source) {
            assigner(object, source, index, customizer);
          }
        }
        return object;
      });
    }

    /**
     * Creates a `baseEach` or `baseEachRight` function.
     *
     * @private
     * @param {Function} eachFunc The function to iterate over a collection.
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new base function.
     */
    function createBaseEach(eachFunc, fromRight) {
      return function(collection, iteratee) {
        if (collection == null) {
          return collection;
        }
        if (!isArrayLike(collection)) {
          return eachFunc(collection, iteratee);
        }
        var length = collection.length,
            index = fromRight ? length : -1,
            iterable = Object(collection);

        while ((fromRight ? index-- : ++index < length)) {
          if (iteratee(iterable[index], index, iterable) === false) {
            break;
          }
        }
        return collection;
      };
    }

    /**
     * Creates a base function for methods like `_.forIn` and `_.forOwn`.
     *
     * @private
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new base function.
     */
    function createBaseFor(fromRight) {
      return function(object, iteratee, keysFunc) {
        var index = -1,
            iterable = Object(object),
            props = keysFunc(object),
            length = props.length;

        while (length--) {
          var key = props[fromRight ? length : ++index];
          if (iteratee(iterable[key], key, iterable) === false) {
            break;
          }
        }
        return object;
      };
    }

    /**
     * Creates a function that wraps `func` to invoke it with the optional `this`
     * binding of `thisArg`.
     *
     * @private
     * @param {Function} func The function to wrap.
     * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
     * @param {*} [thisArg] The `this` binding of `func`.
     * @returns {Function} Returns the new wrapped function.
     */
    function createBind(func, bitmask, thisArg) {
      var isBind = bitmask & WRAP_BIND_FLAG,
          Ctor = createCtor(func);

      function wrapper() {
        var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
        return fn.apply(isBind ? thisArg : this, arguments);
      }
      return wrapper;
    }

    /**
     * Creates a function like `_.lowerFirst`.
     *
     * @private
     * @param {string} methodName The name of the `String` case method to use.
     * @returns {Function} Returns the new case function.
     */
    function createCaseFirst(methodName) {
      return function(string) {
        string = toString(string);

        var strSymbols = hasUnicode(string)
          ? stringToArray(string)
          : undefined;

        var chr = strSymbols
          ? strSymbols[0]
          : string.charAt(0);

        var trailing = strSymbols
          ? castSlice(strSymbols, 1).join('')
          : string.slice(1);

        return chr[methodName]() + trailing;
      };
    }

    /**
     * Creates a function like `_.camelCase`.
     *
     * @private
     * @param {Function} callback The function to combine each word.
     * @returns {Function} Returns the new compounder function.
     */
    function createCompounder(callback) {
      return function(string) {
        return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
      };
    }

    /**
     * Creates a function that produces an instance of `Ctor` regardless of
     * whether it was invoked as part of a `new` expression or by `call` or `apply`.
     *
     * @private
     * @param {Function} Ctor The constructor to wrap.
     * @returns {Function} Returns the new wrapped function.
     */
    function createCtor(Ctor) {
      return function() {
        // Use a `switch` statement to work with class constructors. See
        // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
        // for more details.
        var args = arguments;
        switch (args.length) {
          case 0: return new Ctor;
          case 1: return new Ctor(args[0]);
          case 2: return new Ctor(args[0], args[1]);
          case 3: return new Ctor(args[0], args[1], args[2]);
          case 4: return new Ctor(args[0], args[1], args[2], args[3]);
          case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
          case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
          case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
        }
        var thisBinding = baseCreate(Ctor.prototype),
            result = Ctor.apply(thisBinding, args);

        // Mimic the constructor's `return` behavior.
        // See https://es5.github.io/#x13.2.2 for more details.
        return isObject(result) ? result : thisBinding;
      };
    }

    /**
     * Creates a function that wraps `func` to enable currying.
     *
     * @private
     * @param {Function} func The function to wrap.
     * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
     * @param {number} arity The arity of `func`.
     * @returns {Function} Returns the new wrapped function.
     */
    function createCurry(func, bitmask, arity) {
      var Ctor = createCtor(func);

      function wrapper() {
        var length = arguments.length,
            args = Array(length),
            index = length,
            placeholder = getHolder(wrapper);

        while (index--) {
          args[index] = arguments[index];
        }
        var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
          ? []
          : replaceHolders(args, placeholder);

        length -= holders.length;
        if (length < arity) {
          return createRecurry(
            func, bitmask, createHybrid, wrapper.placeholder, undefined,
            args, holders, undefined, undefined, arity - length);
        }
        var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
        return apply(fn, this, args);
      }
      return wrapper;
    }

    /**
     * Creates a `_.find` or `_.findLast` function.
     *
     * @private
     * @param {Function} findIndexFunc The function to find the collection index.
     * @returns {Function} Returns the new find function.
     */
    function createFind(findIndexFunc) {
      return function(collection, predicate, fromIndex) {
        var iterable = Object(collection);
        if (!isArrayLike(collection)) {
          var iteratee = getIteratee(predicate, 3);
          collection = keys(collection);
          predicate = function(key) { return iteratee(iterable[key], key, iterable); };
        }
        var index = findIndexFunc(collection, predicate, fromIndex);
        return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
      };
    }

    /**
     * Creates a `_.flow` or `_.flowRight` function.
     *
     * @private
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new flow function.
     */
    function createFlow(fromRight) {
      return flatRest(function(funcs) {
        var length = funcs.length,
            index = length,
            prereq = LodashWrapper.prototype.thru;

        if (fromRight) {
          funcs.reverse();
        }
        while (index--) {
          var func = funcs[index];
          if (typeof func != 'function') {
            throw new TypeError(FUNC_ERROR_TEXT);
          }
          if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
            var wrapper = new LodashWrapper([], true);
          }
        }
        index = wrapper ? index : length;
        while (++index < length) {
          func = funcs[index];

          var funcName = getFuncName(func),
              data = funcName == 'wrapper' ? getData(func) : undefined;

          if (data && isLaziable(data[0]) &&
                data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
                !data[4].length && data[9] == 1
              ) {
            wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
          } else {
            wrapper = (func.length == 1 && isLaziable(func))
              ? wrapper[funcName]()
              : wrapper.thru(func);
          }
        }
        return function() {
          var args = arguments,
              value = args[0];

          if (wrapper && args.length == 1 && isArray(value)) {
            return wrapper.plant(value).value();
          }
          var index = 0,
              result = length ? funcs[index].apply(this, args) : value;

          while (++index < length) {
            result = funcs[index].call(this, result);
          }
          return result;
        };
      });
    }

    /**
     * Creates a function that wraps `func` to invoke it with optional `this`
     * binding of `thisArg`, partial application, and currying.
     *
     * @private
     * @param {Function|string} func The function or method name to wrap.
     * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
     * @param {*} [thisArg] The `this` binding of `func`.
     * @param {Array} [partials] The arguments to prepend to those provided to
     *  the new function.
     * @param {Array} [holders] The `partials` placeholder indexes.
     * @param {Array} [partialsRight] The arguments to append to those provided
     *  to the new function.
     * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
     * @param {Array} [argPos] The argument positions of the new function.
     * @param {number} [ary] The arity cap of `func`.
     * @param {number} [arity] The arity of `func`.
     * @returns {Function} Returns the new wrapped function.
     */
    function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
      var isAry = bitmask & WRAP_ARY_FLAG,
          isBind = bitmask & WRAP_BIND_FLAG,
          isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
          isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
          isFlip = bitmask & WRAP_FLIP_FLAG,
          Ctor = isBindKey ? undefined : createCtor(func);

      function wrapper() {
        var length = arguments.length,
            args = Array(length),
            index = length;

        while (index--) {
          args[index] = arguments[index];
        }
        if (isCurried) {
          var placeholder = getHolder(wrapper),
              holdersCount = countHolders(args, placeholder);
        }
        if (partials) {
          args = composeArgs(args, partials, holders, isCurried);
        }
        if (partialsRight) {
          args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
        }
        length -= holdersCount;
        if (isCurried && length < arity) {
          var newHolders = replaceHolders(args, placeholder);
          return createRecurry(
            func, bitmask, createHybrid, wrapper.placeholder, thisArg,
            args, newHolders, argPos, ary, arity - length
          );
        }
        var thisBinding = isBind ? thisArg : this,
            fn = isBindKey ? thisBinding[func] : func;

        length = args.length;
        if (argPos) {
          args = reorder(args, argPos);
        } else if (isFlip && length > 1) {
          args.reverse();
        }
        if (isAry && ary < length) {
          args.length = ary;
        }
        if (this && this !== root && this instanceof wrapper) {
          fn = Ctor || createCtor(fn);
        }
        return fn.apply(thisBinding, args);
      }
      return wrapper;
    }

    /**
     * Creates a function like `_.invertBy`.
     *
     * @private
     * @param {Function} setter The function to set accumulator values.
     * @param {Function} toIteratee The function to resolve iteratees.
     * @returns {Function} Returns the new inverter function.
     */
    function createInverter(setter, toIteratee) {
      return function(object, iteratee) {
        return baseInverter(object, setter, toIteratee(iteratee), {});
      };
    }

    /**
     * Creates a function that performs a mathematical operation on two values.
     *
     * @private
     * @param {Function} operator The function to perform the operation.
     * @param {number} [defaultValue] The value used for `undefined` arguments.
     * @returns {Function} Returns the new mathematical operation function.
     */
    function createMathOperation(operator, defaultValue) {
      return function(value, other) {
        var result;
        if (value === undefined && other === undefined) {
          return defaultValue;
        }
        if (value !== undefined) {
          result = value;
        }
        if (other !== undefined) {
          if (result === undefined) {
            return other;
          }
          if (typeof value == 'string' || typeof other == 'string') {
            value = baseToString(value);
            other = baseToString(other);
          } else {
            value = baseToNumber(value);
            other = baseToNumber(other);
          }
          result = operator(value, other);
        }
        return result;
      };
    }

    /**
     * Creates a function like `_.over`.
     *
     * @private
     * @param {Function} arrayFunc The function to iterate over iteratees.
     * @returns {Function} Returns the new over function.
     */
    function createOver(arrayFunc) {
      return flatRest(function(iteratees) {
        iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
        return baseRest(function(args) {
          var thisArg = this;
          return arrayFunc(iteratees, function(iteratee) {
            return apply(iteratee, thisArg, args);
          });
        });
      });
    }

    /**
     * Creates the padding for `string` based on `length`. The `chars` string
     * is truncated if the number of characters exceeds `length`.
     *
     * @private
     * @param {number} length The padding length.
     * @param {string} [chars=' '] The string used as padding.
     * @returns {string} Returns the padding for `string`.
     */
    function createPadding(length, chars) {
      chars = chars === undefined ? ' ' : baseToString(chars);

      var charsLength = chars.length;
      if (charsLength < 2) {
        return charsLength ? baseRepeat(chars, length) : chars;
      }
      var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
      return hasUnicode(chars)
        ? castSlice(stringToArray(result), 0, length).join('')
        : result.slice(0, length);
    }

    /**
     * Creates a function that wraps `func` to invoke it with the `this` binding
     * of `thisArg` and `partials` prepended to the arguments it receives.
     *
     * @private
     * @param {Function} func The function to wrap.
     * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
     * @param {*} thisArg The `this` binding of `func`.
     * @param {Array} partials The arguments to prepend to those provided to
     *  the new function.
     * @returns {Function} Returns the new wrapped function.
     */
    function createPartial(func, bitmask, thisArg, partials) {
      var isBind = bitmask & WRAP_BIND_FLAG,
          Ctor = createCtor(func);

      function wrapper() {
        var argsIndex = -1,
            argsLength = arguments.length,
            leftIndex = -1,
            leftLength = partials.length,
            args = Array(leftLength + argsLength),
            fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;

        while (++leftIndex < leftLength) {
          args[leftIndex] = partials[leftIndex];
        }
        while (argsLength--) {
          args[leftIndex++] = arguments[++argsIndex];
        }
        return apply(fn, isBind ? thisArg : this, args);
      }
      return wrapper;
    }

    /**
     * Creates a `_.range` or `_.rangeRight` function.
     *
     * @private
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new range function.
     */
    function createRange(fromRight) {
      return function(start, end, step) {
        if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
          end = step = undefined;
        }
        // Ensure the sign of `-0` is preserved.
        start = toFinite(start);
        if (end === undefined) {
          end = start;
          start = 0;
        } else {
          end = toFinite(end);
        }
        step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
        return baseRange(start, end, step, fromRight);
      };
    }

    /**
     * Creates a function that performs a relational operation on two values.
     *
     * @private
     * @param {Function} operator The function to perform the operation.
     * @returns {Function} Returns the new relational operation function.
     */
    function createRelationalOperation(operator) {
      return function(value, other) {
        if (!(typeof value == 'string' && typeof other == 'string')) {
          value = toNumber(value);
          other = toNumber(other);
        }
        return operator(value, other);
      };
    }

    /**
     * Creates a function that wraps `func` to continue currying.
     *
     * @private
     * @param {Function} func The function to wrap.
     * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
     * @param {Function} wrapFunc The function to create the `func` wrapper.
     * @param {*} placeholder The placeholder value.
     * @param {*} [thisArg] The `this` binding of `func`.
     * @param {Array} [partials] The arguments to prepend to those provided to
     *  the new function.
     * @param {Array} [holders] The `partials` placeholder indexes.
     * @param {Array} [argPos] The argument positions of the new function.
     * @param {number} [ary] The arity cap of `func`.
     * @param {number} [arity] The arity of `func`.
     * @returns {Function} Returns the new wrapped function.
     */
    function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
      var isCurry = bitmask & WRAP_CURRY_FLAG,
          newHolders = isCurry ? holders : undefined,
          newHoldersRight = isCurry ? undefined : holders,
          newPartials = isCurry ? partials : undefined,
          newPartialsRight = isCurry ? undefined : partials;

      bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
      bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);

      if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
        bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
      }
      var newData = [
        func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
        newHoldersRight, argPos, ary, arity
      ];

      var result = wrapFunc.apply(undefined, newData);
      if (isLaziable(func)) {
        setData(result, newData);
      }
      result.placeholder = placeholder;
      return setWrapToString(result, func, bitmask);
    }

    /**
     * Creates a function like `_.round`.
     *
     * @private
     * @param {string} methodName The name of the `Math` method to use when rounding.
     * @returns {Function} Returns the new round function.
     */
    function createRound(methodName) {
      var func = Math[methodName];
      return function(number, precision) {
        number = toNumber(number);
        precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
        if (precision && nativeIsFinite(number)) {
          // Shift with exponential notation to avoid floating-point issues.
          // See [MDN](https://mdn.io/round#Examples) for more details.
          var pair = (toString(number) + 'e').split('e'),
              value = func(pair[0] + 'e' + (+pair[1] + precision));

          pair = (toString(value) + 'e').split('e');
          return +(pair[0] + 'e' + (+pair[1] - precision));
        }
        return func(number);
      };
    }

    /**
     * Creates a set object of `values`.
     *
     * @private
     * @param {Array} values The values to add to the set.
     * @returns {Object} Returns the new set.
     */
    var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
      return new Set(values);
    };

    /**
     * Creates a `_.toPairs` or `_.toPairsIn` function.
     *
     * @private
     * @param {Function} keysFunc The function to get the keys of a given object.
     * @returns {Function} Returns the new pairs function.
     */
    function createToPairs(keysFunc) {
      return function(object) {
        var tag = getTag(object);
        if (tag == mapTag) {
          return mapToArray(object);
        }
        if (tag == setTag) {
          return setToPairs(object);
        }
        return baseToPairs(object, keysFunc(object));
      };
    }

    /**
     * Creates a function that either curries or invokes `func` with optional
     * `this` binding and partially applied arguments.
     *
     * @private
     * @param {Function|string} func The function or method name to wrap.
     * @param {number} bitmask The bitmask flags.
     *    1 - `_.bind`
     *    2 - `_.bindKey`
     *    4 - `_.curry` or `_.curryRight` of a bound function
     *    8 - `_.curry`
     *   16 - `_.curryRight`
     *   32 - `_.partial`
     *   64 - `_.partialRight`
     *  128 - `_.rearg`
     *  256 - `_.ary`
     *  512 - `_.flip`
     * @param {*} [thisArg] The `this` binding of `func`.
     * @param {Array} [partials] The arguments to be partially applied.
     * @param {Array} [holders] The `partials` placeholder indexes.
     * @param {Array} [argPos] The argument positions of the new function.
     * @param {number} [ary] The arity cap of `func`.
     * @param {number} [arity] The arity of `func`.
     * @returns {Function} Returns the new wrapped function.
     */
    function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
      var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
      if (!isBindKey && typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      var length = partials ? partials.length : 0;
      if (!length) {
        bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
        partials = holders = undefined;
      }
      ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
      arity = arity === undefined ? arity : toInteger(arity);
      length -= holders ? holders.length : 0;

      if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
        var partialsRight = partials,
            holdersRight = holders;

        partials = holders = undefined;
      }
      var data = isBindKey ? undefined : getData(func);

      var newData = [
        func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
        argPos, ary, arity
      ];

      if (data) {
        mergeData(newData, data);
      }
      func = newData[0];
      bitmask = newData[1];
      thisArg = newData[2];
      partials = newData[3];
      holders = newData[4];
      arity = newData[9] = newData[9] === undefined
        ? (isBindKey ? 0 : func.length)
        : nativeMax(newData[9] - length, 0);

      if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
        bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
      }
      if (!bitmask || bitmask == WRAP_BIND_FLAG) {
        var result = createBind(func, bitmask, thisArg);
      } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
        result = createCurry(func, bitmask, arity);
      } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
        result = createPartial(func, bitmask, thisArg, partials);
      } else {
        result = createHybrid.apply(undefined, newData);
      }
      var setter = data ? baseSetData : setData;
      return setWrapToString(setter(result, newData), func, bitmask);
    }

    /**
     * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
     * of source objects to the destination object for all destination properties
     * that resolve to `undefined`.
     *
     * @private
     * @param {*} objValue The destination value.
     * @param {*} srcValue The source value.
     * @param {string} key The key of the property to assign.
     * @param {Object} object The parent object of `objValue`.
     * @returns {*} Returns the value to assign.
     */
    function customDefaultsAssignIn(objValue, srcValue, key, object) {
      if (objValue === undefined ||
          (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
        return srcValue;
      }
      return objValue;
    }

    /**
     * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
     * objects into destination objects that are passed thru.
     *
     * @private
     * @param {*} objValue The destination value.
     * @param {*} srcValue The source value.
     * @param {string} key The key of the property to merge.
     * @param {Object} object The parent object of `objValue`.
     * @param {Object} source The parent object of `srcValue`.
     * @param {Object} [stack] Tracks traversed source values and their merged
     *  counterparts.
     * @returns {*} Returns the value to assign.
     */
    function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
      if (isObject(objValue) && isObject(srcValue)) {
        // Recursively merge objects and arrays (susceptible to call stack limits).
        stack.set(srcValue, objValue);
        baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
        stack['delete'](srcValue);
      }
      return objValue;
    }

    /**
     * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
     * objects.
     *
     * @private
     * @param {*} value The value to inspect.
     * @param {string} key The key of the property to inspect.
     * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
     */
    function customOmitClone(value) {
      return isPlainObject(value) ? undefined : value;
    }

    /**
     * A specialized version of `baseIsEqualDeep` for arrays with support for
     * partial deep comparisons.
     *
     * @private
     * @param {Array} array The array to compare.
     * @param {Array} other The other array to compare.
     * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
     * @param {Function} customizer The function to customize comparisons.
     * @param {Function} equalFunc The function to determine equivalents of values.
     * @param {Object} stack Tracks traversed `array` and `other` objects.
     * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
     */
    function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
          arrLength = array.length,
          othLength = other.length;

      if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
        return false;
      }
      // Check that cyclic values are equal.
      var arrStacked = stack.get(array);
      var othStacked = stack.get(other);
      if (arrStacked && othStacked) {
        return arrStacked == other && othStacked == array;
      }
      var index = -1,
          result = true,
          seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;

      stack.set(array, other);
      stack.set(other, array);

      // Ignore non-index properties.
      while (++index < arrLength) {
        var arrValue = array[index],
            othValue = other[index];

        if (customizer) {
          var compared = isPartial
            ? customizer(othValue, arrValue, index, other, array, stack)
            : customizer(arrValue, othValue, index, array, other, stack);
        }
        if (compared !== undefined) {
          if (compared) {
            continue;
          }
          result = false;
          break;
        }
        // Recursively compare arrays (susceptible to call stack limits).
        if (seen) {
          if (!arraySome(other, function(othValue, othIndex) {
                if (!cacheHas(seen, othIndex) &&
                    (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
                  return seen.push(othIndex);
                }
              })) {
            result = false;
            break;
          }
        } else if (!(
              arrValue === othValue ||
                equalFunc(arrValue, othValue, bitmask, customizer, stack)
            )) {
          result = false;
          break;
        }
      }
      stack['delete'](array);
      stack['delete'](other);
      return result;
    }

    /**
     * A specialized version of `baseIsEqualDeep` for comparing objects of
     * the same `toStringTag`.
     *
     * **Note:** This function only supports comparing values with tags of
     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
     *
     * @private
     * @param {Object} object The object to compare.
     * @param {Object} other The other object to compare.
     * @param {string} tag The `toStringTag` of the objects to compare.
     * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
     * @param {Function} customizer The function to customize comparisons.
     * @param {Function} equalFunc The function to determine equivalents of values.
     * @param {Object} stack Tracks traversed `object` and `other` objects.
     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
     */
    function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
      switch (tag) {
        case dataViewTag:
          if ((object.byteLength != other.byteLength) ||
              (object.byteOffset != other.byteOffset)) {
            return false;
          }
          object = object.buffer;
          other = other.buffer;

        case arrayBufferTag:
          if ((object.byteLength != other.byteLength) ||
              !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
            return false;
          }
          return true;

        case boolTag:
        case dateTag:
        case numberTag:
          // Coerce booleans to `1` or `0` and dates to milliseconds.
          // Invalid dates are coerced to `NaN`.
          return eq(+object, +other);

        case errorTag:
          return object.name == other.name && object.message == other.message;

        case regexpTag:
        case stringTag:
          // Coerce regexes to strings and treat strings, primitives and objects,
          // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
          // for more details.
          return object == (other + '');

        case mapTag:
          var convert = mapToArray;

        case setTag:
          var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
          convert || (convert = setToArray);

          if (object.size != other.size && !isPartial) {
            return false;
          }
          // Assume cyclic values are equal.
          var stacked = stack.get(object);
          if (stacked) {
            return stacked == other;
          }
          bitmask |= COMPARE_UNORDERED_FLAG;

          // Recursively compare objects (susceptible to call stack limits).
          stack.set(object, other);
          var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
          stack['delete'](object);
          return result;

        case symbolTag:
          if (symbolValueOf) {
            return symbolValueOf.call(object) == symbolValueOf.call(other);
          }
      }
      return false;
    }

    /**
     * A specialized version of `baseIsEqualDeep` for objects with support for
     * partial deep comparisons.
     *
     * @private
     * @param {Object} object The object to compare.
     * @param {Object} other The other object to compare.
     * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
     * @param {Function} customizer The function to customize comparisons.
     * @param {Function} equalFunc The function to determine equivalents of values.
     * @param {Object} stack Tracks traversed `object` and `other` objects.
     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
     */
    function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
          objProps = getAllKeys(object),
          objLength = objProps.length,
          othProps = getAllKeys(other),
          othLength = othProps.length;

      if (objLength != othLength && !isPartial) {
        return false;
      }
      var index = objLength;
      while (index--) {
        var key = objProps[index];
        if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
          return false;
        }
      }
      // Check that cyclic values are equal.
      var objStacked = stack.get(object);
      var othStacked = stack.get(other);
      if (objStacked && othStacked) {
        return objStacked == other && othStacked == object;
      }
      var result = true;
      stack.set(object, other);
      stack.set(other, object);

      var skipCtor = isPartial;
      while (++index < objLength) {
        key = objProps[index];
        var objValue = object[key],
            othValue = other[key];

        if (customizer) {
          var compared = isPartial
            ? customizer(othValue, objValue, key, other, object, stack)
            : customizer(objValue, othValue, key, object, other, stack);
        }
        // Recursively compare objects (susceptible to call stack limits).
        if (!(compared === undefined
              ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
              : compared
            )) {
          result = false;
          break;
        }
        skipCtor || (skipCtor = key == 'constructor');
      }
      if (result && !skipCtor) {
        var objCtor = object.constructor,
            othCtor = other.constructor;

        // Non `Object` object instances with different constructors are not equal.
        if (objCtor != othCtor &&
            ('constructor' in object && 'constructor' in other) &&
            !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
              typeof othCtor == 'function' && othCtor instanceof othCtor)) {
          result = false;
        }
      }
      stack['delete'](object);
      stack['delete'](other);
      return result;
    }

    /**
     * A specialized version of `baseRest` which flattens the rest array.
     *
     * @private
     * @param {Function} func The function to apply a rest parameter to.
     * @returns {Function} Returns the new function.
     */
    function flatRest(func) {
      return setToString(overRest(func, undefined, flatten), func + '');
    }

    /**
     * Creates an array of own enumerable property names and symbols of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names and symbols.
     */
    function getAllKeys(object) {
      return baseGetAllKeys(object, keys, getSymbols);
    }

    /**
     * Creates an array of own and inherited enumerable property names and
     * symbols of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names and symbols.
     */
    function getAllKeysIn(object) {
      return baseGetAllKeys(object, keysIn, getSymbolsIn);
    }

    /**
     * Gets metadata for `func`.
     *
     * @private
     * @param {Function} func The function to query.
     * @returns {*} Returns the metadata for `func`.
     */
    var getData = !metaMap ? noop : function(func) {
      return metaMap.get(func);
    };

    /**
     * Gets the name of `func`.
     *
     * @private
     * @param {Function} func The function to query.
     * @returns {string} Returns the function name.
     */
    function getFuncName(func) {
      var result = (func.name + ''),
          array = realNames[result],
          length = hasOwnProperty.call(realNames, result) ? array.length : 0;

      while (length--) {
        var data = array[length],
            otherFunc = data.func;
        if (otherFunc == null || otherFunc == func) {
          return data.name;
        }
      }
      return result;
    }

    /**
     * Gets the argument placeholder value for `func`.
     *
     * @private
     * @param {Function} func The function to inspect.
     * @returns {*} Returns the placeholder value.
     */
    function getHolder(func) {
      var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
      return object.placeholder;
    }

    /**
     * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
     * this function returns the custom method, otherwise it returns `baseIteratee`.
     * If arguments are provided, the chosen function is invoked with them and
     * its result is returned.
     *
     * @private
     * @param {*} [value] The value to convert to an iteratee.
     * @param {number} [arity] The arity of the created iteratee.
     * @returns {Function} Returns the chosen function or its result.
     */
    function getIteratee() {
      var result = lodash.iteratee || iteratee;
      result = result === iteratee ? baseIteratee : result;
      return arguments.length ? result(arguments[0], arguments[1]) : result;
    }

    /**
     * Gets the data for `map`.
     *
     * @private
     * @param {Object} map The map to query.
     * @param {string} key The reference key.
     * @returns {*} Returns the map data.
     */
    function getMapData(map, key) {
      var data = map.__data__;
      return isKeyable(key)
        ? data[typeof key == 'string' ? 'string' : 'hash']
        : data.map;
    }

    /**
     * Gets the property names, values, and compare flags of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the match data of `object`.
     */
    function getMatchData(object) {
      var result = keys(object),
          length = result.length;

      while (length--) {
        var key = result[length],
            value = object[key];

        result[length] = [key, value, isStrictComparable(value)];
      }
      return result;
    }

    /**
     * Gets the native function at `key` of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {string} key The key of the method to get.
     * @returns {*} Returns the function if it's native, else `undefined`.
     */
    function getNative(object, key) {
      var value = getValue(object, key);
      return baseIsNative(value) ? value : undefined;
    }

    /**
     * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
     *
     * @private
     * @param {*} value The value to query.
     * @returns {string} Returns the raw `toStringTag`.
     */
    function getRawTag(value) {
      var isOwn = hasOwnProperty.call(value, symToStringTag),
          tag = value[symToStringTag];

      try {
        value[symToStringTag] = undefined;
        var unmasked = true;
      } catch (e) {}

      var result = nativeObjectToString.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag] = tag;
        } else {
          delete value[symToStringTag];
        }
      }
      return result;
    }

    /**
     * Creates an array of the own enumerable symbols of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of symbols.
     */
    var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
      if (object == null) {
        return [];
      }
      object = Object(object);
      return arrayFilter(nativeGetSymbols(object), function(symbol) {
        return propertyIsEnumerable.call(object, symbol);
      });
    };

    /**
     * Creates an array of the own and inherited enumerable symbols of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of symbols.
     */
    var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
      var result = [];
      while (object) {
        arrayPush(result, getSymbols(object));
        object = getPrototype(object);
      }
      return result;
    };

    /**
     * Gets the `toStringTag` of `value`.
     *
     * @private
     * @param {*} value The value to query.
     * @returns {string} Returns the `toStringTag`.
     */
    var getTag = baseGetTag;

    // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
    if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
        (Map && getTag(new Map) != mapTag) ||
        (Promise && getTag(Promise.resolve()) != promiseTag) ||
        (Set && getTag(new Set) != setTag) ||
        (WeakMap && getTag(new WeakMap) != weakMapTag)) {
      getTag = function(value) {
        var result = baseGetTag(value),
            Ctor = result == objectTag ? value.constructor : undefined,
            ctorString = Ctor ? toSource(Ctor) : '';

        if (ctorString) {
          switch (ctorString) {
            case dataViewCtorString: return dataViewTag;
            case mapCtorString: return mapTag;
            case promiseCtorString: return promiseTag;
            case setCtorString: return setTag;
            case weakMapCtorString: return weakMapTag;
          }
        }
        return result;
      };
    }

    /**
     * Gets the view, applying any `transforms` to the `start` and `end` positions.
     *
     * @private
     * @param {number} start The start of the view.
     * @param {number} end The end of the view.
     * @param {Array} transforms The transformations to apply to the view.
     * @returns {Object} Returns an object containing the `start` and `end`
     *  positions of the view.
     */
    function getView(start, end, transforms) {
      var index = -1,
          length = transforms.length;

      while (++index < length) {
        var data = transforms[index],
            size = data.size;

        switch (data.type) {
          case 'drop':      start += size; break;
          case 'dropRight': end -= size; break;
          case 'take':      end = nativeMin(end, start + size); break;
          case 'takeRight': start = nativeMax(start, end - size); break;
        }
      }
      return { 'start': start, 'end': end };
    }

    /**
     * Extracts wrapper details from the `source` body comment.
     *
     * @private
     * @param {string} source The source to inspect.
     * @returns {Array} Returns the wrapper details.
     */
    function getWrapDetails(source) {
      var match = source.match(reWrapDetails);
      return match ? match[1].split(reSplitDetails) : [];
    }

    /**
     * Checks if `path` exists on `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {Array|string} path The path to check.
     * @param {Function} hasFunc The function to check properties.
     * @returns {boolean} Returns `true` if `path` exists, else `false`.
     */
    function hasPath(object, path, hasFunc) {
      path = castPath(path, object);

      var index = -1,
          length = path.length,
          result = false;

      while (++index < length) {
        var key = toKey(path[index]);
        if (!(result = object != null && hasFunc(object, key))) {
          break;
        }
        object = object[key];
      }
      if (result || ++index != length) {
        return result;
      }
      length = object == null ? 0 : object.length;
      return !!length && isLength(length) && isIndex(key, length) &&
        (isArray(object) || isArguments(object));
    }

    /**
     * Initializes an array clone.
     *
     * @private
     * @param {Array} array The array to clone.
     * @returns {Array} Returns the initialized clone.
     */
    function initCloneArray(array) {
      var length = array.length,
          result = new array.constructor(length);

      // Add properties assigned by `RegExp#exec`.
      if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
        result.index = array.index;
        result.input = array.input;
      }
      return result;
    }

    /**
     * Initializes an object clone.
     *
     * @private
     * @param {Object} object The object to clone.
     * @returns {Object} Returns the initialized clone.
     */
    function initCloneObject(object) {
      return (typeof object.constructor == 'function' && !isPrototype(object))
        ? baseCreate(getPrototype(object))
        : {};
    }

    /**
     * Initializes an object clone based on its `toStringTag`.
     *
     * **Note:** This function only supports cloning values with tags of
     * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
     *
     * @private
     * @param {Object} object The object to clone.
     * @param {string} tag The `toStringTag` of the object to clone.
     * @param {boolean} [isDeep] Specify a deep clone.
     * @returns {Object} Returns the initialized clone.
     */
    function initCloneByTag(object, tag, isDeep) {
      var Ctor = object.constructor;
      switch (tag) {
        case arrayBufferTag:
          return cloneArrayBuffer(object);

        case boolTag:
        case dateTag:
          return new Ctor(+object);

        case dataViewTag:
          return cloneDataView(object, isDeep);

        case float32Tag: case float64Tag:
        case int8Tag: case int16Tag: case int32Tag:
        case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
          return cloneTypedArray(object, isDeep);

        case mapTag:
          return new Ctor;

        case numberTag:
        case stringTag:
          return new Ctor(object);

        case regexpTag:
          return cloneRegExp(object);

        case setTag:
          return new Ctor;

        case symbolTag:
          return cloneSymbol(object);
      }
    }

    /**
     * Inserts wrapper `details` in a comment at the top of the `source` body.
     *
     * @private
     * @param {string} source The source to modify.
     * @returns {Array} details The details to insert.
     * @returns {string} Returns the modified source.
     */
    function insertWrapDetails(source, details) {
      var length = details.length;
      if (!length) {
        return source;
      }
      var lastIndex = length - 1;
      details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
      details = details.join(length > 2 ? ', ' : ' ');
      return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
    }

    /**
     * Checks if `value` is a flattenable `arguments` object or array.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
     */
    function isFlattenable(value) {
      return isArray(value) || isArguments(value) ||
        !!(spreadableSymbol && value && value[spreadableSymbol]);
    }

    /**
     * Checks if `value` is a valid array-like index.
     *
     * @private
     * @param {*} value The value to check.
     * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
     * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
     */
    function isIndex(value, length) {
      var type = typeof value;
      length = length == null ? MAX_SAFE_INTEGER : length;

      return !!length &&
        (type == 'number' ||
          (type != 'symbol' && reIsUint.test(value))) &&
            (value > -1 && value % 1 == 0 && value < length);
    }

    /**
     * Checks if the given arguments are from an iteratee call.
     *
     * @private
     * @param {*} value The potential iteratee value argument.
     * @param {*} index The potential iteratee index or key argument.
     * @param {*} object The potential iteratee object argument.
     * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
     *  else `false`.
     */
    function isIterateeCall(value, index, object) {
      if (!isObject(object)) {
        return false;
      }
      var type = typeof index;
      if (type == 'number'
            ? (isArrayLike(object) && isIndex(index, object.length))
            : (type == 'string' && index in object)
          ) {
        return eq(object[index], value);
      }
      return false;
    }

    /**
     * Checks if `value` is a property name and not a property path.
     *
     * @private
     * @param {*} value The value to check.
     * @param {Object} [object] The object to query keys on.
     * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
     */
    function isKey(value, object) {
      if (isArray(value)) {
        return false;
      }
      var type = typeof value;
      if (type == 'number' || type == 'symbol' || type == 'boolean' ||
          value == null || isSymbol(value)) {
        return true;
      }
      return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
        (object != null && value in Object(object));
    }

    /**
     * Checks if `value` is suitable for use as unique object key.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
     */
    function isKeyable(value) {
      var type = typeof value;
      return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
        ? (value !== '__proto__')
        : (value === null);
    }

    /**
     * Checks if `func` has a lazy counterpart.
     *
     * @private
     * @param {Function} func The function to check.
     * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
     *  else `false`.
     */
    function isLaziable(func) {
      var funcName = getFuncName(func),
          other = lodash[funcName];

      if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
        return false;
      }
      if (func === other) {
        return true;
      }
      var data = getData(other);
      return !!data && func === data[0];
    }

    /**
     * Checks if `func` has its source masked.
     *
     * @private
     * @param {Function} func The function to check.
     * @returns {boolean} Returns `true` if `func` is masked, else `false`.
     */
    function isMasked(func) {
      return !!maskSrcKey && (maskSrcKey in func);
    }

    /**
     * Checks if `func` is capable of being masked.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
     */
    var isMaskable = coreJsData ? isFunction : stubFalse;

    /**
     * Checks if `value` is likely a prototype object.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
     */
    function isPrototype(value) {
      var Ctor = value && value.constructor,
          proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;

      return value === proto;
    }

    /**
     * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` if suitable for strict
     *  equality comparisons, else `false`.
     */
    function isStrictComparable(value) {
      return value === value && !isObject(value);
    }

    /**
     * A specialized version of `matchesProperty` for source values suitable
     * for strict equality comparisons, i.e. `===`.
     *
     * @private
     * @param {string} key The key of the property to get.
     * @param {*} srcValue The value to match.
     * @returns {Function} Returns the new spec function.
     */
    function matchesStrictComparable(key, srcValue) {
      return function(object) {
        if (object == null) {
          return false;
        }
        return object[key] === srcValue &&
          (srcValue !== undefined || (key in Object(object)));
      };
    }

    /**
     * A specialized version of `_.memoize` which clears the memoized function's
     * cache when it exceeds `MAX_MEMOIZE_SIZE`.
     *
     * @private
     * @param {Function} func The function to have its output memoized.
     * @returns {Function} Returns the new memoized function.
     */
    function memoizeCapped(func) {
      var result = memoize(func, function(key) {
        if (cache.size === MAX_MEMOIZE_SIZE) {
          cache.clear();
        }
        return key;
      });

      var cache = result.cache;
      return result;
    }

    /**
     * Merges the function metadata of `source` into `data`.
     *
     * Merging metadata reduces the number of wrappers used to invoke a function.
     * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
     * may be applied regardless of execution order. Methods like `_.ary` and
     * `_.rearg` modify function arguments, making the order in which they are
     * executed important, preventing the merging of metadata. However, we make
     * an exception for a safe combined case where curried functions have `_.ary`
     * and or `_.rearg` applied.
     *
     * @private
     * @param {Array} data The destination metadata.
     * @param {Array} source The source metadata.
     * @returns {Array} Returns `data`.
     */
    function mergeData(data, source) {
      var bitmask = data[1],
          srcBitmask = source[1],
          newBitmask = bitmask | srcBitmask,
          isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);

      var isCombo =
        ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
        ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
        ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));

      // Exit early if metadata can't be merged.
      if (!(isCommon || isCombo)) {
        return data;
      }
      // Use source `thisArg` if available.
      if (srcBitmask & WRAP_BIND_FLAG) {
        data[2] = source[2];
        // Set when currying a bound function.
        newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
      }
      // Compose partial arguments.
      var value = source[3];
      if (value) {
        var partials = data[3];
        data[3] = partials ? composeArgs(partials, value, source[4]) : value;
        data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
      }
      // Compose partial right arguments.
      value = source[5];
      if (value) {
        partials = data[5];
        data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
        data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
      }
      // Use source `argPos` if available.
      value = source[7];
      if (value) {
        data[7] = value;
      }
      // Use source `ary` if it's smaller.
      if (srcBitmask & WRAP_ARY_FLAG) {
        data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
      }
      // Use source `arity` if one is not provided.
      if (data[9] == null) {
        data[9] = source[9];
      }
      // Use source `func` and merge bitmasks.
      data[0] = source[0];
      data[1] = newBitmask;

      return data;
    }

    /**
     * This function is like
     * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
     * except that it includes inherited enumerable properties.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     */
    function nativeKeysIn(object) {
      var result = [];
      if (object != null) {
        for (var key in Object(object)) {
          result.push(key);
        }
      }
      return result;
    }

    /**
     * Converts `value` to a string using `Object.prototype.toString`.
     *
     * @private
     * @param {*} value The value to convert.
     * @returns {string} Returns the converted string.
     */
    function objectToString(value) {
      return nativeObjectToString.call(value);
    }

    /**
     * A specialized version of `baseRest` which transforms the rest array.
     *
     * @private
     * @param {Function} func The function to apply a rest parameter to.
     * @param {number} [start=func.length-1] The start position of the rest parameter.
     * @param {Function} transform The rest array transform.
     * @returns {Function} Returns the new function.
     */
    function overRest(func, start, transform) {
      start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
      return function() {
        var args = arguments,
            index = -1,
            length = nativeMax(args.length - start, 0),
            array = Array(length);

        while (++index < length) {
          array[index] = args[start + index];
        }
        index = -1;
        var otherArgs = Array(start + 1);
        while (++index < start) {
          otherArgs[index] = args[index];
        }
        otherArgs[start] = transform(array);
        return apply(func, this, otherArgs);
      };
    }

    /**
     * Gets the parent value at `path` of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {Array} path The path to get the parent value of.
     * @returns {*} Returns the parent value.
     */
    function parent(object, path) {
      return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
    }

    /**
     * Reorder `array` according to the specified indexes where the element at
     * the first index is assigned as the first element, the element at
     * the second index is assigned as the second element, and so on.
     *
     * @private
     * @param {Array} array The array to reorder.
     * @param {Array} indexes The arranged array indexes.
     * @returns {Array} Returns `array`.
     */
    function reorder(array, indexes) {
      var arrLength = array.length,
          length = nativeMin(indexes.length, arrLength),
          oldArray = copyArray(array);

      while (length--) {
        var index = indexes[length];
        array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
      }
      return array;
    }

    /**
     * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
     *
     * @private
     * @param {Object} object The object to query.
     * @param {string} key The key of the property to get.
     * @returns {*} Returns the property value.
     */
    function safeGet(object, key) {
      if (key === 'constructor' && typeof object[key] === 'function') {
        return;
      }

      if (key == '__proto__') {
        return;
      }

      return object[key];
    }

    /**
     * Sets metadata for `func`.
     *
     * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
     * period of time, it will trip its breaker and transition to an identity
     * function to avoid garbage collection pauses in V8. See
     * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
     * for more details.
     *
     * @private
     * @param {Function} func The function to associate metadata with.
     * @param {*} data The metadata.
     * @returns {Function} Returns `func`.
     */
    var setData = shortOut(baseSetData);

    /**
     * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
     *
     * @private
     * @param {Function} func The function to delay.
     * @param {number} wait The number of milliseconds to delay invocation.
     * @returns {number|Object} Returns the timer id or timeout object.
     */
    var setTimeout = ctxSetTimeout || function(func, wait) {
      return root.setTimeout(func, wait);
    };

    /**
     * Sets the `toString` method of `func` to return `string`.
     *
     * @private
     * @param {Function} func The function to modify.
     * @param {Function} string The `toString` result.
     * @returns {Function} Returns `func`.
     */
    var setToString = shortOut(baseSetToString);

    /**
     * Sets the `toString` method of `wrapper` to mimic the source of `reference`
     * with wrapper details in a comment at the top of the source body.
     *
     * @private
     * @param {Function} wrapper The function to modify.
     * @param {Function} reference The reference function.
     * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
     * @returns {Function} Returns `wrapper`.
     */
    function setWrapToString(wrapper, reference, bitmask) {
      var source = (reference + '');
      return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
    }

    /**
     * Creates a function that'll short out and invoke `identity` instead
     * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
     * milliseconds.
     *
     * @private
     * @param {Function} func The function to restrict.
     * @returns {Function} Returns the new shortable function.
     */
    function shortOut(func) {
      var count = 0,
          lastCalled = 0;

      return function() {
        var stamp = nativeNow(),
            remaining = HOT_SPAN - (stamp - lastCalled);

        lastCalled = stamp;
        if (remaining > 0) {
          if (++count >= HOT_COUNT) {
            return arguments[0];
          }
        } else {
          count = 0;
        }
        return func.apply(undefined, arguments);
      };
    }

    /**
     * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
     *
     * @private
     * @param {Array} array The array to shuffle.
     * @param {number} [size=array.length] The size of `array`.
     * @returns {Array} Returns `array`.
     */
    function shuffleSelf(array, size) {
      var index = -1,
          length = array.length,
          lastIndex = length - 1;

      size = size === undefined ? length : size;
      while (++index < size) {
        var rand = baseRandom(index, lastIndex),
            value = array[rand];

        array[rand] = array[index];
        array[index] = value;
      }
      array.length = size;
      return array;
    }

    /**
     * Converts `string` to a property path array.
     *
     * @private
     * @param {string} string The string to convert.
     * @returns {Array} Returns the property path array.
     */
    var stringToPath = memoizeCapped(function(string) {
      var result = [];
      if (string.charCodeAt(0) === 46 /* . */) {
        result.push('');
      }
      string.replace(rePropName, function(match, number, quote, subString) {
        result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
      });
      return result;
    });

    /**
     * Converts `value` to a string key if it's not a string or symbol.
     *
     * @private
     * @param {*} value The value to inspect.
     * @returns {string|symbol} Returns the key.
     */
    function toKey(value) {
      if (typeof value == 'string' || isSymbol(value)) {
        return value;
      }
      var result = (value + '');
      return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
    }

    /**
     * Converts `func` to its source code.
     *
     * @private
     * @param {Function} func The function to convert.
     * @returns {string} Returns the source code.
     */
    function toSource(func) {
      if (func != null) {
        try {
          return funcToString.call(func);
        } catch (e) {}
        try {
          return (func + '');
        } catch (e) {}
      }
      return '';
    }

    /**
     * Updates wrapper `details` based on `bitmask` flags.
     *
     * @private
     * @returns {Array} details The details to modify.
     * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
     * @returns {Array} Returns `details`.
     */
    function updateWrapDetails(details, bitmask) {
      arrayEach(wrapFlags, function(pair) {
        var value = '_.' + pair[0];
        if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
          details.push(value);
        }
      });
      return details.sort();
    }

    /**
     * Creates a clone of `wrapper`.
     *
     * @private
     * @param {Object} wrapper The wrapper to clone.
     * @returns {Object} Returns the cloned wrapper.
     */
    function wrapperClone(wrapper) {
      if (wrapper instanceof LazyWrapper) {
        return wrapper.clone();
      }
      var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
      result.__actions__ = copyArray(wrapper.__actions__);
      result.__index__  = wrapper.__index__;
      result.__values__ = wrapper.__values__;
      return result;
    }

    /*------------------------------------------------------------------------*/

    /**
     * Creates an array of elements split into groups the length of `size`.
     * If `array` can't be split evenly, the final chunk will be the remaining
     * elements.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The array to process.
     * @param {number} [size=1] The length of each chunk
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Array} Returns the new array of chunks.
     * @example
     *
     * _.chunk(['a', 'b', 'c', 'd'], 2);
     * // => [['a', 'b'], ['c', 'd']]
     *
     * _.chunk(['a', 'b', 'c', 'd'], 3);
     * // => [['a', 'b', 'c'], ['d']]
     */
    function chunk(array, size, guard) {
      if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
        size = 1;
      } else {
        size = nativeMax(toInteger(size), 0);
      }
      var length = array == null ? 0 : array.length;
      if (!length || size < 1) {
        return [];
      }
      var index = 0,
          resIndex = 0,
          result = Array(nativeCeil(length / size));

      while (index < length) {
        result[resIndex++] = baseSlice(array, index, (index += size));
      }
      return result;
    }

    /**
     * Creates an array with all falsey values removed. The values `false`, `null`,
     * `0`, `""`, `undefined`, and `NaN` are falsey.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The array to compact.
     * @returns {Array} Returns the new array of filtered values.
     * @example
     *
     * _.compact([0, 1, false, 2, '', 3]);
     * // => [1, 2, 3]
     */
    function compact(array) {
      var index = -1,
          length = array == null ? 0 : array.length,
          resIndex = 0,
          result = [];

      while (++index < length) {
        var value = array[index];
        if (value) {
          result[resIndex++] = value;
        }
      }
      return result;
    }

    /**
     * Creates a new array concatenating `array` with any additional arrays
     * and/or values.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to concatenate.
     * @param {...*} [values] The values to concatenate.
     * @returns {Array} Returns the new concatenated array.
     * @example
     *
     * var array = [1];
     * var other = _.concat(array, 2, [3], [[4]]);
     *
     * console.log(other);
     * // => [1, 2, 3, [4]]
     *
     * console.log(array);
     * // => [1]
     */
    function concat() {
      var length = arguments.length;
      if (!length) {
        return [];
      }
      var args = Array(length - 1),
          array = arguments[0],
          index = length;

      while (index--) {
        args[index - 1] = arguments[index];
      }
      return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
    }

    /**
     * Creates an array of `array` values not included in the other given arrays
     * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * for equality comparisons. The order and references of result values are
     * determined by the first array.
     *
     * **Note:** Unlike `_.pullAll`, this method returns a new array.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {...Array} [values] The values to exclude.
     * @returns {Array} Returns the new array of filtered values.
     * @see _.without, _.xor
     * @example
     *
     * _.difference([2, 1], [2, 3]);
     * // => [1]
     */
    var difference = baseRest(function(array, values) {
      return isArrayLikeObject(array)
        ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
        : [];
    });

    /**
     * This method is like `_.difference` except that it accepts `iteratee` which
     * is invoked for each element of `array` and `values` to generate the criterion
     * by which they're compared. The order and references of result values are
     * determined by the first array. The iteratee is invoked with one argument:
     * (value).
     *
     * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {...Array} [values] The values to exclude.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {Array} Returns the new array of filtered values.
     * @example
     *
     * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
     * // => [1.2]
     *
     * // The `_.property` iteratee shorthand.
     * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
     * // => [{ 'x': 2 }]
     */
    var differenceBy = baseRest(function(array, values) {
      var iteratee = last(values);
      if (isArrayLikeObject(iteratee)) {
        iteratee = undefined;
      }
      return isArrayLikeObject(array)
        ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
        : [];
    });

    /**
     * This method is like `_.difference` except that it accepts `comparator`
     * which is invoked to compare elements of `array` to `values`. The order and
     * references of result values are determined by the first array. The comparator
     * is invoked with two arguments: (arrVal, othVal).
     *
     * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {...Array} [values] The values to exclude.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns the new array of filtered values.
     * @example
     *
     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
     *
     * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
     * // => [{ 'x': 2, 'y': 1 }]
     */
    var differenceWith = baseRest(function(array, values) {
      var comparator = last(values);
      if (isArrayLikeObject(comparator)) {
        comparator = undefined;
      }
      return isArrayLikeObject(array)
        ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
        : [];
    });

    /**
     * Creates a slice of `array` with `n` elements dropped from the beginning.
     *
     * @static
     * @memberOf _
     * @since 0.5.0
     * @category Array
     * @param {Array} array The array to query.
     * @param {number} [n=1] The number of elements to drop.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.drop([1, 2, 3]);
     * // => [2, 3]
     *
     * _.drop([1, 2, 3], 2);
     * // => [3]
     *
     * _.drop([1, 2, 3], 5);
     * // => []
     *
     * _.drop([1, 2, 3], 0);
     * // => [1, 2, 3]
     */
    function drop(array, n, guard) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return [];
      }
      n = (guard || n === undefined) ? 1 : toInteger(n);
      return baseSlice(array, n < 0 ? 0 : n, length);
    }

    /**
     * Creates a slice of `array` with `n` elements dropped from the end.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The array to query.
     * @param {number} [n=1] The number of elements to drop.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.dropRight([1, 2, 3]);
     * // => [1, 2]
     *
     * _.dropRight([1, 2, 3], 2);
     * // => [1]
     *
     * _.dropRight([1, 2, 3], 5);
     * // => []
     *
     * _.dropRight([1, 2, 3], 0);
     * // => [1, 2, 3]
     */
    function dropRight(array, n, guard) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return [];
      }
      n = (guard || n === undefined) ? 1 : toInteger(n);
      n = length - n;
      return baseSlice(array, 0, n < 0 ? 0 : n);
    }

    /**
     * Creates a slice of `array` excluding elements dropped from the end.
     * Elements are dropped until `predicate` returns falsey. The predicate is
     * invoked with three arguments: (value, index, array).
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The array to query.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'active': true },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': false }
     * ];
     *
     * _.dropRightWhile(users, function(o) { return !o.active; });
     * // => objects for ['barney']
     *
     * // The `_.matches` iteratee shorthand.
     * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
     * // => objects for ['barney', 'fred']
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.dropRightWhile(users, ['active', false]);
     * // => objects for ['barney']
     *
     * // The `_.property` iteratee shorthand.
     * _.dropRightWhile(users, 'active');
     * // => objects for ['barney', 'fred', 'pebbles']
     */
    function dropRightWhile(array, predicate) {
      return (array && array.length)
        ? baseWhile(array, getIteratee(predicate, 3), true, true)
        : [];
    }

    /**
     * Creates a slice of `array` excluding elements dropped from the beginning.
     * Elements are dropped until `predicate` returns falsey. The predicate is
     * invoked with three arguments: (value, index, array).
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The array to query.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'active': false },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': true }
     * ];
     *
     * _.dropWhile(users, function(o) { return !o.active; });
     * // => objects for ['pebbles']
     *
     * // The `_.matches` iteratee shorthand.
     * _.dropWhile(users, { 'user': 'barney', 'active': false });
     * // => objects for ['fred', 'pebbles']
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.dropWhile(users, ['active', false]);
     * // => objects for ['pebbles']
     *
     * // The `_.property` iteratee shorthand.
     * _.dropWhile(users, 'active');
     * // => objects for ['barney', 'fred', 'pebbles']
     */
    function dropWhile(array, predicate) {
      return (array && array.length)
        ? baseWhile(array, getIteratee(predicate, 3), true)
        : [];
    }

    /**
     * Fills elements of `array` with `value` from `start` up to, but not
     * including, `end`.
     *
     * **Note:** This method mutates `array`.
     *
     * @static
     * @memberOf _
     * @since 3.2.0
     * @category Array
     * @param {Array} array The array to fill.
     * @param {*} value The value to fill `array` with.
     * @param {number} [start=0] The start position.
     * @param {number} [end=array.length] The end position.
     * @returns {Array} Returns `array`.
     * @example
     *
     * var array = [1, 2, 3];
     *
     * _.fill(array, 'a');
     * console.log(array);
     * // => ['a', 'a', 'a']
     *
     * _.fill(Array(3), 2);
     * // => [2, 2, 2]
     *
     * _.fill([4, 6, 8, 10], '*', 1, 3);
     * // => [4, '*', '*', 10]
     */
    function fill(array, value, start, end) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return [];
      }
      if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
        start = 0;
        end = length;
      }
      return baseFill(array, value, start, end);
    }

    /**
     * This method is like `_.find` except that it returns the index of the first
     * element `predicate` returns truthy for instead of the element itself.
     *
     * @static
     * @memberOf _
     * @since 1.1.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @param {number} [fromIndex=0] The index to search from.
     * @returns {number} Returns the index of the found element, else `-1`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'active': false },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': true }
     * ];
     *
     * _.findIndex(users, function(o) { return o.user == 'barney'; });
     * // => 0
     *
     * // The `_.matches` iteratee shorthand.
     * _.findIndex(users, { 'user': 'fred', 'active': false });
     * // => 1
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.findIndex(users, ['active', false]);
     * // => 0
     *
     * // The `_.property` iteratee shorthand.
     * _.findIndex(users, 'active');
     * // => 2
     */
    function findIndex(array, predicate, fromIndex) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return -1;
      }
      var index = fromIndex == null ? 0 : toInteger(fromIndex);
      if (index < 0) {
        index = nativeMax(length + index, 0);
      }
      return baseFindIndex(array, getIteratee(predicate, 3), index);
    }

    /**
     * This method is like `_.findIndex` except that it iterates over elements
     * of `collection` from right to left.
     *
     * @static
     * @memberOf _
     * @since 2.0.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @param {number} [fromIndex=array.length-1] The index to search from.
     * @returns {number} Returns the index of the found element, else `-1`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'active': true },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': false }
     * ];
     *
     * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
     * // => 2
     *
     * // The `_.matches` iteratee shorthand.
     * _.findLastIndex(users, { 'user': 'barney', 'active': true });
     * // => 0
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.findLastIndex(users, ['active', false]);
     * // => 2
     *
     * // The `_.property` iteratee shorthand.
     * _.findLastIndex(users, 'active');
     * // => 0
     */
    function findLastIndex(array, predicate, fromIndex) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return -1;
      }
      var index = length - 1;
      if (fromIndex !== undefined) {
        index = toInteger(fromIndex);
        index = fromIndex < 0
          ? nativeMax(length + index, 0)
          : nativeMin(index, length - 1);
      }
      return baseFindIndex(array, getIteratee(predicate, 3), index, true);
    }

    /**
     * Flattens `array` a single level deep.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The array to flatten.
     * @returns {Array} Returns the new flattened array.
     * @example
     *
     * _.flatten([1, [2, [3, [4]], 5]]);
     * // => [1, 2, [3, [4]], 5]
     */
    function flatten(array) {
      var length = array == null ? 0 : array.length;
      return length ? baseFlatten(array, 1) : [];
    }

    /**
     * Recursively flattens `array`.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The array to flatten.
     * @returns {Array} Returns the new flattened array.
     * @example
     *
     * _.flattenDeep([1, [2, [3, [4]], 5]]);
     * // => [1, 2, 3, 4, 5]
     */
    function flattenDeep(array) {
      var length = array == null ? 0 : array.length;
      return length ? baseFlatten(array, INFINITY) : [];
    }

    /**
     * Recursively flatten `array` up to `depth` times.
     *
     * @static
     * @memberOf _
     * @since 4.4.0
     * @category Array
     * @param {Array} array The array to flatten.
     * @param {number} [depth=1] The maximum recursion depth.
     * @returns {Array} Returns the new flattened array.
     * @example
     *
     * var array = [1, [2, [3, [4]], 5]];
     *
     * _.flattenDepth(array, 1);
     * // => [1, 2, [3, [4]], 5]
     *
     * _.flattenDepth(array, 2);
     * // => [1, 2, 3, [4], 5]
     */
    function flattenDepth(array, depth) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return [];
      }
      depth = depth === undefined ? 1 : toInteger(depth);
      return baseFlatten(array, depth);
    }

    /**
     * The inverse of `_.toPairs`; this method returns an object composed
     * from key-value `pairs`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} pairs The key-value pairs.
     * @returns {Object} Returns the new object.
     * @example
     *
     * _.fromPairs([['a', 1], ['b', 2]]);
     * // => { 'a': 1, 'b': 2 }
     */
    function fromPairs(pairs) {
      var index = -1,
          length = pairs == null ? 0 : pairs.length,
          result = {};

      while (++index < length) {
        var pair = pairs[index];
        result[pair[0]] = pair[1];
      }
      return result;
    }

    /**
     * Gets the first element of `array`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @alias first
     * @category Array
     * @param {Array} array The array to query.
     * @returns {*} Returns the first element of `array`.
     * @example
     *
     * _.head([1, 2, 3]);
     * // => 1
     *
     * _.head([]);
     * // => undefined
     */
    function head(array) {
      return (array && array.length) ? array[0] : undefined;
    }

    /**
     * Gets the index at which the first occurrence of `value` is found in `array`
     * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * for equality comparisons. If `fromIndex` is negative, it's used as the
     * offset from the end of `array`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {*} value The value to search for.
     * @param {number} [fromIndex=0] The index to search from.
     * @returns {number} Returns the index of the matched value, else `-1`.
     * @example
     *
     * _.indexOf([1, 2, 1, 2], 2);
     * // => 1
     *
     * // Search from the `fromIndex`.
     * _.indexOf([1, 2, 1, 2], 2, 2);
     * // => 3
     */
    function indexOf(array, value, fromIndex) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return -1;
      }
      var index = fromIndex == null ? 0 : toInteger(fromIndex);
      if (index < 0) {
        index = nativeMax(length + index, 0);
      }
      return baseIndexOf(array, value, index);
    }

    /**
     * Gets all but the last element of `array`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The array to query.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.initial([1, 2, 3]);
     * // => [1, 2]
     */
    function initial(array) {
      var length = array == null ? 0 : array.length;
      return length ? baseSlice(array, 0, -1) : [];
    }

    /**
     * Creates an array of unique values that are included in all given arrays
     * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * for equality comparisons. The order and references of result values are
     * determined by the first array.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @returns {Array} Returns the new array of intersecting values.
     * @example
     *
     * _.intersection([2, 1], [2, 3]);
     * // => [2]
     */
    var intersection = baseRest(function(arrays) {
      var mapped = arrayMap(arrays, castArrayLikeObject);
      return (mapped.length && mapped[0] === arrays[0])
        ? baseIntersection(mapped)
        : [];
    });

    /**
     * This method is like `_.intersection` except that it accepts `iteratee`
     * which is invoked for each element of each `arrays` to generate the criterion
     * by which they're compared. The order and references of result values are
     * determined by the first array. The iteratee is invoked with one argument:
     * (value).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {Array} Returns the new array of intersecting values.
     * @example
     *
     * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
     * // => [2.1]
     *
     * // The `_.property` iteratee shorthand.
     * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
     * // => [{ 'x': 1 }]
     */
    var intersectionBy = baseRest(function(arrays) {
      var iteratee = last(arrays),
          mapped = arrayMap(arrays, castArrayLikeObject);

      if (iteratee === last(mapped)) {
        iteratee = undefined;
      } else {
        mapped.pop();
      }
      return (mapped.length && mapped[0] === arrays[0])
        ? baseIntersection(mapped, getIteratee(iteratee, 2))
        : [];
    });

    /**
     * This method is like `_.intersection` except that it accepts `comparator`
     * which is invoked to compare elements of `arrays`. The order and references
     * of result values are determined by the first array. The comparator is
     * invoked with two arguments: (arrVal, othVal).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns the new array of intersecting values.
     * @example
     *
     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
     * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
     *
     * _.intersectionWith(objects, others, _.isEqual);
     * // => [{ 'x': 1, 'y': 2 }]
     */
    var intersectionWith = baseRest(function(arrays) {
      var comparator = last(arrays),
          mapped = arrayMap(arrays, castArrayLikeObject);

      comparator = typeof comparator == 'function' ? comparator : undefined;
      if (comparator) {
        mapped.pop();
      }
      return (mapped.length && mapped[0] === arrays[0])
        ? baseIntersection(mapped, undefined, comparator)
        : [];
    });

    /**
     * Converts all elements in `array` into a string separated by `separator`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to convert.
     * @param {string} [separator=','] The element separator.
     * @returns {string} Returns the joined string.
     * @example
     *
     * _.join(['a', 'b', 'c'], '~');
     * // => 'a~b~c'
     */
    function join(array, separator) {
      return array == null ? '' : nativeJoin.call(array, separator);
    }

    /**
     * Gets the last element of `array`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The array to query.
     * @returns {*} Returns the last element of `array`.
     * @example
     *
     * _.last([1, 2, 3]);
     * // => 3
     */
    function last(array) {
      var length = array == null ? 0 : array.length;
      return length ? array[length - 1] : undefined;
    }

    /**
     * This method is like `_.indexOf` except that it iterates over elements of
     * `array` from right to left.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {*} value The value to search for.
     * @param {number} [fromIndex=array.length-1] The index to search from.
     * @returns {number} Returns the index of the matched value, else `-1`.
     * @example
     *
     * _.lastIndexOf([1, 2, 1, 2], 2);
     * // => 3
     *
     * // Search from the `fromIndex`.
     * _.lastIndexOf([1, 2, 1, 2], 2, 2);
     * // => 1
     */
    function lastIndexOf(array, value, fromIndex) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return -1;
      }
      var index = length;
      if (fromIndex !== undefined) {
        index = toInteger(fromIndex);
        index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
      }
      return value === value
        ? strictLastIndexOf(array, value, index)
        : baseFindIndex(array, baseIsNaN, index, true);
    }

    /**
     * Gets the element at index `n` of `array`. If `n` is negative, the nth
     * element from the end is returned.
     *
     * @static
     * @memberOf _
     * @since 4.11.0
     * @category Array
     * @param {Array} array The array to query.
     * @param {number} [n=0] The index of the element to return.
     * @returns {*} Returns the nth element of `array`.
     * @example
     *
     * var array = ['a', 'b', 'c', 'd'];
     *
     * _.nth(array, 1);
     * // => 'b'
     *
     * _.nth(array, -2);
     * // => 'c';
     */
    function nth(array, n) {
      return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
    }

    /**
     * Removes all given values from `array` using
     * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * for equality comparisons.
     *
     * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
     * to remove elements from an array by predicate.
     *
     * @static
     * @memberOf _
     * @since 2.0.0
     * @category Array
     * @param {Array} array The array to modify.
     * @param {...*} [values] The values to remove.
     * @returns {Array} Returns `array`.
     * @example
     *
     * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
     *
     * _.pull(array, 'a', 'c');
     * console.log(array);
     * // => ['b', 'b']
     */
    var pull = baseRest(pullAll);

    /**
     * This method is like `_.pull` except that it accepts an array of values to remove.
     *
     * **Note:** Unlike `_.difference`, this method mutates `array`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to modify.
     * @param {Array} values The values to remove.
     * @returns {Array} Returns `array`.
     * @example
     *
     * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
     *
     * _.pullAll(array, ['a', 'c']);
     * console.log(array);
     * // => ['b', 'b']
     */
    function pullAll(array, values) {
      return (array && array.length && values && values.length)
        ? basePullAll(array, values)
        : array;
    }

    /**
     * This method is like `_.pullAll` except that it accepts `iteratee` which is
     * invoked for each element of `array` and `values` to generate the criterion
     * by which they're compared. The iteratee is invoked with one argument: (value).
     *
     * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to modify.
     * @param {Array} values The values to remove.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {Array} Returns `array`.
     * @example
     *
     * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
     *
     * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
     * console.log(array);
     * // => [{ 'x': 2 }]
     */
    function pullAllBy(array, values, iteratee) {
      return (array && array.length && values && values.length)
        ? basePullAll(array, values, getIteratee(iteratee, 2))
        : array;
    }

    /**
     * This method is like `_.pullAll` except that it accepts `comparator` which
     * is invoked to compare elements of `array` to `values`. The comparator is
     * invoked with two arguments: (arrVal, othVal).
     *
     * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
     *
     * @static
     * @memberOf _
     * @since 4.6.0
     * @category Array
     * @param {Array} array The array to modify.
     * @param {Array} values The values to remove.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns `array`.
     * @example
     *
     * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
     *
     * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
     * console.log(array);
     * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
     */
    function pullAllWith(array, values, comparator) {
      return (array && array.length && values && values.length)
        ? basePullAll(array, values, undefined, comparator)
        : array;
    }

    /**
     * Removes elements from `array` corresponding to `indexes` and returns an
     * array of removed elements.
     *
     * **Note:** Unlike `_.at`, this method mutates `array`.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The array to modify.
     * @param {...(number|number[])} [indexes] The indexes of elements to remove.
     * @returns {Array} Returns the new array of removed elements.
     * @example
     *
     * var array = ['a', 'b', 'c', 'd'];
     * var pulled = _.pullAt(array, [1, 3]);
     *
     * console.log(array);
     * // => ['a', 'c']
     *
     * console.log(pulled);
     * // => ['b', 'd']
     */
    var pullAt = flatRest(function(array, indexes) {
      var length = array == null ? 0 : array.length,
          result = baseAt(array, indexes);

      basePullAt(array, arrayMap(indexes, function(index) {
        return isIndex(index, length) ? +index : index;
      }).sort(compareAscending));

      return result;
    });

    /**
     * Removes all elements from `array` that `predicate` returns truthy for
     * and returns an array of the removed elements. The predicate is invoked
     * with three arguments: (value, index, array).
     *
     * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
     * to pull elements from an array by value.
     *
     * @static
     * @memberOf _
     * @since 2.0.0
     * @category Array
     * @param {Array} array The array to modify.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the new array of removed elements.
     * @example
     *
     * var array = [1, 2, 3, 4];
     * var evens = _.remove(array, function(n) {
     *   return n % 2 == 0;
     * });
     *
     * console.log(array);
     * // => [1, 3]
     *
     * console.log(evens);
     * // => [2, 4]
     */
    function remove(array, predicate) {
      var result = [];
      if (!(array && array.length)) {
        return result;
      }
      var index = -1,
          indexes = [],
          length = array.length;

      predicate = getIteratee(predicate, 3);
      while (++index < length) {
        var value = array[index];
        if (predicate(value, index, array)) {
          result.push(value);
          indexes.push(index);
        }
      }
      basePullAt(array, indexes);
      return result;
    }

    /**
     * Reverses `array` so that the first element becomes the last, the second
     * element becomes the second to last, and so on.
     *
     * **Note:** This method mutates `array` and is based on
     * [`Array#reverse`](https://mdn.io/Array/reverse).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to modify.
     * @returns {Array} Returns `array`.
     * @example
     *
     * var array = [1, 2, 3];
     *
     * _.reverse(array);
     * // => [3, 2, 1]
     *
     * console.log(array);
     * // => [3, 2, 1]
     */
    function reverse(array) {
      return array == null ? array : nativeReverse.call(array);
    }

    /**
     * Creates a slice of `array` from `start` up to, but not including, `end`.
     *
     * **Note:** This method is used instead of
     * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
     * returned.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The array to slice.
     * @param {number} [start=0] The start position.
     * @param {number} [end=array.length] The end position.
     * @returns {Array} Returns the slice of `array`.
     */
    function slice(array, start, end) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return [];
      }
      if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
        start = 0;
        end = length;
      }
      else {
        start = start == null ? 0 : toInteger(start);
        end = end === undefined ? length : toInteger(end);
      }
      return baseSlice(array, start, end);
    }

    /**
     * Uses a binary search to determine the lowest index at which `value`
     * should be inserted into `array` in order to maintain its sort order.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The sorted array to inspect.
     * @param {*} value The value to evaluate.
     * @returns {number} Returns the index at which `value` should be inserted
     *  into `array`.
     * @example
     *
     * _.sortedIndex([30, 50], 40);
     * // => 1
     */
    function sortedIndex(array, value) {
      return baseSortedIndex(array, value);
    }

    /**
     * This method is like `_.sortedIndex` except that it accepts `iteratee`
     * which is invoked for `value` and each element of `array` to compute their
     * sort ranking. The iteratee is invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The sorted array to inspect.
     * @param {*} value The value to evaluate.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {number} Returns the index at which `value` should be inserted
     *  into `array`.
     * @example
     *
     * var objects = [{ 'x': 4 }, { 'x': 5 }];
     *
     * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
     * // => 0
     *
     * // The `_.property` iteratee shorthand.
     * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
     * // => 0
     */
    function sortedIndexBy(array, value, iteratee) {
      return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
    }

    /**
     * This method is like `_.indexOf` except that it performs a binary
     * search on a sorted `array`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {*} value The value to search for.
     * @returns {number} Returns the index of the matched value, else `-1`.
     * @example
     *
     * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
     * // => 1
     */
    function sortedIndexOf(array, value) {
      var length = array == null ? 0 : array.length;
      if (length) {
        var index = baseSortedIndex(array, value);
        if (index < length && eq(array[index], value)) {
          return index;
        }
      }
      return -1;
    }

    /**
     * This method is like `_.sortedIndex` except that it returns the highest
     * index at which `value` should be inserted into `array` in order to
     * maintain its sort order.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The sorted array to inspect.
     * @param {*} value The value to evaluate.
     * @returns {number} Returns the index at which `value` should be inserted
     *  into `array`.
     * @example
     *
     * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
     * // => 4
     */
    function sortedLastIndex(array, value) {
      return baseSortedIndex(array, value, true);
    }

    /**
     * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
     * which is invoked for `value` and each element of `array` to compute their
     * sort ranking. The iteratee is invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The sorted array to inspect.
     * @param {*} value The value to evaluate.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {number} Returns the index at which `value` should be inserted
     *  into `array`.
     * @example
     *
     * var objects = [{ 'x': 4 }, { 'x': 5 }];
     *
     * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
     * // => 1
     *
     * // The `_.property` iteratee shorthand.
     * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
     * // => 1
     */
    function sortedLastIndexBy(array, value, iteratee) {
      return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
    }

    /**
     * This method is like `_.lastIndexOf` except that it performs a binary
     * search on a sorted `array`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {*} value The value to search for.
     * @returns {number} Returns the index of the matched value, else `-1`.
     * @example
     *
     * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
     * // => 3
     */
    function sortedLastIndexOf(array, value) {
      var length = array == null ? 0 : array.length;
      if (length) {
        var index = baseSortedIndex(array, value, true) - 1;
        if (eq(array[index], value)) {
          return index;
        }
      }
      return -1;
    }

    /**
     * This method is like `_.uniq` except that it's designed and optimized
     * for sorted arrays.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @returns {Array} Returns the new duplicate free array.
     * @example
     *
     * _.sortedUniq([1, 1, 2]);
     * // => [1, 2]
     */
    function sortedUniq(array) {
      return (array && array.length)
        ? baseSortedUniq(array)
        : [];
    }

    /**
     * This method is like `_.uniqBy` except that it's designed and optimized
     * for sorted arrays.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {Function} [iteratee] The iteratee invoked per element.
     * @returns {Array} Returns the new duplicate free array.
     * @example
     *
     * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
     * // => [1.1, 2.3]
     */
    function sortedUniqBy(array, iteratee) {
      return (array && array.length)
        ? baseSortedUniq(array, getIteratee(iteratee, 2))
        : [];
    }

    /**
     * Gets all but the first element of `array`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to query.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.tail([1, 2, 3]);
     * // => [2, 3]
     */
    function tail(array) {
      var length = array == null ? 0 : array.length;
      return length ? baseSlice(array, 1, length) : [];
    }

    /**
     * Creates a slice of `array` with `n` elements taken from the beginning.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The array to query.
     * @param {number} [n=1] The number of elements to take.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.take([1, 2, 3]);
     * // => [1]
     *
     * _.take([1, 2, 3], 2);
     * // => [1, 2]
     *
     * _.take([1, 2, 3], 5);
     * // => [1, 2, 3]
     *
     * _.take([1, 2, 3], 0);
     * // => []
     */
    function take(array, n, guard) {
      if (!(array && array.length)) {
        return [];
      }
      n = (guard || n === undefined) ? 1 : toInteger(n);
      return baseSlice(array, 0, n < 0 ? 0 : n);
    }

    /**
     * Creates a slice of `array` with `n` elements taken from the end.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The array to query.
     * @param {number} [n=1] The number of elements to take.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.takeRight([1, 2, 3]);
     * // => [3]
     *
     * _.takeRight([1, 2, 3], 2);
     * // => [2, 3]
     *
     * _.takeRight([1, 2, 3], 5);
     * // => [1, 2, 3]
     *
     * _.takeRight([1, 2, 3], 0);
     * // => []
     */
    function takeRight(array, n, guard) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return [];
      }
      n = (guard || n === undefined) ? 1 : toInteger(n);
      n = length - n;
      return baseSlice(array, n < 0 ? 0 : n, length);
    }

    /**
     * Creates a slice of `array` with elements taken from the end. Elements are
     * taken until `predicate` returns falsey. The predicate is invoked with
     * three arguments: (value, index, array).
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The array to query.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'active': true },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': false }
     * ];
     *
     * _.takeRightWhile(users, function(o) { return !o.active; });
     * // => objects for ['fred', 'pebbles']
     *
     * // The `_.matches` iteratee shorthand.
     * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
     * // => objects for ['pebbles']
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.takeRightWhile(users, ['active', false]);
     * // => objects for ['fred', 'pebbles']
     *
     * // The `_.property` iteratee shorthand.
     * _.takeRightWhile(users, 'active');
     * // => []
     */
    function takeRightWhile(array, predicate) {
      return (array && array.length)
        ? baseWhile(array, getIteratee(predicate, 3), false, true)
        : [];
    }

    /**
     * Creates a slice of `array` with elements taken from the beginning. Elements
     * are taken until `predicate` returns falsey. The predicate is invoked with
     * three arguments: (value, index, array).
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Array
     * @param {Array} array The array to query.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'active': false },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': true }
     * ];
     *
     * _.takeWhile(users, function(o) { return !o.active; });
     * // => objects for ['barney', 'fred']
     *
     * // The `_.matches` iteratee shorthand.
     * _.takeWhile(users, { 'user': 'barney', 'active': false });
     * // => objects for ['barney']
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.takeWhile(users, ['active', false]);
     * // => objects for ['barney', 'fred']
     *
     * // The `_.property` iteratee shorthand.
     * _.takeWhile(users, 'active');
     * // => []
     */
    function takeWhile(array, predicate) {
      return (array && array.length)
        ? baseWhile(array, getIteratee(predicate, 3))
        : [];
    }

    /**
     * Creates an array of unique values, in order, from all given arrays using
     * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * for equality comparisons.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @returns {Array} Returns the new array of combined values.
     * @example
     *
     * _.union([2], [1, 2]);
     * // => [2, 1]
     */
    var union = baseRest(function(arrays) {
      return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
    });

    /**
     * This method is like `_.union` except that it accepts `iteratee` which is
     * invoked for each element of each `arrays` to generate the criterion by
     * which uniqueness is computed. Result values are chosen from the first
     * array in which the value occurs. The iteratee is invoked with one argument:
     * (value).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {Array} Returns the new array of combined values.
     * @example
     *
     * _.unionBy([2.1], [1.2, 2.3], Math.floor);
     * // => [2.1, 1.2]
     *
     * // The `_.property` iteratee shorthand.
     * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
     * // => [{ 'x': 1 }, { 'x': 2 }]
     */
    var unionBy = baseRest(function(arrays) {
      var iteratee = last(arrays);
      if (isArrayLikeObject(iteratee)) {
        iteratee = undefined;
      }
      return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
    });

    /**
     * This method is like `_.union` except that it accepts `comparator` which
     * is invoked to compare elements of `arrays`. Result values are chosen from
     * the first array in which the value occurs. The comparator is invoked
     * with two arguments: (arrVal, othVal).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns the new array of combined values.
     * @example
     *
     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
     * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
     *
     * _.unionWith(objects, others, _.isEqual);
     * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
     */
    var unionWith = baseRest(function(arrays) {
      var comparator = last(arrays);
      comparator = typeof comparator == 'function' ? comparator : undefined;
      return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
    });

    /**
     * Creates a duplicate-free version of an array, using
     * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * for equality comparisons, in which only the first occurrence of each element
     * is kept. The order of result values is determined by the order they occur
     * in the array.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @returns {Array} Returns the new duplicate free array.
     * @example
     *
     * _.uniq([2, 1, 2]);
     * // => [2, 1]
     */
    function uniq(array) {
      return (array && array.length) ? baseUniq(array) : [];
    }

    /**
     * This method is like `_.uniq` except that it accepts `iteratee` which is
     * invoked for each element in `array` to generate the criterion by which
     * uniqueness is computed. The order of result values is determined by the
     * order they occur in the array. The iteratee is invoked with one argument:
     * (value).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {Array} Returns the new duplicate free array.
     * @example
     *
     * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
     * // => [2.1, 1.2]
     *
     * // The `_.property` iteratee shorthand.
     * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
     * // => [{ 'x': 1 }, { 'x': 2 }]
     */
    function uniqBy(array, iteratee) {
      return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
    }

    /**
     * This method is like `_.uniq` except that it accepts `comparator` which
     * is invoked to compare elements of `array`. The order of result values is
     * determined by the order they occur in the array.The comparator is invoked
     * with two arguments: (arrVal, othVal).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns the new duplicate free array.
     * @example
     *
     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
     *
     * _.uniqWith(objects, _.isEqual);
     * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
     */
    function uniqWith(array, comparator) {
      comparator = typeof comparator == 'function' ? comparator : undefined;
      return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
    }

    /**
     * This method is like `_.zip` except that it accepts an array of grouped
     * elements and creates an array regrouping the elements to their pre-zip
     * configuration.
     *
     * @static
     * @memberOf _
     * @since 1.2.0
     * @category Array
     * @param {Array} array The array of grouped elements to process.
     * @returns {Array} Returns the new array of regrouped elements.
     * @example
     *
     * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
     * // => [['a', 1, true], ['b', 2, false]]
     *
     * _.unzip(zipped);
     * // => [['a', 'b'], [1, 2], [true, false]]
     */
    function unzip(array) {
      if (!(array && array.length)) {
        return [];
      }
      var length = 0;
      array = arrayFilter(array, function(group) {
        if (isArrayLikeObject(group)) {
          length = nativeMax(group.length, length);
          return true;
        }
      });
      return baseTimes(length, function(index) {
        return arrayMap(array, baseProperty(index));
      });
    }

    /**
     * This method is like `_.unzip` except that it accepts `iteratee` to specify
     * how regrouped values should be combined. The iteratee is invoked with the
     * elements of each group: (...group).
     *
     * @static
     * @memberOf _
     * @since 3.8.0
     * @category Array
     * @param {Array} array The array of grouped elements to process.
     * @param {Function} [iteratee=_.identity] The function to combine
     *  regrouped values.
     * @returns {Array} Returns the new array of regrouped elements.
     * @example
     *
     * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
     * // => [[1, 10, 100], [2, 20, 200]]
     *
     * _.unzipWith(zipped, _.add);
     * // => [3, 30, 300]
     */
    function unzipWith(array, iteratee) {
      if (!(array && array.length)) {
        return [];
      }
      var result = unzip(array);
      if (iteratee == null) {
        return result;
      }
      return arrayMap(result, function(group) {
        return apply(iteratee, undefined, group);
      });
    }

    /**
     * Creates an array excluding all given values using
     * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * for equality comparisons.
     *
     * **Note:** Unlike `_.pull`, this method returns a new array.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {...*} [values] The values to exclude.
     * @returns {Array} Returns the new array of filtered values.
     * @see _.difference, _.xor
     * @example
     *
     * _.without([2, 1, 2, 3], 1, 2);
     * // => [3]
     */
    var without = baseRest(function(array, values) {
      return isArrayLikeObject(array)
        ? baseDifference(array, values)
        : [];
    });

    /**
     * Creates an array of unique values that is the
     * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
     * of the given arrays. The order of result values is determined by the order
     * they occur in the arrays.
     *
     * @static
     * @memberOf _
     * @since 2.4.0
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @returns {Array} Returns the new array of filtered values.
     * @see _.difference, _.without
     * @example
     *
     * _.xor([2, 1], [2, 3]);
     * // => [1, 3]
     */
    var xor = baseRest(function(arrays) {
      return baseXor(arrayFilter(arrays, isArrayLikeObject));
    });

    /**
     * This method is like `_.xor` except that it accepts `iteratee` which is
     * invoked for each element of each `arrays` to generate the criterion by
     * which by which they're compared. The order of result values is determined
     * by the order they occur in the arrays. The iteratee is invoked with one
     * argument: (value).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {Array} Returns the new array of filtered values.
     * @example
     *
     * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
     * // => [1.2, 3.4]
     *
     * // The `_.property` iteratee shorthand.
     * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
     * // => [{ 'x': 2 }]
     */
    var xorBy = baseRest(function(arrays) {
      var iteratee = last(arrays);
      if (isArrayLikeObject(iteratee)) {
        iteratee = undefined;
      }
      return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
    });

    /**
     * This method is like `_.xor` except that it accepts `comparator` which is
     * invoked to compare elements of `arrays`. The order of result values is
     * determined by the order they occur in the arrays. The comparator is invoked
     * with two arguments: (arrVal, othVal).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @param {Function} [comparator] The comparator invoked per element.
     * @returns {Array} Returns the new array of filtered values.
     * @example
     *
     * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
     * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
     *
     * _.xorWith(objects, others, _.isEqual);
     * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
     */
    var xorWith = baseRest(function(arrays) {
      var comparator = last(arrays);
      comparator = typeof comparator == 'function' ? comparator : undefined;
      return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
    });

    /**
     * Creates an array of grouped elements, the first of which contains the
     * first elements of the given arrays, the second of which contains the
     * second elements of the given arrays, and so on.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Array
     * @param {...Array} [arrays] The arrays to process.
     * @returns {Array} Returns the new array of grouped elements.
     * @example
     *
     * _.zip(['a', 'b'], [1, 2], [true, false]);
     * // => [['a', 1, true], ['b', 2, false]]
     */
    var zip = baseRest(unzip);

    /**
     * This method is like `_.fromPairs` except that it accepts two arrays,
     * one of property identifiers and one of corresponding values.
     *
     * @static
     * @memberOf _
     * @since 0.4.0
     * @category Array
     * @param {Array} [props=[]] The property identifiers.
     * @param {Array} [values=[]] The property values.
     * @returns {Object} Returns the new object.
     * @example
     *
     * _.zipObject(['a', 'b'], [1, 2]);
     * // => { 'a': 1, 'b': 2 }
     */
    function zipObject(props, values) {
      return baseZipObject(props || [], values || [], assignValue);
    }

    /**
     * This method is like `_.zipObject` except that it supports property paths.
     *
     * @static
     * @memberOf _
     * @since 4.1.0
     * @category Array
     * @param {Array} [props=[]] The property identifiers.
     * @param {Array} [values=[]] The property values.
     * @returns {Object} Returns the new object.
     * @example
     *
     * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
     * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
     */
    function zipObjectDeep(props, values) {
      return baseZipObject(props || [], values || [], baseSet);
    }

    /**
     * This method is like `_.zip` except that it accepts `iteratee` to specify
     * how grouped values should be combined. The iteratee is invoked with the
     * elements of each group: (...group).
     *
     * @static
     * @memberOf _
     * @since 3.8.0
     * @category Array
     * @param {...Array} [arrays] The arrays to process.
     * @param {Function} [iteratee=_.identity] The function to combine
     *  grouped values.
     * @returns {Array} Returns the new array of grouped elements.
     * @example
     *
     * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
     *   return a + b + c;
     * });
     * // => [111, 222]
     */
    var zipWith = baseRest(function(arrays) {
      var length = arrays.length,
          iteratee = length > 1 ? arrays[length - 1] : undefined;

      iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
      return unzipWith(arrays, iteratee);
    });

    /*------------------------------------------------------------------------*/

    /**
     * Creates a `lodash` wrapper instance that wraps `value` with explicit method
     * chain sequences enabled. The result of such sequences must be unwrapped
     * with `_#value`.
     *
     * @static
     * @memberOf _
     * @since 1.3.0
     * @category Seq
     * @param {*} value The value to wrap.
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'age': 36 },
     *   { 'user': 'fred',    'age': 40 },
     *   { 'user': 'pebbles', 'age': 1 }
     * ];
     *
     * var youngest = _
     *   .chain(users)
     *   .sortBy('age')
     *   .map(function(o) {
     *     return o.user + ' is ' + o.age;
     *   })
     *   .head()
     *   .value();
     * // => 'pebbles is 1'
     */
    function chain(value) {
      var result = lodash(value);
      result.__chain__ = true;
      return result;
    }

    /**
     * This method invokes `interceptor` and returns `value`. The interceptor
     * is invoked with one argument; (value). The purpose of this method is to
     * "tap into" a method chain sequence in order to modify intermediate results.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Seq
     * @param {*} value The value to provide to `interceptor`.
     * @param {Function} interceptor The function to invoke.
     * @returns {*} Returns `value`.
     * @example
     *
     * _([1, 2, 3])
     *  .tap(function(array) {
     *    // Mutate input array.
     *    array.pop();
     *  })
     *  .reverse()
     *  .value();
     * // => [2, 1]
     */
    function tap(value, interceptor) {
      interceptor(value);
      return value;
    }

    /**
     * This method is like `_.tap` except that it returns the result of `interceptor`.
     * The purpose of this method is to "pass thru" values replacing intermediate
     * results in a method chain sequence.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Seq
     * @param {*} value The value to provide to `interceptor`.
     * @param {Function} interceptor The function to invoke.
     * @returns {*} Returns the result of `interceptor`.
     * @example
     *
     * _('  abc  ')
     *  .chain()
     *  .trim()
     *  .thru(function(value) {
     *    return [value];
     *  })
     *  .value();
     * // => ['abc']
     */
    function thru(value, interceptor) {
      return interceptor(value);
    }

    /**
     * This method is the wrapper version of `_.at`.
     *
     * @name at
     * @memberOf _
     * @since 1.0.0
     * @category Seq
     * @param {...(string|string[])} [paths] The property paths to pick.
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
     *
     * _(object).at(['a[0].b.c', 'a[1]']).value();
     * // => [3, 4]
     */
    var wrapperAt = flatRest(function(paths) {
      var length = paths.length,
          start = length ? paths[0] : 0,
          value = this.__wrapped__,
          interceptor = function(object) { return baseAt(object, paths); };

      if (length > 1 || this.__actions__.length ||
          !(value instanceof LazyWrapper) || !isIndex(start)) {
        return this.thru(interceptor);
      }
      value = value.slice(start, +start + (length ? 1 : 0));
      value.__actions__.push({
        'func': thru,
        'args': [interceptor],
        'thisArg': undefined
      });
      return new LodashWrapper(value, this.__chain__).thru(function(array) {
        if (length && !array.length) {
          array.push(undefined);
        }
        return array;
      });
    });

    /**
     * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
     *
     * @name chain
     * @memberOf _
     * @since 0.1.0
     * @category Seq
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36 },
     *   { 'user': 'fred',   'age': 40 }
     * ];
     *
     * // A sequence without explicit chaining.
     * _(users).head();
     * // => { 'user': 'barney', 'age': 36 }
     *
     * // A sequence with explicit chaining.
     * _(users)
     *   .chain()
     *   .head()
     *   .pick('user')
     *   .value();
     * // => { 'user': 'barney' }
     */
    function wrapperChain() {
      return chain(this);
    }

    /**
     * Executes the chain sequence and returns the wrapped result.
     *
     * @name commit
     * @memberOf _
     * @since 3.2.0
     * @category Seq
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * var array = [1, 2];
     * var wrapped = _(array).push(3);
     *
     * console.log(array);
     * // => [1, 2]
     *
     * wrapped = wrapped.commit();
     * console.log(array);
     * // => [1, 2, 3]
     *
     * wrapped.last();
     * // => 3
     *
     * console.log(array);
     * // => [1, 2, 3]
     */
    function wrapperCommit() {
      return new LodashWrapper(this.value(), this.__chain__);
    }

    /**
     * Gets the next value on a wrapped object following the
     * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
     *
     * @name next
     * @memberOf _
     * @since 4.0.0
     * @category Seq
     * @returns {Object} Returns the next iterator value.
     * @example
     *
     * var wrapped = _([1, 2]);
     *
     * wrapped.next();
     * // => { 'done': false, 'value': 1 }
     *
     * wrapped.next();
     * // => { 'done': false, 'value': 2 }
     *
     * wrapped.next();
     * // => { 'done': true, 'value': undefined }
     */
    function wrapperNext() {
      if (this.__values__ === undefined) {
        this.__values__ = toArray(this.value());
      }
      var done = this.__index__ >= this.__values__.length,
          value = done ? undefined : this.__values__[this.__index__++];

      return { 'done': done, 'value': value };
    }

    /**
     * Enables the wrapper to be iterable.
     *
     * @name Symbol.iterator
     * @memberOf _
     * @since 4.0.0
     * @category Seq
     * @returns {Object} Returns the wrapper object.
     * @example
     *
     * var wrapped = _([1, 2]);
     *
     * wrapped[Symbol.iterator]() === wrapped;
     * // => true
     *
     * Array.from(wrapped);
     * // => [1, 2]
     */
    function wrapperToIterator() {
      return this;
    }

    /**
     * Creates a clone of the chain sequence planting `value` as the wrapped value.
     *
     * @name plant
     * @memberOf _
     * @since 3.2.0
     * @category Seq
     * @param {*} value The value to plant.
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * function square(n) {
     *   return n * n;
     * }
     *
     * var wrapped = _([1, 2]).map(square);
     * var other = wrapped.plant([3, 4]);
     *
     * other.value();
     * // => [9, 16]
     *
     * wrapped.value();
     * // => [1, 4]
     */
    function wrapperPlant(value) {
      var result,
          parent = this;

      while (parent instanceof baseLodash) {
        var clone = wrapperClone(parent);
        clone.__index__ = 0;
        clone.__values__ = undefined;
        if (result) {
          previous.__wrapped__ = clone;
        } else {
          result = clone;
        }
        var previous = clone;
        parent = parent.__wrapped__;
      }
      previous.__wrapped__ = value;
      return result;
    }

    /**
     * This method is the wrapper version of `_.reverse`.
     *
     * **Note:** This method mutates the wrapped array.
     *
     * @name reverse
     * @memberOf _
     * @since 0.1.0
     * @category Seq
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * var array = [1, 2, 3];
     *
     * _(array).reverse().value()
     * // => [3, 2, 1]
     *
     * console.log(array);
     * // => [3, 2, 1]
     */
    function wrapperReverse() {
      var value = this.__wrapped__;
      if (value instanceof LazyWrapper) {
        var wrapped = value;
        if (this.__actions__.length) {
          wrapped = new LazyWrapper(this);
        }
        wrapped = wrapped.reverse();
        wrapped.__actions__.push({
          'func': thru,
          'args': [reverse],
          'thisArg': undefined
        });
        return new LodashWrapper(wrapped, this.__chain__);
      }
      return this.thru(reverse);
    }

    /**
     * Executes the chain sequence to resolve the unwrapped value.
     *
     * @name value
     * @memberOf _
     * @since 0.1.0
     * @alias toJSON, valueOf
     * @category Seq
     * @returns {*} Returns the resolved unwrapped value.
     * @example
     *
     * _([1, 2, 3]).value();
     * // => [1, 2, 3]
     */
    function wrapperValue() {
      return baseWrapperValue(this.__wrapped__, this.__actions__);
    }

    /*------------------------------------------------------------------------*/

    /**
     * Creates an object composed of keys generated from the results of running
     * each element of `collection` thru `iteratee`. The corresponding value of
     * each key is the number of times the key was returned by `iteratee`. The
     * iteratee is invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 0.5.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
     * @returns {Object} Returns the composed aggregate object.
     * @example
     *
     * _.countBy([6.1, 4.2, 6.3], Math.floor);
     * // => { '4': 1, '6': 2 }
     *
     * // The `_.property` iteratee shorthand.
     * _.countBy(['one', 'two', 'three'], 'length');
     * // => { '3': 2, '5': 1 }
     */
    var countBy = createAggregator(function(result, value, key) {
      if (hasOwnProperty.call(result, key)) {
        ++result[key];
      } else {
        baseAssignValue(result, key, 1);
      }
    });

    /**
     * Checks if `predicate` returns truthy for **all** elements of `collection`.
     * Iteration is stopped once `predicate` returns falsey. The predicate is
     * invoked with three arguments: (value, index|key, collection).
     *
     * **Note:** This method returns `true` for
     * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
     * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
     * elements of empty collections.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {boolean} Returns `true` if all elements pass the predicate check,
     *  else `false`.
     * @example
     *
     * _.every([true, 1, null, 'yes'], Boolean);
     * // => false
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36, 'active': false },
     *   { 'user': 'fred',   'age': 40, 'active': false }
     * ];
     *
     * // The `_.matches` iteratee shorthand.
     * _.every(users, { 'user': 'barney', 'active': false });
     * // => false
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.every(users, ['active', false]);
     * // => true
     *
     * // The `_.property` iteratee shorthand.
     * _.every(users, 'active');
     * // => false
     */
    function every(collection, predicate, guard) {
      var func = isArray(collection) ? arrayEvery : baseEvery;
      if (guard && isIterateeCall(collection, predicate, guard)) {
        predicate = undefined;
      }
      return func(collection, getIteratee(predicate, 3));
    }

    /**
     * Iterates over elements of `collection`, returning an array of all elements
     * `predicate` returns truthy for. The predicate is invoked with three
     * arguments: (value, index|key, collection).
     *
     * **Note:** Unlike `_.remove`, this method returns a new array.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the new filtered array.
     * @see _.reject
     * @example
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36, 'active': true },
     *   { 'user': 'fred',   'age': 40, 'active': false }
     * ];
     *
     * _.filter(users, function(o) { return !o.active; });
     * // => objects for ['fred']
     *
     * // The `_.matches` iteratee shorthand.
     * _.filter(users, { 'age': 36, 'active': true });
     * // => objects for ['barney']
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.filter(users, ['active', false]);
     * // => objects for ['fred']
     *
     * // The `_.property` iteratee shorthand.
     * _.filter(users, 'active');
     * // => objects for ['barney']
     *
     * // Combining several predicates using `_.overEvery` or `_.overSome`.
     * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
     * // => objects for ['fred', 'barney']
     */
    function filter(collection, predicate) {
      var func = isArray(collection) ? arrayFilter : baseFilter;
      return func(collection, getIteratee(predicate, 3));
    }

    /**
     * Iterates over elements of `collection`, returning the first element
     * `predicate` returns truthy for. The predicate is invoked with three
     * arguments: (value, index|key, collection).
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to inspect.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @param {number} [fromIndex=0] The index to search from.
     * @returns {*} Returns the matched element, else `undefined`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'age': 36, 'active': true },
     *   { 'user': 'fred',    'age': 40, 'active': false },
     *   { 'user': 'pebbles', 'age': 1,  'active': true }
     * ];
     *
     * _.find(users, function(o) { return o.age < 40; });
     * // => object for 'barney'
     *
     * // The `_.matches` iteratee shorthand.
     * _.find(users, { 'age': 1, 'active': true });
     * // => object for 'pebbles'
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.find(users, ['active', false]);
     * // => object for 'fred'
     *
     * // The `_.property` iteratee shorthand.
     * _.find(users, 'active');
     * // => object for 'barney'
     */
    var find = createFind(findIndex);

    /**
     * This method is like `_.find` except that it iterates over elements of
     * `collection` from right to left.
     *
     * @static
     * @memberOf _
     * @since 2.0.0
     * @category Collection
     * @param {Array|Object} collection The collection to inspect.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @param {number} [fromIndex=collection.length-1] The index to search from.
     * @returns {*} Returns the matched element, else `undefined`.
     * @example
     *
     * _.findLast([1, 2, 3, 4], function(n) {
     *   return n % 2 == 1;
     * });
     * // => 3
     */
    var findLast = createFind(findLastIndex);

    /**
     * Creates a flattened array of values by running each element in `collection`
     * thru `iteratee` and flattening the mapped results. The iteratee is invoked
     * with three arguments: (value, index|key, collection).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the new flattened array.
     * @example
     *
     * function duplicate(n) {
     *   return [n, n];
     * }
     *
     * _.flatMap([1, 2], duplicate);
     * // => [1, 1, 2, 2]
     */
    function flatMap(collection, iteratee) {
      return baseFlatten(map(collection, iteratee), 1);
    }

    /**
     * This method is like `_.flatMap` except that it recursively flattens the
     * mapped results.
     *
     * @static
     * @memberOf _
     * @since 4.7.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the new flattened array.
     * @example
     *
     * function duplicate(n) {
     *   return [[[n, n]]];
     * }
     *
     * _.flatMapDeep([1, 2], duplicate);
     * // => [1, 1, 2, 2]
     */
    function flatMapDeep(collection, iteratee) {
      return baseFlatten(map(collection, iteratee), INFINITY);
    }

    /**
     * This method is like `_.flatMap` except that it recursively flattens the
     * mapped results up to `depth` times.
     *
     * @static
     * @memberOf _
     * @since 4.7.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {number} [depth=1] The maximum recursion depth.
     * @returns {Array} Returns the new flattened array.
     * @example
     *
     * function duplicate(n) {
     *   return [[[n, n]]];
     * }
     *
     * _.flatMapDepth([1, 2], duplicate, 2);
     * // => [[1, 1], [2, 2]]
     */
    function flatMapDepth(collection, iteratee, depth) {
      depth = depth === undefined ? 1 : toInteger(depth);
      return baseFlatten(map(collection, iteratee), depth);
    }

    /**
     * Iterates over elements of `collection` and invokes `iteratee` for each element.
     * The iteratee is invoked with three arguments: (value, index|key, collection).
     * Iteratee functions may exit iteration early by explicitly returning `false`.
     *
     * **Note:** As with other "Collections" methods, objects with a "length"
     * property are iterated like arrays. To avoid this behavior use `_.forIn`
     * or `_.forOwn` for object iteration.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @alias each
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Array|Object} Returns `collection`.
     * @see _.forEachRight
     * @example
     *
     * _.forEach([1, 2], function(value) {
     *   console.log(value);
     * });
     * // => Logs `1` then `2`.
     *
     * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
     *   console.log(key);
     * });
     * // => Logs 'a' then 'b' (iteration order is not guaranteed).
     */
    function forEach(collection, iteratee) {
      var func = isArray(collection) ? arrayEach : baseEach;
      return func(collection, getIteratee(iteratee, 3));
    }

    /**
     * This method is like `_.forEach` except that it iterates over elements of
     * `collection` from right to left.
     *
     * @static
     * @memberOf _
     * @since 2.0.0
     * @alias eachRight
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Array|Object} Returns `collection`.
     * @see _.forEach
     * @example
     *
     * _.forEachRight([1, 2], function(value) {
     *   console.log(value);
     * });
     * // => Logs `2` then `1`.
     */
    function forEachRight(collection, iteratee) {
      var func = isArray(collection) ? arrayEachRight : baseEachRight;
      return func(collection, getIteratee(iteratee, 3));
    }

    /**
     * Creates an object composed of keys generated from the results of running
     * each element of `collection` thru `iteratee`. The order of grouped values
     * is determined by the order they occur in `collection`. The corresponding
     * value of each key is an array of elements responsible for generating the
     * key. The iteratee is invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
     * @returns {Object} Returns the composed aggregate object.
     * @example
     *
     * _.groupBy([6.1, 4.2, 6.3], Math.floor);
     * // => { '4': [4.2], '6': [6.1, 6.3] }
     *
     * // The `_.property` iteratee shorthand.
     * _.groupBy(['one', 'two', 'three'], 'length');
     * // => { '3': ['one', 'two'], '5': ['three'] }
     */
    var groupBy = createAggregator(function(result, value, key) {
      if (hasOwnProperty.call(result, key)) {
        result[key].push(value);
      } else {
        baseAssignValue(result, key, [value]);
      }
    });

    /**
     * Checks if `value` is in `collection`. If `collection` is a string, it's
     * checked for a substring of `value`, otherwise
     * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * is used for equality comparisons. If `fromIndex` is negative, it's used as
     * the offset from the end of `collection`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object|string} collection The collection to inspect.
     * @param {*} value The value to search for.
     * @param {number} [fromIndex=0] The index to search from.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
     * @returns {boolean} Returns `true` if `value` is found, else `false`.
     * @example
     *
     * _.includes([1, 2, 3], 1);
     * // => true
     *
     * _.includes([1, 2, 3], 1, 2);
     * // => false
     *
     * _.includes({ 'a': 1, 'b': 2 }, 1);
     * // => true
     *
     * _.includes('abcd', 'bc');
     * // => true
     */
    function includes(collection, value, fromIndex, guard) {
      collection = isArrayLike(collection) ? collection : values(collection);
      fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;

      var length = collection.length;
      if (fromIndex < 0) {
        fromIndex = nativeMax(length + fromIndex, 0);
      }
      return isString(collection)
        ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
        : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
    }

    /**
     * Invokes the method at `path` of each element in `collection`, returning
     * an array of the results of each invoked method. Any additional arguments
     * are provided to each invoked method. If `path` is a function, it's invoked
     * for, and `this` bound to, each element in `collection`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Array|Function|string} path The path of the method to invoke or
     *  the function invoked per iteration.
     * @param {...*} [args] The arguments to invoke each method with.
     * @returns {Array} Returns the array of results.
     * @example
     *
     * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
     * // => [[1, 5, 7], [1, 2, 3]]
     *
     * _.invokeMap([123, 456], String.prototype.split, '');
     * // => [['1', '2', '3'], ['4', '5', '6']]
     */
    var invokeMap = baseRest(function(collection, path, args) {
      var index = -1,
          isFunc = typeof path == 'function',
          result = isArrayLike(collection) ? Array(collection.length) : [];

      baseEach(collection, function(value) {
        result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
      });
      return result;
    });

    /**
     * Creates an object composed of keys generated from the results of running
     * each element of `collection` thru `iteratee`. The corresponding value of
     * each key is the last element responsible for generating the key. The
     * iteratee is invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
     * @returns {Object} Returns the composed aggregate object.
     * @example
     *
     * var array = [
     *   { 'dir': 'left', 'code': 97 },
     *   { 'dir': 'right', 'code': 100 }
     * ];
     *
     * _.keyBy(array, function(o) {
     *   return String.fromCharCode(o.code);
     * });
     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
     *
     * _.keyBy(array, 'dir');
     * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
     */
    var keyBy = createAggregator(function(result, value, key) {
      baseAssignValue(result, key, value);
    });

    /**
     * Creates an array of values by running each element in `collection` thru
     * `iteratee`. The iteratee is invoked with three arguments:
     * (value, index|key, collection).
     *
     * Many lodash methods are guarded to work as iteratees for methods like
     * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
     *
     * The guarded methods are:
     * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
     * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
     * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
     * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the new mapped array.
     * @example
     *
     * function square(n) {
     *   return n * n;
     * }
     *
     * _.map([4, 8], square);
     * // => [16, 64]
     *
     * _.map({ 'a': 4, 'b': 8 }, square);
     * // => [16, 64] (iteration order is not guaranteed)
     *
     * var users = [
     *   { 'user': 'barney' },
     *   { 'user': 'fred' }
     * ];
     *
     * // The `_.property` iteratee shorthand.
     * _.map(users, 'user');
     * // => ['barney', 'fred']
     */
    function map(collection, iteratee) {
      var func = isArray(collection) ? arrayMap : baseMap;
      return func(collection, getIteratee(iteratee, 3));
    }

    /**
     * This method is like `_.sortBy` except that it allows specifying the sort
     * orders of the iteratees to sort by. If `orders` is unspecified, all values
     * are sorted in ascending order. Otherwise, specify an order of "desc" for
     * descending or "asc" for ascending sort order of corresponding values.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
     *  The iteratees to sort by.
     * @param {string[]} [orders] The sort orders of `iteratees`.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
     * @returns {Array} Returns the new sorted array.
     * @example
     *
     * var users = [
     *   { 'user': 'fred',   'age': 48 },
     *   { 'user': 'barney', 'age': 34 },
     *   { 'user': 'fred',   'age': 40 },
     *   { 'user': 'barney', 'age': 36 }
     * ];
     *
     * // Sort by `user` in ascending order and by `age` in descending order.
     * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
     * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
     */
    function orderBy(collection, iteratees, orders, guard) {
      if (collection == null) {
        return [];
      }
      if (!isArray(iteratees)) {
        iteratees = iteratees == null ? [] : [iteratees];
      }
      orders = guard ? undefined : orders;
      if (!isArray(orders)) {
        orders = orders == null ? [] : [orders];
      }
      return baseOrderBy(collection, iteratees, orders);
    }

    /**
     * Creates an array of elements split into two groups, the first of which
     * contains elements `predicate` returns truthy for, the second of which
     * contains elements `predicate` returns falsey for. The predicate is
     * invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the array of grouped elements.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'age': 36, 'active': false },
     *   { 'user': 'fred',    'age': 40, 'active': true },
     *   { 'user': 'pebbles', 'age': 1,  'active': false }
     * ];
     *
     * _.partition(users, function(o) { return o.active; });
     * // => objects for [['fred'], ['barney', 'pebbles']]
     *
     * // The `_.matches` iteratee shorthand.
     * _.partition(users, { 'age': 1, 'active': false });
     * // => objects for [['pebbles'], ['barney', 'fred']]
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.partition(users, ['active', false]);
     * // => objects for [['barney', 'pebbles'], ['fred']]
     *
     * // The `_.property` iteratee shorthand.
     * _.partition(users, 'active');
     * // => objects for [['fred'], ['barney', 'pebbles']]
     */
    var partition = createAggregator(function(result, value, key) {
      result[key ? 0 : 1].push(value);
    }, function() { return [[], []]; });

    /**
     * Reduces `collection` to a value which is the accumulated result of running
     * each element in `collection` thru `iteratee`, where each successive
     * invocation is supplied the return value of the previous. If `accumulator`
     * is not given, the first element of `collection` is used as the initial
     * value. The iteratee is invoked with four arguments:
     * (accumulator, value, index|key, collection).
     *
     * Many lodash methods are guarded to work as iteratees for methods like
     * `_.reduce`, `_.reduceRight`, and `_.transform`.
     *
     * The guarded methods are:
     * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
     * and `sortBy`
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [accumulator] The initial value.
     * @returns {*} Returns the accumulated value.
     * @see _.reduceRight
     * @example
     *
     * _.reduce([1, 2], function(sum, n) {
     *   return sum + n;
     * }, 0);
     * // => 3
     *
     * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
     *   (result[value] || (result[value] = [])).push(key);
     *   return result;
     * }, {});
     * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
     */
    function reduce(collection, iteratee, accumulator) {
      var func = isArray(collection) ? arrayReduce : baseReduce,
          initAccum = arguments.length < 3;

      return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
    }

    /**
     * This method is like `_.reduce` except that it iterates over elements of
     * `collection` from right to left.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [accumulator] The initial value.
     * @returns {*} Returns the accumulated value.
     * @see _.reduce
     * @example
     *
     * var array = [[0, 1], [2, 3], [4, 5]];
     *
     * _.reduceRight(array, function(flattened, other) {
     *   return flattened.concat(other);
     * }, []);
     * // => [4, 5, 2, 3, 0, 1]
     */
    function reduceRight(collection, iteratee, accumulator) {
      var func = isArray(collection) ? arrayReduceRight : baseReduce,
          initAccum = arguments.length < 3;

      return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
    }

    /**
     * The opposite of `_.filter`; this method returns the elements of `collection`
     * that `predicate` does **not** return truthy for.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the new filtered array.
     * @see _.filter
     * @example
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36, 'active': false },
     *   { 'user': 'fred',   'age': 40, 'active': true }
     * ];
     *
     * _.reject(users, function(o) { return !o.active; });
     * // => objects for ['fred']
     *
     * // The `_.matches` iteratee shorthand.
     * _.reject(users, { 'age': 40, 'active': true });
     * // => objects for ['barney']
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.reject(users, ['active', false]);
     * // => objects for ['fred']
     *
     * // The `_.property` iteratee shorthand.
     * _.reject(users, 'active');
     * // => objects for ['barney']
     */
    function reject(collection, predicate) {
      var func = isArray(collection) ? arrayFilter : baseFilter;
      return func(collection, negate(getIteratee(predicate, 3)));
    }

    /**
     * Gets a random element from `collection`.
     *
     * @static
     * @memberOf _
     * @since 2.0.0
     * @category Collection
     * @param {Array|Object} collection The collection to sample.
     * @returns {*} Returns the random element.
     * @example
     *
     * _.sample([1, 2, 3, 4]);
     * // => 2
     */
    function sample(collection) {
      var func = isArray(collection) ? arraySample : baseSample;
      return func(collection);
    }

    /**
     * Gets `n` random elements at unique keys from `collection` up to the
     * size of `collection`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Collection
     * @param {Array|Object} collection The collection to sample.
     * @param {number} [n=1] The number of elements to sample.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Array} Returns the random elements.
     * @example
     *
     * _.sampleSize([1, 2, 3], 2);
     * // => [3, 1]
     *
     * _.sampleSize([1, 2, 3], 4);
     * // => [2, 3, 1]
     */
    function sampleSize(collection, n, guard) {
      if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
        n = 1;
      } else {
        n = toInteger(n);
      }
      var func = isArray(collection) ? arraySampleSize : baseSampleSize;
      return func(collection, n);
    }

    /**
     * Creates an array of shuffled values, using a version of the
     * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to shuffle.
     * @returns {Array} Returns the new shuffled array.
     * @example
     *
     * _.shuffle([1, 2, 3, 4]);
     * // => [4, 1, 3, 2]
     */
    function shuffle(collection) {
      var func = isArray(collection) ? arrayShuffle : baseShuffle;
      return func(collection);
    }

    /**
     * Gets the size of `collection` by returning its length for array-like
     * values or the number of own enumerable string keyed properties for objects.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object|string} collection The collection to inspect.
     * @returns {number} Returns the collection size.
     * @example
     *
     * _.size([1, 2, 3]);
     * // => 3
     *
     * _.size({ 'a': 1, 'b': 2 });
     * // => 2
     *
     * _.size('pebbles');
     * // => 7
     */
    function size(collection) {
      if (collection == null) {
        return 0;
      }
      if (isArrayLike(collection)) {
        return isString(collection) ? stringSize(collection) : collection.length;
      }
      var tag = getTag(collection);
      if (tag == mapTag || tag == setTag) {
        return collection.size;
      }
      return baseKeys(collection).length;
    }

    /**
     * Checks if `predicate` returns truthy for **any** element of `collection`.
     * Iteration is stopped once `predicate` returns truthy. The predicate is
     * invoked with three arguments: (value, index|key, collection).
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {boolean} Returns `true` if any element passes the predicate check,
     *  else `false`.
     * @example
     *
     * _.some([null, 0, 'yes', false], Boolean);
     * // => true
     *
     * var users = [
     *   { 'user': 'barney', 'active': true },
     *   { 'user': 'fred',   'active': false }
     * ];
     *
     * // The `_.matches` iteratee shorthand.
     * _.some(users, { 'user': 'barney', 'active': false });
     * // => false
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.some(users, ['active', false]);
     * // => true
     *
     * // The `_.property` iteratee shorthand.
     * _.some(users, 'active');
     * // => true
     */
    function some(collection, predicate, guard) {
      var func = isArray(collection) ? arraySome : baseSome;
      if (guard && isIterateeCall(collection, predicate, guard)) {
        predicate = undefined;
      }
      return func(collection, getIteratee(predicate, 3));
    }

    /**
     * Creates an array of elements, sorted in ascending order by the results of
     * running each element in a collection thru each iteratee. This method
     * performs a stable sort, that is, it preserves the original sort order of
     * equal elements. The iteratees are invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Collection
     * @param {Array|Object} collection The collection to iterate over.
     * @param {...(Function|Function[])} [iteratees=[_.identity]]
     *  The iteratees to sort by.
     * @returns {Array} Returns the new sorted array.
     * @example
     *
     * var users = [
     *   { 'user': 'fred',   'age': 48 },
     *   { 'user': 'barney', 'age': 36 },
     *   { 'user': 'fred',   'age': 30 },
     *   { 'user': 'barney', 'age': 34 }
     * ];
     *
     * _.sortBy(users, [function(o) { return o.user; }]);
     * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
     *
     * _.sortBy(users, ['user', 'age']);
     * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
     */
    var sortBy = baseRest(function(collection, iteratees) {
      if (collection == null) {
        return [];
      }
      var length = iteratees.length;
      if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
        iteratees = [];
      } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
        iteratees = [iteratees[0]];
      }
      return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
    });

    /*------------------------------------------------------------------------*/

    /**
     * Gets the timestamp of the number of milliseconds that have elapsed since
     * the Unix epoch (1 January 1970 00:00:00 UTC).
     *
     * @static
     * @memberOf _
     * @since 2.4.0
     * @category Date
     * @returns {number} Returns the timestamp.
     * @example
     *
     * _.defer(function(stamp) {
     *   console.log(_.now() - stamp);
     * }, _.now());
     * // => Logs the number of milliseconds it took for the deferred invocation.
     */
    var now = ctxNow || function() {
      return root.Date.now();
    };

    /*------------------------------------------------------------------------*/

    /**
     * The opposite of `_.before`; this method creates a function that invokes
     * `func` once it's called `n` or more times.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {number} n The number of calls before `func` is invoked.
     * @param {Function} func The function to restrict.
     * @returns {Function} Returns the new restricted function.
     * @example
     *
     * var saves = ['profile', 'settings'];
     *
     * var done = _.after(saves.length, function() {
     *   console.log('done saving!');
     * });
     *
     * _.forEach(saves, function(type) {
     *   asyncSave({ 'type': type, 'complete': done });
     * });
     * // => Logs 'done saving!' after the two async saves have completed.
     */
    function after(n, func) {
      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      n = toInteger(n);
      return function() {
        if (--n < 1) {
          return func.apply(this, arguments);
        }
      };
    }

    /**
     * Creates a function that invokes `func`, with up to `n` arguments,
     * ignoring any additional arguments.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Function
     * @param {Function} func The function to cap arguments for.
     * @param {number} [n=func.length] The arity cap.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Function} Returns the new capped function.
     * @example
     *
     * _.map(['6', '8', '10'], _.ary(parseInt, 1));
     * // => [6, 8, 10]
     */
    function ary(func, n, guard) {
      n = guard ? undefined : n;
      n = (func && n == null) ? func.length : n;
      return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
    }

    /**
     * Creates a function that invokes `func`, with the `this` binding and arguments
     * of the created function, while it's called less than `n` times. Subsequent
     * calls to the created function return the result of the last `func` invocation.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Function
     * @param {number} n The number of calls at which `func` is no longer invoked.
     * @param {Function} func The function to restrict.
     * @returns {Function} Returns the new restricted function.
     * @example
     *
     * jQuery(element).on('click', _.before(5, addContactToList));
     * // => Allows adding up to 4 contacts to the list.
     */
    function before(n, func) {
      var result;
      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      n = toInteger(n);
      return function() {
        if (--n > 0) {
          result = func.apply(this, arguments);
        }
        if (n <= 1) {
          func = undefined;
        }
        return result;
      };
    }

    /**
     * Creates a function that invokes `func` with the `this` binding of `thisArg`
     * and `partials` prepended to the arguments it receives.
     *
     * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
     * may be used as a placeholder for partially applied arguments.
     *
     * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
     * property of bound functions.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {Function} func The function to bind.
     * @param {*} thisArg The `this` binding of `func`.
     * @param {...*} [partials] The arguments to be partially applied.
     * @returns {Function} Returns the new bound function.
     * @example
     *
     * function greet(greeting, punctuation) {
     *   return greeting + ' ' + this.user + punctuation;
     * }
     *
     * var object = { 'user': 'fred' };
     *
     * var bound = _.bind(greet, object, 'hi');
     * bound('!');
     * // => 'hi fred!'
     *
     * // Bound with placeholders.
     * var bound = _.bind(greet, object, _, '!');
     * bound('hi');
     * // => 'hi fred!'
     */
    var bind = baseRest(function(func, thisArg, partials) {
      var bitmask = WRAP_BIND_FLAG;
      if (partials.length) {
        var holders = replaceHolders(partials, getHolder(bind));
        bitmask |= WRAP_PARTIAL_FLAG;
      }
      return createWrap(func, bitmask, thisArg, partials, holders);
    });

    /**
     * Creates a function that invokes the method at `object[key]` with `partials`
     * prepended to the arguments it receives.
     *
     * This method differs from `_.bind` by allowing bound functions to reference
     * methods that may be redefined or don't yet exist. See
     * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
     * for more details.
     *
     * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
     * builds, may be used as a placeholder for partially applied arguments.
     *
     * @static
     * @memberOf _
     * @since 0.10.0
     * @category Function
     * @param {Object} object The object to invoke the method on.
     * @param {string} key The key of the method.
     * @param {...*} [partials] The arguments to be partially applied.
     * @returns {Function} Returns the new bound function.
     * @example
     *
     * var object = {
     *   'user': 'fred',
     *   'greet': function(greeting, punctuation) {
     *     return greeting + ' ' + this.user + punctuation;
     *   }
     * };
     *
     * var bound = _.bindKey(object, 'greet', 'hi');
     * bound('!');
     * // => 'hi fred!'
     *
     * object.greet = function(greeting, punctuation) {
     *   return greeting + 'ya ' + this.user + punctuation;
     * };
     *
     * bound('!');
     * // => 'hiya fred!'
     *
     * // Bound with placeholders.
     * var bound = _.bindKey(object, 'greet', _, '!');
     * bound('hi');
     * // => 'hiya fred!'
     */
    var bindKey = baseRest(function(object, key, partials) {
      var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
      if (partials.length) {
        var holders = replaceHolders(partials, getHolder(bindKey));
        bitmask |= WRAP_PARTIAL_FLAG;
      }
      return createWrap(key, bitmask, object, partials, holders);
    });

    /**
     * Creates a function that accepts arguments of `func` and either invokes
     * `func` returning its result, if at least `arity` number of arguments have
     * been provided, or returns a function that accepts the remaining `func`
     * arguments, and so on. The arity of `func` may be specified if `func.length`
     * is not sufficient.
     *
     * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
     * may be used as a placeholder for provided arguments.
     *
     * **Note:** This method doesn't set the "length" property of curried functions.
     *
     * @static
     * @memberOf _
     * @since 2.0.0
     * @category Function
     * @param {Function} func The function to curry.
     * @param {number} [arity=func.length] The arity of `func`.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Function} Returns the new curried function.
     * @example
     *
     * var abc = function(a, b, c) {
     *   return [a, b, c];
     * };
     *
     * var curried = _.curry(abc);
     *
     * curried(1)(2)(3);
     * // => [1, 2, 3]
     *
     * curried(1, 2)(3);
     * // => [1, 2, 3]
     *
     * curried(1, 2, 3);
     * // => [1, 2, 3]
     *
     * // Curried with placeholders.
     * curried(1)(_, 3)(2);
     * // => [1, 2, 3]
     */
    function curry(func, arity, guard) {
      arity = guard ? undefined : arity;
      var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
      result.placeholder = curry.placeholder;
      return result;
    }

    /**
     * This method is like `_.curry` except that arguments are applied to `func`
     * in the manner of `_.partialRight` instead of `_.partial`.
     *
     * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
     * builds, may be used as a placeholder for provided arguments.
     *
     * **Note:** This method doesn't set the "length" property of curried functions.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Function
     * @param {Function} func The function to curry.
     * @param {number} [arity=func.length] The arity of `func`.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Function} Returns the new curried function.
     * @example
     *
     * var abc = function(a, b, c) {
     *   return [a, b, c];
     * };
     *
     * var curried = _.curryRight(abc);
     *
     * curried(3)(2)(1);
     * // => [1, 2, 3]
     *
     * curried(2, 3)(1);
     * // => [1, 2, 3]
     *
     * curried(1, 2, 3);
     * // => [1, 2, 3]
     *
     * // Curried with placeholders.
     * curried(3)(1, _)(2);
     * // => [1, 2, 3]
     */
    function curryRight(func, arity, guard) {
      arity = guard ? undefined : arity;
      var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
      result.placeholder = curryRight.placeholder;
      return result;
    }

    /**
     * Creates a debounced function that delays invoking `func` until after `wait`
     * milliseconds have elapsed since the last time the debounced function was
     * invoked. The debounced function comes with a `cancel` method to cancel
     * delayed `func` invocations and a `flush` method to immediately invoke them.
     * Provide `options` to indicate whether `func` should be invoked on the
     * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
     * with the last arguments provided to the debounced function. Subsequent
     * calls to the debounced function return the result of the last `func`
     * invocation.
     *
     * **Note:** If `leading` and `trailing` options are `true`, `func` is
     * invoked on the trailing edge of the timeout only if the debounced function
     * is invoked more than once during the `wait` timeout.
     *
     * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
     * until to the next tick, similar to `setTimeout` with a timeout of `0`.
     *
     * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
     * for details over the differences between `_.debounce` and `_.throttle`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {Function} func The function to debounce.
     * @param {number} [wait=0] The number of milliseconds to delay.
     * @param {Object} [options={}] The options object.
     * @param {boolean} [options.leading=false]
     *  Specify invoking on the leading edge of the timeout.
     * @param {number} [options.maxWait]
     *  The maximum time `func` is allowed to be delayed before it's invoked.
     * @param {boolean} [options.trailing=true]
     *  Specify invoking on the trailing edge of the timeout.
     * @returns {Function} Returns the new debounced function.
     * @example
     *
     * // Avoid costly calculations while the window size is in flux.
     * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
     *
     * // Invoke `sendMail` when clicked, debouncing subsequent calls.
     * jQuery(element).on('click', _.debounce(sendMail, 300, {
     *   'leading': true,
     *   'trailing': false
     * }));
     *
     * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
     * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
     * var source = new EventSource('/stream');
     * jQuery(source).on('message', debounced);
     *
     * // Cancel the trailing debounced invocation.
     * jQuery(window).on('popstate', debounced.cancel);
     */
    function debounce(func, wait, options) {
      var lastArgs,
          lastThis,
          maxWait,
          result,
          timerId,
          lastCallTime,
          lastInvokeTime = 0,
          leading = false,
          maxing = false,
          trailing = true;

      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      wait = toNumber(wait) || 0;
      if (isObject(options)) {
        leading = !!options.leading;
        maxing = 'maxWait' in options;
        maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
        trailing = 'trailing' in options ? !!options.trailing : trailing;
      }

      function invokeFunc(time) {
        var args = lastArgs,
            thisArg = lastThis;

        lastArgs = lastThis = undefined;
        lastInvokeTime = time;
        result = func.apply(thisArg, args);
        return result;
      }

      function leadingEdge(time) {
        // Reset any `maxWait` timer.
        lastInvokeTime = time;
        // Start the timer for the trailing edge.
        timerId = setTimeout(timerExpired, wait);
        // Invoke the leading edge.
        return leading ? invokeFunc(time) : result;
      }

      function remainingWait(time) {
        var timeSinceLastCall = time - lastCallTime,
            timeSinceLastInvoke = time - lastInvokeTime,
            timeWaiting = wait - timeSinceLastCall;

        return maxing
          ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
          : timeWaiting;
      }

      function shouldInvoke(time) {
        var timeSinceLastCall = time - lastCallTime,
            timeSinceLastInvoke = time - lastInvokeTime;

        // Either this is the first call, activity has stopped and we're at the
        // trailing edge, the system time has gone backwards and we're treating
        // it as the trailing edge, or we've hit the `maxWait` limit.
        return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
          (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
      }

      function timerExpired() {
        var time = now();
        if (shouldInvoke(time)) {
          return trailingEdge(time);
        }
        // Restart the timer.
        timerId = setTimeout(timerExpired, remainingWait(time));
      }

      function trailingEdge(time) {
        timerId = undefined;

        // Only invoke if we have `lastArgs` which means `func` has been
        // debounced at least once.
        if (trailing && lastArgs) {
          return invokeFunc(time);
        }
        lastArgs = lastThis = undefined;
        return result;
      }

      function cancel() {
        if (timerId !== undefined) {
          clearTimeout(timerId);
        }
        lastInvokeTime = 0;
        lastArgs = lastCallTime = lastThis = timerId = undefined;
      }

      function flush() {
        return timerId === undefined ? result : trailingEdge(now());
      }

      function debounced() {
        var time = now(),
            isInvoking = shouldInvoke(time);

        lastArgs = arguments;
        lastThis = this;
        lastCallTime = time;

        if (isInvoking) {
          if (timerId === undefined) {
            return leadingEdge(lastCallTime);
          }
          if (maxing) {
            // Handle invocations in a tight loop.
            clearTimeout(timerId);
            timerId = setTimeout(timerExpired, wait);
            return invokeFunc(lastCallTime);
          }
        }
        if (timerId === undefined) {
          timerId = setTimeout(timerExpired, wait);
        }
        return result;
      }
      debounced.cancel = cancel;
      debounced.flush = flush;
      return debounced;
    }

    /**
     * Defers invoking the `func` until the current call stack has cleared. Any
     * additional arguments are provided to `func` when it's invoked.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {Function} func The function to defer.
     * @param {...*} [args] The arguments to invoke `func` with.
     * @returns {number} Returns the timer id.
     * @example
     *
     * _.defer(function(text) {
     *   console.log(text);
     * }, 'deferred');
     * // => Logs 'deferred' after one millisecond.
     */
    var defer = baseRest(function(func, args) {
      return baseDelay(func, 1, args);
    });

    /**
     * Invokes `func` after `wait` milliseconds. Any additional arguments are
     * provided to `func` when it's invoked.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {Function} func The function to delay.
     * @param {number} wait The number of milliseconds to delay invocation.
     * @param {...*} [args] The arguments to invoke `func` with.
     * @returns {number} Returns the timer id.
     * @example
     *
     * _.delay(function(text) {
     *   console.log(text);
     * }, 1000, 'later');
     * // => Logs 'later' after one second.
     */
    var delay = baseRest(function(func, wait, args) {
      return baseDelay(func, toNumber(wait) || 0, args);
    });

    /**
     * Creates a function that invokes `func` with arguments reversed.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Function
     * @param {Function} func The function to flip arguments for.
     * @returns {Function} Returns the new flipped function.
     * @example
     *
     * var flipped = _.flip(function() {
     *   return _.toArray(arguments);
     * });
     *
     * flipped('a', 'b', 'c', 'd');
     * // => ['d', 'c', 'b', 'a']
     */
    function flip(func) {
      return createWrap(func, WRAP_FLIP_FLAG);
    }

    /**
     * Creates a function that memoizes the result of `func`. If `resolver` is
     * provided, it determines the cache key for storing the result based on the
     * arguments provided to the memoized function. By default, the first argument
     * provided to the memoized function is used as the map cache key. The `func`
     * is invoked with the `this` binding of the memoized function.
     *
     * **Note:** The cache is exposed as the `cache` property on the memoized
     * function. Its creation may be customized by replacing the `_.memoize.Cache`
     * constructor with one whose instances implement the
     * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
     * method interface of `clear`, `delete`, `get`, `has`, and `set`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {Function} func The function to have its output memoized.
     * @param {Function} [resolver] The function to resolve the cache key.
     * @returns {Function} Returns the new memoized function.
     * @example
     *
     * var object = { 'a': 1, 'b': 2 };
     * var other = { 'c': 3, 'd': 4 };
     *
     * var values = _.memoize(_.values);
     * values(object);
     * // => [1, 2]
     *
     * values(other);
     * // => [3, 4]
     *
     * object.a = 2;
     * values(object);
     * // => [1, 2]
     *
     * // Modify the result cache.
     * values.cache.set(object, ['a', 'b']);
     * values(object);
     * // => ['a', 'b']
     *
     * // Replace `_.memoize.Cache`.
     * _.memoize.Cache = WeakMap;
     */
    function memoize(func, resolver) {
      if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      var memoized = function() {
        var args = arguments,
            key = resolver ? resolver.apply(this, args) : args[0],
            cache = memoized.cache;

        if (cache.has(key)) {
          return cache.get(key);
        }
        var result = func.apply(this, args);
        memoized.cache = cache.set(key, result) || cache;
        return result;
      };
      memoized.cache = new (memoize.Cache || MapCache);
      return memoized;
    }

    // Expose `MapCache`.
    memoize.Cache = MapCache;

    /**
     * Creates a function that negates the result of the predicate `func`. The
     * `func` predicate is invoked with the `this` binding and arguments of the
     * created function.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Function
     * @param {Function} predicate The predicate to negate.
     * @returns {Function} Returns the new negated function.
     * @example
     *
     * function isEven(n) {
     *   return n % 2 == 0;
     * }
     *
     * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
     * // => [1, 3, 5]
     */
    function negate(predicate) {
      if (typeof predicate != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      return function() {
        var args = arguments;
        switch (args.length) {
          case 0: return !predicate.call(this);
          case 1: return !predicate.call(this, args[0]);
          case 2: return !predicate.call(this, args[0], args[1]);
          case 3: return !predicate.call(this, args[0], args[1], args[2]);
        }
        return !predicate.apply(this, args);
      };
    }

    /**
     * Creates a function that is restricted to invoking `func` once. Repeat calls
     * to the function return the value of the first invocation. The `func` is
     * invoked with the `this` binding and arguments of the created function.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {Function} func The function to restrict.
     * @returns {Function} Returns the new restricted function.
     * @example
     *
     * var initialize = _.once(createApplication);
     * initialize();
     * initialize();
     * // => `createApplication` is invoked once
     */
    function once(func) {
      return before(2, func);
    }

    /**
     * Creates a function that invokes `func` with its arguments transformed.
     *
     * @static
     * @since 4.0.0
     * @memberOf _
     * @category Function
     * @param {Function} func The function to wrap.
     * @param {...(Function|Function[])} [transforms=[_.identity]]
     *  The argument transforms.
     * @returns {Function} Returns the new function.
     * @example
     *
     * function doubled(n) {
     *   return n * 2;
     * }
     *
     * function square(n) {
     *   return n * n;
     * }
     *
     * var func = _.overArgs(function(x, y) {
     *   return [x, y];
     * }, [square, doubled]);
     *
     * func(9, 3);
     * // => [81, 6]
     *
     * func(10, 5);
     * // => [100, 10]
     */
    var overArgs = castRest(function(func, transforms) {
      transforms = (transforms.length == 1 && isArray(transforms[0]))
        ? arrayMap(transforms[0], baseUnary(getIteratee()))
        : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));

      var funcsLength = transforms.length;
      return baseRest(function(args) {
        var index = -1,
            length = nativeMin(args.length, funcsLength);

        while (++index < length) {
          args[index] = transforms[index].call(this, args[index]);
        }
        return apply(func, this, args);
      });
    });

    /**
     * Creates a function that invokes `func` with `partials` prepended to the
     * arguments it receives. This method is like `_.bind` except it does **not**
     * alter the `this` binding.
     *
     * The `_.partial.placeholder` value, which defaults to `_` in monolithic
     * builds, may be used as a placeholder for partially applied arguments.
     *
     * **Note:** This method doesn't set the "length" property of partially
     * applied functions.
     *
     * @static
     * @memberOf _
     * @since 0.2.0
     * @category Function
     * @param {Function} func The function to partially apply arguments to.
     * @param {...*} [partials] The arguments to be partially applied.
     * @returns {Function} Returns the new partially applied function.
     * @example
     *
     * function greet(greeting, name) {
     *   return greeting + ' ' + name;
     * }
     *
     * var sayHelloTo = _.partial(greet, 'hello');
     * sayHelloTo('fred');
     * // => 'hello fred'
     *
     * // Partially applied with placeholders.
     * var greetFred = _.partial(greet, _, 'fred');
     * greetFred('hi');
     * // => 'hi fred'
     */
    var partial = baseRest(function(func, partials) {
      var holders = replaceHolders(partials, getHolder(partial));
      return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
    });

    /**
     * This method is like `_.partial` except that partially applied arguments
     * are appended to the arguments it receives.
     *
     * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
     * builds, may be used as a placeholder for partially applied arguments.
     *
     * **Note:** This method doesn't set the "length" property of partially
     * applied functions.
     *
     * @static
     * @memberOf _
     * @since 1.0.0
     * @category Function
     * @param {Function} func The function to partially apply arguments to.
     * @param {...*} [partials] The arguments to be partially applied.
     * @returns {Function} Returns the new partially applied function.
     * @example
     *
     * function greet(greeting, name) {
     *   return greeting + ' ' + name;
     * }
     *
     * var greetFred = _.partialRight(greet, 'fred');
     * greetFred('hi');
     * // => 'hi fred'
     *
     * // Partially applied with placeholders.
     * var sayHelloTo = _.partialRight(greet, 'hello', _);
     * sayHelloTo('fred');
     * // => 'hello fred'
     */
    var partialRight = baseRest(function(func, partials) {
      var holders = replaceHolders(partials, getHolder(partialRight));
      return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
    });

    /**
     * Creates a function that invokes `func` with arguments arranged according
     * to the specified `indexes` where the argument value at the first index is
     * provided as the first argument, the argument value at the second index is
     * provided as the second argument, and so on.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Function
     * @param {Function} func The function to rearrange arguments for.
     * @param {...(number|number[])} indexes The arranged argument indexes.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var rearged = _.rearg(function(a, b, c) {
     *   return [a, b, c];
     * }, [2, 0, 1]);
     *
     * rearged('b', 'c', 'a')
     * // => ['a', 'b', 'c']
     */
    var rearg = flatRest(function(func, indexes) {
      return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
    });

    /**
     * Creates a function that invokes `func` with the `this` binding of the
     * created function and arguments from `start` and beyond provided as
     * an array.
     *
     * **Note:** This method is based on the
     * [rest parameter](https://mdn.io/rest_parameters).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Function
     * @param {Function} func The function to apply a rest parameter to.
     * @param {number} [start=func.length-1] The start position of the rest parameter.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var say = _.rest(function(what, names) {
     *   return what + ' ' + _.initial(names).join(', ') +
     *     (_.size(names) > 1 ? ', & ' : '') + _.last(names);
     * });
     *
     * say('hello', 'fred', 'barney', 'pebbles');
     * // => 'hello fred, barney, & pebbles'
     */
    function rest(func, start) {
      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      start = start === undefined ? start : toInteger(start);
      return baseRest(func, start);
    }

    /**
     * Creates a function that invokes `func` with the `this` binding of the
     * create function and an array of arguments much like
     * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
     *
     * **Note:** This method is based on the
     * [spread operator](https://mdn.io/spread_operator).
     *
     * @static
     * @memberOf _
     * @since 3.2.0
     * @category Function
     * @param {Function} func The function to spread arguments over.
     * @param {number} [start=0] The start position of the spread.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var say = _.spread(function(who, what) {
     *   return who + ' says ' + what;
     * });
     *
     * say(['fred', 'hello']);
     * // => 'fred says hello'
     *
     * var numbers = Promise.all([
     *   Promise.resolve(40),
     *   Promise.resolve(36)
     * ]);
     *
     * numbers.then(_.spread(function(x, y) {
     *   return x + y;
     * }));
     * // => a Promise of 76
     */
    function spread(func, start) {
      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      start = start == null ? 0 : nativeMax(toInteger(start), 0);
      return baseRest(function(args) {
        var array = args[start],
            otherArgs = castSlice(args, 0, start);

        if (array) {
          arrayPush(otherArgs, array);
        }
        return apply(func, this, otherArgs);
      });
    }

    /**
     * Creates a throttled function that only invokes `func` at most once per
     * every `wait` milliseconds. The throttled function comes with a `cancel`
     * method to cancel delayed `func` invocations and a `flush` method to
     * immediately invoke them. Provide `options` to indicate whether `func`
     * should be invoked on the leading and/or trailing edge of the `wait`
     * timeout. The `func` is invoked with the last arguments provided to the
     * throttled function. Subsequent calls to the throttled function return the
     * result of the last `func` invocation.
     *
     * **Note:** If `leading` and `trailing` options are `true`, `func` is
     * invoked on the trailing edge of the timeout only if the throttled function
     * is invoked more than once during the `wait` timeout.
     *
     * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
     * until to the next tick, similar to `setTimeout` with a timeout of `0`.
     *
     * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
     * for details over the differences between `_.throttle` and `_.debounce`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {Function} func The function to throttle.
     * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
     * @param {Object} [options={}] The options object.
     * @param {boolean} [options.leading=true]
     *  Specify invoking on the leading edge of the timeout.
     * @param {boolean} [options.trailing=true]
     *  Specify invoking on the trailing edge of the timeout.
     * @returns {Function} Returns the new throttled function.
     * @example
     *
     * // Avoid excessively updating the position while scrolling.
     * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
     *
     * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
     * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
     * jQuery(element).on('click', throttled);
     *
     * // Cancel the trailing throttled invocation.
     * jQuery(window).on('popstate', throttled.cancel);
     */
    function throttle(func, wait, options) {
      var leading = true,
          trailing = true;

      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      if (isObject(options)) {
        leading = 'leading' in options ? !!options.leading : leading;
        trailing = 'trailing' in options ? !!options.trailing : trailing;
      }
      return debounce(func, wait, {
        'leading': leading,
        'maxWait': wait,
        'trailing': trailing
      });
    }

    /**
     * Creates a function that accepts up to one argument, ignoring any
     * additional arguments.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Function
     * @param {Function} func The function to cap arguments for.
     * @returns {Function} Returns the new capped function.
     * @example
     *
     * _.map(['6', '8', '10'], _.unary(parseInt));
     * // => [6, 8, 10]
     */
    function unary(func) {
      return ary(func, 1);
    }

    /**
     * Creates a function that provides `value` to `wrapper` as its first
     * argument. Any additional arguments provided to the function are appended
     * to those provided to the `wrapper`. The wrapper is invoked with the `this`
     * binding of the created function.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Function
     * @param {*} value The value to wrap.
     * @param {Function} [wrapper=identity] The wrapper function.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var p = _.wrap(_.escape, function(func, text) {
     *   return '<p>' + func(text) + '</p>';
     * });
     *
     * p('fred, barney, & pebbles');
     * // => '<p>fred, barney, &amp; pebbles</p>'
     */
    function wrap(value, wrapper) {
      return partial(castFunction(wrapper), value);
    }

    /*------------------------------------------------------------------------*/

    /**
     * Casts `value` as an array if it's not one.
     *
     * @static
     * @memberOf _
     * @since 4.4.0
     * @category Lang
     * @param {*} value The value to inspect.
     * @returns {Array} Returns the cast array.
     * @example
     *
     * _.castArray(1);
     * // => [1]
     *
     * _.castArray({ 'a': 1 });
     * // => [{ 'a': 1 }]
     *
     * _.castArray('abc');
     * // => ['abc']
     *
     * _.castArray(null);
     * // => [null]
     *
     * _.castArray(undefined);
     * // => [undefined]
     *
     * _.castArray();
     * // => []
     *
     * var array = [1, 2, 3];
     * console.log(_.castArray(array) === array);
     * // => true
     */
    function castArray() {
      if (!arguments.length) {
        return [];
      }
      var value = arguments[0];
      return isArray(value) ? value : [value];
    }

    /**
     * Creates a shallow clone of `value`.
     *
     * **Note:** This method is loosely based on the
     * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
     * and supports cloning arrays, array buffers, booleans, date objects, maps,
     * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
     * arrays. The own enumerable properties of `arguments` objects are cloned
     * as plain objects. An empty object is returned for uncloneable values such
     * as error objects, functions, DOM nodes, and WeakMaps.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to clone.
     * @returns {*} Returns the cloned value.
     * @see _.cloneDeep
     * @example
     *
     * var objects = [{ 'a': 1 }, { 'b': 2 }];
     *
     * var shallow = _.clone(objects);
     * console.log(shallow[0] === objects[0]);
     * // => true
     */
    function clone(value) {
      return baseClone(value, CLONE_SYMBOLS_FLAG);
    }

    /**
     * This method is like `_.clone` except that it accepts `customizer` which
     * is invoked to produce the cloned value. If `customizer` returns `undefined`,
     * cloning is handled by the method instead. The `customizer` is invoked with
     * up to four arguments; (value [, index|key, object, stack]).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to clone.
     * @param {Function} [customizer] The function to customize cloning.
     * @returns {*} Returns the cloned value.
     * @see _.cloneDeepWith
     * @example
     *
     * function customizer(value) {
     *   if (_.isElement(value)) {
     *     return value.cloneNode(false);
     *   }
     * }
     *
     * var el = _.cloneWith(document.body, customizer);
     *
     * console.log(el === document.body);
     * // => false
     * console.log(el.nodeName);
     * // => 'BODY'
     * console.log(el.childNodes.length);
     * // => 0
     */
    function cloneWith(value, customizer) {
      customizer = typeof customizer == 'function' ? customizer : undefined;
      return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
    }

    /**
     * This method is like `_.clone` except that it recursively clones `value`.
     *
     * @static
     * @memberOf _
     * @since 1.0.0
     * @category Lang
     * @param {*} value The value to recursively clone.
     * @returns {*} Returns the deep cloned value.
     * @see _.clone
     * @example
     *
     * var objects = [{ 'a': 1 }, { 'b': 2 }];
     *
     * var deep = _.cloneDeep(objects);
     * console.log(deep[0] === objects[0]);
     * // => false
     */
    function cloneDeep(value) {
      return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
    }

    /**
     * This method is like `_.cloneWith` except that it recursively clones `value`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to recursively clone.
     * @param {Function} [customizer] The function to customize cloning.
     * @returns {*} Returns the deep cloned value.
     * @see _.cloneWith
     * @example
     *
     * function customizer(value) {
     *   if (_.isElement(value)) {
     *     return value.cloneNode(true);
     *   }
     * }
     *
     * var el = _.cloneDeepWith(document.body, customizer);
     *
     * console.log(el === document.body);
     * // => false
     * console.log(el.nodeName);
     * // => 'BODY'
     * console.log(el.childNodes.length);
     * // => 20
     */
    function cloneDeepWith(value, customizer) {
      customizer = typeof customizer == 'function' ? customizer : undefined;
      return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
    }

    /**
     * Checks if `object` conforms to `source` by invoking the predicate
     * properties of `source` with the corresponding property values of `object`.
     *
     * **Note:** This method is equivalent to `_.conforms` when `source` is
     * partially applied.
     *
     * @static
     * @memberOf _
     * @since 4.14.0
     * @category Lang
     * @param {Object} object The object to inspect.
     * @param {Object} source The object of property predicates to conform to.
     * @returns {boolean} Returns `true` if `object` conforms, else `false`.
     * @example
     *
     * var object = { 'a': 1, 'b': 2 };
     *
     * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
     * // => true
     *
     * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
     * // => false
     */
    function conformsTo(object, source) {
      return source == null || baseConformsTo(object, source, keys(source));
    }

    /**
     * Performs a
     * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * comparison between two values to determine if they are equivalent.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
     * @example
     *
     * var object = { 'a': 1 };
     * var other = { 'a': 1 };
     *
     * _.eq(object, object);
     * // => true
     *
     * _.eq(object, other);
     * // => false
     *
     * _.eq('a', 'a');
     * // => true
     *
     * _.eq('a', Object('a'));
     * // => false
     *
     * _.eq(NaN, NaN);
     * // => true
     */
    function eq(value, other) {
      return value === other || (value !== value && other !== other);
    }

    /**
     * Checks if `value` is greater than `other`.
     *
     * @static
     * @memberOf _
     * @since 3.9.0
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if `value` is greater than `other`,
     *  else `false`.
     * @see _.lt
     * @example
     *
     * _.gt(3, 1);
     * // => true
     *
     * _.gt(3, 3);
     * // => false
     *
     * _.gt(1, 3);
     * // => false
     */
    var gt = createRelationalOperation(baseGt);

    /**
     * Checks if `value` is greater than or equal to `other`.
     *
     * @static
     * @memberOf _
     * @since 3.9.0
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if `value` is greater than or equal to
     *  `other`, else `false`.
     * @see _.lte
     * @example
     *
     * _.gte(3, 1);
     * // => true
     *
     * _.gte(3, 3);
     * // => true
     *
     * _.gte(1, 3);
     * // => false
     */
    var gte = createRelationalOperation(function(value, other) {
      return value >= other;
    });

    /**
     * Checks if `value` is likely an `arguments` object.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an `arguments` object,
     *  else `false`.
     * @example
     *
     * _.isArguments(function() { return arguments; }());
     * // => true
     *
     * _.isArguments([1, 2, 3]);
     * // => false
     */
    var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
      return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
        !propertyIsEnumerable.call(value, 'callee');
    };

    /**
     * Checks if `value` is classified as an `Array` object.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an array, else `false`.
     * @example
     *
     * _.isArray([1, 2, 3]);
     * // => true
     *
     * _.isArray(document.body.children);
     * // => false
     *
     * _.isArray('abc');
     * // => false
     *
     * _.isArray(_.noop);
     * // => false
     */
    var isArray = Array.isArray;

    /**
     * Checks if `value` is classified as an `ArrayBuffer` object.
     *
     * @static
     * @memberOf _
     * @since 4.3.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
     * @example
     *
     * _.isArrayBuffer(new ArrayBuffer(2));
     * // => true
     *
     * _.isArrayBuffer(new Array(2));
     * // => false
     */
    var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;

    /**
     * Checks if `value` is array-like. A value is considered array-like if it's
     * not a function and has a `value.length` that's an integer greater than or
     * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
     * @example
     *
     * _.isArrayLike([1, 2, 3]);
     * // => true
     *
     * _.isArrayLike(document.body.children);
     * // => true
     *
     * _.isArrayLike('abc');
     * // => true
     *
     * _.isArrayLike(_.noop);
     * // => false
     */
    function isArrayLike(value) {
      return value != null && isLength(value.length) && !isFunction(value);
    }

    /**
     * This method is like `_.isArrayLike` except that it also checks if `value`
     * is an object.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an array-like object,
     *  else `false`.
     * @example
     *
     * _.isArrayLikeObject([1, 2, 3]);
     * // => true
     *
     * _.isArrayLikeObject(document.body.children);
     * // => true
     *
     * _.isArrayLikeObject('abc');
     * // => false
     *
     * _.isArrayLikeObject(_.noop);
     * // => false
     */
    function isArrayLikeObject(value) {
      return isObjectLike(value) && isArrayLike(value);
    }

    /**
     * Checks if `value` is classified as a boolean primitive or object.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
     * @example
     *
     * _.isBoolean(false);
     * // => true
     *
     * _.isBoolean(null);
     * // => false
     */
    function isBoolean(value) {
      return value === true || value === false ||
        (isObjectLike(value) && baseGetTag(value) == boolTag);
    }

    /**
     * Checks if `value` is a buffer.
     *
     * @static
     * @memberOf _
     * @since 4.3.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
     * @example
     *
     * _.isBuffer(new Buffer(2));
     * // => true
     *
     * _.isBuffer(new Uint8Array(2));
     * // => false
     */
    var isBuffer = nativeIsBuffer || stubFalse;

    /**
     * Checks if `value` is classified as a `Date` object.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
     * @example
     *
     * _.isDate(new Date);
     * // => true
     *
     * _.isDate('Mon April 23 2012');
     * // => false
     */
    var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;

    /**
     * Checks if `value` is likely a DOM element.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
     * @example
     *
     * _.isElement(document.body);
     * // => true
     *
     * _.isElement('<body>');
     * // => false
     */
    function isElement(value) {
      return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
    }

    /**
     * Checks if `value` is an empty object, collection, map, or set.
     *
     * Objects are considered empty if they have no own enumerable string keyed
     * properties.
     *
     * Array-like values such as `arguments` objects, arrays, buffers, strings, or
     * jQuery-like collections are considered empty if they have a `length` of `0`.
     * Similarly, maps and sets are considered empty if they have a `size` of `0`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is empty, else `false`.
     * @example
     *
     * _.isEmpty(null);
     * // => true
     *
     * _.isEmpty(true);
     * // => true
     *
     * _.isEmpty(1);
     * // => true
     *
     * _.isEmpty([1, 2, 3]);
     * // => false
     *
     * _.isEmpty({ 'a': 1 });
     * // => false
     */
    function isEmpty(value) {
      if (value == null) {
        return true;
      }
      if (isArrayLike(value) &&
          (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
            isBuffer(value) || isTypedArray(value) || isArguments(value))) {
        return !value.length;
      }
      var tag = getTag(value);
      if (tag == mapTag || tag == setTag) {
        return !value.size;
      }
      if (isPrototype(value)) {
        return !baseKeys(value).length;
      }
      for (var key in value) {
        if (hasOwnProperty.call(value, key)) {
          return false;
        }
      }
      return true;
    }

    /**
     * Performs a deep comparison between two values to determine if they are
     * equivalent.
     *
     * **Note:** This method supports comparing arrays, array buffers, booleans,
     * date objects, error objects, maps, numbers, `Object` objects, regexes,
     * sets, strings, symbols, and typed arrays. `Object` objects are compared
     * by their own, not inherited, enumerable properties. Functions and DOM
     * nodes are compared by strict equality, i.e. `===`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
     * @example
     *
     * var object = { 'a': 1 };
     * var other = { 'a': 1 };
     *
     * _.isEqual(object, other);
     * // => true
     *
     * object === other;
     * // => false
     */
    function isEqual(value, other) {
      return baseIsEqual(value, other);
    }

    /**
     * This method is like `_.isEqual` except that it accepts `customizer` which
     * is invoked to compare values. If `customizer` returns `undefined`, comparisons
     * are handled by the method instead. The `customizer` is invoked with up to
     * six arguments: (objValue, othValue [, index|key, object, other, stack]).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @param {Function} [customizer] The function to customize comparisons.
     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
     * @example
     *
     * function isGreeting(value) {
     *   return /^h(?:i|ello)$/.test(value);
     * }
     *
     * function customizer(objValue, othValue) {
     *   if (isGreeting(objValue) && isGreeting(othValue)) {
     *     return true;
     *   }
     * }
     *
     * var array = ['hello', 'goodbye'];
     * var other = ['hi', 'goodbye'];
     *
     * _.isEqualWith(array, other, customizer);
     * // => true
     */
    function isEqualWith(value, other, customizer) {
      customizer = typeof customizer == 'function' ? customizer : undefined;
      var result = customizer ? customizer(value, other) : undefined;
      return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
    }

    /**
     * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
     * `SyntaxError`, `TypeError`, or `URIError` object.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
     * @example
     *
     * _.isError(new Error);
     * // => true
     *
     * _.isError(Error);
     * // => false
     */
    function isError(value) {
      if (!isObjectLike(value)) {
        return false;
      }
      var tag = baseGetTag(value);
      return tag == errorTag || tag == domExcTag ||
        (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
    }

    /**
     * Checks if `value` is a finite primitive number.
     *
     * **Note:** This method is based on
     * [`Number.isFinite`](https://mdn.io/Number/isFinite).
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
     * @example
     *
     * _.isFinite(3);
     * // => true
     *
     * _.isFinite(Number.MIN_VALUE);
     * // => true
     *
     * _.isFinite(Infinity);
     * // => false
     *
     * _.isFinite('3');
     * // => false
     */
    function isFinite(value) {
      return typeof value == 'number' && nativeIsFinite(value);
    }

    /**
     * Checks if `value` is classified as a `Function` object.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a function, else `false`.
     * @example
     *
     * _.isFunction(_);
     * // => true
     *
     * _.isFunction(/abc/);
     * // => false
     */
    function isFunction(value) {
      if (!isObject(value)) {
        return false;
      }
      // The use of `Object#toString` avoids issues with the `typeof` operator
      // in Safari 9 which returns 'object' for typed arrays and other constructors.
      var tag = baseGetTag(value);
      return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
    }

    /**
     * Checks if `value` is an integer.
     *
     * **Note:** This method is based on
     * [`Number.isInteger`](https://mdn.io/Number/isInteger).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
     * @example
     *
     * _.isInteger(3);
     * // => true
     *
     * _.isInteger(Number.MIN_VALUE);
     * // => false
     *
     * _.isInteger(Infinity);
     * // => false
     *
     * _.isInteger('3');
     * // => false
     */
    function isInteger(value) {
      return typeof value == 'number' && value == toInteger(value);
    }

    /**
     * Checks if `value` is a valid array-like length.
     *
     * **Note:** This method is loosely based on
     * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
     * @example
     *
     * _.isLength(3);
     * // => true
     *
     * _.isLength(Number.MIN_VALUE);
     * // => false
     *
     * _.isLength(Infinity);
     * // => false
     *
     * _.isLength('3');
     * // => false
     */
    function isLength(value) {
      return typeof value == 'number' &&
        value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
    }

    /**
     * Checks if `value` is the
     * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
     * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an object, else `false`.
     * @example
     *
     * _.isObject({});
     * // => true
     *
     * _.isObject([1, 2, 3]);
     * // => true
     *
     * _.isObject(_.noop);
     * // => true
     *
     * _.isObject(null);
     * // => false
     */
    function isObject(value) {
      var type = typeof value;
      return value != null && (type == 'object' || type == 'function');
    }

    /**
     * Checks if `value` is object-like. A value is object-like if it's not `null`
     * and has a `typeof` result of "object".
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
     * @example
     *
     * _.isObjectLike({});
     * // => true
     *
     * _.isObjectLike([1, 2, 3]);
     * // => true
     *
     * _.isObjectLike(_.noop);
     * // => false
     *
     * _.isObjectLike(null);
     * // => false
     */
    function isObjectLike(value) {
      return value != null && typeof value == 'object';
    }

    /**
     * Checks if `value` is classified as a `Map` object.
     *
     * @static
     * @memberOf _
     * @since 4.3.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a map, else `false`.
     * @example
     *
     * _.isMap(new Map);
     * // => true
     *
     * _.isMap(new WeakMap);
     * // => false
     */
    var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;

    /**
     * Performs a partial deep comparison between `object` and `source` to
     * determine if `object` contains equivalent property values.
     *
     * **Note:** This method is equivalent to `_.matches` when `source` is
     * partially applied.
     *
     * Partial comparisons will match empty array and empty object `source`
     * values against any array or object value, respectively. See `_.isEqual`
     * for a list of supported value comparisons.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Lang
     * @param {Object} object The object to inspect.
     * @param {Object} source The object of property values to match.
     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
     * @example
     *
     * var object = { 'a': 1, 'b': 2 };
     *
     * _.isMatch(object, { 'b': 2 });
     * // => true
     *
     * _.isMatch(object, { 'b': 1 });
     * // => false
     */
    function isMatch(object, source) {
      return object === source || baseIsMatch(object, source, getMatchData(source));
    }

    /**
     * This method is like `_.isMatch` except that it accepts `customizer` which
     * is invoked to compare values. If `customizer` returns `undefined`, comparisons
     * are handled by the method instead. The `customizer` is invoked with five
     * arguments: (objValue, srcValue, index|key, object, source).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {Object} object The object to inspect.
     * @param {Object} source The object of property values to match.
     * @param {Function} [customizer] The function to customize comparisons.
     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
     * @example
     *
     * function isGreeting(value) {
     *   return /^h(?:i|ello)$/.test(value);
     * }
     *
     * function customizer(objValue, srcValue) {
     *   if (isGreeting(objValue) && isGreeting(srcValue)) {
     *     return true;
     *   }
     * }
     *
     * var object = { 'greeting': 'hello' };
     * var source = { 'greeting': 'hi' };
     *
     * _.isMatchWith(object, source, customizer);
     * // => true
     */
    function isMatchWith(object, source, customizer) {
      customizer = typeof customizer == 'function' ? customizer : undefined;
      return baseIsMatch(object, source, getMatchData(source), customizer);
    }

    /**
     * Checks if `value` is `NaN`.
     *
     * **Note:** This method is based on
     * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
     * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
     * `undefined` and other non-number values.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
     * @example
     *
     * _.isNaN(NaN);
     * // => true
     *
     * _.isNaN(new Number(NaN));
     * // => true
     *
     * isNaN(undefined);
     * // => true
     *
     * _.isNaN(undefined);
     * // => false
     */
    function isNaN(value) {
      // An `NaN` primitive is the only value that is not equal to itself.
      // Perform the `toStringTag` check first to avoid errors with some
      // ActiveX objects in IE.
      return isNumber(value) && value != +value;
    }

    /**
     * Checks if `value` is a pristine native function.
     *
     * **Note:** This method can't reliably detect native functions in the presence
     * of the core-js package because core-js circumvents this kind of detection.
     * Despite multiple requests, the core-js maintainer has made it clear: any
     * attempt to fix the detection will be obstructed. As a result, we're left
     * with little choice but to throw an error. Unfortunately, this also affects
     * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
     * which rely on core-js.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a native function,
     *  else `false`.
     * @example
     *
     * _.isNative(Array.prototype.push);
     * // => true
     *
     * _.isNative(_);
     * // => false
     */
    function isNative(value) {
      if (isMaskable(value)) {
        throw new Error(CORE_ERROR_TEXT);
      }
      return baseIsNative(value);
    }

    /**
     * Checks if `value` is `null`.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
     * @example
     *
     * _.isNull(null);
     * // => true
     *
     * _.isNull(void 0);
     * // => false
     */
    function isNull(value) {
      return value === null;
    }

    /**
     * Checks if `value` is `null` or `undefined`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
     * @example
     *
     * _.isNil(null);
     * // => true
     *
     * _.isNil(void 0);
     * // => true
     *
     * _.isNil(NaN);
     * // => false
     */
    function isNil(value) {
      return value == null;
    }

    /**
     * Checks if `value` is classified as a `Number` primitive or object.
     *
     * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
     * classified as numbers, use the `_.isFinite` method.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a number, else `false`.
     * @example
     *
     * _.isNumber(3);
     * // => true
     *
     * _.isNumber(Number.MIN_VALUE);
     * // => true
     *
     * _.isNumber(Infinity);
     * // => true
     *
     * _.isNumber('3');
     * // => false
     */
    function isNumber(value) {
      return typeof value == 'number' ||
        (isObjectLike(value) && baseGetTag(value) == numberTag);
    }

    /**
     * Checks if `value` is a plain object, that is, an object created by the
     * `Object` constructor or one with a `[[Prototype]]` of `null`.
     *
     * @static
     * @memberOf _
     * @since 0.8.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     * }
     *
     * _.isPlainObject(new Foo);
     * // => false
     *
     * _.isPlainObject([1, 2, 3]);
     * // => false
     *
     * _.isPlainObject({ 'x': 0, 'y': 0 });
     * // => true
     *
     * _.isPlainObject(Object.create(null));
     * // => true
     */
    function isPlainObject(value) {
      if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
        return false;
      }
      var proto = getPrototype(value);
      if (proto === null) {
        return true;
      }
      var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
      return typeof Ctor == 'function' && Ctor instanceof Ctor &&
        funcToString.call(Ctor) == objectCtorString;
    }

    /**
     * Checks if `value` is classified as a `RegExp` object.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
     * @example
     *
     * _.isRegExp(/abc/);
     * // => true
     *
     * _.isRegExp('/abc/');
     * // => false
     */
    var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;

    /**
     * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
     * double precision number which isn't the result of a rounded unsafe integer.
     *
     * **Note:** This method is based on
     * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
     * @example
     *
     * _.isSafeInteger(3);
     * // => true
     *
     * _.isSafeInteger(Number.MIN_VALUE);
     * // => false
     *
     * _.isSafeInteger(Infinity);
     * // => false
     *
     * _.isSafeInteger('3');
     * // => false
     */
    function isSafeInteger(value) {
      return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
    }

    /**
     * Checks if `value` is classified as a `Set` object.
     *
     * @static
     * @memberOf _
     * @since 4.3.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a set, else `false`.
     * @example
     *
     * _.isSet(new Set);
     * // => true
     *
     * _.isSet(new WeakSet);
     * // => false
     */
    var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;

    /**
     * Checks if `value` is classified as a `String` primitive or object.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a string, else `false`.
     * @example
     *
     * _.isString('abc');
     * // => true
     *
     * _.isString(1);
     * // => false
     */
    function isString(value) {
      return typeof value == 'string' ||
        (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
    }

    /**
     * Checks if `value` is classified as a `Symbol` primitive or object.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
     * @example
     *
     * _.isSymbol(Symbol.iterator);
     * // => true
     *
     * _.isSymbol('abc');
     * // => false
     */
    function isSymbol(value) {
      return typeof value == 'symbol' ||
        (isObjectLike(value) && baseGetTag(value) == symbolTag);
    }

    /**
     * Checks if `value` is classified as a typed array.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
     * @example
     *
     * _.isTypedArray(new Uint8Array);
     * // => true
     *
     * _.isTypedArray([]);
     * // => false
     */
    var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;

    /**
     * Checks if `value` is `undefined`.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
     * @example
     *
     * _.isUndefined(void 0);
     * // => true
     *
     * _.isUndefined(null);
     * // => false
     */
    function isUndefined(value) {
      return value === undefined;
    }

    /**
     * Checks if `value` is classified as a `WeakMap` object.
     *
     * @static
     * @memberOf _
     * @since 4.3.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
     * @example
     *
     * _.isWeakMap(new WeakMap);
     * // => true
     *
     * _.isWeakMap(new Map);
     * // => false
     */
    function isWeakMap(value) {
      return isObjectLike(value) && getTag(value) == weakMapTag;
    }

    /**
     * Checks if `value` is classified as a `WeakSet` object.
     *
     * @static
     * @memberOf _
     * @since 4.3.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
     * @example
     *
     * _.isWeakSet(new WeakSet);
     * // => true
     *
     * _.isWeakSet(new Set);
     * // => false
     */
    function isWeakSet(value) {
      return isObjectLike(value) && baseGetTag(value) == weakSetTag;
    }

    /**
     * Checks if `value` is less than `other`.
     *
     * @static
     * @memberOf _
     * @since 3.9.0
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if `value` is less than `other`,
     *  else `false`.
     * @see _.gt
     * @example
     *
     * _.lt(1, 3);
     * // => true
     *
     * _.lt(3, 3);
     * // => false
     *
     * _.lt(3, 1);
     * // => false
     */
    var lt = createRelationalOperation(baseLt);

    /**
     * Checks if `value` is less than or equal to `other`.
     *
     * @static
     * @memberOf _
     * @since 3.9.0
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if `value` is less than or equal to
     *  `other`, else `false`.
     * @see _.gte
     * @example
     *
     * _.lte(1, 3);
     * // => true
     *
     * _.lte(3, 3);
     * // => true
     *
     * _.lte(3, 1);
     * // => false
     */
    var lte = createRelationalOperation(function(value, other) {
      return value <= other;
    });

    /**
     * Converts `value` to an array.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Lang
     * @param {*} value The value to convert.
     * @returns {Array} Returns the converted array.
     * @example
     *
     * _.toArray({ 'a': 1, 'b': 2 });
     * // => [1, 2]
     *
     * _.toArray('abc');
     * // => ['a', 'b', 'c']
     *
     * _.toArray(1);
     * // => []
     *
     * _.toArray(null);
     * // => []
     */
    function toArray(value) {
      if (!value) {
        return [];
      }
      if (isArrayLike(value)) {
        return isString(value) ? stringToArray(value) : copyArray(value);
      }
      if (symIterator && value[symIterator]) {
        return iteratorToArray(value[symIterator]());
      }
      var tag = getTag(value),
          func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);

      return func(value);
    }

    /**
     * Converts `value` to a finite number.
     *
     * @static
     * @memberOf _
     * @since 4.12.0
     * @category Lang
     * @param {*} value The value to convert.
     * @returns {number} Returns the converted number.
     * @example
     *
     * _.toFinite(3.2);
     * // => 3.2
     *
     * _.toFinite(Number.MIN_VALUE);
     * // => 5e-324
     *
     * _.toFinite(Infinity);
     * // => 1.7976931348623157e+308
     *
     * _.toFinite('3.2');
     * // => 3.2
     */
    function toFinite(value) {
      if (!value) {
        return value === 0 ? value : 0;
      }
      value = toNumber(value);
      if (value === INFINITY || value === -INFINITY) {
        var sign = (value < 0 ? -1 : 1);
        return sign * MAX_INTEGER;
      }
      return value === value ? value : 0;
    }

    /**
     * Converts `value` to an integer.
     *
     * **Note:** This method is loosely based on
     * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to convert.
     * @returns {number} Returns the converted integer.
     * @example
     *
     * _.toInteger(3.2);
     * // => 3
     *
     * _.toInteger(Number.MIN_VALUE);
     * // => 0
     *
     * _.toInteger(Infinity);
     * // => 1.7976931348623157e+308
     *
     * _.toInteger('3.2');
     * // => 3
     */
    function toInteger(value) {
      var result = toFinite(value),
          remainder = result % 1;

      return result === result ? (remainder ? result - remainder : result) : 0;
    }

    /**
     * Converts `value` to an integer suitable for use as the length of an
     * array-like object.
     *
     * **Note:** This method is based on
     * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to convert.
     * @returns {number} Returns the converted integer.
     * @example
     *
     * _.toLength(3.2);
     * // => 3
     *
     * _.toLength(Number.MIN_VALUE);
     * // => 0
     *
     * _.toLength(Infinity);
     * // => 4294967295
     *
     * _.toLength('3.2');
     * // => 3
     */
    function toLength(value) {
      return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
    }

    /**
     * Converts `value` to a number.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to process.
     * @returns {number} Returns the number.
     * @example
     *
     * _.toNumber(3.2);
     * // => 3.2
     *
     * _.toNumber(Number.MIN_VALUE);
     * // => 5e-324
     *
     * _.toNumber(Infinity);
     * // => Infinity
     *
     * _.toNumber('3.2');
     * // => 3.2
     */
    function toNumber(value) {
      if (typeof value == 'number') {
        return value;
      }
      if (isSymbol(value)) {
        return NAN;
      }
      if (isObject(value)) {
        var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
        value = isObject(other) ? (other + '') : other;
      }
      if (typeof value != 'string') {
        return value === 0 ? value : +value;
      }
      value = baseTrim(value);
      var isBinary = reIsBinary.test(value);
      return (isBinary || reIsOctal.test(value))
        ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
        : (reIsBadHex.test(value) ? NAN : +value);
    }

    /**
     * Converts `value` to a plain object flattening inherited enumerable string
     * keyed properties of `value` to own properties of the plain object.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Lang
     * @param {*} value The value to convert.
     * @returns {Object} Returns the converted plain object.
     * @example
     *
     * function Foo() {
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.assign({ 'a': 1 }, new Foo);
     * // => { 'a': 1, 'b': 2 }
     *
     * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
     * // => { 'a': 1, 'b': 2, 'c': 3 }
     */
    function toPlainObject(value) {
      return copyObject(value, keysIn(value));
    }

    /**
     * Converts `value` to a safe integer. A safe integer can be compared and
     * represented correctly.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to convert.
     * @returns {number} Returns the converted integer.
     * @example
     *
     * _.toSafeInteger(3.2);
     * // => 3
     *
     * _.toSafeInteger(Number.MIN_VALUE);
     * // => 0
     *
     * _.toSafeInteger(Infinity);
     * // => 9007199254740991
     *
     * _.toSafeInteger('3.2');
     * // => 3
     */
    function toSafeInteger(value) {
      return value
        ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
        : (value === 0 ? value : 0);
    }

    /**
     * Converts `value` to a string. An empty string is returned for `null`
     * and `undefined` values. The sign of `-0` is preserved.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to convert.
     * @returns {string} Returns the converted string.
     * @example
     *
     * _.toString(null);
     * // => ''
     *
     * _.toString(-0);
     * // => '-0'
     *
     * _.toString([1, 2, 3]);
     * // => '1,2,3'
     */
    function toString(value) {
      return value == null ? '' : baseToString(value);
    }

    /*------------------------------------------------------------------------*/

    /**
     * Assigns own enumerable string keyed properties of source objects to the
     * destination object. Source objects are applied from left to right.
     * Subsequent sources overwrite property assignments of previous sources.
     *
     * **Note:** This method mutates `object` and is loosely based on
     * [`Object.assign`](https://mdn.io/Object/assign).
     *
     * @static
     * @memberOf _
     * @since 0.10.0
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} [sources] The source objects.
     * @returns {Object} Returns `object`.
     * @see _.assignIn
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     * }
     *
     * function Bar() {
     *   this.c = 3;
     * }
     *
     * Foo.prototype.b = 2;
     * Bar.prototype.d = 4;
     *
     * _.assign({ 'a': 0 }, new Foo, new Bar);
     * // => { 'a': 1, 'c': 3 }
     */
    var assign = createAssigner(function(object, source) {
      if (isPrototype(source) || isArrayLike(source)) {
        copyObject(source, keys(source), object);
        return;
      }
      for (var key in source) {
        if (hasOwnProperty.call(source, key)) {
          assignValue(object, key, source[key]);
        }
      }
    });

    /**
     * This method is like `_.assign` except that it iterates over own and
     * inherited source properties.
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @alias extend
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} [sources] The source objects.
     * @returns {Object} Returns `object`.
     * @see _.assign
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     * }
     *
     * function Bar() {
     *   this.c = 3;
     * }
     *
     * Foo.prototype.b = 2;
     * Bar.prototype.d = 4;
     *
     * _.assignIn({ 'a': 0 }, new Foo, new Bar);
     * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
     */
    var assignIn = createAssigner(function(object, source) {
      copyObject(source, keysIn(source), object);
    });

    /**
     * This method is like `_.assignIn` except that it accepts `customizer`
     * which is invoked to produce the assigned values. If `customizer` returns
     * `undefined`, assignment is handled by the method instead. The `customizer`
     * is invoked with five arguments: (objValue, srcValue, key, object, source).
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @alias extendWith
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} sources The source objects.
     * @param {Function} [customizer] The function to customize assigned values.
     * @returns {Object} Returns `object`.
     * @see _.assignWith
     * @example
     *
     * function customizer(objValue, srcValue) {
     *   return _.isUndefined(objValue) ? srcValue : objValue;
     * }
     *
     * var defaults = _.partialRight(_.assignInWith, customizer);
     *
     * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
     * // => { 'a': 1, 'b': 2 }
     */
    var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
      copyObject(source, keysIn(source), object, customizer);
    });

    /**
     * This method is like `_.assign` except that it accepts `customizer`
     * which is invoked to produce the assigned values. If `customizer` returns
     * `undefined`, assignment is handled by the method instead. The `customizer`
     * is invoked with five arguments: (objValue, srcValue, key, object, source).
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} sources The source objects.
     * @param {Function} [customizer] The function to customize assigned values.
     * @returns {Object} Returns `object`.
     * @see _.assignInWith
     * @example
     *
     * function customizer(objValue, srcValue) {
     *   return _.isUndefined(objValue) ? srcValue : objValue;
     * }
     *
     * var defaults = _.partialRight(_.assignWith, customizer);
     *
     * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
     * // => { 'a': 1, 'b': 2 }
     */
    var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
      copyObject(source, keys(source), object, customizer);
    });

    /**
     * Creates an array of values corresponding to `paths` of `object`.
     *
     * @static
     * @memberOf _
     * @since 1.0.0
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {...(string|string[])} [paths] The property paths to pick.
     * @returns {Array} Returns the picked values.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
     *
     * _.at(object, ['a[0].b.c', 'a[1]']);
     * // => [3, 4]
     */
    var at = flatRest(baseAt);

    /**
     * Creates an object that inherits from the `prototype` object. If a
     * `properties` object is given, its own enumerable string keyed properties
     * are assigned to the created object.
     *
     * @static
     * @memberOf _
     * @since 2.3.0
     * @category Object
     * @param {Object} prototype The object to inherit from.
     * @param {Object} [properties] The properties to assign to the object.
     * @returns {Object} Returns the new object.
     * @example
     *
     * function Shape() {
     *   this.x = 0;
     *   this.y = 0;
     * }
     *
     * function Circle() {
     *   Shape.call(this);
     * }
     *
     * Circle.prototype = _.create(Shape.prototype, {
     *   'constructor': Circle
     * });
     *
     * var circle = new Circle;
     * circle instanceof Circle;
     * // => true
     *
     * circle instanceof Shape;
     * // => true
     */
    function create(prototype, properties) {
      var result = baseCreate(prototype);
      return properties == null ? result : baseAssign(result, properties);
    }

    /**
     * Assigns own and inherited enumerable string keyed properties of source
     * objects to the destination object for all destination properties that
     * resolve to `undefined`. Source objects are applied from left to right.
     * Once a property is set, additional values of the same property are ignored.
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} [sources] The source objects.
     * @returns {Object} Returns `object`.
     * @see _.defaultsDeep
     * @example
     *
     * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
     * // => { 'a': 1, 'b': 2 }
     */
    var defaults = baseRest(function(object, sources) {
      object = Object(object);

      var index = -1;
      var length = sources.length;
      var guard = length > 2 ? sources[2] : undefined;

      if (guard && isIterateeCall(sources[0], sources[1], guard)) {
        length = 1;
      }

      while (++index < length) {
        var source = sources[index];
        var props = keysIn(source);
        var propsIndex = -1;
        var propsLength = props.length;

        while (++propsIndex < propsLength) {
          var key = props[propsIndex];
          var value = object[key];

          if (value === undefined ||
              (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
            object[key] = source[key];
          }
        }
      }

      return object;
    });

    /**
     * This method is like `_.defaults` except that it recursively assigns
     * default properties.
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 3.10.0
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} [sources] The source objects.
     * @returns {Object} Returns `object`.
     * @see _.defaults
     * @example
     *
     * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
     * // => { 'a': { 'b': 2, 'c': 3 } }
     */
    var defaultsDeep = baseRest(function(args) {
      args.push(undefined, customDefaultsMerge);
      return apply(mergeWith, undefined, args);
    });

    /**
     * This method is like `_.find` except that it returns the key of the first
     * element `predicate` returns truthy for instead of the element itself.
     *
     * @static
     * @memberOf _
     * @since 1.1.0
     * @category Object
     * @param {Object} object The object to inspect.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @returns {string|undefined} Returns the key of the matched element,
     *  else `undefined`.
     * @example
     *
     * var users = {
     *   'barney':  { 'age': 36, 'active': true },
     *   'fred':    { 'age': 40, 'active': false },
     *   'pebbles': { 'age': 1,  'active': true }
     * };
     *
     * _.findKey(users, function(o) { return o.age < 40; });
     * // => 'barney' (iteration order is not guaranteed)
     *
     * // The `_.matches` iteratee shorthand.
     * _.findKey(users, { 'age': 1, 'active': true });
     * // => 'pebbles'
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.findKey(users, ['active', false]);
     * // => 'fred'
     *
     * // The `_.property` iteratee shorthand.
     * _.findKey(users, 'active');
     * // => 'barney'
     */
    function findKey(object, predicate) {
      return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
    }

    /**
     * This method is like `_.findKey` except that it iterates over elements of
     * a collection in the opposite order.
     *
     * @static
     * @memberOf _
     * @since 2.0.0
     * @category Object
     * @param {Object} object The object to inspect.
     * @param {Function} [predicate=_.identity] The function invoked per iteration.
     * @returns {string|undefined} Returns the key of the matched element,
     *  else `undefined`.
     * @example
     *
     * var users = {
     *   'barney':  { 'age': 36, 'active': true },
     *   'fred':    { 'age': 40, 'active': false },
     *   'pebbles': { 'age': 1,  'active': true }
     * };
     *
     * _.findLastKey(users, function(o) { return o.age < 40; });
     * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
     *
     * // The `_.matches` iteratee shorthand.
     * _.findLastKey(users, { 'age': 36, 'active': true });
     * // => 'barney'
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.findLastKey(users, ['active', false]);
     * // => 'fred'
     *
     * // The `_.property` iteratee shorthand.
     * _.findLastKey(users, 'active');
     * // => 'pebbles'
     */
    function findLastKey(object, predicate) {
      return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
    }

    /**
     * Iterates over own and inherited enumerable string keyed properties of an
     * object and invokes `iteratee` for each property. The iteratee is invoked
     * with three arguments: (value, key, object). Iteratee functions may exit
     * iteration early by explicitly returning `false`.
     *
     * @static
     * @memberOf _
     * @since 0.3.0
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Object} Returns `object`.
     * @see _.forInRight
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.forIn(new Foo, function(value, key) {
     *   console.log(key);
     * });
     * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
     */
    function forIn(object, iteratee) {
      return object == null
        ? object
        : baseFor(object, getIteratee(iteratee, 3), keysIn);
    }

    /**
     * This method is like `_.forIn` except that it iterates over properties of
     * `object` in the opposite order.
     *
     * @static
     * @memberOf _
     * @since 2.0.0
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Object} Returns `object`.
     * @see _.forIn
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.forInRight(new Foo, function(value, key) {
     *   console.log(key);
     * });
     * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
     */
    function forInRight(object, iteratee) {
      return object == null
        ? object
        : baseForRight(object, getIteratee(iteratee, 3), keysIn);
    }

    /**
     * Iterates over own enumerable string keyed properties of an object and
     * invokes `iteratee` for each property. The iteratee is invoked with three
     * arguments: (value, key, object). Iteratee functions may exit iteration
     * early by explicitly returning `false`.
     *
     * @static
     * @memberOf _
     * @since 0.3.0
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Object} Returns `object`.
     * @see _.forOwnRight
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.forOwn(new Foo, function(value, key) {
     *   console.log(key);
     * });
     * // => Logs 'a' then 'b' (iteration order is not guaranteed).
     */
    function forOwn(object, iteratee) {
      return object && baseForOwn(object, getIteratee(iteratee, 3));
    }

    /**
     * This method is like `_.forOwn` except that it iterates over properties of
     * `object` in the opposite order.
     *
     * @static
     * @memberOf _
     * @since 2.0.0
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Object} Returns `object`.
     * @see _.forOwn
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.forOwnRight(new Foo, function(value, key) {
     *   console.log(key);
     * });
     * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
     */
    function forOwnRight(object, iteratee) {
      return object && baseForOwnRight(object, getIteratee(iteratee, 3));
    }

    /**
     * Creates an array of function property names from own enumerable properties
     * of `object`.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Object
     * @param {Object} object The object to inspect.
     * @returns {Array} Returns the function names.
     * @see _.functionsIn
     * @example
     *
     * function Foo() {
     *   this.a = _.constant('a');
     *   this.b = _.constant('b');
     * }
     *
     * Foo.prototype.c = _.constant('c');
     *
     * _.functions(new Foo);
     * // => ['a', 'b']
     */
    function functions(object) {
      return object == null ? [] : baseFunctions(object, keys(object));
    }

    /**
     * Creates an array of function property names from own and inherited
     * enumerable properties of `object`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Object
     * @param {Object} object The object to inspect.
     * @returns {Array} Returns the function names.
     * @see _.functions
     * @example
     *
     * function Foo() {
     *   this.a = _.constant('a');
     *   this.b = _.constant('b');
     * }
     *
     * Foo.prototype.c = _.constant('c');
     *
     * _.functionsIn(new Foo);
     * // => ['a', 'b', 'c']
     */
    function functionsIn(object) {
      return object == null ? [] : baseFunctions(object, keysIn(object));
    }

    /**
     * Gets the value at `path` of `object`. If the resolved value is
     * `undefined`, the `defaultValue` is returned in its place.
     *
     * @static
     * @memberOf _
     * @since 3.7.0
     * @category Object
     * @param {Object} object The object to query.
     * @param {Array|string} path The path of the property to get.
     * @param {*} [defaultValue] The value returned for `undefined` resolved values.
     * @returns {*} Returns the resolved value.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
     *
     * _.get(object, 'a[0].b.c');
     * // => 3
     *
     * _.get(object, ['a', '0', 'b', 'c']);
     * // => 3
     *
     * _.get(object, 'a.b.c', 'default');
     * // => 'default'
     */
    function get(object, path, defaultValue) {
      var result = object == null ? undefined : baseGet(object, path);
      return result === undefined ? defaultValue : result;
    }

    /**
     * Checks if `path` is a direct property of `object`.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @param {Array|string} path The path to check.
     * @returns {boolean} Returns `true` if `path` exists, else `false`.
     * @example
     *
     * var object = { 'a': { 'b': 2 } };
     * var other = _.create({ 'a': _.create({ 'b': 2 }) });
     *
     * _.has(object, 'a');
     * // => true
     *
     * _.has(object, 'a.b');
     * // => true
     *
     * _.has(object, ['a', 'b']);
     * // => true
     *
     * _.has(other, 'a');
     * // => false
     */
    function has(object, path) {
      return object != null && hasPath(object, path, baseHas);
    }

    /**
     * Checks if `path` is a direct or inherited property of `object`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Object
     * @param {Object} object The object to query.
     * @param {Array|string} path The path to check.
     * @returns {boolean} Returns `true` if `path` exists, else `false`.
     * @example
     *
     * var object = _.create({ 'a': _.create({ 'b': 2 }) });
     *
     * _.hasIn(object, 'a');
     * // => true
     *
     * _.hasIn(object, 'a.b');
     * // => true
     *
     * _.hasIn(object, ['a', 'b']);
     * // => true
     *
     * _.hasIn(object, 'b');
     * // => false
     */
    function hasIn(object, path) {
      return object != null && hasPath(object, path, baseHasIn);
    }

    /**
     * Creates an object composed of the inverted keys and values of `object`.
     * If `object` contains duplicate values, subsequent values overwrite
     * property assignments of previous values.
     *
     * @static
     * @memberOf _
     * @since 0.7.0
     * @category Object
     * @param {Object} object The object to invert.
     * @returns {Object} Returns the new inverted object.
     * @example
     *
     * var object = { 'a': 1, 'b': 2, 'c': 1 };
     *
     * _.invert(object);
     * // => { '1': 'c', '2': 'b' }
     */
    var invert = createInverter(function(result, value, key) {
      if (value != null &&
          typeof value.toString != 'function') {
        value = nativeObjectToString.call(value);
      }

      result[value] = key;
    }, constant(identity));

    /**
     * This method is like `_.invert` except that the inverted object is generated
     * from the results of running each element of `object` thru `iteratee`. The
     * corresponding inverted value of each inverted key is an array of keys
     * responsible for generating the inverted value. The iteratee is invoked
     * with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 4.1.0
     * @category Object
     * @param {Object} object The object to invert.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {Object} Returns the new inverted object.
     * @example
     *
     * var object = { 'a': 1, 'b': 2, 'c': 1 };
     *
     * _.invertBy(object);
     * // => { '1': ['a', 'c'], '2': ['b'] }
     *
     * _.invertBy(object, function(value) {
     *   return 'group' + value;
     * });
     * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
     */
    var invertBy = createInverter(function(result, value, key) {
      if (value != null &&
          typeof value.toString != 'function') {
        value = nativeObjectToString.call(value);
      }

      if (hasOwnProperty.call(result, value)) {
        result[value].push(key);
      } else {
        result[value] = [key];
      }
    }, getIteratee);

    /**
     * Invokes the method at `path` of `object`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Object
     * @param {Object} object The object to query.
     * @param {Array|string} path The path of the method to invoke.
     * @param {...*} [args] The arguments to invoke the method with.
     * @returns {*} Returns the result of the invoked method.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
     *
     * _.invoke(object, 'a[0].b.c.slice', 1, 3);
     * // => [2, 3]
     */
    var invoke = baseRest(baseInvoke);

    /**
     * Creates an array of the own enumerable property names of `object`.
     *
     * **Note:** Non-object values are coerced to objects. See the
     * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
     * for more details.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.keys(new Foo);
     * // => ['a', 'b'] (iteration order is not guaranteed)
     *
     * _.keys('hi');
     * // => ['0', '1']
     */
    function keys(object) {
      return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
    }

    /**
     * Creates an array of the own and inherited enumerable property names of `object`.
     *
     * **Note:** Non-object values are coerced to objects.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.keysIn(new Foo);
     * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
     */
    function keysIn(object) {
      return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
    }

    /**
     * The opposite of `_.mapValues`; this method creates an object with the
     * same values as `object` and keys generated by running each own enumerable
     * string keyed property of `object` thru `iteratee`. The iteratee is invoked
     * with three arguments: (value, key, object).
     *
     * @static
     * @memberOf _
     * @since 3.8.0
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Object} Returns the new mapped object.
     * @see _.mapValues
     * @example
     *
     * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
     *   return key + value;
     * });
     * // => { 'a1': 1, 'b2': 2 }
     */
    function mapKeys(object, iteratee) {
      var result = {};
      iteratee = getIteratee(iteratee, 3);

      baseForOwn(object, function(value, key, object) {
        baseAssignValue(result, iteratee(value, key, object), value);
      });
      return result;
    }

    /**
     * Creates an object with the same keys as `object` and values generated
     * by running each own enumerable string keyed property of `object` thru
     * `iteratee`. The iteratee is invoked with three arguments:
     * (value, key, object).
     *
     * @static
     * @memberOf _
     * @since 2.4.0
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Object} Returns the new mapped object.
     * @see _.mapKeys
     * @example
     *
     * var users = {
     *   'fred':    { 'user': 'fred',    'age': 40 },
     *   'pebbles': { 'user': 'pebbles', 'age': 1 }
     * };
     *
     * _.mapValues(users, function(o) { return o.age; });
     * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
     *
     * // The `_.property` iteratee shorthand.
     * _.mapValues(users, 'age');
     * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
     */
    function mapValues(object, iteratee) {
      var result = {};
      iteratee = getIteratee(iteratee, 3);

      baseForOwn(object, function(value, key, object) {
        baseAssignValue(result, key, iteratee(value, key, object));
      });
      return result;
    }

    /**
     * This method is like `_.assign` except that it recursively merges own and
     * inherited enumerable string keyed properties of source objects into the
     * destination object. Source properties that resolve to `undefined` are
     * skipped if a destination value exists. Array and plain object properties
     * are merged recursively. Other objects and value types are overridden by
     * assignment. Source objects are applied from left to right. Subsequent
     * sources overwrite property assignments of previous sources.
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 0.5.0
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} [sources] The source objects.
     * @returns {Object} Returns `object`.
     * @example
     *
     * var object = {
     *   'a': [{ 'b': 2 }, { 'd': 4 }]
     * };
     *
     * var other = {
     *   'a': [{ 'c': 3 }, { 'e': 5 }]
     * };
     *
     * _.merge(object, other);
     * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
     */
    var merge = createAssigner(function(object, source, srcIndex) {
      baseMerge(object, source, srcIndex);
    });

    /**
     * This method is like `_.merge` except that it accepts `customizer` which
     * is invoked to produce the merged values of the destination and source
     * properties. If `customizer` returns `undefined`, merging is handled by the
     * method instead. The `customizer` is invoked with six arguments:
     * (objValue, srcValue, key, object, source, stack).
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} sources The source objects.
     * @param {Function} customizer The function to customize assigned values.
     * @returns {Object} Returns `object`.
     * @example
     *
     * function customizer(objValue, srcValue) {
     *   if (_.isArray(objValue)) {
     *     return objValue.concat(srcValue);
     *   }
     * }
     *
     * var object = { 'a': [1], 'b': [2] };
     * var other = { 'a': [3], 'b': [4] };
     *
     * _.mergeWith(object, other, customizer);
     * // => { 'a': [1, 3], 'b': [2, 4] }
     */
    var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
      baseMerge(object, source, srcIndex, customizer);
    });

    /**
     * The opposite of `_.pick`; this method creates an object composed of the
     * own and inherited enumerable property paths of `object` that are not omitted.
     *
     * **Note:** This method is considerably slower than `_.pick`.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Object
     * @param {Object} object The source object.
     * @param {...(string|string[])} [paths] The property paths to omit.
     * @returns {Object} Returns the new object.
     * @example
     *
     * var object = { 'a': 1, 'b': '2', 'c': 3 };
     *
     * _.omit(object, ['a', 'c']);
     * // => { 'b': '2' }
     */
    var omit = flatRest(function(object, paths) {
      var result = {};
      if (object == null) {
        return result;
      }
      var isDeep = false;
      paths = arrayMap(paths, function(path) {
        path = castPath(path, object);
        isDeep || (isDeep = path.length > 1);
        return path;
      });
      copyObject(object, getAllKeysIn(object), result);
      if (isDeep) {
        result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
      }
      var length = paths.length;
      while (length--) {
        baseUnset(result, paths[length]);
      }
      return result;
    });

    /**
     * The opposite of `_.pickBy`; this method creates an object composed of
     * the own and inherited enumerable string keyed properties of `object` that
     * `predicate` doesn't return truthy for. The predicate is invoked with two
     * arguments: (value, key).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Object
     * @param {Object} object The source object.
     * @param {Function} [predicate=_.identity] The function invoked per property.
     * @returns {Object} Returns the new object.
     * @example
     *
     * var object = { 'a': 1, 'b': '2', 'c': 3 };
     *
     * _.omitBy(object, _.isNumber);
     * // => { 'b': '2' }
     */
    function omitBy(object, predicate) {
      return pickBy(object, negate(getIteratee(predicate)));
    }

    /**
     * Creates an object composed of the picked `object` properties.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Object
     * @param {Object} object The source object.
     * @param {...(string|string[])} [paths] The property paths to pick.
     * @returns {Object} Returns the new object.
     * @example
     *
     * var object = { 'a': 1, 'b': '2', 'c': 3 };
     *
     * _.pick(object, ['a', 'c']);
     * // => { 'a': 1, 'c': 3 }
     */
    var pick = flatRest(function(object, paths) {
      return object == null ? {} : basePick(object, paths);
    });

    /**
     * Creates an object composed of the `object` properties `predicate` returns
     * truthy for. The predicate is invoked with two arguments: (value, key).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Object
     * @param {Object} object The source object.
     * @param {Function} [predicate=_.identity] The function invoked per property.
     * @returns {Object} Returns the new object.
     * @example
     *
     * var object = { 'a': 1, 'b': '2', 'c': 3 };
     *
     * _.pickBy(object, _.isNumber);
     * // => { 'a': 1, 'c': 3 }
     */
    function pickBy(object, predicate) {
      if (object == null) {
        return {};
      }
      var props = arrayMap(getAllKeysIn(object), function(prop) {
        return [prop];
      });
      predicate = getIteratee(predicate);
      return basePickBy(object, props, function(value, path) {
        return predicate(value, path[0]);
      });
    }

    /**
     * This method is like `_.get` except that if the resolved value is a
     * function it's invoked with the `this` binding of its parent object and
     * its result is returned.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @param {Array|string} path The path of the property to resolve.
     * @param {*} [defaultValue] The value returned for `undefined` resolved values.
     * @returns {*} Returns the resolved value.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
     *
     * _.result(object, 'a[0].b.c1');
     * // => 3
     *
     * _.result(object, 'a[0].b.c2');
     * // => 4
     *
     * _.result(object, 'a[0].b.c3', 'default');
     * // => 'default'
     *
     * _.result(object, 'a[0].b.c3', _.constant('default'));
     * // => 'default'
     */
    function result(object, path, defaultValue) {
      path = castPath(path, object);

      var index = -1,
          length = path.length;

      // Ensure the loop is entered when path is empty.
      if (!length) {
        length = 1;
        object = undefined;
      }
      while (++index < length) {
        var value = object == null ? undefined : object[toKey(path[index])];
        if (value === undefined) {
          index = length;
          value = defaultValue;
        }
        object = isFunction(value) ? value.call(object) : value;
      }
      return object;
    }

    /**
     * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
     * it's created. Arrays are created for missing index properties while objects
     * are created for all other missing properties. Use `_.setWith` to customize
     * `path` creation.
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 3.7.0
     * @category Object
     * @param {Object} object The object to modify.
     * @param {Array|string} path The path of the property to set.
     * @param {*} value The value to set.
     * @returns {Object} Returns `object`.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
     *
     * _.set(object, 'a[0].b.c', 4);
     * console.log(object.a[0].b.c);
     * // => 4
     *
     * _.set(object, ['x', '0', 'y', 'z'], 5);
     * console.log(object.x[0].y.z);
     * // => 5
     */
    function set(object, path, value) {
      return object == null ? object : baseSet(object, path, value);
    }

    /**
     * This method is like `_.set` except that it accepts `customizer` which is
     * invoked to produce the objects of `path`.  If `customizer` returns `undefined`
     * path creation is handled by the method instead. The `customizer` is invoked
     * with three arguments: (nsValue, key, nsObject).
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Object
     * @param {Object} object The object to modify.
     * @param {Array|string} path The path of the property to set.
     * @param {*} value The value to set.
     * @param {Function} [customizer] The function to customize assigned values.
     * @returns {Object} Returns `object`.
     * @example
     *
     * var object = {};
     *
     * _.setWith(object, '[0][1]', 'a', Object);
     * // => { '0': { '1': 'a' } }
     */
    function setWith(object, path, value, customizer) {
      customizer = typeof customizer == 'function' ? customizer : undefined;
      return object == null ? object : baseSet(object, path, value, customizer);
    }

    /**
     * Creates an array of own enumerable string keyed-value pairs for `object`
     * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
     * entries are returned.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @alias entries
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the key-value pairs.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.toPairs(new Foo);
     * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
     */
    var toPairs = createToPairs(keys);

    /**
     * Creates an array of own and inherited enumerable string keyed-value pairs
     * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
     * or set, its entries are returned.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @alias entriesIn
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the key-value pairs.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.toPairsIn(new Foo);
     * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
     */
    var toPairsIn = createToPairs(keysIn);

    /**
     * An alternative to `_.reduce`; this method transforms `object` to a new
     * `accumulator` object which is the result of running each of its own
     * enumerable string keyed properties thru `iteratee`, with each invocation
     * potentially mutating the `accumulator` object. If `accumulator` is not
     * provided, a new object with the same `[[Prototype]]` will be used. The
     * iteratee is invoked with four arguments: (accumulator, value, key, object).
     * Iteratee functions may exit iteration early by explicitly returning `false`.
     *
     * @static
     * @memberOf _
     * @since 1.3.0
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [accumulator] The custom accumulator value.
     * @returns {*} Returns the accumulated value.
     * @example
     *
     * _.transform([2, 3, 4], function(result, n) {
     *   result.push(n *= n);
     *   return n % 2 == 0;
     * }, []);
     * // => [4, 9]
     *
     * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
     *   (result[value] || (result[value] = [])).push(key);
     * }, {});
     * // => { '1': ['a', 'c'], '2': ['b'] }
     */
    function transform(object, iteratee, accumulator) {
      var isArr = isArray(object),
          isArrLike = isArr || isBuffer(object) || isTypedArray(object);

      iteratee = getIteratee(iteratee, 4);
      if (accumulator == null) {
        var Ctor = object && object.constructor;
        if (isArrLike) {
          accumulator = isArr ? new Ctor : [];
        }
        else if (isObject(object)) {
          accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
        }
        else {
          accumulator = {};
        }
      }
      (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
        return iteratee(accumulator, value, index, object);
      });
      return accumulator;
    }

    /**
     * Removes the property at `path` of `object`.
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Object
     * @param {Object} object The object to modify.
     * @param {Array|string} path The path of the property to unset.
     * @returns {boolean} Returns `true` if the property is deleted, else `false`.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c': 7 } }] };
     * _.unset(object, 'a[0].b.c');
     * // => true
     *
     * console.log(object);
     * // => { 'a': [{ 'b': {} }] };
     *
     * _.unset(object, ['a', '0', 'b', 'c']);
     * // => true
     *
     * console.log(object);
     * // => { 'a': [{ 'b': {} }] };
     */
    function unset(object, path) {
      return object == null ? true : baseUnset(object, path);
    }

    /**
     * This method is like `_.set` except that accepts `updater` to produce the
     * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
     * is invoked with one argument: (value).
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 4.6.0
     * @category Object
     * @param {Object} object The object to modify.
     * @param {Array|string} path The path of the property to set.
     * @param {Function} updater The function to produce the updated value.
     * @returns {Object} Returns `object`.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
     *
     * _.update(object, 'a[0].b.c', function(n) { return n * n; });
     * console.log(object.a[0].b.c);
     * // => 9
     *
     * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
     * console.log(object.x[0].y.z);
     * // => 0
     */
    function update(object, path, updater) {
      return object == null ? object : baseUpdate(object, path, castFunction(updater));
    }

    /**
     * This method is like `_.update` except that it accepts `customizer` which is
     * invoked to produce the objects of `path`.  If `customizer` returns `undefined`
     * path creation is handled by the method instead. The `customizer` is invoked
     * with three arguments: (nsValue, key, nsObject).
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 4.6.0
     * @category Object
     * @param {Object} object The object to modify.
     * @param {Array|string} path The path of the property to set.
     * @param {Function} updater The function to produce the updated value.
     * @param {Function} [customizer] The function to customize assigned values.
     * @returns {Object} Returns `object`.
     * @example
     *
     * var object = {};
     *
     * _.updateWith(object, '[0][1]', _.constant('a'), Object);
     * // => { '0': { '1': 'a' } }
     */
    function updateWith(object, path, updater, customizer) {
      customizer = typeof customizer == 'function' ? customizer : undefined;
      return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
    }

    /**
     * Creates an array of the own enumerable string keyed property values of `object`.
     *
     * **Note:** Non-object values are coerced to objects.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property values.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.values(new Foo);
     * // => [1, 2] (iteration order is not guaranteed)
     *
     * _.values('hi');
     * // => ['h', 'i']
     */
    function values(object) {
      return object == null ? [] : baseValues(object, keys(object));
    }

    /**
     * Creates an array of the own and inherited enumerable string keyed property
     * values of `object`.
     *
     * **Note:** Non-object values are coerced to objects.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property values.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.valuesIn(new Foo);
     * // => [1, 2, 3] (iteration order is not guaranteed)
     */
    function valuesIn(object) {
      return object == null ? [] : baseValues(object, keysIn(object));
    }

    /*------------------------------------------------------------------------*/

    /**
     * Clamps `number` within the inclusive `lower` and `upper` bounds.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Number
     * @param {number} number The number to clamp.
     * @param {number} [lower] The lower bound.
     * @param {number} upper The upper bound.
     * @returns {number} Returns the clamped number.
     * @example
     *
     * _.clamp(-10, -5, 5);
     * // => -5
     *
     * _.clamp(10, -5, 5);
     * // => 5
     */
    function clamp(number, lower, upper) {
      if (upper === undefined) {
        upper = lower;
        lower = undefined;
      }
      if (upper !== undefined) {
        upper = toNumber(upper);
        upper = upper === upper ? upper : 0;
      }
      if (lower !== undefined) {
        lower = toNumber(lower);
        lower = lower === lower ? lower : 0;
      }
      return baseClamp(toNumber(number), lower, upper);
    }

    /**
     * Checks if `n` is between `start` and up to, but not including, `end`. If
     * `end` is not specified, it's set to `start` with `start` then set to `0`.
     * If `start` is greater than `end` the params are swapped to support
     * negative ranges.
     *
     * @static
     * @memberOf _
     * @since 3.3.0
     * @category Number
     * @param {number} number The number to check.
     * @param {number} [start=0] The start of the range.
     * @param {number} end The end of the range.
     * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
     * @see _.range, _.rangeRight
     * @example
     *
     * _.inRange(3, 2, 4);
     * // => true
     *
     * _.inRange(4, 8);
     * // => true
     *
     * _.inRange(4, 2);
     * // => false
     *
     * _.inRange(2, 2);
     * // => false
     *
     * _.inRange(1.2, 2);
     * // => true
     *
     * _.inRange(5.2, 4);
     * // => false
     *
     * _.inRange(-3, -2, -6);
     * // => true
     */
    function inRange(number, start, end) {
      start = toFinite(start);
      if (end === undefined) {
        end = start;
        start = 0;
      } else {
        end = toFinite(end);
      }
      number = toNumber(number);
      return baseInRange(number, start, end);
    }

    /**
     * Produces a random number between the inclusive `lower` and `upper` bounds.
     * If only one argument is provided a number between `0` and the given number
     * is returned. If `floating` is `true`, or either `lower` or `upper` are
     * floats, a floating-point number is returned instead of an integer.
     *
     * **Note:** JavaScript follows the IEEE-754 standard for resolving
     * floating-point values which can produce unexpected results.
     *
     * @static
     * @memberOf _
     * @since 0.7.0
     * @category Number
     * @param {number} [lower=0] The lower bound.
     * @param {number} [upper=1] The upper bound.
     * @param {boolean} [floating] Specify returning a floating-point number.
     * @returns {number} Returns the random number.
     * @example
     *
     * _.random(0, 5);
     * // => an integer between 0 and 5
     *
     * _.random(5);
     * // => also an integer between 0 and 5
     *
     * _.random(5, true);
     * // => a floating-point number between 0 and 5
     *
     * _.random(1.2, 5.2);
     * // => a floating-point number between 1.2 and 5.2
     */
    function random(lower, upper, floating) {
      if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
        upper = floating = undefined;
      }
      if (floating === undefined) {
        if (typeof upper == 'boolean') {
          floating = upper;
          upper = undefined;
        }
        else if (typeof lower == 'boolean') {
          floating = lower;
          lower = undefined;
        }
      }
      if (lower === undefined && upper === undefined) {
        lower = 0;
        upper = 1;
      }
      else {
        lower = toFinite(lower);
        if (upper === undefined) {
          upper = lower;
          lower = 0;
        } else {
          upper = toFinite(upper);
        }
      }
      if (lower > upper) {
        var temp = lower;
        lower = upper;
        upper = temp;
      }
      if (floating || lower % 1 || upper % 1) {
        var rand = nativeRandom();
        return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
      }
      return baseRandom(lower, upper);
    }

    /*------------------------------------------------------------------------*/

    /**
     * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the camel cased string.
     * @example
     *
     * _.camelCase('Foo Bar');
     * // => 'fooBar'
     *
     * _.camelCase('--foo-bar--');
     * // => 'fooBar'
     *
     * _.camelCase('__FOO_BAR__');
     * // => 'fooBar'
     */
    var camelCase = createCompounder(function(result, word, index) {
      word = word.toLowerCase();
      return result + (index ? capitalize(word) : word);
    });

    /**
     * Converts the first character of `string` to upper case and the remaining
     * to lower case.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to capitalize.
     * @returns {string} Returns the capitalized string.
     * @example
     *
     * _.capitalize('FRED');
     * // => 'Fred'
     */
    function capitalize(string) {
      return upperFirst(toString(string).toLowerCase());
    }

    /**
     * Deburrs `string` by converting
     * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
     * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
     * letters to basic Latin letters and removing
     * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to deburr.
     * @returns {string} Returns the deburred string.
     * @example
     *
     * _.deburr('déjà vu');
     * // => 'deja vu'
     */
    function deburr(string) {
      string = toString(string);
      return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
    }

    /**
     * Checks if `string` ends with the given target string.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to inspect.
     * @param {string} [target] The string to search for.
     * @param {number} [position=string.length] The position to search up to.
     * @returns {boolean} Returns `true` if `string` ends with `target`,
     *  else `false`.
     * @example
     *
     * _.endsWith('abc', 'c');
     * // => true
     *
     * _.endsWith('abc', 'b');
     * // => false
     *
     * _.endsWith('abc', 'b', 2);
     * // => true
     */
    function endsWith(string, target, position) {
      string = toString(string);
      target = baseToString(target);

      var length = string.length;
      position = position === undefined
        ? length
        : baseClamp(toInteger(position), 0, length);

      var end = position;
      position -= target.length;
      return position >= 0 && string.slice(position, end) == target;
    }

    /**
     * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
     * corresponding HTML entities.
     *
     * **Note:** No other characters are escaped. To escape additional
     * characters use a third-party library like [_he_](https://mths.be/he).
     *
     * Though the ">" character is escaped for symmetry, characters like
     * ">" and "/" don't need escaping in HTML and have no special meaning
     * unless they're part of a tag or unquoted attribute value. See
     * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
     * (under "semi-related fun fact") for more details.
     *
     * When working with HTML you should always
     * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
     * XSS vectors.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to escape.
     * @returns {string} Returns the escaped string.
     * @example
     *
     * _.escape('fred, barney, & pebbles');
     * // => 'fred, barney, &amp; pebbles'
     */
    function escape(string) {
      string = toString(string);
      return (string && reHasUnescapedHtml.test(string))
        ? string.replace(reUnescapedHtml, escapeHtmlChar)
        : string;
    }

    /**
     * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
     * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to escape.
     * @returns {string} Returns the escaped string.
     * @example
     *
     * _.escapeRegExp('[lodash](https://lodash.com/)');
     * // => '\[lodash\]\(https://lodash\.com/\)'
     */
    function escapeRegExp(string) {
      string = toString(string);
      return (string && reHasRegExpChar.test(string))
        ? string.replace(reRegExpChar, '\\$&')
        : string;
    }

    /**
     * Converts `string` to
     * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the kebab cased string.
     * @example
     *
     * _.kebabCase('Foo Bar');
     * // => 'foo-bar'
     *
     * _.kebabCase('fooBar');
     * // => 'foo-bar'
     *
     * _.kebabCase('__FOO_BAR__');
     * // => 'foo-bar'
     */
    var kebabCase = createCompounder(function(result, word, index) {
      return result + (index ? '-' : '') + word.toLowerCase();
    });

    /**
     * Converts `string`, as space separated words, to lower case.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the lower cased string.
     * @example
     *
     * _.lowerCase('--Foo-Bar--');
     * // => 'foo bar'
     *
     * _.lowerCase('fooBar');
     * // => 'foo bar'
     *
     * _.lowerCase('__FOO_BAR__');
     * // => 'foo bar'
     */
    var lowerCase = createCompounder(function(result, word, index) {
      return result + (index ? ' ' : '') + word.toLowerCase();
    });

    /**
     * Converts the first character of `string` to lower case.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the converted string.
     * @example
     *
     * _.lowerFirst('Fred');
     * // => 'fred'
     *
     * _.lowerFirst('FRED');
     * // => 'fRED'
     */
    var lowerFirst = createCaseFirst('toLowerCase');

    /**
     * Pads `string` on the left and right sides if it's shorter than `length`.
     * Padding characters are truncated if they can't be evenly divided by `length`.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to pad.
     * @param {number} [length=0] The padding length.
     * @param {string} [chars=' '] The string used as padding.
     * @returns {string} Returns the padded string.
     * @example
     *
     * _.pad('abc', 8);
     * // => '  abc   '
     *
     * _.pad('abc', 8, '_-');
     * // => '_-abc_-_'
     *
     * _.pad('abc', 3);
     * // => 'abc'
     */
    function pad(string, length, chars) {
      string = toString(string);
      length = toInteger(length);

      var strLength = length ? stringSize(string) : 0;
      if (!length || strLength >= length) {
        return string;
      }
      var mid = (length - strLength) / 2;
      return (
        createPadding(nativeFloor(mid), chars) +
        string +
        createPadding(nativeCeil(mid), chars)
      );
    }

    /**
     * Pads `string` on the right side if it's shorter than `length`. Padding
     * characters are truncated if they exceed `length`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to pad.
     * @param {number} [length=0] The padding length.
     * @param {string} [chars=' '] The string used as padding.
     * @returns {string} Returns the padded string.
     * @example
     *
     * _.padEnd('abc', 6);
     * // => 'abc   '
     *
     * _.padEnd('abc', 6, '_-');
     * // => 'abc_-_'
     *
     * _.padEnd('abc', 3);
     * // => 'abc'
     */
    function padEnd(string, length, chars) {
      string = toString(string);
      length = toInteger(length);

      var strLength = length ? stringSize(string) : 0;
      return (length && strLength < length)
        ? (string + createPadding(length - strLength, chars))
        : string;
    }

    /**
     * Pads `string` on the left side if it's shorter than `length`. Padding
     * characters are truncated if they exceed `length`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to pad.
     * @param {number} [length=0] The padding length.
     * @param {string} [chars=' '] The string used as padding.
     * @returns {string} Returns the padded string.
     * @example
     *
     * _.padStart('abc', 6);
     * // => '   abc'
     *
     * _.padStart('abc', 6, '_-');
     * // => '_-_abc'
     *
     * _.padStart('abc', 3);
     * // => 'abc'
     */
    function padStart(string, length, chars) {
      string = toString(string);
      length = toInteger(length);

      var strLength = length ? stringSize(string) : 0;
      return (length && strLength < length)
        ? (createPadding(length - strLength, chars) + string)
        : string;
    }

    /**
     * Converts `string` to an integer of the specified radix. If `radix` is
     * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
     * hexadecimal, in which case a `radix` of `16` is used.
     *
     * **Note:** This method aligns with the
     * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
     *
     * @static
     * @memberOf _
     * @since 1.1.0
     * @category String
     * @param {string} string The string to convert.
     * @param {number} [radix=10] The radix to interpret `value` by.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {number} Returns the converted integer.
     * @example
     *
     * _.parseInt('08');
     * // => 8
     *
     * _.map(['6', '08', '10'], _.parseInt);
     * // => [6, 8, 10]
     */
    function parseInt(string, radix, guard) {
      if (guard || radix == null) {
        radix = 0;
      } else if (radix) {
        radix = +radix;
      }
      return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
    }

    /**
     * Repeats the given string `n` times.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to repeat.
     * @param {number} [n=1] The number of times to repeat the string.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {string} Returns the repeated string.
     * @example
     *
     * _.repeat('*', 3);
     * // => '***'
     *
     * _.repeat('abc', 2);
     * // => 'abcabc'
     *
     * _.repeat('abc', 0);
     * // => ''
     */
    function repeat(string, n, guard) {
      if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
        n = 1;
      } else {
        n = toInteger(n);
      }
      return baseRepeat(toString(string), n);
    }

    /**
     * Replaces matches for `pattern` in `string` with `replacement`.
     *
     * **Note:** This method is based on
     * [`String#replace`](https://mdn.io/String/replace).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to modify.
     * @param {RegExp|string} pattern The pattern to replace.
     * @param {Function|string} replacement The match replacement.
     * @returns {string} Returns the modified string.
     * @example
     *
     * _.replace('Hi Fred', 'Fred', 'Barney');
     * // => 'Hi Barney'
     */
    function replace() {
      var args = arguments,
          string = toString(args[0]);

      return args.length < 3 ? string : string.replace(args[1], args[2]);
    }

    /**
     * Converts `string` to
     * [snake case](https://en.wikipedia.org/wiki/Snake_case).
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the snake cased string.
     * @example
     *
     * _.snakeCase('Foo Bar');
     * // => 'foo_bar'
     *
     * _.snakeCase('fooBar');
     * // => 'foo_bar'
     *
     * _.snakeCase('--FOO-BAR--');
     * // => 'foo_bar'
     */
    var snakeCase = createCompounder(function(result, word, index) {
      return result + (index ? '_' : '') + word.toLowerCase();
    });

    /**
     * Splits `string` by `separator`.
     *
     * **Note:** This method is based on
     * [`String#split`](https://mdn.io/String/split).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to split.
     * @param {RegExp|string} separator The separator pattern to split by.
     * @param {number} [limit] The length to truncate results to.
     * @returns {Array} Returns the string segments.
     * @example
     *
     * _.split('a-b-c', '-', 2);
     * // => ['a', 'b']
     */
    function split(string, separator, limit) {
      if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
        separator = limit = undefined;
      }
      limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
      if (!limit) {
        return [];
      }
      string = toString(string);
      if (string && (
            typeof separator == 'string' ||
            (separator != null && !isRegExp(separator))
          )) {
        separator = baseToString(separator);
        if (!separator && hasUnicode(string)) {
          return castSlice(stringToArray(string), 0, limit);
        }
      }
      return string.split(separator, limit);
    }

    /**
     * Converts `string` to
     * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
     *
     * @static
     * @memberOf _
     * @since 3.1.0
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the start cased string.
     * @example
     *
     * _.startCase('--foo-bar--');
     * // => 'Foo Bar'
     *
     * _.startCase('fooBar');
     * // => 'Foo Bar'
     *
     * _.startCase('__FOO_BAR__');
     * // => 'FOO BAR'
     */
    var startCase = createCompounder(function(result, word, index) {
      return result + (index ? ' ' : '') + upperFirst(word);
    });

    /**
     * Checks if `string` starts with the given target string.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to inspect.
     * @param {string} [target] The string to search for.
     * @param {number} [position=0] The position to search from.
     * @returns {boolean} Returns `true` if `string` starts with `target`,
     *  else `false`.
     * @example
     *
     * _.startsWith('abc', 'a');
     * // => true
     *
     * _.startsWith('abc', 'b');
     * // => false
     *
     * _.startsWith('abc', 'b', 1);
     * // => true
     */
    function startsWith(string, target, position) {
      string = toString(string);
      position = position == null
        ? 0
        : baseClamp(toInteger(position), 0, string.length);

      target = baseToString(target);
      return string.slice(position, position + target.length) == target;
    }

    /**
     * Creates a compiled template function that can interpolate data properties
     * in "interpolate" delimiters, HTML-escape interpolated data properties in
     * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
     * properties may be accessed as free variables in the template. If a setting
     * object is given, it takes precedence over `_.templateSettings` values.
     *
     * **Note:** In the development build `_.template` utilizes
     * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
     * for easier debugging.
     *
     * For more information on precompiling templates see
     * [lodash's custom builds documentation](https://lodash.com/custom-builds).
     *
     * For more information on Chrome extension sandboxes see
     * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category String
     * @param {string} [string=''] The template string.
     * @param {Object} [options={}] The options object.
     * @param {RegExp} [options.escape=_.templateSettings.escape]
     *  The HTML "escape" delimiter.
     * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
     *  The "evaluate" delimiter.
     * @param {Object} [options.imports=_.templateSettings.imports]
     *  An object to import into the template as free variables.
     * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
     *  The "interpolate" delimiter.
     * @param {string} [options.sourceURL='lodash.templateSources[n]']
     *  The sourceURL of the compiled template.
     * @param {string} [options.variable='obj']
     *  The data object variable name.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Function} Returns the compiled template function.
     * @example
     *
     * // Use the "interpolate" delimiter to create a compiled template.
     * var compiled = _.template('hello <%= user %>!');
     * compiled({ 'user': 'fred' });
     * // => 'hello fred!'
     *
     * // Use the HTML "escape" delimiter to escape data property values.
     * var compiled = _.template('<b><%- value %></b>');
     * compiled({ 'value': '<script>' });
     * // => '<b>&lt;script&gt;</b>'
     *
     * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
     * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
     * compiled({ 'users': ['fred', 'barney'] });
     * // => '<li>fred</li><li>barney</li>'
     *
     * // Use the internal `print` function in "evaluate" delimiters.
     * var compiled = _.template('<% print("hello " + user); %>!');
     * compiled({ 'user': 'barney' });
     * // => 'hello barney!'
     *
     * // Use the ES template literal delimiter as an "interpolate" delimiter.
     * // Disable support by replacing the "interpolate" delimiter.
     * var compiled = _.template('hello ${ user }!');
     * compiled({ 'user': 'pebbles' });
     * // => 'hello pebbles!'
     *
     * // Use backslashes to treat delimiters as plain text.
     * var compiled = _.template('<%= "\\<%- value %\\>" %>');
     * compiled({ 'value': 'ignored' });
     * // => '<%- value %>'
     *
     * // Use the `imports` option to import `jQuery` as `jq`.
     * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
     * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
     * compiled({ 'users': ['fred', 'barney'] });
     * // => '<li>fred</li><li>barney</li>'
     *
     * // Use the `sourceURL` option to specify a custom sourceURL for the template.
     * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
     * compiled(data);
     * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
     *
     * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
     * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
     * compiled.source;
     * // => function(data) {
     * //   var __t, __p = '';
     * //   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
     * //   return __p;
     * // }
     *
     * // Use custom template delimiters.
     * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
     * var compiled = _.template('hello {{ user }}!');
     * compiled({ 'user': 'mustache' });
     * // => 'hello mustache!'
     *
     * // Use the `source` property to inline compiled templates for meaningful
     * // line numbers in error messages and stack traces.
     * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
     *   var JST = {\
     *     "main": ' + _.template(mainText).source + '\
     *   };\
     * ');
     */
    function template(string, options, guard) {
      // Based on John Resig's `tmpl` implementation
      // (http://ejohn.org/blog/javascript-micro-templating/)
      // and Laura Doktorova's doT.js (https://github.com/olado/doT).
      var settings = lodash.templateSettings;

      if (guard && isIterateeCall(string, options, guard)) {
        options = undefined;
      }
      string = toString(string);
      options = assignInWith({}, options, settings, customDefaultsAssignIn);

      var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
          importsKeys = keys(imports),
          importsValues = baseValues(imports, importsKeys);

      var isEscaping,
          isEvaluating,
          index = 0,
          interpolate = options.interpolate || reNoMatch,
          source = "__p += '";

      // Compile the regexp to match each delimiter.
      var reDelimiters = RegExp(
        (options.escape || reNoMatch).source + '|' +
        interpolate.source + '|' +
        (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
        (options.evaluate || reNoMatch).source + '|$'
      , 'g');

      // Use a sourceURL for easier debugging.
      // The sourceURL gets injected into the source that's eval-ed, so be careful
      // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
      // and escape the comment, thus injecting code that gets evaled.
      var sourceURL = '//# sourceURL=' +
        (hasOwnProperty.call(options, 'sourceURL')
          ? (options.sourceURL + '').replace(/\s/g, ' ')
          : ('lodash.templateSources[' + (++templateCounter) + ']')
        ) + '\n';

      string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
        interpolateValue || (interpolateValue = esTemplateValue);

        // Escape characters that can't be included in string literals.
        source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);

        // Replace delimiters with snippets.
        if (escapeValue) {
          isEscaping = true;
          source += "' +\n__e(" + escapeValue + ") +\n'";
        }
        if (evaluateValue) {
          isEvaluating = true;
          source += "';\n" + evaluateValue + ";\n__p += '";
        }
        if (interpolateValue) {
          source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
        }
        index = offset + match.length;

        // The JS engine embedded in Adobe products needs `match` returned in
        // order to produce the correct `offset` value.
        return match;
      });

      source += "';\n";

      // If `variable` is not specified wrap a with-statement around the generated
      // code to add the data object to the top of the scope chain.
      var variable = hasOwnProperty.call(options, 'variable') && options.variable;
      if (!variable) {
        source = 'with (obj) {\n' + source + '\n}\n';
      }
      // Throw an error if a forbidden character was found in `variable`, to prevent
      // potential command injection attacks.
      else if (reForbiddenIdentifierChars.test(variable)) {
        throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
      }

      // Cleanup code by stripping empty strings.
      source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
        .replace(reEmptyStringMiddle, '$1')
        .replace(reEmptyStringTrailing, '$1;');

      // Frame code as the function body.
      source = 'function(' + (variable || 'obj') + ') {\n' +
        (variable
          ? ''
          : 'obj || (obj = {});\n'
        ) +
        "var __t, __p = ''" +
        (isEscaping
           ? ', __e = _.escape'
           : ''
        ) +
        (isEvaluating
          ? ', __j = Array.prototype.join;\n' +
            "function print() { __p += __j.call(arguments, '') }\n"
          : ';\n'
        ) +
        source +
        'return __p\n}';

      var result = attempt(function() {
        return Function(importsKeys, sourceURL + 'return ' + source)
          .apply(undefined, importsValues);
      });

      // Provide the compiled function's source by its `toString` method or
      // the `source` property as a convenience for inlining compiled templates.
      result.source = source;
      if (isError(result)) {
        throw result;
      }
      return result;
    }

    /**
     * Converts `string`, as a whole, to lower case just like
     * [String#toLowerCase](https://mdn.io/toLowerCase).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the lower cased string.
     * @example
     *
     * _.toLower('--Foo-Bar--');
     * // => '--foo-bar--'
     *
     * _.toLower('fooBar');
     * // => 'foobar'
     *
     * _.toLower('__FOO_BAR__');
     * // => '__foo_bar__'
     */
    function toLower(value) {
      return toString(value).toLowerCase();
    }

    /**
     * Converts `string`, as a whole, to upper case just like
     * [String#toUpperCase](https://mdn.io/toUpperCase).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the upper cased string.
     * @example
     *
     * _.toUpper('--foo-bar--');
     * // => '--FOO-BAR--'
     *
     * _.toUpper('fooBar');
     * // => 'FOOBAR'
     *
     * _.toUpper('__foo_bar__');
     * // => '__FOO_BAR__'
     */
    function toUpper(value) {
      return toString(value).toUpperCase();
    }

    /**
     * Removes leading and trailing whitespace or specified characters from `string`.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to trim.
     * @param {string} [chars=whitespace] The characters to trim.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {string} Returns the trimmed string.
     * @example
     *
     * _.trim('  abc  ');
     * // => 'abc'
     *
     * _.trim('-_-abc-_-', '_-');
     * // => 'abc'
     *
     * _.map(['  foo  ', '  bar  '], _.trim);
     * // => ['foo', 'bar']
     */
    function trim(string, chars, guard) {
      string = toString(string);
      if (string && (guard || chars === undefined)) {
        return baseTrim(string);
      }
      if (!string || !(chars = baseToString(chars))) {
        return string;
      }
      var strSymbols = stringToArray(string),
          chrSymbols = stringToArray(chars),
          start = charsStartIndex(strSymbols, chrSymbols),
          end = charsEndIndex(strSymbols, chrSymbols) + 1;

      return castSlice(strSymbols, start, end).join('');
    }

    /**
     * Removes trailing whitespace or specified characters from `string`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to trim.
     * @param {string} [chars=whitespace] The characters to trim.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {string} Returns the trimmed string.
     * @example
     *
     * _.trimEnd('  abc  ');
     * // => '  abc'
     *
     * _.trimEnd('-_-abc-_-', '_-');
     * // => '-_-abc'
     */
    function trimEnd(string, chars, guard) {
      string = toString(string);
      if (string && (guard || chars === undefined)) {
        return string.slice(0, trimmedEndIndex(string) + 1);
      }
      if (!string || !(chars = baseToString(chars))) {
        return string;
      }
      var strSymbols = stringToArray(string),
          end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;

      return castSlice(strSymbols, 0, end).join('');
    }

    /**
     * Removes leading whitespace or specified characters from `string`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to trim.
     * @param {string} [chars=whitespace] The characters to trim.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {string} Returns the trimmed string.
     * @example
     *
     * _.trimStart('  abc  ');
     * // => 'abc  '
     *
     * _.trimStart('-_-abc-_-', '_-');
     * // => 'abc-_-'
     */
    function trimStart(string, chars, guard) {
      string = toString(string);
      if (string && (guard || chars === undefined)) {
        return string.replace(reTrimStart, '');
      }
      if (!string || !(chars = baseToString(chars))) {
        return string;
      }
      var strSymbols = stringToArray(string),
          start = charsStartIndex(strSymbols, stringToArray(chars));

      return castSlice(strSymbols, start).join('');
    }

    /**
     * Truncates `string` if it's longer than the given maximum string length.
     * The last characters of the truncated string are replaced with the omission
     * string which defaults to "...".
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to truncate.
     * @param {Object} [options={}] The options object.
     * @param {number} [options.length=30] The maximum string length.
     * @param {string} [options.omission='...'] The string to indicate text is omitted.
     * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
     * @returns {string} Returns the truncated string.
     * @example
     *
     * _.truncate('hi-diddly-ho there, neighborino');
     * // => 'hi-diddly-ho there, neighbo...'
     *
     * _.truncate('hi-diddly-ho there, neighborino', {
     *   'length': 24,
     *   'separator': ' '
     * });
     * // => 'hi-diddly-ho there,...'
     *
     * _.truncate('hi-diddly-ho there, neighborino', {
     *   'length': 24,
     *   'separator': /,? +/
     * });
     * // => 'hi-diddly-ho there...'
     *
     * _.truncate('hi-diddly-ho there, neighborino', {
     *   'omission': ' [...]'
     * });
     * // => 'hi-diddly-ho there, neig [...]'
     */
    function truncate(string, options) {
      var length = DEFAULT_TRUNC_LENGTH,
          omission = DEFAULT_TRUNC_OMISSION;

      if (isObject(options)) {
        var separator = 'separator' in options ? options.separator : separator;
        length = 'length' in options ? toInteger(options.length) : length;
        omission = 'omission' in options ? baseToString(options.omission) : omission;
      }
      string = toString(string);

      var strLength = string.length;
      if (hasUnicode(string)) {
        var strSymbols = stringToArray(string);
        strLength = strSymbols.length;
      }
      if (length >= strLength) {
        return string;
      }
      var end = length - stringSize(omission);
      if (end < 1) {
        return omission;
      }
      var result = strSymbols
        ? castSlice(strSymbols, 0, end).join('')
        : string.slice(0, end);

      if (separator === undefined) {
        return result + omission;
      }
      if (strSymbols) {
        end += (result.length - end);
      }
      if (isRegExp(separator)) {
        if (string.slice(end).search(separator)) {
          var match,
              substring = result;

          if (!separator.global) {
            separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
          }
          separator.lastIndex = 0;
          while ((match = separator.exec(substring))) {
            var newEnd = match.index;
          }
          result = result.slice(0, newEnd === undefined ? end : newEnd);
        }
      } else if (string.indexOf(baseToString(separator), end) != end) {
        var index = result.lastIndexOf(separator);
        if (index > -1) {
          result = result.slice(0, index);
        }
      }
      return result + omission;
    }

    /**
     * The inverse of `_.escape`; this method converts the HTML entities
     * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
     * their corresponding characters.
     *
     * **Note:** No other HTML entities are unescaped. To unescape additional
     * HTML entities use a third-party library like [_he_](https://mths.be/he).
     *
     * @static
     * @memberOf _
     * @since 0.6.0
     * @category String
     * @param {string} [string=''] The string to unescape.
     * @returns {string} Returns the unescaped string.
     * @example
     *
     * _.unescape('fred, barney, &amp; pebbles');
     * // => 'fred, barney, & pebbles'
     */
    function unescape(string) {
      string = toString(string);
      return (string && reHasEscapedHtml.test(string))
        ? string.replace(reEscapedHtml, unescapeHtmlChar)
        : string;
    }

    /**
     * Converts `string`, as space separated words, to upper case.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the upper cased string.
     * @example
     *
     * _.upperCase('--foo-bar');
     * // => 'FOO BAR'
     *
     * _.upperCase('fooBar');
     * // => 'FOO BAR'
     *
     * _.upperCase('__foo_bar__');
     * // => 'FOO BAR'
     */
    var upperCase = createCompounder(function(result, word, index) {
      return result + (index ? ' ' : '') + word.toUpperCase();
    });

    /**
     * Converts the first character of `string` to upper case.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the converted string.
     * @example
     *
     * _.upperFirst('fred');
     * // => 'Fred'
     *
     * _.upperFirst('FRED');
     * // => 'FRED'
     */
    var upperFirst = createCaseFirst('toUpperCase');

    /**
     * Splits `string` into an array of its words.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category String
     * @param {string} [string=''] The string to inspect.
     * @param {RegExp|string} [pattern] The pattern to match words.
     * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
     * @returns {Array} Returns the words of `string`.
     * @example
     *
     * _.words('fred, barney, & pebbles');
     * // => ['fred', 'barney', 'pebbles']
     *
     * _.words('fred, barney, & pebbles', /[^, ]+/g);
     * // => ['fred', 'barney', '&', 'pebbles']
     */
    function words(string, pattern, guard) {
      string = toString(string);
      pattern = guard ? undefined : pattern;

      if (pattern === undefined) {
        return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
      }
      return string.match(pattern) || [];
    }

    /*------------------------------------------------------------------------*/

    /**
     * Attempts to invoke `func`, returning either the result or the caught error
     * object. Any additional arguments are provided to `func` when it's invoked.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Util
     * @param {Function} func The function to attempt.
     * @param {...*} [args] The arguments to invoke `func` with.
     * @returns {*} Returns the `func` result or error object.
     * @example
     *
     * // Avoid throwing errors for invalid selectors.
     * var elements = _.attempt(function(selector) {
     *   return document.querySelectorAll(selector);
     * }, '>_>');
     *
     * if (_.isError(elements)) {
     *   elements = [];
     * }
     */
    var attempt = baseRest(function(func, args) {
      try {
        return apply(func, undefined, args);
      } catch (e) {
        return isError(e) ? e : new Error(e);
      }
    });

    /**
     * Binds methods of an object to the object itself, overwriting the existing
     * method.
     *
     * **Note:** This method doesn't set the "length" property of bound functions.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Util
     * @param {Object} object The object to bind and assign the bound methods to.
     * @param {...(string|string[])} methodNames The object method names to bind.
     * @returns {Object} Returns `object`.
     * @example
     *
     * var view = {
     *   'label': 'docs',
     *   'click': function() {
     *     console.log('clicked ' + this.label);
     *   }
     * };
     *
     * _.bindAll(view, ['click']);
     * jQuery(element).on('click', view.click);
     * // => Logs 'clicked docs' when clicked.
     */
    var bindAll = flatRest(function(object, methodNames) {
      arrayEach(methodNames, function(key) {
        key = toKey(key);
        baseAssignValue(object, key, bind(object[key], object));
      });
      return object;
    });

    /**
     * Creates a function that iterates over `pairs` and invokes the corresponding
     * function of the first predicate to return truthy. The predicate-function
     * pairs are invoked with the `this` binding and arguments of the created
     * function.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Util
     * @param {Array} pairs The predicate-function pairs.
     * @returns {Function} Returns the new composite function.
     * @example
     *
     * var func = _.cond([
     *   [_.matches({ 'a': 1 }),           _.constant('matches A')],
     *   [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
     *   [_.stubTrue,                      _.constant('no match')]
     * ]);
     *
     * func({ 'a': 1, 'b': 2 });
     * // => 'matches A'
     *
     * func({ 'a': 0, 'b': 1 });
     * // => 'matches B'
     *
     * func({ 'a': '1', 'b': '2' });
     * // => 'no match'
     */
    function cond(pairs) {
      var length = pairs == null ? 0 : pairs.length,
          toIteratee = getIteratee();

      pairs = !length ? [] : arrayMap(pairs, function(pair) {
        if (typeof pair[1] != 'function') {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
        return [toIteratee(pair[0]), pair[1]];
      });

      return baseRest(function(args) {
        var index = -1;
        while (++index < length) {
          var pair = pairs[index];
          if (apply(pair[0], this, args)) {
            return apply(pair[1], this, args);
          }
        }
      });
    }

    /**
     * Creates a function that invokes the predicate properties of `source` with
     * the corresponding property values of a given object, returning `true` if
     * all predicates return truthy, else `false`.
     *
     * **Note:** The created function is equivalent to `_.conformsTo` with
     * `source` partially applied.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Util
     * @param {Object} source The object of property predicates to conform to.
     * @returns {Function} Returns the new spec function.
     * @example
     *
     * var objects = [
     *   { 'a': 2, 'b': 1 },
     *   { 'a': 1, 'b': 2 }
     * ];
     *
     * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
     * // => [{ 'a': 1, 'b': 2 }]
     */
    function conforms(source) {
      return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
    }

    /**
     * Creates a function that returns `value`.
     *
     * @static
     * @memberOf _
     * @since 2.4.0
     * @category Util
     * @param {*} value The value to return from the new function.
     * @returns {Function} Returns the new constant function.
     * @example
     *
     * var objects = _.times(2, _.constant({ 'a': 1 }));
     *
     * console.log(objects);
     * // => [{ 'a': 1 }, { 'a': 1 }]
     *
     * console.log(objects[0] === objects[1]);
     * // => true
     */
    function constant(value) {
      return function() {
        return value;
      };
    }

    /**
     * Checks `value` to determine whether a default value should be returned in
     * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
     * or `undefined`.
     *
     * @static
     * @memberOf _
     * @since 4.14.0
     * @category Util
     * @param {*} value The value to check.
     * @param {*} defaultValue The default value.
     * @returns {*} Returns the resolved value.
     * @example
     *
     * _.defaultTo(1, 10);
     * // => 1
     *
     * _.defaultTo(undefined, 10);
     * // => 10
     */
    function defaultTo(value, defaultValue) {
      return (value == null || value !== value) ? defaultValue : value;
    }

    /**
     * Creates a function that returns the result of invoking the given functions
     * with the `this` binding of the created function, where each successive
     * invocation is supplied the return value of the previous.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Util
     * @param {...(Function|Function[])} [funcs] The functions to invoke.
     * @returns {Function} Returns the new composite function.
     * @see _.flowRight
     * @example
     *
     * function square(n) {
     *   return n * n;
     * }
     *
     * var addSquare = _.flow([_.add, square]);
     * addSquare(1, 2);
     * // => 9
     */
    var flow = createFlow();

    /**
     * This method is like `_.flow` except that it creates a function that
     * invokes the given functions from right to left.
     *
     * @static
     * @since 3.0.0
     * @memberOf _
     * @category Util
     * @param {...(Function|Function[])} [funcs] The functions to invoke.
     * @returns {Function} Returns the new composite function.
     * @see _.flow
     * @example
     *
     * function square(n) {
     *   return n * n;
     * }
     *
     * var addSquare = _.flowRight([square, _.add]);
     * addSquare(1, 2);
     * // => 9
     */
    var flowRight = createFlow(true);

    /**
     * This method returns the first argument it receives.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Util
     * @param {*} value Any value.
     * @returns {*} Returns `value`.
     * @example
     *
     * var object = { 'a': 1 };
     *
     * console.log(_.identity(object) === object);
     * // => true
     */
    function identity(value) {
      return value;
    }

    /**
     * Creates a function that invokes `func` with the arguments of the created
     * function. If `func` is a property name, the created function returns the
     * property value for a given element. If `func` is an array or object, the
     * created function returns `true` for elements that contain the equivalent
     * source properties, otherwise it returns `false`.
     *
     * @static
     * @since 4.0.0
     * @memberOf _
     * @category Util
     * @param {*} [func=_.identity] The value to convert to a callback.
     * @returns {Function} Returns the callback.
     * @example
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36, 'active': true },
     *   { 'user': 'fred',   'age': 40, 'active': false }
     * ];
     *
     * // The `_.matches` iteratee shorthand.
     * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
     * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
     *
     * // The `_.matchesProperty` iteratee shorthand.
     * _.filter(users, _.iteratee(['user', 'fred']));
     * // => [{ 'user': 'fred', 'age': 40 }]
     *
     * // The `_.property` iteratee shorthand.
     * _.map(users, _.iteratee('user'));
     * // => ['barney', 'fred']
     *
     * // Create custom iteratee shorthands.
     * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
     *   return !_.isRegExp(func) ? iteratee(func) : function(string) {
     *     return func.test(string);
     *   };
     * });
     *
     * _.filter(['abc', 'def'], /ef/);
     * // => ['def']
     */
    function iteratee(func) {
      return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
    }

    /**
     * Creates a function that performs a partial deep comparison between a given
     * object and `source`, returning `true` if the given object has equivalent
     * property values, else `false`.
     *
     * **Note:** The created function is equivalent to `_.isMatch` with `source`
     * partially applied.
     *
     * Partial comparisons will match empty array and empty object `source`
     * values against any array or object value, respectively. See `_.isEqual`
     * for a list of supported value comparisons.
     *
     * **Note:** Multiple values can be checked by combining several matchers
     * using `_.overSome`
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Util
     * @param {Object} source The object of property values to match.
     * @returns {Function} Returns the new spec function.
     * @example
     *
     * var objects = [
     *   { 'a': 1, 'b': 2, 'c': 3 },
     *   { 'a': 4, 'b': 5, 'c': 6 }
     * ];
     *
     * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
     * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
     *
     * // Checking for several possible values
     * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
     * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
     */
    function matches(source) {
      return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
    }

    /**
     * Creates a function that performs a partial deep comparison between the
     * value at `path` of a given object to `srcValue`, returning `true` if the
     * object value is equivalent, else `false`.
     *
     * **Note:** Partial comparisons will match empty array and empty object
     * `srcValue` values against any array or object value, respectively. See
     * `_.isEqual` for a list of supported value comparisons.
     *
     * **Note:** Multiple values can be checked by combining several matchers
     * using `_.overSome`
     *
     * @static
     * @memberOf _
     * @since 3.2.0
     * @category Util
     * @param {Array|string} path The path of the property to get.
     * @param {*} srcValue The value to match.
     * @returns {Function} Returns the new spec function.
     * @example
     *
     * var objects = [
     *   { 'a': 1, 'b': 2, 'c': 3 },
     *   { 'a': 4, 'b': 5, 'c': 6 }
     * ];
     *
     * _.find(objects, _.matchesProperty('a', 4));
     * // => { 'a': 4, 'b': 5, 'c': 6 }
     *
     * // Checking for several possible values
     * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
     * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
     */
    function matchesProperty(path, srcValue) {
      return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
    }

    /**
     * Creates a function that invokes the method at `path` of a given object.
     * Any additional arguments are provided to the invoked method.
     *
     * @static
     * @memberOf _
     * @since 3.7.0
     * @category Util
     * @param {Array|string} path The path of the method to invoke.
     * @param {...*} [args] The arguments to invoke the method with.
     * @returns {Function} Returns the new invoker function.
     * @example
     *
     * var objects = [
     *   { 'a': { 'b': _.constant(2) } },
     *   { 'a': { 'b': _.constant(1) } }
     * ];
     *
     * _.map(objects, _.method('a.b'));
     * // => [2, 1]
     *
     * _.map(objects, _.method(['a', 'b']));
     * // => [2, 1]
     */
    var method = baseRest(function(path, args) {
      return function(object) {
        return baseInvoke(object, path, args);
      };
    });

    /**
     * The opposite of `_.method`; this method creates a function that invokes
     * the method at a given path of `object`. Any additional arguments are
     * provided to the invoked method.
     *
     * @static
     * @memberOf _
     * @since 3.7.0
     * @category Util
     * @param {Object} object The object to query.
     * @param {...*} [args] The arguments to invoke the method with.
     * @returns {Function} Returns the new invoker function.
     * @example
     *
     * var array = _.times(3, _.constant),
     *     object = { 'a': array, 'b': array, 'c': array };
     *
     * _.map(['a[2]', 'c[0]'], _.methodOf(object));
     * // => [2, 0]
     *
     * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
     * // => [2, 0]
     */
    var methodOf = baseRest(function(object, args) {
      return function(path) {
        return baseInvoke(object, path, args);
      };
    });

    /**
     * Adds all own enumerable string keyed function properties of a source
     * object to the destination object. If `object` is a function, then methods
     * are added to its prototype as well.
     *
     * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
     * avoid conflicts caused by modifying the original.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Util
     * @param {Function|Object} [object=lodash] The destination object.
     * @param {Object} source The object of functions to add.
     * @param {Object} [options={}] The options object.
     * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
     * @returns {Function|Object} Returns `object`.
     * @example
     *
     * function vowels(string) {
     *   return _.filter(string, function(v) {
     *     return /[aeiou]/i.test(v);
     *   });
     * }
     *
     * _.mixin({ 'vowels': vowels });
     * _.vowels('fred');
     * // => ['e']
     *
     * _('fred').vowels().value();
     * // => ['e']
     *
     * _.mixin({ 'vowels': vowels }, { 'chain': false });
     * _('fred').vowels();
     * // => ['e']
     */
    function mixin(object, source, options) {
      var props = keys(source),
          methodNames = baseFunctions(source, props);

      if (options == null &&
          !(isObject(source) && (methodNames.length || !props.length))) {
        options = source;
        source = object;
        object = this;
        methodNames = baseFunctions(source, keys(source));
      }
      var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
          isFunc = isFunction(object);

      arrayEach(methodNames, function(methodName) {
        var func = source[methodName];
        object[methodName] = func;
        if (isFunc) {
          object.prototype[methodName] = function() {
            var chainAll = this.__chain__;
            if (chain || chainAll) {
              var result = object(this.__wrapped__),
                  actions = result.__actions__ = copyArray(this.__actions__);

              actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
              result.__chain__ = chainAll;
              return result;
            }
            return func.apply(object, arrayPush([this.value()], arguments));
          };
        }
      });

      return object;
    }

    /**
     * Reverts the `_` variable to its previous value and returns a reference to
     * the `lodash` function.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Util
     * @returns {Function} Returns the `lodash` function.
     * @example
     *
     * var lodash = _.noConflict();
     */
    function noConflict() {
      if (root._ === this) {
        root._ = oldDash;
      }
      return this;
    }

    /**
     * This method returns `undefined`.
     *
     * @static
     * @memberOf _
     * @since 2.3.0
     * @category Util
     * @example
     *
     * _.times(2, _.noop);
     * // => [undefined, undefined]
     */
    function noop() {
      // No operation performed.
    }

    /**
     * Creates a function that gets the argument at index `n`. If `n` is negative,
     * the nth argument from the end is returned.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Util
     * @param {number} [n=0] The index of the argument to return.
     * @returns {Function} Returns the new pass-thru function.
     * @example
     *
     * var func = _.nthArg(1);
     * func('a', 'b', 'c', 'd');
     * // => 'b'
     *
     * var func = _.nthArg(-2);
     * func('a', 'b', 'c', 'd');
     * // => 'c'
     */
    function nthArg(n) {
      n = toInteger(n);
      return baseRest(function(args) {
        return baseNth(args, n);
      });
    }

    /**
     * Creates a function that invokes `iteratees` with the arguments it receives
     * and returns their results.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Util
     * @param {...(Function|Function[])} [iteratees=[_.identity]]
     *  The iteratees to invoke.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var func = _.over([Math.max, Math.min]);
     *
     * func(1, 2, 3, 4);
     * // => [4, 1]
     */
    var over = createOver(arrayMap);

    /**
     * Creates a function that checks if **all** of the `predicates` return
     * truthy when invoked with the arguments it receives.
     *
     * Following shorthands are possible for providing predicates.
     * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
     * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Util
     * @param {...(Function|Function[])} [predicates=[_.identity]]
     *  The predicates to check.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var func = _.overEvery([Boolean, isFinite]);
     *
     * func('1');
     * // => true
     *
     * func(null);
     * // => false
     *
     * func(NaN);
     * // => false
     */
    var overEvery = createOver(arrayEvery);

    /**
     * Creates a function that checks if **any** of the `predicates` return
     * truthy when invoked with the arguments it receives.
     *
     * Following shorthands are possible for providing predicates.
     * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
     * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Util
     * @param {...(Function|Function[])} [predicates=[_.identity]]
     *  The predicates to check.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var func = _.overSome([Boolean, isFinite]);
     *
     * func('1');
     * // => true
     *
     * func(null);
     * // => true
     *
     * func(NaN);
     * // => false
     *
     * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
     * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
     */
    var overSome = createOver(arraySome);

    /**
     * Creates a function that returns the value at `path` of a given object.
     *
     * @static
     * @memberOf _
     * @since 2.4.0
     * @category Util
     * @param {Array|string} path The path of the property to get.
     * @returns {Function} Returns the new accessor function.
     * @example
     *
     * var objects = [
     *   { 'a': { 'b': 2 } },
     *   { 'a': { 'b': 1 } }
     * ];
     *
     * _.map(objects, _.property('a.b'));
     * // => [2, 1]
     *
     * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
     * // => [1, 2]
     */
    function property(path) {
      return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
    }

    /**
     * The opposite of `_.property`; this method creates a function that returns
     * the value at a given path of `object`.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Util
     * @param {Object} object The object to query.
     * @returns {Function} Returns the new accessor function.
     * @example
     *
     * var array = [0, 1, 2],
     *     object = { 'a': array, 'b': array, 'c': array };
     *
     * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
     * // => [2, 0]
     *
     * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
     * // => [2, 0]
     */
    function propertyOf(object) {
      return function(path) {
        return object == null ? undefined : baseGet(object, path);
      };
    }

    /**
     * Creates an array of numbers (positive and/or negative) progressing from
     * `start` up to, but not including, `end`. A step of `-1` is used if a negative
     * `start` is specified without an `end` or `step`. If `end` is not specified,
     * it's set to `start` with `start` then set to `0`.
     *
     * **Note:** JavaScript follows the IEEE-754 standard for resolving
     * floating-point values which can produce unexpected results.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Util
     * @param {number} [start=0] The start of the range.
     * @param {number} end The end of the range.
     * @param {number} [step=1] The value to increment or decrement by.
     * @returns {Array} Returns the range of numbers.
     * @see _.inRange, _.rangeRight
     * @example
     *
     * _.range(4);
     * // => [0, 1, 2, 3]
     *
     * _.range(-4);
     * // => [0, -1, -2, -3]
     *
     * _.range(1, 5);
     * // => [1, 2, 3, 4]
     *
     * _.range(0, 20, 5);
     * // => [0, 5, 10, 15]
     *
     * _.range(0, -4, -1);
     * // => [0, -1, -2, -3]
     *
     * _.range(1, 4, 0);
     * // => [1, 1, 1]
     *
     * _.range(0);
     * // => []
     */
    var range = createRange();

    /**
     * This method is like `_.range` except that it populates values in
     * descending order.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Util
     * @param {number} [start=0] The start of the range.
     * @param {number} end The end of the range.
     * @param {number} [step=1] The value to increment or decrement by.
     * @returns {Array} Returns the range of numbers.
     * @see _.inRange, _.range
     * @example
     *
     * _.rangeRight(4);
     * // => [3, 2, 1, 0]
     *
     * _.rangeRight(-4);
     * // => [-3, -2, -1, 0]
     *
     * _.rangeRight(1, 5);
     * // => [4, 3, 2, 1]
     *
     * _.rangeRight(0, 20, 5);
     * // => [15, 10, 5, 0]
     *
     * _.rangeRight(0, -4, -1);
     * // => [-3, -2, -1, 0]
     *
     * _.rangeRight(1, 4, 0);
     * // => [1, 1, 1]
     *
     * _.rangeRight(0);
     * // => []
     */
    var rangeRight = createRange(true);

    /**
     * This method returns a new empty array.
     *
     * @static
     * @memberOf _
     * @since 4.13.0
     * @category Util
     * @returns {Array} Returns the new empty array.
     * @example
     *
     * var arrays = _.times(2, _.stubArray);
     *
     * console.log(arrays);
     * // => [[], []]
     *
     * console.log(arrays[0] === arrays[1]);
     * // => false
     */
    function stubArray() {
      return [];
    }

    /**
     * This method returns `false`.
     *
     * @static
     * @memberOf _
     * @since 4.13.0
     * @category Util
     * @returns {boolean} Returns `false`.
     * @example
     *
     * _.times(2, _.stubFalse);
     * // => [false, false]
     */
    function stubFalse() {
      return false;
    }

    /**
     * This method returns a new empty object.
     *
     * @static
     * @memberOf _
     * @since 4.13.0
     * @category Util
     * @returns {Object} Returns the new empty object.
     * @example
     *
     * var objects = _.times(2, _.stubObject);
     *
     * console.log(objects);
     * // => [{}, {}]
     *
     * console.log(objects[0] === objects[1]);
     * // => false
     */
    function stubObject() {
      return {};
    }

    /**
     * This method returns an empty string.
     *
     * @static
     * @memberOf _
     * @since 4.13.0
     * @category Util
     * @returns {string} Returns the empty string.
     * @example
     *
     * _.times(2, _.stubString);
     * // => ['', '']
     */
    function stubString() {
      return '';
    }

    /**
     * This method returns `true`.
     *
     * @static
     * @memberOf _
     * @since 4.13.0
     * @category Util
     * @returns {boolean} Returns `true`.
     * @example
     *
     * _.times(2, _.stubTrue);
     * // => [true, true]
     */
    function stubTrue() {
      return true;
    }

    /**
     * Invokes the iteratee `n` times, returning an array of the results of
     * each invocation. The iteratee is invoked with one argument; (index).
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Util
     * @param {number} n The number of times to invoke `iteratee`.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @returns {Array} Returns the array of results.
     * @example
     *
     * _.times(3, String);
     * // => ['0', '1', '2']
     *
     *  _.times(4, _.constant(0));
     * // => [0, 0, 0, 0]
     */
    function times(n, iteratee) {
      n = toInteger(n);
      if (n < 1 || n > MAX_SAFE_INTEGER) {
        return [];
      }
      var index = MAX_ARRAY_LENGTH,
          length = nativeMin(n, MAX_ARRAY_LENGTH);

      iteratee = getIteratee(iteratee);
      n -= MAX_ARRAY_LENGTH;

      var result = baseTimes(length, iteratee);
      while (++index < n) {
        iteratee(index);
      }
      return result;
    }

    /**
     * Converts `value` to a property path array.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Util
     * @param {*} value The value to convert.
     * @returns {Array} Returns the new property path array.
     * @example
     *
     * _.toPath('a.b.c');
     * // => ['a', 'b', 'c']
     *
     * _.toPath('a[0].b.c');
     * // => ['a', '0', 'b', 'c']
     */
    function toPath(value) {
      if (isArray(value)) {
        return arrayMap(value, toKey);
      }
      return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
    }

    /**
     * Generates a unique ID. If `prefix` is given, the ID is appended to it.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Util
     * @param {string} [prefix=''] The value to prefix the ID with.
     * @returns {string} Returns the unique ID.
     * @example
     *
     * _.uniqueId('contact_');
     * // => 'contact_104'
     *
     * _.uniqueId();
     * // => '105'
     */
    function uniqueId(prefix) {
      var id = ++idCounter;
      return toString(prefix) + id;
    }

    /*------------------------------------------------------------------------*/

    /**
     * Adds two numbers.
     *
     * @static
     * @memberOf _
     * @since 3.4.0
     * @category Math
     * @param {number} augend The first number in an addition.
     * @param {number} addend The second number in an addition.
     * @returns {number} Returns the total.
     * @example
     *
     * _.add(6, 4);
     * // => 10
     */
    var add = createMathOperation(function(augend, addend) {
      return augend + addend;
    }, 0);

    /**
     * Computes `number` rounded up to `precision`.
     *
     * @static
     * @memberOf _
     * @since 3.10.0
     * @category Math
     * @param {number} number The number to round up.
     * @param {number} [precision=0] The precision to round up to.
     * @returns {number} Returns the rounded up number.
     * @example
     *
     * _.ceil(4.006);
     * // => 5
     *
     * _.ceil(6.004, 2);
     * // => 6.01
     *
     * _.ceil(6040, -2);
     * // => 6100
     */
    var ceil = createRound('ceil');

    /**
     * Divide two numbers.
     *
     * @static
     * @memberOf _
     * @since 4.7.0
     * @category Math
     * @param {number} dividend The first number in a division.
     * @param {number} divisor The second number in a division.
     * @returns {number} Returns the quotient.
     * @example
     *
     * _.divide(6, 4);
     * // => 1.5
     */
    var divide = createMathOperation(function(dividend, divisor) {
      return dividend / divisor;
    }, 1);

    /**
     * Computes `number` rounded down to `precision`.
     *
     * @static
     * @memberOf _
     * @since 3.10.0
     * @category Math
     * @param {number} number The number to round down.
     * @param {number} [precision=0] The precision to round down to.
     * @returns {number} Returns the rounded down number.
     * @example
     *
     * _.floor(4.006);
     * // => 4
     *
     * _.floor(0.046, 2);
     * // => 0.04
     *
     * _.floor(4060, -2);
     * // => 4000
     */
    var floor = createRound('floor');

    /**
     * Computes the maximum value of `array`. If `array` is empty or falsey,
     * `undefined` is returned.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Math
     * @param {Array} array The array to iterate over.
     * @returns {*} Returns the maximum value.
     * @example
     *
     * _.max([4, 2, 8, 6]);
     * // => 8
     *
     * _.max([]);
     * // => undefined
     */
    function max(array) {
      return (array && array.length)
        ? baseExtremum(array, identity, baseGt)
        : undefined;
    }

    /**
     * This method is like `_.max` except that it accepts `iteratee` which is
     * invoked for each element in `array` to generate the criterion by which
     * the value is ranked. The iteratee is invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Math
     * @param {Array} array The array to iterate over.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {*} Returns the maximum value.
     * @example
     *
     * var objects = [{ 'n': 1 }, { 'n': 2 }];
     *
     * _.maxBy(objects, function(o) { return o.n; });
     * // => { 'n': 2 }
     *
     * // The `_.property` iteratee shorthand.
     * _.maxBy(objects, 'n');
     * // => { 'n': 2 }
     */
    function maxBy(array, iteratee) {
      return (array && array.length)
        ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
        : undefined;
    }

    /**
     * Computes the mean of the values in `array`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Math
     * @param {Array} array The array to iterate over.
     * @returns {number} Returns the mean.
     * @example
     *
     * _.mean([4, 2, 8, 6]);
     * // => 5
     */
    function mean(array) {
      return baseMean(array, identity);
    }

    /**
     * This method is like `_.mean` except that it accepts `iteratee` which is
     * invoked for each element in `array` to generate the value to be averaged.
     * The iteratee is invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 4.7.0
     * @category Math
     * @param {Array} array The array to iterate over.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {number} Returns the mean.
     * @example
     *
     * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
     *
     * _.meanBy(objects, function(o) { return o.n; });
     * // => 5
     *
     * // The `_.property` iteratee shorthand.
     * _.meanBy(objects, 'n');
     * // => 5
     */
    function meanBy(array, iteratee) {
      return baseMean(array, getIteratee(iteratee, 2));
    }

    /**
     * Computes the minimum value of `array`. If `array` is empty or falsey,
     * `undefined` is returned.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Math
     * @param {Array} array The array to iterate over.
     * @returns {*} Returns the minimum value.
     * @example
     *
     * _.min([4, 2, 8, 6]);
     * // => 2
     *
     * _.min([]);
     * // => undefined
     */
    function min(array) {
      return (array && array.length)
        ? baseExtremum(array, identity, baseLt)
        : undefined;
    }

    /**
     * This method is like `_.min` except that it accepts `iteratee` which is
     * invoked for each element in `array` to generate the criterion by which
     * the value is ranked. The iteratee is invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Math
     * @param {Array} array The array to iterate over.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {*} Returns the minimum value.
     * @example
     *
     * var objects = [{ 'n': 1 }, { 'n': 2 }];
     *
     * _.minBy(objects, function(o) { return o.n; });
     * // => { 'n': 1 }
     *
     * // The `_.property` iteratee shorthand.
     * _.minBy(objects, 'n');
     * // => { 'n': 1 }
     */
    function minBy(array, iteratee) {
      return (array && array.length)
        ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
        : undefined;
    }

    /**
     * Multiply two numbers.
     *
     * @static
     * @memberOf _
     * @since 4.7.0
     * @category Math
     * @param {number} multiplier The first number in a multiplication.
     * @param {number} multiplicand The second number in a multiplication.
     * @returns {number} Returns the product.
     * @example
     *
     * _.multiply(6, 4);
     * // => 24
     */
    var multiply = createMathOperation(function(multiplier, multiplicand) {
      return multiplier * multiplicand;
    }, 1);

    /**
     * Computes `number` rounded to `precision`.
     *
     * @static
     * @memberOf _
     * @since 3.10.0
     * @category Math
     * @param {number} number The number to round.
     * @param {number} [precision=0] The precision to round to.
     * @returns {number} Returns the rounded number.
     * @example
     *
     * _.round(4.006);
     * // => 4
     *
     * _.round(4.006, 2);
     * // => 4.01
     *
     * _.round(4060, -2);
     * // => 4100
     */
    var round = createRound('round');

    /**
     * Subtract two numbers.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Math
     * @param {number} minuend The first number in a subtraction.
     * @param {number} subtrahend The second number in a subtraction.
     * @returns {number} Returns the difference.
     * @example
     *
     * _.subtract(6, 4);
     * // => 2
     */
    var subtract = createMathOperation(function(minuend, subtrahend) {
      return minuend - subtrahend;
    }, 0);

    /**
     * Computes the sum of the values in `array`.
     *
     * @static
     * @memberOf _
     * @since 3.4.0
     * @category Math
     * @param {Array} array The array to iterate over.
     * @returns {number} Returns the sum.
     * @example
     *
     * _.sum([4, 2, 8, 6]);
     * // => 20
     */
    function sum(array) {
      return (array && array.length)
        ? baseSum(array, identity)
        : 0;
    }

    /**
     * This method is like `_.sum` except that it accepts `iteratee` which is
     * invoked for each element in `array` to generate the value to be summed.
     * The iteratee is invoked with one argument: (value).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Math
     * @param {Array} array The array to iterate over.
     * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
     * @returns {number} Returns the sum.
     * @example
     *
     * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
     *
     * _.sumBy(objects, function(o) { return o.n; });
     * // => 20
     *
     * // The `_.property` iteratee shorthand.
     * _.sumBy(objects, 'n');
     * // => 20
     */
    function sumBy(array, iteratee) {
      return (array && array.length)
        ? baseSum(array, getIteratee(iteratee, 2))
        : 0;
    }

    /*------------------------------------------------------------------------*/

    // Add methods that return wrapped values in chain sequences.
    lodash.after = after;
    lodash.ary = ary;
    lodash.assign = assign;
    lodash.assignIn = assignIn;
    lodash.assignInWith = assignInWith;
    lodash.assignWith = assignWith;
    lodash.at = at;
    lodash.before = before;
    lodash.bind = bind;
    lodash.bindAll = bindAll;
    lodash.bindKey = bindKey;
    lodash.castArray = castArray;
    lodash.chain = chain;
    lodash.chunk = chunk;
    lodash.compact = compact;
    lodash.concat = concat;
    lodash.cond = cond;
    lodash.conforms = conforms;
    lodash.constant = constant;
    lodash.countBy = countBy;
    lodash.create = create;
    lodash.curry = curry;
    lodash.curryRight = curryRight;
    lodash.debounce = debounce;
    lodash.defaults = defaults;
    lodash.defaultsDeep = defaultsDeep;
    lodash.defer = defer;
    lodash.delay = delay;
    lodash.difference = difference;
    lodash.differenceBy = differenceBy;
    lodash.differenceWith = differenceWith;
    lodash.drop = drop;
    lodash.dropRight = dropRight;
    lodash.dropRightWhile = dropRightWhile;
    lodash.dropWhile = dropWhile;
    lodash.fill = fill;
    lodash.filter = filter;
    lodash.flatMap = flatMap;
    lodash.flatMapDeep = flatMapDeep;
    lodash.flatMapDepth = flatMapDepth;
    lodash.flatten = flatten;
    lodash.flattenDeep = flattenDeep;
    lodash.flattenDepth = flattenDepth;
    lodash.flip = flip;
    lodash.flow = flow;
    lodash.flowRight = flowRight;
    lodash.fromPairs = fromPairs;
    lodash.functions = functions;
    lodash.functionsIn = functionsIn;
    lodash.groupBy = groupBy;
    lodash.initial = initial;
    lodash.intersection = intersection;
    lodash.intersectionBy = intersectionBy;
    lodash.intersectionWith = intersectionWith;
    lodash.invert = invert;
    lodash.invertBy = invertBy;
    lodash.invokeMap = invokeMap;
    lodash.iteratee = iteratee;
    lodash.keyBy = keyBy;
    lodash.keys = keys;
    lodash.keysIn = keysIn;
    lodash.map = map;
    lodash.mapKeys = mapKeys;
    lodash.mapValues = mapValues;
    lodash.matches = matches;
    lodash.matchesProperty = matchesProperty;
    lodash.memoize = memoize;
    lodash.merge = merge;
    lodash.mergeWith = mergeWith;
    lodash.method = method;
    lodash.methodOf = methodOf;
    lodash.mixin = mixin;
    lodash.negate = negate;
    lodash.nthArg = nthArg;
    lodash.omit = omit;
    lodash.omitBy = omitBy;
    lodash.once = once;
    lodash.orderBy = orderBy;
    lodash.over = over;
    lodash.overArgs = overArgs;
    lodash.overEvery = overEvery;
    lodash.overSome = overSome;
    lodash.partial = partial;
    lodash.partialRight = partialRight;
    lodash.partition = partition;
    lodash.pick = pick;
    lodash.pickBy = pickBy;
    lodash.property = property;
    lodash.propertyOf = propertyOf;
    lodash.pull = pull;
    lodash.pullAll = pullAll;
    lodash.pullAllBy = pullAllBy;
    lodash.pullAllWith = pullAllWith;
    lodash.pullAt = pullAt;
    lodash.range = range;
    lodash.rangeRight = rangeRight;
    lodash.rearg = rearg;
    lodash.reject = reject;
    lodash.remove = remove;
    lodash.rest = rest;
    lodash.reverse = reverse;
    lodash.sampleSize = sampleSize;
    lodash.set = set;
    lodash.setWith = setWith;
    lodash.shuffle = shuffle;
    lodash.slice = slice;
    lodash.sortBy = sortBy;
    lodash.sortedUniq = sortedUniq;
    lodash.sortedUniqBy = sortedUniqBy;
    lodash.split = split;
    lodash.spread = spread;
    lodash.tail = tail;
    lodash.take = take;
    lodash.takeRight = takeRight;
    lodash.takeRightWhile = takeRightWhile;
    lodash.takeWhile = takeWhile;
    lodash.tap = tap;
    lodash.throttle = throttle;
    lodash.thru = thru;
    lodash.toArray = toArray;
    lodash.toPairs = toPairs;
    lodash.toPairsIn = toPairsIn;
    lodash.toPath = toPath;
    lodash.toPlainObject = toPlainObject;
    lodash.transform = transform;
    lodash.unary = unary;
    lodash.union = union;
    lodash.unionBy = unionBy;
    lodash.unionWith = unionWith;
    lodash.uniq = uniq;
    lodash.uniqBy = uniqBy;
    lodash.uniqWith = uniqWith;
    lodash.unset = unset;
    lodash.unzip = unzip;
    lodash.unzipWith = unzipWith;
    lodash.update = update;
    lodash.updateWith = updateWith;
    lodash.values = values;
    lodash.valuesIn = valuesIn;
    lodash.without = without;
    lodash.words = words;
    lodash.wrap = wrap;
    lodash.xor = xor;
    lodash.xorBy = xorBy;
    lodash.xorWith = xorWith;
    lodash.zip = zip;
    lodash.zipObject = zipObject;
    lodash.zipObjectDeep = zipObjectDeep;
    lodash.zipWith = zipWith;

    // Add aliases.
    lodash.entries = toPairs;
    lodash.entriesIn = toPairsIn;
    lodash.extend = assignIn;
    lodash.extendWith = assignInWith;

    // Add methods to `lodash.prototype`.
    mixin(lodash, lodash);

    /*------------------------------------------------------------------------*/

    // Add methods that return unwrapped values in chain sequences.
    lodash.add = add;
    lodash.attempt = attempt;
    lodash.camelCase = camelCase;
    lodash.capitalize = capitalize;
    lodash.ceil = ceil;
    lodash.clamp = clamp;
    lodash.clone = clone;
    lodash.cloneDeep = cloneDeep;
    lodash.cloneDeepWith = cloneDeepWith;
    lodash.cloneWith = cloneWith;
    lodash.conformsTo = conformsTo;
    lodash.deburr = deburr;
    lodash.defaultTo = defaultTo;
    lodash.divide = divide;
    lodash.endsWith = endsWith;
    lodash.eq = eq;
    lodash.escape = escape;
    lodash.escapeRegExp = escapeRegExp;
    lodash.every = every;
    lodash.find = find;
    lodash.findIndex = findIndex;
    lodash.findKey = findKey;
    lodash.findLast = findLast;
    lodash.findLastIndex = findLastIndex;
    lodash.findLastKey = findLastKey;
    lodash.floor = floor;
    lodash.forEach = forEach;
    lodash.forEachRight = forEachRight;
    lodash.forIn = forIn;
    lodash.forInRight = forInRight;
    lodash.forOwn = forOwn;
    lodash.forOwnRight = forOwnRight;
    lodash.get = get;
    lodash.gt = gt;
    lodash.gte = gte;
    lodash.has = has;
    lodash.hasIn = hasIn;
    lodash.head = head;
    lodash.identity = identity;
    lodash.includes = includes;
    lodash.indexOf = indexOf;
    lodash.inRange = inRange;
    lodash.invoke = invoke;
    lodash.isArguments = isArguments;
    lodash.isArray = isArray;
    lodash.isArrayBuffer = isArrayBuffer;
    lodash.isArrayLike = isArrayLike;
    lodash.isArrayLikeObject = isArrayLikeObject;
    lodash.isBoolean = isBoolean;
    lodash.isBuffer = isBuffer;
    lodash.isDate = isDate;
    lodash.isElement = isElement;
    lodash.isEmpty = isEmpty;
    lodash.isEqual = isEqual;
    lodash.isEqualWith = isEqualWith;
    lodash.isError = isError;
    lodash.isFinite = isFinite;
    lodash.isFunction = isFunction;
    lodash.isInteger = isInteger;
    lodash.isLength = isLength;
    lodash.isMap = isMap;
    lodash.isMatch = isMatch;
    lodash.isMatchWith = isMatchWith;
    lodash.isNaN = isNaN;
    lodash.isNative = isNative;
    lodash.isNil = isNil;
    lodash.isNull = isNull;
    lodash.isNumber = isNumber;
    lodash.isObject = isObject;
    lodash.isObjectLike = isObjectLike;
    lodash.isPlainObject = isPlainObject;
    lodash.isRegExp = isRegExp;
    lodash.isSafeInteger = isSafeInteger;
    lodash.isSet = isSet;
    lodash.isString = isString;
    lodash.isSymbol = isSymbol;
    lodash.isTypedArray = isTypedArray;
    lodash.isUndefined = isUndefined;
    lodash.isWeakMap = isWeakMap;
    lodash.isWeakSet = isWeakSet;
    lodash.join = join;
    lodash.kebabCase = kebabCase;
    lodash.last = last;
    lodash.lastIndexOf = lastIndexOf;
    lodash.lowerCase = lowerCase;
    lodash.lowerFirst = lowerFirst;
    lodash.lt = lt;
    lodash.lte = lte;
    lodash.max = max;
    lodash.maxBy = maxBy;
    lodash.mean = mean;
    lodash.meanBy = meanBy;
    lodash.min = min;
    lodash.minBy = minBy;
    lodash.stubArray = stubArray;
    lodash.stubFalse = stubFalse;
    lodash.stubObject = stubObject;
    lodash.stubString = stubString;
    lodash.stubTrue = stubTrue;
    lodash.multiply = multiply;
    lodash.nth = nth;
    lodash.noConflict = noConflict;
    lodash.noop = noop;
    lodash.now = now;
    lodash.pad = pad;
    lodash.padEnd = padEnd;
    lodash.padStart = padStart;
    lodash.parseInt = parseInt;
    lodash.random = random;
    lodash.reduce = reduce;
    lodash.reduceRight = reduceRight;
    lodash.repeat = repeat;
    lodash.replace = replace;
    lodash.result = result;
    lodash.round = round;
    lodash.runInContext = runInContext;
    lodash.sample = sample;
    lodash.size = size;
    lodash.snakeCase = snakeCase;
    lodash.some = some;
    lodash.sortedIndex = sortedIndex;
    lodash.sortedIndexBy = sortedIndexBy;
    lodash.sortedIndexOf = sortedIndexOf;
    lodash.sortedLastIndex = sortedLastIndex;
    lodash.sortedLastIndexBy = sortedLastIndexBy;
    lodash.sortedLastIndexOf = sortedLastIndexOf;
    lodash.startCase = startCase;
    lodash.startsWith = startsWith;
    lodash.subtract = subtract;
    lodash.sum = sum;
    lodash.sumBy = sumBy;
    lodash.template = template;
    lodash.times = times;
    lodash.toFinite = toFinite;
    lodash.toInteger = toInteger;
    lodash.toLength = toLength;
    lodash.toLower = toLower;
    lodash.toNumber = toNumber;
    lodash.toSafeInteger = toSafeInteger;
    lodash.toString = toString;
    lodash.toUpper = toUpper;
    lodash.trim = trim;
    lodash.trimEnd = trimEnd;
    lodash.trimStart = trimStart;
    lodash.truncate = truncate;
    lodash.unescape = unescape;
    lodash.uniqueId = uniqueId;
    lodash.upperCase = upperCase;
    lodash.upperFirst = upperFirst;

    // Add aliases.
    lodash.each = forEach;
    lodash.eachRight = forEachRight;
    lodash.first = head;

    mixin(lodash, (function() {
      var source = {};
      baseForOwn(lodash, function(func, methodName) {
        if (!hasOwnProperty.call(lodash.prototype, methodName)) {
          source[methodName] = func;
        }
      });
      return source;
    }()), { 'chain': false });

    /*------------------------------------------------------------------------*/

    /**
     * The semantic version number.
     *
     * @static
     * @memberOf _
     * @type {string}
     */
    lodash.VERSION = VERSION;

    // Assign default placeholders.
    arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
      lodash[methodName].placeholder = lodash;
    });

    // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
    arrayEach(['drop', 'take'], function(methodName, index) {
      LazyWrapper.prototype[methodName] = function(n) {
        n = n === undefined ? 1 : nativeMax(toInteger(n), 0);

        var result = (this.__filtered__ && !index)
          ? new LazyWrapper(this)
          : this.clone();

        if (result.__filtered__) {
          result.__takeCount__ = nativeMin(n, result.__takeCount__);
        } else {
          result.__views__.push({
            'size': nativeMin(n, MAX_ARRAY_LENGTH),
            'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
          });
        }
        return result;
      };

      LazyWrapper.prototype[methodName + 'Right'] = function(n) {
        return this.reverse()[methodName](n).reverse();
      };
    });

    // Add `LazyWrapper` methods that accept an `iteratee` value.
    arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
      var type = index + 1,
          isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;

      LazyWrapper.prototype[methodName] = function(iteratee) {
        var result = this.clone();
        result.__iteratees__.push({
          'iteratee': getIteratee(iteratee, 3),
          'type': type
        });
        result.__filtered__ = result.__filtered__ || isFilter;
        return result;
      };
    });

    // Add `LazyWrapper` methods for `_.head` and `_.last`.
    arrayEach(['head', 'last'], function(methodName, index) {
      var takeName = 'take' + (index ? 'Right' : '');

      LazyWrapper.prototype[methodName] = function() {
        return this[takeName](1).value()[0];
      };
    });

    // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
    arrayEach(['initial', 'tail'], function(methodName, index) {
      var dropName = 'drop' + (index ? '' : 'Right');

      LazyWrapper.prototype[methodName] = function() {
        return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
      };
    });

    LazyWrapper.prototype.compact = function() {
      return this.filter(identity);
    };

    LazyWrapper.prototype.find = function(predicate) {
      return this.filter(predicate).head();
    };

    LazyWrapper.prototype.findLast = function(predicate) {
      return this.reverse().find(predicate);
    };

    LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
      if (typeof path == 'function') {
        return new LazyWrapper(this);
      }
      return this.map(function(value) {
        return baseInvoke(value, path, args);
      });
    });

    LazyWrapper.prototype.reject = function(predicate) {
      return this.filter(negate(getIteratee(predicate)));
    };

    LazyWrapper.prototype.slice = function(start, end) {
      start = toInteger(start);

      var result = this;
      if (result.__filtered__ && (start > 0 || end < 0)) {
        return new LazyWrapper(result);
      }
      if (start < 0) {
        result = result.takeRight(-start);
      } else if (start) {
        result = result.drop(start);
      }
      if (end !== undefined) {
        end = toInteger(end);
        result = end < 0 ? result.dropRight(-end) : result.take(end - start);
      }
      return result;
    };

    LazyWrapper.prototype.takeRightWhile = function(predicate) {
      return this.reverse().takeWhile(predicate).reverse();
    };

    LazyWrapper.prototype.toArray = function() {
      return this.take(MAX_ARRAY_LENGTH);
    };

    // Add `LazyWrapper` methods to `lodash.prototype`.
    baseForOwn(LazyWrapper.prototype, function(func, methodName) {
      var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
          isTaker = /^(?:head|last)$/.test(methodName),
          lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
          retUnwrapped = isTaker || /^find/.test(methodName);

      if (!lodashFunc) {
        return;
      }
      lodash.prototype[methodName] = function() {
        var value = this.__wrapped__,
            args = isTaker ? [1] : arguments,
            isLazy = value instanceof LazyWrapper,
            iteratee = args[0],
            useLazy = isLazy || isArray(value);

        var interceptor = function(value) {
          var result = lodashFunc.apply(lodash, arrayPush([value], args));
          return (isTaker && chainAll) ? result[0] : result;
        };

        if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
          // Avoid lazy use if the iteratee has a "length" value other than `1`.
          isLazy = useLazy = false;
        }
        var chainAll = this.__chain__,
            isHybrid = !!this.__actions__.length,
            isUnwrapped = retUnwrapped && !chainAll,
            onlyLazy = isLazy && !isHybrid;

        if (!retUnwrapped && useLazy) {
          value = onlyLazy ? value : new LazyWrapper(this);
          var result = func.apply(value, args);
          result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
          return new LodashWrapper(result, chainAll);
        }
        if (isUnwrapped && onlyLazy) {
          return func.apply(this, args);
        }
        result = this.thru(interceptor);
        return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
      };
    });

    // Add `Array` methods to `lodash.prototype`.
    arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
      var func = arrayProto[methodName],
          chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
          retUnwrapped = /^(?:pop|shift)$/.test(methodName);

      lodash.prototype[methodName] = function() {
        var args = arguments;
        if (retUnwrapped && !this.__chain__) {
          var value = this.value();
          return func.apply(isArray(value) ? value : [], args);
        }
        return this[chainName](function(value) {
          return func.apply(isArray(value) ? value : [], args);
        });
      };
    });

    // Map minified method names to their real names.
    baseForOwn(LazyWrapper.prototype, function(func, methodName) {
      var lodashFunc = lodash[methodName];
      if (lodashFunc) {
        var key = lodashFunc.name + '';
        if (!hasOwnProperty.call(realNames, key)) {
          realNames[key] = [];
        }
        realNames[key].push({ 'name': methodName, 'func': lodashFunc });
      }
    });

    realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
      'name': 'wrapper',
      'func': undefined
    }];

    // Add methods to `LazyWrapper`.
    LazyWrapper.prototype.clone = lazyClone;
    LazyWrapper.prototype.reverse = lazyReverse;
    LazyWrapper.prototype.value = lazyValue;

    // Add chain sequence methods to the `lodash` wrapper.
    lodash.prototype.at = wrapperAt;
    lodash.prototype.chain = wrapperChain;
    lodash.prototype.commit = wrapperCommit;
    lodash.prototype.next = wrapperNext;
    lodash.prototype.plant = wrapperPlant;
    lodash.prototype.reverse = wrapperReverse;
    lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;

    // Add lazy aliases.
    lodash.prototype.first = lodash.prototype.head;

    if (symIterator) {
      lodash.prototype[symIterator] = wrapperToIterator;
    }
    return lodash;
  });

  /*--------------------------------------------------------------------------*/

  // Export lodash.
  var _ = runInContext();

  // Some AMD build optimizers, like r.js, check for condition patterns like:
  if (true) {
    // Expose Lodash on the global object to prevent errors when Lodash is
    // loaded by a script tag in the presence of an AMD loader.
    // See http://requirejs.org/docs/errors.html#mismatch for more details.
    // Use `_.noConflict` to remove Lodash from the global object.
    root._ = _;

    // Define as an anonymous module so, through path mapping, it can be
    // referenced as the "underscore" module.
    !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
      return _;
    }).call(exports, __webpack_require__, exports, module),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  }
  // Check for `exports` after `define` in case a build optimizer adds it.
  else {}
}.call(this));


/***/ }),

/***/ 5378:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var arrayMap = __webpack_require__(4932),
    baseIteratee = __webpack_require__(5389),
    baseMap = __webpack_require__(5128),
    isArray = __webpack_require__(6449);

/**
 * Creates an array of values by running each element in `collection` thru
 * `iteratee`. The iteratee is invoked with three arguments:
 * (value, index|key, collection).
 *
 * Many lodash methods are guarded to work as iteratees for methods like
 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
 *
 * The guarded methods are:
 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
 * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Collection
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
 * @returns {Array} Returns the new mapped array.
 * @example
 *
 * function square(n) {
 *   return n * n;
 * }
 *
 * _.map([4, 8], square);
 * // => [16, 64]
 *
 * _.map({ 'a': 4, 'b': 8 }, square);
 * // => [16, 64] (iteration order is not guaranteed)
 *
 * var users = [
 *   { 'user': 'barney' },
 *   { 'user': 'fred' }
 * ];
 *
 * // The `_.property` iteratee shorthand.
 * _.map(users, 'user');
 * // => ['barney', 'fred']
 */
function map(collection, iteratee) {
  var func = isArray(collection) ? arrayMap : baseMap;
  return func(collection, baseIteratee(iteratee, 3));
}

module.exports = map;


/***/ }),

/***/ 3916:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseAssignValue = __webpack_require__(3360),
    baseForOwn = __webpack_require__(641),
    baseIteratee = __webpack_require__(5389);

/**
 * Creates an object with the same keys as `object` and values generated
 * by running each own enumerable string keyed property of `object` thru
 * `iteratee`. The iteratee is invoked with three arguments:
 * (value, key, object).
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Object
 * @param {Object} object The object to iterate over.
 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
 * @returns {Object} Returns the new mapped object.
 * @see _.mapKeys
 * @example
 *
 * var users = {
 *   'fred':    { 'user': 'fred',    'age': 40 },
 *   'pebbles': { 'user': 'pebbles', 'age': 1 }
 * };
 *
 * _.mapValues(users, function(o) { return o.age; });
 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
 *
 * // The `_.property` iteratee shorthand.
 * _.mapValues(users, 'age');
 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
 */
function mapValues(object, iteratee) {
  var result = {};
  iteratee = baseIteratee(iteratee, 3);

  baseForOwn(object, function(value, key, object) {
    baseAssignValue(result, key, iteratee(value, key, object));
  });
  return result;
}

module.exports = mapValues;


/***/ }),

/***/ 4506:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseExtremum = __webpack_require__(3599),
    baseGt = __webpack_require__(3335),
    identity = __webpack_require__(3488);

/**
 * Computes the maximum value of `array`. If `array` is empty or falsey,
 * `undefined` is returned.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Math
 * @param {Array} array The array to iterate over.
 * @returns {*} Returns the maximum value.
 * @example
 *
 * _.max([4, 2, 8, 6]);
 * // => 8
 *
 * _.max([]);
 * // => undefined
 */
function max(array) {
  return (array && array.length)
    ? baseExtremum(array, identity, baseGt)
    : undefined;
}

module.exports = max;


/***/ }),

/***/ 7551:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseExtremum = __webpack_require__(3599),
    baseGt = __webpack_require__(3335),
    baseIteratee = __webpack_require__(5389);

/**
 * This method is like `_.max` except that it accepts `iteratee` which is
 * invoked for each element in `array` to generate the criterion by which
 * the value is ranked. The iteratee is invoked with one argument: (value).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Math
 * @param {Array} array The array to iterate over.
 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
 * @returns {*} Returns the maximum value.
 * @example
 *
 * var objects = [{ 'n': 1 }, { 'n': 2 }];
 *
 * _.maxBy(objects, function(o) { return o.n; });
 * // => { 'n': 2 }
 *
 * // The `_.property` iteratee shorthand.
 * _.maxBy(objects, 'n');
 * // => { 'n': 2 }
 */
function maxBy(array, iteratee) {
  return (array && array.length)
    ? baseExtremum(array, baseIteratee(iteratee, 2), baseGt)
    : undefined;
}

module.exports = maxBy;


/***/ }),

/***/ 104:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var MapCache = __webpack_require__(3661);

/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';

/**
 * Creates a function that memoizes the result of `func`. If `resolver` is
 * provided, it determines the cache key for storing the result based on the
 * arguments provided to the memoized function. By default, the first argument
 * provided to the memoized function is used as the map cache key. The `func`
 * is invoked with the `this` binding of the memoized function.
 *
 * **Note:** The cache is exposed as the `cache` property on the memoized
 * function. Its creation may be customized by replacing the `_.memoize.Cache`
 * constructor with one whose instances implement the
 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
 * method interface of `clear`, `delete`, `get`, `has`, and `set`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to have its output memoized.
 * @param {Function} [resolver] The function to resolve the cache key.
 * @returns {Function} Returns the new memoized function.
 * @example
 *
 * var object = { 'a': 1, 'b': 2 };
 * var other = { 'c': 3, 'd': 4 };
 *
 * var values = _.memoize(_.values);
 * values(object);
 * // => [1, 2]
 *
 * values(other);
 * // => [3, 4]
 *
 * object.a = 2;
 * values(object);
 * // => [1, 2]
 *
 * // Modify the result cache.
 * values.cache.set(object, ['a', 'b']);
 * values(object);
 * // => ['a', 'b']
 *
 * // Replace `_.memoize.Cache`.
 * _.memoize.Cache = WeakMap;
 */
function memoize(func, resolver) {
  if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  var memoized = function() {
    var args = arguments,
        key = resolver ? resolver.apply(this, args) : args[0],
        cache = memoized.cache;

    if (cache.has(key)) {
      return cache.get(key);
    }
    var result = func.apply(this, args);
    memoized.cache = cache.set(key, result) || cache;
    return result;
  };
  memoized.cache = new (memoize.Cache || MapCache);
  return memoized;
}

// Expose `MapCache`.
memoize.Cache = MapCache;

module.exports = memoize;


/***/ }),

/***/ 1684:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseExtremum = __webpack_require__(3599),
    baseLt = __webpack_require__(6176),
    identity = __webpack_require__(3488);

/**
 * Computes the minimum value of `array`. If `array` is empty or falsey,
 * `undefined` is returned.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Math
 * @param {Array} array The array to iterate over.
 * @returns {*} Returns the minimum value.
 * @example
 *
 * _.min([4, 2, 8, 6]);
 * // => 2
 *
 * _.min([]);
 * // => undefined
 */
function min(array) {
  return (array && array.length)
    ? baseExtremum(array, identity, baseLt)
    : undefined;
}

module.exports = min;


/***/ }),

/***/ 6533:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseExtremum = __webpack_require__(3599),
    baseIteratee = __webpack_require__(5389),
    baseLt = __webpack_require__(6176);

/**
 * This method is like `_.min` except that it accepts `iteratee` which is
 * invoked for each element in `array` to generate the criterion by which
 * the value is ranked. The iteratee is invoked with one argument: (value).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Math
 * @param {Array} array The array to iterate over.
 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
 * @returns {*} Returns the minimum value.
 * @example
 *
 * var objects = [{ 'n': 1 }, { 'n': 2 }];
 *
 * _.minBy(objects, function(o) { return o.n; });
 * // => { 'n': 1 }
 *
 * // The `_.property` iteratee shorthand.
 * _.minBy(objects, 'n');
 * // => { 'n': 1 }
 */
function minBy(array, iteratee) {
  return (array && array.length)
    ? baseExtremum(array, baseIteratee(iteratee, 2), baseLt)
    : undefined;
}

module.exports = minBy;


/***/ }),

/***/ 3950:
/***/ (function(module) {

/**
 * This method returns `undefined`.
 *
 * @static
 * @memberOf _
 * @since 2.3.0
 * @category Util
 * @example
 *
 * _.times(2, _.noop);
 * // => [undefined, undefined]
 */
function noop() {
  // No operation performed.
}

module.exports = noop;


/***/ }),

/***/ 124:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var root = __webpack_require__(9325);

/**
 * Gets the timestamp of the number of milliseconds that have elapsed since
 * the Unix epoch (1 January 1970 00:00:00 UTC).
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Date
 * @returns {number} Returns the timestamp.
 * @example
 *
 * _.defer(function(stamp) {
 *   console.log(_.now() - stamp);
 * }, _.now());
 * // => Logs the number of milliseconds it took for the deferred invocation.
 */
var now = function() {
  return root.Date.now();
};

module.exports = now;


/***/ }),

/***/ 583:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseProperty = __webpack_require__(7237),
    basePropertyDeep = __webpack_require__(7255),
    isKey = __webpack_require__(8586),
    toKey = __webpack_require__(7797);

/**
 * Creates a function that returns the value at `path` of a given object.
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Util
 * @param {Array|string} path The path of the property to get.
 * @returns {Function} Returns the new accessor function.
 * @example
 *
 * var objects = [
 *   { 'a': { 'b': 2 } },
 *   { 'a': { 'b': 1 } }
 * ];
 *
 * _.map(objects, _.property('a.b'));
 * // => [2, 1]
 *
 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
 * // => [1, 2]
 */
function property(path) {
  return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}

module.exports = property;


/***/ }),

/***/ 3181:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var createRange = __webpack_require__(5508);

/**
 * Creates an array of numbers (positive and/or negative) progressing from
 * `start` up to, but not including, `end`. A step of `-1` is used if a negative
 * `start` is specified without an `end` or `step`. If `end` is not specified,
 * it's set to `start` with `start` then set to `0`.
 *
 * **Note:** JavaScript follows the IEEE-754 standard for resolving
 * floating-point values which can produce unexpected results.
 *
 * @static
 * @since 0.1.0
 * @memberOf _
 * @category Util
 * @param {number} [start=0] The start of the range.
 * @param {number} end The end of the range.
 * @param {number} [step=1] The value to increment or decrement by.
 * @returns {Array} Returns the range of numbers.
 * @see _.inRange, _.rangeRight
 * @example
 *
 * _.range(4);
 * // => [0, 1, 2, 3]
 *
 * _.range(-4);
 * // => [0, -1, -2, -3]
 *
 * _.range(1, 5);
 * // => [1, 2, 3, 4]
 *
 * _.range(0, 20, 5);
 * // => [0, 5, 10, 15]
 *
 * _.range(0, -4, -1);
 * // => [0, -1, -2, -3]
 *
 * _.range(1, 4, 0);
 * // => [1, 1, 1]
 *
 * _.range(0);
 * // => []
 */
var range = createRange();

module.exports = range;


/***/ }),

/***/ 2426:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var arraySome = __webpack_require__(4248),
    baseIteratee = __webpack_require__(5389),
    baseSome = __webpack_require__(916),
    isArray = __webpack_require__(6449),
    isIterateeCall = __webpack_require__(6800);

/**
 * Checks if `predicate` returns truthy for **any** element of `collection`.
 * Iteration is stopped once `predicate` returns truthy. The predicate is
 * invoked with three arguments: (value, index|key, collection).
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Collection
 * @param {Array|Object} collection The collection to iterate over.
 * @param {Function} [predicate=_.identity] The function invoked per iteration.
 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
 * @returns {boolean} Returns `true` if any element passes the predicate check,
 *  else `false`.
 * @example
 *
 * _.some([null, 0, 'yes', false], Boolean);
 * // => true
 *
 * var users = [
 *   { 'user': 'barney', 'active': true },
 *   { 'user': 'fred',   'active': false }
 * ];
 *
 * // The `_.matches` iteratee shorthand.
 * _.some(users, { 'user': 'barney', 'active': false });
 * // => false
 *
 * // The `_.matchesProperty` iteratee shorthand.
 * _.some(users, ['active', false]);
 * // => true
 *
 * // The `_.property` iteratee shorthand.
 * _.some(users, 'active');
 * // => true
 */
function some(collection, predicate, guard) {
  var func = isArray(collection) ? arraySome : baseSome;
  if (guard && isIterateeCall(collection, predicate, guard)) {
    predicate = undefined;
  }
  return func(collection, baseIteratee(predicate, 3));
}

module.exports = some;


/***/ }),

/***/ 3031:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseFlatten = __webpack_require__(3120),
    baseOrderBy = __webpack_require__(6155),
    baseRest = __webpack_require__(9302),
    isIterateeCall = __webpack_require__(6800);

/**
 * Creates an array of elements, sorted in ascending order by the results of
 * running each element in a collection thru each iteratee. This method
 * performs a stable sort, that is, it preserves the original sort order of
 * equal elements. The iteratees are invoked with one argument: (value).
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Collection
 * @param {Array|Object} collection The collection to iterate over.
 * @param {...(Function|Function[])} [iteratees=[_.identity]]
 *  The iteratees to sort by.
 * @returns {Array} Returns the new sorted array.
 * @example
 *
 * var users = [
 *   { 'user': 'fred',   'age': 48 },
 *   { 'user': 'barney', 'age': 36 },
 *   { 'user': 'fred',   'age': 30 },
 *   { 'user': 'barney', 'age': 34 }
 * ];
 *
 * _.sortBy(users, [function(o) { return o.user; }]);
 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
 *
 * _.sortBy(users, ['user', 'age']);
 * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
 */
var sortBy = baseRest(function(collection, iteratees) {
  if (collection == null) {
    return [];
  }
  var length = iteratees.length;
  if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
    iteratees = [];
  } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
    iteratees = [iteratees[0]];
  }
  return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});

module.exports = sortBy;


/***/ }),

/***/ 3345:
/***/ (function(module) {

/**
 * This method returns a new empty array.
 *
 * @static
 * @memberOf _
 * @since 4.13.0
 * @category Util
 * @returns {Array} Returns the new empty array.
 * @example
 *
 * var arrays = _.times(2, _.stubArray);
 *
 * console.log(arrays);
 * // => [[], []]
 *
 * console.log(arrays[0] === arrays[1]);
 * // => false
 */
function stubArray() {
  return [];
}

module.exports = stubArray;


/***/ }),

/***/ 5964:
/***/ (function(module) {

/**
 * This method returns `false`.
 *
 * @static
 * @memberOf _
 * @since 4.13.0
 * @category Util
 * @returns {boolean} Returns `false`.
 * @example
 *
 * _.times(2, _.stubFalse);
 * // => [false, false]
 */
function stubFalse() {
  return false;
}

module.exports = stubFalse;


/***/ }),

/***/ 7350:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var debounce = __webpack_require__(8221),
    isObject = __webpack_require__(3805);

/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';

/**
 * Creates a throttled function that only invokes `func` at most once per
 * every `wait` milliseconds. The throttled function comes with a `cancel`
 * method to cancel delayed `func` invocations and a `flush` method to
 * immediately invoke them. Provide `options` to indicate whether `func`
 * should be invoked on the leading and/or trailing edge of the `wait`
 * timeout. The `func` is invoked with the last arguments provided to the
 * throttled function. Subsequent calls to the throttled function return the
 * result of the last `func` invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the throttled function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.throttle` and `_.debounce`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to throttle.
 * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=true]
 *  Specify invoking on the leading edge of the timeout.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new throttled function.
 * @example
 *
 * // Avoid excessively updating the position while scrolling.
 * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
 *
 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
 * jQuery(element).on('click', throttled);
 *
 * // Cancel the trailing throttled invocation.
 * jQuery(window).on('popstate', throttled.cancel);
 */
function throttle(func, wait, options) {
  var leading = true,
      trailing = true;

  if (typeof func != 'function') {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  if (isObject(options)) {
    leading = 'leading' in options ? !!options.leading : leading;
    trailing = 'trailing' in options ? !!options.trailing : trailing;
  }
  return debounce(func, wait, {
    'leading': leading,
    'maxWait': wait,
    'trailing': trailing
  });
}

module.exports = throttle;


/***/ }),

/***/ 7400:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var toNumber = __webpack_require__(9374);

/** Used as references for various `Number` constants. */
var INFINITY = 1 / 0,
    MAX_INTEGER = 1.7976931348623157e+308;

/**
 * Converts `value` to a finite number.
 *
 * @static
 * @memberOf _
 * @since 4.12.0
 * @category Lang
 * @param {*} value The value to convert.
 * @returns {number} Returns the converted number.
 * @example
 *
 * _.toFinite(3.2);
 * // => 3.2
 *
 * _.toFinite(Number.MIN_VALUE);
 * // => 5e-324
 *
 * _.toFinite(Infinity);
 * // => 1.7976931348623157e+308
 *
 * _.toFinite('3.2');
 * // => 3.2
 */
function toFinite(value) {
  if (!value) {
    return value === 0 ? value : 0;
  }
  value = toNumber(value);
  if (value === INFINITY || value === -INFINITY) {
    var sign = (value < 0 ? -1 : 1);
    return sign * MAX_INTEGER;
  }
  return value === value ? value : 0;
}

module.exports = toFinite;


/***/ }),

/***/ 1489:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var toFinite = __webpack_require__(7400);

/**
 * Converts `value` to an integer.
 *
 * **Note:** This method is loosely based on
 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to convert.
 * @returns {number} Returns the converted integer.
 * @example
 *
 * _.toInteger(3.2);
 * // => 3
 *
 * _.toInteger(Number.MIN_VALUE);
 * // => 0
 *
 * _.toInteger(Infinity);
 * // => 1.7976931348623157e+308
 *
 * _.toInteger('3.2');
 * // => 3
 */
function toInteger(value) {
  var result = toFinite(value),
      remainder = result % 1;

  return result === result ? (remainder ? result - remainder : result) : 0;
}

module.exports = toInteger;


/***/ }),

/***/ 9374:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseTrim = __webpack_require__(4128),
    isObject = __webpack_require__(3805),
    isSymbol = __webpack_require__(4394);

/** Used as references for various `Number` constants. */
var NAN = 0 / 0;

/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;

/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;

/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;

/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;

/**
 * Converts `value` to a number.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to process.
 * @returns {number} Returns the number.
 * @example
 *
 * _.toNumber(3.2);
 * // => 3.2
 *
 * _.toNumber(Number.MIN_VALUE);
 * // => 5e-324
 *
 * _.toNumber(Infinity);
 * // => Infinity
 *
 * _.toNumber('3.2');
 * // => 3.2
 */
function toNumber(value) {
  if (typeof value == 'number') {
    return value;
  }
  if (isSymbol(value)) {
    return NAN;
  }
  if (isObject(value)) {
    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
    value = isObject(other) ? (other + '') : other;
  }
  if (typeof value != 'string') {
    return value === 0 ? value : +value;
  }
  value = baseTrim(value);
  var isBinary = reIsBinary.test(value);
  return (isBinary || reIsOctal.test(value))
    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
    : (reIsBadHex.test(value) ? NAN : +value);
}

module.exports = toNumber;


/***/ }),

/***/ 3222:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseToString = __webpack_require__(7556);

/**
 * Converts `value` to a string. An empty string is returned for `null`
 * and `undefined` values. The sign of `-0` is preserved.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to convert.
 * @returns {string} Returns the converted string.
 * @example
 *
 * _.toString(null);
 * // => ''
 *
 * _.toString(-0);
 * // => '-0'
 *
 * _.toString([1, 2, 3]);
 * // => '1,2,3'
 */
function toString(value) {
  return value == null ? '' : baseToString(value);
}

module.exports = toString;


/***/ }),

/***/ 14:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var baseIteratee = __webpack_require__(5389),
    baseUniq = __webpack_require__(5765);

/**
 * This method is like `_.uniq` except that it accepts `iteratee` which is
 * invoked for each element in `array` to generate the criterion by which
 * uniqueness is computed. The order of result values is determined by the
 * order they occur in the array. The iteratee is invoked with one argument:
 * (value).
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Array
 * @param {Array} array The array to inspect.
 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
 * @returns {Array} Returns the new duplicate free array.
 * @example
 *
 * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
 * // => [2.1, 1.2]
 *
 * // The `_.property` iteratee shorthand.
 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
 * // => [{ 'x': 1 }, { 'x': 2 }]
 */
function uniqBy(array, iteratee) {
  return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : [];
}

module.exports = uniqBy;


/***/ }),

/***/ 5808:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var createCaseFirst = __webpack_require__(2507);

/**
 * Converts the first character of `string` to upper case.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category String
 * @param {string} [string=''] The string to convert.
 * @returns {string} Returns the converted string.
 * @example
 *
 * _.upperFirst('fred');
 * // => 'Fred'
 *
 * _.upperFirst('FRED');
 * // => 'FRED'
 */
var upperFirst = createCaseFirst('toUpperCase');

module.exports = upperFirst;


/***/ }),

/***/ 9805:
/***/ (function(__unused_webpack_module, exports) {

"use strict";



var TYPED_OK =  (typeof Uint8Array !== 'undefined') &&
                (typeof Uint16Array !== 'undefined') &&
                (typeof Int32Array !== 'undefined');

function _has(obj, key) {
  return Object.prototype.hasOwnProperty.call(obj, key);
}

exports.assign = function (obj /*from1, from2, from3, ...*/) {
  var sources = Array.prototype.slice.call(arguments, 1);
  while (sources.length) {
    var source = sources.shift();
    if (!source) { continue; }

    if (typeof source !== 'object') {
      throw new TypeError(source + 'must be non-object');
    }

    for (var p in source) {
      if (_has(source, p)) {
        obj[p] = source[p];
      }
    }
  }

  return obj;
};


// reduce buffer size, avoiding mem copy
exports.shrinkBuf = function (buf, size) {
  if (buf.length === size) { return buf; }
  if (buf.subarray) { return buf.subarray(0, size); }
  buf.length = size;
  return buf;
};


var fnTyped = {
  arraySet: function (dest, src, src_offs, len, dest_offs) {
    if (src.subarray && dest.subarray) {
      dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
      return;
    }
    // Fallback to ordinary array
    for (var i = 0; i < len; i++) {
      dest[dest_offs + i] = src[src_offs + i];
    }
  },
  // Join array of chunks to single array.
  flattenChunks: function (chunks) {
    var i, l, len, pos, chunk, result;

    // calculate data length
    len = 0;
    for (i = 0, l = chunks.length; i < l; i++) {
      len += chunks[i].length;
    }

    // join chunks
    result = new Uint8Array(len);
    pos = 0;
    for (i = 0, l = chunks.length; i < l; i++) {
      chunk = chunks[i];
      result.set(chunk, pos);
      pos += chunk.length;
    }

    return result;
  }
};

var fnUntyped = {
  arraySet: function (dest, src, src_offs, len, dest_offs) {
    for (var i = 0; i < len; i++) {
      dest[dest_offs + i] = src[src_offs + i];
    }
  },
  // Join array of chunks to single array.
  flattenChunks: function (chunks) {
    return [].concat.apply([], chunks);
  }
};


// Enable/Disable typed arrays use, for testing
//
exports.setTyped = function (on) {
  if (on) {
    exports.Buf8  = Uint8Array;
    exports.Buf16 = Uint16Array;
    exports.Buf32 = Int32Array;
    exports.assign(exports, fnTyped);
  } else {
    exports.Buf8  = Array;
    exports.Buf16 = Array;
    exports.Buf32 = Array;
    exports.assign(exports, fnUntyped);
  }
};

exports.setTyped(TYPED_OK);


/***/ }),

/***/ 3269:
/***/ (function(module) {

"use strict";


// Note: adler32 takes 12% for level 0 and 2% for level 6.
// It isn't worth it to make additional optimizations as in original.
// Small size is preferable.

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

function adler32(adler, buf, len, pos) {
  var s1 = (adler & 0xffff) |0,
      s2 = ((adler >>> 16) & 0xffff) |0,
      n = 0;

  while (len !== 0) {
    // Set limit ~ twice less than 5552, to keep
    // s2 in 31-bits, because we force signed ints.
    // in other case %= will fail.
    n = len > 2000 ? 2000 : len;
    len -= n;

    do {
      s1 = (s1 + buf[pos++]) |0;
      s2 = (s2 + s1) |0;
    } while (--n);

    s1 %= 65521;
    s2 %= 65521;
  }

  return (s1 | (s2 << 16)) |0;
}


module.exports = adler32;


/***/ }),

/***/ 9681:
/***/ (function(module) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

module.exports = {

  /* Allowed flush values; see deflate() and inflate() below for details */
  Z_NO_FLUSH:         0,
  Z_PARTIAL_FLUSH:    1,
  Z_SYNC_FLUSH:       2,
  Z_FULL_FLUSH:       3,
  Z_FINISH:           4,
  Z_BLOCK:            5,
  Z_TREES:            6,

  /* Return codes for the compression/decompression functions. Negative values
  * are errors, positive values are used for special but normal events.
  */
  Z_OK:               0,
  Z_STREAM_END:       1,
  Z_NEED_DICT:        2,
  Z_ERRNO:           -1,
  Z_STREAM_ERROR:    -2,
  Z_DATA_ERROR:      -3,
  //Z_MEM_ERROR:     -4,
  Z_BUF_ERROR:       -5,
  //Z_VERSION_ERROR: -6,

  /* compression levels */
  Z_NO_COMPRESSION:         0,
  Z_BEST_SPEED:             1,
  Z_BEST_COMPRESSION:       9,
  Z_DEFAULT_COMPRESSION:   -1,


  Z_FILTERED:               1,
  Z_HUFFMAN_ONLY:           2,
  Z_RLE:                    3,
  Z_FIXED:                  4,
  Z_DEFAULT_STRATEGY:       0,

  /* Possible values of the data_type field (though see inflate()) */
  Z_BINARY:                 0,
  Z_TEXT:                   1,
  //Z_ASCII:                1, // = Z_TEXT (deprecated)
  Z_UNKNOWN:                2,

  /* The deflate compression method */
  Z_DEFLATED:               8
  //Z_NULL:                 null // Use -1 or null inline, depending on var type
};


/***/ }),

/***/ 4823:
/***/ (function(module) {

"use strict";


// Note: we can't get significant speed boost here.
// So write code to minimize size - no pregenerated tables
// and array tools dependencies.

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

// Use ordinary array, since untyped makes no boost here
function makeTable() {
  var c, table = [];

  for (var n = 0; n < 256; n++) {
    c = n;
    for (var k = 0; k < 8; k++) {
      c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
    }
    table[n] = c;
  }

  return table;
}

// Create table on load. Just 255 signed longs. Not a problem.
var crcTable = makeTable();


function crc32(crc, buf, len, pos) {
  var t = crcTable,
      end = pos + len;

  crc ^= -1;

  for (var i = pos; i < end; i++) {
    crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
  }

  return (crc ^ (-1)); // >>> 0;
}


module.exports = crc32;


/***/ }),

/***/ 8411:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

var utils   = __webpack_require__(9805);
var trees   = __webpack_require__(3665);
var adler32 = __webpack_require__(3269);
var crc32   = __webpack_require__(4823);
var msg     = __webpack_require__(4674);

/* Public constants ==========================================================*/
/* ===========================================================================*/


/* Allowed flush values; see deflate() and inflate() below for details */
var Z_NO_FLUSH      = 0;
var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH    = 2;
var Z_FULL_FLUSH    = 3;
var Z_FINISH        = 4;
var Z_BLOCK         = 5;
//var Z_TREES         = 6;


/* Return codes for the compression/decompression functions. Negative values
 * are errors, positive values are used for special but normal events.
 */
var Z_OK            = 0;
var Z_STREAM_END    = 1;
//var Z_NEED_DICT     = 2;
//var Z_ERRNO         = -1;
var Z_STREAM_ERROR  = -2;
var Z_DATA_ERROR    = -3;
//var Z_MEM_ERROR     = -4;
var Z_BUF_ERROR     = -5;
//var Z_VERSION_ERROR = -6;


/* compression levels */
//var Z_NO_COMPRESSION      = 0;
//var Z_BEST_SPEED          = 1;
//var Z_BEST_COMPRESSION    = 9;
var Z_DEFAULT_COMPRESSION = -1;


var Z_FILTERED            = 1;
var Z_HUFFMAN_ONLY        = 2;
var Z_RLE                 = 3;
var Z_FIXED               = 4;
var Z_DEFAULT_STRATEGY    = 0;

/* Possible values of the data_type field (though see inflate()) */
//var Z_BINARY              = 0;
//var Z_TEXT                = 1;
//var Z_ASCII               = 1; // = Z_TEXT
var Z_UNKNOWN             = 2;


/* The deflate compression method */
var Z_DEFLATED  = 8;

/*============================================================================*/


var MAX_MEM_LEVEL = 9;
/* Maximum value for memLevel in deflateInit2 */
var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_MEM_LEVEL = 8;


var LENGTH_CODES  = 29;
/* number of length codes, not counting the special END_BLOCK code */
var LITERALS      = 256;
/* number of literal bytes 0..255 */
var L_CODES       = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */
var D_CODES       = 30;
/* number of distance codes */
var BL_CODES      = 19;
/* number of codes used to transfer the bit lengths */
var HEAP_SIZE     = 2 * L_CODES + 1;
/* maximum heap size */
var MAX_BITS  = 15;
/* All codes must not exceed MAX_BITS bits */

var MIN_MATCH = 3;
var MAX_MATCH = 258;
var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);

var PRESET_DICT = 0x20;

var INIT_STATE = 42;
var EXTRA_STATE = 69;
var NAME_STATE = 73;
var COMMENT_STATE = 91;
var HCRC_STATE = 103;
var BUSY_STATE = 113;
var FINISH_STATE = 666;

var BS_NEED_MORE      = 1; /* block not completed, need more input or more output */
var BS_BLOCK_DONE     = 2; /* block flush performed */
var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
var BS_FINISH_DONE    = 4; /* finish done, accept no more input or output */

var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.

function err(strm, errorCode) {
  strm.msg = msg[errorCode];
  return errorCode;
}

function rank(f) {
  return ((f) << 1) - ((f) > 4 ? 9 : 0);
}

function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }


/* =========================================================================
 * Flush as much pending output as possible. All deflate() output goes
 * through this function so some applications may wish to modify it
 * to avoid allocating a large strm->output buffer and copying into it.
 * (See also read_buf()).
 */
function flush_pending(strm) {
  var s = strm.state;

  //_tr_flush_bits(s);
  var len = s.pending;
  if (len > strm.avail_out) {
    len = strm.avail_out;
  }
  if (len === 0) { return; }

  utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
  strm.next_out += len;
  s.pending_out += len;
  strm.total_out += len;
  strm.avail_out -= len;
  s.pending -= len;
  if (s.pending === 0) {
    s.pending_out = 0;
  }
}


function flush_block_only(s, last) {
  trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
  s.block_start = s.strstart;
  flush_pending(s.strm);
}


function put_byte(s, b) {
  s.pending_buf[s.pending++] = b;
}


/* =========================================================================
 * Put a short in the pending buffer. The 16-bit value is put in MSB order.
 * IN assertion: the stream state is correct and there is enough room in
 * pending_buf.
 */
function putShortMSB(s, b) {
//  put_byte(s, (Byte)(b >> 8));
//  put_byte(s, (Byte)(b & 0xff));
  s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
  s.pending_buf[s.pending++] = b & 0xff;
}


/* ===========================================================================
 * Read a new buffer from the current input stream, update the adler32
 * and total number of bytes read.  All deflate() input goes through
 * this function so some applications may wish to modify it to avoid
 * allocating a large strm->input buffer and copying from it.
 * (See also flush_pending()).
 */
function read_buf(strm, buf, start, size) {
  var len = strm.avail_in;

  if (len > size) { len = size; }
  if (len === 0) { return 0; }

  strm.avail_in -= len;

  // zmemcpy(buf, strm->next_in, len);
  utils.arraySet(buf, strm.input, strm.next_in, len, start);
  if (strm.state.wrap === 1) {
    strm.adler = adler32(strm.adler, buf, len, start);
  }

  else if (strm.state.wrap === 2) {
    strm.adler = crc32(strm.adler, buf, len, start);
  }

  strm.next_in += len;
  strm.total_in += len;

  return len;
}


/* ===========================================================================
 * Set match_start to the longest match starting at the given string and
 * return its length. Matches shorter or equal to prev_length are discarded,
 * in which case the result is equal to prev_length and match_start is
 * garbage.
 * IN assertions: cur_match is the head of the hash chain for the current
 *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
 * OUT assertion: the match length is not greater than s->lookahead.
 */
function longest_match(s, cur_match) {
  var chain_length = s.max_chain_length;      /* max hash chain length */
  var scan = s.strstart; /* current string */
  var match;                       /* matched string */
  var len;                           /* length of current match */
  var best_len = s.prev_length;              /* best match length so far */
  var nice_match = s.nice_match;             /* stop if match long enough */
  var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
      s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;

  var _win = s.window; // shortcut

  var wmask = s.w_mask;
  var prev  = s.prev;

  /* Stop when cur_match becomes <= limit. To simplify the code,
   * we prevent matches with the string of window index 0.
   */

  var strend = s.strstart + MAX_MATCH;
  var scan_end1  = _win[scan + best_len - 1];
  var scan_end   = _win[scan + best_len];

  /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
   * It is easy to get rid of this optimization if necessary.
   */
  // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");

  /* Do not waste too much time if we already have a good match: */
  if (s.prev_length >= s.good_match) {
    chain_length >>= 2;
  }
  /* Do not look for matches beyond the end of the input. This is necessary
   * to make deflate deterministic.
   */
  if (nice_match > s.lookahead) { nice_match = s.lookahead; }

  // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");

  do {
    // Assert(cur_match < s->strstart, "no future");
    match = cur_match;

    /* Skip to next match if the match length cannot increase
     * or if the match length is less than 2.  Note that the checks below
     * for insufficient lookahead only occur occasionally for performance
     * reasons.  Therefore uninitialized memory will be accessed, and
     * conditional jumps will be made that depend on those values.
     * However the length of the match is limited to the lookahead, so
     * the output of deflate is not affected by the uninitialized values.
     */

    if (_win[match + best_len]     !== scan_end  ||
        _win[match + best_len - 1] !== scan_end1 ||
        _win[match]                !== _win[scan] ||
        _win[++match]              !== _win[scan + 1]) {
      continue;
    }

    /* The check at best_len-1 can be removed because it will be made
     * again later. (This heuristic is not always a win.)
     * It is not necessary to compare scan[2] and match[2] since they
     * are always equal when the other bytes match, given that
     * the hash keys are equal and that HASH_BITS >= 8.
     */
    scan += 2;
    match++;
    // Assert(*scan == *match, "match[2]?");

    /* We check for insufficient lookahead only every 8th comparison;
     * the 256th check will be made at strstart+258.
     */
    do {
      /*jshint noempty:false*/
    } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             scan < strend);

    // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");

    len = MAX_MATCH - (strend - scan);
    scan = strend - MAX_MATCH;

    if (len > best_len) {
      s.match_start = cur_match;
      best_len = len;
      if (len >= nice_match) {
        break;
      }
      scan_end1  = _win[scan + best_len - 1];
      scan_end   = _win[scan + best_len];
    }
  } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);

  if (best_len <= s.lookahead) {
    return best_len;
  }
  return s.lookahead;
}


/* ===========================================================================
 * Fill the window when the lookahead becomes insufficient.
 * Updates strstart and lookahead.
 *
 * IN assertion: lookahead < MIN_LOOKAHEAD
 * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
 *    At least one byte has been read, or avail_in == 0; reads are
 *    performed for at least two bytes (required for the zip translate_eol
 *    option -- not supported here).
 */
function fill_window(s) {
  var _w_size = s.w_size;
  var p, n, m, more, str;

  //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");

  do {
    more = s.window_size - s.lookahead - s.strstart;

    // JS ints have 32 bit, block below not needed
    /* Deal with !@#$% 64K limit: */
    //if (sizeof(int) <= 2) {
    //    if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
    //        more = wsize;
    //
    //  } else if (more == (unsigned)(-1)) {
    //        /* Very unlikely, but possible on 16 bit machine if
    //         * strstart == 0 && lookahead == 1 (input done a byte at time)
    //         */
    //        more--;
    //    }
    //}


    /* If the window is almost full and there is insufficient lookahead,
     * move the upper half to the lower one to make room in the upper half.
     */
    if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {

      utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
      s.match_start -= _w_size;
      s.strstart -= _w_size;
      /* we now have strstart >= MAX_DIST */
      s.block_start -= _w_size;

      /* Slide the hash table (could be avoided with 32 bit values
       at the expense of memory usage). We slide even when level == 0
       to keep the hash table consistent if we switch back to level > 0
       later. (Using level 0 permanently is not an optimal usage of
       zlib, so we don't care about this pathological case.)
       */

      n = s.hash_size;
      p = n;
      do {
        m = s.head[--p];
        s.head[p] = (m >= _w_size ? m - _w_size : 0);
      } while (--n);

      n = _w_size;
      p = n;
      do {
        m = s.prev[--p];
        s.prev[p] = (m >= _w_size ? m - _w_size : 0);
        /* If n is not on any hash chain, prev[n] is garbage but
         * its value will never be used.
         */
      } while (--n);

      more += _w_size;
    }
    if (s.strm.avail_in === 0) {
      break;
    }

    /* If there was no sliding:
     *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
     *    more == window_size - lookahead - strstart
     * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
     * => more >= window_size - 2*WSIZE + 2
     * In the BIG_MEM or MMAP case (not yet supported),
     *   window_size == input_size + MIN_LOOKAHEAD  &&
     *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
     * Otherwise, window_size == 2*WSIZE so more >= 2.
     * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
     */
    //Assert(more >= 2, "more < 2");
    n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
    s.lookahead += n;

    /* Initialize the hash value now that we have some input: */
    if (s.lookahead + s.insert >= MIN_MATCH) {
      str = s.strstart - s.insert;
      s.ins_h = s.window[str];

      /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
//#if MIN_MATCH != 3
//        Call update_hash() MIN_MATCH-3 more times
//#endif
      while (s.insert) {
        /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;

        s.prev[str & s.w_mask] = s.head[s.ins_h];
        s.head[s.ins_h] = str;
        str++;
        s.insert--;
        if (s.lookahead + s.insert < MIN_MATCH) {
          break;
        }
      }
    }
    /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
     * but this is not important since only literal bytes will be emitted.
     */

  } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);

  /* If the WIN_INIT bytes after the end of the current data have never been
   * written, then zero those bytes in order to avoid memory check reports of
   * the use of uninitialized (or uninitialised as Julian writes) bytes by
   * the longest match routines.  Update the high water mark for the next
   * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
   * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
   */
//  if (s.high_water < s.window_size) {
//    var curr = s.strstart + s.lookahead;
//    var init = 0;
//
//    if (s.high_water < curr) {
//      /* Previous high water mark below current data -- zero WIN_INIT
//       * bytes or up to end of window, whichever is less.
//       */
//      init = s.window_size - curr;
//      if (init > WIN_INIT)
//        init = WIN_INIT;
//      zmemzero(s->window + curr, (unsigned)init);
//      s->high_water = curr + init;
//    }
//    else if (s->high_water < (ulg)curr + WIN_INIT) {
//      /* High water mark at or above current data, but below current data
//       * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
//       * to end of window, whichever is less.
//       */
//      init = (ulg)curr + WIN_INIT - s->high_water;
//      if (init > s->window_size - s->high_water)
//        init = s->window_size - s->high_water;
//      zmemzero(s->window + s->high_water, (unsigned)init);
//      s->high_water += init;
//    }
//  }
//
//  Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
//    "not enough room for search");
}

/* ===========================================================================
 * Copy without compression as much as possible from the input stream, return
 * the current block state.
 * This function does not insert new strings in the dictionary since
 * uncompressible data is probably not useful. This function is used
 * only for the level=0 compression option.
 * NOTE: this function should be optimized to avoid extra copying from
 * window to pending_buf.
 */
function deflate_stored(s, flush) {
  /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
   * to pending_buf_size, and each stored block has a 5 byte header:
   */
  var max_block_size = 0xffff;

  if (max_block_size > s.pending_buf_size - 5) {
    max_block_size = s.pending_buf_size - 5;
  }

  /* Copy as much as possible from input to output: */
  for (;;) {
    /* Fill the window as much as possible: */
    if (s.lookahead <= 1) {

      //Assert(s->strstart < s->w_size+MAX_DIST(s) ||
      //  s->block_start >= (long)s->w_size, "slide too late");
//      if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
//        s.block_start >= s.w_size)) {
//        throw  new Error("slide too late");
//      }

      fill_window(s);
      if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }

      if (s.lookahead === 0) {
        break;
      }
      /* flush the current block */
    }
    //Assert(s->block_start >= 0L, "block gone");
//    if (s.block_start < 0) throw new Error("block gone");

    s.strstart += s.lookahead;
    s.lookahead = 0;

    /* Emit a stored block if pending_buf will be full: */
    var max_start = s.block_start + max_block_size;

    if (s.strstart === 0 || s.strstart >= max_start) {
      /* strstart == 0 is possible when wraparound on 16-bit machine */
      s.lookahead = s.strstart - max_start;
      s.strstart = max_start;
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/


    }
    /* Flush if we may have to slide, otherwise block_start may become
     * negative and the data will be gone:
     */
    if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }

  s.insert = 0;

  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }

  if (s.strstart > s.block_start) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }

  return BS_NEED_MORE;
}

/* ===========================================================================
 * Compress as much as possible from the input stream, return the current
 * block state.
 * This function does not perform lazy evaluation of matches and inserts
 * new strings in the dictionary only for unmatched strings or for short
 * matches. It is used only for the fast compression options.
 */
function deflate_fast(s, flush) {
  var hash_head;        /* head of the hash chain */
  var bflush;           /* set if current block must be flushed */

  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the next match, plus MIN_MATCH bytes to insert the
     * string following the next match.
     */
    if (s.lookahead < MIN_LOOKAHEAD) {
      fill_window(s);
      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) {
        break; /* flush the current block */
      }
    }

    /* Insert the string window[strstart .. strstart+2] in the
     * dictionary, and set hash_head to the head of the hash chain:
     */
    hash_head = 0/*NIL*/;
    if (s.lookahead >= MIN_MATCH) {
      /*** INSERT_STRING(s, s.strstart, hash_head); ***/
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
      s.head[s.ins_h] = s.strstart;
      /***/
    }

    /* Find the longest match, discarding those <= prev_length.
     * At this point we have always match_length < MIN_MATCH
     */
    if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
      /* To simplify the code, we prevent matches with the string
       * of window index 0 (in particular we have to avoid a match
       * of the string with itself at the start of the input file).
       */
      s.match_length = longest_match(s, hash_head);
      /* longest_match() sets match_start */
    }
    if (s.match_length >= MIN_MATCH) {
      // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only

      /*** _tr_tally_dist(s, s.strstart - s.match_start,
                     s.match_length - MIN_MATCH, bflush); ***/
      bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);

      s.lookahead -= s.match_length;

      /* Insert new strings in the hash table only if the match length
       * is not too large. This saves time but degrades compression.
       */
      if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
        s.match_length--; /* string at strstart already in table */
        do {
          s.strstart++;
          /*** INSERT_STRING(s, s.strstart, hash_head); ***/
          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = s.strstart;
          /***/
          /* strstart never exceeds WSIZE-MAX_MATCH, so there are
           * always MIN_MATCH bytes ahead.
           */
        } while (--s.match_length !== 0);
        s.strstart++;
      } else
      {
        s.strstart += s.match_length;
        s.match_length = 0;
        s.ins_h = s.window[s.strstart];
        /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;

//#if MIN_MATCH != 3
//                Call UPDATE_HASH() MIN_MATCH-3 more times
//#endif
        /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
         * matter since it will be recomputed at next deflate call.
         */
      }
    } else {
      /* No match, output a literal byte */
      //Tracevv((stderr,"%c", s.window[s.strstart]));
      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);

      s.lookahead--;
      s.strstart++;
    }
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* ===========================================================================
 * Same as above, but achieves better compression. We use a lazy
 * evaluation for matches: a match is finally adopted only if there is
 * no better match at the next window position.
 */
function deflate_slow(s, flush) {
  var hash_head;          /* head of hash chain */
  var bflush;              /* set if current block must be flushed */

  var max_insert;

  /* Process the input block. */
  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the next match, plus MIN_MATCH bytes to insert the
     * string following the next match.
     */
    if (s.lookahead < MIN_LOOKAHEAD) {
      fill_window(s);
      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) { break; } /* flush the current block */
    }

    /* Insert the string window[strstart .. strstart+2] in the
     * dictionary, and set hash_head to the head of the hash chain:
     */
    hash_head = 0/*NIL*/;
    if (s.lookahead >= MIN_MATCH) {
      /*** INSERT_STRING(s, s.strstart, hash_head); ***/
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
      s.head[s.ins_h] = s.strstart;
      /***/
    }

    /* Find the longest match, discarding those <= prev_length.
     */
    s.prev_length = s.match_length;
    s.prev_match = s.match_start;
    s.match_length = MIN_MATCH - 1;

    if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
        s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
      /* To simplify the code, we prevent matches with the string
       * of window index 0 (in particular we have to avoid a match
       * of the string with itself at the start of the input file).
       */
      s.match_length = longest_match(s, hash_head);
      /* longest_match() sets match_start */

      if (s.match_length <= 5 &&
         (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {

        /* If prev_match is also MIN_MATCH, match_start is garbage
         * but we will ignore the current match anyway.
         */
        s.match_length = MIN_MATCH - 1;
      }
    }
    /* If there was a match at the previous step and the current
     * match is not better, output the previous match:
     */
    if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
      max_insert = s.strstart + s.lookahead - MIN_MATCH;
      /* Do not insert strings in hash table beyond this. */

      //check_match(s, s.strstart-1, s.prev_match, s.prev_length);

      /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
                     s.prev_length - MIN_MATCH, bflush);***/
      bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
      /* Insert in hash table all strings up to the end of the match.
       * strstart-1 and strstart are already inserted. If there is not
       * enough lookahead, the last two strings are not inserted in
       * the hash table.
       */
      s.lookahead -= s.prev_length - 1;
      s.prev_length -= 2;
      do {
        if (++s.strstart <= max_insert) {
          /*** INSERT_STRING(s, s.strstart, hash_head); ***/
          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = s.strstart;
          /***/
        }
      } while (--s.prev_length !== 0);
      s.match_available = 0;
      s.match_length = MIN_MATCH - 1;
      s.strstart++;

      if (bflush) {
        /*** FLUSH_BLOCK(s, 0); ***/
        flush_block_only(s, false);
        if (s.strm.avail_out === 0) {
          return BS_NEED_MORE;
        }
        /***/
      }

    } else if (s.match_available) {
      /* If there was no match at the previous position, output a
       * single literal. If there was a match but the current match
       * is longer, truncate the previous match to a single literal.
       */
      //Tracevv((stderr,"%c", s->window[s->strstart-1]));
      /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);

      if (bflush) {
        /*** FLUSH_BLOCK_ONLY(s, 0) ***/
        flush_block_only(s, false);
        /***/
      }
      s.strstart++;
      s.lookahead--;
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
    } else {
      /* There is no previous match to compare with, wait for
       * the next step to decide.
       */
      s.match_available = 1;
      s.strstart++;
      s.lookahead--;
    }
  }
  //Assert (flush != Z_NO_FLUSH, "no flush?");
  if (s.match_available) {
    //Tracevv((stderr,"%c", s->window[s->strstart-1]));
    /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
    bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);

    s.match_available = 0;
  }
  s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }

  return BS_BLOCK_DONE;
}


/* ===========================================================================
 * For Z_RLE, simply look for runs of bytes, generate matches only of distance
 * one.  Do not maintain a hash table.  (It will be regenerated if this run of
 * deflate switches away from Z_RLE.)
 */
function deflate_rle(s, flush) {
  var bflush;            /* set if current block must be flushed */
  var prev;              /* byte at distance one to match */
  var scan, strend;      /* scan goes up to strend for length of run */

  var _win = s.window;

  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the longest run, plus one for the unrolled loop.
     */
    if (s.lookahead <= MAX_MATCH) {
      fill_window(s);
      if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) { break; } /* flush the current block */
    }

    /* See how many times the previous byte repeats */
    s.match_length = 0;
    if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
      scan = s.strstart - 1;
      prev = _win[scan];
      if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
        strend = s.strstart + MAX_MATCH;
        do {
          /*jshint noempty:false*/
        } while (prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 scan < strend);
        s.match_length = MAX_MATCH - (strend - scan);
        if (s.match_length > s.lookahead) {
          s.match_length = s.lookahead;
        }
      }
      //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
    }

    /* Emit match if have run of MIN_MATCH or longer, else emit literal */
    if (s.match_length >= MIN_MATCH) {
      //check_match(s, s.strstart, s.strstart - 1, s.match_length);

      /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
      bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);

      s.lookahead -= s.match_length;
      s.strstart += s.match_length;
      s.match_length = 0;
    } else {
      /* No match, output a literal byte */
      //Tracevv((stderr,"%c", s->window[s->strstart]));
      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);

      s.lookahead--;
      s.strstart++;
    }
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = 0;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* ===========================================================================
 * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
 * (It will be regenerated if this run of deflate switches away from Huffman.)
 */
function deflate_huff(s, flush) {
  var bflush;             /* set if current block must be flushed */

  for (;;) {
    /* Make sure that we have a literal to write. */
    if (s.lookahead === 0) {
      fill_window(s);
      if (s.lookahead === 0) {
        if (flush === Z_NO_FLUSH) {
          return BS_NEED_MORE;
        }
        break;      /* flush the current block */
      }
    }

    /* Output a literal byte */
    s.match_length = 0;
    //Tracevv((stderr,"%c", s->window[s->strstart]));
    /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
    bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
    s.lookahead--;
    s.strstart++;
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = 0;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* Values for max_lazy_match, good_match and max_chain_length, depending on
 * the desired pack level (0..9). The values given below have been tuned to
 * exclude worst case performance for pathological files. Better values may be
 * found for specific files.
 */
function Config(good_length, max_lazy, nice_length, max_chain, func) {
  this.good_length = good_length;
  this.max_lazy = max_lazy;
  this.nice_length = nice_length;
  this.max_chain = max_chain;
  this.func = func;
}

var configuration_table;

configuration_table = [
  /*      good lazy nice chain */
  new Config(0, 0, 0, 0, deflate_stored),          /* 0 store only */
  new Config(4, 4, 8, 4, deflate_fast),            /* 1 max speed, no lazy matches */
  new Config(4, 5, 16, 8, deflate_fast),           /* 2 */
  new Config(4, 6, 32, 32, deflate_fast),          /* 3 */

  new Config(4, 4, 16, 16, deflate_slow),          /* 4 lazy matches */
  new Config(8, 16, 32, 32, deflate_slow),         /* 5 */
  new Config(8, 16, 128, 128, deflate_slow),       /* 6 */
  new Config(8, 32, 128, 256, deflate_slow),       /* 7 */
  new Config(32, 128, 258, 1024, deflate_slow),    /* 8 */
  new Config(32, 258, 258, 4096, deflate_slow)     /* 9 max compression */
];


/* ===========================================================================
 * Initialize the "longest match" routines for a new zlib stream
 */
function lm_init(s) {
  s.window_size = 2 * s.w_size;

  /*** CLEAR_HASH(s); ***/
  zero(s.head); // Fill with NIL (= 0);

  /* Set the default configuration parameters:
   */
  s.max_lazy_match = configuration_table[s.level].max_lazy;
  s.good_match = configuration_table[s.level].good_length;
  s.nice_match = configuration_table[s.level].nice_length;
  s.max_chain_length = configuration_table[s.level].max_chain;

  s.strstart = 0;
  s.block_start = 0;
  s.lookahead = 0;
  s.insert = 0;
  s.match_length = s.prev_length = MIN_MATCH - 1;
  s.match_available = 0;
  s.ins_h = 0;
}


function DeflateState() {
  this.strm = null;            /* pointer back to this zlib stream */
  this.status = 0;            /* as the name implies */
  this.pending_buf = null;      /* output still pending */
  this.pending_buf_size = 0;  /* size of pending_buf */
  this.pending_out = 0;       /* next pending byte to output to the stream */
  this.pending = 0;           /* nb of bytes in the pending buffer */
  this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */
  this.gzhead = null;         /* gzip header information to write */
  this.gzindex = 0;           /* where in extra, name, or comment */
  this.method = Z_DEFLATED; /* can only be DEFLATED */
  this.last_flush = -1;   /* value of flush param for previous deflate call */

  this.w_size = 0;  /* LZ77 window size (32K by default) */
  this.w_bits = 0;  /* log2(w_size)  (8..16) */
  this.w_mask = 0;  /* w_size - 1 */

  this.window = null;
  /* Sliding window. Input bytes are read into the second half of the window,
   * and move to the first half later to keep a dictionary of at least wSize
   * bytes. With this organization, matches are limited to a distance of
   * wSize-MAX_MATCH bytes, but this ensures that IO is always
   * performed with a length multiple of the block size.
   */

  this.window_size = 0;
  /* Actual size of window: 2*wSize, except when the user input buffer
   * is directly used as sliding window.
   */

  this.prev = null;
  /* Link to older string with same hash index. To limit the size of this
   * array to 64K, this link is maintained only for the last 32K strings.
   * An index in this array is thus a window index modulo 32K.
   */

  this.head = null;   /* Heads of the hash chains or NIL. */

  this.ins_h = 0;       /* hash index of string to be inserted */
  this.hash_size = 0;   /* number of elements in hash table */
  this.hash_bits = 0;   /* log2(hash_size) */
  this.hash_mask = 0;   /* hash_size-1 */

  this.hash_shift = 0;
  /* Number of bits by which ins_h must be shifted at each input
   * step. It must be such that after MIN_MATCH steps, the oldest
   * byte no longer takes part in the hash key, that is:
   *   hash_shift * MIN_MATCH >= hash_bits
   */

  this.block_start = 0;
  /* Window position at the beginning of the current output block. Gets
   * negative when the window is moved backwards.
   */

  this.match_length = 0;      /* length of best match */
  this.prev_match = 0;        /* previous match */
  this.match_available = 0;   /* set if previous match exists */
  this.strstart = 0;          /* start of string to insert */
  this.match_start = 0;       /* start of matching string */
  this.lookahead = 0;         /* number of valid bytes ahead in window */

  this.prev_length = 0;
  /* Length of the best match at previous step. Matches not greater than this
   * are discarded. This is used in the lazy match evaluation.
   */

  this.max_chain_length = 0;
  /* To speed up deflation, hash chains are never searched beyond this
   * length.  A higher limit improves compression ratio but degrades the
   * speed.
   */

  this.max_lazy_match = 0;
  /* Attempt to find a better match only when the current match is strictly
   * smaller than this value. This mechanism is used only for compression
   * levels >= 4.
   */
  // That's alias to max_lazy_match, don't use directly
  //this.max_insert_length = 0;
  /* Insert new strings in the hash table only if the match length is not
   * greater than this length. This saves time but degrades compression.
   * max_insert_length is used only for compression levels <= 3.
   */

  this.level = 0;     /* compression level (1..9) */
  this.strategy = 0;  /* favor or force Huffman coding*/

  this.good_match = 0;
  /* Use a faster search when the previous match is longer than this */

  this.nice_match = 0; /* Stop searching when current match exceeds this */

              /* used by trees.c: */

  /* Didn't use ct_data typedef below to suppress compiler warning */

  // struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
  // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
  // struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */

  // Use flat array of DOUBLE size, with interleaved fata,
  // because JS does not support effective
  this.dyn_ltree  = new utils.Buf16(HEAP_SIZE * 2);
  this.dyn_dtree  = new utils.Buf16((2 * D_CODES + 1) * 2);
  this.bl_tree    = new utils.Buf16((2 * BL_CODES + 1) * 2);
  zero(this.dyn_ltree);
  zero(this.dyn_dtree);
  zero(this.bl_tree);

  this.l_desc   = null;         /* desc. for literal tree */
  this.d_desc   = null;         /* desc. for distance tree */
  this.bl_desc  = null;         /* desc. for bit length tree */

  //ush bl_count[MAX_BITS+1];
  this.bl_count = new utils.Buf16(MAX_BITS + 1);
  /* number of codes at each bit length for an optimal tree */

  //int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
  this.heap = new utils.Buf16(2 * L_CODES + 1);  /* heap used to build the Huffman trees */
  zero(this.heap);

  this.heap_len = 0;               /* number of elements in the heap */
  this.heap_max = 0;               /* element of largest frequency */
  /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
   * The same heap array is used to build all trees.
   */

  this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
  zero(this.depth);
  /* Depth of each subtree used as tie breaker for trees of equal frequency
   */

  this.l_buf = 0;          /* buffer index for literals or lengths */

  this.lit_bufsize = 0;
  /* Size of match buffer for literals/lengths.  There are 4 reasons for
   * limiting lit_bufsize to 64K:
   *   - frequencies can be kept in 16 bit counters
   *   - if compression is not successful for the first block, all input
   *     data is still in the window so we can still emit a stored block even
   *     when input comes from standard input.  (This can also be done for
   *     all blocks if lit_bufsize is not greater than 32K.)
   *   - if compression is not successful for a file smaller than 64K, we can
   *     even emit a stored file instead of a stored block (saving 5 bytes).
   *     This is applicable only for zip (not gzip or zlib).
   *   - creating new Huffman trees less frequently may not provide fast
   *     adaptation to changes in the input data statistics. (Take for
   *     example a binary file with poorly compressible code followed by
   *     a highly compressible string table.) Smaller buffer sizes give
   *     fast adaptation but have of course the overhead of transmitting
   *     trees more frequently.
   *   - I can't count above 4
   */

  this.last_lit = 0;      /* running index in l_buf */

  this.d_buf = 0;
  /* Buffer index for distances. To simplify the code, d_buf and l_buf have
   * the same number of elements. To use different lengths, an extra flag
   * array would be necessary.
   */

  this.opt_len = 0;       /* bit length of current block with optimal trees */
  this.static_len = 0;    /* bit length of current block with static trees */
  this.matches = 0;       /* number of string matches in current block */
  this.insert = 0;        /* bytes at end of window left to insert */


  this.bi_buf = 0;
  /* Output buffer. bits are inserted starting at the bottom (least
   * significant bits).
   */
  this.bi_valid = 0;
  /* Number of valid bits in bi_buf.  All bits above the last valid bit
   * are always zero.
   */

  // Used for window memory init. We safely ignore it for JS. That makes
  // sense only for pointers and memory check tools.
  //this.high_water = 0;
  /* High water mark offset in window for initialized bytes -- bytes above
   * this are set to zero in order to avoid memory check warnings when
   * longest match routines access bytes past the input.  This is then
   * updated to the new high water mark.
   */
}


function deflateResetKeep(strm) {
  var s;

  if (!strm || !strm.state) {
    return err(strm, Z_STREAM_ERROR);
  }

  strm.total_in = strm.total_out = 0;
  strm.data_type = Z_UNKNOWN;

  s = strm.state;
  s.pending = 0;
  s.pending_out = 0;

  if (s.wrap < 0) {
    s.wrap = -s.wrap;
    /* was made negative by deflate(..., Z_FINISH); */
  }
  s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
  strm.adler = (s.wrap === 2) ?
    0  // crc32(0, Z_NULL, 0)
  :
    1; // adler32(0, Z_NULL, 0)
  s.last_flush = Z_NO_FLUSH;
  trees._tr_init(s);
  return Z_OK;
}


function deflateReset(strm) {
  var ret = deflateResetKeep(strm);
  if (ret === Z_OK) {
    lm_init(strm.state);
  }
  return ret;
}


function deflateSetHeader(strm, head) {
  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
  strm.state.gzhead = head;
  return Z_OK;
}


function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
  if (!strm) { // === Z_NULL
    return Z_STREAM_ERROR;
  }
  var wrap = 1;

  if (level === Z_DEFAULT_COMPRESSION) {
    level = 6;
  }

  if (windowBits < 0) { /* suppress zlib wrapper */
    wrap = 0;
    windowBits = -windowBits;
  }

  else if (windowBits > 15) {
    wrap = 2;           /* write gzip wrapper instead */
    windowBits -= 16;
  }


  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
    windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
    strategy < 0 || strategy > Z_FIXED) {
    return err(strm, Z_STREAM_ERROR);
  }


  if (windowBits === 8) {
    windowBits = 9;
  }
  /* until 256-byte window bug fixed */

  var s = new DeflateState();

  strm.state = s;
  s.strm = strm;

  s.wrap = wrap;
  s.gzhead = null;
  s.w_bits = windowBits;
  s.w_size = 1 << s.w_bits;
  s.w_mask = s.w_size - 1;

  s.hash_bits = memLevel + 7;
  s.hash_size = 1 << s.hash_bits;
  s.hash_mask = s.hash_size - 1;
  s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);

  s.window = new utils.Buf8(s.w_size * 2);
  s.head = new utils.Buf16(s.hash_size);
  s.prev = new utils.Buf16(s.w_size);

  // Don't need mem init magic for JS.
  //s.high_water = 0;  /* nothing written to s->window yet */

  s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */

  s.pending_buf_size = s.lit_bufsize * 4;

  //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
  //s->pending_buf = (uchf *) overlay;
  s.pending_buf = new utils.Buf8(s.pending_buf_size);

  // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)
  //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
  s.d_buf = 1 * s.lit_bufsize;

  //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
  s.l_buf = (1 + 2) * s.lit_bufsize;

  s.level = level;
  s.strategy = strategy;
  s.method = method;

  return deflateReset(strm);
}

function deflateInit(strm, level) {
  return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
}


function deflate(strm, flush) {
  var old_flush, s;
  var beg, val; // for gzip header write only

  if (!strm || !strm.state ||
    flush > Z_BLOCK || flush < 0) {
    return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
  }

  s = strm.state;

  if (!strm.output ||
      (!strm.input && strm.avail_in !== 0) ||
      (s.status === FINISH_STATE && flush !== Z_FINISH)) {
    return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
  }

  s.strm = strm; /* just in case */
  old_flush = s.last_flush;
  s.last_flush = flush;

  /* Write the header */
  if (s.status === INIT_STATE) {

    if (s.wrap === 2) { // GZIP header
      strm.adler = 0;  //crc32(0L, Z_NULL, 0);
      put_byte(s, 31);
      put_byte(s, 139);
      put_byte(s, 8);
      if (!s.gzhead) { // s->gzhead == Z_NULL
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, s.level === 9 ? 2 :
                    (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
                     4 : 0));
        put_byte(s, OS_CODE);
        s.status = BUSY_STATE;
      }
      else {
        put_byte(s, (s.gzhead.text ? 1 : 0) +
                    (s.gzhead.hcrc ? 2 : 0) +
                    (!s.gzhead.extra ? 0 : 4) +
                    (!s.gzhead.name ? 0 : 8) +
                    (!s.gzhead.comment ? 0 : 16)
        );
        put_byte(s, s.gzhead.time & 0xff);
        put_byte(s, (s.gzhead.time >> 8) & 0xff);
        put_byte(s, (s.gzhead.time >> 16) & 0xff);
        put_byte(s, (s.gzhead.time >> 24) & 0xff);
        put_byte(s, s.level === 9 ? 2 :
                    (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
                     4 : 0));
        put_byte(s, s.gzhead.os & 0xff);
        if (s.gzhead.extra && s.gzhead.extra.length) {
          put_byte(s, s.gzhead.extra.length & 0xff);
          put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
        }
        if (s.gzhead.hcrc) {
          strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
        }
        s.gzindex = 0;
        s.status = EXTRA_STATE;
      }
    }
    else // DEFLATE header
    {
      var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
      var level_flags = -1;

      if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
        level_flags = 0;
      } else if (s.level < 6) {
        level_flags = 1;
      } else if (s.level === 6) {
        level_flags = 2;
      } else {
        level_flags = 3;
      }
      header |= (level_flags << 6);
      if (s.strstart !== 0) { header |= PRESET_DICT; }
      header += 31 - (header % 31);

      s.status = BUSY_STATE;
      putShortMSB(s, header);

      /* Save the adler32 of the preset dictionary: */
      if (s.strstart !== 0) {
        putShortMSB(s, strm.adler >>> 16);
        putShortMSB(s, strm.adler & 0xffff);
      }
      strm.adler = 1; // adler32(0L, Z_NULL, 0);
    }
  }

//#ifdef GZIP
  if (s.status === EXTRA_STATE) {
    if (s.gzhead.extra/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */

      while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            break;
          }
        }
        put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
        s.gzindex++;
      }
      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (s.gzindex === s.gzhead.extra.length) {
        s.gzindex = 0;
        s.status = NAME_STATE;
      }
    }
    else {
      s.status = NAME_STATE;
    }
  }
  if (s.status === NAME_STATE) {
    if (s.gzhead.name/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */
      //int val;

      do {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            val = 1;
            break;
          }
        }
        // JS specific: little magic to add zero terminator to end of string
        if (s.gzindex < s.gzhead.name.length) {
          val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
        } else {
          val = 0;
        }
        put_byte(s, val);
      } while (val !== 0);

      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (val === 0) {
        s.gzindex = 0;
        s.status = COMMENT_STATE;
      }
    }
    else {
      s.status = COMMENT_STATE;
    }
  }
  if (s.status === COMMENT_STATE) {
    if (s.gzhead.comment/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */
      //int val;

      do {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            val = 1;
            break;
          }
        }
        // JS specific: little magic to add zero terminator to end of string
        if (s.gzindex < s.gzhead.comment.length) {
          val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
        } else {
          val = 0;
        }
        put_byte(s, val);
      } while (val !== 0);

      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (val === 0) {
        s.status = HCRC_STATE;
      }
    }
    else {
      s.status = HCRC_STATE;
    }
  }
  if (s.status === HCRC_STATE) {
    if (s.gzhead.hcrc) {
      if (s.pending + 2 > s.pending_buf_size) {
        flush_pending(strm);
      }
      if (s.pending + 2 <= s.pending_buf_size) {
        put_byte(s, strm.adler & 0xff);
        put_byte(s, (strm.adler >> 8) & 0xff);
        strm.adler = 0; //crc32(0L, Z_NULL, 0);
        s.status = BUSY_STATE;
      }
    }
    else {
      s.status = BUSY_STATE;
    }
  }
//#endif

  /* Flush as much pending output as possible */
  if (s.pending !== 0) {
    flush_pending(strm);
    if (strm.avail_out === 0) {
      /* Since avail_out is 0, deflate will be called again with
       * more output space, but possibly with both pending and
       * avail_in equal to zero. There won't be anything to do,
       * but this is not an error situation so make sure we
       * return OK instead of BUF_ERROR at next call of deflate:
       */
      s.last_flush = -1;
      return Z_OK;
    }

    /* Make sure there is something to do and avoid duplicate consecutive
     * flushes. For repeated and useless calls with Z_FINISH, we keep
     * returning Z_STREAM_END instead of Z_BUF_ERROR.
     */
  } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
    flush !== Z_FINISH) {
    return err(strm, Z_BUF_ERROR);
  }

  /* User must not provide more input after the first FINISH: */
  if (s.status === FINISH_STATE && strm.avail_in !== 0) {
    return err(strm, Z_BUF_ERROR);
  }

  /* Start a new block or continue the current one.
   */
  if (strm.avail_in !== 0 || s.lookahead !== 0 ||
    (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
    var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
      (s.strategy === Z_RLE ? deflate_rle(s, flush) :
        configuration_table[s.level].func(s, flush));

    if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
      s.status = FINISH_STATE;
    }
    if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
      if (strm.avail_out === 0) {
        s.last_flush = -1;
        /* avoid BUF_ERROR next call, see above */
      }
      return Z_OK;
      /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
       * of deflate should use the same flush parameter to make sure
       * that the flush is complete. So we don't have to output an
       * empty block here, this will be done at next call. This also
       * ensures that for a very small output buffer, we emit at most
       * one empty block.
       */
    }
    if (bstate === BS_BLOCK_DONE) {
      if (flush === Z_PARTIAL_FLUSH) {
        trees._tr_align(s);
      }
      else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */

        trees._tr_stored_block(s, 0, 0, false);
        /* For a full flush, this empty block will be recognized
         * as a special marker by inflate_sync().
         */
        if (flush === Z_FULL_FLUSH) {
          /*** CLEAR_HASH(s); ***/             /* forget history */
          zero(s.head); // Fill with NIL (= 0);

          if (s.lookahead === 0) {
            s.strstart = 0;
            s.block_start = 0;
            s.insert = 0;
          }
        }
      }
      flush_pending(strm);
      if (strm.avail_out === 0) {
        s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
        return Z_OK;
      }
    }
  }
  //Assert(strm->avail_out > 0, "bug2");
  //if (strm.avail_out <= 0) { throw new Error("bug2");}

  if (flush !== Z_FINISH) { return Z_OK; }
  if (s.wrap <= 0) { return Z_STREAM_END; }

  /* Write the trailer */
  if (s.wrap === 2) {
    put_byte(s, strm.adler & 0xff);
    put_byte(s, (strm.adler >> 8) & 0xff);
    put_byte(s, (strm.adler >> 16) & 0xff);
    put_byte(s, (strm.adler >> 24) & 0xff);
    put_byte(s, strm.total_in & 0xff);
    put_byte(s, (strm.total_in >> 8) & 0xff);
    put_byte(s, (strm.total_in >> 16) & 0xff);
    put_byte(s, (strm.total_in >> 24) & 0xff);
  }
  else
  {
    putShortMSB(s, strm.adler >>> 16);
    putShortMSB(s, strm.adler & 0xffff);
  }

  flush_pending(strm);
  /* If avail_out is zero, the application will call deflate again
   * to flush the rest.
   */
  if (s.wrap > 0) { s.wrap = -s.wrap; }
  /* write the trailer only once! */
  return s.pending !== 0 ? Z_OK : Z_STREAM_END;
}

function deflateEnd(strm) {
  var status;

  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
    return Z_STREAM_ERROR;
  }

  status = strm.state.status;
  if (status !== INIT_STATE &&
    status !== EXTRA_STATE &&
    status !== NAME_STATE &&
    status !== COMMENT_STATE &&
    status !== HCRC_STATE &&
    status !== BUSY_STATE &&
    status !== FINISH_STATE
  ) {
    return err(strm, Z_STREAM_ERROR);
  }

  strm.state = null;

  return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
}


/* =========================================================================
 * Initializes the compression dictionary from the given byte
 * sequence without producing any compressed output.
 */
function deflateSetDictionary(strm, dictionary) {
  var dictLength = dictionary.length;

  var s;
  var str, n;
  var wrap;
  var avail;
  var next;
  var input;
  var tmpDict;

  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
    return Z_STREAM_ERROR;
  }

  s = strm.state;
  wrap = s.wrap;

  if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
    return Z_STREAM_ERROR;
  }

  /* when using zlib wrappers, compute Adler-32 for provided dictionary */
  if (wrap === 1) {
    /* adler32(strm->adler, dictionary, dictLength); */
    strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
  }

  s.wrap = 0;   /* avoid computing Adler-32 in read_buf */

  /* if dictionary would fill window, just replace the history */
  if (dictLength >= s.w_size) {
    if (wrap === 0) {            /* already empty otherwise */
      /*** CLEAR_HASH(s); ***/
      zero(s.head); // Fill with NIL (= 0);
      s.strstart = 0;
      s.block_start = 0;
      s.insert = 0;
    }
    /* use the tail */
    // dictionary = dictionary.slice(dictLength - s.w_size);
    tmpDict = new utils.Buf8(s.w_size);
    utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
    dictionary = tmpDict;
    dictLength = s.w_size;
  }
  /* insert dictionary into window and hash */
  avail = strm.avail_in;
  next = strm.next_in;
  input = strm.input;
  strm.avail_in = dictLength;
  strm.next_in = 0;
  strm.input = dictionary;
  fill_window(s);
  while (s.lookahead >= MIN_MATCH) {
    str = s.strstart;
    n = s.lookahead - (MIN_MATCH - 1);
    do {
      /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;

      s.prev[str & s.w_mask] = s.head[s.ins_h];

      s.head[s.ins_h] = str;
      str++;
    } while (--n);
    s.strstart = str;
    s.lookahead = MIN_MATCH - 1;
    fill_window(s);
  }
  s.strstart += s.lookahead;
  s.block_start = s.strstart;
  s.insert = s.lookahead;
  s.lookahead = 0;
  s.match_length = s.prev_length = MIN_MATCH - 1;
  s.match_available = 0;
  strm.next_in = next;
  strm.input = input;
  strm.avail_in = avail;
  s.wrap = wrap;
  return Z_OK;
}


exports.deflateInit = deflateInit;
exports.deflateInit2 = deflateInit2;
exports.deflateReset = deflateReset;
exports.deflateResetKeep = deflateResetKeep;
exports.deflateSetHeader = deflateSetHeader;
exports.deflate = deflate;
exports.deflateEnd = deflateEnd;
exports.deflateSetDictionary = deflateSetDictionary;
exports.deflateInfo = 'pako deflate (from Nodeca project)';

/* Not implemented
exports.deflateBound = deflateBound;
exports.deflateCopy = deflateCopy;
exports.deflateParams = deflateParams;
exports.deflatePending = deflatePending;
exports.deflatePrime = deflatePrime;
exports.deflateTune = deflateTune;
*/


/***/ }),

/***/ 7293:
/***/ (function(module) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

// See state defs from inflate.js
var BAD = 30;       /* got a data error -- remain here until reset */
var TYPE = 12;      /* i: waiting for type bits, including last-flag bit */

/*
   Decode literal, length, and distance codes and write out the resulting
   literal and match bytes until either not enough input or output is
   available, an end-of-block is encountered, or a data error is encountered.
   When large enough input and output buffers are supplied to inflate(), for
   example, a 16K input buffer and a 64K output buffer, more than 95% of the
   inflate execution time is spent in this routine.

   Entry assumptions:

        state.mode === LEN
        strm.avail_in >= 6
        strm.avail_out >= 258
        start >= strm.avail_out
        state.bits < 8

   On return, state.mode is one of:

        LEN -- ran out of enough output space or enough available input
        TYPE -- reached end of block code, inflate() to interpret next block
        BAD -- error in block data

   Notes:

    - The maximum input bits used by a length/distance pair is 15 bits for the
      length code, 5 bits for the length extra, 15 bits for the distance code,
      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
      Therefore if strm.avail_in >= 6, then there is enough input to avoid
      checking for available input while decoding.

    - The maximum bytes that a single length/distance pair can output is 258
      bytes, which is the maximum length that can be coded.  inflate_fast()
      requires strm.avail_out >= 258 for each loop to avoid checking for
      output space.
 */
module.exports = function inflate_fast(strm, start) {
  var state;
  var _in;                    /* local strm.input */
  var last;                   /* have enough input while in < last */
  var _out;                   /* local strm.output */
  var beg;                    /* inflate()'s initial strm.output */
  var end;                    /* while out < end, enough space available */
//#ifdef INFLATE_STRICT
  var dmax;                   /* maximum distance from zlib header */
//#endif
  var wsize;                  /* window size or zero if not using window */
  var whave;                  /* valid bytes in the window */
  var wnext;                  /* window write index */
  // Use `s_window` instead `window`, avoid conflict with instrumentation tools
  var s_window;               /* allocated sliding window, if wsize != 0 */
  var hold;                   /* local strm.hold */
  var bits;                   /* local strm.bits */
  var lcode;                  /* local strm.lencode */
  var dcode;                  /* local strm.distcode */
  var lmask;                  /* mask for first level of length codes */
  var dmask;                  /* mask for first level of distance codes */
  var here;                   /* retrieved table entry */
  var op;                     /* code bits, operation, extra bits, or */
                              /*  window position, window bytes to copy */
  var len;                    /* match length, unused bytes */
  var dist;                   /* match distance */
  var from;                   /* where to copy match from */
  var from_source;


  var input, output; // JS specific, because we have no pointers

  /* copy state to local variables */
  state = strm.state;
  //here = state.here;
  _in = strm.next_in;
  input = strm.input;
  last = _in + (strm.avail_in - 5);
  _out = strm.next_out;
  output = strm.output;
  beg = _out - (start - strm.avail_out);
  end = _out + (strm.avail_out - 257);
//#ifdef INFLATE_STRICT
  dmax = state.dmax;
//#endif
  wsize = state.wsize;
  whave = state.whave;
  wnext = state.wnext;
  s_window = state.window;
  hold = state.hold;
  bits = state.bits;
  lcode = state.lencode;
  dcode = state.distcode;
  lmask = (1 << state.lenbits) - 1;
  dmask = (1 << state.distbits) - 1;


  /* decode literals and length/distances until end-of-block or not enough
     input data or output space */

  top:
  do {
    if (bits < 15) {
      hold += input[_in++] << bits;
      bits += 8;
      hold += input[_in++] << bits;
      bits += 8;
    }

    here = lcode[hold & lmask];

    dolen:
    for (;;) { // Goto emulation
      op = here >>> 24/*here.bits*/;
      hold >>>= op;
      bits -= op;
      op = (here >>> 16) & 0xff/*here.op*/;
      if (op === 0) {                          /* literal */
        //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
        //        "inflate:         literal '%c'\n" :
        //        "inflate:         literal 0x%02x\n", here.val));
        output[_out++] = here & 0xffff/*here.val*/;
      }
      else if (op & 16) {                     /* length base */
        len = here & 0xffff/*here.val*/;
        op &= 15;                           /* number of extra bits */
        if (op) {
          if (bits < op) {
            hold += input[_in++] << bits;
            bits += 8;
          }
          len += hold & ((1 << op) - 1);
          hold >>>= op;
          bits -= op;
        }
        //Tracevv((stderr, "inflate:         length %u\n", len));
        if (bits < 15) {
          hold += input[_in++] << bits;
          bits += 8;
          hold += input[_in++] << bits;
          bits += 8;
        }
        here = dcode[hold & dmask];

        dodist:
        for (;;) { // goto emulation
          op = here >>> 24/*here.bits*/;
          hold >>>= op;
          bits -= op;
          op = (here >>> 16) & 0xff/*here.op*/;

          if (op & 16) {                      /* distance base */
            dist = here & 0xffff/*here.val*/;
            op &= 15;                       /* number of extra bits */
            if (bits < op) {
              hold += input[_in++] << bits;
              bits += 8;
              if (bits < op) {
                hold += input[_in++] << bits;
                bits += 8;
              }
            }
            dist += hold & ((1 << op) - 1);
//#ifdef INFLATE_STRICT
            if (dist > dmax) {
              strm.msg = 'invalid distance too far back';
              state.mode = BAD;
              break top;
            }
//#endif
            hold >>>= op;
            bits -= op;
            //Tracevv((stderr, "inflate:         distance %u\n", dist));
            op = _out - beg;                /* max distance in output */
            if (dist > op) {                /* see if copy from window */
              op = dist - op;               /* distance back in window */
              if (op > whave) {
                if (state.sane) {
                  strm.msg = 'invalid distance too far back';
                  state.mode = BAD;
                  break top;
                }

// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
//                if (len <= op - whave) {
//                  do {
//                    output[_out++] = 0;
//                  } while (--len);
//                  continue top;
//                }
//                len -= op - whave;
//                do {
//                  output[_out++] = 0;
//                } while (--op > whave);
//                if (op === 0) {
//                  from = _out - dist;
//                  do {
//                    output[_out++] = output[from++];
//                  } while (--len);
//                  continue top;
//                }
//#endif
              }
              from = 0; // window index
              from_source = s_window;
              if (wnext === 0) {           /* very common case */
                from += wsize - op;
                if (op < len) {         /* some from window */
                  len -= op;
                  do {
                    output[_out++] = s_window[from++];
                  } while (--op);
                  from = _out - dist;  /* rest from output */
                  from_source = output;
                }
              }
              else if (wnext < op) {      /* wrap around window */
                from += wsize + wnext - op;
                op -= wnext;
                if (op < len) {         /* some from end of window */
                  len -= op;
                  do {
                    output[_out++] = s_window[from++];
                  } while (--op);
                  from = 0;
                  if (wnext < len) {  /* some from start of window */
                    op = wnext;
                    len -= op;
                    do {
                      output[_out++] = s_window[from++];
                    } while (--op);
                    from = _out - dist;      /* rest from output */
                    from_source = output;
                  }
                }
              }
              else {                      /* contiguous in window */
                from += wnext - op;
                if (op < len) {         /* some from window */
                  len -= op;
                  do {
                    output[_out++] = s_window[from++];
                  } while (--op);
                  from = _out - dist;  /* rest from output */
                  from_source = output;
                }
              }
              while (len > 2) {
                output[_out++] = from_source[from++];
                output[_out++] = from_source[from++];
                output[_out++] = from_source[from++];
                len -= 3;
              }
              if (len) {
                output[_out++] = from_source[from++];
                if (len > 1) {
                  output[_out++] = from_source[from++];
                }
              }
            }
            else {
              from = _out - dist;          /* copy direct from output */
              do {                        /* minimum length is three */
                output[_out++] = output[from++];
                output[_out++] = output[from++];
                output[_out++] = output[from++];
                len -= 3;
              } while (len > 2);
              if (len) {
                output[_out++] = output[from++];
                if (len > 1) {
                  output[_out++] = output[from++];
                }
              }
            }
          }
          else if ((op & 64) === 0) {          /* 2nd level distance code */
            here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
            continue dodist;
          }
          else {
            strm.msg = 'invalid distance code';
            state.mode = BAD;
            break top;
          }

          break; // need to emulate goto via "continue"
        }
      }
      else if ((op & 64) === 0) {              /* 2nd level length code */
        here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
        continue dolen;
      }
      else if (op & 32) {                     /* end-of-block */
        //Tracevv((stderr, "inflate:         end of block\n"));
        state.mode = TYPE;
        break top;
      }
      else {
        strm.msg = 'invalid literal/length code';
        state.mode = BAD;
        break top;
      }

      break; // need to emulate goto via "continue"
    }
  } while (_in < last && _out < end);

  /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  len = bits >> 3;
  _in -= len;
  bits -= len << 3;
  hold &= (1 << bits) - 1;

  /* update state and return */
  strm.next_in = _in;
  strm.next_out = _out;
  strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
  strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
  state.hold = hold;
  state.bits = bits;
  return;
};


/***/ }),

/***/ 1447:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

var utils         = __webpack_require__(9805);
var adler32       = __webpack_require__(3269);
var crc32         = __webpack_require__(4823);
var inflate_fast  = __webpack_require__(7293);
var inflate_table = __webpack_require__(1998);

var CODES = 0;
var LENS = 1;
var DISTS = 2;

/* Public constants ==========================================================*/
/* ===========================================================================*/


/* Allowed flush values; see deflate() and inflate() below for details */
//var Z_NO_FLUSH      = 0;
//var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH    = 2;
//var Z_FULL_FLUSH    = 3;
var Z_FINISH        = 4;
var Z_BLOCK         = 5;
var Z_TREES         = 6;


/* Return codes for the compression/decompression functions. Negative values
 * are errors, positive values are used for special but normal events.
 */
var Z_OK            = 0;
var Z_STREAM_END    = 1;
var Z_NEED_DICT     = 2;
//var Z_ERRNO         = -1;
var Z_STREAM_ERROR  = -2;
var Z_DATA_ERROR    = -3;
var Z_MEM_ERROR     = -4;
var Z_BUF_ERROR     = -5;
//var Z_VERSION_ERROR = -6;

/* The deflate compression method */
var Z_DEFLATED  = 8;


/* STATES ====================================================================*/
/* ===========================================================================*/


var    HEAD = 1;       /* i: waiting for magic header */
var    FLAGS = 2;      /* i: waiting for method and flags (gzip) */
var    TIME = 3;       /* i: waiting for modification time (gzip) */
var    OS = 4;         /* i: waiting for extra flags and operating system (gzip) */
var    EXLEN = 5;      /* i: waiting for extra length (gzip) */
var    EXTRA = 6;      /* i: waiting for extra bytes (gzip) */
var    NAME = 7;       /* i: waiting for end of file name (gzip) */
var    COMMENT = 8;    /* i: waiting for end of comment (gzip) */
var    HCRC = 9;       /* i: waiting for header crc (gzip) */
var    DICTID = 10;    /* i: waiting for dictionary check value */
var    DICT = 11;      /* waiting for inflateSetDictionary() call */
var        TYPE = 12;      /* i: waiting for type bits, including last-flag bit */
var        TYPEDO = 13;    /* i: same, but skip check to exit inflate on new block */
var        STORED = 14;    /* i: waiting for stored size (length and complement) */
var        COPY_ = 15;     /* i/o: same as COPY below, but only first time in */
var        COPY = 16;      /* i/o: waiting for input or output to copy stored block */
var        TABLE = 17;     /* i: waiting for dynamic block table lengths */
var        LENLENS = 18;   /* i: waiting for code length code lengths */
var        CODELENS = 19;  /* i: waiting for length/lit and distance code lengths */
var            LEN_ = 20;      /* i: same as LEN below, but only first time in */
var            LEN = 21;       /* i: waiting for length/lit/eob code */
var            LENEXT = 22;    /* i: waiting for length extra bits */
var            DIST = 23;      /* i: waiting for distance code */
var            DISTEXT = 24;   /* i: waiting for distance extra bits */
var            MATCH = 25;     /* o: waiting for output space to copy string */
var            LIT = 26;       /* o: waiting for output space to write literal */
var    CHECK = 27;     /* i: waiting for 32-bit check value */
var    LENGTH = 28;    /* i: waiting for 32-bit length (gzip) */
var    DONE = 29;      /* finished check, done -- remain here until reset */
var    BAD = 30;       /* got a data error -- remain here until reset */
var    MEM = 31;       /* got an inflate() memory error -- remain here until reset */
var    SYNC = 32;      /* looking for synchronization bytes to restart inflate() */

/* ===========================================================================*/



var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH =  (ENOUGH_LENS+ENOUGH_DISTS);

var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_WBITS = MAX_WBITS;


function zswap32(q) {
  return  (((q >>> 24) & 0xff) +
          ((q >>> 8) & 0xff00) +
          ((q & 0xff00) << 8) +
          ((q & 0xff) << 24));
}


function InflateState() {
  this.mode = 0;             /* current inflate mode */
  this.last = false;          /* true if processing last block */
  this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */
  this.havedict = false;      /* true if dictionary provided */
  this.flags = 0;             /* gzip header method and flags (0 if zlib) */
  this.dmax = 0;              /* zlib header max distance (INFLATE_STRICT) */
  this.check = 0;             /* protected copy of check value */
  this.total = 0;             /* protected copy of output count */
  // TODO: may be {}
  this.head = null;           /* where to save gzip header information */

  /* sliding window */
  this.wbits = 0;             /* log base 2 of requested window size */
  this.wsize = 0;             /* window size or zero if not using window */
  this.whave = 0;             /* valid bytes in the window */
  this.wnext = 0;             /* window write index */
  this.window = null;         /* allocated sliding window, if needed */

  /* bit accumulator */
  this.hold = 0;              /* input bit accumulator */
  this.bits = 0;              /* number of bits in "in" */

  /* for string and stored block copying */
  this.length = 0;            /* literal or length of data to copy */
  this.offset = 0;            /* distance back to copy string from */

  /* for table and code decoding */
  this.extra = 0;             /* extra bits needed */

  /* fixed and dynamic code tables */
  this.lencode = null;          /* starting table for length/literal codes */
  this.distcode = null;         /* starting table for distance codes */
  this.lenbits = 0;           /* index bits for lencode */
  this.distbits = 0;          /* index bits for distcode */

  /* dynamic table building */
  this.ncode = 0;             /* number of code length code lengths */
  this.nlen = 0;              /* number of length code lengths */
  this.ndist = 0;             /* number of distance code lengths */
  this.have = 0;              /* number of code lengths in lens[] */
  this.next = null;              /* next available space in codes[] */

  this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
  this.work = new utils.Buf16(288); /* work area for code table building */

  /*
   because we don't have pointers in js, we use lencode and distcode directly
   as buffers so we don't need codes
  */
  //this.codes = new utils.Buf32(ENOUGH);       /* space for code tables */
  this.lendyn = null;              /* dynamic table for length/literal codes (JS specific) */
  this.distdyn = null;             /* dynamic table for distance codes (JS specific) */
  this.sane = 0;                   /* if false, allow invalid distance too far */
  this.back = 0;                   /* bits back of last unprocessed length/lit */
  this.was = 0;                    /* initial length of match */
}

function inflateResetKeep(strm) {
  var state;

  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;
  strm.total_in = strm.total_out = state.total = 0;
  strm.msg = ''; /*Z_NULL*/
  if (state.wrap) {       /* to support ill-conceived Java test suite */
    strm.adler = state.wrap & 1;
  }
  state.mode = HEAD;
  state.last = 0;
  state.havedict = 0;
  state.dmax = 32768;
  state.head = null/*Z_NULL*/;
  state.hold = 0;
  state.bits = 0;
  //state.lencode = state.distcode = state.next = state.codes;
  state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
  state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);

  state.sane = 1;
  state.back = -1;
  //Tracev((stderr, "inflate: reset\n"));
  return Z_OK;
}

function inflateReset(strm) {
  var state;

  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;
  state.wsize = 0;
  state.whave = 0;
  state.wnext = 0;
  return inflateResetKeep(strm);

}

function inflateReset2(strm, windowBits) {
  var wrap;
  var state;

  /* get the state */
  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;

  /* extract wrap request from windowBits parameter */
  if (windowBits < 0) {
    wrap = 0;
    windowBits = -windowBits;
  }
  else {
    wrap = (windowBits >> 4) + 1;
    if (windowBits < 48) {
      windowBits &= 15;
    }
  }

  /* set number of window bits, free window if different */
  if (windowBits && (windowBits < 8 || windowBits > 15)) {
    return Z_STREAM_ERROR;
  }
  if (state.window !== null && state.wbits !== windowBits) {
    state.window = null;
  }

  /* update state and reset the rest of it */
  state.wrap = wrap;
  state.wbits = windowBits;
  return inflateReset(strm);
}

function inflateInit2(strm, windowBits) {
  var ret;
  var state;

  if (!strm) { return Z_STREAM_ERROR; }
  //strm.msg = Z_NULL;                 /* in case we return an error */

  state = new InflateState();

  //if (state === Z_NULL) return Z_MEM_ERROR;
  //Tracev((stderr, "inflate: allocated\n"));
  strm.state = state;
  state.window = null/*Z_NULL*/;
  ret = inflateReset2(strm, windowBits);
  if (ret !== Z_OK) {
    strm.state = null/*Z_NULL*/;
  }
  return ret;
}

function inflateInit(strm) {
  return inflateInit2(strm, DEF_WBITS);
}


/*
 Return state with length and distance decoding tables and index sizes set to
 fixed code decoding.  Normally this returns fixed tables from inffixed.h.
 If BUILDFIXED is defined, then instead this routine builds the tables the
 first time it's called, and returns those tables the first time and
 thereafter.  This reduces the size of the code by about 2K bytes, in
 exchange for a little execution time.  However, BUILDFIXED should not be
 used for threaded applications, since the rewriting of the tables and virgin
 may not be thread-safe.
 */
var virgin = true;

var lenfix, distfix; // We have no pointers in JS, so keep tables separate

function fixedtables(state) {
  /* build fixed huffman tables if first call (may not be thread safe) */
  if (virgin) {
    var sym;

    lenfix = new utils.Buf32(512);
    distfix = new utils.Buf32(32);

    /* literal/length table */
    sym = 0;
    while (sym < 144) { state.lens[sym++] = 8; }
    while (sym < 256) { state.lens[sym++] = 9; }
    while (sym < 280) { state.lens[sym++] = 7; }
    while (sym < 288) { state.lens[sym++] = 8; }

    inflate_table(LENS,  state.lens, 0, 288, lenfix,   0, state.work, { bits: 9 });

    /* distance table */
    sym = 0;
    while (sym < 32) { state.lens[sym++] = 5; }

    inflate_table(DISTS, state.lens, 0, 32,   distfix, 0, state.work, { bits: 5 });

    /* do this just once */
    virgin = false;
  }

  state.lencode = lenfix;
  state.lenbits = 9;
  state.distcode = distfix;
  state.distbits = 5;
}


/*
 Update the window with the last wsize (normally 32K) bytes written before
 returning.  If window does not exist yet, create it.  This is only called
 when a window is already in use, or when output has been written during this
 inflate call, but the end of the deflate stream has not been reached yet.
 It is also called to create a window for dictionary data when a dictionary
 is loaded.

 Providing output buffers larger than 32K to inflate() should provide a speed
 advantage, since only the last 32K of output is copied to the sliding window
 upon return from inflate(), and since all distances after the first 32K of
 output will fall in the output data, making match copies simpler and faster.
 The advantage may be dependent on the size of the processor's data caches.
 */
function updatewindow(strm, src, end, copy) {
  var dist;
  var state = strm.state;

  /* if it hasn't been done already, allocate space for the window */
  if (state.window === null) {
    state.wsize = 1 << state.wbits;
    state.wnext = 0;
    state.whave = 0;

    state.window = new utils.Buf8(state.wsize);
  }

  /* copy state->wsize or less output bytes into the circular window */
  if (copy >= state.wsize) {
    utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
    state.wnext = 0;
    state.whave = state.wsize;
  }
  else {
    dist = state.wsize - state.wnext;
    if (dist > copy) {
      dist = copy;
    }
    //zmemcpy(state->window + state->wnext, end - copy, dist);
    utils.arraySet(state.window, src, end - copy, dist, state.wnext);
    copy -= dist;
    if (copy) {
      //zmemcpy(state->window, end - copy, copy);
      utils.arraySet(state.window, src, end - copy, copy, 0);
      state.wnext = copy;
      state.whave = state.wsize;
    }
    else {
      state.wnext += dist;
      if (state.wnext === state.wsize) { state.wnext = 0; }
      if (state.whave < state.wsize) { state.whave += dist; }
    }
  }
  return 0;
}

function inflate(strm, flush) {
  var state;
  var input, output;          // input/output buffers
  var next;                   /* next input INDEX */
  var put;                    /* next output INDEX */
  var have, left;             /* available input and output */
  var hold;                   /* bit buffer */
  var bits;                   /* bits in bit buffer */
  var _in, _out;              /* save starting available input and output */
  var copy;                   /* number of stored or match bytes to copy */
  var from;                   /* where to copy match bytes from */
  var from_source;
  var here = 0;               /* current decoding table entry */
  var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
  //var last;                   /* parent table entry */
  var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
  var len;                    /* length to copy for repeats, bits to drop */
  var ret;                    /* return code */
  var hbuf = new utils.Buf8(4);    /* buffer for gzip header crc calculation */
  var opts;

  var n; // temporary var for NEED_BITS

  var order = /* permutation of code lengths */
    [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];


  if (!strm || !strm.state || !strm.output ||
      (!strm.input && strm.avail_in !== 0)) {
    return Z_STREAM_ERROR;
  }

  state = strm.state;
  if (state.mode === TYPE) { state.mode = TYPEDO; }    /* skip check */


  //--- LOAD() ---
  put = strm.next_out;
  output = strm.output;
  left = strm.avail_out;
  next = strm.next_in;
  input = strm.input;
  have = strm.avail_in;
  hold = state.hold;
  bits = state.bits;
  //---

  _in = have;
  _out = left;
  ret = Z_OK;

  inf_leave: // goto emulation
  for (;;) {
    switch (state.mode) {
      case HEAD:
        if (state.wrap === 0) {
          state.mode = TYPEDO;
          break;
        }
        //=== NEEDBITS(16);
        while (bits < 16) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        if ((state.wrap & 2) && hold === 0x8b1f) {  /* gzip header */
          state.check = 0/*crc32(0L, Z_NULL, 0)*/;
          //=== CRC2(state.check, hold);
          hbuf[0] = hold & 0xff;
          hbuf[1] = (hold >>> 8) & 0xff;
          state.check = crc32(state.check, hbuf, 2, 0);
          //===//

          //=== INITBITS();
          hold = 0;
          bits = 0;
          //===//
          state.mode = FLAGS;
          break;
        }
        state.flags = 0;           /* expect zlib header */
        if (state.head) {
          state.head.done = false;
        }
        if (!(state.wrap & 1) ||   /* check if zlib header allowed */
          (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
          strm.msg = 'incorrect header check';
          state.mode = BAD;
          break;
        }
        if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
          strm.msg = 'unknown compression method';
          state.mode = BAD;
          break;
        }
        //--- DROPBITS(4) ---//
        hold >>>= 4;
        bits -= 4;
        //---//
        len = (hold & 0x0f)/*BITS(4)*/ + 8;
        if (state.wbits === 0) {
          state.wbits = len;
        }
        else if (len > state.wbits) {
          strm.msg = 'invalid window size';
          state.mode = BAD;
          break;
        }
        state.dmax = 1 << len;
        //Tracev((stderr, "inflate:   zlib header ok\n"));
        strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
        state.mode = hold & 0x200 ? DICTID : TYPE;
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        break;
      case FLAGS:
        //=== NEEDBITS(16); */
        while (bits < 16) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        state.flags = hold;
        if ((state.flags & 0xff) !== Z_DEFLATED) {
          strm.msg = 'unknown compression method';
          state.mode = BAD;
          break;
        }
        if (state.flags & 0xe000) {
          strm.msg = 'unknown header flags set';
          state.mode = BAD;
          break;
        }
        if (state.head) {
          state.head.text = ((hold >> 8) & 1);
        }
        if (state.flags & 0x0200) {
          //=== CRC2(state.check, hold);
          hbuf[0] = hold & 0xff;
          hbuf[1] = (hold >>> 8) & 0xff;
          state.check = crc32(state.check, hbuf, 2, 0);
          //===//
        }
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = TIME;
        /* falls through */
      case TIME:
        //=== NEEDBITS(32); */
        while (bits < 32) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        if (state.head) {
          state.head.time = hold;
        }
        if (state.flags & 0x0200) {
          //=== CRC4(state.check, hold)
          hbuf[0] = hold & 0xff;
          hbuf[1] = (hold >>> 8) & 0xff;
          hbuf[2] = (hold >>> 16) & 0xff;
          hbuf[3] = (hold >>> 24) & 0xff;
          state.check = crc32(state.check, hbuf, 4, 0);
          //===
        }
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = OS;
        /* falls through */
      case OS:
        //=== NEEDBITS(16); */
        while (bits < 16) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        if (state.head) {
          state.head.xflags = (hold & 0xff);
          state.head.os = (hold >> 8);
        }
        if (state.flags & 0x0200) {
          //=== CRC2(state.check, hold);
          hbuf[0] = hold & 0xff;
          hbuf[1] = (hold >>> 8) & 0xff;
          state.check = crc32(state.check, hbuf, 2, 0);
          //===//
        }
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = EXLEN;
        /* falls through */
      case EXLEN:
        if (state.flags & 0x0400) {
          //=== NEEDBITS(16); */
          while (bits < 16) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          state.length = hold;
          if (state.head) {
            state.head.extra_len = hold;
          }
          if (state.flags & 0x0200) {
            //=== CRC2(state.check, hold);
            hbuf[0] = hold & 0xff;
            hbuf[1] = (hold >>> 8) & 0xff;
            state.check = crc32(state.check, hbuf, 2, 0);
            //===//
          }
          //=== INITBITS();
          hold = 0;
          bits = 0;
          //===//
        }
        else if (state.head) {
          state.head.extra = null/*Z_NULL*/;
        }
        state.mode = EXTRA;
        /* falls through */
      case EXTRA:
        if (state.flags & 0x0400) {
          copy = state.length;
          if (copy > have) { copy = have; }
          if (copy) {
            if (state.head) {
              len = state.head.extra_len - state.length;
              if (!state.head.extra) {
                // Use untyped array for more convenient processing later
                state.head.extra = new Array(state.head.extra_len);
              }
              utils.arraySet(
                state.head.extra,
                input,
                next,
                // extra field is limited to 65536 bytes
                // - no need for additional size check
                copy,
                /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
                len
              );
              //zmemcpy(state.head.extra + len, next,
              //        len + copy > state.head.extra_max ?
              //        state.head.extra_max - len : copy);
            }
            if (state.flags & 0x0200) {
              state.check = crc32(state.check, input, copy, next);
            }
            have -= copy;
            next += copy;
            state.length -= copy;
          }
          if (state.length) { break inf_leave; }
        }
        state.length = 0;
        state.mode = NAME;
        /* falls through */
      case NAME:
        if (state.flags & 0x0800) {
          if (have === 0) { break inf_leave; }
          copy = 0;
          do {
            // TODO: 2 or 1 bytes?
            len = input[next + copy++];
            /* use constant limit because in js we should not preallocate memory */
            if (state.head && len &&
                (state.length < 65536 /*state.head.name_max*/)) {
              state.head.name += String.fromCharCode(len);
            }
          } while (len && copy < have);

          if (state.flags & 0x0200) {
            state.check = crc32(state.check, input, copy, next);
          }
          have -= copy;
          next += copy;
          if (len) { break inf_leave; }
        }
        else if (state.head) {
          state.head.name = null;
        }
        state.length = 0;
        state.mode = COMMENT;
        /* falls through */
      case COMMENT:
        if (state.flags & 0x1000) {
          if (have === 0) { break inf_leave; }
          copy = 0;
          do {
            len = input[next + copy++];
            /* use constant limit because in js we should not preallocate memory */
            if (state.head && len &&
                (state.length < 65536 /*state.head.comm_max*/)) {
              state.head.comment += String.fromCharCode(len);
            }
          } while (len && copy < have);
          if (state.flags & 0x0200) {
            state.check = crc32(state.check, input, copy, next);
          }
          have -= copy;
          next += copy;
          if (len) { break inf_leave; }
        }
        else if (state.head) {
          state.head.comment = null;
        }
        state.mode = HCRC;
        /* falls through */
      case HCRC:
        if (state.flags & 0x0200) {
          //=== NEEDBITS(16); */
          while (bits < 16) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          if (hold !== (state.check & 0xffff)) {
            strm.msg = 'header crc mismatch';
            state.mode = BAD;
            break;
          }
          //=== INITBITS();
          hold = 0;
          bits = 0;
          //===//
        }
        if (state.head) {
          state.head.hcrc = ((state.flags >> 9) & 1);
          state.head.done = true;
        }
        strm.adler = state.check = 0;
        state.mode = TYPE;
        break;
      case DICTID:
        //=== NEEDBITS(32); */
        while (bits < 32) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        strm.adler = state.check = zswap32(hold);
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = DICT;
        /* falls through */
      case DICT:
        if (state.havedict === 0) {
          //--- RESTORE() ---
          strm.next_out = put;
          strm.avail_out = left;
          strm.next_in = next;
          strm.avail_in = have;
          state.hold = hold;
          state.bits = bits;
          //---
          return Z_NEED_DICT;
        }
        strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
        state.mode = TYPE;
        /* falls through */
      case TYPE:
        if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
        /* falls through */
      case TYPEDO:
        if (state.last) {
          //--- BYTEBITS() ---//
          hold >>>= bits & 7;
          bits -= bits & 7;
          //---//
          state.mode = CHECK;
          break;
        }
        //=== NEEDBITS(3); */
        while (bits < 3) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        state.last = (hold & 0x01)/*BITS(1)*/;
        //--- DROPBITS(1) ---//
        hold >>>= 1;
        bits -= 1;
        //---//

        switch ((hold & 0x03)/*BITS(2)*/) {
          case 0:                             /* stored block */
            //Tracev((stderr, "inflate:     stored block%s\n",
            //        state.last ? " (last)" : ""));
            state.mode = STORED;
            break;
          case 1:                             /* fixed block */
            fixedtables(state);
            //Tracev((stderr, "inflate:     fixed codes block%s\n",
            //        state.last ? " (last)" : ""));
            state.mode = LEN_;             /* decode codes */
            if (flush === Z_TREES) {
              //--- DROPBITS(2) ---//
              hold >>>= 2;
              bits -= 2;
              //---//
              break inf_leave;
            }
            break;
          case 2:                             /* dynamic block */
            //Tracev((stderr, "inflate:     dynamic codes block%s\n",
            //        state.last ? " (last)" : ""));
            state.mode = TABLE;
            break;
          case 3:
            strm.msg = 'invalid block type';
            state.mode = BAD;
        }
        //--- DROPBITS(2) ---//
        hold >>>= 2;
        bits -= 2;
        //---//
        break;
      case STORED:
        //--- BYTEBITS() ---// /* go to byte boundary */
        hold >>>= bits & 7;
        bits -= bits & 7;
        //---//
        //=== NEEDBITS(32); */
        while (bits < 32) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
          strm.msg = 'invalid stored block lengths';
          state.mode = BAD;
          break;
        }
        state.length = hold & 0xffff;
        //Tracev((stderr, "inflate:       stored length %u\n",
        //        state.length));
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = COPY_;
        if (flush === Z_TREES) { break inf_leave; }
        /* falls through */
      case COPY_:
        state.mode = COPY;
        /* falls through */
      case COPY:
        copy = state.length;
        if (copy) {
          if (copy > have) { copy = have; }
          if (copy > left) { copy = left; }
          if (copy === 0) { break inf_leave; }
          //--- zmemcpy(put, next, copy); ---
          utils.arraySet(output, input, next, copy, put);
          //---//
          have -= copy;
          next += copy;
          left -= copy;
          put += copy;
          state.length -= copy;
          break;
        }
        //Tracev((stderr, "inflate:       stored end\n"));
        state.mode = TYPE;
        break;
      case TABLE:
        //=== NEEDBITS(14); */
        while (bits < 14) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
        //--- DROPBITS(5) ---//
        hold >>>= 5;
        bits -= 5;
        //---//
        state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
        //--- DROPBITS(5) ---//
        hold >>>= 5;
        bits -= 5;
        //---//
        state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
        //--- DROPBITS(4) ---//
        hold >>>= 4;
        bits -= 4;
        //---//
//#ifndef PKZIP_BUG_WORKAROUND
        if (state.nlen > 286 || state.ndist > 30) {
          strm.msg = 'too many length or distance symbols';
          state.mode = BAD;
          break;
        }
//#endif
        //Tracev((stderr, "inflate:       table sizes ok\n"));
        state.have = 0;
        state.mode = LENLENS;
        /* falls through */
      case LENLENS:
        while (state.have < state.ncode) {
          //=== NEEDBITS(3);
          while (bits < 3) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
          //--- DROPBITS(3) ---//
          hold >>>= 3;
          bits -= 3;
          //---//
        }
        while (state.have < 19) {
          state.lens[order[state.have++]] = 0;
        }
        // We have separate tables & no pointers. 2 commented lines below not needed.
        //state.next = state.codes;
        //state.lencode = state.next;
        // Switch to use dynamic table
        state.lencode = state.lendyn;
        state.lenbits = 7;

        opts = { bits: state.lenbits };
        ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
        state.lenbits = opts.bits;

        if (ret) {
          strm.msg = 'invalid code lengths set';
          state.mode = BAD;
          break;
        }
        //Tracev((stderr, "inflate:       code lengths ok\n"));
        state.have = 0;
        state.mode = CODELENS;
        /* falls through */
      case CODELENS:
        while (state.have < state.nlen + state.ndist) {
          for (;;) {
            here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
            here_bits = here >>> 24;
            here_op = (here >>> 16) & 0xff;
            here_val = here & 0xffff;

            if ((here_bits) <= bits) { break; }
            //--- PULLBYTE() ---//
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
            //---//
          }
          if (here_val < 16) {
            //--- DROPBITS(here.bits) ---//
            hold >>>= here_bits;
            bits -= here_bits;
            //---//
            state.lens[state.have++] = here_val;
          }
          else {
            if (here_val === 16) {
              //=== NEEDBITS(here.bits + 2);
              n = here_bits + 2;
              while (bits < n) {
                if (have === 0) { break inf_leave; }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              //===//
              //--- DROPBITS(here.bits) ---//
              hold >>>= here_bits;
              bits -= here_bits;
              //---//
              if (state.have === 0) {
                strm.msg = 'invalid bit length repeat';
                state.mode = BAD;
                break;
              }
              len = state.lens[state.have - 1];
              copy = 3 + (hold & 0x03);//BITS(2);
              //--- DROPBITS(2) ---//
              hold >>>= 2;
              bits -= 2;
              //---//
            }
            else if (here_val === 17) {
              //=== NEEDBITS(here.bits + 3);
              n = here_bits + 3;
              while (bits < n) {
                if (have === 0) { break inf_leave; }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              //===//
              //--- DROPBITS(here.bits) ---//
              hold >>>= here_bits;
              bits -= here_bits;
              //---//
              len = 0;
              copy = 3 + (hold & 0x07);//BITS(3);
              //--- DROPBITS(3) ---//
              hold >>>= 3;
              bits -= 3;
              //---//
            }
            else {
              //=== NEEDBITS(here.bits + 7);
              n = here_bits + 7;
              while (bits < n) {
                if (have === 0) { break inf_leave; }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              //===//
              //--- DROPBITS(here.bits) ---//
              hold >>>= here_bits;
              bits -= here_bits;
              //---//
              len = 0;
              copy = 11 + (hold & 0x7f);//BITS(7);
              //--- DROPBITS(7) ---//
              hold >>>= 7;
              bits -= 7;
              //---//
            }
            if (state.have + copy > state.nlen + state.ndist) {
              strm.msg = 'invalid bit length repeat';
              state.mode = BAD;
              break;
            }
            while (copy--) {
              state.lens[state.have++] = len;
            }
          }
        }

        /* handle error breaks in while */
        if (state.mode === BAD) { break; }

        /* check for end-of-block code (better have one) */
        if (state.lens[256] === 0) {
          strm.msg = 'invalid code -- missing end-of-block';
          state.mode = BAD;
          break;
        }

        /* build code tables -- note: do not change the lenbits or distbits
           values here (9 and 6) without reading the comments in inftrees.h
           concerning the ENOUGH constants, which depend on those values */
        state.lenbits = 9;

        opts = { bits: state.lenbits };
        ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
        // We have separate tables & no pointers. 2 commented lines below not needed.
        // state.next_index = opts.table_index;
        state.lenbits = opts.bits;
        // state.lencode = state.next;

        if (ret) {
          strm.msg = 'invalid literal/lengths set';
          state.mode = BAD;
          break;
        }

        state.distbits = 6;
        //state.distcode.copy(state.codes);
        // Switch to use dynamic table
        state.distcode = state.distdyn;
        opts = { bits: state.distbits };
        ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
        // We have separate tables & no pointers. 2 commented lines below not needed.
        // state.next_index = opts.table_index;
        state.distbits = opts.bits;
        // state.distcode = state.next;

        if (ret) {
          strm.msg = 'invalid distances set';
          state.mode = BAD;
          break;
        }
        //Tracev((stderr, 'inflate:       codes ok\n'));
        state.mode = LEN_;
        if (flush === Z_TREES) { break inf_leave; }
        /* falls through */
      case LEN_:
        state.mode = LEN;
        /* falls through */
      case LEN:
        if (have >= 6 && left >= 258) {
          //--- RESTORE() ---
          strm.next_out = put;
          strm.avail_out = left;
          strm.next_in = next;
          strm.avail_in = have;
          state.hold = hold;
          state.bits = bits;
          //---
          inflate_fast(strm, _out);
          //--- LOAD() ---
          put = strm.next_out;
          output = strm.output;
          left = strm.avail_out;
          next = strm.next_in;
          input = strm.input;
          have = strm.avail_in;
          hold = state.hold;
          bits = state.bits;
          //---

          if (state.mode === TYPE) {
            state.back = -1;
          }
          break;
        }
        state.back = 0;
        for (;;) {
          here = state.lencode[hold & ((1 << state.lenbits) - 1)];  /*BITS(state.lenbits)*/
          here_bits = here >>> 24;
          here_op = (here >>> 16) & 0xff;
          here_val = here & 0xffff;

          if (here_bits <= bits) { break; }
          //--- PULLBYTE() ---//
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
          //---//
        }
        if (here_op && (here_op & 0xf0) === 0) {
          last_bits = here_bits;
          last_op = here_op;
          last_val = here_val;
          for (;;) {
            here = state.lencode[last_val +
                    ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
            here_bits = here >>> 24;
            here_op = (here >>> 16) & 0xff;
            here_val = here & 0xffff;

            if ((last_bits + here_bits) <= bits) { break; }
            //--- PULLBYTE() ---//
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
            //---//
          }
          //--- DROPBITS(last.bits) ---//
          hold >>>= last_bits;
          bits -= last_bits;
          //---//
          state.back += last_bits;
        }
        //--- DROPBITS(here.bits) ---//
        hold >>>= here_bits;
        bits -= here_bits;
        //---//
        state.back += here_bits;
        state.length = here_val;
        if (here_op === 0) {
          //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
          //        "inflate:         literal '%c'\n" :
          //        "inflate:         literal 0x%02x\n", here.val));
          state.mode = LIT;
          break;
        }
        if (here_op & 32) {
          //Tracevv((stderr, "inflate:         end of block\n"));
          state.back = -1;
          state.mode = TYPE;
          break;
        }
        if (here_op & 64) {
          strm.msg = 'invalid literal/length code';
          state.mode = BAD;
          break;
        }
        state.extra = here_op & 15;
        state.mode = LENEXT;
        /* falls through */
      case LENEXT:
        if (state.extra) {
          //=== NEEDBITS(state.extra);
          n = state.extra;
          while (bits < n) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
          //--- DROPBITS(state.extra) ---//
          hold >>>= state.extra;
          bits -= state.extra;
          //---//
          state.back += state.extra;
        }
        //Tracevv((stderr, "inflate:         length %u\n", state.length));
        state.was = state.length;
        state.mode = DIST;
        /* falls through */
      case DIST:
        for (;;) {
          here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
          here_bits = here >>> 24;
          here_op = (here >>> 16) & 0xff;
          here_val = here & 0xffff;

          if ((here_bits) <= bits) { break; }
          //--- PULLBYTE() ---//
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
          //---//
        }
        if ((here_op & 0xf0) === 0) {
          last_bits = here_bits;
          last_op = here_op;
          last_val = here_val;
          for (;;) {
            here = state.distcode[last_val +
                    ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
            here_bits = here >>> 24;
            here_op = (here >>> 16) & 0xff;
            here_val = here & 0xffff;

            if ((last_bits + here_bits) <= bits) { break; }
            //--- PULLBYTE() ---//
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
            //---//
          }
          //--- DROPBITS(last.bits) ---//
          hold >>>= last_bits;
          bits -= last_bits;
          //---//
          state.back += last_bits;
        }
        //--- DROPBITS(here.bits) ---//
        hold >>>= here_bits;
        bits -= here_bits;
        //---//
        state.back += here_bits;
        if (here_op & 64) {
          strm.msg = 'invalid distance code';
          state.mode = BAD;
          break;
        }
        state.offset = here_val;
        state.extra = (here_op) & 15;
        state.mode = DISTEXT;
        /* falls through */
      case DISTEXT:
        if (state.extra) {
          //=== NEEDBITS(state.extra);
          n = state.extra;
          while (bits < n) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
          //--- DROPBITS(state.extra) ---//
          hold >>>= state.extra;
          bits -= state.extra;
          //---//
          state.back += state.extra;
        }
//#ifdef INFLATE_STRICT
        if (state.offset > state.dmax) {
          strm.msg = 'invalid distance too far back';
          state.mode = BAD;
          break;
        }
//#endif
        //Tracevv((stderr, "inflate:         distance %u\n", state.offset));
        state.mode = MATCH;
        /* falls through */
      case MATCH:
        if (left === 0) { break inf_leave; }
        copy = _out - left;
        if (state.offset > copy) {         /* copy from window */
          copy = state.offset - copy;
          if (copy > state.whave) {
            if (state.sane) {
              strm.msg = 'invalid distance too far back';
              state.mode = BAD;
              break;
            }
// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
//          Trace((stderr, "inflate.c too far\n"));
//          copy -= state.whave;
//          if (copy > state.length) { copy = state.length; }
//          if (copy > left) { copy = left; }
//          left -= copy;
//          state.length -= copy;
//          do {
//            output[put++] = 0;
//          } while (--copy);
//          if (state.length === 0) { state.mode = LEN; }
//          break;
//#endif
          }
          if (copy > state.wnext) {
            copy -= state.wnext;
            from = state.wsize - copy;
          }
          else {
            from = state.wnext - copy;
          }
          if (copy > state.length) { copy = state.length; }
          from_source = state.window;
        }
        else {                              /* copy from output */
          from_source = output;
          from = put - state.offset;
          copy = state.length;
        }
        if (copy > left) { copy = left; }
        left -= copy;
        state.length -= copy;
        do {
          output[put++] = from_source[from++];
        } while (--copy);
        if (state.length === 0) { state.mode = LEN; }
        break;
      case LIT:
        if (left === 0) { break inf_leave; }
        output[put++] = state.length;
        left--;
        state.mode = LEN;
        break;
      case CHECK:
        if (state.wrap) {
          //=== NEEDBITS(32);
          while (bits < 32) {
            if (have === 0) { break inf_leave; }
            have--;
            // Use '|' instead of '+' to make sure that result is signed
            hold |= input[next++] << bits;
            bits += 8;
          }
          //===//
          _out -= left;
          strm.total_out += _out;
          state.total += _out;
          if (_out) {
            strm.adler = state.check =
                /*UPDATE(state.check, put - _out, _out);*/
                (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));

          }
          _out = left;
          // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
          if ((state.flags ? hold : zswap32(hold)) !== state.check) {
            strm.msg = 'incorrect data check';
            state.mode = BAD;
            break;
          }
          //=== INITBITS();
          hold = 0;
          bits = 0;
          //===//
          //Tracev((stderr, "inflate:   check matches trailer\n"));
        }
        state.mode = LENGTH;
        /* falls through */
      case LENGTH:
        if (state.wrap && state.flags) {
          //=== NEEDBITS(32);
          while (bits < 32) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          if (hold !== (state.total & 0xffffffff)) {
            strm.msg = 'incorrect length check';
            state.mode = BAD;
            break;
          }
          //=== INITBITS();
          hold = 0;
          bits = 0;
          //===//
          //Tracev((stderr, "inflate:   length matches trailer\n"));
        }
        state.mode = DONE;
        /* falls through */
      case DONE:
        ret = Z_STREAM_END;
        break inf_leave;
      case BAD:
        ret = Z_DATA_ERROR;
        break inf_leave;
      case MEM:
        return Z_MEM_ERROR;
      case SYNC:
        /* falls through */
      default:
        return Z_STREAM_ERROR;
    }
  }

  // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"

  /*
     Return from inflate(), updating the total counts and the check value.
     If there was no progress during the inflate() call, return a buffer
     error.  Call updatewindow() to create and/or update the window state.
     Note: a memory error from inflate() is non-recoverable.
   */

  //--- RESTORE() ---
  strm.next_out = put;
  strm.avail_out = left;
  strm.next_in = next;
  strm.avail_in = have;
  state.hold = hold;
  state.bits = bits;
  //---

  if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
                      (state.mode < CHECK || flush !== Z_FINISH))) {
    if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
      state.mode = MEM;
      return Z_MEM_ERROR;
    }
  }
  _in -= strm.avail_in;
  _out -= strm.avail_out;
  strm.total_in += _in;
  strm.total_out += _out;
  state.total += _out;
  if (state.wrap && _out) {
    strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
      (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
  }
  strm.data_type = state.bits + (state.last ? 64 : 0) +
                    (state.mode === TYPE ? 128 : 0) +
                    (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
  if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
    ret = Z_BUF_ERROR;
  }
  return ret;
}

function inflateEnd(strm) {

  if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
    return Z_STREAM_ERROR;
  }

  var state = strm.state;
  if (state.window) {
    state.window = null;
  }
  strm.state = null;
  return Z_OK;
}

function inflateGetHeader(strm, head) {
  var state;

  /* check state */
  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;
  if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }

  /* save header structure */
  state.head = head;
  head.done = false;
  return Z_OK;
}

function inflateSetDictionary(strm, dictionary) {
  var dictLength = dictionary.length;

  var state;
  var dictid;
  var ret;

  /* check state */
  if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
  state = strm.state;

  if (state.wrap !== 0 && state.mode !== DICT) {
    return Z_STREAM_ERROR;
  }

  /* check for correct dictionary identifier */
  if (state.mode === DICT) {
    dictid = 1; /* adler32(0, null, 0)*/
    /* dictid = adler32(dictid, dictionary, dictLength); */
    dictid = adler32(dictid, dictionary, dictLength, 0);
    if (dictid !== state.check) {
      return Z_DATA_ERROR;
    }
  }
  /* copy dictionary to window using updatewindow(), which will amend the
   existing dictionary if appropriate */
  ret = updatewindow(strm, dictionary, dictLength, dictLength);
  if (ret) {
    state.mode = MEM;
    return Z_MEM_ERROR;
  }
  state.havedict = 1;
  // Tracev((stderr, "inflate:   dictionary set\n"));
  return Z_OK;
}

exports.inflateReset = inflateReset;
exports.inflateReset2 = inflateReset2;
exports.inflateResetKeep = inflateResetKeep;
exports.inflateInit = inflateInit;
exports.inflateInit2 = inflateInit2;
exports.inflate = inflate;
exports.inflateEnd = inflateEnd;
exports.inflateGetHeader = inflateGetHeader;
exports.inflateSetDictionary = inflateSetDictionary;
exports.inflateInfo = 'pako inflate (from Nodeca project)';

/* Not implemented
exports.inflateCopy = inflateCopy;
exports.inflateGetDictionary = inflateGetDictionary;
exports.inflateMark = inflateMark;
exports.inflatePrime = inflatePrime;
exports.inflateSync = inflateSync;
exports.inflateSyncPoint = inflateSyncPoint;
exports.inflateUndermine = inflateUndermine;
*/


/***/ }),

/***/ 1998:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

var utils = __webpack_require__(9805);

var MAXBITS = 15;
var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);

var CODES = 0;
var LENS = 1;
var DISTS = 2;

var lbase = [ /* Length codes 257..285 base */
  3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
  35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
];

var lext = [ /* Length codes 257..285 extra */
  16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
  19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
];

var dbase = [ /* Distance codes 0..29 base */
  1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
  257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
  8193, 12289, 16385, 24577, 0, 0
];

var dext = [ /* Distance codes 0..29 extra */
  16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
  23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
  28, 28, 29, 29, 64, 64
];

module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
{
  var bits = opts.bits;
      //here = opts.here; /* table entry for duplication */

  var len = 0;               /* a code's length in bits */
  var sym = 0;               /* index of code symbols */
  var min = 0, max = 0;          /* minimum and maximum code lengths */
  var root = 0;              /* number of index bits for root table */
  var curr = 0;              /* number of index bits for current table */
  var drop = 0;              /* code bits to drop for sub-table */
  var left = 0;                   /* number of prefix codes available */
  var used = 0;              /* code entries in table used */
  var huff = 0;              /* Huffman code */
  var incr;              /* for incrementing code, index */
  var fill;              /* index for replicating entries */
  var low;               /* low bits for current root entry */
  var mask;              /* mask for low root bits */
  var next;             /* next available space in table */
  var base = null;     /* base value table to use */
  var base_index = 0;
//  var shoextra;    /* extra bits table to use */
  var end;                    /* use base and extra for symbol > end */
  var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];    /* number of codes of each length */
  var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];     /* offsets in table for each length */
  var extra = null;
  var extra_index = 0;

  var here_bits, here_op, here_val;

  /*
   Process a set of code lengths to create a canonical Huffman code.  The
   code lengths are lens[0..codes-1].  Each length corresponds to the
   symbols 0..codes-1.  The Huffman code is generated by first sorting the
   symbols by length from short to long, and retaining the symbol order
   for codes with equal lengths.  Then the code starts with all zero bits
   for the first code of the shortest length, and the codes are integer
   increments for the same length, and zeros are appended as the length
   increases.  For the deflate format, these bits are stored backwards
   from their more natural integer increment ordering, and so when the
   decoding tables are built in the large loop below, the integer codes
   are incremented backwards.

   This routine assumes, but does not check, that all of the entries in
   lens[] are in the range 0..MAXBITS.  The caller must assure this.
   1..MAXBITS is interpreted as that code length.  zero means that that
   symbol does not occur in this code.

   The codes are sorted by computing a count of codes for each length,
   creating from that a table of starting indices for each length in the
   sorted table, and then entering the symbols in order in the sorted
   table.  The sorted table is work[], with that space being provided by
   the caller.

   The length counts are used for other purposes as well, i.e. finding
   the minimum and maximum length codes, determining if there are any
   codes at all, checking for a valid set of lengths, and looking ahead
   at length counts to determine sub-table sizes when building the
   decoding tables.
   */

  /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
  for (len = 0; len <= MAXBITS; len++) {
    count[len] = 0;
  }
  for (sym = 0; sym < codes; sym++) {
    count[lens[lens_index + sym]]++;
  }

  /* bound code lengths, force root to be within code lengths */
  root = bits;
  for (max = MAXBITS; max >= 1; max--) {
    if (count[max] !== 0) { break; }
  }
  if (root > max) {
    root = max;
  }
  if (max === 0) {                     /* no symbols to code at all */
    //table.op[opts.table_index] = 64;  //here.op = (var char)64;    /* invalid code marker */
    //table.bits[opts.table_index] = 1;   //here.bits = (var char)1;
    //table.val[opts.table_index++] = 0;   //here.val = (var short)0;
    table[table_index++] = (1 << 24) | (64 << 16) | 0;


    //table.op[opts.table_index] = 64;
    //table.bits[opts.table_index] = 1;
    //table.val[opts.table_index++] = 0;
    table[table_index++] = (1 << 24) | (64 << 16) | 0;

    opts.bits = 1;
    return 0;     /* no symbols, but wait for decoding to report error */
  }
  for (min = 1; min < max; min++) {
    if (count[min] !== 0) { break; }
  }
  if (root < min) {
    root = min;
  }

  /* check for an over-subscribed or incomplete set of lengths */
  left = 1;
  for (len = 1; len <= MAXBITS; len++) {
    left <<= 1;
    left -= count[len];
    if (left < 0) {
      return -1;
    }        /* over-subscribed */
  }
  if (left > 0 && (type === CODES || max !== 1)) {
    return -1;                      /* incomplete set */
  }

  /* generate offsets into symbol table for each length for sorting */
  offs[1] = 0;
  for (len = 1; len < MAXBITS; len++) {
    offs[len + 1] = offs[len] + count[len];
  }

  /* sort symbols by length, by symbol order within each length */
  for (sym = 0; sym < codes; sym++) {
    if (lens[lens_index + sym] !== 0) {
      work[offs[lens[lens_index + sym]]++] = sym;
    }
  }

  /*
   Create and fill in decoding tables.  In this loop, the table being
   filled is at next and has curr index bits.  The code being used is huff
   with length len.  That code is converted to an index by dropping drop
   bits off of the bottom.  For codes where len is less than drop + curr,
   those top drop + curr - len bits are incremented through all values to
   fill the table with replicated entries.

   root is the number of index bits for the root table.  When len exceeds
   root, sub-tables are created pointed to by the root entry with an index
   of the low root bits of huff.  This is saved in low to check for when a
   new sub-table should be started.  drop is zero when the root table is
   being filled, and drop is root when sub-tables are being filled.

   When a new sub-table is needed, it is necessary to look ahead in the
   code lengths to determine what size sub-table is needed.  The length
   counts are used for this, and so count[] is decremented as codes are
   entered in the tables.

   used keeps track of how many table entries have been allocated from the
   provided *table space.  It is checked for LENS and DIST tables against
   the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
   the initial root table size constants.  See the comments in inftrees.h
   for more information.

   sym increments through all symbols, and the loop terminates when
   all codes of length max, i.e. all codes, have been processed.  This
   routine permits incomplete codes, so another loop after this one fills
   in the rest of the decoding tables with invalid code markers.
   */

  /* set up for code type */
  // poor man optimization - use if-else instead of switch,
  // to avoid deopts in old v8
  if (type === CODES) {
    base = extra = work;    /* dummy value--not used */
    end = 19;

  } else if (type === LENS) {
    base = lbase;
    base_index -= 257;
    extra = lext;
    extra_index -= 257;
    end = 256;

  } else {                    /* DISTS */
    base = dbase;
    extra = dext;
    end = -1;
  }

  /* initialize opts for loop */
  huff = 0;                   /* starting code */
  sym = 0;                    /* starting code symbol */
  len = min;                  /* starting code length */
  next = table_index;              /* current table to fill in */
  curr = root;                /* current table index bits */
  drop = 0;                   /* current bits to drop from code for index */
  low = -1;                   /* trigger new sub-table when len > root */
  used = 1 << root;          /* use root table entries */
  mask = used - 1;            /* mask for comparing low */

  /* check available table space */
  if ((type === LENS && used > ENOUGH_LENS) ||
    (type === DISTS && used > ENOUGH_DISTS)) {
    return 1;
  }

  /* process all codes and make table entries */
  for (;;) {
    /* create table entry */
    here_bits = len - drop;
    if (work[sym] < end) {
      here_op = 0;
      here_val = work[sym];
    }
    else if (work[sym] > end) {
      here_op = extra[extra_index + work[sym]];
      here_val = base[base_index + work[sym]];
    }
    else {
      here_op = 32 + 64;         /* end of block */
      here_val = 0;
    }

    /* replicate for those indices with low len bits equal to huff */
    incr = 1 << (len - drop);
    fill = 1 << curr;
    min = fill;                 /* save offset to next table */
    do {
      fill -= incr;
      table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
    } while (fill !== 0);

    /* backwards increment the len-bit code huff */
    incr = 1 << (len - 1);
    while (huff & incr) {
      incr >>= 1;
    }
    if (incr !== 0) {
      huff &= incr - 1;
      huff += incr;
    } else {
      huff = 0;
    }

    /* go to next symbol, update count, len */
    sym++;
    if (--count[len] === 0) {
      if (len === max) { break; }
      len = lens[lens_index + work[sym]];
    }

    /* create new sub-table if needed */
    if (len > root && (huff & mask) !== low) {
      /* if first time, transition to sub-tables */
      if (drop === 0) {
        drop = root;
      }

      /* increment past last table */
      next += min;            /* here min is 1 << curr */

      /* determine length of next table */
      curr = len - drop;
      left = 1 << curr;
      while (curr + drop < max) {
        left -= count[curr + drop];
        if (left <= 0) { break; }
        curr++;
        left <<= 1;
      }

      /* check for enough space */
      used += 1 << curr;
      if ((type === LENS && used > ENOUGH_LENS) ||
        (type === DISTS && used > ENOUGH_DISTS)) {
        return 1;
      }

      /* point entry in root table to sub-table */
      low = huff & mask;
      /*table.op[low] = curr;
      table.bits[low] = root;
      table.val[low] = next - opts.table_index;*/
      table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
    }
  }

  /* fill in remaining table entry if code is incomplete (guaranteed to have
   at most one remaining entry, since if the code is incomplete, the
   maximum code length that was allowed to get this far is one bit) */
  if (huff !== 0) {
    //table.op[next + huff] = 64;            /* invalid code marker */
    //table.bits[next + huff] = len - drop;
    //table.val[next + huff] = 0;
    table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
  }

  /* set return parameters */
  //opts.table_index += used;
  opts.bits = root;
  return 0;
};


/***/ }),

/***/ 4674:
/***/ (function(module) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

module.exports = {
  2:      'need dictionary',     /* Z_NEED_DICT       2  */
  1:      'stream end',          /* Z_STREAM_END      1  */
  0:      '',                    /* Z_OK              0  */
  '-1':   'file error',          /* Z_ERRNO         (-1) */
  '-2':   'stream error',        /* Z_STREAM_ERROR  (-2) */
  '-3':   'data error',          /* Z_DATA_ERROR    (-3) */
  '-4':   'insufficient memory', /* Z_MEM_ERROR     (-4) */
  '-5':   'buffer error',        /* Z_BUF_ERROR     (-5) */
  '-6':   'incompatible version' /* Z_VERSION_ERROR (-6) */
};


/***/ }),

/***/ 3665:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

/* eslint-disable space-unary-ops */

var utils = __webpack_require__(9805);

/* Public constants ==========================================================*/
/* ===========================================================================*/


//var Z_FILTERED          = 1;
//var Z_HUFFMAN_ONLY      = 2;
//var Z_RLE               = 3;
var Z_FIXED               = 4;
//var Z_DEFAULT_STRATEGY  = 0;

/* Possible values of the data_type field (though see inflate()) */
var Z_BINARY              = 0;
var Z_TEXT                = 1;
//var Z_ASCII             = 1; // = Z_TEXT
var Z_UNKNOWN             = 2;

/*============================================================================*/


function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }

// From zutil.h

var STORED_BLOCK = 0;
var STATIC_TREES = 1;
var DYN_TREES    = 2;
/* The three kinds of block type */

var MIN_MATCH    = 3;
var MAX_MATCH    = 258;
/* The minimum and maximum match lengths */

// From deflate.h
/* ===========================================================================
 * Internal compression state.
 */

var LENGTH_CODES  = 29;
/* number of length codes, not counting the special END_BLOCK code */

var LITERALS      = 256;
/* number of literal bytes 0..255 */

var L_CODES       = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */

var D_CODES       = 30;
/* number of distance codes */

var BL_CODES      = 19;
/* number of codes used to transfer the bit lengths */

var HEAP_SIZE     = 2 * L_CODES + 1;
/* maximum heap size */

var MAX_BITS      = 15;
/* All codes must not exceed MAX_BITS bits */

var Buf_size      = 16;
/* size of bit buffer in bi_buf */


/* ===========================================================================
 * Constants
 */

var MAX_BL_BITS = 7;
/* Bit length codes must not exceed MAX_BL_BITS bits */

var END_BLOCK   = 256;
/* end of block literal code */

var REP_3_6     = 16;
/* repeat previous bit length 3-6 times (2 bits of repeat count) */

var REPZ_3_10   = 17;
/* repeat a zero length 3-10 times  (3 bits of repeat count) */

var REPZ_11_138 = 18;
/* repeat a zero length 11-138 times  (7 bits of repeat count) */

/* eslint-disable comma-spacing,array-bracket-spacing */
var extra_lbits =   /* extra bits for each length code */
  [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];

var extra_dbits =   /* extra bits for each distance code */
  [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];

var extra_blbits =  /* extra bits for each bit length code */
  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];

var bl_order =
  [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
/* eslint-enable comma-spacing,array-bracket-spacing */

/* The lengths of the bit length codes are sent in order of decreasing
 * probability, to avoid transmitting the lengths for unused bit length codes.
 */

/* ===========================================================================
 * Local data. These are initialized only once.
 */

// We pre-fill arrays with 0 to avoid uninitialized gaps

var DIST_CODE_LEN = 512; /* see definition of array dist_code below */

// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1
var static_ltree  = new Array((L_CODES + 2) * 2);
zero(static_ltree);
/* The static literal tree. Since the bit lengths are imposed, there is no
 * need for the L_CODES extra codes used during heap construction. However
 * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
 * below).
 */

var static_dtree  = new Array(D_CODES * 2);
zero(static_dtree);
/* The static distance tree. (Actually a trivial tree since all codes use
 * 5 bits.)
 */

var _dist_code    = new Array(DIST_CODE_LEN);
zero(_dist_code);
/* Distance codes. The first 256 values correspond to the distances
 * 3 .. 258, the last 256 values correspond to the top 8 bits of
 * the 15 bit distances.
 */

var _length_code  = new Array(MAX_MATCH - MIN_MATCH + 1);
zero(_length_code);
/* length code for each normalized match length (0 == MIN_MATCH) */

var base_length   = new Array(LENGTH_CODES);
zero(base_length);
/* First normalized length for each code (0 = MIN_MATCH) */

var base_dist     = new Array(D_CODES);
zero(base_dist);
/* First normalized distance for each code (0 = distance of 1) */


function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {

  this.static_tree  = static_tree;  /* static tree or NULL */
  this.extra_bits   = extra_bits;   /* extra bits for each code or NULL */
  this.extra_base   = extra_base;   /* base index for extra_bits */
  this.elems        = elems;        /* max number of elements in the tree */
  this.max_length   = max_length;   /* max bit length for the codes */

  // show if `static_tree` has data or dummy - needed for monomorphic objects
  this.has_stree    = static_tree && static_tree.length;
}


var static_l_desc;
var static_d_desc;
var static_bl_desc;


function TreeDesc(dyn_tree, stat_desc) {
  this.dyn_tree = dyn_tree;     /* the dynamic tree */
  this.max_code = 0;            /* largest code with non zero frequency */
  this.stat_desc = stat_desc;   /* the corresponding static tree */
}



function d_code(dist) {
  return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
}


/* ===========================================================================
 * Output a short LSB first on the stream.
 * IN assertion: there is enough room in pendingBuf.
 */
function put_short(s, w) {
//    put_byte(s, (uch)((w) & 0xff));
//    put_byte(s, (uch)((ush)(w) >> 8));
  s.pending_buf[s.pending++] = (w) & 0xff;
  s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
}


/* ===========================================================================
 * Send a value on a given number of bits.
 * IN assertion: length <= 16 and value fits in length bits.
 */
function send_bits(s, value, length) {
  if (s.bi_valid > (Buf_size - length)) {
    s.bi_buf |= (value << s.bi_valid) & 0xffff;
    put_short(s, s.bi_buf);
    s.bi_buf = value >> (Buf_size - s.bi_valid);
    s.bi_valid += length - Buf_size;
  } else {
    s.bi_buf |= (value << s.bi_valid) & 0xffff;
    s.bi_valid += length;
  }
}


function send_code(s, c, tree) {
  send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);
}


/* ===========================================================================
 * Reverse the first len bits of a code, using straightforward code (a faster
 * method would use a table)
 * IN assertion: 1 <= len <= 15
 */
function bi_reverse(code, len) {
  var res = 0;
  do {
    res |= code & 1;
    code >>>= 1;
    res <<= 1;
  } while (--len > 0);
  return res >>> 1;
}


/* ===========================================================================
 * Flush the bit buffer, keeping at most 7 bits in it.
 */
function bi_flush(s) {
  if (s.bi_valid === 16) {
    put_short(s, s.bi_buf);
    s.bi_buf = 0;
    s.bi_valid = 0;

  } else if (s.bi_valid >= 8) {
    s.pending_buf[s.pending++] = s.bi_buf & 0xff;
    s.bi_buf >>= 8;
    s.bi_valid -= 8;
  }
}


/* ===========================================================================
 * Compute the optimal bit lengths for a tree and update the total bit length
 * for the current block.
 * IN assertion: the fields freq and dad are set, heap[heap_max] and
 *    above are the tree nodes sorted by increasing frequency.
 * OUT assertions: the field len is set to the optimal bit length, the
 *     array bl_count contains the frequencies for each bit length.
 *     The length opt_len is updated; static_len is also updated if stree is
 *     not null.
 */
function gen_bitlen(s, desc)
//    deflate_state *s;
//    tree_desc *desc;    /* the tree descriptor */
{
  var tree            = desc.dyn_tree;
  var max_code        = desc.max_code;
  var stree           = desc.stat_desc.static_tree;
  var has_stree       = desc.stat_desc.has_stree;
  var extra           = desc.stat_desc.extra_bits;
  var base            = desc.stat_desc.extra_base;
  var max_length      = desc.stat_desc.max_length;
  var h;              /* heap index */
  var n, m;           /* iterate over the tree elements */
  var bits;           /* bit length */
  var xbits;          /* extra bits */
  var f;              /* frequency */
  var overflow = 0;   /* number of elements with bit length too large */

  for (bits = 0; bits <= MAX_BITS; bits++) {
    s.bl_count[bits] = 0;
  }

  /* In a first pass, compute the optimal bit lengths (which may
   * overflow in the case of the bit length tree).
   */
  tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */

  for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
    n = s.heap[h];
    bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
    if (bits > max_length) {
      bits = max_length;
      overflow++;
    }
    tree[n * 2 + 1]/*.Len*/ = bits;
    /* We overwrite tree[n].Dad which is no longer needed */

    if (n > max_code) { continue; } /* not a leaf node */

    s.bl_count[bits]++;
    xbits = 0;
    if (n >= base) {
      xbits = extra[n - base];
    }
    f = tree[n * 2]/*.Freq*/;
    s.opt_len += f * (bits + xbits);
    if (has_stree) {
      s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);
    }
  }
  if (overflow === 0) { return; }

  // Trace((stderr,"\nbit length overflow\n"));
  /* This happens for example on obj2 and pic of the Calgary corpus */

  /* Find the first bit length which could increase: */
  do {
    bits = max_length - 1;
    while (s.bl_count[bits] === 0) { bits--; }
    s.bl_count[bits]--;      /* move one leaf down the tree */
    s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
    s.bl_count[max_length]--;
    /* The brother of the overflow item also moves one step up,
     * but this does not affect bl_count[max_length]
     */
    overflow -= 2;
  } while (overflow > 0);

  /* Now recompute all bit lengths, scanning in increasing frequency.
   * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
   * lengths instead of fixing only the wrong ones. This idea is taken
   * from 'ar' written by Haruhiko Okumura.)
   */
  for (bits = max_length; bits !== 0; bits--) {
    n = s.bl_count[bits];
    while (n !== 0) {
      m = s.heap[--h];
      if (m > max_code) { continue; }
      if (tree[m * 2 + 1]/*.Len*/ !== bits) {
        // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
        s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;
        tree[m * 2 + 1]/*.Len*/ = bits;
      }
      n--;
    }
  }
}


/* ===========================================================================
 * Generate the codes for a given tree and bit counts (which need not be
 * optimal).
 * IN assertion: the array bl_count contains the bit length statistics for
 * the given tree and the field len is set for all tree elements.
 * OUT assertion: the field code is set for all tree elements of non
 *     zero code length.
 */
function gen_codes(tree, max_code, bl_count)
//    ct_data *tree;             /* the tree to decorate */
//    int max_code;              /* largest code with non zero frequency */
//    ushf *bl_count;            /* number of codes at each bit length */
{
  var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
  var code = 0;              /* running code value */
  var bits;                  /* bit index */
  var n;                     /* code index */

  /* The distribution counts are first used to generate the code values
   * without bit reversal.
   */
  for (bits = 1; bits <= MAX_BITS; bits++) {
    next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
  }
  /* Check that the bit counts in bl_count are consistent. The last code
   * must be all ones.
   */
  //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
  //        "inconsistent bit counts");
  //Tracev((stderr,"\ngen_codes: max_code %d ", max_code));

  for (n = 0;  n <= max_code; n++) {
    var len = tree[n * 2 + 1]/*.Len*/;
    if (len === 0) { continue; }
    /* Now reverse the bits */
    tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);

    //Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
    //     n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
  }
}


/* ===========================================================================
 * Initialize the various 'constant' tables.
 */
function tr_static_init() {
  var n;        /* iterates over tree elements */
  var bits;     /* bit counter */
  var length;   /* length value */
  var code;     /* code value */
  var dist;     /* distance index */
  var bl_count = new Array(MAX_BITS + 1);
  /* number of codes at each bit length for an optimal tree */

  // do check in _tr_init()
  //if (static_init_done) return;

  /* For some embedded targets, global variables are not initialized: */
/*#ifdef NO_INIT_GLOBAL_POINTERS
  static_l_desc.static_tree = static_ltree;
  static_l_desc.extra_bits = extra_lbits;
  static_d_desc.static_tree = static_dtree;
  static_d_desc.extra_bits = extra_dbits;
  static_bl_desc.extra_bits = extra_blbits;
#endif*/

  /* Initialize the mapping length (0..255) -> length code (0..28) */
  length = 0;
  for (code = 0; code < LENGTH_CODES - 1; code++) {
    base_length[code] = length;
    for (n = 0; n < (1 << extra_lbits[code]); n++) {
      _length_code[length++] = code;
    }
  }
  //Assert (length == 256, "tr_static_init: length != 256");
  /* Note that the length 255 (match length 258) can be represented
   * in two different ways: code 284 + 5 bits or code 285, so we
   * overwrite length_code[255] to use the best encoding:
   */
  _length_code[length - 1] = code;

  /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
  dist = 0;
  for (code = 0; code < 16; code++) {
    base_dist[code] = dist;
    for (n = 0; n < (1 << extra_dbits[code]); n++) {
      _dist_code[dist++] = code;
    }
  }
  //Assert (dist == 256, "tr_static_init: dist != 256");
  dist >>= 7; /* from now on, all distances are divided by 128 */
  for (; code < D_CODES; code++) {
    base_dist[code] = dist << 7;
    for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
      _dist_code[256 + dist++] = code;
    }
  }
  //Assert (dist == 256, "tr_static_init: 256+dist != 512");

  /* Construct the codes of the static literal tree */
  for (bits = 0; bits <= MAX_BITS; bits++) {
    bl_count[bits] = 0;
  }

  n = 0;
  while (n <= 143) {
    static_ltree[n * 2 + 1]/*.Len*/ = 8;
    n++;
    bl_count[8]++;
  }
  while (n <= 255) {
    static_ltree[n * 2 + 1]/*.Len*/ = 9;
    n++;
    bl_count[9]++;
  }
  while (n <= 279) {
    static_ltree[n * 2 + 1]/*.Len*/ = 7;
    n++;
    bl_count[7]++;
  }
  while (n <= 287) {
    static_ltree[n * 2 + 1]/*.Len*/ = 8;
    n++;
    bl_count[8]++;
  }
  /* Codes 286 and 287 do not exist, but we must include them in the
   * tree construction to get a canonical Huffman tree (longest code
   * all ones)
   */
  gen_codes(static_ltree, L_CODES + 1, bl_count);

  /* The static distance tree is trivial: */
  for (n = 0; n < D_CODES; n++) {
    static_dtree[n * 2 + 1]/*.Len*/ = 5;
    static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);
  }

  // Now data ready and we can init static trees
  static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
  static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS);
  static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0,         BL_CODES, MAX_BL_BITS);

  //static_init_done = true;
}


/* ===========================================================================
 * Initialize a new block.
 */
function init_block(s) {
  var n; /* iterates over tree elements */

  /* Initialize the trees. */
  for (n = 0; n < L_CODES;  n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }
  for (n = 0; n < D_CODES;  n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }
  for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }

  s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
  s.opt_len = s.static_len = 0;
  s.last_lit = s.matches = 0;
}


/* ===========================================================================
 * Flush the bit buffer and align the output on a byte boundary
 */
function bi_windup(s)
{
  if (s.bi_valid > 8) {
    put_short(s, s.bi_buf);
  } else if (s.bi_valid > 0) {
    //put_byte(s, (Byte)s->bi_buf);
    s.pending_buf[s.pending++] = s.bi_buf;
  }
  s.bi_buf = 0;
  s.bi_valid = 0;
}

/* ===========================================================================
 * Copy a stored block, storing first the length and its
 * one's complement if requested.
 */
function copy_block(s, buf, len, header)
//DeflateState *s;
//charf    *buf;    /* the input data */
//unsigned len;     /* its length */
//int      header;  /* true if block header must be written */
{
  bi_windup(s);        /* align on byte boundary */

  if (header) {
    put_short(s, len);
    put_short(s, ~len);
  }
//  while (len--) {
//    put_byte(s, *buf++);
//  }
  utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
  s.pending += len;
}

/* ===========================================================================
 * Compares to subtrees, using the tree depth as tie breaker when
 * the subtrees have equal frequency. This minimizes the worst case length.
 */
function smaller(tree, n, m, depth) {
  var _n2 = n * 2;
  var _m2 = m * 2;
  return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
         (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
}

/* ===========================================================================
 * Restore the heap property by moving down the tree starting at node k,
 * exchanging a node with the smallest of its two sons if necessary, stopping
 * when the heap property is re-established (each father smaller than its
 * two sons).
 */
function pqdownheap(s, tree, k)
//    deflate_state *s;
//    ct_data *tree;  /* the tree to restore */
//    int k;               /* node to move down */
{
  var v = s.heap[k];
  var j = k << 1;  /* left son of k */
  while (j <= s.heap_len) {
    /* Set j to the smallest of the two sons: */
    if (j < s.heap_len &&
      smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
      j++;
    }
    /* Exit if v is smaller than both sons */
    if (smaller(tree, v, s.heap[j], s.depth)) { break; }

    /* Exchange v with the smallest son */
    s.heap[k] = s.heap[j];
    k = j;

    /* And continue down the tree, setting j to the left son of k */
    j <<= 1;
  }
  s.heap[k] = v;
}


// inlined manually
// var SMALLEST = 1;

/* ===========================================================================
 * Send the block data compressed using the given Huffman trees
 */
function compress_block(s, ltree, dtree)
//    deflate_state *s;
//    const ct_data *ltree; /* literal tree */
//    const ct_data *dtree; /* distance tree */
{
  var dist;           /* distance of matched string */
  var lc;             /* match length or unmatched char (if dist == 0) */
  var lx = 0;         /* running index in l_buf */
  var code;           /* the code to send */
  var extra;          /* number of extra bits to send */

  if (s.last_lit !== 0) {
    do {
      dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);
      lc = s.pending_buf[s.l_buf + lx];
      lx++;

      if (dist === 0) {
        send_code(s, lc, ltree); /* send a literal byte */
        //Tracecv(isgraph(lc), (stderr," '%c' ", lc));
      } else {
        /* Here, lc is the match length - MIN_MATCH */
        code = _length_code[lc];
        send_code(s, code + LITERALS + 1, ltree); /* send the length code */
        extra = extra_lbits[code];
        if (extra !== 0) {
          lc -= base_length[code];
          send_bits(s, lc, extra);       /* send the extra length bits */
        }
        dist--; /* dist is now the match distance - 1 */
        code = d_code(dist);
        //Assert (code < D_CODES, "bad d_code");

        send_code(s, code, dtree);       /* send the distance code */
        extra = extra_dbits[code];
        if (extra !== 0) {
          dist -= base_dist[code];
          send_bits(s, dist, extra);   /* send the extra distance bits */
        }
      } /* literal or match pair ? */

      /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
      //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
      //       "pendingBuf overflow");

    } while (lx < s.last_lit);
  }

  send_code(s, END_BLOCK, ltree);
}


/* ===========================================================================
 * Construct one Huffman tree and assigns the code bit strings and lengths.
 * Update the total bit length for the current block.
 * IN assertion: the field freq is set for all tree elements.
 * OUT assertions: the fields len and code are set to the optimal bit length
 *     and corresponding code. The length opt_len is updated; static_len is
 *     also updated if stree is not null. The field max_code is set.
 */
function build_tree(s, desc)
//    deflate_state *s;
//    tree_desc *desc; /* the tree descriptor */
{
  var tree     = desc.dyn_tree;
  var stree    = desc.stat_desc.static_tree;
  var has_stree = desc.stat_desc.has_stree;
  var elems    = desc.stat_desc.elems;
  var n, m;          /* iterate over heap elements */
  var max_code = -1; /* largest code with non zero frequency */
  var node;          /* new node being created */

  /* Construct the initial heap, with least frequent element in
   * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
   * heap[0] is not used.
   */
  s.heap_len = 0;
  s.heap_max = HEAP_SIZE;

  for (n = 0; n < elems; n++) {
    if (tree[n * 2]/*.Freq*/ !== 0) {
      s.heap[++s.heap_len] = max_code = n;
      s.depth[n] = 0;

    } else {
      tree[n * 2 + 1]/*.Len*/ = 0;
    }
  }

  /* The pkzip format requires that at least one distance code exists,
   * and that at least one bit should be sent even if there is only one
   * possible code. So to avoid special checks later on we force at least
   * two codes of non zero frequency.
   */
  while (s.heap_len < 2) {
    node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
    tree[node * 2]/*.Freq*/ = 1;
    s.depth[node] = 0;
    s.opt_len--;

    if (has_stree) {
      s.static_len -= stree[node * 2 + 1]/*.Len*/;
    }
    /* node is 0 or 1 so it does not have extra bits */
  }
  desc.max_code = max_code;

  /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
   * establish sub-heaps of increasing lengths:
   */
  for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }

  /* Construct the Huffman tree by repeatedly combining the least two
   * frequent nodes.
   */
  node = elems;              /* next internal node of the tree */
  do {
    //pqremove(s, tree, n);  /* n = node of least frequency */
    /*** pqremove ***/
    n = s.heap[1/*SMALLEST*/];
    s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
    pqdownheap(s, tree, 1/*SMALLEST*/);
    /***/

    m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */

    s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
    s.heap[--s.heap_max] = m;

    /* Create a new node father of n and m */
    tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
    s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
    tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;

    /* and insert the new node in the heap */
    s.heap[1/*SMALLEST*/] = node++;
    pqdownheap(s, tree, 1/*SMALLEST*/);

  } while (s.heap_len >= 2);

  s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];

  /* At this point, the fields freq and dad are set. We can now
   * generate the bit lengths.
   */
  gen_bitlen(s, desc);

  /* The field len is now set, we can generate the bit codes */
  gen_codes(tree, max_code, s.bl_count);
}


/* ===========================================================================
 * Scan a literal or distance tree to determine the frequencies of the codes
 * in the bit length tree.
 */
function scan_tree(s, tree, max_code)
//    deflate_state *s;
//    ct_data *tree;   /* the tree to be scanned */
//    int max_code;    /* and its largest code of non zero frequency */
{
  var n;                     /* iterates over all tree elements */
  var prevlen = -1;          /* last emitted length */
  var curlen;                /* length of current code */

  var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */

  var count = 0;             /* repeat count of the current code */
  var max_count = 7;         /* max repeat count */
  var min_count = 4;         /* min repeat count */

  if (nextlen === 0) {
    max_count = 138;
    min_count = 3;
  }
  tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */

  for (n = 0; n <= max_code; n++) {
    curlen = nextlen;
    nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;

    if (++count < max_count && curlen === nextlen) {
      continue;

    } else if (count < min_count) {
      s.bl_tree[curlen * 2]/*.Freq*/ += count;

    } else if (curlen !== 0) {

      if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
      s.bl_tree[REP_3_6 * 2]/*.Freq*/++;

    } else if (count <= 10) {
      s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;

    } else {
      s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;
    }

    count = 0;
    prevlen = curlen;

    if (nextlen === 0) {
      max_count = 138;
      min_count = 3;

    } else if (curlen === nextlen) {
      max_count = 6;
      min_count = 3;

    } else {
      max_count = 7;
      min_count = 4;
    }
  }
}


/* ===========================================================================
 * Send a literal or distance tree in compressed form, using the codes in
 * bl_tree.
 */
function send_tree(s, tree, max_code)
//    deflate_state *s;
//    ct_data *tree; /* the tree to be scanned */
//    int max_code;       /* and its largest code of non zero frequency */
{
  var n;                     /* iterates over all tree elements */
  var prevlen = -1;          /* last emitted length */
  var curlen;                /* length of current code */

  var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */

  var count = 0;             /* repeat count of the current code */
  var max_count = 7;         /* max repeat count */
  var min_count = 4;         /* min repeat count */

  /* tree[max_code+1].Len = -1; */  /* guard already set */
  if (nextlen === 0) {
    max_count = 138;
    min_count = 3;
  }

  for (n = 0; n <= max_code; n++) {
    curlen = nextlen;
    nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;

    if (++count < max_count && curlen === nextlen) {
      continue;

    } else if (count < min_count) {
      do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);

    } else if (curlen !== 0) {
      if (curlen !== prevlen) {
        send_code(s, curlen, s.bl_tree);
        count--;
      }
      //Assert(count >= 3 && count <= 6, " 3_6?");
      send_code(s, REP_3_6, s.bl_tree);
      send_bits(s, count - 3, 2);

    } else if (count <= 10) {
      send_code(s, REPZ_3_10, s.bl_tree);
      send_bits(s, count - 3, 3);

    } else {
      send_code(s, REPZ_11_138, s.bl_tree);
      send_bits(s, count - 11, 7);
    }

    count = 0;
    prevlen = curlen;
    if (nextlen === 0) {
      max_count = 138;
      min_count = 3;

    } else if (curlen === nextlen) {
      max_count = 6;
      min_count = 3;

    } else {
      max_count = 7;
      min_count = 4;
    }
  }
}


/* ===========================================================================
 * Construct the Huffman tree for the bit lengths and return the index in
 * bl_order of the last bit length code to send.
 */
function build_bl_tree(s) {
  var max_blindex;  /* index of last bit length code of non zero freq */

  /* Determine the bit length frequencies for literal and distance trees */
  scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
  scan_tree(s, s.dyn_dtree, s.d_desc.max_code);

  /* Build the bit length tree: */
  build_tree(s, s.bl_desc);
  /* opt_len now includes the length of the tree representations, except
   * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
   */

  /* Determine the number of bit length codes to send. The pkzip format
   * requires that at least 4 bit length codes be sent. (appnote.txt says
   * 3 but the actual value used is 4.)
   */
  for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
    if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
      break;
    }
  }
  /* Update opt_len to include the bit length tree and counts */
  s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
  //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
  //        s->opt_len, s->static_len));

  return max_blindex;
}


/* ===========================================================================
 * Send the header for a block using dynamic Huffman trees: the counts, the
 * lengths of the bit length codes, the literal tree and the distance tree.
 * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
 */
function send_all_trees(s, lcodes, dcodes, blcodes)
//    deflate_state *s;
//    int lcodes, dcodes, blcodes; /* number of codes for each tree */
{
  var rank;                    /* index in bl_order */

  //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  //        "too many codes");
  //Tracev((stderr, "\nbl counts: "));
  send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
  send_bits(s, dcodes - 1,   5);
  send_bits(s, blcodes - 4,  4); /* not -3 as stated in appnote.txt */
  for (rank = 0; rank < blcodes; rank++) {
    //Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
    send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);
  }
  //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));

  send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */
  //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));

  send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */
  //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
}


/* ===========================================================================
 * Check if the data type is TEXT or BINARY, using the following algorithm:
 * - TEXT if the two conditions below are satisfied:
 *    a) There are no non-portable control characters belonging to the
 *       "black list" (0..6, 14..25, 28..31).
 *    b) There is at least one printable character belonging to the
 *       "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
 * - BINARY otherwise.
 * - The following partially-portable control characters form a
 *   "gray list" that is ignored in this detection algorithm:
 *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
 * IN assertion: the fields Freq of dyn_ltree are set.
 */
function detect_data_type(s) {
  /* black_mask is the bit mask of black-listed bytes
   * set bits 0..6, 14..25, and 28..31
   * 0xf3ffc07f = binary 11110011111111111100000001111111
   */
  var black_mask = 0xf3ffc07f;
  var n;

  /* Check for non-textual ("black-listed") bytes. */
  for (n = 0; n <= 31; n++, black_mask >>>= 1) {
    if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {
      return Z_BINARY;
    }
  }

  /* Check for textual ("white-listed") bytes. */
  if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
      s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
    return Z_TEXT;
  }
  for (n = 32; n < LITERALS; n++) {
    if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
      return Z_TEXT;
    }
  }

  /* There are no "black-listed" or "white-listed" bytes:
   * this stream either is empty or has tolerated ("gray-listed") bytes only.
   */
  return Z_BINARY;
}


var static_init_done = false;

/* ===========================================================================
 * Initialize the tree data structures for a new zlib stream.
 */
function _tr_init(s)
{

  if (!static_init_done) {
    tr_static_init();
    static_init_done = true;
  }

  s.l_desc  = new TreeDesc(s.dyn_ltree, static_l_desc);
  s.d_desc  = new TreeDesc(s.dyn_dtree, static_d_desc);
  s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);

  s.bi_buf = 0;
  s.bi_valid = 0;

  /* Initialize the first block of the first file: */
  init_block(s);
}


/* ===========================================================================
 * Send a stored block
 */
function _tr_stored_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf;       /* input block */
//ulg stored_len;   /* length of input block */
//int last;         /* one if this is the last block for a file */
{
  send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);    /* send block type */
  copy_block(s, buf, stored_len, true); /* with header */
}


/* ===========================================================================
 * Send one empty static block to give enough lookahead for inflate.
 * This takes 10 bits, of which 7 may remain in the bit buffer.
 */
function _tr_align(s) {
  send_bits(s, STATIC_TREES << 1, 3);
  send_code(s, END_BLOCK, static_ltree);
  bi_flush(s);
}


/* ===========================================================================
 * Determine the best encoding for the current block: dynamic trees, static
 * trees or store, and output the encoded block to the zip file.
 */
function _tr_flush_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf;       /* input block, or NULL if too old */
//ulg stored_len;   /* length of input block */
//int last;         /* one if this is the last block for a file */
{
  var opt_lenb, static_lenb;  /* opt_len and static_len in bytes */
  var max_blindex = 0;        /* index of last bit length code of non zero freq */

  /* Build the Huffman trees unless a stored block is forced */
  if (s.level > 0) {

    /* Check if the file is binary or text */
    if (s.strm.data_type === Z_UNKNOWN) {
      s.strm.data_type = detect_data_type(s);
    }

    /* Construct the literal and distance trees */
    build_tree(s, s.l_desc);
    // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
    //        s->static_len));

    build_tree(s, s.d_desc);
    // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
    //        s->static_len));
    /* At this point, opt_len and static_len are the total bit lengths of
     * the compressed block data, excluding the tree representations.
     */

    /* Build the bit length tree for the above two trees, and get the index
     * in bl_order of the last bit length code to send.
     */
    max_blindex = build_bl_tree(s);

    /* Determine the best encoding. Compute the block lengths in bytes. */
    opt_lenb = (s.opt_len + 3 + 7) >>> 3;
    static_lenb = (s.static_len + 3 + 7) >>> 3;

    // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
    //        opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
    //        s->last_lit));

    if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }

  } else {
    // Assert(buf != (char*)0, "lost buf");
    opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
  }

  if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {
    /* 4: two words for the lengths */

    /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
     * Otherwise we can't have processed more than WSIZE input bytes since
     * the last block flush, because compression would have been
     * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
     * transform a block into a stored block.
     */
    _tr_stored_block(s, buf, stored_len, last);

  } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {

    send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
    compress_block(s, static_ltree, static_dtree);

  } else {
    send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
    send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
    compress_block(s, s.dyn_ltree, s.dyn_dtree);
  }
  // Assert (s->compressed_len == s->bits_sent, "bad compressed size");
  /* The above check is made mod 2^32, for files larger than 512 MB
   * and uLong implemented on 32 bits.
   */
  init_block(s);

  if (last) {
    bi_windup(s);
  }
  // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
  //       s->compressed_len-7*last));
}

/* ===========================================================================
 * Save the match info and tally the frequency counts. Return true if
 * the current block must be flushed.
 */
function _tr_tally(s, dist, lc)
//    deflate_state *s;
//    unsigned dist;  /* distance of matched string */
//    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
{
  //var out_length, in_length, dcode;

  s.pending_buf[s.d_buf + s.last_lit * 2]     = (dist >>> 8) & 0xff;
  s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;

  s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
  s.last_lit++;

  if (dist === 0) {
    /* lc is the unmatched char */
    s.dyn_ltree[lc * 2]/*.Freq*/++;
  } else {
    s.matches++;
    /* Here, lc is the match length - MIN_MATCH */
    dist--;             /* dist = match distance - 1 */
    //Assert((ush)dist < (ush)MAX_DIST(s) &&
    //       (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
    //       (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");

    s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
    s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
  }

// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility

//#ifdef TRUNCATE_BLOCK
//  /* Try to guess if it is profitable to stop the current block here */
//  if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
//    /* Compute an upper bound for the compressed length */
//    out_length = s.last_lit*8;
//    in_length = s.strstart - s.block_start;
//
//    for (dcode = 0; dcode < D_CODES; dcode++) {
//      out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
//    }
//    out_length >>>= 3;
//    //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
//    //       s->last_lit, in_length, out_length,
//    //       100L - out_length*100L/in_length));
//    if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
//      return true;
//    }
//  }
//#endif

  return (s.last_lit === s.lit_bufsize - 1);
  /* We avoid equality with lit_bufsize because of wraparound at 64K
   * on 16 bit machines and because stored blocks are restricted to
   * 64K-1 bytes.
   */
}

exports._tr_init  = _tr_init;
exports._tr_stored_block = _tr_stored_block;
exports._tr_flush_block  = _tr_flush_block;
exports._tr_tally = _tr_tally;
exports._tr_align = _tr_align;


/***/ }),

/***/ 4442:
/***/ (function(module) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

function ZStream() {
  /* next input byte */
  this.input = null; // JS specific, because we have no pointers
  this.next_in = 0;
  /* number of bytes available at input */
  this.avail_in = 0;
  /* total number of input bytes read so far */
  this.total_in = 0;
  /* next output byte should be put there */
  this.output = null; // JS specific, because we have no pointers
  this.next_out = 0;
  /* remaining free space at output */
  this.avail_out = 0;
  /* total number of bytes output so far */
  this.total_out = 0;
  /* last error message, NULL if no error */
  this.msg = ''/*Z_NULL*/;
  /* not visible by applications */
  this.state = null;
  /* best guess about the data type: binary or text */
  this.data_type = 2/*Z_UNKNOWN*/;
  /* adler32 value of the uncompressed data */
  this.adler = 0;
}

module.exports = ZStream;


/***/ }),

/***/ 5482:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

var parse = __webpack_require__(8809);
var walk = __webpack_require__(8449);
var stringify = __webpack_require__(9063);

function ValueParser(value) {
  if (this instanceof ValueParser) {
    this.nodes = parse(value);
    return this;
  }
  return new ValueParser(value);
}

ValueParser.prototype.toString = function() {
  return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
};

ValueParser.prototype.walk = function(cb, bubble) {
  walk(this.nodes, cb, bubble);
  return this;
};

ValueParser.unit = __webpack_require__(2882);

ValueParser.walk = walk;

ValueParser.stringify = stringify;

module.exports = ValueParser;


/***/ }),

/***/ 8809:
/***/ (function(module) {

var openParentheses = "(".charCodeAt(0);
var closeParentheses = ")".charCodeAt(0);
var singleQuote = "'".charCodeAt(0);
var doubleQuote = '"'.charCodeAt(0);
var backslash = "\\".charCodeAt(0);
var slash = "/".charCodeAt(0);
var comma = ",".charCodeAt(0);
var colon = ":".charCodeAt(0);
var star = "*".charCodeAt(0);
var uLower = "u".charCodeAt(0);
var uUpper = "U".charCodeAt(0);
var plus = "+".charCodeAt(0);
var isUnicodeRange = /^[a-f0-9?-]+$/i;

module.exports = function(input) {
  var tokens = [];
  var value = input;

  var next,
    quote,
    prev,
    token,
    escape,
    escapePos,
    whitespacePos,
    parenthesesOpenPos;
  var pos = 0;
  var code = value.charCodeAt(pos);
  var max = value.length;
  var stack = [{ nodes: tokens }];
  var balanced = 0;
  var parent;

  var name = "";
  var before = "";
  var after = "";

  while (pos < max) {
    // Whitespaces
    if (code <= 32) {
      next = pos;
      do {
        next += 1;
        code = value.charCodeAt(next);
      } while (code <= 32);
      token = value.slice(pos, next);

      prev = tokens[tokens.length - 1];
      if (code === closeParentheses && balanced) {
        after = token;
      } else if (prev && prev.type === "div") {
        prev.after = token;
        prev.sourceEndIndex += token.length;
      } else if (
        code === comma ||
        code === colon ||
        (code === slash &&
          value.charCodeAt(next + 1) !== star &&
          (!parent ||
            (parent && parent.type === "function" && parent.value !== "calc")))
      ) {
        before = token;
      } else {
        tokens.push({
          type: "space",
          sourceIndex: pos,
          sourceEndIndex: next,
          value: token
        });
      }

      pos = next;

      // Quotes
    } else if (code === singleQuote || code === doubleQuote) {
      next = pos;
      quote = code === singleQuote ? "'" : '"';
      token = {
        type: "string",
        sourceIndex: pos,
        quote: quote
      };
      do {
        escape = false;
        next = value.indexOf(quote, next + 1);
        if (~next) {
          escapePos = next;
          while (value.charCodeAt(escapePos - 1) === backslash) {
            escapePos -= 1;
            escape = !escape;
          }
        } else {
          value += quote;
          next = value.length - 1;
          token.unclosed = true;
        }
      } while (escape);
      token.value = value.slice(pos + 1, next);
      token.sourceEndIndex = token.unclosed ? next : next + 1;
      tokens.push(token);
      pos = next + 1;
      code = value.charCodeAt(pos);

      // Comments
    } else if (code === slash && value.charCodeAt(pos + 1) === star) {
      next = value.indexOf("*/", pos);

      token = {
        type: "comment",
        sourceIndex: pos,
        sourceEndIndex: next + 2
      };

      if (next === -1) {
        token.unclosed = true;
        next = value.length;
        token.sourceEndIndex = next;
      }

      token.value = value.slice(pos + 2, next);
      tokens.push(token);

      pos = next + 2;
      code = value.charCodeAt(pos);

      // Operation within calc
    } else if (
      (code === slash || code === star) &&
      parent &&
      parent.type === "function" &&
      parent.value === "calc"
    ) {
      token = value[pos];
      tokens.push({
        type: "word",
        sourceIndex: pos - before.length,
        sourceEndIndex: pos + token.length,
        value: token
      });
      pos += 1;
      code = value.charCodeAt(pos);

      // Dividers
    } else if (code === slash || code === comma || code === colon) {
      token = value[pos];

      tokens.push({
        type: "div",
        sourceIndex: pos - before.length,
        sourceEndIndex: pos + token.length,
        value: token,
        before: before,
        after: ""
      });
      before = "";

      pos += 1;
      code = value.charCodeAt(pos);

      // Open parentheses
    } else if (openParentheses === code) {
      // Whitespaces after open parentheses
      next = pos;
      do {
        next += 1;
        code = value.charCodeAt(next);
      } while (code <= 32);
      parenthesesOpenPos = pos;
      token = {
        type: "function",
        sourceIndex: pos - name.length,
        value: name,
        before: value.slice(parenthesesOpenPos + 1, next)
      };
      pos = next;

      if (name === "url" && code !== singleQuote && code !== doubleQuote) {
        next -= 1;
        do {
          escape = false;
          next = value.indexOf(")", next + 1);
          if (~next) {
            escapePos = next;
            while (value.charCodeAt(escapePos - 1) === backslash) {
              escapePos -= 1;
              escape = !escape;
            }
          } else {
            value += ")";
            next = value.length - 1;
            token.unclosed = true;
          }
        } while (escape);
        // Whitespaces before closed
        whitespacePos = next;
        do {
          whitespacePos -= 1;
          code = value.charCodeAt(whitespacePos);
        } while (code <= 32);
        if (parenthesesOpenPos < whitespacePos) {
          if (pos !== whitespacePos + 1) {
            token.nodes = [
              {
                type: "word",
                sourceIndex: pos,
                sourceEndIndex: whitespacePos + 1,
                value: value.slice(pos, whitespacePos + 1)
              }
            ];
          } else {
            token.nodes = [];
          }
          if (token.unclosed && whitespacePos + 1 !== next) {
            token.after = "";
            token.nodes.push({
              type: "space",
              sourceIndex: whitespacePos + 1,
              sourceEndIndex: next,
              value: value.slice(whitespacePos + 1, next)
            });
          } else {
            token.after = value.slice(whitespacePos + 1, next);
            token.sourceEndIndex = next;
          }
        } else {
          token.after = "";
          token.nodes = [];
        }
        pos = next + 1;
        token.sourceEndIndex = token.unclosed ? next : pos;
        code = value.charCodeAt(pos);
        tokens.push(token);
      } else {
        balanced += 1;
        token.after = "";
        token.sourceEndIndex = pos + 1;
        tokens.push(token);
        stack.push(token);
        tokens = token.nodes = [];
        parent = token;
      }
      name = "";

      // Close parentheses
    } else if (closeParentheses === code && balanced) {
      pos += 1;
      code = value.charCodeAt(pos);

      parent.after = after;
      parent.sourceEndIndex += after.length;
      after = "";
      balanced -= 1;
      stack[stack.length - 1].sourceEndIndex = pos;
      stack.pop();
      parent = stack[balanced];
      tokens = parent.nodes;

      // Words
    } else {
      next = pos;
      do {
        if (code === backslash) {
          next += 1;
        }
        next += 1;
        code = value.charCodeAt(next);
      } while (
        next < max &&
        !(
          code <= 32 ||
          code === singleQuote ||
          code === doubleQuote ||
          code === comma ||
          code === colon ||
          code === slash ||
          code === openParentheses ||
          (code === star &&
            parent &&
            parent.type === "function" &&
            parent.value === "calc") ||
          (code === slash &&
            parent.type === "function" &&
            parent.value === "calc") ||
          (code === closeParentheses && balanced)
        )
      );
      token = value.slice(pos, next);

      if (openParentheses === code) {
        name = token;
      } else if (
        (uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
        plus === token.charCodeAt(1) &&
        isUnicodeRange.test(token.slice(2))
      ) {
        tokens.push({
          type: "unicode-range",
          sourceIndex: pos,
          sourceEndIndex: next,
          value: token
        });
      } else {
        tokens.push({
          type: "word",
          sourceIndex: pos,
          sourceEndIndex: next,
          value: token
        });
      }

      pos = next;
    }
  }

  for (pos = stack.length - 1; pos; pos -= 1) {
    stack[pos].unclosed = true;
    stack[pos].sourceEndIndex = value.length;
  }

  return stack[0].nodes;
};


/***/ }),

/***/ 9063:
/***/ (function(module) {

function stringifyNode(node, custom) {
  var type = node.type;
  var value = node.value;
  var buf;
  var customResult;

  if (custom && (customResult = custom(node)) !== undefined) {
    return customResult;
  } else if (type === "word" || type === "space") {
    return value;
  } else if (type === "string") {
    buf = node.quote || "";
    return buf + value + (node.unclosed ? "" : buf);
  } else if (type === "comment") {
    return "/*" + value + (node.unclosed ? "" : "*/");
  } else if (type === "div") {
    return (node.before || "") + value + (node.after || "");
  } else if (Array.isArray(node.nodes)) {
    buf = stringify(node.nodes, custom);
    if (type !== "function") {
      return buf;
    }
    return (
      value +
      "(" +
      (node.before || "") +
      buf +
      (node.after || "") +
      (node.unclosed ? "" : ")")
    );
  }
  return value;
}

function stringify(nodes, custom) {
  var result, i;

  if (Array.isArray(nodes)) {
    result = "";
    for (i = nodes.length - 1; ~i; i -= 1) {
      result = stringifyNode(nodes[i], custom) + result;
    }
    return result;
  }
  return stringifyNode(nodes, custom);
}

module.exports = stringify;


/***/ }),

/***/ 2882:
/***/ (function(module) {

var minus = "-".charCodeAt(0);
var plus = "+".charCodeAt(0);
var dot = ".".charCodeAt(0);
var exp = "e".charCodeAt(0);
var EXP = "E".charCodeAt(0);

// Check if three code points would start a number
// https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
function likeNumber(value) {
  var code = value.charCodeAt(0);
  var nextCode;

  if (code === plus || code === minus) {
    nextCode = value.charCodeAt(1);

    if (nextCode >= 48 && nextCode <= 57) {
      return true;
    }

    var nextNextCode = value.charCodeAt(2);

    if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
      return true;
    }

    return false;
  }

  if (code === dot) {
    nextCode = value.charCodeAt(1);

    if (nextCode >= 48 && nextCode <= 57) {
      return true;
    }

    return false;
  }

  if (code >= 48 && code <= 57) {
    return true;
  }

  return false;
}

// Consume a number
// https://www.w3.org/TR/css-syntax-3/#consume-number
module.exports = function(value) {
  var pos = 0;
  var length = value.length;
  var code;
  var nextCode;
  var nextNextCode;

  if (length === 0 || !likeNumber(value)) {
    return false;
  }

  code = value.charCodeAt(pos);

  if (code === plus || code === minus) {
    pos++;
  }

  while (pos < length) {
    code = value.charCodeAt(pos);

    if (code < 48 || code > 57) {
      break;
    }

    pos += 1;
  }

  code = value.charCodeAt(pos);
  nextCode = value.charCodeAt(pos + 1);

  if (code === dot && nextCode >= 48 && nextCode <= 57) {
    pos += 2;

    while (pos < length) {
      code = value.charCodeAt(pos);

      if (code < 48 || code > 57) {
        break;
      }

      pos += 1;
    }
  }

  code = value.charCodeAt(pos);
  nextCode = value.charCodeAt(pos + 1);
  nextNextCode = value.charCodeAt(pos + 2);

  if (
    (code === exp || code === EXP) &&
    ((nextCode >= 48 && nextCode <= 57) ||
      ((nextCode === plus || nextCode === minus) &&
        nextNextCode >= 48 &&
        nextNextCode <= 57))
  ) {
    pos += nextCode === plus || nextCode === minus ? 3 : 2;

    while (pos < length) {
      code = value.charCodeAt(pos);

      if (code < 48 || code > 57) {
        break;
      }

      pos += 1;
    }
  }

  return {
    number: value.slice(0, pos),
    unit: value.slice(pos)
  };
};


/***/ }),

/***/ 8449:
/***/ (function(module) {

module.exports = function walk(nodes, cb, bubble) {
  var i, max, node, result;

  for (i = 0, max = nodes.length; i < max; i += 1) {
    node = nodes[i];
    if (!bubble) {
      result = cb(node, i, nodes);
    }

    if (
      result !== false &&
      node.type === "function" &&
      Array.isArray(node.nodes)
    ) {
      walk(node.nodes, cb, bubble);
    }

    if (bubble) {
      cb(node, i, nodes);
    }
  }
};


/***/ }),

/***/ 5606:
/***/ (function(module) {

// shim for using process in browser
var process = module.exports = {};

// cached from whatever global is present so that test runners that stub it
// don't break things.  But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals.  It's inside a
// function because try/catches deoptimize in certain engines.

var cachedSetTimeout;
var cachedClearTimeout;

function defaultSetTimout() {
    throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
    throw new Error('clearTimeout has not been defined');
}
(function () {
    try {
        if (typeof setTimeout === 'function') {
            cachedSetTimeout = setTimeout;
        } else {
            cachedSetTimeout = defaultSetTimout;
        }
    } catch (e) {
        cachedSetTimeout = defaultSetTimout;
    }
    try {
        if (typeof clearTimeout === 'function') {
            cachedClearTimeout = clearTimeout;
        } else {
            cachedClearTimeout = defaultClearTimeout;
        }
    } catch (e) {
        cachedClearTimeout = defaultClearTimeout;
    }
} ())
function runTimeout(fun) {
    if (cachedSetTimeout === setTimeout) {
        //normal enviroments in sane situations
        return setTimeout(fun, 0);
    }
    // if setTimeout wasn't available but was latter defined
    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
        cachedSetTimeout = setTimeout;
        return setTimeout(fun, 0);
    }
    try {
        // when when somebody has screwed with setTimeout but no I.E. maddness
        return cachedSetTimeout(fun, 0);
    } catch(e){
        try {
            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
            return cachedSetTimeout.call(null, fun, 0);
        } catch(e){
            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
            return cachedSetTimeout.call(this, fun, 0);
        }
    }


}
function runClearTimeout(marker) {
    if (cachedClearTimeout === clearTimeout) {
        //normal enviroments in sane situations
        return clearTimeout(marker);
    }
    // if clearTimeout wasn't available but was latter defined
    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
        cachedClearTimeout = clearTimeout;
        return clearTimeout(marker);
    }
    try {
        // when when somebody has screwed with setTimeout but no I.E. maddness
        return cachedClearTimeout(marker);
    } catch (e){
        try {
            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
            return cachedClearTimeout.call(null, marker);
        } catch (e){
            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
            // Some versions of I.E. have different rules for clearTimeout vs setTimeout
            return cachedClearTimeout.call(this, marker);
        }
    }



}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;

function cleanUpNextTick() {
    if (!draining || !currentQueue) {
        return;
    }
    draining = false;
    if (currentQueue.length) {
        queue = currentQueue.concat(queue);
    } else {
        queueIndex = -1;
    }
    if (queue.length) {
        drainQueue();
    }
}

function drainQueue() {
    if (draining) {
        return;
    }
    var timeout = runTimeout(cleanUpNextTick);
    draining = true;

    var len = queue.length;
    while(len) {
        currentQueue = queue;
        queue = [];
        while (++queueIndex < len) {
            if (currentQueue) {
                currentQueue[queueIndex].run();
            }
        }
        queueIndex = -1;
        len = queue.length;
    }
    currentQueue = null;
    draining = false;
    runClearTimeout(timeout);
}

process.nextTick = function (fun) {
    var args = new Array(arguments.length - 1);
    if (arguments.length > 1) {
        for (var i = 1; i < arguments.length; i++) {
            args[i - 1] = arguments[i];
        }
    }
    queue.push(new Item(fun, args));
    if (queue.length === 1 && !draining) {
        runTimeout(drainQueue);
    }
};

// v8 likes predictible objects
function Item(fun, array) {
    this.fun = fun;
    this.array = array;
}
Item.prototype.run = function () {
    this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};

function noop() {}

process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;

process.listeners = function (name) { return [] }

process.binding = function (name) {
    throw new Error('process.binding is not supported');
};

process.cwd = function () { return '/' };
process.chdir = function (dir) {
    throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };


/***/ }),

/***/ 2694:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/**
 * 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 = __webpack_require__(6925);

function emptyFunction() {}
function emptyFunctionWithReset() {}
emptyFunctionWithReset.resetWarningCache = emptyFunction;

module.exports = 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;
  };
  // Important!
  // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
  var ReactPropTypes = {
    array: 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;
};


/***/ }),

/***/ 5556:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

/**
 * 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 (false) { var throwOnDirectAccess, ReactIs; } else {
  // By explicitly using `prop-types` you are opting into new production behavior.
  // http://fb.me/prop-types-in-prod
  module.exports = __webpack_require__(2694)();
}


/***/ }),

/***/ 6925:
/***/ (function(module) {

"use strict";
/**
 * 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 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';

module.exports = ReactPropTypesSecret;


/***/ }),

/***/ 6663:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

const strictUriEncode = __webpack_require__(4280);
const decodeComponent = __webpack_require__(454);
const splitOnFirst = __webpack_require__(528);

const isNullOrUndefined = value => value === null || value === undefined;

function encoderForArrayFormat(options) {
	switch (options.arrayFormat) {
		case 'index':
			return key => (result, value) => {
				const index = result.length;

				if (
					value === undefined ||
					(options.skipNull && value === null) ||
					(options.skipEmptyString && value === '')
				) {
					return result;
				}

				if (value === null) {
					return [...result, [encode(key, options), '[', index, ']'].join('')];
				}

				return [
					...result,
					[encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')
				];
			};

		case 'bracket':
			return key => (result, value) => {
				if (
					value === undefined ||
					(options.skipNull && value === null) ||
					(options.skipEmptyString && value === '')
				) {
					return result;
				}

				if (value === null) {
					return [...result, [encode(key, options), '[]'].join('')];
				}

				return [...result, [encode(key, options), '[]=', encode(value, options)].join('')];
			};

		case 'comma':
		case 'separator':
			return key => (result, value) => {
				if (value === null || value === undefined || value.length === 0) {
					return result;
				}

				if (result.length === 0) {
					return [[encode(key, options), '=', encode(value, options)].join('')];
				}

				return [[result, encode(value, options)].join(options.arrayFormatSeparator)];
			};

		default:
			return key => (result, value) => {
				if (
					value === undefined ||
					(options.skipNull && value === null) ||
					(options.skipEmptyString && value === '')
				) {
					return result;
				}

				if (value === null) {
					return [...result, encode(key, options)];
				}

				return [...result, [encode(key, options), '=', encode(value, options)].join('')];
			};
	}
}

function parserForArrayFormat(options) {
	let result;

	switch (options.arrayFormat) {
		case 'index':
			return (key, value, accumulator) => {
				result = /\[(\d*)\]$/.exec(key);

				key = key.replace(/\[\d*\]$/, '');

				if (!result) {
					accumulator[key] = value;
					return;
				}

				if (accumulator[key] === undefined) {
					accumulator[key] = {};
				}

				accumulator[key][result[1]] = value;
			};

		case 'bracket':
			return (key, value, accumulator) => {
				result = /(\[\])$/.exec(key);
				key = key.replace(/\[\]$/, '');

				if (!result) {
					accumulator[key] = value;
					return;
				}

				if (accumulator[key] === undefined) {
					accumulator[key] = [value];
					return;
				}

				accumulator[key] = [].concat(accumulator[key], value);
			};

		case 'comma':
		case 'separator':
			return (key, value, accumulator) => {
				const isArray = typeof value === 'string' && value.includes(options.arrayFormatSeparator);
				const isEncodedArray = (typeof value === 'string' && !isArray && decode(value, options).includes(options.arrayFormatSeparator));
				value = isEncodedArray ? decode(value, options) : value;
				const newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options);
				accumulator[key] = newValue;
			};

		default:
			return (key, value, accumulator) => {
				if (accumulator[key] === undefined) {
					accumulator[key] = value;
					return;
				}

				accumulator[key] = [].concat(accumulator[key], value);
			};
	}
}

function validateArrayFormatSeparator(value) {
	if (typeof value !== 'string' || value.length !== 1) {
		throw new TypeError('arrayFormatSeparator must be single character string');
	}
}

function encode(value, options) {
	if (options.encode) {
		return options.strict ? strictUriEncode(value) : encodeURIComponent(value);
	}

	return value;
}

function decode(value, options) {
	if (options.decode) {
		return decodeComponent(value);
	}

	return value;
}

function keysSorter(input) {
	if (Array.isArray(input)) {
		return input.sort();
	}

	if (typeof input === 'object') {
		return keysSorter(Object.keys(input))
			.sort((a, b) => Number(a) - Number(b))
			.map(key => input[key]);
	}

	return input;
}

function removeHash(input) {
	const hashStart = input.indexOf('#');
	if (hashStart !== -1) {
		input = input.slice(0, hashStart);
	}

	return input;
}

function getHash(url) {
	let hash = '';
	const hashStart = url.indexOf('#');
	if (hashStart !== -1) {
		hash = url.slice(hashStart);
	}

	return hash;
}

function extract(input) {
	input = removeHash(input);
	const queryStart = input.indexOf('?');
	if (queryStart === -1) {
		return '';
	}

	return input.slice(queryStart + 1);
}

function parseValue(value, options) {
	if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {
		value = Number(value);
	} else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
		value = value.toLowerCase() === 'true';
	}

	return value;
}

function parse(query, options) {
	options = Object.assign({
		decode: true,
		sort: true,
		arrayFormat: 'none',
		arrayFormatSeparator: ',',
		parseNumbers: false,
		parseBooleans: false
	}, options);

	validateArrayFormatSeparator(options.arrayFormatSeparator);

	const formatter = parserForArrayFormat(options);

	// Create an object with no prototype
	const ret = Object.create(null);

	if (typeof query !== 'string') {
		return ret;
	}

	query = query.trim().replace(/^[?#&]/, '');

	if (!query) {
		return ret;
	}

	for (const param of query.split('&')) {
		let [key, value] = splitOnFirst(options.decode ? param.replace(/\+/g, ' ') : param, '=');

		// Missing `=` should be `null`:
		// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
		value = value === undefined ? null : ['comma', 'separator'].includes(options.arrayFormat) ? value : decode(value, options);
		formatter(decode(key, options), value, ret);
	}

	for (const key of Object.keys(ret)) {
		const value = ret[key];
		if (typeof value === 'object' && value !== null) {
			for (const k of Object.keys(value)) {
				value[k] = parseValue(value[k], options);
			}
		} else {
			ret[key] = parseValue(value, options);
		}
	}

	if (options.sort === false) {
		return ret;
	}

	return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {
		const value = ret[key];
		if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {
			// Sort object keys, not values
			result[key] = keysSorter(value);
		} else {
			result[key] = value;
		}

		return result;
	}, Object.create(null));
}

exports.extract = extract;
exports.parse = parse;

exports.stringify = (object, options) => {
	if (!object) {
		return '';
	}

	options = Object.assign({
		encode: true,
		strict: true,
		arrayFormat: 'none',
		arrayFormatSeparator: ','
	}, options);

	validateArrayFormatSeparator(options.arrayFormatSeparator);

	const shouldFilter = key => (
		(options.skipNull && isNullOrUndefined(object[key])) ||
		(options.skipEmptyString && object[key] === '')
	);

	const formatter = encoderForArrayFormat(options);

	const objectCopy = {};

	for (const key of Object.keys(object)) {
		if (!shouldFilter(key)) {
			objectCopy[key] = object[key];
		}
	}

	const keys = Object.keys(objectCopy);

	if (options.sort !== false) {
		keys.sort(options.sort);
	}

	return keys.map(key => {
		const value = object[key];

		if (value === undefined) {
			return '';
		}

		if (value === null) {
			return encode(key, options);
		}

		if (Array.isArray(value)) {
			return value
				.reduce(formatter(key), [])
				.join('&');
		}

		return encode(key, options) + '=' + encode(value, options);
	}).filter(x => x.length > 0).join('&');
};

exports.parseUrl = (url, options) => {
	options = Object.assign({
		decode: true
	}, options);

	const [url_, hash] = splitOnFirst(url, '#');

	return Object.assign(
		{
			url: url_.split('?')[0] || '',
			query: parse(extract(url), options)
		},
		options && options.parseFragmentIdentifier && hash ? {fragmentIdentifier: decode(hash, options)} : {}
	);
};

exports.stringifyUrl = (object, options) => {
	options = Object.assign({
		encode: true,
		strict: true
	}, options);

	const url = removeHash(object.url).split('?')[0] || '';
	const queryFromUrl = exports.extract(object.url);
	const parsedQueryFromUrl = exports.parse(queryFromUrl, {sort: false});

	const query = Object.assign(parsedQueryFromUrl, object.query);
	let queryString = exports.stringify(query, options);
	if (queryString) {
		queryString = `?${queryString}`;
	}

	let hash = getHash(object.url);
	if (object.fragmentIdentifier) {
		hash = `#${encode(object.fragmentIdentifier, options)}`;
	}

	return `${url}${queryString}${hash}`;
};


/***/ }),

/***/ 2551:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
/**
 * @license React
 * react-dom.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.
 */
/*
 Modernizr 3.0.0pre (Custom Build) | MIT
*/
var aa=__webpack_require__(6540),ca=__webpack_require__(9982);function p(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var da=new Set,ea={};function fa(a,b){ha(a,b);ha(a+"Capture",b)}
function ha(a,b){ea[a]=b;for(a=0;a<b.length;a++)da.add(b[a])}
var ia=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),ja=Object.prototype.hasOwnProperty,ka=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la=
{},ma={};function oa(a){if(ja.call(ma,a))return!0;if(ja.call(la,a))return!1;if(ka.test(a))return ma[a]=!0;la[a]=!0;return!1}function pa(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}
function qa(a,b,c,d){if(null===b||"undefined"===typeof b||pa(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};
"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});
["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});
["checked","multiple","muted","selected"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}
"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(ra,
sa);z[b]=new v(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});
z.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});
function ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2<b.length)||"o"!==b[0]&&"O"!==b[0]||"n"!==b[1]&&"N"!==b[1])qa(b,c,e,d)&&(c=null),d||null===e?oa(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c)))}
var ua=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,va=Symbol.for("react.element"),wa=Symbol.for("react.portal"),ya=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),Aa=Symbol.for("react.profiler"),Ba=Symbol.for("react.provider"),Ca=Symbol.for("react.context"),Da=Symbol.for("react.forward_ref"),Ea=Symbol.for("react.suspense"),Fa=Symbol.for("react.suspense_list"),Ga=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");
var Ia=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var Ja=Symbol.iterator;function Ka(a){if(null===a||"object"!==typeof a)return null;a=Ja&&a[Ja]||a["@@iterator"];return"function"===typeof a?a:null}var A=Object.assign,La;function Ma(a){if(void 0===La)try{throw Error();}catch(c){var b=c.stack.trim().match(/\n( *(at )?)/);La=b&&b[1]||""}return"\n"+La+a}var Na=!1;
function Oa(a,b){if(!a||Na)return"";Na=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error();},Object.defineProperty(b.prototype,"props",{set:function(){throw Error();}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(b,[])}catch(l){var d=l}Reflect.construct(a,[],b)}else{try{b.call()}catch(l){d=l}a.call(b.prototype)}else{try{throw Error();}catch(l){d=l}a()}}catch(l){if(l&&d&&"string"===typeof l.stack){for(var e=l.stack.split("\n"),
f=d.stack.split("\n"),g=e.length-1,h=f.length-1;1<=g&&0<=h&&e[g]!==f[h];)h--;for(;1<=g&&0<=h;g--,h--)if(e[g]!==f[h]){if(1!==g||1!==h){do if(g--,h--,0>h||e[g]!==f[h]){var k="\n"+e[g].replace(" at new "," at ");a.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:"")?Ma(a):""}
function Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return""}}
function Qa(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||"Context")+".Consumer";case Ba:return(a._context.displayName||"Context")+".Provider";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||
b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||"Memo";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}
function Ra(a){var b=a.type;switch(a.tag){case 24:return"Cache";case 9:return(b.displayName||"Context")+".Consumer";case 10:return(b._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=b.render,a=a.displayName||a.name||"",b.displayName||(""!==a?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return b;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(b);case 8:return b===za?"StrictMode":"Mode";case 22:return"Offscreen";
case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof b)return b.displayName||b.name||null;if("string"===typeof b)return b}return null}function Sa(a){switch(typeof a){case "boolean":case "number":case "string":case "undefined":return a;case "object":return a;default:return""}}
function Ta(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)}
function Ua(a){var b=Ta(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=
null;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Ta(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}
function Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,"checked",b,!1)}
function bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?cb(a,b.type,c):b.hasOwnProperty("defaultValue")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}
function db(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}
function cb(a,b,c){if("number"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}var eb=Array.isArray;
function fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=""+Sa(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}
function gb(a,b){if(null!=b.dangerouslySetInnerHTML)throw Error(p(91));return A({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function hb(a,b){var c=b.value;if(null==c){c=b.children;b=b.defaultValue;if(null!=c){if(null!=b)throw Error(p(92));if(eb(c)){if(1<c.length)throw Error(p(93));c=c[0]}b=c}null==b&&(b="");c=b}a._wrapperState={initialValue:Sa(c)}}
function ib(a,b){var c=Sa(b.value),d=Sa(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function jb(a){var b=a.textContent;b===a._wrapperState.initialValue&&""!==b&&null!==b&&(a.value=b)}function kb(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}
function lb(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?kb(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}
var mb,nb=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if("http://www.w3.org/2000/svg"!==a.namespaceURI||"innerHTML"in a)a.innerHTML=b;else{mb=mb||document.createElement("div");mb.innerHTML="<svg>"+b.valueOf().toString()+"</svg>";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});
function ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}
var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,
zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(""+b).trim():b+"px"}
function sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=rb(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});
function ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if("object"!==typeof b.dangerouslySetInnerHTML||!("__html"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&"object"!==typeof b.style)throw Error(p(62));}}
function vb(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;
function Bb(a){if(a=Cb(a)){if("function"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a<b.length;a++)Bb(b[a])}}function Gb(a,b){return a(b)}function Hb(){}var Ib=!1;function Jb(a,b,c){if(Ib)return a(b,c);Ib=!0;try{return Gb(a,b,c)}finally{if(Ib=!1,null!==zb||null!==Ab)Hb(),Fb()}}
function Kb(a,b){var c=a.stateNode;if(null===c)return null;var d=Db(c);if(null===d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":case "onMouseEnter":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&"function"!==
typeof c)throw Error(p(231,b,typeof c));return c}var Lb=!1;if(ia)try{var Mb={};Object.defineProperty(Mb,"passive",{get:function(){Lb=!0}});window.addEventListener("test",Mb,Mb);window.removeEventListener("test",Mb,Mb)}catch(a){Lb=!1}function Nb(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(m){this.onError(m)}}var Ob=!1,Pb=null,Qb=!1,Rb=null,Sb={onError:function(a){Ob=!0;Pb=a}};function Tb(a,b,c,d,e,f,g,h,k){Ob=!1;Pb=null;Nb.apply(Sb,arguments)}
function Ub(a,b,c,d,e,f,g,h,k){Tb.apply(this,arguments);if(Ob){if(Ob){var l=Pb;Ob=!1;Pb=null}else throw Error(p(198));Qb||(Qb=!0,Rb=l)}}function Vb(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.flags&4098)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function Wb(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function Xb(a){if(Vb(a)!==a)throw Error(p(188));}
function Yb(a){var b=a.alternate;if(!b){b=Vb(a);if(null===b)throw Error(p(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return Xb(e),a;if(f===d)return Xb(e),b;f=f.sibling}throw Error(p(188));}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===
c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(p(189));}}if(c.alternate!==d)throw Error(p(190));}if(3!==c.tag)throw Error(p(188));return c.stateNode.current===c?a:b}function Zb(a){a=Yb(a);return null!==a?$b(a):null}function $b(a){if(5===a.tag||6===a.tag)return a;for(a=a.child;null!==a;){var b=$b(a);if(null!==b)return b;a=a.sibling}return null}
var ac=ca.unstable_scheduleCallback,bc=ca.unstable_cancelCallback,cc=ca.unstable_shouldYield,dc=ca.unstable_requestPaint,B=ca.unstable_now,ec=ca.unstable_getCurrentPriorityLevel,fc=ca.unstable_ImmediatePriority,gc=ca.unstable_UserBlockingPriority,hc=ca.unstable_NormalPriority,ic=ca.unstable_LowPriority,jc=ca.unstable_IdlePriority,kc=null,lc=null;function mc(a){if(lc&&"function"===typeof lc.onCommitFiberRoot)try{lc.onCommitFiberRoot(kc,a,void 0,128===(a.current.flags&128))}catch(b){}}
var oc=Math.clz32?Math.clz32:nc,pc=Math.log,qc=Math.LN2;function nc(a){a>>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;
function tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;
default:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0<b;)c=31-oc(b),e=1<<c,d|=a[c],b&=~e;return d}
function vc(a,b){switch(a){case 1:case 2:case 4:return b+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return b+5E3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}
function wc(a,b){for(var c=a.suspendedLanes,d=a.pingedLanes,e=a.expirationTimes,f=a.pendingLanes;0<f;){var g=31-oc(f),h=1<<g,k=e[g];if(-1===k){if(0===(h&c)||0!==(h&d))e[g]=vc(h,b)}else k<=b&&(a.expiredLanes|=h);f&=~h}}function xc(a){a=a.pendingLanes&-1073741825;return 0!==a?a:a&1073741824?1073741824:0}function yc(){var a=rc;rc<<=1;0===(rc&4194240)&&(rc=64);return a}function zc(a){for(var b=[],c=0;31>c;c++)b.push(a);return b}
function Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0<c;){var e=31-oc(c),f=1<<e;b[e]=0;d[e]=-1;a[e]=-1;c&=~f}}
function Cc(a,b){var c=a.entangledLanes|=b;for(a=a.entanglements;c;){var d=31-oc(c),e=1<<d;e&b|a[d]&b&&(a[d]|=b);c&=~e}}var C=0;function Dc(a){a&=-a;return 1<a?4<a?0!==(a&268435455)?16:536870912:4:1}var Ec,Fc,Gc,Hc,Ic,Jc=!1,Kc=[],Lc=null,Mc=null,Nc=null,Oc=new Map,Pc=new Map,Qc=[],Rc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
function Sc(a,b){switch(a){case "focusin":case "focusout":Lc=null;break;case "dragenter":case "dragleave":Mc=null;break;case "mouseover":case "mouseout":Nc=null;break;case "pointerover":case "pointerout":Oc.delete(b.pointerId);break;case "gotpointercapture":case "lostpointercapture":Pc.delete(b.pointerId)}}
function Tc(a,b,c,d,e,f){if(null===a||a.nativeEvent!==f)return a={blockedOn:b,domEventName:c,eventSystemFlags:d,nativeEvent:f,targetContainers:[e]},null!==b&&(b=Cb(b),null!==b&&Fc(b)),a;a.eventSystemFlags|=d;b=a.targetContainers;null!==e&&-1===b.indexOf(e)&&b.push(e);return a}
function Uc(a,b,c,d,e){switch(b){case "focusin":return Lc=Tc(Lc,a,b,c,d,e),!0;case "dragenter":return Mc=Tc(Mc,a,b,c,d,e),!0;case "mouseover":return Nc=Tc(Nc,a,b,c,d,e),!0;case "pointerover":var f=e.pointerId;Oc.set(f,Tc(Oc.get(f)||null,a,b,c,d,e));return!0;case "gotpointercapture":return f=e.pointerId,Pc.set(f,Tc(Pc.get(f)||null,a,b,c,d,e)),!0}return!1}
function Vc(a){var b=Wc(a.target);if(null!==b){var c=Vb(b);if(null!==c)if(b=c.tag,13===b){if(b=Wb(c),null!==b){a.blockedOn=b;Ic(a.priority,function(){Gc(c)});return}}else if(3===b&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null}
function Xc(a){if(null!==a.blockedOn)return!1;for(var b=a.targetContainers;0<b.length;){var c=Yc(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null===c){c=a.nativeEvent;var d=new c.constructor(c.type,c);wb=d;c.target.dispatchEvent(d);wb=null}else return b=Cb(c),null!==b&&Fc(b),a.blockedOn=c,!1;b.shift()}return!0}function Zc(a,b,c){Xc(a)&&c.delete(b)}function $c(){Jc=!1;null!==Lc&&Xc(Lc)&&(Lc=null);null!==Mc&&Xc(Mc)&&(Mc=null);null!==Nc&&Xc(Nc)&&(Nc=null);Oc.forEach(Zc);Pc.forEach(Zc)}
function ad(a,b){a.blockedOn===b&&(a.blockedOn=null,Jc||(Jc=!0,ca.unstable_scheduleCallback(ca.unstable_NormalPriority,$c)))}
function bd(a){function b(b){return ad(b,a)}if(0<Kc.length){ad(Kc[0],a);for(var c=1;c<Kc.length;c++){var d=Kc[c];d.blockedOn===a&&(d.blockedOn=null)}}null!==Lc&&ad(Lc,a);null!==Mc&&ad(Mc,a);null!==Nc&&ad(Nc,a);Oc.forEach(b);Pc.forEach(b);for(c=0;c<Qc.length;c++)d=Qc[c],d.blockedOn===a&&(d.blockedOn=null);for(;0<Qc.length&&(c=Qc[0],null===c.blockedOn);)Vc(c),null===c.blockedOn&&Qc.shift()}var cd=ua.ReactCurrentBatchConfig,dd=!0;
function ed(a,b,c,d){var e=C,f=cd.transition;cd.transition=null;try{C=1,fd(a,b,c,d)}finally{C=e,cd.transition=f}}function gd(a,b,c,d){var e=C,f=cd.transition;cd.transition=null;try{C=4,fd(a,b,c,d)}finally{C=e,cd.transition=f}}
function fd(a,b,c,d){if(dd){var e=Yc(a,b,c,d);if(null===e)hd(a,b,d,id,c),Sc(a,d);else if(Uc(e,a,b,c,d))d.stopPropagation();else if(Sc(a,d),b&4&&-1<Rc.indexOf(a)){for(;null!==e;){var f=Cb(e);null!==f&&Ec(f);f=Yc(a,b,c,d);null===f&&hd(a,b,d,id,c);if(f===e)break;e=f}null!==e&&d.stopPropagation()}else hd(a,b,d,null,c)}}var id=null;
function Yc(a,b,c,d){id=null;a=xb(d);a=Wc(a);if(null!==a)if(b=Vb(a),null===b)a=null;else if(c=b.tag,13===c){a=Wb(b);if(null!==a)return a;a=null}else if(3===c){if(b.stateNode.current.memoizedState.isDehydrated)return 3===b.tag?b.stateNode.containerInfo:null;a=null}else b!==a&&(a=null);id=a;return null}
function jd(a){switch(a){case "cancel":case "click":case "close":case "contextmenu":case "copy":case "cut":case "auxclick":case "dblclick":case "dragend":case "dragstart":case "drop":case "focusin":case "focusout":case "input":case "invalid":case "keydown":case "keypress":case "keyup":case "mousedown":case "mouseup":case "paste":case "pause":case "play":case "pointercancel":case "pointerdown":case "pointerup":case "ratechange":case "reset":case "resize":case "seeked":case "submit":case "touchcancel":case "touchend":case "touchstart":case "volumechange":case "change":case "selectionchange":case "textInput":case "compositionstart":case "compositionend":case "compositionupdate":case "beforeblur":case "afterblur":case "beforeinput":case "blur":case "fullscreenchange":case "focus":case "hashchange":case "popstate":case "select":case "selectstart":return 1;case "drag":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "mousemove":case "mouseout":case "mouseover":case "pointermove":case "pointerout":case "pointerover":case "scroll":case "toggle":case "touchmove":case "wheel":case "mouseenter":case "mouseleave":case "pointerenter":case "pointerleave":return 4;
case "message":switch(ec()){case fc:return 1;case gc:return 4;case hc:case ic:return 16;case jc:return 536870912;default:return 16}default:return 16}}var kd=null,ld=null,md=null;function nd(){if(md)return md;var a,b=ld,c=b.length,d,e="value"in kd?kd.value:kd.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return md=e.slice(a,1<d?1-d:void 0)}
function od(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}function pd(){return!0}function qd(){return!1}
function rd(a){function b(b,d,e,f,g){this._reactName=b;this._targetInst=e;this.type=d;this.nativeEvent=f;this.target=g;this.currentTarget=null;for(var c in a)a.hasOwnProperty(c)&&(b=a[c],this[c]=b?b(f):f[c]);this.isDefaultPrevented=(null!=f.defaultPrevented?f.defaultPrevented:!1===f.returnValue)?pd:qd;this.isPropagationStopped=qd;return this}A(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&
(a.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd});return b}
var sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=rd(sd),ud=A({},sd,{view:0,detail:0}),vd=rd(ud),wd,xd,yd,Ad=A({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if("movementX"in
a)return a.movementX;a!==yd&&(yd&&"mousemove"===a.type?(wd=a.screenX-yd.screenX,xd=a.screenY-yd.screenY):xd=wd=0,yd=a);return wd},movementY:function(a){return"movementY"in a?a.movementY:xd}}),Bd=rd(Ad),Cd=A({},Ad,{dataTransfer:0}),Dd=rd(Cd),Ed=A({},ud,{relatedTarget:0}),Fd=rd(Ed),Gd=A({},sd,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd=rd(Gd),Id=A({},sd,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Jd=rd(Id),Kd=A({},sd,{data:0}),Ld=rd(Kd),Md={Esc:"Escape",
Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",
119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pd(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Od[a])?!!b[a]:!1}function zd(){return Pd}
var Qd=A({},ud,{key:function(a){if(a.key){var b=Md[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=od(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?Nd[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(a){return"keypress"===a.type?od(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===
a.type?od(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),Rd=rd(Qd),Sd=A({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd(Sd),Ud=A({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd(Ud),Wd=A({},sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd=rd(Wd),Yd=A({},Ad,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},
deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Zd=rd(Yd),$d=[9,13,27,32],ae=ia&&"CompositionEvent"in window,be=null;ia&&"documentMode"in document&&(be=document.documentMode);var ce=ia&&"TextEvent"in window&&!be,de=ia&&(!ae||be&&8<be&&11>=be),ee=String.fromCharCode(32),fe=!1;
function ge(a,b){switch(a){case "keyup":return-1!==$d.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "focusout":return!0;default:return!1}}function he(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case "compositionend":return he(b);case "keypress":if(32!==b.which)return null;fe=!0;return ee;case "textInput":return a=b.data,a===ee&&fe?null:a;default:return null}}
function ke(a,b){if(ie)return"compositionend"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case "compositionend":return de&&"ko"!==b.locale?null:b.data;default:return null}}
var le={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!le[a.type]:"textarea"===b?!0:!1}function ne(a,b,c,d){Eb(d);b=oe(b,"onChange");0<b.length&&(c=new td("onChange","change",null,c,d),a.push({event:c,listeners:b}))}var pe=null,qe=null;function re(a){se(a,0)}function te(a){var b=ue(a);if(Wa(b))return a}
function ve(a,b){if("change"===a)return b}var we=!1;if(ia){var xe;if(ia){var ye="oninput"in document;if(!ye){var ze=document.createElement("div");ze.setAttribute("oninput","return;");ye="function"===typeof ze.oninput}xe=ye}else xe=!1;we=xe&&(!document.documentMode||9<document.documentMode)}function Ae(){pe&&(pe.detachEvent("onpropertychange",Be),qe=pe=null)}function Be(a){if("value"===a.propertyName&&te(qe)){var b=[];ne(b,qe,a,xb(a));Jb(re,b)}}
function Ce(a,b,c){"focusin"===a?(Ae(),pe=b,qe=c,pe.attachEvent("onpropertychange",Be)):"focusout"===a&&Ae()}function De(a){if("selectionchange"===a||"keyup"===a||"keydown"===a)return te(qe)}function Ee(a,b){if("click"===a)return te(b)}function Fe(a,b){if("input"===a||"change"===a)return te(b)}function Ge(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var He="function"===typeof Object.is?Object.is:Ge;
function Ie(a,b){if(He(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++){var e=c[d];if(!ja.call(b,e)||!He(a[e],b[e]))return!1}return!0}function Je(a){for(;a&&a.firstChild;)a=a.firstChild;return a}
function Ke(a,b){var c=Je(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}
function Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}
function Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),"selectionStart"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,
d);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});"function"===typeof c.focus&&c.focus();for(c=0;c<b.length;c++)a=b[c],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}
var Pe=ia&&"documentMode"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;
function Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,"selectionStart"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,"onSelect"),0<d.length&&(b=new td("onSelect","select",null,b,c),a.push({event:b,listeners:d}),b.target=Qe)))}
function Ve(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var We={animationend:Ve("Animation","AnimationEnd"),animationiteration:Ve("Animation","AnimationIteration"),animationstart:Ve("Animation","AnimationStart"),transitionend:Ve("Transition","TransitionEnd")},Xe={},Ye={};
ia&&(Ye=document.createElement("div").style,"AnimationEvent"in window||(delete We.animationend.animation,delete We.animationiteration.animation,delete We.animationstart.animation),"TransitionEvent"in window||delete We.transitionend.transition);function Ze(a){if(Xe[a])return Xe[a];if(!We[a])return a;var b=We[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Ye)return Xe[a]=b[c];return a}var $e=Ze("animationend"),af=Ze("animationiteration"),bf=Ze("animationstart"),cf=Ze("transitionend"),df=new Map,ef="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");
function ff(a,b){df.set(a,b);fa(b,[a])}for(var gf=0;gf<ef.length;gf++){var hf=ef[gf],jf=hf.toLowerCase(),kf=hf[0].toUpperCase()+hf.slice(1);ff(jf,"on"+kf)}ff($e,"onAnimationEnd");ff(af,"onAnimationIteration");ff(bf,"onAnimationStart");ff("dblclick","onDoubleClick");ff("focusin","onFocus");ff("focusout","onBlur");ff(cf,"onTransitionEnd");ha("onMouseEnter",["mouseout","mouseover"]);ha("onMouseLeave",["mouseout","mouseover"]);ha("onPointerEnter",["pointerout","pointerover"]);
ha("onPointerLeave",["pointerout","pointerover"]);fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fa("onBeforeInput",["compositionend","keypress","textInput","paste"]);fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));
fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mf=new Set("cancel close invalid load scroll toggle".split(" ").concat(lf));
function nf(a,b,c){var d=a.type||"unknown-event";a.currentTarget=c;Ub(d,b,void 0,a);a.currentTarget=null}
function se(a,b){b=0!==(b&4);for(var c=0;c<a.length;c++){var d=a[c],e=d.event;d=d.listeners;a:{var f=void 0;if(b)for(var g=d.length-1;0<=g;g--){var h=d[g],k=h.instance,l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;nf(e,h,l);f=k}else for(g=0;g<d.length;g++){h=d[g];k=h.instance;l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;nf(e,h,l);f=k}}}if(Qb)throw a=Rb,Qb=!1,Rb=null,a;}
function D(a,b){var c=b[of];void 0===c&&(c=b[of]=new Set);var d=a+"__bubble";c.has(d)||(pf(b,a,2,!1),c.add(d))}function qf(a,b,c){var d=0;b&&(d|=4);pf(c,a,d,b)}var rf="_reactListening"+Math.random().toString(36).slice(2);function sf(a){if(!a[rf]){a[rf]=!0;da.forEach(function(b){"selectionchange"!==b&&(mf.has(b)||qf(b,!1,a),qf(b,!0,a))});var b=9===a.nodeType?a:a.ownerDocument;null===b||b[rf]||(b[rf]=!0,qf("selectionchange",!1,b))}}
function pf(a,b,c,d){switch(jd(b)){case 1:var e=ed;break;case 4:e=gd;break;default:e=fd}c=e.bind(null,b,c,a);e=void 0;!Lb||"touchstart"!==b&&"touchmove"!==b&&"wheel"!==b||(e=!0);d?void 0!==e?a.addEventListener(b,c,{capture:!0,passive:e}):a.addEventListener(b,c,!0):void 0!==e?a.addEventListener(b,c,{passive:e}):a.addEventListener(b,c,!1)}
function hd(a,b,c,d,e){var f=d;if(0===(b&1)&&0===(b&2)&&null!==d)a:for(;;){if(null===d)return;var g=d.tag;if(3===g||4===g){var h=d.stateNode.containerInfo;if(h===e||8===h.nodeType&&h.parentNode===e)break;if(4===g)for(g=d.return;null!==g;){var k=g.tag;if(3===k||4===k)if(k=g.stateNode.containerInfo,k===e||8===k.nodeType&&k.parentNode===e)return;g=g.return}for(;null!==h;){g=Wc(h);if(null===g)return;k=g.tag;if(5===k||6===k){d=f=g;continue a}h=h.parentNode}}d=d.return}Jb(function(){var d=f,e=xb(c),g=[];
a:{var h=df.get(a);if(void 0!==h){var k=td,n=a;switch(a){case "keypress":if(0===od(c))break a;case "keydown":case "keyup":k=Rd;break;case "focusin":n="focus";k=Fd;break;case "focusout":n="blur";k=Fd;break;case "beforeblur":case "afterblur":k=Fd;break;case "click":if(2===c.button)break a;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":k=Bd;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":k=
Dd;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":k=Vd;break;case $e:case af:case bf:k=Hd;break;case cf:k=Xd;break;case "scroll":k=vd;break;case "wheel":k=Zd;break;case "copy":case "cut":case "paste":k=Jd;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":k=Td}var t=0!==(b&4),J=!t&&"scroll"===a,x=t?null!==h?h+"Capture":null:h;t=[];for(var w=d,u;null!==
w;){u=w;var F=u.stateNode;5===u.tag&&null!==F&&(u=F,null!==x&&(F=Kb(w,x),null!=F&&t.push(tf(w,F,u))));if(J)break;w=w.return}0<t.length&&(h=new k(h,n,null,c,e),g.push({event:h,listeners:t}))}}if(0===(b&7)){a:{h="mouseover"===a||"pointerover"===a;k="mouseout"===a||"pointerout"===a;if(h&&c!==wb&&(n=c.relatedTarget||c.fromElement)&&(Wc(n)||n[uf]))break a;if(k||h){h=e.window===e?e:(h=e.ownerDocument)?h.defaultView||h.parentWindow:window;if(k){if(n=c.relatedTarget||c.toElement,k=d,n=n?Wc(n):null,null!==
n&&(J=Vb(n),n!==J||5!==n.tag&&6!==n.tag))n=null}else k=null,n=d;if(k!==n){t=Bd;F="onMouseLeave";x="onMouseEnter";w="mouse";if("pointerout"===a||"pointerover"===a)t=Td,F="onPointerLeave",x="onPointerEnter",w="pointer";J=null==k?h:ue(k);u=null==n?h:ue(n);h=new t(F,w+"leave",k,c,e);h.target=J;h.relatedTarget=u;F=null;Wc(e)===d&&(t=new t(x,w+"enter",n,c,e),t.target=u,t.relatedTarget=J,F=t);J=F;if(k&&n)b:{t=k;x=n;w=0;for(u=t;u;u=vf(u))w++;u=0;for(F=x;F;F=vf(F))u++;for(;0<w-u;)t=vf(t),w--;for(;0<u-w;)x=
vf(x),u--;for(;w--;){if(t===x||null!==x&&t===x.alternate)break b;t=vf(t);x=vf(x)}t=null}else t=null;null!==k&&wf(g,h,k,t,!1);null!==n&&null!==J&&wf(g,J,n,t,!0)}}}a:{h=d?ue(d):window;k=h.nodeName&&h.nodeName.toLowerCase();if("select"===k||"input"===k&&"file"===h.type)var na=ve;else if(me(h))if(we)na=Fe;else{na=De;var xa=Ce}else(k=h.nodeName)&&"input"===k.toLowerCase()&&("checkbox"===h.type||"radio"===h.type)&&(na=Ee);if(na&&(na=na(a,d))){ne(g,na,c,e);break a}xa&&xa(a,h,d);"focusout"===a&&(xa=h._wrapperState)&&
xa.controlled&&"number"===h.type&&cb(h,"number",h.value)}xa=d?ue(d):window;switch(a){case "focusin":if(me(xa)||"true"===xa.contentEditable)Qe=xa,Re=d,Se=null;break;case "focusout":Se=Re=Qe=null;break;case "mousedown":Te=!0;break;case "contextmenu":case "mouseup":case "dragend":Te=!1;Ue(g,c,e);break;case "selectionchange":if(Pe)break;case "keydown":case "keyup":Ue(g,c,e)}var $a;if(ae)b:{switch(a){case "compositionstart":var ba="onCompositionStart";break b;case "compositionend":ba="onCompositionEnd";
break b;case "compositionupdate":ba="onCompositionUpdate";break b}ba=void 0}else ie?ge(a,c)&&(ba="onCompositionEnd"):"keydown"===a&&229===c.keyCode&&(ba="onCompositionStart");ba&&(de&&"ko"!==c.locale&&(ie||"onCompositionStart"!==ba?"onCompositionEnd"===ba&&ie&&($a=nd()):(kd=e,ld="value"in kd?kd.value:kd.textContent,ie=!0)),xa=oe(d,ba),0<xa.length&&(ba=new Ld(ba,a,null,c,e),g.push({event:ba,listeners:xa}),$a?ba.data=$a:($a=he(c),null!==$a&&(ba.data=$a))));if($a=ce?je(a,c):ke(a,c))d=oe(d,"onBeforeInput"),
0<d.length&&(e=new Ld("onBeforeInput","beforeinput",null,c,e),g.push({event:e,listeners:d}),e.data=$a)}se(g,b)})}function tf(a,b,c){return{instance:a,listener:b,currentTarget:c}}function oe(a,b){for(var c=b+"Capture",d=[];null!==a;){var e=a,f=e.stateNode;5===e.tag&&null!==f&&(e=f,f=Kb(a,c),null!=f&&d.unshift(tf(a,f,e)),f=Kb(a,b),null!=f&&d.push(tf(a,f,e)));a=a.return}return d}function vf(a){if(null===a)return null;do a=a.return;while(a&&5!==a.tag);return a?a:null}
function wf(a,b,c,d,e){for(var f=b._reactName,g=[];null!==c&&c!==d;){var h=c,k=h.alternate,l=h.stateNode;if(null!==k&&k===d)break;5===h.tag&&null!==l&&(h=l,e?(k=Kb(c,f),null!=k&&g.unshift(tf(c,k,h))):e||(k=Kb(c,f),null!=k&&g.push(tf(c,k,h))));c=c.return}0!==g.length&&a.push({event:b,listeners:g})}var xf=/\r\n?/g,yf=/\u0000|\uFFFD/g;function zf(a){return("string"===typeof a?a:""+a).replace(xf,"\n").replace(yf,"")}function Af(a,b,c){b=zf(b);if(zf(a)!==b&&c)throw Error(p(425));}function Bf(){}
var Cf=null,Df=null;function Ef(a,b){return"textarea"===a||"noscript"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}
var Ff="function"===typeof setTimeout?setTimeout:void 0,Gf="function"===typeof clearTimeout?clearTimeout:void 0,Hf="function"===typeof Promise?Promise:void 0,Jf="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof Hf?function(a){return Hf.resolve(null).then(a).catch(If)}:Ff;function If(a){setTimeout(function(){throw a;})}
function Kf(a,b){var c=b,d=0;do{var e=c.nextSibling;a.removeChild(c);if(e&&8===e.nodeType)if(c=e.data,"/$"===c){if(0===d){a.removeChild(e);bd(b);return}d--}else"$"!==c&&"$?"!==c&&"$!"!==c||d++;c=e}while(c);bd(b)}function Lf(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break;if(8===b){b=a.data;if("$"===b||"$!"===b||"$?"===b)break;if("/$"===b)return null}}return a}
function Mf(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if("$"===c||"$!"===c||"$?"===c){if(0===b)return a;b--}else"/$"===c&&b++}a=a.previousSibling}return null}var Nf=Math.random().toString(36).slice(2),Of="__reactFiber$"+Nf,Pf="__reactProps$"+Nf,uf="__reactContainer$"+Nf,of="__reactEvents$"+Nf,Qf="__reactListeners$"+Nf,Rf="__reactHandles$"+Nf;
function Wc(a){var b=a[Of];if(b)return b;for(var c=a.parentNode;c;){if(b=c[uf]||c[Of]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=Mf(a);null!==a;){if(c=a[Of])return c;a=Mf(a)}return b}a=c;c=a.parentNode}return null}function Cb(a){a=a[Of]||a[uf];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function ue(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(p(33));}function Db(a){return a[Pf]||null}var Sf=[],Tf=-1;function Uf(a){return{current:a}}
function E(a){0>Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}
function Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||"Unknown",e));return A({},c,d)}
function cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}
function jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a<c.length;a++){var d=c[a];do d=d(!0);while(null!==d)}eg=null;fg=!1}catch(e){throw null!==eg&&(eg=eg.slice(a+1)),ac(fc,jg),e;}finally{C=b,gg=!1}}return null}var kg=[],lg=0,mg=null,ng=0,og=[],pg=0,qg=null,rg=1,sg="";function tg(a,b){kg[lg++]=ng;kg[lg++]=mg;mg=a;ng=b}
function ug(a,b,c){og[pg++]=rg;og[pg++]=sg;og[pg++]=qg;qg=a;var d=rg;a=sg;var e=32-oc(d)-1;d&=~(1<<e);c+=1;var f=32-oc(b)+e;if(30<f){var g=e-e%5;f=(d&(1<<g)-1).toString(32);d>>=g;e-=g;rg=1<<32-oc(b)+e|c<<e|d;sg=f+a}else rg=1<<f|c<<e|d,sg=a}function vg(a){null!==a.return&&(tg(a,1),ug(a,1,0))}function wg(a){for(;a===mg;)mg=kg[--lg],kg[lg]=null,ng=kg[--lg],kg[lg]=null;for(;a===qg;)qg=og[--pg],og[pg]=null,sg=og[--pg],og[pg]=null,rg=og[--pg],og[pg]=null}var xg=null,yg=null,I=!1,zg=null;
function Ag(a,b){var c=Bg(5,null,null,0);c.elementType="DELETED";c.stateNode=b;c.return=a;b=a.deletions;null===b?(a.deletions=[c],a.flags|=16):b.push(c)}
function Cg(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,xg=a,yg=Lf(b.firstChild),!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,xg=a,yg=null,!0):!1;case 13:return b=8!==b.nodeType?null:b,null!==b?(c=null!==qg?{id:rg,overflow:sg}:null,a.memoizedState={dehydrated:b,treeContext:c,retryLane:1073741824},c=Bg(18,null,null,0),c.stateNode=b,c.return=a,a.child=c,xg=a,yg=
null,!0):!1;default:return!1}}function Dg(a){return 0!==(a.mode&1)&&0===(a.flags&128)}function Eg(a){if(I){var b=yg;if(b){var c=b;if(!Cg(a,b)){if(Dg(a))throw Error(p(418));b=Lf(c.nextSibling);var d=xg;b&&Cg(a,b)?Ag(d,c):(a.flags=a.flags&-4097|2,I=!1,xg=a)}}else{if(Dg(a))throw Error(p(418));a.flags=a.flags&-4097|2;I=!1;xg=a}}}function Fg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;xg=a}
function Gg(a){if(a!==xg)return!1;if(!I)return Fg(a),I=!0,!1;var b;(b=3!==a.tag)&&!(b=5!==a.tag)&&(b=a.type,b="head"!==b&&"body"!==b&&!Ef(a.type,a.memoizedProps));if(b&&(b=yg)){if(Dg(a))throw Hg(),Error(p(418));for(;b;)Ag(a,b),b=Lf(b.nextSibling)}Fg(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(p(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if("/$"===c){if(0===b){yg=Lf(a.nextSibling);break a}b--}else"$"!==c&&"$!"!==c&&"$?"!==c||b++}a=a.nextSibling}yg=
null}}else yg=xg?Lf(a.stateNode.nextSibling):null;return!0}function Hg(){for(var a=yg;a;)a=Lf(a.nextSibling)}function Ig(){yg=xg=null;I=!1}function Jg(a){null===zg?zg=[a]:zg.push(a)}var Kg=ua.ReactCurrentBatchConfig;
function Lg(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;if(c){if(1!==c.tag)throw Error(p(309));var d=c.stateNode}if(!d)throw Error(p(147,a));var e=d,f=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===f)return b.ref;b=function(a){var b=e.refs;null===a?delete b[f]:b[f]=a};b._stringRef=f;return b}if("string"!==typeof a)throw Error(p(284));if(!c._owner)throw Error(p(290,a));}return a}
function Mg(a,b){a=Object.prototype.toString.call(b);throw Error(p(31,"[object Object]"===a?"object with keys {"+Object.keys(b).join(", ")+"}":a));}function Ng(a){var b=a._init;return b(a._payload)}
function Og(a){function b(b,c){if(a){var d=b.deletions;null===d?(b.deletions=[c],b.flags|=16):d.push(c)}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b){a=Pg(a,b);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return b.flags|=1048576,c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.flags|=2,c):d;b.flags|=2;return c}function g(b){a&&
null===b.alternate&&(b.flags|=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=Qg(c,a.mode,d),b.return=a,b;b=e(b,c);b.return=a;return b}function k(a,b,c,d){var f=c.type;if(f===ya)return m(a,b,c.props.children,d,c.key);if(null!==b&&(b.elementType===f||"object"===typeof f&&null!==f&&f.$$typeof===Ha&&Ng(f)===b.type))return d=e(b,c.props),d.ref=Lg(a,b,c),d.return=a,d;d=Rg(c.type,c.key,c.props,null,a.mode,d);d.ref=Lg(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag||
b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation)return b=Sg(c,a.mode,d),b.return=a,b;b=e(b,c.children||[]);b.return=a;return b}function m(a,b,c,d,f){if(null===b||7!==b.tag)return b=Tg(c,a.mode,d,f),b.return=a,b;b=e(b,c);b.return=a;return b}function q(a,b,c){if("string"===typeof b&&""!==b||"number"===typeof b)return b=Qg(""+b,a.mode,c),b.return=a,b;if("object"===typeof b&&null!==b){switch(b.$$typeof){case va:return c=Rg(b.type,b.key,b.props,null,a.mode,c),
c.ref=Lg(a,null,b),c.return=a,c;case wa:return b=Sg(b,a.mode,c),b.return=a,b;case Ha:var d=b._init;return q(a,d(b._payload),c)}if(eb(b)||Ka(b))return b=Tg(b,a.mode,c,null),b.return=a,b;Mg(a,b)}return null}function r(a,b,c,d){var e=null!==b?b.key:null;if("string"===typeof c&&""!==c||"number"===typeof c)return null!==e?null:h(a,b,""+c,d);if("object"===typeof c&&null!==c){switch(c.$$typeof){case va:return c.key===e?k(a,b,c,d):null;case wa:return c.key===e?l(a,b,c,d):null;case Ha:return e=c._init,r(a,
b,e(c._payload),d)}if(eb(c)||Ka(c))return null!==e?null:m(a,b,c,d,null);Mg(a,c)}return null}function y(a,b,c,d,e){if("string"===typeof d&&""!==d||"number"===typeof d)return a=a.get(c)||null,h(b,a,""+d,e);if("object"===typeof d&&null!==d){switch(d.$$typeof){case va:return a=a.get(null===d.key?c:d.key)||null,k(b,a,d,e);case wa:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e);case Ha:var f=d._init;return y(a,b,c,f(d._payload),e)}if(eb(d)||Ka(d))return a=a.get(c)||null,m(b,a,d,e,null);Mg(b,d)}return null}
function n(e,g,h,k){for(var l=null,m=null,u=g,w=g=0,x=null;null!==u&&w<h.length;w++){u.index>w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;w<h.length;w++)u=q(e,h[w],k),null!==u&&(g=f(u,g,w),null===m?l=u:m.sibling=u,m=u);I&&tg(e,w);return l}for(u=d(e,u);w<h.length;w++)x=y(u,e,w,h[w],k),null!==x&&(a&&null!==x.alternate&&u.delete(null===
x.key?w:x.key),g=f(x,g,w),null===m?l=x:m.sibling=x,m=x);a&&u.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function t(e,g,h,k){var l=Ka(h);if("function"!==typeof l)throw Error(p(150));h=l.call(h);if(null==h)throw Error(p(151));for(var u=l=null,m=g,w=g=0,x=null,n=h.next();null!==m&&!n.done;w++,n=h.next()){m.index>w?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,
m),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){"object"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if("object"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=
f.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||"object"===typeof k&&null!==k&&k.$$typeof===Ha&&Ng(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=Lg(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Tg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Rg(f.type,f.key,f.props,null,a.mode,h),h.ref=Lg(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==
d;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=Sg(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);Mg(a,f)}return"string"===typeof f&&""!==f||"number"===typeof f?(f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):
(c(a,d),d=Qg(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(a){var b=Wg.current;E(Wg);a._currentValue=b}function bh(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|=b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}}
function ch(a,b){Xg=a;Zg=Yg=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(dh=!0),a.firstContext=null)}function eh(a){var b=a._currentValue;if(Zg!==a)if(a={context:a,memoizedValue:b,next:null},null===Yg){if(null===Xg)throw Error(p(308));Yg=a;Xg.dependencies={lanes:0,firstContext:a}}else Yg=Yg.next=a;return b}var fh=null;function gh(a){null===fh?fh=[a]:fh.push(a)}
function hh(a,b,c,d){var e=b.interleaved;null===e?(c.next=c,gh(b)):(c.next=e.next,e.next=c);b.interleaved=c;return ih(a,d)}function ih(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}var jh=!1;function kh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}
function lh(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function mh(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}
function nh(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(K&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return ih(a,c)}e=d.interleaved;null===e?(b.next=b,gh(d)):(b.next=e.next,e.next=b);d.interleaved=b;return ih(a,c)}function oh(a,b,c){b=b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}
function ph(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=
b;c.lastBaseUpdate=b}
function qh(a,b,c,d){var e=a.updateQueue;jh=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var m=a.alternate;null!==m&&(m=m.updateQueue,h=m.lastBaseUpdate,h!==g&&(null===h?m.firstBaseUpdate=l:h.next=l,m.lastBaseUpdate=k))}if(null!==f){var q=e.baseState;g=0;m=l=k=null;h=f;do{var r=h.lane,y=h.eventTime;if((d&r)===r){null!==m&&(m=m.next={eventTime:y,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,
next:null});a:{var n=a,t=h;r=b;y=c;switch(t.tag){case 1:n=t.payload;if("function"===typeof n){q=n.call(y,q,r);break a}q=n;break a;case 3:n.flags=n.flags&-65537|128;case 0:n=t.payload;r="function"===typeof n?n.call(y,q,r):n;if(null===r||void 0===r)break a;q=A({},q,r);break a;case 2:jh=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,r=e.effects,null===r?e.effects=[h]:r.push(h))}else y={eventTime:y,lane:r,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===m?(l=m=y,k=q):m=m.next=y,g|=r;
h=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else r=h,h=r.next,r.next=null,e.lastBaseUpdate=r,e.shared.pending=null}while(1);null===m&&(k=q);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=m;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);rh|=g;a.lanes=g;a.memoizedState=q}}
function sh(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;b<a.length;b++){var d=a[b],e=d.callback;if(null!==e){d.callback=null;d=c;if("function"!==typeof e)throw Error(p(191,e));e.call(d)}}}var th={},uh=Uf(th),vh=Uf(th),wh=Uf(th);function xh(a){if(a===th)throw Error(p(174));return a}
function yh(a,b){G(wh,b);G(vh,a);G(uh,th);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,"");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(uh);G(uh,b)}function zh(){E(uh);E(vh);E(wh)}function Ah(a){xh(wh.current);var b=xh(uh.current);var c=lb(b,a.type);b!==c&&(G(vh,a),G(uh,c))}function Bh(a){vh.current===a&&(E(uh),E(vh))}var L=Uf(0);
function Ch(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||"$?"===c.data||"$!"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Dh=[];
function Eh(){for(var a=0;a<Dh.length;a++)Dh[a]._workInProgressVersionPrimary=null;Dh.length=0}var Fh=ua.ReactCurrentDispatcher,Gh=ua.ReactCurrentBatchConfig,Hh=0,M=null,N=null,O=null,Ih=!1,Jh=!1,Kh=0,Lh=0;function P(){throw Error(p(321));}function Mh(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!He(a[c],b[c]))return!1;return!0}
function Nh(a,b,c,d,e,f){Hh=f;M=b;b.memoizedState=null;b.updateQueue=null;b.lanes=0;Fh.current=null===a||null===a.memoizedState?Oh:Ph;a=c(d,e);if(Jh){f=0;do{Jh=!1;Kh=0;if(25<=f)throw Error(p(301));f+=1;O=N=null;b.updateQueue=null;Fh.current=Qh;a=c(d,e)}while(Jh)}Fh.current=Rh;b=null!==N&&null!==N.next;Hh=0;O=N=M=null;Ih=!1;if(b)throw Error(p(300));return a}function Sh(){var a=0!==Kh;Kh=0;return a}
function Th(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===O?M.memoizedState=O=a:O=O.next=a;return O}function Uh(){if(null===N){var a=M.alternate;a=null!==a?a.memoizedState:null}else a=N.next;var b=null===O?M.memoizedState:O.next;if(null!==b)O=b,N=a;else{if(null===a)throw Error(p(310));N=a;a={memoizedState:N.memoizedState,baseState:N.baseState,baseQueue:N.baseQueue,queue:N.queue,next:null};null===O?M.memoizedState=O=a:O=O.next=a}return O}
function Vh(a,b){return"function"===typeof b?b(a):b}
function Wh(a){var b=Uh(),c=b.queue;if(null===c)throw Error(p(311));c.lastRenderedReducer=a;var d=N,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){f=e.next;d=d.baseState;var h=g=null,k=null,l=f;do{var m=l.lane;if((Hh&m)===m)null!==k&&(k=k.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),d=l.hasEagerState?l.eagerState:a(d,l.action);else{var q={lane:m,action:l.action,hasEagerState:l.hasEagerState,
eagerState:l.eagerState,next:null};null===k?(h=k=q,g=d):k=k.next=q;M.lanes|=m;rh|=m}l=l.next}while(null!==l&&l!==f);null===k?g=d:k.next=h;He(d,b.memoizedState)||(dh=!0);b.memoizedState=d;b.baseState=g;b.baseQueue=k;c.lastRenderedState=d}a=c.interleaved;if(null!==a){e=a;do f=e.lane,M.lanes|=f,rh|=f,e=e.next;while(e!==a)}else null===e&&(c.lanes=0);return[b.memoizedState,c.dispatch]}
function Xh(a){var b=Uh(),c=b.queue;if(null===c)throw Error(p(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);He(f,b.memoizedState)||(dh=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}function Yh(){}
function Zh(a,b){var c=M,d=Uh(),e=b(),f=!He(d.memoizedState,e);f&&(d.memoizedState=e,dh=!0);d=d.queue;$h(ai.bind(null,c,d,a),[a]);if(d.getSnapshot!==b||f||null!==O&&O.memoizedState.tag&1){c.flags|=2048;bi(9,ci.bind(null,c,d,e,b),void 0,null);if(null===Q)throw Error(p(349));0!==(Hh&30)||di(c,b,e)}return e}function di(a,b,c){a.flags|=16384;a={getSnapshot:b,value:c};b=M.updateQueue;null===b?(b={lastEffect:null,stores:null},M.updateQueue=b,b.stores=[a]):(c=b.stores,null===c?b.stores=[a]:c.push(a))}
function ci(a,b,c,d){b.value=c;b.getSnapshot=d;ei(b)&&fi(a)}function ai(a,b,c){return c(function(){ei(b)&&fi(a)})}function ei(a){var b=a.getSnapshot;a=a.value;try{var c=b();return!He(a,c)}catch(d){return!0}}function fi(a){var b=ih(a,1);null!==b&&gi(b,a,1,-1)}
function hi(a){var b=Th();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vh,lastRenderedState:a};b.queue=a;a=a.dispatch=ii.bind(null,M,a);return[b.memoizedState,a]}
function bi(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=M.updateQueue;null===b?(b={lastEffect:null,stores:null},M.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}function ji(){return Uh().memoizedState}function ki(a,b,c,d){var e=Th();M.flags|=a;e.memoizedState=bi(1|b,c,void 0,void 0===d?null:d)}
function li(a,b,c,d){var e=Uh();d=void 0===d?null:d;var f=void 0;if(null!==N){var g=N.memoizedState;f=g.destroy;if(null!==d&&Mh(d,g.deps)){e.memoizedState=bi(b,c,f,d);return}}M.flags|=a;e.memoizedState=bi(1|b,c,f,d)}function mi(a,b){return ki(8390656,8,a,b)}function $h(a,b){return li(2048,8,a,b)}function ni(a,b){return li(4,2,a,b)}function oi(a,b){return li(4,4,a,b)}
function pi(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function qi(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return li(4,4,pi.bind(null,b,a),c)}function ri(){}function si(a,b){var c=Uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Mh(b,d[1]))return d[0];c.memoizedState=[a,b];return a}
function ti(a,b){var c=Uh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Mh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}function ui(a,b,c){if(0===(Hh&21))return a.baseState&&(a.baseState=!1,dh=!0),a.memoizedState=c;He(c,b)||(c=yc(),M.lanes|=c,rh|=c,a.baseState=!0);return b}function vi(a,b){var c=C;C=0!==c&&4>c?c:4;a(!0);var d=Gh.transition;Gh.transition={};try{a(!1),b()}finally{C=c,Gh.transition=d}}function wi(){return Uh().memoizedState}
function xi(a,b,c){var d=yi(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,c);else if(c=hh(a,b,c,d),null!==c){var e=R();gi(c,a,d,e);Bi(c,b,d)}}
function ii(a,b,c){var d=yi(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,gh(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=hh(a,b,e,d);null!==c&&(e=R(),gi(c,a,d,e),Bi(c,b,d))}}
function zi(a){var b=a.alternate;return a===M||null!==b&&b===M}function Ai(a,b){Jh=Ih=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Bi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}
var Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(a,b){Th().memoizedState=[a,void 0===b?null:b];return a},useContext:eh,useEffect:mi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ki(4194308,
4,pi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ki(4194308,4,a,b)},useInsertionEffect:function(a,b){return ki(4,2,a,b)},useMemo:function(a,b){var c=Th();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Th();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=xi.bind(null,M,a);return[d.memoizedState,a]},useRef:function(a){var b=
Th();a={current:a};return b.memoizedState=a},useState:hi,useDebugValue:ri,useDeferredValue:function(a){return Th().memoizedState=a},useTransition:function(){var a=hi(!1),b=a[0];a=vi.bind(null,a[1]);Th().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=M,e=Th();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===Q)throw Error(p(349));0!==(Hh&30)||di(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;mi(ai.bind(null,d,
f,a),[a]);d.flags|=2048;bi(9,ci.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=Th(),b=Q.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=":"+b+"R"+c;c=Kh++;0<c&&(b+="H"+c.toString(32));b+=":"}else c=Lh++,b=":"+b+"r"+c.toString(32)+":";return a.memoizedState=b},unstable_isNewReconciler:!1},Ph={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Wh,useRef:ji,useState:function(){return Wh(Vh)},
useDebugValue:ri,useDeferredValue:function(a){var b=Uh();return ui(b,N.memoizedState,a)},useTransition:function(){var a=Wh(Vh)[0],b=Uh().memoizedState;return[a,b]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1},Qh={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Xh,useRef:ji,useState:function(){return Xh(Vh)},useDebugValue:ri,useDeferredValue:function(a){var b=Uh();return null===
N?b.memoizedState=a:ui(b,N.memoizedState,a)},useTransition:function(){var a=Xh(Vh)[0],b=Uh().memoizedState;return[a,b]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1};function Ci(a,b){if(a&&a.defaultProps){b=A({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return b}function Di(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:A({},b,c);a.memoizedState=c;0===a.lanes&&(a.updateQueue.baseState=c)}
var Ei={isMounted:function(a){return(a=a._reactInternals)?Vb(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternals;var d=R(),e=yi(a),f=mh(d,e);f.payload=b;void 0!==c&&null!==c&&(f.callback=c);b=nh(a,f,e);null!==b&&(gi(b,a,e,d),oh(b,a,e))},enqueueReplaceState:function(a,b,c){a=a._reactInternals;var d=R(),e=yi(a),f=mh(d,e);f.tag=1;f.payload=b;void 0!==c&&null!==c&&(f.callback=c);b=nh(a,f,e);null!==b&&(gi(b,a,e,d),oh(b,a,e))},enqueueForceUpdate:function(a,b){a=a._reactInternals;var c=R(),d=
yi(a),e=mh(c,d);e.tag=2;void 0!==b&&null!==b&&(e.callback=b);b=nh(a,e,d);null!==b&&(gi(b,a,d,c),oh(b,a,d))}};function Fi(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!Ie(c,d)||!Ie(e,f):!0}
function Gi(a,b,c){var d=!1,e=Vf;var f=b.contextType;"object"===typeof f&&null!==f?f=eh(f):(e=Zf(b)?Xf:H.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Yf(a,e):Vf);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Ei;a.stateNode=b;b._reactInternals=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}
function Hi(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Ei.enqueueReplaceState(b,b.state,null)}
function Ii(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs={};kh(a);var f=b.contextType;"object"===typeof f&&null!==f?e.context=eh(f):(f=Zf(b)?Xf:H.current,e.context=Yf(a,f));e.state=a.memoizedState;f=b.getDerivedStateFromProps;"function"===typeof f&&(Di(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&&"function"!==typeof e.componentWillMount||(b=e.state,
"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Ei.enqueueReplaceState(e,e.state,null),qh(a,c,e,d),e.state=a.memoizedState);"function"===typeof e.componentDidMount&&(a.flags|=4194308)}function Ji(a,b){try{var c="",d=b;do c+=Pa(d),d=d.return;while(d);var e=c}catch(f){e="\nError generating stack: "+f.message+"\n"+f.stack}return{value:a,source:b,stack:e,digest:null}}
function Ki(a,b,c){return{value:a,source:null,stack:null!=c?c:null,digest:null!=b?b:null}}function Li(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}var Mi="function"===typeof WeakMap?WeakMap:Map;function Ni(a,b,c){c=mh(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Oi||(Oi=!0,Pi=d);Li(a,b)};return c}
function Qi(a,b,c){c=mh(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)};c.callback=function(){Li(a,b)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){Li(a,b);"function"!==typeof d&&(null===Ri?Ri=new Set([this]):Ri.add(this));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}
function Si(a,b,c){var d=a.pingCache;if(null===d){d=a.pingCache=new Mi;var e=new Set;d.set(b,e)}else e=d.get(b),void 0===e&&(e=new Set,d.set(b,e));e.has(c)||(e.add(c),a=Ti.bind(null,a,b,c),b.then(a,a))}function Ui(a){do{var b;if(b=13===a.tag)b=a.memoizedState,b=null!==b?null!==b.dehydrated?!0:!1:!0;if(b)return a;a=a.return}while(null!==a);return null}
function Vi(a,b,c,d,e){if(0===(a.mode&1))return a===b?a.flags|=65536:(a.flags|=128,c.flags|=131072,c.flags&=-52805,1===c.tag&&(null===c.alternate?c.tag=17:(b=mh(-1,1),b.tag=2,nh(c,b,1))),c.lanes|=1),a;a.flags|=65536;a.lanes=e;return a}var Wi=ua.ReactCurrentOwner,dh=!1;function Xi(a,b,c,d){b.child=null===a?Vg(b,null,c,d):Ug(b,a.child,c,d)}
function Yi(a,b,c,d,e){c=c.render;var f=b.ref;ch(b,e);d=Nh(a,b,c,d,f,e);c=Sh();if(null!==a&&!dh)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Zi(a,b,e);I&&c&&vg(b);b.flags|=1;Xi(a,b,d,e);return b.child}
function $i(a,b,c,d,e){if(null===a){var f=c.type;if("function"===typeof f&&!aj(f)&&void 0===f.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=f,bj(a,b,f,d,e);a=Rg(c.type,null,d,b,b.mode,e);a.ref=b.ref;a.return=b;return b.child=a}f=a.child;if(0===(a.lanes&e)){var g=f.memoizedProps;c=c.compare;c=null!==c?c:Ie;if(c(g,d)&&a.ref===b.ref)return Zi(a,b,e)}b.flags|=1;a=Pg(f,d);a.ref=b.ref;a.return=b;return b.child=a}
function bj(a,b,c,d,e){if(null!==a){var f=a.memoizedProps;if(Ie(f,d)&&a.ref===b.ref)if(dh=!1,b.pendingProps=d=f,0!==(a.lanes&e))0!==(a.flags&131072)&&(dh=!0);else return b.lanes=a.lanes,Zi(a,b,e)}return cj(a,b,c,d,e)}
function dj(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if("hidden"===d.mode)if(0===(b.mode&1))b.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(ej,fj),fj|=c;else{if(0===(c&1073741824))return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a,cachePool:null,transitions:null},b.updateQueue=null,G(ej,fj),fj|=a,null;b.memoizedState={baseLanes:0,cachePool:null,transitions:null};d=null!==f?f.baseLanes:c;G(ej,fj);fj|=d}else null!==
f?(d=f.baseLanes|c,b.memoizedState=null):d=c,G(ej,fj),fj|=d;Xi(a,b,e,c);return b.child}function gj(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=512,b.flags|=2097152}function cj(a,b,c,d,e){var f=Zf(c)?Xf:H.current;f=Yf(b,f);ch(b,e);c=Nh(a,b,c,d,f,e);d=Sh();if(null!==a&&!dh)return b.updateQueue=a.updateQueue,b.flags&=-2053,a.lanes&=~e,Zi(a,b,e);I&&d&&vg(b);b.flags|=1;Xi(a,b,c,e);return b.child}
function hj(a,b,c,d,e){if(Zf(c)){var f=!0;cg(b)}else f=!1;ch(b,e);if(null===b.stateNode)ij(a,b),Gi(b,c,d),Ii(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;"object"===typeof l&&null!==l?l=eh(l):(l=Zf(c)?Xf:H.current,l=Yf(b,l));var m=c.getDerivedStateFromProps,q="function"===typeof m||"function"===typeof g.getSnapshotBeforeUpdate;q||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||
(h!==d||k!==l)&&Hi(b,g,d,l);jh=!1;var r=b.memoizedState;g.state=r;qh(b,d,g,e);k=b.memoizedState;h!==d||r!==k||Wf.current||jh?("function"===typeof m&&(Di(b,c,m,d),k=b.memoizedState),(h=jh||Fi(b,c,h,d,r,k,l))?(q||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount||("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.flags|=4194308)):
("function"===typeof g.componentDidMount&&(b.flags|=4194308),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):("function"===typeof g.componentDidMount&&(b.flags|=4194308),d=!1)}else{g=b.stateNode;lh(a,b);h=b.memoizedProps;l=b.type===b.elementType?h:Ci(b.type,h);g.props=l;q=b.pendingProps;r=g.context;k=c.contextType;"object"===typeof k&&null!==k?k=eh(k):(k=Zf(c)?Xf:H.current,k=Yf(b,k));var y=c.getDerivedStateFromProps;(m="function"===typeof y||"function"===typeof g.getSnapshotBeforeUpdate)||
"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==q||r!==k)&&Hi(b,g,d,k);jh=!1;r=b.memoizedState;g.state=r;qh(b,d,g,e);var n=b.memoizedState;h!==q||r!==n||Wf.current||jh?("function"===typeof y&&(Di(b,c,y,d),n=b.memoizedState),(l=jh||Fi(b,c,l,d,r,n,k)||!1)?(m||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,n,k),"function"===typeof g.UNSAFE_componentWillUpdate&&
g.UNSAFE_componentWillUpdate(d,n,k)),"function"===typeof g.componentDidUpdate&&(b.flags|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=1024)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),b.memoizedProps=d,b.memoizedState=n),g.props=d,g.state=n,g.context=k,d=l):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&r===
a.memoizedState||(b.flags|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&r===a.memoizedState||(b.flags|=1024),d=!1)}return jj(a,b,c,d,f,e)}
function jj(a,b,c,d,e,f){gj(a,b);var g=0!==(b.flags&128);if(!d&&!g)return e&&dg(b,c,!1),Zi(a,b,f);d=b.stateNode;Wi.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Ug(b,a.child,null,f),b.child=Ug(b,null,h,f)):Xi(a,b,h,f);b.memoizedState=d.state;e&&dg(b,c,!0);return b.child}function kj(a){var b=a.stateNode;b.pendingContext?ag(a,b.pendingContext,b.pendingContext!==b.context):b.context&&ag(a,b.context,!1);yh(a,b.containerInfo)}
function lj(a,b,c,d,e){Ig();Jg(e);b.flags|=256;Xi(a,b,c,d);return b.child}var mj={dehydrated:null,treeContext:null,retryLane:0};function nj(a){return{baseLanes:a,cachePool:null,transitions:null}}
function oj(a,b,c){var d=b.pendingProps,e=L.current,f=!1,g=0!==(b.flags&128),h;(h=g)||(h=null!==a&&null===a.memoizedState?!1:0!==(e&2));if(h)f=!0,b.flags&=-129;else if(null===a||null!==a.memoizedState)e|=1;G(L,e&1);if(null===a){Eg(b);a=b.memoizedState;if(null!==a&&(a=a.dehydrated,null!==a))return 0===(b.mode&1)?b.lanes=1:"$!"===a.data?b.lanes=8:b.lanes=1073741824,null;g=d.children;a=d.fallback;return f?(d=b.mode,f=b.child,g={mode:"hidden",children:g},0===(d&1)&&null!==f?(f.childLanes=0,f.pendingProps=
g):f=pj(g,d,0,null),a=Tg(a,d,c,null),f.return=b,a.return=b,f.sibling=a,b.child=f,b.child.memoizedState=nj(c),b.memoizedState=mj,a):qj(b,g)}e=a.memoizedState;if(null!==e&&(h=e.dehydrated,null!==h))return rj(a,b,g,d,h,e,c);if(f){f=d.fallback;g=b.mode;e=a.child;h=e.sibling;var k={mode:"hidden",children:d.children};0===(g&1)&&b.child!==e?(d=b.child,d.childLanes=0,d.pendingProps=k,b.deletions=null):(d=Pg(e,k),d.subtreeFlags=e.subtreeFlags&14680064);null!==h?f=Pg(h,f):(f=Tg(f,g,c,null),f.flags|=2);f.return=
b;d.return=b;d.sibling=f;b.child=d;d=f;f=b.child;g=a.child.memoizedState;g=null===g?nj(c):{baseLanes:g.baseLanes|c,cachePool:null,transitions:g.transitions};f.memoizedState=g;f.childLanes=a.childLanes&~c;b.memoizedState=mj;return d}f=a.child;a=f.sibling;d=Pg(f,{mode:"visible",children:d.children});0===(b.mode&1)&&(d.lanes=c);d.return=b;d.sibling=null;null!==a&&(c=b.deletions,null===c?(b.deletions=[a],b.flags|=16):c.push(a));b.child=d;b.memoizedState=null;return d}
function qj(a,b){b=pj({mode:"visible",children:b},a.mode,0,null);b.return=a;return a.child=b}function sj(a,b,c,d){null!==d&&Jg(d);Ug(b,a.child,null,c);a=qj(b,b.pendingProps.children);a.flags|=2;b.memoizedState=null;return a}
function rj(a,b,c,d,e,f,g){if(c){if(b.flags&256)return b.flags&=-257,d=Ki(Error(p(422))),sj(a,b,g,d);if(null!==b.memoizedState)return b.child=a.child,b.flags|=128,null;f=d.fallback;e=b.mode;d=pj({mode:"visible",children:d.children},e,0,null);f=Tg(f,e,g,null);f.flags|=2;d.return=b;f.return=b;d.sibling=f;b.child=d;0!==(b.mode&1)&&Ug(b,a.child,null,g);b.child.memoizedState=nj(g);b.memoizedState=mj;return f}if(0===(b.mode&1))return sj(a,b,g,null);if("$!"===e.data){d=e.nextSibling&&e.nextSibling.dataset;
if(d)var h=d.dgst;d=h;f=Error(p(419));d=Ki(f,d,void 0);return sj(a,b,g,d)}h=0!==(g&a.childLanes);if(dh||h){d=Q;if(null!==d){switch(g&-g){case 4:e=2;break;case 16:e=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:e=32;break;case 536870912:e=268435456;break;default:e=0}e=0!==(e&(d.suspendedLanes|g))?0:e;
0!==e&&e!==f.retryLane&&(f.retryLane=e,ih(a,e),gi(d,a,e,-1))}tj();d=Ki(Error(p(421)));return sj(a,b,g,d)}if("$?"===e.data)return b.flags|=128,b.child=a.child,b=uj.bind(null,a),e._reactRetry=b,null;a=f.treeContext;yg=Lf(e.nextSibling);xg=b;I=!0;zg=null;null!==a&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=a.id,sg=a.overflow,qg=b);b=qj(b,d.children);b.flags|=4096;return b}function vj(a,b,c){a.lanes|=b;var d=a.alternate;null!==d&&(d.lanes|=b);bh(a.return,b,c)}
function wj(a,b,c,d,e){var f=a.memoizedState;null===f?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e}:(f.isBackwards=b,f.rendering=null,f.renderingStartTime=0,f.last=d,f.tail=c,f.tailMode=e)}
function xj(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;Xi(a,b,d.children,c);d=L.current;if(0!==(d&2))d=d&1|2,b.flags|=128;else{if(null!==a&&0!==(a.flags&128))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&vj(a,c,b);else if(19===a.tag)vj(a,c,b);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}G(L,d);if(0===(b.mode&1))b.memoizedState=
null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===Ch(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);wj(b,!1,e,c,f);break;case "backwards":c=null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===Ch(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}wj(b,!0,c,null,f);break;case "together":wj(b,!1,null,null,void 0);break;default:b.memoizedState=null}return b.child}
function ij(a,b){0===(b.mode&1)&&null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2)}function Zi(a,b,c){null!==a&&(b.dependencies=a.dependencies);rh|=b.lanes;if(0===(c&b.childLanes))return null;if(null!==a&&b.child!==a.child)throw Error(p(153));if(null!==b.child){a=b.child;c=Pg(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=Pg(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}
function yj(a,b,c){switch(b.tag){case 3:kj(b);Ig();break;case 5:Ah(b);break;case 1:Zf(b.type)&&cg(b);break;case 4:yh(b,b.stateNode.containerInfo);break;case 10:var d=b.type._context,e=b.memoizedProps.value;G(Wg,d._currentValue);d._currentValue=e;break;case 13:d=b.memoizedState;if(null!==d){if(null!==d.dehydrated)return G(L,L.current&1),b.flags|=128,null;if(0!==(c&b.child.childLanes))return oj(a,b,c);G(L,L.current&1);a=Zi(a,b,c);return null!==a?a.sibling:null}G(L,L.current&1);break;case 19:d=0!==(c&
b.childLanes);if(0!==(a.flags&128)){if(d)return xj(a,b,c);b.flags|=128}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);G(L,L.current);if(d)break;else return null;case 22:case 23:return b.lanes=0,dj(a,b,c)}return Zi(a,b,c)}var zj,Aj,Bj,Cj;
zj=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};Aj=function(){};
Bj=function(a,b,c,d){var e=a.memoizedProps;if(e!==d){a=b.stateNode;xh(uh.current);var f=null;switch(c){case "input":e=Ya(a,e);d=Ya(a,d);f=[];break;case "select":e=A({},e,{value:void 0});d=A({},d,{value:void 0});f=[];break;case "textarea":e=gb(a,e);d=gb(a,d);f=[];break;default:"function"!==typeof e.onClick&&"function"===typeof d.onClick&&(a.onclick=Bf)}ub(c,d);var g;c=null;for(l in e)if(!d.hasOwnProperty(l)&&e.hasOwnProperty(l)&&null!=e[l])if("style"===l){var h=e[l];for(g in h)h.hasOwnProperty(g)&&
(c||(c={}),c[g]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(ea.hasOwnProperty(l)?f||(f=[]):(f=f||[]).push(l,null));for(l in d){var k=d[l];h=null!=e?e[l]:void 0;if(d.hasOwnProperty(l)&&k!==h&&(null!=k||null!=h))if("style"===l)if(h){for(g in h)!h.hasOwnProperty(g)||k&&k.hasOwnProperty(g)||(c||(c={}),c[g]="");for(g in k)k.hasOwnProperty(g)&&h[g]!==k[g]&&(c||(c={}),c[g]=k[g])}else c||(f||(f=[]),f.push(l,
c)),c=k;else"dangerouslySetInnerHTML"===l?(k=k?k.__html:void 0,h=h?h.__html:void 0,null!=k&&h!==k&&(f=f||[]).push(l,k)):"children"===l?"string"!==typeof k&&"number"!==typeof k||(f=f||[]).push(l,""+k):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(ea.hasOwnProperty(l)?(null!=k&&"onScroll"===l&&D("scroll",a),f||h===k||(f=[])):(f=f||[]).push(l,k))}c&&(f=f||[]).push("style",c);var l=f;if(b.updateQueue=l)b.flags|=4}};Cj=function(a,b,c,d){c!==d&&(b.flags|=4)};
function Dj(a,b){if(!I)switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}
function S(a){var b=null!==a.alternate&&a.alternate.child===a.child,c=0,d=0;if(b)for(var e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags&14680064,d|=e.flags&14680064,e.return=a,e=e.sibling;else for(e=a.child;null!==e;)c|=e.lanes|e.childLanes,d|=e.subtreeFlags,d|=e.flags,e.return=a,e=e.sibling;a.subtreeFlags|=d;a.childLanes=c;return b}
function Ej(a,b,c){var d=b.pendingProps;wg(b);switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S(b),null;case 1:return Zf(b.type)&&$f(),S(b),null;case 3:d=b.stateNode;zh();E(Wf);E(H);Eh();d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)Gg(b)?b.flags|=4:null===a||a.memoizedState.isDehydrated&&0===(b.flags&256)||(b.flags|=1024,null!==zg&&(Fj(zg),zg=null));Aj(a,b);S(b);return null;case 5:Bh(b);var e=xh(wh.current);
c=b.type;if(null!==a&&null!=b.stateNode)Bj(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=512,b.flags|=2097152);else{if(!d){if(null===b.stateNode)throw Error(p(166));S(b);return null}a=xh(uh.current);if(Gg(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[Of]=b;d[Pf]=f;a=0!==(b.mode&1);switch(c){case "dialog":D("cancel",d);D("close",d);break;case "iframe":case "object":case "embed":D("load",d);break;case "video":case "audio":for(e=0;e<lf.length;e++)D(lf[e],d);break;case "source":D("error",d);break;case "img":case "image":case "link":D("error",
d);D("load",d);break;case "details":D("toggle",d);break;case "input":Za(d,f);D("invalid",d);break;case "select":d._wrapperState={wasMultiple:!!f.multiple};D("invalid",d);break;case "textarea":hb(d,f),D("invalid",d)}ub(c,f);e=null;for(var g in f)if(f.hasOwnProperty(g)){var h=f[g];"children"===g?"string"===typeof h?d.textContent!==h&&(!0!==f.suppressHydrationWarning&&Af(d.textContent,h,a),e=["children",h]):"number"===typeof h&&d.textContent!==""+h&&(!0!==f.suppressHydrationWarning&&Af(d.textContent,
h,a),e=["children",""+h]):ea.hasOwnProperty(g)&&null!=h&&"onScroll"===g&&D("scroll",d)}switch(c){case "input":Va(d);db(d,f,!0);break;case "textarea":Va(d);jb(d);break;case "select":case "option":break;default:"function"===typeof f.onClick&&(d.onclick=Bf)}d=e;b.updateQueue=d;null!==d&&(b.flags|=4)}else{g=9===e.nodeType?e:e.ownerDocument;"http://www.w3.org/1999/xhtml"===a&&(a=kb(c));"http://www.w3.org/1999/xhtml"===a?"script"===c?(a=g.createElement("div"),a.innerHTML="<script>\x3c/script>",a=a.removeChild(a.firstChild)):
"string"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),"select"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;zj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case "dialog":D("cancel",a);D("close",a);e=d;break;case "iframe":case "object":case "embed":D("load",a);e=d;break;case "video":case "audio":for(e=0;e<lf.length;e++)D(lf[e],a);e=d;break;case "source":D("error",a);e=d;break;case "img":case "image":case "link":D("error",
a);D("load",a);e=d;break;case "details":D("toggle",a);e=d;break;case "input":Za(a,d);e=Ya(a,d);D("invalid",a);break;case "option":e=d;break;case "select":a._wrapperState={wasMultiple:!!d.multiple};e=A({},d,{value:void 0});D("invalid",a);break;case "textarea":hb(a,d);e=gb(a,d);D("invalid",a);break;default:e=d}ub(c,e);h=e;for(f in h)if(h.hasOwnProperty(f)){var k=h[f];"style"===f?sb(a,k):"dangerouslySetInnerHTML"===f?(k=k?k.__html:void 0,null!=k&&nb(a,k)):"children"===f?"string"===typeof k?("textarea"!==
c||""!==k)&&ob(a,k):"number"===typeof k&&ob(a,""+k):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(ea.hasOwnProperty(f)?null!=k&&"onScroll"===f&&D("scroll",a):null!=k&&ta(a,f,k,g))}switch(c){case "input":Va(a);db(a,d,!1);break;case "textarea":Va(a);jb(a);break;case "option":null!=d.value&&a.setAttribute("value",""+Sa(d.value));break;case "select":a.multiple=!!d.multiple;f=d.value;null!=f?fb(a,!!d.multiple,f,!1):null!=d.defaultValue&&fb(a,!!d.multiple,d.defaultValue,
!0);break;default:"function"===typeof e.onClick&&(a.onclick=Bf)}switch(c){case "button":case "input":case "select":case "textarea":d=!!d.autoFocus;break a;case "img":d=!0;break a;default:d=!1}}d&&(b.flags|=4)}null!==b.ref&&(b.flags|=512,b.flags|=2097152)}S(b);return null;case 6:if(a&&null!=b.stateNode)Cj(a,b,a.memoizedProps,d);else{if("string"!==typeof d&&null===b.stateNode)throw Error(p(166));c=xh(wh.current);xh(uh.current);if(Gg(b)){d=b.stateNode;c=b.memoizedProps;d[Of]=b;if(f=d.nodeValue!==c)if(a=
xg,null!==a)switch(a.tag){case 3:Af(d.nodeValue,c,0!==(a.mode&1));break;case 5:!0!==a.memoizedProps.suppressHydrationWarning&&Af(d.nodeValue,c,0!==(a.mode&1))}f&&(b.flags|=4)}else d=(9===c.nodeType?c:c.ownerDocument).createTextNode(d),d[Of]=b,b.stateNode=d}S(b);return null;case 13:E(L);d=b.memoizedState;if(null===a||null!==a.memoizedState&&null!==a.memoizedState.dehydrated){if(I&&null!==yg&&0!==(b.mode&1)&&0===(b.flags&128))Hg(),Ig(),b.flags|=98560,f=!1;else if(f=Gg(b),null!==d&&null!==d.dehydrated){if(null===
a){if(!f)throw Error(p(318));f=b.memoizedState;f=null!==f?f.dehydrated:null;if(!f)throw Error(p(317));f[Of]=b}else Ig(),0===(b.flags&128)&&(b.memoizedState=null),b.flags|=4;S(b);f=!1}else null!==zg&&(Fj(zg),zg=null),f=!0;if(!f)return b.flags&65536?b:null}if(0!==(b.flags&128))return b.lanes=c,b;d=null!==d;d!==(null!==a&&null!==a.memoizedState)&&d&&(b.child.flags|=8192,0!==(b.mode&1)&&(null===a||0!==(L.current&1)?0===T&&(T=3):tj()));null!==b.updateQueue&&(b.flags|=4);S(b);return null;case 4:return zh(),
Aj(a,b),null===a&&sf(b.stateNode.containerInfo),S(b),null;case 10:return ah(b.type._context),S(b),null;case 17:return Zf(b.type)&&$f(),S(b),null;case 19:E(L);f=b.memoizedState;if(null===f)return S(b),null;d=0!==(b.flags&128);g=f.rendering;if(null===g)if(d)Dj(f,!1);else{if(0!==T||null!==a&&0!==(a.flags&128))for(a=b.child;null!==a;){g=Ch(a);if(null!==g){b.flags|=128;Dj(f,!1);d=g.updateQueue;null!==d&&(b.updateQueue=d,b.flags|=4);b.subtreeFlags=0;d=c;for(c=b.child;null!==c;)f=c,a=d,f.flags&=14680066,
g=f.alternate,null===g?(f.childLanes=0,f.lanes=a,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=g.childLanes,f.lanes=g.lanes,f.child=g.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=g.memoizedProps,f.memoizedState=g.memoizedState,f.updateQueue=g.updateQueue,f.type=g.type,a=g.dependencies,f.dependencies=null===a?null:{lanes:a.lanes,firstContext:a.firstContext}),c=c.sibling;G(L,L.current&1|2);return b.child}a=
a.sibling}null!==f.tail&&B()>Gj&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304)}else{if(!d)if(a=Ch(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Dj(f,!0),null===f.tail&&"hidden"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Gj&&1073741824!==c&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=
b,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=L.current,G(L,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Hj(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(fj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}
function Ij(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return zh(),E(Wf),E(H),Eh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Bh(b),null;case 13:E(L);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(b.type._context),null;case 22:case 23:return Hj(),
null;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj="function"===typeof WeakSet?WeakSet:Set,V=null;function Lj(a,b){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Mj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Nj=!1;
function Oj(a,b){Cf=dd;a=Me();if(Ne(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=
q.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;
case 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Ci(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent="":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Nj;Nj=!1;return n}
function Pj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Mj(b,c,f)}e=e.next}while(e!==d)}}function Qj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Rj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}"function"===typeof b?b(a):b.current=a}}
function Sj(a){var b=a.alternate;null!==b&&(a.alternate=null,Sj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Tj(a){return 5===a.tag||3===a.tag||4===a.tag}
function Uj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Tj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}
function Vj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Vj(a,b,c),a=a.sibling;null!==a;)Vj(a,b,c),a=a.sibling}
function Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}var X=null,Xj=!1;function Yj(a,b,c){for(c=c.child;null!==c;)Zj(a,b,c),c=c.sibling}
function Zj(a,b,c){if(lc&&"function"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Lj(c,b);case 6:var d=X,e=Xj;X=null;Yj(a,b,c);X=d;Xj=e;null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Xj;X=c.stateNode.containerInfo;Xj=!0;
Yj(a,b,c);X=d;Xj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Mj(c,b,g):0!==(f&4)&&Mj(c,b,g));e=e.next}while(e!==d)}Yj(a,b,c);break;case 1:if(!U&&(Lj(c,b),d=c.stateNode,"function"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Yj(a,b,c);break;case 21:Yj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==
c.memoizedState,Yj(a,b,c),U=d):Yj(a,b,c);break;default:Yj(a,b,c)}}function ak(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Kj);b.forEach(function(b){var d=bk.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}
function ck(a,b){var c=b.deletions;if(null!==c)for(var d=0;d<c.length;d++){var e=c[d];try{var f=a,g=b,h=g;a:for(;null!==h;){switch(h.tag){case 5:X=h.stateNode;Xj=!1;break a;case 3:X=h.stateNode.containerInfo;Xj=!0;break a;case 4:X=h.stateNode.containerInfo;Xj=!0;break a}h=h.return}if(null===X)throw Error(p(160));Zj(f,g,e);X=null;Xj=!1;var k=e.alternate;null!==k&&(k.return=null);e.return=null}catch(l){W(e,b,l)}}if(b.subtreeFlags&12854)for(b=b.child;null!==b;)dk(b,a),b=b.sibling}
function dk(a,b){var c=a.alternate,d=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:ck(b,a);ek(a);if(d&4){try{Pj(3,a,a.return),Qj(3,a)}catch(t){W(a,a.return,t)}try{Pj(5,a,a.return)}catch(t){W(a,a.return,t)}}break;case 1:ck(b,a);ek(a);d&512&&null!==c&&Lj(c,c.return);break;case 5:ck(b,a);ek(a);d&512&&null!==c&&Lj(c,c.return);if(a.flags&32){var e=a.stateNode;try{ob(e,"")}catch(t){W(a,a.return,t)}}if(d&4&&(e=a.stateNode,null!=e)){var f=a.memoizedProps,g=null!==c?c.memoizedProps:f,h=a.type,k=a.updateQueue;
a.updateQueue=null;if(null!==k)try{"input"===h&&"radio"===f.type&&null!=f.name&&ab(e,f);vb(h,g);var l=vb(h,f);for(g=0;g<k.length;g+=2){var m=k[g],q=k[g+1];"style"===m?sb(e,q):"dangerouslySetInnerHTML"===m?nb(e,q):"children"===m?ob(e,q):ta(e,m,q,l)}switch(h){case "input":bb(e,f);break;case "textarea":ib(e,f);break;case "select":var r=e._wrapperState.wasMultiple;e._wrapperState.wasMultiple=!!f.multiple;var y=f.value;null!=y?fb(e,!!f.multiple,y,!1):r!==!!f.multiple&&(null!=f.defaultValue?fb(e,!!f.multiple,
f.defaultValue,!0):fb(e,!!f.multiple,f.multiple?[]:"",!1))}e[Pf]=f}catch(t){W(a,a.return,t)}}break;case 6:ck(b,a);ek(a);if(d&4){if(null===a.stateNode)throw Error(p(162));e=a.stateNode;f=a.memoizedProps;try{e.nodeValue=f}catch(t){W(a,a.return,t)}}break;case 3:ck(b,a);ek(a);if(d&4&&null!==c&&c.memoizedState.isDehydrated)try{bd(b.containerInfo)}catch(t){W(a,a.return,t)}break;case 4:ck(b,a);ek(a);break;case 13:ck(b,a);ek(a);e=a.child;e.flags&8192&&(f=null!==e.memoizedState,e.stateNode.isHidden=f,!f||
null!==e.alternate&&null!==e.alternate.memoizedState||(fk=B()));d&4&&ak(a);break;case 22:m=null!==c&&null!==c.memoizedState;a.mode&1?(U=(l=U)||m,ck(b,a),U=l):ck(b,a);ek(a);if(d&8192){l=null!==a.memoizedState;if((a.stateNode.isHidden=l)&&!m&&0!==(a.mode&1))for(V=a,m=a.child;null!==m;){for(q=V=m;null!==V;){r=V;y=r.child;switch(r.tag){case 0:case 11:case 14:case 15:Pj(4,r,r.return);break;case 1:Lj(r,r.return);var n=r.stateNode;if("function"===typeof n.componentWillUnmount){d=r;c=r.return;try{b=d,n.props=
b.memoizedProps,n.state=b.memoizedState,n.componentWillUnmount()}catch(t){W(d,c,t)}}break;case 5:Lj(r,r.return);break;case 22:if(null!==r.memoizedState){gk(q);continue}}null!==y?(y.return=r,V=y):gk(q)}m=m.sibling}a:for(m=null,q=a;;){if(5===q.tag){if(null===m){m=q;try{e=q.stateNode,l?(f=e.style,"function"===typeof f.setProperty?f.setProperty("display","none","important"):f.display="none"):(h=q.stateNode,k=q.memoizedProps.style,g=void 0!==k&&null!==k&&k.hasOwnProperty("display")?k.display:null,h.style.display=
rb("display",g))}catch(t){W(a,a.return,t)}}}else if(6===q.tag){if(null===m)try{q.stateNode.nodeValue=l?"":q.memoizedProps}catch(t){W(a,a.return,t)}}else if((22!==q.tag&&23!==q.tag||null===q.memoizedState||q===a)&&null!==q.child){q.child.return=q;q=q.child;continue}if(q===a)break a;for(;null===q.sibling;){if(null===q.return||q.return===a)break a;m===q&&(m=null);q=q.return}m===q&&(m=null);q.sibling.return=q.return;q=q.sibling}}break;case 19:ck(b,a);ek(a);d&4&&ak(a);break;case 21:break;default:ck(b,
a),ek(a)}}function ek(a){var b=a.flags;if(b&2){try{a:{for(var c=a.return;null!==c;){if(Tj(c)){var d=c;break a}c=c.return}throw Error(p(160));}switch(d.tag){case 5:var e=d.stateNode;d.flags&32&&(ob(e,""),d.flags&=-33);var f=Uj(a);Wj(a,f,e);break;case 3:case 4:var g=d.stateNode.containerInfo,h=Uj(a);Vj(a,h,g);break;default:throw Error(p(161));}}catch(k){W(a,a.return,k)}a.flags&=-3}b&4096&&(a.flags&=-4097)}function hk(a,b,c){V=a;ik(a,b,c)}
function ik(a,b,c){for(var d=0!==(a.mode&1);null!==V;){var e=V,f=e.child;if(22===e.tag&&d){var g=null!==e.memoizedState||Jj;if(!g){var h=e.alternate,k=null!==h&&null!==h.memoizedState||U;h=Jj;var l=U;Jj=g;if((U=k)&&!l)for(V=e;null!==V;)g=V,k=g.child,22===g.tag&&null!==g.memoizedState?jk(e):null!==k?(k.return=g,V=k):jk(e);for(;null!==f;)V=f,ik(f,b,c),f=f.sibling;V=e;Jj=h;U=l}kk(a,b,c)}else 0!==(e.subtreeFlags&8772)&&null!==f?(f.return=e,V=f):kk(a,b,c)}}
function kk(a){for(;null!==V;){var b=V;if(0!==(b.flags&8772)){var c=b.alternate;try{if(0!==(b.flags&8772))switch(b.tag){case 0:case 11:case 15:U||Qj(5,b);break;case 1:var d=b.stateNode;if(b.flags&4&&!U)if(null===c)d.componentDidMount();else{var e=b.elementType===b.type?c.memoizedProps:Ci(b.type,c.memoizedProps);d.componentDidUpdate(e,c.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var f=b.updateQueue;null!==f&&sh(b,f,d);break;case 3:var g=b.updateQueue;if(null!==g){c=null;if(null!==b.child)switch(b.child.tag){case 5:c=
b.child.stateNode;break;case 1:c=b.child.stateNode}sh(b,g,c)}break;case 5:var h=b.stateNode;if(null===c&&b.flags&4){c=h;var k=b.memoizedProps;switch(b.type){case "button":case "input":case "select":case "textarea":k.autoFocus&&c.focus();break;case "img":k.src&&(c.src=k.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(null===b.memoizedState){var l=b.alternate;if(null!==l){var m=l.memoizedState;if(null!==m){var q=m.dehydrated;null!==q&&bd(q)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;
default:throw Error(p(163));}U||b.flags&512&&Rj(b)}catch(r){W(b,b.return,r)}}if(b===a){V=null;break}c=b.sibling;if(null!==c){c.return=b.return;V=c;break}V=b.return}}function gk(a){for(;null!==V;){var b=V;if(b===a){V=null;break}var c=b.sibling;if(null!==c){c.return=b.return;V=c;break}V=b.return}}
function jk(a){for(;null!==V;){var b=V;try{switch(b.tag){case 0:case 11:case 15:var c=b.return;try{Qj(4,b)}catch(k){W(b,c,k)}break;case 1:var d=b.stateNode;if("function"===typeof d.componentDidMount){var e=b.return;try{d.componentDidMount()}catch(k){W(b,e,k)}}var f=b.return;try{Rj(b)}catch(k){W(b,f,k)}break;case 5:var g=b.return;try{Rj(b)}catch(k){W(b,g,k)}}}catch(k){W(b,b.return,k)}if(b===a){V=null;break}var h=b.sibling;if(null!==h){h.return=b.return;V=h;break}V=b.return}}
var lk=Math.ceil,mk=ua.ReactCurrentDispatcher,nk=ua.ReactCurrentOwner,ok=ua.ReactCurrentBatchConfig,K=0,Q=null,Y=null,Z=0,fj=0,ej=Uf(0),T=0,pk=null,rh=0,qk=0,rk=0,sk=null,tk=null,fk=0,Gj=Infinity,uk=null,Oi=!1,Pi=null,Ri=null,vk=!1,wk=null,xk=0,yk=0,zk=null,Ak=-1,Bk=0;function R(){return 0!==(K&6)?B():-1!==Ak?Ak:Ak=B()}
function yi(a){if(0===(a.mode&1))return 1;if(0!==(K&2)&&0!==Z)return Z&-Z;if(null!==Kg.transition)return 0===Bk&&(Bk=yc()),Bk;a=C;if(0!==a)return a;a=window.event;a=void 0===a?16:jd(a.type);return a}function gi(a,b,c,d){if(50<yk)throw yk=0,zk=null,Error(p(185));Ac(a,c,d);if(0===(K&2)||a!==Q)a===Q&&(0===(K&2)&&(qk|=c),4===T&&Ck(a,Z)),Dk(a,d),1===c&&0===K&&0===(b.mode&1)&&(Gj=B()+500,fg&&jg())}
function Dk(a,b){var c=a.callbackNode;wc(a,b);var d=uc(a,a===Q?Z:0);if(0===d)null!==c&&bc(c),a.callbackNode=null,a.callbackPriority=0;else if(b=d&-d,a.callbackPriority!==b){null!=c&&bc(c);if(1===b)0===a.tag?ig(Ek.bind(null,a)):hg(Ek.bind(null,a)),Jf(function(){0===(K&6)&&jg()}),c=null;else{switch(Dc(d)){case 1:c=fc;break;case 4:c=gc;break;case 16:c=hc;break;case 536870912:c=jc;break;default:c=hc}c=Fk(c,Gk.bind(null,a))}a.callbackPriority=b;a.callbackNode=c}}
function Gk(a,b){Ak=-1;Bk=0;if(0!==(K&6))throw Error(p(327));var c=a.callbackNode;if(Hk()&&a.callbackNode!==c)return null;var d=uc(a,a===Q?Z:0);if(0===d)return null;if(0!==(d&30)||0!==(d&a.expiredLanes)||b)b=Ik(a,d);else{b=d;var e=K;K|=2;var f=Jk();if(Q!==a||Z!==b)uk=null,Gj=B()+500,Kk(a,b);do try{Lk();break}catch(h){Mk(a,h)}while(1);$g();mk.current=f;K=e;null!==Y?b=0:(Q=null,Z=0,b=T)}if(0!==b){2===b&&(e=xc(a),0!==e&&(d=e,b=Nk(a,e)));if(1===b)throw c=pk,Kk(a,0),Ck(a,d),Dk(a,B()),c;if(6===b)Ck(a,d);
else{e=a.current.alternate;if(0===(d&30)&&!Ok(e)&&(b=Ik(a,d),2===b&&(f=xc(a),0!==f&&(d=f,b=Nk(a,f))),1===b))throw c=pk,Kk(a,0),Ck(a,d),Dk(a,B()),c;a.finishedWork=e;a.finishedLanes=d;switch(b){case 0:case 1:throw Error(p(345));case 2:Pk(a,tk,uk);break;case 3:Ck(a,d);if((d&130023424)===d&&(b=fk+500-B(),10<b)){if(0!==uc(a,0))break;e=a.suspendedLanes;if((e&d)!==d){R();a.pingedLanes|=a.suspendedLanes&e;break}a.timeoutHandle=Ff(Pk.bind(null,a,tk,uk),b);break}Pk(a,tk,uk);break;case 4:Ck(a,d);if((d&4194240)===
d)break;b=a.eventTimes;for(e=-1;0<d;){var g=31-oc(d);f=1<<g;g=b[g];g>e&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*lk(d/1960))-d;if(10<d){a.timeoutHandle=Ff(Pk.bind(null,a,tk,uk),d);break}Pk(a,tk,uk);break;case 5:Pk(a,tk,uk);break;default:throw Error(p(329));}}}Dk(a,B());return a.callbackNode===c?Gk.bind(null,a):null}
function Nk(a,b){var c=sk;a.current.memoizedState.isDehydrated&&(Kk(a,b).flags|=256);a=Ik(a,b);2!==a&&(b=tk,tk=c,null!==b&&Fj(b));return a}function Fj(a){null===tk?tk=a:tk.push.apply(tk,a)}
function Ok(a){for(var b=a;;){if(b.flags&16384){var c=b.updateQueue;if(null!==c&&(c=c.stores,null!==c))for(var d=0;d<c.length;d++){var e=c[d],f=e.getSnapshot;e=e.value;try{if(!He(f(),e))return!1}catch(g){return!1}}}c=b.child;if(b.subtreeFlags&16384&&null!==c)c.return=b,b=c;else{if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return!0;b=b.return}b.sibling.return=b.return;b=b.sibling}}return!0}
function Ck(a,b){b&=~rk;b&=~qk;a.suspendedLanes|=b;a.pingedLanes&=~b;for(a=a.expirationTimes;0<b;){var c=31-oc(b),d=1<<c;a[c]=-1;b&=~d}}function Ek(a){if(0!==(K&6))throw Error(p(327));Hk();var b=uc(a,0);if(0===(b&1))return Dk(a,B()),null;var c=Ik(a,b);if(0!==a.tag&&2===c){var d=xc(a);0!==d&&(b=d,c=Nk(a,d))}if(1===c)throw c=pk,Kk(a,0),Ck(a,b),Dk(a,B()),c;if(6===c)throw Error(p(345));a.finishedWork=a.current.alternate;a.finishedLanes=b;Pk(a,tk,uk);Dk(a,B());return null}
function Qk(a,b){var c=K;K|=1;try{return a(b)}finally{K=c,0===K&&(Gj=B()+500,fg&&jg())}}function Rk(a){null!==wk&&0===wk.tag&&0===(K&6)&&Hk();var b=K;K|=1;var c=ok.transition,d=C;try{if(ok.transition=null,C=1,a)return a()}finally{C=d,ok.transition=c,K=b,0===(K&6)&&jg()}}function Hj(){fj=ej.current;E(ej)}
function Kk(a,b){a.finishedWork=null;a.finishedLanes=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,Gf(c));if(null!==Y)for(c=Y.return;null!==c;){var d=c;wg(d);switch(d.tag){case 1:d=d.type.childContextTypes;null!==d&&void 0!==d&&$f();break;case 3:zh();E(Wf);E(H);Eh();break;case 5:Bh(d);break;case 4:zh();break;case 13:E(L);break;case 19:E(L);break;case 10:ah(d.type._context);break;case 22:case 23:Hj()}c=c.return}Q=a;Y=a=Pg(a.current,null);Z=fj=b;T=0;pk=null;rk=qk=rh=0;tk=sk=null;if(null!==fh){for(b=
0;b<fh.length;b++)if(c=fh[b],d=c.interleaved,null!==d){c.interleaved=null;var e=d.next,f=c.pending;if(null!==f){var g=f.next;f.next=e;d.next=g}c.pending=d}fh=null}return a}
function Mk(a,b){do{var c=Y;try{$g();Fh.current=Rh;if(Ih){for(var d=M.memoizedState;null!==d;){var e=d.queue;null!==e&&(e.pending=null);d=d.next}Ih=!1}Hh=0;O=N=M=null;Jh=!1;Kh=0;nk.current=null;if(null===c||null===c.return){T=1;pk=b;Y=null;break}a:{var f=a,g=c.return,h=c,k=b;b=Z;h.flags|=32768;if(null!==k&&"object"===typeof k&&"function"===typeof k.then){var l=k,m=h,q=m.tag;if(0===(m.mode&1)&&(0===q||11===q||15===q)){var r=m.alternate;r?(m.updateQueue=r.updateQueue,m.memoizedState=r.memoizedState,
m.lanes=r.lanes):(m.updateQueue=null,m.memoizedState=null)}var y=Ui(g);if(null!==y){y.flags&=-257;Vi(y,g,h,f,b);y.mode&1&&Si(f,l,b);b=y;k=l;var n=b.updateQueue;if(null===n){var t=new Set;t.add(k);b.updateQueue=t}else n.add(k);break a}else{if(0===(b&1)){Si(f,l,b);tj();break a}k=Error(p(426))}}else if(I&&h.mode&1){var J=Ui(g);if(null!==J){0===(J.flags&65536)&&(J.flags|=256);Vi(J,g,h,f,b);Jg(Ji(k,h));break a}}f=k=Ji(k,h);4!==T&&(T=2);null===sk?sk=[f]:sk.push(f);f=g;do{switch(f.tag){case 3:f.flags|=65536;
b&=-b;f.lanes|=b;var x=Ni(f,k,b);ph(f,x);break a;case 1:h=k;var w=f.type,u=f.stateNode;if(0===(f.flags&128)&&("function"===typeof w.getDerivedStateFromError||null!==u&&"function"===typeof u.componentDidCatch&&(null===Ri||!Ri.has(u)))){f.flags|=65536;b&=-b;f.lanes|=b;var F=Qi(f,h,b);ph(f,F);break a}}f=f.return}while(null!==f)}Sk(c)}catch(na){b=na;Y===c&&null!==c&&(Y=c=c.return);continue}break}while(1)}function Jk(){var a=mk.current;mk.current=Rh;return null===a?Rh:a}
function tj(){if(0===T||3===T||2===T)T=4;null===Q||0===(rh&268435455)&&0===(qk&268435455)||Ck(Q,Z)}function Ik(a,b){var c=K;K|=2;var d=Jk();if(Q!==a||Z!==b)uk=null,Kk(a,b);do try{Tk();break}catch(e){Mk(a,e)}while(1);$g();K=c;mk.current=d;if(null!==Y)throw Error(p(261));Q=null;Z=0;return T}function Tk(){for(;null!==Y;)Uk(Y)}function Lk(){for(;null!==Y&&!cc();)Uk(Y)}function Uk(a){var b=Vk(a.alternate,a,fj);a.memoizedProps=a.pendingProps;null===b?Sk(a):Y=b;nk.current=null}
function Sk(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&32768)){if(c=Ej(c,b,fj),null!==c){Y=c;return}}else{c=Ij(c,b);if(null!==c){c.flags&=32767;Y=c;return}if(null!==a)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{T=6;Y=null;return}}b=b.sibling;if(null!==b){Y=b;return}Y=b=a}while(null!==b);0===T&&(T=5)}function Pk(a,b,c){var d=C,e=ok.transition;try{ok.transition=null,C=1,Wk(a,b,c,d)}finally{ok.transition=e,C=d}return null}
function Wk(a,b,c,d){do Hk();while(null!==wk);if(0!==(K&6))throw Error(p(327));c=a.finishedWork;var e=a.finishedLanes;if(null===c)return null;a.finishedWork=null;a.finishedLanes=0;if(c===a.current)throw Error(p(177));a.callbackNode=null;a.callbackPriority=0;var f=c.lanes|c.childLanes;Bc(a,f);a===Q&&(Y=Q=null,Z=0);0===(c.subtreeFlags&2064)&&0===(c.flags&2064)||vk||(vk=!0,Fk(hc,function(){Hk();return null}));f=0!==(c.flags&15990);if(0!==(c.subtreeFlags&15990)||f){f=ok.transition;ok.transition=null;
var g=C;C=1;var h=K;K|=4;nk.current=null;Oj(a,c);dk(c,a);Oe(Df);dd=!!Cf;Df=Cf=null;a.current=c;hk(c,a,e);dc();K=h;C=g;ok.transition=f}else a.current=c;vk&&(vk=!1,wk=a,xk=e);f=a.pendingLanes;0===f&&(Ri=null);mc(c.stateNode,d);Dk(a,B());if(null!==b)for(d=a.onRecoverableError,c=0;c<b.length;c++)e=b[c],d(e.value,{componentStack:e.stack,digest:e.digest});if(Oi)throw Oi=!1,a=Pi,Pi=null,a;0!==(xk&1)&&0!==a.tag&&Hk();f=a.pendingLanes;0!==(f&1)?a===zk?yk++:(yk=0,zk=a):yk=0;jg();return null}
function Hk(){if(null!==wk){var a=Dc(xk),b=ok.transition,c=C;try{ok.transition=null;C=16>a?16:a;if(null===wk)var d=!1;else{a=wk;wk=null;xk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;k<h.length;k++){var l=h[k];for(V=l;null!==V;){var m=V;switch(m.tag){case 0:case 11:case 15:Pj(8,m,f)}var q=m.child;if(null!==q)q.return=m,V=q;else for(;null!==V;){m=V;var r=m.sibling,y=m.return;Sj(m);if(m===
l){V=null;break}if(null!==r){r.return=y;V=r;break}V=y}}}var n=f.alternate;if(null!==n){var t=n.child;if(null!==t){n.child=null;do{var J=t.sibling;t.sibling=null;t=J}while(null!==t)}}V=f}}if(0!==(f.subtreeFlags&2064)&&null!==g)g.return=f,V=g;else b:for(;null!==V;){f=V;if(0!==(f.flags&2048))switch(f.tag){case 0:case 11:case 15:Pj(9,f,f.return)}var x=f.sibling;if(null!==x){x.return=f.return;V=x;break b}V=f.return}}var w=a.current;for(V=w;null!==V;){g=V;var u=g.child;if(0!==(g.subtreeFlags&2064)&&null!==
u)u.return=g,V=u;else b:for(g=w;null!==V;){h=V;if(0!==(h.flags&2048))try{switch(h.tag){case 0:case 11:case 15:Qj(9,h)}}catch(na){W(h,h.return,na)}if(h===g){V=null;break b}var F=h.sibling;if(null!==F){F.return=h.return;V=F;break b}V=h.return}}K=e;jg();if(lc&&"function"===typeof lc.onPostCommitFiberRoot)try{lc.onPostCommitFiberRoot(kc,a)}catch(na){}d=!0}return d}finally{C=c,ok.transition=b}}return!1}function Xk(a,b,c){b=Ji(c,b);b=Ni(a,b,1);a=nh(a,b,1);b=R();null!==a&&(Ac(a,1,b),Dk(a,b))}
function W(a,b,c){if(3===a.tag)Xk(a,a,c);else for(;null!==b;){if(3===b.tag){Xk(b,a,c);break}else if(1===b.tag){var d=b.stateNode;if("function"===typeof b.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Ri||!Ri.has(d))){a=Ji(c,a);a=Qi(b,a,1);b=nh(b,a,1);a=R();null!==b&&(Ac(b,1,a),Dk(b,a));break}}b=b.return}}
function Ti(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);b=R();a.pingedLanes|=a.suspendedLanes&c;Q===a&&(Z&c)===c&&(4===T||3===T&&(Z&130023424)===Z&&500>B()-fk?Kk(a,0):rk|=c);Dk(a,b)}function Yk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=R();a=ih(a,b);null!==a&&(Ac(a,b,c),Dk(a,c))}function uj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Yk(a,c)}
function bk(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Yk(a,c)}var Vk;
Vk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)dh=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return dh=!1,yj(a,b,c);dh=0!==(a.flags&131072)?!0:!1}else dh=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;ij(a,b);a=b.pendingProps;var e=Yf(b,H.current);ch(b,c);e=Nh(null,b,d,a,e,c);var f=Sh();b.flags|=1;"object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=
null,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,kh(b),e.updater=Ei,b.stateNode=e,e._reactInternals=b,Ii(b,d,a,c),b=jj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Xi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{ij(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=Zk(d);a=Ci(d,a);switch(e){case 0:b=cj(null,b,d,a,c);break a;case 1:b=hj(null,b,d,a,c);break a;case 11:b=Yi(null,b,d,a,c);break a;case 14:b=$i(null,b,d,Ci(d.type,a),c);break a}throw Error(p(306,
d,""));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),cj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),hj(a,b,d,e,c);case 3:a:{kj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;lh(a,b);qh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=
f,b.memoizedState=f,b.flags&256){e=Ji(Error(p(423)),b);b=lj(a,b,d,c,e);break a}else if(d!==e){e=Ji(Error(p(424)),b);b=lj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Vg(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=Zi(a,b,c);break a}Xi(a,b,d,c)}b=b.child}return b;case 5:return Ah(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),
gj(a,b),Xi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return oj(a,b,c);case 4:return yh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Ug(b,null,d,c):Xi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),Yi(a,b,d,e,c);case 7:return Xi(a,b,b.pendingProps,c),b.child;case 8:return Xi(a,b,b.pendingProps.children,c),b.child;case 12:return Xi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;
g=e.value;G(Wg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=Zi(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=mh(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);bh(f.return,
c,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);bh(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Xi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,ch(b,c),e=eh(e),d=d(e),b.flags|=1,Xi(a,b,d,c),
b.child;case 14:return d=b.type,e=Ci(d,b.pendingProps),e=Ci(d.type,e),$i(a,b,d,e,c);case 15:return bj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),ij(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,ch(b,c),Gi(b,d,e),Ii(b,d,e,c),jj(null,b,d,!0,a,c);case 19:return xj(a,b,c);case 22:return dj(a,b,c)}throw Error(p(156,b.tag));};function Fk(a,b){return ac(a,b)}
function $k(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new $k(a,b,c,d)}function aj(a){a=a.prototype;return!(!a||!a.isReactComponent)}
function Zk(a){if("function"===typeof a)return aj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}
function Pg(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};
c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}
function Rg(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)aj(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case ya:return Tg(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return pj(c,e,f,b);default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;
break a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,""));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Tg(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function pj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function Qg(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}
function Sg(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}
function al(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=
null}function bl(a,b,c,d,e,f,g,h,k){a=new al(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};kh(f);return a}function cl(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:wa,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}
function dl(a){if(!a)return Vf;a=a._reactInternals;a:{if(Vb(a)!==a||1!==a.tag)throw Error(p(170));var b=a;do{switch(b.tag){case 3:b=b.stateNode.context;break a;case 1:if(Zf(b.type)){b=b.stateNode.__reactInternalMemoizedMergedChildContext;break a}}b=b.return}while(null!==b);throw Error(p(171));}if(1===a.tag){var c=a.type;if(Zf(c))return bg(a,c,b)}return b}
function el(a,b,c,d,e,f,g,h,k){a=bl(c,d,!0,a,e,f,g,h,k);a.context=dl(null);c=a.current;d=R();e=yi(c);f=mh(d,e);f.callback=void 0!==b&&null!==b?b:null;nh(c,f,e);a.current.lanes=e;Ac(a,e,d);Dk(a,d);return a}function fl(a,b,c,d){var e=b.current,f=R(),g=yi(e);c=dl(c);null===b.context?b.context=c:b.pendingContext=c;b=mh(f,g);b.payload={element:a};d=void 0===d?null:d;null!==d&&(b.callback=d);a=nh(e,b,g);null!==a&&(gi(a,e,g,f),oh(a,e,g));return g}
function gl(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function hl(a,b){a=a.memoizedState;if(null!==a&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c<b?c:b}}function il(a,b){hl(a,b);(a=a.alternate)&&hl(a,b)}function jl(){return null}var kl="function"===typeof reportError?reportError:function(a){console.error(a)};function ll(a){this._internalRoot=a}
ml.prototype.render=ll.prototype.render=function(a){var b=this._internalRoot;if(null===b)throw Error(p(409));fl(a,b,null,null)};ml.prototype.unmount=ll.prototype.unmount=function(){var a=this._internalRoot;if(null!==a){this._internalRoot=null;var b=a.containerInfo;Rk(function(){fl(null,a,null,null)});b[uf]=null}};function ml(a){this._internalRoot=a}
ml.prototype.unstable_scheduleHydration=function(a){if(a){var b=Hc();a={blockedOn:null,target:a,priority:b};for(var c=0;c<Qc.length&&0!==b&&b<Qc[c].priority;c++);Qc.splice(c,0,a);0===c&&Vc(a)}};function nl(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType)}function ol(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}function pl(){}
function ql(a,b,c,d,e){if(e){if("function"===typeof d){var f=d;d=function(){var a=gl(g);f.call(a)}}var g=el(b,d,a,0,null,!1,!1,"",pl);a._reactRootContainer=g;a[uf]=g.current;sf(8===a.nodeType?a.parentNode:a);Rk();return g}for(;e=a.lastChild;)a.removeChild(e);if("function"===typeof d){var h=d;d=function(){var a=gl(k);h.call(a)}}var k=bl(a,0,!1,null,null,!1,!1,"",pl);a._reactRootContainer=k;a[uf]=k.current;sf(8===a.nodeType?a.parentNode:a);Rk(function(){fl(b,k,c,d)});return k}
function rl(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f;if("function"===typeof e){var h=e;e=function(){var a=gl(g);h.call(a)}}fl(b,g,a,e)}else g=ql(c,b,a,e,d);return gl(g)}Ec=function(a){switch(a.tag){case 3:var b=a.stateNode;if(b.current.memoizedState.isDehydrated){var c=tc(b.pendingLanes);0!==c&&(Cc(b,c|1),Dk(b,B()),0===(K&6)&&(Gj=B()+500,jg()))}break;case 13:Rk(function(){var b=ih(a,1);if(null!==b){var c=R();gi(b,a,1,c)}}),il(a,1)}};
Fc=function(a){if(13===a.tag){var b=ih(a,134217728);if(null!==b){var c=R();gi(b,a,134217728,c)}il(a,134217728)}};Gc=function(a){if(13===a.tag){var b=yi(a),c=ih(a,b);if(null!==c){var d=R();gi(c,a,b,d)}il(a,b)}};Hc=function(){return C};Ic=function(a,b){var c=C;try{return C=a,b()}finally{C=c}};
yb=function(a,b,c){switch(b){case "input":bb(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Db(d);if(!e)throw Error(p(90));Wa(d);bb(d,e)}}}break;case "textarea":ib(a,c);break;case "select":b=c.value,null!=b&&fb(a,!!c.multiple,b,!1)}};Gb=Qk;Hb=Rk;
var sl={usingClientEntryPoint:!1,Events:[Cb,ue,Db,Eb,Fb,Qk]},tl={findFiberByHostInstance:Wc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"};
var ul={bundleType:tl.bundleType,version:tl.version,rendererPackageName:tl.rendererPackageName,rendererConfig:tl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ua.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=Zb(a);return null===a?null:a.stateNode},findFiberByHostInstance:tl.findFiberByHostInstance||
jl,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vl.isDisabled&&vl.supportsFiber)try{kc=vl.inject(ul),lc=vl}catch(a){}}exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sl;
exports.createPortal=function(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nl(b))throw Error(p(200));return cl(a,b,null,c)};exports.createRoot=function(a,b){if(!nl(a))throw Error(p(299));var c=!1,d="",e=kl;null!==b&&void 0!==b&&(!0===b.unstable_strictMode&&(c=!0),void 0!==b.identifierPrefix&&(d=b.identifierPrefix),void 0!==b.onRecoverableError&&(e=b.onRecoverableError));b=bl(a,1,!1,null,null,c,!1,d,e);a[uf]=b.current;sf(8===a.nodeType?a.parentNode:a);return new ll(b)};
exports.findDOMNode=function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternals;if(void 0===b){if("function"===typeof a.render)throw Error(p(188));a=Object.keys(a).join(",");throw Error(p(268,a));}a=Zb(b);a=null===a?null:a.stateNode;return a};exports.flushSync=function(a){return Rk(a)};exports.hydrate=function(a,b,c){if(!ol(b))throw Error(p(200));return rl(null,a,b,!0,c)};
exports.hydrateRoot=function(a,b,c){if(!nl(a))throw Error(p(405));var d=null!=c&&c.hydratedSources||null,e=!1,f="",g=kl;null!==c&&void 0!==c&&(!0===c.unstable_strictMode&&(e=!0),void 0!==c.identifierPrefix&&(f=c.identifierPrefix),void 0!==c.onRecoverableError&&(g=c.onRecoverableError));b=el(b,null,a,1,null!=c?c:null,e,!1,f,g);a[uf]=b.current;sf(a);if(d)for(a=0;a<d.length;a++)c=d[a],e=c._getVersion,e=e(c._source),null==b.mutableSourceEagerHydrationData?b.mutableSourceEagerHydrationData=[c,e]:b.mutableSourceEagerHydrationData.push(c,
e);return new ml(b)};exports.render=function(a,b,c){if(!ol(b))throw Error(p(200));return rl(null,a,b,!1,c)};exports.unmountComponentAtNode=function(a){if(!ol(a))throw Error(p(40));return a._reactRootContainer?(Rk(function(){rl(null,null,a,!1,function(){a._reactRootContainer=null;a[uf]=null})}),!0):!1};exports.unstable_batchedUpdates=Qk;
exports.unstable_renderSubtreeIntoContainer=function(a,b,c,d){if(!ol(c))throw Error(p(200));if(null==a||void 0===a._reactInternals)throw Error(p(38));return rl(a,b,c,!1,d)};exports.version="18.3.1-next-f1338f8080-20240426";


/***/ }),

/***/ 5338:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
var __webpack_unused_export__;


var m = __webpack_require__(961);
if (true) {
  exports.H = m.createRoot;
  __webpack_unused_export__ = m.hydrateRoot;
} else { var i; }


/***/ }),

/***/ 961:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


function checkDCE() {
  /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  if (
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
  ) {
    return;
  }
  if (false) {}
  try {
    // Verify that the code above has been dead code eliminated (DCE'd).
    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  } catch (err) {
    // DevTools shouldn't crash React, no matter what.
    // We should still report in case we break this code.
    console.error(err);
  }
}

if (true) {
  // DCE check should happen before ReactDOM bundle executes so that
  // DevTools can report bad minification during injection.
  checkDCE();
  module.exports = __webpack_require__(2551);
} else {}


/***/ }),

/***/ 4405:
/***/ (function(__unused_webpack_module, exports) {

"use strict";
/**
 * @license React
 * react-is.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
  REACT_PORTAL_TYPE = Symbol.for("react.portal"),
  REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
  REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
  REACT_PROFILER_TYPE = Symbol.for("react.profiler");
Symbol.for("react.provider");
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
  REACT_CONTEXT_TYPE = Symbol.for("react.context"),
  REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
  REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
  REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
  REACT_MEMO_TYPE = Symbol.for("react.memo"),
  REACT_LAZY_TYPE = Symbol.for("react.lazy"),
  REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
  REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
function typeOf(object) {
  if ("object" === typeof object && null !== object) {
    var $$typeof = object.$$typeof;
    switch ($$typeof) {
      case REACT_ELEMENT_TYPE:
        switch (((object = object.type), object)) {
          case REACT_FRAGMENT_TYPE:
          case REACT_PROFILER_TYPE:
          case REACT_STRICT_MODE_TYPE:
          case REACT_SUSPENSE_TYPE:
          case REACT_SUSPENSE_LIST_TYPE:
            return object;
          default:
            switch (((object = object && object.$$typeof), object)) {
              case REACT_CONTEXT_TYPE:
              case REACT_FORWARD_REF_TYPE:
              case REACT_LAZY_TYPE:
              case REACT_MEMO_TYPE:
                return object;
              case REACT_CONSUMER_TYPE:
                return object;
              default:
                return $$typeof;
            }
        }
      case REACT_PORTAL_TYPE:
        return $$typeof;
    }
  }
}
exports.ContextConsumer = REACT_CONSUMER_TYPE;
exports.ContextProvider = REACT_CONTEXT_TYPE;
exports.Element = REACT_ELEMENT_TYPE;
exports.ForwardRef = REACT_FORWARD_REF_TYPE;
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.Lazy = REACT_LAZY_TYPE;
exports.Memo = REACT_MEMO_TYPE;
exports.Portal = REACT_PORTAL_TYPE;
exports.Profiler = REACT_PROFILER_TYPE;
exports.StrictMode = REACT_STRICT_MODE_TYPE;
exports.Suspense = REACT_SUSPENSE_TYPE;
exports.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
exports.isContextConsumer = function (object) {
  return typeOf(object) === REACT_CONSUMER_TYPE;
};
exports.isContextProvider = function (object) {
  return typeOf(object) === REACT_CONTEXT_TYPE;
};
exports.isElement = function (object) {
  return (
    "object" === typeof object &&
    null !== object &&
    object.$$typeof === REACT_ELEMENT_TYPE
  );
};
exports.isForwardRef = function (object) {
  return typeOf(object) === REACT_FORWARD_REF_TYPE;
};
exports.isFragment = function (object) {
  return typeOf(object) === REACT_FRAGMENT_TYPE;
};
exports.isLazy = function (object) {
  return typeOf(object) === REACT_LAZY_TYPE;
};
exports.isMemo = function (object) {
  return typeOf(object) === REACT_MEMO_TYPE;
};
exports.isPortal = function (object) {
  return typeOf(object) === REACT_PORTAL_TYPE;
};
exports.isProfiler = function (object) {
  return typeOf(object) === REACT_PROFILER_TYPE;
};
exports.isStrictMode = function (object) {
  return typeOf(object) === REACT_STRICT_MODE_TYPE;
};
exports.isSuspense = function (object) {
  return typeOf(object) === REACT_SUSPENSE_TYPE;
};
exports.isSuspenseList = function (object) {
  return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
};
exports.isValidElementType = function (type) {
  return "string" === typeof type ||
    "function" === typeof type ||
    type === REACT_FRAGMENT_TYPE ||
    type === REACT_PROFILER_TYPE ||
    type === REACT_STRICT_MODE_TYPE ||
    type === REACT_SUSPENSE_TYPE ||
    type === REACT_SUSPENSE_LIST_TYPE ||
    type === REACT_OFFSCREEN_TYPE ||
    ("object" === typeof type &&
      null !== type &&
      (type.$$typeof === REACT_LAZY_TYPE ||
        type.$$typeof === REACT_MEMO_TYPE ||
        type.$$typeof === REACT_CONTEXT_TYPE ||
        type.$$typeof === REACT_CONSUMER_TYPE ||
        type.$$typeof === REACT_FORWARD_REF_TYPE ||
        type.$$typeof === REACT_CLIENT_REFERENCE ||
        void 0 !== type.getModuleId))
    ? !0
    : !1;
};
exports.typeOf = typeOf;


/***/ }),

/***/ 4363:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


if (true) {
  module.exports = __webpack_require__(4405);
} else {}


/***/ }),

/***/ 1020:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
/**
 * @license React
 * react-jsx-runtime.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 f=__webpack_require__(6540),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;


/***/ }),

/***/ 5287:
/***/ (function(__unused_webpack_module, exports) {

"use strict";
/**
 * @license React
 * react.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 l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){if(null===a||"object"!==typeof a)return null;a=z&&a[z]||a["@@iterator"];return"function"===typeof a?a:null}
var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};
E.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;
H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};
function M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}
function N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return"object"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={"=":"=0",":":"=2"};return"$"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g;function Q(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
function R(a,b,e,d,c){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=""===d?"."+Q(h,0):d,I(c)?(e="",null!=a&&(e=a.replace(P,"$&/")+"/"),R(c,b,e,"",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P,"$&/")+"/")+a)),b.push(c)),1;h=0;d=""===d?".":d+":";if(I(a))for(var g=0;g<a.length;g++){k=
a[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if("object"===k)throw b=String(a),Error("Objects are not valid as a React child (found: "+("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}
function S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,"","",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}
var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};function X(){throw Error("act(...) is not supported in production builds of React.");}
exports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};exports.Component=E;exports.Fragment=p;exports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;exports.act=X;
exports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);
for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};
exports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=X;exports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};
exports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};exports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};
exports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};exports.useTransition=function(){return U.current.useTransition()};exports.version="18.3.1";


/***/ }),

/***/ 6540:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


if (true) {
  module.exports = __webpack_require__(5287);
} else {}


/***/ }),

/***/ 4848:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


if (true) {
  module.exports = __webpack_require__(1020);
} else {}


/***/ }),

/***/ 6048:
/***/ (function(module) {

"use strict";


function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

var codes = {};

function createErrorType(code, message, Base) {
  if (!Base) {
    Base = Error;
  }

  function getMessage(arg1, arg2, arg3) {
    if (typeof message === 'string') {
      return message;
    } else {
      return message(arg1, arg2, arg3);
    }
  }

  var NodeError =
  /*#__PURE__*/
  function (_Base) {
    _inheritsLoose(NodeError, _Base);

    function NodeError(arg1, arg2, arg3) {
      return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
    }

    return NodeError;
  }(Base);

  NodeError.prototype.name = Base.name;
  NodeError.prototype.code = code;
  codes[code] = NodeError;
} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js


function oneOf(expected, thing) {
  if (Array.isArray(expected)) {
    var len = expected.length;
    expected = expected.map(function (i) {
      return String(i);
    });

    if (len > 2) {
      return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1];
    } else if (len === 2) {
      return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
    } else {
      return "of ".concat(thing, " ").concat(expected[0]);
    }
  } else {
    return "of ".concat(thing, " ").concat(String(expected));
  }
} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith


function startsWith(str, search, pos) {
  return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith


function endsWith(str, search, this_len) {
  if (this_len === undefined || this_len > str.length) {
    this_len = str.length;
  }

  return str.substring(this_len - search.length, this_len) === search;
} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes


function includes(str, search, start) {
  if (typeof start !== 'number') {
    start = 0;
  }

  if (start + search.length > str.length) {
    return false;
  } else {
    return str.indexOf(search, start) !== -1;
  }
}

createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
  return 'The value "' + value + '" is invalid for option "' + name + '"';
}, TypeError);
createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
  // determiner: 'must be' or 'must not be'
  var determiner;

  if (typeof expected === 'string' && startsWith(expected, 'not ')) {
    determiner = 'must not be';
    expected = expected.replace(/^not /, '');
  } else {
    determiner = 'must be';
  }

  var msg;

  if (endsWith(name, ' argument')) {
    // For cases like 'first argument'
    msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
  } else {
    var type = includes(name, '.') ? 'property' : 'argument';
    msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
  }

  msg += ". Received type ".concat(typeof actual);
  return msg;
}, TypeError);
createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
  return 'The ' + name + ' method is not implemented';
});
createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
createErrorType('ERR_STREAM_DESTROYED', function (name) {
  return 'Cannot call ' + name + ' after a stream was destroyed';
});
createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
  return 'Unknown encoding: ' + arg;
}, TypeError);
createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
module.exports.F = codes;


/***/ }),

/***/ 5382:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/* provided dependency */ var process = __webpack_require__(5606);
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
// Writable.



/*<replacement>*/
var objectKeys = Object.keys || function (obj) {
  var keys = [];
  for (var key in obj) keys.push(key);
  return keys;
};
/*</replacement>*/

module.exports = Duplex;
var Readable = __webpack_require__(5412);
var Writable = __webpack_require__(6708);
__webpack_require__(6698)(Duplex, Readable);
{
  // Allow the keys array to be GC'ed.
  var keys = objectKeys(Writable.prototype);
  for (var v = 0; v < keys.length; v++) {
    var method = keys[v];
    if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  }
}
function Duplex(options) {
  if (!(this instanceof Duplex)) return new Duplex(options);
  Readable.call(this, options);
  Writable.call(this, options);
  this.allowHalfOpen = true;
  if (options) {
    if (options.readable === false) this.readable = false;
    if (options.writable === false) this.writable = false;
    if (options.allowHalfOpen === false) {
      this.allowHalfOpen = false;
      this.once('end', onend);
    }
  }
}
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    return this._writableState.highWaterMark;
  }
});
Object.defineProperty(Duplex.prototype, 'writableBuffer', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    return this._writableState && this._writableState.getBuffer();
  }
});
Object.defineProperty(Duplex.prototype, 'writableLength', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    return this._writableState.length;
  }
});

// the no-half-open enforcer
function onend() {
  // If the writable side ended, then we're ok.
  if (this._writableState.ended) return;

  // no more data can be written.
  // But allow more writes to happen in this tick.
  process.nextTick(onEndNT, this);
}
function onEndNT(self) {
  self.end();
}
Object.defineProperty(Duplex.prototype, 'destroyed', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    if (this._readableState === undefined || this._writableState === undefined) {
      return false;
    }
    return this._readableState.destroyed && this._writableState.destroyed;
  },
  set: function set(value) {
    // we ignore the value if the stream
    // has not been initialized yet
    if (this._readableState === undefined || this._writableState === undefined) {
      return;
    }

    // backward compatibility, the user is explicitly
    // managing destroyed
    this._readableState.destroyed = value;
    this._writableState.destroyed = value;
  }
});

/***/ }),

/***/ 3600:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.



module.exports = PassThrough;
var Transform = __webpack_require__(4610);
__webpack_require__(6698)(PassThrough, Transform);
function PassThrough(options) {
  if (!(this instanceof PassThrough)) return new PassThrough(options);
  Transform.call(this, options);
}
PassThrough.prototype._transform = function (chunk, encoding, cb) {
  cb(null, chunk);
};

/***/ }),

/***/ 5412:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/* provided dependency */ var process = __webpack_require__(5606);
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.



module.exports = Readable;

/*<replacement>*/
var Duplex;
/*</replacement>*/

Readable.ReadableState = ReadableState;

/*<replacement>*/
var EE = (__webpack_require__(7007).EventEmitter);
var EElistenerCount = function EElistenerCount(emitter, type) {
  return emitter.listeners(type).length;
};
/*</replacement>*/

/*<replacement>*/
var Stream = __webpack_require__(345);
/*</replacement>*/

var Buffer = (__webpack_require__(8287).Buffer);
var OurUint8Array = (typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
  return Buffer.from(chunk);
}
function _isUint8Array(obj) {
  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}

/*<replacement>*/
var debugUtil = __webpack_require__(9838);
var debug;
if (debugUtil && debugUtil.debuglog) {
  debug = debugUtil.debuglog('stream');
} else {
  debug = function debug() {};
}
/*</replacement>*/

var BufferList = __webpack_require__(2726);
var destroyImpl = __webpack_require__(5896);
var _require = __webpack_require__(5291),
  getHighWaterMark = _require.getHighWaterMark;
var _require$codes = (__webpack_require__(6048)/* .codes */ .F),
  ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
  ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF,
  ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
  ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;

// Lazy loaded to improve the startup performance.
var StringDecoder;
var createReadableStreamAsyncIterator;
var from;
__webpack_require__(6698)(Readable, Stream);
var errorOrDestroy = destroyImpl.errorOrDestroy;
var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
function prependListener(emitter, event, fn) {
  // Sadly this is not cacheable as some libraries bundle their own
  // event emitter implementation with them.
  if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);

  // This is a hack to make sure that our error handler is attached before any
  // userland ones.  NEVER DO THIS. This is here only because this code needs
  // to continue to work with older versions of Node.js that do not include
  // the prependListener() method. The goal is to eventually remove this hack.
  if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
}
function ReadableState(options, stream, isDuplex) {
  Duplex = Duplex || __webpack_require__(5382);
  options = options || {};

  // Duplex streams are both readable and writable, but share
  // the same options object.
  // However, some cases require setting options to different
  // values for the readable and the writable sides of the duplex stream.
  // These options can be provided separately as readableXXX and writableXXX.
  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;

  // object stream flag. Used to make read(n) ignore n and to
  // make all the buffer merging and length checks go away
  this.objectMode = !!options.objectMode;
  if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;

  // the point at which it stops calling _read() to fill the buffer
  // Note: 0 is a valid value, means "don't call _read preemptively ever"
  this.highWaterMark = getHighWaterMark(this, options, 'readableHighWaterMark', isDuplex);

  // A linked list is used to store data chunks instead of an array because the
  // linked list can remove elements from the beginning faster than
  // array.shift()
  this.buffer = new BufferList();
  this.length = 0;
  this.pipes = null;
  this.pipesCount = 0;
  this.flowing = null;
  this.ended = false;
  this.endEmitted = false;
  this.reading = false;

  // a flag to be able to tell if the event 'readable'/'data' is emitted
  // immediately, or on a later tick.  We set this to true at first, because
  // any actions that shouldn't happen until "later" should generally also
  // not happen before the first read call.
  this.sync = true;

  // whenever we return null, then we set a flag to say
  // that we're awaiting a 'readable' event emission.
  this.needReadable = false;
  this.emittedReadable = false;
  this.readableListening = false;
  this.resumeScheduled = false;
  this.paused = true;

  // Should close be emitted on destroy. Defaults to true.
  this.emitClose = options.emitClose !== false;

  // Should .destroy() be called after 'end' (and potentially 'finish')
  this.autoDestroy = !!options.autoDestroy;

  // has it been destroyed
  this.destroyed = false;

  // Crypto is kind of old and crusty.  Historically, its default string
  // encoding is 'binary' so we have to make this configurable.
  // Everything else in the universe uses 'utf8', though.
  this.defaultEncoding = options.defaultEncoding || 'utf8';

  // the number of writers that are awaiting a drain event in .pipe()s
  this.awaitDrain = 0;

  // if true, a maybeReadMore has been scheduled
  this.readingMore = false;
  this.decoder = null;
  this.encoding = null;
  if (options.encoding) {
    if (!StringDecoder) StringDecoder = (__webpack_require__(3141)/* .StringDecoder */ .I);
    this.decoder = new StringDecoder(options.encoding);
    this.encoding = options.encoding;
  }
}
function Readable(options) {
  Duplex = Duplex || __webpack_require__(5382);
  if (!(this instanceof Readable)) return new Readable(options);

  // Checking for a Stream.Duplex instance is faster here instead of inside
  // the ReadableState constructor, at least with V8 6.5
  var isDuplex = this instanceof Duplex;
  this._readableState = new ReadableState(options, this, isDuplex);

  // legacy
  this.readable = true;
  if (options) {
    if (typeof options.read === 'function') this._read = options.read;
    if (typeof options.destroy === 'function') this._destroy = options.destroy;
  }
  Stream.call(this);
}
Object.defineProperty(Readable.prototype, 'destroyed', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    if (this._readableState === undefined) {
      return false;
    }
    return this._readableState.destroyed;
  },
  set: function set(value) {
    // we ignore the value if the stream
    // has not been initialized yet
    if (!this._readableState) {
      return;
    }

    // backward compatibility, the user is explicitly
    // managing destroyed
    this._readableState.destroyed = value;
  }
});
Readable.prototype.destroy = destroyImpl.destroy;
Readable.prototype._undestroy = destroyImpl.undestroy;
Readable.prototype._destroy = function (err, cb) {
  cb(err);
};

// Manually shove something into the read() buffer.
// This returns true if the highWaterMark has not been hit yet,
// similar to how Writable.write() returns true if you should
// write() some more.
Readable.prototype.push = function (chunk, encoding) {
  var state = this._readableState;
  var skipChunkCheck;
  if (!state.objectMode) {
    if (typeof chunk === 'string') {
      encoding = encoding || state.defaultEncoding;
      if (encoding !== state.encoding) {
        chunk = Buffer.from(chunk, encoding);
        encoding = '';
      }
      skipChunkCheck = true;
    }
  } else {
    skipChunkCheck = true;
  }
  return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
};

// Unshift should *always* be something directly out of read()
Readable.prototype.unshift = function (chunk) {
  return readableAddChunk(this, chunk, null, true, false);
};
function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  debug('readableAddChunk', chunk);
  var state = stream._readableState;
  if (chunk === null) {
    state.reading = false;
    onEofChunk(stream, state);
  } else {
    var er;
    if (!skipChunkCheck) er = chunkInvalid(state, chunk);
    if (er) {
      errorOrDestroy(stream, er);
    } else if (state.objectMode || chunk && chunk.length > 0) {
      if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
        chunk = _uint8ArrayToBuffer(chunk);
      }
      if (addToFront) {
        if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());else addChunk(stream, state, chunk, true);
      } else if (state.ended) {
        errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
      } else if (state.destroyed) {
        return false;
      } else {
        state.reading = false;
        if (state.decoder && !encoding) {
          chunk = state.decoder.write(chunk);
          if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
        } else {
          addChunk(stream, state, chunk, false);
        }
      }
    } else if (!addToFront) {
      state.reading = false;
      maybeReadMore(stream, state);
    }
  }

  // We can push more data if we are below the highWaterMark.
  // Also, if we have no data yet, we can stand some more bytes.
  // This is to work around cases where hwm=0, such as the repl.
  return !state.ended && (state.length < state.highWaterMark || state.length === 0);
}
function addChunk(stream, state, chunk, addToFront) {
  if (state.flowing && state.length === 0 && !state.sync) {
    state.awaitDrain = 0;
    stream.emit('data', chunk);
  } else {
    // update the buffer info.
    state.length += state.objectMode ? 1 : chunk.length;
    if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
    if (state.needReadable) emitReadable(stream);
  }
  maybeReadMore(stream, state);
}
function chunkInvalid(state, chunk) {
  var er;
  if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
    er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer', 'Uint8Array'], chunk);
  }
  return er;
}
Readable.prototype.isPaused = function () {
  return this._readableState.flowing === false;
};

// backwards compatibility.
Readable.prototype.setEncoding = function (enc) {
  if (!StringDecoder) StringDecoder = (__webpack_require__(3141)/* .StringDecoder */ .I);
  var decoder = new StringDecoder(enc);
  this._readableState.decoder = decoder;
  // If setEncoding(null), decoder.encoding equals utf8
  this._readableState.encoding = this._readableState.decoder.encoding;

  // Iterate over current buffer to convert already stored Buffers:
  var p = this._readableState.buffer.head;
  var content = '';
  while (p !== null) {
    content += decoder.write(p.data);
    p = p.next;
  }
  this._readableState.buffer.clear();
  if (content !== '') this._readableState.buffer.push(content);
  this._readableState.length = content.length;
  return this;
};

// Don't raise the hwm > 1GB
var MAX_HWM = 0x40000000;
function computeNewHighWaterMark(n) {
  if (n >= MAX_HWM) {
    // TODO(ronag): Throw ERR_VALUE_OUT_OF_RANGE.
    n = MAX_HWM;
  } else {
    // Get the next highest power of 2 to prevent increasing hwm excessively in
    // tiny amounts
    n--;
    n |= n >>> 1;
    n |= n >>> 2;
    n |= n >>> 4;
    n |= n >>> 8;
    n |= n >>> 16;
    n++;
  }
  return n;
}

// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function howMuchToRead(n, state) {
  if (n <= 0 || state.length === 0 && state.ended) return 0;
  if (state.objectMode) return 1;
  if (n !== n) {
    // Only flow one buffer at a time
    if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  }
  // If we're asking for more than the current hwm, then raise the hwm.
  if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  if (n <= state.length) return n;
  // Don't have enough
  if (!state.ended) {
    state.needReadable = true;
    return 0;
  }
  return state.length;
}

// you can override either this method, or the async _read(n) below.
Readable.prototype.read = function (n) {
  debug('read', n);
  n = parseInt(n, 10);
  var state = this._readableState;
  var nOrig = n;
  if (n !== 0) state.emittedReadable = false;

  // if we're doing read(0) to trigger a readable event, but we
  // already have a bunch of data in the buffer, then just trigger
  // the 'readable' event and move on.
  if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
    debug('read: emitReadable', state.length, state.ended);
    if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
    return null;
  }
  n = howMuchToRead(n, state);

  // if we've ended, and we're now clear, then finish it up.
  if (n === 0 && state.ended) {
    if (state.length === 0) endReadable(this);
    return null;
  }

  // All the actual chunk generation logic needs to be
  // *below* the call to _read.  The reason is that in certain
  // synthetic stream cases, such as passthrough streams, _read
  // may be a completely synchronous operation which may change
  // the state of the read buffer, providing enough data when
  // before there was *not* enough.
  //
  // So, the steps are:
  // 1. Figure out what the state of things will be after we do
  // a read from the buffer.
  //
  // 2. If that resulting state will trigger a _read, then call _read.
  // Note that this may be asynchronous, or synchronous.  Yes, it is
  // deeply ugly to write APIs this way, but that still doesn't mean
  // that the Readable class should behave improperly, as streams are
  // designed to be sync/async agnostic.
  // Take note if the _read call is sync or async (ie, if the read call
  // has returned yet), so that we know whether or not it's safe to emit
  // 'readable' etc.
  //
  // 3. Actually pull the requested chunks out of the buffer and return.

  // if we need a readable event, then we need to do some reading.
  var doRead = state.needReadable;
  debug('need readable', doRead);

  // if we currently have less than the highWaterMark, then also read some
  if (state.length === 0 || state.length - n < state.highWaterMark) {
    doRead = true;
    debug('length less than watermark', doRead);
  }

  // however, if we've ended, then there's no point, and if we're already
  // reading, then it's unnecessary.
  if (state.ended || state.reading) {
    doRead = false;
    debug('reading or ended', doRead);
  } else if (doRead) {
    debug('do read');
    state.reading = true;
    state.sync = true;
    // if the length is currently zero, then we *need* a readable event.
    if (state.length === 0) state.needReadable = true;
    // call internal read method
    this._read(state.highWaterMark);
    state.sync = false;
    // If _read pushed data synchronously, then `reading` will be false,
    // and we need to re-evaluate how much data we can return to the user.
    if (!state.reading) n = howMuchToRead(nOrig, state);
  }
  var ret;
  if (n > 0) ret = fromList(n, state);else ret = null;
  if (ret === null) {
    state.needReadable = state.length <= state.highWaterMark;
    n = 0;
  } else {
    state.length -= n;
    state.awaitDrain = 0;
  }
  if (state.length === 0) {
    // If we have nothing in the buffer, then we want to know
    // as soon as we *do* get something into the buffer.
    if (!state.ended) state.needReadable = true;

    // If we tried to read() past the EOF, then emit end on the next tick.
    if (nOrig !== n && state.ended) endReadable(this);
  }
  if (ret !== null) this.emit('data', ret);
  return ret;
};
function onEofChunk(stream, state) {
  debug('onEofChunk');
  if (state.ended) return;
  if (state.decoder) {
    var chunk = state.decoder.end();
    if (chunk && chunk.length) {
      state.buffer.push(chunk);
      state.length += state.objectMode ? 1 : chunk.length;
    }
  }
  state.ended = true;
  if (state.sync) {
    // if we are sync, wait until next tick to emit the data.
    // Otherwise we risk emitting data in the flow()
    // the readable code triggers during a read() call
    emitReadable(stream);
  } else {
    // emit 'readable' now to make sure it gets picked up.
    state.needReadable = false;
    if (!state.emittedReadable) {
      state.emittedReadable = true;
      emitReadable_(stream);
    }
  }
}

// Don't emit readable right away in sync mode, because this can trigger
// another read() call => stack overflow.  This way, it might trigger
// a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) {
  var state = stream._readableState;
  debug('emitReadable', state.needReadable, state.emittedReadable);
  state.needReadable = false;
  if (!state.emittedReadable) {
    debug('emitReadable', state.flowing);
    state.emittedReadable = true;
    process.nextTick(emitReadable_, stream);
  }
}
function emitReadable_(stream) {
  var state = stream._readableState;
  debug('emitReadable_', state.destroyed, state.length, state.ended);
  if (!state.destroyed && (state.length || state.ended)) {
    stream.emit('readable');
    state.emittedReadable = false;
  }

  // The stream needs another readable event if
  // 1. It is not flowing, as the flow mechanism will take
  //    care of it.
  // 2. It is not ended.
  // 3. It is below the highWaterMark, so we can schedule
  //    another readable later.
  state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
  flow(stream);
}

// at this point, the user has presumably seen the 'readable' event,
// and called read() to consume some data.  that may have triggered
// in turn another _read(n) call, in which case reading = true if
// it's in progress.
// However, if we're not ended, or reading, and the length < hwm,
// then go ahead and try to read some more preemptively.
function maybeReadMore(stream, state) {
  if (!state.readingMore) {
    state.readingMore = true;
    process.nextTick(maybeReadMore_, stream, state);
  }
}
function maybeReadMore_(stream, state) {
  // Attempt to read more data if we should.
  //
  // The conditions for reading more data are (one of):
  // - Not enough data buffered (state.length < state.highWaterMark). The loop
  //   is responsible for filling the buffer with enough data if such data
  //   is available. If highWaterMark is 0 and we are not in the flowing mode
  //   we should _not_ attempt to buffer any extra data. We'll get more data
  //   when the stream consumer calls read() instead.
  // - No data in the buffer, and the stream is in flowing mode. In this mode
  //   the loop below is responsible for ensuring read() is called. Failing to
  //   call read here would abort the flow and there's no other mechanism for
  //   continuing the flow if the stream consumer has just subscribed to the
  //   'data' event.
  //
  // In addition to the above conditions to keep reading data, the following
  // conditions prevent the data from being read:
  // - The stream has ended (state.ended).
  // - There is already a pending 'read' operation (state.reading). This is a
  //   case where the the stream has called the implementation defined _read()
  //   method, but they are processing the call asynchronously and have _not_
  //   called push() with new data. In this case we skip performing more
  //   read()s. The execution ends in this method again after the _read() ends
  //   up calling push() with more data.
  while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
    var len = state.length;
    debug('maybeReadMore read 0');
    stream.read(0);
    if (len === state.length)
      // didn't get any data, stop spinning.
      break;
  }
  state.readingMore = false;
}

// abstract method.  to be overridden in specific implementation classes.
// call cb(er, data) where data is <= n in length.
// for virtual (non-string, non-buffer) streams, "length" is somewhat
// arbitrary, and perhaps not very meaningful.
Readable.prototype._read = function (n) {
  errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED('_read()'));
};
Readable.prototype.pipe = function (dest, pipeOpts) {
  var src = this;
  var state = this._readableState;
  switch (state.pipesCount) {
    case 0:
      state.pipes = dest;
      break;
    case 1:
      state.pipes = [state.pipes, dest];
      break;
    default:
      state.pipes.push(dest);
      break;
  }
  state.pipesCount += 1;
  debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  var endFn = doEnd ? onend : unpipe;
  if (state.endEmitted) process.nextTick(endFn);else src.once('end', endFn);
  dest.on('unpipe', onunpipe);
  function onunpipe(readable, unpipeInfo) {
    debug('onunpipe');
    if (readable === src) {
      if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
        unpipeInfo.hasUnpiped = true;
        cleanup();
      }
    }
  }
  function onend() {
    debug('onend');
    dest.end();
  }

  // when the dest drains, it reduces the awaitDrain counter
  // on the source.  This would be more elegant with a .once()
  // handler in flow(), but adding and removing repeatedly is
  // too slow.
  var ondrain = pipeOnDrain(src);
  dest.on('drain', ondrain);
  var cleanedUp = false;
  function cleanup() {
    debug('cleanup');
    // cleanup event handlers once the pipe is broken
    dest.removeListener('close', onclose);
    dest.removeListener('finish', onfinish);
    dest.removeListener('drain', ondrain);
    dest.removeListener('error', onerror);
    dest.removeListener('unpipe', onunpipe);
    src.removeListener('end', onend);
    src.removeListener('end', unpipe);
    src.removeListener('data', ondata);
    cleanedUp = true;

    // if the reader is waiting for a drain event from this
    // specific writer, then it would cause it to never start
    // flowing again.
    // So, if this is awaiting a drain, then we just call it now.
    // If we don't know, then assume that we are waiting for one.
    if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  }
  src.on('data', ondata);
  function ondata(chunk) {
    debug('ondata');
    var ret = dest.write(chunk);
    debug('dest.write', ret);
    if (ret === false) {
      // If the user unpiped during `dest.write()`, it is possible
      // to get stuck in a permanently paused state if that write
      // also returned false.
      // => Check whether `dest` is still a piping destination.
      if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
        debug('false write response, pause', state.awaitDrain);
        state.awaitDrain++;
      }
      src.pause();
    }
  }

  // if the dest has an error, then stop piping into it.
  // however, don't suppress the throwing behavior for this.
  function onerror(er) {
    debug('onerror', er);
    unpipe();
    dest.removeListener('error', onerror);
    if (EElistenerCount(dest, 'error') === 0) errorOrDestroy(dest, er);
  }

  // Make sure our error handler is attached before userland ones.
  prependListener(dest, 'error', onerror);

  // Both close and finish should trigger unpipe, but only once.
  function onclose() {
    dest.removeListener('finish', onfinish);
    unpipe();
  }
  dest.once('close', onclose);
  function onfinish() {
    debug('onfinish');
    dest.removeListener('close', onclose);
    unpipe();
  }
  dest.once('finish', onfinish);
  function unpipe() {
    debug('unpipe');
    src.unpipe(dest);
  }

  // tell the dest that it's being piped to
  dest.emit('pipe', src);

  // start the flow if it hasn't been started already.
  if (!state.flowing) {
    debug('pipe resume');
    src.resume();
  }
  return dest;
};
function pipeOnDrain(src) {
  return function pipeOnDrainFunctionResult() {
    var state = src._readableState;
    debug('pipeOnDrain', state.awaitDrain);
    if (state.awaitDrain) state.awaitDrain--;
    if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
      state.flowing = true;
      flow(src);
    }
  };
}
Readable.prototype.unpipe = function (dest) {
  var state = this._readableState;
  var unpipeInfo = {
    hasUnpiped: false
  };

  // if we're not piping anywhere, then do nothing.
  if (state.pipesCount === 0) return this;

  // just one destination.  most common case.
  if (state.pipesCount === 1) {
    // passed in one, but it's not the right one.
    if (dest && dest !== state.pipes) return this;
    if (!dest) dest = state.pipes;

    // got a match.
    state.pipes = null;
    state.pipesCount = 0;
    state.flowing = false;
    if (dest) dest.emit('unpipe', this, unpipeInfo);
    return this;
  }

  // slow case. multiple pipe destinations.

  if (!dest) {
    // remove all.
    var dests = state.pipes;
    var len = state.pipesCount;
    state.pipes = null;
    state.pipesCount = 0;
    state.flowing = false;
    for (var i = 0; i < len; i++) dests[i].emit('unpipe', this, {
      hasUnpiped: false
    });
    return this;
  }

  // try to find the right one.
  var index = indexOf(state.pipes, dest);
  if (index === -1) return this;
  state.pipes.splice(index, 1);
  state.pipesCount -= 1;
  if (state.pipesCount === 1) state.pipes = state.pipes[0];
  dest.emit('unpipe', this, unpipeInfo);
  return this;
};

// set up data events if they are asked for
// Ensure readable listeners eventually get something
Readable.prototype.on = function (ev, fn) {
  var res = Stream.prototype.on.call(this, ev, fn);
  var state = this._readableState;
  if (ev === 'data') {
    // update readableListening so that resume() may be a no-op
    // a few lines down. This is needed to support once('readable').
    state.readableListening = this.listenerCount('readable') > 0;

    // Try start flowing on next tick if stream isn't explicitly paused
    if (state.flowing !== false) this.resume();
  } else if (ev === 'readable') {
    if (!state.endEmitted && !state.readableListening) {
      state.readableListening = state.needReadable = true;
      state.flowing = false;
      state.emittedReadable = false;
      debug('on readable', state.length, state.reading);
      if (state.length) {
        emitReadable(this);
      } else if (!state.reading) {
        process.nextTick(nReadingNextTick, this);
      }
    }
  }
  return res;
};
Readable.prototype.addListener = Readable.prototype.on;
Readable.prototype.removeListener = function (ev, fn) {
  var res = Stream.prototype.removeListener.call(this, ev, fn);
  if (ev === 'readable') {
    // We need to check if there is someone still listening to
    // readable and reset the state. However this needs to happen
    // after readable has been emitted but before I/O (nextTick) to
    // support once('readable', fn) cycles. This means that calling
    // resume within the same tick will have no
    // effect.
    process.nextTick(updateReadableListening, this);
  }
  return res;
};
Readable.prototype.removeAllListeners = function (ev) {
  var res = Stream.prototype.removeAllListeners.apply(this, arguments);
  if (ev === 'readable' || ev === undefined) {
    // We need to check if there is someone still listening to
    // readable and reset the state. However this needs to happen
    // after readable has been emitted but before I/O (nextTick) to
    // support once('readable', fn) cycles. This means that calling
    // resume within the same tick will have no
    // effect.
    process.nextTick(updateReadableListening, this);
  }
  return res;
};
function updateReadableListening(self) {
  var state = self._readableState;
  state.readableListening = self.listenerCount('readable') > 0;
  if (state.resumeScheduled && !state.paused) {
    // flowing needs to be set to true now, otherwise
    // the upcoming resume will not flow.
    state.flowing = true;

    // crude way to check if we should resume
  } else if (self.listenerCount('data') > 0) {
    self.resume();
  }
}
function nReadingNextTick(self) {
  debug('readable nexttick read 0');
  self.read(0);
}

// pause() and resume() are remnants of the legacy readable stream API
// If the user uses them, then switch into old mode.
Readable.prototype.resume = function () {
  var state = this._readableState;
  if (!state.flowing) {
    debug('resume');
    // we flow only if there is no one listening
    // for readable, but we still have to call
    // resume()
    state.flowing = !state.readableListening;
    resume(this, state);
  }
  state.paused = false;
  return this;
};
function resume(stream, state) {
  if (!state.resumeScheduled) {
    state.resumeScheduled = true;
    process.nextTick(resume_, stream, state);
  }
}
function resume_(stream, state) {
  debug('resume', state.reading);
  if (!state.reading) {
    stream.read(0);
  }
  state.resumeScheduled = false;
  stream.emit('resume');
  flow(stream);
  if (state.flowing && !state.reading) stream.read(0);
}
Readable.prototype.pause = function () {
  debug('call pause flowing=%j', this._readableState.flowing);
  if (this._readableState.flowing !== false) {
    debug('pause');
    this._readableState.flowing = false;
    this.emit('pause');
  }
  this._readableState.paused = true;
  return this;
};
function flow(stream) {
  var state = stream._readableState;
  debug('flow', state.flowing);
  while (state.flowing && stream.read() !== null);
}

// wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
// It is an ugly unfortunate mess of history.
Readable.prototype.wrap = function (stream) {
  var _this = this;
  var state = this._readableState;
  var paused = false;
  stream.on('end', function () {
    debug('wrapped end');
    if (state.decoder && !state.ended) {
      var chunk = state.decoder.end();
      if (chunk && chunk.length) _this.push(chunk);
    }
    _this.push(null);
  });
  stream.on('data', function (chunk) {
    debug('wrapped data');
    if (state.decoder) chunk = state.decoder.write(chunk);

    // don't skip over falsy values in objectMode
    if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
    var ret = _this.push(chunk);
    if (!ret) {
      paused = true;
      stream.pause();
    }
  });

  // proxy all the other methods.
  // important when wrapping filters and duplexes.
  for (var i in stream) {
    if (this[i] === undefined && typeof stream[i] === 'function') {
      this[i] = function methodWrap(method) {
        return function methodWrapReturnFunction() {
          return stream[method].apply(stream, arguments);
        };
      }(i);
    }
  }

  // proxy certain important events.
  for (var n = 0; n < kProxyEvents.length; n++) {
    stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
  }

  // when we try to consume some more bytes, simply unpause the
  // underlying stream.
  this._read = function (n) {
    debug('wrapped _read', n);
    if (paused) {
      paused = false;
      stream.resume();
    }
  };
  return this;
};
if (typeof Symbol === 'function') {
  Readable.prototype[Symbol.asyncIterator] = function () {
    if (createReadableStreamAsyncIterator === undefined) {
      createReadableStreamAsyncIterator = __webpack_require__(2955);
    }
    return createReadableStreamAsyncIterator(this);
  };
}
Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    return this._readableState.highWaterMark;
  }
});
Object.defineProperty(Readable.prototype, 'readableBuffer', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    return this._readableState && this._readableState.buffer;
  }
});
Object.defineProperty(Readable.prototype, 'readableFlowing', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    return this._readableState.flowing;
  },
  set: function set(state) {
    if (this._readableState) {
      this._readableState.flowing = state;
    }
  }
});

// exposed for testing purposes only.
Readable._fromList = fromList;
Object.defineProperty(Readable.prototype, 'readableLength', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    return this._readableState.length;
  }
});

// Pluck off n bytes from an array of buffers.
// Length is the combined lengths of all the buffers in the list.
// This function is designed to be inlinable, so please take care when making
// changes to the function body.
function fromList(n, state) {
  // nothing buffered
  if (state.length === 0) return null;
  var ret;
  if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
    // read it all, truncate the list
    if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.first();else ret = state.buffer.concat(state.length);
    state.buffer.clear();
  } else {
    // read part of list
    ret = state.buffer.consume(n, state.decoder);
  }
  return ret;
}
function endReadable(stream) {
  var state = stream._readableState;
  debug('endReadable', state.endEmitted);
  if (!state.endEmitted) {
    state.ended = true;
    process.nextTick(endReadableNT, state, stream);
  }
}
function endReadableNT(state, stream) {
  debug('endReadableNT', state.endEmitted, state.length);

  // Check that we didn't get one last unshift.
  if (!state.endEmitted && state.length === 0) {
    state.endEmitted = true;
    stream.readable = false;
    stream.emit('end');
    if (state.autoDestroy) {
      // In case of duplex streams we need a way to detect
      // if the writable side is ready for autoDestroy as well
      var wState = stream._writableState;
      if (!wState || wState.autoDestroy && wState.finished) {
        stream.destroy();
      }
    }
  }
}
if (typeof Symbol === 'function') {
  Readable.from = function (iterable, opts) {
    if (from === undefined) {
      from = __webpack_require__(5157);
    }
    return from(Readable, iterable, opts);
  };
}
function indexOf(xs, x) {
  for (var i = 0, l = xs.length; i < l; i++) {
    if (xs[i] === x) return i;
  }
  return -1;
}

/***/ }),

/***/ 4610:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

// a transform stream is a readable/writable stream where you do
// something with the data.  Sometimes it's called a "filter",
// but that's not a great name for it, since that implies a thing where
// some bits pass through, and others are simply ignored.  (That would
// be a valid example of a transform, of course.)
//
// While the output is causally related to the input, it's not a
// necessarily symmetric or synchronous transformation.  For example,
// a zlib stream might take multiple plain-text writes(), and then
// emit a single compressed chunk some time in the future.
//
// Here's how this works:
//
// The Transform stream has all the aspects of the readable and writable
// stream classes.  When you write(chunk), that calls _write(chunk,cb)
// internally, and returns false if there's a lot of pending writes
// buffered up.  When you call read(), that calls _read(n) until
// there's enough pending readable data buffered up.
//
// In a transform stream, the written data is placed in a buffer.  When
// _read(n) is called, it transforms the queued up data, calling the
// buffered _write cb's as it consumes chunks.  If consuming a single
// written chunk would result in multiple output chunks, then the first
// outputted bit calls the readcb, and subsequent chunks just go into
// the read buffer, and will cause it to emit 'readable' if necessary.
//
// This way, back-pressure is actually determined by the reading side,
// since _read has to be called to start processing a new chunk.  However,
// a pathological inflate type of transform can cause excessive buffering
// here.  For example, imagine a stream where every byte of input is
// interpreted as an integer from 0-255, and then results in that many
// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in
// 1kb of data being output.  In this case, you could write a very small
// amount of input, and end up with a very large amount of output.  In
// such a pathological inflating mechanism, there'd be no way to tell
// the system to stop doing the transform.  A single 4MB write could
// cause the system to run out of memory.
//
// However, even in such a pathological case, only a single written chunk
// would be consumed, and then the rest would wait (un-transformed) until
// the results of the previous transformed chunk were consumed.



module.exports = Transform;
var _require$codes = (__webpack_require__(6048)/* .codes */ .F),
  ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
  ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
  ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING,
  ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
var Duplex = __webpack_require__(5382);
__webpack_require__(6698)(Transform, Duplex);
function afterTransform(er, data) {
  var ts = this._transformState;
  ts.transforming = false;
  var cb = ts.writecb;
  if (cb === null) {
    return this.emit('error', new ERR_MULTIPLE_CALLBACK());
  }
  ts.writechunk = null;
  ts.writecb = null;
  if (data != null)
    // single equals check for both `null` and `undefined`
    this.push(data);
  cb(er);
  var rs = this._readableState;
  rs.reading = false;
  if (rs.needReadable || rs.length < rs.highWaterMark) {
    this._read(rs.highWaterMark);
  }
}
function Transform(options) {
  if (!(this instanceof Transform)) return new Transform(options);
  Duplex.call(this, options);
  this._transformState = {
    afterTransform: afterTransform.bind(this),
    needTransform: false,
    transforming: false,
    writecb: null,
    writechunk: null,
    writeencoding: null
  };

  // start out asking for a readable event once data is transformed.
  this._readableState.needReadable = true;

  // we have implemented the _read method, and done the other things
  // that Readable wants before the first _read call, so unset the
  // sync guard flag.
  this._readableState.sync = false;
  if (options) {
    if (typeof options.transform === 'function') this._transform = options.transform;
    if (typeof options.flush === 'function') this._flush = options.flush;
  }

  // When the writable side finishes, then flush out anything remaining.
  this.on('prefinish', prefinish);
}
function prefinish() {
  var _this = this;
  if (typeof this._flush === 'function' && !this._readableState.destroyed) {
    this._flush(function (er, data) {
      done(_this, er, data);
    });
  } else {
    done(this, null, null);
  }
}
Transform.prototype.push = function (chunk, encoding) {
  this._transformState.needTransform = false;
  return Duplex.prototype.push.call(this, chunk, encoding);
};

// This is the part where you do stuff!
// override this function in implementation classes.
// 'chunk' is an input chunk.
//
// Call `push(newChunk)` to pass along transformed output
// to the readable side.  You may call 'push' zero or more times.
//
// Call `cb(err)` when you are done with this chunk.  If you pass
// an error, then that'll put the hurt on the whole operation.  If you
// never call cb(), then you'll never get another chunk.
Transform.prototype._transform = function (chunk, encoding, cb) {
  cb(new ERR_METHOD_NOT_IMPLEMENTED('_transform()'));
};
Transform.prototype._write = function (chunk, encoding, cb) {
  var ts = this._transformState;
  ts.writecb = cb;
  ts.writechunk = chunk;
  ts.writeencoding = encoding;
  if (!ts.transforming) {
    var rs = this._readableState;
    if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  }
};

// Doesn't matter what the args are here.
// _transform does all the work.
// That we got here means that the readable side wants more data.
Transform.prototype._read = function (n) {
  var ts = this._transformState;
  if (ts.writechunk !== null && !ts.transforming) {
    ts.transforming = true;
    this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  } else {
    // mark that we need a transform, so that any data that comes in
    // will get processed, now that we've asked for it.
    ts.needTransform = true;
  }
};
Transform.prototype._destroy = function (err, cb) {
  Duplex.prototype._destroy.call(this, err, function (err2) {
    cb(err2);
  });
};
function done(stream, er, data) {
  if (er) return stream.emit('error', er);
  if (data != null)
    // single equals check for both `null` and `undefined`
    stream.push(data);

  // TODO(BridgeAR): Write a test for these two error cases
  // if there's nothing in the write buffer, then that means
  // that nothing more will ever be provided
  if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
  if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
  return stream.push(null);
}

/***/ }),

/***/ 6708:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/* provided dependency */ var process = __webpack_require__(5606);
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

// A bit simpler than readable streams.
// Implement an async ._write(chunk, encoding, cb), and it'll handle all
// the drain event emission and buffering.



module.exports = Writable;

/* <replacement> */
function WriteReq(chunk, encoding, cb) {
  this.chunk = chunk;
  this.encoding = encoding;
  this.callback = cb;
  this.next = null;
}

// It seems a linked list but it is not
// there will be only 2 of these for each stream
function CorkedRequest(state) {
  var _this = this;
  this.next = null;
  this.entry = null;
  this.finish = function () {
    onCorkedFinish(_this, state);
  };
}
/* </replacement> */

/*<replacement>*/
var Duplex;
/*</replacement>*/

Writable.WritableState = WritableState;

/*<replacement>*/
var internalUtil = {
  deprecate: __webpack_require__(4643)
};
/*</replacement>*/

/*<replacement>*/
var Stream = __webpack_require__(345);
/*</replacement>*/

var Buffer = (__webpack_require__(8287).Buffer);
var OurUint8Array = (typeof __webpack_require__.g !== 'undefined' ? __webpack_require__.g : typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : {}).Uint8Array || function () {};
function _uint8ArrayToBuffer(chunk) {
  return Buffer.from(chunk);
}
function _isUint8Array(obj) {
  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
}
var destroyImpl = __webpack_require__(5896);
var _require = __webpack_require__(5291),
  getHighWaterMark = _require.getHighWaterMark;
var _require$codes = (__webpack_require__(6048)/* .codes */ .F),
  ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
  ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED,
  ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK,
  ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE,
  ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED,
  ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES,
  ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END,
  ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
var errorOrDestroy = destroyImpl.errorOrDestroy;
__webpack_require__(6698)(Writable, Stream);
function nop() {}
function WritableState(options, stream, isDuplex) {
  Duplex = Duplex || __webpack_require__(5382);
  options = options || {};

  // Duplex streams are both readable and writable, but share
  // the same options object.
  // However, some cases require setting options to different
  // values for the readable and the writable sides of the duplex stream,
  // e.g. options.readableObjectMode vs. options.writableObjectMode, etc.
  if (typeof isDuplex !== 'boolean') isDuplex = stream instanceof Duplex;

  // object stream flag to indicate whether or not this stream
  // contains buffers or objects.
  this.objectMode = !!options.objectMode;
  if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;

  // the point at which write() starts returning false
  // Note: 0 is a valid value, means that we always return false if
  // the entire buffer is not flushed immediately on write()
  this.highWaterMark = getHighWaterMark(this, options, 'writableHighWaterMark', isDuplex);

  // if _final has been called
  this.finalCalled = false;

  // drain event flag.
  this.needDrain = false;
  // at the start of calling end()
  this.ending = false;
  // when end() has been called, and returned
  this.ended = false;
  // when 'finish' is emitted
  this.finished = false;

  // has it been destroyed
  this.destroyed = false;

  // should we decode strings into buffers before passing to _write?
  // this is here so that some node-core streams can optimize string
  // handling at a lower level.
  var noDecode = options.decodeStrings === false;
  this.decodeStrings = !noDecode;

  // Crypto is kind of old and crusty.  Historically, its default string
  // encoding is 'binary' so we have to make this configurable.
  // Everything else in the universe uses 'utf8', though.
  this.defaultEncoding = options.defaultEncoding || 'utf8';

  // not an actual buffer we keep track of, but a measurement
  // of how much we're waiting to get pushed to some underlying
  // socket or file.
  this.length = 0;

  // a flag to see when we're in the middle of a write.
  this.writing = false;

  // when true all writes will be buffered until .uncork() call
  this.corked = 0;

  // a flag to be able to tell if the onwrite cb is called immediately,
  // or on a later tick.  We set this to true at first, because any
  // actions that shouldn't happen until "later" should generally also
  // not happen before the first write call.
  this.sync = true;

  // a flag to know if we're processing previously buffered items, which
  // may call the _write() callback in the same tick, so that we don't
  // end up in an overlapped onwrite situation.
  this.bufferProcessing = false;

  // the callback that's passed to _write(chunk,cb)
  this.onwrite = function (er) {
    onwrite(stream, er);
  };

  // the callback that the user supplies to write(chunk,encoding,cb)
  this.writecb = null;

  // the amount that is being written when _write is called.
  this.writelen = 0;
  this.bufferedRequest = null;
  this.lastBufferedRequest = null;

  // number of pending user-supplied write callbacks
  // this must be 0 before 'finish' can be emitted
  this.pendingcb = 0;

  // emit prefinish if the only thing we're waiting for is _write cbs
  // This is relevant for synchronous Transform streams
  this.prefinished = false;

  // True if the error was already emitted and should not be thrown again
  this.errorEmitted = false;

  // Should close be emitted on destroy. Defaults to true.
  this.emitClose = options.emitClose !== false;

  // Should .destroy() be called after 'finish' (and potentially 'end')
  this.autoDestroy = !!options.autoDestroy;

  // count buffered requests
  this.bufferedRequestCount = 0;

  // allocate the first CorkedRequest, there is always
  // one allocated and free to use, and we maintain at most two
  this.corkedRequestsFree = new CorkedRequest(this);
}
WritableState.prototype.getBuffer = function getBuffer() {
  var current = this.bufferedRequest;
  var out = [];
  while (current) {
    out.push(current);
    current = current.next;
  }
  return out;
};
(function () {
  try {
    Object.defineProperty(WritableState.prototype, 'buffer', {
      get: internalUtil.deprecate(function writableStateBufferGetter() {
        return this.getBuffer();
      }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
    });
  } catch (_) {}
})();

// Test _writableState for inheritance to account for Duplex streams,
// whose prototype chain only points to Readable.
var realHasInstance;
if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  realHasInstance = Function.prototype[Symbol.hasInstance];
  Object.defineProperty(Writable, Symbol.hasInstance, {
    value: function value(object) {
      if (realHasInstance.call(this, object)) return true;
      if (this !== Writable) return false;
      return object && object._writableState instanceof WritableState;
    }
  });
} else {
  realHasInstance = function realHasInstance(object) {
    return object instanceof this;
  };
}
function Writable(options) {
  Duplex = Duplex || __webpack_require__(5382);

  // Writable ctor is applied to Duplexes, too.
  // `realHasInstance` is necessary because using plain `instanceof`
  // would return false, as no `_writableState` property is attached.

  // Trying to use the custom `instanceof` for Writable here will also break the
  // Node.js LazyTransform implementation, which has a non-trivial getter for
  // `_writableState` that would lead to infinite recursion.

  // Checking for a Stream.Duplex instance is faster here instead of inside
  // the WritableState constructor, at least with V8 6.5
  var isDuplex = this instanceof Duplex;
  if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
  this._writableState = new WritableState(options, this, isDuplex);

  // legacy.
  this.writable = true;
  if (options) {
    if (typeof options.write === 'function') this._write = options.write;
    if (typeof options.writev === 'function') this._writev = options.writev;
    if (typeof options.destroy === 'function') this._destroy = options.destroy;
    if (typeof options.final === 'function') this._final = options.final;
  }
  Stream.call(this);
}

// Otherwise people can pipe Writable streams, which is just wrong.
Writable.prototype.pipe = function () {
  errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
};
function writeAfterEnd(stream, cb) {
  var er = new ERR_STREAM_WRITE_AFTER_END();
  // TODO: defer error events consistently everywhere, not just the cb
  errorOrDestroy(stream, er);
  process.nextTick(cb, er);
}

// Checks that a user-supplied chunk is valid, especially for the particular
// mode the stream is in. Currently this means that `null` is never accepted
// and undefined/non-string values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) {
  var er;
  if (chunk === null) {
    er = new ERR_STREAM_NULL_VALUES();
  } else if (typeof chunk !== 'string' && !state.objectMode) {
    er = new ERR_INVALID_ARG_TYPE('chunk', ['string', 'Buffer'], chunk);
  }
  if (er) {
    errorOrDestroy(stream, er);
    process.nextTick(cb, er);
    return false;
  }
  return true;
}
Writable.prototype.write = function (chunk, encoding, cb) {
  var state = this._writableState;
  var ret = false;
  var isBuf = !state.objectMode && _isUint8Array(chunk);
  if (isBuf && !Buffer.isBuffer(chunk)) {
    chunk = _uint8ArrayToBuffer(chunk);
  }
  if (typeof encoding === 'function') {
    cb = encoding;
    encoding = null;
  }
  if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  if (typeof cb !== 'function') cb = nop;
  if (state.ending) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
    state.pendingcb++;
    ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
  }
  return ret;
};
Writable.prototype.cork = function () {
  this._writableState.corked++;
};
Writable.prototype.uncork = function () {
  var state = this._writableState;
  if (state.corked) {
    state.corked--;
    if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  }
};
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  // node::ParseEncoding() requires lower case.
  if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);
  this._writableState.defaultEncoding = encoding;
  return this;
};
Object.defineProperty(Writable.prototype, 'writableBuffer', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    return this._writableState && this._writableState.getBuffer();
  }
});
function decodeChunk(state, chunk, encoding) {
  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
    chunk = Buffer.from(chunk, encoding);
  }
  return chunk;
}
Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    return this._writableState.highWaterMark;
  }
});

// if we're already writing something, then just put this
// in the queue, and wait our turn.  Otherwise, call _write
// If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  if (!isBuf) {
    var newChunk = decodeChunk(state, chunk, encoding);
    if (chunk !== newChunk) {
      isBuf = true;
      encoding = 'buffer';
      chunk = newChunk;
    }
  }
  var len = state.objectMode ? 1 : chunk.length;
  state.length += len;
  var ret = state.length < state.highWaterMark;
  // we must ensure that previous needDrain will not be reset to false.
  if (!ret) state.needDrain = true;
  if (state.writing || state.corked) {
    var last = state.lastBufferedRequest;
    state.lastBufferedRequest = {
      chunk: chunk,
      encoding: encoding,
      isBuf: isBuf,
      callback: cb,
      next: null
    };
    if (last) {
      last.next = state.lastBufferedRequest;
    } else {
      state.bufferedRequest = state.lastBufferedRequest;
    }
    state.bufferedRequestCount += 1;
  } else {
    doWrite(stream, state, false, len, chunk, encoding, cb);
  }
  return ret;
}
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  state.writelen = len;
  state.writecb = cb;
  state.writing = true;
  state.sync = true;
  if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED('write'));else if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  state.sync = false;
}
function onwriteError(stream, state, sync, er, cb) {
  --state.pendingcb;
  if (sync) {
    // defer the callback if we are being called synchronously
    // to avoid piling up things on the stack
    process.nextTick(cb, er);
    // this can emit finish, and it will always happen
    // after error
    process.nextTick(finishMaybe, stream, state);
    stream._writableState.errorEmitted = true;
    errorOrDestroy(stream, er);
  } else {
    // the caller expect this to happen before if
    // it is async
    cb(er);
    stream._writableState.errorEmitted = true;
    errorOrDestroy(stream, er);
    // this can emit finish, but finish must
    // always follow error
    finishMaybe(stream, state);
  }
}
function onwriteStateUpdate(state) {
  state.writing = false;
  state.writecb = null;
  state.length -= state.writelen;
  state.writelen = 0;
}
function onwrite(stream, er) {
  var state = stream._writableState;
  var sync = state.sync;
  var cb = state.writecb;
  if (typeof cb !== 'function') throw new ERR_MULTIPLE_CALLBACK();
  onwriteStateUpdate(state);
  if (er) onwriteError(stream, state, sync, er, cb);else {
    // Check if we're actually ready to finish, but don't emit yet
    var finished = needFinish(state) || stream.destroyed;
    if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
      clearBuffer(stream, state);
    }
    if (sync) {
      process.nextTick(afterWrite, stream, state, finished, cb);
    } else {
      afterWrite(stream, state, finished, cb);
    }
  }
}
function afterWrite(stream, state, finished, cb) {
  if (!finished) onwriteDrain(stream, state);
  state.pendingcb--;
  cb();
  finishMaybe(stream, state);
}

// Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
// value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) {
  if (state.length === 0 && state.needDrain) {
    state.needDrain = false;
    stream.emit('drain');
  }
}

// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
  state.bufferProcessing = true;
  var entry = state.bufferedRequest;
  if (stream._writev && entry && entry.next) {
    // Fast case, write everything using _writev()
    var l = state.bufferedRequestCount;
    var buffer = new Array(l);
    var holder = state.corkedRequestsFree;
    holder.entry = entry;
    var count = 0;
    var allBuffers = true;
    while (entry) {
      buffer[count] = entry;
      if (!entry.isBuf) allBuffers = false;
      entry = entry.next;
      count += 1;
    }
    buffer.allBuffers = allBuffers;
    doWrite(stream, state, true, state.length, buffer, '', holder.finish);

    // doWrite is almost always async, defer these to save a bit of time
    // as the hot path ends with doWrite
    state.pendingcb++;
    state.lastBufferedRequest = null;
    if (holder.next) {
      state.corkedRequestsFree = holder.next;
      holder.next = null;
    } else {
      state.corkedRequestsFree = new CorkedRequest(state);
    }
    state.bufferedRequestCount = 0;
  } else {
    // Slow case, write chunks one-by-one
    while (entry) {
      var chunk = entry.chunk;
      var encoding = entry.encoding;
      var cb = entry.callback;
      var len = state.objectMode ? 1 : chunk.length;
      doWrite(stream, state, false, len, chunk, encoding, cb);
      entry = entry.next;
      state.bufferedRequestCount--;
      // if we didn't call the onwrite immediately, then
      // it means that we need to wait until it does.
      // also, that means that the chunk and cb are currently
      // being processed, so move the buffer counter past them.
      if (state.writing) {
        break;
      }
    }
    if (entry === null) state.lastBufferedRequest = null;
  }
  state.bufferedRequest = entry;
  state.bufferProcessing = false;
}
Writable.prototype._write = function (chunk, encoding, cb) {
  cb(new ERR_METHOD_NOT_IMPLEMENTED('_write()'));
};
Writable.prototype._writev = null;
Writable.prototype.end = function (chunk, encoding, cb) {
  var state = this._writableState;
  if (typeof chunk === 'function') {
    cb = chunk;
    chunk = null;
    encoding = null;
  } else if (typeof encoding === 'function') {
    cb = encoding;
    encoding = null;
  }
  if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);

  // .end() fully uncorks
  if (state.corked) {
    state.corked = 1;
    this.uncork();
  }

  // ignore unnecessary end() calls.
  if (!state.ending) endWritable(this, state, cb);
  return this;
};
Object.defineProperty(Writable.prototype, 'writableLength', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    return this._writableState.length;
  }
});
function needFinish(state) {
  return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
}
function callFinal(stream, state) {
  stream._final(function (err) {
    state.pendingcb--;
    if (err) {
      errorOrDestroy(stream, err);
    }
    state.prefinished = true;
    stream.emit('prefinish');
    finishMaybe(stream, state);
  });
}
function prefinish(stream, state) {
  if (!state.prefinished && !state.finalCalled) {
    if (typeof stream._final === 'function' && !state.destroyed) {
      state.pendingcb++;
      state.finalCalled = true;
      process.nextTick(callFinal, stream, state);
    } else {
      state.prefinished = true;
      stream.emit('prefinish');
    }
  }
}
function finishMaybe(stream, state) {
  var need = needFinish(state);
  if (need) {
    prefinish(stream, state);
    if (state.pendingcb === 0) {
      state.finished = true;
      stream.emit('finish');
      if (state.autoDestroy) {
        // In case of duplex streams we need a way to detect
        // if the readable side is ready for autoDestroy as well
        var rState = stream._readableState;
        if (!rState || rState.autoDestroy && rState.endEmitted) {
          stream.destroy();
        }
      }
    }
  }
  return need;
}
function endWritable(stream, state, cb) {
  state.ending = true;
  finishMaybe(stream, state);
  if (cb) {
    if (state.finished) process.nextTick(cb);else stream.once('finish', cb);
  }
  state.ended = true;
  stream.writable = false;
}
function onCorkedFinish(corkReq, state, err) {
  var entry = corkReq.entry;
  corkReq.entry = null;
  while (entry) {
    var cb = entry.callback;
    state.pendingcb--;
    cb(err);
    entry = entry.next;
  }

  // reuse the free corkReq.
  state.corkedRequestsFree.next = corkReq;
}
Object.defineProperty(Writable.prototype, 'destroyed', {
  // making it explicit this property is not enumerable
  // because otherwise some prototype manipulation in
  // userland will fail
  enumerable: false,
  get: function get() {
    if (this._writableState === undefined) {
      return false;
    }
    return this._writableState.destroyed;
  },
  set: function set(value) {
    // we ignore the value if the stream
    // has not been initialized yet
    if (!this._writableState) {
      return;
    }

    // backward compatibility, the user is explicitly
    // managing destroyed
    this._writableState.destroyed = value;
  }
});
Writable.prototype.destroy = destroyImpl.destroy;
Writable.prototype._undestroy = destroyImpl.undestroy;
Writable.prototype._destroy = function (err, cb) {
  cb(err);
};

/***/ }),

/***/ 2955:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/* provided dependency */ var process = __webpack_require__(5606);


var _Object$setPrototypeO;
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var finished = __webpack_require__(6238);
var kLastResolve = Symbol('lastResolve');
var kLastReject = Symbol('lastReject');
var kError = Symbol('error');
var kEnded = Symbol('ended');
var kLastPromise = Symbol('lastPromise');
var kHandlePromise = Symbol('handlePromise');
var kStream = Symbol('stream');
function createIterResult(value, done) {
  return {
    value: value,
    done: done
  };
}
function readAndResolve(iter) {
  var resolve = iter[kLastResolve];
  if (resolve !== null) {
    var data = iter[kStream].read();
    // we defer if data is null
    // we can be expecting either 'end' or
    // 'error'
    if (data !== null) {
      iter[kLastPromise] = null;
      iter[kLastResolve] = null;
      iter[kLastReject] = null;
      resolve(createIterResult(data, false));
    }
  }
}
function onReadable(iter) {
  // we wait for the next tick, because it might
  // emit an error with process.nextTick
  process.nextTick(readAndResolve, iter);
}
function wrapForNext(lastPromise, iter) {
  return function (resolve, reject) {
    lastPromise.then(function () {
      if (iter[kEnded]) {
        resolve(createIterResult(undefined, true));
        return;
      }
      iter[kHandlePromise](resolve, reject);
    }, reject);
  };
}
var AsyncIteratorPrototype = Object.getPrototypeOf(function () {});
var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
  get stream() {
    return this[kStream];
  },
  next: function next() {
    var _this = this;
    // if we have detected an error in the meanwhile
    // reject straight away
    var error = this[kError];
    if (error !== null) {
      return Promise.reject(error);
    }
    if (this[kEnded]) {
      return Promise.resolve(createIterResult(undefined, true));
    }
    if (this[kStream].destroyed) {
      // We need to defer via nextTick because if .destroy(err) is
      // called, the error will be emitted via nextTick, and
      // we cannot guarantee that there is no error lingering around
      // waiting to be emitted.
      return new Promise(function (resolve, reject) {
        process.nextTick(function () {
          if (_this[kError]) {
            reject(_this[kError]);
          } else {
            resolve(createIterResult(undefined, true));
          }
        });
      });
    }

    // if we have multiple next() calls
    // we will wait for the previous Promise to finish
    // this logic is optimized to support for await loops,
    // where next() is only called once at a time
    var lastPromise = this[kLastPromise];
    var promise;
    if (lastPromise) {
      promise = new Promise(wrapForNext(lastPromise, this));
    } else {
      // fast path needed to support multiple this.push()
      // without triggering the next() queue
      var data = this[kStream].read();
      if (data !== null) {
        return Promise.resolve(createIterResult(data, false));
      }
      promise = new Promise(this[kHandlePromise]);
    }
    this[kLastPromise] = promise;
    return promise;
  }
}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function () {
  return this;
}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
  var _this2 = this;
  // destroy(err, cb) is a private API
  // we can guarantee we have that here, because we control the
  // Readable class this is attached to
  return new Promise(function (resolve, reject) {
    _this2[kStream].destroy(null, function (err) {
      if (err) {
        reject(err);
        return;
      }
      resolve(createIterResult(undefined, true));
    });
  });
}), _Object$setPrototypeO), AsyncIteratorPrototype);
var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(stream) {
  var _Object$create;
  var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
    value: stream,
    writable: true
  }), _defineProperty(_Object$create, kLastResolve, {
    value: null,
    writable: true
  }), _defineProperty(_Object$create, kLastReject, {
    value: null,
    writable: true
  }), _defineProperty(_Object$create, kError, {
    value: null,
    writable: true
  }), _defineProperty(_Object$create, kEnded, {
    value: stream._readableState.endEmitted,
    writable: true
  }), _defineProperty(_Object$create, kHandlePromise, {
    value: function value(resolve, reject) {
      var data = iterator[kStream].read();
      if (data) {
        iterator[kLastPromise] = null;
        iterator[kLastResolve] = null;
        iterator[kLastReject] = null;
        resolve(createIterResult(data, false));
      } else {
        iterator[kLastResolve] = resolve;
        iterator[kLastReject] = reject;
      }
    },
    writable: true
  }), _Object$create));
  iterator[kLastPromise] = null;
  finished(stream, function (err) {
    if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
      var reject = iterator[kLastReject];
      // reject if we are waiting for data in the Promise
      // returned by next() and store the error
      if (reject !== null) {
        iterator[kLastPromise] = null;
        iterator[kLastResolve] = null;
        iterator[kLastReject] = null;
        reject(err);
      }
      iterator[kError] = err;
      return;
    }
    var resolve = iterator[kLastResolve];
    if (resolve !== null) {
      iterator[kLastPromise] = null;
      iterator[kLastResolve] = null;
      iterator[kLastReject] = null;
      resolve(createIterResult(undefined, true));
    }
    iterator[kEnded] = true;
  });
  stream.on('readable', onReadable.bind(null, iterator));
  return iterator;
};
module.exports = createReadableStreamAsyncIterator;

/***/ }),

/***/ 2726:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


function ownKeys(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 _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
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, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var _require = __webpack_require__(8287),
  Buffer = _require.Buffer;
var _require2 = __webpack_require__(5340),
  inspect = _require2.inspect;
var custom = inspect && inspect.custom || 'inspect';
function copyBuffer(src, target, offset) {
  Buffer.prototype.copy.call(src, target, offset);
}
module.exports = /*#__PURE__*/function () {
  function BufferList() {
    _classCallCheck(this, BufferList);
    this.head = null;
    this.tail = null;
    this.length = 0;
  }
  _createClass(BufferList, [{
    key: "push",
    value: function push(v) {
      var entry = {
        data: v,
        next: null
      };
      if (this.length > 0) this.tail.next = entry;else this.head = entry;
      this.tail = entry;
      ++this.length;
    }
  }, {
    key: "unshift",
    value: function unshift(v) {
      var entry = {
        data: v,
        next: this.head
      };
      if (this.length === 0) this.tail = entry;
      this.head = entry;
      ++this.length;
    }
  }, {
    key: "shift",
    value: function shift() {
      if (this.length === 0) return;
      var ret = this.head.data;
      if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
      --this.length;
      return ret;
    }
  }, {
    key: "clear",
    value: function clear() {
      this.head = this.tail = null;
      this.length = 0;
    }
  }, {
    key: "join",
    value: function join(s) {
      if (this.length === 0) return '';
      var p = this.head;
      var ret = '' + p.data;
      while (p = p.next) ret += s + p.data;
      return ret;
    }
  }, {
    key: "concat",
    value: function concat(n) {
      if (this.length === 0) return Buffer.alloc(0);
      var ret = Buffer.allocUnsafe(n >>> 0);
      var p = this.head;
      var i = 0;
      while (p) {
        copyBuffer(p.data, ret, i);
        i += p.data.length;
        p = p.next;
      }
      return ret;
    }

    // Consumes a specified amount of bytes or characters from the buffered data.
  }, {
    key: "consume",
    value: function consume(n, hasStrings) {
      var ret;
      if (n < this.head.data.length) {
        // `slice` is the same for buffers and strings.
        ret = this.head.data.slice(0, n);
        this.head.data = this.head.data.slice(n);
      } else if (n === this.head.data.length) {
        // First chunk is a perfect match.
        ret = this.shift();
      } else {
        // Result spans more than one buffer.
        ret = hasStrings ? this._getString(n) : this._getBuffer(n);
      }
      return ret;
    }
  }, {
    key: "first",
    value: function first() {
      return this.head.data;
    }

    // Consumes a specified amount of characters from the buffered data.
  }, {
    key: "_getString",
    value: function _getString(n) {
      var p = this.head;
      var c = 1;
      var ret = p.data;
      n -= ret.length;
      while (p = p.next) {
        var str = p.data;
        var nb = n > str.length ? str.length : n;
        if (nb === str.length) ret += str;else ret += str.slice(0, n);
        n -= nb;
        if (n === 0) {
          if (nb === str.length) {
            ++c;
            if (p.next) this.head = p.next;else this.head = this.tail = null;
          } else {
            this.head = p;
            p.data = str.slice(nb);
          }
          break;
        }
        ++c;
      }
      this.length -= c;
      return ret;
    }

    // Consumes a specified amount of bytes from the buffered data.
  }, {
    key: "_getBuffer",
    value: function _getBuffer(n) {
      var ret = Buffer.allocUnsafe(n);
      var p = this.head;
      var c = 1;
      p.data.copy(ret);
      n -= p.data.length;
      while (p = p.next) {
        var buf = p.data;
        var nb = n > buf.length ? buf.length : n;
        buf.copy(ret, ret.length - n, 0, nb);
        n -= nb;
        if (n === 0) {
          if (nb === buf.length) {
            ++c;
            if (p.next) this.head = p.next;else this.head = this.tail = null;
          } else {
            this.head = p;
            p.data = buf.slice(nb);
          }
          break;
        }
        ++c;
      }
      this.length -= c;
      return ret;
    }

    // Make sure the linked list only shows the minimal necessary information.
  }, {
    key: custom,
    value: function value(_, options) {
      return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
        // Only inspect one level.
        depth: 0,
        // It should not recurse.
        customInspect: false
      }));
    }
  }]);
  return BufferList;
}();

/***/ }),

/***/ 5896:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
/* provided dependency */ var process = __webpack_require__(5606);


// undocumented cb() API, needed for core, not for public API
function destroy(err, cb) {
  var _this = this;
  var readableDestroyed = this._readableState && this._readableState.destroyed;
  var writableDestroyed = this._writableState && this._writableState.destroyed;
  if (readableDestroyed || writableDestroyed) {
    if (cb) {
      cb(err);
    } else if (err) {
      if (!this._writableState) {
        process.nextTick(emitErrorNT, this, err);
      } else if (!this._writableState.errorEmitted) {
        this._writableState.errorEmitted = true;
        process.nextTick(emitErrorNT, this, err);
      }
    }
    return this;
  }

  // we set destroyed to true before firing error callbacks in order
  // to make it re-entrance safe in case destroy() is called within callbacks

  if (this._readableState) {
    this._readableState.destroyed = true;
  }

  // if this is a duplex stream mark the writable part as destroyed as well
  if (this._writableState) {
    this._writableState.destroyed = true;
  }
  this._destroy(err || null, function (err) {
    if (!cb && err) {
      if (!_this._writableState) {
        process.nextTick(emitErrorAndCloseNT, _this, err);
      } else if (!_this._writableState.errorEmitted) {
        _this._writableState.errorEmitted = true;
        process.nextTick(emitErrorAndCloseNT, _this, err);
      } else {
        process.nextTick(emitCloseNT, _this);
      }
    } else if (cb) {
      process.nextTick(emitCloseNT, _this);
      cb(err);
    } else {
      process.nextTick(emitCloseNT, _this);
    }
  });
  return this;
}
function emitErrorAndCloseNT(self, err) {
  emitErrorNT(self, err);
  emitCloseNT(self);
}
function emitCloseNT(self) {
  if (self._writableState && !self._writableState.emitClose) return;
  if (self._readableState && !self._readableState.emitClose) return;
  self.emit('close');
}
function undestroy() {
  if (this._readableState) {
    this._readableState.destroyed = false;
    this._readableState.reading = false;
    this._readableState.ended = false;
    this._readableState.endEmitted = false;
  }
  if (this._writableState) {
    this._writableState.destroyed = false;
    this._writableState.ended = false;
    this._writableState.ending = false;
    this._writableState.finalCalled = false;
    this._writableState.prefinished = false;
    this._writableState.finished = false;
    this._writableState.errorEmitted = false;
  }
}
function emitErrorNT(self, err) {
  self.emit('error', err);
}
function errorOrDestroy(stream, err) {
  // We have tests that rely on errors being emitted
  // in the same tick, so changing this is semver major.
  // For now when you opt-in to autoDestroy we allow
  // the error to be emitted nextTick. In a future
  // semver major update we should change the default to this.

  var rState = stream._readableState;
  var wState = stream._writableState;
  if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);
}
module.exports = {
  destroy: destroy,
  undestroy: undestroy,
  errorOrDestroy: errorOrDestroy
};

/***/ }),

/***/ 6238:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
// Ported from https://github.com/mafintosh/end-of-stream with
// permission from the author, Mathias Buus (@mafintosh).



var ERR_STREAM_PREMATURE_CLOSE = (__webpack_require__(6048)/* .codes */ .F).ERR_STREAM_PREMATURE_CLOSE;
function once(callback) {
  var called = false;
  return function () {
    if (called) return;
    called = true;
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    callback.apply(this, args);
  };
}
function noop() {}
function isRequest(stream) {
  return stream.setHeader && typeof stream.abort === 'function';
}
function eos(stream, opts, callback) {
  if (typeof opts === 'function') return eos(stream, null, opts);
  if (!opts) opts = {};
  callback = once(callback || noop);
  var readable = opts.readable || opts.readable !== false && stream.readable;
  var writable = opts.writable || opts.writable !== false && stream.writable;
  var onlegacyfinish = function onlegacyfinish() {
    if (!stream.writable) onfinish();
  };
  var writableEnded = stream._writableState && stream._writableState.finished;
  var onfinish = function onfinish() {
    writable = false;
    writableEnded = true;
    if (!readable) callback.call(stream);
  };
  var readableEnded = stream._readableState && stream._readableState.endEmitted;
  var onend = function onend() {
    readable = false;
    readableEnded = true;
    if (!writable) callback.call(stream);
  };
  var onerror = function onerror(err) {
    callback.call(stream, err);
  };
  var onclose = function onclose() {
    var err;
    if (readable && !readableEnded) {
      if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
      return callback.call(stream, err);
    }
    if (writable && !writableEnded) {
      if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
      return callback.call(stream, err);
    }
  };
  var onrequest = function onrequest() {
    stream.req.on('finish', onfinish);
  };
  if (isRequest(stream)) {
    stream.on('complete', onfinish);
    stream.on('abort', onclose);
    if (stream.req) onrequest();else stream.on('request', onrequest);
  } else if (writable && !stream._writableState) {
    // legacy streams
    stream.on('end', onlegacyfinish);
    stream.on('close', onlegacyfinish);
  }
  stream.on('end', onend);
  stream.on('finish', onfinish);
  if (opts.error !== false) stream.on('error', onerror);
  stream.on('close', onclose);
  return function () {
    stream.removeListener('complete', onfinish);
    stream.removeListener('abort', onclose);
    stream.removeListener('request', onrequest);
    if (stream.req) stream.req.removeListener('finish', onfinish);
    stream.removeListener('end', onlegacyfinish);
    stream.removeListener('close', onlegacyfinish);
    stream.removeListener('finish', onfinish);
    stream.removeListener('end', onend);
    stream.removeListener('error', onerror);
    stream.removeListener('close', onclose);
  };
}
module.exports = eos;

/***/ }),

/***/ 5157:
/***/ (function(module) {

module.exports = function () {
  throw new Error('Readable.from is not available in the browser')
};


/***/ }),

/***/ 7758:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
// Ported from https://github.com/mafintosh/pump with
// permission from the author, Mathias Buus (@mafintosh).



var eos;
function once(callback) {
  var called = false;
  return function () {
    if (called) return;
    called = true;
    callback.apply(void 0, arguments);
  };
}
var _require$codes = (__webpack_require__(6048)/* .codes */ .F),
  ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
  ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
function noop(err) {
  // Rethrow the error if it exists to avoid swallowing it
  if (err) throw err;
}
function isRequest(stream) {
  return stream.setHeader && typeof stream.abort === 'function';
}
function destroyer(stream, reading, writing, callback) {
  callback = once(callback);
  var closed = false;
  stream.on('close', function () {
    closed = true;
  });
  if (eos === undefined) eos = __webpack_require__(6238);
  eos(stream, {
    readable: reading,
    writable: writing
  }, function (err) {
    if (err) return callback(err);
    closed = true;
    callback();
  });
  var destroyed = false;
  return function (err) {
    if (closed) return;
    if (destroyed) return;
    destroyed = true;

    // request.destroy just do .end - .abort is what we want
    if (isRequest(stream)) return stream.abort();
    if (typeof stream.destroy === 'function') return stream.destroy();
    callback(err || new ERR_STREAM_DESTROYED('pipe'));
  };
}
function call(fn) {
  fn();
}
function pipe(from, to) {
  return from.pipe(to);
}
function popCallback(streams) {
  if (!streams.length) return noop;
  if (typeof streams[streams.length - 1] !== 'function') return noop;
  return streams.pop();
}
function pipeline() {
  for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) {
    streams[_key] = arguments[_key];
  }
  var callback = popCallback(streams);
  if (Array.isArray(streams[0])) streams = streams[0];
  if (streams.length < 2) {
    throw new ERR_MISSING_ARGS('streams');
  }
  var error;
  var destroys = streams.map(function (stream, i) {
    var reading = i < streams.length - 1;
    var writing = i > 0;
    return destroyer(stream, reading, writing, function (err) {
      if (!error) error = err;
      if (err) destroys.forEach(call);
      if (reading) return;
      destroys.forEach(call);
      callback(error);
    });
  });
  return streams.reduce(pipe);
}
module.exports = pipeline;

/***/ }),

/***/ 5291:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var ERR_INVALID_OPT_VALUE = (__webpack_require__(6048)/* .codes */ .F).ERR_INVALID_OPT_VALUE;
function highWaterMarkFrom(options, isDuplex, duplexKey) {
  return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
}
function getHighWaterMark(state, options, duplexKey, isDuplex) {
  var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
  if (hwm != null) {
    if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
      var name = isDuplex ? duplexKey : 'highWaterMark';
      throw new ERR_INVALID_OPT_VALUE(name, hwm);
    }
    return Math.floor(hwm);
  }

  // Default value
  return state.objectMode ? 16 : 16 * 1024;
}
module.exports = {
  getHighWaterMark: getHighWaterMark
};

/***/ }),

/***/ 345:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

module.exports = __webpack_require__(7007).EventEmitter;


/***/ }),

/***/ 2861:
/***/ (function(module, exports, __webpack_require__) {

/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
/* eslint-disable node/no-deprecated-api */
var buffer = __webpack_require__(8287)
var Buffer = buffer.Buffer

// alternative to using Object.keys for old browsers
function copyProps (src, dst) {
  for (var key in src) {
    dst[key] = src[key]
  }
}
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  module.exports = buffer
} else {
  // Copy properties from require('buffer')
  copyProps(buffer, exports)
  exports.Buffer = SafeBuffer
}

function SafeBuffer (arg, encodingOrOffset, length) {
  return Buffer(arg, encodingOrOffset, length)
}

SafeBuffer.prototype = Object.create(Buffer.prototype)

// Copy static methods from Buffer
copyProps(Buffer, SafeBuffer)

SafeBuffer.from = function (arg, encodingOrOffset, length) {
  if (typeof arg === 'number') {
    throw new TypeError('Argument must not be a number')
  }
  return Buffer(arg, encodingOrOffset, length)
}

SafeBuffer.alloc = function (size, fill, encoding) {
  if (typeof size !== 'number') {
    throw new TypeError('Argument must be a number')
  }
  var buf = Buffer(size)
  if (fill !== undefined) {
    if (typeof encoding === 'string') {
      buf.fill(fill, encoding)
    } else {
      buf.fill(fill)
    }
  } else {
    buf.fill(0)
  }
  return buf
}

SafeBuffer.allocUnsafe = function (size) {
  if (typeof size !== 'number') {
    throw new TypeError('Argument must be a number')
  }
  return Buffer(size)
}

SafeBuffer.allocUnsafeSlow = function (size) {
  if (typeof size !== 'number') {
    throw new TypeError('Argument must be a number')
  }
  return buffer.SlowBuffer(size)
}


/***/ }),

/***/ 7463:
/***/ (function(__unused_webpack_module, exports) {

"use strict";
/**
 * @license React
 * scheduler.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.
 */
function f(a,b){var c=a.length;a.push(b);a:for(;0<c;){var d=c-1>>>1,e=a[d];if(0<g(e,b))a[d]=b,a[c]=e,c=d;else break a}}function h(a){return 0===a.length?null:a[0]}function k(a){if(0===a.length)return null;var b=a[0],c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length,w=e>>>1;d<w;){var m=2*(d+1)-1,C=a[m],n=m+1,x=a[n];if(0>g(C,c))n<e&&0>g(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(n<e&&0>g(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}
function g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D="function"===typeof setTimeout?setTimeout:null,E="function"===typeof clearTimeout?clearTimeout:null,F="undefined"!==typeof setImmediate?setImmediate:null;
"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}
function J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if("function"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;
function M(){return exports.unstable_now()-Q<P?!1:!0}function R(){if(null!==O){var a=exports.unstable_now();Q=a;var b=!0;try{b=O(!0,a)}finally{b?S():(N=!1,O=null)}}else N=!1}var S;if("function"===typeof F)S=function(){F(R)};else if("undefined"!==typeof MessageChannel){var T=new MessageChannel,U=T.port2;T.port1.onmessage=R;S=function(){U.postMessage(null)}}else S=function(){D(R,0)};function I(a){O=a;N||(N=!0,S())}function K(a,b){L=D(function(){a(exports.unstable_now())},b)}
exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){A||z||(A=!0,I(J))};
exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<a?Math.floor(1E3/a):5};exports.unstable_getCurrentPriorityLevel=function(){return y};exports.unstable_getFirstCallbackNode=function(){return h(r)};exports.unstable_next=function(a){switch(y){case 1:case 2:case 3:var b=3;break;default:b=y}var c=y;y=b;try{return a()}finally{y=c}};exports.unstable_pauseExecution=function(){};
exports.unstable_requestPaint=function(){};exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=y;y=a;try{return b()}finally{y=c}};
exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3}e=c+e;a={id:u++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};
exports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};


/***/ }),

/***/ 9982:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


if (true) {
  module.exports = __webpack_require__(7463);
} else {}


/***/ }),

/***/ 2833:
/***/ (function(module) {

//

module.exports = function shallowEqual(objA, objB, compare, compareContext) {
  var ret = compare ? compare.call(compareContext, objA, objB) : void 0;

  if (ret !== void 0) {
    return !!ret;
  }

  if (objA === objB) {
    return true;
  }

  if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
    return false;
  }

  var keysA = Object.keys(objA);
  var keysB = Object.keys(objB);

  if (keysA.length !== keysB.length) {
    return false;
  }

  var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);

  // Test for A's keys different from B.
  for (var idx = 0; idx < keysA.length; idx++) {
    var key = keysA[idx];

    if (!bHasOwnProperty(key)) {
      return false;
    }

    var valueA = objA[key];
    var valueB = objB[key];

    ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;

    if (ret === false || (ret === void 0 && valueA !== valueB)) {
      return false;
    }
  }

  return true;
};


/***/ }),

/***/ 528:
/***/ (function(module) {

"use strict";


module.exports = (string, separator) => {
	if (!(typeof string === 'string' && typeof separator === 'string')) {
		throw new TypeError('Expected the arguments to be of type `string`');
	}

	if (separator === '') {
		return [string];
	}

	const separatorIndex = string.indexOf(separator);

	if (separatorIndex === -1) {
		return [string];
	}

	return [
		string.slice(0, separatorIndex),
		string.slice(separatorIndex + separator.length)
	];
};


/***/ }),

/***/ 8310:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

module.exports = Stream;

var EE = (__webpack_require__(7007).EventEmitter);
var inherits = __webpack_require__(6698);

inherits(Stream, EE);
Stream.Readable = __webpack_require__(5412);
Stream.Writable = __webpack_require__(6708);
Stream.Duplex = __webpack_require__(5382);
Stream.Transform = __webpack_require__(4610);
Stream.PassThrough = __webpack_require__(3600);
Stream.finished = __webpack_require__(6238)
Stream.pipeline = __webpack_require__(7758)

// Backwards-compat with node 0.4.x
Stream.Stream = Stream;



// old-style streams.  Note that the pipe method (the only relevant
// part of this class) is overridden in the Readable class.

function Stream() {
  EE.call(this);
}

Stream.prototype.pipe = function(dest, options) {
  var source = this;

  function ondata(chunk) {
    if (dest.writable) {
      if (false === dest.write(chunk) && source.pause) {
        source.pause();
      }
    }
  }

  source.on('data', ondata);

  function ondrain() {
    if (source.readable && source.resume) {
      source.resume();
    }
  }

  dest.on('drain', ondrain);

  // If the 'end' option is not supplied, dest.end() will be called when
  // source gets the 'end' or 'close' events.  Only dest.end() once.
  if (!dest._isStdio && (!options || options.end !== false)) {
    source.on('end', onend);
    source.on('close', onclose);
  }

  var didOnEnd = false;
  function onend() {
    if (didOnEnd) return;
    didOnEnd = true;

    dest.end();
  }


  function onclose() {
    if (didOnEnd) return;
    didOnEnd = true;

    if (typeof dest.destroy === 'function') dest.destroy();
  }

  // don't leave dangling pipes when there are errors.
  function onerror(er) {
    cleanup();
    if (EE.listenerCount(this, 'error') === 0) {
      throw er; // Unhandled stream error in pipe.
    }
  }

  source.on('error', onerror);
  dest.on('error', onerror);

  // remove all the event listeners that were added.
  function cleanup() {
    source.removeListener('data', ondata);
    dest.removeListener('drain', ondrain);

    source.removeListener('end', onend);
    source.removeListener('close', onclose);

    source.removeListener('error', onerror);
    dest.removeListener('error', onerror);

    source.removeListener('end', cleanup);
    source.removeListener('close', cleanup);

    dest.removeListener('close', cleanup);
  }

  source.on('end', cleanup);
  source.on('close', cleanup);

  dest.on('close', cleanup);

  dest.emit('pipe', source);

  // Allow for unix-like usage: A.pipe(B).pipe(C)
  return dest;
};


/***/ }),

/***/ 4280:
/***/ (function(module) {

"use strict";

module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);


/***/ }),

/***/ 3141:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.



/*<replacement>*/

var Buffer = (__webpack_require__(2861).Buffer);
/*</replacement>*/

var isEncoding = Buffer.isEncoding || function (encoding) {
  encoding = '' + encoding;
  switch (encoding && encoding.toLowerCase()) {
    case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
      return true;
    default:
      return false;
  }
};

function _normalizeEncoding(enc) {
  if (!enc) return 'utf8';
  var retried;
  while (true) {
    switch (enc) {
      case 'utf8':
      case 'utf-8':
        return 'utf8';
      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return 'utf16le';
      case 'latin1':
      case 'binary':
        return 'latin1';
      case 'base64':
      case 'ascii':
      case 'hex':
        return enc;
      default:
        if (retried) return; // undefined
        enc = ('' + enc).toLowerCase();
        retried = true;
    }
  }
};

// Do not cache `Buffer.isEncoding` when checking encoding names as some
// modules monkey-patch it to support additional encodings
function normalizeEncoding(enc) {
  var nenc = _normalizeEncoding(enc);
  if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
  return nenc || enc;
}

// StringDecoder provides an interface for efficiently splitting a series of
// buffers into a series of JS strings without breaking apart multi-byte
// characters.
exports.I = StringDecoder;
function StringDecoder(encoding) {
  this.encoding = normalizeEncoding(encoding);
  var nb;
  switch (this.encoding) {
    case 'utf16le':
      this.text = utf16Text;
      this.end = utf16End;
      nb = 4;
      break;
    case 'utf8':
      this.fillLast = utf8FillLast;
      nb = 4;
      break;
    case 'base64':
      this.text = base64Text;
      this.end = base64End;
      nb = 3;
      break;
    default:
      this.write = simpleWrite;
      this.end = simpleEnd;
      return;
  }
  this.lastNeed = 0;
  this.lastTotal = 0;
  this.lastChar = Buffer.allocUnsafe(nb);
}

StringDecoder.prototype.write = function (buf) {
  if (buf.length === 0) return '';
  var r;
  var i;
  if (this.lastNeed) {
    r = this.fillLast(buf);
    if (r === undefined) return '';
    i = this.lastNeed;
    this.lastNeed = 0;
  } else {
    i = 0;
  }
  if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
  return r || '';
};

StringDecoder.prototype.end = utf8End;

// Returns only complete characters in a Buffer
StringDecoder.prototype.text = utf8Text;

// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
StringDecoder.prototype.fillLast = function (buf) {
  if (this.lastNeed <= buf.length) {
    buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
    return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  }
  buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  this.lastNeed -= buf.length;
};

// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
// continuation byte. If an invalid byte is detected, -2 is returned.
function utf8CheckByte(byte) {
  if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
  return byte >> 6 === 0x02 ? -1 : -2;
}

// Checks at most 3 bytes at the end of a Buffer in order to detect an
// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
// needed to complete the UTF-8 character (if applicable) are returned.
function utf8CheckIncomplete(self, buf, i) {
  var j = buf.length - 1;
  if (j < i) return 0;
  var nb = utf8CheckByte(buf[j]);
  if (nb >= 0) {
    if (nb > 0) self.lastNeed = nb - 1;
    return nb;
  }
  if (--j < i || nb === -2) return 0;
  nb = utf8CheckByte(buf[j]);
  if (nb >= 0) {
    if (nb > 0) self.lastNeed = nb - 2;
    return nb;
  }
  if (--j < i || nb === -2) return 0;
  nb = utf8CheckByte(buf[j]);
  if (nb >= 0) {
    if (nb > 0) {
      if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
    }
    return nb;
  }
  return 0;
}

// Validates as many continuation bytes for a multi-byte UTF-8 character as
// needed or are available. If we see a non-continuation byte where we expect
// one, we "replace" the validated continuation bytes we've seen so far with
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
// behavior. The continuation byte check is included three times in the case
// where all of the continuation bytes for a character exist in the same buffer.
// It is also done this way as a slight performance increase instead of using a
// loop.
function utf8CheckExtraBytes(self, buf, p) {
  if ((buf[0] & 0xC0) !== 0x80) {
    self.lastNeed = 0;
    return '\ufffd';
  }
  if (self.lastNeed > 1 && buf.length > 1) {
    if ((buf[1] & 0xC0) !== 0x80) {
      self.lastNeed = 1;
      return '\ufffd';
    }
    if (self.lastNeed > 2 && buf.length > 2) {
      if ((buf[2] & 0xC0) !== 0x80) {
        self.lastNeed = 2;
        return '\ufffd';
      }
    }
  }
}

// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
function utf8FillLast(buf) {
  var p = this.lastTotal - this.lastNeed;
  var r = utf8CheckExtraBytes(this, buf, p);
  if (r !== undefined) return r;
  if (this.lastNeed <= buf.length) {
    buf.copy(this.lastChar, p, 0, this.lastNeed);
    return this.lastChar.toString(this.encoding, 0, this.lastTotal);
  }
  buf.copy(this.lastChar, p, 0, buf.length);
  this.lastNeed -= buf.length;
}

// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
// partial character, the character's bytes are buffered until the required
// number of bytes are available.
function utf8Text(buf, i) {
  var total = utf8CheckIncomplete(this, buf, i);
  if (!this.lastNeed) return buf.toString('utf8', i);
  this.lastTotal = total;
  var end = buf.length - (total - this.lastNeed);
  buf.copy(this.lastChar, 0, end);
  return buf.toString('utf8', i, end);
}

// For UTF-8, a replacement character is added when ending on a partial
// character.
function utf8End(buf) {
  var r = buf && buf.length ? this.write(buf) : '';
  if (this.lastNeed) return r + '\ufffd';
  return r;
}

// UTF-16LE typically needs two bytes per character, but even if we have an even
// number of bytes available, we need to check if we end on a leading/high
// surrogate. In that case, we need to wait for the next two bytes in order to
// decode the last character properly.
function utf16Text(buf, i) {
  if ((buf.length - i) % 2 === 0) {
    var r = buf.toString('utf16le', i);
    if (r) {
      var c = r.charCodeAt(r.length - 1);
      if (c >= 0xD800 && c <= 0xDBFF) {
        this.lastNeed = 2;
        this.lastTotal = 4;
        this.lastChar[0] = buf[buf.length - 2];
        this.lastChar[1] = buf[buf.length - 1];
        return r.slice(0, -1);
      }
    }
    return r;
  }
  this.lastNeed = 1;
  this.lastTotal = 2;
  this.lastChar[0] = buf[buf.length - 1];
  return buf.toString('utf16le', i, buf.length - 1);
}

// For UTF-16LE we do not explicitly append special replacement characters if we
// end on a partial character, we simply let v8 handle that.
function utf16End(buf) {
  var r = buf && buf.length ? this.write(buf) : '';
  if (this.lastNeed) {
    var end = this.lastTotal - this.lastNeed;
    return r + this.lastChar.toString('utf16le', 0, end);
  }
  return r;
}

function base64Text(buf, i) {
  var n = (buf.length - i) % 3;
  if (n === 0) return buf.toString('base64', i);
  this.lastNeed = 3 - n;
  this.lastTotal = 3;
  if (n === 1) {
    this.lastChar[0] = buf[buf.length - 1];
  } else {
    this.lastChar[0] = buf[buf.length - 2];
    this.lastChar[1] = buf[buf.length - 1];
  }
  return buf.toString('base64', i, buf.length - n);
}

function base64End(buf) {
  var r = buf && buf.length ? this.write(buf) : '';
  if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
  return r;
}

// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
function simpleWrite(buf) {
  return buf.toString(this.encoding);
}

function simpleEnd(buf) {
  return buf && buf.length ? this.write(buf) : '';
}

/***/ }),

/***/ 5072:
/***/ (function(module) {

"use strict";


var stylesInDOM = [];
function getIndexByIdentifier(identifier) {
  var result = -1;
  for (var i = 0; i < stylesInDOM.length; i++) {
    if (stylesInDOM[i].identifier === identifier) {
      result = i;
      break;
    }
  }
  return result;
}
function modulesToDom(list, options) {
  var idCountMap = {};
  var identifiers = [];
  for (var i = 0; i < list.length; i++) {
    var item = list[i];
    var id = options.base ? item[0] + options.base : item[0];
    var count = idCountMap[id] || 0;
    var identifier = "".concat(id, " ").concat(count);
    idCountMap[id] = count + 1;
    var indexByIdentifier = getIndexByIdentifier(identifier);
    var obj = {
      css: item[1],
      media: item[2],
      sourceMap: item[3],
      supports: item[4],
      layer: item[5]
    };
    if (indexByIdentifier !== -1) {
      stylesInDOM[indexByIdentifier].references++;
      stylesInDOM[indexByIdentifier].updater(obj);
    } else {
      var updater = addElementStyle(obj, options);
      options.byIndex = i;
      stylesInDOM.splice(i, 0, {
        identifier: identifier,
        updater: updater,
        references: 1
      });
    }
    identifiers.push(identifier);
  }
  return identifiers;
}
function addElementStyle(obj, options) {
  var api = options.domAPI(options);
  api.update(obj);
  var updater = function updater(newObj) {
    if (newObj) {
      if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
        return;
      }
      api.update(obj = newObj);
    } else {
      api.remove();
    }
  };
  return updater;
}
module.exports = function (list, options) {
  options = options || {};
  list = list || [];
  var lastIdentifiers = modulesToDom(list, options);
  return function update(newList) {
    newList = newList || [];
    for (var i = 0; i < lastIdentifiers.length; i++) {
      var identifier = lastIdentifiers[i];
      var index = getIndexByIdentifier(identifier);
      stylesInDOM[index].references--;
    }
    var newLastIdentifiers = modulesToDom(newList, options);
    for (var _i = 0; _i < lastIdentifiers.length; _i++) {
      var _identifier = lastIdentifiers[_i];
      var _index = getIndexByIdentifier(_identifier);
      if (stylesInDOM[_index].references === 0) {
        stylesInDOM[_index].updater();
        stylesInDOM.splice(_index, 1);
      }
    }
    lastIdentifiers = newLastIdentifiers;
  };
};

/***/ }),

/***/ 7659:
/***/ (function(module) {

"use strict";


var memo = {};

/* istanbul ignore next  */
function getTarget(target) {
  if (typeof memo[target] === "undefined") {
    var styleTarget = document.querySelector(target);

    // Special case to return head of iframe instead of iframe itself
    if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
      try {
        // This will throw an exception if access to iframe is blocked
        // due to cross-origin restrictions
        styleTarget = styleTarget.contentDocument.head;
      } catch (e) {
        // istanbul ignore next
        styleTarget = null;
      }
    }
    memo[target] = styleTarget;
  }
  return memo[target];
}

/* istanbul ignore next  */
function insertBySelector(insert, style) {
  var target = getTarget(insert);
  if (!target) {
    throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  }
  target.appendChild(style);
}
module.exports = insertBySelector;

/***/ }),

/***/ 540:
/***/ (function(module) {

"use strict";


/* istanbul ignore next  */
function insertStyleElement(options) {
  var element = document.createElement("style");
  options.setAttributes(element, options.attributes);
  options.insert(element, options.options);
  return element;
}
module.exports = insertStyleElement;

/***/ }),

/***/ 5056:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


/* istanbul ignore next  */
function setAttributesWithoutAttributes(styleElement) {
  var nonce =  true ? __webpack_require__.nc : 0;
  if (nonce) {
    styleElement.setAttribute("nonce", nonce);
  }
}
module.exports = setAttributesWithoutAttributes;

/***/ }),

/***/ 7825:
/***/ (function(module) {

"use strict";


/* istanbul ignore next  */
function apply(styleElement, options, obj) {
  var css = "";
  if (obj.supports) {
    css += "@supports (".concat(obj.supports, ") {");
  }
  if (obj.media) {
    css += "@media ".concat(obj.media, " {");
  }
  var needLayer = typeof obj.layer !== "undefined";
  if (needLayer) {
    css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  }
  css += obj.css;
  if (needLayer) {
    css += "}";
  }
  if (obj.media) {
    css += "}";
  }
  if (obj.supports) {
    css += "}";
  }
  var sourceMap = obj.sourceMap;
  if (sourceMap && typeof btoa !== "undefined") {
    css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  }

  // For old IE
  /* istanbul ignore if  */
  options.styleTagTransform(css, styleElement, options.options);
}
function removeStyleElement(styleElement) {
  // istanbul ignore if
  if (styleElement.parentNode === null) {
    return false;
  }
  styleElement.parentNode.removeChild(styleElement);
}

/* istanbul ignore next  */
function domAPI(options) {
  if (typeof document === "undefined") {
    return {
      update: function update() {},
      remove: function remove() {}
    };
  }
  var styleElement = options.insertStyleElement(options);
  return {
    update: function update(obj) {
      apply(styleElement, options, obj);
    },
    remove: function remove() {
      removeStyleElement(styleElement);
    }
  };
}
module.exports = domAPI;

/***/ }),

/***/ 1113:
/***/ (function(module) {

"use strict";


/* istanbul ignore next  */
function styleTagTransform(css, styleElement) {
  if (styleElement.styleSheet) {
    styleElement.styleSheet.cssText = css;
  } else {
    while (styleElement.firstChild) {
      styleElement.removeChild(styleElement.firstChild);
    }
    styleElement.appendChild(document.createTextNode(css));
  }
}
module.exports = styleTagTransform;

/***/ }),

/***/ 4643:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {


/**
 * Module exports.
 */

module.exports = deprecate;

/**
 * Mark that a method should not be used.
 * Returns a modified function which warns once by default.
 *
 * If `localStorage.noDeprecation = true` is set, then it is a no-op.
 *
 * If `localStorage.throwDeprecation = true` is set, then deprecated functions
 * will throw an Error when invoked.
 *
 * If `localStorage.traceDeprecation = true` is set, then deprecated functions
 * will invoke `console.trace()` instead of `console.error()`.
 *
 * @param {Function} fn - the function to deprecate
 * @param {String} msg - the string to print to the console when `fn` is invoked
 * @returns {Function} a new "deprecated" version of `fn`
 * @api public
 */

function deprecate (fn, msg) {
  if (config('noDeprecation')) {
    return fn;
  }

  var warned = false;
  function deprecated() {
    if (!warned) {
      if (config('throwDeprecation')) {
        throw new Error(msg);
      } else if (config('traceDeprecation')) {
        console.trace(msg);
      } else {
        console.warn(msg);
      }
      warned = true;
    }
    return fn.apply(this, arguments);
  }

  return deprecated;
}

/**
 * Checks `localStorage` for boolean values for the given `name`.
 *
 * @param {String} name
 * @returns {Boolean}
 * @api private
 */

function config (name) {
  // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  try {
    if (!__webpack_require__.g.localStorage) return false;
  } catch (_) {
    return false;
  }
  var val = __webpack_require__.g.localStorage[name];
  if (null == val) return false;
  return String(val).toLowerCase() === 'true';
}


/***/ }),

/***/ 5860:
/***/ (function() {

/* (ignored) */

/***/ }),

/***/ 5340:
/***/ (function() {

/* (ignored) */

/***/ }),

/***/ 9838:
/***/ (function() {

/* (ignored) */

/***/ }),

/***/ 7374:
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {

"use strict";


var possibleNames = __webpack_require__(6707);

var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis;

/** @type {import('.')} */
module.exports = function availableTypedArrays() {
	var /** @type {ReturnType<typeof availableTypedArrays>} */ out = [];
	for (var i = 0; i < possibleNames.length; i++) {
		if (typeof g[possibleNames[i]] === 'function') {
			// @ts-expect-error
			out[out.length] = possibleNames[i];
		}
	}
	return out;
};


/***/ }),

/***/ 8168:
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ _extends; }
/* harmony export */ });
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);
}

/***/ }),

/***/ 8587:
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   A: function() { return /* binding */ _objectWithoutPropertiesLoose; }
/* harmony export */ });
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;
}

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			id: moduleId,
/******/ 			loaded: false,
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/amd options */
/******/ 	!function() {
/******/ 		__webpack_require__.amdO = {};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/create fake namespace object */
/******/ 	!function() {
/******/ 		var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; };
/******/ 		var leafPrototypes;
/******/ 		// create a fake namespace object
/******/ 		// mode & 1: value is a module id, require it
/******/ 		// mode & 2: merge all properties of value into the ns
/******/ 		// mode & 4: return value when already ns object
/******/ 		// mode & 16: return value when it's Promise-like
/******/ 		// mode & 8|1: behave like require
/******/ 		__webpack_require__.t = function(value, mode) {
/******/ 			if(mode & 1) value = this(value);
/******/ 			if(mode & 8) return value;
/******/ 			if(typeof value === 'object' && value) {
/******/ 				if((mode & 4) && value.__esModule) return value;
/******/ 				if((mode & 16) && typeof value.then === 'function') return value;
/******/ 			}
/******/ 			var ns = Object.create(null);
/******/ 			__webpack_require__.r(ns);
/******/ 			var def = {};
/******/ 			leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
/******/ 			for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
/******/ 				Object.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; });
/******/ 			}
/******/ 			def['default'] = function() { return value; };
/******/ 			__webpack_require__.d(ns, def);
/******/ 			return ns;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	!function() {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/node module decorator */
/******/ 	!function() {
/******/ 		__webpack_require__.nmd = function(module) {
/******/ 			module.paths = [];
/******/ 			if (!module.children) module.children = [];
/******/ 			return module;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/nonce */
/******/ 	!function() {
/******/ 		__webpack_require__.nc = undefined;
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
!function() {
"use strict";

// NAMESPACE OBJECT: ../../modules/ui/code/core/src/ChartView/types.ts
var ChartView_types_namespaceObject = {};
__webpack_require__.r(ChartView_types_namespaceObject);
__webpack_require__.d(ChartView_types_namespaceObject, {
  Chart: function() { return Chart; }
});

// NAMESPACE OBJECT: ../../modules/ui/code/core/node_modules/victory-vendor/es/d3-scale.js
var d3_scale_namespaceObject = {};
__webpack_require__.r(d3_scale_namespaceObject);
__webpack_require__.d(d3_scale_namespaceObject, {
  scaleBand: function() { return band; },
  scaleDiverging: function() { return diverging; },
  scaleDivergingLog: function() { return divergingLog; },
  scaleDivergingPow: function() { return divergingPow; },
  scaleDivergingSqrt: function() { return divergingSqrt; },
  scaleDivergingSymlog: function() { return divergingSymlog; },
  scaleIdentity: function() { return identity_identity; },
  scaleImplicit: function() { return implicit; },
  scaleLinear: function() { return linear_linear; },
  scaleLog: function() { return src_log_log; },
  scaleOrdinal: function() { return ordinal; },
  scalePoint: function() { return band_point; },
  scalePow: function() { return pow; },
  scaleQuantile: function() { return quantile_quantile; },
  scaleQuantize: function() { return quantize; },
  scaleRadial: function() { return radial; },
  scaleSequential: function() { return sequential; },
  scaleSequentialLog: function() { return sequentialLog; },
  scaleSequentialPow: function() { return sequentialPow; },
  scaleSequentialQuantile: function() { return sequentialQuantile; },
  scaleSequentialSqrt: function() { return sequentialSqrt; },
  scaleSequentialSymlog: function() { return sequentialSymlog; },
  scaleSqrt: function() { return sqrt; },
  scaleSymlog: function() { return symlog; },
  scaleThreshold: function() { return threshold; },
  scaleTime: function() { return time; },
  scaleUtc: function() { return utcTime; },
  tickFormat: function() { return tickFormat; }
});

// NAMESPACE OBJECT: ../../modules/ui/code/core/src/ChartView/variants/index.tsx
var variants_namespaceObject = {};
__webpack_require__.r(variants_namespaceObject);
__webpack_require__.d(variants_namespaceObject, {
  BAR: function() { return BAR; },
  BarChart: function() { return variants_BarChart; },
  ChartNameByVariant: function() { return ChartNameByVariant; },
  LINE: function() { return LINE; },
  LineChart: function() { return variants_LineChart; },
  PIE: function() { return PIE; },
  PieChart: function() { return variants_PieChart; },
  colors: function() { return variants_colors; },
  labelPosition: function() { return labelPosition; }
});

// NAMESPACE OBJECT: ../../modules/ui/code/core/src/CartView/types.ts
var CartView_types_namespaceObject = {};
__webpack_require__.r(CartView_types_namespaceObject);
__webpack_require__.d(CartView_types_namespaceObject, {
  CardViewType: function() { return CardViewType; }
});

// NAMESPACE OBJECT: ../../modules/ui/code/core/src/CartView/constants.ts
var CartView_constants_namespaceObject = {};
__webpack_require__.r(CartView_constants_namespaceObject);
__webpack_require__.d(CartView_constants_namespaceObject, {
  CartCurrencyDefault: function() { return CartCurrencyDefault; },
  CartCustomizableProductDefaults: function() { return CartCustomizableProductDefaults; },
  CartDisplayIcon: function() { return constants_CartDisplayIcon; },
  CartQuantityLimits: function() { return CartQuantityLimits; },
  CartRadius: function() { return CartRadius; },
  CartType: function() { return CartType; }
});

// NAMESPACE OBJECT: ../../modules/ui/code/core/src/PollView/types.ts
var PollView_types_namespaceObject = {};
__webpack_require__.r(PollView_types_namespaceObject);
__webpack_require__.d(PollView_types_namespaceObject, {
  PollOptionDefaultProps: function() { return PollOptionDefaultProps; },
  PollOptionPropTypes: function() { return PollOptionPropTypes; },
  PollViewDefaultProps: function() { return PollViewDefaultProps; },
  PollViewPropTypes: function() { return PollViewPropTypes; }
});

// NAMESPACE OBJECT: ../../modules/ui/code/core/src/PollView/styles.tsx
var PollView_styles_namespaceObject = {};
__webpack_require__.r(PollView_styles_namespaceObject);
__webpack_require__.d(PollView_styles_namespaceObject, {
  PollOption: function() { return styles_PollOption; },
  PollOptionContainer: function() { return PollOptionContainer; },
  PollOptionMask: function() { return PollOptionMask; },
  PollOptionText: function() { return PollOptionText; },
  PollOptionVotePercentage: function() { return PollOptionVotePercentage; },
  PollQuestion: function() { return PollQuestion; },
  PollQuestionContainer: function() { return PollQuestionContainer; },
  PollQuestionContainerMask: function() { return PollQuestionContainerMask; },
  PollViewContainer: function() { return PollViewContainer; },
  PollViewContainerMask: function() { return PollViewContainerMask; }
});

// NAMESPACE OBJECT: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/core.js
var core_namespaceObject = {};
__webpack_require__.r(core_namespaceObject);
__webpack_require__.d(core_namespaceObject, {
  addTrackers: function() { return addTrackers; },
  "default": function() { return core; },
  event: function() { return core_event; },
  exception: function() { return exception; },
  ga: function() { return ga; },
  initialize: function() { return initialize; },
  modalview: function() { return modalview; },
  outboundLink: function() { return outboundLink; },
  pageview: function() { return pageview; },
  plugin: function() { return core_plugin; },
  send: function() { return send; },
  set: function() { return set; },
  testModeAPI: function() { return core_testModeAPI; },
  timing: function() { return timing; }
});

// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(6540);
// EXTERNAL MODULE: ./node_modules/react-dom/client.js
var client = __webpack_require__(5338);
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
function typeof_typeof(obj) {
  "@babel/helpers - typeof";

  return typeof_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_typeof(obj);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
function defineProperty_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;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  try {
    var info = gen[key](arg);
    var value = info.value;
  } catch (error) {
    reject(error);
    return;
  }

  if (info.done) {
    resolve(value);
  } else {
    Promise.resolve(value).then(_next, _throw);
  }
}

function asyncToGenerator_asyncToGenerator(fn) {
  return function () {
    var self = this,
        args = arguments;
    return new Promise(function (resolve, reject) {
      var gen = fn.apply(self, args);

      function _next(value) {
        asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
      }

      function _throw(err) {
        asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
      }

      _next(undefined);
    });
  };
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
function _arrayWithHoles(arr) {
  if (Array.isArray(arr)) return arr;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
function _iterableToArrayLimit(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;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
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;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js

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);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js




function slicedToArray_slicedToArray(arr, i) {
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
;// CONCATENATED MODULE: ./node_modules/nanoid/index.browser.js
// This file replaces `index.js` in bundlers like webpack or Rollup,
// according to `browser` config in `package.json`.



let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))

let customRandom = (alphabet, defaultSize, getRandom) => {
  // First, a bitmask is necessary to generate the ID. The bitmask makes bytes
  // values closer to the alphabet size. The bitmask calculates the closest
  // `2^31 - 1` number, which exceeds the alphabet size.
  // For example, the bitmask for the alphabet size 30 is 31 (00011111).
  // `Math.clz32` is not used, because it is not available in browsers.
  let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1
  // Though, the bitmask solution is not perfect since the bytes exceeding
  // the alphabet size are refused. Therefore, to reliably generate the ID,
  // the random bytes redundancy has to be satisfied.

  // Note: every hardware random generator call is performance expensive,
  // because the system call for entropy collection takes a lot of time.
  // So, to avoid additional system calls, extra bytes are requested in advance.

  // Next, a step determines how many random bytes to generate.
  // The number of random bytes gets decided upon the ID size, mask,
  // alphabet size, and magic number 1.6 (using 1.6 peaks at performance
  // according to benchmarks).

  // `-~f => Math.ceil(f)` if f is a float
  // `-~i => i + 1` if i is an integer
  let step = -~((1.6 * mask * defaultSize) / alphabet.length)

  return (size = defaultSize) => {
    let id = ''
    while (true) {
      let bytes = getRandom(step)
      // A compact alternative for `for (var i = 0; i < step; i++)`.
      let j = step | 0
      while (j--) {
        // Adding `|| ''` refuses a random byte that exceeds the alphabet size.
        id += alphabet[bytes[j] & mask] || ''
        if (id.length === size) return id
      }
    }
  }
}

let customAlphabet = (alphabet, size = 21) =>
  customRandom(alphabet, size, random)

let nanoid = (size = 21) =>
  crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
    // It is incorrect to use bytes exceeding the alphabet size.
    // The following mask reduces the random byte in the 0-255 value
    // range to the 0-63 value range. Therefore, adding hacks, such
    // as empty string fallback or magic numbers, is unneccessary because
    // the bitmask trims bytes down to the alphabet size.
    byte &= 63
    if (byte < 36) {
      // `0-9a-z`
      id += byte.toString(36)
    } else if (byte < 62) {
      // `A-Z`
      id += (byte - 26).toString(36).toUpperCase()
    } else if (byte > 62) {
      id += '-'
    } else {
      id += '_'
    }
    return id
  }, '')



;// CONCATENATED MODULE: ../../modules/types/src/core/enums/playerTypes.ts
var PlayerBackgroundTypes = /*#__PURE__*/function (PlayerBackgroundTypes) {
  PlayerBackgroundTypes["COLOR"] = "color";
  PlayerBackgroundTypes["IMAGE"] = "image";
  PlayerBackgroundTypes["PATTERN"] = "pattern";
  return PlayerBackgroundTypes;
}({});
var PlayerLayoutTypes = /*#__PURE__*/function (PlayerLayoutTypes) {
  PlayerLayoutTypes["SINGLE"] = "singlePage";
  PlayerLayoutTypes["DOUBLE"] = "doublePage";
  PlayerLayoutTypes["SMART"] = "smartView";
  return PlayerLayoutTypes;
}({});
var playerTypes_PlayerEffect = /*#__PURE__*/function (PlayerEffect) {
  PlayerEffect["SLIDE"] = "slide";
  PlayerEffect["SCROLL"] = "scroll";
  PlayerEffect["FLIP"] = "flip";
  return PlayerEffect;
}({});
var SkinTypes = /*#__PURE__*/function (SkinTypes) {
  SkinTypes["CLASSIC"] = "classic";
  SkinTypes["MODERN"] = "default";
  SkinTypes["WIDGET_MODERN"] = "player";
  return SkinTypes;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/core/constants/flipbook.ts

var FlipbookStatus = {
  EDITABLE: 'EDITABLE',
  PUBLISHED: 'PUBLISHED',
  TEMPORARY: 'TEMPORARY',
  DRAFT: 'DRAFT',
  DELETED: 'DELETED',
  LAYOUT: 'LAYOUT',
  SCANNING: 'SCANNING',
  INFECTED: 'INFECTED'
};
var FlipbookVisibility = {
  PUBLIC: 'PUBLIC',
  UNLISTED: 'UNLISTED',
  PRIVATE: 'PRIVATE',
  SECONDARY_PRIVATE: 'SECONDARY_PRIVATE',
  // General category for PrivateFlipbookVisiblity, used only for verification
  PRIVATE_EMAIL: 'PRIVATE_EMAIL',
  PRIVATE_SSO: 'PRIVATE_SSO',
  PRIVATE_OTP: 'PRIVATE_OTP',
  SHARED: 'SHARED',
  SHARED_TEAM: 'SHARED_TEAM',
  LOCKED: 'LOCKED',
  MY_READERS: 'READERS',
  INACTIVE: 'INACTIVE'
};
var PublicFlipbookVisibility = [FlipbookVisibility.PUBLIC, FlipbookVisibility.UNLISTED, FlipbookVisibility.PRIVATE // This is actually the visibility for password locked, which is considered public
];
var PrivateFlipbookVisibility = [FlipbookVisibility.PRIVATE_EMAIL, FlipbookVisibility.PRIVATE_SSO, FlipbookVisibility.PRIVATE_OTP, FlipbookVisibility.SHARED_TEAM];
var FlipbookType = {
  FLIPBOOK: 'flipbook',
  SHELF: 'shelf',
  TEMPLATE: 'template',
  SHELF_OLD: 'shelf_old',
  BOOKSHELF: 'bookshelf'
};
var FlipbookReviewStatus = {
  REVIEW: 'REVIEW',
  ACTIVATED: 'ACTIVATED',
  DELETED: 'DELETED',
  BLOCKED: 'BLOCKED'
};
var NewFlipbookVisibilityLabel = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, FlipbookVisibility.PUBLIC, 'Public'), FlipbookVisibility.UNLISTED, 'Unlisted'), FlipbookVisibility.PRIVATE, 'Password locked'), FlipbookVisibility.PRIVATE_EMAIL, 'Invite by email'), FlipbookVisibility.SHARED_TEAM, 'Readers only'), FlipbookVisibility.PRIVATE_SSO, 'SSO'), FlipbookVisibility.PRIVATE_OTP, 'OTP');
var FlipbookFlags = {
  HAS_BEEN_RENAMED: 1,
  WATERMARK: 2,
  TRACK_READERS_INDIVIDUALLY: 4,
  // MERGE_PDFS_AUTOMATICALLY_SET: 8, - NOT USED AND CLEARED IN DEVELOPMENT AND PRODUCTION (SET TO 0)
  PREMIUM: 16,
  WMODE: 32,
  SELL: 64,
  // - DEPRECATED - sell functionality removed from Flipsnack, BUT STILL USED IN GraphAPI
  HAS_DOWNLOAD: 128,
  UPLOAD: 256,
  PUBLIC: 512,
  IS_BEING_DUPLICATED: 1024,
  HAS_BEEN_REDESCRIBED: 2048,
  HIDE_SHARE_BUTTONS: 4096,
  HIDE_COMMENTS: 8192,
  HIDE_MORE: 16384,
  HIDE_PUBLISH_DATE: 32768,
  // MIGRATING: 65536, - NOT USED AND CLEARED IN DEVELOPMENT AND PRODUCTION (SET TO 0)
  ENABLE_SEARCH: 131072,
  LINK_INTRO_SHOWN: 262144,
  JSON_MONO_ITEM: 524288,
  STRUCTURE_CHANGE: 1048576,
  // DOWNLOADED: 2097152, - NOT USED AND CLEARED IN DEVELOPMENT AND PRODUCTION (SET TO 0)
  STATS_READY: 4194304,
  HIDE_ON_PROFILE: 8388608,
  HAS_ZIP: 16777216,
  HAS_ZIP_ARCHIVE: 33554432,
  ORIENTATION_LANDSCAPE: 67108864,
  // LAYOUT_COLLECTION: 134217728, - NOT USED AND CLEARED IN DEVELOPMENT AND PRODUCTION (SET TO 0)
  WITH_JSON: 268435456,
  NEW_EDITOR: 536870912,
  HAS_PDF: 1073741824
};
var FlipbookFilters = {
  ALL: {
    name: 'All flipbooks',
    url: 'all'
  },
  PUBLISHED: {
    name: 'Published',
    url: 'published'
  },
  NOT_PUBLISHED: {
    name: 'Not published',
    url: 'not-published'
  },
  DRAFTS: {
    name: 'Drafts',
    url: 'drafts'
  },
  SHELVES: {
    name: 'Shelves',
    url: 'shelves'
  }
};
var FlipbookMouseEvents = {
  ONCLICK: 'onClick',
  ONMOUSEUP: 'onMouseUp',
  ONMOUSEDOWN: 'onMouseDown',
  ONCONTEXTMENU: 'onContextMenu',
  ONDOUBLECLICK: 'onDoubleClick'
};
var FlipbookTouchEvents = {
  ONTOUCHSTART: 'onTouchStart',
  ONTOUCHMOVE: 'onTouchMove',
  ONTOUCHEND: 'onTouchEnd'
};
var FlipbookReviewMessage = 'This flipbook is under review, as it may violate our terms of service.';
var FlipbookMovingMessage = 'Moving flipbook to another workspace, this may take a while ...';
var FlipbookBlockedMessage = 'Blocked due to copyright claims. Please contact us at legal@flipsnack.com.';
var SPREAD_PAGE_TOLERANCE = 5; // %

var PageLockType = {
  ADD_ELEMENTS: 'addElements',
  REMOVE_ELEMENTS: 'removeElements',
  REORDER_ELEMENTS: 'reorderElements',
  PREVENT_UNLOCK_PAGE: 'preventUnlock'
};
var defaultPageLock = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, PageLockType.ADD_ELEMENTS, false), PageLockType.REMOVE_ELEMENTS, false), PageLockType.REORDER_ELEMENTS, false), PageLockType.PREVENT_UNLOCK_PAGE, false);
var ItemResourceBucket = {
  DEFAULT: 'default',
  CONTENT: 'content'
};
var s3PageSize = {
  THUMB: 'thumb',
  SMALL: 'small',
  MEDIUM: 'medium',
  ORIGINAL: 'original'
};
var FlipbookLogoLocation = {
  COLLECTION: 'collection'
};
var TemplateTypes = {
  TEAM_TEMPLATES: 'team',
  ORGANIZATION_TEMPLATES: 'organization'
};
var FlipbookTrackingType = {
  READER: 'reader',
  SSO: 'sso',
  OTP: 'otp',
  LINK: 'link',
  BOOKSHELF: 'bookshelf'
};
var FlipbookSearchType = /*#__PURE__*/function (FlipbookSearchType) {
  FlipbookSearchType["FLIPBOOKS"] = "flipbooks";
  FlipbookSearchType["TEMPLATES"] = "templates";
  return FlipbookSearchType;
}({});
var SearchHistoryKey = {
  FLIPBOOK: 'flipbookSearchHistory',
  TEMPLATE: 'templateSearchHistory'
};
var FlipbookQuality = /*#__PURE__*/function (FlipbookQuality) {
  FlipbookQuality["STANDARD"] = "STANDARD";
  FlipbookQuality["HIGH"] = "HIGH";
  return FlipbookQuality;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/core/constants/flipbookJson/defaultJsonValues.ts

function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function defaultJsonValues_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }



var defaultOptions = {
  content: {
    effect: playerTypes_PlayerEffect.FLIP,
    layout: PlayerLayoutTypes.SMART,
    hardCover: false,
    rtl: false,
    shadows: true,
    sounds: false,
    skinType: SkinTypes.MODERN,
    widgetLayout: PlayerLayoutTypes.SMART,
    colors: {
      primary: '#0362FC'
    },
    isMobilePreview: false
  },
  background: {
    color: '#ffffff',
    opacity: 1,
    scale: 'scaleCrop',
    type: PlayerBackgroundTypes.COLOR,
    src: ''
  },
  backgroundAudio: {
    enabled: false,
    label: '',
    src: '',
    loop: false,
    autoplay: false
  },
  controls: {
    autoNavigationDelay: 0,
    download: false,
    print: false,
    language: 'English',
    search: false,
    toc: true,
    share: true,
    showControls: true,
    slider: true,
    navigationArrows: true,
    fullScreen: true,
    highlights: true,
    pagesOverview: true,
    animatedInteractions: true,
    isTocAlwaysVisible: false
  }
};
var defaultPage = {
  id: 1,
  type: 'custom',
  source: {
    hash: '',
    page: 0
  },
  width: 10,
  height: 10,
  hash: '',
  version: '1',
  elements: [],
  bgColor: '',
  products: [],
  notes: {
    note: '',
    date: ''
  },
  guidelines: [],
  comments: {},
  extractedText: '',
  showCover: true,
  lock: defaultPageLock,
  newPage: false
};
var defaultFeatures = {
  FLIP_PAGES: 15,
  FLIP_FILES: 3,
  WIDGET_NO_WATERMARK: false,
  WIDGET_RTL_ORIENTATION: false,
  WIDGET_SINGLE_PAGE_VIEW: false,
  WIDGET_SEARCH: false,
  CUSTOM_FONTS: false,
  WIDGET_SHELF: false,
  WIDGET_LOGO: false,
  WIDGET_PASSWORD: false,
  WIDGET_ANALYTICS: false,
  WIDGET_GTM: false,
  WIDGET_PRINT: false,
  WIDGET_MEDIA: false,
  WIDGET_TAGS: false,
  WIDGET_FORMS: false,
  WIDGET_SHOPPING: false,
  WIDGET_DOMAIN_RESTRICTIONS: false,
  DOWNLOAD_PDF: false,
  LAYOUTS: false,
  TABLE_OF_CONTENT: false,
  LINKS_FROM_TEXT: false,
  EMBED: false,
  UPLOAD_VIDEO: false,
  PRODUCT_TAG: false,
  POPUP_FRAME: false,
  CHARTS: false,
  SLIDESHOW: false,
  ADD_TO_CART: false,
  PHOTO_SLIDESHOW: false,
  SPOTLIGHT: false,
  AUDIO_BACKGROUND: false,
  CONTACT_FORM: false,
  QUESTION: false,
  QUIZ: false,
  CUSTOM_PLAYER_COLORS: false,
  ADD_TO_CART_ATTRIBUTES: false,
  POLL: false,
  BETA_TESTING: false,
  SHELF_CUSTOM_BACKGROUND: false,
  ZAPIER_INTEGRATION: false,
  INTERNAL_TESTING: false,
  MANDATORY_ACTIONS: false,
  PAGE_TRANSITION_SCROLL: false
};
var defaultJsonValues_WidgetLayoutTypes = {
  SINGLE: 'singlePage',
  DOUBLE: 'doublePage',
  SMART: 'smartView'
};
var defaultProperties = {
  hash: '',
  status: '',
  title: '',
  author: '',
  visibility: '',
  type: 'flipbook',
  width: 0,
  height: 0,
  idCounter: 0,
  link: {
    domain: '',
    profile: '',
    document: '',
    accountId: '',
    sirAccountId: ''
  },
  sell: {
    enabled: false,
    price: '',
    previewPages: [],
    subscriptionPrice: '',
    subscriptionFlipbooks: '',
    activeSubscription: false
  },
  security: {
    password: '',
    encryptionVersion: 0
  },
  version: {
    schema: 0,
    revision: 0
  },
  resources: {
    text: []
  },
  editor: {
    contentLayout: defaultJsonValues_WidgetLayoutTypes.SINGLE,
    autoCreateLinks: false,
    colors: [],
    fonts: []
  },
  tracking: {
    id: '',
    ipAnonymization: false
  },
  gtmId: '',
  accessibility: {
    enable: false,
    pages: {}
  },
  dateLastUpdate: 0
};
var defaultToc = [];
var defaultLeadForm = {
  header: 'Fill out this form to keep reading',
  placeholder: 'Enter your email here',
  label: 'Submit',
  pageIndex: 0,
  active: false,
  formVersion: 1,
  limit: 'all',
  fields: [{
    id: nanoid(6),
    fieldName: 'Email address',
    validation: 'email',
    required: true,
    noOfRows: 1,
    userInput: '',
    valid: true,
    children: []
  }],
  privacyPolicyActive: false,
  privacyPolicyCompany: '',
  privacyPolicyWebsite: '',
  gdprActive: false,
  gdprMessage: 'I agree to receive marketing materials.'
};
var sellSettings = {
  enabled: false,
  previewPages: []
};
var rootPrimitives = {
  exportName: '',
  downloadMode: false
};
var defaultNewJson = defaultJsonValues_objectSpread({
  properties: defaultProperties,
  features: defaultFeatures,
  options: defaultOptions,
  pages: {
    data: defineProperty_defineProperty({}, defaultPage.id, defaultPage),
    order: [defaultPage.id]
  },
  toc: defaultToc,
  leadForm: null,
  cart: {},
  draftModels: {
    flipbook: {
      name: '',
      description: '',
      width: 0,
      height: 0
    },
    sellerEmail: ''
  }
}, rootPrimitives);
var defaultContactForm = {
  formName: 'Untitled form',
  description: '',
  tooltip: '',
  buttonLabel: 'Submit form',
  thankYouMessage: 'Your response has been submitted.',
  gdprCompliance: {
    active: false,
    message: 'I agree to receive marketing materials.'
  },
  privacyPolicy: {
    active: false,
    companyName: 'Flipsnack',
    policyLink: 'https://legal.flipsnack.com/privacy-policy'
  },
  customerContactFields: [{
    id: 1,
    fieldName: 'Email address',
    validation: 'email',
    required: true,
    noOfRows: 1,
    userInput: '',
    valid: false
  }]
};
var defaultQuiz = {
  formDescription: '',
  startButtonLabel: 'Start quiz',
  mandatory: false,
  allowRetake: false,
  multipleQuestionsPerPage: true,
  // The default is true because for old quizzes there was no other option.
  splitThankYouMessage: false,
  showCorrectAnswer: false,
  question: {
    type: 'radio'
  }
};
;// CONCATENATED MODULE: ../../modules/types/src/core/constants/defaultShelfJson.ts

var DEFAULT_SHELF_BACKGROUND_COLOR = '#ffffff';
var DEFAULT_SHELF_COLOR = '#d1d1d1'; // Plank
var DEFAULT_SHELF_ITEM_WIDTH = 89;
var MIN_SHELF_ITEM_WIDTH = 75;
var MAX_SHELF_ITEM_WIDTH = 300;
var DEFAULT_SHELF_BACKGROUND_TYPE = 'color';
var DEFAULT_SHELF_BACKGROUND_SCALE = 'scaleCrop';
var DefaultShelfJson = {
  properties: {
    title: 'New shelf',
    description: '',
    link: {
      name: '',
      profile: '',
      domain: ''
    },
    type: FlipbookType.BOOKSHELF,
    status: FlipbookStatus.PUBLISHED,
    visibility: FlipbookVisibility.PUBLIC,
    resourceVersion: 1
  },
  options: {
    background: {
      color: DEFAULT_SHELF_BACKGROUND_COLOR,
      opacity: 1
    },
    shelfColor: DEFAULT_SHELF_COLOR,
    width: 640,
    height: 385,
    language: 'English',
    itemsWidth: DEFAULT_SHELF_ITEM_WIDTH,
    restrictedDomainsSettings: {
      useRestrictedDomains: false,
      restrictedDomains: []
    },
    openInNewTab: false
  },
  collection: []
};
;// CONCATENATED MODULE: ../../modules/types/src/core/constants/flipbookVersion.ts
var JSON_VERSION_1 = 1;
var JSON_VERSION_2 = 2;
var JSON_VERSION_3 = 3;
var JSON_REVISION_1 = 1;
// Used for uploaded files in content bucket
var JSON_REVISION_2 = 2;

// Latest version = 3.0
var JSON_VERSION_LATEST = (/* unused pure expression or super */ null && (JSON_VERSION_3));
var JSON_REVISION_LATEST = (/* unused pure expression or super */ null && (JSON_REVISION_2));

// Latest version = 3.0
var flipbookVersion_JsonVersions = {
  1.1: parseFloat("".concat(JSON_VERSION_1, ".").concat(JSON_REVISION_1)),
  // Old json version
  3: JSON_VERSION_3,
  3.1: parseFloat("".concat(JSON_VERSION_3, ".").concat(JSON_REVISION_1)),
  // Have the correct size in properties
  3.2: parseFloat("".concat(JSON_VERSION_3, ".").concat(JSON_REVISION_2)) // Have resources in content bucket
};
;// CONCATENATED MODULE: ../../modules/types/src/core/constants/images.ts

var FIT = 'fit';
var FILL = 'fill';
var PRESERVE_ASPECT_RATIO_MODES = {
  MEET: 'meet',
  SLICE: 'slice'
};
var OBJECT_FIT_VALUES = {
  CONTAIN: 'contain',
  COVER: 'cover'
};
var OBJECT_FIT = defineProperty_defineProperty(defineProperty_defineProperty({}, FIT, OBJECT_FIT_VALUES.CONTAIN), FILL, OBJECT_FIT_VALUES.COVER);
;// CONCATENATED MODULE: ../../modules/types/src/core/enums/flipbookElements.ts

var _FlipbookActionLabel;
var flipbookElements_FlipbookElementType = /*#__PURE__*/function (FlipbookElementType) {
  FlipbookElementType[FlipbookElementType["OUTLINE"] = 0] = "OUTLINE";
  FlipbookElementType[FlipbookElementType["CART"] = 1] = "CART";
  FlipbookElementType[FlipbookElementType["CREDIT_CARD"] = 2] = "CREDIT_CARD";
  FlipbookElementType[FlipbookElementType["CART_WITH_LABEL"] = 4] = "CART_WITH_LABEL";
  FlipbookElementType[FlipbookElementType["CREDIT_CARD_WITH_LABEL"] = 5] = "CREDIT_CARD_WITH_LABEL";
  FlipbookElementType[FlipbookElementType["FACEBOOK"] = 7] = "FACEBOOK";
  FlipbookElementType[FlipbookElementType["TWITTER"] = 8] = "TWITTER";
  FlipbookElementType[FlipbookElementType["LINKEDIN"] = 9] = "LINKEDIN";
  FlipbookElementType[FlipbookElementType["YOUTUBE"] = 10] = "YOUTUBE";
  FlipbookElementType[FlipbookElementType["FLICKR"] = 11] = "FLICKR";
  FlipbookElementType[FlipbookElementType["GOOGLE"] = 12] = "GOOGLE";
  FlipbookElementType[FlipbookElementType["PINTEREST"] = 13] = "PINTEREST";
  FlipbookElementType[FlipbookElementType["SOUNDCLOUD"] = 14] = "SOUNDCLOUD";
  FlipbookElementType[FlipbookElementType["VIMEO"] = 15] = "VIMEO";
  FlipbookElementType[FlipbookElementType["PREVIOUS_PAGE"] = 18] = "PREVIOUS_PAGE";
  FlipbookElementType[FlipbookElementType["NEXT_PAGE"] = 19] = "NEXT_PAGE";
  FlipbookElementType[FlipbookElementType["FIRST_PAGE"] = 20] = "FIRST_PAGE";
  FlipbookElementType[FlipbookElementType["LAST_PAGE"] = 21] = "LAST_PAGE";
  FlipbookElementType[FlipbookElementType["PAGE"] = 22] = "PAGE";
  FlipbookElementType[FlipbookElementType["LINK_ELEMENT"] = 26] = "LINK_ELEMENT";
  FlipbookElementType[FlipbookElementType["TEXT"] = 28] = "TEXT";
  FlipbookElementType[FlipbookElementType["CAPTION"] = 29] = "CAPTION";
  FlipbookElementType[FlipbookElementType["VIDEO"] = 30] = "VIDEO";
  FlipbookElementType[FlipbookElementType["AUDIO"] = 31] = "AUDIO";
  FlipbookElementType[FlipbookElementType["BLOCK_FORM"] = 35] = "BLOCK_FORM";
  FlipbookElementType[FlipbookElementType["IMAGE"] = 37] = "IMAGE";
  FlipbookElementType[FlipbookElementType["VIDEO_WIDGET"] = 46] = "VIDEO_WIDGET";
  FlipbookElementType[FlipbookElementType["TAG"] = 48] = "TAG";
  FlipbookElementType[FlipbookElementType["INSTAGRAM"] = 49] = "INSTAGRAM";
  FlipbookElementType[FlipbookElementType["SHAPE_ELEMENT"] = 50] = "SHAPE_ELEMENT";
  FlipbookElementType[FlipbookElementType["IMAGE_MASK"] = 51] = "IMAGE_MASK";
  FlipbookElementType[FlipbookElementType["FORM"] = 52] = "FORM";
  FlipbookElementType[FlipbookElementType["TEXT_BOX"] = 53] = "TEXT_BOX";
  // new text element,
  FlipbookElementType[FlipbookElementType["PRODUCT_TAG"] = 54] = "PRODUCT_TAG";
  FlipbookElementType[FlipbookElementType["BEHANCE"] = 55] = "BEHANCE";
  FlipbookElementType[FlipbookElementType["SPOTIFY"] = 56] = "SPOTIFY";
  FlipbookElementType[FlipbookElementType["CART_ITEM_WITH_LABEL"] = 57] = "CART_ITEM_WITH_LABEL";
  FlipbookElementType[FlipbookElementType["CREDIT_CARD_ITEM_WITH_LABEL"] = 58] = "CREDIT_CARD_ITEM_WITH_LABEL";
  FlipbookElementType[FlipbookElementType["MESSENGER"] = 59] = "MESSENGER";
  FlipbookElementType[FlipbookElementType["SNAPCHAT"] = 60] = "SNAPCHAT";
  FlipbookElementType[FlipbookElementType["REDDIT"] = 61] = "REDDIT";
  FlipbookElementType[FlipbookElementType["TIKTOK"] = 62] = "TIKTOK";
  FlipbookElementType[FlipbookElementType["TABLE"] = 63] = "TABLE";
  FlipbookElementType[FlipbookElementType["SPOTLIGHT"] = 64] = "SPOTLIGHT";
  FlipbookElementType[FlipbookElementType["POPUP_FRAME"] = 65] = "POPUP_FRAME";
  FlipbookElementType[FlipbookElementType["CONVERT_TEXT"] = 66] = "CONVERT_TEXT";
  FlipbookElementType[FlipbookElementType["SLIDESHOW"] = 67] = "SLIDESHOW";
  FlipbookElementType[FlipbookElementType["CHART_LINE"] = 68] = "CHART_LINE";
  FlipbookElementType[FlipbookElementType["CHART_BAR"] = 69] = "CHART_BAR";
  FlipbookElementType[FlipbookElementType["CHART_PIE"] = 70] = "CHART_PIE";
  FlipbookElementType[FlipbookElementType["ADD_CART"] = 71] = "ADD_CART";
  FlipbookElementType[FlipbookElementType["CART_HYPERLINK"] = 72] = "CART_HYPERLINK";
  FlipbookElementType[FlipbookElementType["POLL"] = 74] = "POLL";
  FlipbookElementType[FlipbookElementType["QUIZ"] = 75] = "QUIZ";
  FlipbookElementType[FlipbookElementType["QUESTION"] = 76] = "QUESTION";
  FlipbookElementType[FlipbookElementType["WHATSAPP"] = 78] = "WHATSAPP";
  FlipbookElementType[FlipbookElementType["GROUP"] = 100] = "GROUP";
  FlipbookElementType[FlipbookElementType["EMBED"] = 101] = "EMBED";
  return FlipbookElementType;
}({});
var flipbookElements_FlipbookElementActionType = /*#__PURE__*/function (FlipbookElementActionType) {
  FlipbookElementActionType[FlipbookElementActionType["GO_TO_URL"] = 0] = "GO_TO_URL";
  FlipbookElementActionType[FlipbookElementActionType["GO_TO_PREV_PAGE"] = 1] = "GO_TO_PREV_PAGE";
  FlipbookElementActionType[FlipbookElementActionType["GO_TO_NEXT_PAGE"] = 2] = "GO_TO_NEXT_PAGE";
  FlipbookElementActionType[FlipbookElementActionType["GO_TO_FIRST_PAGE"] = 3] = "GO_TO_FIRST_PAGE";
  FlipbookElementActionType[FlipbookElementActionType["GO_TO_LAST_PAGE"] = 4] = "GO_TO_LAST_PAGE";
  FlipbookElementActionType[FlipbookElementActionType["GO_TO_PAGE"] = 5] = "GO_TO_PAGE";
  FlipbookElementActionType[FlipbookElementActionType["DOWNLOAD_PDF"] = 6] = "DOWNLOAD_PDF";
  FlipbookElementActionType[FlipbookElementActionType["GO_TO_FLIPSNACK_PROFILE"] = 7] = "GO_TO_FLIPSNACK_PROFILE";
  FlipbookElementActionType[FlipbookElementActionType["SEND_EMAIL"] = 8] = "SEND_EMAIL";
  FlipbookElementActionType[FlipbookElementActionType["TEXT"] = 9] = "TEXT";
  FlipbookElementActionType[FlipbookElementActionType["VIDEO"] = 10] = "VIDEO";
  FlipbookElementActionType[FlipbookElementActionType["AUDIO"] = 11] = "AUDIO";
  FlipbookElementActionType[FlipbookElementActionType["CAPTION"] = 12] = "CAPTION";
  FlipbookElementActionType[FlipbookElementActionType["PAYPAL"] = 13] = "PAYPAL";
  FlipbookElementActionType[FlipbookElementActionType["BLOCK"] = 14] = "BLOCK";
  FlipbookElementActionType[FlipbookElementActionType["SHAPE"] = 15] = "SHAPE";
  FlipbookElementActionType[FlipbookElementActionType["IMAGE"] = 16] = "IMAGE";
  FlipbookElementActionType[FlipbookElementActionType["LIST"] = 17] = "LIST";
  FlipbookElementActionType[FlipbookElementActionType["EVALUATION_SUM"] = 18] = "EVALUATION_SUM";
  FlipbookElementActionType[FlipbookElementActionType["EVALUATION_COMPONENT"] = 19] = "EVALUATION_COMPONENT";
  FlipbookElementActionType[FlipbookElementActionType["COMMENT"] = 20] = "COMMENT";
  FlipbookElementActionType[FlipbookElementActionType["OUTLINE"] = 21] = "OUTLINE";
  FlipbookElementActionType[FlipbookElementActionType["IMPORT"] = 22] = "IMPORT";
  FlipbookElementActionType[FlipbookElementActionType["VIDEO_WIDGET"] = 23] = "VIDEO_WIDGET";
  FlipbookElementActionType[FlipbookElementActionType["TAG"] = 24] = "TAG";
  FlipbookElementActionType[FlipbookElementActionType["SHAPE_ELEMENT"] = 25] = "SHAPE_ELEMENT";
  FlipbookElementActionType[FlipbookElementActionType["IMAGE_MASK"] = 26] = "IMAGE_MASK";
  FlipbookElementActionType[FlipbookElementActionType["FORM"] = 27] = "FORM";
  FlipbookElementActionType[FlipbookElementActionType["TEXT_BOX"] = 28] = "TEXT_BOX";
  // new text element
  FlipbookElementActionType[FlipbookElementActionType["PRODUCT_TAG"] = 29] = "PRODUCT_TAG";
  FlipbookElementActionType[FlipbookElementActionType["SPOTLIGHT"] = 30] = "SPOTLIGHT";
  FlipbookElementActionType[FlipbookElementActionType["POPUP_FRAME"] = 31] = "POPUP_FRAME";
  FlipbookElementActionType[FlipbookElementActionType["CHARTS_LINE"] = 32] = "CHARTS_LINE";
  FlipbookElementActionType[FlipbookElementActionType["CHARTS_BAR"] = 33] = "CHARTS_BAR";
  FlipbookElementActionType[FlipbookElementActionType["CHARTS_PIE"] = 34] = "CHARTS_PIE";
  FlipbookElementActionType[FlipbookElementActionType["ADD_CART"] = 35] = "ADD_CART";
  FlipbookElementActionType[FlipbookElementActionType["CART_HYPERLINK"] = 36] = "CART_HYPERLINK";
  FlipbookElementActionType[FlipbookElementActionType["PHOTO_SLIDESHOW"] = 37] = "PHOTO_SLIDESHOW";
  FlipbookElementActionType[FlipbookElementActionType["POLL"] = 38] = "POLL";
  FlipbookElementActionType[FlipbookElementActionType["QUIZ"] = 39] = "QUIZ";
  FlipbookElementActionType[FlipbookElementActionType["PHONE_NUMBER"] = 40] = "PHONE_NUMBER";
  FlipbookElementActionType[FlipbookElementActionType["QUESTION"] = 41] = "QUESTION";
  FlipbookElementActionType[FlipbookElementActionType["CONTACT_FORM"] = 42] = "CONTACT_FORM";
  FlipbookElementActionType[FlipbookElementActionType["GROUP"] = 100] = "GROUP";
  FlipbookElementActionType[FlipbookElementActionType["EMBED"] = 101] = "EMBED";
  FlipbookElementActionType[FlipbookElementActionType["TABLE"] = 102] = "TABLE";
  FlipbookElementActionType[FlipbookElementActionType["SLIDESHOW"] = 103] = "SLIDESHOW";
  FlipbookElementActionType[FlipbookElementActionType["OPEN_OVERLAY"] = 45] = "OPEN_OVERLAY";
  return FlipbookElementActionType;
}({});
var FlipbookActionLabel = (_FlipbookActionLabel = {}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_FlipbookActionLabel, flipbookElements_FlipbookElementActionType.GO_TO_URL, 'Go to URL'), flipbookElements_FlipbookElementActionType.SEND_EMAIL, 'Send email'), flipbookElements_FlipbookElementActionType.GO_TO_FLIPSNACK_PROFILE, 'Go to profile'), flipbookElements_FlipbookElementActionType.SPOTLIGHT, 'Spotlight'), flipbookElements_FlipbookElementActionType.GO_TO_PAGE, 'Go to page'), flipbookElements_FlipbookElementActionType.GO_TO_PREV_PAGE, 'Go to previous page'), flipbookElements_FlipbookElementActionType.GO_TO_NEXT_PAGE, 'Go to next page'), flipbookElements_FlipbookElementActionType.GO_TO_FIRST_PAGE, 'Go to first page'), flipbookElements_FlipbookElementActionType.GO_TO_LAST_PAGE, 'Go to last page'), flipbookElements_FlipbookElementActionType.AUDIO, 'Audio'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_FlipbookActionLabel, flipbookElements_FlipbookElementActionType.IMAGE, 'Image'), flipbookElements_FlipbookElementActionType.IMAGE_MASK, 'Image mask'), flipbookElements_FlipbookElementActionType.CAPTION, 'Caption'), flipbookElements_FlipbookElementActionType.SHAPE, 'Shape'), flipbookElements_FlipbookElementActionType.SHAPE_ELEMENT, 'Shape'), flipbookElements_FlipbookElementActionType.DOWNLOAD_PDF, 'Download PDF'), flipbookElements_FlipbookElementActionType.VIDEO, 'Video'), flipbookElements_FlipbookElementActionType.VIDEO_WIDGET, 'Video widget'), flipbookElements_FlipbookElementActionType.TABLE, 'Table'), flipbookElements_FlipbookElementActionType.TEXT_BOX, 'Text'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_FlipbookActionLabel, flipbookElements_FlipbookElementActionType.TAG, 'Tag'), flipbookElements_FlipbookElementActionType.PRODUCT_TAG, 'Product tag'), flipbookElements_FlipbookElementActionType.POPUP_FRAME, 'Popup frame'), flipbookElements_FlipbookElementActionType.ADD_CART, 'Shopping button'), flipbookElements_FlipbookElementActionType.CART_HYPERLINK, 'Shopping area'), flipbookElements_FlipbookElementActionType.CHARTS_LINE, 'Line chart'), flipbookElements_FlipbookElementActionType.CHARTS_BAR, 'Bar chart'), flipbookElements_FlipbookElementActionType.CHARTS_PIE, 'Pie chart'), flipbookElements_FlipbookElementActionType.PHOTO_SLIDESHOW, 'Photo slideshow'), flipbookElements_FlipbookElementActionType.QUIZ, 'Quiz'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_FlipbookActionLabel, flipbookElements_FlipbookElementActionType.PHONE_NUMBER, 'Phone number'), flipbookElements_FlipbookElementActionType.CONTACT_FORM, 'Contact form'), flipbookElements_FlipbookElementActionType.OPEN_OVERLAY, 'Open an overlay'));
var ElementShape = /*#__PURE__*/function (ElementShape) {
  ElementShape["BLOCK"] = "block";
  ElementShape["ROUNDED"] = "rounded";
  return ElementShape;
}({});
var ElementTextPosition = /*#__PURE__*/function (ElementTextPosition) {
  ElementTextPosition["TOP"] = "top";
  ElementTextPosition["RIGHT"] = "right";
  ElementTextPosition["BOTTOM"] = "bottom";
  ElementTextPosition["LEFT"] = "left";
  return ElementTextPosition;
}({});
var ElementSource = /*#__PURE__*/function (ElementSource) {
  ElementSource["USER"] = "user";
  ElementSource["ADMIN"] = "admin";
  return ElementSource;
}(ElementSource || {});
var ElementFontWeight = /*#__PURE__*/function (ElementFontWeight) {
  ElementFontWeight["INHERIT"] = "inherit";
  return ElementFontWeight;
}({});
var CartVariant = /*#__PURE__*/function (CartVariant) {
  CartVariant["MODAL"] = "modal";
  CartVariant["BUTTON"] = "button";
  return CartVariant;
}({});
var CartDisplayIcon = /*#__PURE__*/function (CartDisplayIcon) {
  CartDisplayIcon["AREA"] = "area";
  CartDisplayIcon["BUTTON"] = "button";
  return CartDisplayIcon;
}({});
var flipbookElements_ResourceLocation = /*#__PURE__*/function (ResourceLocation) {
  ResourceLocation["PUBLIC"] = "public";
  ResourceLocation["WORKSPACE"] = "workspace";
  return ResourceLocation;
}({});
var CartPricingMethod = /*#__PURE__*/function (CartPricingMethod) {
  CartPricingMethod["FLAT_FEE"] = "flatFee";
  CartPricingMethod["PER_CHARACTER"] = "perCharacter";
  return CartPricingMethod;
}({});
var GradientTypes = /*#__PURE__*/function (GradientTypes) {
  GradientTypes["LINEAR"] = "linear";
  GradientTypes["RADIAL"] = "radial";
  return GradientTypes;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/core/enums/flipbook.ts
var CollectionAction = /*#__PURE__*/function (CollectionAction) {
  CollectionAction["MOVE_TO_WORKSPACE"] = "MOVE_TO_WORKSPACE";
  CollectionAction["DUPLICATE"] = "DUPLICATE";
  CollectionAction["PUBLISH"] = "PUBLISH";
  return CollectionAction;
}({});
var CollectionActionStatus = /*#__PURE__*/function (CollectionActionStatus) {
  CollectionActionStatus["IN_PROGRESS"] = "IN_PROGRESS";
  CollectionActionStatus["COMPLETE"] = "COMPLETE";
  CollectionActionStatus["FAILED"] = "FAILED";
  return CollectionActionStatus;
}({});
var DraftLocation = /*#__PURE__*/function (DraftLocation) {
  DraftLocation["DOCUMENT_DB"] = "documentDb";
  DraftLocation["S3"] = "s3";
  return DraftLocation;
}({});
var NavigationMode = /*#__PURE__*/function (NavigationMode) {
  NavigationMode["SLIDE"] = "slide";
  NavigationMode["FLIP"] = "flip";
  NavigationMode["SCROLL"] = "scroll";
  return NavigationMode;
}({});
var FlipbookAccessType = /*#__PURE__*/function (FlipbookAccessType) {
  FlipbookAccessType["EMAIL"] = "email";
  FlipbookAccessType["READERS"] = "readers";
  FlipbookAccessType["SSO"] = "sso";
  FlipbookAccessType["GROUP"] = "group";
  FlipbookAccessType["PASSWORD_PROTECTED"] = "password_protected";
  FlipbookAccessType["WORKSPACE"] = "workspace";
  FlipbookAccessType["OTP"] = "otp";
  return FlipbookAccessType;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/core/enums/privateResource.ts

var _PrivateResourcePath;
var privateResource_ResourceType = /*#__PURE__*/function (ResourceType) {
  ResourceType["FONT"] = "font";
  ResourceType["WORKSPACE_FONT"] = "workspaceFont";
  ResourceType["IMAGE"] = "image";
  ResourceType["WORKSPACE_IMAGE"] = "workspaceImage";
  ResourceType["LEGACY_IMAGE"] = "legacyImage";
  ResourceType["WORKSPACE_LEGACY_IMAGE"] = "workspaceLegacyImage";
  ResourceType["LEGACY_VIDEO"] = "legacyVideo";
  ResourceType["WORKSPACE_LEGACY_VIDEO"] = "workspaceLegacyVideo";
  ResourceType["VIDEO"] = "video";
  ResourceType["WORKSPACE_VIDEO"] = "workspaceVideo";
  ResourceType["LOGO"] = "logo";
  ResourceType["WORKSPACE_LOGO"] = "workspaceLogo";
  return ResourceType;
}({});
var privateResource_PublicResourcePath = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, privateResource_ResourceType.LEGACY_IMAGE, 'collections/uploads'), privateResource_ResourceType.WORKSPACE_LEGACY_IMAGE, 'collections/uploads'), privateResource_ResourceType.LEGACY_VIDEO, 'collections/uploads'), privateResource_ResourceType.WORKSPACE_LEGACY_VIDEO, 'collections/uploads');
var privateResource_PrivateResourcePath = (_PrivateResourcePath = {}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_PrivateResourcePath, privateResource_ResourceType.FONT, 'library/fonts'), privateResource_ResourceType.WORKSPACE_FONT, 'library/fonts'), privateResource_ResourceType.IMAGE, 'library/images'), privateResource_ResourceType.LEGACY_IMAGE, 'library/images'), privateResource_ResourceType.WORKSPACE_IMAGE, 'library/images'), privateResource_ResourceType.WORKSPACE_LEGACY_IMAGE, 'library/images'), privateResource_ResourceType.VIDEO, 'library/videos'), privateResource_ResourceType.LEGACY_VIDEO, 'library/videos'), privateResource_ResourceType.WORKSPACE_VIDEO, 'library/videos'), privateResource_ResourceType.WORKSPACE_LEGACY_VIDEO, 'library/videos'), defineProperty_defineProperty(defineProperty_defineProperty(_PrivateResourcePath, privateResource_ResourceType.LOGO, 'library/images'), privateResource_ResourceType.WORKSPACE_LOGO, 'library/images'));
;// CONCATENATED MODULE: ../../modules/types/src/core/enums/userSso.ts
var SsoTypeEnum = /*#__PURE__*/function (SsoTypeEnum) {
  SsoTypeEnum["OAUTH"] = "oauth";
  SsoTypeEnum["OPEN_ID"] = "openid";
  SsoTypeEnum["SAML"] = "saml";
  return SsoTypeEnum;
}({});
var SSOConnectionVersion = /*#__PURE__*/function (SSOConnectionVersion) {
  SSOConnectionVersion[SSOConnectionVersion["VERSION_1"] = 1] = "VERSION_1";
  SSOConnectionVersion[SSOConnectionVersion["VERSION_2"] = 2] = "VERSION_2";
  return SSOConnectionVersion;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/core/enums/hubspot.ts
var hubspotProperties = /*#__PURE__*/function (hubspotProperties) {
  hubspotProperties["HOW_USE_FLIPSNACK"] = "sign_up_how_use_flipsnack";
  hubspotProperties["SCHOOL_ROLE"] = "sign_up_school_role";
  hubspotProperties["NUM_EMPLOYEES"] = "numemployees";
  hubspotProperties["USE_CASE"] = "sign_up_use_case";
  hubspotProperties["USE_CASE_OTHER"] = "sign_up_use_case_other";
  hubspotProperties["LIFECYCLESTAGE"] = "lifecyclestage";
  return hubspotProperties;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/core/enums/userLibrary.ts
var UserLibraryFileTypes = /*#__PURE__*/function (UserLibraryFileTypes) {
  UserLibraryFileTypes["LIBRARY"] = "library";
  UserLibraryFileTypes["IMAGE"] = "image";
  UserLibraryFileTypes["LOGO"] = "logo";
  UserLibraryFileTypes["BACKGROUND"] = "background";
  UserLibraryFileTypes["AUDIO_BACKGROUND"] = "audioBackground";
  UserLibraryFileTypes["MP3"] = "mp3";
  UserLibraryFileTypes["VIDEO"] = "video";
  UserLibraryFileTypes["SVG"] = "svg";
  UserLibraryFileTypes["FONT"] = "font";
  UserLibraryFileTypes["AUTOMATOR_CSV"] = "automatorCsv";
  UserLibraryFileTypes["CUSTOM_LOGO"] = "customLogo";
  UserLibraryFileTypes["FAVICON"] = "favicon";
  UserLibraryFileTypes["FLIPBOOK_ITEM"] = "flipbookItem";
  return UserLibraryFileTypes;
}({});
// EXTERNAL MODULE: ../../modules/types/src/core/types/flipbookElements/BaseElementType.ts
var BaseElementType = __webpack_require__(1819);
// EXTERNAL MODULE: ../../modules/types/src/core/types/flipbookElements/QuestionElementType.ts
var QuestionElementType = __webpack_require__(3764);
// EXTERNAL MODULE: ../../modules/types/src/core/types/flipbookElements/QuizElementType.ts
var QuizElementType = __webpack_require__(3259);
;// CONCATENATED MODULE: ../../modules/types/src/core/types/automation/products.ts
var PRODUCT_CSV_TYPE = /*#__PURE__*/function (PRODUCT_CSV_TYPE) {
  PRODUCT_CSV_TYPE["DATA_SET"] = "DATA_SET";
  PRODUCT_CSV_TYPE["PRODUCT_LIST"] = "PRODUCT_LIST";
  return PRODUCT_CSV_TYPE;
}({});
var FILE_TYPES = /*#__PURE__*/function (FILE_TYPES) {
  FILE_TYPES["CSV"] = "csv";
  FILE_TYPES["XML"] = "xml";
  FILE_TYPES["JSON"] = "json";
  return FILE_TYPES;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/core/types/flipbookJson/fontsType.ts
// TODO Clean this file from unused types

var fontsType_FontSource = /*#__PURE__*/function (FontSource) {
  FontSource["USER"] = "user";
  FontSource["ADMIN"] = "admin";
  return FontSource;
}({});
// EXTERNAL MODULE: ../../modules/types/src/core/types/flipbookJson/playerTypes.ts
var playerTypes = __webpack_require__(697);
;// CONCATENATED MODULE: ../../modules/types/src/core/types/flipbook/visibility.ts
var VisibilityEnum = /*#__PURE__*/function (VisibilityEnum) {
  VisibilityEnum["PUBLIC"] = "PUBLIC";
  VisibilityEnum["UNLISTED"] = "UNLISTED";
  VisibilityEnum["PRIVATE"] = "PRIVATE";
  VisibilityEnum["SHARED"] = "SHARED";
  VisibilityEnum["PRIVATE_EMAIL"] = "PRIVATE_EMAIL";
  VisibilityEnum["SHARED_TEAM"] = "SHARED_TEAM";
  VisibilityEnum["PRIVATE_SSO"] = "PRIVATE_SSO";
  return VisibilityEnum;
}({});
// EXTERNAL MODULE: ../../modules/types/src/core/types/cart/CartProduct.ts
var CartProduct = __webpack_require__(9716);
;// CONCATENATED MODULE: ../../modules/types/src/general/constants/tabIndex.ts
var TabIndex = {
  UNREACHABLE: -1,
  DEFAULT: 0,
  ACCESSIBILITY: 1,
  CONTENT: 2,
  ITEM_VIEW_PANEL: 3,
  CONTROLLER_BAR: 4
};
;// CONCATENATED MODULE: ../../modules/types/src/general/enums/keyboard.ts
var KeyboardCodes = /*#__PURE__*/function (KeyboardCodes) {
  KeyboardCodes["ENTER"] = "Enter";
  KeyboardCodes["NUMPAD_ENTER"] = "NumpadEnter";
  KeyboardCodes["SPACE"] = "Space";
  KeyboardCodes["ARROW_LEFT"] = "ArrowLeft";
  KeyboardCodes["ARROW_RIGHT"] = "ArrowRight";
  KeyboardCodes["ARROW_DOWN"] = "ArrowDown";
  KeyboardCodes["ARROW_UP"] = "ArrowUp";
  KeyboardCodes["TAB"] = "Tab";
  KeyboardCodes["BACKSPACE"] = "Backspace";
  KeyboardCodes["DELETE"] = "Delete";
  KeyboardCodes["A"] = "KeyA";
  KeyboardCodes["X"] = "KeyX";
  KeyboardCodes["COMMA"] = "Comma";
  KeyboardCodes["DOT"] = "Period";
  KeyboardCodes["NUMPAD_DOT"] = "NumpadDecimal";
  KeyboardCodes["ESCAPE"] = "Escape";
  return KeyboardCodes;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/general/enums/statistics.ts
var InteractivityElementType = /*#__PURE__*/function (InteractivityElementType) {
  InteractivityElementType["QUIZ"] = "quiz";
  InteractivityElementType["POLL"] = "poll";
  InteractivityElementType["QUESTION"] = "question";
  InteractivityElementType["CONTACT_FORM"] = "contact_form";
  InteractivityElementType["LEAD_FORM"] = "lead_form";
  return InteractivityElementType;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/general/enums/amazon.ts
var amazon_CannedACL = /*#__PURE__*/function (CannedACL) {
  CannedACL["PRIVATE"] = "private";
  CannedACL["PUBLIC_READ"] = "public-read";
  CannedACL["PUBLIC_READ_WRITE"] = "public-read-write";
  return CannedACL;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/general/enums/pricing.ts
var pricing_PriceType = /*#__PURE__*/function (PriceType) {
  PriceType["SELF"] = "self";
  PriceType["SALES"] = "sales";
  return PriceType;
}({});
var Frequency = /*#__PURE__*/function (Frequency) {
  Frequency["MONTHLY"] = "Monthly";
  Frequency["YEARLY"] = "Yearly";
  return Frequency;
}({});
;// CONCATENATED MODULE: ../../modules/types/src/general/type-guards/pricing.ts

function isSalesPricePlan(price) {
  return price.type === PriceType.SALES;
}
;// CONCATENATED MODULE: ../../modules/types/src/index.ts
// //////////////////////////////// CORE ///////////////////////////////////
// CONSTANTS






// ENUMS








// TYPES


























// //////////////////////////////// GENERAL ///////////////////////////////////
// CONSTANTS


// ENUMS





// TYPES


// TYPE-GUARDS

// EXTERNAL MODULE: ./node_modules/prop-types/index.js
var prop_types = __webpack_require__(5556);
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
// EXTERNAL MODULE: ./node_modules/react-is/cjs/react-is.production.js
var react_is_production = __webpack_require__(4405);
// EXTERNAL MODULE: ./node_modules/shallowequal/index.js
var shallowequal = __webpack_require__(2833);
var shallowequal_default = /*#__PURE__*/__webpack_require__.n(shallowequal);
;// CONCATENATED MODULE: ./node_modules/@emotion/stylis/dist/stylis.browser.esm.js
function stylis_min (W) {
  function M(d, c, e, h, a) {
    for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {
      g = e.charCodeAt(l);
      l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);

      if (0 === b + n + v + m) {
        if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {
          switch (g) {
            case 32:
            case 9:
            case 59:
            case 13:
            case 10:
              break;

            default:
              f += e.charAt(l);
          }

          g = 59;
        }

        switch (g) {
          case 123:
            f = f.trim();
            q = f.charCodeAt(0);
            k = 1;

            for (t = ++l; l < B;) {
              switch (g = e.charCodeAt(l)) {
                case 123:
                  k++;
                  break;

                case 125:
                  k--;
                  break;

                case 47:
                  switch (g = e.charCodeAt(l + 1)) {
                    case 42:
                    case 47:
                      a: {
                        for (u = l + 1; u < J; ++u) {
                          switch (e.charCodeAt(u)) {
                            case 47:
                              if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
                                l = u + 1;
                                break a;
                              }

                              break;

                            case 10:
                              if (47 === g) {
                                l = u + 1;
                                break a;
                              }

                          }
                        }

                        l = u;
                      }

                  }

                  break;

                case 91:
                  g++;

                case 40:
                  g++;

                case 34:
                case 39:
                  for (; l++ < J && e.charCodeAt(l) !== g;) {
                  }

              }

              if (0 === k) break;
              l++;
            }

            k = e.substring(t, l);
            0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));

            switch (q) {
              case 64:
                0 < r && (f = f.replace(N, ''));
                g = f.charCodeAt(1);

                switch (g) {
                  case 100:
                  case 109:
                  case 115:
                  case 45:
                    r = c;
                    break;

                  default:
                    r = O;
                }

                k = M(c, r, k, g, a + 1);
                t = k.length;
                0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));
                if (0 < t) switch (g) {
                  case 115:
                    f = f.replace(da, ea);

                  case 100:
                  case 109:
                  case 45:
                    k = f + '{' + k + '}';
                    break;

                  case 107:
                    f = f.replace(fa, '$1 $2');
                    k = f + '{' + k + '}';
                    k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;
                    break;

                  default:
                    k = f + k, 112 === h && (k = (p += k, ''));
                } else k = '';
                break;

              default:
                k = M(c, X(c, f, I), k, h, a + 1);
            }

            F += k;
            k = I = r = u = q = 0;
            f = '';
            g = e.charCodeAt(++l);
            break;

          case 125:
          case 59:
            f = (0 < r ? f.replace(N, '') : f).trim();
            if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
              case 0:
                break;

              case 64:
                if (105 === g || 99 === g) {
                  G += f + e.charAt(l);
                  break;
                }

              default:
                58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
            }
            I = r = u = q = 0;
            f = '';
            g = e.charCodeAt(++l);
        }
      }

      switch (g) {
        case 13:
        case 10:
          47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00');
          0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);
          z = 1;
          D++;
          break;

        case 59:
        case 125:
          if (0 === b + n + v + m) {
            z++;
            break;
          }

        default:
          z++;
          y = e.charAt(l);

          switch (g) {
            case 9:
            case 32:
              if (0 === n + m + b) switch (x) {
                case 44:
                case 58:
                case 9:
                case 32:
                  y = '';
                  break;

                default:
                  32 !== g && (y = ' ');
              }
              break;

            case 0:
              y = '\\0';
              break;

            case 12:
              y = '\\f';
              break;

            case 11:
              y = '\\v';
              break;

            case 38:
              0 === n + b + m && (r = I = 1, y = '\f' + y);
              break;

            case 108:
              if (0 === n + b + m + E && 0 < u) switch (l - u) {
                case 2:
                  112 === x && 58 === e.charCodeAt(l - 3) && (E = x);

                case 8:
                  111 === K && (E = K);
              }
              break;

            case 58:
              0 === n + b + m && (u = l);
              break;

            case 44:
              0 === b + v + n + m && (r = 1, y += '\r');
              break;

            case 34:
            case 39:
              0 === b && (n = n === g ? 0 : 0 === n ? g : n);
              break;

            case 91:
              0 === n + b + v && m++;
              break;

            case 93:
              0 === n + b + v && m--;
              break;

            case 41:
              0 === n + b + m && v--;
              break;

            case 40:
              if (0 === n + b + m) {
                if (0 === q) switch (2 * x + 3 * K) {
                  case 533:
                    break;

                  default:
                    q = 1;
                }
                v++;
              }

              break;

            case 64:
              0 === b + v + n + m + u + k && (k = 1);
              break;

            case 42:
            case 47:
              if (!(0 < n + m + v)) switch (b) {
                case 0:
                  switch (2 * g + 3 * e.charCodeAt(l + 1)) {
                    case 235:
                      b = 47;
                      break;

                    case 220:
                      t = l, b = 42;
                  }

                  break;

                case 42:
                  47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);
              }
          }

          0 === b && (f += y);
      }

      K = x;
      x = g;
      l++;
    }

    t = p.length;

    if (0 < t) {
      r = c;
      if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;
      p = r.join(',') + '{' + p + '}';

      if (0 !== w * E) {
        2 !== w || L(p, 2) || (E = 0);

        switch (E) {
          case 111:
            p = p.replace(ha, ':-moz-$1') + p;
            break;

          case 112:
            p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;
        }

        E = 0;
      }
    }

    return G + p + F;
  }

  function X(d, c, e) {
    var h = c.trim().split(ia);
    c = h;
    var a = h.length,
        m = d.length;

    switch (m) {
      case 0:
      case 1:
        var b = 0;

        for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {
          c[b] = Z(d, c[b], e).trim();
        }

        break;

      default:
        var v = b = 0;

        for (c = []; b < a; ++b) {
          for (var n = 0; n < m; ++n) {
            c[v++] = Z(d[n] + ' ', h[b], e).trim();
          }
        }

    }

    return c;
  }

  function Z(d, c, e) {
    var h = c.charCodeAt(0);
    33 > h && (h = (c = c.trim()).charCodeAt(0));

    switch (h) {
      case 38:
        return c.replace(F, '$1' + d.trim());

      case 58:
        return d.trim() + c.replace(F, '$1' + d.trim());

      default:
        if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());
    }

    return d + c;
  }

  function P(d, c, e, h) {
    var a = d + ';',
        m = 2 * c + 3 * e + 4 * h;

    if (944 === m) {
      d = a.indexOf(':', 9) + 1;
      var b = a.substring(d, a.length - 1).trim();
      b = a.substring(0, d).trim() + b + ';';
      return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;
    }

    if (0 === w || 2 === w && !L(a, 1)) return a;

    switch (m) {
      case 1015:
        return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;

      case 951:
        return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;

      case 963:
        return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;

      case 1009:
        if (100 !== a.charCodeAt(4)) break;

      case 969:
      case 942:
        return '-webkit-' + a + a;

      case 978:
        return '-webkit-' + a + '-moz-' + a + a;

      case 1019:
      case 983:
        return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;

      case 883:
        if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;
        if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;
        break;

      case 932:
        if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
          case 103:
            return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;

          case 115:
            return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;

          case 98:
            return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;
        }
        return '-webkit-' + a + '-ms-' + a + a;

      case 964:
        return '-webkit-' + a + '-ms-flex-' + a + a;

      case 1023:
        if (99 !== a.charCodeAt(8)) break;
        b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');
        return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;

      case 1005:
        return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;

      case 1e3:
        b = a.substring(13).trim();
        c = b.indexOf('-') + 1;

        switch (b.charCodeAt(0) + b.charCodeAt(c)) {
          case 226:
            b = a.replace(G, 'tb');
            break;

          case 232:
            b = a.replace(G, 'tb-rl');
            break;

          case 220:
            b = a.replace(G, 'lr');
            break;

          default:
            return a;
        }

        return '-webkit-' + a + '-ms-' + b + a;

      case 1017:
        if (-1 === a.indexOf('sticky', 9)) break;

      case 975:
        c = (a = d).length - 10;
        b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();

        switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
          case 203:
            if (111 > b.charCodeAt(8)) break;

          case 115:
            a = a.replace(b, '-webkit-' + b) + ';' + a;
            break;

          case 207:
          case 102:
            a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;
        }

        return a + ';';

      case 938:
        if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
          case 105:
            return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;

          case 115:
            return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;

          default:
            return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;
        }
        break;

      case 973:
      case 989:
        if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;

      case 931:
      case 953:
        if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;
        break;

      case 962:
        if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;
    }

    return a;
  }

  function L(d, c) {
    var e = d.indexOf(1 === c ? ':' : '{'),
        h = d.substring(0, 3 !== c ? e : 10);
    e = d.substring(e + 1, d.length - 1);
    return R(2 !== c ? h : h.replace(na, '$1'), e, c);
  }

  function ea(d, c) {
    var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
    return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';
  }

  function H(d, c, e, h, a, m, b, v, n, q) {
    for (var g = 0, x = c, w; g < A; ++g) {
      switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
        case void 0:
        case !1:
        case !0:
        case null:
          break;

        default:
          x = w;
      }
    }

    if (x !== c) return x;
  }

  function T(d) {
    switch (d) {
      case void 0:
      case null:
        A = S.length = 0;
        break;

      default:
        if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {
          T(d[c]);
        } else Y = !!d | 0;
    }

    return T;
  }

  function U(d) {
    d = d.prefix;
    void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);
    return U;
  }

  function B(d, c) {
    var e = d;
    33 > e.charCodeAt(0) && (e = e.trim());
    V = e;
    e = [V];

    if (0 < A) {
      var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
      void 0 !== h && 'string' === typeof h && (c = h);
    }

    var a = M(O, e, c, 0, 0);
    0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));
    V = '';
    E = 0;
    z = D = 1;
    return a;
  }

  var ca = /^\0+/g,
      N = /[\0\r\f]/g,
      aa = /: */g,
      ka = /zoo|gra/,
      ma = /([,: ])(transform)/g,
      ia = /,\r+?/g,
      F = /([\t\r\n ])*\f?&/g,
      fa = /@(k\w+)\s*(\S*)\s*/,
      Q = /::(place)/g,
      ha = /:(read-only)/g,
      G = /[svh]\w+-[tblr]{2}/,
      da = /\(\s*(.*)\s*\)/g,
      oa = /([\s\S]*?);/g,
      ba = /-self|flex-/g,
      na = /[^]*?(:[rp][el]a[\w-]+)[^]*/,
      la = /stretch|:\s*\w+\-(?:conte|avail)/,
      ja = /([^-])(image-set\()/,
      z = 1,
      D = 1,
      E = 0,
      w = 1,
      O = [],
      S = [],
      A = 0,
      R = null,
      Y = 0,
      V = '';
  B.use = T;
  B.set = U;
  void 0 !== W && U(W);
  return B;
}

/* harmony default export */ var stylis_browser_esm = (stylis_min);

// EXTERNAL MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js
var unitless_browser_esm = __webpack_require__(7103);
// EXTERNAL MODULE: ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js
var is_prop_valid_browser_esm = __webpack_require__(5165);
// EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
var hoist_non_react_statics_cjs = __webpack_require__(4146);
var hoist_non_react_statics_cjs_default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics_cjs);
;// CONCATENATED MODULE: ./node_modules/styled-components/dist/styled-components.browser.esm.js
/* provided dependency */ var process = __webpack_require__(5606);
function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var g=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},S=function(t){return null!==t&&"object"==typeof t&&"[object Object]"===(t.toString?t.toString():Object.prototype.toString.call(t))&&!(0,react_is_production.typeOf)(t)},w=Object.freeze([]),E=Object.freeze({});function b(e){return"function"==typeof e}function _(e){return false||e.displayName||e.name||"Component"}function N(e){return e&&"string"==typeof e.styledComponentId}var A="undefined"!=typeof process&&(({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).REACT_APP_SC_ATTR||({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).SC_ATTR)||"data-styled",C="5.3.1",styled_components_browser_esm_I="undefined"!=typeof window&&"HTMLElement"in window,P=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).REACT_APP_SC_DISABLE_SPEEDY&&""!==({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).REACT_APP_SC_DISABLE_SPEEDY?"false"!==({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).REACT_APP_SC_DISABLE_SPEEDY&&({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).SC_DISABLE_SPEEDY&&""!==({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).SC_DISABLE_SPEEDY?"false"!==({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).SC_DISABLE_SPEEDY&&({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).SC_DISABLE_SPEEDY:"production"!=="production"),O={},R= false?0:{};function D(){for(var e=arguments.length<=0?void 0:arguments[0],t=[],n=1,r=arguments.length;n<r;n+=1)t.push(n<0||arguments.length<=n?void 0:arguments[n]);return t.forEach((function(t){e=e.replace(/%[a-z]/,t)})),e}function j(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw true?new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):"")):0}var T=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&j(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var i=this.indexOfGroup(e+1),a=0,c=t.length;a<c;a++)this.tag.insertRule(i,t[a])&&(this.groupSizes[e]++,i++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+=this.tag.getRule(s)+"/*!sc*/\n";return t},e}(),k=new Map,x=new Map,V=1,B=function(e){if(k.has(e))return k.get(e);for(;x.has(V);)V++;var t=V++;return false&&0,k.set(e,t),x.set(t,e),t},M=function(e){return x.get(e)},z=function(e,t){t>=V&&(V=t+1),k.set(e,t),x.set(t,e)},L="style["+A+'][data-styled-version="5.3.1"]',G=new RegExp("^"+A+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),F=function(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s<i;s++)(r=o[s])&&e.registerName(t,r)},Y=function(e,t){for(var n=(t.innerHTML||"").split("/*!sc*/\n"),r=[],o=0,s=n.length;o<s;o++){var i=n[o].trim();if(i){var a=i.match(G);if(a){var c=0|parseInt(a[1],10),u=a[2];0!==c&&(z(u,c),F(e,u,a[3]),e.getTag().insertRules(c,r)),r.length=0}else r.push(i)}}},q=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},H=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(A))return r}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(A,"active"),r.setAttribute("data-styled-version","5.3.1");var i=q();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r},$=function(){function e(e){var t=this.element=H(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}j(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),W=function(){function e(e){var t=this.element=H(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),U=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),J=styled_components_browser_esm_I,X={isServer:!styled_components_browser_esm_I,useCSSOMInjection:!P},Z=function(){function e(e,t,n){void 0===e&&(e=E),void 0===t&&(t={}),this.options=v({},X,{},e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&styled_components_browser_esm_I&&J&&(J=!1,function(e){for(var t=document.querySelectorAll(L),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(A)&&(Y(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return B(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(v({},this.options,{},t),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new U(o):r?new $(o):new W(o),new T(e)));var e,t,n,r,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(B(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(B(e),n)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(B(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var s=M(o);if(void 0!==s){var i=e.names.get(s),a=t.getGroup(o);if(i&&a&&i.size){var c=A+".g"+o+'[id="'+s+'"]',u="";void 0!==i&&i.forEach((function(e){e.length>0&&(u+=e+",")})),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),K=/(a)(d)/gi,Q=function(e){return String.fromCharCode(e+(e>25?39:97))};function ee(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Q(t%52)+n;return(Q(t%52)+n).replace(K,"$1-$2")}var te=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},ne=function(e){return te(5381,e)};function re(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(b(n)&&!N(n))return!1}return!0}var oe=ne("5.3.1"),se=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic= true&&(void 0===n||n.isStatic)&&re(e),this.componentId=t,this.baseHash=te(oe,t),this.baseStyle=n,Z.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else{var s=Ne(this.rules,e,t,n).join(""),i=ee(te(this.baseHash,s)>>>0);if(!t.hasNameForId(r,i)){var a=n(s,"."+i,void 0,r);t.insertRules(r,i,a)}o.push(i),this.staticRulesId=i}else{for(var c=this.rules.length,u=te(this.baseHash,n.hash),l="",d=0;d<c;d++){var h=this.rules[d];if("string"==typeof h)l+=h, false&&(0);else if(h){var p=Ne(h,e,t,n),f=Array.isArray(p)?p.join(""):p;u=te(u,f+d),l+=f}}if(l){var m=ee(u>>>0);if(!t.hasNameForId(r,m)){var y=n(l,"."+m,void 0,r);t.insertRules(r,m,y)}o.push(m)}}return o.join(" ")},e}(),ie=/^\s*\/\/.*$/gm,ae=[":","[",".","#"];function ce(e){var t,n,r,o,s=void 0===e?E:e,i=s.options,a=void 0===i?E:i,c=s.plugins,u=void 0===c?w:c,l=new stylis_browser_esm(a),d=[],h=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,s,i,a,c,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){d.push(e)})),f=function(e,r,s){return 0===r&&-1!==ae.indexOf(s[n.length])||s.match(o)?e:"."+t};function m(e,s,i,a){void 0===a&&(a="&");var c=e.replace(ie,""),u=s&&i?i+" "+s+" { "+c+" }":c;return t=a,n=s,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(i||!s?"":s,u)}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,f))},h,function(e){if(-2===e){var t=d;return d=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||j(15),te(e,t.name)}),5381).toString():"",m}var ue=react.createContext(),le=ue.Consumer,de=react.createContext(),he=(de.Consumer,new Z),pe=ce();function fe(){return (0,react.useContext)(ue)||he}function me(){return (0,react.useContext)(de)||pe}function ye(e){var t=(0,react.useState)(e.stylisPlugins),n=t[0],s=t[1],c=fe(),u=(0,react.useMemo)((function(){var t=c;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),l=(0,react.useMemo)((function(){return ce({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return (0,react.useEffect)((function(){shallowequal_default()(n,e.stylisPlugins)||s(e.stylisPlugins)}),[e.stylisPlugins]),react.createElement(ue.Provider,{value:u},react.createElement(de.Provider,{value:l}, false?0:e.children))}var ve=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=pe);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return j(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=pe),this.name+e.hash},e}(),ge=/([A-Z])/,Se=/([A-Z])/g,we=/^ms-/,Ee=function(e){return"-"+e.toLowerCase()};function be(e){return ge.test(e)?e.replace(Se,Ee).replace(we,"-ms-"):e}var _e=function(e){return null==e||!1===e||""===e};function Ne(e,n,r,o){if(Array.isArray(e)){for(var s,i=[],a=0,c=e.length;a<c;a+=1)""!==(s=Ne(e[a],n,r,o))&&(Array.isArray(s)?i.push.apply(i,s):i.push(s));return i}if(_e(e))return"";if(N(e))return"."+e.styledComponentId;if(b(e)){if("function"!=typeof(l=e)||l.prototype&&l.prototype.isReactComponent||!n)return e;var u=e(n);return false&&0,Ne(u,n,r,o)}var l;return e instanceof ve?r?(e.inject(r,o),e.getName(o)):e:S(e)?function e(t,n){var r,o,s=[];for(var i in t)t.hasOwnProperty(i)&&!_e(t[i])&&(Array.isArray(t[i])&&t[i].isCss||b(t[i])?s.push(be(i)+":",t[i],";"):S(t[i])?s.push.apply(s,e(t[i],i)):s.push(be(i)+": "+(r=i,null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in unitless_browser_esm/* default */.A?String(o).trim():o+"px")+";"));return n?[n+" {"].concat(s,["}"]):s}(e):e.toString()}var Ae=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function Ce(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return b(e)||S(e)?Ae(Ne(g(w,[e].concat(n)))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:Ae(Ne(g(e,n)))}var Ie=/invalid hook call/i,Pe=new Set,Oe=function(e,t){if(false){ var o, n, r; }},Re=function(e,t,n){return void 0===n&&(n=E),e.theme!==n.theme&&e.theme||t||n.theme},De=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function Te(e){return e.replace(De,"-").replace(je,"")}var ke=function(e){return ee(ne(e)>>>0)};function xe(e){return"string"==typeof e&&( true||0)}var Ve=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Be=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Me(e,t,n){var r=e[n];Ve(t)&&Ve(r)?ze(r,t):e[n]=t}function ze(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,s=n;o<s.length;o++){var i=s[o];if(Ve(i))for(var a in i)Be(a)&&Me(e,i[a],a)}return e}var Le=react.createContext(),Ge=Le.Consumer;function Fe(e){var t=(0,react.useContext)(Le),n=(0,react.useMemo)((function(){return function(e,t){if(!e)return j(14);if(b(e)){var n=e(t);return true?n:0}return Array.isArray(e)||"object"!=typeof e?j(8):t?v({},t,{},e):e}(e.theme,t)}),[e.theme,t]);return e.children?react.createElement(Le.Provider,{value:n},e.children):null}var Ye={};function qe(e,t,n){var o=N(e),i=!xe(e),a=t.attrs,c=void 0===a?w:a,d=t.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":Te(e);Ye[n]=(Ye[n]||0)+1;var r=n+"-"+ke("5.3.1"+n+Ye[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):d,p=t.displayName,f=void 0===p?function(e){return xe(e)?"styled."+e:"Styled("+_(e)+")"}(e):p,g=t.displayName&&t.componentId?Te(t.displayName)+"-"+t.componentId:t.componentId||h,S=o&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,A=t.shouldForwardProp;o&&e.shouldForwardProp&&(A=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var C,I=new se(n,g,o?e.componentStyle:void 0),P=I.isStatic&&0===c.length,O=function(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,d=e.shouldForwardProp,h=e.styledComponentId,p=e.target; false&&0;var f=function(e,t,n){void 0===e&&(e=E);var r=v({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,s,i=e;for(t in b(i)&&(i=i(r)),i)r[t]=o[t]="className"===t?(n=o[t],s=i[t],n&&s?n+" "+s:n||s):i[t]})),[r,o]}(Re(t,(0,react.useContext)(Le),a)||E,t,o),y=f[0],g=f[1],S=function(e,t,n,r){var o=fe(),s=me(),i=t?e.generateAndInjectStyles(E,o,s):e.generateAndInjectStyles(n,o,s);return false&&0, false&&0,i}(i,r,y, false?0:void 0),w=n,_=g.$as||t.$as||g.as||t.as||p,N=xe(_),A=g!==t?v({},t,{},g):t,C={};for(var I in A)"$"!==I[0]&&"as"!==I&&("forwardedAs"===I?C.as=A[I]:(d?d(I,is_prop_valid_browser_esm/* default */.A,_):!N||(0,is_prop_valid_browser_esm/* default */.A)(I))&&(C[I]=A[I]));return t.style&&g.style!==t.style&&(C.style=v({},t.style,{},g.style)),C.className=Array.prototype.concat(c,h,S!==h?S:null,t.className,g.className).filter(Boolean).join(" "),C.ref=w,(0,react.createElement)(_,C)}(C,e,t,P)};return O.displayName=f,(C=react.forwardRef(O)).attrs=S,C.componentStyle=I,C.displayName=f,C.shouldForwardProp=A,C.foldedComponentIds=o?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):w,C.styledComponentId=g,C.target=o?e.target:e,C.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["componentId"]),s=r&&r+"-"+(xe(e)?e:Te(_(e)));return qe(e,v({},o,{attrs:S,componentId:s}),n)},Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?ze({},e.defaultProps,t):t}}), false&&(0),C.toString=function(){return"."+C.styledComponentId},i&&hoist_non_react_statics_cjs_default()(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C}var He=function(e){return function e(t,r,o){if(void 0===o&&(o=E),!(0,react_is_production.isValidElementType)(r))return j(1,String(r));var s=function(){return t(r,o,Ce.apply(void 0,arguments))};return s.withConfig=function(n){return e(t,r,v({},o,{},n))},s.attrs=function(n){return e(t,r,v({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}))},s}(qe,e)};["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","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){He[e]=He(e)}));var $e=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=re(e),Z.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var o=r(Ne(this.rules,t,n,r).join(""),""),s=this.componentId+e;n.insertRules(s,s,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&Z.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function We(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var i=Ce.apply(void 0,[e].concat(n)),a="sc-global-"+ke(JSON.stringify(i)),u=new $e(i,a);function l(e){var t=fe(),n=me(),o=s(Le),l=c(t.allocateGSInstance(a)).current;return false&&0, false&&0,t.server&&h(l,e,t,o,n),d((function(){if(!t.server)return h(l,e,t,o,n),function(){return u.removeStyles(l,t)}}),[l,e,t,o,n]),null}function h(e,t,n,r,o){if(u.isStatic)u.renderStyles(e,O,n,o);else{var s=v({},t,{theme:Re(t,r,l.defaultProps)});u.renderStyles(e,s,n,o)}}return false&&0,r.memo(l)}function Ue(e){ false&&0;for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Ce.apply(void 0,[e].concat(n)).join(""),s=ke(o);return new ve(s,o)}var Je=function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=q();return"<style "+[n&&'nonce="'+n+'"',A+'="true"','data-styled-version="5.3.1"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?j(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return j(2);var n=((t={})[A]="",t["data-styled-version"]="5.3.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),o=q();return o&&(n.nonce=o),[react.createElement("style",v({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Z({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?j(2):react.createElement(ye,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return j(3)},e}(),Xe=function(e){var t=r.forwardRef((function(t,n){var o=s(Le),i=e.defaultProps,a=Re(t,o,i);return false&&0,r.createElement(e,v({},t,{theme:a,ref:n}))}));return y(t,e),t.displayName="WithTheme("+_(e)+")",t},Ze=function(){return (0,react.useContext)(Le)},Ke={StyleSheet:Z,masterSheet:he}; false&&0, false&&(0);/* harmony default export */ var styled_components_browser_esm = (He);
//# sourceMappingURL=styled-components.browser.esm.js.map

;// CONCATENATED MODULE: ../../modules/ui/code/core/src/BaseImage/styles.tsx

var styles_Image = styled_components_browser_esm.img.withConfig({
  displayName: "styles__Image",
  componentId: "sc-6xgvle-0"
})(["width:", ";height:", ";max-height:", ";max-width:", ";object-fit:", ";-webkit-touch-callout:none;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;", ""], function (props) {
  return typeof props.$width === 'string' ? props.$width : "".concat(props.$width, "px");
}, function (props) {
  return typeof props.$height === 'string' ? props.$height : "".concat(props.$height, "px");
}, function (_ref) {
  var $maxHeight = _ref.$maxHeight;
  return typeof $maxHeight === 'string' ? $maxHeight : "".concat($maxHeight, "px");
}, function (_ref2) {
  var $maxWidth = _ref2.$maxWidth;
  return typeof $maxWidth === 'string' ? $maxWidth : "".concat($maxWidth, "px");
}, function (props) {
  return props.objectFit;
}, function (_ref3) {
  var $scaleX = _ref3.$scaleX,
    $scaleY = _ref3.$scaleY;
  return $scaleX !== 1 || $scaleY !== 1 ? "transform: scale(".concat($scaleX, ", ").concat($scaleY, ");") : '';
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/BaseImage/index.tsx



var BaseImage = function BaseImage(_ref) {
  var width = _ref.width,
    height = _ref.height,
    objectFit = _ref.objectFit,
    src = _ref.src,
    fallbackSrc = _ref.fallbackSrc,
    alt = _ref.alt,
    maxHeight = _ref.maxHeight,
    maxWidth = _ref.maxWidth,
    imageScale = _ref.imageScale,
    _ref$setCountImages = _ref.setCountImages,
    setCountImages = _ref$setCountImages === void 0 ? function () {} : _ref$setCountImages,
    _ref$setCountImagesLo = _ref.setCountImagesLoaded,
    setCountImagesLoaded = _ref$setCountImagesLo === void 0 ? function () {} : _ref$setCountImagesLo;
  var preventDragHandler = function preventDragHandler(event) {
    event.preventDefault();
  };
  var imageSrc = src || fallbackSrc;
  (0,react.useEffect)(function () {
    if (imageSrc) {
      setCountImages();
    }
  }, []);
  var onLoad = function onLoad() {
    setCountImagesLoaded();
  };
  var onError = function onError(event) {
    onLoad();
    var currentTarget = event.currentTarget;
    if (currentTarget && currentTarget.src !== fallbackSrc) {
      setCountImages();
      currentTarget.src = fallbackSrc;
    }
  };
  return /*#__PURE__*/react.createElement(styles_Image, {
    $width: width,
    $height: height,
    $maxHeight: maxHeight,
    $maxWidth: maxWidth,
    src: imageSrc,
    onError: onError,
    onLoad: onLoad,
    alt: alt,
    objectFit: objectFit,
    draggable: false,
    onDragStart: preventDragHandler,
    $scaleX: imageScale && imageScale.x ? imageScale.x : 1,
    $scaleY: imageScale && imageScale.y ? imageScale.y : 1
  });
};
BaseImage.propTypes = {
  src: (prop_types_default()).string.isRequired,
  fallbackSrc: (prop_types_default()).string,
  alt: (prop_types_default()).string,
  width: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]),
  height: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]),
  objectFit: (prop_types_default()).string.isRequired,
  maxHeight: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]),
  maxWidth: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]),
  imageScale: prop_types_default().shape({
    x: (prop_types_default()).number,
    y: (prop_types_default()).number
  }),
  setCountImages: (prop_types_default()).func,
  setCountImagesLoaded: (prop_types_default()).func
};
BaseImage.defaultProps = {
  alt: '',
  width: '100%',
  height: 'auto',
  maxHeight: '100%',
  maxWidth: 'none',
  fallbackSrc: '',
  imageScale: {
    x: 1,
    y: 1
  },
  setCountImages: function setCountImages() {},
  setCountImagesLoaded: function setCountImagesLoaded() {}
};
/* harmony default export */ var src_BaseImage = (/*#__PURE__*/react.memo(BaseImage));
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(8168);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
var objectWithoutPropertiesLoose = __webpack_require__(8587);
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js

function objectWithoutProperties_objectWithoutProperties(source, excluded) {
  if (source == null) return {};
  var target = (0,objectWithoutPropertiesLoose/* default */.A)(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;
}
// EXTERNAL MODULE: ./node_modules/react-dom/index.js
var react_dom = __webpack_require__(961);
// EXTERNAL MODULE: ../../modules/ui/code/content-icons/node_modules/clsx/dist/clsx.m.js
var clsx_m = __webpack_require__(9156);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/utils/esm/deepmerge.js


function isPlainObject(item) {
  return item && typeof_typeof(item) === 'object' && item.constructor === Object;
}
function deepmerge(target, source) {
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
    clone: true
  };
  var output = options.clone ? (0,esm_extends/* default */.A)({}, target) : target;

  if (isPlainObject(target) && isPlainObject(source)) {
    Object.keys(source).forEach(function (key) {
      // Avoid prototype pollution
      if (key === '__proto__') {
        return;
      }

      if (isPlainObject(source[key]) && key in target) {
        output[key] = deepmerge(target[key], source[key], options);
      } else {
        output[key] = source[key];
      }
    });
  }

  return output;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/utils/esm/formatMuiErrorMessage.js
/**
 * WARNING: Don't import this directly.
 * Use `MuiError` from `@material-ui/utils/macros/MuiError.macro` instead.
 * @param {number} code
 */
function formatMuiErrorMessage(code) {
  // Apply babel-plugin-transform-template-literals in loose mode
  // loose mode is safe iff we're concatenating primitives
  // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose

  /* eslint-disable prefer-template */
  var url = 'https://mui.com/production-error/?code=' + code;

  for (var i = 1; i < arguments.length; i += 1) {
    // rest params over-transpile for this case
    // eslint-disable-next-line prefer-rest-params
    url += '&args[]=' + encodeURIComponent(arguments[i]);
  }

  return 'Minified Material-UI error #' + code + '; visit ' + url + ' for the full message.';
  /* eslint-enable prefer-template */
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/colorManipulator.js


/* eslint-disable no-use-before-define */

/**
 * Returns a number whose value is limited to the given range.
 *
 * @param {number} value The value to be clamped
 * @param {number} min The lower boundary of the output range
 * @param {number} max The upper boundary of the output range
 * @returns {number} A number in the range [min, max]
 */
function clamp(value) {
  var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;

  if (false) {}

  return Math.min(Math.max(min, value), max);
}
/**
 * Converts a color from CSS hex format to CSS rgb format.
 *
 * @param {string} color - Hex color, i.e. #nnn or #nnnnnn
 * @returns {string} A CSS rgb color string
 */


function hexToRgb(color) {
  color = color.substr(1);
  var re = new RegExp(".{1,".concat(color.length >= 6 ? 2 : 1, "}"), 'g');
  var colors = color.match(re);

  if (colors && colors[0].length === 1) {
    colors = colors.map(function (n) {
      return n + n;
    });
  }

  return colors ? "rgb".concat(colors.length === 4 ? 'a' : '', "(").concat(colors.map(function (n, index) {
    return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;
  }).join(', '), ")") : '';
}

function intToHex(int) {
  var hex = int.toString(16);
  return hex.length === 1 ? "0".concat(hex) : hex;
}
/**
 * Converts a color from CSS rgb format to CSS hex format.
 *
 * @param {string} color - RGB color, i.e. rgb(n, n, n)
 * @returns {string} A CSS rgb color string, i.e. #nnnnnn
 */


function rgbToHex(color) {
  // Idempotent
  if (color.indexOf('#') === 0) {
    return color;
  }

  var _decomposeColor = decomposeColor(color),
      values = _decomposeColor.values;

  return "#".concat(values.map(function (n) {
    return intToHex(n);
  }).join(''));
}
/**
 * Converts a color from hsl format to rgb format.
 *
 * @param {string} color - HSL color values
 * @returns {string} rgb color values
 */

function hslToRgb(color) {
  color = decomposeColor(color);
  var _color = color,
      values = _color.values;
  var h = values[0];
  var s = values[1] / 100;
  var l = values[2] / 100;
  var a = s * Math.min(l, 1 - l);

  var f = function f(n) {
    var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (n + h / 30) % 12;
    return l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
  };

  var type = 'rgb';
  var rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];

  if (color.type === 'hsla') {
    type += 'a';
    rgb.push(values[3]);
  }

  return recomposeColor({
    type: type,
    values: rgb
  });
}
/**
 * Returns an object with the type and values of a color.
 *
 * Note: Does not support rgb % values.
 *
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @returns {object} - A MUI color object: {type: string, values: number[]}
 */

function decomposeColor(color) {
  // Idempotent
  if (color.type) {
    return color;
  }

  if (color.charAt(0) === '#') {
    return decomposeColor(hexToRgb(color));
  }

  var marker = color.indexOf('(');
  var type = color.substring(0, marker);

  if (['rgb', 'rgba', 'hsl', 'hsla'].indexOf(type) === -1) {
    throw new Error( false ? 0 : formatMuiErrorMessage(3, color));
  }

  var values = color.substring(marker + 1, color.length - 1).split(',');
  values = values.map(function (value) {
    return parseFloat(value);
  });
  return {
    type: type,
    values: values
  };
}
/**
 * Converts a color object with type and values to a string.
 *
 * @param {object} color - Decomposed color
 * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'
 * @param {array} color.values - [n,n,n] or [n,n,n,n]
 * @returns {string} A CSS color string
 */

function recomposeColor(color) {
  var type = color.type;
  var values = color.values;

  if (type.indexOf('rgb') !== -1) {
    // Only convert the first 3 values to int (i.e. not alpha)
    values = values.map(function (n, i) {
      return i < 3 ? parseInt(n, 10) : n;
    });
  } else if (type.indexOf('hsl') !== -1) {
    values[1] = "".concat(values[1], "%");
    values[2] = "".concat(values[2], "%");
  }

  return "".concat(type, "(").concat(values.join(', '), ")");
}
/**
 * Calculates the contrast ratio between two colors.
 *
 * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
 *
 * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @returns {number} A contrast ratio value in the range 0 - 21.
 */

function getContrastRatio(foreground, background) {
  var lumA = getLuminance(foreground);
  var lumB = getLuminance(background);
  return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
}
/**
 * The relative brightness of any point in a color space,
 * normalized to 0 for darkest black and 1 for lightest white.
 *
 * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
 *
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @returns {number} The relative brightness of the color in the range 0 - 1
 */

function getLuminance(color) {
  color = decomposeColor(color);
  var rgb = color.type === 'hsl' ? decomposeColor(hslToRgb(color)).values : color.values;
  rgb = rgb.map(function (val) {
    val /= 255; // normalized

    return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
  }); // Truncate at 3 digits

  return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
}
/**
 * Darken or lighten a color, depending on its luminance.
 * Light colors are darkened, dark colors are lightened.
 *
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @param {number} coefficient=0.15 - multiplier in the range 0 - 1
 * @returns {string} A CSS color string. Hex input values are returned as rgb
 */

function emphasize(color) {
  var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;
  return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);
}
var warnedOnce = false;
/**
 * Set the absolute transparency of a color.
 * Any existing alpha values are overwritten.
 *
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @param {number} value - value to set the alpha channel to in the range 0 -1
 * @returns {string} A CSS color string. Hex input values are returned as rgb
 *
 * @deprecated
 * Use `import { alpha } from '@material-ui/core/styles'` instead.
 */

function fade(color, value) {
  if (false) {}

  return alpha(color, value);
}
/**
 * Set the absolute transparency of a color.
 * Any existing alpha value is overwritten.
 *
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @param {number} value - value to set the alpha channel to in the range 0-1
 * @returns {string} A CSS color string. Hex input values are returned as rgb
 */

function alpha(color, value) {
  color = decomposeColor(color);
  value = clamp(value);

  if (color.type === 'rgb' || color.type === 'hsl') {
    color.type += 'a';
  }

  color.values[3] = value;
  return recomposeColor(color);
}
/**
 * Darkens a color.
 *
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @param {number} coefficient - multiplier in the range 0 - 1
 * @returns {string} A CSS color string. Hex input values are returned as rgb
 */

function darken(color, coefficient) {
  color = decomposeColor(color);
  coefficient = clamp(coefficient);

  if (color.type.indexOf('hsl') !== -1) {
    color.values[2] *= 1 - coefficient;
  } else if (color.type.indexOf('rgb') !== -1) {
    for (var i = 0; i < 3; i += 1) {
      color.values[i] *= 1 - coefficient;
    }
  }

  return recomposeColor(color);
}
/**
 * Lightens a color.
 *
 * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
 * @param {number} coefficient - multiplier in the range 0 - 1
 * @returns {string} A CSS color string. Hex input values are returned as rgb
 */

function lighten(color, coefficient) {
  color = decomposeColor(color);
  coefficient = clamp(coefficient);

  if (color.type.indexOf('hsl') !== -1) {
    color.values[2] += (100 - color.values[2]) * coefficient;
  } else if (color.type.indexOf('rgb') !== -1) {
    for (var i = 0; i < 3; i += 1) {
      color.values[i] += (255 - color.values[i]) * coefficient;
    }
  }

  return recomposeColor(color);
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/is-in-browser/dist/module.js
var module_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var isBrowser = (typeof window === "undefined" ? "undefined" : module_typeof(window)) === "object" && (typeof document === "undefined" ? "undefined" : module_typeof(document)) === 'object' && document.nodeType === 9;

/* harmony default export */ var dist_module = (isBrowser);

;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
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_createClass(Constructor, protoProps, staticProps) {
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  if (staticProps) _defineProperties(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", {
    writable: false
  });
  return Constructor;
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
function _setPrototypeOf(o, p) {
  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
    o.__proto__ = p;
    return o;
  };

  return _setPrototypeOf(o, p);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js

function _inheritsLoose(subClass, superClass) {
  subClass.prototype = Object.create(superClass.prototype);
  subClass.prototype.constructor = subClass;
  _setPrototypeOf(subClass, superClass);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
function _assertThisInitialized(self) {
  if (self === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }

  return self;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/jss/dist/jss.esm.js








var plainObjectConstrurctor = {}.constructor;
function cloneStyle(style) {
  if (style == null || typeof style !== 'object') return style;
  if (Array.isArray(style)) return style.map(cloneStyle);
  if (style.constructor !== plainObjectConstrurctor) return style;
  var newStyle = {};

  for (var name in style) {
    newStyle[name] = cloneStyle(style[name]);
  }

  return newStyle;
}

/**
 * Create a rule instance.
 */

function createRule(name, decl, options) {
  if (name === void 0) {
    name = 'unnamed';
  }

  var jss = options.jss;
  var declCopy = cloneStyle(decl);
  var rule = jss.plugins.onCreateRule(name, declCopy, options);
  if (rule) return rule; // It is an at-rule and it has no instance.

  if (name[0] === '@') {
     false ? 0 : void 0;
  }

  return null;
}

var join = function join(value, by) {
  var result = '';

  for (var i = 0; i < value.length; i++) {
    // Remove !important from the value, it will be readded later.
    if (value[i] === '!important') break;
    if (result) result += by;
    result += value[i];
  }

  return result;
};
/**
 * Converts JSS array value to a CSS string.
 *
 * `margin: [['5px', '10px']]` > `margin: 5px 10px;`
 * `border: ['1px', '2px']` > `border: 1px, 2px;`
 * `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;`
 * `color: ['red', !important]` > `color: red !important;`
 */


var toCssValue = function toCssValue(value) {
  if (!Array.isArray(value)) return value;
  var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.

  if (Array.isArray(value[0])) {
    for (var i = 0; i < value.length; i++) {
      if (value[i] === '!important') break;
      if (cssValue) cssValue += ', ';
      cssValue += join(value[i], ' ');
    }
  } else cssValue = join(value, ', '); // Add !important, because it was ignored.


  if (value[value.length - 1] === '!important') {
    cssValue += ' !important';
  }

  return cssValue;
};

function getWhitespaceSymbols(options) {
  if (options && options.format === false) {
    return {
      linebreak: '',
      space: ''
    };
  }

  return {
    linebreak: '\n',
    space: ' '
  };
}

/**
 * Indent a string.
 * http://jsperf.com/array-join-vs-for
 */

function indentStr(str, indent) {
  var result = '';

  for (var index = 0; index < indent; index++) {
    result += '  ';
  }

  return result + str;
}
/**
 * Converts a Rule to CSS string.
 */


function toCss(selector, style, options) {
  if (options === void 0) {
    options = {};
  }

  var result = '';
  if (!style) return result;
  var _options = options,
      _options$indent = _options.indent,
      indent = _options$indent === void 0 ? 0 : _options$indent;
  var fallbacks = style.fallbacks;

  if (options.format === false) {
    indent = -Infinity;
  }

  var _getWhitespaceSymbols = getWhitespaceSymbols(options),
      linebreak = _getWhitespaceSymbols.linebreak,
      space = _getWhitespaceSymbols.space;

  if (selector) indent++; // Apply fallbacks first.

  if (fallbacks) {
    // Array syntax {fallbacks: [{prop: value}]}
    if (Array.isArray(fallbacks)) {
      for (var index = 0; index < fallbacks.length; index++) {
        var fallback = fallbacks[index];

        for (var prop in fallback) {
          var value = fallback[prop];

          if (value != null) {
            if (result) result += linebreak;
            result += indentStr(prop + ":" + space + toCssValue(value) + ";", indent);
          }
        }
      }
    } else {
      // Object syntax {fallbacks: {prop: value}}
      for (var _prop in fallbacks) {
        var _value = fallbacks[_prop];

        if (_value != null) {
          if (result) result += linebreak;
          result += indentStr(_prop + ":" + space + toCssValue(_value) + ";", indent);
        }
      }
    }
  }

  for (var _prop2 in style) {
    var _value2 = style[_prop2];

    if (_value2 != null && _prop2 !== 'fallbacks') {
      if (result) result += linebreak;
      result += indentStr(_prop2 + ":" + space + toCssValue(_value2) + ";", indent);
    }
  } // Allow empty style in this case, because properties will be added dynamically.


  if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.

  if (!selector) return result;
  indent--;
  if (result) result = "" + linebreak + result + linebreak;
  return indentStr("" + selector + space + "{" + result, indent) + indentStr('}', indent);
}

var escapeRegex = /([[\].#*$><+~=|^:(),"'`\s])/g;
var nativeEscape = typeof CSS !== 'undefined' && CSS.escape;
var jss_esm_escape = (function (str) {
  return nativeEscape ? nativeEscape(str) : str.replace(escapeRegex, '\\$1');
});

var BaseStyleRule =
/*#__PURE__*/
function () {
  function BaseStyleRule(key, style, options) {
    this.type = 'style';
    this.isProcessed = false;
    var sheet = options.sheet,
        Renderer = options.Renderer;
    this.key = key;
    this.options = options;
    this.style = style;
    if (sheet) this.renderer = sheet.renderer;else if (Renderer) this.renderer = new Renderer();
  }
  /**
   * Get or set a style property.
   */


  var _proto = BaseStyleRule.prototype;

  _proto.prop = function prop(name, value, options) {
    // It's a getter.
    if (value === undefined) return this.style[name]; // Don't do anything if the value has not changed.

    var force = options ? options.force : false;
    if (!force && this.style[name] === value) return this;
    var newValue = value;

    if (!options || options.process !== false) {
      newValue = this.options.jss.plugins.onChangeValue(value, name, this);
    }

    var isEmpty = newValue == null || newValue === false;
    var isDefined = name in this.style; // Value is empty and wasn't defined before.

    if (isEmpty && !isDefined && !force) return this; // We are going to remove this value.

    var remove = isEmpty && isDefined;
    if (remove) delete this.style[name];else this.style[name] = newValue; // Renderable is defined if StyleSheet option `link` is true.

    if (this.renderable && this.renderer) {
      if (remove) this.renderer.removeProperty(this.renderable, name);else this.renderer.setProperty(this.renderable, name, newValue);
      return this;
    }

    var sheet = this.options.sheet;

    if (sheet && sheet.attached) {
       false ? 0 : void 0;
    }

    return this;
  };

  return BaseStyleRule;
}();
var StyleRule =
/*#__PURE__*/
function (_BaseStyleRule) {
  _inheritsLoose(StyleRule, _BaseStyleRule);

  function StyleRule(key, style, options) {
    var _this;

    _this = _BaseStyleRule.call(this, key, style, options) || this;
    var selector = options.selector,
        scoped = options.scoped,
        sheet = options.sheet,
        generateId = options.generateId;

    if (selector) {
      _this.selectorText = selector;
    } else if (scoped !== false) {
      _this.id = generateId(_assertThisInitialized(_assertThisInitialized(_this)), sheet);
      _this.selectorText = "." + jss_esm_escape(_this.id);
    }

    return _this;
  }
  /**
   * Set selector string.
   * Attention: use this with caution. Most browsers didn't implement
   * selectorText setter, so this may result in rerendering of entire Style Sheet.
   */


  var _proto2 = StyleRule.prototype;

  /**
   * Apply rule to an element inline.
   */
  _proto2.applyTo = function applyTo(renderable) {
    var renderer = this.renderer;

    if (renderer) {
      var json = this.toJSON();

      for (var prop in json) {
        renderer.setProperty(renderable, prop, json[prop]);
      }
    }

    return this;
  }
  /**
   * Returns JSON representation of the rule.
   * Fallbacks are not supported.
   * Useful for inline styles.
   */
  ;

  _proto2.toJSON = function toJSON() {
    var json = {};

    for (var prop in this.style) {
      var value = this.style[prop];
      if (typeof value !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = toCssValue(value);
    }

    return json;
  }
  /**
   * Generates a CSS string.
   */
  ;

  _proto2.toString = function toString(options) {
    var sheet = this.options.sheet;
    var link = sheet ? sheet.options.link : false;
    var opts = link ? (0,esm_extends/* default */.A)({}, options, {
      allowEmpty: true
    }) : options;
    return toCss(this.selectorText, this.style, opts);
  };

  createClass_createClass(StyleRule, [{
    key: "selector",
    set: function set(selector) {
      if (selector === this.selectorText) return;
      this.selectorText = selector;
      var renderer = this.renderer,
          renderable = this.renderable;
      if (!renderable || !renderer) return;
      var hasChanged = renderer.setSelector(renderable, selector); // If selector setter is not implemented, rerender the rule.

      if (!hasChanged) {
        renderer.replaceRule(renderable, this);
      }
    }
    /**
     * Get selector string.
     */
    ,
    get: function get() {
      return this.selectorText;
    }
  }]);

  return StyleRule;
}(BaseStyleRule);
var pluginStyleRule = {
  onCreateRule: function onCreateRule(key, style, options) {
    if (key[0] === '@' || options.parent && options.parent.type === 'keyframes') {
      return null;
    }

    return new StyleRule(key, style, options);
  }
};

var defaultToStringOptions = {
  indent: 1,
  children: true
};
var atRegExp = /@([\w-]+)/;
/**
 * Conditional rule for @media, @supports
 */

var ConditionalRule =
/*#__PURE__*/
function () {
  function ConditionalRule(key, styles, options) {
    this.type = 'conditional';
    this.isProcessed = false;
    this.key = key;
    var atMatch = key.match(atRegExp);
    this.at = atMatch ? atMatch[1] : 'unknown'; // Key might contain a unique suffix in case the `name` passed by user was duplicate.

    this.query = options.name || "@" + this.at;
    this.options = options;
    this.rules = new RuleList((0,esm_extends/* default */.A)({}, options, {
      parent: this
    }));

    for (var name in styles) {
      this.rules.add(name, styles[name]);
    }

    this.rules.process();
  }
  /**
   * Get a rule.
   */


  var _proto = ConditionalRule.prototype;

  _proto.getRule = function getRule(name) {
    return this.rules.get(name);
  }
  /**
   * Get index of a rule.
   */
  ;

  _proto.indexOf = function indexOf(rule) {
    return this.rules.indexOf(rule);
  }
  /**
   * Create and register rule, run plugins.
   */
  ;

  _proto.addRule = function addRule(name, style, options) {
    var rule = this.rules.add(name, style, options);
    if (!rule) return null;
    this.options.jss.plugins.onProcessRule(rule);
    return rule;
  }
  /**
   * Replace rule, run plugins.
   */
  ;

  _proto.replaceRule = function replaceRule(name, style, options) {
    var newRule = this.rules.replace(name, style, options);
    if (newRule) this.options.jss.plugins.onProcessRule(newRule);
    return newRule;
  }
  /**
   * Generates a CSS string.
   */
  ;

  _proto.toString = function toString(options) {
    if (options === void 0) {
      options = defaultToStringOptions;
    }

    var _getWhitespaceSymbols = getWhitespaceSymbols(options),
        linebreak = _getWhitespaceSymbols.linebreak;

    if (options.indent == null) options.indent = defaultToStringOptions.indent;
    if (options.children == null) options.children = defaultToStringOptions.children;

    if (options.children === false) {
      return this.query + " {}";
    }

    var children = this.rules.toString(options);
    return children ? this.query + " {" + linebreak + children + linebreak + "}" : '';
  };

  return ConditionalRule;
}();
var keyRegExp = /@container|@media|@supports\s+/;
var pluginConditionalRule = {
  onCreateRule: function onCreateRule(key, styles, options) {
    return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null;
  }
};

var defaultToStringOptions$1 = {
  indent: 1,
  children: true
};
var nameRegExp = /@keyframes\s+([\w-]+)/;
/**
 * Rule for @keyframes
 */

var KeyframesRule =
/*#__PURE__*/
function () {
  function KeyframesRule(key, frames, options) {
    this.type = 'keyframes';
    this.at = '@keyframes';
    this.isProcessed = false;
    var nameMatch = key.match(nameRegExp);

    if (nameMatch && nameMatch[1]) {
      this.name = nameMatch[1];
    } else {
      this.name = 'noname';
       false ? 0 : void 0;
    }

    this.key = this.type + "-" + this.name;
    this.options = options;
    var scoped = options.scoped,
        sheet = options.sheet,
        generateId = options.generateId;
    this.id = scoped === false ? this.name : jss_esm_escape(generateId(this, sheet));
    this.rules = new RuleList((0,esm_extends/* default */.A)({}, options, {
      parent: this
    }));

    for (var name in frames) {
      this.rules.add(name, frames[name], (0,esm_extends/* default */.A)({}, options, {
        parent: this
      }));
    }

    this.rules.process();
  }
  /**
   * Generates a CSS string.
   */


  var _proto = KeyframesRule.prototype;

  _proto.toString = function toString(options) {
    if (options === void 0) {
      options = defaultToStringOptions$1;
    }

    var _getWhitespaceSymbols = getWhitespaceSymbols(options),
        linebreak = _getWhitespaceSymbols.linebreak;

    if (options.indent == null) options.indent = defaultToStringOptions$1.indent;
    if (options.children == null) options.children = defaultToStringOptions$1.children;

    if (options.children === false) {
      return this.at + " " + this.id + " {}";
    }

    var children = this.rules.toString(options);
    if (children) children = "" + linebreak + children + linebreak;
    return this.at + " " + this.id + " {" + children + "}";
  };

  return KeyframesRule;
}();
var keyRegExp$1 = /@keyframes\s+/;
var refRegExp = /\$([\w-]+)/g;

var findReferencedKeyframe = function findReferencedKeyframe(val, keyframes) {
  if (typeof val === 'string') {
    return val.replace(refRegExp, function (match, name) {
      if (name in keyframes) {
        return keyframes[name];
      }

       false ? 0 : void 0;
      return match;
    });
  }

  return val;
};
/**
 * Replace the reference for a animation name.
 */


var replaceRef = function replaceRef(style, prop, keyframes) {
  var value = style[prop];
  var refKeyframe = findReferencedKeyframe(value, keyframes);

  if (refKeyframe !== value) {
    style[prop] = refKeyframe;
  }
};

var pluginKeyframesRule = {
  onCreateRule: function onCreateRule(key, frames, options) {
    return typeof key === 'string' && keyRegExp$1.test(key) ? new KeyframesRule(key, frames, options) : null;
  },
  // Animation name ref replacer.
  onProcessStyle: function onProcessStyle(style, rule, sheet) {
    if (rule.type !== 'style' || !sheet) return style;
    if ('animation-name' in style) replaceRef(style, 'animation-name', sheet.keyframes);
    if ('animation' in style) replaceRef(style, 'animation', sheet.keyframes);
    return style;
  },
  onChangeValue: function onChangeValue(val, prop, rule) {
    var sheet = rule.options.sheet;

    if (!sheet) {
      return val;
    }

    switch (prop) {
      case 'animation':
        return findReferencedKeyframe(val, sheet.keyframes);

      case 'animation-name':
        return findReferencedKeyframe(val, sheet.keyframes);

      default:
        return val;
    }
  }
};

var KeyframeRule =
/*#__PURE__*/
function (_BaseStyleRule) {
  _inheritsLoose(KeyframeRule, _BaseStyleRule);

  function KeyframeRule() {
    return _BaseStyleRule.apply(this, arguments) || this;
  }

  var _proto = KeyframeRule.prototype;

  /**
   * Generates a CSS string.
   */
  _proto.toString = function toString(options) {
    var sheet = this.options.sheet;
    var link = sheet ? sheet.options.link : false;
    var opts = link ? (0,esm_extends/* default */.A)({}, options, {
      allowEmpty: true
    }) : options;
    return toCss(this.key, this.style, opts);
  };

  return KeyframeRule;
}(BaseStyleRule);
var pluginKeyframeRule = {
  onCreateRule: function onCreateRule(key, style, options) {
    if (options.parent && options.parent.type === 'keyframes') {
      return new KeyframeRule(key, style, options);
    }

    return null;
  }
};

var FontFaceRule =
/*#__PURE__*/
function () {
  function FontFaceRule(key, style, options) {
    this.type = 'font-face';
    this.at = '@font-face';
    this.isProcessed = false;
    this.key = key;
    this.style = style;
    this.options = options;
  }
  /**
   * Generates a CSS string.
   */


  var _proto = FontFaceRule.prototype;

  _proto.toString = function toString(options) {
    var _getWhitespaceSymbols = getWhitespaceSymbols(options),
        linebreak = _getWhitespaceSymbols.linebreak;

    if (Array.isArray(this.style)) {
      var str = '';

      for (var index = 0; index < this.style.length; index++) {
        str += toCss(this.at, this.style[index]);
        if (this.style[index + 1]) str += linebreak;
      }

      return str;
    }

    return toCss(this.at, this.style, options);
  };

  return FontFaceRule;
}();
var keyRegExp$2 = /@font-face/;
var pluginFontFaceRule = {
  onCreateRule: function onCreateRule(key, style, options) {
    return keyRegExp$2.test(key) ? new FontFaceRule(key, style, options) : null;
  }
};

var ViewportRule =
/*#__PURE__*/
function () {
  function ViewportRule(key, style, options) {
    this.type = 'viewport';
    this.at = '@viewport';
    this.isProcessed = false;
    this.key = key;
    this.style = style;
    this.options = options;
  }
  /**
   * Generates a CSS string.
   */


  var _proto = ViewportRule.prototype;

  _proto.toString = function toString(options) {
    return toCss(this.key, this.style, options);
  };

  return ViewportRule;
}();
var pluginViewportRule = {
  onCreateRule: function onCreateRule(key, style, options) {
    return key === '@viewport' || key === '@-ms-viewport' ? new ViewportRule(key, style, options) : null;
  }
};

var SimpleRule =
/*#__PURE__*/
function () {
  function SimpleRule(key, value, options) {
    this.type = 'simple';
    this.isProcessed = false;
    this.key = key;
    this.value = value;
    this.options = options;
  }
  /**
   * Generates a CSS string.
   */
  // eslint-disable-next-line no-unused-vars


  var _proto = SimpleRule.prototype;

  _proto.toString = function toString(options) {
    if (Array.isArray(this.value)) {
      var str = '';

      for (var index = 0; index < this.value.length; index++) {
        str += this.key + " " + this.value[index] + ";";
        if (this.value[index + 1]) str += '\n';
      }

      return str;
    }

    return this.key + " " + this.value + ";";
  };

  return SimpleRule;
}();
var keysMap = {
  '@charset': true,
  '@import': true,
  '@namespace': true
};
var pluginSimpleRule = {
  onCreateRule: function onCreateRule(key, value, options) {
    return key in keysMap ? new SimpleRule(key, value, options) : null;
  }
};

var plugins = [pluginStyleRule, pluginConditionalRule, pluginKeyframesRule, pluginKeyframeRule, pluginFontFaceRule, pluginViewportRule, pluginSimpleRule];

var defaultUpdateOptions = {
  process: true
};
var forceUpdateOptions = {
  force: true,
  process: true
  /**
   * Contains rules objects and allows adding/removing etc.
   * Is used for e.g. by `StyleSheet` or `ConditionalRule`.
   */

};

var RuleList =
/*#__PURE__*/
function () {
  // Rules registry for access by .get() method.
  // It contains the same rule registered by name and by selector.
  // Original styles object.
  // Used to ensure correct rules order.
  function RuleList(options) {
    this.map = {};
    this.raw = {};
    this.index = [];
    this.counter = 0;
    this.options = options;
    this.classes = options.classes;
    this.keyframes = options.keyframes;
  }
  /**
   * Create and register rule.
   *
   * Will not render after Style Sheet was rendered the first time.
   */


  var _proto = RuleList.prototype;

  _proto.add = function add(name, decl, ruleOptions) {
    var _this$options = this.options,
        parent = _this$options.parent,
        sheet = _this$options.sheet,
        jss = _this$options.jss,
        Renderer = _this$options.Renderer,
        generateId = _this$options.generateId,
        scoped = _this$options.scoped;

    var options = (0,esm_extends/* default */.A)({
      classes: this.classes,
      parent: parent,
      sheet: sheet,
      jss: jss,
      Renderer: Renderer,
      generateId: generateId,
      scoped: scoped,
      name: name,
      keyframes: this.keyframes,
      selector: undefined
    }, ruleOptions); // When user uses .createStyleSheet(), duplicate names are not possible, but
    // `sheet.addRule()` opens the door for any duplicate rule name. When this happens
    // we need to make the key unique within this RuleList instance scope.


    var key = name;

    if (name in this.raw) {
      key = name + "-d" + this.counter++;
    } // We need to save the original decl before creating the rule
    // because cache plugin needs to use it as a key to return a cached rule.


    this.raw[key] = decl;

    if (key in this.classes) {
      // E.g. rules inside of @media container
      options.selector = "." + jss_esm_escape(this.classes[key]);
    }

    var rule = createRule(key, decl, options);
    if (!rule) return null;
    this.register(rule);
    var index = options.index === undefined ? this.index.length : options.index;
    this.index.splice(index, 0, rule);
    return rule;
  }
  /**
   * Replace rule.
   * Create a new rule and remove old one instead of overwriting
   * because we want to invoke onCreateRule hook to make plugins work.
   */
  ;

  _proto.replace = function replace(name, decl, ruleOptions) {
    var oldRule = this.get(name);
    var oldIndex = this.index.indexOf(oldRule);

    if (oldRule) {
      this.remove(oldRule);
    }

    var options = ruleOptions;
    if (oldIndex !== -1) options = (0,esm_extends/* default */.A)({}, ruleOptions, {
      index: oldIndex
    });
    return this.add(name, decl, options);
  }
  /**
   * Get a rule by name or selector.
   */
  ;

  _proto.get = function get(nameOrSelector) {
    return this.map[nameOrSelector];
  }
  /**
   * Delete a rule.
   */
  ;

  _proto.remove = function remove(rule) {
    this.unregister(rule);
    delete this.raw[rule.key];
    this.index.splice(this.index.indexOf(rule), 1);
  }
  /**
   * Get index of a rule.
   */
  ;

  _proto.indexOf = function indexOf(rule) {
    return this.index.indexOf(rule);
  }
  /**
   * Run `onProcessRule()` plugins on every rule.
   */
  ;

  _proto.process = function process() {
    var plugins = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop
    // we end up with very hard-to-track-down side effects.

    this.index.slice(0).forEach(plugins.onProcessRule, plugins);
  }
  /**
   * Register a rule in `.map`, `.classes` and `.keyframes` maps.
   */
  ;

  _proto.register = function register(rule) {
    this.map[rule.key] = rule;

    if (rule instanceof StyleRule) {
      this.map[rule.selector] = rule;
      if (rule.id) this.classes[rule.key] = rule.id;
    } else if (rule instanceof KeyframesRule && this.keyframes) {
      this.keyframes[rule.name] = rule.id;
    }
  }
  /**
   * Unregister a rule.
   */
  ;

  _proto.unregister = function unregister(rule) {
    delete this.map[rule.key];

    if (rule instanceof StyleRule) {
      delete this.map[rule.selector];
      delete this.classes[rule.key];
    } else if (rule instanceof KeyframesRule) {
      delete this.keyframes[rule.name];
    }
  }
  /**
   * Update the function values with a new data.
   */
  ;

  _proto.update = function update() {
    var name;
    var data;
    var options;

    if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {
      name = arguments.length <= 0 ? undefined : arguments[0];
      data = arguments.length <= 1 ? undefined : arguments[1];
      options = arguments.length <= 2 ? undefined : arguments[2];
    } else {
      data = arguments.length <= 0 ? undefined : arguments[0];
      options = arguments.length <= 1 ? undefined : arguments[1];
      name = null;
    }

    if (name) {
      this.updateOne(this.get(name), data, options);
    } else {
      for (var index = 0; index < this.index.length; index++) {
        this.updateOne(this.index[index], data, options);
      }
    }
  }
  /**
   * Execute plugins, update rule props.
   */
  ;

  _proto.updateOne = function updateOne(rule, data, options) {
    if (options === void 0) {
      options = defaultUpdateOptions;
    }

    var _this$options2 = this.options,
        plugins = _this$options2.jss.plugins,
        sheet = _this$options2.sheet; // It is a rules container like for e.g. ConditionalRule.

    if (rule.rules instanceof RuleList) {
      rule.rules.update(data, options);
      return;
    }

    var style = rule.style;
    plugins.onUpdate(data, rule, sheet, options); // We rely on a new `style` ref in case it was mutated during onUpdate hook.

    if (options.process && style && style !== rule.style) {
      // We need to run the plugins in case new `style` relies on syntax plugins.
      plugins.onProcessStyle(rule.style, rule, sheet); // Update and add props.

      for (var prop in rule.style) {
        var nextValue = rule.style[prop];
        var prevValue = style[prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.
        // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.

        if (nextValue !== prevValue) {
          rule.prop(prop, nextValue, forceUpdateOptions);
        }
      } // Remove props.


      for (var _prop in style) {
        var _nextValue = rule.style[_prop];
        var _prevValue = style[_prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.
        // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.

        if (_nextValue == null && _nextValue !== _prevValue) {
          rule.prop(_prop, null, forceUpdateOptions);
        }
      }
    }
  }
  /**
   * Convert rules to a CSS string.
   */
  ;

  _proto.toString = function toString(options) {
    var str = '';
    var sheet = this.options.sheet;
    var link = sheet ? sheet.options.link : false;

    var _getWhitespaceSymbols = getWhitespaceSymbols(options),
        linebreak = _getWhitespaceSymbols.linebreak;

    for (var index = 0; index < this.index.length; index++) {
      var rule = this.index[index];
      var css = rule.toString(options); // No need to render an empty rule.

      if (!css && !link) continue;
      if (str) str += linebreak;
      str += css;
    }

    return str;
  };

  return RuleList;
}();

var StyleSheet =
/*#__PURE__*/
function () {
  function StyleSheet(styles, options) {
    this.attached = false;
    this.deployed = false;
    this.classes = {};
    this.keyframes = {};
    this.options = (0,esm_extends/* default */.A)({}, options, {
      sheet: this,
      parent: this,
      classes: this.classes,
      keyframes: this.keyframes
    });

    if (options.Renderer) {
      this.renderer = new options.Renderer(this);
    }

    this.rules = new RuleList(this.options);

    for (var name in styles) {
      this.rules.add(name, styles[name]);
    }

    this.rules.process();
  }
  /**
   * Attach renderable to the render tree.
   */


  var _proto = StyleSheet.prototype;

  _proto.attach = function attach() {
    if (this.attached) return this;
    if (this.renderer) this.renderer.attach();
    this.attached = true; // Order is important, because we can't use insertRule API if style element is not attached.

    if (!this.deployed) this.deploy();
    return this;
  }
  /**
   * Remove renderable from render tree.
   */
  ;

  _proto.detach = function detach() {
    if (!this.attached) return this;
    if (this.renderer) this.renderer.detach();
    this.attached = false;
    return this;
  }
  /**
   * Add a rule to the current stylesheet.
   * Will insert a rule also after the stylesheet has been rendered first time.
   */
  ;

  _proto.addRule = function addRule(name, decl, options) {
    var queue = this.queue; // Plugins can create rules.
    // In order to preserve the right order, we need to queue all `.addRule` calls,
    // which happen after the first `rules.add()` call.

    if (this.attached && !queue) this.queue = [];
    var rule = this.rules.add(name, decl, options);
    if (!rule) return null;
    this.options.jss.plugins.onProcessRule(rule);

    if (this.attached) {
      if (!this.deployed) return rule; // Don't insert rule directly if there is no stringified version yet.
      // It will be inserted all together when .attach is called.

      if (queue) queue.push(rule);else {
        this.insertRule(rule);

        if (this.queue) {
          this.queue.forEach(this.insertRule, this);
          this.queue = undefined;
        }
      }
      return rule;
    } // We can't add rules to a detached style node.
    // We will redeploy the sheet once user will attach it.


    this.deployed = false;
    return rule;
  }
  /**
   * Replace a rule in the current stylesheet.
   */
  ;

  _proto.replaceRule = function replaceRule(nameOrSelector, decl, options) {
    var oldRule = this.rules.get(nameOrSelector);
    if (!oldRule) return this.addRule(nameOrSelector, decl, options);
    var newRule = this.rules.replace(nameOrSelector, decl, options);

    if (newRule) {
      this.options.jss.plugins.onProcessRule(newRule);
    }

    if (this.attached) {
      if (!this.deployed) return newRule; // Don't replace / delete rule directly if there is no stringified version yet.
      // It will be inserted all together when .attach is called.

      if (this.renderer) {
        if (!newRule) {
          this.renderer.deleteRule(oldRule);
        } else if (oldRule.renderable) {
          this.renderer.replaceRule(oldRule.renderable, newRule);
        }
      }

      return newRule;
    } // We can't replace rules to a detached style node.
    // We will redeploy the sheet once user will attach it.


    this.deployed = false;
    return newRule;
  }
  /**
   * Insert rule into the StyleSheet
   */
  ;

  _proto.insertRule = function insertRule(rule) {
    if (this.renderer) {
      this.renderer.insertRule(rule);
    }
  }
  /**
   * Create and add rules.
   * Will render also after Style Sheet was rendered the first time.
   */
  ;

  _proto.addRules = function addRules(styles, options) {
    var added = [];

    for (var name in styles) {
      var rule = this.addRule(name, styles[name], options);
      if (rule) added.push(rule);
    }

    return added;
  }
  /**
   * Get a rule by name or selector.
   */
  ;

  _proto.getRule = function getRule(nameOrSelector) {
    return this.rules.get(nameOrSelector);
  }
  /**
   * Delete a rule by name.
   * Returns `true`: if rule has been deleted from the DOM.
   */
  ;

  _proto.deleteRule = function deleteRule(name) {
    var rule = typeof name === 'object' ? name : this.rules.get(name);

    if (!rule || // Style sheet was created without link: true and attached, in this case we
    // won't be able to remove the CSS rule from the DOM.
    this.attached && !rule.renderable) {
      return false;
    }

    this.rules.remove(rule);

    if (this.attached && rule.renderable && this.renderer) {
      return this.renderer.deleteRule(rule.renderable);
    }

    return true;
  }
  /**
   * Get index of a rule.
   */
  ;

  _proto.indexOf = function indexOf(rule) {
    return this.rules.indexOf(rule);
  }
  /**
   * Deploy pure CSS string to a renderable.
   */
  ;

  _proto.deploy = function deploy() {
    if (this.renderer) this.renderer.deploy();
    this.deployed = true;
    return this;
  }
  /**
   * Update the function values with a new data.
   */
  ;

  _proto.update = function update() {
    var _this$rules;

    (_this$rules = this.rules).update.apply(_this$rules, arguments);

    return this;
  }
  /**
   * Updates a single rule.
   */
  ;

  _proto.updateOne = function updateOne(rule, data, options) {
    this.rules.updateOne(rule, data, options);
    return this;
  }
  /**
   * Convert rules to a CSS string.
   */
  ;

  _proto.toString = function toString(options) {
    return this.rules.toString(options);
  };

  return StyleSheet;
}();

var PluginsRegistry =
/*#__PURE__*/
function () {
  function PluginsRegistry() {
    this.plugins = {
      internal: [],
      external: []
    };
    this.registry = {};
  }

  var _proto = PluginsRegistry.prototype;

  /**
   * Call `onCreateRule` hooks and return an object if returned by a hook.
   */
  _proto.onCreateRule = function onCreateRule(name, decl, options) {
    for (var i = 0; i < this.registry.onCreateRule.length; i++) {
      var rule = this.registry.onCreateRule[i](name, decl, options);
      if (rule) return rule;
    }

    return null;
  }
  /**
   * Call `onProcessRule` hooks.
   */
  ;

  _proto.onProcessRule = function onProcessRule(rule) {
    if (rule.isProcessed) return;
    var sheet = rule.options.sheet;

    for (var i = 0; i < this.registry.onProcessRule.length; i++) {
      this.registry.onProcessRule[i](rule, sheet);
    }

    if (rule.style) this.onProcessStyle(rule.style, rule, sheet);
    rule.isProcessed = true;
  }
  /**
   * Call `onProcessStyle` hooks.
   */
  ;

  _proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {
    for (var i = 0; i < this.registry.onProcessStyle.length; i++) {
      rule.style = this.registry.onProcessStyle[i](rule.style, rule, sheet);
    }
  }
  /**
   * Call `onProcessSheet` hooks.
   */
  ;

  _proto.onProcessSheet = function onProcessSheet(sheet) {
    for (var i = 0; i < this.registry.onProcessSheet.length; i++) {
      this.registry.onProcessSheet[i](sheet);
    }
  }
  /**
   * Call `onUpdate` hooks.
   */
  ;

  _proto.onUpdate = function onUpdate(data, rule, sheet, options) {
    for (var i = 0; i < this.registry.onUpdate.length; i++) {
      this.registry.onUpdate[i](data, rule, sheet, options);
    }
  }
  /**
   * Call `onChangeValue` hooks.
   */
  ;

  _proto.onChangeValue = function onChangeValue(value, prop, rule) {
    var processedValue = value;

    for (var i = 0; i < this.registry.onChangeValue.length; i++) {
      processedValue = this.registry.onChangeValue[i](processedValue, prop, rule);
    }

    return processedValue;
  }
  /**
   * Register a plugin.
   */
  ;

  _proto.use = function use(newPlugin, options) {
    if (options === void 0) {
      options = {
        queue: 'external'
      };
    }

    var plugins = this.plugins[options.queue]; // Avoids applying same plugin twice, at least based on ref.

    if (plugins.indexOf(newPlugin) !== -1) {
      return;
    }

    plugins.push(newPlugin);
    this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {
      for (var name in plugin) {
        if (name in registry) {
          registry[name].push(plugin[name]);
        } else {
           false ? 0 : void 0;
        }
      }

      return registry;
    }, {
      onCreateRule: [],
      onProcessRule: [],
      onProcessStyle: [],
      onProcessSheet: [],
      onChangeValue: [],
      onUpdate: []
    });
  };

  return PluginsRegistry;
}();

/**
 * Sheets registry to access all instances in one place.
 */

var SheetsRegistry =
/*#__PURE__*/
function () {
  function SheetsRegistry() {
    this.registry = [];
  }

  var _proto = SheetsRegistry.prototype;

  /**
   * Register a Style Sheet.
   */
  _proto.add = function add(sheet) {
    var registry = this.registry;
    var index = sheet.options.index;
    if (registry.indexOf(sheet) !== -1) return;

    if (registry.length === 0 || index >= this.index) {
      registry.push(sheet);
      return;
    } // Find a position.


    for (var i = 0; i < registry.length; i++) {
      if (registry[i].options.index > index) {
        registry.splice(i, 0, sheet);
        return;
      }
    }
  }
  /**
   * Reset the registry.
   */
  ;

  _proto.reset = function reset() {
    this.registry = [];
  }
  /**
   * Remove a Style Sheet.
   */
  ;

  _proto.remove = function remove(sheet) {
    var index = this.registry.indexOf(sheet);
    this.registry.splice(index, 1);
  }
  /**
   * Convert all attached sheets to a CSS string.
   */
  ;

  _proto.toString = function toString(_temp) {
    var _ref = _temp === void 0 ? {} : _temp,
        attached = _ref.attached,
        options = (0,objectWithoutPropertiesLoose/* default */.A)(_ref, ["attached"]);

    var _getWhitespaceSymbols = getWhitespaceSymbols(options),
        linebreak = _getWhitespaceSymbols.linebreak;

    var css = '';

    for (var i = 0; i < this.registry.length; i++) {
      var sheet = this.registry[i];

      if (attached != null && sheet.attached !== attached) {
        continue;
      }

      if (css) css += linebreak;
      css += sheet.toString(options);
    }

    return css;
  };

  createClass_createClass(SheetsRegistry, [{
    key: "index",

    /**
     * Current highest index number.
     */
    get: function get() {
      return this.registry.length === 0 ? 0 : this.registry[this.registry.length - 1].options.index;
    }
  }]);

  return SheetsRegistry;
}();

/**
 * This is a global sheets registry. Only DomRenderer will add sheets to it.
 * On the server one should use an own SheetsRegistry instance and add the
 * sheets to it, because you need to make sure to create a new registry for
 * each request in order to not leak sheets across requests.
 */

var sheets = new SheetsRegistry();

/* eslint-disable */

/**
 * Now that `globalThis` is available on most platforms
 * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility)
 * we check for `globalThis` first. `globalThis` is necessary for jss
 * to run in Agoric's secure version of JavaScript (SES). Under SES,
 * `globalThis` exists, but `window`, `self`, and `Function('return
 * this')()` are all undefined for security reasons.
 *
 * https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
 */
var globalThis$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' && window.Math === Math ? window : typeof self !== 'undefined' && self.Math === Math ? self : Function('return this')();

var ns = '2f1acc6c3a606b082e5eef5e54414ffb';
if (globalThis$1[ns] == null) globalThis$1[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify
// the current version with just one short number and use it for classes generation
// we use a counter. Also it is more accurate, because user can manually reevaluate
// the module.

var moduleId = globalThis$1[ns]++;

var maxRules = 1e10;
/**
 * Returns a function which generates unique class names based on counters.
 * When new generator function is created, rule counter is reseted.
 * We need to reset the rule counter for SSR for each request.
 */

var createGenerateId = function createGenerateId(options) {
  if (options === void 0) {
    options = {};
  }

  var ruleCounter = 0;

  var generateId = function generateId(rule, sheet) {
    ruleCounter += 1;

    if (ruleCounter > maxRules) {
       false ? 0 : void 0;
    }

    var jssId = '';
    var prefix = '';

    if (sheet) {
      if (sheet.options.classNamePrefix) {
        prefix = sheet.options.classNamePrefix;
      }

      if (sheet.options.jss.id != null) {
        jssId = String(sheet.options.jss.id);
      }
    }

    if (options.minify) {
      // Using "c" because a number can't be the first char in a class name.
      return "" + (prefix || 'c') + moduleId + jssId + ruleCounter;
    }

    return prefix + rule.key + "-" + moduleId + (jssId ? "-" + jssId : '') + "-" + ruleCounter;
  };

  return generateId;
};

/**
 * Cache the value from the first time a function is called.
 */

var memoize = function memoize(fn) {
  var value;
  return function () {
    if (!value) value = fn();
    return value;
  };
};
/**
 * Get a style property value.
 */


var getPropertyValue = function getPropertyValue(cssRule, prop) {
  try {
    // Support CSSTOM.
    if (cssRule.attributeStyleMap) {
      return cssRule.attributeStyleMap.get(prop);
    }

    return cssRule.style.getPropertyValue(prop);
  } catch (err) {
    // IE may throw if property is unknown.
    return '';
  }
};
/**
 * Set a style property.
 */


var setProperty = function setProperty(cssRule, prop, value) {
  try {
    var cssValue = value;

    if (Array.isArray(value)) {
      cssValue = toCssValue(value);
    } // Support CSSTOM.


    if (cssRule.attributeStyleMap) {
      cssRule.attributeStyleMap.set(prop, cssValue);
    } else {
      var indexOfImportantFlag = cssValue ? cssValue.indexOf('!important') : -1;
      var cssValueWithoutImportantFlag = indexOfImportantFlag > -1 ? cssValue.substr(0, indexOfImportantFlag - 1) : cssValue;
      cssRule.style.setProperty(prop, cssValueWithoutImportantFlag, indexOfImportantFlag > -1 ? 'important' : '');
    }
  } catch (err) {
    // IE may throw if property is unknown.
    return false;
  }

  return true;
};
/**
 * Remove a style property.
 */


var removeProperty = function removeProperty(cssRule, prop) {
  try {
    // Support CSSTOM.
    if (cssRule.attributeStyleMap) {
      cssRule.attributeStyleMap.delete(prop);
    } else {
      cssRule.style.removeProperty(prop);
    }
  } catch (err) {
     false ? 0 : void 0;
  }
};
/**
 * Set the selector.
 */


var setSelector = function setSelector(cssRule, selectorText) {
  cssRule.selectorText = selectorText; // Return false if setter was not successful.
  // Currently works in chrome only.

  return cssRule.selectorText === selectorText;
};
/**
 * Gets the `head` element upon the first call and caches it.
 * We assume it can't be null.
 */


var getHead = memoize(function () {
  return document.querySelector('head');
});
/**
 * Find attached sheet with an index higher than the passed one.
 */

function findHigherSheet(registry, options) {
  for (var i = 0; i < registry.length; i++) {
    var sheet = registry[i];

    if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {
      return sheet;
    }
  }

  return null;
}
/**
 * Find attached sheet with the highest index.
 */


function findHighestSheet(registry, options) {
  for (var i = registry.length - 1; i >= 0; i--) {
    var sheet = registry[i];

    if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {
      return sheet;
    }
  }

  return null;
}
/**
 * Find a comment with "jss" inside.
 */


function findCommentNode(text) {
  var head = getHead();

  for (var i = 0; i < head.childNodes.length; i++) {
    var node = head.childNodes[i];

    if (node.nodeType === 8 && node.nodeValue.trim() === text) {
      return node;
    }
  }

  return null;
}
/**
 * Find a node before which we can insert the sheet.
 */


function findPrevNode(options) {
  var registry = sheets.registry;

  if (registry.length > 0) {
    // Try to insert before the next higher sheet.
    var sheet = findHigherSheet(registry, options);

    if (sheet && sheet.renderer) {
      return {
        parent: sheet.renderer.element.parentNode,
        node: sheet.renderer.element
      };
    } // Otherwise insert after the last attached.


    sheet = findHighestSheet(registry, options);

    if (sheet && sheet.renderer) {
      return {
        parent: sheet.renderer.element.parentNode,
        node: sheet.renderer.element.nextSibling
      };
    }
  } // Try to find a comment placeholder if registry is empty.


  var insertionPoint = options.insertionPoint;

  if (insertionPoint && typeof insertionPoint === 'string') {
    var comment = findCommentNode(insertionPoint);

    if (comment) {
      return {
        parent: comment.parentNode,
        node: comment.nextSibling
      };
    } // If user specifies an insertion point and it can't be found in the document -
    // bad specificity issues may appear.


     false ? 0 : void 0;
  }

  return false;
}
/**
 * Insert style element into the DOM.
 */


function insertStyle(style, options) {
  var insertionPoint = options.insertionPoint;
  var nextNode = findPrevNode(options);

  if (nextNode !== false && nextNode.parent) {
    nextNode.parent.insertBefore(style, nextNode.node);
    return;
  } // Works with iframes and any node types.


  if (insertionPoint && typeof insertionPoint.nodeType === 'number') {
    var insertionPointElement = insertionPoint;
    var parentNode = insertionPointElement.parentNode;
    if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else  false ? 0 : void 0;
    return;
  }

  getHead().appendChild(style);
}
/**
 * Read jss nonce setting from the page if the user has set it.
 */


var getNonce = memoize(function () {
  var node = document.querySelector('meta[property="csp-nonce"]');
  return node ? node.getAttribute('content') : null;
});

var _insertRule = function insertRule(container, rule, index) {
  try {
    if ('insertRule' in container) {
      container.insertRule(rule, index);
    } // Keyframes rule.
    else if ('appendRule' in container) {
        container.appendRule(rule);
      }
  } catch (err) {
     false ? 0 : void 0;
    return false;
  }

  return container.cssRules[index];
};

var getValidRuleInsertionIndex = function getValidRuleInsertionIndex(container, index) {
  var maxIndex = container.cssRules.length; // In case previous insertion fails, passed index might be wrong

  if (index === undefined || index > maxIndex) {
    // eslint-disable-next-line no-param-reassign
    return maxIndex;
  }

  return index;
};

var createStyle = function createStyle() {
  var el = document.createElement('style'); // Without it, IE will have a broken source order specificity if we
  // insert rules after we insert the style tag.
  // It seems to kick-off the source order specificity algorithm.

  el.textContent = '\n';
  return el;
};

var DomRenderer =
/*#__PURE__*/
function () {
  // Will be empty if link: true option is not set, because
  // it is only for use together with insertRule API.
  function DomRenderer(sheet) {
    this.getPropertyValue = getPropertyValue;
    this.setProperty = setProperty;
    this.removeProperty = removeProperty;
    this.setSelector = setSelector;
    this.hasInsertedRules = false;
    this.cssRules = [];
    // There is no sheet when the renderer is used from a standalone StyleRule.
    if (sheet) sheets.add(sheet);
    this.sheet = sheet;

    var _ref = this.sheet ? this.sheet.options : {},
        media = _ref.media,
        meta = _ref.meta,
        element = _ref.element;

    this.element = element || createStyle();
    this.element.setAttribute('data-jss', '');
    if (media) this.element.setAttribute('media', media);
    if (meta) this.element.setAttribute('data-meta', meta);
    var nonce = getNonce();
    if (nonce) this.element.setAttribute('nonce', nonce);
  }
  /**
   * Insert style element into render tree.
   */


  var _proto = DomRenderer.prototype;

  _proto.attach = function attach() {
    // In the case the element node is external and it is already in the DOM.
    if (this.element.parentNode || !this.sheet) return;
    insertStyle(this.element, this.sheet.options); // When rules are inserted using `insertRule` API, after `sheet.detach().attach()`
    // most browsers create a new CSSStyleSheet, except of all IEs.

    var deployed = Boolean(this.sheet && this.sheet.deployed);

    if (this.hasInsertedRules && deployed) {
      this.hasInsertedRules = false;
      this.deploy();
    }
  }
  /**
   * Remove style element from render tree.
   */
  ;

  _proto.detach = function detach() {
    if (!this.sheet) return;
    var parentNode = this.element.parentNode;
    if (parentNode) parentNode.removeChild(this.element); // In the most browsers, rules inserted using insertRule() API will be lost when style element is removed.
    // Though IE will keep them and we need a consistent behavior.

    if (this.sheet.options.link) {
      this.cssRules = [];
      this.element.textContent = '\n';
    }
  }
  /**
   * Inject CSS string into element.
   */
  ;

  _proto.deploy = function deploy() {
    var sheet = this.sheet;
    if (!sheet) return;

    if (sheet.options.link) {
      this.insertRules(sheet.rules);
      return;
    }

    this.element.textContent = "\n" + sheet.toString() + "\n";
  }
  /**
   * Insert RuleList into an element.
   */
  ;

  _proto.insertRules = function insertRules(rules, nativeParent) {
    for (var i = 0; i < rules.index.length; i++) {
      this.insertRule(rules.index[i], i, nativeParent);
    }
  }
  /**
   * Insert a rule into element.
   */
  ;

  _proto.insertRule = function insertRule(rule, index, nativeParent) {
    if (nativeParent === void 0) {
      nativeParent = this.element.sheet;
    }

    if (rule.rules) {
      var parent = rule;
      var latestNativeParent = nativeParent;

      if (rule.type === 'conditional' || rule.type === 'keyframes') {
        var _insertionIndex = getValidRuleInsertionIndex(nativeParent, index); // We need to render the container without children first.


        latestNativeParent = _insertRule(nativeParent, parent.toString({
          children: false
        }), _insertionIndex);

        if (latestNativeParent === false) {
          return false;
        }

        this.refCssRule(rule, _insertionIndex, latestNativeParent);
      }

      this.insertRules(parent.rules, latestNativeParent);
      return latestNativeParent;
    }

    var ruleStr = rule.toString();
    if (!ruleStr) return false;
    var insertionIndex = getValidRuleInsertionIndex(nativeParent, index);

    var nativeRule = _insertRule(nativeParent, ruleStr, insertionIndex);

    if (nativeRule === false) {
      return false;
    }

    this.hasInsertedRules = true;
    this.refCssRule(rule, insertionIndex, nativeRule);
    return nativeRule;
  };

  _proto.refCssRule = function refCssRule(rule, index, cssRule) {
    rule.renderable = cssRule; // We only want to reference the top level rules, deleteRule API doesn't support removing nested rules
    // like rules inside media queries or keyframes

    if (rule.options.parent instanceof StyleSheet) {
      this.cssRules.splice(index, 0, cssRule);
    }
  }
  /**
   * Delete a rule.
   */
  ;

  _proto.deleteRule = function deleteRule(cssRule) {
    var sheet = this.element.sheet;
    var index = this.indexOf(cssRule);
    if (index === -1) return false;
    sheet.deleteRule(index);
    this.cssRules.splice(index, 1);
    return true;
  }
  /**
   * Get index of a CSS Rule.
   */
  ;

  _proto.indexOf = function indexOf(cssRule) {
    return this.cssRules.indexOf(cssRule);
  }
  /**
   * Generate a new CSS rule and replace the existing one.
   */
  ;

  _proto.replaceRule = function replaceRule(cssRule, rule) {
    var index = this.indexOf(cssRule);
    if (index === -1) return false;
    this.element.sheet.deleteRule(index);
    this.cssRules.splice(index, 1);
    return this.insertRule(rule, index);
  }
  /**
   * Get all rules elements.
   */
  ;

  _proto.getRules = function getRules() {
    return this.element.sheet.cssRules;
  };

  return DomRenderer;
}();

var instanceCounter = 0;

var Jss =
/*#__PURE__*/
function () {
  function Jss(options) {
    this.id = instanceCounter++;
    this.version = "10.10.0";
    this.plugins = new PluginsRegistry();
    this.options = {
      id: {
        minify: false
      },
      createGenerateId: createGenerateId,
      Renderer: dist_module ? DomRenderer : null,
      plugins: []
    };
    this.generateId = createGenerateId({
      minify: false
    });

    for (var i = 0; i < plugins.length; i++) {
      this.plugins.use(plugins[i], {
        queue: 'internal'
      });
    }

    this.setup(options);
  }
  /**
   * Prepares various options, applies plugins.
   * Should not be used twice on the same instance, because there is no plugins
   * deduplication logic.
   */


  var _proto = Jss.prototype;

  _proto.setup = function setup(options) {
    if (options === void 0) {
      options = {};
    }

    if (options.createGenerateId) {
      this.options.createGenerateId = options.createGenerateId;
    }

    if (options.id) {
      this.options.id = (0,esm_extends/* default */.A)({}, this.options.id, options.id);
    }

    if (options.createGenerateId || options.id) {
      this.generateId = this.options.createGenerateId(this.options.id);
    }

    if (options.insertionPoint != null) this.options.insertionPoint = options.insertionPoint;

    if ('Renderer' in options) {
      this.options.Renderer = options.Renderer;
    } // eslint-disable-next-line prefer-spread


    if (options.plugins) this.use.apply(this, options.plugins);
    return this;
  }
  /**
   * Create a Style Sheet.
   */
  ;

  _proto.createStyleSheet = function createStyleSheet(styles, options) {
    if (options === void 0) {
      options = {};
    }

    var _options = options,
        index = _options.index;

    if (typeof index !== 'number') {
      index = sheets.index === 0 ? 0 : sheets.index + 1;
    }

    var sheet = new StyleSheet(styles, (0,esm_extends/* default */.A)({}, options, {
      jss: this,
      generateId: options.generateId || this.generateId,
      insertionPoint: this.options.insertionPoint,
      Renderer: this.options.Renderer,
      index: index
    }));
    this.plugins.onProcessSheet(sheet);
    return sheet;
  }
  /**
   * Detach the Style Sheet and remove it from the registry.
   */
  ;

  _proto.removeStyleSheet = function removeStyleSheet(sheet) {
    sheet.detach();
    sheets.remove(sheet);
    return this;
  }
  /**
   * Create a rule without a Style Sheet.
   * [Deprecated] will be removed in the next major version.
   */
  ;

  _proto.createRule = function createRule$1(name, style, options) {
    if (style === void 0) {
      style = {};
    }

    if (options === void 0) {
      options = {};
    }

    // Enable rule without name for inline styles.
    if (typeof name === 'object') {
      return this.createRule(undefined, name, style);
    }

    var ruleOptions = (0,esm_extends/* default */.A)({}, options, {
      name: name,
      jss: this,
      Renderer: this.options.Renderer
    });

    if (!ruleOptions.generateId) ruleOptions.generateId = this.generateId;
    if (!ruleOptions.classes) ruleOptions.classes = {};
    if (!ruleOptions.keyframes) ruleOptions.keyframes = {};

    var rule = createRule(name, style, ruleOptions);

    if (rule) this.plugins.onProcessRule(rule);
    return rule;
  }
  /**
   * Register plugin. Passed function will be invoked with a rule instance.
   */
  ;

  _proto.use = function use() {
    var _this = this;

    for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
      plugins[_key] = arguments[_key];
    }

    plugins.forEach(function (plugin) {
      _this.plugins.use(plugin);
    });
    return this;
  };

  return Jss;
}();

var createJss = function createJss(options) {
  return new Jss(options);
};

/**
 * SheetsManager is like a WeakMap which is designed to count StyleSheet
 * instances and attach/detach automatically.
 * Used in react-jss.
 */

var SheetsManager =
/*#__PURE__*/
(/* unused pure expression or super */ null && (function () {
  function SheetsManager() {
    this.length = 0;
    this.sheets = new WeakMap();
  }

  var _proto = SheetsManager.prototype;

  _proto.get = function get(key) {
    var entry = this.sheets.get(key);
    return entry && entry.sheet;
  };

  _proto.add = function add(key, sheet) {
    if (this.sheets.has(key)) return;
    this.length++;
    this.sheets.set(key, {
      sheet: sheet,
      refs: 0
    });
  };

  _proto.manage = function manage(key) {
    var entry = this.sheets.get(key);

    if (entry) {
      if (entry.refs === 0) {
        entry.sheet.attach();
      }

      entry.refs++;
      return entry.sheet;
    }

    warning(false, "[JSS] SheetsManager: can't find sheet to manage");
    return undefined;
  };

  _proto.unmanage = function unmanage(key) {
    var entry = this.sheets.get(key);

    if (entry) {
      if (entry.refs > 0) {
        entry.refs--;
        if (entry.refs === 0) entry.sheet.detach();
      }
    } else {
      warning(false, "SheetsManager: can't find sheet to unmanage");
    }
  };

  _createClass(SheetsManager, [{
    key: "size",
    get: function get() {
      return this.length;
    }
  }]);

  return SheetsManager;
}()));

/**
* Export a constant indicating if this browser has CSSTOM support.
* https://developers.google.com/web/updates/2018/03/cssom
*/
var hasCSSTOMSupport = typeof CSS === 'object' && CSS != null && 'number' in CSS;

/**
 * Extracts a styles object with only props that contain function values.
 */
function getDynamicStyles(styles) {
  var to = null;

  for (var key in styles) {
    var value = styles[key];
    var type = typeof value;

    if (type === 'function') {
      if (!to) to = {};
      to[key] = value;
    } else if (type === 'object' && value !== null && !Array.isArray(value)) {
      var extracted = getDynamicStyles(value);

      if (extracted) {
        if (!to) to = {};
        to[key] = extracted;
      }
    }
  }

  return to;
}

/**
 * A better abstraction over CSS.
 *
 * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present
 * @website https://github.com/cssinjs/jss
 * @license MIT
 */
var index = createJss();

/* harmony default export */ var jss_esm = ((/* unused pure expression or super */ null && (index)));


;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/mergeClasses/mergeClasses.js


function mergeClasses() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var baseClasses = options.baseClasses,
      newClasses = options.newClasses,
      Component = options.Component;

  if (!newClasses) {
    return baseClasses;
  }

  var nextClasses = (0,esm_extends/* default */.A)({}, baseClasses);

  if (false) {}

  Object.keys(newClasses).forEach(function (key) {
    if (false) {}

    if (newClasses[key]) {
      nextClasses[key] = "".concat(baseClasses[key], " ").concat(newClasses[key]);
    }
  });
  return nextClasses;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/makeStyles/multiKeyStore.js
// Used https://github.com/thinkloop/multi-key-cache as inspiration
var multiKeyStore = {
  set: function set(cache, key1, key2, value) {
    var subCache = cache.get(key1);

    if (!subCache) {
      subCache = new Map();
      cache.set(key1, subCache);
    }

    subCache.set(key2, value);
  },
  get: function get(cache, key1, key2) {
    var subCache = cache.get(key1);
    return subCache ? subCache.get(key2) : undefined;
  },
  delete: function _delete(cache, key1, key2) {
    var subCache = cache.get(key1);
    subCache.delete(key2);
  }
};
/* harmony default export */ var makeStyles_multiKeyStore = (multiKeyStore);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/useTheme/ThemeContext.js

var src_ThemeContext = react.createContext(null);

if (false) {}

/* harmony default export */ var useTheme_ThemeContext = (src_ThemeContext);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/useTheme/useTheme.js


function useTheme() {
  var theme = react.useContext(useTheme_ThemeContext);

  if (false) {}

  return theme;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/ThemeProvider/nested.js
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
/* harmony default export */ var nested = (hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__');
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/createGenerateClassName/createGenerateClassName.js

/**
 * This is the list of the style rule name we use as drop in replacement for the built-in
 * pseudo classes (:checked, :disabled, :focused, etc.).
 *
 * Why do they exist in the first place?
 * These classes are used at a specificity of 2.
 * It allows them to override previously definied styles as well as
 * being untouched by simple user overrides.
 */

var pseudoClasses = ['checked', 'disabled', 'error', 'focused', 'focusVisible', 'required', 'expanded', 'selected']; // Returns a function which generates unique class names based on counters.
// When new generator function is created, rule counter is reset.
// We need to reset the rule counter for SSR for each request.
//
// It's inspired by
// https://github.com/cssinjs/jss/blob/4e6a05dd3f7b6572fdd3ab216861d9e446c20331/src/utils/createGenerateClassName.js

function createGenerateClassName() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var _options$disableGloba = options.disableGlobal,
      disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,
      _options$productionPr = options.productionPrefix,
      productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,
      _options$seed = options.seed,
      seed = _options$seed === void 0 ? '' : _options$seed;
  var seedPrefix = seed === '' ? '' : "".concat(seed, "-");
  var ruleCounter = 0;

  var getNextCounterId = function getNextCounterId() {
    ruleCounter += 1;

    if (false) {}

    return ruleCounter;
  };

  return function (rule, styleSheet) {
    var name = styleSheet.options.name; // Is a global static MUI style?

    if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {
      // We can use a shorthand class name, we never use the keys to style the components.
      if (pseudoClasses.indexOf(rule.key) !== -1) {
        return "Mui-".concat(rule.key);
      }

      var prefix = "".concat(seedPrefix).concat(name, "-").concat(rule.key);

      if (!styleSheet.options.theme[nested] || seed !== '') {
        return prefix;
      }

      return "".concat(prefix, "-").concat(getNextCounterId());
    }

    if (true) {
      return "".concat(seedPrefix).concat(productionPrefix).concat(getNextCounterId());
    }

    var suffix = "".concat(rule.key, "-").concat(getNextCounterId()); // Help with debuggability.

    if (styleSheet.options.classNamePrefix) {
      return "".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, "-").concat(suffix);
    }

    return "".concat(seedPrefix).concat(suffix);
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.esm.js



var now = Date.now();
var fnValuesNs = "fnValues" + now;
var fnRuleNs = "fnStyle" + ++now;

var functionPlugin = function functionPlugin() {
  return {
    onCreateRule: function onCreateRule(name, decl, options) {
      if (typeof decl !== 'function') return null;
      var rule = createRule(name, {}, options);
      rule[fnRuleNs] = decl;
      return rule;
    },
    onProcessStyle: function onProcessStyle(style, rule) {
      // We need to extract function values from the declaration, so that we can keep core unaware of them.
      // We need to do that only once.
      // We don't need to extract functions on each style update, since this can happen only once.
      // We don't support function values inside of function rules.
      if (fnValuesNs in rule || fnRuleNs in rule) return style;
      var fnValues = {};

      for (var prop in style) {
        var value = style[prop];
        if (typeof value !== 'function') continue;
        delete style[prop];
        fnValues[prop] = value;
      }

      rule[fnValuesNs] = fnValues;
      return style;
    },
    onUpdate: function onUpdate(data, rule, sheet, options) {
      var styleRule = rule;
      var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object
      // will be returned from that function.

      if (fnRule) {
        // Empty object will remove all currently defined props
        // in case function rule returns a falsy value.
        styleRule.style = fnRule(data) || {};

        if (false) { var prop; }
      }

      var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.

      if (fnValues) {
        for (var _prop in fnValues) {
          styleRule.prop(_prop, fnValues[_prop](data), options);
        }
      }
    }
  };
};

/* harmony default export */ var jss_plugin_rule_value_function_esm = (functionPlugin);

;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/jss-plugin-global/dist/jss-plugin-global.esm.js



var at = '@global';
var atPrefix = '@global ';

var GlobalContainerRule =
/*#__PURE__*/
function () {
  function GlobalContainerRule(key, styles, options) {
    this.type = 'global';
    this.at = at;
    this.isProcessed = false;
    this.key = key;
    this.options = options;
    this.rules = new RuleList((0,esm_extends/* default */.A)({}, options, {
      parent: this
    }));

    for (var selector in styles) {
      this.rules.add(selector, styles[selector]);
    }

    this.rules.process();
  }
  /**
   * Get a rule.
   */


  var _proto = GlobalContainerRule.prototype;

  _proto.getRule = function getRule(name) {
    return this.rules.get(name);
  }
  /**
   * Create and register rule, run plugins.
   */
  ;

  _proto.addRule = function addRule(name, style, options) {
    var rule = this.rules.add(name, style, options);
    if (rule) this.options.jss.plugins.onProcessRule(rule);
    return rule;
  }
  /**
   * Replace rule, run plugins.
   */
  ;

  _proto.replaceRule = function replaceRule(name, style, options) {
    var newRule = this.rules.replace(name, style, options);
    if (newRule) this.options.jss.plugins.onProcessRule(newRule);
    return newRule;
  }
  /**
   * Get index of a rule.
   */
  ;

  _proto.indexOf = function indexOf(rule) {
    return this.rules.indexOf(rule);
  }
  /**
   * Generates a CSS string.
   */
  ;

  _proto.toString = function toString(options) {
    return this.rules.toString(options);
  };

  return GlobalContainerRule;
}();

var GlobalPrefixedRule =
/*#__PURE__*/
function () {
  function GlobalPrefixedRule(key, style, options) {
    this.type = 'global';
    this.at = at;
    this.isProcessed = false;
    this.key = key;
    this.options = options;
    var selector = key.substr(atPrefix.length);
    this.rule = options.jss.createRule(selector, style, (0,esm_extends/* default */.A)({}, options, {
      parent: this
    }));
  }

  var _proto2 = GlobalPrefixedRule.prototype;

  _proto2.toString = function toString(options) {
    return this.rule ? this.rule.toString(options) : '';
  };

  return GlobalPrefixedRule;
}();

var separatorRegExp = /\s*,\s*/g;

function addScope(selector, scope) {
  var parts = selector.split(separatorRegExp);
  var scoped = '';

  for (var i = 0; i < parts.length; i++) {
    scoped += scope + " " + parts[i].trim();
    if (parts[i + 1]) scoped += ', ';
  }

  return scoped;
}

function handleNestedGlobalContainerRule(rule, sheet) {
  var options = rule.options,
      style = rule.style;
  var rules = style ? style[at] : null;
  if (!rules) return;

  for (var name in rules) {
    sheet.addRule(name, rules[name], (0,esm_extends/* default */.A)({}, options, {
      selector: addScope(name, rule.selector)
    }));
  }

  delete style[at];
}

function handlePrefixedGlobalRule(rule, sheet) {
  var options = rule.options,
      style = rule.style;

  for (var prop in style) {
    if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;
    var selector = addScope(prop.substr(at.length), rule.selector);
    sheet.addRule(selector, style[prop], (0,esm_extends/* default */.A)({}, options, {
      selector: selector
    }));
    delete style[prop];
  }
}
/**
 * Convert nested rules to separate, remove them from original styles.
 */


function jssGlobal() {
  function onCreateRule(name, styles, options) {
    if (!name) return null;

    if (name === at) {
      return new GlobalContainerRule(name, styles, options);
    }

    if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {
      return new GlobalPrefixedRule(name, styles, options);
    }

    var parent = options.parent;

    if (parent) {
      if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {
        options.scoped = false;
      }
    }

    if (!options.selector && options.scoped === false) {
      options.selector = name;
    }

    return null;
  }

  function onProcessRule(rule, sheet) {
    if (rule.type !== 'style' || !sheet) return;
    handleNestedGlobalContainerRule(rule, sheet);
    handlePrefixedGlobalRule(rule, sheet);
  }

  return {
    onCreateRule: onCreateRule,
    onProcessRule: onProcessRule
  };
}

/* harmony default export */ var jss_plugin_global_esm = (jssGlobal);

;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/jss-plugin-nested/dist/jss-plugin-nested.esm.js



var jss_plugin_nested_esm_separatorRegExp = /\s*,\s*/g;
var parentRegExp = /&/g;
var jss_plugin_nested_esm_refRegExp = /\$([\w-]+)/g;
/**
 * Convert nested rules to separate, remove them from original styles.
 */

function jssNested() {
  // Get a function to be used for $ref replacement.
  function getReplaceRef(container, sheet) {
    return function (match, key) {
      var rule = container.getRule(key) || sheet && sheet.getRule(key);

      if (rule) {
        return rule.selector;
      }

       false ? 0 : void 0;
      return key;
    };
  }

  function replaceParentRefs(nestedProp, parentProp) {
    var parentSelectors = parentProp.split(jss_plugin_nested_esm_separatorRegExp);
    var nestedSelectors = nestedProp.split(jss_plugin_nested_esm_separatorRegExp);
    var result = '';

    for (var i = 0; i < parentSelectors.length; i++) {
      var parent = parentSelectors[i];

      for (var j = 0; j < nestedSelectors.length; j++) {
        var nested = nestedSelectors[j];
        if (result) result += ', '; // Replace all & by the parent or prefix & with the parent.

        result += nested.indexOf('&') !== -1 ? nested.replace(parentRegExp, parent) : parent + " " + nested;
      }
    }

    return result;
  }

  function getOptions(rule, container, prevOptions) {
    // Options has been already created, now we only increase index.
    if (prevOptions) return (0,esm_extends/* default */.A)({}, prevOptions, {
      index: prevOptions.index + 1
    });
    var nestingLevel = rule.options.nestingLevel;
    nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1;

    var options = (0,esm_extends/* default */.A)({}, rule.options, {
      nestingLevel: nestingLevel,
      index: container.indexOf(rule) + 1 // We don't need the parent name to be set options for chlid.

    });

    delete options.name;
    return options;
  }

  function onProcessStyle(style, rule, sheet) {
    if (rule.type !== 'style') return style;
    var styleRule = rule;
    var container = styleRule.options.parent;
    var options;
    var replaceRef;

    for (var prop in style) {
      var isNested = prop.indexOf('&') !== -1;
      var isNestedConditional = prop[0] === '@';
      if (!isNested && !isNestedConditional) continue;
      options = getOptions(styleRule, container, options);

      if (isNested) {
        var selector = replaceParentRefs(prop, styleRule.selector); // Lazily create the ref replacer function just once for
        // all nested rules within the sheet.

        if (!replaceRef) replaceRef = getReplaceRef(container, sheet); // Replace all $refs.

        selector = selector.replace(jss_plugin_nested_esm_refRegExp, replaceRef);
        var name = styleRule.key + "-" + prop;

        if ('replaceRule' in container) {
          // for backward compatibility
          container.replaceRule(name, style[prop], (0,esm_extends/* default */.A)({}, options, {
            selector: selector
          }));
        } else {
          container.addRule(name, style[prop], (0,esm_extends/* default */.A)({}, options, {
            selector: selector
          }));
        }
      } else if (isNestedConditional) {
        // Place conditional right after the parent rule to ensure right ordering.
        container.addRule(prop, {}, options).addRule(styleRule.key, style[prop], {
          selector: styleRule.selector
        });
      }

      delete style[prop];
    }

    return style;
  }

  return {
    onProcessStyle: onProcessStyle
  };
}

/* harmony default export */ var jss_plugin_nested_esm = (jssNested);

;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/hyphenate-style-name/index.js
/* eslint-disable no-var, prefer-template */
var uppercasePattern = /[A-Z]/g
var msPattern = /^ms-/
var cache = {}

function toHyphenLower(match) {
  return '-' + match.toLowerCase()
}

function hyphenateStyleName(name) {
  if (cache.hasOwnProperty(name)) {
    return cache[name]
  }

  var hName = name.replace(uppercasePattern, toHyphenLower)
  return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)
}

/* harmony default export */ var hyphenate_style_name = (hyphenateStyleName);

;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js


/**
 * Convert camel cased property names to dash separated.
 */

function convertCase(style) {
  var converted = {};

  for (var prop in style) {
    var key = prop.indexOf('--') === 0 ? prop : hyphenate_style_name(prop);
    converted[key] = style[prop];
  }

  if (style.fallbacks) {
    if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);
  }

  return converted;
}
/**
 * Allow camel cased property names by converting them back to dasherized.
 */


function camelCase() {
  function onProcessStyle(style) {
    if (Array.isArray(style)) {
      // Handle rules like @font-face, which can have multiple styles in an array
      for (var index = 0; index < style.length; index++) {
        style[index] = convertCase(style[index]);
      }

      return style;
    }

    return convertCase(style);
  }

  function onChangeValue(value, prop, rule) {
    if (prop.indexOf('--') === 0) {
      return value;
    }

    var hyphenatedProp = hyphenate_style_name(prop); // There was no camel case in place

    if (prop === hyphenatedProp) return value;
    rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.

    return null;
  }

  return {
    onProcessStyle: onProcessStyle,
    onChangeValue: onChangeValue
  };
}

/* harmony default export */ var jss_plugin_camel_case_esm = (camelCase);

;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/jss-plugin-default-unit/dist/jss-plugin-default-unit.esm.js


var px = hasCSSTOMSupport && CSS ? CSS.px : 'px';
var ms = hasCSSTOMSupport && CSS ? CSS.ms : 'ms';
var percent = hasCSSTOMSupport && CSS ? CSS.percent : '%';
/**
 * Generated jss-plugin-default-unit CSS property units
 */

var defaultUnits = {
  // Animation properties
  'animation-delay': ms,
  'animation-duration': ms,
  // Background properties
  'background-position': px,
  'background-position-x': px,
  'background-position-y': px,
  'background-size': px,
  // Border Properties
  border: px,
  'border-bottom': px,
  'border-bottom-left-radius': px,
  'border-bottom-right-radius': px,
  'border-bottom-width': px,
  'border-left': px,
  'border-left-width': px,
  'border-radius': px,
  'border-right': px,
  'border-right-width': px,
  'border-top': px,
  'border-top-left-radius': px,
  'border-top-right-radius': px,
  'border-top-width': px,
  'border-width': px,
  'border-block': px,
  'border-block-end': px,
  'border-block-end-width': px,
  'border-block-start': px,
  'border-block-start-width': px,
  'border-block-width': px,
  'border-inline': px,
  'border-inline-end': px,
  'border-inline-end-width': px,
  'border-inline-start': px,
  'border-inline-start-width': px,
  'border-inline-width': px,
  'border-start-start-radius': px,
  'border-start-end-radius': px,
  'border-end-start-radius': px,
  'border-end-end-radius': px,
  // Margin properties
  margin: px,
  'margin-bottom': px,
  'margin-left': px,
  'margin-right': px,
  'margin-top': px,
  'margin-block': px,
  'margin-block-end': px,
  'margin-block-start': px,
  'margin-inline': px,
  'margin-inline-end': px,
  'margin-inline-start': px,
  // Padding properties
  padding: px,
  'padding-bottom': px,
  'padding-left': px,
  'padding-right': px,
  'padding-top': px,
  'padding-block': px,
  'padding-block-end': px,
  'padding-block-start': px,
  'padding-inline': px,
  'padding-inline-end': px,
  'padding-inline-start': px,
  // Mask properties
  'mask-position-x': px,
  'mask-position-y': px,
  'mask-size': px,
  // Width and height properties
  height: px,
  width: px,
  'min-height': px,
  'max-height': px,
  'min-width': px,
  'max-width': px,
  // Position properties
  bottom: px,
  left: px,
  top: px,
  right: px,
  inset: px,
  'inset-block': px,
  'inset-block-end': px,
  'inset-block-start': px,
  'inset-inline': px,
  'inset-inline-end': px,
  'inset-inline-start': px,
  // Shadow properties
  'box-shadow': px,
  'text-shadow': px,
  // Column properties
  'column-gap': px,
  'column-rule': px,
  'column-rule-width': px,
  'column-width': px,
  // Font and text properties
  'font-size': px,
  'font-size-delta': px,
  'letter-spacing': px,
  'text-decoration-thickness': px,
  'text-indent': px,
  'text-stroke': px,
  'text-stroke-width': px,
  'word-spacing': px,
  // Motion properties
  motion: px,
  'motion-offset': px,
  // Outline properties
  outline: px,
  'outline-offset': px,
  'outline-width': px,
  // Perspective properties
  perspective: px,
  'perspective-origin-x': percent,
  'perspective-origin-y': percent,
  // Transform properties
  'transform-origin': percent,
  'transform-origin-x': percent,
  'transform-origin-y': percent,
  'transform-origin-z': percent,
  // Transition properties
  'transition-delay': ms,
  'transition-duration': ms,
  // Alignment properties
  'vertical-align': px,
  'flex-basis': px,
  // Some random properties
  'shape-margin': px,
  size: px,
  gap: px,
  // Grid properties
  grid: px,
  'grid-gap': px,
  'row-gap': px,
  'grid-row-gap': px,
  'grid-column-gap': px,
  'grid-template-rows': px,
  'grid-template-columns': px,
  'grid-auto-rows': px,
  'grid-auto-columns': px,
  // Not existing properties.
  // Used to avoid issues with jss-plugin-expand integration.
  'box-shadow-x': px,
  'box-shadow-y': px,
  'box-shadow-blur': px,
  'box-shadow-spread': px,
  'font-line-height': px,
  'text-shadow-x': px,
  'text-shadow-y': px,
  'text-shadow-blur': px
};

/**
 * Clones the object and adds a camel cased property version.
 */

function addCamelCasedVersion(obj) {
  var regExp = /(-[a-z])/g;

  var replace = function replace(str) {
    return str[1].toUpperCase();
  };

  var newObj = {};

  for (var key in obj) {
    newObj[key] = obj[key];
    newObj[key.replace(regExp, replace)] = obj[key];
  }

  return newObj;
}

var units = addCamelCasedVersion(defaultUnits);
/**
 * Recursive deep style passing function
 */

function iterate(prop, value, options) {
  if (value == null) return value;

  if (Array.isArray(value)) {
    for (var i = 0; i < value.length; i++) {
      value[i] = iterate(prop, value[i], options);
    }
  } else if (typeof value === 'object') {
    if (prop === 'fallbacks') {
      for (var innerProp in value) {
        value[innerProp] = iterate(innerProp, value[innerProp], options);
      }
    } else {
      for (var _innerProp in value) {
        value[_innerProp] = iterate(prop + "-" + _innerProp, value[_innerProp], options);
      }
    } // eslint-disable-next-line no-restricted-globals

  } else if (typeof value === 'number' && isNaN(value) === false) {
    var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px.

    if (unit && !(value === 0 && unit === px)) {
      return typeof unit === 'function' ? unit(value).toString() : "" + value + unit;
    }

    return value.toString();
  }

  return value;
}
/**
 * Add unit to numeric values.
 */


function defaultUnit(options) {
  if (options === void 0) {
    options = {};
  }

  var camelCasedOptions = addCamelCasedVersion(options);

  function onProcessStyle(style, rule) {
    if (rule.type !== 'style') return style;

    for (var prop in style) {
      style[prop] = iterate(prop, style[prop], camelCasedOptions);
    }

    return style;
  }

  function onChangeValue(value, prop) {
    return iterate(prop, value, camelCasedOptions);
  }

  return {
    onProcessStyle: onProcessStyle,
    onChangeValue: onChangeValue
  };
}

/* harmony default export */ var jss_plugin_default_unit_esm = (defaultUnit);

;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js

function _arrayWithoutHoles(arr) {
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
function _iterableToArray(iter) {
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
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.");
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js




function toConsumableArray_toConsumableArray(arr) {
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/css-vendor/dist/css-vendor.esm.js



// Export javascript style and css style vendor prefixes.
var js = '';
var css = '';
var vendor = '';
var browser = '';
var isTouch = dist_module && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside.

if (dist_module) {
  // Order matters. We need to check Webkit the last one because
  // other vendors use to add Webkit prefixes to some properties
  var jsCssMap = {
    Moz: '-moz-',
    ms: '-ms-',
    O: '-o-',
    Webkit: '-webkit-'
  };

  var _document$createEleme = document.createElement('p'),
      style = _document$createEleme.style;

  var testProp = 'Transform';

  for (var key in jsCssMap) {
    if (key + testProp in style) {
      js = key;
      css = jsCssMap[key];
      break;
    }
  } // Correctly detect the Edge browser.


  if (js === 'Webkit' && 'msHyphens' in style) {
    js = 'ms';
    css = jsCssMap.ms;
    browser = 'edge';
  } // Correctly detect the Safari browser.


  if (js === 'Webkit' && '-apple-trailing-word' in style) {
    vendor = 'apple';
  }
}
/**
 * Vendor prefix string for the current browser.
 *
 * @type {{js: String, css: String, vendor: String, browser: String}}
 * @api public
 */


var src_prefix = {
  js: js,
  css: css,
  vendor: vendor,
  browser: browser,
  isTouch: isTouch
};

/**
 * Test if a keyframe at-rule should be prefixed or not
 *
 * @param {String} vendor prefix string for the current browser.
 * @return {String}
 * @api public
 */

function supportedKeyframes(key) {
  // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a'
  if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules.
  // https://caniuse.com/#search=keyframes

  if (src_prefix.js === 'ms') return key;
  return "@" + src_prefix.css + "keyframes" + key.substr(10);
}

// https://caniuse.com/#search=appearance

var appearence = {
  noPrefill: ['appearance'],
  supportedProperty: function supportedProperty(prop) {
    if (prop !== 'appearance') return false;
    if (src_prefix.js === 'ms') return "-webkit-" + prop;
    return src_prefix.css + prop;
  }
};

// https://caniuse.com/#search=color-adjust

var colorAdjust = {
  noPrefill: ['color-adjust'],
  supportedProperty: function supportedProperty(prop) {
    if (prop !== 'color-adjust') return false;
    if (src_prefix.js === 'Webkit') return src_prefix.css + "print-" + prop;
    return prop;
  }
};

var regExp = /[-\s]+(.)?/g;
/**
 * Replaces the letter with the capital letter
 *
 * @param {String} match
 * @param {String} c
 * @return {String}
 * @api private
 */

function toUpper(match, c) {
  return c ? c.toUpperCase() : '';
}
/**
 * Convert dash separated strings to camel-cased.
 *
 * @param {String} str
 * @return {String}
 * @api private
 */


function camelize(str) {
  return str.replace(regExp, toUpper);
}

/**
 * Convert dash separated strings to pascal cased.
 *
 * @param {String} str
 * @return {String}
 * @api private
 */

function pascalize(str) {
  return camelize("-" + str);
}

// but we can use a longhand property instead.
// https://caniuse.com/#search=mask

var mask = {
  noPrefill: ['mask'],
  supportedProperty: function supportedProperty(prop, style) {
    if (!/^mask/.test(prop)) return false;

    if (src_prefix.js === 'Webkit') {
      var longhand = 'mask-image';

      if (camelize(longhand) in style) {
        return prop;
      }

      if (src_prefix.js + pascalize(longhand) in style) {
        return src_prefix.css + prop;
      }
    }

    return prop;
  }
};

// https://caniuse.com/#search=text-orientation

var textOrientation = {
  noPrefill: ['text-orientation'],
  supportedProperty: function supportedProperty(prop) {
    if (prop !== 'text-orientation') return false;

    if (src_prefix.vendor === 'apple' && !src_prefix.isTouch) {
      return src_prefix.css + prop;
    }

    return prop;
  }
};

// https://caniuse.com/#search=transform

var transform = {
  noPrefill: ['transform'],
  supportedProperty: function supportedProperty(prop, style, options) {
    if (prop !== 'transform') return false;

    if (options.transform) {
      return prop;
    }

    return src_prefix.css + prop;
  }
};

// https://caniuse.com/#search=transition

var transition = {
  noPrefill: ['transition'],
  supportedProperty: function supportedProperty(prop, style, options) {
    if (prop !== 'transition') return false;

    if (options.transition) {
      return prop;
    }

    return src_prefix.css + prop;
  }
};

// https://caniuse.com/#search=writing-mode

var writingMode = {
  noPrefill: ['writing-mode'],
  supportedProperty: function supportedProperty(prop) {
    if (prop !== 'writing-mode') return false;

    if (src_prefix.js === 'Webkit' || src_prefix.js === 'ms' && src_prefix.browser !== 'edge') {
      return src_prefix.css + prop;
    }

    return prop;
  }
};

// https://caniuse.com/#search=user-select

var userSelect = {
  noPrefill: ['user-select'],
  supportedProperty: function supportedProperty(prop) {
    if (prop !== 'user-select') return false;

    if (src_prefix.js === 'Moz' || src_prefix.js === 'ms' || src_prefix.vendor === 'apple') {
      return src_prefix.css + prop;
    }

    return prop;
  }
};

// https://caniuse.com/#search=multicolumn
// https://github.com/postcss/autoprefixer/issues/491
// https://github.com/postcss/autoprefixer/issues/177

var breakPropsOld = {
  supportedProperty: function supportedProperty(prop, style) {
    if (!/^break-/.test(prop)) return false;

    if (src_prefix.js === 'Webkit') {
      var jsProp = "WebkitColumn" + pascalize(prop);
      return jsProp in style ? src_prefix.css + "column-" + prop : false;
    }

    if (src_prefix.js === 'Moz') {
      var _jsProp = "page" + pascalize(prop);

      return _jsProp in style ? "page-" + prop : false;
    }

    return false;
  }
};

// See https://github.com/postcss/autoprefixer/issues/324.

var inlineLogicalOld = {
  supportedProperty: function supportedProperty(prop, style) {
    if (!/^(border|margin|padding)-inline/.test(prop)) return false;
    if (src_prefix.js === 'Moz') return prop;
    var newProp = prop.replace('-inline', '');
    return src_prefix.js + pascalize(newProp) in style ? src_prefix.css + newProp : false;
  }
};

// Camelization is required because we can't test using.
// CSS syntax for e.g. in FF.

var unprefixed = {
  supportedProperty: function supportedProperty(prop, style) {
    return camelize(prop) in style ? prop : false;
  }
};

var prefixed = {
  supportedProperty: function supportedProperty(prop, style) {
    var pascalized = pascalize(prop); // Return custom CSS variable without prefixing.

    if (prop[0] === '-') return prop; // Return already prefixed value without prefixing.

    if (prop[0] === '-' && prop[1] === '-') return prop;
    if (src_prefix.js + pascalized in style) return src_prefix.css + prop; // Try webkit fallback.

    if (src_prefix.js !== 'Webkit' && "Webkit" + pascalized in style) return "-webkit-" + prop;
    return false;
  }
};

// https://caniuse.com/#search=scroll-snap

var scrollSnap = {
  supportedProperty: function supportedProperty(prop) {
    if (prop.substring(0, 11) !== 'scroll-snap') return false;

    if (src_prefix.js === 'ms') {
      return "" + src_prefix.css + prop;
    }

    return prop;
  }
};

// https://caniuse.com/#search=overscroll-behavior

var overscrollBehavior = {
  supportedProperty: function supportedProperty(prop) {
    if (prop !== 'overscroll-behavior') return false;

    if (src_prefix.js === 'ms') {
      return src_prefix.css + "scroll-chaining";
    }

    return prop;
  }
};

var propMap = {
  'flex-grow': 'flex-positive',
  'flex-shrink': 'flex-negative',
  'flex-basis': 'flex-preferred-size',
  'justify-content': 'flex-pack',
  order: 'flex-order',
  'align-items': 'flex-align',
  'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin.

}; // Support old flex spec from 2012.

var flex2012 = {
  supportedProperty: function supportedProperty(prop, style) {
    var newProp = propMap[prop];
    if (!newProp) return false;
    return src_prefix.js + pascalize(newProp) in style ? src_prefix.css + newProp : false;
  }
};

var propMap$1 = {
  flex: 'box-flex',
  'flex-grow': 'box-flex',
  'flex-direction': ['box-orient', 'box-direction'],
  order: 'box-ordinal-group',
  'align-items': 'box-align',
  'flex-flow': ['box-orient', 'box-direction'],
  'justify-content': 'box-pack'
};
var propKeys = Object.keys(propMap$1);

var prefixCss = function prefixCss(p) {
  return src_prefix.css + p;
}; // Support old flex spec from 2009.


var flex2009 = {
  supportedProperty: function supportedProperty(prop, style, _ref) {
    var multiple = _ref.multiple;

    if (propKeys.indexOf(prop) > -1) {
      var newProp = propMap$1[prop];

      if (!Array.isArray(newProp)) {
        return src_prefix.js + pascalize(newProp) in style ? src_prefix.css + newProp : false;
      }

      if (!multiple) return false;

      for (var i = 0; i < newProp.length; i++) {
        if (!(src_prefix.js + pascalize(newProp[0]) in style)) {
          return false;
        }
      }

      return newProp.map(prefixCss);
    }

    return false;
  }
};

// plugins = [
//   ...plugins,
//    breakPropsOld,
//    inlineLogicalOld,
//    unprefixed,
//    prefixed,
//    scrollSnap,
//    flex2012,
//    flex2009
// ]
// Plugins without 'noPrefill' value, going last.
// 'flex-*' plugins should be at the bottom.
// 'flex2009' going after 'flex2012'.
// 'prefixed' going after 'unprefixed'

var css_vendor_esm_plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009];
var propertyDetectors = css_vendor_esm_plugins.filter(function (p) {
  return p.supportedProperty;
}).map(function (p) {
  return p.supportedProperty;
});
var noPrefill = css_vendor_esm_plugins.filter(function (p) {
  return p.noPrefill;
}).reduce(function (a, p) {
  a.push.apply(a, toConsumableArray_toConsumableArray(p.noPrefill));
  return a;
}, []);

var el;
var css_vendor_esm_cache = {};

if (dist_module) {
  el = document.createElement('p'); // We test every property on vendor prefix requirement.
  // Once tested, result is cached. It gives us up to 70% perf boost.
  // http://jsperf.com/element-style-object-access-vs-plain-object
  //
  // Prefill cache with known css properties to reduce amount of
  // properties we need to feature test at runtime.
  // http://davidwalsh.name/vendor-prefix

  var computed = window.getComputedStyle(document.documentElement, '');

  for (var key$1 in computed) {
    // eslint-disable-next-line no-restricted-globals
    if (!isNaN(key$1)) css_vendor_esm_cache[computed[key$1]] = computed[key$1];
  } // Properties that cannot be correctly detected using the
  // cache prefill method.


  noPrefill.forEach(function (x) {
    return delete css_vendor_esm_cache[x];
  });
}
/**
 * Test if a property is supported, returns supported property with vendor
 * prefix if required. Returns `false` if not supported.
 *
 * @param {String} prop dash separated
 * @param {Object} [options]
 * @return {String|Boolean}
 * @api public
 */


function supportedProperty(prop, options) {
  if (options === void 0) {
    options = {};
  }

  // For server-side rendering.
  if (!el) return prop; // Remove cache for benchmark tests or return property from the cache.

  if ( true && css_vendor_esm_cache[prop] != null) {
    return css_vendor_esm_cache[prop];
  } // Check if 'transition' or 'transform' natively supported in browser.


  if (prop === 'transition' || prop === 'transform') {
    options[prop] = prop in el.style;
  } // Find a plugin for current prefix property.


  for (var i = 0; i < propertyDetectors.length; i++) {
    css_vendor_esm_cache[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found.

    if (css_vendor_esm_cache[prop]) break;
  } // Reset styles for current property.
  // Firefox can even throw an error for invalid properties, e.g., "0".


  try {
    el.style[prop] = '';
  } catch (err) {
    return false;
  }

  return css_vendor_esm_cache[prop];
}

var cache$1 = {};
var transitionProperties = {
  transition: 1,
  'transition-property': 1,
  '-webkit-transition': 1,
  '-webkit-transition-property': 1
};
var transPropsRegExp = /(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;
var el$1;
/**
 * Returns prefixed value transition/transform if needed.
 *
 * @param {String} match
 * @param {String} p1
 * @param {String} p2
 * @return {String}
 * @api private
 */

function prefixTransitionCallback(match, p1, p2) {
  if (p1 === 'var') return 'var';
  if (p1 === 'all') return 'all';
  if (p2 === 'all') return ', all';
  var prefixedValue = p1 ? supportedProperty(p1) : ", " + supportedProperty(p2);
  if (!prefixedValue) return p1 || p2;
  return prefixedValue;
}

if (dist_module) el$1 = document.createElement('p');
/**
 * Returns prefixed value if needed. Returns `false` if value is not supported.
 *
 * @param {String} property
 * @param {String} value
 * @return {String|Boolean}
 * @api public
 */

function supportedValue(property, value) {
  // For server-side rendering.
  var prefixedValue = value;
  if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'.
  // We want only prefixable values here.
  // eslint-disable-next-line no-restricted-globals

  if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) {
    return prefixedValue;
  } // Create cache key for current value.


  var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache.

  if ( true && cache$1[cacheKey] != null) {
    return cache$1[cacheKey];
  } // IE can even throw an error in some cases, for e.g. style.content = 'bar'.


  try {
    // Test value as it is.
    el$1.style[property] = prefixedValue;
  } catch (err) {
    // Return false if value not supported.
    cache$1[cacheKey] = false;
    return false;
  } // If 'transition' or 'transition-property' property.


  if (transitionProperties[property]) {
    prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback);
  } else if (el$1.style[property] === '') {
    // Value with a vendor prefix.
    prefixedValue = src_prefix.css + prefixedValue; // Hardcode test to convert "flex" to "-ms-flexbox" for IE10.

    if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.

    el$1.style[property] = prefixedValue; // Return false if value not supported.

    if (el$1.style[property] === '') {
      cache$1[cacheKey] = false;
      return false;
    }
  } // Reset styles for current property.


  el$1.style[property] = ''; // Write current value to cache.

  cache$1[cacheKey] = prefixedValue;
  return cache$1[cacheKey];
}



;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/jss-plugin-vendor-prefixer/dist/jss-plugin-vendor-prefixer.esm.js



/**
 * Add vendor prefix to a property name when needed.
 */

function jssVendorPrefixer() {
  function onProcessRule(rule) {
    if (rule.type === 'keyframes') {
      var atRule = rule;
      atRule.at = supportedKeyframes(atRule.at);
    }
  }

  function prefixStyle(style) {
    for (var prop in style) {
      var value = style[prop];

      if (prop === 'fallbacks' && Array.isArray(value)) {
        style[prop] = value.map(prefixStyle);
        continue;
      }

      var changeProp = false;
      var supportedProp = supportedProperty(prop);
      if (supportedProp && supportedProp !== prop) changeProp = true;
      var changeValue = false;
      var supportedValue$1 = supportedValue(supportedProp, toCssValue(value));
      if (supportedValue$1 && supportedValue$1 !== value) changeValue = true;

      if (changeProp || changeValue) {
        if (changeProp) delete style[prop];
        style[supportedProp || prop] = supportedValue$1 || value;
      }
    }

    return style;
  }

  function onProcessStyle(style, rule) {
    if (rule.type !== 'style') return style;
    return prefixStyle(style);
  }

  function onChangeValue(value, prop) {
    return supportedValue(prop, toCssValue(value)) || value;
  }

  return {
    onProcessRule: onProcessRule,
    onProcessStyle: onProcessStyle,
    onChangeValue: onChangeValue
  };
}

/* harmony default export */ var jss_plugin_vendor_prefixer_esm = (jssVendorPrefixer);

;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/jss-plugin-props-sort/dist/jss-plugin-props-sort.esm.js
/**
 * Sort props by length.
 */
function jssPropsSort() {
  var sort = function sort(prop0, prop1) {
    if (prop0.length === prop1.length) {
      return prop0 > prop1 ? 1 : -1;
    }

    return prop0.length - prop1.length;
  };

  return {
    onProcessStyle: function onProcessStyle(style, rule) {
      if (rule.type !== 'style') return style;
      var newStyle = {};
      var props = Object.keys(style).sort(sort);

      for (var i = 0; i < props.length; i++) {
        newStyle[props[i]] = style[props[i]];
      }

      return newStyle;
    }
  };
}

/* harmony default export */ var jss_plugin_props_sort_esm = (jssPropsSort);

;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/jssPreset/jssPreset.js






 // Subset of jss-preset-default with only the plugins the Material-UI components are using.

function jssPreset_jssPreset() {
  return {
    plugins: [jss_plugin_rule_value_function_esm(), jss_plugin_global_esm(), jss_plugin_nested_esm(), jss_plugin_camel_case_esm(), jss_plugin_default_unit_esm(), // Disable the vendor prefixer server-side, it does nothing.
    // This way, we can get a performance boost.
    // In the documentation, we are using `autoprefixer` to solve this problem.
    typeof window === 'undefined' ? null : jss_plugin_vendor_prefixer_esm(), jss_plugin_props_sort_esm()]
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/StylesProvider/StylesProvider.js







 // Default JSS instance.

var jss = createJss(jssPreset_jssPreset()); // Use a singleton or the provided one by the context.
//
// The counter-based approach doesn't tolerate any mistake.
// It's much safer to use the same counter everywhere.

var generateClassName = createGenerateClassName(); // Exported for test purposes

var sheetsManager = new Map();
var StylesProvider_defaultOptions = {
  disableGeneration: false,
  generateClassName: generateClassName,
  jss: jss,
  sheetsCache: null,
  sheetsManager: sheetsManager,
  sheetsRegistry: null
};
var StylesContext = react.createContext(StylesProvider_defaultOptions);

if (false) {}

var injectFirstNode;
function StylesProvider(props) {
  var children = props.children,
      _props$injectFirst = props.injectFirst,
      injectFirst = _props$injectFirst === void 0 ? false : _props$injectFirst,
      _props$disableGenerat = props.disableGeneration,
      disableGeneration = _props$disableGenerat === void 0 ? false : _props$disableGenerat,
      localOptions = _objectWithoutProperties(props, ["children", "injectFirst", "disableGeneration"]);

  var outerOptions = React.useContext(StylesContext);

  var context = _extends({}, outerOptions, {
    disableGeneration: disableGeneration
  }, localOptions);

  if (false) {}

  if (false) {}

  if (false) {}

  if (!context.jss.options.insertionPoint && injectFirst && typeof window !== 'undefined') {
    if (!injectFirstNode) {
      var head = document.head;
      injectFirstNode = document.createComment('mui-inject-first');
      head.insertBefore(injectFirstNode, head.firstChild);
    }

    context.jss = create({
      plugins: jssPreset().plugins,
      insertionPoint: injectFirstNode
    });
  }

  return /*#__PURE__*/React.createElement(StylesContext.Provider, {
    value: context
  }, children);
}
 false ? 0 : void 0;

if (false) {}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/makeStyles/indexCounter.js
/* eslint-disable import/prefer-default-export */
// Global index counter to preserve source order.
// We create the style sheet during the creation of the component,
// children are handled after the parents, so the order of style elements would be parent->child.
// It is a problem though when a parent passes a className
// which needs to override any child's styles.
// StyleSheet of the child has a higher specificity, because of the source order.
// So our solution is to render sheets them in the reverse order child->sheet, so
// that parent has a higher specificity.
var indexCounter = -1e9;
function increment() {
  indexCounter += 1;

  if (false) {}

  return indexCounter;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/getStylesCreator/getStylesCreator.js




function getStylesCreator(stylesOrCreator) {
  var themingEnabled = typeof stylesOrCreator === 'function';

  if (false) {}

  return {
    create: function create(theme, name) {
      var styles;

      try {
        styles = themingEnabled ? stylesOrCreator(theme) : stylesOrCreator;
      } catch (err) {
        if (false) {}

        throw err;
      }

      if (!name || !theme.overrides || !theme.overrides[name]) {
        return styles;
      }

      var overrides = theme.overrides[name];

      var stylesWithOverrides = (0,esm_extends/* default */.A)({}, styles);

      Object.keys(overrides).forEach(function (key) {
        if (false) {}

        stylesWithOverrides[key] = deepmerge(stylesWithOverrides[key], overrides[key]);
      });
      return stylesWithOverrides;
    },
    options: {}
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/getStylesCreator/noopTheme.js
// We use the same empty object to ref count the styles that don't need a theme object.
var noopTheme = {};
/* harmony default export */ var getStylesCreator_noopTheme = (noopTheme);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/makeStyles/makeStyles.js












function getClasses(_ref, classes, Component) {
  var state = _ref.state,
      stylesOptions = _ref.stylesOptions;

  if (stylesOptions.disableGeneration) {
    return classes || {};
  }

  if (!state.cacheClasses) {
    state.cacheClasses = {
      // Cache for the finalized classes value.
      value: null,
      // Cache for the last used classes prop pointer.
      lastProp: null,
      // Cache for the last used rendered classes pointer.
      lastJSS: {}
    };
  } // Tracks if either the rendered classes or classes prop has changed,
  // requiring the generation of a new finalized classes object.


  var generate = false;

  if (state.classes !== state.cacheClasses.lastJSS) {
    state.cacheClasses.lastJSS = state.classes;
    generate = true;
  }

  if (classes !== state.cacheClasses.lastProp) {
    state.cacheClasses.lastProp = classes;
    generate = true;
  }

  if (generate) {
    state.cacheClasses.value = mergeClasses({
      baseClasses: state.cacheClasses.lastJSS,
      newClasses: classes,
      Component: Component
    });
  }

  return state.cacheClasses.value;
}

function attach(_ref2, props) {
  var state = _ref2.state,
      theme = _ref2.theme,
      stylesOptions = _ref2.stylesOptions,
      stylesCreator = _ref2.stylesCreator,
      name = _ref2.name;

  if (stylesOptions.disableGeneration) {
    return;
  }

  var sheetManager = makeStyles_multiKeyStore.get(stylesOptions.sheetsManager, stylesCreator, theme);

  if (!sheetManager) {
    sheetManager = {
      refs: 0,
      staticSheet: null,
      dynamicStyles: null
    };
    makeStyles_multiKeyStore.set(stylesOptions.sheetsManager, stylesCreator, theme, sheetManager);
  }

  var options = (0,esm_extends/* default */.A)({}, stylesCreator.options, stylesOptions, {
    theme: theme,
    flip: typeof stylesOptions.flip === 'boolean' ? stylesOptions.flip : theme.direction === 'rtl'
  });

  options.generateId = options.serverGenerateClassName || options.generateClassName;
  var sheetsRegistry = stylesOptions.sheetsRegistry;

  if (sheetManager.refs === 0) {
    var staticSheet;

    if (stylesOptions.sheetsCache) {
      staticSheet = makeStyles_multiKeyStore.get(stylesOptions.sheetsCache, stylesCreator, theme);
    }

    var styles = stylesCreator.create(theme, name);

    if (!staticSheet) {
      staticSheet = stylesOptions.jss.createStyleSheet(styles, (0,esm_extends/* default */.A)({
        link: false
      }, options));
      staticSheet.attach();

      if (stylesOptions.sheetsCache) {
        makeStyles_multiKeyStore.set(stylesOptions.sheetsCache, stylesCreator, theme, staticSheet);
      }
    }

    if (sheetsRegistry) {
      sheetsRegistry.add(staticSheet);
    }

    sheetManager.staticSheet = staticSheet;
    sheetManager.dynamicStyles = getDynamicStyles(styles);
  }

  if (sheetManager.dynamicStyles) {
    var dynamicSheet = stylesOptions.jss.createStyleSheet(sheetManager.dynamicStyles, (0,esm_extends/* default */.A)({
      link: true
    }, options));
    dynamicSheet.update(props);
    dynamicSheet.attach();
    state.dynamicSheet = dynamicSheet;
    state.classes = mergeClasses({
      baseClasses: sheetManager.staticSheet.classes,
      newClasses: dynamicSheet.classes
    });

    if (sheetsRegistry) {
      sheetsRegistry.add(dynamicSheet);
    }
  } else {
    state.classes = sheetManager.staticSheet.classes;
  }

  sheetManager.refs += 1;
}

function update(_ref3, props) {
  var state = _ref3.state;

  if (state.dynamicSheet) {
    state.dynamicSheet.update(props);
  }
}

function detach(_ref4) {
  var state = _ref4.state,
      theme = _ref4.theme,
      stylesOptions = _ref4.stylesOptions,
      stylesCreator = _ref4.stylesCreator;

  if (stylesOptions.disableGeneration) {
    return;
  }

  var sheetManager = makeStyles_multiKeyStore.get(stylesOptions.sheetsManager, stylesCreator, theme);
  sheetManager.refs -= 1;
  var sheetsRegistry = stylesOptions.sheetsRegistry;

  if (sheetManager.refs === 0) {
    makeStyles_multiKeyStore.delete(stylesOptions.sheetsManager, stylesCreator, theme);
    stylesOptions.jss.removeStyleSheet(sheetManager.staticSheet);

    if (sheetsRegistry) {
      sheetsRegistry.remove(sheetManager.staticSheet);
    }
  }

  if (state.dynamicSheet) {
    stylesOptions.jss.removeStyleSheet(state.dynamicSheet);

    if (sheetsRegistry) {
      sheetsRegistry.remove(state.dynamicSheet);
    }
  }
}

function useSynchronousEffect(func, values) {
  var key = react.useRef([]);
  var output; // Store "generation" key. Just returns a new object every time

  var currentKey = react.useMemo(function () {
    return {};
  }, values); // eslint-disable-line react-hooks/exhaustive-deps
  // "the first render", or "memo dropped the value"

  if (key.current !== currentKey) {
    key.current = currentKey;
    output = func();
  }

  react.useEffect(function () {
    return function () {
      if (output) {
        output();
      }
    };
  }, [currentKey] // eslint-disable-line react-hooks/exhaustive-deps
  );
}

function makeStyles(stylesOrCreator) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

  var name = options.name,
      classNamePrefixOption = options.classNamePrefix,
      Component = options.Component,
      _options$defaultTheme = options.defaultTheme,
      defaultTheme = _options$defaultTheme === void 0 ? getStylesCreator_noopTheme : _options$defaultTheme,
      stylesOptions2 = objectWithoutProperties_objectWithoutProperties(options, ["name", "classNamePrefix", "Component", "defaultTheme"]);

  var stylesCreator = getStylesCreator(stylesOrCreator);
  var classNamePrefix = name || classNamePrefixOption || 'makeStyles';
  stylesCreator.options = {
    index: increment(),
    name: name,
    meta: classNamePrefix,
    classNamePrefix: classNamePrefix
  };

  var useStyles = function useStyles() {
    var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var theme = useTheme() || defaultTheme;

    var stylesOptions = (0,esm_extends/* default */.A)({}, react.useContext(StylesContext), stylesOptions2);

    var instance = react.useRef();
    var shouldUpdate = react.useRef();
    useSynchronousEffect(function () {
      var current = {
        name: name,
        state: {},
        stylesCreator: stylesCreator,
        stylesOptions: stylesOptions,
        theme: theme
      };
      attach(current, props);
      shouldUpdate.current = false;
      instance.current = current;
      return function () {
        detach(current);
      };
    }, [theme, stylesCreator]);
    react.useEffect(function () {
      if (shouldUpdate.current) {
        update(instance.current, props);
      }

      shouldUpdate.current = true;
    });
    var classes = getClasses(instance.current, props.classes, Component);

    if (false) {}

    return classes;
  };

  return useStyles;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/getThemeProps/getThemeProps.js
/* eslint-disable no-restricted-syntax */
function getThemeProps(params) {
  var theme = params.theme,
      name = params.name,
      props = params.props;

  if (!theme || !theme.props || !theme.props[name]) {
    return props;
  } // Resolve default props, code borrow from React source.
  // https://github.com/facebook/react/blob/15a8f031838a553e41c0b66eb1bcf1da8448104d/packages/react/src/ReactElement.js#L221


  var defaultProps = theme.props[name];
  var propName;

  for (propName in defaultProps) {
    if (props[propName] === undefined) {
      props[propName] = defaultProps[propName];
    }
  }

  return props;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/styles/esm/withStyles/withStyles.js








 // Link a style sheet with a component.
// It does not modify the component passed to it;
// instead, it returns a new component, with a `classes` property.

var withStyles = function withStyles(stylesOrCreator) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  return function (Component) {
    var defaultTheme = options.defaultTheme,
        _options$withTheme = options.withTheme,
        withTheme = _options$withTheme === void 0 ? false : _options$withTheme,
        name = options.name,
        stylesOptions = objectWithoutProperties_objectWithoutProperties(options, ["defaultTheme", "withTheme", "name"]);

    if (false) {}

    var classNamePrefix = name;

    if (false) { var displayName; }

    var useStyles = makeStyles(stylesOrCreator, (0,esm_extends/* default */.A)({
      defaultTheme: defaultTheme,
      Component: Component,
      name: name || Component.displayName,
      classNamePrefix: classNamePrefix
    }, stylesOptions));
    var WithStyles = /*#__PURE__*/react.forwardRef(function WithStyles(props, ref) {
      var classesProp = props.classes,
          innerRef = props.innerRef,
          other = objectWithoutProperties_objectWithoutProperties(props, ["classes", "innerRef"]); // The wrapper receives only user supplied props, which could be a subset of
      // the actual props Component might receive due to merging with defaultProps.
      // So copying it here would give us the same result in the wrapper as well.


      var classes = useStyles((0,esm_extends/* default */.A)({}, Component.defaultProps, props));
      var theme;
      var more = other;

      if (typeof name === 'string' || withTheme) {
        // name and withTheme are invariant in the outer scope
        // eslint-disable-next-line react-hooks/rules-of-hooks
        theme = useTheme() || defaultTheme;

        if (name) {
          more = getThemeProps({
            theme: theme,
            name: name,
            props: other
          });
        } // Provide the theme to the wrapped component.
        // So we don't have to use the `withTheme()` Higher-order Component.


        if (withTheme && !more.theme) {
          more.theme = theme;
        }
      }

      return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.A)({
        ref: innerRef || ref,
        classes: classes
      }, more));
    });
     false ? 0 : void 0;

    if (false) {}

    hoist_non_react_statics_cjs_default()(WithStyles, Component);

    if (false) {}

    return WithStyles;
  };
};

/* harmony default export */ var withStyles_withStyles = (withStyles);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/createBreakpoints.js


// Sorted ASC by size. That's important.
// It can't be configured as it's used statically for propTypes.
var keys = ['xs', 'sm', 'md', 'lg', 'xl']; // Keep in mind that @media is inclusive by the CSS specification.

function createBreakpoints(breakpoints) {
  var _breakpoints$values = breakpoints.values,
      values = _breakpoints$values === void 0 ? {
    xs: 0,
    sm: 600,
    md: 960,
    lg: 1280,
    xl: 1920
  } : _breakpoints$values,
      _breakpoints$unit = breakpoints.unit,
      unit = _breakpoints$unit === void 0 ? 'px' : _breakpoints$unit,
      _breakpoints$step = breakpoints.step,
      step = _breakpoints$step === void 0 ? 5 : _breakpoints$step,
      other = objectWithoutProperties_objectWithoutProperties(breakpoints, ["values", "unit", "step"]);

  function up(key) {
    var value = typeof values[key] === 'number' ? values[key] : key;
    return "@media (min-width:".concat(value).concat(unit, ")");
  }

  function down(key) {
    var endIndex = keys.indexOf(key) + 1;
    var upperbound = values[keys[endIndex]];

    if (endIndex === keys.length) {
      // xl down applies to all sizes
      return up('xs');
    }

    var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : key;
    return "@media (max-width:".concat(value - step / 100).concat(unit, ")");
  }

  function between(start, end) {
    var endIndex = keys.indexOf(end);

    if (endIndex === keys.length - 1) {
      return up(start);
    }

    return "@media (min-width:".concat(typeof values[start] === 'number' ? values[start] : start).concat(unit, ") and ") + "(max-width:".concat((endIndex !== -1 && typeof values[keys[endIndex + 1]] === 'number' ? values[keys[endIndex + 1]] : end) - step / 100).concat(unit, ")");
  }

  function only(key) {
    return between(key, key);
  }

  var warnedOnce = false;

  function width(key) {
    if (false) {}

    return values[key];
  }

  return (0,esm_extends/* default */.A)({
    keys: keys,
    values: values,
    up: up,
    down: down,
    between: between,
    only: only,
    width: width
  }, other);
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/createMixins.js


function createMixins(breakpoints, spacing, mixins) {
  var _toolbar;

  return (0,esm_extends/* default */.A)({
    gutters: function gutters() {
      var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      console.warn(['Material-UI: theme.mixins.gutters() is deprecated.', 'You can use the source of the mixin directly:', "\n      paddingLeft: theme.spacing(2),\n      paddingRight: theme.spacing(2),\n      [theme.breakpoints.up('sm')]: {\n        paddingLeft: theme.spacing(3),\n        paddingRight: theme.spacing(3),\n      },\n      "].join('\n'));
      return (0,esm_extends/* default */.A)({
        paddingLeft: spacing(2),
        paddingRight: spacing(2)
      }, styles, defineProperty_defineProperty({}, breakpoints.up('sm'), (0,esm_extends/* default */.A)({
        paddingLeft: spacing(3),
        paddingRight: spacing(3)
      }, styles[breakpoints.up('sm')])));
    },
    toolbar: (_toolbar = {
      minHeight: 56
    }, defineProperty_defineProperty(_toolbar, "".concat(breakpoints.up('xs'), " and (orientation: landscape)"), {
      minHeight: 48
    }), defineProperty_defineProperty(_toolbar, breakpoints.up('sm'), {
      minHeight: 64
    }), _toolbar)
  }, mixins);
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/colors/common.js
var common = {
  black: '#000',
  white: '#fff'
};
/* harmony default export */ var colors_common = (common);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/colors/grey.js
var grey = {
  50: '#fafafa',
  100: '#f5f5f5',
  200: '#eeeeee',
  300: '#e0e0e0',
  400: '#bdbdbd',
  500: '#9e9e9e',
  600: '#757575',
  700: '#616161',
  800: '#424242',
  900: '#212121',
  A100: '#d5d5d5',
  A200: '#aaaaaa',
  A400: '#303030',
  A700: '#616161'
};
/* harmony default export */ var colors_grey = (grey);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/colors/indigo.js
var indigo = {
  50: '#e8eaf6',
  100: '#c5cae9',
  200: '#9fa8da',
  300: '#7986cb',
  400: '#5c6bc0',
  500: '#3f51b5',
  600: '#3949ab',
  700: '#303f9f',
  800: '#283593',
  900: '#1a237e',
  A100: '#8c9eff',
  A200: '#536dfe',
  A400: '#3d5afe',
  A700: '#304ffe'
};
/* harmony default export */ var colors_indigo = (indigo);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/colors/pink.js
var pink = {
  50: '#fce4ec',
  100: '#f8bbd0',
  200: '#f48fb1',
  300: '#f06292',
  400: '#ec407a',
  500: '#e91e63',
  600: '#d81b60',
  700: '#c2185b',
  800: '#ad1457',
  900: '#880e4f',
  A100: '#ff80ab',
  A200: '#ff4081',
  A400: '#f50057',
  A700: '#c51162'
};
/* harmony default export */ var colors_pink = (pink);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/colors/red.js
var red = {
  50: '#ffebee',
  100: '#ffcdd2',
  200: '#ef9a9a',
  300: '#e57373',
  400: '#ef5350',
  500: '#f44336',
  600: '#e53935',
  700: '#d32f2f',
  800: '#c62828',
  900: '#b71c1c',
  A100: '#ff8a80',
  A200: '#ff5252',
  A400: '#ff1744',
  A700: '#d50000'
};
/* harmony default export */ var colors_red = (red);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/colors/orange.js
var orange = {
  50: '#fff3e0',
  100: '#ffe0b2',
  200: '#ffcc80',
  300: '#ffb74d',
  400: '#ffa726',
  500: '#ff9800',
  600: '#fb8c00',
  700: '#f57c00',
  800: '#ef6c00',
  900: '#e65100',
  A100: '#ffd180',
  A200: '#ffab40',
  A400: '#ff9100',
  A700: '#ff6d00'
};
/* harmony default export */ var colors_orange = (orange);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/colors/blue.js
var blue = {
  50: '#e3f2fd',
  100: '#bbdefb',
  200: '#90caf9',
  300: '#64b5f6',
  400: '#42a5f5',
  500: '#2196f3',
  600: '#1e88e5',
  700: '#1976d2',
  800: '#1565c0',
  900: '#0d47a1',
  A100: '#82b1ff',
  A200: '#448aff',
  A400: '#2979ff',
  A700: '#2962ff'
};
/* harmony default export */ var colors_blue = (blue);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/colors/green.js
var green = {
  50: '#e8f5e9',
  100: '#c8e6c9',
  200: '#a5d6a7',
  300: '#81c784',
  400: '#66bb6a',
  500: '#4caf50',
  600: '#43a047',
  700: '#388e3c',
  800: '#2e7d32',
  900: '#1b5e20',
  A100: '#b9f6ca',
  A200: '#69f0ae',
  A400: '#00e676',
  A700: '#00c853'
};
/* harmony default export */ var colors_green = (green);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/createPalette.js













var light = {
  // The colors used to style the text.
  text: {
    // The most important text.
    primary: 'rgba(0, 0, 0, 0.87)',
    // Secondary text.
    secondary: 'rgba(0, 0, 0, 0.54)',
    // Disabled text have even lower visual prominence.
    disabled: 'rgba(0, 0, 0, 0.38)',
    // Text hints.
    hint: 'rgba(0, 0, 0, 0.38)'
  },
  // The color used to divide different elements.
  divider: 'rgba(0, 0, 0, 0.12)',
  // The background colors used to style the surfaces.
  // Consistency between these values is important.
  background: {
    paper: colors_common.white,
    default: colors_grey[50]
  },
  // The colors used to style the action elements.
  action: {
    // The color of an active action like an icon button.
    active: 'rgba(0, 0, 0, 0.54)',
    // The color of an hovered action.
    hover: 'rgba(0, 0, 0, 0.04)',
    hoverOpacity: 0.04,
    // The color of a selected action.
    selected: 'rgba(0, 0, 0, 0.08)',
    selectedOpacity: 0.08,
    // The color of a disabled action.
    disabled: 'rgba(0, 0, 0, 0.26)',
    // The background color of a disabled action.
    disabledBackground: 'rgba(0, 0, 0, 0.12)',
    disabledOpacity: 0.38,
    focus: 'rgba(0, 0, 0, 0.12)',
    focusOpacity: 0.12,
    activatedOpacity: 0.12
  }
};
var dark = {
  text: {
    primary: colors_common.white,
    secondary: 'rgba(255, 255, 255, 0.7)',
    disabled: 'rgba(255, 255, 255, 0.5)',
    hint: 'rgba(255, 255, 255, 0.5)',
    icon: 'rgba(255, 255, 255, 0.5)'
  },
  divider: 'rgba(255, 255, 255, 0.12)',
  background: {
    paper: colors_grey[800],
    default: '#303030'
  },
  action: {
    active: colors_common.white,
    hover: 'rgba(255, 255, 255, 0.08)',
    hoverOpacity: 0.08,
    selected: 'rgba(255, 255, 255, 0.16)',
    selectedOpacity: 0.16,
    disabled: 'rgba(255, 255, 255, 0.3)',
    disabledBackground: 'rgba(255, 255, 255, 0.12)',
    disabledOpacity: 0.38,
    focus: 'rgba(255, 255, 255, 0.12)',
    focusOpacity: 0.12,
    activatedOpacity: 0.24
  }
};

function addLightOrDark(intent, direction, shade, tonalOffset) {
  var tonalOffsetLight = tonalOffset.light || tonalOffset;
  var tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;

  if (!intent[direction]) {
    if (intent.hasOwnProperty(shade)) {
      intent[direction] = intent[shade];
    } else if (direction === 'light') {
      intent.light = lighten(intent.main, tonalOffsetLight);
    } else if (direction === 'dark') {
      intent.dark = darken(intent.main, tonalOffsetDark);
    }
  }
}

function createPalette(palette) {
  var _palette$primary = palette.primary,
      primary = _palette$primary === void 0 ? {
    light: colors_indigo[300],
    main: colors_indigo[500],
    dark: colors_indigo[700]
  } : _palette$primary,
      _palette$secondary = palette.secondary,
      secondary = _palette$secondary === void 0 ? {
    light: colors_pink.A200,
    main: colors_pink.A400,
    dark: colors_pink.A700
  } : _palette$secondary,
      _palette$error = palette.error,
      error = _palette$error === void 0 ? {
    light: colors_red[300],
    main: colors_red[500],
    dark: colors_red[700]
  } : _palette$error,
      _palette$warning = palette.warning,
      warning = _palette$warning === void 0 ? {
    light: colors_orange[300],
    main: colors_orange[500],
    dark: colors_orange[700]
  } : _palette$warning,
      _palette$info = palette.info,
      info = _palette$info === void 0 ? {
    light: colors_blue[300],
    main: colors_blue[500],
    dark: colors_blue[700]
  } : _palette$info,
      _palette$success = palette.success,
      success = _palette$success === void 0 ? {
    light: colors_green[300],
    main: colors_green[500],
    dark: colors_green[700]
  } : _palette$success,
      _palette$type = palette.type,
      type = _palette$type === void 0 ? 'light' : _palette$type,
      _palette$contrastThre = palette.contrastThreshold,
      contrastThreshold = _palette$contrastThre === void 0 ? 3 : _palette$contrastThre,
      _palette$tonalOffset = palette.tonalOffset,
      tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset,
      other = objectWithoutProperties_objectWithoutProperties(palette, ["primary", "secondary", "error", "warning", "info", "success", "type", "contrastThreshold", "tonalOffset"]); // Use the same logic as
  // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59
  // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54


  function getContrastText(background) {
    var contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;

    if (false) { var contrast; }

    return contrastText;
  }

  var augmentColor = function augmentColor(color) {
    var mainShade = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
    var lightShade = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300;
    var darkShade = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 700;
    color = (0,esm_extends/* default */.A)({}, color);

    if (!color.main && color[mainShade]) {
      color.main = color[mainShade];
    }

    if (!color.main) {
      throw new Error( false ? 0 : formatMuiErrorMessage(4, mainShade));
    }

    if (typeof color.main !== 'string') {
      throw new Error( false ? 0 : formatMuiErrorMessage(5, JSON.stringify(color.main)));
    }

    addLightOrDark(color, 'light', lightShade, tonalOffset);
    addLightOrDark(color, 'dark', darkShade, tonalOffset);

    if (!color.contrastText) {
      color.contrastText = getContrastText(color.main);
    }

    return color;
  };

  var types = {
    dark: dark,
    light: light
  };

  if (false) {}

  var paletteOutput = deepmerge((0,esm_extends/* default */.A)({
    // A collection of common colors.
    common: colors_common,
    // The palette type, can be light or dark.
    type: type,
    // The colors used to represent primary interface elements for a user.
    primary: augmentColor(primary),
    // The colors used to represent secondary interface elements for a user.
    secondary: augmentColor(secondary, 'A400', 'A200', 'A700'),
    // The colors used to represent interface elements that the user should be made aware of.
    error: augmentColor(error),
    // The colors used to represent potentially dangerous actions or important messages.
    warning: augmentColor(warning),
    // The colors used to present information to the user that is neutral and not necessarily important.
    info: augmentColor(info),
    // The colors used to indicate the successful completion of an action that user triggered.
    success: augmentColor(success),
    // The grey colors.
    grey: colors_grey,
    // Used by `getContrastText()` to maximize the contrast between
    // the background and the text.
    contrastThreshold: contrastThreshold,
    // Takes a background color and returns the text color that maximizes the contrast.
    getContrastText: getContrastText,
    // Generate a rich color object.
    augmentColor: augmentColor,
    // Used by the functions below to shift a color's luminance by approximately
    // two indexes within its tonal palette.
    // E.g., shift from Red 500 to Red 300 or Red 700.
    tonalOffset: tonalOffset
  }, types[type]), other);
  return paletteOutput;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/createTypography.js




function round(value) {
  return Math.round(value * 1e5) / 1e5;
}

var createTypography_warnedOnce = false;

function roundWithDeprecationWarning(value) {
  if (false) {}

  return round(value);
}

var caseAllCaps = {
  textTransform: 'uppercase'
};
var defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif';
/**
 * @see @link{https://material.io/design/typography/the-type-system.html}
 * @see @link{https://material.io/design/typography/understanding-typography.html}
 */

function createTypography(palette, typography) {
  var _ref = typeof typography === 'function' ? typography(palette) : typography,
      _ref$fontFamily = _ref.fontFamily,
      fontFamily = _ref$fontFamily === void 0 ? defaultFontFamily : _ref$fontFamily,
      _ref$fontSize = _ref.fontSize,
      fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize,
      _ref$fontWeightLight = _ref.fontWeightLight,
      fontWeightLight = _ref$fontWeightLight === void 0 ? 300 : _ref$fontWeightLight,
      _ref$fontWeightRegula = _ref.fontWeightRegular,
      fontWeightRegular = _ref$fontWeightRegula === void 0 ? 400 : _ref$fontWeightRegula,
      _ref$fontWeightMedium = _ref.fontWeightMedium,
      fontWeightMedium = _ref$fontWeightMedium === void 0 ? 500 : _ref$fontWeightMedium,
      _ref$fontWeightBold = _ref.fontWeightBold,
      fontWeightBold = _ref$fontWeightBold === void 0 ? 700 : _ref$fontWeightBold,
      _ref$htmlFontSize = _ref.htmlFontSize,
      htmlFontSize = _ref$htmlFontSize === void 0 ? 16 : _ref$htmlFontSize,
      allVariants = _ref.allVariants,
      pxToRem2 = _ref.pxToRem,
      other = objectWithoutProperties_objectWithoutProperties(_ref, ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"]);

  if (false) {}

  var coef = fontSize / 14;

  var pxToRem = pxToRem2 || function (size) {
    return "".concat(size / htmlFontSize * coef, "rem");
  };

  var buildVariant = function buildVariant(fontWeight, size, lineHeight, letterSpacing, casing) {
    return (0,esm_extends/* default */.A)({
      fontFamily: fontFamily,
      fontWeight: fontWeight,
      fontSize: pxToRem(size),
      // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
      lineHeight: lineHeight
    }, fontFamily === defaultFontFamily ? {
      letterSpacing: "".concat(round(letterSpacing / size), "em")
    } : {}, casing, allVariants);
  };

  var variants = {
    h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
    h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),
    h3: buildVariant(fontWeightRegular, 48, 1.167, 0),
    h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),
    h5: buildVariant(fontWeightRegular, 24, 1.334, 0),
    h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),
    subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),
    subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
    body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
    body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),
    button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
    caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
    overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps)
  };
  return deepmerge((0,esm_extends/* default */.A)({
    htmlFontSize: htmlFontSize,
    pxToRem: pxToRem,
    round: roundWithDeprecationWarning,
    // TODO v5: remove
    fontFamily: fontFamily,
    fontSize: fontSize,
    fontWeightLight: fontWeightLight,
    fontWeightRegular: fontWeightRegular,
    fontWeightMedium: fontWeightMedium,
    fontWeightBold: fontWeightBold
  }, variants), other, {
    clone: false // No need to clone deep

  });
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/shadows.js
var shadowKeyUmbraOpacity = 0.2;
var shadowKeyPenumbraOpacity = 0.14;
var shadowAmbientShadowOpacity = 0.12;

function createShadow() {
  return ["".concat(arguments.length <= 0 ? undefined : arguments[0], "px ").concat(arguments.length <= 1 ? undefined : arguments[1], "px ").concat(arguments.length <= 2 ? undefined : arguments[2], "px ").concat(arguments.length <= 3 ? undefined : arguments[3], "px rgba(0,0,0,").concat(shadowKeyUmbraOpacity, ")"), "".concat(arguments.length <= 4 ? undefined : arguments[4], "px ").concat(arguments.length <= 5 ? undefined : arguments[5], "px ").concat(arguments.length <= 6 ? undefined : arguments[6], "px ").concat(arguments.length <= 7 ? undefined : arguments[7], "px rgba(0,0,0,").concat(shadowKeyPenumbraOpacity, ")"), "".concat(arguments.length <= 8 ? undefined : arguments[8], "px ").concat(arguments.length <= 9 ? undefined : arguments[9], "px ").concat(arguments.length <= 10 ? undefined : arguments[10], "px ").concat(arguments.length <= 11 ? undefined : arguments[11], "px rgba(0,0,0,").concat(shadowAmbientShadowOpacity, ")")].join(',');
} // Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss


var shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
/* harmony default export */ var styles_shadows = (shadows);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/shape.js
var shape = {
  borderRadius: 4
};
/* harmony default export */ var styles_shape = (shape);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/system/esm/breakpoints.js




 // The breakpoint **start** at this value.
// For instance with the first breakpoint xs: [xs, sm[.

var values = {
  xs: 0,
  sm: 600,
  md: 960,
  lg: 1280,
  xl: 1920
};
var defaultBreakpoints = {
  // Sorted ASC by size. That's important.
  // It can't be configured as it's used statically for propTypes.
  keys: ['xs', 'sm', 'md', 'lg', 'xl'],
  up: function up(key) {
    return "@media (min-width:".concat(values[key], "px)");
  }
};
function handleBreakpoints(props, propValue, styleFromPropValue) {
  if (false) {}

  if (Array.isArray(propValue)) {
    var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
    return propValue.reduce(function (acc, item, index) {
      acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
      return acc;
    }, {});
  }

  if (typeof_typeof(propValue) === 'object') {
    var _themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;

    return Object.keys(propValue).reduce(function (acc, breakpoint) {
      acc[_themeBreakpoints.up(breakpoint)] = styleFromPropValue(propValue[breakpoint]);
      return acc;
    }, {});
  }

  var output = styleFromPropValue(propValue);
  return output;
}

function breakpoints(styleFunction) {
  var newStyleFunction = function newStyleFunction(props) {
    var base = styleFunction(props);
    var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
    var extended = themeBreakpoints.keys.reduce(function (acc, key) {
      if (props[key]) {
        acc = acc || {};
        acc[themeBreakpoints.up(key)] = styleFunction(_extends({
          theme: props.theme
        }, props[key]));
      }

      return acc;
    }, null);
    return merge(base, extended);
  };

  newStyleFunction.propTypes =  false ? 0 : {};
  newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl'].concat(_toConsumableArray(styleFunction.filterProps));
  return newStyleFunction;
}

/* harmony default export */ var esm_breakpoints = ((/* unused pure expression or super */ null && (breakpoints)));
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/system/esm/merge.js


function merge_merge(acc, item) {
  if (!item) {
    return acc;
  }

  return deepmerge(acc, item, {
    clone: false // No need to clone deep, it's way faster.

  });
}

/* harmony default export */ var esm_merge = (merge_merge);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/system/esm/memoize.js
function memoize_memoize(fn) {
  var cache = {};
  return function (arg) {
    if (cache[arg] === undefined) {
      cache[arg] = fn(arg);
    }

    return cache[arg];
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/system/esm/spacing.js





var properties = {
  m: 'margin',
  p: 'padding'
};
var directions = {
  t: 'Top',
  r: 'Right',
  b: 'Bottom',
  l: 'Left',
  x: ['Left', 'Right'],
  y: ['Top', 'Bottom']
};
var aliases = {
  marginX: 'mx',
  marginY: 'my',
  paddingX: 'px',
  paddingY: 'py'
}; // memoize() impact:
// From 300,000 ops/sec
// To 350,000 ops/sec

var getCssProperties = memoize_memoize(function (prop) {
  // It's not a shorthand notation.
  if (prop.length > 2) {
    if (aliases[prop]) {
      prop = aliases[prop];
    } else {
      return [prop];
    }
  }

  var _prop$split = prop.split(''),
      _prop$split2 = slicedToArray_slicedToArray(_prop$split, 2),
      a = _prop$split2[0],
      b = _prop$split2[1];

  var property = properties[a];
  var direction = directions[b] || '';
  return Array.isArray(direction) ? direction.map(function (dir) {
    return property + dir;
  }) : [property + direction];
});
var spacingKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY'];
function createUnarySpacing(theme) {
  var themeSpacing = theme.spacing || 8;

  if (typeof themeSpacing === 'number') {
    return function (abs) {
      if (false) {}

      return themeSpacing * abs;
    };
  }

  if (Array.isArray(themeSpacing)) {
    return function (abs) {
      if (false) {}

      return themeSpacing[abs];
    };
  }

  if (typeof themeSpacing === 'function') {
    return themeSpacing;
  }

  if (false) {}

  return function () {
    return undefined;
  };
}

function getValue(transformer, propValue) {
  if (typeof propValue === 'string' || propValue == null) {
    return propValue;
  }

  var abs = Math.abs(propValue);
  var transformed = transformer(abs);

  if (propValue >= 0) {
    return transformed;
  }

  if (typeof transformed === 'number') {
    return -transformed;
  }

  return "-".concat(transformed);
}

function getStyleFromPropValue(cssProperties, transformer) {
  return function (propValue) {
    return cssProperties.reduce(function (acc, cssProperty) {
      acc[cssProperty] = getValue(transformer, propValue);
      return acc;
    }, {});
  };
}

function spacing(props) {
  var theme = props.theme;
  var transformer = createUnarySpacing(theme);
  return Object.keys(props).map(function (prop) {
    // Using a hash computation over an array iteration could be faster, but with only 28 items,
    // it's doesn't worth the bundle size.
    if (spacingKeys.indexOf(prop) === -1) {
      return null;
    }

    var cssProperties = getCssProperties(prop);
    var styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);
    var propValue = props[prop];
    return handleBreakpoints(props, propValue, styleFromPropValue);
  }).reduce(esm_merge, {});
}

spacing.propTypes =  false ? 0 : {};
spacing.filterProps = spacingKeys;
/* harmony default export */ var esm_spacing = ((/* unused pure expression or super */ null && (spacing)));
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/createSpacing.js

var warnOnce;
function createSpacing() {
  var spacingInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 8;

  // Already transformed.
  if (spacingInput.mui) {
    return spacingInput;
  } // Material Design layouts are visually balanced. Most measurements align to an 8dp grid applied, which aligns both spacing and the overall layout.
  // Smaller components, such as icons and type, can align to a 4dp grid.
  // https://material.io/design/layout/understanding-layout.html#usage


  var transform = createUnarySpacing({
    spacing: spacingInput
  });

  var spacing = function spacing() {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    if (false) {}

    if (args.length === 0) {
      return transform(1);
    }

    if (args.length === 1) {
      return transform(args[0]);
    }

    return args.map(function (argument) {
      if (typeof argument === 'string') {
        return argument;
      }

      var output = transform(argument);
      return typeof output === 'number' ? "".concat(output, "px") : output;
    }).join(' ');
  }; // Backward compatibility, to remove in v5.


  Object.defineProperty(spacing, 'unit', {
    get: function get() {
      if (false) {}

      return spacingInput;
    }
  });
  spacing.mui = true;
  return spacing;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/transitions.js

// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
// to learn the context in which each easing should be used.
var easing = {
  // This is the most common easing curve.
  easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
  // Objects enter the screen at full velocity from off-screen and
  // slowly decelerate to a resting point.
  easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
  // Objects leave the screen at full velocity. They do not decelerate when off-screen.
  easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
  // The sharp curve is used by objects that may return to the screen at any time.
  sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'
}; // Follow https://material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations
// to learn when use what timing

var duration = {
  shortest: 150,
  shorter: 200,
  short: 250,
  // most basic recommended timing
  standard: 300,
  // this is to be used in complex animations
  complex: 375,
  // recommended when something is entering screen
  enteringScreen: 225,
  // recommended when something is leaving screen
  leavingScreen: 195
};

function formatMs(milliseconds) {
  return "".concat(Math.round(milliseconds), "ms");
}
/**
 * @param {string|Array} props
 * @param {object} param
 * @param {string} param.prop
 * @param {number} param.duration
 * @param {string} param.easing
 * @param {number} param.delay
 */


/* harmony default export */ var transitions = ({
  easing: easing,
  duration: duration,
  create: function create() {
    var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['all'];
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    var _options$duration = options.duration,
        durationOption = _options$duration === void 0 ? duration.standard : _options$duration,
        _options$easing = options.easing,
        easingOption = _options$easing === void 0 ? easing.easeInOut : _options$easing,
        _options$delay = options.delay,
        delay = _options$delay === void 0 ? 0 : _options$delay,
        other = objectWithoutProperties_objectWithoutProperties(options, ["duration", "easing", "delay"]);

    if (false) { var isNumber, isString; }

    return (Array.isArray(props) ? props : [props]).map(function (animatedProp) {
      return "".concat(animatedProp, " ").concat(typeof durationOption === 'string' ? durationOption : formatMs(durationOption), " ").concat(easingOption, " ").concat(typeof delay === 'string' ? delay : formatMs(delay));
    }).join(',');
  },
  getAutoHeightDuration: function getAutoHeightDuration(height) {
    if (!height) {
      return 0;
    }

    var constant = height / 36; // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10

    return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);
  }
});
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/zIndex.js
// We need to centralize the zIndex definitions as they work
// like global values in the browser.
var zIndex = {
  mobileStepper: 1000,
  speedDial: 1050,
  appBar: 1100,
  drawer: 1200,
  modal: 1300,
  snackbar: 1400,
  tooltip: 1500
};
/* harmony default export */ var styles_zIndex = (zIndex);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/createTheme.js













function createTheme() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

  var _options$breakpoints = options.breakpoints,
      breakpointsInput = _options$breakpoints === void 0 ? {} : _options$breakpoints,
      _options$mixins = options.mixins,
      mixinsInput = _options$mixins === void 0 ? {} : _options$mixins,
      _options$palette = options.palette,
      paletteInput = _options$palette === void 0 ? {} : _options$palette,
      spacingInput = options.spacing,
      _options$typography = options.typography,
      typographyInput = _options$typography === void 0 ? {} : _options$typography,
      other = objectWithoutProperties_objectWithoutProperties(options, ["breakpoints", "mixins", "palette", "spacing", "typography"]);

  var palette = createPalette(paletteInput);
  var breakpoints = createBreakpoints(breakpointsInput);
  var spacing = createSpacing(spacingInput);
  var muiTheme = deepmerge({
    breakpoints: breakpoints,
    direction: 'ltr',
    mixins: createMixins(breakpoints, spacing, mixinsInput),
    overrides: {},
    // Inject custom styles
    palette: palette,
    props: {},
    // Provide default props
    shadows: styles_shadows,
    typography: createTypography(palette, typographyInput),
    spacing: spacing,
    shape: styles_shape,
    transitions: transitions,
    zIndex: styles_zIndex
  }, other);

  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    args[_key - 1] = arguments[_key];
  }

  muiTheme = args.reduce(function (acc, argument) {
    return deepmerge(acc, argument);
  }, muiTheme);

  if (false) { var traverse, pseudoClasses; }

  return muiTheme;
}

var createTheme_warnedOnce = false;
function createMuiTheme() {
  if (false) {}

  return createTheme.apply(void 0, arguments);
}
/* harmony default export */ var styles_createTheme = (createTheme);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/defaultTheme.js

var defaultTheme = styles_createTheme();
/* harmony default export */ var styles_defaultTheme = (defaultTheme);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/withStyles.js




function styles_withStyles_withStyles(stylesOrCreator, options) {
  return withStyles_withStyles(stylesOrCreator, (0,esm_extends/* default */.A)({
    defaultTheme: styles_defaultTheme
  }, options));
}

/* harmony default export */ var styles_withStyles = (styles_withStyles_withStyles);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/utils/capitalize.js

// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
//
// A strict capitalization should uppercase the first letter of each word a the sentence.
// We only handle the first word.
function capitalize(string) {
  if (typeof string !== 'string') {
    throw new Error( false ? 0 : formatMuiErrorMessage(7));
  }

  return string.charAt(0).toUpperCase() + string.slice(1);
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/react-transition-group/esm/config.js
/* harmony default export */ var config = ({
  disabled: false
});
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/react-transition-group/esm/TransitionGroupContext.js

/* harmony default export */ var TransitionGroupContext = (react.createContext(null));
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/react-transition-group/esm/utils/reflow.js
var forceReflow = function forceReflow(node) {
  return node.scrollTop;
};
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/react-transition-group/esm/Transition.js









var UNMOUNTED = 'unmounted';
var EXITED = 'exited';
var ENTERING = 'entering';
var ENTERED = 'entered';
var EXITING = 'exiting';
/**
 * The Transition component lets you describe a transition from one component
 * state to another _over time_ with a simple declarative API. Most commonly
 * it's used to animate the mounting and unmounting of a component, but can also
 * be used to describe in-place transition states as well.
 *
 * ---
 *
 * **Note**: `Transition` is a platform-agnostic base component. If you're using
 * transitions in CSS, you'll probably want to use
 * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
 * instead. It inherits all the features of `Transition`, but contains
 * additional features necessary to play nice with CSS transitions (hence the
 * name of the component).
 *
 * ---
 *
 * By default the `Transition` component does not alter the behavior of the
 * component it renders, it only tracks "enter" and "exit" states for the
 * components. It's up to you to give meaning and effect to those states. For
 * example we can add styles to a component when it enters or exits:
 *
 * ```jsx
 * import { Transition } from 'react-transition-group';
 *
 * const duration = 300;
 *
 * const defaultStyle = {
 *   transition: `opacity ${duration}ms ease-in-out`,
 *   opacity: 0,
 * }
 *
 * const transitionStyles = {
 *   entering: { opacity: 1 },
 *   entered:  { opacity: 1 },
 *   exiting:  { opacity: 0 },
 *   exited:  { opacity: 0 },
 * };
 *
 * const Fade = ({ in: inProp }) => (
 *   <Transition in={inProp} timeout={duration}>
 *     {state => (
 *       <div style={{
 *         ...defaultStyle,
 *         ...transitionStyles[state]
 *       }}>
 *         I'm a fade Transition!
 *       </div>
 *     )}
 *   </Transition>
 * );
 * ```
 *
 * There are 4 main states a Transition can be in:
 *  - `'entering'`
 *  - `'entered'`
 *  - `'exiting'`
 *  - `'exited'`
 *
 * Transition state is toggled via the `in` prop. When `true` the component
 * begins the "Enter" stage. During this stage, the component will shift from
 * its current transition state, to `'entering'` for the duration of the
 * transition and then to the `'entered'` stage once it's complete. Let's take
 * the following example (we'll use the
 * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
 *
 * ```jsx
 * function App() {
 *   const [inProp, setInProp] = useState(false);
 *   return (
 *     <div>
 *       <Transition in={inProp} timeout={500}>
 *         {state => (
 *           // ...
 *         )}
 *       </Transition>
 *       <button onClick={() => setInProp(true)}>
 *         Click to Enter
 *       </button>
 *     </div>
 *   );
 * }
 * ```
 *
 * When the button is clicked the component will shift to the `'entering'` state
 * and stay there for 500ms (the value of `timeout`) before it finally switches
 * to `'entered'`.
 *
 * When `in` is `false` the same thing happens except the state moves from
 * `'exiting'` to `'exited'`.
 */

var Transition = /*#__PURE__*/function (_React$Component) {
  _inheritsLoose(Transition, _React$Component);

  function Transition(props, context) {
    var _this;

    _this = _React$Component.call(this, props, context) || this;
    var parentGroup = context; // In the context of a TransitionGroup all enters are really appears

    var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
    var initialStatus;
    _this.appearStatus = null;

    if (props.in) {
      if (appear) {
        initialStatus = EXITED;
        _this.appearStatus = ENTERING;
      } else {
        initialStatus = ENTERED;
      }
    } else {
      if (props.unmountOnExit || props.mountOnEnter) {
        initialStatus = UNMOUNTED;
      } else {
        initialStatus = EXITED;
      }
    }

    _this.state = {
      status: initialStatus
    };
    _this.nextCallback = null;
    return _this;
  }

  Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
    var nextIn = _ref.in;

    if (nextIn && prevState.status === UNMOUNTED) {
      return {
        status: EXITED
      };
    }

    return null;
  } // getSnapshotBeforeUpdate(prevProps) {
  //   let nextStatus = null
  //   if (prevProps !== this.props) {
  //     const { status } = this.state
  //     if (this.props.in) {
  //       if (status !== ENTERING && status !== ENTERED) {
  //         nextStatus = ENTERING
  //       }
  //     } else {
  //       if (status === ENTERING || status === ENTERED) {
  //         nextStatus = EXITING
  //       }
  //     }
  //   }
  //   return { nextStatus }
  // }
  ;

  var _proto = Transition.prototype;

  _proto.componentDidMount = function componentDidMount() {
    this.updateStatus(true, this.appearStatus);
  };

  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
    var nextStatus = null;

    if (prevProps !== this.props) {
      var status = this.state.status;

      if (this.props.in) {
        if (status !== ENTERING && status !== ENTERED) {
          nextStatus = ENTERING;
        }
      } else {
        if (status === ENTERING || status === ENTERED) {
          nextStatus = EXITING;
        }
      }
    }

    this.updateStatus(false, nextStatus);
  };

  _proto.componentWillUnmount = function componentWillUnmount() {
    this.cancelNextCallback();
  };

  _proto.getTimeouts = function getTimeouts() {
    var timeout = this.props.timeout;
    var exit, enter, appear;
    exit = enter = appear = timeout;

    if (timeout != null && typeof timeout !== 'number') {
      exit = timeout.exit;
      enter = timeout.enter; // TODO: remove fallback for next major

      appear = timeout.appear !== undefined ? timeout.appear : enter;
    }

    return {
      exit: exit,
      enter: enter,
      appear: appear
    };
  };

  _proto.updateStatus = function updateStatus(mounting, nextStatus) {
    if (mounting === void 0) {
      mounting = false;
    }

    if (nextStatus !== null) {
      // nextStatus will always be ENTERING or EXITING.
      this.cancelNextCallback();

      if (nextStatus === ENTERING) {
        if (this.props.unmountOnExit || this.props.mountOnEnter) {
          var node = this.props.nodeRef ? this.props.nodeRef.current : react_dom.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749
          // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
          // To make the animation happen,  we have to separate each rendering and avoid being processed as batched.

          if (node) forceReflow(node);
        }

        this.performEnter(mounting);
      } else {
        this.performExit();
      }
    } else if (this.props.unmountOnExit && this.state.status === EXITED) {
      this.setState({
        status: UNMOUNTED
      });
    }
  };

  _proto.performEnter = function performEnter(mounting) {
    var _this2 = this;

    var enter = this.props.enter;
    var appearing = this.context ? this.context.isMounting : mounting;

    var _ref2 = this.props.nodeRef ? [appearing] : [react_dom.findDOMNode(this), appearing],
        maybeNode = _ref2[0],
        maybeAppearing = _ref2[1];

    var timeouts = this.getTimeouts();
    var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
    // if we are mounting and running this it means appear _must_ be set

    if (!mounting && !enter || config.disabled) {
      this.safeSetState({
        status: ENTERED
      }, function () {
        _this2.props.onEntered(maybeNode);
      });
      return;
    }

    this.props.onEnter(maybeNode, maybeAppearing);
    this.safeSetState({
      status: ENTERING
    }, function () {
      _this2.props.onEntering(maybeNode, maybeAppearing);

      _this2.onTransitionEnd(enterTimeout, function () {
        _this2.safeSetState({
          status: ENTERED
        }, function () {
          _this2.props.onEntered(maybeNode, maybeAppearing);
        });
      });
    });
  };

  _proto.performExit = function performExit() {
    var _this3 = this;

    var exit = this.props.exit;
    var timeouts = this.getTimeouts();
    var maybeNode = this.props.nodeRef ? undefined : react_dom.findDOMNode(this); // no exit animation skip right to EXITED

    if (!exit || config.disabled) {
      this.safeSetState({
        status: EXITED
      }, function () {
        _this3.props.onExited(maybeNode);
      });
      return;
    }

    this.props.onExit(maybeNode);
    this.safeSetState({
      status: EXITING
    }, function () {
      _this3.props.onExiting(maybeNode);

      _this3.onTransitionEnd(timeouts.exit, function () {
        _this3.safeSetState({
          status: EXITED
        }, function () {
          _this3.props.onExited(maybeNode);
        });
      });
    });
  };

  _proto.cancelNextCallback = function cancelNextCallback() {
    if (this.nextCallback !== null) {
      this.nextCallback.cancel();
      this.nextCallback = null;
    }
  };

  _proto.safeSetState = function safeSetState(nextState, callback) {
    // This shouldn't be necessary, but there are weird race conditions with
    // setState callbacks and unmounting in testing, so always make sure that
    // we can cancel any pending setState callbacks after we unmount.
    callback = this.setNextCallback(callback);
    this.setState(nextState, callback);
  };

  _proto.setNextCallback = function setNextCallback(callback) {
    var _this4 = this;

    var active = true;

    this.nextCallback = function (event) {
      if (active) {
        active = false;
        _this4.nextCallback = null;
        callback(event);
      }
    };

    this.nextCallback.cancel = function () {
      active = false;
    };

    return this.nextCallback;
  };

  _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
    this.setNextCallback(handler);
    var node = this.props.nodeRef ? this.props.nodeRef.current : react_dom.findDOMNode(this);
    var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;

    if (!node || doesNotHaveTimeoutOrListener) {
      setTimeout(this.nextCallback, 0);
      return;
    }

    if (this.props.addEndListener) {
      var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
          maybeNode = _ref3[0],
          maybeNextCallback = _ref3[1];

      this.props.addEndListener(maybeNode, maybeNextCallback);
    }

    if (timeout != null) {
      setTimeout(this.nextCallback, timeout);
    }
  };

  _proto.render = function render() {
    var status = this.state.status;

    if (status === UNMOUNTED) {
      return null;
    }

    var _this$props = this.props,
        children = _this$props.children,
        _in = _this$props.in,
        _mountOnEnter = _this$props.mountOnEnter,
        _unmountOnExit = _this$props.unmountOnExit,
        _appear = _this$props.appear,
        _enter = _this$props.enter,
        _exit = _this$props.exit,
        _timeout = _this$props.timeout,
        _addEndListener = _this$props.addEndListener,
        _onEnter = _this$props.onEnter,
        _onEntering = _this$props.onEntering,
        _onEntered = _this$props.onEntered,
        _onExit = _this$props.onExit,
        _onExiting = _this$props.onExiting,
        _onExited = _this$props.onExited,
        _nodeRef = _this$props.nodeRef,
        childProps = (0,objectWithoutPropertiesLoose/* default */.A)(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);

    return (
      /*#__PURE__*/
      // allows for nested Transitions
      react.createElement(TransitionGroupContext.Provider, {
        value: null
      }, typeof children === 'function' ? children(status, childProps) : react.cloneElement(react.Children.only(children), childProps))
    );
  };

  return Transition;
}(react.Component);

Transition.contextType = TransitionGroupContext;
Transition.propTypes =  false ? 0 : {}; // Name the function so it is clearer in the documentation

function noop() {}

Transition.defaultProps = {
  in: false,
  mountOnEnter: false,
  unmountOnExit: false,
  appear: false,
  enter: true,
  exit: true,
  onEnter: noop,
  onEntering: noop,
  onEntered: noop,
  onExit: noop,
  onExiting: noop,
  onExited: noop
};
Transition.UNMOUNTED = UNMOUNTED;
Transition.EXITED = EXITED;
Transition.ENTERING = ENTERING;
Transition.ENTERED = ENTERED;
Transition.EXITING = EXITING;
/* harmony default export */ var esm_Transition = (Transition);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/styles/useTheme.js



function useTheme_useTheme() {
  var theme = useTheme() || styles_defaultTheme;

  if (false) {}

  return theme;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/transitions/utils.js
var reflow = function reflow(node) {
  return node.scrollTop;
};
function getTransitionProps(props, options) {
  var timeout = props.timeout,
      _props$style = props.style,
      style = _props$style === void 0 ? {} : _props$style;
  return {
    duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,
    delay: style.transitionDelay
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/utils/setRef.js
// TODO v5: consider to make it private
function setRef_setRef(ref, value) {
  if (typeof ref === 'function') {
    ref(value);
  } else if (ref) {
    ref.current = value;
  }
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/utils/useForkRef.js


function useForkRef(refA, refB) {
  /**
   * This will create a new function if the ref props change and are defined.
   * This means react will call the old forkRef with `null` and the new forkRef
   * with the ref. Cleanup naturally emerges from this behavior
   */
  return react.useMemo(function () {
    if (refA == null && refB == null) {
      return null;
    }

    return function (refValue) {
      setRef_setRef(refA, refValue);
      setRef_setRef(refB, refValue);
    };
  }, [refA, refB]);
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/Grow/Grow.js










function getScale(value) {
  return "scale(".concat(value, ", ").concat(Math.pow(value, 2), ")");
}

var styles = {
  entering: {
    opacity: 1,
    transform: getScale(1)
  },
  entered: {
    opacity: 1,
    transform: 'none'
  }
};
/**
 * The Grow transition is used by the [Tooltip](/components/tooltips/) and
 * [Popover](/components/popover/) components.
 * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
 */

var Grow = /*#__PURE__*/react.forwardRef(function Grow(props, ref) {
  var children = props.children,
      _props$disableStrictM = props.disableStrictModeCompat,
      disableStrictModeCompat = _props$disableStrictM === void 0 ? false : _props$disableStrictM,
      inProp = props.in,
      onEnter = props.onEnter,
      onEntered = props.onEntered,
      onEntering = props.onEntering,
      onExit = props.onExit,
      onExited = props.onExited,
      onExiting = props.onExiting,
      style = props.style,
      _props$timeout = props.timeout,
      timeout = _props$timeout === void 0 ? 'auto' : _props$timeout,
      _props$TransitionComp = props.TransitionComponent,
      TransitionComponent = _props$TransitionComp === void 0 ? esm_Transition : _props$TransitionComp,
      other = objectWithoutProperties_objectWithoutProperties(props, ["children", "disableStrictModeCompat", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"]);

  var timer = react.useRef();
  var autoTimeout = react.useRef();
  var theme = useTheme_useTheme();
  var enableStrictModeCompat = theme.unstable_strictMode && !disableStrictModeCompat;
  var nodeRef = react.useRef(null);
  var foreignRef = useForkRef(children.ref, ref);
  var handleRef = useForkRef(enableStrictModeCompat ? nodeRef : undefined, foreignRef);

  var normalizedTransitionCallback = function normalizedTransitionCallback(callback) {
    return function (nodeOrAppearing, maybeAppearing) {
      if (callback) {
        var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing],
            _ref2 = slicedToArray_slicedToArray(_ref, 2),
            node = _ref2[0],
            isAppearing = _ref2[1]; // onEnterXxx and onExitXxx callbacks have a different arguments.length value.


        if (isAppearing === undefined) {
          callback(node);
        } else {
          callback(node, isAppearing);
        }
      }
    };
  };

  var handleEntering = normalizedTransitionCallback(onEntering);
  var handleEnter = normalizedTransitionCallback(function (node, isAppearing) {
    reflow(node); // So the animation always start from the start.

    var _getTransitionProps = getTransitionProps({
      style: style,
      timeout: timeout
    }, {
      mode: 'enter'
    }),
        transitionDuration = _getTransitionProps.duration,
        delay = _getTransitionProps.delay;

    var duration;

    if (timeout === 'auto') {
      duration = theme.transitions.getAutoHeightDuration(node.clientHeight);
      autoTimeout.current = duration;
    } else {
      duration = transitionDuration;
    }

    node.style.transition = [theme.transitions.create('opacity', {
      duration: duration,
      delay: delay
    }), theme.transitions.create('transform', {
      duration: duration * 0.666,
      delay: delay
    })].join(',');

    if (onEnter) {
      onEnter(node, isAppearing);
    }
  });
  var handleEntered = normalizedTransitionCallback(onEntered);
  var handleExiting = normalizedTransitionCallback(onExiting);
  var handleExit = normalizedTransitionCallback(function (node) {
    var _getTransitionProps2 = getTransitionProps({
      style: style,
      timeout: timeout
    }, {
      mode: 'exit'
    }),
        transitionDuration = _getTransitionProps2.duration,
        delay = _getTransitionProps2.delay;

    var duration;

    if (timeout === 'auto') {
      duration = theme.transitions.getAutoHeightDuration(node.clientHeight);
      autoTimeout.current = duration;
    } else {
      duration = transitionDuration;
    }

    node.style.transition = [theme.transitions.create('opacity', {
      duration: duration,
      delay: delay
    }), theme.transitions.create('transform', {
      duration: duration * 0.666,
      delay: delay || duration * 0.333
    })].join(',');
    node.style.opacity = '0';
    node.style.transform = getScale(0.75);

    if (onExit) {
      onExit(node);
    }
  });
  var handleExited = normalizedTransitionCallback(onExited);

  var addEndListener = function addEndListener(nodeOrNext, maybeNext) {
    var next = enableStrictModeCompat ? nodeOrNext : maybeNext;

    if (timeout === 'auto') {
      timer.current = setTimeout(next, autoTimeout.current || 0);
    }
  };

  react.useEffect(function () {
    return function () {
      clearTimeout(timer.current);
    };
  }, []);
  return /*#__PURE__*/react.createElement(TransitionComponent, (0,esm_extends/* default */.A)({
    appear: true,
    in: inProp,
    nodeRef: enableStrictModeCompat ? nodeRef : undefined,
    onEnter: handleEnter,
    onEntered: handleEntered,
    onEntering: handleEntering,
    onExit: handleExit,
    onExited: handleExited,
    onExiting: handleExiting,
    addEndListener: addEndListener,
    timeout: timeout === 'auto' ? null : timeout
  }, other), function (state, childProps) {
    return /*#__PURE__*/react.cloneElement(children, (0,esm_extends/* default */.A)({
      style: (0,esm_extends/* default */.A)({
        opacity: 0,
        transform: getScale(0.75),
        visibility: state === 'exited' && !inProp ? 'hidden' : undefined
      }, styles[state], style, children.props.style),
      ref: handleRef
    }, childProps));
  });
});
 false ? 0 : void 0;
Grow.muiSupportAuto = true;
/* harmony default export */ var Grow_Grow = (Grow);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/popper.js/dist/esm/popper.js
/**!
 * @fileOverview Kickass library to create and place poppers near their reference elements.
 * @version 1.16.1-lts
 * @license
 * Copyright (c) 2016 Federico Zivolo and contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
var popper_isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';

var timeoutDuration = function () {
  var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
    if (popper_isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
      return 1;
    }
  }
  return 0;
}();

function microtaskDebounce(fn) {
  var called = false;
  return function () {
    if (called) {
      return;
    }
    called = true;
    window.Promise.resolve().then(function () {
      called = false;
      fn();
    });
  };
}

function taskDebounce(fn) {
  var scheduled = false;
  return function () {
    if (!scheduled) {
      scheduled = true;
      setTimeout(function () {
        scheduled = false;
        fn();
      }, timeoutDuration);
    }
  };
}

var supportsMicroTasks = popper_isBrowser && window.Promise;

/**
* Create a debounced version of a method, that's asynchronously deferred
* but called in the minimum time possible.
*
* @method
* @memberof Popper.Utils
* @argument {Function} fn
* @returns {Function}
*/
var popper_debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;

/**
 * Check if the given variable is a function
 * @method
 * @memberof Popper.Utils
 * @argument {Any} functionToCheck - variable to check
 * @returns {Boolean} answer to: is a function?
 */
function isFunction(functionToCheck) {
  var getType = {};
  return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
}

/**
 * Get CSS computed property of the given element
 * @method
 * @memberof Popper.Utils
 * @argument {Eement} element
 * @argument {String} property
 */
function getStyleComputedProperty(element, property) {
  if (element.nodeType !== 1) {
    return [];
  }
  // NOTE: 1 DOM access here
  var window = element.ownerDocument.defaultView;
  var css = window.getComputedStyle(element, null);
  return property ? css[property] : css;
}

/**
 * Returns the parentNode or the host of the element
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element
 * @returns {Element} parent
 */
function getParentNode(element) {
  if (element.nodeName === 'HTML') {
    return element;
  }
  return element.parentNode || element.host;
}

/**
 * Returns the scrolling parent of the given element
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element
 * @returns {Element} scroll parent
 */
function getScrollParent(element) {
  // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  if (!element) {
    return document.body;
  }

  switch (element.nodeName) {
    case 'HTML':
    case 'BODY':
      return element.ownerDocument.body;
    case '#document':
      return element.body;
  }

  // Firefox want us to check `-x` and `-y` variations as well

  var _getStyleComputedProp = getStyleComputedProperty(element),
      overflow = _getStyleComputedProp.overflow,
      overflowX = _getStyleComputedProp.overflowX,
      overflowY = _getStyleComputedProp.overflowY;

  if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
    return element;
  }

  return getScrollParent(getParentNode(element));
}

/**
 * Returns the reference node of the reference object, or the reference object itself.
 * @method
 * @memberof Popper.Utils
 * @param {Element|Object} reference - the reference element (the popper will be relative to this)
 * @returns {Element} parent
 */
function getReferenceNode(reference) {
  return reference && reference.referenceNode ? reference.referenceNode : reference;
}

var isIE11 = popper_isBrowser && !!(window.MSInputMethodContext && document.documentMode);
var isIE10 = popper_isBrowser && /MSIE 10/.test(navigator.userAgent);

/**
 * Determines if the browser is Internet Explorer
 * @method
 * @memberof Popper.Utils
 * @param {Number} version to check
 * @returns {Boolean} isIE
 */
function isIE(version) {
  if (version === 11) {
    return isIE11;
  }
  if (version === 10) {
    return isIE10;
  }
  return isIE11 || isIE10;
}

/**
 * Returns the offset parent of the given element
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element
 * @returns {Element} offset parent
 */
function getOffsetParent(element) {
  if (!element) {
    return document.documentElement;
  }

  var noOffsetParent = isIE(10) ? document.body : null;

  // NOTE: 1 DOM access here
  var offsetParent = element.offsetParent || null;
  // Skip hidden elements which don't have an offsetParent
  while (offsetParent === noOffsetParent && element.nextElementSibling) {
    offsetParent = (element = element.nextElementSibling).offsetParent;
  }

  var nodeName = offsetParent && offsetParent.nodeName;

  if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
    return element ? element.ownerDocument.documentElement : document.documentElement;
  }

  // .offsetParent will return the closest TH, TD or TABLE in case
  // no offsetParent is present, I hate this job...
  if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
    return getOffsetParent(offsetParent);
  }

  return offsetParent;
}

function isOffsetContainer(element) {
  var nodeName = element.nodeName;

  if (nodeName === 'BODY') {
    return false;
  }
  return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
}

/**
 * Finds the root node (document, shadowDOM root) of the given element
 * @method
 * @memberof Popper.Utils
 * @argument {Element} node
 * @returns {Element} root node
 */
function getRoot(node) {
  if (node.parentNode !== null) {
    return getRoot(node.parentNode);
  }

  return node;
}

/**
 * Finds the offset parent common to the two provided nodes
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element1
 * @argument {Element} element2
 * @returns {Element} common offset parent
 */
function findCommonOffsetParent(element1, element2) {
  // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
    return document.documentElement;
  }

  // Here we make sure to give as "start" the element that comes first in the DOM
  var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  var start = order ? element1 : element2;
  var end = order ? element2 : element1;

  // Get common ancestor container
  var range = document.createRange();
  range.setStart(start, 0);
  range.setEnd(end, 0);
  var commonAncestorContainer = range.commonAncestorContainer;

  // Both nodes are inside #document

  if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
    if (isOffsetContainer(commonAncestorContainer)) {
      return commonAncestorContainer;
    }

    return getOffsetParent(commonAncestorContainer);
  }

  // one of the nodes is inside shadowDOM, find which one
  var element1root = getRoot(element1);
  if (element1root.host) {
    return findCommonOffsetParent(element1root.host, element2);
  } else {
    return findCommonOffsetParent(element1, getRoot(element2).host);
  }
}

/**
 * Gets the scroll value of the given element in the given side (top and left)
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element
 * @argument {String} side `top` or `left`
 * @returns {number} amount of scrolled pixels
 */
function getScroll(element) {
  var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';

  var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  var nodeName = element.nodeName;

  if (nodeName === 'BODY' || nodeName === 'HTML') {
    var html = element.ownerDocument.documentElement;
    var scrollingElement = element.ownerDocument.scrollingElement || html;
    return scrollingElement[upperSide];
  }

  return element[upperSide];
}

/*
 * Sum or subtract the element scroll values (left and top) from a given rect object
 * @method
 * @memberof Popper.Utils
 * @param {Object} rect - Rect object you want to change
 * @param {HTMLElement} element - The element from the function reads the scroll values
 * @param {Boolean} subtract - set to true if you want to subtract the scroll values
 * @return {Object} rect - The modifier rect object
 */
function includeScroll(rect, element) {
  var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

  var scrollTop = getScroll(element, 'top');
  var scrollLeft = getScroll(element, 'left');
  var modifier = subtract ? -1 : 1;
  rect.top += scrollTop * modifier;
  rect.bottom += scrollTop * modifier;
  rect.left += scrollLeft * modifier;
  rect.right += scrollLeft * modifier;
  return rect;
}

/*
 * Helper to detect borders of a given element
 * @method
 * @memberof Popper.Utils
 * @param {CSSStyleDeclaration} styles
 * Result of `getStyleComputedProperty` on the given element
 * @param {String} axis - `x` or `y`
 * @return {number} borders - The borders size of the given axis
 */

function getBordersSize(styles, axis) {
  var sideA = axis === 'x' ? 'Left' : 'Top';
  var sideB = sideA === 'Left' ? 'Right' : 'Bottom';

  return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
}

function getSize(axis, body, html, computedStyle) {
  return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
}

function getWindowSizes(document) {
  var body = document.body;
  var html = document.documentElement;
  var computedStyle = isIE(10) && getComputedStyle(html);

  return {
    height: getSize('Height', body, html, computedStyle),
    width: getSize('Width', body, html, computedStyle)
  };
}

var classCallCheck = function (instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
};

var createClass = 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);
    }
  }

  return function (Constructor, protoProps, staticProps) {
    if (protoProps) defineProperties(Constructor.prototype, protoProps);
    if (staticProps) defineProperties(Constructor, staticProps);
    return Constructor;
  };
}();





var defineProperty = function (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;
};

var popper_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;
};

/**
 * Given element offsets, generate an output similar to getBoundingClientRect
 * @method
 * @memberof Popper.Utils
 * @argument {Object} offsets
 * @returns {Object} ClientRect like output
 */
function getClientRect(offsets) {
  return popper_extends({}, offsets, {
    right: offsets.left + offsets.width,
    bottom: offsets.top + offsets.height
  });
}

/**
 * Get bounding client rect of given element
 * @method
 * @memberof Popper.Utils
 * @param {HTMLElement} element
 * @return {Object} client rect
 */
function getBoundingClientRect(element) {
  var rect = {};

  // IE10 10 FIX: Please, don't ask, the element isn't
  // considered in DOM in some circumstances...
  // This isn't reproducible in IE10 compatibility mode of IE11
  try {
    if (isIE(10)) {
      rect = element.getBoundingClientRect();
      var scrollTop = getScroll(element, 'top');
      var scrollLeft = getScroll(element, 'left');
      rect.top += scrollTop;
      rect.left += scrollLeft;
      rect.bottom += scrollTop;
      rect.right += scrollLeft;
    } else {
      rect = element.getBoundingClientRect();
    }
  } catch (e) {}

  var result = {
    left: rect.left,
    top: rect.top,
    width: rect.right - rect.left,
    height: rect.bottom - rect.top
  };

  // subtract scrollbar size from sizes
  var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  var width = sizes.width || element.clientWidth || result.width;
  var height = sizes.height || element.clientHeight || result.height;

  var horizScrollbar = element.offsetWidth - width;
  var vertScrollbar = element.offsetHeight - height;

  // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  // we make this check conditional for performance reasons
  if (horizScrollbar || vertScrollbar) {
    var styles = getStyleComputedProperty(element);
    horizScrollbar -= getBordersSize(styles, 'x');
    vertScrollbar -= getBordersSize(styles, 'y');

    result.width -= horizScrollbar;
    result.height -= vertScrollbar;
  }

  return getClientRect(result);
}

function getOffsetRectRelativeToArbitraryNode(children, parent) {
  var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

  var isIE10 = isIE(10);
  var isHTML = parent.nodeName === 'HTML';
  var childrenRect = getBoundingClientRect(children);
  var parentRect = getBoundingClientRect(parent);
  var scrollParent = getScrollParent(children);

  var styles = getStyleComputedProperty(parent);
  var borderTopWidth = parseFloat(styles.borderTopWidth);
  var borderLeftWidth = parseFloat(styles.borderLeftWidth);

  // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  if (fixedPosition && isHTML) {
    parentRect.top = Math.max(parentRect.top, 0);
    parentRect.left = Math.max(parentRect.left, 0);
  }
  var offsets = getClientRect({
    top: childrenRect.top - parentRect.top - borderTopWidth,
    left: childrenRect.left - parentRect.left - borderLeftWidth,
    width: childrenRect.width,
    height: childrenRect.height
  });
  offsets.marginTop = 0;
  offsets.marginLeft = 0;

  // Subtract margins of documentElement in case it's being used as parent
  // we do this only on HTML because it's the only element that behaves
  // differently when margins are applied to it. The margins are included in
  // the box of the documentElement, in the other cases not.
  if (!isIE10 && isHTML) {
    var marginTop = parseFloat(styles.marginTop);
    var marginLeft = parseFloat(styles.marginLeft);

    offsets.top -= borderTopWidth - marginTop;
    offsets.bottom -= borderTopWidth - marginTop;
    offsets.left -= borderLeftWidth - marginLeft;
    offsets.right -= borderLeftWidth - marginLeft;

    // Attach marginTop and marginLeft because in some circumstances we may need them
    offsets.marginTop = marginTop;
    offsets.marginLeft = marginLeft;
  }

  if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
    offsets = includeScroll(offsets, parent);
  }

  return offsets;
}

function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

  var html = element.ownerDocument.documentElement;
  var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  var width = Math.max(html.clientWidth, window.innerWidth || 0);
  var height = Math.max(html.clientHeight, window.innerHeight || 0);

  var scrollTop = !excludeScroll ? getScroll(html) : 0;
  var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;

  var offset = {
    top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
    left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
    width: width,
    height: height
  };

  return getClientRect(offset);
}

/**
 * Check if the given element is fixed or is inside a fixed parent
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element
 * @argument {Element} customContainer
 * @returns {Boolean} answer to "isFixed?"
 */
function isFixed(element) {
  var nodeName = element.nodeName;
  if (nodeName === 'BODY' || nodeName === 'HTML') {
    return false;
  }
  if (getStyleComputedProperty(element, 'position') === 'fixed') {
    return true;
  }
  var parentNode = getParentNode(element);
  if (!parentNode) {
    return false;
  }
  return isFixed(parentNode);
}

/**
 * Finds the first parent of an element that has a transformed property defined
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element
 * @returns {Element} first transformed parent or documentElement
 */

function getFixedPositionOffsetParent(element) {
  // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  if (!element || !element.parentElement || isIE()) {
    return document.documentElement;
  }
  var el = element.parentElement;
  while (el && getStyleComputedProperty(el, 'transform') === 'none') {
    el = el.parentElement;
  }
  return el || document.documentElement;
}

/**
 * Computed the boundaries limits and return them
 * @method
 * @memberof Popper.Utils
 * @param {HTMLElement} popper
 * @param {HTMLElement} reference
 * @param {number} padding
 * @param {HTMLElement} boundariesElement - Element used to define the boundaries
 * @param {Boolean} fixedPosition - Is in fixed position mode
 * @returns {Object} Coordinates of the boundaries
 */
function getBoundaries(popper, reference, padding, boundariesElement) {
  var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;

  // NOTE: 1 DOM access here

  var boundaries = { top: 0, left: 0 };
  var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));

  // Handle viewport case
  if (boundariesElement === 'viewport') {
    boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  } else {
    // Handle other cases based on DOM element used as boundaries
    var boundariesNode = void 0;
    if (boundariesElement === 'scrollParent') {
      boundariesNode = getScrollParent(getParentNode(reference));
      if (boundariesNode.nodeName === 'BODY') {
        boundariesNode = popper.ownerDocument.documentElement;
      }
    } else if (boundariesElement === 'window') {
      boundariesNode = popper.ownerDocument.documentElement;
    } else {
      boundariesNode = boundariesElement;
    }

    var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);

    // In case of HTML, we need a different computation
    if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
      var _getWindowSizes = getWindowSizes(popper.ownerDocument),
          height = _getWindowSizes.height,
          width = _getWindowSizes.width;

      boundaries.top += offsets.top - offsets.marginTop;
      boundaries.bottom = height + offsets.top;
      boundaries.left += offsets.left - offsets.marginLeft;
      boundaries.right = width + offsets.left;
    } else {
      // for all the other DOM elements, this one is good
      boundaries = offsets;
    }
  }

  // Add paddings
  padding = padding || 0;
  var isPaddingNumber = typeof padding === 'number';
  boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;

  return boundaries;
}

function getArea(_ref) {
  var width = _ref.width,
      height = _ref.height;

  return width * height;
}

/**
 * Utility used to transform the `auto` placement to the placement with more
 * available space.
 * @method
 * @memberof Popper.Utils
 * @argument {Object} data - The data object generated by update method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The data object, properly modified
 */
function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;

  if (placement.indexOf('auto') === -1) {
    return placement;
  }

  var boundaries = getBoundaries(popper, reference, padding, boundariesElement);

  var rects = {
    top: {
      width: boundaries.width,
      height: refRect.top - boundaries.top
    },
    right: {
      width: boundaries.right - refRect.right,
      height: boundaries.height
    },
    bottom: {
      width: boundaries.width,
      height: boundaries.bottom - refRect.bottom
    },
    left: {
      width: refRect.left - boundaries.left,
      height: boundaries.height
    }
  };

  var sortedAreas = Object.keys(rects).map(function (key) {
    return popper_extends({
      key: key
    }, rects[key], {
      area: getArea(rects[key])
    });
  }).sort(function (a, b) {
    return b.area - a.area;
  });

  var filteredAreas = sortedAreas.filter(function (_ref2) {
    var width = _ref2.width,
        height = _ref2.height;
    return width >= popper.clientWidth && height >= popper.clientHeight;
  });

  var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;

  var variation = placement.split('-')[1];

  return computedPlacement + (variation ? '-' + variation : '');
}

/**
 * Get offsets to the reference element
 * @method
 * @memberof Popper.Utils
 * @param {Object} state
 * @param {Element} popper - the popper element
 * @param {Element} reference - the reference element (the popper will be relative to this)
 * @param {Element} fixedPosition - is in fixed position mode
 * @returns {Object} An object containing the offsets which will be applied to the popper
 */
function getReferenceOffsets(state, popper, reference) {
  var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;

  var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
}

/**
 * Get the outer sizes of the given element (offset size + margins)
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element
 * @returns {Object} object containing width and height properties
 */
function getOuterSizes(element) {
  var window = element.ownerDocument.defaultView;
  var styles = window.getComputedStyle(element);
  var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  var result = {
    width: element.offsetWidth + y,
    height: element.offsetHeight + x
  };
  return result;
}

/**
 * Get the opposite placement of the given one
 * @method
 * @memberof Popper.Utils
 * @argument {String} placement
 * @returns {String} flipped placement
 */
function getOppositePlacement(placement) {
  var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
  return placement.replace(/left|right|bottom|top/g, function (matched) {
    return hash[matched];
  });
}

/**
 * Get offsets to the popper
 * @method
 * @memberof Popper.Utils
 * @param {Object} position - CSS position the Popper will get applied
 * @param {HTMLElement} popper - the popper element
 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
 * @param {String} placement - one of the valid placement options
 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
 */
function getPopperOffsets(popper, referenceOffsets, placement) {
  placement = placement.split('-')[0];

  // Get popper node sizes
  var popperRect = getOuterSizes(popper);

  // Add position, width and height to our offsets object
  var popperOffsets = {
    width: popperRect.width,
    height: popperRect.height
  };

  // depending by the popper placement we have to compute its offsets slightly differently
  var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  var mainSide = isHoriz ? 'top' : 'left';
  var secondarySide = isHoriz ? 'left' : 'top';
  var measurement = isHoriz ? 'height' : 'width';
  var secondaryMeasurement = !isHoriz ? 'height' : 'width';

  popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  if (placement === secondarySide) {
    popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  } else {
    popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  }

  return popperOffsets;
}

/**
 * Mimics the `find` method of Array
 * @method
 * @memberof Popper.Utils
 * @argument {Array} arr
 * @argument prop
 * @argument value
 * @returns index or -1
 */
function find(arr, check) {
  // use native find if supported
  if (Array.prototype.find) {
    return arr.find(check);
  }

  // use `filter` to obtain the same behavior of `find`
  return arr.filter(check)[0];
}

/**
 * Return the index of the matching object
 * @method
 * @memberof Popper.Utils
 * @argument {Array} arr
 * @argument prop
 * @argument value
 * @returns index or -1
 */
function findIndex(arr, prop, value) {
  // use native findIndex if supported
  if (Array.prototype.findIndex) {
    return arr.findIndex(function (cur) {
      return cur[prop] === value;
    });
  }

  // use `find` + `indexOf` if `findIndex` isn't supported
  var match = find(arr, function (obj) {
    return obj[prop] === value;
  });
  return arr.indexOf(match);
}

/**
 * Loop trough the list of modifiers and run them in order,
 * each of them will then edit the data object.
 * @method
 * @memberof Popper.Utils
 * @param {dataObject} data
 * @param {Array} modifiers
 * @param {String} ends - Optional modifier name used as stopper
 * @returns {dataObject}
 */
function runModifiers(modifiers, data, ends) {
  var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));

  modifiersToRun.forEach(function (modifier) {
    if (modifier['function']) {
      // eslint-disable-line dot-notation
      console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
    }
    var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
    if (modifier.enabled && isFunction(fn)) {
      // Add properties to offsets to make them a complete clientRect object
      // we do this before each modifier to make sure the previous one doesn't
      // mess with these values
      data.offsets.popper = getClientRect(data.offsets.popper);
      data.offsets.reference = getClientRect(data.offsets.reference);

      data = fn(data, modifier);
    }
  });

  return data;
}

/**
 * Updates the position of the popper, computing the new offsets and applying
 * the new style.<br />
 * Prefer `scheduleUpdate` over `update` because of performance reasons.
 * @method
 * @memberof Popper
 */
function popper_update() {
  // if popper is destroyed, don't perform any further update
  if (this.state.isDestroyed) {
    return;
  }

  var data = {
    instance: this,
    styles: {},
    arrowStyles: {},
    attributes: {},
    flipped: false,
    offsets: {}
  };

  // compute reference element offsets
  data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);

  // compute auto placement, store placement inside the data object,
  // modifiers will be able to edit `placement` if needed
  // and refer to originalPlacement to know the original value
  data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);

  // store the computed placement inside `originalPlacement`
  data.originalPlacement = data.placement;

  data.positionFixed = this.options.positionFixed;

  // compute the popper offsets
  data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);

  data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';

  // run the modifiers
  data = runModifiers(this.modifiers, data);

  // the first `update` will call `onCreate` callback
  // the other ones will call `onUpdate` callback
  if (!this.state.isCreated) {
    this.state.isCreated = true;
    this.options.onCreate(data);
  } else {
    this.options.onUpdate(data);
  }
}

/**
 * Helper used to know if the given modifier is enabled.
 * @method
 * @memberof Popper.Utils
 * @returns {Boolean}
 */
function isModifierEnabled(modifiers, modifierName) {
  return modifiers.some(function (_ref) {
    var name = _ref.name,
        enabled = _ref.enabled;
    return enabled && name === modifierName;
  });
}

/**
 * Get the prefixed supported property name
 * @method
 * @memberof Popper.Utils
 * @argument {String} property (camelCase)
 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
 */
function getSupportedPropertyName(property) {
  var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  var upperProp = property.charAt(0).toUpperCase() + property.slice(1);

  for (var i = 0; i < prefixes.length; i++) {
    var prefix = prefixes[i];
    var toCheck = prefix ? '' + prefix + upperProp : property;
    if (typeof document.body.style[toCheck] !== 'undefined') {
      return toCheck;
    }
  }
  return null;
}

/**
 * Destroys the popper.
 * @method
 * @memberof Popper
 */
function destroy() {
  this.state.isDestroyed = true;

  // touch DOM only if `applyStyle` modifier is enabled
  if (isModifierEnabled(this.modifiers, 'applyStyle')) {
    this.popper.removeAttribute('x-placement');
    this.popper.style.position = '';
    this.popper.style.top = '';
    this.popper.style.left = '';
    this.popper.style.right = '';
    this.popper.style.bottom = '';
    this.popper.style.willChange = '';
    this.popper.style[getSupportedPropertyName('transform')] = '';
  }

  this.disableEventListeners();

  // remove the popper if user explicitly asked for the deletion on destroy
  // do not use `remove` because IE11 doesn't support it
  if (this.options.removeOnDestroy) {
    this.popper.parentNode.removeChild(this.popper);
  }
  return this;
}

/**
 * Get the window associated with the element
 * @argument {Element} element
 * @returns {Window}
 */
function getWindow(element) {
  var ownerDocument = element.ownerDocument;
  return ownerDocument ? ownerDocument.defaultView : window;
}

function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  var isBody = scrollParent.nodeName === 'BODY';
  var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  target.addEventListener(event, callback, { passive: true });

  if (!isBody) {
    attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  }
  scrollParents.push(target);
}

/**
 * Setup needed event listeners used to update the popper position
 * @method
 * @memberof Popper.Utils
 * @private
 */
function setupEventListeners(reference, options, state, updateBound) {
  // Resize event listener on window
  state.updateBound = updateBound;
  getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });

  // Scroll event listener on scroll parents
  var scrollElement = getScrollParent(reference);
  attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  state.scrollElement = scrollElement;
  state.eventsEnabled = true;

  return state;
}

/**
 * It will add resize/scroll events and start recalculating
 * position of the popper element when they are triggered.
 * @method
 * @memberof Popper
 */
function enableEventListeners() {
  if (!this.state.eventsEnabled) {
    this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  }
}

/**
 * Remove event listeners used to update the popper position
 * @method
 * @memberof Popper.Utils
 * @private
 */
function removeEventListeners(reference, state) {
  // Remove resize event listener on window
  getWindow(reference).removeEventListener('resize', state.updateBound);

  // Remove scroll event listener on scroll parents
  state.scrollParents.forEach(function (target) {
    target.removeEventListener('scroll', state.updateBound);
  });

  // Reset state
  state.updateBound = null;
  state.scrollParents = [];
  state.scrollElement = null;
  state.eventsEnabled = false;
  return state;
}

/**
 * It will remove resize/scroll events and won't recalculate popper position
 * when they are triggered. It also won't trigger `onUpdate` callback anymore,
 * unless you call `update` method manually.
 * @method
 * @memberof Popper
 */
function disableEventListeners() {
  if (this.state.eventsEnabled) {
    cancelAnimationFrame(this.scheduleUpdate);
    this.state = removeEventListeners(this.reference, this.state);
  }
}

/**
 * Tells if a given input is a number
 * @method
 * @memberof Popper.Utils
 * @param {*} input to check
 * @return {Boolean}
 */
function isNumeric(n) {
  return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
}

/**
 * Set the style to the given popper
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element - Element to apply the style to
 * @argument {Object} styles
 * Object with a list of properties and values which will be applied to the element
 */
function setStyles(element, styles) {
  Object.keys(styles).forEach(function (prop) {
    var unit = '';
    // add unit if the value is numeric and is one of the following
    if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
      unit = 'px';
    }
    element.style[prop] = styles[prop] + unit;
  });
}

/**
 * Set the attributes to the given popper
 * @method
 * @memberof Popper.Utils
 * @argument {Element} element - Element to apply the attributes to
 * @argument {Object} styles
 * Object with a list of properties and values which will be applied to the element
 */
function setAttributes(element, attributes) {
  Object.keys(attributes).forEach(function (prop) {
    var value = attributes[prop];
    if (value !== false) {
      element.setAttribute(prop, attributes[prop]);
    } else {
      element.removeAttribute(prop);
    }
  });
}

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by `update` method
 * @argument {Object} data.styles - List of style properties - values to apply to popper element
 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The same data object
 */
function applyStyle(data) {
  // any property present in `data.styles` will be applied to the popper,
  // in this way we can make the 3rd party modifiers add custom styles to it
  // Be aware, modifiers could override the properties defined in the previous
  // lines of this modifier!
  setStyles(data.instance.popper, data.styles);

  // any property present in `data.attributes` will be applied to the popper,
  // they will be set as HTML attributes of the element
  setAttributes(data.instance.popper, data.attributes);

  // if arrowElement is defined and arrowStyles has some properties
  if (data.arrowElement && Object.keys(data.arrowStyles).length) {
    setStyles(data.arrowElement, data.arrowStyles);
  }

  return data;
}

/**
 * Set the x-placement attribute before everything else because it could be used
 * to add margins to the popper margins needs to be calculated to get the
 * correct popper offsets.
 * @method
 * @memberof Popper.modifiers
 * @param {HTMLElement} reference - The reference element used to position the popper
 * @param {HTMLElement} popper - The HTML element used as popper
 * @param {Object} options - Popper.js options
 */
function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  // compute reference element offsets
  var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);

  // compute auto placement, store placement inside the data object,
  // modifiers will be able to edit `placement` if needed
  // and refer to originalPlacement to know the original value
  var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);

  popper.setAttribute('x-placement', placement);

  // Apply `position` to popper before anything else because
  // without the position applied we can't guarantee correct computations
  setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });

  return options;
}

/**
 * @function
 * @memberof Popper.Utils
 * @argument {Object} data - The data object generated by `update` method
 * @argument {Boolean} shouldRound - If the offsets should be rounded at all
 * @returns {Object} The popper's position offsets rounded
 *
 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
 * good as it can be within reason.
 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
 *
 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
 * as well on High DPI screens).
 *
 * Firefox prefers no rounding for positioning and does not have blurriness on
 * high DPI screens.
 *
 * Only horizontal placement and left/right values need to be considered.
 */
function getRoundedOffsets(data, shouldRound) {
  var _data$offsets = data.offsets,
      popper = _data$offsets.popper,
      reference = _data$offsets.reference;
  var round = Math.round,
      floor = Math.floor;

  var noRound = function noRound(v) {
    return v;
  };

  var referenceWidth = round(reference.width);
  var popperWidth = round(popper.width);

  var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  var isVariation = data.placement.indexOf('-') !== -1;
  var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
  var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;

  var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
  var verticalToInteger = !shouldRound ? noRound : round;

  return {
    left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
    top: verticalToInteger(popper.top),
    bottom: verticalToInteger(popper.bottom),
    right: horizontalToInteger(popper.right)
  };
}

var isFirefox = popper_isBrowser && /Firefox/i.test(navigator.userAgent);

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by `update` method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The data object, properly modified
 */
function computeStyle(data, options) {
  var x = options.x,
      y = options.y;
  var popper = data.offsets.popper;

  // Remove this legacy support in Popper.js v2

  var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
    return modifier.name === 'applyStyle';
  }).gpuAcceleration;
  if (legacyGpuAccelerationOption !== undefined) {
    console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  }
  var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;

  var offsetParent = getOffsetParent(data.instance.popper);
  var offsetParentRect = getBoundingClientRect(offsetParent);

  // Styles
  var styles = {
    position: popper.position
  };

  var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);

  var sideA = x === 'bottom' ? 'top' : 'bottom';
  var sideB = y === 'right' ? 'left' : 'right';

  // if gpuAcceleration is set to `true` and transform is supported,
  //  we use `translate3d` to apply the position to the popper we
  // automatically use the supported prefixed version if needed
  var prefixedProperty = getSupportedPropertyName('transform');

  // now, let's make a step back and look at this code closely (wtf?)
  // If the content of the popper grows once it's been positioned, it
  // may happen that the popper gets misplaced because of the new content
  // overflowing its reference element
  // To avoid this problem, we provide two options (x and y), which allow
  // the consumer to define the offset origin.
  // If we position a popper on top of a reference element, we can set
  // `x` to `top` to make the popper grow towards its top instead of
  // its bottom.
  var left = void 0,
      top = void 0;
  if (sideA === 'bottom') {
    // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
    // and not the bottom of the html element
    if (offsetParent.nodeName === 'HTML') {
      top = -offsetParent.clientHeight + offsets.bottom;
    } else {
      top = -offsetParentRect.height + offsets.bottom;
    }
  } else {
    top = offsets.top;
  }
  if (sideB === 'right') {
    if (offsetParent.nodeName === 'HTML') {
      left = -offsetParent.clientWidth + offsets.right;
    } else {
      left = -offsetParentRect.width + offsets.right;
    }
  } else {
    left = offsets.left;
  }
  if (gpuAcceleration && prefixedProperty) {
    styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
    styles[sideA] = 0;
    styles[sideB] = 0;
    styles.willChange = 'transform';
  } else {
    // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
    var invertTop = sideA === 'bottom' ? -1 : 1;
    var invertLeft = sideB === 'right' ? -1 : 1;
    styles[sideA] = top * invertTop;
    styles[sideB] = left * invertLeft;
    styles.willChange = sideA + ', ' + sideB;
  }

  // Attributes
  var attributes = {
    'x-placement': data.placement
  };

  // Update `data` attributes, styles and arrowStyles
  data.attributes = popper_extends({}, attributes, data.attributes);
  data.styles = popper_extends({}, styles, data.styles);
  data.arrowStyles = popper_extends({}, data.offsets.arrow, data.arrowStyles);

  return data;
}

/**
 * Helper used to know if the given modifier depends from another one.<br />
 * It checks if the needed modifier is listed and enabled.
 * @method
 * @memberof Popper.Utils
 * @param {Array} modifiers - list of modifiers
 * @param {String} requestingName - name of requesting modifier
 * @param {String} requestedName - name of requested modifier
 * @returns {Boolean}
 */
function isModifierRequired(modifiers, requestingName, requestedName) {
  var requesting = find(modifiers, function (_ref) {
    var name = _ref.name;
    return name === requestingName;
  });

  var isRequired = !!requesting && modifiers.some(function (modifier) {
    return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  });

  if (!isRequired) {
    var _requesting = '`' + requestingName + '`';
    var requested = '`' + requestedName + '`';
    console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  }
  return isRequired;
}

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by update method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The data object, properly modified
 */
function arrow(data, options) {
  var _data$offsets$arrow;

  // arrow depends on keepTogether in order to work
  if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
    return data;
  }

  var arrowElement = options.element;

  // if arrowElement is a string, suppose it's a CSS selector
  if (typeof arrowElement === 'string') {
    arrowElement = data.instance.popper.querySelector(arrowElement);

    // if arrowElement is not found, don't run the modifier
    if (!arrowElement) {
      return data;
    }
  } else {
    // if the arrowElement isn't a query selector we must check that the
    // provided DOM node is child of its popper node
    if (!data.instance.popper.contains(arrowElement)) {
      console.warn('WARNING: `arrow.element` must be child of its popper element!');
      return data;
    }
  }

  var placement = data.placement.split('-')[0];
  var _data$offsets = data.offsets,
      popper = _data$offsets.popper,
      reference = _data$offsets.reference;

  var isVertical = ['left', 'right'].indexOf(placement) !== -1;

  var len = isVertical ? 'height' : 'width';
  var sideCapitalized = isVertical ? 'Top' : 'Left';
  var side = sideCapitalized.toLowerCase();
  var altSide = isVertical ? 'left' : 'top';
  var opSide = isVertical ? 'bottom' : 'right';
  var arrowElementSize = getOuterSizes(arrowElement)[len];

  //
  // extends keepTogether behavior making sure the popper and its
  // reference have enough pixels in conjunction
  //

  // top/left side
  if (reference[opSide] - arrowElementSize < popper[side]) {
    data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  }
  // bottom/right side
  if (reference[side] + arrowElementSize > popper[opSide]) {
    data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  }
  data.offsets.popper = getClientRect(data.offsets.popper);

  // compute center of the popper
  var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;

  // Compute the sideValue using the updated popper offsets
  // take popper margin in account because we don't have this info available
  var css = getStyleComputedProperty(data.instance.popper);
  var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
  var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
  var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;

  // prevent arrowElement from being placed not contiguously to its popper
  sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);

  data.arrowElement = arrowElement;
  data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);

  return data;
}

/**
 * Get the opposite placement variation of the given one
 * @method
 * @memberof Popper.Utils
 * @argument {String} placement variation
 * @returns {String} flipped placement variation
 */
function getOppositeVariation(variation) {
  if (variation === 'end') {
    return 'start';
  } else if (variation === 'start') {
    return 'end';
  }
  return variation;
}

/**
 * List of accepted placements to use as values of the `placement` option.<br />
 * Valid placements are:
 * - `auto`
 * - `top`
 * - `right`
 * - `bottom`
 * - `left`
 *
 * Each placement can have a variation from this list:
 * - `-start`
 * - `-end`
 *
 * Variations are interpreted easily if you think of them as the left to right
 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
 * is right.<br />
 * Vertically (`left` and `right`), `start` is top and `end` is bottom.
 *
 * Some valid examples are:
 * - `top-end` (on top of reference, right aligned)
 * - `right-start` (on right of reference, top aligned)
 * - `bottom` (on bottom, centered)
 * - `auto-end` (on the side with more space available, alignment depends by placement)
 *
 * @static
 * @type {Array}
 * @enum {String}
 * @readonly
 * @method placements
 * @memberof Popper
 */
var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];

// Get rid of `auto` `auto-start` and `auto-end`
var validPlacements = placements.slice(3);

/**
 * Given an initial placement, returns all the subsequent placements
 * clockwise (or counter-clockwise).
 *
 * @method
 * @memberof Popper.Utils
 * @argument {String} placement - A valid placement (it accepts variations)
 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
 * @returns {Array} placements including their variations
 */
function clockwise(placement) {
  var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

  var index = validPlacements.indexOf(placement);
  var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  return counter ? arr.reverse() : arr;
}

var BEHAVIORS = {
  FLIP: 'flip',
  CLOCKWISE: 'clockwise',
  COUNTERCLOCKWISE: 'counterclockwise'
};

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by update method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The data object, properly modified
 */
function flip(data, options) {
  // if `inner` modifier is enabled, we can't use the `flip` modifier
  if (isModifierEnabled(data.instance.modifiers, 'inner')) {
    return data;
  }

  if (data.flipped && data.placement === data.originalPlacement) {
    // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
    return data;
  }

  var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);

  var placement = data.placement.split('-')[0];
  var placementOpposite = getOppositePlacement(placement);
  var variation = data.placement.split('-')[1] || '';

  var flipOrder = [];

  switch (options.behavior) {
    case BEHAVIORS.FLIP:
      flipOrder = [placement, placementOpposite];
      break;
    case BEHAVIORS.CLOCKWISE:
      flipOrder = clockwise(placement);
      break;
    case BEHAVIORS.COUNTERCLOCKWISE:
      flipOrder = clockwise(placement, true);
      break;
    default:
      flipOrder = options.behavior;
  }

  flipOrder.forEach(function (step, index) {
    if (placement !== step || flipOrder.length === index + 1) {
      return data;
    }

    placement = data.placement.split('-')[0];
    placementOpposite = getOppositePlacement(placement);

    var popperOffsets = data.offsets.popper;
    var refOffsets = data.offsets.reference;

    // using floor because the reference offsets may contain decimals we are not going to consider here
    var floor = Math.floor;
    var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);

    var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
    var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
    var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
    var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);

    var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;

    // flip the variation if required
    var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;

    // flips variation if reference element overflows boundaries
    var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);

    // flips variation if popper content overflows boundaries
    var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);

    var flippedVariation = flippedVariationByRef || flippedVariationByContent;

    if (overlapsRef || overflowsBoundaries || flippedVariation) {
      // this boolean to detect any flip loop
      data.flipped = true;

      if (overlapsRef || overflowsBoundaries) {
        placement = flipOrder[index + 1];
      }

      if (flippedVariation) {
        variation = getOppositeVariation(variation);
      }

      data.placement = placement + (variation ? '-' + variation : '');

      // this object contains `position`, we want to preserve it along with
      // any additional property we may add in the future
      data.offsets.popper = popper_extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));

      data = runModifiers(data.instance.modifiers, data, 'flip');
    }
  });
  return data;
}

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by update method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The data object, properly modified
 */
function keepTogether(data) {
  var _data$offsets = data.offsets,
      popper = _data$offsets.popper,
      reference = _data$offsets.reference;

  var placement = data.placement.split('-')[0];
  var floor = Math.floor;
  var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  var side = isVertical ? 'right' : 'bottom';
  var opSide = isVertical ? 'left' : 'top';
  var measurement = isVertical ? 'width' : 'height';

  if (popper[side] < floor(reference[opSide])) {
    data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  }
  if (popper[opSide] > floor(reference[side])) {
    data.offsets.popper[opSide] = floor(reference[side]);
  }

  return data;
}

/**
 * Converts a string containing value + unit into a px value number
 * @function
 * @memberof {modifiers~offset}
 * @private
 * @argument {String} str - Value + unit string
 * @argument {String} measurement - `height` or `width`
 * @argument {Object} popperOffsets
 * @argument {Object} referenceOffsets
 * @returns {Number|String}
 * Value in pixels, or original string if no values were extracted
 */
function toValue(str, measurement, popperOffsets, referenceOffsets) {
  // separate value from unit
  var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  var value = +split[1];
  var unit = split[2];

  // If it's not a number it's an operator, I guess
  if (!value) {
    return str;
  }

  if (unit.indexOf('%') === 0) {
    var element = void 0;
    switch (unit) {
      case '%p':
        element = popperOffsets;
        break;
      case '%':
      case '%r':
      default:
        element = referenceOffsets;
    }

    var rect = getClientRect(element);
    return rect[measurement] / 100 * value;
  } else if (unit === 'vh' || unit === 'vw') {
    // if is a vh or vw, we calculate the size based on the viewport
    var size = void 0;
    if (unit === 'vh') {
      size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
    } else {
      size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
    }
    return size / 100 * value;
  } else {
    // if is an explicit pixel unit, we get rid of the unit and keep the value
    // if is an implicit unit, it's px, and we return just the value
    return value;
  }
}

/**
 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
 * @function
 * @memberof {modifiers~offset}
 * @private
 * @argument {String} offset
 * @argument {Object} popperOffsets
 * @argument {Object} referenceOffsets
 * @argument {String} basePlacement
 * @returns {Array} a two cells array with x and y offsets in numbers
 */
function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  var offsets = [0, 0];

  // Use height if placement is left or right and index is 0 otherwise use width
  // in this way the first offset will use an axis and the second one
  // will use the other one
  var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;

  // Split the offset string to obtain a list of values and operands
  // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  var fragments = offset.split(/(\+|\-)/).map(function (frag) {
    return frag.trim();
  });

  // Detect if the offset string contains a pair of values or a single one
  // they could be separated by comma or space
  var divider = fragments.indexOf(find(fragments, function (frag) {
    return frag.search(/,|\s/) !== -1;
  }));

  if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
    console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  }

  // If divider is found, we divide the list of values and operands to divide
  // them by ofset X and Y.
  var splitRegex = /\s*,\s*|\s+/;
  var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];

  // Convert the values with units to absolute pixels to allow our computations
  ops = ops.map(function (op, index) {
    // Most of the units rely on the orientation of the popper
    var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
    var mergeWithPrevious = false;
    return op
    // This aggregates any `+` or `-` sign that aren't considered operators
    // e.g.: 10 + +5 => [10, +, +5]
    .reduce(function (a, b) {
      if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
        a[a.length - 1] = b;
        mergeWithPrevious = true;
        return a;
      } else if (mergeWithPrevious) {
        a[a.length - 1] += b;
        mergeWithPrevious = false;
        return a;
      } else {
        return a.concat(b);
      }
    }, [])
    // Here we convert the string values into number values (in px)
    .map(function (str) {
      return toValue(str, measurement, popperOffsets, referenceOffsets);
    });
  });

  // Loop trough the offsets arrays and execute the operations
  ops.forEach(function (op, index) {
    op.forEach(function (frag, index2) {
      if (isNumeric(frag)) {
        offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
      }
    });
  });
  return offsets;
}

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by update method
 * @argument {Object} options - Modifiers configuration and options
 * @argument {Number|String} options.offset=0
 * The offset value as described in the modifier description
 * @returns {Object} The data object, properly modified
 */
function offset(data, _ref) {
  var offset = _ref.offset;
  var placement = data.placement,
      _data$offsets = data.offsets,
      popper = _data$offsets.popper,
      reference = _data$offsets.reference;

  var basePlacement = placement.split('-')[0];

  var offsets = void 0;
  if (isNumeric(+offset)) {
    offsets = [+offset, 0];
  } else {
    offsets = parseOffset(offset, popper, reference, basePlacement);
  }

  if (basePlacement === 'left') {
    popper.top += offsets[0];
    popper.left -= offsets[1];
  } else if (basePlacement === 'right') {
    popper.top += offsets[0];
    popper.left += offsets[1];
  } else if (basePlacement === 'top') {
    popper.left += offsets[0];
    popper.top -= offsets[1];
  } else if (basePlacement === 'bottom') {
    popper.left += offsets[0];
    popper.top += offsets[1];
  }

  data.popper = popper;
  return data;
}

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by `update` method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The data object, properly modified
 */
function preventOverflow(data, options) {
  var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);

  // If offsetParent is the reference element, we really want to
  // go one step up and use the next offsetParent as reference to
  // avoid to make this modifier completely useless and look like broken
  if (data.instance.reference === boundariesElement) {
    boundariesElement = getOffsetParent(boundariesElement);
  }

  // NOTE: DOM access here
  // resets the popper's position so that the document size can be calculated excluding
  // the size of the popper element itself
  var transformProp = getSupportedPropertyName('transform');
  var popperStyles = data.instance.popper.style; // assignment to help minification
  var top = popperStyles.top,
      left = popperStyles.left,
      transform = popperStyles[transformProp];

  popperStyles.top = '';
  popperStyles.left = '';
  popperStyles[transformProp] = '';

  var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);

  // NOTE: DOM access here
  // restores the original style properties after the offsets have been computed
  popperStyles.top = top;
  popperStyles.left = left;
  popperStyles[transformProp] = transform;

  options.boundaries = boundaries;

  var order = options.priority;
  var popper = data.offsets.popper;

  var check = {
    primary: function primary(placement) {
      var value = popper[placement];
      if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
        value = Math.max(popper[placement], boundaries[placement]);
      }
      return defineProperty({}, placement, value);
    },
    secondary: function secondary(placement) {
      var mainSide = placement === 'right' ? 'left' : 'top';
      var value = popper[mainSide];
      if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
        value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
      }
      return defineProperty({}, mainSide, value);
    }
  };

  order.forEach(function (placement) {
    var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
    popper = popper_extends({}, popper, check[side](placement));
  });

  data.offsets.popper = popper;

  return data;
}

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by `update` method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The data object, properly modified
 */
function shift(data) {
  var placement = data.placement;
  var basePlacement = placement.split('-')[0];
  var shiftvariation = placement.split('-')[1];

  // if shift shiftvariation is specified, run the modifier
  if (shiftvariation) {
    var _data$offsets = data.offsets,
        reference = _data$offsets.reference,
        popper = _data$offsets.popper;

    var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
    var side = isVertical ? 'left' : 'top';
    var measurement = isVertical ? 'width' : 'height';

    var shiftOffsets = {
      start: defineProperty({}, side, reference[side]),
      end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
    };

    data.offsets.popper = popper_extends({}, popper, shiftOffsets[shiftvariation]);
  }

  return data;
}

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by update method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The data object, properly modified
 */
function hide(data) {
  if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
    return data;
  }

  var refRect = data.offsets.reference;
  var bound = find(data.instance.modifiers, function (modifier) {
    return modifier.name === 'preventOverflow';
  }).boundaries;

  if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
    // Avoid unnecessary DOM access if visibility hasn't changed
    if (data.hide === true) {
      return data;
    }

    data.hide = true;
    data.attributes['x-out-of-boundaries'] = '';
  } else {
    // Avoid unnecessary DOM access if visibility hasn't changed
    if (data.hide === false) {
      return data;
    }

    data.hide = false;
    data.attributes['x-out-of-boundaries'] = false;
  }

  return data;
}

/**
 * @function
 * @memberof Modifiers
 * @argument {Object} data - The data object generated by `update` method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {Object} The data object, properly modified
 */
function inner(data) {
  var placement = data.placement;
  var basePlacement = placement.split('-')[0];
  var _data$offsets = data.offsets,
      popper = _data$offsets.popper,
      reference = _data$offsets.reference;

  var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;

  var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;

  popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);

  data.placement = getOppositePlacement(placement);
  data.offsets.popper = getClientRect(popper);

  return data;
}

/**
 * Modifier function, each modifier can have a function of this type assigned
 * to its `fn` property.<br />
 * These functions will be called on each update, this means that you must
 * make sure they are performant enough to avoid performance bottlenecks.
 *
 * @function ModifierFn
 * @argument {dataObject} data - The data object generated by `update` method
 * @argument {Object} options - Modifiers configuration and options
 * @returns {dataObject} The data object, properly modified
 */

/**
 * Modifiers are plugins used to alter the behavior of your poppers.<br />
 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
 * needed by the library.
 *
 * Usually you don't want to override the `order`, `fn` and `onLoad` props.
 * All the other properties are configurations that could be tweaked.
 * @namespace modifiers
 */
var modifiers = {
  /**
   * Modifier used to shift the popper on the start or end of its reference
   * element.<br />
   * It will read the variation of the `placement` property.<br />
   * It can be one either `-end` or `-start`.
   * @memberof modifiers
   * @inner
   */
  shift: {
    /** @prop {number} order=100 - Index used to define the order of execution */
    order: 100,
    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
    enabled: true,
    /** @prop {ModifierFn} */
    fn: shift
  },

  /**
   * The `offset` modifier can shift your popper on both its axis.
   *
   * It accepts the following units:
   * - `px` or unit-less, interpreted as pixels
   * - `%` or `%r`, percentage relative to the length of the reference element
   * - `%p`, percentage relative to the length of the popper element
   * - `vw`, CSS viewport width unit
   * - `vh`, CSS viewport height unit
   *
   * For length is intended the main axis relative to the placement of the popper.<br />
   * This means that if the placement is `top` or `bottom`, the length will be the
   * `width`. In case of `left` or `right`, it will be the `height`.
   *
   * You can provide a single value (as `Number` or `String`), or a pair of values
   * as `String` divided by a comma or one (or more) white spaces.<br />
   * The latter is a deprecated method because it leads to confusion and will be
   * removed in v2.<br />
   * Additionally, it accepts additions and subtractions between different units.
   * Note that multiplications and divisions aren't supported.
   *
   * Valid examples are:
   * ```
   * 10
   * '10%'
   * '10, 10'
   * '10%, 10'
   * '10 + 10%'
   * '10 - 5vh + 3%'
   * '-10px + 5vh, 5px - 6%'
   * ```
   * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
   * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
   * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
   *
   * @memberof modifiers
   * @inner
   */
  offset: {
    /** @prop {number} order=200 - Index used to define the order of execution */
    order: 200,
    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
    enabled: true,
    /** @prop {ModifierFn} */
    fn: offset,
    /** @prop {Number|String} offset=0
     * The offset value as described in the modifier description
     */
    offset: 0
  },

  /**
   * Modifier used to prevent the popper from being positioned outside the boundary.
   *
   * A scenario exists where the reference itself is not within the boundaries.<br />
   * We can say it has "escaped the boundaries" — or just "escaped".<br />
   * In this case we need to decide whether the popper should either:
   *
   * - detach from the reference and remain "trapped" in the boundaries, or
   * - if it should ignore the boundary and "escape with its reference"
   *
   * When `escapeWithReference` is set to`true` and reference is completely
   * outside its boundaries, the popper will overflow (or completely leave)
   * the boundaries in order to remain attached to the edge of the reference.
   *
   * @memberof modifiers
   * @inner
   */
  preventOverflow: {
    /** @prop {number} order=300 - Index used to define the order of execution */
    order: 300,
    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
    enabled: true,
    /** @prop {ModifierFn} */
    fn: preventOverflow,
    /**
     * @prop {Array} [priority=['left','right','top','bottom']]
     * Popper will try to prevent overflow following these priorities by default,
     * then, it could overflow on the left and on top of the `boundariesElement`
     */
    priority: ['left', 'right', 'top', 'bottom'],
    /**
     * @prop {number} padding=5
     * Amount of pixel used to define a minimum distance between the boundaries
     * and the popper. This makes sure the popper always has a little padding
     * between the edges of its container
     */
    padding: 5,
    /**
     * @prop {String|HTMLElement} boundariesElement='scrollParent'
     * Boundaries used by the modifier. Can be `scrollParent`, `window`,
     * `viewport` or any DOM element.
     */
    boundariesElement: 'scrollParent'
  },

  /**
   * Modifier used to make sure the reference and its popper stay near each other
   * without leaving any gap between the two. Especially useful when the arrow is
   * enabled and you want to ensure that it points to its reference element.
   * It cares only about the first axis. You can still have poppers with margin
   * between the popper and its reference element.
   * @memberof modifiers
   * @inner
   */
  keepTogether: {
    /** @prop {number} order=400 - Index used to define the order of execution */
    order: 400,
    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
    enabled: true,
    /** @prop {ModifierFn} */
    fn: keepTogether
  },

  /**
   * This modifier is used to move the `arrowElement` of the popper to make
   * sure it is positioned between the reference element and its popper element.
   * It will read the outer size of the `arrowElement` node to detect how many
   * pixels of conjunction are needed.
   *
   * It has no effect if no `arrowElement` is provided.
   * @memberof modifiers
   * @inner
   */
  arrow: {
    /** @prop {number} order=500 - Index used to define the order of execution */
    order: 500,
    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
    enabled: true,
    /** @prop {ModifierFn} */
    fn: arrow,
    /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
    element: '[x-arrow]'
  },

  /**
   * Modifier used to flip the popper's placement when it starts to overlap its
   * reference element.
   *
   * Requires the `preventOverflow` modifier before it in order to work.
   *
   * **NOTE:** this modifier will interrupt the current update cycle and will
   * restart it if it detects the need to flip the placement.
   * @memberof modifiers
   * @inner
   */
  flip: {
    /** @prop {number} order=600 - Index used to define the order of execution */
    order: 600,
    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
    enabled: true,
    /** @prop {ModifierFn} */
    fn: flip,
    /**
     * @prop {String|Array} behavior='flip'
     * The behavior used to change the popper's placement. It can be one of
     * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
     * placements (with optional variations)
     */
    behavior: 'flip',
    /**
     * @prop {number} padding=5
     * The popper will flip if it hits the edges of the `boundariesElement`
     */
    padding: 5,
    /**
     * @prop {String|HTMLElement} boundariesElement='viewport'
     * The element which will define the boundaries of the popper position.
     * The popper will never be placed outside of the defined boundaries
     * (except if `keepTogether` is enabled)
     */
    boundariesElement: 'viewport',
    /**
     * @prop {Boolean} flipVariations=false
     * The popper will switch placement variation between `-start` and `-end` when
     * the reference element overlaps its boundaries.
     *
     * The original placement should have a set variation.
     */
    flipVariations: false,
    /**
     * @prop {Boolean} flipVariationsByContent=false
     * The popper will switch placement variation between `-start` and `-end` when
     * the popper element overlaps its reference boundaries.
     *
     * The original placement should have a set variation.
     */
    flipVariationsByContent: false
  },

  /**
   * Modifier used to make the popper flow toward the inner of the reference element.
   * By default, when this modifier is disabled, the popper will be placed outside
   * the reference element.
   * @memberof modifiers
   * @inner
   */
  inner: {
    /** @prop {number} order=700 - Index used to define the order of execution */
    order: 700,
    /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
    enabled: false,
    /** @prop {ModifierFn} */
    fn: inner
  },

  /**
   * Modifier used to hide the popper when its reference element is outside of the
   * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
   * be used to hide with a CSS selector the popper when its reference is
   * out of boundaries.
   *
   * Requires the `preventOverflow` modifier before it in order to work.
   * @memberof modifiers
   * @inner
   */
  hide: {
    /** @prop {number} order=800 - Index used to define the order of execution */
    order: 800,
    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
    enabled: true,
    /** @prop {ModifierFn} */
    fn: hide
  },

  /**
   * Computes the style that will be applied to the popper element to gets
   * properly positioned.
   *
   * Note that this modifier will not touch the DOM, it just prepares the styles
   * so that `applyStyle` modifier can apply it. This separation is useful
   * in case you need to replace `applyStyle` with a custom implementation.
   *
   * This modifier has `850` as `order` value to maintain backward compatibility
   * with previous versions of Popper.js. Expect the modifiers ordering method
   * to change in future major versions of the library.
   *
   * @memberof modifiers
   * @inner
   */
  computeStyle: {
    /** @prop {number} order=850 - Index used to define the order of execution */
    order: 850,
    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
    enabled: true,
    /** @prop {ModifierFn} */
    fn: computeStyle,
    /**
     * @prop {Boolean} gpuAcceleration=true
     * If true, it uses the CSS 3D transformation to position the popper.
     * Otherwise, it will use the `top` and `left` properties
     */
    gpuAcceleration: true,
    /**
     * @prop {string} [x='bottom']
     * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
     * Change this if your popper should grow in a direction different from `bottom`
     */
    x: 'bottom',
    /**
     * @prop {string} [x='left']
     * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
     * Change this if your popper should grow in a direction different from `right`
     */
    y: 'right'
  },

  /**
   * Applies the computed styles to the popper element.
   *
   * All the DOM manipulations are limited to this modifier. This is useful in case
   * you want to integrate Popper.js inside a framework or view library and you
   * want to delegate all the DOM manipulations to it.
   *
   * Note that if you disable this modifier, you must make sure the popper element
   * has its position set to `absolute` before Popper.js can do its work!
   *
   * Just disable this modifier and define your own to achieve the desired effect.
   *
   * @memberof modifiers
   * @inner
   */
  applyStyle: {
    /** @prop {number} order=900 - Index used to define the order of execution */
    order: 900,
    /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
    enabled: true,
    /** @prop {ModifierFn} */
    fn: applyStyle,
    /** @prop {Function} */
    onLoad: applyStyleOnLoad,
    /**
     * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
     * @prop {Boolean} gpuAcceleration=true
     * If true, it uses the CSS 3D transformation to position the popper.
     * Otherwise, it will use the `top` and `left` properties
     */
    gpuAcceleration: undefined
  }
};

/**
 * The `dataObject` is an object containing all the information used by Popper.js.
 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
 * @name dataObject
 * @property {Object} data.instance The Popper.js instance
 * @property {String} data.placement Placement applied to popper
 * @property {String} data.originalPlacement Placement originally defined on init
 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
 * @property {Object} data.boundaries Offsets of the popper boundaries
 * @property {Object} data.offsets The measurements of popper, reference and arrow elements
 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
 */

/**
 * Default options provided to Popper.js constructor.<br />
 * These can be overridden using the `options` argument of Popper.js.<br />
 * To override an option, simply pass an object with the same
 * structure of the `options` object, as the 3rd argument. For example:
 * ```
 * new Popper(ref, pop, {
 *   modifiers: {
 *     preventOverflow: { enabled: false }
 *   }
 * })
 * ```
 * @type {Object}
 * @static
 * @memberof Popper
 */
var Defaults = {
  /**
   * Popper's placement.
   * @prop {Popper.placements} placement='bottom'
   */
  placement: 'bottom',

  /**
   * Set this to true if you want popper to position it self in 'fixed' mode
   * @prop {Boolean} positionFixed=false
   */
  positionFixed: false,

  /**
   * Whether events (resize, scroll) are initially enabled.
   * @prop {Boolean} eventsEnabled=true
   */
  eventsEnabled: true,

  /**
   * Set to true if you want to automatically remove the popper when
   * you call the `destroy` method.
   * @prop {Boolean} removeOnDestroy=false
   */
  removeOnDestroy: false,

  /**
   * Callback called when the popper is created.<br />
   * By default, it is set to no-op.<br />
   * Access Popper.js instance with `data.instance`.
   * @prop {onCreate}
   */
  onCreate: function onCreate() {},

  /**
   * Callback called when the popper is updated. This callback is not called
   * on the initialization/creation of the popper, but only on subsequent
   * updates.<br />
   * By default, it is set to no-op.<br />
   * Access Popper.js instance with `data.instance`.
   * @prop {onUpdate}
   */
  onUpdate: function onUpdate() {},

  /**
   * List of modifiers used to modify the offsets before they are applied to the popper.
   * They provide most of the functionalities of Popper.js.
   * @prop {modifiers}
   */
  modifiers: modifiers
};

/**
 * @callback onCreate
 * @param {dataObject} data
 */

/**
 * @callback onUpdate
 * @param {dataObject} data
 */

// Utils
// Methods
var Popper = function () {
  /**
   * Creates a new Popper.js instance.
   * @class Popper
   * @param {Element|referenceObject} reference - The reference element used to position the popper
   * @param {Element} popper - The HTML / XML element used as the popper
   * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
   * @return {Object} instance - The generated Popper.js instance
   */
  function Popper(reference, popper) {
    var _this = this;

    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
    classCallCheck(this, Popper);

    this.scheduleUpdate = function () {
      return requestAnimationFrame(_this.update);
    };

    // make update() debounced, so that it only runs at most once-per-tick
    this.update = popper_debounce(this.update.bind(this));

    // with {} we create a new object with the options inside it
    this.options = popper_extends({}, Popper.Defaults, options);

    // init state
    this.state = {
      isDestroyed: false,
      isCreated: false,
      scrollParents: []
    };

    // get reference and popper elements (allow jQuery wrappers)
    this.reference = reference && reference.jquery ? reference[0] : reference;
    this.popper = popper && popper.jquery ? popper[0] : popper;

    // Deep merge modifiers options
    this.options.modifiers = {};
    Object.keys(popper_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
      _this.options.modifiers[name] = popper_extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
    });

    // Refactoring modifiers' list (Object => Array)
    this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
      return popper_extends({
        name: name
      }, _this.options.modifiers[name]);
    })
    // sort the modifiers by order
    .sort(function (a, b) {
      return a.order - b.order;
    });

    // modifiers have the ability to execute arbitrary code when Popper.js get inited
    // such code is executed in the same order of its modifier
    // they could add new properties to their options configuration
    // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
    this.modifiers.forEach(function (modifierOptions) {
      if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
        modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
      }
    });

    // fire the first update to position the popper in the right place
    this.update();

    var eventsEnabled = this.options.eventsEnabled;
    if (eventsEnabled) {
      // setup event listeners, they will take care of update the position in specific situations
      this.enableEventListeners();
    }

    this.state.eventsEnabled = eventsEnabled;
  }

  // We can't use class properties because they don't get listed in the
  // class prototype and break stuff like Sinon stubs


  createClass(Popper, [{
    key: 'update',
    value: function update$$1() {
      return popper_update.call(this);
    }
  }, {
    key: 'destroy',
    value: function destroy$$1() {
      return destroy.call(this);
    }
  }, {
    key: 'enableEventListeners',
    value: function enableEventListeners$$1() {
      return enableEventListeners.call(this);
    }
  }, {
    key: 'disableEventListeners',
    value: function disableEventListeners$$1() {
      return disableEventListeners.call(this);
    }

    /**
     * Schedules an update. It will run on the next UI update available.
     * @method scheduleUpdate
     * @memberof Popper
     */


    /**
     * Collection of utilities useful when writing custom modifiers.
     * Starting from version 1.7, this method is available only if you
     * include `popper-utils.js` before `popper.js`.
     *
     * **DEPRECATION**: This way to access PopperUtils is deprecated
     * and will be removed in v2! Use the PopperUtils module directly instead.
     * Due to the high instability of the methods contained in Utils, we can't
     * guarantee them to follow semver. Use them at your own risk!
     * @static
     * @private
     * @type {Object}
     * @deprecated since version 1.8
     * @member Utils
     * @memberof Popper
     */

  }]);
  return Popper;
}();

/**
 * The `referenceObject` is an object that provides an interface compatible with Popper.js
 * and lets you use it as replacement of a real DOM node.<br />
 * You can use this method to position a popper relatively to a set of coordinates
 * in case you don't have a DOM node to use as reference.
 *
 * ```
 * new Popper(referenceObject, popperNode);
 * ```
 *
 * NB: This feature isn't supported in Internet Explorer 10.
 * @name referenceObject
 * @property {Function} data.getBoundingClientRect
 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
 * @property {number} data.clientWidth
 * An ES6 getter that will return the width of the virtual reference element.
 * @property {number} data.clientHeight
 * An ES6 getter that will return the height of the virtual reference element.
 */


Popper.Utils = (typeof window !== 'undefined' ? window : __webpack_require__.g).PopperUtils;
Popper.placements = placements;
Popper.Defaults = Defaults;

/* harmony default export */ var esm_popper = (Popper);
//# sourceMappingURL=popper.js.map

;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/Portal/Portal.js








function getContainer(container) {
  container = typeof container === 'function' ? container() : container; // #StrictMode ready

  return react_dom.findDOMNode(container);
}

var useEnhancedEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
/**
 * Portals provide a first-class way to render children into a DOM node
 * that exists outside the DOM hierarchy of the parent component.
 */

var Portal = /*#__PURE__*/react.forwardRef(function Portal(props, ref) {
  var children = props.children,
      container = props.container,
      _props$disablePortal = props.disablePortal,
      disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,
      onRendered = props.onRendered;

  var _React$useState = react.useState(null),
      mountNode = _React$useState[0],
      setMountNode = _React$useState[1];

  var handleRef = useForkRef( /*#__PURE__*/react.isValidElement(children) ? children.ref : null, ref);
  useEnhancedEffect(function () {
    if (!disablePortal) {
      setMountNode(getContainer(container) || document.body);
    }
  }, [container, disablePortal]);
  useEnhancedEffect(function () {
    if (mountNode && !disablePortal) {
      setRef_setRef(ref, mountNode);
      return function () {
        setRef_setRef(ref, null);
      };
    }

    return undefined;
  }, [ref, mountNode, disablePortal]);
  useEnhancedEffect(function () {
    if (onRendered && (mountNode || disablePortal)) {
      onRendered();
    }
  }, [onRendered, mountNode, disablePortal]);

  if (disablePortal) {
    if ( /*#__PURE__*/react.isValidElement(children)) {
      return /*#__PURE__*/react.cloneElement(children, {
        ref: handleRef
      });
    }

    return children;
  }

  return mountNode ? /*#__PURE__*/react_dom.createPortal(children, mountNode) : mountNode;
});
 false ? 0 : void 0;

if (false) {}

/* harmony default export */ var Portal_Portal = (Portal);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/utils/createChainedFunction.js
/**
 * Safe chained function
 *
 * Will only create a new function if needed,
 * otherwise will pass back existing functions or null.
 *
 * @param {function} functions to chain
 * @returns {function|null}
 */
function createChainedFunction() {
  for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
    funcs[_key] = arguments[_key];
  }

  return funcs.reduce(function (acc, func) {
    if (func == null) {
      return acc;
    }

    if (false) {}

    return function chainedFunction() {
      for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        args[_key2] = arguments[_key2];
      }

      acc.apply(this, args);
      func.apply(this, args);
    };
  }, function () {});
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/Popper/Popper.js












function flipPlacement(placement, theme) {
  var direction = theme && theme.direction || 'ltr';

  if (direction === 'ltr') {
    return placement;
  }

  switch (placement) {
    case 'bottom-end':
      return 'bottom-start';

    case 'bottom-start':
      return 'bottom-end';

    case 'top-end':
      return 'top-start';

    case 'top-start':
      return 'top-end';

    default:
      return placement;
  }
}

function getAnchorEl(anchorEl) {
  return typeof anchorEl === 'function' ? anchorEl() : anchorEl;
}

var Popper_useEnhancedEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
var defaultPopperOptions = {};
/**
 * Poppers rely on the 3rd party library [Popper.js](https://popper.js.org/docs/v1/) for positioning.
 */

var Popper_Popper = /*#__PURE__*/react.forwardRef(function Popper(props, ref) {
  var anchorEl = props.anchorEl,
      children = props.children,
      container = props.container,
      _props$disablePortal = props.disablePortal,
      disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,
      _props$keepMounted = props.keepMounted,
      keepMounted = _props$keepMounted === void 0 ? false : _props$keepMounted,
      modifiers = props.modifiers,
      open = props.open,
      _props$placement = props.placement,
      initialPlacement = _props$placement === void 0 ? 'bottom' : _props$placement,
      _props$popperOptions = props.popperOptions,
      popperOptions = _props$popperOptions === void 0 ? defaultPopperOptions : _props$popperOptions,
      popperRefProp = props.popperRef,
      style = props.style,
      _props$transition = props.transition,
      transition = _props$transition === void 0 ? false : _props$transition,
      other = objectWithoutProperties_objectWithoutProperties(props, ["anchorEl", "children", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition"]);

  var tooltipRef = react.useRef(null);
  var ownRef = useForkRef(tooltipRef, ref);
  var popperRef = react.useRef(null);
  var handlePopperRef = useForkRef(popperRef, popperRefProp);
  var handlePopperRefRef = react.useRef(handlePopperRef);
  Popper_useEnhancedEffect(function () {
    handlePopperRefRef.current = handlePopperRef;
  }, [handlePopperRef]);
  react.useImperativeHandle(popperRefProp, function () {
    return popperRef.current;
  }, []);

  var _React$useState = react.useState(true),
      exited = _React$useState[0],
      setExited = _React$useState[1];

  var theme = useTheme();
  var rtlPlacement = flipPlacement(initialPlacement, theme);
  /**
   * placement initialized from prop but can change during lifetime if modifiers.flip.
   * modifiers.flip is essentially a flip for controlled/uncontrolled behavior
   */

  var _React$useState2 = react.useState(rtlPlacement),
      placement = _React$useState2[0],
      setPlacement = _React$useState2[1];

  react.useEffect(function () {
    if (popperRef.current) {
      popperRef.current.update();
    }
  });
  var handleOpen = react.useCallback(function () {
    if (!tooltipRef.current || !anchorEl || !open) {
      return;
    }

    if (popperRef.current) {
      popperRef.current.destroy();
      handlePopperRefRef.current(null);
    }

    var handlePopperUpdate = function handlePopperUpdate(data) {
      setPlacement(data.placement);
    };

    var resolvedAnchorEl = getAnchorEl(anchorEl);

    if (false) { var box; }

    var popper = new esm_popper(getAnchorEl(anchorEl), tooltipRef.current, (0,esm_extends/* default */.A)({
      placement: rtlPlacement
    }, popperOptions, {
      modifiers: (0,esm_extends/* default */.A)({}, disablePortal ? {} : {
        // It's using scrollParent by default, we can use the viewport when using a portal.
        preventOverflow: {
          boundariesElement: 'window'
        }
      }, modifiers, popperOptions.modifiers),
      // We could have been using a custom modifier like react-popper is doing.
      // But it seems this is the best public API for this use case.
      onCreate: createChainedFunction(handlePopperUpdate, popperOptions.onCreate),
      onUpdate: createChainedFunction(handlePopperUpdate, popperOptions.onUpdate)
    }));
    handlePopperRefRef.current(popper);
  }, [anchorEl, disablePortal, modifiers, open, rtlPlacement, popperOptions]);
  var handleRef = react.useCallback(function (node) {
    setRef_setRef(ownRef, node);
    handleOpen();
  }, [ownRef, handleOpen]);

  var handleEnter = function handleEnter() {
    setExited(false);
  };

  var handleClose = function handleClose() {
    if (!popperRef.current) {
      return;
    }

    popperRef.current.destroy();
    handlePopperRefRef.current(null);
  };

  var handleExited = function handleExited() {
    setExited(true);
    handleClose();
  };

  react.useEffect(function () {
    return function () {
      handleClose();
    };
  }, []);
  react.useEffect(function () {
    if (!open && !transition) {
      // Otherwise handleExited will call this.
      handleClose();
    }
  }, [open, transition]);

  if (!keepMounted && !open && (!transition || exited)) {
    return null;
  }

  var childProps = {
    placement: placement
  };

  if (transition) {
    childProps.TransitionProps = {
      in: open,
      onEnter: handleEnter,
      onExited: handleExited
    };
  }

  return /*#__PURE__*/react.createElement(Portal_Portal, {
    disablePortal: disablePortal,
    container: container
  }, /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.A)({
    ref: handleRef,
    role: "tooltip"
  }, other, {
    style: (0,esm_extends/* default */.A)({
      // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
      position: 'fixed',
      // Fix Popper.js display issue
      top: 0,
      left: 0,
      display: !open && keepMounted && !transition ? 'none' : null
    }, style)
  }), typeof children === 'function' ? children(childProps) : children));
});
 false ? 0 : void 0;
/* harmony default export */ var esm_Popper_Popper = (Popper_Popper);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/utils/unstable_useId.js

/**
 * Private module reserved for @material-ui/x packages.
 */

function unstable_useId_useId(idOverride) {
  var _React$useState = react.useState(idOverride),
      defaultId = _React$useState[0],
      setDefaultId = _React$useState[1];

  var id = idOverride || defaultId;
  react.useEffect(function () {
    if (defaultId == null) {
      // Fallback to this default id when possible.
      // Use the random value for client-side rendering only.
      // We can't use it server-side.
      setDefaultId("mui-".concat(Math.round(Math.random() * 1e5)));
    }
  }, [defaultId]);
  return id;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/utils/useIsFocusVisible.js
// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js


var hadKeyboardEvent = true;
var hadFocusVisibleRecently = false;
var hadFocusVisibleRecentlyTimeout = null;
var inputTypesWhitelist = {
  text: true,
  search: true,
  url: true,
  tel: true,
  email: true,
  password: true,
  number: true,
  date: true,
  month: true,
  week: true,
  time: true,
  datetime: true,
  'datetime-local': true
};
/**
 * Computes whether the given element should automatically trigger the
 * `focus-visible` class being added, i.e. whether it should always match
 * `:focus-visible` when focused.
 * @param {Element} node
 * @return {boolean}
 */

function focusTriggersKeyboardModality(node) {
  var type = node.type,
      tagName = node.tagName;

  if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
    return true;
  }

  if (tagName === 'TEXTAREA' && !node.readOnly) {
    return true;
  }

  if (node.isContentEditable) {
    return true;
  }

  return false;
}
/**
 * Keep track of our keyboard modality state with `hadKeyboardEvent`.
 * If the most recent user interaction was via the keyboard;
 * and the key press did not include a meta, alt/option, or control key;
 * then the modality is keyboard. Otherwise, the modality is not keyboard.
 * @param {KeyboardEvent} event
 */


function handleKeyDown(event) {
  if (event.metaKey || event.altKey || event.ctrlKey) {
    return;
  }

  hadKeyboardEvent = true;
}
/**
 * If at any point a user clicks with a pointing device, ensure that we change
 * the modality away from keyboard.
 * This avoids the situation where a user presses a key on an already focused
 * element, and then clicks on a different element, focusing it with a
 * pointing device, while we still think we're in keyboard modality.
 */


function handlePointerDown() {
  hadKeyboardEvent = false;
}

function handleVisibilityChange() {
  if (this.visibilityState === 'hidden') {
    // If the tab becomes active again, the browser will handle calling focus
    // on the element (Safari actually calls it twice).
    // If this tab change caused a blur on an element with focus-visible,
    // re-apply the class when the user switches back to the tab.
    if (hadFocusVisibleRecently) {
      hadKeyboardEvent = true;
    }
  }
}

function prepare(doc) {
  doc.addEventListener('keydown', handleKeyDown, true);
  doc.addEventListener('mousedown', handlePointerDown, true);
  doc.addEventListener('pointerdown', handlePointerDown, true);
  doc.addEventListener('touchstart', handlePointerDown, true);
  doc.addEventListener('visibilitychange', handleVisibilityChange, true);
}

function teardown(doc) {
  doc.removeEventListener('keydown', handleKeyDown, true);
  doc.removeEventListener('mousedown', handlePointerDown, true);
  doc.removeEventListener('pointerdown', handlePointerDown, true);
  doc.removeEventListener('touchstart', handlePointerDown, true);
  doc.removeEventListener('visibilitychange', handleVisibilityChange, true);
}

function isFocusVisible(event) {
  var target = event.target;

  try {
    return target.matches(':focus-visible');
  } catch (error) {} // browsers not implementing :focus-visible will throw a SyntaxError
  // we use our own heuristic for those browsers
  // rethrow might be better if it's not the expected error but do we really
  // want to crash if focus-visible malfunctioned?
  // no need for validFocusTarget check. the user does that by attaching it to
  // focusable events only


  return hadKeyboardEvent || focusTriggersKeyboardModality(target);
}
/**
 * Should be called if a blur event is fired on a focus-visible element
 */


function handleBlurVisible() {
  // To detect a tab/window switch, we look for a blur event followed
  // rapidly by a visibility change.
  // If we don't see a visibility change within 100ms, it's probably a
  // regular focus change.
  hadFocusVisibleRecently = true;
  window.clearTimeout(hadFocusVisibleRecentlyTimeout);
  hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {
    hadFocusVisibleRecently = false;
  }, 100);
}

function useIsFocusVisible() {
  var ref = react.useCallback(function (instance) {
    var node = react_dom.findDOMNode(instance);

    if (node != null) {
      prepare(node.ownerDocument);
    }
  }, []);

  if (false) {}

  return {
    isFocusVisible: isFocusVisible,
    onBlurVisible: handleBlurVisible,
    ref: ref
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/utils/useControlled.js
/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */

function useControlled_useControlled(_ref) {
  var controlled = _ref.controlled,
      defaultProp = _ref.default,
      name = _ref.name,
      _ref$state = _ref.state,
      state = _ref$state === void 0 ? 'value' : _ref$state;

  var _React$useRef = react.useRef(controlled !== undefined),
      isControlled = _React$useRef.current;

  var _React$useState = react.useState(defaultProp),
      valueState = _React$useState[0],
      setValue = _React$useState[1];

  var value = isControlled ? controlled : valueState;

  if (false) { var _React$useRef2, defaultValue; }

  var setValueIfUncontrolled = react.useCallback(function (newValue) {
    if (!isControlled) {
      setValue(newValue);
    }
  }, []);
  return [value, setValueIfUncontrolled];
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/Tooltip/Tooltip.js





















function Tooltip_round(value) {
  return Math.round(value * 1e5) / 1e5;
}

function arrowGenerator() {
  return {
    '&[x-placement*="bottom"] $arrow': {
      top: 0,
      left: 0,
      marginTop: '-0.71em',
      marginLeft: 4,
      marginRight: 4,
      '&::before': {
        transformOrigin: '0 100%'
      }
    },
    '&[x-placement*="top"] $arrow': {
      bottom: 0,
      left: 0,
      marginBottom: '-0.71em',
      marginLeft: 4,
      marginRight: 4,
      '&::before': {
        transformOrigin: '100% 0'
      }
    },
    '&[x-placement*="right"] $arrow': {
      left: 0,
      marginLeft: '-0.71em',
      height: '1em',
      width: '0.71em',
      marginTop: 4,
      marginBottom: 4,
      '&::before': {
        transformOrigin: '100% 100%'
      }
    },
    '&[x-placement*="left"] $arrow': {
      right: 0,
      marginRight: '-0.71em',
      height: '1em',
      width: '0.71em',
      marginTop: 4,
      marginBottom: 4,
      '&::before': {
        transformOrigin: '0 0'
      }
    }
  };
}

var Tooltip_styles = function styles(theme) {
  return {
    /* Styles applied to the Popper component. */
    popper: {
      zIndex: theme.zIndex.tooltip,
      pointerEvents: 'none' // disable jss-rtl plugin

    },

    /* Styles applied to the Popper component if `interactive={true}`. */
    popperInteractive: {
      pointerEvents: 'auto'
    },

    /* Styles applied to the Popper component if `arrow={true}`. */
    popperArrow: arrowGenerator(),

    /* Styles applied to the tooltip (label wrapper) element. */
    tooltip: {
      backgroundColor: alpha(theme.palette.grey[700], 0.9),
      borderRadius: theme.shape.borderRadius,
      color: theme.palette.common.white,
      fontFamily: theme.typography.fontFamily,
      padding: '4px 8px',
      fontSize: theme.typography.pxToRem(10),
      lineHeight: "".concat(Tooltip_round(14 / 10), "em"),
      maxWidth: 300,
      wordWrap: 'break-word',
      fontWeight: theme.typography.fontWeightMedium
    },

    /* Styles applied to the tooltip (label wrapper) element if `arrow={true}`. */
    tooltipArrow: {
      position: 'relative',
      margin: '0'
    },

    /* Styles applied to the arrow element. */
    arrow: {
      overflow: 'hidden',
      position: 'absolute',
      width: '1em',
      height: '0.71em'
      /* = width / sqrt(2) = (length of the hypotenuse) */
      ,
      boxSizing: 'border-box',
      color: alpha(theme.palette.grey[700], 0.9),
      '&::before': {
        content: '""',
        margin: 'auto',
        display: 'block',
        width: '100%',
        height: '100%',
        backgroundColor: 'currentColor',
        transform: 'rotate(45deg)'
      }
    },

    /* Styles applied to the tooltip (label wrapper) element if the tooltip is opened by touch. */
    touch: {
      padding: '8px 16px',
      fontSize: theme.typography.pxToRem(14),
      lineHeight: "".concat(Tooltip_round(16 / 14), "em"),
      fontWeight: theme.typography.fontWeightRegular
    },

    /* Styles applied to the tooltip (label wrapper) element if `placement` contains "left". */
    tooltipPlacementLeft: defineProperty_defineProperty({
      transformOrigin: 'right center',
      margin: '0 24px '
    }, theme.breakpoints.up('sm'), {
      margin: '0 14px'
    }),

    /* Styles applied to the tooltip (label wrapper) element if `placement` contains "right". */
    tooltipPlacementRight: defineProperty_defineProperty({
      transformOrigin: 'left center',
      margin: '0 24px'
    }, theme.breakpoints.up('sm'), {
      margin: '0 14px'
    }),

    /* Styles applied to the tooltip (label wrapper) element if `placement` contains "top". */
    tooltipPlacementTop: defineProperty_defineProperty({
      transformOrigin: 'center bottom',
      margin: '24px 0'
    }, theme.breakpoints.up('sm'), {
      margin: '14px 0'
    }),

    /* Styles applied to the tooltip (label wrapper) element if `placement` contains "bottom". */
    tooltipPlacementBottom: defineProperty_defineProperty({
      transformOrigin: 'center top',
      margin: '24px 0'
    }, theme.breakpoints.up('sm'), {
      margin: '14px 0'
    })
  };
};
var hystersisOpen = false;
var hystersisTimer = null;
function testReset() {
  hystersisOpen = false;
  clearTimeout(hystersisTimer);
}
var Tooltip_Tooltip = /*#__PURE__*/react.forwardRef(function Tooltip(props, ref) {
  var _props$arrow = props.arrow,
      arrow = _props$arrow === void 0 ? false : _props$arrow,
      children = props.children,
      classes = props.classes,
      _props$disableFocusLi = props.disableFocusListener,
      disableFocusListener = _props$disableFocusLi === void 0 ? false : _props$disableFocusLi,
      _props$disableHoverLi = props.disableHoverListener,
      disableHoverListener = _props$disableHoverLi === void 0 ? false : _props$disableHoverLi,
      _props$disableTouchLi = props.disableTouchListener,
      disableTouchListener = _props$disableTouchLi === void 0 ? false : _props$disableTouchLi,
      _props$enterDelay = props.enterDelay,
      enterDelay = _props$enterDelay === void 0 ? 100 : _props$enterDelay,
      _props$enterNextDelay = props.enterNextDelay,
      enterNextDelay = _props$enterNextDelay === void 0 ? 0 : _props$enterNextDelay,
      _props$enterTouchDela = props.enterTouchDelay,
      enterTouchDelay = _props$enterTouchDela === void 0 ? 700 : _props$enterTouchDela,
      idProp = props.id,
      _props$interactive = props.interactive,
      interactive = _props$interactive === void 0 ? false : _props$interactive,
      _props$leaveDelay = props.leaveDelay,
      leaveDelay = _props$leaveDelay === void 0 ? 0 : _props$leaveDelay,
      _props$leaveTouchDela = props.leaveTouchDelay,
      leaveTouchDelay = _props$leaveTouchDela === void 0 ? 1500 : _props$leaveTouchDela,
      onClose = props.onClose,
      onOpen = props.onOpen,
      openProp = props.open,
      _props$placement = props.placement,
      placement = _props$placement === void 0 ? 'bottom' : _props$placement,
      _props$PopperComponen = props.PopperComponent,
      PopperComponent = _props$PopperComponen === void 0 ? esm_Popper_Popper : _props$PopperComponen,
      PopperProps = props.PopperProps,
      title = props.title,
      _props$TransitionComp = props.TransitionComponent,
      TransitionComponent = _props$TransitionComp === void 0 ? Grow_Grow : _props$TransitionComp,
      TransitionProps = props.TransitionProps,
      other = objectWithoutProperties_objectWithoutProperties(props, ["arrow", "children", "classes", "disableFocusListener", "disableHoverListener", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "id", "interactive", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "title", "TransitionComponent", "TransitionProps"]);

  var theme = useTheme_useTheme();

  var _React$useState = react.useState(),
      childNode = _React$useState[0],
      setChildNode = _React$useState[1];

  var _React$useState2 = react.useState(null),
      arrowRef = _React$useState2[0],
      setArrowRef = _React$useState2[1];

  var ignoreNonTouchEvents = react.useRef(false);
  var closeTimer = react.useRef();
  var enterTimer = react.useRef();
  var leaveTimer = react.useRef();
  var touchTimer = react.useRef();

  var _useControlled = useControlled_useControlled({
    controlled: openProp,
    default: false,
    name: 'Tooltip',
    state: 'open'
  }),
      _useControlled2 = slicedToArray_slicedToArray(_useControlled, 2),
      openState = _useControlled2[0],
      setOpenState = _useControlled2[1];

  var open = openState;

  if (false) { var _React$useRef, isControlled; }

  var id = unstable_useId_useId(idProp);
  react.useEffect(function () {
    return function () {
      clearTimeout(closeTimer.current);
      clearTimeout(enterTimer.current);
      clearTimeout(leaveTimer.current);
      clearTimeout(touchTimer.current);
    };
  }, []);

  var handleOpen = function handleOpen(event) {
    clearTimeout(hystersisTimer);
    hystersisOpen = true; // The mouseover event will trigger for every nested element in the tooltip.
    // We can skip rerendering when the tooltip is already open.
    // We are using the mouseover event instead of the mouseenter event to fix a hide/show issue.

    setOpenState(true);

    if (onOpen) {
      onOpen(event);
    }
  };

  var handleEnter = function handleEnter() {
    var forward = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
    return function (event) {
      var childrenProps = children.props;

      if (event.type === 'mouseover' && childrenProps.onMouseOver && forward) {
        childrenProps.onMouseOver(event);
      }

      if (ignoreNonTouchEvents.current && event.type !== 'touchstart') {
        return;
      } // Remove the title ahead of time.
      // We don't want to wait for the next render commit.
      // We would risk displaying two tooltips at the same time (native + this one).


      if (childNode) {
        childNode.removeAttribute('title');
      }

      clearTimeout(enterTimer.current);
      clearTimeout(leaveTimer.current);

      if (enterDelay || hystersisOpen && enterNextDelay) {
        event.persist();
        enterTimer.current = setTimeout(function () {
          handleOpen(event);
        }, hystersisOpen ? enterNextDelay : enterDelay);
      } else {
        handleOpen(event);
      }
    };
  };

  var _useIsFocusVisible = useIsFocusVisible(),
      isFocusVisible = _useIsFocusVisible.isFocusVisible,
      onBlurVisible = _useIsFocusVisible.onBlurVisible,
      focusVisibleRef = _useIsFocusVisible.ref;

  var _React$useState3 = react.useState(false),
      childIsFocusVisible = _React$useState3[0],
      setChildIsFocusVisible = _React$useState3[1];

  var handleBlur = function handleBlur() {
    if (childIsFocusVisible) {
      setChildIsFocusVisible(false);
      onBlurVisible();
    }
  };

  var handleFocus = function handleFocus() {
    var forward = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
    return function (event) {
      // Workaround for https://github.com/facebook/react/issues/7769
      // The autoFocus of React might trigger the event before the componentDidMount.
      // We need to account for this eventuality.
      if (!childNode) {
        setChildNode(event.currentTarget);
      }

      if (isFocusVisible(event)) {
        setChildIsFocusVisible(true);
        handleEnter()(event);
      }

      var childrenProps = children.props;

      if (childrenProps.onFocus && forward) {
        childrenProps.onFocus(event);
      }
    };
  };

  var handleClose = function handleClose(event) {
    clearTimeout(hystersisTimer);
    hystersisTimer = setTimeout(function () {
      hystersisOpen = false;
    }, 800 + leaveDelay);
    setOpenState(false);

    if (onClose) {
      onClose(event);
    }

    clearTimeout(closeTimer.current);
    closeTimer.current = setTimeout(function () {
      ignoreNonTouchEvents.current = false;
    }, theme.transitions.duration.shortest);
  };

  var handleLeave = function handleLeave() {
    var forward = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
    return function (event) {
      var childrenProps = children.props;

      if (event.type === 'blur') {
        if (childrenProps.onBlur && forward) {
          childrenProps.onBlur(event);
        }

        handleBlur();
      }

      if (event.type === 'mouseleave' && childrenProps.onMouseLeave && event.currentTarget === childNode) {
        childrenProps.onMouseLeave(event);
      }

      clearTimeout(enterTimer.current);
      clearTimeout(leaveTimer.current);
      event.persist();
      leaveTimer.current = setTimeout(function () {
        handleClose(event);
      }, leaveDelay);
    };
  };

  var detectTouchStart = function detectTouchStart(event) {
    ignoreNonTouchEvents.current = true;
    var childrenProps = children.props;

    if (childrenProps.onTouchStart) {
      childrenProps.onTouchStart(event);
    }
  };

  var handleTouchStart = function handleTouchStart(event) {
    detectTouchStart(event);
    clearTimeout(leaveTimer.current);
    clearTimeout(closeTimer.current);
    clearTimeout(touchTimer.current);
    event.persist();
    touchTimer.current = setTimeout(function () {
      handleEnter()(event);
    }, enterTouchDelay);
  };

  var handleTouchEnd = function handleTouchEnd(event) {
    if (children.props.onTouchEnd) {
      children.props.onTouchEnd(event);
    }

    clearTimeout(touchTimer.current);
    clearTimeout(leaveTimer.current);
    event.persist();
    leaveTimer.current = setTimeout(function () {
      handleClose(event);
    }, leaveTouchDelay);
  };

  var handleUseRef = useForkRef(setChildNode, ref);
  var handleFocusRef = useForkRef(focusVisibleRef, handleUseRef); // can be removed once we drop support for non ref forwarding class components

  var handleOwnRef = react.useCallback(function (instance) {
    // #StrictMode ready
    setRef_setRef(handleFocusRef, react_dom.findDOMNode(instance));
  }, [handleFocusRef]);
  var handleRef = useForkRef(children.ref, handleOwnRef); // There is no point in displaying an empty tooltip.

  if (title === '') {
    open = false;
  } // For accessibility and SEO concerns, we render the title to the DOM node when
  // the tooltip is hidden. However, we have made a tradeoff when
  // `disableHoverListener` is set. This title logic is disabled.
  // It's allowing us to keep the implementation size minimal.
  // We are open to change the tradeoff.


  var shouldShowNativeTitle = !open && !disableHoverListener;

  var childrenProps = (0,esm_extends/* default */.A)({
    'aria-describedby': open ? id : null,
    title: shouldShowNativeTitle && typeof title === 'string' ? title : null
  }, other, children.props, {
    className: (0,clsx_m/* default */.A)(other.className, children.props.className),
    onTouchStart: detectTouchStart,
    ref: handleRef
  });

  var interactiveWrapperListeners = {};

  if (!disableTouchListener) {
    childrenProps.onTouchStart = handleTouchStart;
    childrenProps.onTouchEnd = handleTouchEnd;
  }

  if (!disableHoverListener) {
    childrenProps.onMouseOver = handleEnter();
    childrenProps.onMouseLeave = handleLeave();

    if (interactive) {
      interactiveWrapperListeners.onMouseOver = handleEnter(false);
      interactiveWrapperListeners.onMouseLeave = handleLeave(false);
    }
  }

  if (!disableFocusListener) {
    childrenProps.onFocus = handleFocus();
    childrenProps.onBlur = handleLeave();

    if (interactive) {
      interactiveWrapperListeners.onFocus = handleFocus(false);
      interactiveWrapperListeners.onBlur = handleLeave(false);
    }
  }

  if (false) {}

  var mergedPopperProps = react.useMemo(function () {
    return deepmerge({
      popperOptions: {
        modifiers: {
          arrow: {
            enabled: Boolean(arrowRef),
            element: arrowRef
          }
        }
      }
    }, PopperProps);
  }, [arrowRef, PopperProps]);
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.cloneElement(children, childrenProps), /*#__PURE__*/react.createElement(PopperComponent, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.popper, interactive && classes.popperInteractive, arrow && classes.popperArrow),
    placement: placement,
    anchorEl: childNode,
    open: childNode ? open : false,
    id: childrenProps['aria-describedby'],
    transition: true
  }, interactiveWrapperListeners, mergedPopperProps), function (_ref) {
    var placementInner = _ref.placement,
        TransitionPropsInner = _ref.TransitionProps;
    return /*#__PURE__*/react.createElement(TransitionComponent, (0,esm_extends/* default */.A)({
      timeout: theme.transitions.duration.shorter
    }, TransitionPropsInner, TransitionProps), /*#__PURE__*/react.createElement("div", {
      className: (0,clsx_m/* default */.A)(classes.tooltip, classes["tooltipPlacement".concat(capitalize(placementInner.split('-')[0]))], ignoreNonTouchEvents.current && classes.touch, arrow && classes.tooltipArrow)
    }, title, arrow ? /*#__PURE__*/react.createElement("span", {
      className: classes.arrow,
      ref: setArrowRef
    }) : null));
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var esm_Tooltip_Tooltip = (styles_withStyles(Tooltip_styles, {
  name: 'MuiTooltip',
  flip: false
})(Tooltip_Tooltip));
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/utils/useEventCallback.js

var useEventCallback_useEnhancedEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
/**
 * https://github.com/facebook/react/issues/14099#issuecomment-440013892
 *
 * @param {function} fn
 */

function useEventCallback_useEventCallback(fn) {
  var ref = react.useRef(fn);
  useEventCallback_useEnhancedEffect(function () {
    ref.current = fn;
  });
  return react.useCallback(function () {
    return (0, ref.current).apply(void 0, arguments);
  }, []);
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/react-transition-group/esm/utils/ChildMapping.js

/**
 * Given `this.props.children`, return an object mapping key to child.
 *
 * @param {*} children `this.props.children`
 * @return {object} Mapping of key to child
 */

function getChildMapping(children, mapFn) {
  var mapper = function mapper(child) {
    return mapFn && (0,react.isValidElement)(child) ? mapFn(child) : child;
  };

  var result = Object.create(null);
  if (children) react.Children.map(children, function (c) {
    return c;
  }).forEach(function (child) {
    // run the map function here instead so that the key is the computed one
    result[child.key] = mapper(child);
  });
  return result;
}
/**
 * When you're adding or removing children some may be added or removed in the
 * same render pass. We want to show *both* since we want to simultaneously
 * animate elements in and out. This function takes a previous set of keys
 * and a new set of keys and merges them with its best guess of the correct
 * ordering. In the future we may expose some of the utilities in
 * ReactMultiChild to make this easy, but for now React itself does not
 * directly have this concept of the union of prevChildren and nextChildren
 * so we implement it here.
 *
 * @param {object} prev prev children as returned from
 * `ReactTransitionChildMapping.getChildMapping()`.
 * @param {object} next next children as returned from
 * `ReactTransitionChildMapping.getChildMapping()`.
 * @return {object} a key set that contains all keys in `prev` and all keys
 * in `next` in a reasonable order.
 */

function mergeChildMappings(prev, next) {
  prev = prev || {};
  next = next || {};

  function getValueForKey(key) {
    return key in next ? next[key] : prev[key];
  } // For each key of `next`, the list of keys to insert before that key in
  // the combined list


  var nextKeysPending = Object.create(null);
  var pendingKeys = [];

  for (var prevKey in prev) {
    if (prevKey in next) {
      if (pendingKeys.length) {
        nextKeysPending[prevKey] = pendingKeys;
        pendingKeys = [];
      }
    } else {
      pendingKeys.push(prevKey);
    }
  }

  var i;
  var childMapping = {};

  for (var nextKey in next) {
    if (nextKeysPending[nextKey]) {
      for (i = 0; i < nextKeysPending[nextKey].length; i++) {
        var pendingNextKey = nextKeysPending[nextKey][i];
        childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
      }
    }

    childMapping[nextKey] = getValueForKey(nextKey);
  } // Finally, add the keys which didn't appear before any key in `next`


  for (i = 0; i < pendingKeys.length; i++) {
    childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
  }

  return childMapping;
}

function getProp(child, prop, props) {
  return props[prop] != null ? props[prop] : child.props[prop];
}

function getInitialChildMapping(props, onExited) {
  return getChildMapping(props.children, function (child) {
    return (0,react.cloneElement)(child, {
      onExited: onExited.bind(null, child),
      in: true,
      appear: getProp(child, 'appear', props),
      enter: getProp(child, 'enter', props),
      exit: getProp(child, 'exit', props)
    });
  });
}
function getNextChildMapping(nextProps, prevChildMapping, onExited) {
  var nextChildMapping = getChildMapping(nextProps.children);
  var children = mergeChildMappings(prevChildMapping, nextChildMapping);
  Object.keys(children).forEach(function (key) {
    var child = children[key];
    if (!(0,react.isValidElement)(child)) return;
    var hasPrev = (key in prevChildMapping);
    var hasNext = (key in nextChildMapping);
    var prevChild = prevChildMapping[key];
    var isLeaving = (0,react.isValidElement)(prevChild) && !prevChild.props.in; // item is new (entering)

    if (hasNext && (!hasPrev || isLeaving)) {
      // console.log('entering', key)
      children[key] = (0,react.cloneElement)(child, {
        onExited: onExited.bind(null, child),
        in: true,
        exit: getProp(child, 'exit', nextProps),
        enter: getProp(child, 'enter', nextProps)
      });
    } else if (!hasNext && hasPrev && !isLeaving) {
      // item is old (exiting)
      // console.log('leaving', key)
      children[key] = (0,react.cloneElement)(child, {
        in: false
      });
    } else if (hasNext && hasPrev && (0,react.isValidElement)(prevChild)) {
      // item hasn't changed transition states
      // copy over the last transition props;
      // console.log('unchanged', key)
      children[key] = (0,react.cloneElement)(child, {
        onExited: onExited.bind(null, child),
        in: prevChild.props.in,
        exit: getProp(child, 'exit', nextProps),
        enter: getProp(child, 'enter', nextProps)
      });
    }
  });
  return children;
}
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/react-transition-group/esm/TransitionGroup.js









var TransitionGroup_values = Object.values || function (obj) {
  return Object.keys(obj).map(function (k) {
    return obj[k];
  });
};

var defaultProps = {
  component: 'div',
  childFactory: function childFactory(child) {
    return child;
  }
};
/**
 * The `<TransitionGroup>` component manages a set of transition components
 * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
 * components, `<TransitionGroup>` is a state machine for managing the mounting
 * and unmounting of components over time.
 *
 * Consider the example below. As items are removed or added to the TodoList the
 * `in` prop is toggled automatically by the `<TransitionGroup>`.
 *
 * Note that `<TransitionGroup>`  does not define any animation behavior!
 * Exactly _how_ a list item animates is up to the individual transition
 * component. This means you can mix and match animations across different list
 * items.
 */

var TransitionGroup = /*#__PURE__*/function (_React$Component) {
  _inheritsLoose(TransitionGroup, _React$Component);

  function TransitionGroup(props, context) {
    var _this;

    _this = _React$Component.call(this, props, context) || this;

    var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear


    _this.state = {
      contextValue: {
        isMounting: true
      },
      handleExited: handleExited,
      firstRender: true
    };
    return _this;
  }

  var _proto = TransitionGroup.prototype;

  _proto.componentDidMount = function componentDidMount() {
    this.mounted = true;
    this.setState({
      contextValue: {
        isMounting: false
      }
    });
  };

  _proto.componentWillUnmount = function componentWillUnmount() {
    this.mounted = false;
  };

  TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
    var prevChildMapping = _ref.children,
        handleExited = _ref.handleExited,
        firstRender = _ref.firstRender;
    return {
      children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
      firstRender: false
    };
  } // node is `undefined` when user provided `nodeRef` prop
  ;

  _proto.handleExited = function handleExited(child, node) {
    var currentChildMapping = getChildMapping(this.props.children);
    if (child.key in currentChildMapping) return;

    if (child.props.onExited) {
      child.props.onExited(node);
    }

    if (this.mounted) {
      this.setState(function (state) {
        var children = (0,esm_extends/* default */.A)({}, state.children);

        delete children[child.key];
        return {
          children: children
        };
      });
    }
  };

  _proto.render = function render() {
    var _this$props = this.props,
        Component = _this$props.component,
        childFactory = _this$props.childFactory,
        props = (0,objectWithoutPropertiesLoose/* default */.A)(_this$props, ["component", "childFactory"]);

    var contextValue = this.state.contextValue;
    var children = TransitionGroup_values(this.state.children).map(childFactory);
    delete props.appear;
    delete props.enter;
    delete props.exit;

    if (Component === null) {
      return /*#__PURE__*/react.createElement(TransitionGroupContext.Provider, {
        value: contextValue
      }, children);
    }

    return /*#__PURE__*/react.createElement(TransitionGroupContext.Provider, {
      value: contextValue
    }, /*#__PURE__*/react.createElement(Component, props, children));
  };

  return TransitionGroup;
}(react.Component);

TransitionGroup.propTypes =  false ? 0 : {};
TransitionGroup.defaultProps = defaultProps;
/* harmony default export */ var esm_TransitionGroup = (TransitionGroup);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/ButtonBase/Ripple.js




var Ripple_useEnhancedEffect = typeof window === 'undefined' ? react.useEffect : react.useLayoutEffect;
/**
 * @ignore - internal component.
 */

function Ripple(props) {
  var classes = props.classes,
      _props$pulsate = props.pulsate,
      pulsate = _props$pulsate === void 0 ? false : _props$pulsate,
      rippleX = props.rippleX,
      rippleY = props.rippleY,
      rippleSize = props.rippleSize,
      inProp = props.in,
      _props$onExited = props.onExited,
      onExited = _props$onExited === void 0 ? function () {} : _props$onExited,
      timeout = props.timeout;

  var _React$useState = react.useState(false),
      leaving = _React$useState[0],
      setLeaving = _React$useState[1];

  var rippleClassName = (0,clsx_m/* default */.A)(classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
  var rippleStyles = {
    width: rippleSize,
    height: rippleSize,
    top: -(rippleSize / 2) + rippleY,
    left: -(rippleSize / 2) + rippleX
  };
  var childClassName = (0,clsx_m/* default */.A)(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
  var handleExited = useEventCallback_useEventCallback(onExited); // Ripple is used for user feedback (e.g. click or press) so we want to apply styles with the highest priority

  Ripple_useEnhancedEffect(function () {
    if (!inProp) {
      // react-transition-group#onExit
      setLeaving(true); // react-transition-group#onExited

      var timeoutId = setTimeout(handleExited, timeout);
      return function () {
        clearTimeout(timeoutId);
      };
    }

    return undefined;
  }, [handleExited, inProp, timeout]);
  return /*#__PURE__*/react.createElement("span", {
    className: rippleClassName,
    style: rippleStyles
  }, /*#__PURE__*/react.createElement("span", {
    className: childClassName
  }));
}

 false ? 0 : void 0;
/* harmony default export */ var ButtonBase_Ripple = (Ripple);
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/ButtonBase/TouchRipple.js









var DURATION = 550;
var DELAY_RIPPLE = 80;
var TouchRipple_styles = function styles(theme) {
  return {
    /* Styles applied to the root element. */
    root: {
      overflow: 'hidden',
      pointerEvents: 'none',
      position: 'absolute',
      zIndex: 0,
      top: 0,
      right: 0,
      bottom: 0,
      left: 0,
      borderRadius: 'inherit'
    },

    /* Styles applied to the internal `Ripple` components `ripple` class. */
    ripple: {
      opacity: 0,
      position: 'absolute'
    },

    /* Styles applied to the internal `Ripple` components `rippleVisible` class. */
    rippleVisible: {
      opacity: 0.3,
      transform: 'scale(1)',
      animation: "$enter ".concat(DURATION, "ms ").concat(theme.transitions.easing.easeInOut)
    },

    /* Styles applied to the internal `Ripple` components `ripplePulsate` class. */
    ripplePulsate: {
      animationDuration: "".concat(theme.transitions.duration.shorter, "ms")
    },

    /* Styles applied to the internal `Ripple` components `child` class. */
    child: {
      opacity: 1,
      display: 'block',
      width: '100%',
      height: '100%',
      borderRadius: '50%',
      backgroundColor: 'currentColor'
    },

    /* Styles applied to the internal `Ripple` components `childLeaving` class. */
    childLeaving: {
      opacity: 0,
      animation: "$exit ".concat(DURATION, "ms ").concat(theme.transitions.easing.easeInOut)
    },

    /* Styles applied to the internal `Ripple` components `childPulsate` class. */
    childPulsate: {
      position: 'absolute',
      left: 0,
      top: 0,
      animation: "$pulsate 2500ms ".concat(theme.transitions.easing.easeInOut, " 200ms infinite")
    },
    '@keyframes enter': {
      '0%': {
        transform: 'scale(0)',
        opacity: 0.1
      },
      '100%': {
        transform: 'scale(1)',
        opacity: 0.3
      }
    },
    '@keyframes exit': {
      '0%': {
        opacity: 1
      },
      '100%': {
        opacity: 0
      }
    },
    '@keyframes pulsate': {
      '0%': {
        transform: 'scale(1)'
      },
      '50%': {
        transform: 'scale(0.92)'
      },
      '100%': {
        transform: 'scale(1)'
      }
    }
  };
};
/**
 * @ignore - internal component.
 *
 * TODO v5: Make private
 */

var TouchRipple = /*#__PURE__*/react.forwardRef(function TouchRipple(props, ref) {
  var _props$center = props.center,
      centerProp = _props$center === void 0 ? false : _props$center,
      classes = props.classes,
      className = props.className,
      other = objectWithoutProperties_objectWithoutProperties(props, ["center", "classes", "className"]);

  var _React$useState = react.useState([]),
      ripples = _React$useState[0],
      setRipples = _React$useState[1];

  var nextKey = react.useRef(0);
  var rippleCallback = react.useRef(null);
  react.useEffect(function () {
    if (rippleCallback.current) {
      rippleCallback.current();
      rippleCallback.current = null;
    }
  }, [ripples]); // Used to filter out mouse emulated events on mobile.

  var ignoringMouseDown = react.useRef(false); // We use a timer in order to only show the ripples for touch "click" like events.
  // We don't want to display the ripple for touch scroll events.

  var startTimer = react.useRef(null); // This is the hook called once the previous timeout is ready.

  var startTimerCommit = react.useRef(null);
  var container = react.useRef(null);
  react.useEffect(function () {
    return function () {
      clearTimeout(startTimer.current);
    };
  }, []);
  var startCommit = react.useCallback(function (params) {
    var pulsate = params.pulsate,
        rippleX = params.rippleX,
        rippleY = params.rippleY,
        rippleSize = params.rippleSize,
        cb = params.cb;
    setRipples(function (oldRipples) {
      return [].concat(toConsumableArray_toConsumableArray(oldRipples), [/*#__PURE__*/react.createElement(ButtonBase_Ripple, {
        key: nextKey.current,
        classes: classes,
        timeout: DURATION,
        pulsate: pulsate,
        rippleX: rippleX,
        rippleY: rippleY,
        rippleSize: rippleSize
      })]);
    });
    nextKey.current += 1;
    rippleCallback.current = cb;
  }, [classes]);
  var start = react.useCallback(function () {
    var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    var cb = arguments.length > 2 ? arguments[2] : undefined;
    var _options$pulsate = options.pulsate,
        pulsate = _options$pulsate === void 0 ? false : _options$pulsate,
        _options$center = options.center,
        center = _options$center === void 0 ? centerProp || options.pulsate : _options$center,
        _options$fakeElement = options.fakeElement,
        fakeElement = _options$fakeElement === void 0 ? false : _options$fakeElement;

    if (event.type === 'mousedown' && ignoringMouseDown.current) {
      ignoringMouseDown.current = false;
      return;
    }

    if (event.type === 'touchstart') {
      ignoringMouseDown.current = true;
    }

    var element = fakeElement ? null : container.current;
    var rect = element ? element.getBoundingClientRect() : {
      width: 0,
      height: 0,
      left: 0,
      top: 0
    }; // Get the size of the ripple

    var rippleX;
    var rippleY;
    var rippleSize;

    if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
      rippleX = Math.round(rect.width / 2);
      rippleY = Math.round(rect.height / 2);
    } else {
      var _ref = event.touches ? event.touches[0] : event,
          clientX = _ref.clientX,
          clientY = _ref.clientY;

      rippleX = Math.round(clientX - rect.left);
      rippleY = Math.round(clientY - rect.top);
    }

    if (center) {
      rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3); // For some reason the animation is broken on Mobile Chrome if the size if even.

      if (rippleSize % 2 === 0) {
        rippleSize += 1;
      }
    } else {
      var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
      var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
      rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));
    } // Touche devices


    if (event.touches) {
      // check that this isn't another touchstart due to multitouch
      // otherwise we will only clear a single timer when unmounting while two
      // are running
      if (startTimerCommit.current === null) {
        // Prepare the ripple effect.
        startTimerCommit.current = function () {
          startCommit({
            pulsate: pulsate,
            rippleX: rippleX,
            rippleY: rippleY,
            rippleSize: rippleSize,
            cb: cb
          });
        }; // Delay the execution of the ripple effect.


        startTimer.current = setTimeout(function () {
          if (startTimerCommit.current) {
            startTimerCommit.current();
            startTimerCommit.current = null;
          }
        }, DELAY_RIPPLE); // We have to make a tradeoff with this value.
      }
    } else {
      startCommit({
        pulsate: pulsate,
        rippleX: rippleX,
        rippleY: rippleY,
        rippleSize: rippleSize,
        cb: cb
      });
    }
  }, [centerProp, startCommit]);
  var pulsate = react.useCallback(function () {
    start({}, {
      pulsate: true
    });
  }, [start]);
  var stop = react.useCallback(function (event, cb) {
    clearTimeout(startTimer.current); // The touch interaction occurs too quickly.
    // We still want to show ripple effect.

    if (event.type === 'touchend' && startTimerCommit.current) {
      event.persist();
      startTimerCommit.current();
      startTimerCommit.current = null;
      startTimer.current = setTimeout(function () {
        stop(event, cb);
      });
      return;
    }

    startTimerCommit.current = null;
    setRipples(function (oldRipples) {
      if (oldRipples.length > 0) {
        return oldRipples.slice(1);
      }

      return oldRipples;
    });
    rippleCallback.current = cb;
  }, []);
  react.useImperativeHandle(ref, function () {
    return {
      pulsate: pulsate,
      start: start,
      stop: stop
    };
  }, [pulsate, start, stop]);
  return /*#__PURE__*/react.createElement("span", (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ref: container
  }, other), /*#__PURE__*/react.createElement(esm_TransitionGroup, {
    component: null,
    exit: true
  }, ripples));
});
 false ? 0 : void 0;
/* harmony default export */ var ButtonBase_TouchRipple = (styles_withStyles(TouchRipple_styles, {
  flip: false,
  name: 'MuiTouchRipple'
})( /*#__PURE__*/react.memo(TouchRipple)));
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/ButtonBase/ButtonBase.js













var ButtonBase_styles = {
  /* Styles applied to the root element. */
  root: {
    display: 'inline-flex',
    alignItems: 'center',
    justifyContent: 'center',
    position: 'relative',
    WebkitTapHighlightColor: 'transparent',
    backgroundColor: 'transparent',
    // Reset default value
    // We disable the focus ring for mouse, touch and keyboard users.
    outline: 0,
    border: 0,
    margin: 0,
    // Remove the margin in Safari
    borderRadius: 0,
    padding: 0,
    // Remove the padding in Firefox
    cursor: 'pointer',
    userSelect: 'none',
    verticalAlign: 'middle',
    '-moz-appearance': 'none',
    // Reset
    '-webkit-appearance': 'none',
    // Reset
    textDecoration: 'none',
    // So we take precedent over the style of a native <a /> element.
    color: 'inherit',
    '&::-moz-focus-inner': {
      borderStyle: 'none' // Remove Firefox dotted outline.

    },
    '&$disabled': {
      pointerEvents: 'none',
      // Disable link interactions
      cursor: 'default'
    },
    '@media print': {
      colorAdjust: 'exact'
    }
  },

  /* Pseudo-class applied to the root element if `disabled={true}`. */
  disabled: {},

  /* Pseudo-class applied to the root element if keyboard focused. */
  focusVisible: {}
};
/**
 * `ButtonBase` contains as few styles as possible.
 * It aims to be a simple building block for creating a button.
 * It contains a load of style reset and some focus/ripple logic.
 */

var ButtonBase = /*#__PURE__*/react.forwardRef(function ButtonBase(props, ref) {
  var action = props.action,
      buttonRefProp = props.buttonRef,
      _props$centerRipple = props.centerRipple,
      centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple,
      children = props.children,
      classes = props.classes,
      className = props.className,
      _props$component = props.component,
      component = _props$component === void 0 ? 'button' : _props$component,
      _props$disabled = props.disabled,
      disabled = _props$disabled === void 0 ? false : _props$disabled,
      _props$disableRipple = props.disableRipple,
      disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,
      _props$disableTouchRi = props.disableTouchRipple,
      disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi,
      _props$focusRipple = props.focusRipple,
      focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple,
      focusVisibleClassName = props.focusVisibleClassName,
      onBlur = props.onBlur,
      onClick = props.onClick,
      onFocus = props.onFocus,
      onFocusVisible = props.onFocusVisible,
      onKeyDown = props.onKeyDown,
      onKeyUp = props.onKeyUp,
      onMouseDown = props.onMouseDown,
      onMouseLeave = props.onMouseLeave,
      onMouseUp = props.onMouseUp,
      onTouchEnd = props.onTouchEnd,
      onTouchMove = props.onTouchMove,
      onTouchStart = props.onTouchStart,
      onDragLeave = props.onDragLeave,
      _props$tabIndex = props.tabIndex,
      tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
      TouchRippleProps = props.TouchRippleProps,
      _props$type = props.type,
      type = _props$type === void 0 ? 'button' : _props$type,
      other = objectWithoutProperties_objectWithoutProperties(props, ["action", "buttonRef", "centerRipple", "children", "classes", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "onBlur", "onClick", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "onDragLeave", "tabIndex", "TouchRippleProps", "type"]);

  var buttonRef = react.useRef(null);

  function getButtonNode() {
    // #StrictMode ready
    return react_dom.findDOMNode(buttonRef.current);
  }

  var rippleRef = react.useRef(null);

  var _React$useState = react.useState(false),
      focusVisible = _React$useState[0],
      setFocusVisible = _React$useState[1];

  if (disabled && focusVisible) {
    setFocusVisible(false);
  }

  var _useIsFocusVisible = useIsFocusVisible(),
      isFocusVisible = _useIsFocusVisible.isFocusVisible,
      onBlurVisible = _useIsFocusVisible.onBlurVisible,
      focusVisibleRef = _useIsFocusVisible.ref;

  react.useImperativeHandle(action, function () {
    return {
      focusVisible: function focusVisible() {
        setFocusVisible(true);
        buttonRef.current.focus();
      }
    };
  }, []);
  react.useEffect(function () {
    if (focusVisible && focusRipple && !disableRipple) {
      rippleRef.current.pulsate();
    }
  }, [disableRipple, focusRipple, focusVisible]);

  function useRippleHandler(rippleAction, eventCallback) {
    var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple;
    return useEventCallback_useEventCallback(function (event) {
      if (eventCallback) {
        eventCallback(event);
      }

      var ignore = skipRippleAction;

      if (!ignore && rippleRef.current) {
        rippleRef.current[rippleAction](event);
      }

      return true;
    });
  }

  var handleMouseDown = useRippleHandler('start', onMouseDown);
  var handleDragLeave = useRippleHandler('stop', onDragLeave);
  var handleMouseUp = useRippleHandler('stop', onMouseUp);
  var handleMouseLeave = useRippleHandler('stop', function (event) {
    if (focusVisible) {
      event.preventDefault();
    }

    if (onMouseLeave) {
      onMouseLeave(event);
    }
  });
  var handleTouchStart = useRippleHandler('start', onTouchStart);
  var handleTouchEnd = useRippleHandler('stop', onTouchEnd);
  var handleTouchMove = useRippleHandler('stop', onTouchMove);
  var handleBlur = useRippleHandler('stop', function (event) {
    if (focusVisible) {
      onBlurVisible(event);
      setFocusVisible(false);
    }

    if (onBlur) {
      onBlur(event);
    }
  }, false);
  var handleFocus = useEventCallback_useEventCallback(function (event) {
    // Fix for https://github.com/facebook/react/issues/7769
    if (!buttonRef.current) {
      buttonRef.current = event.currentTarget;
    }

    if (isFocusVisible(event)) {
      setFocusVisible(true);

      if (onFocusVisible) {
        onFocusVisible(event);
      }
    }

    if (onFocus) {
      onFocus(event);
    }
  });

  var isNonNativeButton = function isNonNativeButton() {
    var button = getButtonNode();
    return component && component !== 'button' && !(button.tagName === 'A' && button.href);
  };
  /**
   * IE 11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
   */


  var keydownRef = react.useRef(false);
  var handleKeyDown = useEventCallback_useEventCallback(function (event) {
    // Check if key is already down to avoid repeats being counted as multiple activations
    if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {
      keydownRef.current = true;
      event.persist();
      rippleRef.current.stop(event, function () {
        rippleRef.current.start(event);
      });
    }

    if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
      event.preventDefault();
    }

    if (onKeyDown) {
      onKeyDown(event);
    } // Keyboard accessibility for non interactive elements


    if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
      event.preventDefault();

      if (onClick) {
        onClick(event);
      }
    }
  });
  var handleKeyUp = useEventCallback_useEventCallback(function (event) {
    // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
    // https://codesandbox.io/s/button-keyup-preventdefault-dn7f0
    if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
      keydownRef.current = false;
      event.persist();
      rippleRef.current.stop(event, function () {
        rippleRef.current.pulsate(event);
      });
    }

    if (onKeyUp) {
      onKeyUp(event);
    } // Keyboard accessibility for non interactive elements


    if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) {
      onClick(event);
    }
  });
  var ComponentProp = component;

  if (ComponentProp === 'button' && other.href) {
    ComponentProp = 'a';
  }

  var buttonProps = {};

  if (ComponentProp === 'button') {
    buttonProps.type = type;
    buttonProps.disabled = disabled;
  } else {
    if (ComponentProp !== 'a' || !other.href) {
      buttonProps.role = 'button';
    }

    buttonProps['aria-disabled'] = disabled;
  }

  var handleUserRef = useForkRef(buttonRefProp, ref);
  var handleOwnRef = useForkRef(focusVisibleRef, buttonRef);
  var handleRef = useForkRef(handleUserRef, handleOwnRef);

  var _React$useState2 = react.useState(false),
      mountedState = _React$useState2[0],
      setMountedState = _React$useState2[1];

  react.useEffect(function () {
    setMountedState(true);
  }, []);
  var enableTouchRipple = mountedState && !disableRipple && !disabled;

  if (false) {}

  return /*#__PURE__*/react.createElement(ComponentProp, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className, focusVisible && [classes.focusVisible, focusVisibleClassName], disabled && classes.disabled),
    onBlur: handleBlur,
    onClick: onClick,
    onFocus: handleFocus,
    onKeyDown: handleKeyDown,
    onKeyUp: handleKeyUp,
    onMouseDown: handleMouseDown,
    onMouseLeave: handleMouseLeave,
    onMouseUp: handleMouseUp,
    onDragLeave: handleDragLeave,
    onTouchEnd: handleTouchEnd,
    onTouchMove: handleTouchMove,
    onTouchStart: handleTouchStart,
    ref: handleRef,
    tabIndex: disabled ? -1 : tabIndex
  }, buttonProps, other), children, enableTouchRipple ?
  /*#__PURE__*/

  /* TouchRipple is only needed client-side, x2 boost on the server. */
  react.createElement(ButtonBase_TouchRipple, (0,esm_extends/* default */.A)({
    ref: rippleRef,
    center: centerRipple
  }, TouchRippleProps)) : null);
});
 false ? 0 : void 0;
/* harmony default export */ var ButtonBase_ButtonBase = (styles_withStyles(ButtonBase_styles, {
  name: 'MuiButtonBase'
})(ButtonBase));
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/node_modules/@material-ui/core/esm/Button/Button.js









var Button_styles = function styles(theme) {
  return {
    /* Styles applied to the root element. */
    root: (0,esm_extends/* default */.A)({}, theme.typography.button, {
      boxSizing: 'border-box',
      minWidth: 64,
      padding: '6px 16px',
      borderRadius: theme.shape.borderRadius,
      color: theme.palette.text.primary,
      transition: theme.transitions.create(['background-color', 'box-shadow', 'border'], {
        duration: theme.transitions.duration.short
      }),
      '&:hover': {
        textDecoration: 'none',
        backgroundColor: alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity),
        // Reset on touch devices, it doesn't add specificity
        '@media (hover: none)': {
          backgroundColor: 'transparent'
        },
        '&$disabled': {
          backgroundColor: 'transparent'
        }
      },
      '&$disabled': {
        color: theme.palette.action.disabled
      }
    }),

    /* Styles applied to the span element that wraps the children. */
    label: {
      width: '100%',
      // Ensure the correct width for iOS Safari
      display: 'inherit',
      alignItems: 'inherit',
      justifyContent: 'inherit'
    },

    /* Styles applied to the root element if `variant="text"`. */
    text: {
      padding: '6px 8px'
    },

    /* Styles applied to the root element if `variant="text"` and `color="primary"`. */
    textPrimary: {
      color: theme.palette.primary.main,
      '&:hover': {
        backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity),
        // Reset on touch devices, it doesn't add specificity
        '@media (hover: none)': {
          backgroundColor: 'transparent'
        }
      }
    },

    /* Styles applied to the root element if `variant="text"` and `color="secondary"`. */
    textSecondary: {
      color: theme.palette.secondary.main,
      '&:hover': {
        backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity),
        // Reset on touch devices, it doesn't add specificity
        '@media (hover: none)': {
          backgroundColor: 'transparent'
        }
      }
    },

    /* Styles applied to the root element if `variant="outlined"`. */
    outlined: {
      padding: '5px 15px',
      border: "1px solid ".concat(theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'),
      '&$disabled': {
        border: "1px solid ".concat(theme.palette.action.disabledBackground)
      }
    },

    /* Styles applied to the root element if `variant="outlined"` and `color="primary"`. */
    outlinedPrimary: {
      color: theme.palette.primary.main,
      border: "1px solid ".concat(alpha(theme.palette.primary.main, 0.5)),
      '&:hover': {
        border: "1px solid ".concat(theme.palette.primary.main),
        backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity),
        // Reset on touch devices, it doesn't add specificity
        '@media (hover: none)': {
          backgroundColor: 'transparent'
        }
      }
    },

    /* Styles applied to the root element if `variant="outlined"` and `color="secondary"`. */
    outlinedSecondary: {
      color: theme.palette.secondary.main,
      border: "1px solid ".concat(alpha(theme.palette.secondary.main, 0.5)),
      '&:hover': {
        border: "1px solid ".concat(theme.palette.secondary.main),
        backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity),
        // Reset on touch devices, it doesn't add specificity
        '@media (hover: none)': {
          backgroundColor: 'transparent'
        }
      },
      '&$disabled': {
        border: "1px solid ".concat(theme.palette.action.disabled)
      }
    },

    /* Styles applied to the root element if `variant="contained"`. */
    contained: {
      color: theme.palette.getContrastText(theme.palette.grey[300]),
      backgroundColor: theme.palette.grey[300],
      boxShadow: theme.shadows[2],
      '&:hover': {
        backgroundColor: theme.palette.grey.A100,
        boxShadow: theme.shadows[4],
        // Reset on touch devices, it doesn't add specificity
        '@media (hover: none)': {
          boxShadow: theme.shadows[2],
          backgroundColor: theme.palette.grey[300]
        },
        '&$disabled': {
          backgroundColor: theme.palette.action.disabledBackground
        }
      },
      '&$focusVisible': {
        boxShadow: theme.shadows[6]
      },
      '&:active': {
        boxShadow: theme.shadows[8]
      },
      '&$disabled': {
        color: theme.palette.action.disabled,
        boxShadow: theme.shadows[0],
        backgroundColor: theme.palette.action.disabledBackground
      }
    },

    /* Styles applied to the root element if `variant="contained"` and `color="primary"`. */
    containedPrimary: {
      color: theme.palette.primary.contrastText,
      backgroundColor: theme.palette.primary.main,
      '&:hover': {
        backgroundColor: theme.palette.primary.dark,
        // Reset on touch devices, it doesn't add specificity
        '@media (hover: none)': {
          backgroundColor: theme.palette.primary.main
        }
      }
    },

    /* Styles applied to the root element if `variant="contained"` and `color="secondary"`. */
    containedSecondary: {
      color: theme.palette.secondary.contrastText,
      backgroundColor: theme.palette.secondary.main,
      '&:hover': {
        backgroundColor: theme.palette.secondary.dark,
        // Reset on touch devices, it doesn't add specificity
        '@media (hover: none)': {
          backgroundColor: theme.palette.secondary.main
        }
      }
    },

    /* Styles applied to the root element if `disableElevation={true}`. */
    disableElevation: {
      boxShadow: 'none',
      '&:hover': {
        boxShadow: 'none'
      },
      '&$focusVisible': {
        boxShadow: 'none'
      },
      '&:active': {
        boxShadow: 'none'
      },
      '&$disabled': {
        boxShadow: 'none'
      }
    },

    /* Pseudo-class applied to the ButtonBase root element if the button is keyboard focused. */
    focusVisible: {},

    /* Pseudo-class applied to the root element if `disabled={true}`. */
    disabled: {},

    /* Styles applied to the root element if `color="inherit"`. */
    colorInherit: {
      color: 'inherit',
      borderColor: 'currentColor'
    },

    /* Styles applied to the root element if `size="small"` and `variant="text"`. */
    textSizeSmall: {
      padding: '4px 5px',
      fontSize: theme.typography.pxToRem(13)
    },

    /* Styles applied to the root element if `size="large"` and `variant="text"`. */
    textSizeLarge: {
      padding: '8px 11px',
      fontSize: theme.typography.pxToRem(15)
    },

    /* Styles applied to the root element if `size="small"` and `variant="outlined"`. */
    outlinedSizeSmall: {
      padding: '3px 9px',
      fontSize: theme.typography.pxToRem(13)
    },

    /* Styles applied to the root element if `size="large"` and `variant="outlined"`. */
    outlinedSizeLarge: {
      padding: '7px 21px',
      fontSize: theme.typography.pxToRem(15)
    },

    /* Styles applied to the root element if `size="small"` and `variant="contained"`. */
    containedSizeSmall: {
      padding: '4px 10px',
      fontSize: theme.typography.pxToRem(13)
    },

    /* Styles applied to the root element if `size="large"` and `variant="contained"`. */
    containedSizeLarge: {
      padding: '8px 22px',
      fontSize: theme.typography.pxToRem(15)
    },

    /* Styles applied to the root element if `size="small"`. */
    sizeSmall: {},

    /* Styles applied to the root element if `size="large"`. */
    sizeLarge: {},

    /* Styles applied to the root element if `fullWidth={true}`. */
    fullWidth: {
      width: '100%'
    },

    /* Styles applied to the startIcon element if supplied. */
    startIcon: {
      display: 'inherit',
      marginRight: 8,
      marginLeft: -4,
      '&$iconSizeSmall': {
        marginLeft: -2
      }
    },

    /* Styles applied to the endIcon element if supplied. */
    endIcon: {
      display: 'inherit',
      marginRight: -4,
      marginLeft: 8,
      '&$iconSizeSmall': {
        marginRight: -2
      }
    },

    /* Styles applied to the icon element if supplied and `size="small"`. */
    iconSizeSmall: {
      '& > *:first-child': {
        fontSize: 18
      }
    },

    /* Styles applied to the icon element if supplied and `size="medium"`. */
    iconSizeMedium: {
      '& > *:first-child': {
        fontSize: 20
      }
    },

    /* Styles applied to the icon element if supplied and `size="large"`. */
    iconSizeLarge: {
      '& > *:first-child': {
        fontSize: 22
      }
    }
  };
};
var Button_Button = /*#__PURE__*/react.forwardRef(function Button(props, ref) {
  var children = props.children,
      classes = props.classes,
      className = props.className,
      _props$color = props.color,
      color = _props$color === void 0 ? 'default' : _props$color,
      _props$component = props.component,
      component = _props$component === void 0 ? 'button' : _props$component,
      _props$disabled = props.disabled,
      disabled = _props$disabled === void 0 ? false : _props$disabled,
      _props$disableElevati = props.disableElevation,
      disableElevation = _props$disableElevati === void 0 ? false : _props$disableElevati,
      _props$disableFocusRi = props.disableFocusRipple,
      disableFocusRipple = _props$disableFocusRi === void 0 ? false : _props$disableFocusRi,
      endIconProp = props.endIcon,
      focusVisibleClassName = props.focusVisibleClassName,
      _props$fullWidth = props.fullWidth,
      fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,
      _props$size = props.size,
      size = _props$size === void 0 ? 'medium' : _props$size,
      startIconProp = props.startIcon,
      _props$type = props.type,
      type = _props$type === void 0 ? 'button' : _props$type,
      _props$variant = props.variant,
      variant = _props$variant === void 0 ? 'text' : _props$variant,
      other = objectWithoutProperties_objectWithoutProperties(props, ["children", "classes", "className", "color", "component", "disabled", "disableElevation", "disableFocusRipple", "endIcon", "focusVisibleClassName", "fullWidth", "size", "startIcon", "type", "variant"]);

  var startIcon = startIconProp && /*#__PURE__*/react.createElement("span", {
    className: (0,clsx_m/* default */.A)(classes.startIcon, classes["iconSize".concat(capitalize(size))])
  }, startIconProp);
  var endIcon = endIconProp && /*#__PURE__*/react.createElement("span", {
    className: (0,clsx_m/* default */.A)(classes.endIcon, classes["iconSize".concat(capitalize(size))])
  }, endIconProp);
  return /*#__PURE__*/react.createElement(ButtonBase_ButtonBase, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, classes[variant], className, color === 'inherit' ? classes.colorInherit : color !== 'default' && classes["".concat(variant).concat(capitalize(color))], size !== 'medium' && [classes["".concat(variant, "Size").concat(capitalize(size))], classes["size".concat(capitalize(size))]], disableElevation && classes.disableElevation, disabled && classes.disabled, fullWidth && classes.fullWidth),
    component: component,
    disabled: disabled,
    focusRipple: !disableFocusRipple,
    focusVisibleClassName: (0,clsx_m/* default */.A)(classes.focusVisible, focusVisibleClassName),
    ref: ref,
    type: type
  }, other), /*#__PURE__*/react.createElement("span", {
    className: classes.label
  }, startIcon, children, endIcon));
});
 false ? 0 : void 0;
/* harmony default export */ var esm_Button_Button = (styles_withStyles(Button_styles, {
  name: 'MuiButton'
})(Button_Button));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/theme/theme.tsx
var themes = {
  colors: {
    primary: '#0362FC',
    black: '#000000',
    buttonBackground: '#41485d',
    disabled: 'rgba(0, 0, 0, 0.15)',
    green: '#00bb60',
    grey: 'rgba(0, 0, 0, 0.2)',
    greyContainer: 'rgba(0, 0, 0, 0.05)',
    greyIcon: '#6f7685',
    hoverColor: '#eff0f2',
    orange: '#fc8600',
    red: '#c30000',
    textFocusColor: '#028fdf',
    white: '#ffffff',
    lightBlue: 'rgba(3, 98, 252, 0.4)',
    grey50: '#fafafa',
    grey100: '#f7f7f7',
    grey200: '#e8e8e8',
    grey400: '#a3a3a3',
    grey500: '#888888',
    darkGrey: '#2D516E',
    error: '#d8000c'
  }
};
var componentsTheme = {
  button: {
    disabled: themes.colors.disabled,
    hoverColor: themes.colors.hoverColor
  },
  embed: {
    containerBackground: themes.colors.greyContainer,
    containerWidth: 339,
    containerHeight: 198,
    iconColor: themes.colors.greyIcon
  },
  iconButton: {
    buttonBackground: themes.colors.buttonBackground,
    buttonWidth: 50,
    buttonHeight: 50,
    buttonRadius: '3px',
    buttonOpacity: 0,
    labelColor: themes.colors.white,
    iconWidth: 32,
    iconLeftRightMargin: 7,
    fontSize: 11,
    fontScaleFactor: 26,
    iconScaleFactor: 46
  },
  passwordStrengthTheme: {
    textColor: themes.colors.black,
    focusedText: themes.colors.textFocusColor,
    inputBackground: themes.colors.white,
    inputBorder: themes.colors.grey,
    passwordStrong: themes.colors.green,
    passwordMedium: themes.colors.orange,
    passwordWeak: themes.colors.red,
    passwordScoreBar: themes.colors.greyContainer,
    passwordScoreText: themes.colors.darkGrey
  },
  videoCover: {
    containerBackground: themes.colors.black,
    svgColor: themes.colors.white
  },
  slideshow: {
    buttonSize: 20,
    bulletSize: 4
  },
  poll: {
    question: {
      container: {
        borderRadius: 8,
        minHeight: 53,
        width: 100
      },
      heading: {
        margin: 0,
        padding: 16
      }
    },
    option: {
      container: {
        width: 100,
        padding: 16
      },
      lastChild: {
        marginBottom: 0
      },
      height: 40,
      width: 100,
      borderRadius: 4,
      padding: 10,
      borderSize: 1,
      marginBottom: 8,
      vote: {
        paddingLeft: 10,
        percentageColor: 'rgba(0, 0, 0, 0.08)'
      }
    }
  },
  quiz: {
    question: {
      header: {
        padding: 20
      },
      container: {
        borderRadius: 8,
        minHeight: 50
      },
      heading: {
        padding: 16,
        fontSize: 16,
        fontWeight: 700
      }
    },
    option: {
      container: {
        padding: 15
      },
      height: 40,
      fontSize: 14,
      padding: 10,
      borderRadius: 4,
      borderSize: 1,
      borderColor: '#e8e8e8'
    }
  }
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Button/index.tsx





var src_Button_styles = {
  text: {
    '&:hover': {
      backgroundColor: componentsTheme.button.hoverColor
    }
  },
  disabled: {
    '& svg': {
      fill: componentsTheme.button.disabled
    }
  }
};
var FiButton = function FiButton(_ref) {
  var children = _ref.children,
    classes = _ref.classes,
    onClick = _ref.onClick,
    id = _ref.id,
    _ref$color = _ref.color,
    color = _ref$color === void 0 ? 'default' : _ref$color,
    _ref$component = _ref.component,
    component = _ref$component === void 0 ? 'button' : _ref$component,
    disabled = _ref.disabled,
    disableElevation = _ref.disableElevation,
    disableFocusRipple = _ref.disableFocusRipple,
    disableRipple = _ref.disableRipple,
    endIcon = _ref.endIcon,
    fullWidth = _ref.fullWidth,
    href = _ref.href,
    startIcon = _ref.startIcon,
    _ref$variant = _ref.variant,
    variant = _ref$variant === void 0 ? 'text' : _ref$variant,
    _ref$size = _ref.size,
    size = _ref$size === void 0 ? 'medium' : _ref$size,
    _ref$tooltip = _ref.tooltip,
    tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip;
  return /*#__PURE__*/react.createElement(esm_Tooltip_Tooltip, {
    placement: "top",
    title: tooltip
  }, /*#__PURE__*/react.createElement("span", null, /*#__PURE__*/react.createElement(esm_Button_Button, {
    classes: classes,
    id: id,
    color: color,
    component: component,
    disabled: disabled,
    disableElevation: disableElevation,
    disableFocusRipple: disableFocusRipple,
    disableRipple: disableRipple,
    endIcon: endIcon,
    fullWidth: fullWidth,
    href: href,
    startIcon: startIcon,
    variant: variant,
    onClick: disabled ? undefined : onClick,
    size: size
  }, children)));
};
FiButton.propTypes = {
  children: (prop_types_default()).node.isRequired,
  classes: prop_types_default().instanceOf(Object).isRequired,
  id: (prop_types_default()).string,
  color: prop_types_default().oneOf(['inherit', 'primary', 'secondary', 'default']),
  component: prop_types_default().oneOfType([(prop_types_default()).any]),
  disabled: (prop_types_default()).bool,
  disableElevation: (prop_types_default()).bool,
  disableFocusRipple: (prop_types_default()).bool,
  disableRipple: (prop_types_default()).bool,
  endIcon: (prop_types_default()).node,
  fullWidth: (prop_types_default()).bool,
  href: (prop_types_default()).string,
  startIcon: (prop_types_default()).node,
  variant: prop_types_default().oneOf(['text', 'outlined', 'contained']),
  onClick: (prop_types_default()).func.isRequired,
  size: prop_types_default().oneOf(['small', 'medium', 'large']),
  tooltip: (prop_types_default()).string
};
FiButton.defaultProps = {
  id: '',
  color: 'default',
  component: 'button',
  disabled: false,
  disableElevation: false,
  disableFocusRipple: false,
  disableRipple: undefined,
  endIcon: null,
  fullWidth: false,
  href: undefined,
  size: 'medium',
  startIcon: null,
  variant: 'text',
  tooltip: ''
};
/* harmony default export */ var src_Button = (styles_withStyles(src_Button_styles)(FiButton));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Masonry/styles.tsx

var masonryBrickEffect = Ue(["from{opacity:0.6;transform:scale(0.9) translateY(10%);}to{opacity:1;transform:scale(1) translateY(0);}"]);
var MasonryBrick = styled_components_browser_esm.div.withConfig({
  displayName: "styles__MasonryBrick",
  componentId: "sc-efb4uv-0"
})(["position:relative;margin:0 ", "px ", "px 0;overflow:hidden;transform:translateZ(0);animation:300ms ", " ease-in;"], function (props) {
  return props === null || props === void 0 ? void 0 : props.gap;
}, function (props) {
  return props === null || props === void 0 ? void 0 : props.gap;
}, masonryBrickEffect);
var MasonryColumn = styled_components_browser_esm.div.withConfig({
  displayName: "styles__MasonryColumn",
  componentId: "sc-efb4uv-1"
})(["flex:1;display:flex;flex-direction:column;transform:translateZ(0);"]);
var MasonryRow = styled_components_browser_esm.div.withConfig({
  displayName: "styles__MasonryRow",
  componentId: "sc-efb4uv-2"
})(["display:flex;flex-direction:row;transform:translateZ(0);"]);
var MasonryContainerCSS = {
  display: 'block',
  width: '100%',
  height: '100%',
  overflowY: 'scroll',
  overflowX: 'hidden',
  transform: 'translateZ(0)'
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Masonry/constants.tsx
// Pixels padded bottom before onBottom trigger
var PADDING_BOTTOM = 100;

// Throttle milliseconds for scrollHandler
var THROTTLE_PROPS_CHANGE = 300;

// Throttle milliseconds for scrollHandler
var THROTTLE_HANDLE_SCROLL = 100;

// Default column size
var DEFAULT_COLUMNS = 3;

// Default column size
var DEFAULT_GAP_SIZE = 0;

// Make sure the column size is at least 2 otherwise use default size
var getColumns = function getColumns(cols) {
  return cols && cols > 1 ? cols : DEFAULT_COLUMNS;
};
var BRICK_PARSED = 1;
var BRICK_MEMOIZED = 2;
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Masonry/index.tsx



function Masonry_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function Masonry_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Masonry_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Masonry_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }



var Masonry = function Masonry(_ref) {
  var children = _ref.children,
    columns = _ref.columns,
    disabled = _ref.disabled,
    gap = _ref.gap,
    rerender = _ref.rerender,
    containerStyle = _ref.containerStyle,
    onBottom = _ref.onBottom;
  var _useState = (0,react.useState)(null),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    render = _useState2[0],
    setRender = _useState2[1];
  var _useState3 = (0,react.useState)({}),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    parsed = _useState4[0],
    setParsed = _useState4[1];
  var _useState5 = (0,react.useState)([]),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    matrix = _useState6[0],
    setMatrix = _useState6[1];
  var _useState7 = (0,react.useState)([]),
    _useState8 = slicedToArray_slicedToArray(_useState7, 2),
    matrixKeys = _useState8[0],
    setMatrixKeys = _useState8[1];
  var _useState9 = (0,react.useState)([]),
    _useState10 = slicedToArray_slicedToArray(_useState9, 2),
    columnHeights = _useState10[0],
    setColumnHeights = _useState10[1];
  var _useState11 = (0,react.useState)(0),
    _useState12 = slicedToArray_slicedToArray(_useState11, 2),
    columnWidth = _useState12[0],
    setColumnWidth = _useState12[1];
  var _useState13 = (0,react.useState)(0),
    _useState14 = slicedToArray_slicedToArray(_useState13, 2),
    columnHeightDiff = _useState14[0],
    setColumnHeightDiff = _useState14[1];
  var _useState15 = (0,react.useState)(getColumns(columns)),
    _useState16 = slicedToArray_slicedToArray(_useState15, 2),
    cols = _useState16[0],
    setCols = _useState16[1];
  var _useState17 = (0,react.useState)(false),
    _useState18 = slicedToArray_slicedToArray(_useState17, 2),
    isLoading = _useState18[0],
    setIsLoading = _useState18[1];
  var _useState19 = (0,react.useState)(0),
    _useState20 = slicedToArray_slicedToArray(_useState19, 2),
    placeholderIndex = _useState20[0],
    setPlaceholderIndex = _useState20[1];
  var _useState21 = (0,react.useState)(0),
    _useState22 = slicedToArray_slicedToArray(_useState21, 2),
    childrenCount = _useState22[0],
    setChildrenCount = _useState22[1];
  var container = (0,react.useRef)(null);

  /**
   * Initial values of state props
   * @returns: StateProps
   */
  var getInitialState = function getInitialState() {
    return {
      matrix: [],
      matrixKeys: [],
      columnHeights: [],
      parsed: {},
      columnWidth: 0,
      columnHeightDiff: 0,
      cols: getColumns(columns),
      isLoading: false,
      render: null,
      placeholderIndex: 0,
      childrenCount: 0
    };
  };

  /**
   * Detect changes for children
   */
  var detectedRenderNeedingChanges = function detectedRenderNeedingChanges(localParsed) {
    var item;
    if (children) {
      for (item in children) {
        var _children$item, _children$item2;
        if ((_children$item = children[item]) !== null && _children$item !== void 0 && (_children$item = _children$item.props) !== null && _children$item !== void 0 && _children$item.brickid && localParsed[(_children$item2 = children[item]) === null || _children$item2 === void 0 || (_children$item2 = _children$item2.props) === null || _children$item2 === void 0 ? void 0 : _children$item2.brickid] !== BRICK_MEMOIZED) {
          return true;
        }
      }
    }
    return false;
  };
  var scrollToTop = function scrollToTop() {
    var _container$current;
    if (container !== null && container !== void 0 && (_container$current = container.current) !== null && _container$current !== void 0 && _container$current.scrollTop) {
      container.current.scrollTop = 0;
    }
  };
  var getMatrixKeysByItem = function getMatrixKeysByItem(localMatrix, item) {
    var _item$props;
    var i;
    var j;
    if (item !== null && item !== void 0 && (_item$props = item.props) !== null && _item$props !== void 0 && _item$props.brickid) {
      for (i in localMatrix) {
        if (localMatrix[i]) {
          for (j in localMatrix[i]) {
            if (localMatrix[i][j]) {
              var _localMatrix$i$j;
              if (((_localMatrix$i$j = localMatrix[i][j]) === null || _localMatrix$i$j === void 0 || (_localMatrix$i$j = _localMatrix$i$j.props) === null || _localMatrix$i$j === void 0 || (_localMatrix$i$j = _localMatrix$i$j.children) === null || _localMatrix$i$j === void 0 || (_localMatrix$i$j = _localMatrix$i$j.props) === null || _localMatrix$i$j === void 0 ? void 0 : _localMatrix$i$j.brickid) === item.props.brickid) {
                return {
                  matrixColumn: i,
                  matrixRow: j
                };
              }
            }
          }
        }
      }
    }
    return null;
  };

  /**
   * Wrapper for children to animate them
   * @param id: string
   * @param item: any
   * @returns: any
   */
  var getBrick = function getBrick(id, item) {
    return /*#__PURE__*/react.createElement(MasonryBrick, {
      key: "masonry-brick-".concat(id),
      gap: gap
    }, item);
  };

  /**
   * Get column heights (min and max) and calculate the difference,
   * this way we will trigger onBottom callback as soon as the smallest column is at end on view.
   * @param columnHeightsLocal: number[]
   * @param columnsLocal: number
   * @returns: number
   */
  var getColumnHeightDiff = function getColumnHeightDiff(columnHeightsLocal, columnsLocal) {
    var i = 0;
    var maxColumnHeight = columnHeightsLocal[i];
    var minColumnHeight = columnHeightsLocal[i];
    while (i < columnsLocal) {
      if (columnHeightsLocal[i] < minColumnHeight) {
        minColumnHeight = columnHeightsLocal[i];
      }
      if (columnHeightsLocal[i] > maxColumnHeight) {
        maxColumnHeight = columnHeightsLocal[i];
      }
      i++;
    }
    return maxColumnHeight - minColumnHeight;
  };

  /**
   * Initial masonry matrix, generate it's keys and reset column heights
   * @param local: StateProps
   * @returns: StateProps
   */
  var getStateWithInitializedMasonry = function getStateWithInitializedMasonry(local) {
    var matrixLocal = [];
    var matrixKeysLocal = [];
    var columnHeightsLocal = [];
    for (var i = 0; i < local.cols; i++) {
      matrixLocal.push([]);
      matrixKeysLocal.push("masonry-matrix-column-".concat(i));
      columnHeightsLocal[i] = 0;
    }
    return Masonry_objectSpread(Masonry_objectSpread({}, local), {}, {
      matrix: [].concat(matrixLocal),
      matrixKeys: [].concat(matrixKeysLocal),
      columnHeights: [].concat(columnHeightsLocal)
    });
  };

  /**
   * Find the index of the smallest column height
   * @param columnHeightsLocal: number[]
   * @param columnsLocal: number
   * @returns: number
   */
  var getSmallestColumnHeightIndex = function getSmallestColumnHeightIndex(columnHeightsLocal, columnsLocal) {
    var i;
    var indexOfSmallestColumnHeight = 0;
    var columnHeight = columnHeightsLocal[indexOfSmallestColumnHeight];
    if (columnHeight) {
      i = 1;
      while (i < columnsLocal) {
        if (columnHeightsLocal[i] < columnHeight) {
          indexOfSmallestColumnHeight = i;
          columnHeight = columnHeightsLocal[indexOfSmallestColumnHeight];
        }
        i++;
      }
    }
    return indexOfSmallestColumnHeight;
  };

  /**
   * Update state props
   * @param local: StateProps
   * @returns: void
   */
  var updateState = function updateState(local) {
    setMatrix(local.matrix);
    setMatrixKeys(local.matrixKeys);
    setColumnHeights(local.columnHeights);
    setParsed(local.parsed);
    setColumnWidth(local.columnWidth);
    setColumnHeightDiff(local.columnHeightDiff);
    setCols(local.cols);
    setIsLoading(local.isLoading);
    setRender(local.render);
    setPlaceholderIndex(local.placeholderIndex);
    setChildrenCount(local.childrenCount);
  };

  /**
   * Renders only if needed and renders only unparsed children
   * @param forceRender?: boolean
   * @param columnsLocal?: number
   * @returns: null
   */
  var renderMasonry = function renderMasonry(forceRender, columnsLocal) {
    var localChildrenCount = react.Children.count(children);

    // Don't re-render previous and current children list is empty
    if (childrenCount && childrenCount === localChildrenCount && !forceRender) {
      return null;
    }

    // Case where masonry is empty
    if (childrenCount && !localChildrenCount) {
      updateState(getInitialState());
      return null;
    }
    var local = localChildrenCount < childrenCount ? Masonry_objectSpread(Masonry_objectSpread({}, getInitialState()), {}, {
      childrenCount: localChildrenCount
    }) : Masonry_objectSpread(Masonry_objectSpread({}, getInitialState()), {}, {
      matrix: toConsumableArray_toConsumableArray(matrix),
      matrixKeys: toConsumableArray_toConsumableArray(matrixKeys),
      columnHeights: toConsumableArray_toConsumableArray(columnHeights),
      parsed: Masonry_objectSpread({}, parsed),
      columnWidth: columnWidth,
      columnHeightDiff: columnHeightDiff,
      cols: columnsLocal || cols,
      placeholderIndex: placeholderIndex,
      childrenCount: localChildrenCount
    });
    if (cols !== local.cols) {
      local.matrix.length = 0;
    }

    // Don't re-render if not required
    if (!forceRender && childrenCount === localChildrenCount && !detectedRenderNeedingChanges(local.parsed)) {
      return null;
    }

    // Initialize matrix
    if (local.matrix.length !== local.cols || !local.columnWidth || forceRender) {
      var _container$current2;
      var offsetWidth = (container === null || container === void 0 || (_container$current2 = container.current) === null || _container$current2 === void 0 ? void 0 : _container$current2.offsetWidth) || 0;
      if (!offsetWidth || !local.cols) {
        return null;
      }
      local = getStateWithInitializedMasonry(Masonry_objectSpread(Masonry_objectSpread({}, getInitialState()), {}, {
        cols: local.cols,
        columnWidth: offsetWidth / local.cols || 0,
        childrenCount: localChildrenCount
      }));
    }

    // Case where masonry is empty
    if (!children) {
      return null;
    }

    // Parse children, add them to matrix & memoize parsed ones
    react.Children.forEach(children, function (item) {
      var _item$props2;
      if (item !== null && item !== void 0 && (_item$props2 = item.props) !== null && _item$props2 !== void 0 && _item$props2.brickid) {
        var _item$props3, _item$props4, _item$props7;
        if (item !== null && item !== void 0 && (_item$props3 = item.props) !== null && _item$props3 !== void 0 && _item$props3.brickplaceholder && item !== null && item !== void 0 && (_item$props4 = item.props) !== null && _item$props4 !== void 0 && _item$props4.brickloading) {
          var _item$props5;
          if (local.parsed[item === null || item === void 0 || (_item$props5 = item.props) === null || _item$props5 === void 0 ? void 0 : _item$props5.brickid] !== BRICK_PARSED) {
            var _item$props6;
            local.parsed[item.props.brickid] = BRICK_PARSED;
            if ((item === null || item === void 0 || (_item$props6 = item.props) === null || _item$props6 === void 0 ? void 0 : _item$props6.brickplaceholder) === 'top') {
              scrollToTop();
              local.matrix[local.placeholderIndex].splice(0, 0, getBrick(item.props.brickid, item));
            } else {
              local.matrix[local.placeholderIndex].push(getBrick(item.props.brickid, item));
            }
            local.placeholderIndex = local.placeholderIndex + 1 >= cols ? 0 : local.placeholderIndex + 1;
          } else {
            var keys = getMatrixKeysByItem(local.matrix, item);
            if (keys) {
              local.matrix[keys.matrixColumn][keys.matrixRow] = getBrick(item.props.brickid, item);
            }
          }
        } else if (local.parsed[item === null || item === void 0 || (_item$props7 = item.props) === null || _item$props7 === void 0 ? void 0 : _item$props7.brickid] !== BRICK_MEMOIZED) {
          var _item$props8;
          var w = parseInt(item.props.brickwidth, 10) || 0;
          var h = parseInt(item.props.brickheight, 10) || 0;
          var i = getSmallestColumnHeightIndex(local.columnHeights, local.cols);
          if (local.parsed[item === null || item === void 0 || (_item$props8 = item.props) === null || _item$props8 === void 0 ? void 0 : _item$props8.brickid] === BRICK_PARSED) {
            var _keys = getMatrixKeysByItem(local.matrix, item);
            if (_keys) {
              var brick = local.matrix[_keys.matrixColumn][_keys.matrixRow];
              var brickW = parseInt(brick.props.children.props.brickwidth, 10) || 0;
              var brickH = parseInt(brick.props.children.props.brickheight, 10) || 0;
              local.columnHeights[_keys.matrixColumn] -= brickH / brickW * local.columnWidth;
              local.columnHeights[_keys.matrixColumn] += h / w * local.columnWidth;
              local.matrix[_keys.matrixColumn][_keys.matrixRow] = getBrick(item.props.brickid, item);
              local.parsed[item.props.brickid] = BRICK_MEMOIZED;
            }
          } else {
            local.parsed[item.props.brickid] = BRICK_MEMOIZED;
            local.matrix[i].push(getBrick(item.props.brickid, item));
            local.columnHeights[i] += h / w * local.columnWidth;
          }
        }
      }
    });
    local.columnHeightDiff = getColumnHeightDiff(local.columnHeights, local.cols);
    local.render = local.matrix.map(function (column, index) {
      return /*#__PURE__*/react.createElement(MasonryColumn, {
        key: local.matrixKeys[index.toString()]
      }, column.map(function (row) {
        return row;
      }));
    });
    updateState(local);
    return null;
  };

  /**
   * Scroll event handler
   * @returns: void
   */
  var handleScroll = function handleScroll() {
    var _container$current3, _container$current4, _container$current5;
    var offsetHeight = (container === null || container === void 0 || (_container$current3 = container.current) === null || _container$current3 === void 0 ? void 0 : _container$current3.offsetHeight) || 0;
    var scrollTop = (container === null || container === void 0 || (_container$current4 = container.current) === null || _container$current4 === void 0 ? void 0 : _container$current4.scrollTop) || 0;
    var scrollHeight = (container === null || container === void 0 || (_container$current5 = container.current) === null || _container$current5 === void 0 ? void 0 : _container$current5.scrollHeight) || 0;
    if (scrollHeight - columnHeightDiff - PADDING_BOTTOM <= offsetHeight + scrollTop) {
      onBottom();
      setIsLoading(true);
    }
  };

  /**
   * Scroll event watcher
   * @returns: void
   */
  var onScroll = function onScroll() {
    if (!isLoading && !disabled) {
      handleScroll();
    }
  };

  /**
   * Children change watcher
   */
  (0,react.useEffect)(function () {
    var timeout = window.setTimeout(onScroll, THROTTLE_HANDLE_SCROLL);
    renderMasonry();
    return function () {
      return window.clearTimeout(timeout);
    };
  }, [children]);

  /**
   * Columns change watcher
   */
  (0,react.useEffect)(function () {
    if (columns > 0 && columns !== cols) {
      renderMasonry(false, columns);
    }
  }, [columns]);

  /**
   * Gap change watcher
   */
  (0,react.useEffect)(function () {
    if (gap) {
      renderMasonry(true);
    }
  }, [gap]);

  /**
   * Rerender change watcher
   */
  (0,react.useEffect)(function () {
    if (rerender) {
      setPlaceholderIndex(0);
      renderMasonry(true);
    }
  }, [rerender]);

  /**
   * Disable watchers & enter loading state
   */
  (0,react.useEffect)(function () {
    var timeout;
    if (!disabled) {
      timeout = window.setTimeout(handleScroll, THROTTLE_PROPS_CHANGE);
    }
    setIsLoading(disabled);
    return function () {
      return window.clearTimeout(timeout);
    };
  }, [disabled]);
  return /*#__PURE__*/react.createElement("div", {
    style: Masonry_objectSpread(Masonry_objectSpread({}, MasonryContainerCSS), containerStyle),
    ref: container,
    onScroll: onScroll
  }, /*#__PURE__*/react.createElement(MasonryRow, null, render));
};
Masonry.defaultProps = {
  children: null,
  columns: DEFAULT_COLUMNS,
  disabled: false,
  gap: DEFAULT_GAP_SIZE,
  rerender: 0,
  containerStyle: {},
  onBottom: function onBottom() {
    return undefined;
  }
};
/* harmony default export */ var src_Masonry = ((/* unused pure expression or super */ null && (Masonry)));
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/composeClasses/composeClasses.js
var composeClasses = __webpack_require__(7453);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useId/useId.js
var useId_useId = __webpack_require__(5311);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/capitalize.js
var utils_capitalize = __webpack_require__(2040);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useForkRef/useForkRef.js
var useForkRef_useForkRef = __webpack_require__(4061);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/utils/isHostComponent.js
/**
 * Determines if a given element is a DOM element name (i.e. not a React component).
 */
function isHostComponent(element) {
  return typeof element === 'string';
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/utils/appendOwnerState.js



/**
 * Type of the ownerState based on the type of an element it applies to.
 * This resolves to the provided OwnerState for React components and `undefined` for host components.
 * Falls back to `OwnerState | undefined` when the exact type can't be determined in development time.
 */

/**
 * Appends the ownerState object to the props, merging with the existing one if necessary.
 *
 * @param elementType Type of the element that owns the `existingProps`. If the element is a DOM node or undefined, `ownerState` is not applied.
 * @param otherProps Props of the element.
 * @param ownerState
 */
function appendOwnerState(elementType, otherProps, ownerState) {
  if (elementType === undefined || isHostComponent(elementType)) {
    return otherProps;
  }
  return (0,esm_extends/* default */.A)({}, otherProps, {
    ownerState: (0,esm_extends/* default */.A)({}, otherProps.ownerState, ownerState)
  });
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/utils/extractEventHandlers.js
/**
 * Extracts event handlers from a given object.
 * A prop is considered an event handler if it is a function and its name starts with `on`.
 *
 * @param object An object to extract event handlers from.
 * @param excludeKeys An array of keys to exclude from the returned object.
 */
function extractEventHandlers(object, excludeKeys = []) {
  if (object === undefined) {
    return {};
  }
  const result = {};
  Object.keys(object).filter(prop => prop.match(/^on[A-Z]/) && typeof object[prop] === 'function' && !excludeKeys.includes(prop)).forEach(prop => {
    result[prop] = object[prop];
  });
  return result;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/utils/omitEventHandlers.js
/**
 * Removes event handlers from the given object.
 * A field is considered an event handler if it is a function with a name beginning with `on`.
 *
 * @param object Object to remove event handlers from.
 * @returns Object with event handlers removed.
 */
function omitEventHandlers(object) {
  if (object === undefined) {
    return {};
  }
  const result = {};
  Object.keys(object).filter(prop => !(prop.match(/^on[A-Z]/) && typeof object[prop] === 'function')).forEach(prop => {
    result[prop] = object[prop];
  });
  return result;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/utils/mergeSlotProps.js




/**
 * Merges the slot component internal props (usually coming from a hook)
 * with the externally provided ones.
 *
 * The merge order is (the latter overrides the former):
 * 1. The internal props (specified as a getter function to work with get*Props hook result)
 * 2. Additional props (specified internally on a Base UI component)
 * 3. External props specified on the owner component. These should only be used on a root slot.
 * 4. External props specified in the `slotProps.*` prop.
 * 5. The `className` prop - combined from all the above.
 * @param parameters
 * @returns
 */
function mergeSlotProps(parameters) {
  const {
    getSlotProps,
    additionalProps,
    externalSlotProps,
    externalForwardedProps,
    className
  } = parameters;
  if (!getSlotProps) {
    // The simpler case - getSlotProps is not defined, so no internal event handlers are defined,
    // so we can simply merge all the props without having to worry about extracting event handlers.
    const joinedClasses = (0,clsx_m/* default */.A)(additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
    const mergedStyle = (0,esm_extends/* default */.A)({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
    const props = (0,esm_extends/* default */.A)({}, additionalProps, externalForwardedProps, externalSlotProps);
    if (joinedClasses.length > 0) {
      props.className = joinedClasses;
    }
    if (Object.keys(mergedStyle).length > 0) {
      props.style = mergedStyle;
    }
    return {
      props,
      internalRef: undefined
    };
  }

  // In this case, getSlotProps is responsible for calling the external event handlers.
  // We don't need to include them in the merged props because of this.

  const eventHandlers = extractEventHandlers((0,esm_extends/* default */.A)({}, externalForwardedProps, externalSlotProps));
  const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);
  const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);
  const internalSlotProps = getSlotProps(eventHandlers);

  // The order of classes is important here.
  // Emotion (that we use in libraries consuming Base UI) depends on this order
  // to properly override style. It requires the most important classes to be last
  // (see https://github.com/mui/material-ui/pull/33205) for the related discussion.
  const joinedClasses = (0,clsx_m/* default */.A)(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);
  const mergedStyle = (0,esm_extends/* default */.A)({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);
  const props = (0,esm_extends/* default */.A)({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);
  if (joinedClasses.length > 0) {
    props.className = joinedClasses;
  }
  if (Object.keys(mergedStyle).length > 0) {
    props.style = mergedStyle;
  }
  return {
    props,
    internalRef: internalSlotProps.ref
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/utils/resolveComponentProps.js
/**
 * If `componentProps` is a function, calls it with the provided `ownerState`.
 * Otherwise, just returns `componentProps`.
 */
function resolveComponentProps(componentProps, ownerState, slotState) {
  if (typeof componentProps === 'function') {
    return componentProps(ownerState, slotState);
  }
  return componentProps;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/utils/useSlotProps.js
'use client';



const _excluded = ["elementType", "externalSlotProps", "ownerState", "skipResolvingSlotProps"];




/**
 * @ignore - do not document.
 * Builds the props to be passed into the slot of an unstyled component.
 * It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior.
 * If the slot component is not a host component, it also merges in the `ownerState`.
 *
 * @param parameters.getSlotProps - A function that returns the props to be passed to the slot component.
 */
function useSlotProps(parameters) {
  var _parameters$additiona;
  const {
      elementType,
      externalSlotProps,
      ownerState,
      skipResolvingSlotProps = false
    } = parameters,
    rest = (0,objectWithoutPropertiesLoose/* default */.A)(parameters, _excluded);
  const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState);
  const {
    props: mergedProps,
    internalRef
  } = mergeSlotProps((0,esm_extends/* default */.A)({}, rest, {
    externalSlotProps: resolvedComponentsProps
  }));
  const ref = (0,useForkRef_useForkRef/* default */.A)(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);
  const props = appendOwnerState(elementType, (0,esm_extends/* default */.A)({}, mergedProps, {
    ref
  }), ownerState);
  return props;
}
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js
var ownerDocument = __webpack_require__(8183);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
var esm_useEventCallback_useEventCallback = __webpack_require__(1885);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/createChainedFunction/createChainedFunction.js
var createChainedFunction_createChainedFunction = __webpack_require__(4067);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/ownerWindow/ownerWindow.js
var ownerWindow = __webpack_require__(2327);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/getScrollbarSize/getScrollbarSize.js
// A change of the browser zoom change the scrollbar size.
// Credit https://github.com/twbs/bootstrap/blob/488fd8afc535ca3a6ad4dc581f5e89217b6a36ac/js/src/util/scrollbar.js#L14-L18
function getScrollbarSize(doc) {
  // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
  const documentWidth = doc.documentElement.clientWidth;
  return Math.abs(window.innerWidth - documentWidth);
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/unstable_useModal/ModalManager.js

// Is a vertical scrollbar displayed?
function isOverflowing(container) {
  const doc = (0,ownerDocument/* default */.A)(container);
  if (doc.body === container) {
    return (0,ownerWindow/* default */.A)(container).innerWidth > doc.documentElement.clientWidth;
  }
  return container.scrollHeight > container.clientHeight;
}
function ariaHidden(element, show) {
  if (show) {
    element.setAttribute('aria-hidden', 'true');
  } else {
    element.removeAttribute('aria-hidden');
  }
}
function getPaddingRight(element) {
  return parseInt((0,ownerWindow/* default */.A)(element).getComputedStyle(element).paddingRight, 10) || 0;
}
function isAriaHiddenForbiddenOnElement(element) {
  // The forbidden HTML tags are the ones from ARIA specification that
  // can be children of body and can't have aria-hidden attribute.
  // cf. https://www.w3.org/TR/html-aria/#docconformance
  const forbiddenTagNames = ['TEMPLATE', 'SCRIPT', 'STYLE', 'LINK', 'MAP', 'META', 'NOSCRIPT', 'PICTURE', 'COL', 'COLGROUP', 'PARAM', 'SLOT', 'SOURCE', 'TRACK'];
  const isForbiddenTagName = forbiddenTagNames.indexOf(element.tagName) !== -1;
  const isInputHidden = element.tagName === 'INPUT' && element.getAttribute('type') === 'hidden';
  return isForbiddenTagName || isInputHidden;
}
function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, show) {
  const blacklist = [mountElement, currentElement, ...elementsToExclude];
  [].forEach.call(container.children, element => {
    const isNotExcludedElement = blacklist.indexOf(element) === -1;
    const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
    if (isNotExcludedElement && isNotForbiddenElement) {
      ariaHidden(element, show);
    }
  });
}
function findIndexOf(items, callback) {
  let idx = -1;
  items.some((item, index) => {
    if (callback(item)) {
      idx = index;
      return true;
    }
    return false;
  });
  return idx;
}
function handleContainer(containerInfo, props) {
  const restoreStyle = [];
  const container = containerInfo.container;
  if (!props.disableScrollLock) {
    if (isOverflowing(container)) {
      // Compute the size before applying overflow hidden to avoid any scroll jumps.
      const scrollbarSize = getScrollbarSize((0,ownerDocument/* default */.A)(container));
      restoreStyle.push({
        value: container.style.paddingRight,
        property: 'padding-right',
        el: container
      });
      // Use computed style, here to get the real padding to add our scrollbar width.
      container.style.paddingRight = `${getPaddingRight(container) + scrollbarSize}px`;

      // .mui-fixed is a global helper.
      const fixedElements = (0,ownerDocument/* default */.A)(container).querySelectorAll('.mui-fixed');
      [].forEach.call(fixedElements, element => {
        restoreStyle.push({
          value: element.style.paddingRight,
          property: 'padding-right',
          el: element
        });
        element.style.paddingRight = `${getPaddingRight(element) + scrollbarSize}px`;
      });
    }
    let scrollContainer;
    if (container.parentNode instanceof DocumentFragment) {
      scrollContainer = (0,ownerDocument/* default */.A)(container).body;
    } else {
      // Support html overflow-y: auto for scroll stability between pages
      // https://css-tricks.com/snippets/css/force-vertical-scrollbar/
      const parent = container.parentElement;
      const containerWindow = (0,ownerWindow/* default */.A)(container);
      scrollContainer = (parent == null ? void 0 : parent.nodeName) === 'HTML' && containerWindow.getComputedStyle(parent).overflowY === 'scroll' ? parent : container;
    }

    // Block the scroll even if no scrollbar is visible to account for mobile keyboard
    // screensize shrink.
    restoreStyle.push({
      value: scrollContainer.style.overflow,
      property: 'overflow',
      el: scrollContainer
    }, {
      value: scrollContainer.style.overflowX,
      property: 'overflow-x',
      el: scrollContainer
    }, {
      value: scrollContainer.style.overflowY,
      property: 'overflow-y',
      el: scrollContainer
    });
    scrollContainer.style.overflow = 'hidden';
  }
  const restore = () => {
    restoreStyle.forEach(({
      value,
      el,
      property
    }) => {
      if (value) {
        el.style.setProperty(property, value);
      } else {
        el.style.removeProperty(property);
      }
    });
  };
  return restore;
}
function getHiddenSiblings(container) {
  const hiddenSiblings = [];
  [].forEach.call(container.children, element => {
    if (element.getAttribute('aria-hidden') === 'true') {
      hiddenSiblings.push(element);
    }
  });
  return hiddenSiblings;
}
/**
 * @ignore - do not document.
 *
 * Proper state management for containers and the modals in those containers.
 * Simplified, but inspired by react-overlay's ModalManager class.
 * Used by the Modal to ensure proper styling of containers.
 */
class ModalManager {
  constructor() {
    this.containers = void 0;
    this.modals = void 0;
    this.modals = [];
    this.containers = [];
  }
  add(modal, container) {
    let modalIndex = this.modals.indexOf(modal);
    if (modalIndex !== -1) {
      return modalIndex;
    }
    modalIndex = this.modals.length;
    this.modals.push(modal);

    // If the modal we are adding is already in the DOM.
    if (modal.modalRef) {
      ariaHidden(modal.modalRef, false);
    }
    const hiddenSiblings = getHiddenSiblings(container);
    ariaHiddenSiblings(container, modal.mount, modal.modalRef, hiddenSiblings, true);
    const containerIndex = findIndexOf(this.containers, item => item.container === container);
    if (containerIndex !== -1) {
      this.containers[containerIndex].modals.push(modal);
      return modalIndex;
    }
    this.containers.push({
      modals: [modal],
      container,
      restore: null,
      hiddenSiblings
    });
    return modalIndex;
  }
  mount(modal, props) {
    const containerIndex = findIndexOf(this.containers, item => item.modals.indexOf(modal) !== -1);
    const containerInfo = this.containers[containerIndex];
    if (!containerInfo.restore) {
      containerInfo.restore = handleContainer(containerInfo, props);
    }
  }
  remove(modal, ariaHiddenState = true) {
    const modalIndex = this.modals.indexOf(modal);
    if (modalIndex === -1) {
      return modalIndex;
    }
    const containerIndex = findIndexOf(this.containers, item => item.modals.indexOf(modal) !== -1);
    const containerInfo = this.containers[containerIndex];
    containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);
    this.modals.splice(modalIndex, 1);

    // If that was the last modal in a container, clean up the container.
    if (containerInfo.modals.length === 0) {
      // The modal might be closed before it had the chance to be mounted in the DOM.
      if (containerInfo.restore) {
        containerInfo.restore();
      }
      if (modal.modalRef) {
        // In case the modal wasn't in the DOM yet.
        ariaHidden(modal.modalRef, ariaHiddenState);
      }
      ariaHiddenSiblings(containerInfo.container, modal.mount, modal.modalRef, containerInfo.hiddenSiblings, false);
      this.containers.splice(containerIndex, 1);
    } else {
      // Otherwise make sure the next top modal is visible to a screen reader.
      const nextTop = containerInfo.modals[containerInfo.modals.length - 1];
      // as soon as a modal is adding its modalRef is undefined. it can't set
      // aria-hidden because the dom element doesn't exist either
      // when modal was unmounted before modalRef gets null
      if (nextTop.modalRef) {
        ariaHidden(nextTop.modalRef, false);
      }
    }
    return modalIndex;
  }
  isTopModal(modal) {
    return this.modals.length > 0 && this.modals[this.modals.length - 1] === modal;
  }
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/unstable_useModal/useModal.js
'use client';






function useModal_getContainer(container) {
  return typeof container === 'function' ? container() : container;
}
function getHasTransition(children) {
  return children ? children.props.hasOwnProperty('in') : false;
}

// A modal manager used to track and manage the state of open Modals.
// Modals don't open on the server so this won't conflict with concurrent requests.
const defaultManager = new ModalManager();
/**
 *
 * Demos:
 *
 * - [Modal](https://mui.com/base-ui/react-modal/#hook)
 *
 * API:
 *
 * - [useModal API](https://mui.com/base-ui/react-modal/hooks-api/#use-modal)
 */
function useModal(parameters) {
  const {
    container,
    disableEscapeKeyDown = false,
    disableScrollLock = false,
    // @ts-ignore internal logic - Base UI supports the manager as a prop too
    manager = defaultManager,
    closeAfterTransition = false,
    onTransitionEnter,
    onTransitionExited,
    children,
    onClose,
    open,
    rootRef
  } = parameters;

  // @ts-ignore internal logic
  const modal = react.useRef({});
  const mountNodeRef = react.useRef(null);
  const modalRef = react.useRef(null);
  const handleRef = (0,useForkRef_useForkRef/* default */.A)(modalRef, rootRef);
  const [exited, setExited] = react.useState(!open);
  const hasTransition = getHasTransition(children);
  let ariaHiddenProp = true;
  if (parameters['aria-hidden'] === 'false' || parameters['aria-hidden'] === false) {
    ariaHiddenProp = false;
  }
  const getDoc = () => (0,ownerDocument/* default */.A)(mountNodeRef.current);
  const getModal = () => {
    modal.current.modalRef = modalRef.current;
    modal.current.mount = mountNodeRef.current;
    return modal.current;
  };
  const handleMounted = () => {
    manager.mount(getModal(), {
      disableScrollLock
    });

    // Fix a bug on Chrome where the scroll isn't initially 0.
    if (modalRef.current) {
      modalRef.current.scrollTop = 0;
    }
  };
  const handleOpen = (0,esm_useEventCallback_useEventCallback/* default */.A)(() => {
    const resolvedContainer = useModal_getContainer(container) || getDoc().body;
    manager.add(getModal(), resolvedContainer);

    // The element was already mounted.
    if (modalRef.current) {
      handleMounted();
    }
  });
  const isTopModal = react.useCallback(() => manager.isTopModal(getModal()), [manager]);
  const handlePortalRef = (0,esm_useEventCallback_useEventCallback/* default */.A)(node => {
    mountNodeRef.current = node;
    if (!node) {
      return;
    }
    if (open && isTopModal()) {
      handleMounted();
    } else if (modalRef.current) {
      ariaHidden(modalRef.current, ariaHiddenProp);
    }
  });
  const handleClose = react.useCallback(() => {
    manager.remove(getModal(), ariaHiddenProp);
  }, [ariaHiddenProp, manager]);
  react.useEffect(() => {
    return () => {
      handleClose();
    };
  }, [handleClose]);
  react.useEffect(() => {
    if (open) {
      handleOpen();
    } else if (!hasTransition || !closeAfterTransition) {
      handleClose();
    }
  }, [open, handleClose, hasTransition, closeAfterTransition, handleOpen]);
  const createHandleKeyDown = otherHandlers => event => {
    var _otherHandlers$onKeyD;
    (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null || _otherHandlers$onKeyD.call(otherHandlers, event);

    // The handler doesn't take event.defaultPrevented into account:
    //
    // event.preventDefault() is meant to stop default behaviors like
    // clicking a checkbox to check it, hitting a button to submit a form,
    // and hitting left arrow to move the cursor in a text input etc.
    // Only special HTML elements have these default behaviors.
    if (event.key !== 'Escape' || event.which === 229 ||
    // Wait until IME is settled.
    !isTopModal()) {
      return;
    }
    if (!disableEscapeKeyDown) {
      // Swallow the event, in case someone is listening for the escape key on the body.
      event.stopPropagation();
      if (onClose) {
        onClose(event, 'escapeKeyDown');
      }
    }
  };
  const createHandleBackdropClick = otherHandlers => event => {
    var _otherHandlers$onClic;
    (_otherHandlers$onClic = otherHandlers.onClick) == null || _otherHandlers$onClic.call(otherHandlers, event);
    if (event.target !== event.currentTarget) {
      return;
    }
    if (onClose) {
      onClose(event, 'backdropClick');
    }
  };
  const getRootProps = (otherHandlers = {}) => {
    const propsEventHandlers = extractEventHandlers(parameters);

    // The custom event handlers shouldn't be spread on the root element
    delete propsEventHandlers.onTransitionEnter;
    delete propsEventHandlers.onTransitionExited;
    const externalEventHandlers = (0,esm_extends/* default */.A)({}, propsEventHandlers, otherHandlers);
    return (0,esm_extends/* default */.A)({
      role: 'presentation'
    }, externalEventHandlers, {
      onKeyDown: createHandleKeyDown(externalEventHandlers),
      ref: handleRef
    });
  };
  const getBackdropProps = (otherHandlers = {}) => {
    const externalEventHandlers = otherHandlers;
    return (0,esm_extends/* default */.A)({
      'aria-hidden': true
    }, externalEventHandlers, {
      onClick: createHandleBackdropClick(externalEventHandlers),
      open
    });
  };
  const getTransitionProps = () => {
    const handleEnter = () => {
      setExited(false);
      if (onTransitionEnter) {
        onTransitionEnter();
      }
    };
    const handleExited = () => {
      setExited(true);
      if (onTransitionExited) {
        onTransitionExited();
      }
      if (closeAfterTransition) {
        handleClose();
      }
    };
    return {
      onEnter: (0,createChainedFunction_createChainedFunction/* default */.A)(handleEnter, children == null ? void 0 : children.props.onEnter),
      onExited: (0,createChainedFunction_createChainedFunction/* default */.A)(handleExited, children == null ? void 0 : children.props.onExited)
    };
  };
  return {
    getRootProps,
    getBackdropProps,
    getTransitionProps,
    rootRef: handleRef,
    portalRef: handlePortalRef,
    isTopModal,
    exited,
    hasTransition
  };
}
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
var jsx_runtime = __webpack_require__(4848);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/FocusTrap/FocusTrap.js
'use client';

/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex */





// Inspired by https://github.com/focus-trap/tabbable
const candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'].join(',');
function getTabIndex(node) {
  const tabindexAttr = parseInt(node.getAttribute('tabindex') || '', 10);
  if (!Number.isNaN(tabindexAttr)) {
    return tabindexAttr;
  }

  // Browsers do not return `tabIndex` correctly for contentEditable nodes;
  // https://bugs.chromium.org/p/chromium/issues/detail?id=661108&q=contenteditable%20tabindex&can=2
  // so if they don't have a tabindex attribute specifically set, assume it's 0.
  // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
  //  `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
  //  yet they are still part of the regular tab order; in FF, they get a default
  //  `tabIndex` of 0; since Chrome still puts those elements in the regular tab
  //  order, consider their tab index to be 0.
  if (node.contentEditable === 'true' || (node.nodeName === 'AUDIO' || node.nodeName === 'VIDEO' || node.nodeName === 'DETAILS') && node.getAttribute('tabindex') === null) {
    return 0;
  }
  return node.tabIndex;
}
function isNonTabbableRadio(node) {
  if (node.tagName !== 'INPUT' || node.type !== 'radio') {
    return false;
  }
  if (!node.name) {
    return false;
  }
  const getRadio = selector => node.ownerDocument.querySelector(`input[type="radio"]${selector}`);
  let roving = getRadio(`[name="${node.name}"]:checked`);
  if (!roving) {
    roving = getRadio(`[name="${node.name}"]`);
  }
  return roving !== node;
}
function isNodeMatchingSelectorFocusable(node) {
  if (node.disabled || node.tagName === 'INPUT' && node.type === 'hidden' || isNonTabbableRadio(node)) {
    return false;
  }
  return true;
}
function defaultGetTabbable(root) {
  const regularTabNodes = [];
  const orderedTabNodes = [];
  Array.from(root.querySelectorAll(candidatesSelector)).forEach((node, i) => {
    const nodeTabIndex = getTabIndex(node);
    if (nodeTabIndex === -1 || !isNodeMatchingSelectorFocusable(node)) {
      return;
    }
    if (nodeTabIndex === 0) {
      regularTabNodes.push(node);
    } else {
      orderedTabNodes.push({
        documentOrder: i,
        tabIndex: nodeTabIndex,
        node: node
      });
    }
  });
  return orderedTabNodes.sort((a, b) => a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex).map(a => a.node).concat(regularTabNodes);
}
function defaultIsEnabled() {
  return true;
}

/**
 * Utility component that locks focus inside the component.
 *
 * Demos:
 *
 * - [Focus Trap](https://mui.com/base-ui/react-focus-trap/)
 *
 * API:
 *
 * - [FocusTrap API](https://mui.com/base-ui/react-focus-trap/components-api/#focus-trap)
 */
function FocusTrap(props) {
  const {
    children,
    disableAutoFocus = false,
    disableEnforceFocus = false,
    disableRestoreFocus = false,
    getTabbable = defaultGetTabbable,
    isEnabled = defaultIsEnabled,
    open
  } = props;
  const ignoreNextEnforceFocus = react.useRef(false);
  const sentinelStart = react.useRef(null);
  const sentinelEnd = react.useRef(null);
  const nodeToRestore = react.useRef(null);
  const reactFocusEventTarget = react.useRef(null);
  // This variable is useful when disableAutoFocus is true.
  // It waits for the active element to move into the component to activate.
  const activated = react.useRef(false);
  const rootRef = react.useRef(null);
  // @ts-expect-error TODO upstream fix
  const handleRef = (0,useForkRef_useForkRef/* default */.A)(children.ref, rootRef);
  const lastKeydown = react.useRef(null);
  react.useEffect(() => {
    // We might render an empty child.
    if (!open || !rootRef.current) {
      return;
    }
    activated.current = !disableAutoFocus;
  }, [disableAutoFocus, open]);
  react.useEffect(() => {
    // We might render an empty child.
    if (!open || !rootRef.current) {
      return;
    }
    const doc = (0,ownerDocument/* default */.A)(rootRef.current);
    if (!rootRef.current.contains(doc.activeElement)) {
      if (!rootRef.current.hasAttribute('tabIndex')) {
        if (false) {}
        rootRef.current.setAttribute('tabIndex', '-1');
      }
      if (activated.current) {
        rootRef.current.focus();
      }
    }
    return () => {
      // restoreLastFocus()
      if (!disableRestoreFocus) {
        // In IE11 it is possible for document.activeElement to be null resulting
        // in nodeToRestore.current being null.
        // Not all elements in IE11 have a focus method.
        // Once IE11 support is dropped the focus() call can be unconditional.
        if (nodeToRestore.current && nodeToRestore.current.focus) {
          ignoreNextEnforceFocus.current = true;
          nodeToRestore.current.focus();
        }
        nodeToRestore.current = null;
      }
    };
    // Missing `disableRestoreFocus` which is fine.
    // We don't support changing that prop on an open FocusTrap
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [open]);
  react.useEffect(() => {
    // We might render an empty child.
    if (!open || !rootRef.current) {
      return;
    }
    const doc = (0,ownerDocument/* default */.A)(rootRef.current);
    const loopFocus = nativeEvent => {
      lastKeydown.current = nativeEvent;
      if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== 'Tab') {
        return;
      }

      // Make sure the next tab starts from the right place.
      // doc.activeElement refers to the origin.
      if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {
        // We need to ignore the next contain as
        // it will try to move the focus back to the rootRef element.
        ignoreNextEnforceFocus.current = true;
        if (sentinelEnd.current) {
          sentinelEnd.current.focus();
        }
      }
    };
    const contain = () => {
      const rootElement = rootRef.current;

      // Cleanup functions are executed lazily in React 17.
      // Contain can be called between the component being unmounted and its cleanup function being run.
      if (rootElement === null) {
        return;
      }
      if (!doc.hasFocus() || !isEnabled() || ignoreNextEnforceFocus.current) {
        ignoreNextEnforceFocus.current = false;
        return;
      }

      // The focus is already inside
      if (rootElement.contains(doc.activeElement)) {
        return;
      }

      // The disableEnforceFocus is set and the focus is outside of the focus trap (and sentinel nodes)
      if (disableEnforceFocus && doc.activeElement !== sentinelStart.current && doc.activeElement !== sentinelEnd.current) {
        return;
      }

      // if the focus event is not coming from inside the children's react tree, reset the refs
      if (doc.activeElement !== reactFocusEventTarget.current) {
        reactFocusEventTarget.current = null;
      } else if (reactFocusEventTarget.current !== null) {
        return;
      }
      if (!activated.current) {
        return;
      }
      let tabbable = [];
      if (doc.activeElement === sentinelStart.current || doc.activeElement === sentinelEnd.current) {
        tabbable = getTabbable(rootRef.current);
      }

      // one of the sentinel nodes was focused, so move the focus
      // to the first/last tabbable element inside the focus trap
      if (tabbable.length > 0) {
        var _lastKeydown$current, _lastKeydown$current2;
        const isShiftTab = Boolean(((_lastKeydown$current = lastKeydown.current) == null ? void 0 : _lastKeydown$current.shiftKey) && ((_lastKeydown$current2 = lastKeydown.current) == null ? void 0 : _lastKeydown$current2.key) === 'Tab');
        const focusNext = tabbable[0];
        const focusPrevious = tabbable[tabbable.length - 1];
        if (typeof focusNext !== 'string' && typeof focusPrevious !== 'string') {
          if (isShiftTab) {
            focusPrevious.focus();
          } else {
            focusNext.focus();
          }
        }
        // no tabbable elements in the trap focus or the focus was outside of the focus trap
      } else {
        rootElement.focus();
      }
    };
    doc.addEventListener('focusin', contain);
    doc.addEventListener('keydown', loopFocus, true);

    // With Edge, Safari and Firefox, no focus related events are fired when the focused area stops being a focused area.
    // for example https://bugzilla.mozilla.org/show_bug.cgi?id=559561.
    // Instead, we can look if the active element was restored on the BODY element.
    //
    // The whatwg spec defines how the browser should behave but does not explicitly mention any events:
    // https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule.
    const interval = setInterval(() => {
      if (doc.activeElement && doc.activeElement.tagName === 'BODY') {
        contain();
      }
    }, 50);
    return () => {
      clearInterval(interval);
      doc.removeEventListener('focusin', contain);
      doc.removeEventListener('keydown', loopFocus, true);
    };
  }, [disableAutoFocus, disableEnforceFocus, disableRestoreFocus, isEnabled, open, getTabbable]);
  const onFocus = event => {
    if (nodeToRestore.current === null) {
      nodeToRestore.current = event.relatedTarget;
    }
    activated.current = true;
    reactFocusEventTarget.current = event.target;
    const childrenPropsHandler = children.props.onFocus;
    if (childrenPropsHandler) {
      childrenPropsHandler(event);
    }
  };
  const handleFocusSentinel = event => {
    if (nodeToRestore.current === null) {
      nodeToRestore.current = event.relatedTarget;
    }
    activated.current = true;
  };
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
    children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
      tabIndex: open ? 0 : -1,
      onFocus: handleFocusSentinel,
      ref: sentinelStart,
      "data-testid": "sentinelStart"
    }), /*#__PURE__*/react.cloneElement(children, {
      ref: handleRef,
      onFocus
    }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
      tabIndex: open ? 0 : -1,
      onFocus: handleFocusSentinel,
      ref: sentinelEnd,
      "data-testid": "sentinelEnd"
    })]
  });
}
 false ? 0 : void 0;
if (false) {}

// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
var useEnhancedEffect_useEnhancedEffect = __webpack_require__(2723);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/setRef/setRef.js
var esm_setRef_setRef = __webpack_require__(207);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/Portal/Portal.js
'use client';






function Portal_getContainer(container) {
  return typeof container === 'function' ? container() : container;
}

/**
 * Portals provide a first-class way to render children into a DOM node
 * that exists outside the DOM hierarchy of the parent component.
 *
 * Demos:
 *
 * - [Portal](https://mui.com/base-ui/react-portal/)
 *
 * API:
 *
 * - [Portal API](https://mui.com/base-ui/react-portal/components-api/#portal)
 */
const Portal_Portal_Portal = /*#__PURE__*/react.forwardRef(function Portal(props, forwardedRef) {
  const {
    children,
    container,
    disablePortal = false
  } = props;
  const [mountNode, setMountNode] = react.useState(null);
  // @ts-expect-error TODO upstream fix
  const handleRef = (0,useForkRef_useForkRef/* default */.A)( /*#__PURE__*/react.isValidElement(children) ? children.ref : null, forwardedRef);
  (0,useEnhancedEffect_useEnhancedEffect/* default */.A)(() => {
    if (!disablePortal) {
      setMountNode(Portal_getContainer(container) || document.body);
    }
  }, [container, disablePortal]);
  (0,useEnhancedEffect_useEnhancedEffect/* default */.A)(() => {
    if (mountNode && !disablePortal) {
      (0,esm_setRef_setRef/* default */.A)(forwardedRef, mountNode);
      return () => {
        (0,esm_setRef_setRef/* default */.A)(forwardedRef, null);
      };
    }
    return undefined;
  }, [forwardedRef, mountNode, disablePortal]);
  if (disablePortal) {
    if ( /*#__PURE__*/react.isValidElement(children)) {
      const newProps = {
        ref: handleRef
      };
      return /*#__PURE__*/react.cloneElement(children, newProps);
    }
    return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
      children: children
    });
  }
  return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
    children: mountNode ? /*#__PURE__*/react_dom.createPortal(children, mountNode) : mountNode
  });
});
 false ? 0 : void 0;
if (false) {}

// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/styled.js
var styled = __webpack_require__(3874);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/useThemeProps.js
var useThemeProps = __webpack_require__(1863);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/useTheme.js + 1 modules
var esm_useTheme = __webpack_require__(7133);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/defaultTheme.js
var material_styles_defaultTheme = __webpack_require__(7199);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/identifier.js
var identifier = __webpack_require__(346);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/useTheme.js
'use client';





function styles_useTheme_useTheme() {
  const theme = (0,esm_useTheme/* default */.A)(material_styles_defaultTheme/* default */.A);
  if (false) {}
  return theme[identifier/* default */.A] || theme;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/transitions/utils.js
const utils_reflow = node => node.scrollTop;
function utils_getTransitionProps(props, options) {
  var _style$transitionDura, _style$transitionTimi;
  const {
    timeout,
    easing,
    style = {}
  } = props;
  return {
    duration: (_style$transitionDura = style.transitionDuration) != null ? _style$transitionDura : typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,
    easing: (_style$transitionTimi = style.transitionTimingFunction) != null ? _style$transitionTimi : typeof easing === 'object' ? easing[options.mode] : easing,
    delay: style.transitionDelay
  };
}
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useForkRef.js
var utils_useForkRef = __webpack_require__(6982);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Fade/Fade.js
'use client';



const Fade_excluded = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];








const Fade_styles = {
  entering: {
    opacity: 1
  },
  entered: {
    opacity: 1
  }
};

/**
 * The Fade transition is used by the [Modal](/material-ui/react-modal/) component.
 * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
 */
const Fade = /*#__PURE__*/react.forwardRef(function Fade(props, ref) {
  const theme = styles_useTheme_useTheme();
  const defaultTimeout = {
    enter: theme.transitions.duration.enteringScreen,
    exit: theme.transitions.duration.leavingScreen
  };
  const {
      addEndListener,
      appear = true,
      children,
      easing,
      in: inProp,
      onEnter,
      onEntered,
      onEntering,
      onExit,
      onExited,
      onExiting,
      style,
      timeout = defaultTimeout,
      // eslint-disable-next-line react/prop-types
      TransitionComponent = esm_Transition
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Fade_excluded);
  const enableStrictModeCompat = true;
  const nodeRef = react.useRef(null);
  const handleRef = (0,utils_useForkRef/* default */.A)(nodeRef, children.ref, ref);
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
    if (callback) {
      const node = nodeRef.current;

      // onEnterXxx and onExitXxx callbacks have a different arguments.length value.
      if (maybeIsAppearing === undefined) {
        callback(node);
      } else {
        callback(node, maybeIsAppearing);
      }
    }
  };
  const handleEntering = normalizedTransitionCallback(onEntering);
  const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
    utils_reflow(node); // So the animation always start from the start.

    const transitionProps = utils_getTransitionProps({
      style,
      timeout,
      easing
    }, {
      mode: 'enter'
    });
    node.style.webkitTransition = theme.transitions.create('opacity', transitionProps);
    node.style.transition = theme.transitions.create('opacity', transitionProps);
    if (onEnter) {
      onEnter(node, isAppearing);
    }
  });
  const handleEntered = normalizedTransitionCallback(onEntered);
  const handleExiting = normalizedTransitionCallback(onExiting);
  const handleExit = normalizedTransitionCallback(node => {
    const transitionProps = utils_getTransitionProps({
      style,
      timeout,
      easing
    }, {
      mode: 'exit'
    });
    node.style.webkitTransition = theme.transitions.create('opacity', transitionProps);
    node.style.transition = theme.transitions.create('opacity', transitionProps);
    if (onExit) {
      onExit(node);
    }
  });
  const handleExited = normalizedTransitionCallback(onExited);
  const handleAddEndListener = next => {
    if (addEndListener) {
      // Old call signature before `react-transition-group` implemented `nodeRef`
      addEndListener(nodeRef.current, next);
    }
  };
  return /*#__PURE__*/(0,jsx_runtime.jsx)(TransitionComponent, (0,esm_extends/* default */.A)({
    appear: appear,
    in: inProp,
    nodeRef: enableStrictModeCompat ? nodeRef : undefined,
    onEnter: handleEnter,
    onEntered: handleEntered,
    onEntering: handleEntering,
    onExit: handleExit,
    onExited: handleExited,
    onExiting: handleExiting,
    addEndListener: handleAddEndListener,
    timeout: timeout
  }, other, {
    children: (state, childProps) => {
      return /*#__PURE__*/react.cloneElement(children, (0,esm_extends/* default */.A)({
        style: (0,esm_extends/* default */.A)({
          opacity: 0,
          visibility: state === 'exited' && !inProp ? 'hidden' : undefined
        }, Fade_styles[state], style, children.props.style),
        ref: handleRef
      }, childProps));
    }
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var Fade_Fade = (Fade);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js
var generateUtilityClasses = __webpack_require__(7135);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js
var generateUtilityClass_generateUtilityClass = __webpack_require__(6467);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Backdrop/backdropClasses.js


function getBackdropUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiBackdrop', slot);
}
const backdropClasses = (0,generateUtilityClasses/* default */.A)('MuiBackdrop', ['root', 'invisible']);
/* harmony default export */ var Backdrop_backdropClasses = ((/* unused pure expression or super */ null && (backdropClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Backdrop/Backdrop.js
'use client';



const Backdrop_excluded = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"];









const useUtilityClasses = ownerState => {
  const {
    classes,
    invisible
  } = ownerState;
  const slots = {
    root: ['root', invisible && 'invisible']
  };
  return (0,composeClasses/* default */.A)(slots, getBackdropUtilityClass, classes);
};
const BackdropRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiBackdrop',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, ownerState.invisible && styles.invisible];
  }
})(({
  ownerState
}) => (0,esm_extends/* default */.A)({
  position: 'fixed',
  display: 'flex',
  alignItems: 'center',
  justifyContent: 'center',
  right: 0,
  bottom: 0,
  top: 0,
  left: 0,
  backgroundColor: 'rgba(0, 0, 0, 0.5)',
  WebkitTapHighlightColor: 'transparent'
}, ownerState.invisible && {
  backgroundColor: 'transparent'
}));
const Backdrop = /*#__PURE__*/react.forwardRef(function Backdrop(inProps, ref) {
  var _slotProps$root, _ref, _slots$root;
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiBackdrop'
  });
  const {
      children,
      className,
      component = 'div',
      components = {},
      componentsProps = {},
      invisible = false,
      open,
      slotProps = {},
      slots = {},
      TransitionComponent = Fade_Fade,
      transitionDuration
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Backdrop_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    component,
    invisible
  });
  const classes = useUtilityClasses(ownerState);
  const rootSlotProps = (_slotProps$root = slotProps.root) != null ? _slotProps$root : componentsProps.root;
  return /*#__PURE__*/(0,jsx_runtime.jsx)(TransitionComponent, (0,esm_extends/* default */.A)({
    in: open,
    timeout: transitionDuration
  }, other, {
    children: /*#__PURE__*/(0,jsx_runtime.jsx)(BackdropRoot, (0,esm_extends/* default */.A)({
      "aria-hidden": true
    }, rootSlotProps, {
      as: (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : component,
      className: (0,clsx_m/* default */.A)(classes.root, className, rootSlotProps == null ? void 0 : rootSlotProps.className),
      ownerState: (0,esm_extends/* default */.A)({}, ownerState, rootSlotProps == null ? void 0 : rootSlotProps.ownerState),
      classes: classes,
      ref: ref,
      children: children
    }))
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var Backdrop_Backdrop = (Backdrop);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Modal/modalClasses.js


function getModalUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiModal', slot);
}
const modalClasses = (0,generateUtilityClasses/* default */.A)('MuiModal', ['root', 'hidden', 'backdrop']);
/* harmony default export */ var Modal_modalClasses = ((/* unused pure expression or super */ null && (modalClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Modal/Modal.js
'use client';



const Modal_excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "container", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "onTransitionEnter", "onTransitionExited", "open", "slotProps", "slots", "theme"];
















const Modal_useUtilityClasses = ownerState => {
  const {
    open,
    exited,
    classes
  } = ownerState;
  const slots = {
    root: ['root', !open && exited && 'hidden'],
    backdrop: ['backdrop']
  };
  return (0,composeClasses/* default */.A)(slots, getModalUtilityClass, classes);
};
const ModalRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiModal',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, !ownerState.open && ownerState.exited && styles.hidden];
  }
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  position: 'fixed',
  zIndex: (theme.vars || theme).zIndex.modal,
  right: 0,
  bottom: 0,
  top: 0,
  left: 0
}, !ownerState.open && ownerState.exited && {
  visibility: 'hidden'
}));
const ModalBackdrop = (0,styled/* default */.Ay)(Backdrop_Backdrop, {
  name: 'MuiModal',
  slot: 'Backdrop',
  overridesResolver: (props, styles) => {
    return styles.backdrop;
  }
})({
  zIndex: -1
});

/**
 * Modal is a lower-level construct that is leveraged by the following components:
 *
 * - [Dialog](/material-ui/api/dialog/)
 * - [Drawer](/material-ui/api/drawer/)
 * - [Menu](/material-ui/api/menu/)
 * - [Popover](/material-ui/api/popover/)
 *
 * If you are creating a modal dialog, you probably want to use the [Dialog](/material-ui/api/dialog/) component
 * rather than directly using Modal.
 *
 * This component shares many concepts with [react-overlays](https://react-bootstrap.github.io/react-overlays/#modals).
 */
const Modal = /*#__PURE__*/react.forwardRef(function Modal(inProps, ref) {
  var _ref, _slots$root, _ref2, _slots$backdrop, _slotProps$root, _slotProps$backdrop;
  const props = (0,useThemeProps/* default */.A)({
    name: 'MuiModal',
    props: inProps
  });
  const {
      BackdropComponent = ModalBackdrop,
      BackdropProps,
      className,
      closeAfterTransition = false,
      children,
      container,
      component,
      components = {},
      componentsProps = {},
      disableAutoFocus = false,
      disableEnforceFocus = false,
      disableEscapeKeyDown = false,
      disablePortal = false,
      disableRestoreFocus = false,
      disableScrollLock = false,
      hideBackdrop = false,
      keepMounted = false,
      onBackdropClick,
      open,
      slotProps,
      slots
      // eslint-disable-next-line react/prop-types
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Modal_excluded);
  const propsWithDefaults = (0,esm_extends/* default */.A)({}, props, {
    closeAfterTransition,
    disableAutoFocus,
    disableEnforceFocus,
    disableEscapeKeyDown,
    disablePortal,
    disableRestoreFocus,
    disableScrollLock,
    hideBackdrop,
    keepMounted
  });
  const {
    getRootProps,
    getBackdropProps,
    getTransitionProps,
    portalRef,
    isTopModal,
    exited,
    hasTransition
  } = useModal((0,esm_extends/* default */.A)({}, propsWithDefaults, {
    rootRef: ref
  }));
  const ownerState = (0,esm_extends/* default */.A)({}, propsWithDefaults, {
    exited
  });
  const classes = Modal_useUtilityClasses(ownerState);
  const childProps = {};
  if (children.props.tabIndex === undefined) {
    childProps.tabIndex = '-1';
  }

  // It's a Transition like component
  if (hasTransition) {
    const {
      onEnter,
      onExited
    } = getTransitionProps();
    childProps.onEnter = onEnter;
    childProps.onExited = onExited;
  }
  const RootSlot = (_ref = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref : ModalRoot;
  const BackdropSlot = (_ref2 = (_slots$backdrop = slots == null ? void 0 : slots.backdrop) != null ? _slots$backdrop : components.Backdrop) != null ? _ref2 : BackdropComponent;
  const rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
  const backdropSlotProps = (_slotProps$backdrop = slotProps == null ? void 0 : slotProps.backdrop) != null ? _slotProps$backdrop : componentsProps.backdrop;
  const rootProps = useSlotProps({
    elementType: RootSlot,
    externalSlotProps: rootSlotProps,
    externalForwardedProps: other,
    getSlotProps: getRootProps,
    additionalProps: {
      ref,
      as: component
    },
    ownerState,
    className: (0,clsx_m/* default */.A)(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
  });
  const backdropProps = useSlotProps({
    elementType: BackdropSlot,
    externalSlotProps: backdropSlotProps,
    additionalProps: BackdropProps,
    getSlotProps: otherHandlers => {
      return getBackdropProps((0,esm_extends/* default */.A)({}, otherHandlers, {
        onClick: e => {
          if (onBackdropClick) {
            onBackdropClick(e);
          }
          if (otherHandlers != null && otherHandlers.onClick) {
            otherHandlers.onClick(e);
          }
        }
      }));
    },
    className: (0,clsx_m/* default */.A)(backdropSlotProps == null ? void 0 : backdropSlotProps.className, BackdropProps == null ? void 0 : BackdropProps.className, classes == null ? void 0 : classes.backdrop),
    ownerState
  });
  if (!keepMounted && !open && (!hasTransition || exited)) {
    return null;
  }
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Portal_Portal_Portal, {
    ref: portalRef,
    container: container,
    disablePortal: disablePortal,
    children: /*#__PURE__*/(0,jsx_runtime.jsxs)(RootSlot, (0,esm_extends/* default */.A)({}, rootProps, {
      children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/(0,jsx_runtime.jsx)(BackdropSlot, (0,esm_extends/* default */.A)({}, backdropProps)) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(FocusTrap, {
        disableEnforceFocus: disableEnforceFocus,
        disableAutoFocus: disableAutoFocus,
        disableRestoreFocus: disableRestoreFocus,
        isEnabled: isTopModal,
        open: open,
        children: /*#__PURE__*/react.cloneElement(children, childProps)
      })]
    }))
  });
});
 false ? 0 : void 0;
/* harmony default export */ var Modal_Modal = (Modal);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/colorManipulator.js
var colorManipulator = __webpack_require__(2937);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/getOverlayAlpha.js
// Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61
const getOverlayAlpha = elevation => {
  let alphaValue;
  if (elevation < 1) {
    alphaValue = 5.11916 * elevation ** 2;
  } else {
    alphaValue = 4.5 * Math.log(elevation + 1) + 2;
  }
  return (alphaValue / 100).toFixed(2);
};
/* harmony default export */ var styles_getOverlayAlpha = (getOverlayAlpha);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Paper/paperClasses.js


function getPaperUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiPaper', slot);
}
const paperClasses = (0,generateUtilityClasses/* default */.A)('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);
/* harmony default export */ var Paper_paperClasses = ((/* unused pure expression or super */ null && (paperClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Paper/Paper.js
'use client';



const Paper_excluded = ["className", "component", "elevation", "square", "variant"];













const Paper_useUtilityClasses = ownerState => {
  const {
    square,
    elevation,
    variant,
    classes
  } = ownerState;
  const slots = {
    root: ['root', variant, !square && 'rounded', variant === 'elevation' && `elevation${elevation}`]
  };
  return (0,composeClasses/* default */.A)(slots, getPaperUtilityClass, classes);
};
const PaperRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiPaper',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles[`elevation${ownerState.elevation}`]];
  }
})(({
  theme,
  ownerState
}) => {
  var _theme$vars$overlays;
  return (0,esm_extends/* default */.A)({
    backgroundColor: (theme.vars || theme).palette.background.paper,
    color: (theme.vars || theme).palette.text.primary,
    transition: theme.transitions.create('box-shadow')
  }, !ownerState.square && {
    borderRadius: theme.shape.borderRadius
  }, ownerState.variant === 'outlined' && {
    border: `1px solid ${(theme.vars || theme).palette.divider}`
  }, ownerState.variant === 'elevation' && (0,esm_extends/* default */.A)({
    boxShadow: (theme.vars || theme).shadows[ownerState.elevation]
  }, !theme.vars && theme.palette.mode === 'dark' && {
    backgroundImage: `linear-gradient(${(0,colorManipulator/* alpha */.X4)('#fff', styles_getOverlayAlpha(ownerState.elevation))}, ${(0,colorManipulator/* alpha */.X4)('#fff', styles_getOverlayAlpha(ownerState.elevation))})`
  }, theme.vars && {
    backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]
  }));
});
const Paper_Paper = /*#__PURE__*/react.forwardRef(function Paper(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiPaper'
  });
  const {
      className,
      component = 'div',
      elevation = 1,
      square = false,
      variant = 'elevation'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Paper_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    component,
    elevation,
    square,
    variant
  });
  const classes = Paper_useUtilityClasses(ownerState);
  if (false) {}
  return /*#__PURE__*/(0,jsx_runtime.jsx)(PaperRoot, (0,esm_extends/* default */.A)({
    as: component,
    ownerState: ownerState,
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ref: ref
  }, other));
});
 false ? 0 : void 0;
/* harmony default export */ var material_Paper_Paper = (Paper_Paper);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Dialog/dialogClasses.js


function getDialogUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiDialog', slot);
}
const dialogClasses = (0,generateUtilityClasses/* default */.A)('MuiDialog', ['root', 'scrollPaper', 'scrollBody', 'container', 'paper', 'paperScrollPaper', 'paperScrollBody', 'paperWidthFalse', 'paperWidthXs', 'paperWidthSm', 'paperWidthMd', 'paperWidthLg', 'paperWidthXl', 'paperFullWidth', 'paperFullScreen']);
/* harmony default export */ var Dialog_dialogClasses = (dialogClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Dialog/DialogContext.js

const DialogContext = /*#__PURE__*/react.createContext({});
if (false) {}
/* harmony default export */ var Dialog_DialogContext = (DialogContext);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Dialog/Dialog.js
'use client';



const Dialog_excluded = ["aria-describedby", "aria-labelledby", "BackdropComponent", "BackdropProps", "children", "className", "disableEscapeKeyDown", "fullScreen", "fullWidth", "maxWidth", "onBackdropClick", "onClose", "open", "PaperComponent", "PaperProps", "scroll", "TransitionComponent", "transitionDuration", "TransitionProps"];
















const DialogBackdrop = (0,styled/* default */.Ay)(Backdrop_Backdrop, {
  name: 'MuiDialog',
  slot: 'Backdrop',
  overrides: (props, styles) => styles.backdrop
})({
  // Improve scrollable dialog support.
  zIndex: -1
});
const Dialog_useUtilityClasses = ownerState => {
  const {
    classes,
    scroll,
    maxWidth,
    fullWidth,
    fullScreen
  } = ownerState;
  const slots = {
    root: ['root'],
    container: ['container', `scroll${(0,utils_capitalize/* default */.A)(scroll)}`],
    paper: ['paper', `paperScroll${(0,utils_capitalize/* default */.A)(scroll)}`, `paperWidth${(0,utils_capitalize/* default */.A)(String(maxWidth))}`, fullWidth && 'paperFullWidth', fullScreen && 'paperFullScreen']
  };
  return (0,composeClasses/* default */.A)(slots, getDialogUtilityClass, classes);
};
const DialogRoot = (0,styled/* default */.Ay)(Modal_Modal, {
  name: 'MuiDialog',
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
})({
  '@media print': {
    // Use !important to override the Modal inline-style.
    position: 'absolute !important'
  }
});
const DialogContainer = (0,styled/* default */.Ay)('div', {
  name: 'MuiDialog',
  slot: 'Container',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.container, styles[`scroll${(0,utils_capitalize/* default */.A)(ownerState.scroll)}`]];
  }
})(({
  ownerState
}) => (0,esm_extends/* default */.A)({
  height: '100%',
  '@media print': {
    height: 'auto'
  },
  // We disable the focus ring for mouse, touch and keyboard users.
  outline: 0
}, ownerState.scroll === 'paper' && {
  display: 'flex',
  justifyContent: 'center',
  alignItems: 'center'
}, ownerState.scroll === 'body' && {
  overflowY: 'auto',
  overflowX: 'hidden',
  textAlign: 'center',
  '&::after': {
    content: '""',
    display: 'inline-block',
    verticalAlign: 'middle',
    height: '100%',
    width: '0'
  }
}));
const DialogPaper = (0,styled/* default */.Ay)(material_Paper_Paper, {
  name: 'MuiDialog',
  slot: 'Paper',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.paper, styles[`scrollPaper${(0,utils_capitalize/* default */.A)(ownerState.scroll)}`], styles[`paperWidth${(0,utils_capitalize/* default */.A)(String(ownerState.maxWidth))}`], ownerState.fullWidth && styles.paperFullWidth, ownerState.fullScreen && styles.paperFullScreen];
  }
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  margin: 32,
  position: 'relative',
  overflowY: 'auto',
  // Fix IE11 issue, to remove at some point.
  '@media print': {
    overflowY: 'visible',
    boxShadow: 'none'
  }
}, ownerState.scroll === 'paper' && {
  display: 'flex',
  flexDirection: 'column',
  maxHeight: 'calc(100% - 64px)'
}, ownerState.scroll === 'body' && {
  display: 'inline-block',
  verticalAlign: 'middle',
  textAlign: 'left' // 'initial' doesn't work on IE11
}, !ownerState.maxWidth && {
  maxWidth: 'calc(100% - 64px)'
}, ownerState.maxWidth === 'xs' && {
  maxWidth: theme.breakpoints.unit === 'px' ? Math.max(theme.breakpoints.values.xs, 444) : `max(${theme.breakpoints.values.xs}${theme.breakpoints.unit}, 444px)`,
  [`&.${Dialog_dialogClasses.paperScrollBody}`]: {
    [theme.breakpoints.down(Math.max(theme.breakpoints.values.xs, 444) + 32 * 2)]: {
      maxWidth: 'calc(100% - 64px)'
    }
  }
}, ownerState.maxWidth && ownerState.maxWidth !== 'xs' && {
  maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`,
  [`&.${Dialog_dialogClasses.paperScrollBody}`]: {
    [theme.breakpoints.down(theme.breakpoints.values[ownerState.maxWidth] + 32 * 2)]: {
      maxWidth: 'calc(100% - 64px)'
    }
  }
}, ownerState.fullWidth && {
  width: 'calc(100% - 64px)'
}, ownerState.fullScreen && {
  margin: 0,
  width: '100%',
  maxWidth: '100%',
  height: '100%',
  maxHeight: 'none',
  borderRadius: 0,
  [`&.${Dialog_dialogClasses.paperScrollBody}`]: {
    margin: 0,
    maxWidth: '100%'
  }
}));

/**
 * Dialogs are overlaid modal paper based components with a backdrop.
 */
const Dialog = /*#__PURE__*/react.forwardRef(function Dialog(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiDialog'
  });
  const theme = styles_useTheme_useTheme();
  const defaultTransitionDuration = {
    enter: theme.transitions.duration.enteringScreen,
    exit: theme.transitions.duration.leavingScreen
  };
  const {
      'aria-describedby': ariaDescribedby,
      'aria-labelledby': ariaLabelledbyProp,
      BackdropComponent,
      BackdropProps,
      children,
      className,
      disableEscapeKeyDown = false,
      fullScreen = false,
      fullWidth = false,
      maxWidth = 'sm',
      onBackdropClick,
      onClose,
      open,
      PaperComponent = material_Paper_Paper,
      PaperProps = {},
      scroll = 'paper',
      TransitionComponent = Fade_Fade,
      transitionDuration = defaultTransitionDuration,
      TransitionProps
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Dialog_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    disableEscapeKeyDown,
    fullScreen,
    fullWidth,
    maxWidth,
    scroll
  });
  const classes = Dialog_useUtilityClasses(ownerState);
  const backdropClick = react.useRef();
  const handleMouseDown = event => {
    // We don't want to close the dialog when clicking the dialog content.
    // Make sure the event starts and ends on the same DOM element.
    backdropClick.current = event.target === event.currentTarget;
  };
  const handleBackdropClick = event => {
    // Ignore the events not coming from the "backdrop".
    if (!backdropClick.current) {
      return;
    }
    backdropClick.current = null;
    if (onBackdropClick) {
      onBackdropClick(event);
    }
    if (onClose) {
      onClose(event, 'backdropClick');
    }
  };
  const ariaLabelledby = (0,useId_useId/* default */.A)(ariaLabelledbyProp);
  const dialogContextValue = react.useMemo(() => {
    return {
      titleId: ariaLabelledby
    };
  }, [ariaLabelledby]);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(DialogRoot, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className),
    closeAfterTransition: true,
    components: {
      Backdrop: DialogBackdrop
    },
    componentsProps: {
      backdrop: (0,esm_extends/* default */.A)({
        transitionDuration,
        as: BackdropComponent
      }, BackdropProps)
    },
    disableEscapeKeyDown: disableEscapeKeyDown,
    onClose: onClose,
    open: open,
    ref: ref,
    onClick: handleBackdropClick,
    ownerState: ownerState
  }, other, {
    children: /*#__PURE__*/(0,jsx_runtime.jsx)(TransitionComponent, (0,esm_extends/* default */.A)({
      appear: true,
      in: open,
      timeout: transitionDuration,
      role: "presentation"
    }, TransitionProps, {
      children: /*#__PURE__*/(0,jsx_runtime.jsx)(DialogContainer, {
        className: (0,clsx_m/* default */.A)(classes.container),
        onMouseDown: handleMouseDown,
        ownerState: ownerState,
        children: /*#__PURE__*/(0,jsx_runtime.jsx)(DialogPaper, (0,esm_extends/* default */.A)({
          as: PaperComponent,
          elevation: 24,
          role: "dialog",
          "aria-describedby": ariaDescribedby,
          "aria-labelledby": ariaLabelledby
        }, PaperProps, {
          className: (0,clsx_m/* default */.A)(classes.paper, PaperProps.className),
          ownerState: ownerState,
          children: /*#__PURE__*/(0,jsx_runtime.jsx)(Dialog_DialogContext.Provider, {
            value: dialogContextValue,
            children: children
          })
        }))
      })
    }))
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var Dialog_Dialog = (Dialog);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Dialog/Dialog.tsx
/* eslint-disable react/require-default-props */



/**
 *
 * Demos:
 *
 * - [Dialog](https://mui.com/material-ui/react-dialog/)
 *
 * API:
 *
 * - [Dialog API](https://mui.com/material-ui/api/dialog/)
 */

var Dialog_Dialog_Dialog = function Dialog(_ref) {
  var children = _ref.children,
    open = _ref.open,
    _ref$disableEscapeKey = _ref.disableEscapeKeyDown,
    disableEscapeKeyDown = _ref$disableEscapeKey === void 0 ? false : _ref$disableEscapeKey,
    _ref$fullScreen = _ref.fullScreen,
    fullScreen = _ref$fullScreen === void 0 ? false : _ref$fullScreen,
    _ref$fullWidth = _ref.fullWidth,
    fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
    PaperComponent = _ref.PaperComponent,
    PaperProps = _ref.PaperProps;
  return /*#__PURE__*/react.createElement(Dialog_Dialog, {
    open: open,
    disableEscapeKeyDown: disableEscapeKeyDown,
    fullScreen: fullScreen,
    fullWidth: fullWidth,
    PaperComponent: PaperComponent,
    PaperProps: PaperProps
  }, children);
};
Dialog_Dialog_Dialog.propTypes = {
  children: prop_types_default().oneOfType([prop_types_default().arrayOf((prop_types_default()).node), (prop_types_default()).node]).isRequired,
  open: (prop_types_default()).bool,
  disableEscapeKeyDown: (prop_types_default()).bool,
  fullScreen: (prop_types_default()).bool,
  fullWidth: (prop_types_default()).bool,
  PaperComponent: (prop_types_default()).elementType,
  PaperProps: prop_types_default().shape({})
};
/* harmony default export */ var standard_Dialog_Dialog = ((/* unused pure expression or super */ null && (Dialog_Dialog_Dialog)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/DialogActions/dialogActionsClasses.js


function getDialogActionsUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiDialogActions', slot);
}
const dialogActionsClasses = (0,generateUtilityClasses/* default */.A)('MuiDialogActions', ['root', 'spacing']);
/* harmony default export */ var DialogActions_dialogActionsClasses = ((/* unused pure expression or super */ null && (dialogActionsClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/DialogActions/DialogActions.js
'use client';



const DialogActions_excluded = ["className", "disableSpacing"];








const DialogActions_useUtilityClasses = ownerState => {
  const {
    classes,
    disableSpacing
  } = ownerState;
  const slots = {
    root: ['root', !disableSpacing && 'spacing']
  };
  return (0,composeClasses/* default */.A)(slots, getDialogActionsUtilityClass, classes);
};
const DialogActionsRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiDialogActions',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, !ownerState.disableSpacing && styles.spacing];
  }
})(({
  ownerState
}) => (0,esm_extends/* default */.A)({
  display: 'flex',
  alignItems: 'center',
  padding: 8,
  justifyContent: 'flex-end',
  flex: '0 0 auto'
}, !ownerState.disableSpacing && {
  '& > :not(style) ~ :not(style)': {
    marginLeft: 8
  }
}));
const DialogActions = /*#__PURE__*/react.forwardRef(function DialogActions(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiDialogActions'
  });
  const {
      className,
      disableSpacing = false
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, DialogActions_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    disableSpacing
  });
  const classes = DialogActions_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(DialogActionsRoot, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ownerState: ownerState,
    ref: ref
  }, other));
});
 false ? 0 : void 0;
/* harmony default export */ var DialogActions_DialogActions = (DialogActions);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Dialog/DialogActions.tsx
/* eslint-disable react/require-default-props */




/**
 *
 * Demos:
 *
 * - [DialogActions](https://mui.com/material-ui/react-dialog/)
 *
 * API:
 *
 * - [DialogActions API](https://mui.com/material-ui/api/dialog-actions/)
 */

var Dialog_DialogActions_DialogActions = function DialogActions(_ref) {
  var children = _ref.children;
  return /*#__PURE__*/react.createElement(DialogActions_DialogActions, null, children);
};
Dialog_DialogActions_DialogActions.propTypes = {
  children: (prop_types_default()).node.isRequired
};
/* harmony default export */ var Dialog_DialogActions = ((/* unused pure expression or super */ null && (Dialog_DialogActions_DialogActions)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Dialog/DialogTitle.tsx
/* eslint-disable react/require-default-props */



/**
 *
 * Demos:
 *
 * - [DialogTitle](https://mui.com/material-ui/react-dialog/)
 *
 * API:
 *
 * - [DialogTitle API](https://mui.com/material-ui/api/dialog-title/)
 */

var DialogTitle = function DialogTitle(_ref) {
  var children = _ref.children;
  return /*#__PURE__*/React.createElement(MuiDialogTitle, null, children);
};
/* harmony default export */ var Dialog_DialogTitle = ((/* unused pure expression or super */ null && (DialogTitle)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/DialogContent/dialogContentClasses.js


function getDialogContentUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiDialogContent', slot);
}
const dialogContentClasses = (0,generateUtilityClasses/* default */.A)('MuiDialogContent', ['root', 'dividers']);
/* harmony default export */ var DialogContent_dialogContentClasses = ((/* unused pure expression or super */ null && (dialogContentClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/DialogTitle/dialogTitleClasses.js


function getDialogTitleUtilityClass(slot) {
  return generateUtilityClass('MuiDialogTitle', slot);
}
const dialogTitleClasses = (0,generateUtilityClasses/* default */.A)('MuiDialogTitle', ['root']);
/* harmony default export */ var DialogTitle_dialogTitleClasses = (dialogTitleClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/DialogContent/DialogContent.js
'use client';



const DialogContent_excluded = ["className", "dividers"];









const DialogContent_useUtilityClasses = ownerState => {
  const {
    classes,
    dividers
  } = ownerState;
  const slots = {
    root: ['root', dividers && 'dividers']
  };
  return (0,composeClasses/* default */.A)(slots, getDialogContentUtilityClass, classes);
};
const DialogContentRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiDialogContent',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, ownerState.dividers && styles.dividers];
  }
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  flex: '1 1 auto',
  // Add iOS momentum scrolling for iOS < 13.0
  WebkitOverflowScrolling: 'touch',
  overflowY: 'auto',
  padding: '20px 24px'
}, ownerState.dividers ? {
  padding: '16px 24px',
  borderTop: `1px solid ${(theme.vars || theme).palette.divider}`,
  borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
} : {
  [`.${DialogTitle_dialogTitleClasses.root} + &`]: {
    paddingTop: 0
  }
}));
const DialogContent = /*#__PURE__*/react.forwardRef(function DialogContent(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiDialogContent'
  });
  const {
      className,
      dividers = false
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, DialogContent_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    dividers
  });
  const classes = DialogContent_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(DialogContentRoot, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ownerState: ownerState,
    ref: ref
  }, other));
});
 false ? 0 : void 0;
/* harmony default export */ var DialogContent_DialogContent = (DialogContent);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Dialog/DialogContent.tsx
/* eslint-disable react/require-default-props */




/**
 *
 * Demos:
 *
 * - [DialogContent](https://mui.com/material-ui/react-dialog/)
 *
 * API:
 *
 * - [DialogContent API](https://mui.com/material-ui/api/dialog-content/)
 */

var Dialog_DialogContent_DialogContent = function DialogContent(_ref) {
  var children = _ref.children,
    dividers = _ref.dividers;
  return /*#__PURE__*/react.createElement(DialogContent_DialogContent, {
    dividers: dividers
  }, children);
};
Dialog_DialogContent_DialogContent.propTypes = {
  children: (prop_types_default()).node.isRequired,
  dividers: (prop_types_default()).bool
};
Dialog_DialogContent_DialogContent.defaultProps = {
  dividers: false
};
/* harmony default export */ var Dialog_DialogContent = ((/* unused pure expression or super */ null && (Dialog_DialogContent_DialogContent)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Dialog/index.ts




;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Box/Box.tsx
/* eslint-disable react/require-default-props */



/**
 *
 * Demos:
 *
 * - [Box](https://mui.com/components/box/)
 *
 * API:
 *
 * - [Box API](https://mui.com/components/box/#api)
 */

var Box_Box = /*#__PURE__*/(/* unused pure expression or super */ null && (forwardRef(function (props, ref) {
  return /*#__PURE__*/React.createElement(MuiBox, {
    component: props.component,
    display: props.display,
    flexDirection: props.flexDirection,
    flexShrink: props.flexShrink,
    flex: props.flex,
    justifyContent: props.justifyContent,
    m: props.m,
    mt: props.mt,
    mb: props.mb,
    ml: props.ml,
    mx: props.mx,
    my: props.my,
    px: props.px,
    py: props.py,
    pb: props.pb,
    pl: props.pl,
    pr: props.pr,
    pt: props.pt,
    borderBottom: props.borderBottom,
    position: props.position,
    border: props.border,
    borderRadius: props.borderRadius,
    borderColor: props.borderColor,
    top: props.top,
    right: props.right,
    bottom: props.bottom,
    left: props.left,
    p: props.p,
    minWidth: props.minWidth,
    maxWidth: props.maxWidth,
    minHeight: props.minHeight,
    maxHeight: props.maxHeight,
    width: props.width,
    height: props.height,
    sx: props.sx,
    gap: props.gap,
    alignItems: props.alignItems,
    lineHeight: props.lineHeight,
    zIndex: props.zIndex,
    bgcolor: props.bgcolor,
    className: props.className,
    onMouseEnter: props.onMouseEnter,
    onMouseLeave: props.onMouseLeave,
    onClick: props.onClick,
    overflow: props.overflow,
    ref: ref,
    onContextMenu: props.onContextMenu,
    color: props.color,
    textAlign: props.textAlign,
    alignContent: props.alignContent,
    role: props.role
  }, props.children);
})));
/* harmony default export */ var standard_Box_Box = ((/* unused pure expression or super */ null && (Box_Box)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Box/BoxProps.ts
var Display = /*#__PURE__*/function (Display) {
  Display["FLEX"] = "flex";
  Display["NONE"] = "none";
  Display["BLOCK"] = "block";
  Display["INLINE"] = "inline";
  Display["INLINE_FLEX"] = "inline-flex";
  Display["GRID"] = "grid";
  return Display;
}({});
var FlexDirection = /*#__PURE__*/function (FlexDirection) {
  FlexDirection["COLUMN"] = "column";
  FlexDirection["ROW"] = "row";
  FlexDirection["ROW_REVERSE"] = "row-reverse";
  return FlexDirection;
}({});
var JustifyContent = /*#__PURE__*/function (JustifyContent) {
  JustifyContent["SPACE_BETWEEN"] = "space-between";
  JustifyContent["CENTER"] = "center";
  JustifyContent["FLEX_START"] = "flex-start";
  JustifyContent["FLEX_END"] = "flex-end";
  return JustifyContent;
}({});
var Width = /*#__PURE__*/function (Width) {
  Width["FULL_WIDTH"] = "100%";
  Width["FIT_CONTENT"] = "fit-content";
  return Width;
}({});
var Height = /*#__PURE__*/function (Height) {
  Height["FIT_CONTENT"] = "fit-content";
  return Height;
}({});
var AlignItems = /*#__PURE__*/function (AlignItems) {
  AlignItems["CENTER"] = "center";
  AlignItems["START"] = "start";
  AlignItems["END"] = "end";
  AlignItems["FLEX_START"] = "flex-start";
  return AlignItems;
}({});
var TextAlign = /*#__PURE__*/function (TextAlign) {
  TextAlign["CENTER"] = "center";
  return TextAlign;
}({});
var AlignContent = /*#__PURE__*/function (AlignContent) {
  AlignContent["CENTER"] = "center";
  return AlignContent;
}({});
var BorderColor = /*#__PURE__*/function (BorderColor) {
  BorderColor["OUTLINE_BORDER"] = "other.outlinedBorder";
  return BorderColor;
}({});
var Overflow = /*#__PURE__*/function (Overflow) {
  Overflow["HIDDEN"] = "hidden";
  return Overflow;
}({});
var Position = /*#__PURE__*/function (Position) {
  Position["RELATIVE"] = "relative";
  Position["STICKY"] = "sticky";
  return Position;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Box/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/props.ts
// The enums in this file represent all the props that are used in more than one component

// TODO: To review for redundant structures, to review Size
var Color = /*#__PURE__*/function (Color) {
  Color["PRIMARY"] = "primary";
  Color["SECONDARY"] = "secondary";
  Color["SUCCESS"] = "success";
  Color["ERROR"] = "error";
  Color["INFO"] = "info";
  Color["WARNING"] = "warning";
  Color["INHERIT"] = "inherit";
  return Color;
}({});
var props_Underline = /*#__PURE__*/function (Underline) {
  Underline["NONE"] = "none";
  Underline["HOVER"] = "hover";
  Underline["ALWAYS"] = "always";
  return Underline;
}({});
var LabelPlacement = /*#__PURE__*/function (LabelPlacement) {
  LabelPlacement["BOTTOM"] = "bottom";
  LabelPlacement["END"] = "end";
  LabelPlacement["START"] = "start";
  LabelPlacement["TOP"] = "top";
  return LabelPlacement;
}({});
var SelectionControlSize = /*#__PURE__*/function (SelectionControlSize) {
  SelectionControlSize["SMALL"] = "small";
  SelectionControlSize["MEDIUM"] = "medium";
  return SelectionControlSize;
}({});
var ButtonSize = /*#__PURE__*/function (ButtonSize) {
  ButtonSize["SMALL"] = "small";
  ButtonSize["MEDIUM"] = "medium";
  ButtonSize["LARGE"] = "large";
  return ButtonSize;
}({});
var TextFieldSize = /*#__PURE__*/function (TextFieldSize) {
  TextFieldSize["SMALL"] = "small";
  TextFieldSize["MEDIUM"] = "medium";
  return TextFieldSize;
}({});
var TextFieldVariant = /*#__PURE__*/function (TextFieldVariant) {
  TextFieldVariant["OUTLINED"] = "outlined";
  TextFieldVariant["FILLED"] = "filled";
  TextFieldVariant["STANDARD"] = "standard";
  return TextFieldVariant;
}({});
var props_Size = /*#__PURE__*/function (Size) {
  Size["SMALL"] = "small";
  Size["MEDIUM"] = "medium";
  return Size;
}({});
var Variants = /*#__PURE__*/function (Variants) {
  Variants["BODY1"] = "body1";
  Variants["BODY2"] = "body2";
  Variants["SUBTITLE1"] = "subtitle1";
  Variants["SUBTITLE2"] = "subtitle2";
  Variants["CAPTION"] = "caption";
  Variants["OVERLINE"] = "overline";
  Variants["H1"] = "h1";
  Variants["H2"] = "h2";
  Variants["H3"] = "h3";
  Variants["H4"] = "h4";
  Variants["H5"] = "h5";
  Variants["H6"] = "h6";
  Variants["ALERTTEXT"] = "alertText";
  return Variants;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Button/ButtonProps.ts

var ButtonProps_Variant = /*#__PURE__*/function (Variant) {
  Variant["CONTAINED"] = "contained";
  Variant["OUTLINED"] = "outlined";
  Variant["TEXT"] = "text";
  // TODO: Delete the following temporary written code (we need to simulate the appearance of a selected folder button
  //  until we get access to the real folder developed on another branch).
  Variant["FAKE_FOLDER"] = "fakeFolder";
  return Variant;
}({});
var Type = /*#__PURE__*/function (Type) {
  Type["BUTTON"] = "button";
  Type["SUBMIT"] = "submit";
  Type["RESET"] = "reset";
  return Type;
}({});
var Target = /*#__PURE__*/function (Target) {
  Target["BLANK"] = "_blank";
  Target["SELF"] = "_self";
  return Target;
}({});
var Rel = /*#__PURE__*/function (Rel) {
  Rel["NO_OPENER_NO_REFERRER"] = "noopener noreferrer";
  return Rel;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Button/Button.tsx




/**
 *
 * Demos:
 *
 * - [Button group](https://mui.com/material-ui/react-button-group/)
 * - [Buttons](https://mui.com/material-ui/react-button/)
 *
 * API:
 *
 * - [Button API](https://mui.com/material-ui/api/button/)
 * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/)
 */
var Button_Button_Button = function Button(_ref) {
  var children = _ref.children,
    color = _ref.color,
    disabled = _ref.disabled,
    disableRipple = _ref.disableRipple,
    disableElevation = _ref.disableElevation,
    endIcon = _ref.endIcon,
    href = _ref.href,
    onClick = _ref.onClick,
    size = _ref.size,
    startIcon = _ref.startIcon,
    variant = _ref.variant,
    fullWidth = _ref.fullWidth,
    type = _ref.type,
    sx = _ref.sx,
    _ref$component = _ref.component,
    component = _ref$component === void 0 ? 'button' : _ref$component,
    _ref$target = _ref.target,
    target = _ref$target === void 0 ? ButtonProps.Target.BLANK : _ref$target;
  return href ? /*#__PURE__*/React.createElement(MuiButton, {
    href: href,
    target: target,
    rel: ButtonProps.Rel.NO_OPENER_NO_REFERRER,
    onClick: function onClick(e) {
      return e.stopPropagation();
    },
    color: color,
    disabled: disabled,
    disableRipple: disableRipple,
    disableElevation: disableElevation,
    endIcon: endIcon,
    size: size,
    startIcon: startIcon,
    variant: variant,
    fullWidth: fullWidth,
    type: type,
    sx: sx
  }, children) : /*#__PURE__*/React.createElement(MuiButton, {
    color: color,
    disabled: disabled,
    disableRipple: disableRipple,
    disableElevation: disableElevation,
    endIcon: endIcon,
    onClick: onClick,
    size: size,
    startIcon: startIcon,
    variant: variant,
    fullWidth: fullWidth,
    type: type,
    sx: sx,
    component: component
  }, children);
};
/* harmony default export */ var standard_Button_Button = ((/* unused pure expression or super */ null && (Button_Button_Button)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Button/index.ts



// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/breakpoints.js
var system_esm_breakpoints = __webpack_require__(8138);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js
var extendSxProp = __webpack_require__(449);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Grid/GridContext.js
'use client';



/**
 * @ignore - internal component.
 */
const GridContext = /*#__PURE__*/react.createContext();
if (false) {}
/* harmony default export */ var Grid_GridContext = (GridContext);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Grid/gridClasses.js


function getGridUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiGrid', slot);
}
const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
const GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
const gridClasses = (0,generateUtilityClasses/* default */.A)('MuiGrid', ['root', 'container', 'item', 'zeroMinWidth',
// spacings
...SPACINGS.map(spacing => `spacing-xs-${spacing}`),
// direction values
...DIRECTIONS.map(direction => `direction-xs-${direction}`),
// wrap values
...WRAPS.map(wrap => `wrap-xs-${wrap}`),
// grid sizes for all breakpoints
...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
/* harmony default export */ var Grid_gridClasses = (gridClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Grid/Grid.js
'use client';

// A grid component using the following libs as inspiration.
//
// For the implementation:
// - https://getbootstrap.com/docs/4.3/layout/grid/
// - https://github.com/kristoferjoseph/flexboxgrid/blob/master/src/css/flexboxgrid.css
// - https://github.com/roylee0704/react-flexbox-grid
// - https://material.angularjs.org/latest/layout/introduction
//
// Follow this flexbox Guide to better understand the underlying model:
// - https://css-tricks.com/snippets/css/a-guide-to-flexbox/


const Grid_excluded = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "rowSpacing", "spacing", "wrap", "zeroMinWidth"];













function getOffset(val) {
  const parse = parseFloat(val);
  return `${parse}${String(val).replace(String(parse), '') || 'px'}`;
}
function generateGrid({
  theme,
  ownerState
}) {
  let size;
  return theme.breakpoints.keys.reduce((globalStyles, breakpoint) => {
    // Use side effect over immutability for better performance.
    let styles = {};
    if (ownerState[breakpoint]) {
      size = ownerState[breakpoint];
    }
    if (!size) {
      return globalStyles;
    }
    if (size === true) {
      // For the auto layouting
      styles = {
        flexBasis: 0,
        flexGrow: 1,
        maxWidth: '100%'
      };
    } else if (size === 'auto') {
      styles = {
        flexBasis: 'auto',
        flexGrow: 0,
        flexShrink: 0,
        maxWidth: 'none',
        width: 'auto'
      };
    } else {
      const columnsBreakpointValues = (0,system_esm_breakpoints/* resolveBreakpointValues */.kW)({
        values: ownerState.columns,
        breakpoints: theme.breakpoints.values
      });
      const columnValue = typeof columnsBreakpointValues === 'object' ? columnsBreakpointValues[breakpoint] : columnsBreakpointValues;
      if (columnValue === undefined || columnValue === null) {
        return globalStyles;
      }
      // Keep 7 significant numbers.
      const width = `${Math.round(size / columnValue * 10e7) / 10e5}%`;
      let more = {};
      if (ownerState.container && ownerState.item && ownerState.columnSpacing !== 0) {
        const themeSpacing = theme.spacing(ownerState.columnSpacing);
        if (themeSpacing !== '0px') {
          const fullWidth = `calc(${width} + ${getOffset(themeSpacing)})`;
          more = {
            flexBasis: fullWidth,
            maxWidth: fullWidth
          };
        }
      }

      // Close to the bootstrap implementation:
      // https://github.com/twbs/bootstrap/blob/8fccaa2439e97ec72a4b7dc42ccc1f649790adb0/scss/mixins/_grid.scss#L41
      styles = (0,esm_extends/* default */.A)({
        flexBasis: width,
        flexGrow: 0,
        maxWidth: width
      }, more);
    }

    // No need for a media query for the first size.
    if (theme.breakpoints.values[breakpoint] === 0) {
      Object.assign(globalStyles, styles);
    } else {
      globalStyles[theme.breakpoints.up(breakpoint)] = styles;
    }
    return globalStyles;
  }, {});
}
function generateDirection({
  theme,
  ownerState
}) {
  const directionValues = (0,system_esm_breakpoints/* resolveBreakpointValues */.kW)({
    values: ownerState.direction,
    breakpoints: theme.breakpoints.values
  });
  return (0,system_esm_breakpoints/* handleBreakpoints */.NI)({
    theme
  }, directionValues, propValue => {
    const output = {
      flexDirection: propValue
    };
    if (propValue.indexOf('column') === 0) {
      output[`& > .${Grid_gridClasses.item}`] = {
        maxWidth: 'none'
      };
    }
    return output;
  });
}

/**
 * Extracts zero value breakpoint keys before a non-zero value breakpoint key.
 * @example { xs: 0, sm: 0, md: 2, lg: 0, xl: 0 } or [0, 0, 2, 0, 0]
 * @returns [xs, sm]
 */
function extractZeroValueBreakpointKeys({
  breakpoints,
  values
}) {
  let nonZeroKey = '';
  Object.keys(values).forEach(key => {
    if (nonZeroKey !== '') {
      return;
    }
    if (values[key] !== 0) {
      nonZeroKey = key;
    }
  });
  const sortedBreakpointKeysByValue = Object.keys(breakpoints).sort((a, b) => {
    return breakpoints[a] - breakpoints[b];
  });
  return sortedBreakpointKeysByValue.slice(0, sortedBreakpointKeysByValue.indexOf(nonZeroKey));
}
function generateRowGap({
  theme,
  ownerState
}) {
  const {
    container,
    rowSpacing
  } = ownerState;
  let styles = {};
  if (container && rowSpacing !== 0) {
    const rowSpacingValues = (0,system_esm_breakpoints/* resolveBreakpointValues */.kW)({
      values: rowSpacing,
      breakpoints: theme.breakpoints.values
    });
    let zeroValueBreakpointKeys;
    if (typeof rowSpacingValues === 'object') {
      zeroValueBreakpointKeys = extractZeroValueBreakpointKeys({
        breakpoints: theme.breakpoints.values,
        values: rowSpacingValues
      });
    }
    styles = (0,system_esm_breakpoints/* handleBreakpoints */.NI)({
      theme
    }, rowSpacingValues, (propValue, breakpoint) => {
      var _zeroValueBreakpointK;
      const themeSpacing = theme.spacing(propValue);
      if (themeSpacing !== '0px') {
        return {
          marginTop: `-${getOffset(themeSpacing)}`,
          [`& > .${Grid_gridClasses.item}`]: {
            paddingTop: getOffset(themeSpacing)
          }
        };
      }
      if ((_zeroValueBreakpointK = zeroValueBreakpointKeys) != null && _zeroValueBreakpointK.includes(breakpoint)) {
        return {};
      }
      return {
        marginTop: 0,
        [`& > .${Grid_gridClasses.item}`]: {
          paddingTop: 0
        }
      };
    });
  }
  return styles;
}
function generateColumnGap({
  theme,
  ownerState
}) {
  const {
    container,
    columnSpacing
  } = ownerState;
  let styles = {};
  if (container && columnSpacing !== 0) {
    const columnSpacingValues = (0,system_esm_breakpoints/* resolveBreakpointValues */.kW)({
      values: columnSpacing,
      breakpoints: theme.breakpoints.values
    });
    let zeroValueBreakpointKeys;
    if (typeof columnSpacingValues === 'object') {
      zeroValueBreakpointKeys = extractZeroValueBreakpointKeys({
        breakpoints: theme.breakpoints.values,
        values: columnSpacingValues
      });
    }
    styles = (0,system_esm_breakpoints/* handleBreakpoints */.NI)({
      theme
    }, columnSpacingValues, (propValue, breakpoint) => {
      var _zeroValueBreakpointK2;
      const themeSpacing = theme.spacing(propValue);
      if (themeSpacing !== '0px') {
        return {
          width: `calc(100% + ${getOffset(themeSpacing)})`,
          marginLeft: `-${getOffset(themeSpacing)}`,
          [`& > .${Grid_gridClasses.item}`]: {
            paddingLeft: getOffset(themeSpacing)
          }
        };
      }
      if ((_zeroValueBreakpointK2 = zeroValueBreakpointKeys) != null && _zeroValueBreakpointK2.includes(breakpoint)) {
        return {};
      }
      return {
        width: '100%',
        marginLeft: 0,
        [`& > .${Grid_gridClasses.item}`]: {
          paddingLeft: 0
        }
      };
    });
  }
  return styles;
}
function resolveSpacingStyles(spacing, breakpoints, styles = {}) {
  // undefined/null or `spacing` <= 0
  if (!spacing || spacing <= 0) {
    return [];
  }
  // in case of string/number `spacing`
  if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
    return [styles[`spacing-xs-${String(spacing)}`]];
  }
  // in case of object `spacing`
  const spacingStyles = [];
  breakpoints.forEach(breakpoint => {
    const value = spacing[breakpoint];
    if (Number(value) > 0) {
      spacingStyles.push(styles[`spacing-${breakpoint}-${String(value)}`]);
    }
  });
  return spacingStyles;
}

// Default CSS values
// flex: '0 1 auto',
// flexDirection: 'row',
// alignItems: 'flex-start',
// flexWrap: 'nowrap',
// justifyContent: 'flex-start',
const GridRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiGrid',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    const {
      container,
      direction,
      item,
      spacing,
      wrap,
      zeroMinWidth,
      breakpoints
    } = ownerState;
    let spacingStyles = [];

    // in case of grid item
    if (container) {
      spacingStyles = resolveSpacingStyles(spacing, breakpoints, styles);
    }
    const breakpointsStyles = [];
    breakpoints.forEach(breakpoint => {
      const value = ownerState[breakpoint];
      if (value) {
        breakpointsStyles.push(styles[`grid-${breakpoint}-${String(value)}`]);
      }
    });
    return [styles.root, container && styles.container, item && styles.item, zeroMinWidth && styles.zeroMinWidth, ...spacingStyles, direction !== 'row' && styles[`direction-xs-${String(direction)}`], wrap !== 'wrap' && styles[`wrap-xs-${String(wrap)}`], ...breakpointsStyles];
  }
})(({
  ownerState
}) => (0,esm_extends/* default */.A)({
  boxSizing: 'border-box'
}, ownerState.container && {
  display: 'flex',
  flexWrap: 'wrap',
  width: '100%'
}, ownerState.item && {
  margin: 0 // For instance, it's useful when used with a `figure` element.
}, ownerState.zeroMinWidth && {
  minWidth: 0
}, ownerState.wrap !== 'wrap' && {
  flexWrap: ownerState.wrap
}), generateDirection, generateRowGap, generateColumnGap, generateGrid);
function resolveSpacingClasses(spacing, breakpoints) {
  // undefined/null or `spacing` <= 0
  if (!spacing || spacing <= 0) {
    return [];
  }
  // in case of string/number `spacing`
  if (typeof spacing === 'string' && !Number.isNaN(Number(spacing)) || typeof spacing === 'number') {
    return [`spacing-xs-${String(spacing)}`];
  }
  // in case of object `spacing`
  const classes = [];
  breakpoints.forEach(breakpoint => {
    const value = spacing[breakpoint];
    if (Number(value) > 0) {
      const className = `spacing-${breakpoint}-${String(value)}`;
      classes.push(className);
    }
  });
  return classes;
}
const Grid_useUtilityClasses = ownerState => {
  const {
    classes,
    container,
    direction,
    item,
    spacing,
    wrap,
    zeroMinWidth,
    breakpoints
  } = ownerState;
  let spacingClasses = [];

  // in case of grid item
  if (container) {
    spacingClasses = resolveSpacingClasses(spacing, breakpoints);
  }
  const breakpointsClasses = [];
  breakpoints.forEach(breakpoint => {
    const value = ownerState[breakpoint];
    if (value) {
      breakpointsClasses.push(`grid-${breakpoint}-${String(value)}`);
    }
  });
  const slots = {
    root: ['root', container && 'container', item && 'item', zeroMinWidth && 'zeroMinWidth', ...spacingClasses, direction !== 'row' && `direction-xs-${String(direction)}`, wrap !== 'wrap' && `wrap-xs-${String(wrap)}`, ...breakpointsClasses]
  };
  return (0,composeClasses/* default */.A)(slots, getGridUtilityClass, classes);
};
const Grid = /*#__PURE__*/react.forwardRef(function Grid(inProps, ref) {
  const themeProps = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiGrid'
  });
  const {
    breakpoints
  } = styles_useTheme_useTheme();
  const props = (0,extendSxProp/* default */.A)(themeProps);
  const {
      className,
      columns: columnsProp,
      columnSpacing: columnSpacingProp,
      component = 'div',
      container = false,
      direction = 'row',
      item = false,
      rowSpacing: rowSpacingProp,
      spacing = 0,
      wrap = 'wrap',
      zeroMinWidth = false
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Grid_excluded);
  const rowSpacing = rowSpacingProp || spacing;
  const columnSpacing = columnSpacingProp || spacing;
  const columnsContext = react.useContext(Grid_GridContext);

  // columns set with default breakpoint unit of 12
  const columns = container ? columnsProp || 12 : columnsContext;
  const breakpointsValues = {};
  const otherFiltered = (0,esm_extends/* default */.A)({}, other);
  breakpoints.keys.forEach(breakpoint => {
    if (other[breakpoint] != null) {
      breakpointsValues[breakpoint] = other[breakpoint];
      delete otherFiltered[breakpoint];
    }
  });
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    columns,
    container,
    direction,
    item,
    rowSpacing,
    columnSpacing,
    wrap,
    zeroMinWidth,
    spacing
  }, breakpointsValues, {
    breakpoints: breakpoints.keys
  });
  const classes = Grid_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(Grid_GridContext.Provider, {
    value: columns,
    children: /*#__PURE__*/(0,jsx_runtime.jsx)(GridRoot, (0,esm_extends/* default */.A)({
      ownerState: ownerState,
      className: (0,clsx_m/* default */.A)(classes.root, className),
      as: component,
      ref: ref
    }, otherFiltered))
  });
});
 false ? 0 : void 0;
if (false) {}
/* harmony default export */ var Grid_Grid = (Grid);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Grid/Grid.tsx



/**
 *
 * Demos:
 *
 * - [Grid](https://mui.com/material-ui/react-grid/)
 *
 * API:
 *
 * - [Grid API](https://mui.com/material-ui/api/grid/)
 */
var Grid_Grid_Grid = function Grid(_ref) {
  var children = _ref.children,
    container = _ref.container,
    item = _ref.item,
    spacing = _ref.spacing,
    alignItems = _ref.alignItems,
    direction = _ref.direction,
    justifyContent = _ref.justifyContent,
    xs = _ref.xs,
    sm = _ref.sm,
    md = _ref.md,
    lg = _ref.lg,
    xl = _ref.xl,
    pl = _ref.pl,
    sx = _ref.sx;
  return /*#__PURE__*/react.createElement(Grid_Grid, {
    container: container,
    item: item,
    spacing: spacing,
    alignItems: alignItems,
    direction: direction,
    justifyContent: justifyContent,
    xs: xs,
    sm: sm,
    md: md,
    lg: lg,
    xl: xl,
    pl: pl,
    sx: sx
  }, children);
};
var BreakPointPropType = prop_types_default().oneOfType([prop_types_default().oneOf(['auto']).isRequired, (prop_types_default()).number.isRequired, (prop_types_default()).bool.isRequired]);
Grid_Grid_Grid.propTypes = {
  children: (prop_types_default()).element.isRequired,
  container: (prop_types_default()).bool,
  item: (prop_types_default()).bool,
  spacing: prop_types_default().oneOfType([prop_types_default().arrayOf(prop_types_default().oneOfType([(prop_types_default()).number.isRequired, (prop_types_default()).string.isRequired])).isRequired, (prop_types_default()).number.isRequired, prop_types_default().shape({}).isRequired, (prop_types_default()).string.isRequired]),
  alignItems: (prop_types_default()).string,
  direction: (prop_types_default()).string,
  justifyContent: (prop_types_default()).string,
  xs: BreakPointPropType,
  sm: BreakPointPropType,
  md: BreakPointPropType,
  lg: BreakPointPropType,
  xl: BreakPointPropType
};
/* harmony default export */ var standard_Grid_Grid = ((/* unused pure expression or super */ null && (Grid_Grid_Grid)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Grid/GridProps.ts
var GridProps_AlignItems = /*#__PURE__*/function (AlignItems) {
  AlignItems["FLEX_START"] = "flex-start";
  AlignItems["CENTER"] = "center";
  AlignItems["FLEX_END"] = "flex-end";
  AlignItems["STRETCH"] = "stretch";
  AlignItems["BASELINE"] = "baseline";
  return AlignItems;
}({});
var Direction = /*#__PURE__*/function (Direction) {
  Direction["COLUMN_REVERSE"] = "column-reverse";
  Direction["COLUMN"] = "column";
  Direction["ROW_REVERSE"] = "row-reverse";
  Direction["ROW"] = "row";
  return Direction;
}({});
var GridProps_JustifyContent = /*#__PURE__*/function (JustifyContent) {
  JustifyContent["FLEX_START"] = "flex-start";
  JustifyContent["CENTER"] = "center";
  JustifyContent["FLEX_END"] = "flex-end";
  JustifyContent["SPACE_BETWEEN"] = "space-between";
  JustifyContent["SPACE_AROUND"] = "space-around";
  JustifyContent["SPACE_EVENLY"] = "space-evenly";
  return JustifyContent;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Grid/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Stack/Stack.tsx


/**
 *
 * Demos:
 *
 * - [Stack](https://mui.com/material-ui/react-stack/)
 *
 * API:
 *
 * - [Stack API](https://mui.com/material-ui/api/stack/)
 */
var Stack_Stack = function Stack(_ref) {
  var children = _ref.children,
    component = _ref.component,
    direction = _ref.direction,
    divider = _ref.divider,
    spacing = _ref.spacing,
    alignItems = _ref.alignItems,
    justifyContent = _ref.justifyContent,
    flexWrap = _ref.flexWrap,
    sx = _ref.sx,
    p = _ref.p,
    py = _ref.py,
    px = _ref.px,
    pb = _ref.pb,
    pl = _ref.pl,
    minWidth = _ref.minWidth,
    maxWidth = _ref.maxWidth,
    height = _ref.height,
    minHeight = _ref.minHeight,
    borderBottom = _ref.borderBottom,
    borderColor = _ref.borderColor,
    bgcolor = _ref.bgcolor,
    gap = _ref.gap,
    width = _ref.width,
    mb = _ref.mb,
    flexGrow = _ref.flexGrow,
    flex = _ref.flex,
    mt = _ref.mt,
    m = _ref.m,
    textAlign = _ref.textAlign,
    onMouseLeave = _ref.onMouseLeave;
  return /*#__PURE__*/React.createElement(MuiStack, {
    component: component || 'div',
    direction: direction,
    divider: divider,
    spacing: spacing,
    alignItems: alignItems,
    justifyContent: justifyContent,
    flexWrap: flexWrap,
    sx: sx,
    p: p,
    py: py,
    px: px,
    pb: pb,
    pl: pl,
    mt: mt,
    minWidth: minWidth,
    maxWidth: maxWidth,
    height: height,
    minHeight: minHeight,
    width: width,
    borderBottom: borderBottom,
    borderColor: borderColor,
    bgcolor: bgcolor,
    gap: gap,
    mb: mb,
    flexGrow: flexGrow,
    flex: flex,
    textAlign: textAlign,
    onMouseLeave: onMouseLeave,
    m: m
  }, children);
};
/* harmony default export */ var standard_Stack_Stack = ((/* unused pure expression or super */ null && (Stack_Stack)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Stack/StackProps.ts
var StackProps_Direction = /*#__PURE__*/function (Direction) {
  Direction["ROW"] = "row";
  Direction["ROW_REVERSE"] = "row-reverse";
  Direction["COLUMN"] = "column";
  Direction["COLUMN_REVERSE"] = "column-reverse";
  return Direction;
}({});
var StackProps_AlignItems = /*#__PURE__*/function (AlignItems) {
  AlignItems["FLEX_START"] = "flex-start";
  AlignItems["CENTER"] = "center";
  AlignItems["FLEX_END"] = "flex-end";
  AlignItems["STRETCH"] = "stretch";
  AlignItems["BASELINE"] = "baseline";
  return AlignItems;
}({});
var StackProps_JustifyContent = /*#__PURE__*/function (JustifyContent) {
  JustifyContent["FLEX_START"] = "flex-start";
  JustifyContent["CENTER"] = "center";
  JustifyContent["FLEX_END"] = "flex-end";
  JustifyContent["SPACE_BETWEEN"] = "space-between";
  JustifyContent["SPACE_AROUND"] = "space-around";
  JustifyContent["SPACE_EVENLY"] = "space-evenly";
  return JustifyContent;
}({});
var FlexWrap = /*#__PURE__*/function (FlexWrap) {
  FlexWrap["NO_WRAP"] = "nowrap";
  FlexWrap["WRAP"] = "wrap";
  FlexWrap["WRAP_REVERSE"] = "wrap-reverse";
  return FlexWrap;
}({});
var StackProps_Colors = /*#__PURE__*/function (Colors) {
  Colors["GREY50"] = "grey.50";
  Colors["GREY100"] = "grey.100";
  Colors["GREY200"] = "grey.200";
  Colors["WHITE_TRANSPARENT"] = "rgba(255, 255, 255, 0.85)";
  return Colors;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Stack/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Typography/Typography.tsx


/**
 *
 * Demos:
 *
 * - [Typography](https://mui.com/material-ui/react-typography/)
 *
 * API:
 *
 * - [Typography API](https://mui.com/material-ui/api/typography/)
 */
var Typography_Typography = function Typography(props) {
  return /*#__PURE__*/React.createElement(MuiTypography, {
    onClick: props.onClick,
    align: props.align,
    variant: props.variant,
    color: props.color,
    display: props.display,
    sx: props.sx,
    classes: props.classes,
    noWrap: props.noWrap,
    tabIndex: props.tabIndex
  }, props.children);
};
/* harmony default export */ var standard_Typography_Typography = ((/* unused pure expression or super */ null && (Typography_Typography)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Typography/TypographyProps.ts

var Aligns = /*#__PURE__*/function (Aligns) {
  Aligns["CENTER"] = "center";
  Aligns["INHERIT"] = "inherit";
  Aligns["JUSTIFY"] = "justify";
  Aligns["LEFT"] = "left";
  Aligns["RIGHT"] = "right";
  return Aligns;
}({});
var TypographyProps_Colors = /*#__PURE__*/function (Colors) {
  Colors["PRIMARY"] = "text.primary";
  Colors["SECONDARY"] = "text.secondary";
  Colors["DISABLED"] = "text.disabled";
  Colors["SUCCESS"] = "text.success";
  Colors["ERROR"] = "text.error";
  Colors["INHERIT"] = "inherit";
  return Colors;
}({});
var TypographyProps_Variants = /*#__PURE__*/function (Variants) {
  Variants["BODY1"] = "body1";
  Variants["BODY2"] = "body2";
  Variants["SUBTITLE1"] = "subtitle1";
  Variants["SUBTITLE2"] = "subtitle2";
  Variants["CAPTION"] = "caption";
  Variants["OVERLINE"] = "overline";
  Variants["MORE_INFO"] = "moreInfo";
  Variants["H1"] = "h1";
  Variants["H2"] = "h2";
  Variants["H3"] = "h3";
  Variants["H4"] = "h4";
  Variants["H5"] = "h5";
  Variants["H6"] = "h6";
  return Variants;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/zero-styled/index.js



// eslint-disable-next-line @typescript-eslint/no-unused-vars
function createUseThemeProps(name) {
  return useThemeProps/* default */.A;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useSlot.js
'use client';



const useSlot_excluded = ["className", "elementType", "ownerState", "externalForwardedProps", "getSlotOwnerState", "internalForwardedProps"],
  _excluded2 = ["component", "slots", "slotProps"],
  _excluded3 = ["component"];


/**
 * An internal function to create a Material UI slot.
 *
 * This is an advanced version of Base UI `useSlotProps` because Material UI allows leaf component to be customized via `component` prop
 * while Base UI does not need to support leaf component customization.
 *
 * @param {string} name: name of the slot
 * @param {object} parameters
 * @returns {[Slot, slotProps]} The slot's React component and the slot's props
 *
 * Note: the returned slot's props
 * - will never contain `component` prop.
 * - might contain `as` prop.
 */
function useSlot(
/**
 * The slot's name. All Material UI components should have `root` slot.
 *
 * If the name is `root`, the logic behaves differently from other slots,
 * e.g. the `externalForwardedProps` are spread to `root` slot but not other slots.
 */
name, parameters) {
  const {
      className,
      elementType: initialElementType,
      ownerState,
      externalForwardedProps,
      getSlotOwnerState,
      internalForwardedProps
    } = parameters,
    useSlotPropsParams = (0,objectWithoutPropertiesLoose/* default */.A)(parameters, useSlot_excluded);
  const {
      component: rootComponent,
      slots = {
        [name]: undefined
      },
      slotProps = {
        [name]: undefined
      }
    } = externalForwardedProps,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(externalForwardedProps, _excluded2);
  const elementType = slots[name] || initialElementType;

  // `slotProps[name]` can be a callback that receives the component's ownerState.
  // `resolvedComponentsProps` is always a plain object.
  const resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);
  const _mergeSlotProps = mergeSlotProps((0,esm_extends/* default */.A)({
      className
    }, useSlotPropsParams, {
      externalForwardedProps: name === 'root' ? other : undefined,
      externalSlotProps: resolvedComponentsProps
    })),
    {
      props: {
        component: slotComponent
      },
      internalRef
    } = _mergeSlotProps,
    mergedProps = (0,objectWithoutPropertiesLoose/* default */.A)(_mergeSlotProps.props, _excluded3);
  const ref = (0,useForkRef_useForkRef/* default */.A)(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref);
  const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};
  const finalOwnerState = (0,esm_extends/* default */.A)({}, ownerState, slotOwnerState);
  const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;
  const props = appendOwnerState(elementType, (0,esm_extends/* default */.A)({}, name === 'root' && !rootComponent && !slots[name] && internalForwardedProps, name !== 'root' && !slots[name] && internalForwardedProps, mergedProps, LeafComponent && {
    as: LeafComponent
  }, {
    ref
  }), finalOwnerState);
  Object.keys(slotOwnerState).forEach(propName => {
    delete props[propName];
  });
  return [elementType, props];
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Alert/alertClasses.js


function getAlertUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiAlert', slot);
}
const alertClasses = (0,generateUtilityClasses/* default */.A)('MuiAlert', ['root', 'action', 'icon', 'message', 'filled', 'colorSuccess', 'colorInfo', 'colorWarning', 'colorError', 'filledSuccess', 'filledInfo', 'filledWarning', 'filledError', 'outlined', 'outlinedSuccess', 'outlinedInfo', 'outlinedWarning', 'outlinedError', 'standard', 'standardSuccess', 'standardInfo', 'standardWarning', 'standardError']);
/* harmony default export */ var Alert_alertClasses = (alertClasses);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useEventCallback.js
var utils_useEventCallback = __webpack_require__(1476);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useIsFocusVisible.js + 1 modules
var utils_useIsFocusVisible = __webpack_require__(7266);
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/@emotion/react/dist/emotion-react.browser.esm.js
var emotion_react_browser_esm = __webpack_require__(8361);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/useTimeout/useTimeout.js + 2 modules
var useTimeout = __webpack_require__(478);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/ButtonBase/Ripple.js
'use client';





/**
 * @ignore - internal component.
 */

function Ripple_Ripple(props) {
  const {
    className,
    classes,
    pulsate = false,
    rippleX,
    rippleY,
    rippleSize,
    in: inProp,
    onExited,
    timeout
  } = props;
  const [leaving, setLeaving] = react.useState(false);
  const rippleClassName = (0,clsx_m/* default */.A)(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
  const rippleStyles = {
    width: rippleSize,
    height: rippleSize,
    top: -(rippleSize / 2) + rippleY,
    left: -(rippleSize / 2) + rippleX
  };
  const childClassName = (0,clsx_m/* default */.A)(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
  if (!inProp && !leaving) {
    setLeaving(true);
  }
  react.useEffect(() => {
    if (!inProp && onExited != null) {
      // react-transition-group#onExited
      const timeoutId = setTimeout(onExited, timeout);
      return () => {
        clearTimeout(timeoutId);
      };
    }
    return undefined;
  }, [onExited, inProp, timeout]);
  return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
    className: rippleClassName,
    style: rippleStyles,
    children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
      className: childClassName
    })
  });
}
 false ? 0 : void 0;
/* harmony default export */ var material_ButtonBase_Ripple = (Ripple_Ripple);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/ButtonBase/touchRippleClasses.js


function getTouchRippleUtilityClass(slot) {
  return generateUtilityClass('MuiTouchRipple', slot);
}
const touchRippleClasses = (0,generateUtilityClasses/* default */.A)('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);
/* harmony default export */ var ButtonBase_touchRippleClasses = (touchRippleClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/ButtonBase/TouchRipple.js
'use client';



const TouchRipple_excluded = ["center", "classes", "className"];
let TouchRipple_ = t => t,
  _t,
  _t2,
  _t3,
  _t4;











const TouchRipple_DURATION = 550;
const TouchRipple_DELAY_RIPPLE = 80;
const enterKeyframe = (0,emotion_react_browser_esm/* keyframes */.i7)(_t || (_t = TouchRipple_`
  0% {
    transform: scale(0);
    opacity: 0.1;
  }

  100% {
    transform: scale(1);
    opacity: 0.3;
  }
`));
const exitKeyframe = (0,emotion_react_browser_esm/* keyframes */.i7)(_t2 || (_t2 = TouchRipple_`
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
`));
const pulsateKeyframe = (0,emotion_react_browser_esm/* keyframes */.i7)(_t3 || (_t3 = TouchRipple_`
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.92);
  }

  100% {
    transform: scale(1);
  }
`));
const TouchRippleRoot = (0,styled/* default */.Ay)('span', {
  name: 'MuiTouchRipple',
  slot: 'Root'
})({
  overflow: 'hidden',
  pointerEvents: 'none',
  position: 'absolute',
  zIndex: 0,
  top: 0,
  right: 0,
  bottom: 0,
  left: 0,
  borderRadius: 'inherit'
});

// This `styled()` function invokes keyframes. `styled-components` only supports keyframes
// in string templates. Do not convert these styles in JS object as it will break.
const TouchRippleRipple = (0,styled/* default */.Ay)(material_ButtonBase_Ripple, {
  name: 'MuiTouchRipple',
  slot: 'Ripple'
})(_t4 || (_t4 = TouchRipple_`
  opacity: 0;
  position: absolute;

  &.${0} {
    opacity: 0.3;
    transform: scale(1);
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }

  &.${0} {
    animation-duration: ${0}ms;
  }

  & .${0} {
    opacity: 1;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: currentColor;
  }

  & .${0} {
    opacity: 0;
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }

  & .${0} {
    position: absolute;
    /* @noflip */
    left: 0px;
    top: 0;
    animation-name: ${0};
    animation-duration: 2500ms;
    animation-timing-function: ${0};
    animation-iteration-count: infinite;
    animation-delay: 200ms;
  }
`), ButtonBase_touchRippleClasses.rippleVisible, enterKeyframe, TouchRipple_DURATION, ({
  theme
}) => theme.transitions.easing.easeInOut, ButtonBase_touchRippleClasses.ripplePulsate, ({
  theme
}) => theme.transitions.duration.shorter, ButtonBase_touchRippleClasses.child, ButtonBase_touchRippleClasses.childLeaving, exitKeyframe, TouchRipple_DURATION, ({
  theme
}) => theme.transitions.easing.easeInOut, ButtonBase_touchRippleClasses.childPulsate, pulsateKeyframe, ({
  theme
}) => theme.transitions.easing.easeInOut);

/**
 * @ignore - internal component.
 *
 * TODO v5: Make private
 */
const TouchRipple_TouchRipple = /*#__PURE__*/react.forwardRef(function TouchRipple(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiTouchRipple'
  });
  const {
      center: centerProp = false,
      classes = {},
      className
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, TouchRipple_excluded);
  const [ripples, setRipples] = react.useState([]);
  const nextKey = react.useRef(0);
  const rippleCallback = react.useRef(null);
  react.useEffect(() => {
    if (rippleCallback.current) {
      rippleCallback.current();
      rippleCallback.current = null;
    }
  }, [ripples]);

  // Used to filter out mouse emulated events on mobile.
  const ignoringMouseDown = react.useRef(false);
  // We use a timer in order to only show the ripples for touch "click" like events.
  // We don't want to display the ripple for touch scroll events.
  const startTimer = (0,useTimeout/* default */.A)();

  // This is the hook called once the previous timeout is ready.
  const startTimerCommit = react.useRef(null);
  const container = react.useRef(null);
  const startCommit = react.useCallback(params => {
    const {
      pulsate,
      rippleX,
      rippleY,
      rippleSize,
      cb
    } = params;
    setRipples(oldRipples => [...oldRipples, /*#__PURE__*/(0,jsx_runtime.jsx)(TouchRippleRipple, {
      classes: {
        ripple: (0,clsx_m/* default */.A)(classes.ripple, ButtonBase_touchRippleClasses.ripple),
        rippleVisible: (0,clsx_m/* default */.A)(classes.rippleVisible, ButtonBase_touchRippleClasses.rippleVisible),
        ripplePulsate: (0,clsx_m/* default */.A)(classes.ripplePulsate, ButtonBase_touchRippleClasses.ripplePulsate),
        child: (0,clsx_m/* default */.A)(classes.child, ButtonBase_touchRippleClasses.child),
        childLeaving: (0,clsx_m/* default */.A)(classes.childLeaving, ButtonBase_touchRippleClasses.childLeaving),
        childPulsate: (0,clsx_m/* default */.A)(classes.childPulsate, ButtonBase_touchRippleClasses.childPulsate)
      },
      timeout: TouchRipple_DURATION,
      pulsate: pulsate,
      rippleX: rippleX,
      rippleY: rippleY,
      rippleSize: rippleSize
    }, nextKey.current)]);
    nextKey.current += 1;
    rippleCallback.current = cb;
  }, [classes]);
  const start = react.useCallback((event = {}, options = {}, cb = () => {}) => {
    const {
      pulsate = false,
      center = centerProp || options.pulsate,
      fakeElement = false // For test purposes
    } = options;
    if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) {
      ignoringMouseDown.current = false;
      return;
    }
    if ((event == null ? void 0 : event.type) === 'touchstart') {
      ignoringMouseDown.current = true;
    }
    const element = fakeElement ? null : container.current;
    const rect = element ? element.getBoundingClientRect() : {
      width: 0,
      height: 0,
      left: 0,
      top: 0
    };

    // Get the size of the ripple
    let rippleX;
    let rippleY;
    let rippleSize;
    if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
      rippleX = Math.round(rect.width / 2);
      rippleY = Math.round(rect.height / 2);
    } else {
      const {
        clientX,
        clientY
      } = event.touches && event.touches.length > 0 ? event.touches[0] : event;
      rippleX = Math.round(clientX - rect.left);
      rippleY = Math.round(clientY - rect.top);
    }
    if (center) {
      rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);

      // For some reason the animation is broken on Mobile Chrome if the size is even.
      if (rippleSize % 2 === 0) {
        rippleSize += 1;
      }
    } else {
      const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
      const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
      rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);
    }

    // Touche devices
    if (event != null && event.touches) {
      // check that this isn't another touchstart due to multitouch
      // otherwise we will only clear a single timer when unmounting while two
      // are running
      if (startTimerCommit.current === null) {
        // Prepare the ripple effect.
        startTimerCommit.current = () => {
          startCommit({
            pulsate,
            rippleX,
            rippleY,
            rippleSize,
            cb
          });
        };
        // Delay the execution of the ripple effect.
        // We have to make a tradeoff with this delay value.
        startTimer.start(TouchRipple_DELAY_RIPPLE, () => {
          if (startTimerCommit.current) {
            startTimerCommit.current();
            startTimerCommit.current = null;
          }
        });
      }
    } else {
      startCommit({
        pulsate,
        rippleX,
        rippleY,
        rippleSize,
        cb
      });
    }
  }, [centerProp, startCommit, startTimer]);
  const pulsate = react.useCallback(() => {
    start({}, {
      pulsate: true
    });
  }, [start]);
  const stop = react.useCallback((event, cb) => {
    startTimer.clear();

    // The touch interaction occurs too quickly.
    // We still want to show ripple effect.
    if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {
      startTimerCommit.current();
      startTimerCommit.current = null;
      startTimer.start(0, () => {
        stop(event, cb);
      });
      return;
    }
    startTimerCommit.current = null;
    setRipples(oldRipples => {
      if (oldRipples.length > 0) {
        return oldRipples.slice(1);
      }
      return oldRipples;
    });
    rippleCallback.current = cb;
  }, [startTimer]);
  react.useImperativeHandle(ref, () => ({
    pulsate,
    start,
    stop
  }), [pulsate, start, stop]);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(TouchRippleRoot, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(ButtonBase_touchRippleClasses.root, classes.root, className),
    ref: container
  }, other, {
    children: /*#__PURE__*/(0,jsx_runtime.jsx)(esm_TransitionGroup, {
      component: null,
      exit: true,
      children: ripples
    })
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var material_ButtonBase_TouchRipple = (TouchRipple_TouchRipple);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/ButtonBase/buttonBaseClasses.js


function getButtonBaseUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiButtonBase', slot);
}
const buttonBaseClasses = (0,generateUtilityClasses/* default */.A)('MuiButtonBase', ['root', 'disabled', 'focusVisible']);
/* harmony default export */ var ButtonBase_buttonBaseClasses = (buttonBaseClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/ButtonBase/ButtonBase.js
'use client';



const ButtonBase_excluded = ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"];















const ButtonBase_useUtilityClasses = ownerState => {
  const {
    disabled,
    focusVisible,
    focusVisibleClassName,
    classes
  } = ownerState;
  const slots = {
    root: ['root', disabled && 'disabled', focusVisible && 'focusVisible']
  };
  const composedClasses = (0,composeClasses/* default */.A)(slots, getButtonBaseUtilityClass, classes);
  if (focusVisible && focusVisibleClassName) {
    composedClasses.root += ` ${focusVisibleClassName}`;
  }
  return composedClasses;
};
const ButtonBaseRoot = (0,styled/* default */.Ay)('button', {
  name: 'MuiButtonBase',
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
})({
  display: 'inline-flex',
  alignItems: 'center',
  justifyContent: 'center',
  position: 'relative',
  boxSizing: 'border-box',
  WebkitTapHighlightColor: 'transparent',
  backgroundColor: 'transparent',
  // Reset default value
  // We disable the focus ring for mouse, touch and keyboard users.
  outline: 0,
  border: 0,
  margin: 0,
  // Remove the margin in Safari
  borderRadius: 0,
  padding: 0,
  // Remove the padding in Firefox
  cursor: 'pointer',
  userSelect: 'none',
  verticalAlign: 'middle',
  MozAppearance: 'none',
  // Reset
  WebkitAppearance: 'none',
  // Reset
  textDecoration: 'none',
  // So we take precedent over the style of a native <a /> element.
  color: 'inherit',
  '&::-moz-focus-inner': {
    borderStyle: 'none' // Remove Firefox dotted outline.
  },
  [`&.${ButtonBase_buttonBaseClasses.disabled}`]: {
    pointerEvents: 'none',
    // Disable link interactions
    cursor: 'default'
  },
  '@media print': {
    colorAdjust: 'exact'
  }
});

/**
 * `ButtonBase` contains as few styles as possible.
 * It aims to be a simple building block for creating a button.
 * It contains a load of style reset and some focus/ripple logic.
 */
const ButtonBase_ButtonBase_ButtonBase = /*#__PURE__*/react.forwardRef(function ButtonBase(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiButtonBase'
  });
  const {
      action,
      centerRipple = false,
      children,
      className,
      component = 'button',
      disabled = false,
      disableRipple = false,
      disableTouchRipple = false,
      focusRipple = false,
      LinkComponent = 'a',
      onBlur,
      onClick,
      onContextMenu,
      onDragLeave,
      onFocus,
      onFocusVisible,
      onKeyDown,
      onKeyUp,
      onMouseDown,
      onMouseLeave,
      onMouseUp,
      onTouchEnd,
      onTouchMove,
      onTouchStart,
      tabIndex = 0,
      TouchRippleProps,
      touchRippleRef,
      type
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, ButtonBase_excluded);
  const buttonRef = react.useRef(null);
  const rippleRef = react.useRef(null);
  const handleRippleRef = (0,utils_useForkRef/* default */.A)(rippleRef, touchRippleRef);
  const {
    isFocusVisibleRef,
    onFocus: handleFocusVisible,
    onBlur: handleBlurVisible,
    ref: focusVisibleRef
  } = (0,utils_useIsFocusVisible/* default */.A)();
  const [focusVisible, setFocusVisible] = react.useState(false);
  if (disabled && focusVisible) {
    setFocusVisible(false);
  }
  react.useImperativeHandle(action, () => ({
    focusVisible: () => {
      setFocusVisible(true);
      buttonRef.current.focus();
    }
  }), []);
  const [mountedState, setMountedState] = react.useState(false);
  react.useEffect(() => {
    setMountedState(true);
  }, []);
  const enableTouchRipple = mountedState && !disableRipple && !disabled;
  react.useEffect(() => {
    if (focusVisible && focusRipple && !disableRipple && mountedState) {
      rippleRef.current.pulsate();
    }
  }, [disableRipple, focusRipple, focusVisible, mountedState]);
  function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {
    return (0,utils_useEventCallback/* default */.A)(event => {
      if (eventCallback) {
        eventCallback(event);
      }
      const ignore = skipRippleAction;
      if (!ignore && rippleRef.current) {
        rippleRef.current[rippleAction](event);
      }
      return true;
    });
  }
  const handleMouseDown = useRippleHandler('start', onMouseDown);
  const handleContextMenu = useRippleHandler('stop', onContextMenu);
  const handleDragLeave = useRippleHandler('stop', onDragLeave);
  const handleMouseUp = useRippleHandler('stop', onMouseUp);
  const handleMouseLeave = useRippleHandler('stop', event => {
    if (focusVisible) {
      event.preventDefault();
    }
    if (onMouseLeave) {
      onMouseLeave(event);
    }
  });
  const handleTouchStart = useRippleHandler('start', onTouchStart);
  const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
  const handleTouchMove = useRippleHandler('stop', onTouchMove);
  const handleBlur = useRippleHandler('stop', event => {
    handleBlurVisible(event);
    if (isFocusVisibleRef.current === false) {
      setFocusVisible(false);
    }
    if (onBlur) {
      onBlur(event);
    }
  }, false);
  const handleFocus = (0,utils_useEventCallback/* default */.A)(event => {
    // Fix for https://github.com/facebook/react/issues/7769
    if (!buttonRef.current) {
      buttonRef.current = event.currentTarget;
    }
    handleFocusVisible(event);
    if (isFocusVisibleRef.current === true) {
      setFocusVisible(true);
      if (onFocusVisible) {
        onFocusVisible(event);
      }
    }
    if (onFocus) {
      onFocus(event);
    }
  });
  const isNonNativeButton = () => {
    const button = buttonRef.current;
    return component && component !== 'button' && !(button.tagName === 'A' && button.href);
  };

  /**
   * IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
   */
  const keydownRef = react.useRef(false);
  const handleKeyDown = (0,utils_useEventCallback/* default */.A)(event => {
    // Check if key is already down to avoid repeats being counted as multiple activations
    if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {
      keydownRef.current = true;
      rippleRef.current.stop(event, () => {
        rippleRef.current.start(event);
      });
    }
    if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
      event.preventDefault();
    }
    if (onKeyDown) {
      onKeyDown(event);
    }

    // Keyboard accessibility for non interactive elements
    if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
      event.preventDefault();
      if (onClick) {
        onClick(event);
      }
    }
  });
  const handleKeyUp = (0,utils_useEventCallback/* default */.A)(event => {
    // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
    // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0
    if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
      keydownRef.current = false;
      rippleRef.current.stop(event, () => {
        rippleRef.current.pulsate(event);
      });
    }
    if (onKeyUp) {
      onKeyUp(event);
    }

    // Keyboard accessibility for non interactive elements
    if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) {
      onClick(event);
    }
  });
  let ComponentProp = component;
  if (ComponentProp === 'button' && (other.href || other.to)) {
    ComponentProp = LinkComponent;
  }
  const buttonProps = {};
  if (ComponentProp === 'button') {
    buttonProps.type = type === undefined ? 'button' : type;
    buttonProps.disabled = disabled;
  } else {
    if (!other.href && !other.to) {
      buttonProps.role = 'button';
    }
    if (disabled) {
      buttonProps['aria-disabled'] = disabled;
    }
  }
  const handleRef = (0,utils_useForkRef/* default */.A)(ref, focusVisibleRef, buttonRef);
  if (false) {}
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    centerRipple,
    component,
    disabled,
    disableRipple,
    disableTouchRipple,
    focusRipple,
    tabIndex,
    focusVisible
  });
  const classes = ButtonBase_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(ButtonBaseRoot, (0,esm_extends/* default */.A)({
    as: ComponentProp,
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ownerState: ownerState,
    onBlur: handleBlur,
    onClick: onClick,
    onContextMenu: handleContextMenu,
    onFocus: handleFocus,
    onKeyDown: handleKeyDown,
    onKeyUp: handleKeyUp,
    onMouseDown: handleMouseDown,
    onMouseLeave: handleMouseLeave,
    onMouseUp: handleMouseUp,
    onDragLeave: handleDragLeave,
    onTouchEnd: handleTouchEnd,
    onTouchMove: handleTouchMove,
    onTouchStart: handleTouchStart,
    ref: handleRef,
    tabIndex: disabled ? -1 : tabIndex,
    type: type
  }, buttonProps, other, {
    children: [children, enableTouchRipple ?
    /*#__PURE__*/
    /* TouchRipple is only needed client-side, x2 boost on the server. */
    (0,jsx_runtime.jsx)(material_ButtonBase_TouchRipple, (0,esm_extends/* default */.A)({
      ref: handleRippleRef,
      center: centerRipple
    }, TouchRippleProps)) : null]
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var material_ButtonBase_ButtonBase = (ButtonBase_ButtonBase_ButtonBase);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/IconButton/iconButtonClasses.js


function getIconButtonUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiIconButton', slot);
}
const iconButtonClasses = (0,generateUtilityClasses/* default */.A)('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge']);
/* harmony default export */ var IconButton_iconButtonClasses = (iconButtonClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/IconButton/IconButton.js
'use client';



const IconButton_excluded = ["edge", "children", "className", "color", "disabled", "disableFocusRipple", "size"];












const IconButton_useUtilityClasses = ownerState => {
  const {
    classes,
    disabled,
    color,
    edge,
    size
  } = ownerState;
  const slots = {
    root: ['root', disabled && 'disabled', color !== 'default' && `color${(0,utils_capitalize/* default */.A)(color)}`, edge && `edge${(0,utils_capitalize/* default */.A)(edge)}`, `size${(0,utils_capitalize/* default */.A)(size)}`]
  };
  return (0,composeClasses/* default */.A)(slots, getIconButtonUtilityClass, classes);
};
const IconButtonRoot = (0,styled/* default */.Ay)(material_ButtonBase_ButtonBase, {
  name: 'MuiIconButton',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, ownerState.color !== 'default' && styles[`color${(0,utils_capitalize/* default */.A)(ownerState.color)}`], ownerState.edge && styles[`edge${(0,utils_capitalize/* default */.A)(ownerState.edge)}`], styles[`size${(0,utils_capitalize/* default */.A)(ownerState.size)}`]];
  }
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  textAlign: 'center',
  flex: '0 0 auto',
  fontSize: theme.typography.pxToRem(24),
  padding: 8,
  borderRadius: '50%',
  overflow: 'visible',
  // Explicitly set the default value to solve a bug on IE11.
  color: (theme.vars || theme).palette.action.active,
  transition: theme.transitions.create('background-color', {
    duration: theme.transitions.duration.shortest
  })
}, !ownerState.disableRipple && {
  '&:hover': {
    backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.activeChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0,colorManipulator/* alpha */.X4)(theme.palette.action.active, theme.palette.action.hoverOpacity),
    // Reset on touch devices, it doesn't add specificity
    '@media (hover: none)': {
      backgroundColor: 'transparent'
    }
  }
}, ownerState.edge === 'start' && {
  marginLeft: ownerState.size === 'small' ? -3 : -12
}, ownerState.edge === 'end' && {
  marginRight: ownerState.size === 'small' ? -3 : -12
}), ({
  theme,
  ownerState
}) => {
  var _palette;
  const palette = (_palette = (theme.vars || theme).palette) == null ? void 0 : _palette[ownerState.color];
  return (0,esm_extends/* default */.A)({}, ownerState.color === 'inherit' && {
    color: 'inherit'
  }, ownerState.color !== 'inherit' && ownerState.color !== 'default' && (0,esm_extends/* default */.A)({
    color: palette == null ? void 0 : palette.main
  }, !ownerState.disableRipple && {
    '&:hover': (0,esm_extends/* default */.A)({}, palette && {
      backgroundColor: theme.vars ? `rgba(${palette.mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0,colorManipulator/* alpha */.X4)(palette.main, theme.palette.action.hoverOpacity)
    }, {
      // Reset on touch devices, it doesn't add specificity
      '@media (hover: none)': {
        backgroundColor: 'transparent'
      }
    })
  }), ownerState.size === 'small' && {
    padding: 5,
    fontSize: theme.typography.pxToRem(18)
  }, ownerState.size === 'large' && {
    padding: 12,
    fontSize: theme.typography.pxToRem(28)
  }, {
    [`&.${IconButton_iconButtonClasses.disabled}`]: {
      backgroundColor: 'transparent',
      color: (theme.vars || theme).palette.action.disabled
    }
  });
});

/**
 * Refer to the [Icons](/material-ui/icons/) section of the documentation
 * regarding the available icon options.
 */
const IconButton_IconButton = /*#__PURE__*/react.forwardRef(function IconButton(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiIconButton'
  });
  const {
      edge = false,
      children,
      className,
      color = 'default',
      disabled = false,
      disableFocusRipple = false,
      size = 'medium'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, IconButton_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    edge,
    color,
    disabled,
    disableFocusRipple,
    size
  });
  const classes = IconButton_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(IconButtonRoot, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className),
    centerRipple: true,
    focusRipple: !disableFocusRipple,
    disabled: disabled,
    ref: ref
  }, other, {
    ownerState: ownerState,
    children: children
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var material_IconButton_IconButton = (IconButton_IconButton);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/createSvgIcon.js + 2 modules
var createSvgIcon = __webpack_require__(793);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/internal/svg-icons/SuccessOutlined.js
'use client';




/**
 * @ignore - internal component.
 */

/* harmony default export */ var SuccessOutlined = ((0,createSvgIcon/* default */.A)( /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
  d: "M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"
}), 'SuccessOutlined'));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/internal/svg-icons/ReportProblemOutlined.js
'use client';




/**
 * @ignore - internal component.
 */

/* harmony default export */ var ReportProblemOutlined = ((0,createSvgIcon/* default */.A)( /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
  d: "M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"
}), 'ReportProblemOutlined'));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/internal/svg-icons/ErrorOutline.js
'use client';




/**
 * @ignore - internal component.
 */

/* harmony default export */ var ErrorOutline = ((0,createSvgIcon/* default */.A)( /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
  d: "M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
}), 'ErrorOutline'));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/internal/svg-icons/InfoOutlined.js
'use client';




/**
 * @ignore - internal component.
 */

/* harmony default export */ var InfoOutlined = ((0,createSvgIcon/* default */.A)( /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
  d: "M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"
}), 'InfoOutlined'));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/internal/svg-icons/Close.js
'use client';




/**
 * @ignore - internal component.
 *
 * Alias to `Clear`.
 */

/* harmony default export */ var svg_icons_Close = ((0,createSvgIcon/* default */.A)( /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
}), 'Close'));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Alert/Alert.js
'use client';



const Alert_excluded = ["action", "children", "className", "closeText", "color", "components", "componentsProps", "icon", "iconMapping", "onClose", "role", "severity", "slotProps", "slots", "variant"];


















const Alert_useThemeProps = createUseThemeProps('MuiAlert');
const Alert_useUtilityClasses = ownerState => {
  const {
    variant,
    color,
    severity,
    classes
  } = ownerState;
  const slots = {
    root: ['root', `color${(0,utils_capitalize/* default */.A)(color || severity)}`, `${variant}${(0,utils_capitalize/* default */.A)(color || severity)}`, `${variant}`],
    icon: ['icon'],
    message: ['message'],
    action: ['action']
  };
  return (0,composeClasses/* default */.A)(slots, getAlertUtilityClass, classes);
};
const AlertRoot = (0,styled/* default */.Ay)(material_Paper_Paper, {
  name: 'MuiAlert',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, styles[ownerState.variant], styles[`${ownerState.variant}${(0,utils_capitalize/* default */.A)(ownerState.color || ownerState.severity)}`]];
  }
})(({
  theme
}) => {
  const getColor = theme.palette.mode === 'light' ? colorManipulator/* darken */.e$ : colorManipulator/* lighten */.a;
  const getBackgroundColor = theme.palette.mode === 'light' ? colorManipulator/* lighten */.a : colorManipulator/* darken */.e$;
  return (0,esm_extends/* default */.A)({}, theme.typography.body2, {
    backgroundColor: 'transparent',
    display: 'flex',
    padding: '6px 16px',
    variants: [...Object.entries(theme.palette).filter(([, value]) => value.main && value.light).map(([color]) => ({
      props: {
        colorSeverity: color,
        variant: 'standard'
      },
      style: {
        color: theme.vars ? theme.vars.palette.Alert[`${color}Color`] : getColor(theme.palette[color].light, 0.6),
        backgroundColor: theme.vars ? theme.vars.palette.Alert[`${color}StandardBg`] : getBackgroundColor(theme.palette[color].light, 0.9),
        [`& .${Alert_alertClasses.icon}`]: theme.vars ? {
          color: theme.vars.palette.Alert[`${color}IconColor`]
        } : {
          color: theme.palette[color].main
        }
      }
    })), ...Object.entries(theme.palette).filter(([, value]) => value.main && value.light).map(([color]) => ({
      props: {
        colorSeverity: color,
        variant: 'outlined'
      },
      style: {
        color: theme.vars ? theme.vars.palette.Alert[`${color}Color`] : getColor(theme.palette[color].light, 0.6),
        border: `1px solid ${(theme.vars || theme).palette[color].light}`,
        [`& .${Alert_alertClasses.icon}`]: theme.vars ? {
          color: theme.vars.palette.Alert[`${color}IconColor`]
        } : {
          color: theme.palette[color].main
        }
      }
    })), ...Object.entries(theme.palette).filter(([, value]) => value.main && value.dark).map(([color]) => ({
      props: {
        colorSeverity: color,
        variant: 'filled'
      },
      style: (0,esm_extends/* default */.A)({
        fontWeight: theme.typography.fontWeightMedium
      }, theme.vars ? {
        color: theme.vars.palette.Alert[`${color}FilledColor`],
        backgroundColor: theme.vars.palette.Alert[`${color}FilledBg`]
      } : {
        backgroundColor: theme.palette.mode === 'dark' ? theme.palette[color].dark : theme.palette[color].main,
        color: theme.palette.getContrastText(theme.palette[color].main)
      })
    }))]
  });
});
const AlertIcon = (0,styled/* default */.Ay)('div', {
  name: 'MuiAlert',
  slot: 'Icon',
  overridesResolver: (props, styles) => styles.icon
})({
  marginRight: 12,
  padding: '7px 0',
  display: 'flex',
  fontSize: 22,
  opacity: 0.9
});
const AlertMessage = (0,styled/* default */.Ay)('div', {
  name: 'MuiAlert',
  slot: 'Message',
  overridesResolver: (props, styles) => styles.message
})({
  padding: '8px 0',
  minWidth: 0,
  overflow: 'auto'
});
const AlertAction = (0,styled/* default */.Ay)('div', {
  name: 'MuiAlert',
  slot: 'Action',
  overridesResolver: (props, styles) => styles.action
})({
  display: 'flex',
  alignItems: 'flex-start',
  padding: '4px 0 0 16px',
  marginLeft: 'auto',
  marginRight: -8
});
const defaultIconMapping = {
  success: /*#__PURE__*/(0,jsx_runtime.jsx)(SuccessOutlined, {
    fontSize: "inherit"
  }),
  warning: /*#__PURE__*/(0,jsx_runtime.jsx)(ReportProblemOutlined, {
    fontSize: "inherit"
  }),
  error: /*#__PURE__*/(0,jsx_runtime.jsx)(ErrorOutline, {
    fontSize: "inherit"
  }),
  info: /*#__PURE__*/(0,jsx_runtime.jsx)(InfoOutlined, {
    fontSize: "inherit"
  })
};
const Alert = /*#__PURE__*/react.forwardRef(function Alert(inProps, ref) {
  const props = Alert_useThemeProps({
    props: inProps,
    name: 'MuiAlert'
  });
  const {
      action,
      children,
      className,
      closeText = 'Close',
      color,
      components = {},
      componentsProps = {},
      icon,
      iconMapping = defaultIconMapping,
      onClose,
      role = 'alert',
      severity = 'success',
      slotProps = {},
      slots = {},
      variant = 'standard'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Alert_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    color,
    severity,
    variant,
    colorSeverity: color || severity
  });
  const classes = Alert_useUtilityClasses(ownerState);
  const externalForwardedProps = {
    slots: (0,esm_extends/* default */.A)({
      closeButton: components.CloseButton,
      closeIcon: components.CloseIcon
    }, slots),
    slotProps: (0,esm_extends/* default */.A)({}, componentsProps, slotProps)
  };
  const [CloseButtonSlot, closeButtonProps] = useSlot('closeButton', {
    elementType: material_IconButton_IconButton,
    externalForwardedProps,
    ownerState
  });
  const [CloseIconSlot, closeIconProps] = useSlot('closeIcon', {
    elementType: svg_icons_Close,
    externalForwardedProps,
    ownerState
  });
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(AlertRoot, (0,esm_extends/* default */.A)({
    role: role,
    elevation: 0,
    ownerState: ownerState,
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ref: ref
  }, other, {
    children: [icon !== false ? /*#__PURE__*/(0,jsx_runtime.jsx)(AlertIcon, {
      ownerState: ownerState,
      className: classes.icon,
      children: icon || iconMapping[severity] || defaultIconMapping[severity]
    }) : null, /*#__PURE__*/(0,jsx_runtime.jsx)(AlertMessage, {
      ownerState: ownerState,
      className: classes.message,
      children: children
    }), action != null ? /*#__PURE__*/(0,jsx_runtime.jsx)(AlertAction, {
      ownerState: ownerState,
      className: classes.action,
      children: action
    }) : null, action == null && onClose ? /*#__PURE__*/(0,jsx_runtime.jsx)(AlertAction, {
      ownerState: ownerState,
      className: classes.action,
      children: /*#__PURE__*/(0,jsx_runtime.jsx)(CloseButtonSlot, (0,esm_extends/* default */.A)({
        size: "small",
        "aria-label": closeText,
        title: closeText,
        color: "inherit",
        onClick: onClose
      }, closeButtonProps, {
        children: /*#__PURE__*/(0,jsx_runtime.jsx)(CloseIconSlot, (0,esm_extends/* default */.A)({
          fontSize: "small"
        }, closeIconProps))
      }))
    }) : null]
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var Alert_Alert = (Alert);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Typography/typographyClasses.js


function getTypographyUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiTypography', slot);
}
const typographyClasses = (0,generateUtilityClasses/* default */.A)('MuiTypography', ['root', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'inherit', 'button', 'caption', 'overline', 'alignLeft', 'alignRight', 'alignCenter', 'alignJustify', 'noWrap', 'gutterBottom', 'paragraph']);
/* harmony default export */ var Typography_typographyClasses = ((/* unused pure expression or super */ null && (typographyClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Typography/Typography.js
'use client';



const Typography_excluded = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"];










const Typography_useUtilityClasses = ownerState => {
  const {
    align,
    gutterBottom,
    noWrap,
    paragraph,
    variant,
    classes
  } = ownerState;
  const slots = {
    root: ['root', variant, ownerState.align !== 'inherit' && `align${(0,utils_capitalize/* default */.A)(align)}`, gutterBottom && 'gutterBottom', noWrap && 'noWrap', paragraph && 'paragraph']
  };
  return (0,composeClasses/* default */.A)(slots, getTypographyUtilityClass, classes);
};
const TypographyRoot = (0,styled/* default */.Ay)('span', {
  name: 'MuiTypography',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== 'inherit' && styles[`align${(0,utils_capitalize/* default */.A)(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];
  }
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  margin: 0
}, ownerState.variant === 'inherit' && {
  // Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
  font: 'inherit'
}, ownerState.variant !== 'inherit' && theme.typography[ownerState.variant], ownerState.align !== 'inherit' && {
  textAlign: ownerState.align
}, ownerState.noWrap && {
  overflow: 'hidden',
  textOverflow: 'ellipsis',
  whiteSpace: 'nowrap'
}, ownerState.gutterBottom && {
  marginBottom: '0.35em'
}, ownerState.paragraph && {
  marginBottom: 16
}));
const defaultVariantMapping = {
  h1: 'h1',
  h2: 'h2',
  h3: 'h3',
  h4: 'h4',
  h5: 'h5',
  h6: 'h6',
  subtitle1: 'h6',
  subtitle2: 'h6',
  body1: 'p',
  body2: 'p',
  inherit: 'p'
};

// TODO v6: deprecate these color values in v5.x and remove the transformation in v6
const colorTransformations = {
  primary: 'primary.main',
  textPrimary: 'text.primary',
  secondary: 'secondary.main',
  textSecondary: 'text.secondary',
  error: 'error.main'
};
const transformDeprecatedColors = color => {
  return colorTransformations[color] || color;
};
const Typography_Typography_Typography = /*#__PURE__*/react.forwardRef(function Typography(inProps, ref) {
  const themeProps = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiTypography'
  });
  const color = transformDeprecatedColors(themeProps.color);
  const props = (0,extendSxProp/* default */.A)((0,esm_extends/* default */.A)({}, themeProps, {
    color
  }));
  const {
      align = 'inherit',
      className,
      component,
      gutterBottom = false,
      noWrap = false,
      paragraph = false,
      variant = 'body1',
      variantMapping = defaultVariantMapping
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Typography_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    align,
    color,
    className,
    component,
    gutterBottom,
    noWrap,
    paragraph,
    variant,
    variantMapping
  });
  const Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';
  const classes = Typography_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(TypographyRoot, (0,esm_extends/* default */.A)({
    as: Component,
    ref: ref,
    ownerState: ownerState,
    className: (0,clsx_m/* default */.A)(classes.root, className)
  }, other));
});
 false ? 0 : void 0;
/* harmony default export */ var material_Typography_Typography = (Typography_Typography_Typography);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/AlertTitle/alertTitleClasses.js


function getAlertTitleUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiAlertTitle', slot);
}
const alertTitleClasses = (0,generateUtilityClasses/* default */.A)('MuiAlertTitle', ['root']);
/* harmony default export */ var AlertTitle_alertTitleClasses = ((/* unused pure expression or super */ null && (alertTitleClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/AlertTitle/AlertTitle.js
'use client';



const AlertTitle_excluded = ["className"];








const AlertTitle_useThemeProps = createUseThemeProps('MuiAlertTitle');
const AlertTitle_useUtilityClasses = ownerState => {
  const {
    classes
  } = ownerState;
  const slots = {
    root: ['root']
  };
  return (0,composeClasses/* default */.A)(slots, getAlertTitleUtilityClass, classes);
};
const AlertTitleRoot = (0,styled/* default */.Ay)(material_Typography_Typography, {
  name: 'MuiAlertTitle',
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
})(({
  theme
}) => {
  return {
    fontWeight: theme.typography.fontWeightMedium,
    marginTop: -2
  };
});
const AlertTitle = /*#__PURE__*/react.forwardRef(function AlertTitle(inProps, ref) {
  const props = AlertTitle_useThemeProps({
    props: inProps,
    name: 'MuiAlertTitle'
  });
  const {
      className
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, AlertTitle_excluded);
  const ownerState = props;
  const classes = AlertTitle_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(AlertTitleRoot, (0,esm_extends/* default */.A)({
    gutterBottom: true,
    component: "div",
    ownerState: ownerState,
    ref: ref,
    className: (0,clsx_m/* default */.A)(classes.root, className)
  }, other));
});
 false ? 0 : void 0;
/* harmony default export */ var AlertTitle_AlertTitle = (AlertTitle);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/AlertTitle/AlertTitle.tsx



/**
 *
 * Demos:
 *
 * - [Alert](https://v5.mui.com/material-ui/react-alert/)
 *
 * API:
 *
 * - [Alert API](https://v5.mui.com/material-ui/api/alert-title/)
 */
var AlertTitle_AlertTitle_AlertTitle = function AlertTitle(_ref) {
  var children = _ref.children;
  return /*#__PURE__*/react.createElement(AlertTitle_AlertTitle, null, children);
};
/* harmony default export */ var standard_AlertTitle_AlertTitle = (AlertTitle_AlertTitle_AlertTitle);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/AlertTitle/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Alert/AlertProps.ts
var Severity = /*#__PURE__*/function (Severity) {
  Severity["SUCCESS"] = "success";
  Severity["ERROR"] = "error";
  Severity["INFO"] = "info";
  Severity["WARNING"] = "warning";
  return Severity;
}({});
var AlertProps_Variant = /*#__PURE__*/function (Variant) {
  Variant["FILLED"] = "filled";
  Variant["OUTLINED"] = "outlined";
  Variant["STANDARD"] = "standard";
  return Variant;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Alert/Alert.tsx





var Alert_Alert_Alert = /*#__PURE__*/(0,react.forwardRef)(function (_ref, ref) {
  var onClose = _ref.onClose,
    icon = _ref.icon,
    severity = _ref.severity,
    variant = _ref.variant,
    children = _ref.children,
    sx = _ref.sx,
    action = _ref.action,
    title = _ref.title;
  return /*#__PURE__*/react.createElement(Alert_Alert, {
    ref: ref,
    onClose: onClose,
    icon: icon,
    severity: severity,
    variant: variant,
    sx: sx,
    action: action
  }, title && /*#__PURE__*/react.createElement(standard_AlertTitle_AlertTitle, null, title), children);
});
Alert_Alert_Alert.propTypes = {
  onClose: (prop_types_default()).func,
  icon: (prop_types_default()).element.isRequired,
  children: (prop_types_default()).element.isRequired,
  severity: prop_types_default().oneOf(Object.values(Severity)),
  variant: prop_types_default().oneOf(Object.values(AlertProps_Variant)),
  sx: prop_types_default().shape({}),
  action: (prop_types_default()).element,
  title: (prop_types_default()).string
};
/* harmony default export */ var standard_Alert_Alert = ((/* unused pure expression or super */ null && (Alert_Alert_Alert)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Alert/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Chip/Chip.tsx


var Chip_Chip = function Chip(_ref) {
  var color = _ref.color,
    label = _ref.label,
    size = _ref.size,
    variant = _ref.variant,
    clickable = _ref.clickable,
    icon = _ref.icon,
    onClick = _ref.onClick,
    sx = _ref.sx;
  return /*#__PURE__*/React.createElement(MuiChip, {
    color: color,
    label: label,
    size: size,
    variant: variant,
    clickable: clickable
    // @ts-ignore
    ,
    icon: icon,
    onClick: onClick,
    sx: sx
  });
};
/* harmony default export */ var standard_Chip_Chip = ((/* unused pure expression or super */ null && (Chip_Chip)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Chip/ChipProps.ts
var ChipProps_Size = /*#__PURE__*/function (Size) {
  Size["SMALL"] = "small";
  Size["MEDIUM"] = "medium";
  return Size;
}({});
var ChipProps_Color = /*#__PURE__*/function (Color) {
  Color["PRIMARY"] = "primary";
  Color["SECONDARY"] = "secondary";
  Color["DEFAULT"] = "default";
  return Color;
}({});
var ChipProps_Variant = /*#__PURE__*/function (Variant) {
  Variant["OUTLINED"] = "outlined";
  Variant["BADGE"] = "badge";
  Variant["FILLED"] = "filled";
  return Variant;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Chip/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/CircularProgress/circularProgressClasses.js


function getCircularProgressUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiCircularProgress', slot);
}
const circularProgressClasses = (0,generateUtilityClasses/* default */.A)('MuiCircularProgress', ['root', 'determinate', 'indeterminate', 'colorPrimary', 'colorSecondary', 'svg', 'circle', 'circleDeterminate', 'circleIndeterminate', 'circleDisableShrink']);
/* harmony default export */ var CircularProgress_circularProgressClasses = ((/* unused pure expression or super */ null && (circularProgressClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/CircularProgress/CircularProgress.js
'use client';



const CircularProgress_excluded = ["className", "color", "disableShrink", "size", "style", "thickness", "value", "variant"];
let CircularProgress_ = t => t,
  CircularProgress_t,
  CircularProgress_t2,
  CircularProgress_t3,
  CircularProgress_t4;











const SIZE = 44;
const circularRotateKeyframe = (0,emotion_react_browser_esm/* keyframes */.i7)(CircularProgress_t || (CircularProgress_t = CircularProgress_`
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
`));
const circularDashKeyframe = (0,emotion_react_browser_esm/* keyframes */.i7)(CircularProgress_t2 || (CircularProgress_t2 = CircularProgress_`
  0% {
    stroke-dasharray: 1px, 200px;
    stroke-dashoffset: 0;
  }

  50% {
    stroke-dasharray: 100px, 200px;
    stroke-dashoffset: -15px;
  }

  100% {
    stroke-dasharray: 100px, 200px;
    stroke-dashoffset: -125px;
  }
`));
const CircularProgress_useUtilityClasses = ownerState => {
  const {
    classes,
    variant,
    color,
    disableShrink
  } = ownerState;
  const slots = {
    root: ['root', variant, `color${(0,utils_capitalize/* default */.A)(color)}`],
    svg: ['svg'],
    circle: ['circle', `circle${(0,utils_capitalize/* default */.A)(variant)}`, disableShrink && 'circleDisableShrink']
  };
  return (0,composeClasses/* default */.A)(slots, getCircularProgressUtilityClass, classes);
};
const CircularProgressRoot = (0,styled/* default */.Ay)('span', {
  name: 'MuiCircularProgress',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, styles[ownerState.variant], styles[`color${(0,utils_capitalize/* default */.A)(ownerState.color)}`]];
  }
})(({
  ownerState,
  theme
}) => (0,esm_extends/* default */.A)({
  display: 'inline-block'
}, ownerState.variant === 'determinate' && {
  transition: theme.transitions.create('transform')
}, ownerState.color !== 'inherit' && {
  color: (theme.vars || theme).palette[ownerState.color].main
}), ({
  ownerState
}) => ownerState.variant === 'indeterminate' && (0,emotion_react_browser_esm/* css */.AH)(CircularProgress_t3 || (CircularProgress_t3 = CircularProgress_`
      animation: ${0} 1.4s linear infinite;
    `), circularRotateKeyframe));
const CircularProgressSVG = (0,styled/* default */.Ay)('svg', {
  name: 'MuiCircularProgress',
  slot: 'Svg',
  overridesResolver: (props, styles) => styles.svg
})({
  display: 'block' // Keeps the progress centered
});
const CircularProgressCircle = (0,styled/* default */.Ay)('circle', {
  name: 'MuiCircularProgress',
  slot: 'Circle',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.circle, styles[`circle${(0,utils_capitalize/* default */.A)(ownerState.variant)}`], ownerState.disableShrink && styles.circleDisableShrink];
  }
})(({
  ownerState,
  theme
}) => (0,esm_extends/* default */.A)({
  stroke: 'currentColor'
}, ownerState.variant === 'determinate' && {
  transition: theme.transitions.create('stroke-dashoffset')
}, ownerState.variant === 'indeterminate' && {
  // Some default value that looks fine waiting for the animation to kicks in.
  strokeDasharray: '80px, 200px',
  strokeDashoffset: 0 // Add the unit to fix a Edge 16 and below bug.
}), ({
  ownerState
}) => ownerState.variant === 'indeterminate' && !ownerState.disableShrink && (0,emotion_react_browser_esm/* css */.AH)(CircularProgress_t4 || (CircularProgress_t4 = CircularProgress_`
      animation: ${0} 1.4s ease-in-out infinite;
    `), circularDashKeyframe));

/**
 * ## ARIA
 *
 * If the progress bar is describing the loading progress of a particular region of a page,
 * you should use `aria-describedby` to point to the progress bar, and set the `aria-busy`
 * attribute to `true` on that region until it has finished loading.
 */
const CircularProgress = /*#__PURE__*/react.forwardRef(function CircularProgress(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiCircularProgress'
  });
  const {
      className,
      color = 'primary',
      disableShrink = false,
      size = 40,
      style,
      thickness = 3.6,
      value = 0,
      variant = 'indeterminate'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, CircularProgress_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    color,
    disableShrink,
    size,
    thickness,
    value,
    variant
  });
  const classes = CircularProgress_useUtilityClasses(ownerState);
  const circleStyle = {};
  const rootStyle = {};
  const rootProps = {};
  if (variant === 'determinate') {
    const circumference = 2 * Math.PI * ((SIZE - thickness) / 2);
    circleStyle.strokeDasharray = circumference.toFixed(3);
    rootProps['aria-valuenow'] = Math.round(value);
    circleStyle.strokeDashoffset = `${((100 - value) / 100 * circumference).toFixed(3)}px`;
    rootStyle.transform = 'rotate(-90deg)';
  }
  return /*#__PURE__*/(0,jsx_runtime.jsx)(CircularProgressRoot, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className),
    style: (0,esm_extends/* default */.A)({
      width: size,
      height: size
    }, rootStyle, style),
    ownerState: ownerState,
    ref: ref,
    role: "progressbar"
  }, rootProps, other, {
    children: /*#__PURE__*/(0,jsx_runtime.jsx)(CircularProgressSVG, {
      className: classes.svg,
      ownerState: ownerState,
      viewBox: `${SIZE / 2} ${SIZE / 2} ${SIZE} ${SIZE}`,
      children: /*#__PURE__*/(0,jsx_runtime.jsx)(CircularProgressCircle, {
        className: classes.circle,
        style: circleStyle,
        ownerState: ownerState,
        cx: SIZE,
        cy: SIZE,
        r: (SIZE - thickness) / 2,
        fill: "none",
        strokeWidth: thickness
      })
    })
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var CircularProgress_CircularProgress = (CircularProgress);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/CircularProgress/CircularProgressProps.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/CircularProgress/CircularProgress.tsx
/* eslint-disable react/require-default-props */





/**
 *
 * Demos:
 *
 * - [CircularProgress](https://mui.com/material-ui/react-progress/)
 *
 * API:
 *
 * - [CircularProgress API](https://mui.com/material-ui/api/circular-progress/)
 */
var CircularProgress_CircularProgress_CircularProgress = function CircularProgress(_ref) {
  var color = _ref.color,
    disableShrink = _ref.disableShrink,
    size = _ref.size,
    sx = _ref.sx,
    thickness = _ref.thickness;
  return /*#__PURE__*/react.createElement(CircularProgress_CircularProgress, {
    color: color,
    disableShrink: disableShrink,
    size: size,
    thickness: thickness,
    sx: sx
  });
};
CircularProgress_CircularProgress_CircularProgress.propTypes = {
  color: prop_types_default().oneOf(Object.values(Color)),
  disableShrink: (prop_types_default()).bool,
  size: (prop_types_default()).number,
  thickness: (prop_types_default()).number,
  sx: prop_types_default().shape({})
};
/* harmony default export */ var standard_CircularProgress_CircularProgress = ((/* unused pure expression or super */ null && (CircularProgress_CircularProgress_CircularProgress)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/CircularProgress/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/LinearProgress/LinearProgress.tsx



var LinearProgress = function LinearProgress(props) {
  return /*#__PURE__*/React.createElement(Box, {
    sx: {
      width: '100%'
    }
  }, /*#__PURE__*/React.createElement(MuiLinearProgress, {
    variant: props.variant,
    value: props.value
  }));
};
/* harmony default export */ var LinearProgress_LinearProgress = ((/* unused pure expression or super */ null && (LinearProgress)));
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/createTransitions.js
var createTransitions = __webpack_require__(4757);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Collapse/collapseClasses.js


function getCollapseUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiCollapse', slot);
}
const collapseClasses = (0,generateUtilityClasses/* default */.A)('MuiCollapse', ['root', 'horizontal', 'vertical', 'entered', 'hidden', 'wrapper', 'wrapperInner']);
/* harmony default export */ var Collapse_collapseClasses = ((/* unused pure expression or super */ null && (collapseClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Collapse/Collapse.js
'use client';



const Collapse_excluded = ["addEndListener", "children", "className", "collapsedSize", "component", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "orientation", "style", "timeout", "TransitionComponent"];















const Collapse_useUtilityClasses = ownerState => {
  const {
    orientation,
    classes
  } = ownerState;
  const slots = {
    root: ['root', `${orientation}`],
    entered: ['entered'],
    hidden: ['hidden'],
    wrapper: ['wrapper', `${orientation}`],
    wrapperInner: ['wrapperInner', `${orientation}`]
  };
  return (0,composeClasses/* default */.A)(slots, getCollapseUtilityClass, classes);
};
const CollapseRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiCollapse',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, styles[ownerState.orientation], ownerState.state === 'entered' && styles.entered, ownerState.state === 'exited' && !ownerState.in && ownerState.collapsedSize === '0px' && styles.hidden];
  }
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  height: 0,
  overflow: 'hidden',
  transition: theme.transitions.create('height')
}, ownerState.orientation === 'horizontal' && {
  height: 'auto',
  width: 0,
  transition: theme.transitions.create('width')
}, ownerState.state === 'entered' && (0,esm_extends/* default */.A)({
  height: 'auto',
  overflow: 'visible'
}, ownerState.orientation === 'horizontal' && {
  width: 'auto'
}), ownerState.state === 'exited' && !ownerState.in && ownerState.collapsedSize === '0px' && {
  visibility: 'hidden'
}));
const CollapseWrapper = (0,styled/* default */.Ay)('div', {
  name: 'MuiCollapse',
  slot: 'Wrapper',
  overridesResolver: (props, styles) => styles.wrapper
})(({
  ownerState
}) => (0,esm_extends/* default */.A)({
  // Hack to get children with a negative margin to not falsify the height computation.
  display: 'flex',
  width: '100%'
}, ownerState.orientation === 'horizontal' && {
  width: 'auto',
  height: '100%'
}));
const CollapseWrapperInner = (0,styled/* default */.Ay)('div', {
  name: 'MuiCollapse',
  slot: 'WrapperInner',
  overridesResolver: (props, styles) => styles.wrapperInner
})(({
  ownerState
}) => (0,esm_extends/* default */.A)({
  width: '100%'
}, ownerState.orientation === 'horizontal' && {
  width: 'auto',
  height: '100%'
}));

/**
 * The Collapse transition is used by the
 * [Vertical Stepper](/material-ui/react-stepper/#vertical-stepper) StepContent component.
 * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
 */
const Collapse = /*#__PURE__*/react.forwardRef(function Collapse(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiCollapse'
  });
  const {
      addEndListener,
      children,
      className,
      collapsedSize: collapsedSizeProp = '0px',
      component,
      easing,
      in: inProp,
      onEnter,
      onEntered,
      onEntering,
      onExit,
      onExited,
      onExiting,
      orientation = 'vertical',
      style,
      timeout = createTransitions/* duration */.p0.standard,
      // eslint-disable-next-line react/prop-types
      TransitionComponent = esm_Transition
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Collapse_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    orientation,
    collapsedSize: collapsedSizeProp
  });
  const classes = Collapse_useUtilityClasses(ownerState);
  const theme = styles_useTheme_useTheme();
  const timer = (0,useTimeout/* default */.A)();
  const wrapperRef = react.useRef(null);
  const autoTransitionDuration = react.useRef();
  const collapsedSize = typeof collapsedSizeProp === 'number' ? `${collapsedSizeProp}px` : collapsedSizeProp;
  const isHorizontal = orientation === 'horizontal';
  const size = isHorizontal ? 'width' : 'height';
  const nodeRef = react.useRef(null);
  const handleRef = (0,utils_useForkRef/* default */.A)(ref, nodeRef);
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
    if (callback) {
      const node = nodeRef.current;

      // onEnterXxx and onExitXxx callbacks have a different arguments.length value.
      if (maybeIsAppearing === undefined) {
        callback(node);
      } else {
        callback(node, maybeIsAppearing);
      }
    }
  };
  const getWrapperSize = () => wrapperRef.current ? wrapperRef.current[isHorizontal ? 'clientWidth' : 'clientHeight'] : 0;
  const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
    if (wrapperRef.current && isHorizontal) {
      // Set absolute position to get the size of collapsed content
      wrapperRef.current.style.position = 'absolute';
    }
    node.style[size] = collapsedSize;
    if (onEnter) {
      onEnter(node, isAppearing);
    }
  });
  const handleEntering = normalizedTransitionCallback((node, isAppearing) => {
    const wrapperSize = getWrapperSize();
    if (wrapperRef.current && isHorizontal) {
      // After the size is read reset the position back to default
      wrapperRef.current.style.position = '';
    }
    const {
      duration: transitionDuration,
      easing: transitionTimingFunction
    } = utils_getTransitionProps({
      style,
      timeout,
      easing
    }, {
      mode: 'enter'
    });
    if (timeout === 'auto') {
      const duration2 = theme.transitions.getAutoHeightDuration(wrapperSize);
      node.style.transitionDuration = `${duration2}ms`;
      autoTransitionDuration.current = duration2;
    } else {
      node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : `${transitionDuration}ms`;
    }
    node.style[size] = `${wrapperSize}px`;
    node.style.transitionTimingFunction = transitionTimingFunction;
    if (onEntering) {
      onEntering(node, isAppearing);
    }
  });
  const handleEntered = normalizedTransitionCallback((node, isAppearing) => {
    node.style[size] = 'auto';
    if (onEntered) {
      onEntered(node, isAppearing);
    }
  });
  const handleExit = normalizedTransitionCallback(node => {
    node.style[size] = `${getWrapperSize()}px`;
    if (onExit) {
      onExit(node);
    }
  });
  const handleExited = normalizedTransitionCallback(onExited);
  const handleExiting = normalizedTransitionCallback(node => {
    const wrapperSize = getWrapperSize();
    const {
      duration: transitionDuration,
      easing: transitionTimingFunction
    } = utils_getTransitionProps({
      style,
      timeout,
      easing
    }, {
      mode: 'exit'
    });
    if (timeout === 'auto') {
      // TODO: rename getAutoHeightDuration to something more generic (width support)
      // Actually it just calculates animation duration based on size
      const duration2 = theme.transitions.getAutoHeightDuration(wrapperSize);
      node.style.transitionDuration = `${duration2}ms`;
      autoTransitionDuration.current = duration2;
    } else {
      node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : `${transitionDuration}ms`;
    }
    node.style[size] = collapsedSize;
    node.style.transitionTimingFunction = transitionTimingFunction;
    if (onExiting) {
      onExiting(node);
    }
  });
  const handleAddEndListener = next => {
    if (timeout === 'auto') {
      timer.start(autoTransitionDuration.current || 0, next);
    }
    if (addEndListener) {
      // Old call signature before `react-transition-group` implemented `nodeRef`
      addEndListener(nodeRef.current, next);
    }
  };
  return /*#__PURE__*/(0,jsx_runtime.jsx)(TransitionComponent, (0,esm_extends/* default */.A)({
    in: inProp,
    onEnter: handleEnter,
    onEntered: handleEntered,
    onEntering: handleEntering,
    onExit: handleExit,
    onExited: handleExited,
    onExiting: handleExiting,
    addEndListener: handleAddEndListener,
    nodeRef: nodeRef,
    timeout: timeout === 'auto' ? null : timeout
  }, other, {
    children: (state, childProps) => /*#__PURE__*/(0,jsx_runtime.jsx)(CollapseRoot, (0,esm_extends/* default */.A)({
      as: component,
      className: (0,clsx_m/* default */.A)(classes.root, className, {
        'entered': classes.entered,
        'exited': !inProp && collapsedSize === '0px' && classes.hidden
      }[state]),
      style: (0,esm_extends/* default */.A)({
        [isHorizontal ? 'minWidth' : 'minHeight']: collapsedSize
      }, style),
      ref: handleRef
    }, childProps, {
      // `ownerState` is set after `childProps` to override any existing `ownerState` property in `childProps`
      // that might have been forwarded from the Transition component.
      ownerState: (0,esm_extends/* default */.A)({}, ownerState, {
        state
      }),
      children: /*#__PURE__*/(0,jsx_runtime.jsx)(CollapseWrapper, {
        ownerState: (0,esm_extends/* default */.A)({}, ownerState, {
          state
        }),
        className: classes.wrapper,
        ref: wrapperRef,
        children: /*#__PURE__*/(0,jsx_runtime.jsx)(CollapseWrapperInner, {
          ownerState: (0,esm_extends/* default */.A)({}, ownerState, {
            state
          }),
          className: classes.wrapperInner,
          children: children
        })
      })
    }))
  }));
});
 false ? 0 : void 0;
Collapse.muiSupportAuto = true;
/* harmony default export */ var Collapse_Collapse = (Collapse);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Accordion/AccordionContext.js
'use client';



/**
 * @ignore - internal component.
 * @type {React.Context<{} | {expanded: boolean, disabled: boolean, toggle: () => void}>}
 */
const AccordionContext = /*#__PURE__*/react.createContext({});
if (false) {}
/* harmony default export */ var Accordion_AccordionContext = (AccordionContext);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useControlled.js + 1 modules
var utils_useControlled = __webpack_require__(9727);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Accordion/accordionClasses.js


function getAccordionUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiAccordion', slot);
}
const accordionClasses = (0,generateUtilityClasses/* default */.A)('MuiAccordion', ['root', 'rounded', 'expanded', 'disabled', 'gutters', 'region']);
/* harmony default export */ var Accordion_accordionClasses = (accordionClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Accordion/Accordion.js
'use client';



const Accordion_excluded = ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "slots", "slotProps", "TransitionComponent", "TransitionProps"];















const Accordion_useThemeProps = createUseThemeProps('MuiAccordion');
const Accordion_useUtilityClasses = ownerState => {
  const {
    classes,
    square,
    expanded,
    disabled,
    disableGutters
  } = ownerState;
  const slots = {
    root: ['root', !square && 'rounded', expanded && 'expanded', disabled && 'disabled', !disableGutters && 'gutters'],
    region: ['region']
  };
  return (0,composeClasses/* default */.A)(slots, getAccordionUtilityClass, classes);
};
const AccordionRoot = (0,styled/* default */.Ay)(material_Paper_Paper, {
  name: 'MuiAccordion',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [{
      [`& .${Accordion_accordionClasses.region}`]: styles.region
    }, styles.root, !ownerState.square && styles.rounded, !ownerState.disableGutters && styles.gutters];
  }
})(({
  theme
}) => {
  const transition = {
    duration: theme.transitions.duration.shortest
  };
  return {
    position: 'relative',
    transition: theme.transitions.create(['margin'], transition),
    overflowAnchor: 'none',
    // Keep the same scrolling position
    '&::before': {
      position: 'absolute',
      left: 0,
      top: -1,
      right: 0,
      height: 1,
      content: '""',
      opacity: 1,
      backgroundColor: (theme.vars || theme).palette.divider,
      transition: theme.transitions.create(['opacity', 'background-color'], transition)
    },
    '&:first-of-type': {
      '&::before': {
        display: 'none'
      }
    },
    [`&.${Accordion_accordionClasses.expanded}`]: {
      '&::before': {
        opacity: 0
      },
      '&:first-of-type': {
        marginTop: 0
      },
      '&:last-of-type': {
        marginBottom: 0
      },
      '& + &': {
        '&::before': {
          display: 'none'
        }
      }
    },
    [`&.${Accordion_accordionClasses.disabled}`]: {
      backgroundColor: (theme.vars || theme).palette.action.disabledBackground
    }
  };
}, ({
  theme
}) => ({
  variants: [{
    props: props => !props.square,
    style: {
      borderRadius: 0,
      '&:first-of-type': {
        borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
        borderTopRightRadius: (theme.vars || theme).shape.borderRadius
      },
      '&:last-of-type': {
        borderBottomLeftRadius: (theme.vars || theme).shape.borderRadius,
        borderBottomRightRadius: (theme.vars || theme).shape.borderRadius,
        // Fix a rendering issue on Edge
        '@supports (-ms-ime-align: auto)': {
          borderBottomLeftRadius: 0,
          borderBottomRightRadius: 0
        }
      }
    }
  }, {
    props: props => !props.disableGutters,
    style: {
      [`&.${Accordion_accordionClasses.expanded}`]: {
        margin: '16px 0'
      }
    }
  }]
}));
const Accordion = /*#__PURE__*/react.forwardRef(function Accordion(inProps, ref) {
  const props = Accordion_useThemeProps({
    props: inProps,
    name: 'MuiAccordion'
  });
  const {
      children: childrenProp,
      className,
      defaultExpanded = false,
      disabled = false,
      disableGutters = false,
      expanded: expandedProp,
      onChange,
      square = false,
      slots = {},
      slotProps = {},
      TransitionComponent: TransitionComponentProp,
      TransitionProps: TransitionPropsProp
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Accordion_excluded);
  const [expanded, setExpandedState] = (0,utils_useControlled/* default */.A)({
    controlled: expandedProp,
    default: defaultExpanded,
    name: 'Accordion',
    state: 'expanded'
  });
  const handleChange = react.useCallback(event => {
    setExpandedState(!expanded);
    if (onChange) {
      onChange(event, !expanded);
    }
  }, [expanded, onChange, setExpandedState]);
  const [summary, ...children] = react.Children.toArray(childrenProp);
  const contextValue = react.useMemo(() => ({
    expanded,
    disabled,
    disableGutters,
    toggle: handleChange
  }), [expanded, disabled, disableGutters, handleChange]);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    square,
    disabled,
    disableGutters,
    expanded
  });
  const classes = Accordion_useUtilityClasses(ownerState);
  const backwardCompatibleSlots = (0,esm_extends/* default */.A)({
    transition: TransitionComponentProp
  }, slots);
  const backwardCompatibleSlotProps = (0,esm_extends/* default */.A)({
    transition: TransitionPropsProp
  }, slotProps);
  const [TransitionSlot, transitionProps] = useSlot('transition', {
    elementType: Collapse_Collapse,
    externalForwardedProps: {
      slots: backwardCompatibleSlots,
      slotProps: backwardCompatibleSlotProps
    },
    ownerState
  });
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(AccordionRoot, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ref: ref,
    ownerState: ownerState,
    square: square
  }, other, {
    children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Accordion_AccordionContext.Provider, {
      value: contextValue,
      children: summary
    }), /*#__PURE__*/(0,jsx_runtime.jsx)(TransitionSlot, (0,esm_extends/* default */.A)({
      in: expanded,
      timeout: "auto"
    }, transitionProps, {
      children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
        "aria-labelledby": summary.props.id,
        id: summary.props['aria-controls'],
        role: "region",
        className: classes.region,
        children: children
      })
    }))]
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var Accordion_Accordion = (Accordion);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Accordion/Accordion.tsx
/* eslint-disable react/require-default-props */




var AccordionStyled = (0,styled/* default */.Ay)(Accordion_Accordion)(function (_ref) {
  var theme = _ref.theme;
  return {
    '&.MuiAccordion-root:before': {
      backgroundColor: theme.palette.common.white
    },
    '&.MuiAccordion-root': {
      boxShadow: 'none'
    }
  };
});

/**
 *
 * Demos:
 *
 * - [Accordion](https://mui.com/material-ui/react-accordion/)
 *
 * API:
 *
 * - [Accordion API](https://mui.com/material-ui/api/accordion/)
 */

var Accordion_Accordion_Accordion = function Accordion(_ref2) {
  var children = _ref2.children,
    expanded = _ref2.expanded,
    onChange = _ref2.onChange,
    disableGutters = _ref2.disableGutters,
    sx = _ref2.sx;
  return /*#__PURE__*/react.createElement(AccordionStyled, {
    expanded: expanded,
    onChange: onChange,
    disableGutters: disableGutters,
    sx: sx
  }, children);
};
Accordion_Accordion_Accordion.propTypes = {
  children: (prop_types_default()).node.isRequired,
  expanded: (prop_types_default()).bool,
  onChange: (prop_types_default()).func,
  disableGutters: (prop_types_default()).bool
};
/* harmony default export */ var standard_Accordion_Accordion = ((/* unused pure expression or super */ null && (Accordion_Accordion_Accordion)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/AccordionSummary/accordionSummaryClasses.js


function getAccordionSummaryUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiAccordionSummary', slot);
}
const accordionSummaryClasses = (0,generateUtilityClasses/* default */.A)('MuiAccordionSummary', ['root', 'expanded', 'focusVisible', 'disabled', 'gutters', 'contentGutters', 'content', 'expandIconWrapper']);
/* harmony default export */ var AccordionSummary_accordionSummaryClasses = (accordionSummaryClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/AccordionSummary/AccordionSummary.js
'use client';



const AccordionSummary_excluded = ["children", "className", "expandIcon", "focusVisibleClassName", "onClick"];










const AccordionSummary_useThemeProps = createUseThemeProps('MuiAccordionSummary');
const AccordionSummary_useUtilityClasses = ownerState => {
  const {
    classes,
    expanded,
    disabled,
    disableGutters
  } = ownerState;
  const slots = {
    root: ['root', expanded && 'expanded', disabled && 'disabled', !disableGutters && 'gutters'],
    focusVisible: ['focusVisible'],
    content: ['content', expanded && 'expanded', !disableGutters && 'contentGutters'],
    expandIconWrapper: ['expandIconWrapper', expanded && 'expanded']
  };
  return (0,composeClasses/* default */.A)(slots, getAccordionSummaryUtilityClass, classes);
};
const AccordionSummaryRoot = (0,styled/* default */.Ay)(material_ButtonBase_ButtonBase, {
  name: 'MuiAccordionSummary',
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
})(({
  theme
}) => {
  const transition = {
    duration: theme.transitions.duration.shortest
  };
  return {
    display: 'flex',
    minHeight: 48,
    padding: theme.spacing(0, 2),
    transition: theme.transitions.create(['min-height', 'background-color'], transition),
    [`&.${AccordionSummary_accordionSummaryClasses.focusVisible}`]: {
      backgroundColor: (theme.vars || theme).palette.action.focus
    },
    [`&.${AccordionSummary_accordionSummaryClasses.disabled}`]: {
      opacity: (theme.vars || theme).palette.action.disabledOpacity
    },
    [`&:hover:not(.${AccordionSummary_accordionSummaryClasses.disabled})`]: {
      cursor: 'pointer'
    },
    variants: [{
      props: props => !props.disableGutters,
      style: {
        [`&.${AccordionSummary_accordionSummaryClasses.expanded}`]: {
          minHeight: 64
        }
      }
    }]
  };
});
const AccordionSummaryContent = (0,styled/* default */.Ay)('div', {
  name: 'MuiAccordionSummary',
  slot: 'Content',
  overridesResolver: (props, styles) => styles.content
})(({
  theme
}) => ({
  display: 'flex',
  flexGrow: 1,
  margin: '12px 0',
  variants: [{
    props: props => !props.disableGutters,
    style: {
      transition: theme.transitions.create(['margin'], {
        duration: theme.transitions.duration.shortest
      }),
      [`&.${AccordionSummary_accordionSummaryClasses.expanded}`]: {
        margin: '20px 0'
      }
    }
  }]
}));
const AccordionSummaryExpandIconWrapper = (0,styled/* default */.Ay)('div', {
  name: 'MuiAccordionSummary',
  slot: 'ExpandIconWrapper',
  overridesResolver: (props, styles) => styles.expandIconWrapper
})(({
  theme
}) => ({
  display: 'flex',
  color: (theme.vars || theme).palette.action.active,
  transform: 'rotate(0deg)',
  transition: theme.transitions.create('transform', {
    duration: theme.transitions.duration.shortest
  }),
  [`&.${AccordionSummary_accordionSummaryClasses.expanded}`]: {
    transform: 'rotate(180deg)'
  }
}));
const AccordionSummary = /*#__PURE__*/react.forwardRef(function AccordionSummary(inProps, ref) {
  const props = AccordionSummary_useThemeProps({
    props: inProps,
    name: 'MuiAccordionSummary'
  });
  const {
      children,
      className,
      expandIcon,
      focusVisibleClassName,
      onClick
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, AccordionSummary_excluded);
  const {
    disabled = false,
    disableGutters,
    expanded,
    toggle
  } = react.useContext(Accordion_AccordionContext);
  const handleChange = event => {
    if (toggle) {
      toggle(event);
    }
    if (onClick) {
      onClick(event);
    }
  };
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    expanded,
    disabled,
    disableGutters
  });
  const classes = AccordionSummary_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(AccordionSummaryRoot, (0,esm_extends/* default */.A)({
    focusRipple: false,
    disableRipple: true,
    disabled: disabled,
    component: "div",
    "aria-expanded": expanded,
    className: (0,clsx_m/* default */.A)(classes.root, className),
    focusVisibleClassName: (0,clsx_m/* default */.A)(classes.focusVisible, focusVisibleClassName),
    onClick: handleChange,
    ref: ref,
    ownerState: ownerState
  }, other, {
    children: [/*#__PURE__*/(0,jsx_runtime.jsx)(AccordionSummaryContent, {
      className: classes.content,
      ownerState: ownerState,
      children: children
    }), expandIcon && /*#__PURE__*/(0,jsx_runtime.jsx)(AccordionSummaryExpandIconWrapper, {
      className: classes.expandIconWrapper,
      ownerState: ownerState,
      children: expandIcon
    })]
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var AccordionSummary_AccordionSummary = (AccordionSummary);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Accordion/AccordionSummary.tsx
/* eslint-disable react/require-default-props */




var AccordionSummaryStyled = (0,styled/* default */.Ay)(AccordionSummary_AccordionSummary)(function (_ref) {
  var theme = _ref.theme;
  return {
    flexDirection: 'row-reverse',
    '& .MuiAccordionSummary-expandIconWrapper.Mui-expanded': {
      transform: 'rotate(90deg)'
    },
    '& .MuiAccordionSummary-content': {
      marginLeft: theme.spacing(2)
    }
  };
});

/**
 *
 * Demos:
 *
 * - [Accordion](https://mui.com/material-ui/react-accordion/)
 *
 * API:
 *
 * - [Accordion API](https://mui.com/material-ui/api/accordion-summary/)
 */

var Accordion_AccordionSummary_AccordionSummary = function AccordionSummary(_ref2) {
  var children = _ref2.children,
    expandIcon = _ref2.expandIcon,
    sx = _ref2.sx;
  return /*#__PURE__*/react.createElement(AccordionSummaryStyled, {
    expandIcon: expandIcon,
    sx: sx
  }, children);
};
Accordion_AccordionSummary_AccordionSummary.propTypes = {
  children: (prop_types_default()).node.isRequired,
  expandIcon: (prop_types_default()).element,
  sx: prop_types_default().shape({})
};
/* harmony default export */ var Accordion_AccordionSummary = ((/* unused pure expression or super */ null && (Accordion_AccordionSummary_AccordionSummary)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/AccordionDetails/accordionDetailsClasses.js


function getAccordionDetailsUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiAccordionDetails', slot);
}
const accordionDetailsClasses = (0,generateUtilityClasses/* default */.A)('MuiAccordionDetails', ['root']);
/* harmony default export */ var AccordionDetails_accordionDetailsClasses = ((/* unused pure expression or super */ null && (accordionDetailsClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/AccordionDetails/AccordionDetails.js
'use client';



const AccordionDetails_excluded = ["className"];







const AccordionDetails_useThemeProps = createUseThemeProps('MuiAccordionDetails');
const AccordionDetails_useUtilityClasses = ownerState => {
  const {
    classes
  } = ownerState;
  const slots = {
    root: ['root']
  };
  return (0,composeClasses/* default */.A)(slots, getAccordionDetailsUtilityClass, classes);
};
const AccordionDetailsRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiAccordionDetails',
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
})(({
  theme
}) => ({
  padding: theme.spacing(1, 2, 2)
}));
const AccordionDetails = /*#__PURE__*/react.forwardRef(function AccordionDetails(inProps, ref) {
  const props = AccordionDetails_useThemeProps({
    props: inProps,
    name: 'MuiAccordionDetails'
  });
  const {
      className
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, AccordionDetails_excluded);
  const ownerState = props;
  const classes = AccordionDetails_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(AccordionDetailsRoot, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ref: ref,
    ownerState: ownerState
  }, other));
});
 false ? 0 : void 0;
/* harmony default export */ var AccordionDetails_AccordionDetails = (AccordionDetails);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Accordion/AccordionDetails.tsx
/* eslint-disable react/require-default-props */




/**
 *
 * Demos:
 *
 * - [Accordion](https://mui.com/material-ui/react-accordion/)
 *
 * API:
 *
 * - [Accordion API](https://mui.com/material-ui/api/accordion-details/)
 */

var Accordion_AccordionDetails_AccordionDetails = function AccordionDetails(_ref) {
  var children = _ref.children;
  return /*#__PURE__*/react.createElement(AccordionDetails_AccordionDetails, null, children);
};
Accordion_AccordionDetails_AccordionDetails.propTypes = {
  children: (prop_types_default()).node.isRequired
};
/* harmony default export */ var Accordion_AccordionDetails = ((/* unused pure expression or super */ null && (Accordion_AccordionDetails_AccordionDetails)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Accordion/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Switch/Switch.tsx


var Switch_Switch = function Switch(_ref) {
  var _ref$defaultChecked = _ref.defaultChecked,
    defaultChecked = _ref$defaultChecked === void 0 ? false : _ref$defaultChecked,
    _ref$disabled = _ref.disabled,
    disabled = _ref$disabled === void 0 ? false : _ref$disabled,
    inputRef = _ref.inputRef,
    checked = _ref.checked,
    size = _ref.size,
    onChange = _ref.onChange,
    inputProps = _ref.inputProps,
    name = _ref.name,
    onKeyDown = _ref.onKeyDown;
  return /*#__PURE__*/React.createElement(MuiSwitch, {
    defaultChecked: defaultChecked,
    disabled: disabled,
    inputRef: inputRef,
    checked: checked,
    size: size,
    onChange: onChange,
    inputProps: inputProps,
    onKeyDown: onKeyDown,
    name: name
  });
};
/* harmony default export */ var standard_Switch_Switch = ((/* unused pure expression or super */ null && (Switch_Switch)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Switch/SwitchProps.ts
var SwitchProps_Size = /*#__PURE__*/function (Size) {
  Size["SMALL"] = "small";
  Size["MEDIUM"] = "medium";
  return Size;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Slider/Slider.tsx



/**
 *
 * Demos:
 *
 * - [Slider](https://mui.com/material-ui/react-slider/)
 *
 * API:
 *
 * - [Slider API](https://mui.com/material-ui/api/slider/)
 */

var Slider = function Slider(props) {
  return /*#__PURE__*/React.createElement(MuiSlider, {
    size: props.size,
    onChange: props.onChange,
    min: props.min,
    max: props.max,
    step: props.step,
    value: props.value,
    disableSwap: props.disableSwap
  });
};
/* harmony default export */ var Slider_Slider = ((/* unused pure expression or super */ null && (Slider)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Slider/SliderProps.ts
var SliderProps_Size = /*#__PURE__*/function (Size) {
  Size["SMALL"] = "small";
  Size["MEDIUM"] = "medium";
  return Size;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Divider/Divider.tsx


/**
 *
 * Demo:
 *
 * - [Divider](https://mui.com/material-ui/react-divider/)
 *
 * API:
 *
 * - [Divider API](https://mui.com/material-ui/api/divider/)
 */
var Divider_Divider = function Divider(props) {
  return /*#__PURE__*/React.createElement(MuiDivider, {
    variant: props.variant,
    orientation: props.orientation,
    component: "div",
    "aria-hidden": "true",
    sx: props.sx
  }, props.children);
};
/* harmony default export */ var standard_Divider_Divider = ((/* unused pure expression or super */ null && (Divider_Divider)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Divider/DividerProps.ts
var DividerProps_Variant = /*#__PURE__*/function (Variant) {
  Variant["MIDDLE"] = "middle";
  Variant["FULLWIDTH"] = "fullWidth";
  Variant["INSET"] = "inset";
  return Variant;
}({});
var Orientation = /*#__PURE__*/function (Orientation) {
  Orientation["VERTICAL"] = "vertical";
  return Orientation;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Divider/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Link/LinkProps.ts
var LinkProps_Underline = /*#__PURE__*/function (Underline) {
  Underline["NONE"] = "none";
  return Underline;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Link/Link.tsx




/**
 *
 * Demo:
 *
 * - [Link](https://mui.com/material-ui/react-link/)
 *
 * API:
 *
 * - [Link API](https://mui.com/material-ui/api/link/)
 */

var Link_Link = function Link(_ref) {
  var href = _ref.href,
    onClick = _ref.onClick,
    children = _ref.children,
    display = _ref.display,
    className = _ref.className;
  return href ? /*#__PURE__*/React.createElement(MuiLink, {
    href: href,
    target: "_blank",
    rel: "noopener noreferrer",
    underline: Underline.NONE,
    display: display,
    className: className
  }, children) : /*#__PURE__*/React.createElement(MuiLink, {
    onClick: onClick,
    component: "button",
    underline: Underline.NONE,
    display: display,
    className: className
  }, children);
};
/* harmony default export */ var standard_Link_Link = ((/* unused pure expression or super */ null && (Link_Link)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Link/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/IconButton/IconButton.tsx





/**
 *
 * Demo:
 *
 * - [IconButton](https://mui.com/material-ui/react-button/#icon-button)
 *
 * API:
 *
 * - [IconButton API](https://mui.com/material-ui/api/icon-button/)
 */
var IconButton_IconButton_IconButton = function IconButton(_ref) {
  var size = _ref.size,
    onClick = _ref.onClick,
    children = _ref.children,
    sx = _ref.sx,
    disabled = _ref.disabled,
    label = _ref.label;
  return /*#__PURE__*/React.createElement(MuiIconButton, {
    disabled: disabled,
    size: size,
    onClick: onClick,
    sx: sx
  }, children, label && /*#__PURE__*/React.createElement(Typography, {
    variant: TypographyProps.Variants.BODY2,
    sx: {
      mt: 2
    }
  }, label));
};
/* harmony default export */ var standard_IconButton_IconButton = ((/* unused pure expression or super */ null && (IconButton_IconButton_IconButton)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/IconButton/IconButtonProps.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/IconButton/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Tooltip/Tooltip.tsx


/**
 *
 * Demos:
 *
 * - [Tooltip](https://mui.com/material-ui/react-tooltip/)
 *
 * API:
 *
 * - [Tooltip API](https://mui.com/material-ui/api/tooltip/)
 */
var Tooltip_Tooltip_Tooltip = function Tooltip(_ref) {
  var title = _ref.title,
    placement = _ref.placement,
    followCursor = _ref.followCursor,
    children = _ref.children,
    disableInteractive = _ref.disableInteractive,
    _ref$offset = _ref.offset,
    offset = _ref$offset === void 0 ? 18 : _ref$offset,
    disableFocusListener = _ref.disableFocusListener,
    disableHoverListener = _ref.disableHoverListener;
  return /*#__PURE__*/React.createElement(MuiTooltip, {
    title: title,
    placement: placement,
    followCursor: followCursor,
    enterDelay: 500,
    disableInteractive: disableInteractive,
    disableFocusListener: disableFocusListener,
    disableHoverListener: disableHoverListener,
    PopperProps: followCursor ? {
      modifiers: [{
        name: 'offset',
        options: {
          offset: [0, offset]
        }
      }]
    } : {}
  }, /*#__PURE__*/React.createElement("span", null, children));
};
/* harmony default export */ var standard_Tooltip_Tooltip = ((/* unused pure expression or super */ null && (Tooltip_Tooltip_Tooltip)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Tooltip/TooltipProps.ts
var PlacementType = /*#__PURE__*/function (PlacementType) {
  PlacementType["BOTTOM_END"] = "bottom-end";
  PlacementType["BOTTOM_START"] = "bottom-start";
  PlacementType["BOTTOM"] = "bottom";
  PlacementType["LEFT_END"] = "left-end";
  PlacementType["LEFT_START"] = "left-start";
  PlacementType["LEFT"] = "left";
  PlacementType["RIGHT_END"] = "right-end";
  PlacementType["RIGHT_START"] = "right-start";
  PlacementType["RIGHT"] = "right";
  PlacementType["TOP_END"] = "top-end";
  PlacementType["TOP_START"] = "top-start";
  PlacementType["TOP"] = "top";
  return PlacementType;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/TablePagination/TablePagination.tsx



/**
 *
 * Demos:
 *
 * - [TablePagination](https://mui.com/material-ui/react-pagination/#table-pagination)
 *
 * API:
 *
 * - [TablePagination API](https://mui.com/material-ui/api/table-pagination/)
 */
var TablePagination = function TablePagination(_ref) {
  var count = _ref.count,
    page = _ref.page,
    rowsPerPage = _ref.rowsPerPage,
    handleChangePage = _ref.handleChangePage,
    rowsPerPageOptions = _ref.rowsPerPageOptions,
    labelRowsPerPage = _ref.labelRowsPerPage,
    classes = _ref.classes,
    onRowsPerPageChange = _ref.onRowsPerPageChange;
  return /*#__PURE__*/React.createElement(MuiTablePagination, {
    component: "div",
    count: count,
    page: page,
    rowsPerPage: rowsPerPage,
    rowsPerPageOptions: rowsPerPageOptions,
    onPageChange: handleChangePage,
    labelRowsPerPage: labelRowsPerPage,
    onRowsPerPageChange: onRowsPerPageChange,
    classes: classes,
    slotProps: {
      actions: {
        nextButton: {
          sx: {
            borderRadius: '8px',
            '&.Mui-disabled': {
              color: '#000'
            }
          }
        },
        previousButton: {
          sx: {
            borderRadius: '8px',
            '&.Mui-disabled': {
              color: '#000'
            }
          }
        }
      },
      select: {
        MenuProps: {
          slotProps: {
            paper: {
              sx: {
                '& .MuiList-root': {
                  maxHeight: 'fit-content'
                }
              }
            }
          }
        }
      }
    }
  });
};
/* harmony default export */ var TablePagination_TablePagination = ((/* unused pure expression or super */ null && (TablePagination)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/TablePagination/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/SvgIcon/SvgIcon.tsx


var SvgIcon_SvgIcon = function SvgIcon(props) {
  return /*#__PURE__*/React.createElement(MuiSvgIcon, {
    width: props.width,
    height: props.height,
    viewBox: props.viewBox,
    sx: props.sx,
    color: props.color,
    fontSize: props.fontSize
  }, props.children);
};
/* harmony default export */ var standard_SvgIcon_SvgIcon = ((/* unused pure expression or super */ null && (SvgIcon_SvgIcon)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/SvgIcon/SVGIconProps.ts
var SVGIconProps_Colors = /*#__PURE__*/function (Colors) {
  Colors["INHERIT"] = "inherit";
  Colors["ACTION"] = "action";
  Colors["DISABLED"] = "disabled";
  Colors["PRIMARY"] = "primary";
  Colors["SECONDARY"] = "secondary";
  Colors["ERROR"] = "error";
  Colors["INFO"] = "info";
  Colors["SUCCESS"] = "success";
  Colors["WARNING"] = "warning";
  return Colors;
}({});
var SVGIconProps_FontSize = /*#__PURE__*/function (FontSize) {
  FontSize["LARGE"] = "large";
  FontSize["SMALL"] = "small";
  return FontSize;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/InputAdornment/InputAdornment.tsx


/**
 * This component is a wrapper for InputAdornment. This can be used as Adornment element for other components
 *
 * Demo:
 * - [InputAdornment](https://mui.com/material-ui/react-text-field/#input-adornments)
 *
 * API:
 * - [InputAdornment API](https://mui.com/material-ui/api/input-adornment/)
 * */
var InputAdornment_InputAdornment = function InputAdornment(props) {
  return /*#__PURE__*/React.createElement(MuiInputAdornment, {
    position: props.position
  }, props.children);
};
/* harmony default export */ var standard_InputAdornment_InputAdornment = ((/* unused pure expression or super */ null && (InputAdornment_InputAdornment)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/InputAdornment/InputAdornmentProps.ts
var InputAdornmentProps_AdornmentPosition = /*#__PURE__*/function (AdornmentPosition) {
  AdornmentPosition["START"] = "start";
  AdornmentPosition["END"] = "end";
  return AdornmentPosition;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Grow/Grow.tsx

var Grow_excluded = (/* unused pure expression or super */ null && (["children"]));


var Grow_Grow_Grow = function Grow(_ref) {
  var children = _ref.children,
    transitionProps = _objectWithoutProperties(_ref, Grow_excluded);
  return /*#__PURE__*/React.createElement(MuiGrow, transitionProps, children);
};
/* harmony default export */ var standard_Grow_Grow = ((/* unused pure expression or super */ null && (Grow_Grow_Grow)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Grow/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Popper/Popper.tsx


var Popper_Popper_Popper = function Popper(_ref) {
  var children = _ref.children,
    open = _ref.open,
    transition = _ref.transition,
    anchorEl = _ref.anchorEl,
    placement = _ref.placement,
    disablePortal = _ref.disablePortal,
    sx = _ref.sx,
    modifiers = _ref.modifiers;
  return /*#__PURE__*/React.createElement(MuiPopper, {
    open: open,
    anchorEl: anchorEl,
    transition: transition,
    disablePortal: disablePortal,
    placement: placement,
    sx: sx,
    modifiers: modifiers
  }, children);
};
/* harmony default export */ var standard_Popper_Popper = ((/* unused pure expression or super */ null && (Popper_Popper_Popper)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/MenuItem/MenuItem.tsx

/* eslint-disable react/require-default-props */



var MenuItem_MenuItem = function MenuItem(props) {
  return /*#__PURE__*/React.createElement(MuiMenuItem, _extends({}, props, {
    onClick: props.onClick,
    disabled: props.disabled,
    divider: props.divider,
    component: props.component || 'li',
    value: props.value,
    disableRipple: props.disableRipple,
    sx: props.sx
  }), props.children);
};
/* harmony default export */ var standard_MenuItem_MenuItem = ((/* unused pure expression or super */ null && (MenuItem_MenuItem)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/MenuItem/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Avatar/Avatar.tsx
/* eslint-disable react/require-default-props */



var Avatar = function Avatar(_ref) {
  var sx = _ref.sx,
    src = _ref.src,
    id = _ref.id,
    alt = _ref.alt;
  return /*#__PURE__*/React.createElement(MuiAvatar, {
    id: id,
    sx: sx,
    src: src,
    alt: alt
  });
};
/* harmony default export */ var Avatar_Avatar = ((/* unused pure expression or super */ null && (Avatar)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Avatar/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/FormControl/FormControl.tsx


var FormControl_FormControl = function FormControl(_ref) {
  var fullWidth = _ref.fullWidth,
    children = _ref.children;
  return /*#__PURE__*/React.createElement(MuiFormControl, {
    fullWidth: fullWidth
  }, children);
};
/* harmony default export */ var standard_FormControl_FormControl = ((/* unused pure expression or super */ null && (FormControl_FormControl)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormControl/FormControlContext.js

/**
 * @ignore - internal component.
 */
const FormControlContext = /*#__PURE__*/react.createContext(undefined);
if (false) {}
/* harmony default export */ var FormControl_FormControlContext = (FormControlContext);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormControl/useFormControl.js
'use client';



function useFormControl() {
  return react.useContext(FormControl_FormControlContext);
}
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/deepmerge/deepmerge.js
var deepmerge_deepmerge = __webpack_require__(3479);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/styled-engine/index.js + 3 modules
var styled_engine = __webpack_require__(3033);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/createTheme/createTheme.js + 2 modules
var createTheme_createTheme = __webpack_require__(9731);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js
var styleFunctionSx = __webpack_require__(2733);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/createStyled.js


const createStyled_excluded = ["ownerState"],
  createStyled_excluded2 = ["variants"],
  createStyled_excluded3 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
/* eslint-disable no-underscore-dangle */






function isEmpty(obj) {
  return Object.keys(obj).length === 0;
}

// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40
function isStringTag(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;
}

// Update /system/styled/#api in case if this changes
function shouldForwardProp(prop) {
  return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
}
const systemDefaultTheme = (0,createTheme_createTheme/* default */.A)();
const lowercaseFirstLetter = string => {
  if (!string) {
    return string;
  }
  return string.charAt(0).toLowerCase() + string.slice(1);
};
function resolveTheme({
  defaultTheme,
  theme,
  themeId
}) {
  return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;
}
function defaultOverridesResolver(slot) {
  if (!slot) {
    return null;
  }
  return (props, styles) => styles[slot];
}
function processStyleArg(callableStyle, _ref) {
  let {
      ownerState
    } = _ref,
    props = (0,objectWithoutPropertiesLoose/* default */.A)(_ref, createStyled_excluded);
  const resolvedStylesArg = typeof callableStyle === 'function' ? callableStyle((0,esm_extends/* default */.A)({
    ownerState
  }, props)) : callableStyle;
  if (Array.isArray(resolvedStylesArg)) {
    return resolvedStylesArg.flatMap(resolvedStyle => processStyleArg(resolvedStyle, (0,esm_extends/* default */.A)({
      ownerState
    }, props)));
  }
  if (!!resolvedStylesArg && typeof resolvedStylesArg === 'object' && Array.isArray(resolvedStylesArg.variants)) {
    const {
        variants = []
      } = resolvedStylesArg,
      otherStyles = (0,objectWithoutPropertiesLoose/* default */.A)(resolvedStylesArg, createStyled_excluded2);
    let result = otherStyles;
    variants.forEach(variant => {
      let isMatch = true;
      if (typeof variant.props === 'function') {
        isMatch = variant.props((0,esm_extends/* default */.A)({
          ownerState
        }, props, ownerState));
      } else {
        Object.keys(variant.props).forEach(key => {
          if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {
            isMatch = false;
          }
        });
      }
      if (isMatch) {
        if (!Array.isArray(result)) {
          result = [result];
        }
        result.push(typeof variant.style === 'function' ? variant.style((0,esm_extends/* default */.A)({
          ownerState
        }, props, ownerState)) : variant.style);
      }
    });
    return result;
  }
  return resolvedStylesArg;
}
function createStyled(input = {}) {
  const {
    themeId,
    defaultTheme = systemDefaultTheme,
    rootShouldForwardProp = shouldForwardProp,
    slotShouldForwardProp = shouldForwardProp
  } = input;
  const systemSx = props => {
    return (0,styleFunctionSx/* default */.A)((0,esm_extends/* default */.A)({}, props, {
      theme: resolveTheme((0,esm_extends/* default */.A)({}, props, {
        defaultTheme,
        themeId
      }))
    }));
  };
  systemSx.__mui_systemSx = true;
  return (tag, inputOptions = {}) => {
    // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.
    (0,styled_engine.internal_processStyles)(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));
    const {
        name: componentName,
        slot: componentSlot,
        skipVariantsResolver: inputSkipVariantsResolver,
        skipSx: inputSkipSx,
        // TODO v6: remove `lowercaseFirstLetter()` in the next major release
        // For more details: https://github.com/mui/material-ui/pull/37908
        overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))
      } = inputOptions,
      options = (0,objectWithoutPropertiesLoose/* default */.A)(inputOptions, createStyled_excluded3);

    // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
    const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :
    // TODO v6: remove `Root` in the next major release
    // For more details: https://github.com/mui/material-ui/pull/37908
    componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;
    const skipSx = inputSkipSx || false;
    let label;
    if (false) {}
    let shouldForwardPropOption = shouldForwardProp;

    // TODO v6: remove `Root` in the next major release
    // For more details: https://github.com/mui/material-ui/pull/37908
    if (componentSlot === 'Root' || componentSlot === 'root') {
      shouldForwardPropOption = rootShouldForwardProp;
    } else if (componentSlot) {
      // any other slot specified
      shouldForwardPropOption = slotShouldForwardProp;
    } else if (isStringTag(tag)) {
      // for string (html) tag, preserve the behavior in emotion & styled-components.
      shouldForwardPropOption = undefined;
    }
    const defaultStyledResolver = (0,styled_engine["default"])(tag, (0,esm_extends/* default */.A)({
      shouldForwardProp: shouldForwardPropOption,
      label
    }, options));
    const transformStyleArg = stylesArg => {
      // On the server Emotion doesn't use React.forwardRef for creating components, so the created
      // component stays as a function. This condition makes sure that we do not interpolate functions
      // which are basically components used as a selectors.
      if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg || (0,deepmerge_deepmerge/* isPlainObject */.Q)(stylesArg)) {
        return props => processStyleArg(stylesArg, (0,esm_extends/* default */.A)({}, props, {
          theme: resolveTheme({
            theme: props.theme,
            defaultTheme,
            themeId
          })
        }));
      }
      return stylesArg;
    };
    const muiStyledResolver = (styleArg, ...expressions) => {
      let transformedStyleArg = transformStyleArg(styleArg);
      const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];
      if (componentName && overridesResolver) {
        expressionsWithDefaultTheme.push(props => {
          const theme = resolveTheme((0,esm_extends/* default */.A)({}, props, {
            defaultTheme,
            themeId
          }));
          if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {
            return null;
          }
          const styleOverrides = theme.components[componentName].styleOverrides;
          const resolvedStyleOverrides = {};
          // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly
          Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {
            resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, (0,esm_extends/* default */.A)({}, props, {
              theme
            }));
          });
          return overridesResolver(props, resolvedStyleOverrides);
        });
      }
      if (componentName && !skipVariantsResolver) {
        expressionsWithDefaultTheme.push(props => {
          var _theme$components;
          const theme = resolveTheme((0,esm_extends/* default */.A)({}, props, {
            defaultTheme,
            themeId
          }));
          const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;
          return processStyleArg({
            variants: themeVariants
          }, (0,esm_extends/* default */.A)({}, props, {
            theme
          }));
        });
      }
      if (!skipSx) {
        expressionsWithDefaultTheme.push(systemSx);
      }
      const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;
      if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {
        const placeholders = new Array(numOfCustomFnsApplied).fill('');
        // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.
        transformedStyleArg = [...styleArg, ...placeholders];
        transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
      }
      const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);
      if (false) {}
      if (tag.muiName) {
        Component.muiName = tag.muiName;
      }
      return Component;
    };
    if (defaultStyledResolver.withConfig) {
      muiStyledResolver.withConfig = defaultStyledResolver.withConfig;
    }
    return muiStyledResolver;
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/styled.js

const styled_styled = createStyled();
/* harmony default export */ var esm_styled = (styled_styled);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/useThemeProps/useThemeProps.js + 2 modules
var useThemeProps_useThemeProps = __webpack_require__(511);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/spacing.js + 1 modules
var system_esm_spacing = __webpack_require__(2610);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/Stack/createStack.js


const createStack_excluded = ["component", "direction", "spacing", "divider", "children", "className", "useFlexGap"];













const createStack_defaultTheme = (0,createTheme_createTheme/* default */.A)();
// widening Theme to any so that the consumer can own the theme structure.
const defaultCreateStyledComponent = esm_styled('div', {
  name: 'MuiStack',
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
});
function useThemePropsDefault(props) {
  return (0,useThemeProps_useThemeProps/* default */.A)({
    props,
    name: 'MuiStack',
    defaultTheme: createStack_defaultTheme
  });
}

/**
 * Return an array with the separator React element interspersed between
 * each React node of the input children.
 *
 * > joinChildren([1,2,3], 0)
 * [1,0,2,0,3]
 */
function joinChildren(children, separator) {
  const childrenArray = react.Children.toArray(children).filter(Boolean);
  return childrenArray.reduce((output, child, index) => {
    output.push(child);
    if (index < childrenArray.length - 1) {
      output.push( /*#__PURE__*/react.cloneElement(separator, {
        key: `separator-${index}`
      }));
    }
    return output;
  }, []);
}
const getSideFromDirection = direction => {
  return {
    row: 'Left',
    'row-reverse': 'Right',
    column: 'Top',
    'column-reverse': 'Bottom'
  }[direction];
};
const createStack_style = ({
  ownerState,
  theme
}) => {
  let styles = (0,esm_extends/* default */.A)({
    display: 'flex',
    flexDirection: 'column'
  }, (0,system_esm_breakpoints/* handleBreakpoints */.NI)({
    theme
  }, (0,system_esm_breakpoints/* resolveBreakpointValues */.kW)({
    values: ownerState.direction,
    breakpoints: theme.breakpoints.values
  }), propValue => ({
    flexDirection: propValue
  })));
  if (ownerState.spacing) {
    const transformer = (0,system_esm_spacing/* createUnarySpacing */.LX)(theme);
    const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
      if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {
        acc[breakpoint] = true;
      }
      return acc;
    }, {});
    const directionValues = (0,system_esm_breakpoints/* resolveBreakpointValues */.kW)({
      values: ownerState.direction,
      base
    });
    const spacingValues = (0,system_esm_breakpoints/* resolveBreakpointValues */.kW)({
      values: ownerState.spacing,
      base
    });
    if (typeof directionValues === 'object') {
      Object.keys(directionValues).forEach((breakpoint, index, breakpoints) => {
        const directionValue = directionValues[breakpoint];
        if (!directionValue) {
          const previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';
          directionValues[breakpoint] = previousDirectionValue;
        }
      });
    }
    const styleFromPropValue = (propValue, breakpoint) => {
      if (ownerState.useFlexGap) {
        return {
          gap: (0,system_esm_spacing/* getValue */._W)(transformer, propValue)
        };
      }
      return {
        // The useFlexGap={false} implement relies on each child to give up control of the margin.
        // We need to reset the margin to avoid double spacing.
        '& > :not(style):not(style)': {
          margin: 0
        },
        '& > :not(style) ~ :not(style)': {
          [`margin${getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)}`]: (0,system_esm_spacing/* getValue */._W)(transformer, propValue)
        }
      };
    };
    styles = (0,deepmerge_deepmerge/* default */.A)(styles, (0,system_esm_breakpoints/* handleBreakpoints */.NI)({
      theme
    }, spacingValues, styleFromPropValue));
  }
  styles = (0,system_esm_breakpoints/* mergeBreakpointsInOrder */.iZ)(theme.breakpoints, styles);
  return styles;
};
function createStack(options = {}) {
  const {
    // This will allow adding custom styled fn (for example for custom sx style function)
    createStyledComponent = defaultCreateStyledComponent,
    useThemeProps = useThemePropsDefault,
    componentName = 'MuiStack'
  } = options;
  const useUtilityClasses = () => {
    const slots = {
      root: ['root']
    };
    return (0,composeClasses/* default */.A)(slots, slot => (0,generateUtilityClass_generateUtilityClass/* default */.Ay)(componentName, slot), {});
  };
  const StackRoot = createStyledComponent(createStack_style);
  const Stack = /*#__PURE__*/react.forwardRef(function Grid(inProps, ref) {
    const themeProps = useThemeProps(inProps);
    const props = (0,extendSxProp/* default */.A)(themeProps); // `color` type conflicts with html color attribute.
    const {
        component = 'div',
        direction = 'column',
        spacing = 0,
        divider,
        children,
        className,
        useFlexGap = false
      } = props,
      other = (0,objectWithoutPropertiesLoose/* default */.A)(props, createStack_excluded);
    const ownerState = {
      direction,
      spacing,
      useFlexGap
    };
    const classes = useUtilityClasses();
    return /*#__PURE__*/(0,jsx_runtime.jsx)(StackRoot, (0,esm_extends/* default */.A)({
      as: component,
      ownerState: ownerState,
      ref: ref,
      className: (0,clsx_m/* default */.A)(classes.root, className)
    }, other, {
      children: divider ? joinChildren(children, divider) : children
    }));
  });
   false ? 0 : void 0;
  return Stack;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Stack/Stack.js
'use client';





const Stack_Stack_Stack = createStack({
  createStyledComponent: (0,styled/* default */.Ay)('div', {
    name: 'MuiStack',
    slot: 'Root',
    overridesResolver: (props, styles) => styles.root
  }),
  useThemeProps: inProps => (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiStack'
  })
});
 false ? 0 : void 0;
/* harmony default export */ var material_Stack_Stack = (Stack_Stack_Stack);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormControlLabel/formControlLabelClasses.js


function getFormControlLabelUtilityClasses(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiFormControlLabel', slot);
}
const formControlLabelClasses = (0,generateUtilityClasses/* default */.A)('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error', 'required', 'asterisk']);
/* harmony default export */ var FormControlLabel_formControlLabelClasses = (formControlLabelClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormControl/formControlState.js
function formControlState({
  props,
  states,
  muiFormControl
}) {
  return states.reduce((acc, state) => {
    acc[state] = props[state];
    if (muiFormControl) {
      if (typeof props[state] === 'undefined') {
        acc[state] = muiFormControl[state];
      }
    }
    return acc;
  }, {});
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormControlLabel/FormControlLabel.js
'use client';



const FormControlLabel_excluded = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slotProps", "value"];















const FormControlLabel_useUtilityClasses = ownerState => {
  const {
    classes,
    disabled,
    labelPlacement,
    error,
    required
  } = ownerState;
  const slots = {
    root: ['root', disabled && 'disabled', `labelPlacement${(0,utils_capitalize/* default */.A)(labelPlacement)}`, error && 'error', required && 'required'],
    label: ['label', disabled && 'disabled'],
    asterisk: ['asterisk', error && 'error']
  };
  return (0,composeClasses/* default */.A)(slots, getFormControlLabelUtilityClasses, classes);
};
const FormControlLabelRoot = (0,styled/* default */.Ay)('label', {
  name: 'MuiFormControlLabel',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [{
      [`& .${FormControlLabel_formControlLabelClasses.label}`]: styles.label
    }, styles.root, styles[`labelPlacement${(0,utils_capitalize/* default */.A)(ownerState.labelPlacement)}`]];
  }
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  display: 'inline-flex',
  alignItems: 'center',
  cursor: 'pointer',
  // For correct alignment with the text.
  verticalAlign: 'middle',
  WebkitTapHighlightColor: 'transparent',
  marginLeft: -11,
  marginRight: 16,
  // used for row presentation of radio/checkbox
  [`&.${FormControlLabel_formControlLabelClasses.disabled}`]: {
    cursor: 'default'
  }
}, ownerState.labelPlacement === 'start' && {
  flexDirection: 'row-reverse',
  marginLeft: 16,
  // used for row presentation of radio/checkbox
  marginRight: -11
}, ownerState.labelPlacement === 'top' && {
  flexDirection: 'column-reverse',
  marginLeft: 16
}, ownerState.labelPlacement === 'bottom' && {
  flexDirection: 'column',
  marginLeft: 16
}, {
  [`& .${FormControlLabel_formControlLabelClasses.label}`]: {
    [`&.${FormControlLabel_formControlLabelClasses.disabled}`]: {
      color: (theme.vars || theme).palette.text.disabled
    }
  }
}));
const AsteriskComponent = (0,styled/* default */.Ay)('span', {
  name: 'MuiFormControlLabel',
  slot: 'Asterisk',
  overridesResolver: (props, styles) => styles.asterisk
})(({
  theme
}) => ({
  [`&.${FormControlLabel_formControlLabelClasses.error}`]: {
    color: (theme.vars || theme).palette.error.main
  }
}));

/**
 * Drop-in replacement of the `Radio`, `Switch` and `Checkbox` component.
 * Use this component if you want to display an extra label.
 */
const FormControlLabel_FormControlLabel = /*#__PURE__*/react.forwardRef(function FormControlLabel(inProps, ref) {
  var _ref, _slotProps$typography;
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiFormControlLabel'
  });
  const {
      className,
      componentsProps = {},
      control,
      disabled: disabledProp,
      disableTypography,
      label: labelProp,
      labelPlacement = 'end',
      required: requiredProp,
      slotProps = {}
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, FormControlLabel_excluded);
  const muiFormControl = useFormControl();
  const disabled = (_ref = disabledProp != null ? disabledProp : control.props.disabled) != null ? _ref : muiFormControl == null ? void 0 : muiFormControl.disabled;
  const required = requiredProp != null ? requiredProp : control.props.required;
  const controlProps = {
    disabled,
    required
  };
  ['checked', 'name', 'onChange', 'value', 'inputRef'].forEach(key => {
    if (typeof control.props[key] === 'undefined' && typeof props[key] !== 'undefined') {
      controlProps[key] = props[key];
    }
  });
  const fcs = formControlState({
    props,
    muiFormControl,
    states: ['error']
  });
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    disabled,
    labelPlacement,
    required,
    error: fcs.error
  });
  const classes = FormControlLabel_useUtilityClasses(ownerState);
  const typographySlotProps = (_slotProps$typography = slotProps.typography) != null ? _slotProps$typography : componentsProps.typography;
  let label = labelProp;
  if (label != null && label.type !== material_Typography_Typography && !disableTypography) {
    label = /*#__PURE__*/(0,jsx_runtime.jsx)(material_Typography_Typography, (0,esm_extends/* default */.A)({
      component: "span"
    }, typographySlotProps, {
      className: (0,clsx_m/* default */.A)(classes.label, typographySlotProps == null ? void 0 : typographySlotProps.className),
      children: label
    }));
  }
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(FormControlLabelRoot, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ownerState: ownerState,
    ref: ref
  }, other, {
    children: [/*#__PURE__*/react.cloneElement(control, controlProps), required ? /*#__PURE__*/(0,jsx_runtime.jsxs)(material_Stack_Stack, {
      display: "block",
      children: [label, /*#__PURE__*/(0,jsx_runtime.jsxs)(AsteriskComponent, {
        ownerState: ownerState,
        "aria-hidden": true,
        className: classes.asterisk,
        children: ["\u2009", '*']
      })]
    }) : label]
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var material_FormControlLabel_FormControlLabel = (FormControlLabel_FormControlLabel);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/theme/constants/universal.ts


var componentsProperties = {
  borderWidth: 1,
  borderRadius: 4,
  spacing: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24],
  // Button and IconButton
  button: defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({
    borderRadius: '8px'
  }, ButtonSize.SMALL, {
    size: 24,
    fontSize: 11,
    letterSpacing: 0.4
  }), ButtonSize.MEDIUM, {
    size: 32,
    fontSize: 13,
    letterSpacing: 0.4
  }), ButtonSize.LARGE, {
    size: 40,
    fontSize: 13,
    letterSpacing: 0.4
  }),
  // Checkbox, Radio button and Switch
  selectionControl: defineProperty_defineProperty(defineProperty_defineProperty({}, SelectionControlSize.SMALL, {
    size: 32,
    fontSize: 14,
    lineHeight: '22px'
  }), SelectionControlSize.MEDIUM, {
    size: 40,
    fontSize: 14,
    lineHeight: '24px'
  })
};
var betweenComponentsProperties = {
  spacing: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32]
};
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/FormControlLabel/FormControlLabelProps.tsx

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/FormControlLabel/FormControlLabel.tsx

function FormControlLabel_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function FormControlLabel_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? FormControlLabel_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : FormControlLabel_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





var selectionControl = componentsProperties.selectionControl;
var StyledFormControlLabel = (0,styled/* default */.Ay)(material_FormControlLabel_FormControlLabel)(function (_ref) {
  var _ref$size = _ref.size,
    size = _ref$size === void 0 ? SelectionControlSize.SMALL : _ref$size;
  return FormControlLabel_objectSpread(FormControlLabel_objectSpread({
    marginLeft: 0
  }, size === SelectionControlSize.SMALL && {
    '& .MuiFormControlLabel-label': {
      fontSize: selectionControl[SelectionControlSize.SMALL].fontSize,
      lineHeight: selectionControl[SelectionControlSize.SMALL].lineHeight
    }
  }), size === SelectionControlSize.MEDIUM && {
    '& .MuiFormControlLabel-label': {
      fontSize: selectionControl[SelectionControlSize.MEDIUM].fontSize,
      lineHeight: selectionControl[SelectionControlSize.MEDIUM].lineHeight
    }
  });
});
var FormControlLabel_FormControlLabel_FormControlLabel = function FormControlLabel(_ref2) {
  var id = _ref2.id,
    control = _ref2.control,
    label = _ref2.label,
    labelPlacement = _ref2.labelPlacement,
    size = _ref2.size,
    value = _ref2.value,
    sx = _ref2.sx;
  return /*#__PURE__*/React.createElement(StyledFormControlLabel, {
    id: id,
    control: control,
    label: label,
    labelPlacement: labelPlacement,
    size: size,
    value: value,
    sx: sx
  });
};
/* harmony default export */ var standard_FormControlLabel_FormControlLabel = ((/* unused pure expression or super */ null && (FormControlLabel_FormControlLabel_FormControlLabel)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/FormControlLabel/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Skeleton/SkeletonProps.ts
var SkeletonProps_Variant = /*#__PURE__*/function (Variant) {
  Variant["RECTANGULAR"] = "rectangular";
  return Variant;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Skeleton/Skeleton.tsx



/**
 *
 * Demos:
 *
 * - [Skeleton](https://mui.com/material-ui/react-skeleton/)
 *
 * API:
 *
 * - [Skeleton API](https://mui.com/material-ui/api/skeleton/)
 */
var Skeleton = function Skeleton(props) {
  return /*#__PURE__*/React.createElement(MuiSkeleton, {
    variant: props.variant || Variant.RECTANGULAR,
    width: props.width,
    height: props.height
  });
};
/* harmony default export */ var Skeleton_Skeleton = ((/* unused pure expression or super */ null && (Skeleton)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Skeleton/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Paper/PaperProps.tsx
var PaperProps_Variant = /*#__PURE__*/function (Variant) {
  Variant["NORMAL"] = "normal";
  Variant["ELEVATED"] = "elevated";
  return Variant;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Paper/Paper.tsx




/**
 *
 * Demo:
 *
 * - [Paper](https://mui.com/material-ui/react-paper/)
 *
 * API:
 *
 * - [Paper API](https://mui.com/material-ui/api/paper/)
 */
var Paper_Paper_Paper = /*#__PURE__*/(/* unused pure expression or super */ null && (forwardRef(function (_ref, ref) {
  var children = _ref.children,
    _ref$variant = _ref.variant,
    variant = _ref$variant === void 0 ? Variant.NORMAL : _ref$variant,
    _ref$padding = _ref.padding,
    padding = _ref$padding === void 0 ? '0px' : _ref$padding;
  return /*#__PURE__*/React.createElement(MuiPaper, {
    elevation: 0,
    variant: variant,
    sx: {
      padding: padding
    },
    ref: ref
  }, children);
})));
/* harmony default export */ var standard_Paper_Paper = ((/* unused pure expression or super */ null && (Paper_Paper_Paper)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Paper/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Card/Card.tsx


/**
 *
 * Demos:
 *
 * - [Cards](https://mui.com/material-ui/react-card/)
 *
 * API:
 *
 * - [Card API](https://mui.com/material-ui/api/card/)
 * - inherits [Paper API](https://mui.com/material-ui/api/paper/)
 */
var Card = function Card(props) {
  return /*#__PURE__*/React.createElement(MuiCard, {
    sx: props.sx
  }, props.children);
};
/* harmony default export */ var Card_Card = ((/* unused pure expression or super */ null && (Card)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Card/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/CardMedia/CardMedia.tsx


/**
 *
 * Demos:
 *
 * - [Cards](https://mui.com/material-ui/react-card/)
 *
 * API:
 *
 * - [CardMedia API](https://mui.com/material-ui/api/card-media/)
 */
var CardMedia = function CardMedia(props) {
  return /*#__PURE__*/React.createElement(MuiCardMedia, {
    component: "img",
    image: props.image,
    alt: props.alt,
    sx: props.sx,
    title: props.title
  });
};
/* harmony default export */ var CardMedia_CardMedia = ((/* unused pure expression or super */ null && (CardMedia)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/CardMedia/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/FormHelperText/FormHelperText.tsx


var FormHelperText = function FormHelperText(props) {
  return /*#__PURE__*/React.createElement(MuiFormHelperText, {
    error: props.error
  }, props.children);
};
/* harmony default export */ var FormHelperText_FormHelperText = ((/* unused pure expression or super */ null && (FormHelperText)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/FormHelperText/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/InputLabel/InputLabel.tsx


var InputLabel_InputLabel = function InputLabel(_ref) {
  var children = _ref.children,
    sx = _ref.sx,
    htmlFor = _ref.htmlFor,
    shrink = _ref.shrink,
    required = _ref.required,
    error = _ref.error;
  return /*#__PURE__*/React.createElement(MuiInputLabel, {
    sx: sx,
    htmlFor: htmlFor,
    shrink: shrink,
    required: required,
    error: error
  }, children);
};
/* harmony default export */ var standard_InputLabel_InputLabel = ((/* unused pure expression or super */ null && (InputLabel_InputLabel)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/InputLabel/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/ButtonGroup/ButtonGroup.tsx
// @ts-nocheck



var ButtonGroup = /*#__PURE__*/(/* unused pure expression or super */ null && (forwardRef(function (props, ref) {
  return /*#__PURE__*/React.createElement(MuiButtonGroup, {
    variant: props.variant,
    color: props.color,
    ref: ref,
    sx: props.sx
  }, props.children);
})));
/* harmony default export */ var ButtonGroup_ButtonGroup = ((/* unused pure expression or super */ null && (ButtonGroup)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/ButtonGroup/ButtonGroupProps.tsx
var ButtonGroupProps_Variant = /*#__PURE__*/function (Variant) {
  Variant["CONTAINED"] = "contained";
  Variant["OUTLINED"] = "outlined";
  Variant["TEXT"] = "text";
  return Variant;
}({});
var ButtonGroupProps_Color = /*#__PURE__*/function (Color) {
  Color["INHERIT"] = "inherit";
  Color["PRIMARY"] = "primary";
  Color["SECONDARY"] = "secondary";
  Color["ERROR"] = "error";
  Color["INFO"] = "info";
  Color["SUCCESS"] = "success";
  Color["WARNING"] = "warning";
  return Color;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/DataGrid/DataGrid.tsx
// eslint-disable-next-line no-restricted-imports



var DataGrid = function DataGrid(props) {
  return /*#__PURE__*/React.createElement(MuiDataGrid, {
    columns: props.columns,
    rows: props.rows,
    autoHeight: props.autoHeight,
    getRowHeight: props.getRowHeight,
    paginationModel: props.paginationModel,
    onPaginationModelChange: props.onPaginationModelChange,
    disableColumnMenu: props.disableColumnMenu,
    disableRowSelectionOnClick: props.disableRowSelectionOnClick,
    pageSizeOptions: props.pageSizeOptions,
    initialState: props.initialState,
    sortingOrder: props.sortingOrder,
    checkboxSelection: props.checkboxSelection,
    disableColumnResize: props.disableColumnResize,
    onRowSelectionModelChange: props.onRowSelectionModelChange,
    slots: props.slots
  });
};
/* harmony default export */ var DataGrid_DataGrid = ((/* unused pure expression or super */ null && (DataGrid)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/ToggleButtonGroup/ToggleButtonGroup.tsx



/**
 *
 * Demo:
 *
 * - [ToggleButtonGroup](https://mui.com/material-ui/react-toggle-button/)
 *
 * API:
 *
 * - [ToggleButtonGroup API](https://mui.com/material-ui/api/toggle-button-group/)
 * - [ToggleButton API](https://mui.com/material-ui/api/toggle-button/)
 */
var ToggleButtonGroup = function ToggleButtonGroup(_ref) {
  var buttons = _ref.buttons,
    selected = _ref.selected,
    handleChange = _ref.handleChange,
    _ref$preventDeselecti = _ref.preventDeselection,
    preventDeselection = _ref$preventDeselecti === void 0 ? true : _ref$preventDeselecti;
  var onChange = function onChange(event, newValue) {
    if (preventDeselection && (!newValue || newValue === selected)) {
      return;
    }
    handleChange(event, newValue);
  };
  var toggleButtons = buttons.map(function (button) {
    return /*#__PURE__*/React.createElement(ToggleButton, {
      value: button.value,
      fullWidth: true,
      size: "small",
      sx: {
        textTransform: 'none'
      },
      key: button.value
    }, button.label);
  });
  return /*#__PURE__*/React.createElement(MuiToggleButtonGroup, {
    value: selected,
    exclusive: true,
    onChange: onChange,
    fullWidth: true
  }, toggleButtons);
};
/* harmony default export */ var ToggleButtonGroup_ToggleButtonGroup = ((/* unused pure expression or super */ null && (ToggleButtonGroup)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/MenuList/MenuList.tsx


var MenuList_MenuItem = function MenuItem(props) {
  return /*#__PURE__*/React.createElement(MuiMenuList, {
    sx: props.sx,
    id: props.id
  }, props.children);
};
/* harmony default export */ var MenuList = ((/* unused pure expression or super */ null && (MenuList_MenuItem)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Radio/Radio.tsx


var Radio = function Radio(props) {
  return /*#__PURE__*/React.createElement(MuiRadio, {
    checked: props.checked,
    size: props.size,
    onChange: props.onChange,
    sx: props.sx,
    disabled: props.disabled,
    disableRipple: props.disableRipple
  });
};
/* harmony default export */ var Radio_Radio = ((/* unused pure expression or super */ null && (Radio)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Select/Select.tsx


var Select = function Select(props) {
  return /*#__PURE__*/React.createElement(MuiSelect, {
    value: props.value,
    classes: props.classes,
    onChange: props.onChange,
    sx: props.sx
  }, props.children);
};
/* harmony default export */ var Select_Select = ((/* unused pure expression or super */ null && (Select)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Select/generateMenuItems.tsx


var generateMenuItems_generateMenuItems = function generateMenuItems(menuItemsProps) {
  return menuItemsProps.map(function (item) {
    return /*#__PURE__*/React.createElement(MenuItem, {
      key: item.key,
      value: item.value,
      disabled: item.disabled
    }, item.label);
  });
};
/* harmony default export */ var Select_generateMenuItems = ((/* unused pure expression or super */ null && (generateMenuItems_generateMenuItems)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Select/Select.tsx






var Select_Select_Select = function Select(_ref) {
  var disabled = _ref.disabled,
    formHelperText = _ref.formHelperText,
    id = _ref.id,
    inputLabel = _ref.inputLabel,
    menuItemsProps = _ref.menuItemsProps,
    onChange = _ref.onChange,
    size = _ref.size,
    value = _ref.value,
    _ref$width = _ref.width,
    width = _ref$width === void 0 ? '100%' : _ref$width,
    error = _ref.error,
    onFocus = _ref.onFocus,
    defaultValue = _ref.defaultValue,
    displayEmpty = _ref.displayEmpty;
  return /*#__PURE__*/React.createElement(MuiFormControl, {
    disabled: disabled,
    size: size,
    sx: {
      width: width
    },
    variant: "outlined",
    error: error,
    onFocus: onFocus
  }, inputLabel && /*#__PURE__*/React.createElement(MuiInputLabel, {
    id: "InputLabel_".concat(id),
    htmlFor: id,
    disabled: disabled
    // By default, z-index = 1 in MUI5 to ensure that the label overlaps or sits above other elements within
    //  the TextField component. In our case, it overlaps the loading state overlay.
    ,
    sx: {
      zIndex: 0
    }
  }, inputLabel), /*#__PURE__*/React.createElement(MuiSelect, {
    id: id,
    label: inputLabel,
    labelId: "InputLabel_".concat(id),
    MenuProps: {
      MenuListProps: {
        sx: {
          maxHeight: 200
        }
      }
    },
    notched: false,
    onChange: onChange,
    value: value,
    defaultValue: defaultValue,
    displayEmpty: displayEmpty
  }, generateMenuItems(menuItemsProps)), formHelperText && /*#__PURE__*/React.createElement(MuiFormHelperText, null, formHelperText));
};
/* harmony default export */ var custom_Select_Select = ((/* unused pure expression or super */ null && (Select_Select_Select)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Popover/Popover.tsx


var Popover = function Popover(props) {
  return /*#__PURE__*/React.createElement(MuiPopover, {
    id: props.id,
    open: props.open,
    onClose: props.onClose,
    anchorReference: props.anchorReference,
    anchorPosition: props.anchorPosition,
    sx: props.sx,
    anchorEl: props.anchorEl,
    anchorOrigin: props.anchorOrigin,
    transformOrigin: props.transformOrigin
  }, props.children);
};
/* harmony default export */ var Popover_Popover = ((/* unused pure expression or super */ null && (Popover)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/ToggleButtonGroup/toggleButtonGroupClasses.js


function getToggleButtonGroupUtilityClass(slot) {
  return generateUtilityClass('MuiToggleButtonGroup', slot);
}
const toggleButtonGroupClasses = (0,generateUtilityClasses/* default */.A)('MuiToggleButtonGroup', ['root', 'selected', 'vertical', 'disabled', 'grouped', 'groupedHorizontal', 'groupedVertical', 'fullWidth', 'firstButton', 'lastButton', 'middleButton']);
/* harmony default export */ var ToggleButtonGroup_toggleButtonGroupClasses = (toggleButtonGroupClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/CustomToggleButtonGroup/CustomToggleButtonGroup.tsx




var customSx = defineProperty_defineProperty(defineProperty_defineProperty({
  display: 'flex',
  gap: '6px'
}, "& .".concat(ToggleButtonGroup_toggleButtonGroupClasses.grouped), {
  borderLeft: 0,
  border: 0,
  borderRadius: '8px',
  height: '32px',
  width: 'fit-content',
  backgroundColor: 'rgba(0, 0, 0, 0.1)',
  fontSize: '12px',
  padding: '9px',
  color: '#000',
  '&:hover': {
    backgroundColor: 'rgba(0, 0, 0, 0.2)'
  }
}), "& .".concat(ToggleButtonGroup_toggleButtonGroupClasses.middleButton, ",& .").concat(ToggleButtonGroup_toggleButtonGroupClasses.lastButton), {
  marginLeft: 0,
  borderLeft: 0
});
var CustomToggleButtonGroup = function CustomToggleButtonGroup(_ref) {
  var value = _ref.value,
    listOfButtons = _ref.listOfButtons,
    onChange = _ref.onChange;
  return /*#__PURE__*/React.createElement(MuiToggleButtonGroup, {
    value: value,
    onChange: onChange,
    sx: customSx
  }, listOfButtons.map(function (option) {
    return /*#__PURE__*/React.createElement(MuiToggleButton, {
      key: option.value,
      value: option.value,
      "aria-label": option.value
    }, option.label);
  }));
};
/* harmony default export */ var CustomToggleButtonGroup_CustomToggleButtonGroup = ((/* unused pure expression or super */ null && (CustomToggleButtonGroup)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Select/SelectProps.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/standard/Popper/PopperTypes.ts
var PopperPlacement = /*#__PURE__*/function (PopperPlacement) {
  PopperPlacement["TOP_START"] = "top-start";
  PopperPlacement["TOP"] = "top";
  PopperPlacement["TOP_END"] = "top-end";
  PopperPlacement["LEFT_START"] = "left-start";
  PopperPlacement["LEFT"] = "left";
  PopperPlacement["LEFT_END"] = "left-end";
  PopperPlacement["RIGHT_START"] = "right-start";
  PopperPlacement["RIGHT"] = "right";
  PopperPlacement["RIGHT_END"] = "right-end";
  PopperPlacement["BOTTOM_START"] = "bottom-start";
  PopperPlacement["BOTTOM"] = "bottom";
  PopperPlacement["BOTTOM_END"] = "bottom-end";
  return PopperPlacement;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/icons/customIcons/Database.tsx


var Database = (0,createSvgIcon/* default */.A)(/*#__PURE__*/react.createElement("svg", {
  xmlns: "http://www.w3.org/2000/svg",
  height: "24",
  viewBox: "0 -960 960 960",
  width: "24"
}, /*#__PURE__*/react.createElement("path", {
  d: "M480-120q-151 0-255.5-46.5T120-280v-400q0-66 105.5-113T480-840q149 0 254.5 47T840-680v400q0 67-104.5 113.5T480-120Zm0-479q89 0 179-25.5T760-679q-11-29-100.5-55T480-760q-91 0-178.5 25.5T200-679q14 30 101.5 55T480-599Zm0 199q42 0 81-4t74.5-11.5q35.5-7.5 67-18.5t57.5-25v-120q-26 14-57.5 25t-67 18.5Q600-528 561-524t-81 4q-42 0-82-4t-75.5-11.5Q287-543 256-554t-56-25v120q25 14 56 25t66.5 18.5Q358-408 398-404t82 4Zm0 200q46 0 93.5-7t87.5-18.5q40-11.5 67-26t32-29.5v-98q-26 14-57.5 25t-67 18.5Q600-328 561-324t-81 4q-42 0-82-4t-75.5-11.5Q287-343 256-354t-56-25v99q5 15 31.5 29t66.5 25.5q40 11.5 88 18.5t94 7Z"
})), 'Database');
/* harmony default export */ var customIcons_Database = ((/* unused pure expression or super */ null && (Database)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/icons/customIcons/GoogleDriveMono.tsx


var GoogleDriveMono = (0,createSvgIcon/* default */.A)(/*#__PURE__*/react.createElement("svg", {
  width: "24",
  height: "24",
  viewBox: "0 0 24 24",
  fill: "auto",
  xmlns: "http://www.w3.org/2000/svg"
}, /*#__PURE__*/react.createElement("path", {
  d: "M10.358 14.8L7.366 20.2H18.008L21.001 14.8H10.357H10.358ZM8.279 5.17L3 14.722L6.035 20.197L11.315 10.644L8.279 5.168V5.17ZM20.501 13.9L15.015 4H8.945L14.423 13.9H20.501Z"
})), 'Google drive mono');
/* harmony default export */ var customIcons_GoogleDriveMono = ((/* unused pure expression or super */ null && (GoogleDriveMono)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/icons/customIcons/GoogleDriveColor.tsx


var GoogleDriveColor = (0,createSvgIcon/* default */.A)(/*#__PURE__*/react.createElement("svg", {
  width: "24",
  height: "24",
  viewBox: "0 0 24 24",
  fill: "none",
  xmlns: "http://www.w3.org/2000/svg"
}, /*#__PURE__*/react.createElement("path", {
  d: "M3.51099 18.3036L4.39239 19.826C4.57555 20.1465 4.83882 20.3984 5.14789 20.5815L8.29579 15.1328H2C2 15.4877 2.09158 15.8425 2.27473 16.163L3.51099 18.3036Z",
  fill: "#0066DA"
}), /*#__PURE__*/react.createElement("path", {
  d: "M11.9931 8.72411L8.84523 3.27539C8.53618 3.45854 8.27289 3.71037 8.08975 4.03089L2.27473 14.1041C2.09494 14.4178 2.00024 14.7729 2 15.1344H8.29579L11.9931 8.72411Z",
  fill: "#00AC47"
}), /*#__PURE__*/react.createElement("path", {
  d: "M18.8388 20.5815C19.1478 20.3984 19.4111 20.1465 19.5943 19.826L19.9606 19.1965L21.712 16.163C21.8951 15.8425 21.9867 15.4877 21.9867 15.1328H15.6904L17.0302 17.7656L18.8388 20.5815Z",
  fill: "#EA4335"
}), /*#__PURE__*/react.createElement("path", {
  d: "M11.9936 8.72345L15.1415 3.27473C14.8324 3.09158 14.4776 3 14.1113 3H9.87594C9.50963 3 9.15477 3.10302 8.8457 3.27473L11.9936 8.72345Z",
  fill: "#00832D"
}), /*#__PURE__*/react.createElement("path", {
  d: "M15.6901 15.1328H8.29535L5.14746 20.5815C5.45653 20.7647 5.81139 20.8563 6.17768 20.8563H17.8077C18.174 20.8563 18.5289 20.7532 18.8379 20.5815L15.6901 15.1328Z",
  fill: "#2684FC"
}), /*#__PURE__*/react.createElement("path", {
  d: "M18.8041 9.06752L15.8966 4.03089C15.7134 3.71037 15.4501 3.45854 15.1411 3.27539L11.9932 8.72411L15.6905 15.1344H21.9749C21.9749 14.7795 21.8833 14.4247 21.7002 14.1041L18.8041 9.06752Z",
  fill: "#FFBA00"
})), 'Google drive color');
/* harmony default export */ var customIcons_GoogleDriveColor = ((/* unused pure expression or super */ null && (GoogleDriveColor)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/icons/customIcons/Flipbook.tsx


var Flipbook = (0,createSvgIcon/* default */.A)(/*#__PURE__*/react.createElement("svg", {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24",
  width: "24",
  height: "24"
}, /*#__PURE__*/react.createElement("path", {
  /* eslint-disable-next-line max-len */
  d: "M22.775 2h-7.777a.8.8 0 0 0-.566.234L12 4.667 9.568 2.234A.8.8 0 0 0 9.002 2H1.266C.568 2 0 2.594 0 3.323v17.468C0 21.521.474 22 1.173 22h8.42l.899 1.002a1 1 0 0 0 .744.331h1.535a1 1 0 0 0 .743-.33L14.418 22h8.357c.699 0 1.225-.48 1.225-1.209V3.367C24 2.637 23.473 2 22.775 2ZM13.2 20.965l.016-13.632 1.223-2.249a.8.8 0 0 1 .703-.417h5.791a.4.4 0 0 1 .4.4v13.866a.4.4 0 0 1-.4.4h-5.999a.6.6 0 0 0-.446.2L13.2 20.964ZM10.667 7.333 9.554 5.11a.8.8 0 0 0-.715-.442H3.067a.4.4 0 0 0-.4.4v13.866a.4.4 0 0 0 .4.4h6a.6.6 0 0 1 .445.197l1.303 1.435-.148-13.632Z",
  clipRule: "evenodd",
  fill: "#fff",
  fillRule: "evenodd"
})), 'Flipbook');
/* harmony default export */ var customIcons_Flipbook = ((/* unused pure expression or super */ null && (Flipbook)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/icons/customIcons/Automation.tsx


var Automation = (0,createSvgIcon/* default */.A)(/*#__PURE__*/react.createElement("svg", {
  xmlns: "http://www.w3.org/2000/svg",
  height: "24",
  width: "24",
  viewBox: "0 0 24 24"
}, /*#__PURE__*/react.createElement("path", {
  d: "M21.994 18.847c.008-1.226.022-2.457-.038-3.683-.072-1.45-.8-2.53-2.213-2.963-.8-.243-1.096-.528-1.099-1.436-.014-3.428-2.256-6.315-5.593-7.218-.805-.219-.984-.528-.978-1.286.005-.878.42-2.21-1.006-2.26-1.575-.054-1.108 1.347-1.149 2.263-.027.627-.027 1.032-.835 1.256-3.614 1.007-5.643 3.702-5.75 7.518-.016.63-.14.884-.822 1.07C.857 12.562.063 13.72.03 15.435c-.022 1.138-.035 2.46-.025 3.412.01.95.576.86 1.053.852.477-.008 1.15.053 1.152-.842.003-.894.021-2.172.005-3.263-.011-.7.167-1.24 1.102-1.434 0 1.453-.017 2.772.002 4.088.036 2.161 1.333 3.488 3.488 3.532.665.013 1.102.112 1.545.755 1.346 1.959 3.919 1.945 5.298.008.388-.547.729-.763 1.4-.771 2.35-.025 3.6-1.322 3.624-3.661.014-1.297.003-2.594.003-3.95.937.188 1.11.73 1.102 1.43-.014 1.092.004 2.322.003 3.275-.001.953.79.824 1.173.837.383.012 1.034.076 1.04-.856zM10.84 5.377c2.811-.017 5.296 2.268 5.449 4.98.057 1.006-.335 1.538-1.388 1.525-1.353-.017-2.706-.003-4.058-.006a914.855 914.855 0 0 0-4.058 0c-.98.003-1.355-.513-1.323-1.456.085-2.686 2.57-5.027 5.378-5.043zm5.465 9.014a204.1 204.1 0 0 1-.02 3.925c-.013.76-.464 1.146-1.213 1.149-2.798.005-5.593.008-8.39 0-.831-.003-1.236-.449-1.236-1.269v-.101l-.013-3.683 10.872-.02zM8.012 8.42a1.222 1.222 0 1 1 0 2.444 1.222 1.222 0 0 1 0-2.444zm5.704 0a1.222 1.222 0 1 1 0 2.444 1.222 1.222 0 0 1 0-2.444z"
})), 'Automation');
/* harmony default export */ var customIcons_Automation = ((/* unused pure expression or super */ null && (Automation)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/icons/customIcons/Read.tsx


var Read = (0,createSvgIcon/* default */.A)(/*#__PURE__*/react.createElement("svg", {
  xmlns: "http://www.w3.org/2000/svg",
  height: "24",
  width: "24",
  viewBox: "0 0 24 24"
}, /*#__PURE__*/react.createElement("path", {
  d: "M6.146 2C4.41 2 3 3.181 3 4.93V19.02C3 20.769 4.411 22 6.146 22H20V2H6.146Zm11.883 18.02H6.633c-.89 0-1.613-.496-1.613-1.393V5.433c0-.897.724-1.384 1.613-1.384h.374v3.263c0 .895 1-.278 2-.278.455 0 .909.164 1.362.492a.4.4 0 0 0 .634-.324V4.05h7.026V20.02ZM8 12h7a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2Zm0 3h3a1 1 0 1 1 0 2H8a1 1 0 1 1 0-2Z"
})), 'Read');
/* harmony default export */ var customIcons_Read = ((/* unused pure expression or super */ null && (Read)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/icons/customIcons/Slack.tsx


var Slack = (0,createSvgIcon/* default */.A)(/*#__PURE__*/react.createElement("svg", {
  xmlns: "http://www.w3.org/2000/svg",
  width: "1em",
  height: "1em",
  viewBox: "0 0 24 24"
}, /*#__PURE__*/react.createElement("path", {
  d: "M6 15a2 2 0 0 1-2 2a2 2 0 0 1-2-2a2 2 0 0 1 2-2h2zm1 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2a2 2 0 0 1-2-2zm2-8a2 2 0 0 1-2-2a2 2 0 0 1 2-2a2 2 0 0 1 2 2v2zm0 1a2 2 0 0 1 2 2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2a2 2 0 0 1 2-2zm8 2a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2h-2zm-1 0a2 2 0 0 1-2 2a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2a2 2 0 0 1 2 2zm-2 8a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2v-2zm0-1a2 2 0 0 1-2-2a2 2 0 0 1 2-2h5a2 2 0 0 1 2 2a2 2 0 0 1-2 2z"
})), 'Slack');
/* harmony default export */ var customIcons_Slack = ((/* unused pure expression or super */ null && (Slack)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/icons/customIcons/PremiumCrown.tsx


var PremiumCrown = (0,createSvgIcon/* default */.A)(/*#__PURE__*/react.createElement("svg", {
  xmlns: "http://www.w3.org/2000/svg",
  width: "20",
  height: "20",
  viewBox: "0 0 20 20",
  fill: "none"
}, /*#__PURE__*/react.createElement("path", {
  d: "M14.3993 16.6984H5.60061C5.24192 16.6984 4.92347 16.4689 4.81004 16.1286L1.96005 7.57866 C1.84636 7.23759 2.18902 6.9223 2.51947 7.06392L7.49997 9.19842L9.60984 3.57212 C9.74502 3.21164 10.2549 3.21164 10.3901 3.57212L12.5 9.19842L17.4805 7.06392 C17.8109 6.9223 18.1536 7.23759 18.0399 7.57866L15.1899 16.1286 C15.0765 16.4689 14.758 16.6984 14.3993 16.6984Z",
  fill: "#FFC107"
})), 'Premium Crown Icon');
/* harmony default export */ var customIcons_PremiumCrown = ((/* unused pure expression or super */ null && (PremiumCrown)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/icons/index.ts
/**
 * https://docs.google.com/document/d/1JQ0FSxD2S7h9fNfiCIiW7whj5f_DJP5fhoJfzWd9qts/edit?usp=sharing
 * Always check this document before adding a new Icon
 */

// Standard MUI icons


















































































/**
 * Check '@flipsnack-ui/mui/icons' section from documentation
 * https://docs.google.com/document/d/1JQ0FSxD2S7h9fNfiCIiW7whj5f_DJP5fhoJfzWd9qts/edit?usp=sharing
 */
// Elements panel icons










































// Custom icons








;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Checkbox/Checkbox.tsx
/* eslint-disable react/require-default-props */





/**
 *
 * Demos:
 *
 * - [Checkboxes](https://mui.com/material-ui/react-checkbox/)
 * - [Transfer list](https://mui.com/material-ui/react-transfer-list/)
 *
 * API:
 *
 * - [Checkbox API](https://mui.com/material-ui/api/checkbox/)
 * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/)
 */
var Checkbox = function Checkbox(_ref) {
  var id = _ref.id,
    checked = _ref.checked,
    color = _ref.color,
    indeterminate = _ref.indeterminate,
    onChange = _ref.onChange,
    required = _ref.required,
    size = _ref.size,
    disabled = _ref.disabled,
    label = _ref.label,
    labelPlacement = _ref.labelPlacement,
    sx = _ref.sx,
    isFilled = _ref.isFilled,
    iconColor = _ref.iconColor,
    _ref$outlineColor = _ref.outlineColor,
    outlineColor = _ref$outlineColor === void 0 ? '#000' : _ref$outlineColor,
    className = _ref.className,
    disableRipple = _ref.disableRipple;
  // TODO: Review component implementation
  //  (fara conditionarea pe culoarea icoanelor, culoarea pentru disabled nu se aplica)
  var MuiCheckboxComponent = /*#__PURE__*/React.createElement(MuiCheckbox, {
    id: id,
    classes: {
      root: className
    },
    checked: checked,
    checkedIcon: isFilled ? /*#__PURE__*/React.createElement(CheckBoxFilled, {
      sx: disabled ? {} : {
        color: iconColor
      }
    }) : /*#__PURE__*/React.createElement(CheckBox, {
      sx: disabled ? {} : {
        color: iconColor
      }
    }),
    color: color,
    disabled: disabled,
    icon: /*#__PURE__*/React.createElement(CheckBoxBlank, {
      sx: disabled ? {} : {
        color: outlineColor
      }
    }),
    indeterminate: indeterminate,
    indeterminateIcon: isFilled ? /*#__PURE__*/React.createElement(IndeterminateCheckBoxFilled, {
      sx: disabled ? {} : {
        color: iconColor
      }
    }) : /*#__PURE__*/React.createElement(IndeterminateCheckBox, {
      sx: disabled ? {} : {
        color: iconColor
      }
    }),
    onChange: onChange,
    required: required,
    size: size,
    sx: sx,
    disableRipple: disableRipple
  });
  if (label) {
    return /*#__PURE__*/React.createElement(FormControlLabel, {
      control: MuiCheckboxComponent,
      label: label,
      labelPlacement: labelPlacement,
      size: size
    });
  }
  return MuiCheckboxComponent;
};
/* harmony default export */ var Checkbox_Checkbox = ((/* unused pure expression or super */ null && (Checkbox)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Checkbox/CheckboxProps.ts

var CheckboxProps_Colors = /*#__PURE__*/function (Colors) {
  Colors["PRIMARY"] = "primary";
  Colors["SECONDARY"] = "secondary";
  return Colors;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Checkbox/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/PageTitle/PageTitle.tsx





var PageTitle = function PageTitle(_ref) {
  var title = _ref.title,
    description = _ref.description;
  return /*#__PURE__*/react.createElement(material_Stack_Stack, {
    sx: {
      gap: 4,
      padding: 12,
      borderRadius: function borderRadius(theme) {
        return "".concat(theme.shape.borderRadius, "px");
      },
      backgroundColor: 'grey.100'
    }
  }, /*#__PURE__*/react.createElement(material_Typography_Typography, {
    variant: TypographyProps_Variants.H4
  }, title), /*#__PURE__*/react.createElement(material_Typography_Typography, {
    sx: {
      color: 'text.secondary',
      '&:hover': {
        color: 'text.secondary' // TODO: (TEMPORARY) remove after we don’t have < MUI5 theme provider
      }
    },
    variant: TypographyProps_Variants.BODY2
  }, description));
};
PageTitle.propTypes = {
  title: (prop_types_default()).string.isRequired,
  description: (prop_types_default()).string.isRequired
};
/* harmony default export */ var PageTitle_PageTitle = ((/* unused pure expression or super */ null && (PageTitle)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/PageTitle/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/createBox.js
'use client';



const createBox_excluded = ["className", "component"];






function createBox(options = {}) {
  const {
    themeId,
    defaultTheme,
    defaultClassName = 'MuiBox-root',
    generateClassName
  } = options;
  const BoxRoot = (0,styled_engine["default"])('div', {
    shouldForwardProp: prop => prop !== 'theme' && prop !== 'sx' && prop !== 'as'
  })(styleFunctionSx/* default */.A);
  const Box = /*#__PURE__*/react.forwardRef(function Box(inProps, ref) {
    const theme = (0,esm_useTheme/* default */.A)(defaultTheme);
    const _extendSxProp = (0,extendSxProp/* default */.A)(inProps),
      {
        className,
        component = 'div'
      } = _extendSxProp,
      other = (0,objectWithoutPropertiesLoose/* default */.A)(_extendSxProp, createBox_excluded);
    return /*#__PURE__*/(0,jsx_runtime.jsx)(BoxRoot, (0,esm_extends/* default */.A)({
      as: component,
      ref: ref,
      className: (0,clsx_m/* default */.A)(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),
      theme: themeId ? theme[themeId] || theme : theme
    }, other));
  });
  return Box;
}
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js
var ClassNameGenerator = __webpack_require__(913);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/createTheme.js + 13 modules
var material_styles_createTheme = __webpack_require__(4434);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Box/boxClasses.js

const boxClasses = (0,generateUtilityClasses/* default */.A)('MuiBox', ['root']);
/* harmony default export */ var Box_boxClasses = (boxClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Box/Box.js
'use client';







const Box_defaultTheme = (0,material_styles_createTheme/* default */.A)();
const Box_Box_Box = createBox({
  themeId: identifier/* default */.A,
  defaultTheme: Box_defaultTheme,
  defaultClassName: Box_boxClasses.root,
  generateClassName: ClassNameGenerator/* default */.A.generate
});
 false ? 0 : void 0;
/* harmony default export */ var material_Box_Box = (Box_Box_Box);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/PageSection/PageSection.tsx






var PageSection = function PageSection(_ref) {
  var title = _ref.title,
    children = _ref.children;
  return /*#__PURE__*/react.createElement(material_Stack_Stack, {
    sx: {
      padding: 12,
      gap: 9,
      borderWidth: '1px',
      borderStyle: 'solid',
      borderColor: 'other.outlinedBorder',
      borderRadius: function borderRadius(theme) {
        return "".concat(theme.shape.borderRadius, "px");
      }
    },
    component: "section"
  }, /*#__PURE__*/react.createElement(material_Typography_Typography, {
    variant: TypographyProps_Variants.H5
  }, title), /*#__PURE__*/react.createElement(material_Box_Box, null, children));
};
PageSection.propTypes = {
  title: (prop_types_default()).string.isRequired,
  children: prop_types_default().oneOfType([prop_types_default().arrayOf((prop_types_default()).node.isRequired).isRequired, (prop_types_default()).node.isRequired]).isRequired
};
/* harmony default export */ var PageSection_PageSection = ((/* unused pure expression or super */ null && (PageSection)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/PageSection/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/TabPanel/TabPanel.tsx


var tabPanel = 'tabpanel';
var TabPanel = function TabPanel(_ref) {
  var children = _ref.children,
    value = _ref.value,
    index = _ref.index,
    _ref$tabName = _ref.tabName,
    tabName = _ref$tabName === void 0 ? 'simple' : _ref$tabName;
  return /*#__PURE__*/React.createElement("div", {
    role: tabPanel,
    id: "".concat(tabName, "-").concat(tabPanel, "-").concat(index),
    "aria-labelledby": "".concat(tabName, "-tab-").concat(index)
  }, value === index && /*#__PURE__*/React.createElement(Box, null, children));
};
/* harmony default export */ var TabPanel_TabPanel = ((/* unused pure expression or super */ null && (TabPanel)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/TabPanel/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/TabBar/TabBar.tsx




/**
 *
 * Demos:
 *
 * - [TabBar](https://mui.com/material-ui/react-tabs/)
 *
 * API:
 *
 * - [TabBar API](https://mui.com/material-ui/api/tabs/)
 */

var TabBar = function TabBar(_ref) {
  var value = _ref.value,
    onChange = _ref.onChange,
    tabsList = _ref.tabsList;
  return /*#__PURE__*/React.createElement(Tabs, {
    value: value,
    onChange: onChange
  }, tabsList.map(function (tab) {
    return /*#__PURE__*/React.createElement(Tab, {
      key: tab.id,
      label: tab.label,
      id: tab.id,
      disabled: tab.disabled,
      icon: tab.icon
    });
  }));
};
/* harmony default export */ var TabBar_TabBar = ((/* unused pure expression or super */ null && (TabBar)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/TabBar/index.ts

// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js
var formatMuiErrorMessage_formatMuiErrorMessage = __webpack_require__(799);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/utils/esm/debounce/debounce.js
var debounce_debounce = __webpack_require__(9379);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/TextareaAutosize/TextareaAutosize.js
'use client';



const TextareaAutosize_excluded = ["onChange", "maxRows", "minRows", "style", "value"];





function getStyleValue(value) {
  return parseInt(value, 10) || 0;
}
const TextareaAutosize_styles = {
  shadow: {
    // Visibility needed to hide the extra text area on iPads
    visibility: 'hidden',
    // Remove from the content flow
    position: 'absolute',
    // Ignore the scrollbar width
    overflow: 'hidden',
    height: 0,
    top: 0,
    left: 0,
    // Create a new layer, increase the isolation of the computed values
    transform: 'translateZ(0)'
  }
};
function TextareaAutosize_isEmpty(obj) {
  return obj === undefined || obj === null || Object.keys(obj).length === 0 || obj.outerHeightStyle === 0 && !obj.overflowing;
}

/**
 *
 * Demos:
 *
 * - [Textarea Autosize](https://mui.com/base-ui/react-textarea-autosize/)
 * - [Textarea Autosize](https://mui.com/material-ui/react-textarea-autosize/)
 *
 * API:
 *
 * - [TextareaAutosize API](https://mui.com/base-ui/react-textarea-autosize/components-api/#textarea-autosize)
 */
const TextareaAutosize = /*#__PURE__*/react.forwardRef(function TextareaAutosize(props, forwardedRef) {
  const {
      onChange,
      maxRows,
      minRows = 1,
      style,
      value
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, TextareaAutosize_excluded);
  const {
    current: isControlled
  } = react.useRef(value != null);
  const inputRef = react.useRef(null);
  const handleRef = (0,useForkRef_useForkRef/* default */.A)(forwardedRef, inputRef);
  const shadowRef = react.useRef(null);
  const calculateTextareaStyles = react.useCallback(() => {
    const input = inputRef.current;
    const containerWindow = (0,ownerWindow/* default */.A)(input);
    const computedStyle = containerWindow.getComputedStyle(input);

    // If input's width is shrunk and it's not visible, don't sync height.
    if (computedStyle.width === '0px') {
      return {
        outerHeightStyle: 0,
        overflowing: false
      };
    }
    const inputShallow = shadowRef.current;
    inputShallow.style.width = computedStyle.width;
    inputShallow.value = input.value || props.placeholder || 'x';
    if (inputShallow.value.slice(-1) === '\n') {
      // Certain fonts which overflow the line height will cause the textarea
      // to report a different scrollHeight depending on whether the last line
      // is empty. Make it non-empty to avoid this issue.
      inputShallow.value += ' ';
    }
    const boxSizing = computedStyle.boxSizing;
    const padding = getStyleValue(computedStyle.paddingBottom) + getStyleValue(computedStyle.paddingTop);
    const border = getStyleValue(computedStyle.borderBottomWidth) + getStyleValue(computedStyle.borderTopWidth);

    // The height of the inner content
    const innerHeight = inputShallow.scrollHeight;

    // Measure height of a textarea with a single row
    inputShallow.value = 'x';
    const singleRowHeight = inputShallow.scrollHeight;

    // The height of the outer content
    let outerHeight = innerHeight;
    if (minRows) {
      outerHeight = Math.max(Number(minRows) * singleRowHeight, outerHeight);
    }
    if (maxRows) {
      outerHeight = Math.min(Number(maxRows) * singleRowHeight, outerHeight);
    }
    outerHeight = Math.max(outerHeight, singleRowHeight);

    // Take the box sizing into account for applying this value as a style.
    const outerHeightStyle = outerHeight + (boxSizing === 'border-box' ? padding + border : 0);
    const overflowing = Math.abs(outerHeight - innerHeight) <= 1;
    return {
      outerHeightStyle,
      overflowing
    };
  }, [maxRows, minRows, props.placeholder]);
  const syncHeight = react.useCallback(() => {
    const textareaStyles = calculateTextareaStyles();
    if (TextareaAutosize_isEmpty(textareaStyles)) {
      return;
    }
    const input = inputRef.current;
    input.style.height = `${textareaStyles.outerHeightStyle}px`;
    input.style.overflow = textareaStyles.overflowing ? 'hidden' : '';
  }, [calculateTextareaStyles]);
  (0,useEnhancedEffect_useEnhancedEffect/* default */.A)(() => {
    const handleResize = () => {
      syncHeight();
    };
    // Workaround a "ResizeObserver loop completed with undelivered notifications" error
    // in test.
    // Note that we might need to use this logic in production per https://github.com/WICG/resize-observer/issues/38
    // Also see https://github.com/mui/mui-x/issues/8733
    let rAF;
    const rAFHandleResize = () => {
      cancelAnimationFrame(rAF);
      rAF = requestAnimationFrame(() => {
        handleResize();
      });
    };
    const debounceHandleResize = (0,debounce_debounce/* default */.A)(handleResize);
    const input = inputRef.current;
    const containerWindow = (0,ownerWindow/* default */.A)(input);
    containerWindow.addEventListener('resize', debounceHandleResize);
    let resizeObserver;
    if (typeof ResizeObserver !== 'undefined') {
      resizeObserver = new ResizeObserver( false ? 0 : handleResize);
      resizeObserver.observe(input);
    }
    return () => {
      debounceHandleResize.clear();
      cancelAnimationFrame(rAF);
      containerWindow.removeEventListener('resize', debounceHandleResize);
      if (resizeObserver) {
        resizeObserver.disconnect();
      }
    };
  }, [calculateTextareaStyles, syncHeight]);
  (0,useEnhancedEffect_useEnhancedEffect/* default */.A)(() => {
    syncHeight();
  });
  const handleChange = event => {
    if (!isControlled) {
      syncHeight();
    }
    if (onChange) {
      onChange(event);
    }
  };
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
    children: [/*#__PURE__*/(0,jsx_runtime.jsx)("textarea", (0,esm_extends/* default */.A)({
      value: value,
      onChange: handleChange,
      ref: handleRef
      // Apply the rows prop to get a "correct" first SSR paint
      ,
      rows: minRows,
      style: style
    }, other)), /*#__PURE__*/(0,jsx_runtime.jsx)("textarea", {
      "aria-hidden": true,
      className: props.className,
      readOnly: true,
      ref: shadowRef,
      tabIndex: -1,
      style: (0,esm_extends/* default */.A)({}, TextareaAutosize_styles.shadow, style, {
        paddingTop: 0,
        paddingBottom: 0
      })
    })]
  });
});
 false ? 0 : void 0;

// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/useEnhancedEffect.js
var utils_useEnhancedEffect = __webpack_require__(5504);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles.js
var GlobalStyles = __webpack_require__(2722);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.js
'use client';






function GlobalStyles_GlobalStyles({
  styles,
  themeId,
  defaultTheme = {}
}) {
  const upperTheme = (0,esm_useTheme/* default */.A)(defaultTheme);
  const globalStyles = typeof styles === 'function' ? styles(themeId ? upperTheme[themeId] || upperTheme : upperTheme) : styles;
  return /*#__PURE__*/(0,jsx_runtime.jsx)(GlobalStyles/* default */.A, {
    styles: globalStyles
  });
}
 false ? 0 : void 0;
/* harmony default export */ var esm_GlobalStyles_GlobalStyles = (GlobalStyles_GlobalStyles);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/GlobalStyles/GlobalStyles.js
'use client';








function GlobalStyles_GlobalStyles_GlobalStyles(props) {
  return /*#__PURE__*/(0,jsx_runtime.jsx)(esm_GlobalStyles_GlobalStyles, (0,esm_extends/* default */.A)({}, props, {
    defaultTheme: material_styles_defaultTheme/* default */.A,
    themeId: identifier/* default */.A
  }));
}
 false ? 0 : void 0;
/* harmony default export */ var material_GlobalStyles_GlobalStyles = (GlobalStyles_GlobalStyles_GlobalStyles);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/InputBase/utils.js
// Supports determination of isControlled().
// Controlled input accepts its current value as a prop.
//
// @see https://facebook.github.io/react/docs/forms.html#controlled-components
// @param value
// @returns {boolean} true if string (including '') or number (including zero)
function hasValue(value) {
  return value != null && !(Array.isArray(value) && value.length === 0);
}

// Determine if field is empty or filled.
// Response determines if label is presented above field or as placeholder.
//
// @param obj
// @param SSR
// @returns {boolean} False when not present or empty string.
//                    True when any number or string with length.
function isFilled(obj, SSR = false) {
  return obj && (hasValue(obj.value) && obj.value !== '' || SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '');
}

// Determine if an Input is adorned on start.
// It's corresponding to the left with LTR.
//
// @param obj
// @returns {boolean} False when no adornments.
//                    True when adorned at the start.
function isAdornedStart(obj) {
  return obj.startAdornment;
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/InputBase/inputBaseClasses.js


function getInputBaseUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiInputBase', slot);
}
const inputBaseClasses = (0,generateUtilityClasses/* default */.A)('MuiInputBase', ['root', 'formControl', 'focused', 'disabled', 'adornedStart', 'adornedEnd', 'error', 'sizeSmall', 'multiline', 'colorSecondary', 'fullWidth', 'hiddenLabel', 'readOnly', 'input', 'inputSizeSmall', 'inputMultiline', 'inputTypeSearch', 'inputAdornedStart', 'inputAdornedEnd', 'inputHiddenLabel']);
/* harmony default export */ var InputBase_inputBaseClasses = (inputBaseClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/InputBase/InputBase.js
'use client';




const InputBase_excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "slotProps", "slots", "startAdornment", "type", "value"];





















const rootOverridesResolver = (props, styles) => {
  const {
    ownerState
  } = props;
  return [styles.root, ownerState.formControl && styles.formControl, ownerState.startAdornment && styles.adornedStart, ownerState.endAdornment && styles.adornedEnd, ownerState.error && styles.error, ownerState.size === 'small' && styles.sizeSmall, ownerState.multiline && styles.multiline, ownerState.color && styles[`color${(0,utils_capitalize/* default */.A)(ownerState.color)}`], ownerState.fullWidth && styles.fullWidth, ownerState.hiddenLabel && styles.hiddenLabel];
};
const inputOverridesResolver = (props, styles) => {
  const {
    ownerState
  } = props;
  return [styles.input, ownerState.size === 'small' && styles.inputSizeSmall, ownerState.multiline && styles.inputMultiline, ownerState.type === 'search' && styles.inputTypeSearch, ownerState.startAdornment && styles.inputAdornedStart, ownerState.endAdornment && styles.inputAdornedEnd, ownerState.hiddenLabel && styles.inputHiddenLabel];
};
const InputBase_useUtilityClasses = ownerState => {
  const {
    classes,
    color,
    disabled,
    error,
    endAdornment,
    focused,
    formControl,
    fullWidth,
    hiddenLabel,
    multiline,
    readOnly,
    size,
    startAdornment,
    type
  } = ownerState;
  const slots = {
    root: ['root', `color${(0,utils_capitalize/* default */.A)(color)}`, disabled && 'disabled', error && 'error', fullWidth && 'fullWidth', focused && 'focused', formControl && 'formControl', size && size !== 'medium' && `size${(0,utils_capitalize/* default */.A)(size)}`, multiline && 'multiline', startAdornment && 'adornedStart', endAdornment && 'adornedEnd', hiddenLabel && 'hiddenLabel', readOnly && 'readOnly'],
    input: ['input', disabled && 'disabled', type === 'search' && 'inputTypeSearch', multiline && 'inputMultiline', size === 'small' && 'inputSizeSmall', hiddenLabel && 'inputHiddenLabel', startAdornment && 'inputAdornedStart', endAdornment && 'inputAdornedEnd', readOnly && 'readOnly']
  };
  return (0,composeClasses/* default */.A)(slots, getInputBaseUtilityClass, classes);
};
const InputBaseRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiInputBase',
  slot: 'Root',
  overridesResolver: rootOverridesResolver
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({}, theme.typography.body1, {
  color: (theme.vars || theme).palette.text.primary,
  lineHeight: '1.4375em',
  // 23px
  boxSizing: 'border-box',
  // Prevent padding issue with fullWidth.
  position: 'relative',
  cursor: 'text',
  display: 'inline-flex',
  alignItems: 'center',
  [`&.${InputBase_inputBaseClasses.disabled}`]: {
    color: (theme.vars || theme).palette.text.disabled,
    cursor: 'default'
  }
}, ownerState.multiline && (0,esm_extends/* default */.A)({
  padding: '4px 0 5px'
}, ownerState.size === 'small' && {
  paddingTop: 1
}), ownerState.fullWidth && {
  width: '100%'
}));
const InputBaseComponent = (0,styled/* default */.Ay)('input', {
  name: 'MuiInputBase',
  slot: 'Input',
  overridesResolver: inputOverridesResolver
})(({
  theme,
  ownerState
}) => {
  const light = theme.palette.mode === 'light';
  const placeholder = (0,esm_extends/* default */.A)({
    color: 'currentColor'
  }, theme.vars ? {
    opacity: theme.vars.opacity.inputPlaceholder
  } : {
    opacity: light ? 0.42 : 0.5
  }, {
    transition: theme.transitions.create('opacity', {
      duration: theme.transitions.duration.shorter
    })
  });
  const placeholderHidden = {
    opacity: '0 !important'
  };
  const placeholderVisible = theme.vars ? {
    opacity: theme.vars.opacity.inputPlaceholder
  } : {
    opacity: light ? 0.42 : 0.5
  };
  return (0,esm_extends/* default */.A)({
    font: 'inherit',
    letterSpacing: 'inherit',
    color: 'currentColor',
    padding: '4px 0 5px',
    border: 0,
    boxSizing: 'content-box',
    background: 'none',
    height: '1.4375em',
    // Reset 23pxthe native input line-height
    margin: 0,
    // Reset for Safari
    WebkitTapHighlightColor: 'transparent',
    display: 'block',
    // Make the flex item shrink with Firefox
    minWidth: 0,
    width: '100%',
    // Fix IE11 width issue
    animationName: 'mui-auto-fill-cancel',
    animationDuration: '10ms',
    '&::-webkit-input-placeholder': placeholder,
    '&::-moz-placeholder': placeholder,
    // Firefox 19+
    '&:-ms-input-placeholder': placeholder,
    // IE11
    '&::-ms-input-placeholder': placeholder,
    // Edge
    '&:focus': {
      outline: 0
    },
    // Reset Firefox invalid required input style
    '&:invalid': {
      boxShadow: 'none'
    },
    '&::-webkit-search-decoration': {
      // Remove the padding when type=search.
      WebkitAppearance: 'none'
    },
    // Show and hide the placeholder logic
    [`label[data-shrink=false] + .${InputBase_inputBaseClasses.formControl} &`]: {
      '&::-webkit-input-placeholder': placeholderHidden,
      '&::-moz-placeholder': placeholderHidden,
      // Firefox 19+
      '&:-ms-input-placeholder': placeholderHidden,
      // IE11
      '&::-ms-input-placeholder': placeholderHidden,
      // Edge
      '&:focus::-webkit-input-placeholder': placeholderVisible,
      '&:focus::-moz-placeholder': placeholderVisible,
      // Firefox 19+
      '&:focus:-ms-input-placeholder': placeholderVisible,
      // IE11
      '&:focus::-ms-input-placeholder': placeholderVisible // Edge
    },
    [`&.${InputBase_inputBaseClasses.disabled}`]: {
      opacity: 1,
      // Reset iOS opacity
      WebkitTextFillColor: (theme.vars || theme).palette.text.disabled // Fix opacity Safari bug
    },
    '&:-webkit-autofill': {
      animationDuration: '5000s',
      animationName: 'mui-auto-fill'
    }
  }, ownerState.size === 'small' && {
    paddingTop: 1
  }, ownerState.multiline && {
    height: 'auto',
    resize: 'none',
    padding: 0,
    paddingTop: 0
  }, ownerState.type === 'search' && {
    // Improve type search style.
    MozAppearance: 'textfield'
  });
});
const inputGlobalStyles = /*#__PURE__*/(0,jsx_runtime.jsx)(material_GlobalStyles_GlobalStyles, {
  styles: {
    '@keyframes mui-auto-fill': {
      from: {
        display: 'block'
      }
    },
    '@keyframes mui-auto-fill-cancel': {
      from: {
        display: 'block'
      }
    }
  }
});

/**
 * `InputBase` contains as few styles as possible.
 * It aims to be a simple building block for creating an input.
 * It contains a load of style reset and some state logic.
 */
const InputBase = /*#__PURE__*/react.forwardRef(function InputBase(inProps, ref) {
  var _slotProps$input;
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiInputBase'
  });
  const {
      'aria-describedby': ariaDescribedby,
      autoComplete,
      autoFocus,
      className,
      components = {},
      componentsProps = {},
      defaultValue,
      disabled,
      disableInjectingGlobalStyles,
      endAdornment,
      fullWidth = false,
      id,
      inputComponent = 'input',
      inputProps: inputPropsProp = {},
      inputRef: inputRefProp,
      maxRows,
      minRows,
      multiline = false,
      name,
      onBlur,
      onChange,
      onClick,
      onFocus,
      onKeyDown,
      onKeyUp,
      placeholder,
      readOnly,
      renderSuffix,
      rows,
      slotProps = {},
      slots = {},
      startAdornment,
      type = 'text',
      value: valueProp
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, InputBase_excluded);
  const value = inputPropsProp.value != null ? inputPropsProp.value : valueProp;
  const {
    current: isControlled
  } = react.useRef(value != null);
  const inputRef = react.useRef();
  const handleInputRefWarning = react.useCallback(instance => {
    if (false) {}
  }, []);
  const handleInputRef = (0,utils_useForkRef/* default */.A)(inputRef, inputRefProp, inputPropsProp.ref, handleInputRefWarning);
  const [focused, setFocused] = react.useState(false);
  const muiFormControl = useFormControl();
  if (false) {}
  const fcs = formControlState({
    props,
    muiFormControl,
    states: ['color', 'disabled', 'error', 'hiddenLabel', 'size', 'required', 'filled']
  });
  fcs.focused = muiFormControl ? muiFormControl.focused : focused;

  // The blur won't fire when the disabled state is set on a focused input.
  // We need to book keep the focused state manually.
  react.useEffect(() => {
    if (!muiFormControl && disabled && focused) {
      setFocused(false);
      if (onBlur) {
        onBlur();
      }
    }
  }, [muiFormControl, disabled, focused, onBlur]);
  const onFilled = muiFormControl && muiFormControl.onFilled;
  const onEmpty = muiFormControl && muiFormControl.onEmpty;
  const checkDirty = react.useCallback(obj => {
    if (isFilled(obj)) {
      if (onFilled) {
        onFilled();
      }
    } else if (onEmpty) {
      onEmpty();
    }
  }, [onFilled, onEmpty]);
  (0,utils_useEnhancedEffect/* default */.A)(() => {
    if (isControlled) {
      checkDirty({
        value
      });
    }
  }, [value, checkDirty, isControlled]);
  const handleFocus = event => {
    // Fix a bug with IE11 where the focus/blur events are triggered
    // while the component is disabled.
    if (fcs.disabled) {
      event.stopPropagation();
      return;
    }
    if (onFocus) {
      onFocus(event);
    }
    if (inputPropsProp.onFocus) {
      inputPropsProp.onFocus(event);
    }
    if (muiFormControl && muiFormControl.onFocus) {
      muiFormControl.onFocus(event);
    } else {
      setFocused(true);
    }
  };
  const handleBlur = event => {
    if (onBlur) {
      onBlur(event);
    }
    if (inputPropsProp.onBlur) {
      inputPropsProp.onBlur(event);
    }
    if (muiFormControl && muiFormControl.onBlur) {
      muiFormControl.onBlur(event);
    } else {
      setFocused(false);
    }
  };
  const handleChange = (event, ...args) => {
    if (!isControlled) {
      const element = event.target || inputRef.current;
      if (element == null) {
        throw new Error( false ? 0 : (0,formatMuiErrorMessage_formatMuiErrorMessage/* default */.A)(1));
      }
      checkDirty({
        value: element.value
      });
    }
    if (inputPropsProp.onChange) {
      inputPropsProp.onChange(event, ...args);
    }

    // Perform in the willUpdate
    if (onChange) {
      onChange(event, ...args);
    }
  };

  // Check the input state on mount, in case it was filled by the user
  // or auto filled by the browser before the hydration (for SSR).
  react.useEffect(() => {
    checkDirty(inputRef.current);
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);
  const handleClick = event => {
    if (inputRef.current && event.currentTarget === event.target) {
      inputRef.current.focus();
    }
    if (onClick) {
      onClick(event);
    }
  };
  let InputComponent = inputComponent;
  let inputProps = inputPropsProp;
  if (multiline && InputComponent === 'input') {
    if (rows) {
      if (false) {}
      inputProps = (0,esm_extends/* default */.A)({
        type: undefined,
        minRows: rows,
        maxRows: rows
      }, inputProps);
    } else {
      inputProps = (0,esm_extends/* default */.A)({
        type: undefined,
        maxRows,
        minRows
      }, inputProps);
    }
    InputComponent = TextareaAutosize;
  }
  const handleAutoFill = event => {
    // Provide a fake value as Chrome might not let you access it for security reasons.
    checkDirty(event.animationName === 'mui-auto-fill-cancel' ? inputRef.current : {
      value: 'x'
    });
  };
  react.useEffect(() => {
    if (muiFormControl) {
      muiFormControl.setAdornedStart(Boolean(startAdornment));
    }
  }, [muiFormControl, startAdornment]);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    color: fcs.color || 'primary',
    disabled: fcs.disabled,
    endAdornment,
    error: fcs.error,
    focused: fcs.focused,
    formControl: muiFormControl,
    fullWidth,
    hiddenLabel: fcs.hiddenLabel,
    multiline,
    size: fcs.size,
    startAdornment,
    type
  });
  const classes = InputBase_useUtilityClasses(ownerState);
  const Root = slots.root || components.Root || InputBaseRoot;
  const rootProps = slotProps.root || componentsProps.root || {};
  const Input = slots.input || components.Input || InputBaseComponent;
  inputProps = (0,esm_extends/* default */.A)({}, inputProps, (_slotProps$input = slotProps.input) != null ? _slotProps$input : componentsProps.input);
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
    children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/(0,jsx_runtime.jsxs)(Root, (0,esm_extends/* default */.A)({}, rootProps, !isHostComponent(Root) && {
      ownerState: (0,esm_extends/* default */.A)({}, ownerState, rootProps.ownerState)
    }, {
      ref: ref,
      onClick: handleClick
    }, other, {
      className: (0,clsx_m/* default */.A)(classes.root, rootProps.className, className, readOnly && 'MuiInputBase-readOnly'),
      children: [startAdornment, /*#__PURE__*/(0,jsx_runtime.jsx)(FormControl_FormControlContext.Provider, {
        value: null,
        children: /*#__PURE__*/(0,jsx_runtime.jsx)(Input, (0,esm_extends/* default */.A)({
          ownerState: ownerState,
          "aria-invalid": fcs.error,
          "aria-describedby": ariaDescribedby,
          autoComplete: autoComplete,
          autoFocus: autoFocus,
          defaultValue: defaultValue,
          disabled: fcs.disabled,
          id: id,
          onAnimationStart: handleAutoFill,
          name: name,
          placeholder: placeholder,
          readOnly: readOnly,
          required: fcs.required,
          rows: rows,
          value: value,
          onKeyDown: onKeyDown,
          onKeyUp: onKeyUp,
          type: type
        }, inputProps, !isHostComponent(Input) && {
          as: InputComponent,
          ownerState: (0,esm_extends/* default */.A)({}, ownerState, inputProps.ownerState)
        }, {
          ref: handleInputRef,
          className: (0,clsx_m/* default */.A)(classes.input, inputProps.className, readOnly && 'MuiInputBase-readOnly'),
          onBlur: handleBlur,
          onChange: handleChange,
          onFocus: handleFocus
        }))
      }), endAdornment, renderSuffix ? renderSuffix((0,esm_extends/* default */.A)({}, fcs, {
        startAdornment
      })) : null]
    }))]
  });
});
 false ? 0 : void 0;
/* harmony default export */ var InputBase_InputBase = (InputBase);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/rootShouldForwardProp.js
var rootShouldForwardProp = __webpack_require__(5740);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Input/inputClasses.js




function getInputUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiInput', slot);
}
const inputClasses = (0,esm_extends/* default */.A)({}, InputBase_inputBaseClasses, (0,generateUtilityClasses/* default */.A)('MuiInput', ['root', 'underline', 'input']));
/* harmony default export */ var Input_inputClasses = (inputClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Input/Input.js
'use client';



const Input_excluded = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "slotProps", "slots", "type"];











const Input_useUtilityClasses = ownerState => {
  const {
    classes,
    disableUnderline
  } = ownerState;
  const slots = {
    root: ['root', !disableUnderline && 'underline'],
    input: ['input']
  };
  const composedClasses = (0,composeClasses/* default */.A)(slots, getInputUtilityClass, classes);
  return (0,esm_extends/* default */.A)({}, classes, composedClasses);
};
const InputRoot = (0,styled/* default */.Ay)(InputBaseRoot, {
  shouldForwardProp: prop => (0,rootShouldForwardProp/* default */.A)(prop) || prop === 'classes',
  name: 'MuiInput',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [...rootOverridesResolver(props, styles), !ownerState.disableUnderline && styles.underline];
  }
})(({
  theme,
  ownerState
}) => {
  const light = theme.palette.mode === 'light';
  let bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
  if (theme.vars) {
    bottomLineColor = `rgba(${theme.vars.palette.common.onBackgroundChannel} / ${theme.vars.opacity.inputUnderline})`;
  }
  return (0,esm_extends/* default */.A)({
    position: 'relative'
  }, ownerState.formControl && {
    'label + &': {
      marginTop: 16
    }
  }, !ownerState.disableUnderline && {
    '&::after': {
      borderBottom: `2px solid ${(theme.vars || theme).palette[ownerState.color].main}`,
      left: 0,
      bottom: 0,
      // Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
      content: '""',
      position: 'absolute',
      right: 0,
      transform: 'scaleX(0)',
      transition: theme.transitions.create('transform', {
        duration: theme.transitions.duration.shorter,
        easing: theme.transitions.easing.easeOut
      }),
      pointerEvents: 'none' // Transparent to the hover style.
    },
    [`&.${Input_inputClasses.focused}:after`]: {
      // translateX(0) is a workaround for Safari transform scale bug
      // See https://github.com/mui/material-ui/issues/31766
      transform: 'scaleX(1) translateX(0)'
    },
    [`&.${Input_inputClasses.error}`]: {
      '&::before, &::after': {
        borderBottomColor: (theme.vars || theme).palette.error.main
      }
    },
    '&::before': {
      borderBottom: `1px solid ${bottomLineColor}`,
      left: 0,
      bottom: 0,
      // Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
      content: '"\\00a0"',
      position: 'absolute',
      right: 0,
      transition: theme.transitions.create('border-bottom-color', {
        duration: theme.transitions.duration.shorter
      }),
      pointerEvents: 'none' // Transparent to the hover style.
    },
    [`&:hover:not(.${Input_inputClasses.disabled}, .${Input_inputClasses.error}):before`]: {
      borderBottom: `2px solid ${(theme.vars || theme).palette.text.primary}`,
      // Reset on touch devices, it doesn't add specificity
      '@media (hover: none)': {
        borderBottom: `1px solid ${bottomLineColor}`
      }
    },
    [`&.${Input_inputClasses.disabled}:before`]: {
      borderBottomStyle: 'dotted'
    }
  });
});
const InputInput = (0,styled/* default */.Ay)(InputBaseComponent, {
  name: 'MuiInput',
  slot: 'Input',
  overridesResolver: inputOverridesResolver
})({});
const Input = /*#__PURE__*/react.forwardRef(function Input(inProps, ref) {
  var _ref, _slots$root, _ref2, _slots$input;
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiInput'
  });
  const {
      disableUnderline,
      components = {},
      componentsProps: componentsPropsProp,
      fullWidth = false,
      inputComponent = 'input',
      multiline = false,
      slotProps,
      slots = {},
      type = 'text'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Input_excluded);
  const classes = Input_useUtilityClasses(props);
  const ownerState = {
    disableUnderline
  };
  const inputComponentsProps = {
    root: {
      ownerState
    }
  };
  const componentsProps = (slotProps != null ? slotProps : componentsPropsProp) ? (0,deepmerge_deepmerge/* default */.A)(slotProps != null ? slotProps : componentsPropsProp, inputComponentsProps) : inputComponentsProps;
  const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : InputRoot;
  const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : InputInput;
  return /*#__PURE__*/(0,jsx_runtime.jsx)(InputBase_InputBase, (0,esm_extends/* default */.A)({
    slots: {
      root: RootSlot,
      input: InputSlot
    },
    slotProps: componentsProps,
    fullWidth: fullWidth,
    inputComponent: inputComponent,
    multiline: multiline,
    ref: ref,
    type: type
  }, other, {
    classes: classes
  }));
});
 false ? 0 : void 0;
Input.muiName = 'Input';
/* harmony default export */ var Input_Input = (Input);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FilledInput/filledInputClasses.js




function getFilledInputUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiFilledInput', slot);
}
const filledInputClasses = (0,esm_extends/* default */.A)({}, InputBase_inputBaseClasses, (0,generateUtilityClasses/* default */.A)('MuiFilledInput', ['root', 'underline', 'input']));
/* harmony default export */ var FilledInput_filledInputClasses = (filledInputClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FilledInput/FilledInput.js
'use client';



const FilledInput_excluded = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "slotProps", "slots", "type"];











const FilledInput_useUtilityClasses = ownerState => {
  const {
    classes,
    disableUnderline
  } = ownerState;
  const slots = {
    root: ['root', !disableUnderline && 'underline'],
    input: ['input']
  };
  const composedClasses = (0,composeClasses/* default */.A)(slots, getFilledInputUtilityClass, classes);
  return (0,esm_extends/* default */.A)({}, classes, composedClasses);
};
const FilledInputRoot = (0,styled/* default */.Ay)(InputBaseRoot, {
  shouldForwardProp: prop => (0,rootShouldForwardProp/* default */.A)(prop) || prop === 'classes',
  name: 'MuiFilledInput',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [...rootOverridesResolver(props, styles), !ownerState.disableUnderline && styles.underline];
  }
})(({
  theme,
  ownerState
}) => {
  var _palette;
  const light = theme.palette.mode === 'light';
  const bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
  const backgroundColor = light ? 'rgba(0, 0, 0, 0.06)' : 'rgba(255, 255, 255, 0.09)';
  const hoverBackground = light ? 'rgba(0, 0, 0, 0.09)' : 'rgba(255, 255, 255, 0.13)';
  const disabledBackground = light ? 'rgba(0, 0, 0, 0.12)' : 'rgba(255, 255, 255, 0.12)';
  return (0,esm_extends/* default */.A)({
    position: 'relative',
    backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor,
    borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,
    borderTopRightRadius: (theme.vars || theme).shape.borderRadius,
    transition: theme.transitions.create('background-color', {
      duration: theme.transitions.duration.shorter,
      easing: theme.transitions.easing.easeOut
    }),
    '&:hover': {
      backgroundColor: theme.vars ? theme.vars.palette.FilledInput.hoverBg : hoverBackground,
      // Reset on touch devices, it doesn't add specificity
      '@media (hover: none)': {
        backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor
      }
    },
    [`&.${FilledInput_filledInputClasses.focused}`]: {
      backgroundColor: theme.vars ? theme.vars.palette.FilledInput.bg : backgroundColor
    },
    [`&.${FilledInput_filledInputClasses.disabled}`]: {
      backgroundColor: theme.vars ? theme.vars.palette.FilledInput.disabledBg : disabledBackground
    }
  }, !ownerState.disableUnderline && {
    '&::after': {
      borderBottom: `2px solid ${(_palette = (theme.vars || theme).palette[ownerState.color || 'primary']) == null ? void 0 : _palette.main}`,
      left: 0,
      bottom: 0,
      // Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
      content: '""',
      position: 'absolute',
      right: 0,
      transform: 'scaleX(0)',
      transition: theme.transitions.create('transform', {
        duration: theme.transitions.duration.shorter,
        easing: theme.transitions.easing.easeOut
      }),
      pointerEvents: 'none' // Transparent to the hover style.
    },
    [`&.${FilledInput_filledInputClasses.focused}:after`]: {
      // translateX(0) is a workaround for Safari transform scale bug
      // See https://github.com/mui/material-ui/issues/31766
      transform: 'scaleX(1) translateX(0)'
    },
    [`&.${FilledInput_filledInputClasses.error}`]: {
      '&::before, &::after': {
        borderBottomColor: (theme.vars || theme).palette.error.main
      }
    },
    '&::before': {
      borderBottom: `1px solid ${theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / ${theme.vars.opacity.inputUnderline})` : bottomLineColor}`,
      left: 0,
      bottom: 0,
      // Doing the other way around crash on IE11 "''" https://github.com/cssinjs/jss/issues/242
      content: '"\\00a0"',
      position: 'absolute',
      right: 0,
      transition: theme.transitions.create('border-bottom-color', {
        duration: theme.transitions.duration.shorter
      }),
      pointerEvents: 'none' // Transparent to the hover style.
    },
    [`&:hover:not(.${FilledInput_filledInputClasses.disabled}, .${FilledInput_filledInputClasses.error}):before`]: {
      borderBottom: `1px solid ${(theme.vars || theme).palette.text.primary}`
    },
    [`&.${FilledInput_filledInputClasses.disabled}:before`]: {
      borderBottomStyle: 'dotted'
    }
  }, ownerState.startAdornment && {
    paddingLeft: 12
  }, ownerState.endAdornment && {
    paddingRight: 12
  }, ownerState.multiline && (0,esm_extends/* default */.A)({
    padding: '25px 12px 8px'
  }, ownerState.size === 'small' && {
    paddingTop: 21,
    paddingBottom: 4
  }, ownerState.hiddenLabel && {
    paddingTop: 16,
    paddingBottom: 17
  }, ownerState.hiddenLabel && ownerState.size === 'small' && {
    paddingTop: 8,
    paddingBottom: 9
  }));
});
const FilledInputInput = (0,styled/* default */.Ay)(InputBaseComponent, {
  name: 'MuiFilledInput',
  slot: 'Input',
  overridesResolver: inputOverridesResolver
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  paddingTop: 25,
  paddingRight: 12,
  paddingBottom: 8,
  paddingLeft: 12
}, !theme.vars && {
  '&:-webkit-autofill': {
    WebkitBoxShadow: theme.palette.mode === 'light' ? null : '0 0 0 100px #266798 inset',
    WebkitTextFillColor: theme.palette.mode === 'light' ? null : '#fff',
    caretColor: theme.palette.mode === 'light' ? null : '#fff',
    borderTopLeftRadius: 'inherit',
    borderTopRightRadius: 'inherit'
  }
}, theme.vars && {
  '&:-webkit-autofill': {
    borderTopLeftRadius: 'inherit',
    borderTopRightRadius: 'inherit'
  },
  [theme.getColorSchemeSelector('dark')]: {
    '&:-webkit-autofill': {
      WebkitBoxShadow: '0 0 0 100px #266798 inset',
      WebkitTextFillColor: '#fff',
      caretColor: '#fff'
    }
  }
}, ownerState.size === 'small' && {
  paddingTop: 21,
  paddingBottom: 4
}, ownerState.hiddenLabel && {
  paddingTop: 16,
  paddingBottom: 17
}, ownerState.startAdornment && {
  paddingLeft: 0
}, ownerState.endAdornment && {
  paddingRight: 0
}, ownerState.hiddenLabel && ownerState.size === 'small' && {
  paddingTop: 8,
  paddingBottom: 9
}, ownerState.multiline && {
  paddingTop: 0,
  paddingBottom: 0,
  paddingLeft: 0,
  paddingRight: 0
}));
const FilledInput = /*#__PURE__*/react.forwardRef(function FilledInput(inProps, ref) {
  var _ref, _slots$root, _ref2, _slots$input;
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiFilledInput'
  });
  const {
      components = {},
      componentsProps: componentsPropsProp,
      fullWidth = false,
      // declare here to prevent spreading to DOM
      inputComponent = 'input',
      multiline = false,
      slotProps,
      slots = {},
      type = 'text'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, FilledInput_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    fullWidth,
    inputComponent,
    multiline,
    type
  });
  const classes = FilledInput_useUtilityClasses(props);
  const filledInputComponentsProps = {
    root: {
      ownerState
    },
    input: {
      ownerState
    }
  };
  const componentsProps = (slotProps != null ? slotProps : componentsPropsProp) ? (0,deepmerge_deepmerge/* default */.A)(filledInputComponentsProps, slotProps != null ? slotProps : componentsPropsProp) : filledInputComponentsProps;
  const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : FilledInputRoot;
  const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : FilledInputInput;
  return /*#__PURE__*/(0,jsx_runtime.jsx)(InputBase_InputBase, (0,esm_extends/* default */.A)({
    slots: {
      root: RootSlot,
      input: InputSlot
    },
    componentsProps: componentsProps,
    fullWidth: fullWidth,
    inputComponent: inputComponent,
    multiline: multiline,
    ref: ref,
    type: type
  }, other, {
    classes: classes
  }));
});
 false ? 0 : void 0;
FilledInput.muiName = 'Input';
/* harmony default export */ var FilledInput_FilledInput = (FilledInput);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/OutlinedInput/NotchedOutline.js
'use client';



var _span;
const NotchedOutline_excluded = ["children", "classes", "className", "label", "notched"];




const NotchedOutlineRoot = (0,styled/* default */.Ay)('fieldset', {
  shouldForwardProp: rootShouldForwardProp/* default */.A
})({
  textAlign: 'left',
  position: 'absolute',
  bottom: 0,
  right: 0,
  top: -5,
  left: 0,
  margin: 0,
  padding: '0 8px',
  pointerEvents: 'none',
  borderRadius: 'inherit',
  borderStyle: 'solid',
  borderWidth: 1,
  overflow: 'hidden',
  minWidth: '0%'
});
const NotchedOutlineLegend = (0,styled/* default */.Ay)('legend', {
  shouldForwardProp: rootShouldForwardProp/* default */.A
})(({
  ownerState,
  theme
}) => (0,esm_extends/* default */.A)({
  float: 'unset',
  // Fix conflict with bootstrap
  width: 'auto',
  // Fix conflict with bootstrap
  overflow: 'hidden'
}, !ownerState.withLabel && {
  padding: 0,
  lineHeight: '11px',
  // sync with `height` in `legend` styles
  transition: theme.transitions.create('width', {
    duration: 150,
    easing: theme.transitions.easing.easeOut
  })
}, ownerState.withLabel && (0,esm_extends/* default */.A)({
  display: 'block',
  // Fix conflict with normalize.css and sanitize.css
  padding: 0,
  height: 11,
  // sync with `lineHeight` in `legend` styles
  fontSize: '0.75em',
  visibility: 'hidden',
  maxWidth: 0.01,
  transition: theme.transitions.create('max-width', {
    duration: 50,
    easing: theme.transitions.easing.easeOut
  }),
  whiteSpace: 'nowrap',
  '& > span': {
    paddingLeft: 5,
    paddingRight: 5,
    display: 'inline-block',
    opacity: 0,
    visibility: 'visible'
  }
}, ownerState.notched && {
  maxWidth: '100%',
  transition: theme.transitions.create('max-width', {
    duration: 100,
    easing: theme.transitions.easing.easeOut,
    delay: 50
  })
})));

/**
 * @ignore - internal component.
 */
function NotchedOutline(props) {
  const {
      className,
      label,
      notched
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, NotchedOutline_excluded);
  const withLabel = label != null && label !== '';
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    notched,
    withLabel
  });
  return /*#__PURE__*/(0,jsx_runtime.jsx)(NotchedOutlineRoot, (0,esm_extends/* default */.A)({
    "aria-hidden": true,
    className: className,
    ownerState: ownerState
  }, other, {
    children: /*#__PURE__*/(0,jsx_runtime.jsx)(NotchedOutlineLegend, {
      ownerState: ownerState,
      children: withLabel ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
        children: label
      }) : // notranslate needed while Google Translate will not fix zero-width space issue
      _span || (_span = /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
        className: "notranslate",
        children: "\u200B"
      }))
    })
  }));
}
 false ? 0 : void 0;
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/OutlinedInput/outlinedInputClasses.js




function getOutlinedInputUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiOutlinedInput', slot);
}
const outlinedInputClasses = (0,esm_extends/* default */.A)({}, InputBase_inputBaseClasses, (0,generateUtilityClasses/* default */.A)('MuiOutlinedInput', ['root', 'notchedOutline', 'input']));
/* harmony default export */ var OutlinedInput_outlinedInputClasses = (outlinedInputClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/OutlinedInput/OutlinedInput.js
'use client';



const OutlinedInput_excluded = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "slots", "type"];













const OutlinedInput_useUtilityClasses = ownerState => {
  const {
    classes
  } = ownerState;
  const slots = {
    root: ['root'],
    notchedOutline: ['notchedOutline'],
    input: ['input']
  };
  const composedClasses = (0,composeClasses/* default */.A)(slots, getOutlinedInputUtilityClass, classes);
  return (0,esm_extends/* default */.A)({}, classes, composedClasses);
};
const OutlinedInputRoot = (0,styled/* default */.Ay)(InputBaseRoot, {
  shouldForwardProp: prop => (0,rootShouldForwardProp/* default */.A)(prop) || prop === 'classes',
  name: 'MuiOutlinedInput',
  slot: 'Root',
  overridesResolver: rootOverridesResolver
})(({
  theme,
  ownerState
}) => {
  const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
  return (0,esm_extends/* default */.A)({
    position: 'relative',
    borderRadius: (theme.vars || theme).shape.borderRadius,
    [`&:hover .${OutlinedInput_outlinedInputClasses.notchedOutline}`]: {
      borderColor: (theme.vars || theme).palette.text.primary
    },
    // Reset on touch devices, it doesn't add specificity
    '@media (hover: none)': {
      [`&:hover .${OutlinedInput_outlinedInputClasses.notchedOutline}`]: {
        borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
      }
    },
    [`&.${OutlinedInput_outlinedInputClasses.focused} .${OutlinedInput_outlinedInputClasses.notchedOutline}`]: {
      borderColor: (theme.vars || theme).palette[ownerState.color].main,
      borderWidth: 2
    },
    [`&.${OutlinedInput_outlinedInputClasses.error} .${OutlinedInput_outlinedInputClasses.notchedOutline}`]: {
      borderColor: (theme.vars || theme).palette.error.main
    },
    [`&.${OutlinedInput_outlinedInputClasses.disabled} .${OutlinedInput_outlinedInputClasses.notchedOutline}`]: {
      borderColor: (theme.vars || theme).palette.action.disabled
    }
  }, ownerState.startAdornment && {
    paddingLeft: 14
  }, ownerState.endAdornment && {
    paddingRight: 14
  }, ownerState.multiline && (0,esm_extends/* default */.A)({
    padding: '16.5px 14px'
  }, ownerState.size === 'small' && {
    padding: '8.5px 14px'
  }));
});
const OutlinedInput_NotchedOutlineRoot = (0,styled/* default */.Ay)(NotchedOutline, {
  name: 'MuiOutlinedInput',
  slot: 'NotchedOutline',
  overridesResolver: (props, styles) => styles.notchedOutline
})(({
  theme
}) => {
  const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
  return {
    borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
  };
});
const OutlinedInputInput = (0,styled/* default */.Ay)(InputBaseComponent, {
  name: 'MuiOutlinedInput',
  slot: 'Input',
  overridesResolver: inputOverridesResolver
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  padding: '16.5px 14px'
}, !theme.vars && {
  '&:-webkit-autofill': {
    WebkitBoxShadow: theme.palette.mode === 'light' ? null : '0 0 0 100px #266798 inset',
    WebkitTextFillColor: theme.palette.mode === 'light' ? null : '#fff',
    caretColor: theme.palette.mode === 'light' ? null : '#fff',
    borderRadius: 'inherit'
  }
}, theme.vars && {
  '&:-webkit-autofill': {
    borderRadius: 'inherit'
  },
  [theme.getColorSchemeSelector('dark')]: {
    '&:-webkit-autofill': {
      WebkitBoxShadow: '0 0 0 100px #266798 inset',
      WebkitTextFillColor: '#fff',
      caretColor: '#fff'
    }
  }
}, ownerState.size === 'small' && {
  padding: '8.5px 14px'
}, ownerState.multiline && {
  padding: 0
}, ownerState.startAdornment && {
  paddingLeft: 0
}, ownerState.endAdornment && {
  paddingRight: 0
}));
const OutlinedInput = /*#__PURE__*/react.forwardRef(function OutlinedInput(inProps, ref) {
  var _ref, _slots$root, _ref2, _slots$input, _React$Fragment;
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiOutlinedInput'
  });
  const {
      components = {},
      fullWidth = false,
      inputComponent = 'input',
      label,
      multiline = false,
      notched,
      slots = {},
      type = 'text'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, OutlinedInput_excluded);
  const classes = OutlinedInput_useUtilityClasses(props);
  const muiFormControl = useFormControl();
  const fcs = formControlState({
    props,
    muiFormControl,
    states: ['color', 'disabled', 'error', 'focused', 'hiddenLabel', 'size', 'required']
  });
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    color: fcs.color || 'primary',
    disabled: fcs.disabled,
    error: fcs.error,
    focused: fcs.focused,
    formControl: muiFormControl,
    fullWidth,
    hiddenLabel: fcs.hiddenLabel,
    multiline,
    size: fcs.size,
    type
  });
  const RootSlot = (_ref = (_slots$root = slots.root) != null ? _slots$root : components.Root) != null ? _ref : OutlinedInputRoot;
  const InputSlot = (_ref2 = (_slots$input = slots.input) != null ? _slots$input : components.Input) != null ? _ref2 : OutlinedInputInput;
  return /*#__PURE__*/(0,jsx_runtime.jsx)(InputBase_InputBase, (0,esm_extends/* default */.A)({
    slots: {
      root: RootSlot,
      input: InputSlot
    },
    renderSuffix: state => /*#__PURE__*/(0,jsx_runtime.jsx)(OutlinedInput_NotchedOutlineRoot, {
      ownerState: ownerState,
      className: classes.notchedOutline,
      label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
        children: [label, "\u2009", '*']
      })) : label,
      notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
    }),
    fullWidth: fullWidth,
    inputComponent: inputComponent,
    multiline: multiline,
    ref: ref,
    type: type
  }, other, {
    classes: (0,esm_extends/* default */.A)({}, classes, {
      notchedOutline: null
    })
  }));
});
 false ? 0 : void 0;
OutlinedInput.muiName = 'Input';
/* harmony default export */ var OutlinedInput_OutlinedInput = (OutlinedInput);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormLabel/formLabelClasses.js


function getFormLabelUtilityClasses(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiFormLabel', slot);
}
const formLabelClasses = (0,generateUtilityClasses/* default */.A)('MuiFormLabel', ['root', 'colorSecondary', 'focused', 'disabled', 'error', 'filled', 'required', 'asterisk']);
/* harmony default export */ var FormLabel_formLabelClasses = (formLabelClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormLabel/FormLabel.js
'use client';



const FormLabel_excluded = ["children", "className", "color", "component", "disabled", "error", "filled", "focused", "required"];











const FormLabel_useUtilityClasses = ownerState => {
  const {
    classes,
    color,
    focused,
    disabled,
    error,
    filled,
    required
  } = ownerState;
  const slots = {
    root: ['root', `color${(0,utils_capitalize/* default */.A)(color)}`, disabled && 'disabled', error && 'error', filled && 'filled', focused && 'focused', required && 'required'],
    asterisk: ['asterisk', error && 'error']
  };
  return (0,composeClasses/* default */.A)(slots, getFormLabelUtilityClasses, classes);
};
const FormLabelRoot = (0,styled/* default */.Ay)('label', {
  name: 'MuiFormLabel',
  slot: 'Root',
  overridesResolver: ({
    ownerState
  }, styles) => {
    return (0,esm_extends/* default */.A)({}, styles.root, ownerState.color === 'secondary' && styles.colorSecondary, ownerState.filled && styles.filled);
  }
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  color: (theme.vars || theme).palette.text.secondary
}, theme.typography.body1, {
  lineHeight: '1.4375em',
  padding: 0,
  position: 'relative',
  [`&.${FormLabel_formLabelClasses.focused}`]: {
    color: (theme.vars || theme).palette[ownerState.color].main
  },
  [`&.${FormLabel_formLabelClasses.disabled}`]: {
    color: (theme.vars || theme).palette.text.disabled
  },
  [`&.${FormLabel_formLabelClasses.error}`]: {
    color: (theme.vars || theme).palette.error.main
  }
}));
const FormLabel_AsteriskComponent = (0,styled/* default */.Ay)('span', {
  name: 'MuiFormLabel',
  slot: 'Asterisk',
  overridesResolver: (props, styles) => styles.asterisk
})(({
  theme
}) => ({
  [`&.${FormLabel_formLabelClasses.error}`]: {
    color: (theme.vars || theme).palette.error.main
  }
}));
const FormLabel = /*#__PURE__*/react.forwardRef(function FormLabel(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiFormLabel'
  });
  const {
      children,
      className,
      component = 'label'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, FormLabel_excluded);
  const muiFormControl = useFormControl();
  const fcs = formControlState({
    props,
    muiFormControl,
    states: ['color', 'required', 'focused', 'disabled', 'error', 'filled']
  });
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    color: fcs.color || 'primary',
    component,
    disabled: fcs.disabled,
    error: fcs.error,
    filled: fcs.filled,
    focused: fcs.focused,
    required: fcs.required
  });
  const classes = FormLabel_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(FormLabelRoot, (0,esm_extends/* default */.A)({
    as: component,
    ownerState: ownerState,
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ref: ref
  }, other, {
    children: [children, fcs.required && /*#__PURE__*/(0,jsx_runtime.jsxs)(FormLabel_AsteriskComponent, {
      ownerState: ownerState,
      "aria-hidden": true,
      className: classes.asterisk,
      children: ["\u2009", '*']
    })]
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var FormLabel_FormLabel = (FormLabel);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/InputLabel/inputLabelClasses.js


function getInputLabelUtilityClasses(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiInputLabel', slot);
}
const inputLabelClasses = (0,generateUtilityClasses/* default */.A)('MuiInputLabel', ['root', 'focused', 'disabled', 'error', 'required', 'asterisk', 'formControl', 'sizeSmall', 'shrink', 'animated', 'standard', 'filled', 'outlined']);
/* harmony default export */ var InputLabel_inputLabelClasses = ((/* unused pure expression or super */ null && (inputLabelClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/InputLabel/InputLabel.js
'use client';



const InputLabel_excluded = ["disableAnimation", "margin", "shrink", "variant", "className"];












const InputLabel_useUtilityClasses = ownerState => {
  const {
    classes,
    formControl,
    size,
    shrink,
    disableAnimation,
    variant,
    required
  } = ownerState;
  const slots = {
    root: ['root', formControl && 'formControl', !disableAnimation && 'animated', shrink && 'shrink', size && size !== 'normal' && `size${(0,utils_capitalize/* default */.A)(size)}`, variant],
    asterisk: [required && 'asterisk']
  };
  const composedClasses = (0,composeClasses/* default */.A)(slots, getInputLabelUtilityClasses, classes);
  return (0,esm_extends/* default */.A)({}, classes, composedClasses);
};
const InputLabelRoot = (0,styled/* default */.Ay)(FormLabel_FormLabel, {
  shouldForwardProp: prop => (0,rootShouldForwardProp/* default */.A)(prop) || prop === 'classes',
  name: 'MuiInputLabel',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [{
      [`& .${FormLabel_formLabelClasses.asterisk}`]: styles.asterisk
    }, styles.root, ownerState.formControl && styles.formControl, ownerState.size === 'small' && styles.sizeSmall, ownerState.shrink && styles.shrink, !ownerState.disableAnimation && styles.animated, ownerState.focused && styles.focused, styles[ownerState.variant]];
  }
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  display: 'block',
  transformOrigin: 'top left',
  whiteSpace: 'nowrap',
  overflow: 'hidden',
  textOverflow: 'ellipsis',
  maxWidth: '100%'
}, ownerState.formControl && {
  position: 'absolute',
  left: 0,
  top: 0,
  // slight alteration to spec spacing to match visual spec result
  transform: 'translate(0, 20px) scale(1)'
}, ownerState.size === 'small' && {
  // Compensation for the `Input.inputSizeSmall` style.
  transform: 'translate(0, 17px) scale(1)'
}, ownerState.shrink && {
  transform: 'translate(0, -1.5px) scale(0.75)',
  transformOrigin: 'top left',
  maxWidth: '133%'
}, !ownerState.disableAnimation && {
  transition: theme.transitions.create(['color', 'transform', 'max-width'], {
    duration: theme.transitions.duration.shorter,
    easing: theme.transitions.easing.easeOut
  })
}, ownerState.variant === 'filled' && (0,esm_extends/* default */.A)({
  // Chrome's autofill feature gives the input field a yellow background.
  // Since the input field is behind the label in the HTML tree,
  // the input field is drawn last and hides the label with an opaque background color.
  // zIndex: 1 will raise the label above opaque background-colors of input.
  zIndex: 1,
  pointerEvents: 'none',
  transform: 'translate(12px, 16px) scale(1)',
  maxWidth: 'calc(100% - 24px)'
}, ownerState.size === 'small' && {
  transform: 'translate(12px, 13px) scale(1)'
}, ownerState.shrink && (0,esm_extends/* default */.A)({
  userSelect: 'none',
  pointerEvents: 'auto',
  transform: 'translate(12px, 7px) scale(0.75)',
  maxWidth: 'calc(133% - 24px)'
}, ownerState.size === 'small' && {
  transform: 'translate(12px, 4px) scale(0.75)'
})), ownerState.variant === 'outlined' && (0,esm_extends/* default */.A)({
  // see comment above on filled.zIndex
  zIndex: 1,
  pointerEvents: 'none',
  transform: 'translate(14px, 16px) scale(1)',
  maxWidth: 'calc(100% - 24px)'
}, ownerState.size === 'small' && {
  transform: 'translate(14px, 9px) scale(1)'
}, ownerState.shrink && {
  userSelect: 'none',
  pointerEvents: 'auto',
  // Theoretically, we should have (8+5)*2/0.75 = 34px
  // but it feels a better when it bleeds a bit on the left, so 32px.
  maxWidth: 'calc(133% - 32px)',
  transform: 'translate(14px, -9px) scale(0.75)'
})));
const InputLabel_InputLabel_InputLabel = /*#__PURE__*/react.forwardRef(function InputLabel(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    name: 'MuiInputLabel',
    props: inProps
  });
  const {
      disableAnimation = false,
      shrink: shrinkProp,
      className
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, InputLabel_excluded);
  const muiFormControl = useFormControl();
  let shrink = shrinkProp;
  if (typeof shrink === 'undefined' && muiFormControl) {
    shrink = muiFormControl.filled || muiFormControl.focused || muiFormControl.adornedStart;
  }
  const fcs = formControlState({
    props,
    muiFormControl,
    states: ['size', 'variant', 'required', 'focused']
  });
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    disableAnimation,
    formControl: muiFormControl,
    shrink,
    size: fcs.size,
    variant: fcs.variant,
    required: fcs.required,
    focused: fcs.focused
  });
  const classes = InputLabel_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(InputLabelRoot, (0,esm_extends/* default */.A)({
    "data-shrink": shrink,
    ownerState: ownerState,
    ref: ref,
    className: (0,clsx_m/* default */.A)(classes.root, className)
  }, other, {
    classes: classes
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var material_InputLabel_InputLabel = (InputLabel_InputLabel_InputLabel);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/isMuiElement.js + 1 modules
var isMuiElement = __webpack_require__(5223);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormControl/formControlClasses.js


function getFormControlUtilityClasses(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiFormControl', slot);
}
const formControlClasses = (0,generateUtilityClasses/* default */.A)('MuiFormControl', ['root', 'marginNone', 'marginNormal', 'marginDense', 'fullWidth', 'disabled']);
/* harmony default export */ var FormControl_formControlClasses = ((/* unused pure expression or super */ null && (formControlClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormControl/FormControl.js
'use client';



const FormControl_excluded = ["children", "className", "color", "component", "disabled", "error", "focused", "fullWidth", "hiddenLabel", "margin", "required", "size", "variant"];












const FormControl_useUtilityClasses = ownerState => {
  const {
    classes,
    margin,
    fullWidth
  } = ownerState;
  const slots = {
    root: ['root', margin !== 'none' && `margin${(0,utils_capitalize/* default */.A)(margin)}`, fullWidth && 'fullWidth']
  };
  return (0,composeClasses/* default */.A)(slots, getFormControlUtilityClasses, classes);
};
const FormControlRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiFormControl',
  slot: 'Root',
  overridesResolver: ({
    ownerState
  }, styles) => {
    return (0,esm_extends/* default */.A)({}, styles.root, styles[`margin${(0,utils_capitalize/* default */.A)(ownerState.margin)}`], ownerState.fullWidth && styles.fullWidth);
  }
})(({
  ownerState
}) => (0,esm_extends/* default */.A)({
  display: 'inline-flex',
  flexDirection: 'column',
  position: 'relative',
  // Reset fieldset default style.
  minWidth: 0,
  padding: 0,
  margin: 0,
  border: 0,
  verticalAlign: 'top'
}, ownerState.margin === 'normal' && {
  marginTop: 16,
  marginBottom: 8
}, ownerState.margin === 'dense' && {
  marginTop: 8,
  marginBottom: 4
}, ownerState.fullWidth && {
  width: '100%'
}));

/**
 * Provides context such as filled/focused/error/required for form inputs.
 * Relying on the context provides high flexibility and ensures that the state always stays
 * consistent across the children of the `FormControl`.
 * This context is used by the following components:
 *
 *  - FormLabel
 *  - FormHelperText
 *  - Input
 *  - InputLabel
 *
 * You can find one composition example below and more going to [the demos](/material-ui/react-text-field/#components).
 *
 * ```jsx
 * <FormControl>
 *   <InputLabel htmlFor="my-input">Email address</InputLabel>
 *   <Input id="my-input" aria-describedby="my-helper-text" />
 *   <FormHelperText id="my-helper-text">We'll never share your email.</FormHelperText>
 * </FormControl>
 * ```
 *
 * ⚠️ Only one `InputBase` can be used within a FormControl because it creates visual inconsistencies.
 * For instance, only one input can be focused at the same time, the state shouldn't be shared.
 */
const FormControl_FormControl_FormControl = /*#__PURE__*/react.forwardRef(function FormControl(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiFormControl'
  });
  const {
      children,
      className,
      color = 'primary',
      component = 'div',
      disabled = false,
      error = false,
      focused: visuallyFocused,
      fullWidth = false,
      hiddenLabel = false,
      margin = 'none',
      required = false,
      size = 'medium',
      variant = 'outlined'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, FormControl_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    color,
    component,
    disabled,
    error,
    fullWidth,
    hiddenLabel,
    margin,
    required,
    size,
    variant
  });
  const classes = FormControl_useUtilityClasses(ownerState);
  const [adornedStart, setAdornedStart] = react.useState(() => {
    // We need to iterate through the children and find the Input in order
    // to fully support server-side rendering.
    let initialAdornedStart = false;
    if (children) {
      react.Children.forEach(children, child => {
        if (!(0,isMuiElement/* default */.A)(child, ['Input', 'Select'])) {
          return;
        }
        const input = (0,isMuiElement/* default */.A)(child, ['Select']) ? child.props.input : child;
        if (input && isAdornedStart(input.props)) {
          initialAdornedStart = true;
        }
      });
    }
    return initialAdornedStart;
  });
  const [filled, setFilled] = react.useState(() => {
    // We need to iterate through the children and find the Input in order
    // to fully support server-side rendering.
    let initialFilled = false;
    if (children) {
      react.Children.forEach(children, child => {
        if (!(0,isMuiElement/* default */.A)(child, ['Input', 'Select'])) {
          return;
        }
        if (isFilled(child.props, true) || isFilled(child.props.inputProps, true)) {
          initialFilled = true;
        }
      });
    }
    return initialFilled;
  });
  const [focusedState, setFocused] = react.useState(false);
  if (disabled && focusedState) {
    setFocused(false);
  }
  const focused = visuallyFocused !== undefined && !disabled ? visuallyFocused : focusedState;
  let registerEffect;
  if (false) {}
  const childContext = react.useMemo(() => {
    return {
      adornedStart,
      setAdornedStart,
      color,
      disabled,
      error,
      filled,
      focused,
      fullWidth,
      hiddenLabel,
      size,
      onBlur: () => {
        setFocused(false);
      },
      onEmpty: () => {
        setFilled(false);
      },
      onFilled: () => {
        setFilled(true);
      },
      onFocus: () => {
        setFocused(true);
      },
      registerEffect,
      required,
      variant
    };
  }, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, required, size, variant]);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(FormControl_FormControlContext.Provider, {
    value: childContext,
    children: /*#__PURE__*/(0,jsx_runtime.jsx)(FormControlRoot, (0,esm_extends/* default */.A)({
      as: component,
      ownerState: ownerState,
      className: (0,clsx_m/* default */.A)(classes.root, className),
      ref: ref
    }, other, {
      children: children
    }))
  });
});
 false ? 0 : void 0;
/* harmony default export */ var material_FormControl_FormControl = (FormControl_FormControl_FormControl);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormHelperText/formHelperTextClasses.js


function getFormHelperTextUtilityClasses(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiFormHelperText', slot);
}
const formHelperTextClasses = (0,generateUtilityClasses/* default */.A)('MuiFormHelperText', ['root', 'error', 'disabled', 'sizeSmall', 'sizeMedium', 'contained', 'focused', 'filled', 'required']);
/* harmony default export */ var FormHelperText_formHelperTextClasses = (formHelperTextClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/FormHelperText/FormHelperText.js
'use client';



var FormHelperText_span;
const FormHelperText_excluded = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"];











const FormHelperText_useUtilityClasses = ownerState => {
  const {
    classes,
    contained,
    size,
    disabled,
    error,
    filled,
    focused,
    required
  } = ownerState;
  const slots = {
    root: ['root', disabled && 'disabled', error && 'error', size && `size${(0,utils_capitalize/* default */.A)(size)}`, contained && 'contained', focused && 'focused', filled && 'filled', required && 'required']
  };
  return (0,composeClasses/* default */.A)(slots, getFormHelperTextUtilityClasses, classes);
};
const FormHelperTextRoot = (0,styled/* default */.Ay)('p', {
  name: 'MuiFormHelperText',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, ownerState.size && styles[`size${(0,utils_capitalize/* default */.A)(ownerState.size)}`], ownerState.contained && styles.contained, ownerState.filled && styles.filled];
  }
})(({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({
  color: (theme.vars || theme).palette.text.secondary
}, theme.typography.caption, {
  textAlign: 'left',
  marginTop: 3,
  marginRight: 0,
  marginBottom: 0,
  marginLeft: 0,
  [`&.${FormHelperText_formHelperTextClasses.disabled}`]: {
    color: (theme.vars || theme).palette.text.disabled
  },
  [`&.${FormHelperText_formHelperTextClasses.error}`]: {
    color: (theme.vars || theme).palette.error.main
  }
}, ownerState.size === 'small' && {
  marginTop: 4
}, ownerState.contained && {
  marginLeft: 14,
  marginRight: 14
}));
const FormHelperText_FormHelperText_FormHelperText = /*#__PURE__*/react.forwardRef(function FormHelperText(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiFormHelperText'
  });
  const {
      children,
      className,
      component = 'p'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, FormHelperText_excluded);
  const muiFormControl = useFormControl();
  const fcs = formControlState({
    props,
    muiFormControl,
    states: ['variant', 'size', 'disabled', 'error', 'filled', 'focused', 'required']
  });
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    component,
    contained: fcs.variant === 'filled' || fcs.variant === 'outlined',
    variant: fcs.variant,
    size: fcs.size,
    disabled: fcs.disabled,
    error: fcs.error,
    filled: fcs.filled,
    focused: fcs.focused,
    required: fcs.required
  });
  const classes = FormHelperText_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(FormHelperTextRoot, (0,esm_extends/* default */.A)({
    as: component,
    ownerState: ownerState,
    className: (0,clsx_m/* default */.A)(classes.root, className),
    ref: ref
  }, other, {
    children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
    FormHelperText_span || (FormHelperText_span = /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
      className: "notranslate",
      children: "\u200B"
    })) : children
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var material_FormHelperText_FormHelperText = (FormHelperText_FormHelperText_FormHelperText);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/ownerDocument.js
var utils_ownerDocument = __webpack_require__(3294);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/system/esm/RtlProvider/index.js


const RtlProvider_excluded = (/* unused pure expression or super */ null && (["value"]));



const RtlContext = /*#__PURE__*/react.createContext();
function RtlProvider(_ref) {
  let {
      value
    } = _ref,
    props = _objectWithoutPropertiesLoose(_ref, RtlProvider_excluded);
  return /*#__PURE__*/_jsx(RtlContext.Provider, _extends({
    value: value != null ? value : true
  }, props));
}
 false ? 0 : void 0;
const useRtl = () => {
  const value = react.useContext(RtlContext);
  return value != null ? value : false;
};
/* harmony default export */ var esm_RtlProvider = ((/* unused pure expression or super */ null && (RtlProvider)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/List/ListContext.js
'use client';



/**
 * @ignore - internal component.
 */
const ListContext = /*#__PURE__*/react.createContext({});
if (false) {}
/* harmony default export */ var List_ListContext = (ListContext);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/List/listClasses.js


function getListUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiList', slot);
}
const listClasses = (0,generateUtilityClasses/* default */.A)('MuiList', ['root', 'padding', 'dense', 'subheader']);
/* harmony default export */ var List_listClasses = ((/* unused pure expression or super */ null && (listClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/List/List.js
'use client';



const List_excluded = ["children", "className", "component", "dense", "disablePadding", "subheader"];










const List_useUtilityClasses = ownerState => {
  const {
    classes,
    disablePadding,
    dense,
    subheader
  } = ownerState;
  const slots = {
    root: ['root', !disablePadding && 'padding', dense && 'dense', subheader && 'subheader']
  };
  return (0,composeClasses/* default */.A)(slots, getListUtilityClass, classes);
};
const ListRoot = (0,styled/* default */.Ay)('ul', {
  name: 'MuiList',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.root, !ownerState.disablePadding && styles.padding, ownerState.dense && styles.dense, ownerState.subheader && styles.subheader];
  }
})(({
  ownerState
}) => (0,esm_extends/* default */.A)({
  listStyle: 'none',
  margin: 0,
  padding: 0,
  position: 'relative'
}, !ownerState.disablePadding && {
  paddingTop: 8,
  paddingBottom: 8
}, ownerState.subheader && {
  paddingTop: 0
}));
const List = /*#__PURE__*/react.forwardRef(function List(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiList'
  });
  const {
      children,
      className,
      component = 'ul',
      dense = false,
      disablePadding = false,
      subheader
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, List_excluded);
  const context = react.useMemo(() => ({
    dense
  }), [dense]);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    component,
    dense,
    disablePadding
  });
  const classes = List_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(List_ListContext.Provider, {
    value: context,
    children: /*#__PURE__*/(0,jsx_runtime.jsxs)(ListRoot, (0,esm_extends/* default */.A)({
      as: component,
      className: (0,clsx_m/* default */.A)(classes.root, className),
      ref: ref,
      ownerState: ownerState
    }, other, {
      children: [subheader, children]
    }))
  });
});
 false ? 0 : void 0;
/* harmony default export */ var List_List = (List);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/getScrollbarSize.js

/* harmony default export */ var utils_getScrollbarSize = (getScrollbarSize);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/MenuList/MenuList.js
'use client';



const MenuList_excluded = ["actions", "autoFocus", "autoFocusItem", "children", "className", "disabledItemsFocusable", "disableListWrap", "onKeyDown", "variant"];









function nextItem(list, item, disableListWrap) {
  if (list === item) {
    return list.firstChild;
  }
  if (item && item.nextElementSibling) {
    return item.nextElementSibling;
  }
  return disableListWrap ? null : list.firstChild;
}
function previousItem(list, item, disableListWrap) {
  if (list === item) {
    return disableListWrap ? list.firstChild : list.lastChild;
  }
  if (item && item.previousElementSibling) {
    return item.previousElementSibling;
  }
  return disableListWrap ? null : list.lastChild;
}
function textCriteriaMatches(nextFocus, textCriteria) {
  if (textCriteria === undefined) {
    return true;
  }
  let text = nextFocus.innerText;
  if (text === undefined) {
    // jsdom doesn't support innerText
    text = nextFocus.textContent;
  }
  text = text.trim().toLowerCase();
  if (text.length === 0) {
    return false;
  }
  if (textCriteria.repeating) {
    return text[0] === textCriteria.keys[0];
  }
  return text.indexOf(textCriteria.keys.join('')) === 0;
}
function moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable, traversalFunction, textCriteria) {
  let wrappedOnce = false;
  let nextFocus = traversalFunction(list, currentFocus, currentFocus ? disableListWrap : false);
  while (nextFocus) {
    // Prevent infinite loop.
    if (nextFocus === list.firstChild) {
      if (wrappedOnce) {
        return false;
      }
      wrappedOnce = true;
    }

    // Same logic as useAutocomplete.js
    const nextFocusDisabled = disabledItemsFocusable ? false : nextFocus.disabled || nextFocus.getAttribute('aria-disabled') === 'true';
    if (!nextFocus.hasAttribute('tabindex') || !textCriteriaMatches(nextFocus, textCriteria) || nextFocusDisabled) {
      // Move to the next element.
      nextFocus = traversalFunction(list, nextFocus, disableListWrap);
    } else {
      nextFocus.focus();
      return true;
    }
  }
  return false;
}

/**
 * A permanently displayed menu following https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/.
 * It's exposed to help customization of the [`Menu`](/material-ui/api/menu/) component if you
 * use it separately you need to move focus into the component manually. Once
 * the focus is placed inside the component it is fully keyboard accessible.
 */
const MenuList_MenuList = /*#__PURE__*/react.forwardRef(function MenuList(props, ref) {
  const {
      // private
      // eslint-disable-next-line react/prop-types
      actions,
      autoFocus = false,
      autoFocusItem = false,
      children,
      className,
      disabledItemsFocusable = false,
      disableListWrap = false,
      onKeyDown,
      variant = 'selectedMenu'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, MenuList_excluded);
  const listRef = react.useRef(null);
  const textCriteriaRef = react.useRef({
    keys: [],
    repeating: true,
    previousKeyMatched: true,
    lastTime: null
  });
  (0,utils_useEnhancedEffect/* default */.A)(() => {
    if (autoFocus) {
      listRef.current.focus();
    }
  }, [autoFocus]);
  react.useImperativeHandle(actions, () => ({
    adjustStyleForScrollbar: (containerElement, {
      direction
    }) => {
      // Let's ignore that piece of logic if users are already overriding the width
      // of the menu.
      const noExplicitWidth = !listRef.current.style.width;
      if (containerElement.clientHeight < listRef.current.clientHeight && noExplicitWidth) {
        const scrollbarSize = `${utils_getScrollbarSize((0,utils_ownerDocument/* default */.A)(containerElement))}px`;
        listRef.current.style[direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = scrollbarSize;
        listRef.current.style.width = `calc(100% + ${scrollbarSize})`;
      }
      return listRef.current;
    }
  }), []);
  const handleKeyDown = event => {
    const list = listRef.current;
    const key = event.key;
    /**
     * @type {Element} - will always be defined since we are in a keydown handler
     * attached to an element. A keydown event is either dispatched to the activeElement
     * or document.body or document.documentElement. Only the first case will
     * trigger this specific handler.
     */
    const currentFocus = (0,utils_ownerDocument/* default */.A)(list).activeElement;
    if (key === 'ArrowDown') {
      // Prevent scroll of the page
      event.preventDefault();
      moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable, nextItem);
    } else if (key === 'ArrowUp') {
      event.preventDefault();
      moveFocus(list, currentFocus, disableListWrap, disabledItemsFocusable, previousItem);
    } else if (key === 'Home') {
      event.preventDefault();
      moveFocus(list, null, disableListWrap, disabledItemsFocusable, nextItem);
    } else if (key === 'End') {
      event.preventDefault();
      moveFocus(list, null, disableListWrap, disabledItemsFocusable, previousItem);
    } else if (key.length === 1) {
      const criteria = textCriteriaRef.current;
      const lowerKey = key.toLowerCase();
      const currTime = performance.now();
      if (criteria.keys.length > 0) {
        // Reset
        if (currTime - criteria.lastTime > 500) {
          criteria.keys = [];
          criteria.repeating = true;
          criteria.previousKeyMatched = true;
        } else if (criteria.repeating && lowerKey !== criteria.keys[0]) {
          criteria.repeating = false;
        }
      }
      criteria.lastTime = currTime;
      criteria.keys.push(lowerKey);
      const keepFocusOnCurrent = currentFocus && !criteria.repeating && textCriteriaMatches(currentFocus, criteria);
      if (criteria.previousKeyMatched && (keepFocusOnCurrent || moveFocus(list, currentFocus, false, disabledItemsFocusable, nextItem, criteria))) {
        event.preventDefault();
      } else {
        criteria.previousKeyMatched = false;
      }
    }
    if (onKeyDown) {
      onKeyDown(event);
    }
  };
  const handleRef = (0,utils_useForkRef/* default */.A)(listRef, ref);

  /**
   * the index of the item should receive focus
   * in a `variant="selectedMenu"` it's the first `selected` item
   * otherwise it's the very first item.
   */
  let activeItemIndex = -1;
  // since we inject focus related props into children we have to do a lookahead
  // to check if there is a `selected` item. We're looking for the last `selected`
  // item and use the first valid item as a fallback
  react.Children.forEach(children, (child, index) => {
    if (! /*#__PURE__*/react.isValidElement(child)) {
      if (activeItemIndex === index) {
        activeItemIndex += 1;
        if (activeItemIndex >= children.length) {
          // there are no focusable items within the list.
          activeItemIndex = -1;
        }
      }
      return;
    }
    if (false) {}
    if (!child.props.disabled) {
      if (variant === 'selectedMenu' && child.props.selected) {
        activeItemIndex = index;
      } else if (activeItemIndex === -1) {
        activeItemIndex = index;
      }
    }
    if (activeItemIndex === index && (child.props.disabled || child.props.muiSkipListHighlight || child.type.muiSkipListHighlight)) {
      activeItemIndex += 1;
      if (activeItemIndex >= children.length) {
        // there are no focusable items within the list.
        activeItemIndex = -1;
      }
    }
  });
  const items = react.Children.map(children, (child, index) => {
    if (index === activeItemIndex) {
      const newChildProps = {};
      if (autoFocusItem) {
        newChildProps.autoFocus = true;
      }
      if (child.props.tabIndex === undefined && variant === 'selectedMenu') {
        newChildProps.tabIndex = 0;
      }
      return /*#__PURE__*/react.cloneElement(child, newChildProps);
    }
    return child;
  });
  return /*#__PURE__*/(0,jsx_runtime.jsx)(List_List, (0,esm_extends/* default */.A)({
    role: "menu",
    ref: handleRef,
    className: className,
    onKeyDown: handleKeyDown,
    tabIndex: autoFocus ? 0 : -1
  }, other, {
    children: items
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var material_MenuList_MenuList = (MenuList_MenuList);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/debounce.js
var utils_debounce = __webpack_require__(7181);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/utils/ownerWindow.js
var utils_ownerWindow = __webpack_require__(7375);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Grow/Grow.js
'use client';



const Grow_Grow_excluded = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];









function Grow_getScale(value) {
  return `scale(${value}, ${value ** 2})`;
}
const Grow_styles = {
  entering: {
    opacity: 1,
    transform: Grow_getScale(1)
  },
  entered: {
    opacity: 1,
    transform: 'none'
  }
};

/*
 TODO v6: remove
 Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
 */
const isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\/)15(.|_)4/i.test(navigator.userAgent);

/**
 * The Grow transition is used by the [Tooltip](/material-ui/react-tooltip/) and
 * [Popover](/material-ui/react-popover/) components.
 * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
 */
const material_Grow_Grow_Grow = /*#__PURE__*/react.forwardRef(function Grow(props, ref) {
  const {
      addEndListener,
      appear = true,
      children,
      easing,
      in: inProp,
      onEnter,
      onEntered,
      onEntering,
      onExit,
      onExited,
      onExiting,
      style,
      timeout = 'auto',
      // eslint-disable-next-line react/prop-types
      TransitionComponent = esm_Transition
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Grow_Grow_excluded);
  const timer = (0,useTimeout/* default */.A)();
  const autoTimeout = react.useRef();
  const theme = styles_useTheme_useTheme();
  const nodeRef = react.useRef(null);
  const handleRef = (0,utils_useForkRef/* default */.A)(nodeRef, children.ref, ref);
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
    if (callback) {
      const node = nodeRef.current;

      // onEnterXxx and onExitXxx callbacks have a different arguments.length value.
      if (maybeIsAppearing === undefined) {
        callback(node);
      } else {
        callback(node, maybeIsAppearing);
      }
    }
  };
  const handleEntering = normalizedTransitionCallback(onEntering);
  const handleEnter = normalizedTransitionCallback((node, isAppearing) => {
    utils_reflow(node); // So the animation always start from the start.

    const {
      duration: transitionDuration,
      delay,
      easing: transitionTimingFunction
    } = utils_getTransitionProps({
      style,
      timeout,
      easing
    }, {
      mode: 'enter'
    });
    let duration;
    if (timeout === 'auto') {
      duration = theme.transitions.getAutoHeightDuration(node.clientHeight);
      autoTimeout.current = duration;
    } else {
      duration = transitionDuration;
    }
    node.style.transition = [theme.transitions.create('opacity', {
      duration,
      delay
    }), theme.transitions.create('transform', {
      duration: isWebKit154 ? duration : duration * 0.666,
      delay,
      easing: transitionTimingFunction
    })].join(',');
    if (onEnter) {
      onEnter(node, isAppearing);
    }
  });
  const handleEntered = normalizedTransitionCallback(onEntered);
  const handleExiting = normalizedTransitionCallback(onExiting);
  const handleExit = normalizedTransitionCallback(node => {
    const {
      duration: transitionDuration,
      delay,
      easing: transitionTimingFunction
    } = utils_getTransitionProps({
      style,
      timeout,
      easing
    }, {
      mode: 'exit'
    });
    let duration;
    if (timeout === 'auto') {
      duration = theme.transitions.getAutoHeightDuration(node.clientHeight);
      autoTimeout.current = duration;
    } else {
      duration = transitionDuration;
    }
    node.style.transition = [theme.transitions.create('opacity', {
      duration,
      delay
    }), theme.transitions.create('transform', {
      duration: isWebKit154 ? duration : duration * 0.666,
      delay: isWebKit154 ? delay : delay || duration * 0.333,
      easing: transitionTimingFunction
    })].join(',');
    node.style.opacity = 0;
    node.style.transform = Grow_getScale(0.75);
    if (onExit) {
      onExit(node);
    }
  });
  const handleExited = normalizedTransitionCallback(onExited);
  const handleAddEndListener = next => {
    if (timeout === 'auto') {
      timer.start(autoTimeout.current || 0, next);
    }
    if (addEndListener) {
      // Old call signature before `react-transition-group` implemented `nodeRef`
      addEndListener(nodeRef.current, next);
    }
  };
  return /*#__PURE__*/(0,jsx_runtime.jsx)(TransitionComponent, (0,esm_extends/* default */.A)({
    appear: appear,
    in: inProp,
    nodeRef: nodeRef,
    onEnter: handleEnter,
    onEntered: handleEntered,
    onEntering: handleEntering,
    onExit: handleExit,
    onExited: handleExited,
    onExiting: handleExiting,
    addEndListener: handleAddEndListener,
    timeout: timeout === 'auto' ? null : timeout
  }, other, {
    children: (state, childProps) => {
      return /*#__PURE__*/react.cloneElement(children, (0,esm_extends/* default */.A)({
        style: (0,esm_extends/* default */.A)({
          opacity: 0,
          transform: Grow_getScale(0.75),
          visibility: state === 'exited' && !inProp ? 'hidden' : undefined
        }, Grow_styles[state], style, children.props.style),
        ref: handleRef
      }, childProps));
    }
  }));
});
 false ? 0 : void 0;
material_Grow_Grow_Grow.muiSupportAuto = true;
/* harmony default export */ var material_Grow_Grow = (material_Grow_Grow_Grow);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Popover/popoverClasses.js


function getPopoverUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiPopover', slot);
}
const popoverClasses = (0,generateUtilityClasses/* default */.A)('MuiPopover', ['root', 'paper']);
/* harmony default export */ var Popover_popoverClasses = ((/* unused pure expression or super */ null && (popoverClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Popover/Popover.js
'use client';



const Popover_excluded = ["onEntering"],
  Popover_excluded2 = ["action", "anchorEl", "anchorOrigin", "anchorPosition", "anchorReference", "children", "className", "container", "elevation", "marginThreshold", "open", "PaperProps", "slots", "slotProps", "transformOrigin", "TransitionComponent", "transitionDuration", "TransitionProps", "disableScrollLock"],
  Popover_excluded3 = ["slotProps"];





















function getOffsetTop(rect, vertical) {
  let offset = 0;
  if (typeof vertical === 'number') {
    offset = vertical;
  } else if (vertical === 'center') {
    offset = rect.height / 2;
  } else if (vertical === 'bottom') {
    offset = rect.height;
  }
  return offset;
}
function getOffsetLeft(rect, horizontal) {
  let offset = 0;
  if (typeof horizontal === 'number') {
    offset = horizontal;
  } else if (horizontal === 'center') {
    offset = rect.width / 2;
  } else if (horizontal === 'right') {
    offset = rect.width;
  }
  return offset;
}
function getTransformOriginValue(transformOrigin) {
  return [transformOrigin.horizontal, transformOrigin.vertical].map(n => typeof n === 'number' ? `${n}px` : n).join(' ');
}
function resolveAnchorEl(anchorEl) {
  return typeof anchorEl === 'function' ? anchorEl() : anchorEl;
}
const Popover_useUtilityClasses = ownerState => {
  const {
    classes
  } = ownerState;
  const slots = {
    root: ['root'],
    paper: ['paper']
  };
  return (0,composeClasses/* default */.A)(slots, getPopoverUtilityClass, classes);
};
const PopoverRoot = (0,styled/* default */.Ay)(Modal_Modal, {
  name: 'MuiPopover',
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
})({});
const PopoverPaper = (0,styled/* default */.Ay)(material_Paper_Paper, {
  name: 'MuiPopover',
  slot: 'Paper',
  overridesResolver: (props, styles) => styles.paper
})({
  position: 'absolute',
  overflowY: 'auto',
  overflowX: 'hidden',
  // So we see the popover when it's empty.
  // It's most likely on issue on userland.
  minWidth: 16,
  minHeight: 16,
  maxWidth: 'calc(100% - 32px)',
  maxHeight: 'calc(100% - 32px)',
  // We disable the focus ring for mouse, touch and keyboard users.
  outline: 0
});
const Popover_Popover_Popover = /*#__PURE__*/react.forwardRef(function Popover(inProps, ref) {
  var _slotProps$paper, _slots$root, _slots$paper;
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiPopover'
  });
  const {
      action,
      anchorEl,
      anchorOrigin = {
        vertical: 'top',
        horizontal: 'left'
      },
      anchorPosition,
      anchorReference = 'anchorEl',
      children,
      className,
      container: containerProp,
      elevation = 8,
      marginThreshold = 16,
      open,
      PaperProps: PaperPropsProp = {},
      slots,
      slotProps,
      transformOrigin = {
        vertical: 'top',
        horizontal: 'left'
      },
      TransitionComponent = material_Grow_Grow,
      transitionDuration: transitionDurationProp = 'auto',
      TransitionProps: {
        onEntering
      } = {},
      disableScrollLock = false
    } = props,
    TransitionProps = (0,objectWithoutPropertiesLoose/* default */.A)(props.TransitionProps, Popover_excluded),
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Popover_excluded2);
  const externalPaperSlotProps = (_slotProps$paper = slotProps == null ? void 0 : slotProps.paper) != null ? _slotProps$paper : PaperPropsProp;
  const paperRef = react.useRef();
  const handlePaperRef = (0,utils_useForkRef/* default */.A)(paperRef, externalPaperSlotProps.ref);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    anchorOrigin,
    anchorReference,
    elevation,
    marginThreshold,
    externalPaperSlotProps,
    transformOrigin,
    TransitionComponent,
    transitionDuration: transitionDurationProp,
    TransitionProps
  });
  const classes = Popover_useUtilityClasses(ownerState);

  // Returns the top/left offset of the position
  // to attach to on the anchor element (or body if none is provided)
  const getAnchorOffset = react.useCallback(() => {
    if (anchorReference === 'anchorPosition') {
      if (false) {}
      return anchorPosition;
    }
    const resolvedAnchorEl = resolveAnchorEl(anchorEl);

    // If an anchor element wasn't provided, just use the parent body element of this Popover
    const anchorElement = resolvedAnchorEl && resolvedAnchorEl.nodeType === 1 ? resolvedAnchorEl : (0,utils_ownerDocument/* default */.A)(paperRef.current).body;
    const anchorRect = anchorElement.getBoundingClientRect();
    if (false) {}
    return {
      top: anchorRect.top + getOffsetTop(anchorRect, anchorOrigin.vertical),
      left: anchorRect.left + getOffsetLeft(anchorRect, anchorOrigin.horizontal)
    };
  }, [anchorEl, anchorOrigin.horizontal, anchorOrigin.vertical, anchorPosition, anchorReference]);

  // Returns the base transform origin using the element
  const getTransformOrigin = react.useCallback(elemRect => {
    return {
      vertical: getOffsetTop(elemRect, transformOrigin.vertical),
      horizontal: getOffsetLeft(elemRect, transformOrigin.horizontal)
    };
  }, [transformOrigin.horizontal, transformOrigin.vertical]);
  const getPositioningStyle = react.useCallback(element => {
    const elemRect = {
      width: element.offsetWidth,
      height: element.offsetHeight
    };

    // Get the transform origin point on the element itself
    const elemTransformOrigin = getTransformOrigin(elemRect);
    if (anchorReference === 'none') {
      return {
        top: null,
        left: null,
        transformOrigin: getTransformOriginValue(elemTransformOrigin)
      };
    }

    // Get the offset of the anchoring element
    const anchorOffset = getAnchorOffset();

    // Calculate element positioning
    let top = anchorOffset.top - elemTransformOrigin.vertical;
    let left = anchorOffset.left - elemTransformOrigin.horizontal;
    const bottom = top + elemRect.height;
    const right = left + elemRect.width;

    // Use the parent window of the anchorEl if provided
    const containerWindow = (0,utils_ownerWindow/* default */.A)(resolveAnchorEl(anchorEl));

    // Window thresholds taking required margin into account
    const heightThreshold = containerWindow.innerHeight - marginThreshold;
    const widthThreshold = containerWindow.innerWidth - marginThreshold;

    // Check if the vertical axis needs shifting
    if (marginThreshold !== null && top < marginThreshold) {
      const diff = top - marginThreshold;
      top -= diff;
      elemTransformOrigin.vertical += diff;
    } else if (marginThreshold !== null && bottom > heightThreshold) {
      const diff = bottom - heightThreshold;
      top -= diff;
      elemTransformOrigin.vertical += diff;
    }
    if (false) {}

    // Check if the horizontal axis needs shifting
    if (marginThreshold !== null && left < marginThreshold) {
      const diff = left - marginThreshold;
      left -= diff;
      elemTransformOrigin.horizontal += diff;
    } else if (right > widthThreshold) {
      const diff = right - widthThreshold;
      left -= diff;
      elemTransformOrigin.horizontal += diff;
    }
    return {
      top: `${Math.round(top)}px`,
      left: `${Math.round(left)}px`,
      transformOrigin: getTransformOriginValue(elemTransformOrigin)
    };
  }, [anchorEl, anchorReference, getAnchorOffset, getTransformOrigin, marginThreshold]);
  const [isPositioned, setIsPositioned] = react.useState(open);
  const setPositioningStyles = react.useCallback(() => {
    const element = paperRef.current;
    if (!element) {
      return;
    }
    const positioning = getPositioningStyle(element);
    if (positioning.top !== null) {
      element.style.top = positioning.top;
    }
    if (positioning.left !== null) {
      element.style.left = positioning.left;
    }
    element.style.transformOrigin = positioning.transformOrigin;
    setIsPositioned(true);
  }, [getPositioningStyle]);
  react.useEffect(() => {
    if (disableScrollLock) {
      window.addEventListener('scroll', setPositioningStyles);
    }
    return () => window.removeEventListener('scroll', setPositioningStyles);
  }, [anchorEl, disableScrollLock, setPositioningStyles]);
  const handleEntering = (element, isAppearing) => {
    if (onEntering) {
      onEntering(element, isAppearing);
    }
    setPositioningStyles();
  };
  const handleExited = () => {
    setIsPositioned(false);
  };
  react.useEffect(() => {
    if (open) {
      setPositioningStyles();
    }
  });
  react.useImperativeHandle(action, () => open ? {
    updatePosition: () => {
      setPositioningStyles();
    }
  } : null, [open, setPositioningStyles]);
  react.useEffect(() => {
    if (!open) {
      return undefined;
    }
    const handleResize = (0,utils_debounce/* default */.A)(() => {
      setPositioningStyles();
    });
    const containerWindow = (0,utils_ownerWindow/* default */.A)(anchorEl);
    containerWindow.addEventListener('resize', handleResize);
    return () => {
      handleResize.clear();
      containerWindow.removeEventListener('resize', handleResize);
    };
  }, [anchorEl, open, setPositioningStyles]);
  let transitionDuration = transitionDurationProp;
  if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) {
    transitionDuration = undefined;
  }

  // If the container prop is provided, use that
  // If the anchorEl prop is provided, use its parent body element as the container
  // If neither are provided let the Modal take care of choosing the container
  const container = containerProp || (anchorEl ? (0,utils_ownerDocument/* default */.A)(resolveAnchorEl(anchorEl)).body : undefined);
  const RootSlot = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : PopoverRoot;
  const PaperSlot = (_slots$paper = slots == null ? void 0 : slots.paper) != null ? _slots$paper : PopoverPaper;
  const paperProps = useSlotProps({
    elementType: PaperSlot,
    externalSlotProps: (0,esm_extends/* default */.A)({}, externalPaperSlotProps, {
      style: isPositioned ? externalPaperSlotProps.style : (0,esm_extends/* default */.A)({}, externalPaperSlotProps.style, {
        opacity: 0
      })
    }),
    additionalProps: {
      elevation,
      ref: handlePaperRef
    },
    ownerState,
    className: (0,clsx_m/* default */.A)(classes.paper, externalPaperSlotProps == null ? void 0 : externalPaperSlotProps.className)
  });
  const _useSlotProps = useSlotProps({
      elementType: RootSlot,
      externalSlotProps: (slotProps == null ? void 0 : slotProps.root) || {},
      externalForwardedProps: other,
      additionalProps: {
        ref,
        slotProps: {
          backdrop: {
            invisible: true
          }
        },
        container,
        open
      },
      ownerState,
      className: (0,clsx_m/* default */.A)(classes.root, className)
    }),
    {
      slotProps: rootSlotPropsProp
    } = _useSlotProps,
    rootProps = (0,objectWithoutPropertiesLoose/* default */.A)(_useSlotProps, Popover_excluded3);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(RootSlot, (0,esm_extends/* default */.A)({}, rootProps, !isHostComponent(RootSlot) && {
    slotProps: rootSlotPropsProp,
    disableScrollLock
  }, {
    children: /*#__PURE__*/(0,jsx_runtime.jsx)(TransitionComponent, (0,esm_extends/* default */.A)({
      appear: true,
      in: open,
      onEntering: handleEntering,
      onExited: handleExited,
      timeout: transitionDuration
    }, TransitionProps, {
      children: /*#__PURE__*/(0,jsx_runtime.jsx)(PaperSlot, (0,esm_extends/* default */.A)({}, paperProps, {
        children: children
      }))
    }))
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var material_Popover_Popover = (Popover_Popover_Popover);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Menu/menuClasses.js


function getMenuUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiMenu', slot);
}
const menuClasses = (0,generateUtilityClasses/* default */.A)('MuiMenu', ['root', 'paper', 'list']);
/* harmony default export */ var Menu_menuClasses = ((/* unused pure expression or super */ null && (menuClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Menu/Menu.js
'use client';



const Menu_excluded = ["onEntering"],
  Menu_excluded2 = ["autoFocus", "children", "className", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant", "slots", "slotProps"];














const RTL_ORIGIN = {
  vertical: 'top',
  horizontal: 'right'
};
const LTR_ORIGIN = {
  vertical: 'top',
  horizontal: 'left'
};
const Menu_useUtilityClasses = ownerState => {
  const {
    classes
  } = ownerState;
  const slots = {
    root: ['root'],
    paper: ['paper'],
    list: ['list']
  };
  return (0,composeClasses/* default */.A)(slots, getMenuUtilityClass, classes);
};
const MenuRoot = (0,styled/* default */.Ay)(material_Popover_Popover, {
  shouldForwardProp: prop => (0,rootShouldForwardProp/* default */.A)(prop) || prop === 'classes',
  name: 'MuiMenu',
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
})({});
const MenuPaper = (0,styled/* default */.Ay)(PopoverPaper, {
  name: 'MuiMenu',
  slot: 'Paper',
  overridesResolver: (props, styles) => styles.paper
})({
  // specZ: The maximum height of a simple menu should be one or more rows less than the view
  // height. This ensures a tappable area outside of the simple menu with which to dismiss
  // the menu.
  maxHeight: 'calc(100% - 96px)',
  // Add iOS momentum scrolling for iOS < 13.0
  WebkitOverflowScrolling: 'touch'
});
const MenuMenuList = (0,styled/* default */.Ay)(material_MenuList_MenuList, {
  name: 'MuiMenu',
  slot: 'List',
  overridesResolver: (props, styles) => styles.list
})({
  // We disable the focus ring for mouse, touch and keyboard users.
  outline: 0
});
const Menu = /*#__PURE__*/react.forwardRef(function Menu(inProps, ref) {
  var _slots$paper, _slotProps$paper;
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiMenu'
  });
  const {
      autoFocus = true,
      children,
      className,
      disableAutoFocusItem = false,
      MenuListProps = {},
      onClose,
      open,
      PaperProps = {},
      PopoverClasses,
      transitionDuration = 'auto',
      TransitionProps: {
        onEntering
      } = {},
      variant = 'selectedMenu',
      slots = {},
      slotProps = {}
    } = props,
    TransitionProps = (0,objectWithoutPropertiesLoose/* default */.A)(props.TransitionProps, Menu_excluded),
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Menu_excluded2);
  const isRtl = useRtl();
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    autoFocus,
    disableAutoFocusItem,
    MenuListProps,
    onEntering,
    PaperProps,
    transitionDuration,
    TransitionProps,
    variant
  });
  const classes = Menu_useUtilityClasses(ownerState);
  const autoFocusItem = autoFocus && !disableAutoFocusItem && open;
  const menuListActionsRef = react.useRef(null);
  const handleEntering = (element, isAppearing) => {
    if (menuListActionsRef.current) {
      menuListActionsRef.current.adjustStyleForScrollbar(element, {
        direction: isRtl ? 'rtl' : 'ltr'
      });
    }
    if (onEntering) {
      onEntering(element, isAppearing);
    }
  };
  const handleListKeyDown = event => {
    if (event.key === 'Tab') {
      event.preventDefault();
      if (onClose) {
        onClose(event, 'tabKeyDown');
      }
    }
  };

  /**
   * the index of the item should receive focus
   * in a `variant="selectedMenu"` it's the first `selected` item
   * otherwise it's the very first item.
   */
  let activeItemIndex = -1;
  // since we inject focus related props into children we have to do a lookahead
  // to check if there is a `selected` item. We're looking for the last `selected`
  // item and use the first valid item as a fallback
  react.Children.map(children, (child, index) => {
    if (! /*#__PURE__*/react.isValidElement(child)) {
      return;
    }
    if (false) {}
    if (!child.props.disabled) {
      if (variant === 'selectedMenu' && child.props.selected) {
        activeItemIndex = index;
      } else if (activeItemIndex === -1) {
        activeItemIndex = index;
      }
    }
  });
  const PaperSlot = (_slots$paper = slots.paper) != null ? _slots$paper : MenuPaper;
  const paperExternalSlotProps = (_slotProps$paper = slotProps.paper) != null ? _slotProps$paper : PaperProps;
  const rootSlotProps = useSlotProps({
    elementType: slots.root,
    externalSlotProps: slotProps.root,
    ownerState,
    className: [classes.root, className]
  });
  const paperSlotProps = useSlotProps({
    elementType: PaperSlot,
    externalSlotProps: paperExternalSlotProps,
    ownerState,
    className: classes.paper
  });
  return /*#__PURE__*/(0,jsx_runtime.jsx)(MenuRoot, (0,esm_extends/* default */.A)({
    onClose: onClose,
    anchorOrigin: {
      vertical: 'bottom',
      horizontal: isRtl ? 'right' : 'left'
    },
    transformOrigin: isRtl ? RTL_ORIGIN : LTR_ORIGIN,
    slots: {
      paper: PaperSlot,
      root: slots.root
    },
    slotProps: {
      root: rootSlotProps,
      paper: paperSlotProps
    },
    open: open,
    ref: ref,
    transitionDuration: transitionDuration,
    TransitionProps: (0,esm_extends/* default */.A)({
      onEntering: handleEntering
    }, TransitionProps),
    ownerState: ownerState
  }, other, {
    classes: PopoverClasses,
    children: /*#__PURE__*/(0,jsx_runtime.jsx)(MenuMenuList, (0,esm_extends/* default */.A)({
      onKeyDown: handleListKeyDown,
      actions: menuListActionsRef,
      autoFocus: autoFocus && (activeItemIndex === -1 || disableAutoFocusItem),
      autoFocusItem: autoFocusItem,
      variant: variant
    }, MenuListProps, {
      className: (0,clsx_m/* default */.A)(classes.list, MenuListProps.className),
      children: children
    }))
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var Menu_Menu = (Menu);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/NativeSelect/nativeSelectClasses.js


function getNativeSelectUtilityClasses(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiNativeSelect', slot);
}
const nativeSelectClasses = (0,generateUtilityClasses/* default */.A)('MuiNativeSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
/* harmony default export */ var NativeSelect_nativeSelectClasses = (nativeSelectClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/NativeSelect/NativeSelectInput.js
'use client';



const NativeSelectInput_excluded = ["className", "disabled", "error", "IconComponent", "inputRef", "variant"];










const NativeSelectInput_useUtilityClasses = ownerState => {
  const {
    classes,
    variant,
    disabled,
    multiple,
    open,
    error
  } = ownerState;
  const slots = {
    select: ['select', variant, disabled && 'disabled', multiple && 'multiple', error && 'error'],
    icon: ['icon', `icon${(0,utils_capitalize/* default */.A)(variant)}`, open && 'iconOpen', disabled && 'disabled']
  };
  return (0,composeClasses/* default */.A)(slots, getNativeSelectUtilityClasses, classes);
};
const nativeSelectSelectStyles = ({
  ownerState,
  theme
}) => (0,esm_extends/* default */.A)({
  MozAppearance: 'none',
  // Reset
  WebkitAppearance: 'none',
  // Reset
  // When interacting quickly, the text can end up selected.
  // Native select can't be selected either.
  userSelect: 'none',
  borderRadius: 0,
  // Reset
  cursor: 'pointer',
  '&:focus': (0,esm_extends/* default */.A)({}, theme.vars ? {
    backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.05)`
  } : {
    backgroundColor: theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)'
  }, {
    borderRadius: 0 // Reset Chrome style
  }),
  // Remove IE11 arrow
  '&::-ms-expand': {
    display: 'none'
  },
  [`&.${NativeSelect_nativeSelectClasses.disabled}`]: {
    cursor: 'default'
  },
  '&[multiple]': {
    height: 'auto'
  },
  '&:not([multiple]) option, &:not([multiple]) optgroup': {
    backgroundColor: (theme.vars || theme).palette.background.paper
  },
  // Bump specificity to allow extending custom inputs
  '&&&': {
    paddingRight: 24,
    minWidth: 16 // So it doesn't collapse.
  }
}, ownerState.variant === 'filled' && {
  '&&&': {
    paddingRight: 32
  }
}, ownerState.variant === 'outlined' && {
  borderRadius: (theme.vars || theme).shape.borderRadius,
  '&:focus': {
    borderRadius: (theme.vars || theme).shape.borderRadius // Reset the reset for Chrome style
  },
  '&&&': {
    paddingRight: 32
  }
});
const NativeSelectSelect = (0,styled/* default */.Ay)('select', {
  name: 'MuiNativeSelect',
  slot: 'Select',
  shouldForwardProp: rootShouldForwardProp/* default */.A,
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.select, styles[ownerState.variant], ownerState.error && styles.error, {
      [`&.${NativeSelect_nativeSelectClasses.multiple}`]: styles.multiple
    }];
  }
})(nativeSelectSelectStyles);
const nativeSelectIconStyles = ({
  ownerState,
  theme
}) => (0,esm_extends/* default */.A)({
  // We use a position absolute over a flexbox in order to forward the pointer events
  // to the input and to support wrapping tags..
  position: 'absolute',
  right: 0,
  top: 'calc(50% - .5em)',
  // Center vertically, height is 1em
  pointerEvents: 'none',
  // Don't block pointer events on the select under the icon.
  color: (theme.vars || theme).palette.action.active,
  [`&.${NativeSelect_nativeSelectClasses.disabled}`]: {
    color: (theme.vars || theme).palette.action.disabled
  }
}, ownerState.open && {
  transform: 'rotate(180deg)'
}, ownerState.variant === 'filled' && {
  right: 7
}, ownerState.variant === 'outlined' && {
  right: 7
});
const NativeSelectIcon = (0,styled/* default */.Ay)('svg', {
  name: 'MuiNativeSelect',
  slot: 'Icon',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.icon, ownerState.variant && styles[`icon${(0,utils_capitalize/* default */.A)(ownerState.variant)}`], ownerState.open && styles.iconOpen];
  }
})(nativeSelectIconStyles);

/**
 * @ignore - internal component.
 */
const NativeSelectInput = /*#__PURE__*/react.forwardRef(function NativeSelectInput(props, ref) {
  const {
      className,
      disabled,
      error,
      IconComponent,
      inputRef,
      variant = 'standard'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, NativeSelectInput_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    disabled,
    variant,
    error
  });
  const classes = NativeSelectInput_useUtilityClasses(ownerState);
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
    children: [/*#__PURE__*/(0,jsx_runtime.jsx)(NativeSelectSelect, (0,esm_extends/* default */.A)({
      ownerState: ownerState,
      className: (0,clsx_m/* default */.A)(classes.select, className),
      disabled: disabled,
      ref: inputRef || ref
    }, other)), props.multiple ? null : /*#__PURE__*/(0,jsx_runtime.jsx)(NativeSelectIcon, {
      as: IconComponent,
      ownerState: ownerState,
      className: classes.icon
    })]
  });
});
 false ? 0 : void 0;
/* harmony default export */ var NativeSelect_NativeSelectInput = (NativeSelectInput);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/styles/slotShouldForwardProp.js
var slotShouldForwardProp = __webpack_require__(1292);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Select/selectClasses.js


function getSelectUtilityClasses(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiSelect', slot);
}
const selectClasses = (0,generateUtilityClasses/* default */.A)('MuiSelect', ['root', 'select', 'multiple', 'filled', 'outlined', 'standard', 'disabled', 'focused', 'icon', 'iconOpen', 'iconFilled', 'iconOutlined', 'iconStandard', 'nativeInput', 'error']);
/* harmony default export */ var Select_selectClasses = (selectClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Select/SelectInput.js
'use client';




var SelectInput_span;
const SelectInput_excluded = ["aria-describedby", "aria-label", "autoFocus", "autoWidth", "children", "className", "defaultOpen", "defaultValue", "disabled", "displayEmpty", "error", "IconComponent", "inputRef", "labelId", "MenuProps", "multiple", "name", "onBlur", "onChange", "onClose", "onFocus", "onOpen", "open", "readOnly", "renderValue", "SelectDisplayProps", "tabIndex", "type", "value", "variant"];


















const SelectSelect = (0,styled/* default */.Ay)('div', {
  name: 'MuiSelect',
  slot: 'Select',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [
    // Win specificity over the input base
    {
      [`&.${Select_selectClasses.select}`]: styles.select
    }, {
      [`&.${Select_selectClasses.select}`]: styles[ownerState.variant]
    }, {
      [`&.${Select_selectClasses.error}`]: styles.error
    }, {
      [`&.${Select_selectClasses.multiple}`]: styles.multiple
    }];
  }
})(nativeSelectSelectStyles, {
  // Win specificity over the input base
  [`&.${Select_selectClasses.select}`]: {
    height: 'auto',
    // Resets for multiple select with chips
    minHeight: '1.4375em',
    // Required for select\text-field height consistency
    textOverflow: 'ellipsis',
    whiteSpace: 'nowrap',
    overflow: 'hidden'
  }
});
const SelectIcon = (0,styled/* default */.Ay)('svg', {
  name: 'MuiSelect',
  slot: 'Icon',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    return [styles.icon, ownerState.variant && styles[`icon${(0,utils_capitalize/* default */.A)(ownerState.variant)}`], ownerState.open && styles.iconOpen];
  }
})(nativeSelectIconStyles);
const SelectNativeInput = (0,styled/* default */.Ay)('input', {
  shouldForwardProp: prop => (0,slotShouldForwardProp/* default */.A)(prop) && prop !== 'classes',
  name: 'MuiSelect',
  slot: 'NativeInput',
  overridesResolver: (props, styles) => styles.nativeInput
})({
  bottom: 0,
  left: 0,
  position: 'absolute',
  opacity: 0,
  pointerEvents: 'none',
  width: '100%',
  boxSizing: 'border-box'
});
function areEqualValues(a, b) {
  if (typeof b === 'object' && b !== null) {
    return a === b;
  }

  // The value could be a number, the DOM will stringify it anyway.
  return String(a) === String(b);
}
function SelectInput_isEmpty(display) {
  return display == null || typeof display === 'string' && !display.trim();
}
const SelectInput_useUtilityClasses = ownerState => {
  const {
    classes,
    variant,
    disabled,
    multiple,
    open,
    error
  } = ownerState;
  const slots = {
    select: ['select', variant, disabled && 'disabled', multiple && 'multiple', error && 'error'],
    icon: ['icon', `icon${(0,utils_capitalize/* default */.A)(variant)}`, open && 'iconOpen', disabled && 'disabled'],
    nativeInput: ['nativeInput']
  };
  return (0,composeClasses/* default */.A)(slots, getSelectUtilityClasses, classes);
};

/**
 * @ignore - internal component.
 */
const SelectInput = /*#__PURE__*/react.forwardRef(function SelectInput(props, ref) {
  var _MenuProps$slotProps;
  const {
      'aria-describedby': ariaDescribedby,
      'aria-label': ariaLabel,
      autoFocus,
      autoWidth,
      children,
      className,
      defaultOpen,
      defaultValue,
      disabled,
      displayEmpty,
      error = false,
      IconComponent,
      inputRef: inputRefProp,
      labelId,
      MenuProps = {},
      multiple,
      name,
      onBlur,
      onChange,
      onClose,
      onFocus,
      onOpen,
      open: openProp,
      readOnly,
      renderValue,
      SelectDisplayProps = {},
      tabIndex: tabIndexProp
      // catching `type` from Input which makes no sense for SelectInput
      ,

      value: valueProp,
      variant = 'standard'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, SelectInput_excluded);
  const [value, setValueState] = (0,utils_useControlled/* default */.A)({
    controlled: valueProp,
    default: defaultValue,
    name: 'Select'
  });
  const [openState, setOpenState] = (0,utils_useControlled/* default */.A)({
    controlled: openProp,
    default: defaultOpen,
    name: 'Select'
  });
  const inputRef = react.useRef(null);
  const displayRef = react.useRef(null);
  const [displayNode, setDisplayNode] = react.useState(null);
  const {
    current: isOpenControlled
  } = react.useRef(openProp != null);
  const [menuMinWidthState, setMenuMinWidthState] = react.useState();
  const handleRef = (0,utils_useForkRef/* default */.A)(ref, inputRefProp);
  const handleDisplayRef = react.useCallback(node => {
    displayRef.current = node;
    if (node) {
      setDisplayNode(node);
    }
  }, []);
  const anchorElement = displayNode == null ? void 0 : displayNode.parentNode;
  react.useImperativeHandle(handleRef, () => ({
    focus: () => {
      displayRef.current.focus();
    },
    node: inputRef.current,
    value
  }), [value]);

  // Resize menu on `defaultOpen` automatic toggle.
  react.useEffect(() => {
    if (defaultOpen && openState && displayNode && !isOpenControlled) {
      setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
      displayRef.current.focus();
    }
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [displayNode, autoWidth]);
  // `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
  // `defaultOpen` and `openState` are ignored to avoid unnecessary callbacks.
  react.useEffect(() => {
    if (autoFocus) {
      displayRef.current.focus();
    }
  }, [autoFocus]);
  react.useEffect(() => {
    if (!labelId) {
      return undefined;
    }
    const label = (0,utils_ownerDocument/* default */.A)(displayRef.current).getElementById(labelId);
    if (label) {
      const handler = () => {
        if (getSelection().isCollapsed) {
          displayRef.current.focus();
        }
      };
      label.addEventListener('click', handler);
      return () => {
        label.removeEventListener('click', handler);
      };
    }
    return undefined;
  }, [labelId]);
  const update = (open, event) => {
    if (open) {
      if (onOpen) {
        onOpen(event);
      }
    } else if (onClose) {
      onClose(event);
    }
    if (!isOpenControlled) {
      setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
      setOpenState(open);
    }
  };
  const handleMouseDown = event => {
    // Ignore everything but left-click
    if (event.button !== 0) {
      return;
    }
    // Hijack the default focus behavior.
    event.preventDefault();
    displayRef.current.focus();
    update(true, event);
  };
  const handleClose = event => {
    update(false, event);
  };
  const childrenArray = react.Children.toArray(children);

  // Support autofill.
  const handleChange = event => {
    const child = childrenArray.find(childItem => childItem.props.value === event.target.value);
    if (child === undefined) {
      return;
    }
    setValueState(child.props.value);
    if (onChange) {
      onChange(event, child);
    }
  };
  const handleItemClick = child => event => {
    let newValue;

    // We use the tabindex attribute to signal the available options.
    if (!event.currentTarget.hasAttribute('tabindex')) {
      return;
    }
    if (multiple) {
      newValue = Array.isArray(value) ? value.slice() : [];
      const itemIndex = value.indexOf(child.props.value);
      if (itemIndex === -1) {
        newValue.push(child.props.value);
      } else {
        newValue.splice(itemIndex, 1);
      }
    } else {
      newValue = child.props.value;
    }
    if (child.props.onClick) {
      child.props.onClick(event);
    }
    if (value !== newValue) {
      setValueState(newValue);
      if (onChange) {
        // Redefine target to allow name and value to be read.
        // This allows seamless integration with the most popular form libraries.
        // https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
        // Clone the event to not override `target` of the original event.
        const nativeEvent = event.nativeEvent || event;
        const clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
        Object.defineProperty(clonedEvent, 'target', {
          writable: true,
          value: {
            value: newValue,
            name
          }
        });
        onChange(clonedEvent, child);
      }
    }
    if (!multiple) {
      update(false, event);
    }
  };
  const handleKeyDown = event => {
    if (!readOnly) {
      const validKeys = [' ', 'ArrowUp', 'ArrowDown',
      // The native select doesn't respond to enter on macOS, but it's recommended by
      // https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
      'Enter'];
      if (validKeys.indexOf(event.key) !== -1) {
        event.preventDefault();
        update(true, event);
      }
    }
  };
  const open = displayNode !== null && openState;
  const handleBlur = event => {
    // if open event.stopImmediatePropagation
    if (!open && onBlur) {
      // Preact support, target is read only property on a native event.
      Object.defineProperty(event, 'target', {
        writable: true,
        value: {
          value,
          name
        }
      });
      onBlur(event);
    }
  };
  delete other['aria-invalid'];
  let display;
  let displaySingle;
  const displayMultiple = [];
  let computeDisplay = false;
  let foundMatch = false;

  // No need to display any value if the field is empty.
  if (isFilled({
    value
  }) || displayEmpty) {
    if (renderValue) {
      display = renderValue(value);
    } else {
      computeDisplay = true;
    }
  }
  const items = childrenArray.map(child => {
    if (! /*#__PURE__*/react.isValidElement(child)) {
      return null;
    }
    if (false) {}
    let selected;
    if (multiple) {
      if (!Array.isArray(value)) {
        throw new Error( false ? 0 : (0,formatMuiErrorMessage_formatMuiErrorMessage/* default */.A)(2));
      }
      selected = value.some(v => areEqualValues(v, child.props.value));
      if (selected && computeDisplay) {
        displayMultiple.push(child.props.children);
      }
    } else {
      selected = areEqualValues(value, child.props.value);
      if (selected && computeDisplay) {
        displaySingle = child.props.children;
      }
    }
    if (selected) {
      foundMatch = true;
    }
    return /*#__PURE__*/react.cloneElement(child, {
      'aria-selected': selected ? 'true' : 'false',
      onClick: handleItemClick(child),
      onKeyUp: event => {
        if (event.key === ' ') {
          // otherwise our MenuItems dispatches a click event
          // it's not behavior of the native <option> and causes
          // the select to close immediately since we open on space keydown
          event.preventDefault();
        }
        if (child.props.onKeyUp) {
          child.props.onKeyUp(event);
        }
      },
      role: 'option',
      selected,
      value: undefined,
      // The value is most likely not a valid HTML attribute.
      'data-value': child.props.value // Instead, we provide it as a data attribute.
    });
  });
  if (false) {}
  if (computeDisplay) {
    if (multiple) {
      if (displayMultiple.length === 0) {
        display = null;
      } else {
        display = displayMultiple.reduce((output, child, index) => {
          output.push(child);
          if (index < displayMultiple.length - 1) {
            output.push(', ');
          }
          return output;
        }, []);
      }
    } else {
      display = displaySingle;
    }
  }

  // Avoid performing a layout computation in the render method.
  let menuMinWidth = menuMinWidthState;
  if (!autoWidth && isOpenControlled && displayNode) {
    menuMinWidth = anchorElement.clientWidth;
  }
  let tabIndex;
  if (typeof tabIndexProp !== 'undefined') {
    tabIndex = tabIndexProp;
  } else {
    tabIndex = disabled ? null : 0;
  }
  const buttonId = SelectDisplayProps.id || (name ? `mui-component-select-${name}` : undefined);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    variant,
    value,
    open,
    error
  });
  const classes = SelectInput_useUtilityClasses(ownerState);
  const paperProps = (0,esm_extends/* default */.A)({}, MenuProps.PaperProps, (_MenuProps$slotProps = MenuProps.slotProps) == null ? void 0 : _MenuProps$slotProps.paper);
  const listboxId = (0,useId_useId/* default */.A)();
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(react.Fragment, {
    children: [/*#__PURE__*/(0,jsx_runtime.jsx)(SelectSelect, (0,esm_extends/* default */.A)({
      ref: handleDisplayRef,
      tabIndex: tabIndex,
      role: "combobox",
      "aria-controls": listboxId,
      "aria-disabled": disabled ? 'true' : undefined,
      "aria-expanded": open ? 'true' : 'false',
      "aria-haspopup": "listbox",
      "aria-label": ariaLabel,
      "aria-labelledby": [labelId, buttonId].filter(Boolean).join(' ') || undefined,
      "aria-describedby": ariaDescribedby,
      onKeyDown: handleKeyDown,
      onMouseDown: disabled || readOnly ? null : handleMouseDown,
      onBlur: handleBlur,
      onFocus: onFocus
    }, SelectDisplayProps, {
      ownerState: ownerState,
      className: (0,clsx_m/* default */.A)(SelectDisplayProps.className, classes.select, className)
      // The id is required for proper a11y
      ,
      id: buttonId,
      children: SelectInput_isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
      SelectInput_span || (SelectInput_span = /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
        className: "notranslate",
        children: "\u200B"
      })) : display
    })), /*#__PURE__*/(0,jsx_runtime.jsx)(SelectNativeInput, (0,esm_extends/* default */.A)({
      "aria-invalid": error,
      value: Array.isArray(value) ? value.join(',') : value,
      name: name,
      ref: inputRef,
      "aria-hidden": true,
      onChange: handleChange,
      tabIndex: -1,
      disabled: disabled,
      className: classes.nativeInput,
      autoFocus: autoFocus,
      ownerState: ownerState
    }, other)), /*#__PURE__*/(0,jsx_runtime.jsx)(SelectIcon, {
      as: IconComponent,
      className: classes.icon,
      ownerState: ownerState
    }), /*#__PURE__*/(0,jsx_runtime.jsx)(Menu_Menu, (0,esm_extends/* default */.A)({
      id: `menu-${name || ''}`,
      anchorEl: anchorElement,
      open: open,
      onClose: handleClose,
      anchorOrigin: {
        vertical: 'bottom',
        horizontal: 'center'
      },
      transformOrigin: {
        vertical: 'top',
        horizontal: 'center'
      }
    }, MenuProps, {
      MenuListProps: (0,esm_extends/* default */.A)({
        'aria-labelledby': labelId,
        role: 'listbox',
        'aria-multiselectable': multiple ? 'true' : undefined,
        disableListWrap: true,
        id: listboxId
      }, MenuProps.MenuListProps),
      slotProps: (0,esm_extends/* default */.A)({}, MenuProps.slotProps, {
        paper: (0,esm_extends/* default */.A)({}, paperProps, {
          style: (0,esm_extends/* default */.A)({
            minWidth: menuMinWidth
          }, paperProps != null ? paperProps.style : null)
        })
      }),
      children: items
    }))]
  });
});
 false ? 0 : void 0;
/* harmony default export */ var Select_SelectInput = (SelectInput);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/internal/svg-icons/ArrowDropDown.js
'use client';




/**
 * @ignore - internal component.
 */

/* harmony default export */ var ArrowDropDown = ((0,createSvgIcon/* default */.A)( /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
  d: "M7 10l5 5 5-5z"
}), 'ArrowDropDown'));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Select/Select.js
'use client';



const Select_excluded = ["autoWidth", "children", "classes", "className", "defaultOpen", "displayEmpty", "IconComponent", "id", "input", "inputProps", "label", "labelId", "MenuProps", "multiple", "native", "onClose", "onOpen", "open", "renderValue", "SelectDisplayProps", "variant"],
  Select_excluded2 = ["root"];
















const Select_useUtilityClasses = ownerState => {
  const {
    classes
  } = ownerState;
  return classes;
};
const styledRootConfig = {
  name: 'MuiSelect',
  overridesResolver: (props, styles) => styles.root,
  shouldForwardProp: prop => (0,rootShouldForwardProp/* default */.A)(prop) && prop !== 'variant',
  slot: 'Root'
};
const StyledInput = (0,styled/* default */.Ay)(Input_Input, styledRootConfig)('');
const StyledOutlinedInput = (0,styled/* default */.Ay)(OutlinedInput_OutlinedInput, styledRootConfig)('');
const StyledFilledInput = (0,styled/* default */.Ay)(FilledInput_FilledInput, styledRootConfig)('');
const material_Select_Select_Select = /*#__PURE__*/react.forwardRef(function Select(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    name: 'MuiSelect',
    props: inProps
  });
  const {
      autoWidth = false,
      children,
      classes: classesProp = {},
      className,
      defaultOpen = false,
      displayEmpty = false,
      IconComponent = ArrowDropDown,
      id,
      input,
      inputProps,
      label,
      labelId,
      MenuProps,
      multiple = false,
      native = false,
      onClose,
      onOpen,
      open,
      renderValue,
      SelectDisplayProps,
      variant: variantProp = 'outlined'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Select_excluded);
  const inputComponent = native ? NativeSelect_NativeSelectInput : Select_SelectInput;
  const muiFormControl = useFormControl();
  const fcs = formControlState({
    props,
    muiFormControl,
    states: ['variant', 'error']
  });
  const variant = fcs.variant || variantProp;
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    variant,
    classes: classesProp
  });
  const classes = Select_useUtilityClasses(ownerState);
  const restOfClasses = (0,objectWithoutPropertiesLoose/* default */.A)(classes, Select_excluded2);
  const InputComponent = input || {
    standard: /*#__PURE__*/(0,jsx_runtime.jsx)(StyledInput, {
      ownerState: ownerState
    }),
    outlined: /*#__PURE__*/(0,jsx_runtime.jsx)(StyledOutlinedInput, {
      label: label,
      ownerState: ownerState
    }),
    filled: /*#__PURE__*/(0,jsx_runtime.jsx)(StyledFilledInput, {
      ownerState: ownerState
    })
  }[variant];
  const inputComponentRef = (0,utils_useForkRef/* default */.A)(ref, InputComponent.ref);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
    children: /*#__PURE__*/react.cloneElement(InputComponent, (0,esm_extends/* default */.A)({
      // Most of the logic is implemented in `SelectInput`.
      // The `Select` component is a simple API wrapper to expose something better to play with.
      inputComponent,
      inputProps: (0,esm_extends/* default */.A)({
        children,
        error: fcs.error,
        IconComponent,
        variant,
        type: undefined,
        // We render a select. We can ignore the type provided by the `Input`.
        multiple
      }, native ? {
        id
      } : {
        autoWidth,
        defaultOpen,
        displayEmpty,
        labelId,
        MenuProps,
        onClose,
        onOpen,
        open,
        renderValue,
        SelectDisplayProps: (0,esm_extends/* default */.A)({
          id
        }, SelectDisplayProps)
      }, inputProps, {
        classes: inputProps ? (0,deepmerge_deepmerge/* default */.A)(restOfClasses, inputProps.classes) : restOfClasses
      }, input ? input.props.inputProps : {})
    }, (multiple && native || displayEmpty) && variant === 'outlined' ? {
      notched: true
    } : {}, {
      ref: inputComponentRef,
      className: (0,clsx_m/* default */.A)(InputComponent.props.className, className, classes.root)
    }, !input && {
      variant
    }, other))
  });
});
 false ? 0 : void 0;
material_Select_Select_Select.muiName = 'Select';
/* harmony default export */ var material_Select_Select = (material_Select_Select_Select);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/TextField/textFieldClasses.js


function getTextFieldUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiTextField', slot);
}
const textFieldClasses = (0,generateUtilityClasses/* default */.A)('MuiTextField', ['root']);
/* harmony default export */ var TextField_textFieldClasses = ((/* unused pure expression or super */ null && (textFieldClasses)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/TextField/TextField.js
'use client';



const TextField_excluded = ["autoComplete", "autoFocus", "children", "className", "color", "defaultValue", "disabled", "error", "FormHelperTextProps", "fullWidth", "helperText", "id", "InputLabelProps", "inputProps", "InputProps", "inputRef", "label", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onFocus", "placeholder", "required", "rows", "select", "SelectProps", "type", "value", "variant"];


















const variantComponent = {
  standard: Input_Input,
  filled: FilledInput_FilledInput,
  outlined: OutlinedInput_OutlinedInput
};
const TextField_useUtilityClasses = ownerState => {
  const {
    classes
  } = ownerState;
  const slots = {
    root: ['root']
  };
  return (0,composeClasses/* default */.A)(slots, getTextFieldUtilityClass, classes);
};
const TextFieldRoot = (0,styled/* default */.Ay)(material_FormControl_FormControl, {
  name: 'MuiTextField',
  slot: 'Root',
  overridesResolver: (props, styles) => styles.root
})({});

/**
 * The `TextField` is a convenience wrapper for the most common cases (80%).
 * It cannot be all things to all people, otherwise the API would grow out of control.
 *
 * ## Advanced Configuration
 *
 * It's important to understand that the text field is a simple abstraction
 * on top of the following components:
 *
 * - [FormControl](/material-ui/api/form-control/)
 * - [InputLabel](/material-ui/api/input-label/)
 * - [FilledInput](/material-ui/api/filled-input/)
 * - [OutlinedInput](/material-ui/api/outlined-input/)
 * - [Input](/material-ui/api/input/)
 * - [FormHelperText](/material-ui/api/form-helper-text/)
 *
 * If you wish to alter the props applied to the `input` element, you can do so as follows:
 *
 * ```jsx
 * const inputProps = {
 *   step: 300,
 * };
 *
 * return <TextField id="time" type="time" inputProps={inputProps} />;
 * ```
 *
 * For advanced cases, please look at the source of TextField by clicking on the
 * "Edit this page" button above. Consider either:
 *
 * - using the upper case props for passing values directly to the components
 * - using the underlying components directly as shown in the demos
 */
const TextField_TextField = /*#__PURE__*/react.forwardRef(function TextField(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiTextField'
  });
  const {
      autoComplete,
      autoFocus = false,
      children,
      className,
      color = 'primary',
      defaultValue,
      disabled = false,
      error = false,
      FormHelperTextProps,
      fullWidth = false,
      helperText,
      id: idOverride,
      InputLabelProps,
      inputProps,
      InputProps,
      inputRef,
      label,
      maxRows,
      minRows,
      multiline = false,
      name,
      onBlur,
      onChange,
      onFocus,
      placeholder,
      required = false,
      rows,
      select = false,
      SelectProps,
      type,
      value,
      variant = 'outlined'
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, TextField_excluded);
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    autoFocus,
    color,
    disabled,
    error,
    fullWidth,
    multiline,
    required,
    select,
    variant
  });
  const classes = TextField_useUtilityClasses(ownerState);
  if (false) {}
  const InputMore = {};
  if (variant === 'outlined') {
    if (InputLabelProps && typeof InputLabelProps.shrink !== 'undefined') {
      InputMore.notched = InputLabelProps.shrink;
    }
    InputMore.label = label;
  }
  if (select) {
    // unset defaults from textbox inputs
    if (!SelectProps || !SelectProps.native) {
      InputMore.id = undefined;
    }
    InputMore['aria-describedby'] = undefined;
  }
  const id = (0,useId_useId/* default */.A)(idOverride);
  const helperTextId = helperText && id ? `${id}-helper-text` : undefined;
  const inputLabelId = label && id ? `${id}-label` : undefined;
  const InputComponent = variantComponent[variant];
  const InputElement = /*#__PURE__*/(0,jsx_runtime.jsx)(InputComponent, (0,esm_extends/* default */.A)({
    "aria-describedby": helperTextId,
    autoComplete: autoComplete,
    autoFocus: autoFocus,
    defaultValue: defaultValue,
    fullWidth: fullWidth,
    multiline: multiline,
    name: name,
    rows: rows,
    maxRows: maxRows,
    minRows: minRows,
    type: type,
    value: value,
    id: id,
    inputRef: inputRef,
    onBlur: onBlur,
    onChange: onChange,
    onFocus: onFocus,
    placeholder: placeholder,
    inputProps: inputProps
  }, InputMore, InputProps));
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(TextFieldRoot, (0,esm_extends/* default */.A)({
    className: (0,clsx_m/* default */.A)(classes.root, className),
    disabled: disabled,
    error: error,
    fullWidth: fullWidth,
    ref: ref,
    required: required,
    color: color,
    variant: variant,
    ownerState: ownerState
  }, other, {
    children: [label != null && label !== '' && /*#__PURE__*/(0,jsx_runtime.jsx)(material_InputLabel_InputLabel, (0,esm_extends/* default */.A)({
      htmlFor: id,
      id: inputLabelId
    }, InputLabelProps, {
      children: label
    })), select ? /*#__PURE__*/(0,jsx_runtime.jsx)(material_Select_Select, (0,esm_extends/* default */.A)({
      "aria-describedby": helperTextId,
      id: id,
      labelId: inputLabelId,
      value: value,
      input: InputElement
    }, SelectProps, {
      children: children
    })) : InputElement, helperText && /*#__PURE__*/(0,jsx_runtime.jsx)(material_FormHelperText_FormHelperText, (0,esm_extends/* default */.A)({
      id: helperTextId
    }, FormHelperTextProps, {
      children: helperText
    }))]
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var material_TextField_TextField = (TextField_TextField);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/LabeledInput/LabeledInputProps.ts

var LabeledInputProps_Variant = /*#__PURE__*/function (Variant) {
  Variant["STANDARD"] = "standard";
  Variant["OUTLINED"] = "outlined";
  Variant["FILLED"] = "filled";
  return Variant;
}({});
var LabeledInputProps_Size = /*#__PURE__*/function (Size) {
  Size["SMALL"] = "small";
  Size["MEDIUM"] = "medium";
  return Size;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/LabeledInput/LabeledInput.tsx

/* eslint-disable react/require-default-props */







var StyledInputBase = (0,styled/* default */.Ay)(material_TextField_TextField)(function (_ref) {
  var theme = _ref.theme;
  return {
    '.Mui-focused': {
      '.MuiOutlinedInput-notchedOutline': {
        borderColor: theme.palette.primary.main,
        borderWidth: 1
      }
    },
    'input::placeholder': {
      color: theme.palette.grey['900']
    },
    '& .MuiFormHelperText-root': {
      fontSize: '12px'
    },
    '& .Mui-error': {
      '.MuiOutlinedInput-notchedOutline': {
        borderColor: theme.palette.error.main
      }
    }
  };
});
/**
 * This input component is part of a form. The InputLabel is used together with the TextField component
 *
 * Demo:
 *
 * - [FormControl](https://mui.com/material-ui/react-text-field/#icons)
 * - [TextField](https://mui.com/material-ui/react-text-field/)
 *
 * API:
 *
 * - [FormControl API](https://mui.com/material-ui/api/form-control/)
 * - [InputLabel API](https://mui.com/material-ui/api/input-label/)
 * - [TextField API](https://mui.com/material-ui/api/text-field/)
 */
var LabeledInput_LabeledInput = function LabeledInput(_ref2) {
  var autoComplete = _ref2.autoComplete,
    autoFocus = _ref2.autoFocus,
    disabled = _ref2.disabled,
    error = _ref2.error,
    fullWidth = _ref2.fullWidth,
    id = _ref2.id,
    _ref2$helperText = _ref2.helperText,
    helperText = _ref2$helperText === void 0 ? '' : _ref2$helperText,
    label = _ref2.label,
    maxLength = _ref2.maxLength,
    multiline = _ref2.multiline,
    onClick = _ref2.onClick,
    onChange = _ref2.onChange,
    placeholder = _ref2.placeholder,
    required = _ref2.required,
    rows = _ref2.rows,
    _ref2$size = _ref2.size,
    size = _ref2$size === void 0 ? Size.SMALL : _ref2$size,
    type = _ref2.type,
    value = _ref2.value,
    variant = _ref2.variant,
    select = _ref2.select,
    children = _ref2.children,
    SelectProps = _ref2.SelectProps,
    onFocus = _ref2.onFocus,
    onBlur = _ref2.onBlur,
    onKeyDown = _ref2.onKeyDown,
    inputRef = _ref2.inputRef,
    defaultValue = _ref2.defaultValue,
    tooltip = _ref2.tooltip,
    minRows = _ref2.minRows,
    maxRows = _ref2.maxRows,
    name = _ref2.name;
  var _useState = useState(false),
    _useState2 = _slicedToArray(_useState, 2),
    isInputLabelFocused = _useState2[0],
    setIsInputLabelFocused = _useState2[1];
  var onInputFocus = function onInputFocus(event) {
    setIsInputLabelFocused(true);
    if (onFocus) {
      onFocus(event);
    }
  };
  var onInputBlur = function onInputBlur(event) {
    setIsInputLabelFocused(false);
    if (onBlur) {
      onBlur(event);
    }
  };
  return /*#__PURE__*/React.createElement(FormControl, {
    fullWidth: fullWidth,
    variant: "standard"
  }, label && /*#__PURE__*/React.createElement(Stack, {
    alignItems: StackProps.AlignItems.CENTER,
    direction: StackProps.Direction.ROW,
    spacing: 2
  }, /*#__PURE__*/React.createElement(InputLabel, {
    htmlFor: id,
    shrink: true,
    focused: isInputLabelFocused,
    error: error
  }, label), tooltip || null), /*#__PURE__*/React.createElement(StyledInputBase, {
    autoComplete: autoComplete,
    autoFocus: autoFocus,
    disabled: disabled,
    id: id,
    multiline: multiline,
    onClick: onClick,
    onChange: onChange,
    placeholder: placeholder,
    required: required,
    rows: rows,
    size: size !== null && size !== void 0 ? size : 'small',
    type: type,
    value: value,
    variant: variant,
    inputProps: {
      maxLength: maxLength !== null && maxLength !== void 0 ? maxLength : null
    },
    error: error,
    helperText: helperText,
    select: select,
    onFocus: onInputFocus,
    onBlur: onInputBlur,
    onKeyDown: onKeyDown,
    SelectProps: SelectProps,
    inputRef: inputRef,
    defaultValue: defaultValue,
    minRows: minRows,
    maxRows: maxRows,
    name: name
  }, children !== null && children !== void 0 ? children : null));
};
/* harmony default export */ var custom_LabeledInput_LabeledInput = ((/* unused pure expression or super */ null && (LabeledInput_LabeledInput)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/LabeledInput/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Breadcrumbs/Breadcrumbs.tsx



/**
 *
 * Demo:
 *
 * - [Breadcrumbs](https://mui.com/material-ui/react-breadcrumbs/)
 *
 * API:
 *
 * - [Breadcrumbs API](https://mui.com/material-ui/api/breadcrumbs/)
 */

var Breadcrumbs = function Breadcrumbs(_ref) {
  var children = _ref.children,
    sx = _ref.sx,
    maxItems = _ref.maxItems;
  return /*#__PURE__*/React.createElement(MuiBreadcrumbs, {
    sx: sx,
    "aria-label": "breadcrumb",
    maxItems: maxItems
  }, children);
};
/* harmony default export */ var Breadcrumbs_Breadcrumbs = ((/* unused pure expression or super */ null && (Breadcrumbs)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Breadcrumbs/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/TextField/TextField.tsx

function TextField_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function TextField_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? TextField_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : TextField_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





/**
 *
 * Demo:
 *
 * - [TextField](https://mui.com/material-ui/react-text-field/)
 *
 * API:
 *
 * - [TextField API](https://mui.com/material-ui/api/text-field/)
 */

var TextField_TextField_TextField = function TextField(props) {
  var inputProps = TextField_objectSpread({}, props.inputProps);
  if (props.adornment) {
    var adornmentKey = props.adornment === AdornmentPosition.START ? 'startAdornment' : 'endAdornment';
    inputProps = TextField_objectSpread(TextField_objectSpread({}, props.inputProps), {}, _defineProperty({}, adornmentKey, /*#__PURE__*/React.createElement(InputAdornment, {
      position: props.adornment
    }, props.icon)));
  }
  return /*#__PURE__*/React.createElement(MuiTextField, {
    id: props.id,
    variant: props.variant,
    placeholder: props.placeholder,
    inputProps: inputProps,
    disabled: props.disabled,
    value: props.value,
    onFocus: props.onFocus,
    onBlur: props.onBlur,
    autoFocus: props.autoFocus,
    onChange: props.onChange,
    fullWidth: props.fullWidth,
    inputRef: props.inputRef,
    size: props.size,
    multiline: props.multiline,
    maxRows: props.maxRows,
    rows: props.rows
  });
};
/* harmony default export */ var custom_TextField_TextField = ((/* unused pure expression or super */ null && (TextField_TextField_TextField)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/TextField/TextFieldProps.ts
var TextFieldProps_Variant = /*#__PURE__*/function (Variant) {
  Variant["STANDARD"] = "standard";
  Variant["OUTLINED"] = "outlined";
  Variant["FILLED"] = "filled";
  return Variant;
}({});
var TextFieldProps_Size = /*#__PURE__*/function (Size) {
  Size["SMALL"] = "small";
  Size["MEDIUM"] = "medium";
  return Size;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/TextField/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Badge/BadgeProps.ts
var BadgeProps_BadgeType = /*#__PURE__*/function (BadgeType) {
  BadgeType["NEW"] = "new";
  BadgeType["BETA"] = "beta";
  BadgeType["COMING_SOON"] = "comingSoon";
  BadgeType["PUBLISHED"] = "published";
  BadgeType["BOOKSHELF"] = "bookshelf";
  BadgeType["TEMPLATE"] = "template";
  BadgeType["DRAFT"] = "draft";
  BadgeType["NOT_PUBLISHED"] = "notPublished";
  BadgeType["REVIEW_PENDING"] = "reviewPending";
  BadgeType["REVIEW_BLOCKED"] = "blocked";
  BadgeType["CONVERT_FAILED"] = "convertFailed";
  BadgeType["DELETED"] = "deleted";
  BadgeType["INACTIVE"] = "inactive";
  return BadgeType;
}({});
var BadgeProps_Size = /*#__PURE__*/function (Size) {
  Size["SMALL"] = "small";
  Size["MEDIUM"] = "medium";
  return Size;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Badge/Badge.tsx

var _BadgeLabel;



var BadgeLabel = (_BadgeLabel = {}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_BadgeLabel, BadgeProps_BadgeType.COMING_SOON, 'COMING SOON'), BadgeProps_BadgeType.NEW, 'NEW'), BadgeProps_BadgeType.BETA, 'BETA'), BadgeProps_BadgeType.PUBLISHED, 'Published'), BadgeProps_BadgeType.BOOKSHELF, 'Bookshelf'), BadgeProps_BadgeType.TEMPLATE, 'Template'), BadgeProps_BadgeType.DRAFT, 'Draft'), BadgeProps_BadgeType.NOT_PUBLISHED, 'Not published'), BadgeProps_BadgeType.REVIEW_PENDING, 'Review pending'), BadgeProps_BadgeType.CONVERT_FAILED, 'Convert failed'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_BadgeLabel, BadgeProps_BadgeType.DELETED, 'Deleted'), BadgeProps_BadgeType.REVIEW_BLOCKED, 'Copyright claim'), BadgeProps_BadgeType.INACTIVE, 'Inactive'));
var Badge_Badge = function Badge(props) {
  var label = props.type ? BadgeLabel[props.type] : BadgeLabel[BadgeType.NEW];
  return /*#__PURE__*/React.createElement(Chip, {
    label: label,
    variant: ChipProps.Variant.BADGE,
    size: props.size || Size.MEDIUM
  });
};
/* harmony default export */ var custom_Badge_Badge = ((/* unused pure expression or super */ null && (Badge_Badge)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Badge/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/IconInput/IconInput.tsx

function IconInput_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function IconInput_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? IconInput_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : IconInput_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





var IconInput_StyledOutlinedInput = (0,styled/* default */.Ay)(OutlinedInput_OutlinedInput)(function (_ref) {
  var theme = _ref.theme;
  return {
    '&.Mui-disabled': {
      color: theme.palette.text.disabled,
      '&& .MuiOutlinedInput-notchedOutline': {
        borderColor: theme.palette.text.disabled
      }
    }
  };
});

/**
 * This input component is part of a form. The IconInput is used together with the OutlinedInput component which
 * supports Adornment elements
 *
 * Demo:
 * - [FormControl](https://mui.com/material-ui/react-text-field/#icons)
 *
 * API:
 *
 * - [FormControl API](https://mui.com/material-ui/api/form-control/)
 * - [InputLabel API](https://mui.com/material-ui/api/input-label/)
 * - [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/)
 */
var IconInput = function IconInput(props) {
  return /*#__PURE__*/React.createElement(FormControl, {
    fullWidth: props.fullWidth,
    variant: props.variant,
    sx: IconInput_objectSpread({}, props.sx)
  }, /*#__PURE__*/React.createElement(InputLabel, {
    htmlFor: props.id,
    shrink: true
  }, props.label), /*#__PURE__*/React.createElement(IconInput_StyledOutlinedInput, {
    id: props.id,
    name: props.name,
    placeholder: props.placeholder,
    type: props.type,
    error: props.error,
    readOnly: props.readOnly,
    disabled: props.disabled,
    value: props.value,
    startAdornment: props.startAdornment,
    endAdornment: props.endAdornment,
    fullWidth: props.fullWidth,
    size: "small"
  }));
};
/* harmony default export */ var IconInput_IconInput = ((/* unused pure expression or super */ null && (IconInput)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/RadioGroup/RadioGroup.tsx


var RadioGroup = function RadioGroup(_ref) {
  var listOfOptions = _ref.listOfOptions,
    _ref$name = _ref.name,
    name = _ref$name === void 0 ? 'controlled-radio-buttons-group' : _ref$name,
    handleChange = _ref.handleChange,
    value = _ref.value,
    _ref$defaultValue = _ref.defaultValue,
    defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue;
  return /*#__PURE__*/React.createElement(MuiRadioGroup, {
    "aria-labelledby": "radio-buttons-group",
    name: name,
    value: value,
    defaultValue: defaultValue,
    onChange: handleChange
  }, listOfOptions.map(function (option) {
    return /*#__PURE__*/React.createElement(MuiFormControlLabel, {
      key: option.label,
      value: option.value,
      label: option.label,
      control: /*#__PURE__*/React.createElement(MuiRadio, null)
    });
  }));
};
/* harmony default export */ var RadioGroup_RadioGroup = ((/* unused pure expression or super */ null && (RadioGroup)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Modal/ModalProps.tsx

var ModalProps_SizeType = /*#__PURE__*/function (SizeType) {
  SizeType["LARGE"] = "large";
  SizeType["STANDARD"] = "standard";
  SizeType["MEDIUM"] = "medium";
  SizeType["SMALL"] = "small";
  SizeType["PRODUCT_FEED"] = "productFeed";
  SizeType["CUSTOMIZE_MODAL"] = "customizeModal";
  SizeType["PRODUCT_LINKING_ERROR"] = "productLinkingError";
  return SizeType;
}({});
var ModalProps_Size = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, ModalProps_SizeType.LARGE, {
  width: 1000,
  height: 720
}), ModalProps_SizeType.STANDARD, {
  width: 1000,
  height: 620
}), ModalProps_SizeType.MEDIUM, {
  width: 900,
  height: 472
}), ModalProps_SizeType.SMALL, {
  width: 560,
  height: 208
}), ModalProps_SizeType.PRODUCT_FEED, {
  width: 640,
  height: 720
}), ModalProps_SizeType.CUSTOMIZE_MODAL, {
  width: 640,
  height: 'auto'
}), ModalProps_SizeType.PRODUCT_LINKING_ERROR, {
  width: 640,
  height: 'auto'
});
var ModalProps_CloseButtonLocationType = /*#__PURE__*/function (CloseButtonLocationType) {
  CloseButtonLocationType["INSIDE"] = "inside";
  CloseButtonLocationType["OUTSIDE"] = "outside";
  CloseButtonLocationType["NONE"] = "none";
  return CloseButtonLocationType;
}({});
var ModalProps_Margin = '32px';
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Modal/Modal.tsx






var sxCloseButtonContainer = {
  display: 'flex',
  justifyContent: 'center',
  alignItems: 'center',
  position: 'absolute',
  right: '-48px',
  top: 0,
  width: '40px',
  height: '40px',
  background: '#FFF',
  borderRadius: '50%'
};
var sxIconButton = {
  borderRadius: '50%',
  width: '40px',
  height: '40px'
};

/**
 *
 * Demos:
 *
 * - [Modal](https://mui.com/material-ui/react-modal/)
 *
 * API:
 *
 * - [Modal API](https://mui.com/material-ui/api/modal/)
 */

var Modal_Modal_Modal = function Modal(_ref) {
  var _ref$sizeType = _ref.sizeType,
    sizeType = _ref$sizeType === void 0 ? SizeType.STANDARD : _ref$sizeType,
    title = _ref.title,
    _ref$showDivider = _ref.showDivider,
    showDivider = _ref$showDivider === void 0 ? false : _ref$showDivider,
    onClose = _ref.onClose,
    children = _ref.children,
    _ref$isFitContent = _ref.isFitContent,
    isFitContent = _ref$isFitContent === void 0 ? false : _ref$isFitContent,
    _ref$disableAutoFocus = _ref.disableAutoFocus,
    disableAutoFocus = _ref$disableAutoFocus === void 0 ? false : _ref$disableAutoFocus,
    _ref$closeButtonLocat = _ref.closeButtonLocation,
    closeButtonLocation = _ref$closeButtonLocat === void 0 ? CloseButtonLocationType.INSIDE : _ref$closeButtonLocat,
    _ref$maxHeight = _ref.maxHeight,
    maxHeight = _ref$maxHeight === void 0 ? Size[sizeType].height : _ref$maxHeight,
    _ref$contentHeight = _ref.contentHeight,
    contentHeight = _ref$contentHeight === void 0 ? '100%' : _ref$contentHeight,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? "calc(100% - 2 * ".concat(Margin, ");") : _ref$height,
    _ref$contentOverflow = _ref.contentOverflow,
    contentOverflow = _ref$contentOverflow === void 0 ? 'auto' : _ref$contentOverflow;
  var isOutsideCloseButtonLocation = closeButtonLocation === CloseButtonLocationType.OUTSIDE;
  var style = {
    position: 'relative',
    overflowY: isOutsideCloseButtonLocation ? 'unset' : 'auto',
    maxWidth: isFitContent ? 'fit-content' : Size[sizeType].width,
    width: "calc(100% - 2 * ".concat(Margin, ");"),
    maxHeight: maxHeight,
    height: isFitContent ? 'fit-content' : height,
    borderRadius: 4,
    bgcolor: 'background.paper'
  };
  return /*#__PURE__*/React.createElement(MuiModal, {
    open: true,
    onClose: onClose,
    disableAutoFocus: disableAutoFocus,
    sx: {
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'center'
    }
  }, /*#__PURE__*/React.createElement(MuiBox, {
    sx: style,
    display: BoxProps.Display.FLEX,
    flexDirection: BoxProps.FlexDirection.COLUMN
  }, isOutsideCloseButtonLocation && /*#__PURE__*/React.createElement(Box, {
    sx: sxCloseButtonContainer
  }, /*#__PURE__*/React.createElement(IconButton, {
    onClick: onClose,
    sx: sxIconButton
  }, /*#__PURE__*/React.createElement(Close, null))), title && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
    display: BoxProps.Display.FLEX,
    justifyContent: BoxProps.JustifyContent.SPACE_BETWEEN,
    p: "24px"
  }, /*#__PURE__*/React.createElement(Box, {
    display: BoxProps.Display.FLEX,
    flexDirection: BoxProps.FlexDirection.COLUMN,
    justifyContent: BoxProps.JustifyContent.CENTER
  }, /*#__PURE__*/React.createElement(Typography, {
    variant: TypographyProps.Variants.H4
  }, title)), closeButtonLocation === CloseButtonLocationType.INSIDE && /*#__PURE__*/React.createElement(IconButton, {
    onClick: onClose
  }, /*#__PURE__*/React.createElement(Close, null))), showDivider && /*#__PURE__*/React.createElement(Divider, null)), /*#__PURE__*/React.createElement(Box, {
    display: BoxProps.Display.FLEX,
    maxHeight: contentHeight,
    overflow: contentOverflow,
    sx: {
      flex: '1'
    }
  }, children)));
};
/* harmony default export */ var custom_Modal_Modal = ((/* unused pure expression or super */ null && (Modal_Modal_Modal)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Modal/index.ts



;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/InfoBox/InfoBox.tsx


var InfoBox = function InfoBox(_ref) {
  var badgeType = _ref.badgeType,
    title = _ref.title,
    description = _ref.description,
    learnMoreUrl = _ref.learnMoreUrl,
    children = _ref.children;
  var sxContainer = {
    gap: 8
  };
  var sxTypography = {
    color: 'text.primary',
    '&:hover': {
      color: 'text.primary'
    }
  };
  return /*#__PURE__*/React.createElement(Paper, {
    variant: PaperProps.Variant.ELEVATED,
    padding: "16px"
  }, /*#__PURE__*/React.createElement(Stack, {
    direction: StackProps.Direction.COLUMN,
    alignItems: StackProps.AlignItems.FLEX_START,
    sx: sxContainer
  }, /*#__PURE__*/React.createElement(Stack, {
    direction: StackProps.Direction.COLUMN,
    alignItems: StackProps.AlignItems.FLEX_START,
    spacing: 4
  }, badgeType && /*#__PURE__*/React.createElement(Box, {
    mb: "16px"
  }, /*#__PURE__*/React.createElement(Badge, {
    type: BadgeProps.BadgeType.COMING_SOON
  })), /*#__PURE__*/React.createElement(Typography, {
    variant: TypographyProps.Variants.H5,
    sx: sxTypography
  }, title), /*#__PURE__*/React.createElement(Typography, {
    variant: TypographyProps.Variants.BODY2,
    sx: sxTypography
  }, description, learnMoreUrl && /*#__PURE__*/React.createElement(React.Fragment, null, ' ', /*#__PURE__*/React.createElement(Link, {
    href: learnMoreUrl
  }, "Learn more")))), children));
};
/* harmony default export */ var InfoBox_InfoBox = ((/* unused pure expression or super */ null && (InfoBox)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/InfoBox/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/FileInputButton/FileInputButton.tsx



var FileInputButton_VisuallyHiddenInput = (0,styled/* default */.Ay)('input')({
  clip: 'rect(0 0 0 0)',
  clipPath: 'inset(50%)',
  height: 1,
  overflow: 'hidden',
  bottom: 0,
  left: 0,
  whiteSpace: 'nowrap',
  width: 1,
  position: 'absolute'
});
var FileInputButton = function FileInputButton(_ref) {
  var variant = _ref.variant,
    children = _ref.children,
    color = _ref.color,
    size = _ref.size,
    fullWidth = _ref.fullWidth,
    onChange = _ref.onChange,
    disabled = _ref.disabled;
  return /*#__PURE__*/React.createElement(Button, {
    component: "label",
    variant: variant,
    color: color,
    size: size,
    fullWidth: fullWidth,
    disabled: disabled
  }, children, /*#__PURE__*/React.createElement(FileInputButton_VisuallyHiddenInput, {
    type: "file",
    onChange: onChange,
    multiple: true
  }));
};
/* harmony default export */ var FileInputButton_FileInputButton = ((/* unused pure expression or super */ null && (FileInputButton)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/useAutocomplete/useAutocomplete.js
'use client';

/* eslint-disable no-constant-condition */




// https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript
// Give up on IE11 support for this feature
function stripDiacritics(string) {
  return typeof string.normalize !== 'undefined' ? string.normalize('NFD').replace(/[\u0300-\u036f]/g, '') : string;
}
function createFilterOptions(config = {}) {
  const {
    ignoreAccents = true,
    ignoreCase = true,
    limit,
    matchFrom = 'any',
    stringify,
    trim = false
  } = config;
  return (options, {
    inputValue,
    getOptionLabel
  }) => {
    let input = trim ? inputValue.trim() : inputValue;
    if (ignoreCase) {
      input = input.toLowerCase();
    }
    if (ignoreAccents) {
      input = stripDiacritics(input);
    }
    const filteredOptions = !input ? options : options.filter(option => {
      let candidate = (stringify || getOptionLabel)(option);
      if (ignoreCase) {
        candidate = candidate.toLowerCase();
      }
      if (ignoreAccents) {
        candidate = stripDiacritics(candidate);
      }
      return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1;
    });
    return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;
  };
}

// To replace with .findIndex() once we stop IE11 support.
function useAutocomplete_findIndex(array, comp) {
  for (let i = 0; i < array.length; i += 1) {
    if (comp(array[i])) {
      return i;
    }
  }
  return -1;
}
const defaultFilterOptions = createFilterOptions();

// Number of options to jump in list box when `Page Up` and `Page Down` keys are used.
const pageSize = 5;
const defaultIsActiveElementInListbox = listboxRef => {
  var _listboxRef$current$p;
  return listboxRef.current !== null && ((_listboxRef$current$p = listboxRef.current.parentElement) == null ? void 0 : _listboxRef$current$p.contains(document.activeElement));
};
function useAutocomplete(props) {
  const {
    // eslint-disable-next-line @typescript-eslint/naming-convention
    unstable_isActiveElementInListbox = defaultIsActiveElementInListbox,
    // eslint-disable-next-line @typescript-eslint/naming-convention
    unstable_classNamePrefix = 'Mui',
    autoComplete = false,
    autoHighlight = false,
    autoSelect = false,
    blurOnSelect = false,
    clearOnBlur = !props.freeSolo,
    clearOnEscape = false,
    componentName = 'useAutocomplete',
    defaultValue = props.multiple ? [] : null,
    disableClearable = false,
    disableCloseOnSelect = false,
    disabled: disabledProp,
    disabledItemsFocusable = false,
    disableListWrap = false,
    filterOptions = defaultFilterOptions,
    filterSelectedOptions = false,
    freeSolo = false,
    getOptionDisabled,
    getOptionKey,
    getOptionLabel: getOptionLabelProp = option => {
      var _option$label;
      return (_option$label = option.label) != null ? _option$label : option;
    },
    groupBy,
    handleHomeEndKeys = !props.freeSolo,
    id: idProp,
    includeInputInList = false,
    inputValue: inputValueProp,
    isOptionEqualToValue = (option, value) => option === value,
    multiple = false,
    onChange,
    onClose,
    onHighlightChange,
    onInputChange,
    onOpen,
    open: openProp,
    openOnFocus = false,
    options,
    readOnly = false,
    selectOnFocus = !props.freeSolo,
    value: valueProp
  } = props;
  const id = useId(idProp);
  let getOptionLabel = getOptionLabelProp;
  getOptionLabel = option => {
    const optionLabel = getOptionLabelProp(option);
    if (typeof optionLabel !== 'string') {
      if (false) {}
      return String(optionLabel);
    }
    return optionLabel;
  };
  const ignoreFocus = React.useRef(false);
  const firstFocus = React.useRef(true);
  const inputRef = React.useRef(null);
  const listboxRef = React.useRef(null);
  const [anchorEl, setAnchorEl] = React.useState(null);
  const [focusedTag, setFocusedTag] = React.useState(-1);
  const defaultHighlighted = autoHighlight ? 0 : -1;
  const highlightedIndexRef = React.useRef(defaultHighlighted);
  const [value, setValueState] = useControlled({
    controlled: valueProp,
    default: defaultValue,
    name: componentName
  });
  const [inputValue, setInputValueState] = useControlled({
    controlled: inputValueProp,
    default: '',
    name: componentName,
    state: 'inputValue'
  });
  const [focused, setFocused] = React.useState(false);
  const resetInputValue = React.useCallback((event, newValue) => {
    // retain current `inputValue` if new option isn't selected and `clearOnBlur` is false
    // When `multiple` is enabled, `newValue` is an array of all selected items including the newly selected item
    const isOptionSelected = multiple ? value.length < newValue.length : newValue !== null;
    if (!isOptionSelected && !clearOnBlur) {
      return;
    }
    let newInputValue;
    if (multiple) {
      newInputValue = '';
    } else if (newValue == null) {
      newInputValue = '';
    } else {
      const optionLabel = getOptionLabel(newValue);
      newInputValue = typeof optionLabel === 'string' ? optionLabel : '';
    }
    if (inputValue === newInputValue) {
      return;
    }
    setInputValueState(newInputValue);
    if (onInputChange) {
      onInputChange(event, newInputValue, 'reset');
    }
  }, [getOptionLabel, inputValue, multiple, onInputChange, setInputValueState, clearOnBlur, value]);
  const [open, setOpenState] = useControlled({
    controlled: openProp,
    default: false,
    name: componentName,
    state: 'open'
  });
  const [inputPristine, setInputPristine] = React.useState(true);
  const inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value);
  const popupOpen = open && !readOnly;
  const filteredOptions = popupOpen ? filterOptions(options.filter(option => {
    if (filterSelectedOptions && (multiple ? value : [value]).some(value2 => value2 !== null && isOptionEqualToValue(option, value2))) {
      return false;
    }
    return true;
  }),
  // we use the empty string to manipulate `filterOptions` to not filter any options
  // i.e. the filter predicate always returns true
  {
    inputValue: inputValueIsSelectedValue && inputPristine ? '' : inputValue,
    getOptionLabel
  }) : [];
  const previousProps = usePreviousProps({
    filteredOptions,
    value,
    inputValue
  });
  React.useEffect(() => {
    const valueChange = value !== previousProps.value;
    if (focused && !valueChange) {
      return;
    }

    // Only reset the input's value when freeSolo if the component's value changes.
    if (freeSolo && !valueChange) {
      return;
    }
    resetInputValue(null, value);
  }, [value, resetInputValue, focused, previousProps.value, freeSolo]);
  const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;
  if (false) {}
  const focusTag = useEventCallback(tagToFocus => {
    if (tagToFocus === -1) {
      inputRef.current.focus();
    } else {
      anchorEl.querySelector(`[data-tag-index="${tagToFocus}"]`).focus();
    }
  });

  // Ensure the focusedTag is never inconsistent
  React.useEffect(() => {
    if (multiple && focusedTag > value.length - 1) {
      setFocusedTag(-1);
      focusTag(-1);
    }
  }, [value, multiple, focusedTag, focusTag]);
  function validOptionIndex(index, direction) {
    if (!listboxRef.current || index < 0 || index >= filteredOptions.length) {
      return -1;
    }
    let nextFocus = index;
    while (true) {
      const option = listboxRef.current.querySelector(`[data-option-index="${nextFocus}"]`);

      // Same logic as MenuList.js
      const nextFocusDisabled = disabledItemsFocusable ? false : !option || option.disabled || option.getAttribute('aria-disabled') === 'true';
      if (option && option.hasAttribute('tabindex') && !nextFocusDisabled) {
        // The next option is available
        return nextFocus;
      }

      // The next option is disabled, move to the next element.
      // with looped index
      if (direction === 'next') {
        nextFocus = (nextFocus + 1) % filteredOptions.length;
      } else {
        nextFocus = (nextFocus - 1 + filteredOptions.length) % filteredOptions.length;
      }

      // We end up with initial index, that means we don't have available options.
      // All of them are disabled
      if (nextFocus === index) {
        return -1;
      }
    }
  }
  const setHighlightedIndex = useEventCallback(({
    event,
    index,
    reason = 'auto'
  }) => {
    highlightedIndexRef.current = index;

    // does the index exist?
    if (index === -1) {
      inputRef.current.removeAttribute('aria-activedescendant');
    } else {
      inputRef.current.setAttribute('aria-activedescendant', `${id}-option-${index}`);
    }
    if (onHighlightChange) {
      onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
    }
    if (!listboxRef.current) {
      return;
    }
    const prev = listboxRef.current.querySelector(`[role="option"].${unstable_classNamePrefix}-focused`);
    if (prev) {
      prev.classList.remove(`${unstable_classNamePrefix}-focused`);
      prev.classList.remove(`${unstable_classNamePrefix}-focusVisible`);
    }
    let listboxNode = listboxRef.current;
    if (listboxRef.current.getAttribute('role') !== 'listbox') {
      listboxNode = listboxRef.current.parentElement.querySelector('[role="listbox"]');
    }

    // "No results"
    if (!listboxNode) {
      return;
    }
    if (index === -1) {
      listboxNode.scrollTop = 0;
      return;
    }
    const option = listboxRef.current.querySelector(`[data-option-index="${index}"]`);
    if (!option) {
      return;
    }
    option.classList.add(`${unstable_classNamePrefix}-focused`);
    if (reason === 'keyboard') {
      option.classList.add(`${unstable_classNamePrefix}-focusVisible`);
    }

    // Scroll active descendant into view.
    // Logic copied from https://www.w3.org/WAI/content-assets/wai-aria-practices/patterns/combobox/examples/js/select-only.js
    // In case of mouse clicks and touch (in mobile devices) we avoid scrolling the element and keep both behaviors same.
    // Consider this API instead once it has a better browser support:
    // .scrollIntoView({ scrollMode: 'if-needed', block: 'nearest' });
    if (listboxNode.scrollHeight > listboxNode.clientHeight && reason !== 'mouse' && reason !== 'touch') {
      const element = option;
      const scrollBottom = listboxNode.clientHeight + listboxNode.scrollTop;
      const elementBottom = element.offsetTop + element.offsetHeight;
      if (elementBottom > scrollBottom) {
        listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;
      } else if (element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) < listboxNode.scrollTop) {
        listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);
      }
    }
  });
  const changeHighlightedIndex = useEventCallback(({
    event,
    diff,
    direction = 'next',
    reason = 'auto'
  }) => {
    if (!popupOpen) {
      return;
    }
    const getNextIndex = () => {
      const maxIndex = filteredOptions.length - 1;
      if (diff === 'reset') {
        return defaultHighlighted;
      }
      if (diff === 'start') {
        return 0;
      }
      if (diff === 'end') {
        return maxIndex;
      }
      const newIndex = highlightedIndexRef.current + diff;
      if (newIndex < 0) {
        if (newIndex === -1 && includeInputInList) {
          return -1;
        }
        if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {
          return 0;
        }
        return maxIndex;
      }
      if (newIndex > maxIndex) {
        if (newIndex === maxIndex + 1 && includeInputInList) {
          return -1;
        }
        if (disableListWrap || Math.abs(diff) > 1) {
          return maxIndex;
        }
        return 0;
      }
      return newIndex;
    };
    const nextIndex = validOptionIndex(getNextIndex(), direction);
    setHighlightedIndex({
      index: nextIndex,
      reason,
      event
    });

    // Sync the content of the input with the highlighted option.
    if (autoComplete && diff !== 'reset') {
      if (nextIndex === -1) {
        inputRef.current.value = inputValue;
      } else {
        const option = getOptionLabel(filteredOptions[nextIndex]);
        inputRef.current.value = option;

        // The portion of the selected suggestion that has not been typed by the user,
        // a completion string, appears inline after the input cursor in the textbox.
        const index = option.toLowerCase().indexOf(inputValue.toLowerCase());
        if (index === 0 && inputValue.length > 0) {
          inputRef.current.setSelectionRange(inputValue.length, option.length);
        }
      }
    }
  });
  const getPreviousHighlightedOptionIndex = () => {
    const isSameValue = (value1, value2) => {
      const label1 = value1 ? getOptionLabel(value1) : '';
      const label2 = value2 ? getOptionLabel(value2) : '';
      return label1 === label2;
    };
    if (highlightedIndexRef.current !== -1 && previousProps.filteredOptions && previousProps.filteredOptions.length !== filteredOptions.length && previousProps.inputValue === inputValue && (multiple ? value.length === previousProps.value.length && previousProps.value.every((val, i) => getOptionLabel(value[i]) === getOptionLabel(val)) : isSameValue(previousProps.value, value))) {
      const previousHighlightedOption = previousProps.filteredOptions[highlightedIndexRef.current];
      if (previousHighlightedOption) {
        return useAutocomplete_findIndex(filteredOptions, option => {
          return getOptionLabel(option) === getOptionLabel(previousHighlightedOption);
        });
      }
    }
    return -1;
  };
  const syncHighlightedIndex = React.useCallback(() => {
    if (!popupOpen) {
      return;
    }

    // Check if the previously highlighted option still exists in the updated filtered options list and if the value and inputValue haven't changed
    // If it exists and the value and the inputValue haven't changed, just update its index, otherwise continue execution
    const previousHighlightedOptionIndex = getPreviousHighlightedOptionIndex();
    if (previousHighlightedOptionIndex !== -1) {
      highlightedIndexRef.current = previousHighlightedOptionIndex;
      return;
    }
    const valueItem = multiple ? value[0] : value;

    // The popup is empty, reset
    if (filteredOptions.length === 0 || valueItem == null) {
      changeHighlightedIndex({
        diff: 'reset'
      });
      return;
    }
    if (!listboxRef.current) {
      return;
    }

    // Synchronize the value with the highlighted index
    if (valueItem != null) {
      const currentOption = filteredOptions[highlightedIndexRef.current];

      // Keep the current highlighted index if possible
      if (multiple && currentOption && useAutocomplete_findIndex(value, val => isOptionEqualToValue(currentOption, val)) !== -1) {
        return;
      }
      const itemIndex = useAutocomplete_findIndex(filteredOptions, optionItem => isOptionEqualToValue(optionItem, valueItem));
      if (itemIndex === -1) {
        changeHighlightedIndex({
          diff: 'reset'
        });
      } else {
        setHighlightedIndex({
          index: itemIndex
        });
      }
      return;
    }

    // Prevent the highlighted index to leak outside the boundaries.
    if (highlightedIndexRef.current >= filteredOptions.length - 1) {
      setHighlightedIndex({
        index: filteredOptions.length - 1
      });
      return;
    }

    // Restore the focus to the previous index.
    setHighlightedIndex({
      index: highlightedIndexRef.current
    });
    // Ignore filteredOptions (and options, isOptionEqualToValue, getOptionLabel) not to break the scroll position
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [
  // Only sync the highlighted index when the option switch between empty and not
  filteredOptions.length,
  // Don't sync the highlighted index with the value when multiple
  // eslint-disable-next-line react-hooks/exhaustive-deps
  multiple ? false : value, filterSelectedOptions, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);
  const handleListboxRef = useEventCallback(node => {
    setRef(listboxRef, node);
    if (!node) {
      return;
    }
    syncHighlightedIndex();
  });
  if (false) {}
  React.useEffect(() => {
    syncHighlightedIndex();
  }, [syncHighlightedIndex]);
  const handleOpen = event => {
    if (open) {
      return;
    }
    setOpenState(true);
    setInputPristine(true);
    if (onOpen) {
      onOpen(event);
    }
  };
  const handleClose = (event, reason) => {
    if (!open) {
      return;
    }
    setOpenState(false);
    if (onClose) {
      onClose(event, reason);
    }
  };
  const handleValue = (event, newValue, reason, details) => {
    if (multiple) {
      if (value.length === newValue.length && value.every((val, i) => val === newValue[i])) {
        return;
      }
    } else if (value === newValue) {
      return;
    }
    if (onChange) {
      onChange(event, newValue, reason, details);
    }
    setValueState(newValue);
  };
  const isTouch = React.useRef(false);
  const selectNewValue = (event, option, reasonProp = 'selectOption', origin = 'options') => {
    let reason = reasonProp;
    let newValue = option;
    if (multiple) {
      newValue = Array.isArray(value) ? value.slice() : [];
      if (false) {}
      const itemIndex = useAutocomplete_findIndex(newValue, valueItem => isOptionEqualToValue(option, valueItem));
      if (itemIndex === -1) {
        newValue.push(option);
      } else if (origin !== 'freeSolo') {
        newValue.splice(itemIndex, 1);
        reason = 'removeOption';
      }
    }
    resetInputValue(event, newValue);
    handleValue(event, newValue, reason, {
      option
    });
    if (!disableCloseOnSelect && (!event || !event.ctrlKey && !event.metaKey)) {
      handleClose(event, reason);
    }
    if (blurOnSelect === true || blurOnSelect === 'touch' && isTouch.current || blurOnSelect === 'mouse' && !isTouch.current) {
      inputRef.current.blur();
    }
  };
  function validTagIndex(index, direction) {
    if (index === -1) {
      return -1;
    }
    let nextFocus = index;
    while (true) {
      // Out of range
      if (direction === 'next' && nextFocus === value.length || direction === 'previous' && nextFocus === -1) {
        return -1;
      }
      const option = anchorEl.querySelector(`[data-tag-index="${nextFocus}"]`);

      // Same logic as MenuList.js
      if (!option || !option.hasAttribute('tabindex') || option.disabled || option.getAttribute('aria-disabled') === 'true') {
        nextFocus += direction === 'next' ? 1 : -1;
      } else {
        return nextFocus;
      }
    }
  }
  const handleFocusTag = (event, direction) => {
    if (!multiple) {
      return;
    }
    if (inputValue === '') {
      handleClose(event, 'toggleInput');
    }
    let nextTag = focusedTag;
    if (focusedTag === -1) {
      if (inputValue === '' && direction === 'previous') {
        nextTag = value.length - 1;
      }
    } else {
      nextTag += direction === 'next' ? 1 : -1;
      if (nextTag < 0) {
        nextTag = 0;
      }
      if (nextTag === value.length) {
        nextTag = -1;
      }
    }
    nextTag = validTagIndex(nextTag, direction);
    setFocusedTag(nextTag);
    focusTag(nextTag);
  };
  const handleClear = event => {
    ignoreFocus.current = true;
    setInputValueState('');
    if (onInputChange) {
      onInputChange(event, '', 'clear');
    }
    handleValue(event, multiple ? [] : null, 'clear');
  };
  const handleKeyDown = other => event => {
    if (other.onKeyDown) {
      other.onKeyDown(event);
    }
    if (event.defaultMuiPrevented) {
      return;
    }
    if (focusedTag !== -1 && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) === -1) {
      setFocusedTag(-1);
      focusTag(-1);
    }

    // Wait until IME is settled.
    if (event.which !== 229) {
      switch (event.key) {
        case 'Home':
          if (popupOpen && handleHomeEndKeys) {
            // Prevent scroll of the page
            event.preventDefault();
            changeHighlightedIndex({
              diff: 'start',
              direction: 'next',
              reason: 'keyboard',
              event
            });
          }
          break;
        case 'End':
          if (popupOpen && handleHomeEndKeys) {
            // Prevent scroll of the page
            event.preventDefault();
            changeHighlightedIndex({
              diff: 'end',
              direction: 'previous',
              reason: 'keyboard',
              event
            });
          }
          break;
        case 'PageUp':
          // Prevent scroll of the page
          event.preventDefault();
          changeHighlightedIndex({
            diff: -pageSize,
            direction: 'previous',
            reason: 'keyboard',
            event
          });
          handleOpen(event);
          break;
        case 'PageDown':
          // Prevent scroll of the page
          event.preventDefault();
          changeHighlightedIndex({
            diff: pageSize,
            direction: 'next',
            reason: 'keyboard',
            event
          });
          handleOpen(event);
          break;
        case 'ArrowDown':
          // Prevent cursor move
          event.preventDefault();
          changeHighlightedIndex({
            diff: 1,
            direction: 'next',
            reason: 'keyboard',
            event
          });
          handleOpen(event);
          break;
        case 'ArrowUp':
          // Prevent cursor move
          event.preventDefault();
          changeHighlightedIndex({
            diff: -1,
            direction: 'previous',
            reason: 'keyboard',
            event
          });
          handleOpen(event);
          break;
        case 'ArrowLeft':
          handleFocusTag(event, 'previous');
          break;
        case 'ArrowRight':
          handleFocusTag(event, 'next');
          break;
        case 'Enter':
          if (highlightedIndexRef.current !== -1 && popupOpen) {
            const option = filteredOptions[highlightedIndexRef.current];
            const disabled = getOptionDisabled ? getOptionDisabled(option) : false;

            // Avoid early form validation, let the end-users continue filling the form.
            event.preventDefault();
            if (disabled) {
              return;
            }
            selectNewValue(event, option, 'selectOption');

            // Move the selection to the end.
            if (autoComplete) {
              inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
            }
          } else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {
            if (multiple) {
              // Allow people to add new values before they submit the form.
              event.preventDefault();
            }
            selectNewValue(event, inputValue, 'createOption', 'freeSolo');
          }
          break;
        case 'Escape':
          if (popupOpen) {
            // Avoid Opera to exit fullscreen mode.
            event.preventDefault();
            // Avoid the Modal to handle the event.
            event.stopPropagation();
            handleClose(event, 'escape');
          } else if (clearOnEscape && (inputValue !== '' || multiple && value.length > 0)) {
            // Avoid Opera to exit fullscreen mode.
            event.preventDefault();
            // Avoid the Modal to handle the event.
            event.stopPropagation();
            handleClear(event);
          }
          break;
        case 'Backspace':
          // Remove the value on the left of the "cursor"
          if (multiple && !readOnly && inputValue === '' && value.length > 0) {
            const index = focusedTag === -1 ? value.length - 1 : focusedTag;
            const newValue = value.slice();
            newValue.splice(index, 1);
            handleValue(event, newValue, 'removeOption', {
              option: value[index]
            });
          }
          break;
        case 'Delete':
          // Remove the value on the right of the "cursor"
          if (multiple && !readOnly && inputValue === '' && value.length > 0 && focusedTag !== -1) {
            const index = focusedTag;
            const newValue = value.slice();
            newValue.splice(index, 1);
            handleValue(event, newValue, 'removeOption', {
              option: value[index]
            });
          }
          break;
        default:
      }
    }
  };
  const handleFocus = event => {
    setFocused(true);
    if (openOnFocus && !ignoreFocus.current) {
      handleOpen(event);
    }
  };
  const handleBlur = event => {
    // Ignore the event when using the scrollbar with IE11
    if (unstable_isActiveElementInListbox(listboxRef)) {
      inputRef.current.focus();
      return;
    }
    setFocused(false);
    firstFocus.current = true;
    ignoreFocus.current = false;
    if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {
      selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');
    } else if (autoSelect && freeSolo && inputValue !== '') {
      selectNewValue(event, inputValue, 'blur', 'freeSolo');
    } else if (clearOnBlur) {
      resetInputValue(event, value);
    }
    handleClose(event, 'blur');
  };
  const handleInputChange = event => {
    const newValue = event.target.value;
    if (inputValue !== newValue) {
      setInputValueState(newValue);
      setInputPristine(false);
      if (onInputChange) {
        onInputChange(event, newValue, 'input');
      }
    }
    if (newValue === '') {
      if (!disableClearable && !multiple) {
        handleValue(event, null, 'clear');
      }
    } else {
      handleOpen(event);
    }
  };
  const handleOptionMouseMove = event => {
    const index = Number(event.currentTarget.getAttribute('data-option-index'));
    if (highlightedIndexRef.current !== index) {
      setHighlightedIndex({
        event,
        index,
        reason: 'mouse'
      });
    }
  };
  const handleOptionTouchStart = event => {
    setHighlightedIndex({
      event,
      index: Number(event.currentTarget.getAttribute('data-option-index')),
      reason: 'touch'
    });
    isTouch.current = true;
  };
  const handleOptionClick = event => {
    const index = Number(event.currentTarget.getAttribute('data-option-index'));
    selectNewValue(event, filteredOptions[index], 'selectOption');
    isTouch.current = false;
  };
  const handleTagDelete = index => event => {
    const newValue = value.slice();
    newValue.splice(index, 1);
    handleValue(event, newValue, 'removeOption', {
      option: value[index]
    });
  };
  const handlePopupIndicator = event => {
    if (open) {
      handleClose(event, 'toggleInput');
    } else {
      handleOpen(event);
    }
  };

  // Prevent input blur when interacting with the combobox
  const handleMouseDown = event => {
    // Prevent focusing the input if click is anywhere outside the Autocomplete
    if (!event.currentTarget.contains(event.target)) {
      return;
    }
    if (event.target.getAttribute('id') !== id) {
      event.preventDefault();
    }
  };

  // Focus the input when interacting with the combobox
  const handleClick = event => {
    // Prevent focusing the input if click is anywhere outside the Autocomplete
    if (!event.currentTarget.contains(event.target)) {
      return;
    }
    inputRef.current.focus();
    if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {
      inputRef.current.select();
    }
    firstFocus.current = false;
  };
  const handleInputMouseDown = event => {
    if (!disabledProp && (inputValue === '' || !open)) {
      handlePopupIndicator(event);
    }
  };
  let dirty = freeSolo && inputValue.length > 0;
  dirty = dirty || (multiple ? value.length > 0 : value !== null);
  let groupedOptions = filteredOptions;
  if (groupBy) {
    // used to keep track of key and indexes in the result array
    const indexBy = new Map();
    let warn = false;
    groupedOptions = filteredOptions.reduce((acc, option, index) => {
      const group = groupBy(option);
      if (acc.length > 0 && acc[acc.length - 1].group === group) {
        acc[acc.length - 1].options.push(option);
      } else {
        if (false) {}
        acc.push({
          key: index,
          index,
          group,
          options: [option]
        });
      }
      return acc;
    }, []);
  }
  if (disabledProp && focused) {
    handleBlur();
  }
  return {
    getRootProps: (other = {}) => _extends({
      'aria-owns': listboxAvailable ? `${id}-listbox` : null
    }, other, {
      onKeyDown: handleKeyDown(other),
      onMouseDown: handleMouseDown,
      onClick: handleClick
    }),
    getInputLabelProps: () => ({
      id: `${id}-label`,
      htmlFor: id
    }),
    getInputProps: () => ({
      id,
      value: inputValue,
      onBlur: handleBlur,
      onFocus: handleFocus,
      onChange: handleInputChange,
      onMouseDown: handleInputMouseDown,
      // if open then this is handled imperatively so don't let react override
      // only have an opinion about this when closed
      'aria-activedescendant': popupOpen ? '' : null,
      'aria-autocomplete': autoComplete ? 'both' : 'list',
      'aria-controls': listboxAvailable ? `${id}-listbox` : undefined,
      'aria-expanded': listboxAvailable,
      // Disable browser's suggestion that might overlap with the popup.
      // Handle autocomplete but not autofill.
      autoComplete: 'off',
      ref: inputRef,
      autoCapitalize: 'none',
      spellCheck: 'false',
      role: 'combobox',
      disabled: disabledProp
    }),
    getClearProps: () => ({
      tabIndex: -1,
      type: 'button',
      onClick: handleClear
    }),
    getPopupIndicatorProps: () => ({
      tabIndex: -1,
      type: 'button',
      onClick: handlePopupIndicator
    }),
    getTagProps: ({
      index
    }) => _extends({
      key: index,
      'data-tag-index': index,
      tabIndex: -1
    }, !readOnly && {
      onDelete: handleTagDelete(index)
    }),
    getListboxProps: () => ({
      role: 'listbox',
      id: `${id}-listbox`,
      'aria-labelledby': `${id}-label`,
      ref: handleListboxRef,
      onMouseDown: event => {
        // Prevent blur
        event.preventDefault();
      }
    }),
    getOptionProps: ({
      index,
      option
    }) => {
      var _getOptionKey;
      const selected = (multiple ? value : [value]).some(value2 => value2 != null && isOptionEqualToValue(option, value2));
      const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
      return {
        key: (_getOptionKey = getOptionKey == null ? void 0 : getOptionKey(option)) != null ? _getOptionKey : getOptionLabel(option),
        tabIndex: -1,
        role: 'option',
        id: `${id}-option-${index}`,
        onMouseMove: handleOptionMouseMove,
        onClick: handleOptionClick,
        onTouchStart: handleOptionTouchStart,
        'data-option-index': index,
        'aria-disabled': disabled,
        'aria-selected': selected
      };
    },
    id,
    inputValue,
    value,
    dirty,
    expanded: popupOpen && anchorEl,
    popupOpen,
    focused: focused || focusedTag !== -1,
    anchorEl,
    setAnchorEl,
    focusedTag,
    groupedOptions
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/Autocomplete/Autocomplete.tsx



function Autocomplete_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function Autocomplete_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Autocomplete_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Autocomplete_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }






var filter = createFilterOptions();
var Autocomplete = function Autocomplete(props) {
  var defaultList = props.optionsList;
  var defaultValue = props.optionsList.find(function (option) {
    return option.value === props.defaultValue;
  });
  var _React$useState = React.useState({
      title: (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.title) || props.defaultValue,
      value: (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) || props.defaultValue
    }),
    _React$useState2 = _slicedToArray(_React$useState, 2),
    value = _React$useState2[0],
    setValue = _React$useState2[1];
  var _onChange = function onChange(newValue) {
    if (newValue && newValue.inputValue) {
      var inputValue = newValue.inputValue.toUpperCase();

      // Create a new value from the user input
      setValue({
        title: inputValue,
        value: inputValue
      });
      props.changeValue(inputValue);
      defaultList.unshift({
        title: inputValue,
        value: inputValue
      });
    } else if (newValue) {
      setValue(newValue);
      props.changeValue(newValue.value);
    }
  };
  return /*#__PURE__*/React.createElement(MuiAutocomplete, {
    fullWidth: true,
    value: value,
    onChange: function onChange(event, newValue) {
      return _onChange(newValue);
    },
    filterOptions: function filterOptions(options, params) {
      var filtered = filter(options, params);
      var inputValue = params.inputValue;
      var isExisting = options.some(function (option) {
        return inputValue === option.title;
      });

      // Suggest the creation of a new value
      if (inputValue !== '' && !isExisting) {
        filtered.push({
          inputValue: inputValue,
          title: "Add ".concat(inputValue),
          value: inputValue
        });
      }
      return filtered;
    },
    selectOnFocus: true,
    clearOnBlur: true,
    handleHomeEndKeys: true,
    id: "currency-input",
    options: props.optionsList,
    getOptionLabel: function getOptionLabel(option) {
      if (option !== null && option !== void 0 && option.inputValue) {
        return option.inputValue;
      }

      // Regular option
      return option.title;
    },
    renderOption: function renderOption(localProps, option) {
      return /*#__PURE__*/React.createElement(MenuItem, _extends({}, localProps, {
        key: option.title
      }), option.title);
    },
    renderInput: function renderInput(params) {
      return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Stack, {
        direction: StackProps.Direction.ROW,
        spacing: 4
      }, /*#__PURE__*/React.createElement(InputLabel, {
        shrink: true
      }, "Currency"), props.tooltip ? props.tooltip : null), /*#__PURE__*/React.createElement(TextField, _extends({}, params, {
        size: props.size,
        inputProps: Autocomplete_objectSpread(Autocomplete_objectSpread({}, params.inputProps), {}, {
          maxLength: props.charactersLimit || -1
        })
      })));
    },
    isOptionEqualToValue: props.isOptionEqualToValue
  });
};
/* harmony default export */ var Autocomplete_Autocomplete = ((/* unused pure expression or super */ null && (Autocomplete)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/VisuallyHiddenInput/VisuallyHiddenInput.tsx

/* harmony default export */ var VisuallyHiddenInput_VisuallyHiddenInput = ((0,styled/* default */.Ay)('input')({
  clip: 'rect(0 0 0 0)',
  clipPath: 'inset(50%)',
  height: 1,
  overflow: 'hidden',
  bottom: 0,
  left: 0,
  whiteSpace: 'nowrap',
  width: 1,
  position: 'absolute'
}));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/CustomIconButton/CustomIconButton.tsx








/* harmony default export */ var CustomIconButton = (function (_ref) {
  var icon = _ref.icon,
    label = _ref.label,
    _ref$isFileInput = _ref.isFileInput,
    isFileInput = _ref$isFileInput === void 0 ? false : _ref$isFileInput,
    onChange = _ref.onChange,
    onClick = _ref.onClick,
    _ref$disabled = _ref.disabled,
    disabled = _ref$disabled === void 0 ? false : _ref$disabled,
    _ref$multiple = _ref.multiple,
    multiple = _ref$multiple === void 0 ? false : _ref$multiple,
    _ref$component = _ref.component,
    component = _ref$component === void 0 ? 'label' : _ref$component,
    _ref$display = _ref.display,
    display = _ref$display === void 0 ? BoxProps.Display.FLEX : _ref$display,
    _ref$flexDirection = _ref.flexDirection,
    flexDirection = _ref$flexDirection === void 0 ? BoxProps.FlexDirection.COLUMN : _ref$flexDirection,
    _ref$justifyContent = _ref.justifyContent,
    justifyContent = _ref$justifyContent === void 0 ? BoxProps.JustifyContent.CENTER : _ref$justifyContent,
    _ref$alignItems = _ref.alignItems,
    alignItems = _ref$alignItems === void 0 ? BoxProps.AlignItems.CENTER : _ref$alignItems,
    gap = _ref.gap,
    width = _ref.width,
    height = _ref.height,
    _ref$px = _ref.px,
    px = _ref$px === void 0 ? 4 : _ref$px,
    _ref$py = _ref.py,
    py = _ref$py === void 0 ? 2 : _ref$py,
    _ref$border = _ref.border,
    border = _ref$border === void 0 ? '1px solid' : _ref$border,
    _ref$borderColor = _ref.borderColor,
    borderColor = _ref$borderColor === void 0 ? BoxProps.BorderColor.OUTLINE_BORDER : _ref$borderColor,
    _ref$borderRadius = _ref.borderRadius,
    borderRadius = _ref$borderRadius === void 0 ? 4 : _ref$borderRadius;
  return /*#__PURE__*/React.createElement(Box, {
    component: component,
    display: display,
    flexDirection: flexDirection,
    justifyContent: justifyContent,
    alignItems: alignItems,
    gap: gap,
    width: width,
    height: height,
    px: px,
    py: py,
    border: border,
    borderColor: borderColor,
    borderRadius: borderRadius,
    onClick: onClick,
    sx: {
      transition: 'background-color 0.2s ease-out',
      cursor: 'pointer',
      pointerEvents: disabled ? 'none' : 'auto',
      '& svg': {
        transition: 'color 0.2s ease-out'
      },
      '&:hover': {
        borderColor: 'other.outlinedBorder',
        backgroundColor: 'grey.100'
      },
      '&:hover svg': {
        color: 'primary.main'
      }
    }
  }, /*#__PURE__*/React.createElement(SvgIcon, {
    color: disabled ? Colors.DISABLED : Colors.SECONDARY,
    fontSize: FontSize.LARGE
  }, icon), /*#__PURE__*/React.createElement(Typography, {
    variant: TypographyProps.Variants.BODY2,
    color: disabled ? TypographyProps.Colors.DISABLED : TypographyProps.Colors.PRIMARY,
    sx: {
      cursor: 'pointer'
    }
  }, label), isFileInput && /*#__PURE__*/React.createElement(VisuallyHiddenInput, {
    type: "file",
    onChange: onChange,
    multiple: multiple,
    disabled: disabled
  }));
});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/CustomListItem/CustomListItem.tsx





/* harmony default export */ var CustomListItem = (function (_ref) {
  var onClick = _ref.onClick,
    children = _ref.children;
  return /*#__PURE__*/React.createElement(Button, {
    variant: ButtonProps.Variant.TEXT,
    onClick: onClick,
    fullWidth: true,
    disableRipple: true,
    sx: {
      display: 'flex',
      justifyContent: 'flex-start',
      height: 'auto',
      border: '1px solid',
      borderColor: 'other.outlinedBorder',
      '&:hover': {
        backgroundColor: 'grey.100'
      }
    }
  }, /*#__PURE__*/React.createElement(Stack, {
    direction: StackProps.Direction.COLUMN,
    gap: 8
  }, children));
});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/LabeledSwitcher/LabeledSwitcher.tsx



var LabeledSwitcher = function LabeledSwitcher(_ref) {
  var _ref$defaultChecked = _ref.defaultChecked,
    defaultChecked = _ref$defaultChecked === void 0 ? false : _ref$defaultChecked,
    _ref$disabled = _ref.disabled,
    disabled = _ref$disabled === void 0 ? false : _ref$disabled,
    checked = _ref.checked,
    inputRef = _ref.inputRef,
    _ref$isReversed = _ref.isReversed,
    isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
    label = _ref.label,
    _ref$labelVariant = _ref.labelVariant,
    labelVariant = _ref$labelVariant === void 0 ? TypographyProps.Variants.SUBTITLE2 : _ref$labelVariant,
    name = _ref.name,
    _ref$size = _ref.size,
    size = _ref$size === void 0 ? SwitchProps.Size.MEDIUM : _ref$size,
    _ref$tooltipText = _ref.tooltipText,
    tooltipText = _ref$tooltipText === void 0 ? '' : _ref$tooltipText,
    onChange = _ref.onChange;
  return /*#__PURE__*/React.createElement(Box, {
    display: BoxProps.Display.FLEX,
    flexDirection: isReversed ? BoxProps.FlexDirection.ROW_REVERSE : BoxProps.FlexDirection.ROW,
    alignItems: BoxProps.AlignItems.CENTER,
    justifyContent: isReversed ? BoxProps.JustifyContent.FLEX_END : BoxProps.JustifyContent.SPACE_BETWEEN
  }, /*#__PURE__*/React.createElement(Box, {
    display: BoxProps.Display.FLEX,
    flexDirection: BoxProps.FlexDirection.ROW,
    alignItems: BoxProps.AlignItems.CENTER,
    gap: 4
  }, /*#__PURE__*/React.createElement(Typography, {
    variant: labelVariant
  }, label), tooltipText ? /*#__PURE__*/React.createElement(Tooltip, {
    title: tooltipText,
    placement: TooltipProps.PlacementType.RIGHT
  }, /*#__PURE__*/React.createElement(Info, {
    viewBox: "0 0 24 20",
    sx: {
      width: '16px',
      height: '16px'
    }
  })) : null), /*#__PURE__*/React.createElement(Switch, {
    size: size,
    checked: checked,
    defaultChecked: defaultChecked,
    onChange: onChange,
    disabled: disabled,
    inputRef: inputRef,
    name: name
  }));
};
/* harmony default export */ var LabeledSwitcher_LabeledSwitcher = ((/* unused pure expression or super */ null && (LabeledSwitcher)));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/custom/LabeledSwitcher/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/mui/src/components/index.ts
// Standard MUI components






































































// Custom MUI components


















// EXTERNAL MODULE: ../../modules/utils/code/helpers/node_modules/blueimp-md5/js/md5.js
var md5 = __webpack_require__(7839);
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/hashing/md5Hex.ts

/* harmony default export */ var hashing_md5Hex = (function (str) {
  return md5Hex(str);
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/hashing/generateMD5Hash.ts


/**
 * Generate an MD5 hash of an ID.
 * @param {string} char A character added to the MD5 hash as suffix.
 * @param {number} id The id from which to generate the MD5 hash.
 * @param {string} prefix A set of characters that should be added as prefix.
 * @param {number} length The maximum length of the resulting hash.
 * @returns {string}
 */
/* harmony default export */ var generateMD5Hash = (function (char, id) {
  var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  var length = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 32;
  var string = (Date.now() + Math.random()).toString();
  string = md5Hex(string) + char + id;
  string = string.substr(string.length - (length - prefix.length));
  string = prefix + string;
  return string;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/hashing/base64.ts
/* provided dependency */ var Buffer = __webpack_require__(8287)["Buffer"];
/**
 * Encodes a given string into a base64 format.
 *
 * This function takes a plain text string, encodes it into base64, and returns the encoded string.
 * The encoding is done using the UTF-8 character encoding.
 *
 * @param {string} input - The string to be encoded into base64 format.
 * @returns {string} The base64-encoded version of the input string.
 *
 * @example
 * const encoded = base64Encode('Hello, World!');
 * console.log(encoded); // Outputs: SGVsbG8sIFdvcmxkIQ==
 */
var base64Encode = function base64Encode(input) {
  return Buffer.from(input, 'utf-8').toString('base64');
};

/**
 * Decodes a base64-encoded string back to its original form.
 *
 * This function takes a base64-encoded string, decodes it, and returns the resulting plain text string.
 * The decoding is done using the UTF-8 character encoding.
 *
 * @param {string} encoded - The base64-encoded string to be decoded.
 * @returns {string} The decoded string, which was originally in UTF-8 format.
 *
 * @example
 * const decoded = base64Decode('SGVsbG8sIFdvcmxkIQ==');
 * console.log(decoded); // Outputs: Hello, World!
 */
var base64Decode = function base64Decode(encoded) {
  return Buffer.from(encoded, 'base64').toString('utf-8');
};

/**
 * Encodes a JavaScript object into a base64-encoded string.
 *
 * This function takes a JavaScript object, converts it to a JSON string using `JSON.stringify()`,
 * then encodes that string into base64. The result is a base64-encoded string that represents the original object.
 *
 * @param {object} obj - The object to be encoded into base64 format.
 * @returns {string} The base64-encoded version of the JSON stringified object.
 *
 * @example
 * const obj = { name: 'John', age: 30 };
 * const encodedObj = base64EncodeObject(obj);
 * console.log(encodedObj); // Outputs: eyJuYW1lIjoiSm9obiIsImFnZSI6MzB9
 */
var base64EncodeObject = function base64EncodeObject(obj) {
  var jsonString = JSON.stringify(obj);
  return base64Encode(jsonString);
};

/**
 * Decodes a base64-encoded string back into a JavaScript object of type T.
 *
 * @param {string} encodedObj - The base64-encoded string representing a JavaScript object.
 * @returns {T} The decoded JavaScript object of type T.
 *
 * @example
 * const encodedObj = 'eyJuYW1lIjoiSm9obiIsImFnZSI6MzB9';
 * const decodedObj = base64DecodeObject<{ name: string, age: number }>(encodedObj);
 * console.log(decodedObj); // Outputs: { name: 'John', age: 30 }
 */
var base64DecodeObject = function base64DecodeObject(encodedObj) {
  var jsonString = base64Decode(encodedObj);
  return JSON.parse(jsonString);
};
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/hashing/index.ts




// EXTERNAL MODULE: ../../modules/utils/code/helpers/node_modules/owasp-password-strength-test/owasp-password-strength-test.js
var owasp_password_strength_test = __webpack_require__(4044);
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/getPasswordStrength.ts

/**
 * Calculates a score from 0 to 1 for the length of the password. The minimum length password should
 * get a minimum score, but greater than 0. The highest score will be assigned to passwords with a
 * length greated than the optimal length up to maximum length.
 *
 * @param {string} password
 * @param {object} config
 */
var getPasswordLengthScore = function getPasswordLengthScore(password, config) {
  var minScore = 0;
  var maxScore = 1;
  var minLength = config.minLength,
    maxLength = config.maxLength,
    optimalLength = config.optimalLength;
  if (password.length < minLength || password.length > maxLength) {
    return minScore;
  }
  if (password.length >= optimalLength && password.length <= maxLength) {
    return maxScore;
  }

  // The value of each character between minLength and optimalLength;
  // minLength is a good enough score, so it should count in calculating the score, that's why we add 1 to the diff.
  var charScore = maxScore / (optimalLength - minLength + 1);
  var score = +((password.length - minLength + 1) * charScore).toFixed(2);
  return score;
};

/**
 * Get the strength of a password based on OWASP recommendations.
 *
 * The module contains 3 required tests and 4 optional tests:
 * 1. minimum password length (required 1)
 * 2. maximum password length (required 2)
 * 3. repeating characters (required 3)
 * 4. at least one lowercase letter (optional 1)
 * 5. at least one uppercase letter (optional 2)
 * 6. at least one number (optional 3)
 * 7. at least one special character (optional 4)
 *
 * @param {string} password
 * @param {object} config
 * @returns {PasswordScore} Password score in the range of 0 to 1 along with the required password rules that have been
 *                  fulfilled or not.
 */
/* harmony default export */ var src_getPasswordStrength = (function (password) {
  var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
    allowPassphrases: false,
    maxLength: 64,
    minLength: 8,
    minOptionalTestsToPass: 4
  };
  // The index of the tests, as defined in the module.
  var OWASP_TESTS = {
    MIN_LENGTH: 0,
    MAX_LENGTH: 1,
    REPEATING_CHARS: 2,
    LOWERCASE: 3,
    UPPERCASE: 4,
    NUMBERS: 5,
    SYMBOLS: 6
  };
  var passwordTestResult = {
    score: 0,
    minLength: false,
    lowercase: false,
    uppercase: false,
    numbers: false,
    symbols: false
  };
  if (!password.length) {
    return passwordTestResult;
  }
  owaspPassStrength.config(config);
  var testScores = [3,
  // required test 1
  1,
  // required test 2
  1,
  // required test 3
  1,
  // optional test 1
  1,
  // optional test 2
  2,
  // optional test 3
  2 // optional test 4
  ];
  var maxTestsScore = 11; // Summ of each of the OWASP tests score.
  var maxPasswordLengthScore = 1;
  var maxPasswordScore = maxTestsScore + maxPasswordLengthScore;
  var optimalPasswordLength = 10;
  var passwordLengthConfig = {
    minLength: config.minLength,
    maxLength: config.maxLength,
    optimalLength: optimalPasswordLength
  };
  var passwordLengthScore = getPasswordLengthScore(password, passwordLengthConfig);
  var result = owaspPassStrength.test(password);

  // Initialize test results with true and only set to false the ones that failed.
  passwordTestResult.minLength = true;
  passwordTestResult.lowercase = true;
  passwordTestResult.uppercase = true;
  passwordTestResult.numbers = true;
  passwordTestResult.symbols = true;
  var failedTestsScore = result.failedTests.reduce(function (sum, testIndex) {
    switch (testIndex) {
      case OWASP_TESTS.MIN_LENGTH:
        passwordTestResult.minLength = false;
        break;
      case OWASP_TESTS.LOWERCASE:
        passwordTestResult.lowercase = false;
        break;
      case OWASP_TESTS.UPPERCASE:
        passwordTestResult.uppercase = false;
        break;
      case OWASP_TESTS.NUMBERS:
        passwordTestResult.numbers = false;
        break;
      case OWASP_TESTS.SYMBOLS:
        passwordTestResult.symbols = false;
        break;
      default:
    }
    return sum + testScores[testIndex];
  }, 0);
  var passwordScore = maxTestsScore - failedTestsScore + passwordLengthScore;
  passwordTestResult.score = +(passwordScore / maxPasswordScore).toFixed(2);
  return passwordTestResult;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js
const getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
    return {
        setHttpHandler(handler) {
            runtimeConfig.httpHandler = handler;
        },
        httpHandler() {
            return runtimeConfig.httpHandler;
        },
        updateHttpClientConfig(key, value) {
            runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
        },
        httpHandlerConfigs() {
            return runtimeConfig.httpHandler.httpHandlerConfigs();
        },
    };
};
const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
    return {
        httpHandler: httpHandlerExtensionConfiguration.httpHandler(),
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/protocol-http/dist-es/extensions/index.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/auth/auth.js
var HttpAuthLocation;
(function (HttpAuthLocation) {
    HttpAuthLocation["HEADER"] = "header";
    HttpAuthLocation["QUERY"] = "query";
})(HttpAuthLocation || (HttpAuthLocation = {}));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js
var HttpApiKeyAuth_HttpApiKeyAuthLocation;
(function (HttpApiKeyAuthLocation) {
    HttpApiKeyAuthLocation["HEADER"] = "header";
    HttpApiKeyAuthLocation["QUERY"] = "query";
})(HttpApiKeyAuth_HttpApiKeyAuthLocation || (HttpApiKeyAuth_HttpApiKeyAuthLocation = {}));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/auth/index.js







;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/endpoint.js
var EndpointURLScheme;
(function (EndpointURLScheme) {
    EndpointURLScheme["HTTP"] = "http";
    EndpointURLScheme["HTTPS"] = "https";
})(EndpointURLScheme || (EndpointURLScheme = {}));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/extensions/checksum.js
var AlgorithmId;
(function (AlgorithmId) {
    AlgorithmId["MD5"] = "md5";
    AlgorithmId["CRC32"] = "crc32";
    AlgorithmId["CRC32C"] = "crc32c";
    AlgorithmId["SHA1"] = "sha1";
    AlgorithmId["SHA256"] = "sha256";
})(AlgorithmId || (AlgorithmId = {}));
const checksum_getChecksumConfiguration = (runtimeConfig) => {
    const checksumAlgorithms = [];
    if (runtimeConfig.sha256 !== undefined) {
        checksumAlgorithms.push({
            algorithmId: () => AlgorithmId.SHA256,
            checksumConstructor: () => runtimeConfig.sha256,
        });
    }
    if (runtimeConfig.md5 != undefined) {
        checksumAlgorithms.push({
            algorithmId: () => AlgorithmId.MD5,
            checksumConstructor: () => runtimeConfig.md5,
        });
    }
    return {
        addChecksumAlgorithm(algo) {
            checksumAlgorithms.push(algo);
        },
        checksumAlgorithms() {
            return checksumAlgorithms;
        },
    };
};
const checksum_resolveChecksumRuntimeConfig = (clientConfig) => {
    const runtimeConfig = {};
    clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
        runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
    });
    return runtimeConfig;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js

const getDefaultClientConfiguration = (runtimeConfig) => {
    return getChecksumConfiguration(runtimeConfig);
};
const resolveDefaultRuntimeConfig = (config) => {
    return resolveChecksumRuntimeConfig(config);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/extensions/index.js




;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/http.js
var http_FieldPosition;
(function (FieldPosition) {
    FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER";
    FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER";
})(http_FieldPosition || (http_FieldPosition = {}));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/middleware.js
const middleware_SMITHY_CONTEXT_KEY = "__smithy_context";

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/profile.js
var IniSectionType;
(function (IniSectionType) {
    IniSectionType["PROFILE"] = "profile";
    IniSectionType["SSO_SESSION"] = "sso-session";
    IniSectionType["SERVICES"] = "services";
})(IniSectionType || (IniSectionType = {}));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/transfer.js
var RequestHandlerProtocol;
(function (RequestHandlerProtocol) {
    RequestHandlerProtocol["HTTP_0_9"] = "http/0.9";
    RequestHandlerProtocol["HTTP_1_0"] = "http/1.0";
    RequestHandlerProtocol["TDS_8_0"] = "tds/8.0";
})(RequestHandlerProtocol || (RequestHandlerProtocol = {}));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/types/dist-es/index.js






































;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/protocol-http/dist-es/Field.js

class Field {
    constructor({ name, kind = FieldPosition.HEADER, values = [] }) {
        this.name = name;
        this.kind = kind;
        this.values = values;
    }
    add(value) {
        this.values.push(value);
    }
    set(values) {
        this.values = values;
    }
    remove(value) {
        this.values = this.values.filter((v) => v !== value);
    }
    toString() {
        return this.values.map((v) => (v.includes(",") || v.includes(" ") ? `"${v}"` : v)).join(", ");
    }
    get() {
        return this.values;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/protocol-http/dist-es/httpRequest.js
class httpRequest_HttpRequest {
    constructor(options) {
        this.method = options.method || "GET";
        this.hostname = options.hostname || "localhost";
        this.port = options.port;
        this.query = options.query || {};
        this.headers = options.headers || {};
        this.body = options.body;
        this.protocol = options.protocol
            ? options.protocol.slice(-1) !== ":"
                ? `${options.protocol}:`
                : options.protocol
            : "https:";
        this.path = options.path ? (options.path.charAt(0) !== "/" ? `/${options.path}` : options.path) : "/";
        this.username = options.username;
        this.password = options.password;
        this.fragment = options.fragment;
    }
    static clone(request) {
        const cloned = new httpRequest_HttpRequest({
            ...request,
            headers: { ...request.headers },
        });
        if (cloned.query) {
            cloned.query = cloneQuery(cloned.query);
        }
        return cloned;
    }
    static isInstance(request) {
        if (!request) {
            return false;
        }
        const req = request;
        return ("method" in req &&
            "protocol" in req &&
            "hostname" in req &&
            "path" in req &&
            typeof req["query"] === "object" &&
            typeof req["headers"] === "object");
    }
    clone() {
        return httpRequest_HttpRequest.clone(this);
    }
}
function cloneQuery(query) {
    return Object.keys(query).reduce((carry, paramName) => {
        const param = query[paramName];
        return {
            ...carry,
            [paramName]: Array.isArray(param) ? [...param] : param,
        };
    }, {});
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/protocol-http/dist-es/httpResponse.js
class httpResponse_HttpResponse {
    constructor(options) {
        this.statusCode = options.statusCode;
        this.reason = options.reason;
        this.headers = options.headers || {};
        this.body = options.body;
    }
    static isInstance(response) {
        if (!response)
            return false;
        const resp = response;
        return typeof resp.statusCode === "number" && typeof resp.headers === "object";
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/protocol-http/dist-es/index.js









;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-expect-continue/dist-es/index.js

function addExpectContinueMiddleware(options) {
    return (next) => async (args) => {
        const { request } = args;
        if (httpRequest_HttpRequest.isInstance(request) && request.body && options.runtime === "node") {
            if (options.requestHandler?.constructor?.name !== "FetchHttpHandler") {
                request.headers = {
                    ...request.headers,
                    Expect: "100-continue",
                };
            }
        }
        return next({
            ...args,
            request,
        });
    };
}
const addExpectContinueMiddlewareOptions = {
    step: "build",
    tags: ["SET_EXPECT_HEADER", "EXPECT_HEADER"],
    name: "addExpectContinueMiddleware",
    override: true,
};
const getAddExpectContinuePlugin = (options) => ({
    applyToStack: (clientStack) => {
        clientStack.add(addExpectContinueMiddleware(options), addExpectContinueMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/constants.js
const constants_RequestChecksumCalculation = {
    WHEN_SUPPORTED: "WHEN_SUPPORTED",
    WHEN_REQUIRED: "WHEN_REQUIRED",
};
const DEFAULT_REQUEST_CHECKSUM_CALCULATION = constants_RequestChecksumCalculation.WHEN_SUPPORTED;
const constants_ResponseChecksumValidation = {
    WHEN_SUPPORTED: "WHEN_SUPPORTED",
    WHEN_REQUIRED: "WHEN_REQUIRED",
};
const DEFAULT_RESPONSE_CHECKSUM_VALIDATION = constants_RequestChecksumCalculation.WHEN_SUPPORTED;
var constants_ChecksumAlgorithm;
(function (ChecksumAlgorithm) {
    ChecksumAlgorithm["MD5"] = "MD5";
    ChecksumAlgorithm["CRC32"] = "CRC32";
    ChecksumAlgorithm["CRC32C"] = "CRC32C";
    ChecksumAlgorithm["CRC64NVME"] = "CRC64NVME";
    ChecksumAlgorithm["SHA1"] = "SHA1";
    ChecksumAlgorithm["SHA256"] = "SHA256";
})(constants_ChecksumAlgorithm || (constants_ChecksumAlgorithm = {}));
var ChecksumLocation;
(function (ChecksumLocation) {
    ChecksumLocation["HEADER"] = "header";
    ChecksumLocation["TRAILER"] = "trailer";
})(ChecksumLocation || (ChecksumLocation = {}));
const constants_DEFAULT_CHECKSUM_ALGORITHM = constants_ChecksumAlgorithm.CRC32;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/stringUnionSelector.js
var SelectorType;
(function (SelectorType) {
    SelectorType["ENV"] = "env";
    SelectorType["CONFIG"] = "shared config entry";
})(SelectorType || (SelectorType = {}));
const stringUnionSelector = (obj, key, union, type) => {
    if (!(key in obj))
        return undefined;
    const value = obj[key].toUpperCase();
    if (!Object.values(union).includes(value)) {
        throw new TypeError(`Cannot load ${type} '${key}'. Expected one of ${Object.values(union)}, got '${obj[key]}'.`);
    }
    return value;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS.js


const ENV_REQUEST_CHECKSUM_CALCULATION = "AWS_REQUEST_CHECKSUM_CALCULATION";
const CONFIG_REQUEST_CHECKSUM_CALCULATION = "request_checksum_calculation";
const NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS = {
    environmentVariableSelector: (env) => stringUnionSelector(env, ENV_REQUEST_CHECKSUM_CALCULATION, constants_RequestChecksumCalculation, SelectorType.ENV),
    configFileSelector: (profile) => stringUnionSelector(profile, CONFIG_REQUEST_CHECKSUM_CALCULATION, constants_RequestChecksumCalculation, SelectorType.CONFIG),
    default: DEFAULT_REQUEST_CHECKSUM_CALCULATION,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS.js


const ENV_RESPONSE_CHECKSUM_VALIDATION = "AWS_RESPONSE_CHECKSUM_VALIDATION";
const CONFIG_RESPONSE_CHECKSUM_VALIDATION = "response_checksum_validation";
const NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS = {
    environmentVariableSelector: (env) => stringUnionSelector(env, ENV_RESPONSE_CHECKSUM_VALIDATION, constants_ResponseChecksumValidation, SelectorType.ENV),
    configFileSelector: (profile) => stringUnionSelector(profile, CONFIG_RESPONSE_CHECKSUM_VALIDATION, constants_ResponseChecksumValidation, SelectorType.CONFIG),
    default: DEFAULT_RESPONSE_CHECKSUM_VALIDATION,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/crc64-nvme-crt-container.js
const crc64_nvme_crt_container_crc64NvmeCrtContainer = {
    CrtCrc64Nvme: null,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-base64/dist-es/constants.browser.js
const alphabetByEncoding = {};
const alphabetByValue = new Array(64);
for (let i = 0, start = "A".charCodeAt(0), limit = "Z".charCodeAt(0); i + start <= limit; i++) {
    const char = String.fromCharCode(i + start);
    alphabetByEncoding[char] = i;
    alphabetByValue[i] = char;
}
for (let i = 0, start = "a".charCodeAt(0), limit = "z".charCodeAt(0); i + start <= limit; i++) {
    const char = String.fromCharCode(i + start);
    const index = i + 26;
    alphabetByEncoding[char] = index;
    alphabetByValue[index] = char;
}
for (let i = 0; i < 10; i++) {
    alphabetByEncoding[i.toString(10)] = i + 52;
    const char = i.toString(10);
    const index = i + 52;
    alphabetByEncoding[char] = index;
    alphabetByValue[index] = char;
}
alphabetByEncoding["+"] = 62;
alphabetByValue[62] = "+";
alphabetByEncoding["/"] = 63;
alphabetByValue[63] = "/";
const bitsPerLetter = 6;
const bitsPerByte = 8;
const maxLetterValue = 0b111111;


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-base64/dist-es/fromBase64.browser.js

const fromBase64 = (input) => {
    let totalByteLength = (input.length / 4) * 3;
    if (input.slice(-2) === "==") {
        totalByteLength -= 2;
    }
    else if (input.slice(-1) === "=") {
        totalByteLength--;
    }
    const out = new ArrayBuffer(totalByteLength);
    const dataView = new DataView(out);
    for (let i = 0; i < input.length; i += 4) {
        let bits = 0;
        let bitLength = 0;
        for (let j = i, limit = i + 3; j <= limit; j++) {
            if (input[j] !== "=") {
                if (!(input[j] in alphabetByEncoding)) {
                    throw new TypeError(`Invalid character ${input[j]} in base64 string.`);
                }
                bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);
                bitLength += bitsPerLetter;
            }
            else {
                bits >>= bitsPerLetter;
            }
        }
        const chunkOffset = (i / 4) * 3;
        bits >>= bitLength % bitsPerByte;
        const byteLength = Math.floor(bitLength / bitsPerByte);
        for (let k = 0; k < byteLength; k++) {
            const offset = (byteLength - k - 1) * bitsPerByte;
            dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);
        }
    }
    return new Uint8Array(out);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-utf8/dist-es/fromUtf8.browser.js
const fromUtf8 = (input) => new TextEncoder().encode(input);

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-base64/dist-es/toBase64.browser.js


function toBase64_browser_toBase64(_input) {
    let input;
    if (typeof _input === "string") {
        input = fromUtf8(_input);
    }
    else {
        input = _input;
    }
    const isArrayLike = typeof input === "object" && typeof input.length === "number";
    const isUint8Array = typeof input === "object" &&
        typeof input.byteOffset === "number" &&
        typeof input.byteLength === "number";
    if (!isArrayLike && !isUint8Array) {
        throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
    }
    let str = "";
    for (let i = 0; i < input.length; i += 3) {
        let bits = 0;
        let bitLength = 0;
        for (let j = i, limit = Math.min(i + 3, input.length); j < limit; j++) {
            bits |= input[j] << ((limit - j - 1) * bitsPerByte);
            bitLength += bitsPerByte;
        }
        const bitClusterCount = Math.ceil(bitLength / bitsPerLetter);
        bits <<= bitClusterCount * bitsPerLetter - bitLength;
        for (let k = 1; k <= bitClusterCount; k++) {
            const offset = (bitClusterCount - k) * bitsPerLetter;
            str += alphabetByValue[(bits & (maxLetterValue << offset)) >> offset];
        }
        str += "==".slice(0, 4 - bitClusterCount);
    }
    return str;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-base64/dist-es/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-utf8/dist-es/toUtf8.browser.js
const toUtf8 = (input) => {
    if (typeof input === "string") {
        return input;
    }
    if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
        throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
    }
    return new TextDecoder("utf-8").decode(input);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/blob/transforms.js



function transformToString(payload, encoding = "utf-8") {
    if (encoding === "base64") {
        return toBase64_browser_toBase64(payload);
    }
    return toUtf8(payload);
}
function transformFromString(str, encoding) {
    if (encoding === "base64") {
        return Uint8ArrayBlobAdapter.mutate(fromBase64(str));
    }
    return Uint8ArrayBlobAdapter.mutate(fromUtf8(str));
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js

class Uint8ArrayBlobAdapter extends Uint8Array {
    static fromString(source, encoding = "utf-8") {
        switch (typeof source) {
            case "string":
                return transformFromString(source, encoding);
            default:
                throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
        }
    }
    static mutate(source) {
        Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype);
        return source;
    }
    transformToString(encoding = "utf-8") {
        return transformToString(this, encoding);
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/checksum/ChecksumStream.browser.js
const ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function () { };
class ChecksumStream_browser_ChecksumStream extends (/* unused pure expression or super */ null && (ReadableStreamRef)) {
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/checksum/createChecksumStream.browser.js



const createChecksumStream_browser_createChecksumStream = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder, }) => {
    if (!isReadableStream(source)) {
        throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
    }
    const encoder = base64Encoder ?? toBase64;
    if (typeof TransformStream !== "function") {
        throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");
    }
    const transform = new TransformStream({
        start() { },
        async transform(chunk, controller) {
            checksum.update(chunk);
            controller.enqueue(chunk);
        },
        async flush(controller) {
            const digest = await checksum.digest();
            const received = encoder(digest);
            if (expectedChecksum !== received) {
                const error = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}"` +
                    ` in response header "${checksumSourceLocation}".`);
                controller.error(error);
            }
            else {
                controller.terminate();
            }
        },
    });
    source.pipeThrough(transform);
    const readable = transform.readable;
    Object.setPrototypeOf(readable, ChecksumStream.prototype);
    return readable;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/createBufferedReadableStream.js
/* provided dependency */ var createBufferedReadableStream_Buffer = __webpack_require__(8287)["Buffer"];

function createBufferedReadableStream(upstream, size, logger) {
    const reader = upstream.getReader();
    let streamBufferingLoggedWarning = false;
    let bytesSeen = 0;
    const buffers = ["", new ByteArrayCollector((size) => new Uint8Array(size))];
    let mode = -1;
    const pull = async (controller) => {
        const { value, done } = await reader.read();
        const chunk = value;
        if (done) {
            if (mode !== -1) {
                const remainder = flush(buffers, mode);
                if (sizeOf(remainder) > 0) {
                    controller.enqueue(remainder);
                }
            }
            controller.close();
        }
        else {
            const chunkMode = modeOf(chunk, false);
            if (mode !== chunkMode) {
                if (mode >= 0) {
                    controller.enqueue(flush(buffers, mode));
                }
                mode = chunkMode;
            }
            if (mode === -1) {
                controller.enqueue(chunk);
                return;
            }
            const chunkSize = sizeOf(chunk);
            bytesSeen += chunkSize;
            const bufferSize = sizeOf(buffers[mode]);
            if (chunkSize >= size && bufferSize === 0) {
                controller.enqueue(chunk);
            }
            else {
                const newSize = createBufferedReadableStream_merge(buffers, mode, chunk);
                if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
                    streamBufferingLoggedWarning = true;
                    logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
                }
                if (newSize >= size) {
                    controller.enqueue(flush(buffers, mode));
                }
                else {
                    await pull(controller);
                }
            }
        }
    };
    return new ReadableStream({
        pull,
    });
}
const createBufferedReadableStream_createBufferedReadable = (/* unused pure expression or super */ null && (createBufferedReadableStream));
function createBufferedReadableStream_merge(buffers, mode, chunk) {
    switch (mode) {
        case 0:
            buffers[0] += chunk;
            return sizeOf(buffers[0]);
        case 1:
        case 2:
            buffers[mode].push(chunk);
            return sizeOf(buffers[mode]);
    }
}
function flush(buffers, mode) {
    switch (mode) {
        case 0:
            const s = buffers[0];
            buffers[0] = "";
            return s;
        case 1:
        case 2:
            return buffers[mode].flush();
    }
    throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`);
}
function sizeOf(chunk) {
    return chunk?.byteLength ?? chunk?.length ?? 0;
}
function modeOf(chunk, allowBuffer = true) {
    if (allowBuffer && typeof createBufferedReadableStream_Buffer !== "undefined" && chunk instanceof createBufferedReadableStream_Buffer) {
        return 2;
    }
    if (chunk instanceof Uint8Array) {
        return 1;
    }
    if (typeof chunk === "string") {
        return 0;
    }
    return -1;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/getAwsChunkedEncodingStream.browser.js
const getAwsChunkedEncodingStream = (readableStream, options) => {
    const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
    const checksumRequired = base64Encoder !== undefined &&
        bodyLengthChecker !== undefined &&
        checksumAlgorithmFn !== undefined &&
        checksumLocationName !== undefined &&
        streamHasher !== undefined;
    const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : undefined;
    const reader = readableStream.getReader();
    return new ReadableStream({
        async pull(controller) {
            const { value, done } = await reader.read();
            if (done) {
                controller.enqueue(`0\r\n`);
                if (checksumRequired) {
                    const checksum = base64Encoder(await digest);
                    controller.enqueue(`${checksumLocationName}:${checksum}\r\n`);
                    controller.enqueue(`\r\n`);
                }
                controller.close();
            }
            else {
                controller.enqueue(`${(bodyLengthChecker(value) || 0).toString(16)}\r\n${value}\r\n`);
            }
        },
    });
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/headStream.browser.js
async function headStream(stream, bytes) {
    let byteLengthCounter = 0;
    const chunks = [];
    const reader = stream.getReader();
    let isDone = false;
    while (!isDone) {
        const { done, value } = await reader.read();
        if (value) {
            chunks.push(value);
            byteLengthCounter += value?.byteLength ?? 0;
        }
        if (byteLengthCounter >= bytes) {
            break;
        }
        isDone = done;
    }
    reader.releaseLock();
    const collected = new Uint8Array(Math.min(bytes, byteLengthCounter));
    let offset = 0;
    for (const chunk of chunks) {
        if (chunk.byteLength > collected.byteLength - offset) {
            collected.set(chunk.subarray(0, collected.byteLength - offset), offset);
            break;
        }
        else {
            collected.set(chunk, offset);
        }
        offset += chunk.length;
    }
    return collected;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-uri-escape/dist-es/escape-uri.js
const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);
const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/querystring-builder/dist-es/index.js

function buildQueryString(query) {
    const parts = [];
    for (let key of Object.keys(query).sort()) {
        const value = query[key];
        key = escapeUri(key);
        if (Array.isArray(value)) {
            for (let i = 0, iLen = value.length; i < iLen; i++) {
                parts.push(`${key}=${escapeUri(value[i])}`);
            }
        }
        else {
            let qsEntry = key;
            if (value || typeof value === "string") {
                qsEntry += `=${escapeUri(value)}`;
            }
            parts.push(qsEntry);
        }
    }
    return parts.join("&");
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/fetch-http-handler/dist-es/create-request.js
function createRequest(url, requestOptions) {
    return new Request(url, requestOptions);
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/fetch-http-handler/dist-es/request-timeout.js
function requestTimeout(timeoutInMs = 0) {
    return new Promise((resolve, reject) => {
        if (timeoutInMs) {
            setTimeout(() => {
                const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);
                timeoutError.name = "TimeoutError";
                reject(timeoutError);
            }, timeoutInMs);
        }
    });
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js




const keepAliveSupport = {
    supported: undefined,
};
class FetchHttpHandler {
    static create(instanceOrOptions) {
        if (typeof instanceOrOptions?.handle === "function") {
            return instanceOrOptions;
        }
        return new FetchHttpHandler(instanceOrOptions);
    }
    constructor(options) {
        if (typeof options === "function") {
            this.configProvider = options().then((opts) => opts || {});
        }
        else {
            this.config = options ?? {};
            this.configProvider = Promise.resolve(this.config);
        }
        if (keepAliveSupport.supported === undefined) {
            keepAliveSupport.supported = Boolean(typeof Request !== "undefined" && "keepalive" in createRequest("https://[::1]"));
        }
    }
    destroy() {
    }
    async handle(request, { abortSignal } = {}) {
        if (!this.config) {
            this.config = await this.configProvider;
        }
        const requestTimeoutInMs = this.config.requestTimeout;
        const keepAlive = this.config.keepAlive === true;
        const credentials = this.config.credentials;
        if (abortSignal?.aborted) {
            const abortError = new Error("Request aborted");
            abortError.name = "AbortError";
            return Promise.reject(abortError);
        }
        let path = request.path;
        const queryString = buildQueryString(request.query || {});
        if (queryString) {
            path += `?${queryString}`;
        }
        if (request.fragment) {
            path += `#${request.fragment}`;
        }
        let auth = "";
        if (request.username != null || request.password != null) {
            const username = request.username ?? "";
            const password = request.password ?? "";
            auth = `${username}:${password}@`;
        }
        const { port, method } = request;
        const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path}`;
        const body = method === "GET" || method === "HEAD" ? undefined : request.body;
        const requestOptions = {
            body,
            headers: new Headers(request.headers),
            method: method,
            credentials,
        };
        if (this.config?.cache) {
            requestOptions.cache = this.config.cache;
        }
        if (body) {
            requestOptions.duplex = "half";
        }
        if (typeof AbortController !== "undefined") {
            requestOptions.signal = abortSignal;
        }
        if (keepAliveSupport.supported) {
            requestOptions.keepalive = keepAlive;
        }
        if (typeof this.config.requestInit === "function") {
            Object.assign(requestOptions, this.config.requestInit(request));
        }
        let removeSignalEventListener = () => { };
        const fetchRequest = createRequest(url, requestOptions);
        const raceOfPromises = [
            fetch(fetchRequest).then((response) => {
                const fetchHeaders = response.headers;
                const transformedHeaders = {};
                for (const pair of fetchHeaders.entries()) {
                    transformedHeaders[pair[0]] = pair[1];
                }
                const hasReadableStream = response.body != undefined;
                if (!hasReadableStream) {
                    return response.blob().then((body) => ({
                        response: new httpResponse_HttpResponse({
                            headers: transformedHeaders,
                            reason: response.statusText,
                            statusCode: response.status,
                            body,
                        }),
                    }));
                }
                return {
                    response: new httpResponse_HttpResponse({
                        headers: transformedHeaders,
                        reason: response.statusText,
                        statusCode: response.status,
                        body: response.body,
                    }),
                };
            }),
            requestTimeout(requestTimeoutInMs),
        ];
        if (abortSignal) {
            raceOfPromises.push(new Promise((resolve, reject) => {
                const onAbort = () => {
                    const abortError = new Error("Request aborted");
                    abortError.name = "AbortError";
                    reject(abortError);
                };
                if (typeof abortSignal.addEventListener === "function") {
                    const signal = abortSignal;
                    signal.addEventListener("abort", onAbort, { once: true });
                    removeSignalEventListener = () => signal.removeEventListener("abort", onAbort);
                }
                else {
                    abortSignal.onabort = onAbort;
                }
            }));
        }
        return Promise.race(raceOfPromises).finally(removeSignalEventListener);
    }
    updateHttpClientConfig(key, value) {
        this.config = undefined;
        this.configProvider = this.configProvider.then((config) => {
            config[key] = value;
            return config;
        });
    }
    httpHandlerConfigs() {
        return this.config ?? {};
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js

const streamCollector = async (stream) => {
    if ((typeof Blob === "function" && stream instanceof Blob) || stream.constructor?.name === "Blob") {
        if (Blob.prototype.arrayBuffer !== undefined) {
            return new Uint8Array(await stream.arrayBuffer());
        }
        return collectBlob(stream);
    }
    return collectStream(stream);
};
async function collectBlob(blob) {
    const base64 = await readToBase64(blob);
    const arrayBuffer = fromBase64(base64);
    return new Uint8Array(arrayBuffer);
}
async function collectStream(stream) {
    const chunks = [];
    const reader = stream.getReader();
    let isDone = false;
    let length = 0;
    while (!isDone) {
        const { done, value } = await reader.read();
        if (value) {
            chunks.push(value);
            length += value.length;
        }
        isDone = done;
    }
    const collected = new Uint8Array(length);
    let offset = 0;
    for (const chunk of chunks) {
        collected.set(chunk, offset);
        offset += chunk.length;
    }
    return collected;
}
function readToBase64(blob) {
    return new Promise((resolve, reject) => {
        const reader = new FileReader();
        reader.onloadend = () => {
            if (reader.readyState !== 2) {
                return reject(new Error("Reader aborted too early"));
            }
            const result = (reader.result ?? "");
            const commaIndex = result.indexOf(",");
            const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
            resolve(result.substring(dataOffset));
        };
        reader.onabort = () => reject(new Error("Read aborted"));
        reader.onerror = () => reject(reader.error);
        reader.readAsDataURL(blob);
    });
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/fetch-http-handler/dist-es/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-hex-encoding/dist-es/index.js
const SHORT_TO_HEX = {};
const HEX_TO_SHORT = {};
for (let i = 0; i < 256; i++) {
    let encodedByte = i.toString(16).toLowerCase();
    if (encodedByte.length === 1) {
        encodedByte = `0${encodedByte}`;
    }
    SHORT_TO_HEX[i] = encodedByte;
    HEX_TO_SHORT[encodedByte] = i;
}
function fromHex(encoded) {
    if (encoded.length % 2 !== 0) {
        throw new Error("Hex encoded strings must have an even number length");
    }
    const out = new Uint8Array(encoded.length / 2);
    for (let i = 0; i < encoded.length; i += 2) {
        const encodedByte = encoded.slice(i, i + 2).toLowerCase();
        if (encodedByte in HEX_TO_SHORT) {
            out[i / 2] = HEX_TO_SHORT[encodedByte];
        }
        else {
            throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
        }
    }
    return out;
}
function toHex(bytes) {
    let out = "";
    for (let i = 0; i < bytes.byteLength; i++) {
        out += SHORT_TO_HEX[bytes[i]];
    }
    return out;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/stream-type-check.js
const stream_type_check_isReadableStream = (stream) => typeof ReadableStream === "function" &&
    (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);
const isBlob = (blob) => {
    return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js





const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
const sdkStreamMixin = (stream) => {
    if (!isBlobInstance(stream) && !stream_type_check_isReadableStream(stream)) {
        const name = stream?.__proto__?.constructor?.name || stream;
        throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
    }
    let transformed = false;
    const transformToByteArray = async () => {
        if (transformed) {
            throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
        }
        transformed = true;
        return await streamCollector(stream);
    };
    const blobToWebStream = (blob) => {
        if (typeof blob.stream !== "function") {
            throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\n" +
                "If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
        }
        return blob.stream();
    };
    return Object.assign(stream, {
        transformToByteArray: transformToByteArray,
        transformToString: async (encoding) => {
            const buf = await transformToByteArray();
            if (encoding === "base64") {
                return toBase64_browser_toBase64(buf);
            }
            else if (encoding === "hex") {
                return toHex(buf);
            }
            else if (encoding === undefined || encoding === "utf8" || encoding === "utf-8") {
                return toUtf8(buf);
            }
            else if (typeof TextDecoder === "function") {
                return new TextDecoder(encoding).decode(buf);
            }
            else {
                throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
            }
        },
        transformToWebStream: () => {
            if (transformed) {
                throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
            }
            transformed = true;
            if (isBlobInstance(stream)) {
                return blobToWebStream(stream);
            }
            else if (stream_type_check_isReadableStream(stream)) {
                return stream;
            }
            else {
                throw new Error(`Cannot transform payload to web stream, got ${stream}`);
            }
        },
    });
};
const isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/splitStream.browser.js
async function splitStream(stream) {
    if (typeof stream.stream === "function") {
        stream = stream.stream();
    }
    const readableStream = stream;
    return readableStream.tee();
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-stream/dist-es/index.js










;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/types.js

const types_CLIENT_SUPPORTED_ALGORITHMS = [
    constants_ChecksumAlgorithm.CRC32,
    constants_ChecksumAlgorithm.CRC32C,
    constants_ChecksumAlgorithm.CRC64NVME,
    constants_ChecksumAlgorithm.SHA1,
    constants_ChecksumAlgorithm.SHA256,
];
const types_PRIORITY_ORDER_ALGORITHMS = [
    constants_ChecksumAlgorithm.SHA256,
    constants_ChecksumAlgorithm.SHA1,
    constants_ChecksumAlgorithm.CRC32,
    constants_ChecksumAlgorithm.CRC32C,
    constants_ChecksumAlgorithm.CRC64NVME,
];

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmForRequest.js


const getChecksumAlgorithmForRequest_getChecksumAlgorithmForRequest = (input, { requestChecksumRequired, requestAlgorithmMember, requestChecksumCalculation }) => {
    if (!requestAlgorithmMember) {
        return requestChecksumCalculation === RequestChecksumCalculation.WHEN_SUPPORTED || requestChecksumRequired
            ? DEFAULT_CHECKSUM_ALGORITHM
            : undefined;
    }
    if (!input[requestAlgorithmMember]) {
        return undefined;
    }
    const checksumAlgorithm = input[requestAlgorithmMember];
    if (!CLIENT_SUPPORTED_ALGORITHMS.includes(checksumAlgorithm)) {
        throw new Error(`The checksum algorithm "${checksumAlgorithm}" is not supported by the client.` +
            ` Select one of ${CLIENT_SUPPORTED_ALGORITHMS}.`);
    }
    return checksumAlgorithm;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumLocationName.js

const getChecksumLocationName_getChecksumLocationName = (algorithm) => algorithm === ChecksumAlgorithm.MD5 ? "content-md5" : `x-amz-checksum-${algorithm.toLowerCase()}`;

;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.mjs
/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */

var extendStatics = function(d, b) {
  extendStatics = Object.setPrototypeOf ||
      ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
      function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  return extendStatics(d, b);
};

function __extends(d, b) {
  if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  extendStatics(d, b);
  function __() { this.constructor = d; }
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

var __assign = function() {
  __assign = Object.assign || function __assign(t) {
      for (var s, i = 1, n = arguments.length; i < n; i++) {
          s = arguments[i];
          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
      return t;
  }
  return __assign.apply(this, arguments);
}

function __rest(s, e) {
  var t = {};
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
      t[p] = s[p];
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
          if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
              t[p[i]] = s[p[i]];
      }
  return t;
}

function __decorate(decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
}

function __param(paramIndex, decorator) {
  return function (target, key) { decorator(target, key, paramIndex); }
}

function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
      var context = {};
      for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
      for (var p in contextIn.access) context.access[p] = contextIn.access[p];
      context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
      var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
      if (kind === "accessor") {
          if (result === void 0) continue;
          if (result === null || typeof result !== "object") throw new TypeError("Object expected");
          if (_ = accept(result.get)) descriptor.get = _;
          if (_ = accept(result.set)) descriptor.set = _;
          if (_ = accept(result.init)) initializers.unshift(_);
      }
      else if (_ = accept(result)) {
          if (kind === "field") initializers.unshift(_);
          else descriptor[key] = _;
      }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};

function __runInitializers(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
      value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};

function __propKey(x) {
  return typeof x === "symbol" ? x : "".concat(x);
};

function __setFunctionName(f, name, prefix) {
  if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
  return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};

function __metadata(metadataKey, metadataValue) {
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}

function tslib_es6_awaiter(thisArg, _arguments, P, generator) {
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  return new (P || (P = Promise))(function (resolve, reject) {
      function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
      function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
      function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
      step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
}

function tslib_es6_generator(thisArg, body) {
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
  return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  function verb(n) { return function (v) { return step([n, v]); }; }
  function step(op) {
      if (f) throw new TypeError("Generator is already executing.");
      while (g && (g = 0, op[0] && (_ = 0)), _) try {
          if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
          if (y = 0, t) op = [op[0] & 2, t.value];
          switch (op[0]) {
              case 0: case 1: t = op; break;
              case 4: _.label++; return { value: op[1], done: false };
              case 5: _.label++; y = op[1]; op = [0]; continue;
              case 7: op = _.ops.pop(); _.trys.pop(); continue;
              default:
                  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                  if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                  if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                  if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                  if (t[2]) _.ops.pop();
                  _.trys.pop(); continue;
          }
          op = body.call(thisArg, _);
      } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
      if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  }
}

var __createBinding = Object.create ? (function(o, m, k, k2) {
  if (k2 === undefined) k2 = k;
  var desc = Object.getOwnPropertyDescriptor(m, k);
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
  }
  Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
  if (k2 === undefined) k2 = k;
  o[k2] = m[k];
});

function __exportStar(m, o) {
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}

function __values(o) {
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  if (m) return m.call(o);
  if (o && typeof o.length === "number") return {
      next: function () {
          if (o && i >= o.length) o = void 0;
          return { value: o && o[i++], done: !o };
      }
  };
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}

function __read(o, n) {
  var m = typeof Symbol === "function" && o[Symbol.iterator];
  if (!m) return o;
  var i = m.call(o), r, ar = [], e;
  try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  }
  catch (error) { e = { error: error }; }
  finally {
      try {
          if (r && !r.done && (m = i["return"])) m.call(i);
      }
      finally { if (e) throw e.error; }
  }
  return ar;
}

/** @deprecated */
function __spread() {
  for (var ar = [], i = 0; i < arguments.length; i++)
      ar = ar.concat(__read(arguments[i]));
  return ar;
}

/** @deprecated */
function __spreadArrays() {
  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  for (var r = Array(s), k = 0, i = 0; i < il; i++)
      for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
          r[k] = a[j];
  return r;
}

function __spreadArray(to, from, pack) {
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
      if (ar || !(i in from)) {
          if (!ar) ar = Array.prototype.slice.call(from, 0, i);
          ar[i] = from[i];
      }
  }
  return to.concat(ar || Array.prototype.slice.call(from));
}

function __await(v) {
  return this instanceof __await ? (this.v = v, this) : new __await(v);
}

function __asyncGenerator(thisArg, _arguments, generator) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var g = generator.apply(thisArg, _arguments || []), i, q = [];
  return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
  function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
  function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
  function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  function fulfill(value) { resume("next", value); }
  function reject(value) { resume("throw", value); }
  function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}

function __asyncDelegator(o) {
  var i, p;
  return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}

function __asyncValues(o) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var m = o[Symbol.asyncIterator], i;
  return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}

function __makeTemplateObject(cooked, raw) {
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  return cooked;
};

var __setModuleDefault = Object.create ? (function(o, v) {
  Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
  o["default"] = v;
};

var tslib_es6_ownKeys = function(o) {
  tslib_es6_ownKeys = Object.getOwnPropertyNames || function (o) {
    var ar = [];
    for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
    return ar;
  };
  return tslib_es6_ownKeys(o);
};

function __importStar(mod) {
  if (mod && mod.__esModule) return mod;
  var result = {};
  if (mod != null) for (var k = tslib_es6_ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
  __setModuleDefault(result, mod);
  return result;
}

function __importDefault(mod) {
  return (mod && mod.__esModule) ? mod : { default: mod };
}

function __classPrivateFieldGet(receiver, state, kind, f) {
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}

function __classPrivateFieldSet(receiver, state, value, kind, f) {
  if (kind === "m") throw new TypeError("Private method is not writable");
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}

function __classPrivateFieldIn(state, receiver) {
  if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
  return typeof state === "function" ? receiver === state : state.has(receiver);
}

function __addDisposableResource(env, value, async) {
  if (value !== null && value !== void 0) {
    if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
    var dispose, inner;
    if (async) {
      if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
      dispose = value[Symbol.asyncDispose];
    }
    if (dispose === void 0) {
      if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
      dispose = value[Symbol.dispose];
      if (async) inner = dispose;
    }
    if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
    if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
    env.stack.push({ value: value, dispose: dispose, async: async });
  }
  else if (async) {
    env.stack.push({ async: true });
  }
  return value;
}

var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
  var e = new Error(message);
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};

function __disposeResources(env) {
  function fail(e) {
    env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
    env.hasError = true;
  }
  var r, s = 0;
  function next() {
    while (r = env.stack.pop()) {
      try {
        if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
        if (r.dispose) {
          var result = r.dispose.call(r.value);
          if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
        }
        else s |= 1;
      }
      catch (e) {
        fail(e);
      }
    }
    if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
    if (env.hasError) throw env.error;
  }
  return next();
}

function __rewriteRelativeImportExtension(path, preserveJsx) {
  if (typeof path === "string" && /^\.\.?\//.test(path)) {
      return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
          return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
      });
  }
  return path;
}

/* harmony default export */ var tslib_es6 = ({
  __extends,
  __assign,
  __rest,
  __decorate,
  __param,
  __esDecorate,
  __runInitializers,
  __propKey,
  __setFunctionName,
  __metadata,
  __awaiter: tslib_es6_awaiter,
  __generator: tslib_es6_generator,
  __createBinding,
  __exportStar,
  __values,
  __read,
  __spread,
  __spreadArrays,
  __spreadArray,
  __await,
  __asyncGenerator,
  __asyncDelegator,
  __asyncValues,
  __makeTemplateObject,
  __importStar,
  __importDefault,
  __classPrivateFieldGet,
  __classPrivateFieldSet,
  __classPrivateFieldIn,
  __addDisposableResource,
  __disposeResources,
  __rewriteRelativeImportExtension,
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/util/build/module/convertToBuffer.js
/* provided dependency */ var convertToBuffer_Buffer = __webpack_require__(8287)["Buffer"];
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

// Quick polyfill
var convertToBuffer_fromUtf8 = typeof convertToBuffer_Buffer !== "undefined" && convertToBuffer_Buffer.from
    ? function (input) { return convertToBuffer_Buffer.from(input, "utf8"); }
    : fromUtf8;
function convertToBuffer(data) {
    // Already a Uint8, do nothing
    if (data instanceof Uint8Array)
        return data;
    if (typeof data === "string") {
        return convertToBuffer_fromUtf8(data);
    }
    if (ArrayBuffer.isView(data)) {
        return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
    }
    return new Uint8Array(data);
}
//# sourceMappingURL=convertToBuffer.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/util/build/module/isEmptyData.js
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
function isEmptyData(data) {
    if (typeof data === "string") {
        return data.length === 0;
    }
    return data.byteLength === 0;
}
//# sourceMappingURL=isEmptyData.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/util/build/module/numToUint8.js
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
function numToUint8(num) {
    return new Uint8Array([
        (num & 0xff000000) >> 24,
        (num & 0x00ff0000) >> 16,
        (num & 0x0000ff00) >> 8,
        num & 0x000000ff,
    ]);
}
//# sourceMappingURL=numToUint8.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/util/build/module/uint32ArrayFrom.js
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// IE 11 does not support Array.from, so we do it manually
function uint32ArrayFrom(a_lookUpTable) {
    if (!Uint32Array.from) {
        var return_array = new Uint32Array(a_lookUpTable.length);
        var a_index = 0;
        while (a_index < a_lookUpTable.length) {
            return_array[a_index] = a_lookUpTable[a_index];
            a_index += 1;
        }
        return return_array;
    }
    return Uint32Array.from(a_lookUpTable);
}
//# sourceMappingURL=uint32ArrayFrom.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/util/build/module/index.js
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0




//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/crc32c/build/module/aws_crc32c.js
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0



var aws_crc32c_AwsCrc32c = /** @class */ (function () {
    function AwsCrc32c() {
        this.crc32c = new Crc32c();
    }
    AwsCrc32c.prototype.update = function (toHash) {
        if (isEmptyData(toHash))
            return;
        this.crc32c.update(convertToBuffer(toHash));
    };
    AwsCrc32c.prototype.digest = function () {
        return tslib_es6_awaiter(this, void 0, void 0, function () {
            return tslib_es6_generator(this, function (_a) {
                return [2 /*return*/, numToUint8(this.crc32c.digest())];
            });
        });
    };
    AwsCrc32c.prototype.reset = function () {
        this.crc32c = new Crc32c();
    };
    return AwsCrc32c;
}());

//# sourceMappingURL=aws_crc32c.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/crc32c/build/module/index.js
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0


function crc32c(data) {
    return new Crc32c().update(data).digest();
}
var Crc32c = /** @class */ (function () {
    function Crc32c() {
        this.checksum = 0xffffffff;
    }
    Crc32c.prototype.update = function (data) {
        var e_1, _a;
        try {
            for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
                var byte = data_1_1.value;
                this.checksum =
                    (this.checksum >>> 8) ^ lookupTable[(this.checksum ^ byte) & 0xff];
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (data_1_1 && !data_1_1.done && (_a = data_1.return)) _a.call(data_1);
            }
            finally { if (e_1) throw e_1.error; }
        }
        return this;
    };
    Crc32c.prototype.digest = function () {
        return (this.checksum ^ 0xffffffff) >>> 0;
    };
    return Crc32c;
}());

// prettier-ignore
var a_lookupTable = [
    0x00000000, 0xF26B8303, 0xE13B70F7, 0x1350F3F4, 0xC79A971F, 0x35F1141C, 0x26A1E7E8, 0xD4CA64EB,
    0x8AD958CF, 0x78B2DBCC, 0x6BE22838, 0x9989AB3B, 0x4D43CFD0, 0xBF284CD3, 0xAC78BF27, 0x5E133C24,
    0x105EC76F, 0xE235446C, 0xF165B798, 0x030E349B, 0xD7C45070, 0x25AFD373, 0x36FF2087, 0xC494A384,
    0x9A879FA0, 0x68EC1CA3, 0x7BBCEF57, 0x89D76C54, 0x5D1D08BF, 0xAF768BBC, 0xBC267848, 0x4E4DFB4B,
    0x20BD8EDE, 0xD2D60DDD, 0xC186FE29, 0x33ED7D2A, 0xE72719C1, 0x154C9AC2, 0x061C6936, 0xF477EA35,
    0xAA64D611, 0x580F5512, 0x4B5FA6E6, 0xB93425E5, 0x6DFE410E, 0x9F95C20D, 0x8CC531F9, 0x7EAEB2FA,
    0x30E349B1, 0xC288CAB2, 0xD1D83946, 0x23B3BA45, 0xF779DEAE, 0x05125DAD, 0x1642AE59, 0xE4292D5A,
    0xBA3A117E, 0x4851927D, 0x5B016189, 0xA96AE28A, 0x7DA08661, 0x8FCB0562, 0x9C9BF696, 0x6EF07595,
    0x417B1DBC, 0xB3109EBF, 0xA0406D4B, 0x522BEE48, 0x86E18AA3, 0x748A09A0, 0x67DAFA54, 0x95B17957,
    0xCBA24573, 0x39C9C670, 0x2A993584, 0xD8F2B687, 0x0C38D26C, 0xFE53516F, 0xED03A29B, 0x1F682198,
    0x5125DAD3, 0xA34E59D0, 0xB01EAA24, 0x42752927, 0x96BF4DCC, 0x64D4CECF, 0x77843D3B, 0x85EFBE38,
    0xDBFC821C, 0x2997011F, 0x3AC7F2EB, 0xC8AC71E8, 0x1C661503, 0xEE0D9600, 0xFD5D65F4, 0x0F36E6F7,
    0x61C69362, 0x93AD1061, 0x80FDE395, 0x72966096, 0xA65C047D, 0x5437877E, 0x4767748A, 0xB50CF789,
    0xEB1FCBAD, 0x197448AE, 0x0A24BB5A, 0xF84F3859, 0x2C855CB2, 0xDEEEDFB1, 0xCDBE2C45, 0x3FD5AF46,
    0x7198540D, 0x83F3D70E, 0x90A324FA, 0x62C8A7F9, 0xB602C312, 0x44694011, 0x5739B3E5, 0xA55230E6,
    0xFB410CC2, 0x092A8FC1, 0x1A7A7C35, 0xE811FF36, 0x3CDB9BDD, 0xCEB018DE, 0xDDE0EB2A, 0x2F8B6829,
    0x82F63B78, 0x709DB87B, 0x63CD4B8F, 0x91A6C88C, 0x456CAC67, 0xB7072F64, 0xA457DC90, 0x563C5F93,
    0x082F63B7, 0xFA44E0B4, 0xE9141340, 0x1B7F9043, 0xCFB5F4A8, 0x3DDE77AB, 0x2E8E845F, 0xDCE5075C,
    0x92A8FC17, 0x60C37F14, 0x73938CE0, 0x81F80FE3, 0x55326B08, 0xA759E80B, 0xB4091BFF, 0x466298FC,
    0x1871A4D8, 0xEA1A27DB, 0xF94AD42F, 0x0B21572C, 0xDFEB33C7, 0x2D80B0C4, 0x3ED04330, 0xCCBBC033,
    0xA24BB5A6, 0x502036A5, 0x4370C551, 0xB11B4652, 0x65D122B9, 0x97BAA1BA, 0x84EA524E, 0x7681D14D,
    0x2892ED69, 0xDAF96E6A, 0xC9A99D9E, 0x3BC21E9D, 0xEF087A76, 0x1D63F975, 0x0E330A81, 0xFC588982,
    0xB21572C9, 0x407EF1CA, 0x532E023E, 0xA145813D, 0x758FE5D6, 0x87E466D5, 0x94B49521, 0x66DF1622,
    0x38CC2A06, 0xCAA7A905, 0xD9F75AF1, 0x2B9CD9F2, 0xFF56BD19, 0x0D3D3E1A, 0x1E6DCDEE, 0xEC064EED,
    0xC38D26C4, 0x31E6A5C7, 0x22B65633, 0xD0DDD530, 0x0417B1DB, 0xF67C32D8, 0xE52CC12C, 0x1747422F,
    0x49547E0B, 0xBB3FFD08, 0xA86F0EFC, 0x5A048DFF, 0x8ECEE914, 0x7CA56A17, 0x6FF599E3, 0x9D9E1AE0,
    0xD3D3E1AB, 0x21B862A8, 0x32E8915C, 0xC083125F, 0x144976B4, 0xE622F5B7, 0xF5720643, 0x07198540,
    0x590AB964, 0xAB613A67, 0xB831C993, 0x4A5A4A90, 0x9E902E7B, 0x6CFBAD78, 0x7FAB5E8C, 0x8DC0DD8F,
    0xE330A81A, 0x115B2B19, 0x020BD8ED, 0xF0605BEE, 0x24AA3F05, 0xD6C1BC06, 0xC5914FF2, 0x37FACCF1,
    0x69E9F0D5, 0x9B8273D6, 0x88D28022, 0x7AB90321, 0xAE7367CA, 0x5C18E4C9, 0x4F48173D, 0xBD23943E,
    0xF36E6F75, 0x0105EC76, 0x12551F82, 0xE03E9C81, 0x34F4F86A, 0xC69F7B69, 0xD5CF889D, 0x27A40B9E,
    0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351,
];
var lookupTable = uint32ArrayFrom(a_lookupTable);

//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/crc32/build/module/aws_crc32.js
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0



var aws_crc32_AwsCrc32 = /** @class */ (function () {
    function AwsCrc32() {
        this.crc32 = new Crc32();
    }
    AwsCrc32.prototype.update = function (toHash) {
        if (isEmptyData(toHash))
            return;
        this.crc32.update(convertToBuffer(toHash));
    };
    AwsCrc32.prototype.digest = function () {
        return tslib_es6_awaiter(this, void 0, void 0, function () {
            return tslib_es6_generator(this, function (_a) {
                return [2 /*return*/, numToUint8(this.crc32.digest())];
            });
        });
    };
    AwsCrc32.prototype.reset = function () {
        this.crc32 = new Crc32();
    };
    return AwsCrc32;
}());

//# sourceMappingURL=aws_crc32.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/crc32/build/module/index.js


function crc32(data) {
    return new Crc32().update(data).digest();
}
var Crc32 = /** @class */ (function () {
    function Crc32() {
        this.checksum = 0xffffffff;
    }
    Crc32.prototype.update = function (data) {
        var e_1, _a;
        try {
            for (var data_1 = __values(data), data_1_1 = data_1.next(); !data_1_1.done; data_1_1 = data_1.next()) {
                var byte = data_1_1.value;
                this.checksum =
                    (this.checksum >>> 8) ^ module_lookupTable[(this.checksum ^ byte) & 0xff];
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (data_1_1 && !data_1_1.done && (_a = data_1.return)) _a.call(data_1);
            }
            finally { if (e_1) throw e_1.error; }
        }
        return this;
    };
    Crc32.prototype.digest = function () {
        return (this.checksum ^ 0xffffffff) >>> 0;
    };
    return Crc32;
}());

// prettier-ignore
var a_lookUpTable = [
    0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
    0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
    0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
    0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
    0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
    0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
    0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
    0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
    0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
    0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
    0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
    0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
    0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
    0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
    0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
    0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
    0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
    0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
    0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
    0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
    0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
    0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
    0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
    0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
    0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
    0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
    0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
    0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
    0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
    0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
    0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
    0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
    0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
    0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
    0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
    0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
    0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
    0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
    0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
    0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
    0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
    0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
    0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
    0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
    0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
    0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
    0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
    0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
    0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
    0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
    0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
    0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
    0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
    0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
    0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
    0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
    0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
    0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
    0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
    0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
    0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
    0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
    0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
    0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D,
];
var module_lookupTable = uint32ArrayFrom(a_lookUpTable);

//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getCrc32ChecksumAlgorithmFunction.browser.js

const getCrc32ChecksumAlgorithmFunction_browser_getCrc32ChecksumAlgorithmFunction = () => AwsCrc32;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/selectChecksumAlgorithmFunction.js




const selectChecksumAlgorithmFunction_selectChecksumAlgorithmFunction = (checksumAlgorithm, config) => {
    switch (checksumAlgorithm) {
        case ChecksumAlgorithm.MD5:
            return config.md5;
        case ChecksumAlgorithm.CRC32:
            return getCrc32ChecksumAlgorithmFunction();
        case ChecksumAlgorithm.CRC32C:
            return AwsCrc32c;
        case ChecksumAlgorithm.CRC64NVME:
            if (typeof crc64NvmeCrtContainer.CrtCrc64Nvme !== "function") {
                throw new Error(`Please check whether you have installed the "@aws-sdk/crc64-nvme-crt" package explicitly. \n` +
                    `You must also register the package by calling [require("@aws-sdk/crc64-nvme-crt");] ` +
                    `or an ESM equivalent such as [import "@aws-sdk/crc64-nvme-crt";]. \n` +
                    "For more information please go to " +
                    "https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
            }
            return crc64NvmeCrtContainer.CrtCrc64Nvme;
        case ChecksumAlgorithm.SHA1:
            return config.sha1;
        case ChecksumAlgorithm.SHA256:
            return config.sha256;
        default:
            throw new Error(`Unsupported checksum algorithm: ${checksumAlgorithm}`);
    }
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsMiddleware.js











const flexibleChecksumsMiddleware_flexibleChecksumsMiddlewareOptions = {
    name: "flexibleChecksumsMiddleware",
    step: "build",
    tags: ["BODY_CHECKSUM"],
    override: true,
};
const flexibleChecksumsMiddleware_flexibleChecksumsMiddleware = (config, middlewareConfig) => (next, context) => async (args) => {
    if (!HttpRequest.isInstance(args.request)) {
        return next(args);
    }
    if (hasHeaderWithPrefix("x-amz-checksum-", args.request.headers)) {
        return next(args);
    }
    const { request, input } = args;
    const { body: requestBody, headers } = request;
    const { base64Encoder, streamHasher } = config;
    const { requestChecksumRequired, requestAlgorithmMember } = middlewareConfig;
    const requestChecksumCalculation = await config.requestChecksumCalculation();
    const requestAlgorithmMemberName = requestAlgorithmMember?.name;
    const requestAlgorithmMemberHttpHeader = requestAlgorithmMember?.httpHeader;
    if (requestAlgorithmMemberName && !input[requestAlgorithmMemberName]) {
        if (requestChecksumCalculation === RequestChecksumCalculation.WHEN_SUPPORTED || requestChecksumRequired) {
            input[requestAlgorithmMemberName] = DEFAULT_CHECKSUM_ALGORITHM;
            if (requestAlgorithmMemberHttpHeader) {
                headers[requestAlgorithmMemberHttpHeader] = DEFAULT_CHECKSUM_ALGORITHM;
            }
        }
    }
    const checksumAlgorithm = getChecksumAlgorithmForRequest(input, {
        requestChecksumRequired,
        requestAlgorithmMember: requestAlgorithmMember?.name,
        requestChecksumCalculation,
    });
    let updatedBody = requestBody;
    let updatedHeaders = headers;
    if (checksumAlgorithm) {
        switch (checksumAlgorithm) {
            case ChecksumAlgorithm.CRC32:
                setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_CRC32", "U");
                break;
            case ChecksumAlgorithm.CRC32C:
                setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_CRC32C", "V");
                break;
            case ChecksumAlgorithm.CRC64NVME:
                setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_CRC64", "W");
                break;
            case ChecksumAlgorithm.SHA1:
                setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_SHA1", "X");
                break;
            case ChecksumAlgorithm.SHA256:
                setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_SHA256", "Y");
                break;
        }
        const checksumLocationName = getChecksumLocationName(checksumAlgorithm);
        const checksumAlgorithmFn = selectChecksumAlgorithmFunction(checksumAlgorithm, config);
        if (isStreaming(requestBody)) {
            const { getAwsChunkedEncodingStream, bodyLengthChecker } = config;
            updatedBody = getAwsChunkedEncodingStream(typeof config.requestStreamBufferSize === "number" && config.requestStreamBufferSize >= 8 * 1024
                ? createBufferedReadable(requestBody, config.requestStreamBufferSize, context.logger)
                : requestBody, {
                base64Encoder,
                bodyLengthChecker,
                checksumLocationName,
                checksumAlgorithmFn,
                streamHasher,
            });
            updatedHeaders = {
                ...headers,
                "content-encoding": headers["content-encoding"]
                    ? `${headers["content-encoding"]},aws-chunked`
                    : "aws-chunked",
                "transfer-encoding": "chunked",
                "x-amz-decoded-content-length": headers["content-length"],
                "x-amz-content-sha256": "STREAMING-UNSIGNED-PAYLOAD-TRAILER",
                "x-amz-trailer": checksumLocationName,
            };
            delete updatedHeaders["content-length"];
        }
        else if (!hasHeader(checksumLocationName, headers)) {
            const rawChecksum = await stringHasher(checksumAlgorithmFn, requestBody);
            updatedHeaders = {
                ...headers,
                [checksumLocationName]: base64Encoder(rawChecksum),
            };
        }
    }
    const result = await next({
        ...args,
        request: {
            ...request,
            headers: updatedHeaders,
            body: updatedBody,
        },
    });
    return result;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsInputMiddleware.js


const flexibleChecksumsInputMiddleware_flexibleChecksumsInputMiddlewareOptions = {
    name: "flexibleChecksumsInputMiddleware",
    toMiddleware: "serializerMiddleware",
    relation: "before",
    tags: ["BODY_CHECKSUM"],
    override: true,
};
const flexibleChecksumsInputMiddleware_flexibleChecksumsInputMiddleware = (config, middlewareConfig) => (next, context) => async (args) => {
    const input = args.input;
    const { requestValidationModeMember } = middlewareConfig;
    const requestChecksumCalculation = await config.requestChecksumCalculation();
    const responseChecksumValidation = await config.responseChecksumValidation();
    switch (requestChecksumCalculation) {
        case RequestChecksumCalculation.WHEN_REQUIRED:
            setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED", "a");
            break;
        case RequestChecksumCalculation.WHEN_SUPPORTED:
            setFeature(context, "FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED", "Z");
            break;
    }
    switch (responseChecksumValidation) {
        case ResponseChecksumValidation.WHEN_REQUIRED:
            setFeature(context, "FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED", "c");
            break;
        case ResponseChecksumValidation.WHEN_SUPPORTED:
            setFeature(context, "FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED", "b");
            break;
    }
    if (requestValidationModeMember && !input[requestValidationModeMember]) {
        if (responseChecksumValidation === ResponseChecksumValidation.WHEN_SUPPORTED) {
            input[requestValidationModeMember] = "ENABLED";
        }
    }
    return next(args);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getChecksumAlgorithmListForResponse.js

const getChecksumAlgorithmListForResponse_getChecksumAlgorithmListForResponse = (responseAlgorithms = []) => {
    const validChecksumAlgorithms = [];
    for (const algorithm of PRIORITY_ORDER_ALGORITHMS) {
        if (!responseAlgorithms.includes(algorithm) || !CLIENT_SUPPORTED_ALGORITHMS.includes(algorithm)) {
            continue;
        }
        validChecksumAlgorithms.push(algorithm);
    }
    return validChecksumAlgorithms;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/validateChecksumFromResponse.js







const validateChecksumFromResponse_validateChecksumFromResponse = async (response, { config, responseAlgorithms, logger }) => {
    const checksumAlgorithms = getChecksumAlgorithmListForResponse(responseAlgorithms);
    const { body: responseBody, headers: responseHeaders } = response;
    for (const algorithm of checksumAlgorithms) {
        const responseHeader = getChecksumLocationName(algorithm);
        const checksumFromResponse = responseHeaders[responseHeader];
        if (checksumFromResponse) {
            let checksumAlgorithmFn;
            try {
                checksumAlgorithmFn = selectChecksumAlgorithmFunction(algorithm, config);
            }
            catch (error) {
                if (algorithm === ChecksumAlgorithm.CRC64NVME) {
                    logger?.warn(`Skipping ${ChecksumAlgorithm.CRC64NVME} checksum validation: ${error.message}`);
                    continue;
                }
                throw error;
            }
            const { base64Encoder } = config;
            if (isStreaming(responseBody)) {
                response.body = createChecksumStream({
                    expectedChecksum: checksumFromResponse,
                    checksumSourceLocation: responseHeader,
                    checksum: new checksumAlgorithmFn(),
                    source: responseBody,
                    base64Encoder,
                });
                return;
            }
            const checksum = await getChecksum(responseBody, { checksumAlgorithmFn, base64Encoder });
            if (checksum === checksumFromResponse) {
                break;
            }
            throw new Error(`Checksum mismatch: expected "${checksum}" but received "${checksumFromResponse}"` +
                ` in response header "${responseHeader}".`);
        }
    }
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/flexibleChecksumsResponseMiddleware.js





const flexibleChecksumsResponseMiddleware_flexibleChecksumsResponseMiddlewareOptions = {
    name: "flexibleChecksumsResponseMiddleware",
    toMiddleware: "deserializerMiddleware",
    relation: "after",
    tags: ["BODY_CHECKSUM"],
    override: true,
};
const flexibleChecksumsResponseMiddleware_flexibleChecksumsResponseMiddleware = (config, middlewareConfig) => (next, context) => async (args) => {
    if (!HttpRequest.isInstance(args.request)) {
        return next(args);
    }
    const input = args.input;
    const result = await next(args);
    const response = result.response;
    const { requestValidationModeMember, responseAlgorithms } = middlewareConfig;
    if (requestValidationModeMember && input[requestValidationModeMember] === "ENABLED") {
        const { clientName, commandName } = context;
        const isS3WholeObjectMultipartGetResponseChecksum = clientName === "S3Client" &&
            commandName === "GetObjectCommand" &&
            getChecksumAlgorithmListForResponse(responseAlgorithms).every((algorithm) => {
                const responseHeader = getChecksumLocationName(algorithm);
                const checksumFromResponse = response.headers[responseHeader];
                return !checksumFromResponse || isChecksumWithPartNumber(checksumFromResponse);
            });
        if (isS3WholeObjectMultipartGetResponseChecksum) {
            return result;
        }
        await validateChecksumFromResponse(response, {
            config,
            responseAlgorithms,
            logger: context.logger,
        });
    }
    return result;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/getFlexibleChecksumsPlugin.js



const getFlexibleChecksumsPlugin = (config, middlewareConfig) => ({
    applyToStack: (clientStack) => {
        clientStack.add(flexibleChecksumsMiddleware(config, middlewareConfig), flexibleChecksumsMiddlewareOptions);
        clientStack.addRelativeTo(flexibleChecksumsInputMiddleware(config, middlewareConfig), flexibleChecksumsInputMiddlewareOptions);
        clientStack.addRelativeTo(flexibleChecksumsResponseMiddleware(config, middlewareConfig), flexibleChecksumsResponseMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js

const getSmithyContext = (context) => context[middleware_SMITHY_CONTEXT_KEY] || (context[middleware_SMITHY_CONTEXT_KEY] = {});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js
const normalizeProvider_normalizeProvider = (input) => {
    if (typeof input === "function")
        return input;
    const promisified = Promise.resolve(input);
    return () => promisified;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-middleware/dist-es/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/resolveFlexibleChecksumsConfig.js


const resolveFlexibleChecksumsConfig = (input) => {
    const { requestChecksumCalculation, responseChecksumValidation, requestStreamBufferSize } = input;
    return Object.assign(input, {
        requestChecksumCalculation: normalizeProvider_normalizeProvider(requestChecksumCalculation ?? DEFAULT_REQUEST_CHECKSUM_CALCULATION),
        responseChecksumValidation: normalizeProvider_normalizeProvider(responseChecksumValidation ?? DEFAULT_RESPONSE_CHECKSUM_VALIDATION),
        requestStreamBufferSize: Number(requestStreamBufferSize ?? 0),
    });
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-flexible-checksums/dist-es/index.js








;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-host-header/dist-es/index.js

function resolveHostHeaderConfig(input) {
    return input;
}
const hostHeaderMiddleware = (options) => (next) => async (args) => {
    if (!httpRequest_HttpRequest.isInstance(args.request))
        return next(args);
    const { request } = args;
    const { handlerProtocol = "" } = options.requestHandler.metadata || {};
    if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
        delete request.headers["host"];
        request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
    }
    else if (!request.headers["host"]) {
        let host = request.hostname;
        if (request.port != null)
            host += `:${request.port}`;
        request.headers["host"] = host;
    }
    return next(args);
};
const hostHeaderMiddlewareOptions = {
    name: "hostHeaderMiddleware",
    step: "build",
    priority: "low",
    tags: ["HOST"],
    override: true,
};
const getHostHeaderPlugin = (options) => ({
    applyToStack: (clientStack) => {
        clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js
const loggerMiddleware = () => (next, context) => async (args) => {
    try {
        const response = await next(args);
        const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
        const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
        const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
        const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
        const { $metadata, ...outputWithoutMetadata } = response.output;
        logger?.info?.({
            clientName,
            commandName,
            input: inputFilterSensitiveLog(args.input),
            output: outputFilterSensitiveLog(outputWithoutMetadata),
            metadata: $metadata,
        });
        return response;
    }
    catch (error) {
        const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
        const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
        const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
        logger?.error?.({
            clientName,
            commandName,
            input: inputFilterSensitiveLog(args.input),
            error,
            metadata: error.$metadata,
        });
        throw error;
    }
};
const loggerMiddlewareOptions = {
    name: "loggerMiddleware",
    tags: ["LOGGER"],
    step: "initialize",
    override: true,
};
const getLoggerPlugin = (options) => ({
    applyToStack: (clientStack) => {
        clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-logger/dist-es/index.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js

const TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id";
const ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
const ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
const recursionDetectionMiddleware = (options) => (next) => async (args) => {
    const { request } = args;
    if (!httpRequest_HttpRequest.isInstance(request) || options.runtime !== "node") {
        return next(args);
    }
    const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ??
        TRACE_ID_HEADER_NAME;
    if (request.headers.hasOwnProperty(traceIdHeader)) {
        return next(args);
    }
    const functionName = ({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"})[ENV_LAMBDA_FUNCTION_NAME];
    const traceId = ({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"})[ENV_TRACE_ID];
    const nonEmptyString = (str) => typeof str === "string" && str.length > 0;
    if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
        request.headers[TRACE_ID_HEADER_NAME] = traceId;
    }
    return next({
        ...args,
        request,
    });
};
const addRecursionDetectionMiddlewareOptions = {
    step: "build",
    tags: ["RECURSION_DETECTION"],
    name: "recursionDetectionMiddleware",
    override: true,
    priority: "low",
};
const getRecursionDetectionPlugin = (options) => ({
    applyToStack: (clientStack) => {
        clientStack.add(recursionDetectionMiddleware(options), addRecursionDetectionMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js
const getAllAliases = (name, aliases) => {
    const _aliases = [];
    if (name) {
        _aliases.push(name);
    }
    if (aliases) {
        for (const alias of aliases) {
            _aliases.push(alias);
        }
    }
    return _aliases;
};
const getMiddlewareNameWithAliases = (name, aliases) => {
    return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`;
};
const constructStack = () => {
    let absoluteEntries = [];
    let relativeEntries = [];
    let identifyOnResolve = false;
    const entriesNameSet = new Set();
    const sort = (entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] ||
        priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]);
    const removeByName = (toRemove) => {
        let isRemoved = false;
        const filterCb = (entry) => {
            const aliases = getAllAliases(entry.name, entry.aliases);
            if (aliases.includes(toRemove)) {
                isRemoved = true;
                for (const alias of aliases) {
                    entriesNameSet.delete(alias);
                }
                return false;
            }
            return true;
        };
        absoluteEntries = absoluteEntries.filter(filterCb);
        relativeEntries = relativeEntries.filter(filterCb);
        return isRemoved;
    };
    const removeByReference = (toRemove) => {
        let isRemoved = false;
        const filterCb = (entry) => {
            if (entry.middleware === toRemove) {
                isRemoved = true;
                for (const alias of getAllAliases(entry.name, entry.aliases)) {
                    entriesNameSet.delete(alias);
                }
                return false;
            }
            return true;
        };
        absoluteEntries = absoluteEntries.filter(filterCb);
        relativeEntries = relativeEntries.filter(filterCb);
        return isRemoved;
    };
    const cloneTo = (toStack) => {
        absoluteEntries.forEach((entry) => {
            toStack.add(entry.middleware, { ...entry });
        });
        relativeEntries.forEach((entry) => {
            toStack.addRelativeTo(entry.middleware, { ...entry });
        });
        toStack.identifyOnResolve?.(stack.identifyOnResolve());
        return toStack;
    };
    const expandRelativeMiddlewareList = (from) => {
        const expandedMiddlewareList = [];
        from.before.forEach((entry) => {
            if (entry.before.length === 0 && entry.after.length === 0) {
                expandedMiddlewareList.push(entry);
            }
            else {
                expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
            }
        });
        expandedMiddlewareList.push(from);
        from.after.reverse().forEach((entry) => {
            if (entry.before.length === 0 && entry.after.length === 0) {
                expandedMiddlewareList.push(entry);
            }
            else {
                expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
            }
        });
        return expandedMiddlewareList;
    };
    const getMiddlewareList = (debug = false) => {
        const normalizedAbsoluteEntries = [];
        const normalizedRelativeEntries = [];
        const normalizedEntriesNameMap = {};
        absoluteEntries.forEach((entry) => {
            const normalizedEntry = {
                ...entry,
                before: [],
                after: [],
            };
            for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
                normalizedEntriesNameMap[alias] = normalizedEntry;
            }
            normalizedAbsoluteEntries.push(normalizedEntry);
        });
        relativeEntries.forEach((entry) => {
            const normalizedEntry = {
                ...entry,
                before: [],
                after: [],
            };
            for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
                normalizedEntriesNameMap[alias] = normalizedEntry;
            }
            normalizedRelativeEntries.push(normalizedEntry);
        });
        normalizedRelativeEntries.forEach((entry) => {
            if (entry.toMiddleware) {
                const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];
                if (toMiddleware === undefined) {
                    if (debug) {
                        return;
                    }
                    throw new Error(`${entry.toMiddleware} is not found when adding ` +
                        `${getMiddlewareNameWithAliases(entry.name, entry.aliases)} ` +
                        `middleware ${entry.relation} ${entry.toMiddleware}`);
                }
                if (entry.relation === "after") {
                    toMiddleware.after.push(entry);
                }
                if (entry.relation === "before") {
                    toMiddleware.before.push(entry);
                }
            }
        });
        const mainChain = sort(normalizedAbsoluteEntries)
            .map(expandRelativeMiddlewareList)
            .reduce((wholeList, expandedMiddlewareList) => {
            wholeList.push(...expandedMiddlewareList);
            return wholeList;
        }, []);
        return mainChain;
    };
    const stack = {
        add: (middleware, options = {}) => {
            const { name, override, aliases: _aliases } = options;
            const entry = {
                step: "initialize",
                priority: "normal",
                middleware,
                ...options,
            };
            const aliases = getAllAliases(name, _aliases);
            if (aliases.length > 0) {
                if (aliases.some((alias) => entriesNameSet.has(alias))) {
                    if (!override)
                        throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
                    for (const alias of aliases) {
                        const toOverrideIndex = absoluteEntries.findIndex((entry) => entry.name === alias || entry.aliases?.some((a) => a === alias));
                        if (toOverrideIndex === -1) {
                            continue;
                        }
                        const toOverride = absoluteEntries[toOverrideIndex];
                        if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) {
                            throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ` +
                                `${toOverride.priority} priority in ${toOverride.step} step cannot ` +
                                `be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ` +
                                `${entry.priority} priority in ${entry.step} step.`);
                        }
                        absoluteEntries.splice(toOverrideIndex, 1);
                    }
                }
                for (const alias of aliases) {
                    entriesNameSet.add(alias);
                }
            }
            absoluteEntries.push(entry);
        },
        addRelativeTo: (middleware, options) => {
            const { name, override, aliases: _aliases } = options;
            const entry = {
                middleware,
                ...options,
            };
            const aliases = getAllAliases(name, _aliases);
            if (aliases.length > 0) {
                if (aliases.some((alias) => entriesNameSet.has(alias))) {
                    if (!override)
                        throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
                    for (const alias of aliases) {
                        const toOverrideIndex = relativeEntries.findIndex((entry) => entry.name === alias || entry.aliases?.some((a) => a === alias));
                        if (toOverrideIndex === -1) {
                            continue;
                        }
                        const toOverride = relativeEntries[toOverrideIndex];
                        if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {
                            throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ` +
                                `${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden ` +
                                `by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} ` +
                                `"${entry.toMiddleware}" middleware.`);
                        }
                        relativeEntries.splice(toOverrideIndex, 1);
                    }
                }
                for (const alias of aliases) {
                    entriesNameSet.add(alias);
                }
            }
            relativeEntries.push(entry);
        },
        clone: () => cloneTo(constructStack()),
        use: (plugin) => {
            plugin.applyToStack(stack);
        },
        remove: (toRemove) => {
            if (typeof toRemove === "string")
                return removeByName(toRemove);
            else
                return removeByReference(toRemove);
        },
        removeByTag: (toRemove) => {
            let isRemoved = false;
            const filterCb = (entry) => {
                const { tags, name, aliases: _aliases } = entry;
                if (tags && tags.includes(toRemove)) {
                    const aliases = getAllAliases(name, _aliases);
                    for (const alias of aliases) {
                        entriesNameSet.delete(alias);
                    }
                    isRemoved = true;
                    return false;
                }
                return true;
            };
            absoluteEntries = absoluteEntries.filter(filterCb);
            relativeEntries = relativeEntries.filter(filterCb);
            return isRemoved;
        },
        concat: (from) => {
            const cloned = cloneTo(constructStack());
            cloned.use(from);
            cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false));
            return cloned;
        },
        applyToStack: cloneTo,
        identify: () => {
            return getMiddlewareList(true).map((mw) => {
                const step = mw.step ??
                    mw.relation +
                        " " +
                        mw.toMiddleware;
                return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step;
            });
        },
        identifyOnResolve(toggle) {
            if (typeof toggle === "boolean")
                identifyOnResolve = toggle;
            return identifyOnResolve;
        },
        resolve: (handler, context) => {
            for (const middleware of getMiddlewareList()
                .map((entry) => entry.middleware)
                .reverse()) {
                handler = middleware(handler, context);
            }
            if (identifyOnResolve) {
                console.log(stack.identify());
            }
            return handler;
        },
    };
    return stack;
};
const stepWeights = {
    initialize: 5,
    serialize: 4,
    build: 3,
    finalizeRequest: 2,
    deserialize: 1,
};
const priorityWeights = {
    high: 3,
    normal: 2,
    low: 1,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-stack/dist-es/index.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/client.js

class Client {
    constructor(config) {
        this.config = config;
        this.middlewareStack = constructStack();
    }
    send(command, optionsOrCb, cb) {
        const options = typeof optionsOrCb !== "function" ? optionsOrCb : undefined;
        const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb;
        const useHandlerCache = options === undefined && this.config.cacheMiddleware === true;
        let handler;
        if (useHandlerCache) {
            if (!this.handlers) {
                this.handlers = new WeakMap();
            }
            const handlers = this.handlers;
            if (handlers.has(command.constructor)) {
                handler = handlers.get(command.constructor);
            }
            else {
                handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
                handlers.set(command.constructor, handler);
            }
        }
        else {
            delete this.handlers;
            handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
        }
        if (callback) {
            handler(command)
                .then((result) => callback(null, result.output), (err) => callback(err))
                .catch(() => { });
        }
        else {
            return handler(command).then((result) => result.output);
        }
    }
    destroy() {
        this.config?.requestHandler?.destroy?.();
        delete this.handlers;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js

const collect_stream_body_collectBody = async (streamBody = new Uint8Array(), context) => {
    if (streamBody instanceof Uint8Array) {
        return Uint8ArrayBlobAdapter.mutate(streamBody);
    }
    if (!streamBody) {
        return Uint8ArrayBlobAdapter.mutate(new Uint8Array());
    }
    const fromContext = context.streamCollector(streamBody);
    return Uint8ArrayBlobAdapter.mutate(await fromContext);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js
function extendedEncodeURIComponent(str) {
    return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
        return "%" + c.charCodeAt(0).toString(16).toUpperCase();
    });
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js

const resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
    if (input != null && input[memberName] !== undefined) {
        const labelValue = labelValueProvider();
        if (labelValue.length <= 0) {
            throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
        }
        resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel
            ? labelValue
                .split("/")
                .map((segment) => extendedEncodeURIComponent(segment))
                .join("/")
            : extendedEncodeURIComponent(labelValue));
    }
    else {
        throw new Error("No value provided for input HTTP label: " + memberName + ".");
    }
    return resolvedPath;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js


function requestBuilder(input, context) {
    return new RequestBuilder(input, context);
}
class RequestBuilder {
    constructor(input, context) {
        this.input = input;
        this.context = context;
        this.query = {};
        this.method = "";
        this.headers = {};
        this.path = "";
        this.body = null;
        this.hostname = "";
        this.resolvePathStack = [];
    }
    async build() {
        const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
        this.path = basePath;
        for (const resolvePath of this.resolvePathStack) {
            resolvePath(this.path);
        }
        return new httpRequest_HttpRequest({
            protocol,
            hostname: this.hostname || hostname,
            port,
            method: this.method,
            path: this.path,
            query: this.query,
            body: this.body,
            headers: this.headers,
        });
    }
    hn(hostname) {
        this.hostname = hostname;
        return this;
    }
    bp(uriLabel) {
        this.resolvePathStack.push((basePath) => {
            this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
        });
        return this;
    }
    p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
        this.resolvePathStack.push((path) => {
            this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
        });
        return this;
    }
    h(headers) {
        this.headers = headers;
        return this;
    }
    q(query) {
        this.query = query;
        return this;
    }
    b(body) {
        this.body = body;
        return this;
    }
    m(method) {
        this.method = method;
        return this;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/submodules/protocols/index.js





;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/command.js


class Command {
    constructor() {
        this.middlewareStack = constructStack();
    }
    static classBuilder() {
        return new ClassBuilder();
    }
    resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor, }) {
        for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) {
            this.middlewareStack.use(mw);
        }
        const stack = clientStack.concat(this.middlewareStack);
        const { logger } = configuration;
        const handlerExecutionContext = {
            logger,
            clientName,
            commandName,
            inputFilterSensitiveLog,
            outputFilterSensitiveLog,
            [middleware_SMITHY_CONTEXT_KEY]: {
                commandInstance: this,
                ...smithyContext,
            },
            ...additionalContext,
        };
        const { requestHandler } = configuration;
        return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
    }
}
class ClassBuilder {
    constructor() {
        this._init = () => { };
        this._ep = {};
        this._middlewareFn = () => [];
        this._commandName = "";
        this._clientName = "";
        this._additionalContext = {};
        this._smithyContext = {};
        this._inputFilterSensitiveLog = (_) => _;
        this._outputFilterSensitiveLog = (_) => _;
        this._serializer = null;
        this._deserializer = null;
    }
    init(cb) {
        this._init = cb;
    }
    ep(endpointParameterInstructions) {
        this._ep = endpointParameterInstructions;
        return this;
    }
    m(middlewareSupplier) {
        this._middlewareFn = middlewareSupplier;
        return this;
    }
    s(service, operation, smithyContext = {}) {
        this._smithyContext = {
            service,
            operation,
            ...smithyContext,
        };
        return this;
    }
    c(additionalContext = {}) {
        this._additionalContext = additionalContext;
        return this;
    }
    n(clientName, commandName) {
        this._clientName = clientName;
        this._commandName = commandName;
        return this;
    }
    f(inputFilter = (_) => _, outputFilter = (_) => _) {
        this._inputFilterSensitiveLog = inputFilter;
        this._outputFilterSensitiveLog = outputFilter;
        return this;
    }
    ser(serializer) {
        this._serializer = serializer;
        return this;
    }
    de(deserializer) {
        this._deserializer = deserializer;
        return this;
    }
    build() {
        const closure = this;
        let CommandRef;
        return (CommandRef = class extends Command {
            static getEndpointParameterInstructions() {
                return closure._ep;
            }
            constructor(...[input]) {
                super();
                this.serialize = closure._serializer;
                this.deserialize = closure._deserializer;
                this.input = input ?? {};
                closure._init(this);
            }
            resolveMiddleware(stack, configuration, options) {
                return this.resolveMiddlewareWithContext(stack, configuration, options, {
                    CommandCtor: CommandRef,
                    middlewareFn: closure._middlewareFn,
                    clientName: closure._clientName,
                    commandName: closure._commandName,
                    inputFilterSensitiveLog: closure._inputFilterSensitiveLog,
                    outputFilterSensitiveLog: closure._outputFilterSensitiveLog,
                    smithyContext: closure._smithyContext,
                    additionalContext: closure._additionalContext,
                });
            }
        });
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/constants.js
const constants_SENSITIVE_STRING = "***SensitiveInformation***";

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/parse-utils.js
const parseBoolean = (value) => {
    switch (value) {
        case "true":
            return true;
        case "false":
            return false;
        default:
            throw new Error(`Unable to parse boolean value "${value}"`);
    }
};
const expectBoolean = (value) => {
    if (value === null || value === undefined) {
        return undefined;
    }
    if (typeof value === "number") {
        if (value === 0 || value === 1) {
            logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
        }
        if (value === 0) {
            return false;
        }
        if (value === 1) {
            return true;
        }
    }
    if (typeof value === "string") {
        const lower = value.toLowerCase();
        if (lower === "false" || lower === "true") {
            logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
        }
        if (lower === "false") {
            return false;
        }
        if (lower === "true") {
            return true;
        }
    }
    if (typeof value === "boolean") {
        return value;
    }
    throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`);
};
const expectNumber = (value) => {
    if (value === null || value === undefined) {
        return undefined;
    }
    if (typeof value === "string") {
        const parsed = parseFloat(value);
        if (!Number.isNaN(parsed)) {
            if (String(parsed) !== String(value)) {
                logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));
            }
            return parsed;
        }
    }
    if (typeof value === "number") {
        return value;
    }
    throw new TypeError(`Expected number, got ${typeof value}: ${value}`);
};
const MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
const expectFloat32 = (value) => {
    const expected = expectNumber(value);
    if (expected !== undefined && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {
        if (Math.abs(expected) > MAX_FLOAT) {
            throw new TypeError(`Expected 32-bit float, got ${value}`);
        }
    }
    return expected;
};
const expectLong = (value) => {
    if (value === null || value === undefined) {
        return undefined;
    }
    if (Number.isInteger(value) && !Number.isNaN(value)) {
        return value;
    }
    throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);
};
const expectInt = (/* unused pure expression or super */ null && (expectLong));
const expectInt32 = (value) => expectSizedInt(value, 32);
const expectShort = (value) => expectSizedInt(value, 16);
const expectByte = (value) => expectSizedInt(value, 8);
const expectSizedInt = (value, size) => {
    const expected = expectLong(value);
    if (expected !== undefined && castInt(expected, size) !== expected) {
        throw new TypeError(`Expected ${size}-bit integer, got ${value}`);
    }
    return expected;
};
const castInt = (value, size) => {
    switch (size) {
        case 32:
            return Int32Array.of(value)[0];
        case 16:
            return Int16Array.of(value)[0];
        case 8:
            return Int8Array.of(value)[0];
    }
};
const expectNonNull = (value, location) => {
    if (value === null || value === undefined) {
        if (location) {
            throw new TypeError(`Expected a non-null value for ${location}`);
        }
        throw new TypeError("Expected a non-null value");
    }
    return value;
};
const expectObject = (value) => {
    if (value === null || value === undefined) {
        return undefined;
    }
    if (typeof value === "object" && !Array.isArray(value)) {
        return value;
    }
    const receivedType = Array.isArray(value) ? "array" : typeof value;
    throw new TypeError(`Expected object, got ${receivedType}: ${value}`);
};
const expectString = (value) => {
    if (value === null || value === undefined) {
        return undefined;
    }
    if (typeof value === "string") {
        return value;
    }
    if (["boolean", "number", "bigint"].includes(typeof value)) {
        logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));
        return String(value);
    }
    throw new TypeError(`Expected string, got ${typeof value}: ${value}`);
};
const expectUnion = (value) => {
    if (value === null || value === undefined) {
        return undefined;
    }
    const asObject = expectObject(value);
    const setKeys = Object.entries(asObject)
        .filter(([, v]) => v != null)
        .map(([k]) => k);
    if (setKeys.length === 0) {
        throw new TypeError(`Unions must have exactly one non-null member. None were found.`);
    }
    if (setKeys.length > 1) {
        throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`);
    }
    return asObject;
};
const parse_utils_strictParseDouble = (value) => {
    if (typeof value == "string") {
        return expectNumber(parseNumber(value));
    }
    return expectNumber(value);
};
const strictParseFloat = (/* unused pure expression or super */ null && (parse_utils_strictParseDouble));
const strictParseFloat32 = (value) => {
    if (typeof value == "string") {
        return expectFloat32(parseNumber(value));
    }
    return expectFloat32(value);
};
const NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
const parseNumber = (value) => {
    const matches = value.match(NUMBER_REGEX);
    if (matches === null || matches[0].length !== value.length) {
        throw new TypeError(`Expected real number, got implicit NaN`);
    }
    return parseFloat(value);
};
const limitedParseDouble = (value) => {
    if (typeof value == "string") {
        return parseFloatString(value);
    }
    return expectNumber(value);
};
const handleFloat = (/* unused pure expression or super */ null && (limitedParseDouble));
const limitedParseFloat = (/* unused pure expression or super */ null && (limitedParseDouble));
const limitedParseFloat32 = (value) => {
    if (typeof value == "string") {
        return parseFloatString(value);
    }
    return expectFloat32(value);
};
const parseFloatString = (value) => {
    switch (value) {
        case "NaN":
            return NaN;
        case "Infinity":
            return Infinity;
        case "-Infinity":
            return -Infinity;
        default:
            throw new Error(`Unable to parse float value: ${value}`);
    }
};
const strictParseLong = (value) => {
    if (typeof value === "string") {
        return expectLong(parseNumber(value));
    }
    return expectLong(value);
};
const strictParseInt = (/* unused pure expression or super */ null && (strictParseLong));
const strictParseInt32 = (value) => {
    if (typeof value === "string") {
        return expectInt32(parseNumber(value));
    }
    return expectInt32(value);
};
const parse_utils_strictParseShort = (value) => {
    if (typeof value === "string") {
        return expectShort(parseNumber(value));
    }
    return expectShort(value);
};
const strictParseByte = (value) => {
    if (typeof value === "string") {
        return expectByte(parseNumber(value));
    }
    return expectByte(value);
};
const stackTraceWarning = (message) => {
    return String(new TypeError(message).stack || message)
        .split("\n")
        .slice(0, 5)
        .filter((s) => !s.includes("stackTraceWarning"))
        .join("\n");
};
const logger = {
    warn: console.warn,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/date-utils.js

const DAYS = (/* unused pure expression or super */ null && (["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]));
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
function dateToUtcString(date) {
    const year = date.getUTCFullYear();
    const month = date.getUTCMonth();
    const dayOfWeek = date.getUTCDay();
    const dayOfMonthInt = date.getUTCDate();
    const hoursInt = date.getUTCHours();
    const minutesInt = date.getUTCMinutes();
    const secondsInt = date.getUTCSeconds();
    const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;
    const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;
    const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;
    const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;
    return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`;
}
const RFC3339 = (/* unused pure expression or super */ null && (new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/)));
const parseRfc3339DateTime = (value) => {
    if (value === null || value === undefined) {
        return undefined;
    }
    if (typeof value !== "string") {
        throw new TypeError("RFC-3339 date-times must be expressed as strings");
    }
    const match = RFC3339.exec(value);
    if (!match) {
        throw new TypeError("Invalid RFC-3339 date-time value");
    }
    const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;
    const year = strictParseShort(stripLeadingZeroes(yearStr));
    const month = parseDateValue(monthStr, "month", 1, 12);
    const day = parseDateValue(dayStr, "day", 1, 31);
    return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
};
const RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/);
const parseRfc3339DateTimeWithOffset = (value) => {
    if (value === null || value === undefined) {
        return undefined;
    }
    if (typeof value !== "string") {
        throw new TypeError("RFC-3339 date-times must be expressed as strings");
    }
    const match = RFC3339_WITH_OFFSET.exec(value);
    if (!match) {
        throw new TypeError("Invalid RFC-3339 date-time value");
    }
    const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;
    const year = parse_utils_strictParseShort(stripLeadingZeroes(yearStr));
    const month = parseDateValue(monthStr, "month", 1, 12);
    const day = parseDateValue(dayStr, "day", 1, 31);
    const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
    if (offsetStr.toUpperCase() != "Z") {
        date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr));
    }
    return date;
};
const IMF_FIXDATE = (/* unused pure expression or super */ null && (new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/)));
const RFC_850_DATE = (/* unused pure expression or super */ null && (new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/)));
const ASC_TIME = (/* unused pure expression or super */ null && (new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/)));
const date_utils_parseRfc7231DateTime = (value) => {
    if (value === null || value === undefined) {
        return undefined;
    }
    if (typeof value !== "string") {
        throw new TypeError("RFC-7231 date-times must be expressed as strings");
    }
    let match = IMF_FIXDATE.exec(value);
    if (match) {
        const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
        return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
    }
    match = RFC_850_DATE.exec(value);
    if (match) {
        const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
        return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), {
            hours,
            minutes,
            seconds,
            fractionalMilliseconds,
        }));
    }
    match = ASC_TIME.exec(value);
    if (match) {
        const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;
        return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
    }
    throw new TypeError("Invalid RFC-7231 date-time value");
};
const parseEpochTimestamp = (value) => {
    if (value === null || value === undefined) {
        return undefined;
    }
    let valueAsDouble;
    if (typeof value === "number") {
        valueAsDouble = value;
    }
    else if (typeof value === "string") {
        valueAsDouble = strictParseDouble(value);
    }
    else if (typeof value === "object" && value.tag === 1) {
        valueAsDouble = value.value;
    }
    else {
        throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");
    }
    if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) {
        throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");
    }
    return new Date(Math.round(valueAsDouble * 1000));
};
const buildDate = (year, month, day, time) => {
    const adjustedMonth = month - 1;
    validateDayOfMonth(year, adjustedMonth, day);
    return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time.hours, "hour", 0, 23), parseDateValue(time.minutes, "minute", 0, 59), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds)));
};
const parseTwoDigitYear = (value) => {
    const thisYear = new Date().getUTCFullYear();
    const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value));
    if (valueInThisCentury < thisYear) {
        return valueInThisCentury + 100;
    }
    return valueInThisCentury;
};
const FIFTY_YEARS_IN_MILLIS = (/* unused pure expression or super */ null && (50 * 365 * 24 * 60 * 60 * 1000));
const adjustRfc850Year = (input) => {
    if (input.getTime() - new Date().getTime() > FIFTY_YEARS_IN_MILLIS) {
        return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds()));
    }
    return input;
};
const parseMonthByShortName = (value) => {
    const monthIdx = MONTHS.indexOf(value);
    if (monthIdx < 0) {
        throw new TypeError(`Invalid month: ${value}`);
    }
    return monthIdx + 1;
};
const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
const validateDayOfMonth = (year, month, day) => {
    let maxDays = DAYS_IN_MONTH[month];
    if (month === 1 && isLeapYear(year)) {
        maxDays = 29;
    }
    if (day > maxDays) {
        throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);
    }
};
const isLeapYear = (year) => {
    return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
};
const parseDateValue = (value, type, lower, upper) => {
    const dateVal = strictParseByte(stripLeadingZeroes(value));
    if (dateVal < lower || dateVal > upper) {
        throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
    }
    return dateVal;
};
const parseMilliseconds = (value) => {
    if (value === null || value === undefined) {
        return 0;
    }
    return strictParseFloat32("0." + value) * 1000;
};
const parseOffsetToMilliseconds = (value) => {
    const directionStr = value[0];
    let direction = 1;
    if (directionStr == "+") {
        direction = 1;
    }
    else if (directionStr == "-") {
        direction = -1;
    }
    else {
        throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`);
    }
    const hour = Number(value.substring(1, 3));
    const minute = Number(value.substring(4, 6));
    return direction * (hour * 60 + minute) * 60 * 1000;
};
const stripLeadingZeroes = (value) => {
    let idx = 0;
    while (idx < value.length - 1 && value.charAt(idx) === "0") {
        idx++;
    }
    if (idx === 0) {
        return value;
    }
    return value.slice(idx);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/exceptions.js
class ServiceException extends Error {
    constructor(options) {
        super(options.message);
        Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype);
        this.name = options.name;
        this.$fault = options.$fault;
        this.$metadata = options.$metadata;
    }
    static isInstance(value) {
        if (!value)
            return false;
        const candidate = value;
        return (ServiceException.prototype.isPrototypeOf(candidate) ||
            (Boolean(candidate.$fault) &&
                Boolean(candidate.$metadata) &&
                (candidate.$fault === "client" || candidate.$fault === "server")));
    }
    static [Symbol.hasInstance](instance) {
        if (!instance)
            return false;
        const candidate = instance;
        if (this === ServiceException) {
            return ServiceException.isInstance(instance);
        }
        if (ServiceException.isInstance(instance)) {
            if (candidate.name && this.name) {
                return this.prototype.isPrototypeOf(instance) || candidate.name === this.name;
            }
            return this.prototype.isPrototypeOf(instance);
        }
        return false;
    }
}
const decorateServiceException = (exception, additions = {}) => {
    Object.entries(additions)
        .filter(([, v]) => v !== undefined)
        .forEach(([k, v]) => {
        if (exception[k] == undefined || exception[k] === "") {
            exception[k] = v;
        }
    });
    const message = exception.message || exception.Message || "UnknownError";
    exception.message = message;
    delete exception.Message;
    return exception;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/default-error-handler.js

const throwDefaultError = ({ output, parsedBody, exceptionCtor, errorCode }) => {
    const $metadata = deserializeMetadata(output);
    const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
    const response = new exceptionCtor({
        name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError",
        $fault: "client",
        $metadata,
    });
    throw decorateServiceException(response, parsedBody);
};
const withBaseException = (ExceptionCtor) => {
    return ({ output, parsedBody, errorCode }) => {
        throwDefaultError({ output, parsedBody, exceptionCtor: ExceptionCtor, errorCode });
    };
};
const deserializeMetadata = (output) => ({
    httpStatusCode: output.statusCode,
    requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
    extendedRequestId: output.headers["x-amz-id-2"],
    cfId: output.headers["x-amz-cf-id"],
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/defaults-mode.js
const loadConfigsForDefaultMode = (mode) => {
    switch (mode) {
        case "standard":
            return {
                retryMode: "standard",
                connectionTimeout: 3100,
            };
        case "in-region":
            return {
                retryMode: "standard",
                connectionTimeout: 1100,
            };
        case "cross-region":
            return {
                retryMode: "standard",
                connectionTimeout: 3100,
            };
        case "mobile":
            return {
                retryMode: "standard",
                connectionTimeout: 30000,
            };
        default:
            return {};
    }
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/extended-encode-uri-component.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js


const extensions_checksum_getChecksumConfiguration = (runtimeConfig) => {
    const checksumAlgorithms = [];
    for (const id in AlgorithmId) {
        const algorithmId = AlgorithmId[id];
        if (runtimeConfig[algorithmId] === undefined) {
            continue;
        }
        checksumAlgorithms.push({
            algorithmId: () => algorithmId,
            checksumConstructor: () => runtimeConfig[algorithmId],
        });
    }
    return {
        addChecksumAlgorithm(algo) {
            checksumAlgorithms.push(algo);
        },
        checksumAlgorithms() {
            return checksumAlgorithms;
        },
    };
};
const extensions_checksum_resolveChecksumRuntimeConfig = (clientConfig) => {
    const runtimeConfig = {};
    clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
        runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
    });
    return runtimeConfig;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/extensions/retry.js
const getRetryConfiguration = (runtimeConfig) => {
    return {
        setRetryStrategy(retryStrategy) {
            runtimeConfig.retryStrategy = retryStrategy;
        },
        retryStrategy() {
            return runtimeConfig.retryStrategy;
        },
    };
};
const resolveRetryRuntimeConfig = (retryStrategyConfiguration) => {
    const runtimeConfig = {};
    runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy();
    return runtimeConfig;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js


const getDefaultExtensionConfiguration = (runtimeConfig) => {
    return Object.assign(extensions_checksum_getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig));
};
const defaultExtensionConfiguration_getDefaultClientConfiguration = (/* unused pure expression or super */ null && (getDefaultExtensionConfiguration));
const defaultExtensionConfiguration_resolveDefaultRuntimeConfig = (config) => {
    return Object.assign(extensions_checksum_resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config));
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/extensions/index.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js
const getValueFromTextNode = (obj) => {
    const textNodeName = "#text";
    for (const key in obj) {
        if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== undefined) {
            obj[key] = obj[key][textNodeName];
        }
        else if (typeof obj[key] === "object" && obj[key] !== null) {
            obj[key] = getValueFromTextNode(obj[key]);
        }
    }
    return obj;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/is-serializable-header-value.js
const is_serializable_header_value_isSerializableHeaderValue = (value) => {
    return value != null;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/lazy-json.js
const LazyJsonString = function LazyJsonString(val) {
    const str = Object.assign(new String(val), {
        deserializeJSON() {
            return JSON.parse(String(val));
        },
        toString() {
            return String(val);
        },
        toJSON() {
            return String(val);
        },
    });
    return str;
};
LazyJsonString.from = (object) => {
    if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) {
        return object;
    }
    else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) {
        return LazyJsonString(String(object));
    }
    return LazyJsonString(JSON.stringify(object));
};
LazyJsonString.fromObject = LazyJsonString.from;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js
class NoOpLogger_NoOpLogger {
    trace() { }
    debug() { }
    info() { }
    warn() { }
    error() { }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/object-mapping.js
function object_mapping_map(arg0, arg1, arg2) {
    let target;
    let filter;
    let instructions;
    if (typeof arg1 === "undefined" && typeof arg2 === "undefined") {
        target = {};
        instructions = arg0;
    }
    else {
        target = arg0;
        if (typeof arg1 === "function") {
            filter = arg1;
            instructions = arg2;
            return mapWithFilter(target, filter, instructions);
        }
        else {
            instructions = arg1;
        }
    }
    for (const key of Object.keys(instructions)) {
        if (!Array.isArray(instructions[key])) {
            target[key] = instructions[key];
            continue;
        }
        applyInstruction(target, null, instructions, key);
    }
    return target;
}
const convertMap = (target) => {
    const output = {};
    for (const [k, v] of Object.entries(target || {})) {
        output[k] = [, v];
    }
    return output;
};
const take = (source, instructions) => {
    const out = {};
    for (const key in instructions) {
        applyInstruction(out, source, instructions, key);
    }
    return out;
};
const mapWithFilter = (target, filter, instructions) => {
    return object_mapping_map(target, Object.entries(instructions).reduce((_instructions, [key, value]) => {
        if (Array.isArray(value)) {
            _instructions[key] = value;
        }
        else {
            if (typeof value === "function") {
                _instructions[key] = [filter, value()];
            }
            else {
                _instructions[key] = [filter, value];
            }
        }
        return _instructions;
    }, {}));
};
const applyInstruction = (target, source, instructions, targetKey) => {
    if (source !== null) {
        let instruction = instructions[targetKey];
        if (typeof instruction === "function") {
            instruction = [, instruction];
        }
        const [filter = nonNullish, valueFn = pass, sourceKey = targetKey] = instruction;
        if ((typeof filter === "function" && filter(source[sourceKey])) || (typeof filter !== "function" && !!filter)) {
            target[targetKey] = valueFn(source[sourceKey]);
        }
        return;
    }
    let [filter, value] = instructions[targetKey];
    if (typeof value === "function") {
        let _value;
        const defaultFilterPassed = filter === undefined && (_value = value()) != null;
        const customFilterPassed = (typeof filter === "function" && !!filter(void 0)) || (typeof filter !== "function" && !!filter);
        if (defaultFilterPassed) {
            target[targetKey] = _value;
        }
        else if (customFilterPassed) {
            target[targetKey] = value();
        }
    }
    else {
        const defaultFilterPassed = filter === undefined && value != null;
        const customFilterPassed = (typeof filter === "function" && !!filter(value)) || (typeof filter !== "function" && !!filter);
        if (defaultFilterPassed || customFilterPassed) {
            target[targetKey] = value;
        }
    }
};
const nonNullish = (_) => _ != null;
const pass = (_) => _;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/resolve-path.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/smithy-client/dist-es/index.js


























;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/check-content-length-header.js


const CONTENT_LENGTH_HEADER = "content-length";
const DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length";
function checkContentLengthHeader() {
    return (next, context) => async (args) => {
        const { request } = args;
        if (HttpRequest.isInstance(request)) {
            if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) {
                const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`;
                if (typeof context?.logger?.warn === "function" && !(context.logger instanceof NoOpLogger)) {
                    context.logger.warn(message);
                }
                else {
                    console.warn(message);
                }
            }
        }
        return next({ ...args });
    };
}
const checkContentLengthHeaderMiddlewareOptions = {
    step: "finalizeRequest",
    tags: ["CHECK_CONTENT_LENGTH_HEADER"],
    name: "getCheckContentLengthHeaderPlugin",
    override: true,
};
const getCheckContentLengthHeaderPlugin = (unused) => ({
    applyToStack: (clientStack) => {
        clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-endpoint-middleware.js
const regionRedirectEndpointMiddleware = (config) => {
    return (next, context) => async (args) => {
        const originalRegion = await config.region();
        const regionProviderRef = config.region;
        let unlock = () => { };
        if (context.__s3RegionRedirect) {
            Object.defineProperty(config, "region", {
                writable: false,
                value: async () => {
                    return context.__s3RegionRedirect;
                },
            });
            unlock = () => Object.defineProperty(config, "region", {
                writable: true,
                value: regionProviderRef,
            });
        }
        try {
            const result = await next(args);
            if (context.__s3RegionRedirect) {
                unlock();
                const region = await config.region();
                if (originalRegion !== region) {
                    throw new Error("Region was not restored following S3 region redirect.");
                }
            }
            return result;
        }
        catch (e) {
            unlock();
            throw e;
        }
    };
};
const regionRedirectEndpointMiddlewareOptions = {
    tags: ["REGION_REDIRECT", "S3"],
    name: "regionRedirectEndpointMiddleware",
    override: true,
    relation: "before",
    toMiddleware: "endpointV2Middleware",
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-middleware.js

function regionRedirectMiddleware(clientConfig) {
    return (next, context) => async (args) => {
        try {
            return await next(args);
        }
        catch (err) {
            if (clientConfig.followRegionRedirects) {
                if (err?.$metadata?.httpStatusCode === 301 ||
                    (err?.$metadata?.httpStatusCode === 400 && err?.name === "IllegalLocationConstraintException")) {
                    try {
                        const actualRegion = err.$response.headers["x-amz-bucket-region"];
                        context.logger?.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`);
                        context.__s3RegionRedirect = actualRegion;
                    }
                    catch (e) {
                        throw new Error("Region redirect failed: " + e);
                    }
                    return next(args);
                }
            }
            throw err;
        }
    };
}
const regionRedirectMiddlewareOptions = {
    step: "initialize",
    tags: ["REGION_REDIRECT", "S3"],
    name: "regionRedirectMiddleware",
    override: true,
};
const getRegionRedirectMiddlewarePlugin = (clientConfig) => ({
    applyToStack: (clientStack) => {
        clientStack.add(regionRedirectMiddleware(clientConfig), regionRedirectMiddlewareOptions);
        clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig), regionRedirectEndpointMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-expires-middleware.js


const s3ExpiresMiddleware = (config) => {
    return (next, context) => async (args) => {
        const result = await next(args);
        const { response } = result;
        if (HttpResponse.isInstance(response)) {
            if (response.headers.expires) {
                response.headers.expiresstring = response.headers.expires;
                try {
                    parseRfc7231DateTime(response.headers.expires);
                }
                catch (e) {
                    context.logger?.warn(`AWS SDK Warning for ${context.clientName}::${context.commandName} response parsing (${response.headers.expires}): ${e}`);
                    delete response.headers.expires;
                }
            }
        }
        return result;
    };
};
const s3ExpiresMiddlewareOptions = {
    tags: ["S3"],
    name: "s3ExpiresMiddleware",
    override: true,
    relation: "after",
    toMiddleware: "deserializerMiddleware",
};
const getS3ExpiresMiddlewarePlugin = (clientConfig) => ({
    applyToStack: (clientStack) => {
        clientStack.addRelativeTo(s3ExpiresMiddleware(clientConfig), s3ExpiresMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCache.js
class S3ExpressIdentityCache {
    data;
    lastPurgeTime = Date.now();
    static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 30000;
    constructor(data = {}) {
        this.data = data;
    }
    get(key) {
        const entry = this.data[key];
        if (!entry) {
            return;
        }
        return entry;
    }
    set(key, entry) {
        this.data[key] = entry;
        return entry;
    }
    delete(key) {
        delete this.data[key];
    }
    async purgeExpired() {
        const now = Date.now();
        if (this.lastPurgeTime + S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) {
            return;
        }
        for (const key in this.data) {
            const entry = this.data[key];
            if (!entry.isRefreshing) {
                const credential = await entry.identity;
                if (credential.expiration) {
                    if (credential.expiration.getTime() < now) {
                        delete this.data[key];
                    }
                }
            }
        }
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCacheEntry.js
class S3ExpressIdentityCacheEntry {
    _identity;
    isRefreshing;
    accessed;
    constructor(_identity, isRefreshing = false, accessed = Date.now()) {
        this._identity = _identity;
        this.isRefreshing = isRefreshing;
        this.accessed = accessed;
    }
    get identity() {
        this.accessed = Date.now();
        return this._identity;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityProviderImpl.js


class S3ExpressIdentityProviderImpl {
    createSessionFn;
    cache;
    static REFRESH_WINDOW_MS = 60000;
    constructor(createSessionFn, cache = new S3ExpressIdentityCache()) {
        this.createSessionFn = createSessionFn;
        this.cache = cache;
    }
    async getS3ExpressIdentity(awsIdentity, identityProperties) {
        const key = identityProperties.Bucket;
        const { cache } = this;
        const entry = cache.get(key);
        if (entry) {
            return entry.identity.then((identity) => {
                const isExpired = (identity.expiration?.getTime() ?? 0) < Date.now();
                if (isExpired) {
                    return cache.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
                }
                const isExpiringSoon = (identity.expiration?.getTime() ?? 0) < Date.now() + S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS;
                if (isExpiringSoon && !entry.isRefreshing) {
                    entry.isRefreshing = true;
                    this.getIdentity(key).then((id) => {
                        cache.set(key, new S3ExpressIdentityCacheEntry(Promise.resolve(id)));
                    });
                }
                return identity;
            });
        }
        return cache.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
    }
    async getIdentity(key) {
        await this.cache.purgeExpired().catch((error) => {
            console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error);
        });
        const session = await this.createSessionFn(key);
        if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) {
            throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");
        }
        const identity = {
            accessKeyId: session.Credentials.AccessKeyId,
            secretAccessKey: session.Credentials.SecretAccessKey,
            sessionToken: session.Credentials.SessionToken,
            expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : undefined,
        };
        return identity;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js

const toUint8Array = (data) => {
    if (typeof data === "string") {
        return fromUtf8(data);
    }
    if (ArrayBuffer.isView(data)) {
        return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
    }
    return new Uint8Array(data);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/constants.js
const ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
const CREDENTIAL_QUERY_PARAM = "X-Amz-Credential";
const AMZ_DATE_QUERY_PARAM = "X-Amz-Date";
const SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders";
const EXPIRES_QUERY_PARAM = "X-Amz-Expires";
const SIGNATURE_QUERY_PARAM = "X-Amz-Signature";
const TOKEN_QUERY_PARAM = "X-Amz-Security-Token";
const REGION_SET_PARAM = "X-Amz-Region-Set";
const AUTH_HEADER = "authorization";
const AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();
const DATE_HEADER = "date";
const GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER];
const SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();
const SHA256_HEADER = "x-amz-content-sha256";
const TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();
const HOST_HEADER = "host";
const ALWAYS_UNSIGNABLE_HEADERS = {
    authorization: true,
    "cache-control": true,
    connection: true,
    expect: true,
    from: true,
    "keep-alive": true,
    "max-forwards": true,
    pragma: true,
    referer: true,
    te: true,
    trailer: true,
    "transfer-encoding": true,
    upgrade: true,
    "user-agent": true,
    "x-amzn-trace-id": true,
};
const PROXY_HEADER_PATTERN = /^proxy-/;
const SEC_HEADER_PATTERN = /^sec-/;
const UNSIGNABLE_PATTERNS = (/* unused pure expression or super */ null && ([/^proxy-/i, /^sec-/i]));
const ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256";
const ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256";
const EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD";
const UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
const MAX_CACHE_SIZE = 50;
const KEY_TYPE_IDENTIFIER = "aws4_request";
const MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js



const signingKeyCache = {};
const cacheQueue = [];
const createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`;
const getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => {
    const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);
    const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`;
    if (cacheKey in signingKeyCache) {
        return signingKeyCache[cacheKey];
    }
    cacheQueue.push(cacheKey);
    while (cacheQueue.length > MAX_CACHE_SIZE) {
        delete signingKeyCache[cacheQueue.shift()];
    }
    let key = `AWS4${credentials.secretAccessKey}`;
    for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) {
        key = await hmac(sha256Constructor, key, signable);
    }
    return (signingKeyCache[cacheKey] = key);
};
const clearCredentialCache = () => {
    cacheQueue.length = 0;
    Object.keys(signingKeyCache).forEach((cacheKey) => {
        delete signingKeyCache[cacheKey];
    });
};
const hmac = (ctor, secret, data) => {
    const hash = new ctor(secret);
    hash.update(toUint8Array(data));
    return hash.digest();
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js

const getCanonicalHeaders = ({ headers }, unsignableHeaders, signableHeaders) => {
    const canonical = {};
    for (const headerName of Object.keys(headers).sort()) {
        if (headers[headerName] == undefined) {
            continue;
        }
        const canonicalHeaderName = headerName.toLowerCase();
        if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS ||
            unsignableHeaders?.has(canonicalHeaderName) ||
            PROXY_HEADER_PATTERN.test(canonicalHeaderName) ||
            SEC_HEADER_PATTERN.test(canonicalHeaderName)) {
            if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) {
                continue;
            }
        }
        canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " ");
    }
    return canonical;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/is-array-buffer/dist-es/index.js
const isArrayBuffer = (arg) => (typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer) ||
    Object.prototype.toString.call(arg) === "[object ArrayBuffer]";

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js




const getPayloadHash = async ({ headers, body }, hashConstructor) => {
    for (const headerName of Object.keys(headers)) {
        if (headerName.toLowerCase() === SHA256_HEADER) {
            return headers[headerName];
        }
    }
    if (body == undefined) {
        return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
    }
    else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer(body)) {
        const hashCtor = new hashConstructor();
        hashCtor.update(toUint8Array(body));
        return toHex(await hashCtor.digest());
    }
    return UNSIGNED_PAYLOAD;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js


class HeaderFormatter {
    format(headers) {
        const chunks = [];
        for (const headerName of Object.keys(headers)) {
            const bytes = fromUtf8(headerName);
            chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
        }
        const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));
        let position = 0;
        for (const chunk of chunks) {
            out.set(chunk, position);
            position += chunk.byteLength;
        }
        return out;
    }
    formatHeaderValue(header) {
        switch (header.type) {
            case "boolean":
                return Uint8Array.from([header.value ? 0 : 1]);
            case "byte":
                return Uint8Array.from([2, header.value]);
            case "short":
                const shortView = new DataView(new ArrayBuffer(3));
                shortView.setUint8(0, 3);
                shortView.setInt16(1, header.value, false);
                return new Uint8Array(shortView.buffer);
            case "integer":
                const intView = new DataView(new ArrayBuffer(5));
                intView.setUint8(0, 4);
                intView.setInt32(1, header.value, false);
                return new Uint8Array(intView.buffer);
            case "long":
                const longBytes = new Uint8Array(9);
                longBytes[0] = 5;
                longBytes.set(header.value.bytes, 1);
                return longBytes;
            case "binary":
                const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
                binView.setUint8(0, 6);
                binView.setUint16(1, header.value.byteLength, false);
                const binBytes = new Uint8Array(binView.buffer);
                binBytes.set(header.value, 3);
                return binBytes;
            case "string":
                const utf8Bytes = fromUtf8(header.value);
                const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
                strView.setUint8(0, 7);
                strView.setUint16(1, utf8Bytes.byteLength, false);
                const strBytes = new Uint8Array(strView.buffer);
                strBytes.set(utf8Bytes, 3);
                return strBytes;
            case "timestamp":
                const tsBytes = new Uint8Array(9);
                tsBytes[0] = 8;
                tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);
                return tsBytes;
            case "uuid":
                if (!UUID_PATTERN.test(header.value)) {
                    throw new Error(`Invalid UUID received: ${header.value}`);
                }
                const uuidBytes = new Uint8Array(17);
                uuidBytes[0] = 9;
                uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
                return uuidBytes;
        }
    }
}
var HEADER_VALUE_TYPE;
(function (HEADER_VALUE_TYPE) {
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolTrue"] = 0] = "boolTrue";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolFalse"] = 1] = "boolFalse";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byte"] = 2] = "byte";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["short"] = 3] = "short";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["integer"] = 4] = "integer";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["long"] = 5] = "long";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byteArray"] = 6] = "byteArray";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["string"] = 7] = "string";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["timestamp"] = 8] = "timestamp";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["uuid"] = 9] = "uuid";
})(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {}));
const UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
class Int64 {
    constructor(bytes) {
        this.bytes = bytes;
        if (bytes.byteLength !== 8) {
            throw new Error("Int64 buffers must be exactly 8 bytes");
        }
    }
    static fromNumber(number) {
        if (number > 9223372036854776000 || number < -9223372036854776000) {
            throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);
        }
        const bytes = new Uint8Array(8);
        for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {
            bytes[i] = remaining;
        }
        if (number < 0) {
            negate(bytes);
        }
        return new Int64(bytes);
    }
    valueOf() {
        const bytes = this.bytes.slice(0);
        const negative = bytes[0] & 0b10000000;
        if (negative) {
            negate(bytes);
        }
        return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
    }
    toString() {
        return String(this.valueOf());
    }
}
function negate(bytes) {
    for (let i = 0; i < 8; i++) {
        bytes[i] ^= 0xff;
    }
    for (let i = 7; i > -1; i--) {
        bytes[i]++;
        if (bytes[i] !== 0)
            break;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/headerUtil.js
const headerUtil_hasHeader = (soughtHeader, headers) => {
    soughtHeader = soughtHeader.toLowerCase();
    for (const headerName of Object.keys(headers)) {
        if (soughtHeader === headerName.toLowerCase()) {
            return true;
        }
    }
    return false;
};
const getHeaderValue = (soughtHeader, headers) => {
    soughtHeader = soughtHeader.toLowerCase();
    for (const headerName of Object.keys(headers)) {
        if (soughtHeader === headerName.toLowerCase()) {
            return headers[headerName];
        }
    }
    return undefined;
};
const deleteHeader = (soughtHeader, headers) => {
    soughtHeader = soughtHeader.toLowerCase();
    for (const headerName of Object.keys(headers)) {
        if (soughtHeader === headerName.toLowerCase()) {
            delete headers[headerName];
        }
    }
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js

const moveHeadersToQuery = (request, options = {}) => {
    const { headers, query = {} } = httpRequest_HttpRequest.clone(request);
    for (const name of Object.keys(headers)) {
        const lname = name.toLowerCase();
        if ((lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname)) ||
            options.hoistableHeaders?.has(lname)) {
            query[name] = headers[name];
            delete headers[name];
        }
    }
    return {
        ...request,
        headers,
        query,
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js


const prepareRequest = (request) => {
    request = httpRequest_HttpRequest.clone(request);
    for (const headerName of Object.keys(request.headers)) {
        if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
            delete request.headers[headerName];
        }
    }
    return request;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js


const getCanonicalQuery = ({ query = {} }) => {
    const keys = [];
    const serialized = {};
    for (const key of Object.keys(query)) {
        if (key.toLowerCase() === SIGNATURE_HEADER) {
            continue;
        }
        const encodedKey = escapeUri(key);
        keys.push(encodedKey);
        const value = query[key];
        if (typeof value === "string") {
            serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`;
        }
        else if (Array.isArray(value)) {
            serialized[encodedKey] = value
                .slice(0)
                .reduce((encoded, value) => encoded.concat([`${encodedKey}=${escapeUri(value)}`]), [])
                .sort()
                .join("&");
        }
    }
    return keys
        .sort()
        .map((key) => serialized[key])
        .filter((serialized) => serialized)
        .join("&");
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/utilDate.js
const iso8601 = (time) => toDate(time)
    .toISOString()
    .replace(/\.\d{3}Z$/, "Z");
const toDate = (time) => {
    if (typeof time === "number") {
        return new Date(time * 1000);
    }
    if (typeof time === "string") {
        if (Number(time)) {
            return new Date(Number(time) * 1000);
        }
        return new Date(time);
    }
    return time;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js






class SignatureV4Base {
    constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) {
        this.service = service;
        this.sha256 = sha256;
        this.uriEscapePath = uriEscapePath;
        this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true;
        this.regionProvider = normalizeProvider_normalizeProvider(region);
        this.credentialProvider = normalizeProvider_normalizeProvider(credentials);
    }
    createCanonicalRequest(request, canonicalHeaders, payloadHash) {
        const sortedHeaders = Object.keys(canonicalHeaders).sort();
        return `${request.method}
${this.getCanonicalPath(request)}
${getCanonicalQuery(request)}
${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")}

${sortedHeaders.join(";")}
${payloadHash}`;
    }
    async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) {
        const hash = new this.sha256();
        hash.update(toUint8Array(canonicalRequest));
        const hashedRequest = await hash.digest();
        return `${algorithmIdentifier}
${longDate}
${credentialScope}
${toHex(hashedRequest)}`;
    }
    getCanonicalPath({ path }) {
        if (this.uriEscapePath) {
            const normalizedPathSegments = [];
            for (const pathSegment of path.split("/")) {
                if (pathSegment?.length === 0)
                    continue;
                if (pathSegment === ".")
                    continue;
                if (pathSegment === "..") {
                    normalizedPathSegments.pop();
                }
                else {
                    normalizedPathSegments.push(pathSegment);
                }
            }
            const normalizedPath = `${path?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path?.endsWith("/") ? "/" : ""}`;
            const doubleEncoded = escapeUri(normalizedPath);
            return doubleEncoded.replace(/%2F/g, "/");
        }
        return path;
    }
    validateResolvedCredentials(credentials) {
        if (typeof credentials !== "object" ||
            typeof credentials.accessKeyId !== "string" ||
            typeof credentials.secretAccessKey !== "string") {
            throw new Error("Resolved credential object is not valid");
        }
    }
    formatDate(now) {
        const longDate = iso8601(now).replace(/[\-:]/g, "");
        return {
            longDate,
            shortDate: longDate.slice(0, 8),
        };
    }
    getCanonicalHeaderList(headers) {
        return Object.keys(headers).sort().join(";");
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js











class SignatureV4 extends SignatureV4Base {
    constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true, }) {
        super({
            applyChecksum,
            credentials,
            region,
            service,
            sha256,
            uriEscapePath,
        });
        this.headerFormatter = new HeaderFormatter();
    }
    async presign(originalRequest, options = {}) {
        const { signingDate = new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, hoistableHeaders, signingRegion, signingService, } = options;
        const credentials = await this.credentialProvider();
        this.validateResolvedCredentials(credentials);
        const region = signingRegion ?? (await this.regionProvider());
        const { longDate, shortDate } = this.formatDate(signingDate);
        if (expiresIn > MAX_PRESIGNED_TTL) {
            return Promise.reject("Signature version 4 presigned URLs" + " must have an expiration date less than one week in" + " the future");
        }
        const scope = createScope(shortDate, region, signingService ?? this.service);
        const request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders, hoistableHeaders });
        if (credentials.sessionToken) {
            request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;
        }
        request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;
        request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`;
        request.query[AMZ_DATE_QUERY_PARAM] = longDate;
        request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);
        const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);
        request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders);
        request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256)));
        return request;
    }
    async sign(toSign, options) {
        if (typeof toSign === "string") {
            return this.signString(toSign, options);
        }
        else if (toSign.headers && toSign.payload) {
            return this.signEvent(toSign, options);
        }
        else if (toSign.message) {
            return this.signMessage(toSign, options);
        }
        else {
            return this.signRequest(toSign, options);
        }
    }
    async signEvent({ headers, payload }, { signingDate = new Date(), priorSignature, signingRegion, signingService }) {
        const region = signingRegion ?? (await this.regionProvider());
        const { shortDate, longDate } = this.formatDate(signingDate);
        const scope = createScope(shortDate, region, signingService ?? this.service);
        const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256);
        const hash = new this.sha256();
        hash.update(headers);
        const hashedHeaders = toHex(await hash.digest());
        const stringToSign = [
            EVENT_ALGORITHM_IDENTIFIER,
            longDate,
            scope,
            priorSignature,
            hashedHeaders,
            hashedPayload,
        ].join("\n");
        return this.signString(stringToSign, { signingDate, signingRegion: region, signingService });
    }
    async signMessage(signableMessage, { signingDate = new Date(), signingRegion, signingService }) {
        const promise = this.signEvent({
            headers: this.headerFormatter.format(signableMessage.message.headers),
            payload: signableMessage.message.body,
        }, {
            signingDate,
            signingRegion,
            signingService,
            priorSignature: signableMessage.priorSignature,
        });
        return promise.then((signature) => {
            return { message: signableMessage.message, signature };
        });
    }
    async signString(stringToSign, { signingDate = new Date(), signingRegion, signingService } = {}) {
        const credentials = await this.credentialProvider();
        this.validateResolvedCredentials(credentials);
        const region = signingRegion ?? (await this.regionProvider());
        const { shortDate } = this.formatDate(signingDate);
        const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));
        hash.update(toUint8Array(stringToSign));
        return toHex(await hash.digest());
    }
    async signRequest(requestToSign, { signingDate = new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService, } = {}) {
        const credentials = await this.credentialProvider();
        this.validateResolvedCredentials(credentials);
        const region = signingRegion ?? (await this.regionProvider());
        const request = prepareRequest(requestToSign);
        const { longDate, shortDate } = this.formatDate(signingDate);
        const scope = createScope(shortDate, region, signingService ?? this.service);
        request.headers[AMZ_DATE_HEADER] = longDate;
        if (credentials.sessionToken) {
            request.headers[TOKEN_HEADER] = credentials.sessionToken;
        }
        const payloadHash = await getPayloadHash(request, this.sha256);
        if (!headerUtil_hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {
            request.headers[SHA256_HEADER] = payloadHash;
        }
        const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);
        const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash));
        request.headers[AUTH_HEADER] =
            `${ALGORITHM_IDENTIFIER} ` +
                `Credential=${credentials.accessKeyId}/${scope}, ` +
                `SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, ` +
                `Signature=${signature}`;
        return request;
    }
    async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) {
        const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest, ALGORITHM_IDENTIFIER);
        const hash = new this.sha256(await keyPromise);
        hash.update(toUint8Array(stringToSign));
        return toHex(await hash.digest());
    }
    getSigningKey(credentials, region, shortDate, service) {
        return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js
const signatureV4aContainer = {
    SignatureV4a: null,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/signature-v4/dist-es/index.js












;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js
const booleanSelector = (obj, key, type) => {
    if (!(key in obj))
        return undefined;
    if (obj[key] === "true")
        return true;
    if (obj[key] === "false")
        return false;
    throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-config-provider/dist-es/types.js
var types_SelectorType;
(function (SelectorType) {
    SelectorType["ENV"] = "env";
    SelectorType["CONFIG"] = "shared config entry";
})(types_SelectorType || (types_SelectorType = {}));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-config-provider/dist-es/index.js




;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/constants.js

const S3_EXPRESS_BUCKET_TYPE = "Directory";
const S3_EXPRESS_BACKEND = "S3Express";
const S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express";
const SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
const SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
const NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH";
const NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth";
const NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = {
    environmentVariableSelector: (env) => booleanSelector(env, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, types_SelectorType.ENV),
    configFileSelector: (profile) => booleanSelector(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, types_SelectorType.CONFIG),
    default: false,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/SignatureV4S3Express.js


class SignatureV4S3Express extends SignatureV4 {
    async signWithCredentials(requestToSign, credentials, options) {
        const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
        requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken;
        const privateAccess = this;
        setSingleOverride(privateAccess, credentialsWithoutSessionToken);
        return privateAccess.signRequest(requestToSign, options ?? {});
    }
    async presignWithCredentials(requestToSign, credentials, options) {
        const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
        delete requestToSign.headers[SESSION_TOKEN_HEADER];
        requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
        requestToSign.query = requestToSign.query ?? {};
        requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
        const privateAccess = this;
        setSingleOverride(privateAccess, credentialsWithoutSessionToken);
        return this.presign(requestToSign, options);
    }
}
function getCredentialsWithoutSessionToken(credentials) {
    const credentialsWithoutSessionToken = {
        accessKeyId: credentials.accessKeyId,
        secretAccessKey: credentials.secretAccessKey,
        expiration: credentials.expiration,
    };
    return credentialsWithoutSessionToken;
}
function setSingleOverride(privateAccess, credentialsWithoutSessionToken) {
    const id = setTimeout(() => {
        throw new Error("SignatureV4S3Express credential override was created but not called.");
    }, 10);
    const currentCredentialProvider = privateAccess.credentialProvider;
    const overrideCredentialsProviderOnce = () => {
        clearTimeout(id);
        privateAccess.credentialProvider = currentCredentialProvider;
        return Promise.resolve(credentialsWithoutSessionToken);
    };
    privateAccess.credentialProvider = overrideCredentialsProviderOnce;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
function setFeature_setFeature(context, feature, value) {
    if (!context.__aws_sdk_context) {
        context.__aws_sdk_context = {
            features: {},
        };
    }
    else if (!context.__aws_sdk_context.features) {
        context.__aws_sdk_context.features = {};
    }
    context.__aws_sdk_context.features[feature] = value;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressMiddleware.js



const s3ExpressMiddleware = (options) => {
    return (next, context) => async (args) => {
        if (context.endpointV2) {
            const endpoint = context.endpointV2;
            const isS3ExpressAuth = endpoint.properties?.authSchemes?.[0]?.name === S3_EXPRESS_AUTH_SCHEME;
            const isS3ExpressBucket = endpoint.properties?.backend === S3_EXPRESS_BACKEND ||
                endpoint.properties?.bucketType === S3_EXPRESS_BUCKET_TYPE;
            if (isS3ExpressBucket) {
                setFeature_setFeature(context, "S3_EXPRESS_BUCKET", "J");
                context.isS3ExpressBucket = true;
            }
            if (isS3ExpressAuth) {
                const requestBucket = args.input.Bucket;
                if (requestBucket) {
                    const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), {
                        Bucket: requestBucket,
                    });
                    context.s3ExpressIdentity = s3ExpressIdentity;
                    if (httpRequest_HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) {
                        args.request.headers[SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken;
                    }
                }
            }
        }
        return next(args);
    };
};
const s3ExpressMiddlewareOptions = {
    name: "s3ExpressMiddleware",
    step: "build",
    tags: ["S3", "S3_EXPRESS"],
    override: true,
};
const getS3ExpressPlugin = (options) => ({
    applyToStack: (clientStack) => {
        clientStack.add(s3ExpressMiddleware(options), s3ExpressMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/getSmithyContext.js

const getSmithyContext_getSmithyContext = (context) => context[SMITHY_CONTEXT_KEY] || (context[SMITHY_CONTEXT_KEY] = {});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js


function convertHttpAuthSchemesToMap(httpAuthSchemes) {
    const map = new Map();
    for (const scheme of httpAuthSchemes) {
        map.set(scheme.schemeId, scheme);
    }
    return map;
}
const httpAuthSchemeMiddleware_httpAuthSchemeMiddleware = (config, mwOptions) => (next, context) => async (args) => {
    const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
    const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
    const smithyContext = getSmithyContext(context);
    const failureReasons = [];
    for (const option of options) {
        const scheme = authSchemes.get(option.schemeId);
        if (!scheme) {
            failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
            continue;
        }
        const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
        if (!identityProvider) {
            failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
            continue;
        }
        const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
        option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
        option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
        smithyContext.selectedHttpAuthScheme = {
            httpAuthOption: option,
            identity: await identityProvider(option.identityProperties),
            signer: scheme.signer,
        };
        break;
    }
    if (!smithyContext.selectedHttpAuthScheme) {
        throw new Error(failureReasons.join("\n"));
    }
    return next(args);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js

const httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
    step: "serialize",
    tags: ["HTTP_AUTH_SCHEME"],
    name: "httpAuthSchemeMiddleware",
    override: true,
    relation: "before",
    toMiddleware: "endpointV2Middleware",
};
const getHttpAuthSchemeEndpointRuleSetPlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
    applyToStack: (clientStack) => {
        clientStack.addRelativeTo(httpAuthSchemeMiddleware_httpAuthSchemeMiddleware(config, {
            httpAuthSchemeParametersProvider,
            identityProviderConfigProvider,
        }), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js
const deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => {
    const { response } = await next(args);
    try {
        const parsed = await deserializer(response, options);
        return {
            response,
            output: parsed,
        };
    }
    catch (error) {
        Object.defineProperty(error, "$response", {
            value: response,
        });
        if (!("$metadata" in error)) {
            const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
            try {
                error.message += "\n  " + hint;
            }
            catch (e) {
                if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
                    console.warn(hint);
                }
                else {
                    context.logger?.warn?.(hint);
                }
            }
            if (typeof error.$responseBodyText !== "undefined") {
                if (error.$response) {
                    error.$response.body = error.$responseBodyText;
                }
            }
        }
        throw error;
    }
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js
const serializerMiddleware = (options, serializer) => (next, context) => async (args) => {
    const endpoint = context.endpointV2?.url && options.urlParser
        ? async () => options.urlParser(context.endpointV2.url)
        : options.endpoint;
    if (!endpoint) {
        throw new Error("No valid endpoint provider available.");
    }
    const request = await serializer(args.input, { ...options, endpoint });
    return next({
        ...args,
        request,
    });
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js


const deserializerMiddlewareOption = {
    name: "deserializerMiddleware",
    step: "deserialize",
    tags: ["DESERIALIZER"],
    override: true,
};
const serializerMiddlewareOption = {
    name: "serializerMiddleware",
    step: "serialize",
    tags: ["SERIALIZER"],
    override: true,
};
function getSerdePlugin(config, serializer, deserializer) {
    return {
        applyToStack: (commandStack) => {
            commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);
            commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);
        },
    };
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-serde/dist-es/index.js




;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js


const httpAuthSchemeMiddlewareOptions = {
    step: "serialize",
    tags: ["HTTP_AUTH_SCHEME"],
    name: "httpAuthSchemeMiddleware",
    override: true,
    relation: "before",
    toMiddleware: serializerMiddlewareOption.name,
};
const getHttpAuthSchemePlugin = (config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider, }) => ({
    applyToStack: (clientStack) => {
        clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
            httpAuthSchemeParametersProvider,
            identityProviderConfigProvider,
        }), httpAuthSchemeMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/index.js




;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js



const defaultErrorHandler = (signingProperties) => (error) => {
    throw error;
};
const defaultSuccessHandler = (httpResponse, signingProperties) => { };
const httpSigningMiddleware = (config) => (next, context) => async (args) => {
    if (!httpRequest_HttpRequest.isInstance(args.request)) {
        return next(args);
    }
    const smithyContext = getSmithyContext(context);
    const scheme = smithyContext.selectedHttpAuthScheme;
    if (!scheme) {
        throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
    }
    const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme;
    const output = await next({
        ...args,
        request: await signer.sign(args.request, identity, signingProperties),
    }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
    (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
    return output;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js

const getHttpSigningMiddleware_httpSigningMiddlewareOptions = {
    step: "finalizeRequest",
    tags: ["HTTP_SIGNING"],
    name: "httpSigningMiddleware",
    aliases: ["apiKeyMiddleware", "tokenMiddleware", "awsAuthMiddleware"],
    override: true,
    relation: "after",
    toMiddleware: "retryMiddleware",
};
const getHttpSigningPlugin = (config) => ({
    applyToStack: (clientStack) => {
        clientStack.addRelativeTo(httpSigningMiddleware(config), getHttpSigningMiddleware_httpSigningMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/middleware-http-signing/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/normalizeProvider.js
const dist_es_normalizeProvider_normalizeProvider = (input) => {
    if (typeof input === "function")
        return input;
    const promisified = Promise.resolve(input);
    return () => promisified;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/protocols/requestBuilder.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/setFeature.js
function dist_es_setFeature_setFeature(context, feature, value) {
    if (!context.__smithy_context) {
        context.__smithy_context = {
            features: {},
        };
    }
    else if (!context.__smithy_context.features) {
        context.__smithy_context.features = {};
    }
    context.__smithy_context.features[feature] = value;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js
class DefaultIdentityProviderConfig {
    constructor(config) {
        this.authSchemes = new Map();
        for (const [key, value] of Object.entries(config)) {
            if (value !== undefined) {
                this.authSchemes.set(key, value);
            }
        }
    }
    getIdentityProvider(schemeId) {
        return this.authSchemes.get(schemeId);
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js


class HttpApiKeyAuthSigner {
    async sign(httpRequest, identity, signingProperties) {
        if (!signingProperties) {
            throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");
        }
        if (!signingProperties.name) {
            throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");
        }
        if (!signingProperties.in) {
            throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");
        }
        if (!identity.apiKey) {
            throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");
        }
        const clonedRequest = HttpRequest.clone(httpRequest);
        if (signingProperties.in === HttpApiKeyAuthLocation.QUERY) {
            clonedRequest.query[signingProperties.name] = identity.apiKey;
        }
        else if (signingProperties.in === HttpApiKeyAuthLocation.HEADER) {
            clonedRequest.headers[signingProperties.name] = signingProperties.scheme
                ? `${signingProperties.scheme} ${identity.apiKey}`
                : identity.apiKey;
        }
        else {
            throw new Error("request can only be signed with `apiKey` locations `query` or `header`, " +
                "but found: `" +
                signingProperties.in +
                "`");
        }
        return clonedRequest;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js

class HttpBearerAuthSigner {
    async sign(httpRequest, identity, signingProperties) {
        const clonedRequest = HttpRequest.clone(httpRequest);
        if (!identity.token) {
            throw new Error("request could not be signed with `token` since the `token` is not defined");
        }
        clonedRequest.headers["Authorization"] = `Bearer ${identity.token}`;
        return clonedRequest;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/util-identity-and-auth/httpAuthSchemes/index.js




;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js
const createIsIdentityExpiredFunction = (expirationMs) => (identity) => doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
const EXPIRATION_MS = 300000;
const isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
const doesIdentityRequireRefresh = (identity) => identity.expiration !== undefined;
const memoizeIdentityProvider = (provider, isExpired, requiresRefresh) => {
    if (provider === undefined) {
        return undefined;
    }
    const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
    let resolved;
    let pending;
    let hasResult;
    let isConstant = false;
    const coalesceProvider = async (options) => {
        if (!pending) {
            pending = normalizedProvider(options);
        }
        try {
            resolved = await pending;
            hasResult = true;
            isConstant = false;
        }
        finally {
            pending = undefined;
        }
        return resolved;
    };
    if (isExpired === undefined) {
        return async (options) => {
            if (!hasResult || options?.forceRefresh) {
                resolved = await coalesceProvider(options);
            }
            return resolved;
        };
    }
    return async (options) => {
        if (!hasResult || options?.forceRefresh) {
            resolved = await coalesceProvider(options);
        }
        if (isConstant) {
            return resolved;
        }
        if (!requiresRefresh(resolved)) {
            isConstant = true;
            return resolved;
        }
        if (isExpired(resolved)) {
            await coalesceProvider(options);
            return resolved;
        }
        return resolved;
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/util-identity-and-auth/index.js




;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/core/dist-es/index.js









;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/signS3Express.js
const signS3Express = async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => {
    const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {});
    if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
        throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
    }
    return signedRequest;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js





const s3ExpressHttpSigningMiddleware_defaultErrorHandler = (signingProperties) => (error) => {
    throw error;
};
const s3ExpressHttpSigningMiddleware_defaultSuccessHandler = (httpResponse, signingProperties) => { };
const s3ExpressHttpSigningMiddlewareOptions = (/* unused pure expression or super */ null && (httpSigningMiddlewareOptions));
const s3ExpressHttpSigningMiddleware = (config) => (next, context) => async (args) => {
    if (!httpRequest_HttpRequest.isInstance(args.request)) {
        return next(args);
    }
    const smithyContext = getSmithyContext(context);
    const scheme = smithyContext.selectedHttpAuthScheme;
    if (!scheme) {
        throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
    }
    const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme;
    let request;
    if (context.s3ExpressIdentity) {
        request = await signS3Express(context.s3ExpressIdentity, signingProperties, args.request, await config.signer());
    }
    else {
        request = await signer.sign(args.request, identity, signingProperties);
    }
    const output = await next({
        ...args,
        request,
    }).catch((signer.errorHandler || s3ExpressHttpSigningMiddleware_defaultErrorHandler)(signingProperties));
    (signer.successHandler || s3ExpressHttpSigningMiddleware_defaultSuccessHandler)(output.response, signingProperties);
    return output;
};
const getS3ExpressHttpSigningPlugin = (config) => ({
    applyToStack: (clientStack) => {
        clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), getHttpSigningMiddleware_httpSigningMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/index.js








;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3Configuration.js

const resolveS3Config = (input, { session, }) => {
    const [s3ClientProvider, CreateSessionCommandCtor] = session;
    const { forcePathStyle, useAccelerateEndpoint, disableMultiregionAccessPoints, followRegionRedirects, s3ExpressIdentityProvider, bucketEndpoint, } = input;
    return Object.assign(input, {
        forcePathStyle: forcePathStyle ?? false,
        useAccelerateEndpoint: useAccelerateEndpoint ?? false,
        disableMultiregionAccessPoints: disableMultiregionAccessPoints ?? false,
        followRegionRedirects: followRegionRedirects ?? false,
        s3ExpressIdentityProvider: s3ExpressIdentityProvider ??
            new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({
                Bucket: key,
            }))),
        bucketEndpoint: bucketEndpoint ?? false,
    });
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/throw-200-exceptions.js


const THROW_IF_EMPTY_BODY = {
    CopyObjectCommand: true,
    UploadPartCopyCommand: true,
    CompleteMultipartUploadCommand: true,
};
const MAX_BYTES_TO_INSPECT = 3000;
const throw200ExceptionsMiddleware = (config) => (next, context) => async (args) => {
    const result = await next(args);
    const { response } = result;
    if (!httpResponse_HttpResponse.isInstance(response)) {
        return result;
    }
    const { statusCode, body: sourceBody } = response;
    if (statusCode < 200 || statusCode >= 300) {
        return result;
    }
    const isSplittableStream = typeof sourceBody?.stream === "function" ||
        typeof sourceBody?.pipe === "function" ||
        typeof sourceBody?.tee === "function";
    if (!isSplittableStream) {
        return result;
    }
    let bodyCopy = sourceBody;
    let body = sourceBody;
    if (sourceBody && typeof sourceBody === "object" && !(sourceBody instanceof Uint8Array)) {
        [bodyCopy, body] = await splitStream(sourceBody);
    }
    response.body = body;
    const bodyBytes = await throw_200_exceptions_collectBody(bodyCopy, {
        streamCollector: async (stream) => {
            return headStream(stream, MAX_BYTES_TO_INSPECT);
        },
    });
    if (typeof bodyCopy?.destroy === "function") {
        bodyCopy.destroy();
    }
    const bodyStringTail = config.utf8Encoder(bodyBytes.subarray(bodyBytes.length - 16));
    if (bodyBytes.length === 0 && THROW_IF_EMPTY_BODY[context.commandName]) {
        const err = new Error("S3 aborted request");
        err.name = "InternalError";
        throw err;
    }
    if (bodyStringTail && bodyStringTail.endsWith("</Error>")) {
        response.statusCode = 400;
    }
    return result;
};
const throw_200_exceptions_collectBody = (streamBody = new Uint8Array(), context) => {
    if (streamBody instanceof Uint8Array) {
        return Promise.resolve(streamBody);
    }
    return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
};
const throw200ExceptionsMiddlewareOptions = {
    relation: "after",
    toMiddleware: "deserializerMiddleware",
    tags: ["THROW_200_EXCEPTIONS", "S3"],
    name: "throw200ExceptionsMiddleware",
    override: true,
};
const getThrow200ExceptionsPlugin = (config) => ({
    applyToStack: (clientStack) => {
        clientStack.addRelativeTo(throw200ExceptionsMiddleware(config), throw200ExceptionsMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-arn-parser/dist-es/index.js
const dist_es_validate = (str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6;
const parse = (arn) => {
    const segments = arn.split(":");
    if (segments.length < 6 || segments[0] !== "arn")
        throw new Error("Malformed ARN");
    const [, partition, service, region, accountId, ...resource] = segments;
    return {
        partition,
        service,
        region,
        accountId,
        resource: resource.join(":"),
    };
};
const build = (arnObject) => {
    const { partition = "aws", service, region, accountId, resource } = arnObject;
    if ([service, region, accountId, resource].some((segment) => typeof segment !== "string")) {
        throw new Error("Input ARN object is invalid");
    }
    return `arn:${partition}:${service}:${region}:${accountId}:${resource}`;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/bucket-endpoint-middleware.js
function bucketEndpointMiddleware(options) {
    return (next, context) => async (args) => {
        if (options.bucketEndpoint) {
            const endpoint = context.endpointV2;
            if (endpoint) {
                const bucket = args.input.Bucket;
                if (typeof bucket === "string") {
                    try {
                        const bucketEndpointUrl = new URL(bucket);
                        context.endpointV2 = {
                            ...endpoint,
                            url: bucketEndpointUrl,
                        };
                    }
                    catch (e) {
                        const warning = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`;
                        if (context.logger?.constructor?.name === "NoOpLogger") {
                            console.warn(warning);
                        }
                        else {
                            context.logger?.warn?.(warning);
                        }
                        throw e;
                    }
                }
            }
        }
        return next(args);
    };
}
const bucketEndpointMiddlewareOptions = {
    name: "bucketEndpointMiddleware",
    override: true,
    relation: "after",
    toMiddleware: "endpointV2Middleware",
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/validate-bucket-name.js


function validateBucketNameMiddleware({ bucketEndpoint }) {
    return (next) => async (args) => {
        const { input: { Bucket }, } = args;
        if (!bucketEndpoint && typeof Bucket === "string" && !dist_es_validate(Bucket) && Bucket.indexOf("/") >= 0) {
            const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`);
            err.name = "InvalidBucketName";
            throw err;
        }
        return next({ ...args });
    };
}
const validateBucketNameMiddlewareOptions = {
    step: "initialize",
    tags: ["VALIDATE_BUCKET_NAME"],
    name: "validateBucketNameMiddleware",
    override: true,
};
const getValidateBucketNamePlugin = (options) => ({
    applyToStack: (clientStack) => {
        clientStack.add(validateBucketNameMiddleware(options), validateBucketNameMiddlewareOptions);
        clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/index.js









;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js

const DEFAULT_UA_APP_ID = undefined;
function isValidUserAgentAppId(appId) {
    if (appId === undefined) {
        return true;
    }
    return typeof appId === "string" && appId.length <= 50;
}
function resolveUserAgentConfig(input) {
    const normalizedAppIdProvider = dist_es_normalizeProvider_normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
    const { customUserAgent } = input;
    return Object.assign(input, {
        customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent,
        userAgentAppId: async () => {
            const appId = await normalizedAppIdProvider();
            if (!isValidUserAgentAppId(appId)) {
                const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
                if (typeof appId !== "string") {
                    logger?.warn("userAgentAppId must be a string or undefined.");
                }
                else if (appId.length > 50) {
                    logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
                }
            }
            return appId;
        },
    });
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js
class EndpointCache {
    constructor({ size, params }) {
        this.data = new Map();
        this.parameters = [];
        this.capacity = size ?? 50;
        if (params) {
            this.parameters = params;
        }
    }
    get(endpointParams, resolver) {
        const key = this.hash(endpointParams);
        if (key === false) {
            return resolver();
        }
        if (!this.data.has(key)) {
            if (this.data.size > this.capacity + 10) {
                const keys = this.data.keys();
                let i = 0;
                while (true) {
                    const { value, done } = keys.next();
                    this.data.delete(value);
                    if (done || ++i > 10) {
                        break;
                    }
                }
            }
            this.data.set(key, resolver());
        }
        return this.data.get(key);
    }
    size() {
        return this.data.size;
    }
    hash(endpointParams) {
        let buffer = "";
        const { parameters } = this;
        if (parameters.length === 0) {
            return false;
        }
        for (const param of parameters) {
            const val = String(endpointParams[param] ?? "");
            if (val.includes("|;")) {
                return false;
            }
            buffer += val + "|;";
        }
        return buffer;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js
const IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`);
const isIpAddress = (value) => IP_V4_REGEX.test(value) || (value.startsWith("[") && value.endsWith("]"));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js
const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
const isValidHostLabel = (value, allowSubDomains = false) => {
    if (!allowSubDomains) {
        return VALID_HOST_LABEL_REGEX.test(value);
    }
    const labels = value.split(".");
    for (const label of labels) {
        if (!isValidHostLabel(label)) {
            return false;
        }
    }
    return true;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js
const customEndpointFunctions = {};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js
const debugId = "endpoints";

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js
function toDebugString(input) {
    if (typeof input !== "object" || input == null) {
        return input;
    }
    if ("ref" in input) {
        return `$${toDebugString(input.ref)}`;
    }
    if ("fn" in input) {
        return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`;
    }
    return JSON.stringify(input, null, 2);
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js
class EndpointError extends Error {
    constructor(message) {
        super(message);
        this.name = "EndpointError";
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/types/index.js








;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js
const booleanEquals = (value1, value2) => value1 === value2;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js

const getAttrPathList = (path) => {
    const parts = path.split(".");
    const pathList = [];
    for (const part of parts) {
        const squareBracketIndex = part.indexOf("[");
        if (squareBracketIndex !== -1) {
            if (part.indexOf("]") !== part.length - 1) {
                throw new EndpointError(`Path: '${path}' does not end with ']'`);
            }
            const arrayIndex = part.slice(squareBracketIndex + 1, -1);
            if (Number.isNaN(parseInt(arrayIndex))) {
                throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
            }
            if (squareBracketIndex !== 0) {
                pathList.push(part.slice(0, squareBracketIndex));
            }
            pathList.push(arrayIndex);
        }
        else {
            pathList.push(part);
        }
    }
    return pathList;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js


const getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => {
    if (typeof acc !== "object") {
        throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
    }
    else if (Array.isArray(acc)) {
        return acc[parseInt(index)];
    }
    return acc[index];
}, value);

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js
const isSet = (value) => value != null;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/not.js
const not = (value) => !value;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js


const DEFAULT_PORTS = {
    [EndpointURLScheme.HTTP]: 80,
    [EndpointURLScheme.HTTPS]: 443,
};
const parseURL = (value) => {
    const whatwgURL = (() => {
        try {
            if (value instanceof URL) {
                return value;
            }
            if (typeof value === "object" && "hostname" in value) {
                const { hostname, port, protocol = "", path = "", query = {} } = value;
                const url = new URL(`${protocol}//${hostname}${port ? `:${port}` : ""}${path}`);
                url.search = Object.entries(query)
                    .map(([k, v]) => `${k}=${v}`)
                    .join("&");
                return url;
            }
            return new URL(value);
        }
        catch (error) {
            return null;
        }
    })();
    if (!whatwgURL) {
        console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);
        return null;
    }
    const urlString = whatwgURL.href;
    const { host, hostname, pathname, protocol, search } = whatwgURL;
    if (search) {
        return null;
    }
    const scheme = protocol.slice(0, -1);
    if (!Object.values(EndpointURLScheme).includes(scheme)) {
        return null;
    }
    const isIp = isIpAddress(hostname);
    const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) ||
        (typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`));
    const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;
    return {
        scheme,
        authority,
        path: pathname,
        normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`,
        isIp,
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js
const stringEquals = (value1, value2) => value1 === value2;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/substring.js
const substring = (input, start, stop, reverse) => {
    if (start >= stop || input.length < stop) {
        return null;
    }
    if (!reverse) {
        return input.substring(start, stop);
    }
    return input.substring(input.length - stop, input.length - start);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js
const uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/lib/index.js










;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js

const endpointFunctions = {
    booleanEquals: booleanEquals,
    getAttr: getAttr,
    isSet: isSet,
    isValidHostLabel: isValidHostLabel,
    not: not,
    parseURL: parseURL,
    stringEquals: stringEquals,
    substring: substring,
    uriEncode: uriEncode,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js

const evaluateTemplate = (template, options) => {
    const evaluatedTemplateArr = [];
    const templateContext = {
        ...options.endpointParams,
        ...options.referenceRecord,
    };
    let currentIndex = 0;
    while (currentIndex < template.length) {
        const openingBraceIndex = template.indexOf("{", currentIndex);
        if (openingBraceIndex === -1) {
            evaluatedTemplateArr.push(template.slice(currentIndex));
            break;
        }
        evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));
        const closingBraceIndex = template.indexOf("}", openingBraceIndex);
        if (closingBraceIndex === -1) {
            evaluatedTemplateArr.push(template.slice(openingBraceIndex));
            break;
        }
        if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") {
            evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));
            currentIndex = closingBraceIndex + 2;
        }
        const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);
        if (parameterName.includes("#")) {
            const [refName, attrName] = parameterName.split("#");
            evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName));
        }
        else {
            evaluatedTemplateArr.push(templateContext[parameterName]);
        }
        currentIndex = closingBraceIndex + 1;
    }
    return evaluatedTemplateArr.join("");
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js
const getReferenceValue = ({ ref }, options) => {
    const referenceRecord = {
        ...options.endpointParams,
        ...options.referenceRecord,
    };
    return referenceRecord[ref];
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js




const evaluateExpression = (obj, keyName, options) => {
    if (typeof obj === "string") {
        return evaluateTemplate(obj, options);
    }
    else if (obj["fn"]) {
        return callFunction(obj, options);
    }
    else if (obj["ref"]) {
        return getReferenceValue(obj, options);
    }
    throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js



const callFunction = ({ fn, argv }, options) => {
    const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : evaluateExpression(arg, "arg", options));
    const fnSegments = fn.split(".");
    if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) {
        return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs);
    }
    return endpointFunctions[fn](...evaluatedArgs);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js



const evaluateCondition = ({ assign, ...fnArgs }, options) => {
    if (assign && assign in options.referenceRecord) {
        throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
    }
    const value = callFunction(fnArgs, options);
    options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);
    return {
        result: value === "" ? true : !!value,
        ...(assign != null && { toAssign: { name: assign, value } }),
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js


const evaluateConditions = (conditions = [], options) => {
    const conditionsReferenceRecord = {};
    for (const condition of conditions) {
        const { result, toAssign } = evaluateCondition(condition, {
            ...options,
            referenceRecord: {
                ...options.referenceRecord,
                ...conditionsReferenceRecord,
            },
        });
        if (!result) {
            return { result };
        }
        if (toAssign) {
            conditionsReferenceRecord[toAssign.name] = toAssign.value;
            options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);
        }
    }
    return { result: true, referenceRecord: conditionsReferenceRecord };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js


const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({
    ...acc,
    [headerKey]: headerVal.map((headerValEntry) => {
        const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
        if (typeof processedExpr !== "string") {
            throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);
        }
        return processedExpr;
    }),
}), {});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperty.js



const getEndpointProperty = (property, options) => {
    if (Array.isArray(property)) {
        return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));
    }
    switch (typeof property) {
        case "string":
            return evaluateTemplate(property, options);
        case "object":
            if (property === null) {
                throw new EndpointError(`Unexpected endpoint property: ${property}`);
            }
            return getEndpointProperties(property, options);
        case "boolean":
            return property;
        default:
            throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`);
    }
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js

const getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({
    ...acc,
    [propertyKey]: getEndpointProperty(propertyVal, options),
}), {});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js


const getEndpointUrl = (endpointUrl, options) => {
    const expression = evaluateExpression(endpointUrl, "Endpoint URL", options);
    if (typeof expression === "string") {
        try {
            return new URL(expression);
        }
        catch (error) {
            console.error(`Failed to construct URL with ${expression}`, error);
            throw error;
        }
    }
    throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js





const evaluateEndpointRule = (endpointRule, options) => {
    const { conditions, endpoint } = endpointRule;
    const { result, referenceRecord } = evaluateConditions(conditions, options);
    if (!result) {
        return;
    }
    const endpointRuleOptions = {
        ...options,
        referenceRecord: { ...options.referenceRecord, ...referenceRecord },
    };
    const { url, properties, headers } = endpoint;
    options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
    return {
        ...(headers != undefined && {
            headers: getEndpointHeaders(headers, endpointRuleOptions),
        }),
        ...(properties != undefined && {
            properties: getEndpointProperties(properties, endpointRuleOptions),
        }),
        url: getEndpointUrl(url, endpointRuleOptions),
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js



const evaluateErrorRule = (errorRule, options) => {
    const { conditions, error } = errorRule;
    const { result, referenceRecord } = evaluateConditions(conditions, options);
    if (!result) {
        return;
    }
    throw new EndpointError(evaluateExpression(error, "Error", {
        ...options,
        referenceRecord: { ...options.referenceRecord, ...referenceRecord },
    }));
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTreeRule.js


const evaluateTreeRule = (treeRule, options) => {
    const { conditions, rules } = treeRule;
    const { result, referenceRecord } = evaluateConditions(conditions, options);
    if (!result) {
        return;
    }
    return evaluateRules(rules, {
        ...options,
        referenceRecord: { ...options.referenceRecord, ...referenceRecord },
    });
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js




const evaluateRules = (rules, options) => {
    for (const rule of rules) {
        if (rule.type === "endpoint") {
            const endpointOrUndefined = evaluateEndpointRule(rule, options);
            if (endpointOrUndefined) {
                return endpointOrUndefined;
            }
        }
        else if (rule.type === "error") {
            evaluateErrorRule(rule, options);
        }
        else if (rule.type === "tree") {
            const endpointOrUndefined = evaluateTreeRule(rule, options);
            if (endpointOrUndefined) {
                return endpointOrUndefined;
            }
        }
        else {
            throw new EndpointError(`Unknown endpoint rule: ${rule}`);
        }
    }
    throw new EndpointError(`Rules evaluation failed`);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/utils/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js



const resolveEndpoint = (ruleSetObject, options) => {
    const { endpointParams, logger } = options;
    const { parameters, rules } = ruleSetObject;
    options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
    const paramsWithDefault = Object.entries(parameters)
        .filter(([, v]) => v.default != null)
        .map(([k, v]) => [k, v.default]);
    if (paramsWithDefault.length > 0) {
        for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
            endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
        }
    }
    const requiredParams = Object.entries(parameters)
        .filter(([, v]) => v.required)
        .map(([k]) => k);
    for (const requiredParam of requiredParams) {
        if (endpointParams[requiredParam] == null) {
            throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
        }
    }
    const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
    options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
    return endpoint;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-endpoints/dist-es/index.js







;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js


const isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
    if (allowSubDomains) {
        for (const label of value.split(".")) {
            if (!isVirtualHostableS3Bucket(label)) {
                return false;
            }
        }
        return true;
    }
    if (!isValidHostLabel(value)) {
        return false;
    }
    if (value.length < 3 || value.length > 63) {
        return false;
    }
    if (value !== value.toLowerCase()) {
        return false;
    }
    if (isIpAddress(value)) {
        return false;
    }
    return true;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js
const ARN_DELIMITER = ":";
const RESOURCE_DELIMITER = "/";
const parseArn = (value) => {
    const segments = value.split(ARN_DELIMITER);
    if (segments.length < 6)
        return null;
    const [arn, partition, service, region, accountId, ...resourcePath] = segments;
    if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
        return null;
    const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
    return {
        partition,
        service,
        region,
        accountId,
        resourceId,
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json
var partitions_namespaceObject = /*#__PURE__*/JSON.parse('{"partitions":[{"id":"aws","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","implicitGlobalRegion":"us-east-1","name":"aws","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^(us|eu|ap|sa|ca|me|af|il|mx)\\\\-\\\\w+\\\\-\\\\d+$","regions":{"af-south-1":{"description":"Africa (Cape Town)"},"ap-east-1":{"description":"Asia Pacific (Hong Kong)"},"ap-northeast-1":{"description":"Asia Pacific (Tokyo)"},"ap-northeast-2":{"description":"Asia Pacific (Seoul)"},"ap-northeast-3":{"description":"Asia Pacific (Osaka)"},"ap-south-1":{"description":"Asia Pacific (Mumbai)"},"ap-south-2":{"description":"Asia Pacific (Hyderabad)"},"ap-southeast-1":{"description":"Asia Pacific (Singapore)"},"ap-southeast-2":{"description":"Asia Pacific (Sydney)"},"ap-southeast-3":{"description":"Asia Pacific (Jakarta)"},"ap-southeast-4":{"description":"Asia Pacific (Melbourne)"},"ap-southeast-5":{"description":"Asia Pacific (Malaysia)"},"ap-southeast-7":{"description":"Asia Pacific (Thailand)"},"aws-global":{"description":"AWS Standard global region"},"ca-central-1":{"description":"Canada (Central)"},"ca-west-1":{"description":"Canada West (Calgary)"},"eu-central-1":{"description":"Europe (Frankfurt)"},"eu-central-2":{"description":"Europe (Zurich)"},"eu-north-1":{"description":"Europe (Stockholm)"},"eu-south-1":{"description":"Europe (Milan)"},"eu-south-2":{"description":"Europe (Spain)"},"eu-west-1":{"description":"Europe (Ireland)"},"eu-west-2":{"description":"Europe (London)"},"eu-west-3":{"description":"Europe (Paris)"},"il-central-1":{"description":"Israel (Tel Aviv)"},"me-central-1":{"description":"Middle East (UAE)"},"me-south-1":{"description":"Middle East (Bahrain)"},"mx-central-1":{"description":"Mexico (Central)"},"sa-east-1":{"description":"South America (Sao Paulo)"},"us-east-1":{"description":"US East (N. Virginia)"},"us-east-2":{"description":"US East (Ohio)"},"us-west-1":{"description":"US West (N. California)"},"us-west-2":{"description":"US West (Oregon)"}}},{"id":"aws-cn","outputs":{"dnsSuffix":"amazonaws.com.cn","dualStackDnsSuffix":"api.amazonwebservices.com.cn","implicitGlobalRegion":"cn-northwest-1","name":"aws-cn","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^cn\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-cn-global":{"description":"AWS China global region"},"cn-north-1":{"description":"China (Beijing)"},"cn-northwest-1":{"description":"China (Ningxia)"}}},{"id":"aws-us-gov","outputs":{"dnsSuffix":"amazonaws.com","dualStackDnsSuffix":"api.aws","implicitGlobalRegion":"us-gov-west-1","name":"aws-us-gov","supportsDualStack":true,"supportsFIPS":true},"regionRegex":"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-us-gov-global":{"description":"AWS GovCloud (US) global region"},"us-gov-east-1":{"description":"AWS GovCloud (US-East)"},"us-gov-west-1":{"description":"AWS GovCloud (US-West)"}}},{"id":"aws-iso","outputs":{"dnsSuffix":"c2s.ic.gov","dualStackDnsSuffix":"c2s.ic.gov","implicitGlobalRegion":"us-iso-east-1","name":"aws-iso","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-global":{"description":"AWS ISO (US) global region"},"us-iso-east-1":{"description":"US ISO East"},"us-iso-west-1":{"description":"US ISO WEST"}}},{"id":"aws-iso-b","outputs":{"dnsSuffix":"sc2s.sgov.gov","dualStackDnsSuffix":"sc2s.sgov.gov","implicitGlobalRegion":"us-isob-east-1","name":"aws-iso-b","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-b-global":{"description":"AWS ISOB (US) global region"},"us-isob-east-1":{"description":"US ISOB East (Ohio)"}}},{"id":"aws-iso-e","outputs":{"dnsSuffix":"cloud.adc-e.uk","dualStackDnsSuffix":"cloud.adc-e.uk","implicitGlobalRegion":"eu-isoe-west-1","name":"aws-iso-e","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-e-global":{"description":"AWS ISOE (Europe) global region"},"eu-isoe-west-1":{"description":"EU ISOE West"}}},{"id":"aws-iso-f","outputs":{"dnsSuffix":"csp.hci.ic.gov","dualStackDnsSuffix":"csp.hci.ic.gov","implicitGlobalRegion":"us-isof-south-1","name":"aws-iso-f","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$","regions":{"aws-iso-f-global":{"description":"AWS ISOF global region"},"us-isof-east-1":{"description":"US ISOF EAST"},"us-isof-south-1":{"description":"US ISOF SOUTH"}}},{"id":"aws-eusc","outputs":{"dnsSuffix":"amazonaws.eu","dualStackDnsSuffix":"amazonaws.eu","implicitGlobalRegion":"eusc-de-east-1","name":"aws-eusc","supportsDualStack":false,"supportsFIPS":true},"regionRegex":"^eusc\\\\-(de)\\\\-\\\\w+\\\\-\\\\d+$","regions":{"eusc-de-east-1":{"description":"EU (Germany)"}}}],"version":"1.1"}');
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js

let selectedPartitionsInfo = partitions_namespaceObject;
let selectedUserAgentPrefix = "";
const partition = (value) => {
    const { partitions } = selectedPartitionsInfo;
    for (const partition of partitions) {
        const { regions, outputs } = partition;
        for (const [region, regionData] of Object.entries(regions)) {
            if (region === value) {
                return {
                    ...outputs,
                    ...regionData,
                };
            }
        }
    }
    for (const partition of partitions) {
        const { regionRegex, outputs } = partition;
        if (new RegExp(regionRegex).test(value)) {
            return {
                ...outputs,
            };
        }
    }
    const DEFAULT_PARTITION = partitions.find((partition) => partition.id === "aws");
    if (!DEFAULT_PARTITION) {
        throw new Error("Provided region was not found in the partition array or regex," +
            " and default partition with id 'aws' doesn't exist.");
    }
    return {
        ...DEFAULT_PARTITION.outputs,
    };
};
const setPartitionInfo = (partitionsInfo, userAgentPrefix = "") => {
    selectedPartitionsInfo = partitionsInfo;
    selectedUserAgentPrefix = userAgentPrefix;
};
const useDefaultPartitionInfo = () => {
    setPartitionInfo(partitionsInfo, "");
};
const getUserAgentPrefix = () => selectedUserAgentPrefix;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-endpoints/dist-es/aws.js




const awsEndpointFunctions = {
    isVirtualHostableS3Bucket: isVirtualHostableS3Bucket,
    parseArn: parseArn,
    partition: partition,
};
customEndpointFunctions.aws = awsEndpointFunctions;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js







;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-endpoints/dist-es/index.js






;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js

const ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
async function checkFeatures(context, config, args) {
    const request = args.request;
    if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
        setFeature_setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M");
    }
    if (typeof config.retryStrategy === "function") {
        const retryStrategy = await config.retryStrategy();
        if (typeof retryStrategy.acquireInitialRetryToken === "function") {
            if (retryStrategy.constructor?.name?.includes("Adaptive")) {
                setFeature_setFeature(context, "RETRY_MODE_ADAPTIVE", "F");
            }
            else {
                setFeature_setFeature(context, "RETRY_MODE_STANDARD", "E");
            }
        }
        else {
            setFeature_setFeature(context, "RETRY_MODE_LEGACY", "D");
        }
    }
    if (typeof config.accountIdEndpointMode === "function") {
        const endpointV2 = context.endpointV2;
        if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
            setFeature_setFeature(context, "ACCOUNT_ID_ENDPOINT", "O");
        }
        switch (await config.accountIdEndpointMode?.()) {
            case "disabled":
                setFeature_setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
                break;
            case "preferred":
                setFeature_setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
                break;
            case "required":
                setFeature_setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
                break;
        }
    }
    const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity;
    if (identity?.$source) {
        const credentials = identity;
        if (credentials.accountId) {
            setFeature_setFeature(context, "RESOLVED_ACCOUNT_ID", "T");
        }
        for (const [key, value] of Object.entries(credentials.$source ?? {})) {
            setFeature_setFeature(context, key, value);
        }
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js
const USER_AGENT = "user-agent";
const X_AMZ_USER_AGENT = "x-amz-user-agent";
const SPACE = " ";
const UA_NAME_SEPARATOR = "/";
const UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g;
const UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g;
const UA_ESCAPE_CHAR = "-";

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js
const BYTE_LIMIT = 1024;
function encodeFeatures(features) {
    let buffer = "";
    for (const key in features) {
        const val = features[key];
        if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
            if (buffer.length) {
                buffer += "," + val;
            }
            else {
                buffer += val;
            }
            continue;
        }
        break;
    }
    return buffer;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js





const userAgentMiddleware = (options) => (next, context) => async (args) => {
    const { request } = args;
    if (!httpRequest_HttpRequest.isInstance(request)) {
        return next(args);
    }
    const { headers } = request;
    const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
    const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
    await checkFeatures(context, options, args);
    const awsContext = context;
    defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);
    const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
    const appId = await options.userAgentAppId();
    if (appId) {
        defaultUserAgent.push(escapeUserAgent([`app/${appId}`]));
    }
    const prefix = getUserAgentPrefix();
    const sdkUserAgentValue = (prefix ? [prefix] : [])
        .concat([...defaultUserAgent, ...userAgent, ...customUserAgent])
        .join(SPACE);
    const normalUAValue = [
        ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
        ...customUserAgent,
    ].join(SPACE);
    if (options.runtime !== "browser") {
        if (normalUAValue) {
            headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT]
                ? `${headers[USER_AGENT]} ${normalUAValue}`
                : normalUAValue;
        }
        headers[USER_AGENT] = sdkUserAgentValue;
    }
    else {
        headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
    }
    return next({
        ...args,
        request,
    });
};
const escapeUserAgent = (userAgentPair) => {
    const name = userAgentPair[0]
        .split(UA_NAME_SEPARATOR)
        .map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR))
        .join(UA_NAME_SEPARATOR);
    const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
    const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
    const prefix = name.substring(0, prefixSeparatorIndex);
    let uaName = name.substring(prefixSeparatorIndex + 1);
    if (prefix === "api") {
        uaName = uaName.toLowerCase();
    }
    return [prefix, uaName, version]
        .filter((item) => item && item.length > 0)
        .reduce((acc, item, index) => {
        switch (index) {
            case 0:
                return item;
            case 1:
                return `${acc}/${item}`;
            default:
                return `${acc}#${item}`;
        }
    }, "");
};
const getUserAgentMiddlewareOptions = {
    name: "getUserAgentMiddleware",
    step: "build",
    priority: "low",
    tags: ["SET_USER_AGENT", "USER_AGENT"],
    override: true,
};
const getUserAgentPlugin = (config) => ({
    applyToStack: (clientStack) => {
        clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js

const ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT";
const CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint";
const DEFAULT_USE_DUALSTACK_ENDPOINT = false;
const NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = {
    environmentVariableSelector: (env) => booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, types_SelectorType.ENV),
    configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, types_SelectorType.CONFIG),
    default: false,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js

const ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT";
const CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint";
const DEFAULT_USE_FIPS_ENDPOINT = false;
const NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {
    environmentVariableSelector: (env) => booleanSelector(env, ENV_USE_FIPS_ENDPOINT, types_SelectorType.ENV),
    configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, types_SelectorType.CONFIG),
    default: false,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveCustomEndpointsConfig.js

const resolveCustomEndpointsConfig = (input) => {
    const { tls, endpoint, urlParser, useDualstackEndpoint } = input;
    return Object.assign(input, {
        tls: tls ?? true,
        endpoint: normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint),
        isCustomEndpoint: true,
        useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
    });
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/resolveEndpointsConfig.js


const resolveEndpointsConfig = (input) => {
    const useDualstackEndpoint = normalizeProvider(input.useDualstackEndpoint ?? false);
    const { endpoint, useFipsEndpoint, urlParser, tls } = input;
    return Object.assign(input, {
        tls: tls ?? true,
        endpoint: endpoint
            ? normalizeProvider(typeof endpoint === "string" ? urlParser(endpoint) : endpoint)
            : () => getEndpointFromRegion({ ...input, useDualstackEndpoint, useFipsEndpoint }),
        isCustomEndpoint: !!endpoint,
        useDualstackEndpoint,
    });
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/index.js





;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js
const REGION_ENV_NAME = "AWS_REGION";
const REGION_INI_NAME = "region";
const NODE_REGION_CONFIG_OPTIONS = {
    environmentVariableSelector: (env) => env[REGION_ENV_NAME],
    configFileSelector: (profile) => profile[REGION_INI_NAME],
    default: () => {
        throw new Error("Region is missing");
    },
};
const NODE_REGION_CONFIG_FILE_OPTIONS = {
    preferredFile: "credentials",
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js
const isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips"));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js

const getRealRegion = (region) => isFipsRegion(region)
    ? ["fips-aws-global", "aws-fips"].includes(region)
        ? "us-east-1"
        : region.replace(/fips-(dkr-|prod-)?|-fips/, "")
    : region;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js


const resolveRegionConfig = (input) => {
    const { region, useFipsEndpoint } = input;
    if (!region) {
        throw new Error("Region is missing");
    }
    return Object.assign(input, {
        region: async () => {
            if (typeof region === "string") {
                return getRealRegion(region);
            }
            const providedRegion = await region();
            return getRealRegion(providedRegion);
        },
        useFipsEndpoint: async () => {
            const providedRegion = typeof region === "string" ? region : await region();
            if (isFipsRegion(providedRegion)) {
                return true;
            }
            return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
        },
    });
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/regionConfig/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/config-resolver/dist-es/index.js




;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-serde-config-resolver/dist-es/EventStreamSerdeConfig.js
const resolveEventStreamSerdeConfig = (input) => Object.assign(input, {
    eventStreamMarshaller: input.eventStreamSerdeProvider(input),
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-content-length/dist-es/index.js

const dist_es_CONTENT_LENGTH_HEADER = "content-length";
function contentLengthMiddleware(bodyLengthChecker) {
    return (next) => async (args) => {
        const request = args.request;
        if (httpRequest_HttpRequest.isInstance(request)) {
            const { body, headers } = request;
            if (body &&
                Object.keys(headers)
                    .map((str) => str.toLowerCase())
                    .indexOf(dist_es_CONTENT_LENGTH_HEADER) === -1) {
                try {
                    const length = bodyLengthChecker(body);
                    request.headers = {
                        ...request.headers,
                        [dist_es_CONTENT_LENGTH_HEADER]: String(length),
                    };
                }
                catch (error) {
                }
            }
        }
        return next({
            ...args,
            request,
        });
    };
}
const contentLengthMiddlewareOptions = {
    step: "build",
    tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"],
    name: "contentLengthMiddleware",
    override: true,
};
const getContentLengthPlugin = (options) => ({
    applyToStack: (clientStack) => {
        clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js
const resolveParamsForS3 = async (endpointParams) => {
    const bucket = endpointParams?.Bucket || "";
    if (typeof endpointParams.Bucket === "string") {
        endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"));
    }
    if (isArnBucketName(bucket)) {
        if (endpointParams.ForcePathStyle === true) {
            throw new Error("Path-style addressing cannot be used with ARN buckets");
        }
    }
    else if (!isDnsCompatibleBucketName(bucket) ||
        (bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:")) ||
        bucket.toLowerCase() !== bucket ||
        bucket.length < 3) {
        endpointParams.ForcePathStyle = true;
    }
    if (endpointParams.DisableMultiRegionAccessPoints) {
        endpointParams.disableMultiRegionAccessPoints = true;
        endpointParams.DisableMRAP = true;
    }
    return endpointParams;
};
const DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/;
const IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
const DOTS_PATTERN = /\.\./;
const DOT_PATTERN = /\./;
const S3_HOSTNAME_PATTERN = /^(.+\.)?s3(-fips)?(\.dualstack)?[.-]([a-z0-9-]+)\./;
const isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName);
const isArnBucketName = (bucketName) => {
    const [arn, partition, service, , , bucket] = bucketName.split(":");
    const isArn = arn === "arn" && bucketName.split(":").length >= 6;
    const isValidArn = Boolean(isArn && partition && service && bucket);
    if (isArn && !isValidArn) {
        throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);
    }
    return isValidArn;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js
const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config) => {
    const configProvider = async () => {
        const configValue = config[configKey] ?? config[canonicalEndpointParamKey];
        if (typeof configValue === "function") {
            return configValue();
        }
        return configValue;
    };
    if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
        return async () => {
            const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
            const configValue = credentials?.credentialScope ?? credentials?.CredentialScope;
            return configValue;
        };
    }
    if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") {
        return async () => {
            const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
            const configValue = credentials?.accountId ?? credentials?.AccountId;
            return configValue;
        };
    }
    if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
        return async () => {
            const endpoint = await configProvider();
            if (endpoint && typeof endpoint === "object") {
                if ("url" in endpoint) {
                    return endpoint.url.href;
                }
                if ("hostname" in endpoint) {
                    const { protocol, hostname, port, path } = endpoint;
                    return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`;
                }
            }
            return endpoint;
        };
    }
    return configProvider;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.browser.js
const getEndpointFromConfig = async (serviceId) => undefined;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/querystring-parser/dist-es/index.js
function parseQueryString(querystring) {
    const query = {};
    querystring = querystring.replace(/^\?/, "");
    if (querystring) {
        for (const pair of querystring.split("&")) {
            let [key, value = null] = pair.split("=");
            key = decodeURIComponent(key);
            if (value) {
                value = decodeURIComponent(value);
            }
            if (!(key in query)) {
                query[key] = value;
            }
            else if (Array.isArray(query[key])) {
                query[key].push(value);
            }
            else {
                query[key] = [query[key], value];
            }
        }
    }
    return query;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/url-parser/dist-es/index.js

const parseUrl = (url) => {
    if (typeof url === "string") {
        return parseUrl(new URL(url));
    }
    const { hostname, pathname, port, protocol, search } = url;
    let query;
    if (search) {
        query = parseQueryString(search);
    }
    return {
        hostname,
        port: port ? parseInt(port) : undefined,
        protocol,
        path: pathname,
        query,
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js

const toEndpointV1 = (endpoint) => {
    if (typeof endpoint === "object") {
        if ("url" in endpoint) {
            return parseUrl(endpoint.url);
        }
        return endpoint;
    }
    return parseUrl(endpoint);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js




const getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => {
    if (!clientConfig.endpoint) {
        let endpointFromConfig;
        if (clientConfig.serviceConfiguredEndpoint) {
            endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
        }
        else {
            endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId);
        }
        if (endpointFromConfig) {
            clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
        }
    }
    const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
    if (typeof clientConfig.endpointProvider !== "function") {
        throw new Error("config.endpointProvider is not set.");
    }
    const endpoint = clientConfig.endpointProvider(endpointParams, context);
    return endpoint;
};
const resolveParams = async (commandInput, instructionsSupplier, clientConfig) => {
    const endpointParams = {};
    const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};
    for (const [name, instruction] of Object.entries(instructions)) {
        switch (instruction.type) {
            case "staticContextParams":
                endpointParams[name] = instruction.value;
                break;
            case "contextParams":
                endpointParams[name] = commandInput[instruction.name];
                break;
            case "clientContextParams":
            case "builtInParams":
                endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)();
                break;
            case "operationContextParams":
                endpointParams[name] = instruction.get(commandInput);
                break;
            default:
                throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
        }
    }
    if (Object.keys(instructions).length === 0) {
        Object.assign(endpointParams, clientConfig);
    }
    if (String(clientConfig.serviceId).toLowerCase() === "s3") {
        await resolveParamsForS3(endpointParams);
    }
    return endpointParams;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js



const endpointMiddleware = ({ config, instructions, }) => {
    return (next, context) => async (args) => {
        if (config.endpoint) {
            dist_es_setFeature_setFeature(context, "ENDPOINT_OVERRIDE", "N");
        }
        const endpoint = await getEndpointFromInstructions(args.input, {
            getEndpointParameterInstructions() {
                return instructions;
            },
        }, { ...config }, context);
        context.endpointV2 = endpoint;
        context.authSchemes = endpoint.properties?.authSchemes;
        const authScheme = context.authSchemes?.[0];
        if (authScheme) {
            context["signing_region"] = authScheme.signingRegion;
            context["signing_service"] = authScheme.signingName;
            const smithyContext = getSmithyContext(context);
            const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
            if (httpAuthOption) {
                httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
                    signing_region: authScheme.signingRegion,
                    signingRegion: authScheme.signingRegion,
                    signing_service: authScheme.signingName,
                    signingName: authScheme.signingName,
                    signingRegionSet: authScheme.signingRegionSet,
                }, authScheme.properties);
            }
        }
        return next({
            ...args,
        });
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js


const endpointMiddlewareOptions = {
    step: "serialize",
    tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"],
    name: "endpointV2Middleware",
    override: true,
    relation: "before",
    toMiddleware: serializerMiddlewareOption.name,
};
const getEndpointPlugin = (config, instructions) => ({
    applyToStack: (clientStack) => {
        clientStack.addRelativeTo(endpointMiddleware({
            config,
            instructions,
        }), endpointMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js



const resolveEndpointConfig = (input) => {
    const tls = input.tls ?? true;
    const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;
    const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await normalizeProvider_normalizeProvider(endpoint)()) : undefined;
    const isCustomEndpoint = !!endpoint;
    const resolvedConfig = Object.assign(input, {
        endpoint: customEndpointProvider,
        tls,
        isCustomEndpoint,
        useDualstackEndpoint: normalizeProvider_normalizeProvider(useDualstackEndpoint ?? false),
        useFipsEndpoint: normalizeProvider_normalizeProvider(useFipsEndpoint ?? false),
    });
    let configuredEndpointPromise = undefined;
    resolvedConfig.serviceConfiguredEndpoint = async () => {
        if (input.serviceId && !configuredEndpointPromise) {
            configuredEndpointPromise = getEndpointFromConfig(input.serviceId);
        }
        return configuredEndpointPromise;
    };
    return resolvedConfig;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-endpoint/dist-es/index.js






;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-retry/dist-es/config.js
var RETRY_MODES;
(function (RETRY_MODES) {
    RETRY_MODES["STANDARD"] = "standard";
    RETRY_MODES["ADAPTIVE"] = "adaptive";
})(RETRY_MODES || (RETRY_MODES = {}));
const DEFAULT_MAX_ATTEMPTS = 3;
const DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/service-error-classification/dist-es/constants.js
const CLOCK_SKEW_ERROR_CODES = [
    "AuthFailure",
    "InvalidSignatureException",
    "RequestExpired",
    "RequestInTheFuture",
    "RequestTimeTooSkewed",
    "SignatureDoesNotMatch",
];
const THROTTLING_ERROR_CODES = [
    "BandwidthLimitExceeded",
    "EC2ThrottledException",
    "LimitExceededException",
    "PriorRequestNotComplete",
    "ProvisionedThroughputExceededException",
    "RequestLimitExceeded",
    "RequestThrottled",
    "RequestThrottledException",
    "SlowDown",
    "ThrottledException",
    "Throttling",
    "ThrottlingException",
    "TooManyRequestsException",
    "TransactionInProgressException",
];
const TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/service-error-classification/dist-es/index.js

const isRetryableByTrait = (error) => error.$retryable !== undefined;
const isClockSkewError = (error) => CLOCK_SKEW_ERROR_CODES.includes(error.name);
const isClockSkewCorrectedError = (error) => error.$metadata?.clockSkewCorrected;
const isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 ||
    THROTTLING_ERROR_CODES.includes(error.name) ||
    error.$retryable?.throttling == true;
const isTransientError = (error, depth = 0) => isClockSkewCorrectedError(error) ||
    TRANSIENT_ERROR_CODES.includes(error.name) ||
    NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") ||
    TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) ||
    (error.cause !== undefined && depth <= 10 && isTransientError(error.cause, depth + 1));
const isServerError = (error) => {
    if (error.$metadata?.httpStatusCode !== undefined) {
        const statusCode = error.$metadata.httpStatusCode;
        if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {
            return true;
        }
        return false;
    }
    return false;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js

class DefaultRateLimiter {
    constructor(options) {
        this.currentCapacity = 0;
        this.enabled = false;
        this.lastMaxRate = 0;
        this.measuredTxRate = 0;
        this.requestCount = 0;
        this.lastTimestamp = 0;
        this.timeWindow = 0;
        this.beta = options?.beta ?? 0.7;
        this.minCapacity = options?.minCapacity ?? 1;
        this.minFillRate = options?.minFillRate ?? 0.5;
        this.scaleConstant = options?.scaleConstant ?? 0.4;
        this.smooth = options?.smooth ?? 0.8;
        const currentTimeInSeconds = this.getCurrentTimeInSeconds();
        this.lastThrottleTime = currentTimeInSeconds;
        this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
        this.fillRate = this.minFillRate;
        this.maxCapacity = this.minCapacity;
    }
    getCurrentTimeInSeconds() {
        return Date.now() / 1000;
    }
    async getSendToken() {
        return this.acquireTokenBucket(1);
    }
    async acquireTokenBucket(amount) {
        if (!this.enabled) {
            return;
        }
        this.refillTokenBucket();
        if (amount > this.currentCapacity) {
            const delay = ((amount - this.currentCapacity) / this.fillRate) * 1000;
            await new Promise((resolve) => DefaultRateLimiter.setTimeoutFn(resolve, delay));
        }
        this.currentCapacity = this.currentCapacity - amount;
    }
    refillTokenBucket() {
        const timestamp = this.getCurrentTimeInSeconds();
        if (!this.lastTimestamp) {
            this.lastTimestamp = timestamp;
            return;
        }
        const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
        this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount);
        this.lastTimestamp = timestamp;
    }
    updateClientSendingRate(response) {
        let calculatedRate;
        this.updateMeasuredRate();
        if (isThrottlingError(response)) {
            const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
            this.lastMaxRate = rateToUse;
            this.calculateTimeWindow();
            this.lastThrottleTime = this.getCurrentTimeInSeconds();
            calculatedRate = this.cubicThrottle(rateToUse);
            this.enableTokenBucket();
        }
        else {
            this.calculateTimeWindow();
            calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
        }
        const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);
        this.updateTokenBucketRate(newRate);
    }
    calculateTimeWindow() {
        this.timeWindow = this.getPrecise(Math.pow((this.lastMaxRate * (1 - this.beta)) / this.scaleConstant, 1 / 3));
    }
    cubicThrottle(rateToUse) {
        return this.getPrecise(rateToUse * this.beta);
    }
    cubicSuccess(timestamp) {
        return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
    }
    enableTokenBucket() {
        this.enabled = true;
    }
    updateTokenBucketRate(newRate) {
        this.refillTokenBucket();
        this.fillRate = Math.max(newRate, this.minFillRate);
        this.maxCapacity = Math.max(newRate, this.minCapacity);
        this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity);
    }
    updateMeasuredRate() {
        const t = this.getCurrentTimeInSeconds();
        const timeBucket = Math.floor(t * 2) / 2;
        this.requestCount++;
        if (timeBucket > this.lastTxRateBucket) {
            const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
            this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
            this.requestCount = 0;
            this.lastTxRateBucket = timeBucket;
        }
    }
    getPrecise(num) {
        return parseFloat(num.toFixed(8));
    }
}
DefaultRateLimiter.setTimeoutFn = setTimeout;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-retry/dist-es/constants.js
const DEFAULT_RETRY_DELAY_BASE = 100;
const MAXIMUM_RETRY_DELAY = 20 * 1000;
const THROTTLING_RETRY_DELAY_BASE = 500;
const INITIAL_RETRY_TOKENS = 500;
const RETRY_COST = 5;
const TIMEOUT_RETRY_COST = 10;
const NO_RETRY_INCREMENT = 1;
const constants_INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
const constants_REQUEST_HEADER = "amz-sdk-request";

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js

const getDefaultRetryBackoffStrategy = () => {
    let delayBase = DEFAULT_RETRY_DELAY_BASE;
    const computeNextBackoffDelay = (attempts) => {
        return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));
    };
    const setDelayBase = (delay) => {
        delayBase = delay;
    };
    return {
        computeNextBackoffDelay,
        setDelayBase,
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js

const createDefaultRetryToken = ({ retryDelay, retryCount, retryCost, }) => {
    const getRetryCount = () => retryCount;
    const getRetryDelay = () => Math.min(MAXIMUM_RETRY_DELAY, retryDelay);
    const getRetryCost = () => retryCost;
    return {
        getRetryCount,
        getRetryDelay,
        getRetryCost,
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js




class StandardRetryStrategy {
    constructor(maxAttempts) {
        this.maxAttempts = maxAttempts;
        this.mode = RETRY_MODES.STANDARD;
        this.capacity = INITIAL_RETRY_TOKENS;
        this.retryBackoffStrategy = getDefaultRetryBackoffStrategy();
        this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts;
    }
    async acquireInitialRetryToken(retryTokenScope) {
        return createDefaultRetryToken({
            retryDelay: DEFAULT_RETRY_DELAY_BASE,
            retryCount: 0,
        });
    }
    async refreshRetryTokenForRetry(token, errorInfo) {
        const maxAttempts = await this.getMaxAttempts();
        if (this.shouldRetry(token, errorInfo, maxAttempts)) {
            const errorType = errorInfo.errorType;
            this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE);
            const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
            const retryDelay = errorInfo.retryAfterHint
                ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType)
                : delayFromErrorType;
            const capacityCost = this.getCapacityCost(errorType);
            this.capacity -= capacityCost;
            return createDefaultRetryToken({
                retryDelay,
                retryCount: token.getRetryCount() + 1,
                retryCost: capacityCost,
            });
        }
        throw new Error("No retry token available");
    }
    recordSuccess(token) {
        this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
    }
    getCapacity() {
        return this.capacity;
    }
    async getMaxAttempts() {
        try {
            return await this.maxAttemptsProvider();
        }
        catch (error) {
            console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
            return DEFAULT_MAX_ATTEMPTS;
        }
    }
    shouldRetry(tokenToRenew, errorInfo, maxAttempts) {
        const attempts = tokenToRenew.getRetryCount() + 1;
        return (attempts < maxAttempts &&
            this.capacity >= this.getCapacityCost(errorInfo.errorType) &&
            this.isRetryableError(errorInfo.errorType));
    }
    getCapacityCost(errorType) {
        return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST;
    }
    isRetryableError(errorType) {
        return errorType === "THROTTLING" || errorType === "TRANSIENT";
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js



class AdaptiveRetryStrategy {
    constructor(maxAttemptsProvider, options) {
        this.maxAttemptsProvider = maxAttemptsProvider;
        this.mode = RETRY_MODES.ADAPTIVE;
        const { rateLimiter } = options ?? {};
        this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
        this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);
    }
    async acquireInitialRetryToken(retryTokenScope) {
        await this.rateLimiter.getSendToken();
        return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
    }
    async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
        this.rateLimiter.updateClientSendingRate(errorInfo);
        return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
    }
    recordSuccess(token) {
        this.rateLimiter.updateClientSendingRate({});
        this.standardRetryStrategy.recordSuccess(token);
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js


class ConfiguredRetryStrategy extends StandardRetryStrategy {
    constructor(maxAttempts, computeNextBackoffDelay = DEFAULT_RETRY_DELAY_BASE) {
        super(typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts);
        if (typeof computeNextBackoffDelay === "number") {
            this.computeNextBackoffDelay = () => computeNextBackoffDelay;
        }
        else {
            this.computeNextBackoffDelay = computeNextBackoffDelay;
        }
    }
    async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
        const token = await super.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
        token.getRetryDelay = () => this.computeNextBackoffDelay(token.getRetryCount());
        return token;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-retry/dist-es/index.js








;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/uuid/dist/esm-browser/native.js
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
/* harmony default export */ var esm_browser_native = ({
  randomUUID
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/uuid/dist/esm-browser/rng.js
// Unique ID creation requires a high quality random # generator. In the browser we therefore
// require the crypto API and do not support built-in fallback to lower quality random number
// generators (like Math.random()).
let getRandomValues;
const rnds8 = new Uint8Array(16);
function rng() {
  // lazy load so that environments that need to polyfill have a chance to do so
  if (!getRandomValues) {
    // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
    getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);

    if (!getRandomValues) {
      throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
    }
  }

  return getRandomValues(rnds8);
}
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/uuid/dist/esm-browser/stringify.js

/**
 * Convert array of 16 byte values to UUID string format of the form:
 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
 */

const byteToHex = [];

for (let i = 0; i < 256; ++i) {
  byteToHex.push((i + 0x100).toString(16).slice(1));
}

function unsafeStringify(arr, offset = 0) {
  // Note: Be careful editing this code!  It's been tuned for performance
  // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
  return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
}

function stringify(arr, offset = 0) {
  const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID.  If this throws, it's likely due to one
  // of the following:
  // - One or more input array values don't map to a hex octet (leading to
  // "undefined" in the uuid)
  // - Invalid input values for the RFC `version` or `variant` fields

  if (!validate(uuid)) {
    throw TypeError('Stringified UUID is invalid');
  }

  return uuid;
}

/* harmony default export */ var esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify)));
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/uuid/dist/esm-browser/v4.js




function v4(options, buf, offset) {
  if (esm_browser_native.randomUUID && !buf && !options) {
    return esm_browser_native.randomUUID();
  }

  options = options || {};
  const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`

  rnds[6] = rnds[6] & 0x0f | 0x40;
  rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided

  if (buf) {
    offset = offset || 0;

    for (let i = 0; i < 16; ++i) {
      buf[offset + i] = rnds[i];
    }

    return buf;
  }

  return unsafeStringify(rnds);
}

/* harmony default export */ var esm_browser_v4 = (v4);
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/defaultRetryQuota.js

const getDefaultRetryQuota = (initialRetryTokens, options) => {
    const MAX_CAPACITY = initialRetryTokens;
    const noRetryIncrement = options?.noRetryIncrement ?? NO_RETRY_INCREMENT;
    const retryCost = options?.retryCost ?? RETRY_COST;
    const timeoutRetryCost = options?.timeoutRetryCost ?? TIMEOUT_RETRY_COST;
    let availableCapacity = initialRetryTokens;
    const getCapacityAmount = (error) => (error.name === "TimeoutError" ? timeoutRetryCost : retryCost);
    const hasRetryTokens = (error) => getCapacityAmount(error) <= availableCapacity;
    const retrieveRetryTokens = (error) => {
        if (!hasRetryTokens(error)) {
            throw new Error("No retry token available");
        }
        const capacityAmount = getCapacityAmount(error);
        availableCapacity -= capacityAmount;
        return capacityAmount;
    };
    const releaseRetryTokens = (capacityReleaseAmount) => {
        availableCapacity += capacityReleaseAmount ?? noRetryIncrement;
        availableCapacity = Math.min(availableCapacity, MAX_CAPACITY);
    };
    return Object.freeze({
        hasRetryTokens,
        retrieveRetryTokens,
        releaseRetryTokens,
    });
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/delayDecider.js

const defaultDelayDecider = (delayBase, attempts) => Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/retryDecider.js

const defaultRetryDecider = (error) => {
    if (!error) {
        return false;
    }
    return isRetryableByTrait(error) || isClockSkewError(error) || isThrottlingError(error) || isTransientError(error);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/util.js
const asSdkError = (error) => {
    if (error instanceof Error)
        return error;
    if (error instanceof Object)
        return Object.assign(new Error(), error);
    if (typeof error === "string")
        return new Error(error);
    return new Error(`AWS SDK error wrapper for ${error}`);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js








class StandardRetryStrategy_StandardRetryStrategy {
    constructor(maxAttemptsProvider, options) {
        this.maxAttemptsProvider = maxAttemptsProvider;
        this.mode = RETRY_MODES.STANDARD;
        this.retryDecider = options?.retryDecider ?? defaultRetryDecider;
        this.delayDecider = options?.delayDecider ?? defaultDelayDecider;
        this.retryQuota = options?.retryQuota ?? getDefaultRetryQuota(INITIAL_RETRY_TOKENS);
    }
    shouldRetry(error, attempts, maxAttempts) {
        return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error);
    }
    async getMaxAttempts() {
        let maxAttempts;
        try {
            maxAttempts = await this.maxAttemptsProvider();
        }
        catch (error) {
            maxAttempts = DEFAULT_MAX_ATTEMPTS;
        }
        return maxAttempts;
    }
    async retry(next, args, options) {
        let retryTokenAmount;
        let attempts = 0;
        let totalDelay = 0;
        const maxAttempts = await this.getMaxAttempts();
        const { request } = args;
        if (httpRequest_HttpRequest.isInstance(request)) {
            request.headers[constants_INVOCATION_ID_HEADER] = esm_browser_v4();
        }
        while (true) {
            try {
                if (httpRequest_HttpRequest.isInstance(request)) {
                    request.headers[constants_REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
                }
                if (options?.beforeRequest) {
                    await options.beforeRequest();
                }
                const { response, output } = await next(args);
                if (options?.afterRequest) {
                    options.afterRequest(response);
                }
                this.retryQuota.releaseRetryTokens(retryTokenAmount);
                output.$metadata.attempts = attempts + 1;
                output.$metadata.totalRetryDelay = totalDelay;
                return { response, output };
            }
            catch (e) {
                const err = asSdkError(e);
                attempts++;
                if (this.shouldRetry(err, attempts, maxAttempts)) {
                    retryTokenAmount = this.retryQuota.retrieveRetryTokens(err);
                    const delayFromDecider = this.delayDecider(isThrottlingError(err) ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE, attempts);
                    const delayFromResponse = getDelayFromRetryAfterHeader(err.$response);
                    const delay = Math.max(delayFromResponse || 0, delayFromDecider);
                    totalDelay += delay;
                    await new Promise((resolve) => setTimeout(resolve, delay));
                    continue;
                }
                if (!err.$metadata) {
                    err.$metadata = {};
                }
                err.$metadata.attempts = attempts;
                err.$metadata.totalRetryDelay = totalDelay;
                throw err;
            }
        }
    }
}
const getDelayFromRetryAfterHeader = (response) => {
    if (!httpResponse_HttpResponse.isInstance(response))
        return;
    const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after");
    if (!retryAfterHeaderName)
        return;
    const retryAfter = response.headers[retryAfterHeaderName];
    const retryAfterSeconds = Number(retryAfter);
    if (!Number.isNaN(retryAfterSeconds))
        return retryAfterSeconds * 1000;
    const retryAfterDate = new Date(retryAfter);
    return retryAfterDate.getTime() - Date.now();
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/AdaptiveRetryStrategy.js


class AdaptiveRetryStrategy_AdaptiveRetryStrategy extends StandardRetryStrategy_StandardRetryStrategy {
    constructor(maxAttemptsProvider, options) {
        const { rateLimiter, ...superOptions } = options ?? {};
        super(maxAttemptsProvider, superOptions);
        this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
        this.mode = RETRY_MODES.ADAPTIVE;
    }
    async retry(next, args) {
        return super.retry(next, args, {
            beforeRequest: async () => {
                return this.rateLimiter.getSendToken();
            },
            afterRequest: (response) => {
                this.rateLimiter.updateClientSendingRate(response);
            },
        });
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/configurations.js


const ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
const CONFIG_MAX_ATTEMPTS = "max_attempts";
const NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
    environmentVariableSelector: (env) => {
        const value = env[ENV_MAX_ATTEMPTS];
        if (!value)
            return undefined;
        const maxAttempt = parseInt(value);
        if (Number.isNaN(maxAttempt)) {
            throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`);
        }
        return maxAttempt;
    },
    configFileSelector: (profile) => {
        const value = profile[CONFIG_MAX_ATTEMPTS];
        if (!value)
            return undefined;
        const maxAttempt = parseInt(value);
        if (Number.isNaN(maxAttempt)) {
            throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`);
        }
        return maxAttempt;
    },
    default: DEFAULT_MAX_ATTEMPTS,
};
const resolveRetryConfig = (input) => {
    const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input;
    const maxAttempts = normalizeProvider_normalizeProvider(_maxAttempts ?? DEFAULT_MAX_ATTEMPTS);
    return Object.assign(input, {
        maxAttempts,
        retryStrategy: async () => {
            if (retryStrategy) {
                return retryStrategy;
            }
            const retryMode = await normalizeProvider_normalizeProvider(_retryMode)();
            if (retryMode === RETRY_MODES.ADAPTIVE) {
                return new AdaptiveRetryStrategy(maxAttempts);
            }
            return new StandardRetryStrategy(maxAttempts);
        },
    });
};
const ENV_RETRY_MODE = "AWS_RETRY_MODE";
const CONFIG_RETRY_MODE = "retry_mode";
const NODE_RETRY_MODE_CONFIG_OPTIONS = {
    environmentVariableSelector: (env) => env[ENV_RETRY_MODE],
    configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],
    default: DEFAULT_RETRY_MODE,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js


const omitRetryHeadersMiddleware = () => (next) => async (args) => {
    const { request } = args;
    if (HttpRequest.isInstance(request)) {
        delete request.headers[INVOCATION_ID_HEADER];
        delete request.headers[REQUEST_HEADER];
    }
    return next(args);
};
const omitRetryHeadersMiddlewareOptions = {
    name: "omitRetryHeadersMiddleware",
    tags: ["RETRY", "HEADERS", "OMIT_RETRY_HEADERS"],
    relation: "before",
    toMiddleware: "awsAuthMiddleware",
    override: true,
};
const getOmitRetryHeadersPlugin = (options) => ({
    applyToStack: (clientStack) => {
        clientStack.addRelativeTo(omitRetryHeadersMiddleware(), omitRetryHeadersMiddlewareOptions);
    },
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.browser.js
const isStreamingPayload = (request) => request?.body instanceof ReadableStream;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js







const retryMiddleware = (options) => (next, context) => async (args) => {
    let retryStrategy = await options.retryStrategy();
    const maxAttempts = await options.maxAttempts();
    if (isRetryStrategyV2(retryStrategy)) {
        retryStrategy = retryStrategy;
        let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]);
        let lastError = new Error();
        let attempts = 0;
        let totalRetryDelay = 0;
        const { request } = args;
        const isRequest = httpRequest_HttpRequest.isInstance(request);
        if (isRequest) {
            request.headers[constants_INVOCATION_ID_HEADER] = esm_browser_v4();
        }
        while (true) {
            try {
                if (isRequest) {
                    request.headers[constants_REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
                }
                const { response, output } = await next(args);
                retryStrategy.recordSuccess(retryToken);
                output.$metadata.attempts = attempts + 1;
                output.$metadata.totalRetryDelay = totalRetryDelay;
                return { response, output };
            }
            catch (e) {
                const retryErrorInfo = getRetryErrorInfo(e);
                lastError = asSdkError(e);
                if (isRequest && isStreamingPayload(request)) {
                    (context.logger instanceof NoOpLogger_NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
                    throw lastError;
                }
                try {
                    retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
                }
                catch (refreshError) {
                    if (!lastError.$metadata) {
                        lastError.$metadata = {};
                    }
                    lastError.$metadata.attempts = attempts + 1;
                    lastError.$metadata.totalRetryDelay = totalRetryDelay;
                    throw lastError;
                }
                attempts = retryToken.getRetryCount();
                const delay = retryToken.getRetryDelay();
                totalRetryDelay += delay;
                await new Promise((resolve) => setTimeout(resolve, delay));
            }
        }
    }
    else {
        retryStrategy = retryStrategy;
        if (retryStrategy?.mode)
            context.userAgent = [...(context.userAgent || []), ["cfg/retry-mode", retryStrategy.mode]];
        return retryStrategy.retry(next, args);
    }
};
const isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" &&
    typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" &&
    typeof retryStrategy.recordSuccess !== "undefined";
const getRetryErrorInfo = (error) => {
    const errorInfo = {
        error,
        errorType: getRetryErrorType(error),
    };
    const retryAfterHint = getRetryAfterHint(error.$response);
    if (retryAfterHint) {
        errorInfo.retryAfterHint = retryAfterHint;
    }
    return errorInfo;
};
const getRetryErrorType = (error) => {
    if (isThrottlingError(error))
        return "THROTTLING";
    if (isTransientError(error))
        return "TRANSIENT";
    if (isServerError(error))
        return "SERVER_ERROR";
    return "CLIENT_ERROR";
};
const retryMiddlewareOptions = {
    name: "retryMiddleware",
    tags: ["RETRY"],
    step: "finalizeRequest",
    priority: "high",
    override: true,
};
const getRetryPlugin = (options) => ({
    applyToStack: (clientStack) => {
        clientStack.add(retryMiddleware(options), retryMiddlewareOptions);
    },
});
const getRetryAfterHint = (response) => {
    if (!httpResponse_HttpResponse.isInstance(response))
        return;
    const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after");
    if (!retryAfterHeaderName)
        return;
    const retryAfter = response.headers[retryAfterHeaderName];
    const retryAfterSeconds = Number(retryAfter);
    if (!Number.isNaN(retryAfterSeconds))
        return new Date(retryAfterSeconds * 1000);
    const retryAfterDate = new Date(retryAfter);
    return retryAfterDate;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/middleware-retry/dist-es/index.js








;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js
function setCredentialFeature(credentials, feature, value) {
    if (!credentials.$source) {
        credentials.$source = {};
    }
    credentials.$source[feature] = value;
    return credentials;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js



const resolveAwsSdkSigV4Config = (config) => {
    let inputCredentials = config.credentials;
    let isUserSupplied = !!config.credentials;
    let resolvedCredentials = undefined;
    Object.defineProperty(config, "credentials", {
        set(credentials) {
            if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) {
                isUserSupplied = true;
            }
            inputCredentials = credentials;
            const memoizedProvider = normalizeCredentialProvider(config, {
                credentials: inputCredentials,
                credentialDefaultProvider: config.credentialDefaultProvider,
            });
            const boundProvider = bindCallerConfig(config, memoizedProvider);
            if (isUserSupplied && !boundProvider.attributed) {
                resolvedCredentials = async (options) => boundProvider(options).then((creds) => setCredentialFeature(creds, "CREDENTIALS_CODE", "e"));
                resolvedCredentials.memoized = boundProvider.memoized;
                resolvedCredentials.configBound = boundProvider.configBound;
                resolvedCredentials.attributed = true;
            }
            else {
                resolvedCredentials = boundProvider;
            }
        },
        get() {
            return resolvedCredentials;
        },
        enumerable: true,
        configurable: true,
    });
    config.credentials = inputCredentials;
    const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256, } = config;
    let signer;
    if (config.signer) {
        signer = dist_es_normalizeProvider_normalizeProvider(config.signer);
    }
    else if (config.regionInfoProvider) {
        signer = () => dist_es_normalizeProvider_normalizeProvider(config.region)()
            .then(async (region) => [
            (await config.regionInfoProvider(region, {
                useFipsEndpoint: await config.useFipsEndpoint(),
                useDualstackEndpoint: await config.useDualstackEndpoint(),
            })) || {},
            region,
        ])
            .then(([regionInfo, region]) => {
            const { signingRegion, signingService } = regionInfo;
            config.signingRegion = config.signingRegion || signingRegion || region;
            config.signingName = config.signingName || signingService || config.serviceId;
            const params = {
                ...config,
                credentials: config.credentials,
                region: config.signingRegion,
                service: config.signingName,
                sha256,
                uriEscapePath: signingEscapePath,
            };
            const SignerCtor = config.signerConstructor || SignatureV4;
            return new SignerCtor(params);
        });
    }
    else {
        signer = async (authScheme) => {
            authScheme = Object.assign({}, {
                name: "sigv4",
                signingName: config.signingName || config.defaultSigningName,
                signingRegion: await dist_es_normalizeProvider_normalizeProvider(config.region)(),
                properties: {},
            }, authScheme);
            const signingRegion = authScheme.signingRegion;
            const signingService = authScheme.signingName;
            config.signingRegion = config.signingRegion || signingRegion;
            config.signingName = config.signingName || signingService || config.serviceId;
            const params = {
                ...config,
                credentials: config.credentials,
                region: config.signingRegion,
                service: config.signingName,
                sha256,
                uriEscapePath: signingEscapePath,
            };
            const SignerCtor = config.signerConstructor || SignatureV4;
            return new SignerCtor(params);
        };
    }
    const resolvedConfig = Object.assign(config, {
        systemClockOffset,
        signingEscapePath,
        signer,
    });
    return resolvedConfig;
};
const resolveAWSSDKSigV4Config = (/* unused pure expression or super */ null && (resolveAwsSdkSigV4Config));
function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider, }) {
    let credentialsProvider;
    if (credentials) {
        if (!credentials?.memoized) {
            credentialsProvider = memoizeIdentityProvider(credentials, isIdentityExpired, doesIdentityRequireRefresh);
        }
        else {
            credentialsProvider = credentials;
        }
    }
    else {
        if (credentialDefaultProvider) {
            credentialsProvider = dist_es_normalizeProvider_normalizeProvider(credentialDefaultProvider(Object.assign({}, config, {
                parentClientConfig: config,
            })));
        }
        else {
            credentialsProvider = async () => {
                throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.");
            };
        }
    }
    credentialsProvider.memoized = true;
    return credentialsProvider;
}
function bindCallerConfig(config, credentialsProvider) {
    if (credentialsProvider.configBound) {
        return credentialsProvider;
    }
    const fn = async (options) => credentialsProvider({ ...options, callerClientConfig: config });
    fn.memoized = credentialsProvider.memoized;
    fn.configBound = true;
    return fn;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/property-provider/dist-es/ProviderError.js
class ProviderError_ProviderError extends Error {
    constructor(message, options = true) {
        let logger;
        let tryNextLink = true;
        if (typeof options === "boolean") {
            logger = undefined;
            tryNextLink = options;
        }
        else if (options != null && typeof options === "object") {
            logger = options.logger;
            tryNextLink = options.tryNextLink ?? true;
        }
        super(message);
        this.name = "ProviderError";
        this.tryNextLink = tryNextLink;
        Object.setPrototypeOf(this, ProviderError_ProviderError.prototype);
        logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
    }
    static from(error, options = true) {
        return Object.assign(new this(error.message, options), error);
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js

class CredentialsProviderError extends ProviderError_ProviderError {
    constructor(message, options = true) {
        super(message, options);
        this.name = "CredentialsProviderError";
        Object.setPrototypeOf(this, CredentialsProviderError.prototype);
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/property-provider/dist-es/TokenProviderError.js

class TokenProviderError extends ProviderError_ProviderError {
    constructor(message, options = true) {
        super(message, options);
        this.name = "TokenProviderError";
        Object.setPrototypeOf(this, TokenProviderError.prototype);
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/property-provider/dist-es/chain.js

const chain = (...providers) => async () => {
    if (providers.length === 0) {
        throw new ProviderError("No providers in chain");
    }
    let lastProviderError;
    for (const provider of providers) {
        try {
            const credentials = await provider();
            return credentials;
        }
        catch (err) {
            lastProviderError = err;
            if (err?.tryNextLink) {
                continue;
            }
            throw err;
        }
    }
    throw lastProviderError;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/property-provider/dist-es/memoize.js
const dist_es_memoize_memoize = (provider, isExpired, requiresRefresh) => {
    let resolved;
    let pending;
    let hasResult;
    let isConstant = false;
    const coalesceProvider = async () => {
        if (!pending) {
            pending = provider();
        }
        try {
            resolved = await pending;
            hasResult = true;
            isConstant = false;
        }
        finally {
            pending = undefined;
        }
        return resolved;
    };
    if (isExpired === undefined) {
        return async (options) => {
            if (!hasResult || options?.forceRefresh) {
                resolved = await coalesceProvider();
            }
            return resolved;
        };
    }
    return async (options) => {
        if (!hasResult || options?.forceRefresh) {
            resolved = await coalesceProvider();
        }
        if (isConstant) {
            return resolved;
        }
        if (requiresRefresh && !requiresRefresh(resolved)) {
            isConstant = true;
            return resolved;
        }
        if (isExpired(resolved)) {
            await coalesceProvider();
            return resolved;
        }
        return resolved;
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/property-provider/dist-es/index.js







;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.js


const resolveAwsSdkSigV4AConfig = (config) => {
    config.sigv4aSigningRegionSet = dist_es_normalizeProvider_normalizeProvider(config.sigv4aSigningRegionSet);
    return config;
};
const NODE_SIGV4A_CONFIG_OPTIONS = {
    environmentVariableSelector(env) {
        if (env.AWS_SIGV4A_SIGNING_REGION_SET) {
            return env.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((_) => _.trim());
        }
        throw new ProviderError_ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.", {
            tryNextLink: true,
        });
    },
    configFileSelector(profile) {
        if (profile.sigv4a_signing_region_set) {
            return (profile.sigv4a_signing_region_set ?? "").split(",").map((_) => _.trim());
        }
        throw new ProviderError_ProviderError("sigv4a_signing_region_set not set in profile.", {
            tryNextLink: true,
        });
    },
    default: undefined,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js
const signatureV4CrtContainer = {
    CrtSignerV4: null,
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js


class SignatureV4MultiRegion {
    sigv4aSigner;
    sigv4Signer;
    signerOptions;
    constructor(options) {
        this.sigv4Signer = new SignatureV4S3Express(options);
        this.signerOptions = options;
    }
    async sign(requestToSign, options = {}) {
        if (options.signingRegion === "*") {
            if (this.signerOptions.runtime !== "node")
                throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
            return this.getSigv4aSigner().sign(requestToSign, options);
        }
        return this.sigv4Signer.sign(requestToSign, options);
    }
    async signWithCredentials(requestToSign, credentials, options = {}) {
        if (options.signingRegion === "*") {
            if (this.signerOptions.runtime !== "node")
                throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
            return this.getSigv4aSigner().signWithCredentials(requestToSign, credentials, options);
        }
        return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options);
    }
    async presign(originalRequest, options = {}) {
        if (options.signingRegion === "*") {
            if (this.signerOptions.runtime !== "node")
                throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
            return this.getSigv4aSigner().presign(originalRequest, options);
        }
        return this.sigv4Signer.presign(originalRequest, options);
    }
    async presignWithCredentials(originalRequest, credentials, options = {}) {
        if (options.signingRegion === "*") {
            throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");
        }
        return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options);
    }
    getSigv4aSigner() {
        if (!this.sigv4aSigner) {
            let CrtSignerV4 = null;
            try {
                CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
                if (typeof CrtSignerV4 !== "function")
                    throw new Error();
            }
            catch (e) {
                e.message =
                    `${e.message}\n` +
                        `Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \n` +
                        `You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] ` +
                        `or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \n` +
                        "For more information please go to " +
                        "https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt";
                throw e;
            }
            this.sigv4aSigner = new CrtSignerV4({
                ...this.signerOptions,
                signingAlgorithm: 1,
            });
        }
        return this.sigv4aSigner;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/endpoint/ruleset.js
const cp = "required", cq = "type", cr = "rules", cs = "conditions", ct = "fn", cu = "argv", cv = "ref", cw = "assign", cx = "url", cy = "properties", cz = "backend", cA = "authSchemes", cB = "disableDoubleEncoding", cC = "signingName", cD = "signingRegion", cE = "headers", cF = "signingRegionSet";
const a = 6, ruleset_b = false, ruleset_c = true, ruleset_d = "isSet", e = "booleanEquals", f = "error", ruleset_g = "aws.partition", h = "stringEquals", i = "getAttr", ruleset_j = "name", ruleset_k = "substring", l = "bucketSuffix", m = "parseURL", n = "endpoint", o = "tree", p = "aws.isVirtualHostableS3Bucket", ruleset_q = "{url#scheme}://{Bucket}.{url#authority}{url#path}", ruleset_r = "not", ruleset_s = "accessPointSuffix", t = "{url#scheme}://{url#authority}{url#path}", u = "hardwareType", ruleset_v = "regionPrefix", ruleset_w = "bucketAliasSuffix", ruleset_x = "outpostId", ruleset_y = "isValidHostLabel", ruleset_z = "sigv4a", ruleset_A = "s3-outposts", ruleset_B = "s3", ruleset_C = "{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}", ruleset_D = "https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}", ruleset_E = "https://{Bucket}.s3.{partitionResult#dnsSuffix}", ruleset_F = "aws.parseArn", ruleset_G = "bucketArn", ruleset_H = "arnType", ruleset_I = "", ruleset_J = "s3-object-lambda", ruleset_K = "accesspoint", ruleset_L = "accessPointName", ruleset_M = "{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}", ruleset_N = "mrapPartition", ruleset_O = "outpostType", ruleset_P = "arnPrefix", ruleset_Q = "{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}", ruleset_R = "https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", ruleset_S = "https://s3.{partitionResult#dnsSuffix}", ruleset_T = { [cp]: false, [cq]: "String" }, ruleset_U = { [cp]: true, "default": false, [cq]: "Boolean" }, ruleset_V = { [cp]: false, [cq]: "Boolean" }, ruleset_W = { [ct]: e, [cu]: [{ [cv]: "Accelerate" }, true] }, ruleset_X = { [ct]: e, [cu]: [{ [cv]: "UseFIPS" }, true] }, ruleset_Y = { [ct]: e, [cu]: [{ [cv]: "UseDualStack" }, true] }, ruleset_Z = { [ct]: ruleset_d, [cu]: [{ [cv]: "Endpoint" }] }, aa = { [ct]: ruleset_g, [cu]: [{ [cv]: "Region" }], [cw]: "partitionResult" }, ab = { [ct]: h, [cu]: [{ [ct]: i, [cu]: [{ [cv]: "partitionResult" }, ruleset_j] }, "aws-cn"] }, ac = { [ct]: ruleset_d, [cu]: [{ [cv]: "Bucket" }] }, ad = { [cv]: "Bucket" }, ruleset_ae = { [cs]: [ruleset_Y], [f]: "S3Express does not support Dual-stack.", [cq]: f }, af = { [cs]: [ruleset_W], [f]: "S3Express does not support S3 Accelerate.", [cq]: f }, ag = { [cs]: [ruleset_Z, { [ct]: m, [cu]: [{ [cv]: "Endpoint" }], [cw]: "url" }], [cr]: [{ [cs]: [{ [ct]: ruleset_d, [cu]: [{ [cv]: "DisableS3ExpressSessionAuth" }] }, { [ct]: e, [cu]: [{ [cv]: "DisableS3ExpressSessionAuth" }, true] }], [cr]: [{ [cs]: [{ [ct]: e, [cu]: [{ [ct]: i, [cu]: [{ [cv]: "url" }, "isIp"] }, true] }], [cr]: [{ [cs]: [{ [ct]: "uriEncode", [cu]: [ad], [cw]: "uri_encoded_bucket" }], [cr]: [{ [n]: { [cx]: "{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}", [cy]: { [cz]: "S3Express", [cA]: [{ [cB]: true, [ruleset_j]: "sigv4", [cC]: "s3express", [cD]: "{Region}" }] }, [cE]: {} }, [cq]: n }], [cq]: o }], [cq]: o }, { [cs]: [{ [ct]: p, [cu]: [ad, false] }], [cr]: [{ [n]: { [cx]: ruleset_q, [cy]: { [cz]: "S3Express", [cA]: [{ [cB]: true, [ruleset_j]: "sigv4", [cC]: "s3express", [cD]: "{Region}" }] }, [cE]: {} }, [cq]: n }], [cq]: o }, { [f]: "S3Express bucket name is not a valid virtual hostable name.", [cq]: f }], [cq]: o }, { [cs]: [{ [ct]: e, [cu]: [{ [ct]: i, [cu]: [{ [cv]: "url" }, "isIp"] }, true] }], [cr]: [{ [cs]: [{ [ct]: "uriEncode", [cu]: [ad], [cw]: "uri_encoded_bucket" }], [cr]: [{ [n]: { [cx]: "{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}", [cy]: { [cz]: "S3Express", [cA]: [{ [cB]: true, [ruleset_j]: "sigv4-s3express", [cC]: "s3express", [cD]: "{Region}" }] }, [cE]: {} }, [cq]: n }], [cq]: o }], [cq]: o }, { [cs]: [{ [ct]: p, [cu]: [ad, false] }], [cr]: [{ [n]: { [cx]: ruleset_q, [cy]: { [cz]: "S3Express", [cA]: [{ [cB]: true, [ruleset_j]: "sigv4-s3express", [cC]: "s3express", [cD]: "{Region}" }] }, [cE]: {} }, [cq]: n }], [cq]: o }, { [f]: "S3Express bucket name is not a valid virtual hostable name.", [cq]: f }], [cq]: o }, ah = { [ct]: m, [cu]: [{ [cv]: "Endpoint" }], [cw]: "url" }, ai = { [ct]: e, [cu]: [{ [ct]: i, [cu]: [{ [cv]: "url" }, "isIp"] }, true] }, aj = { [cv]: "url" }, ak = { [ct]: "uriEncode", [cu]: [ad], [cw]: "uri_encoded_bucket" }, al = { [cz]: "S3Express", [cA]: [{ [cB]: true, [ruleset_j]: "sigv4", [cC]: "s3express", [cD]: "{Region}" }] }, am = {}, an = { [ct]: p, [cu]: [ad, false] }, ao = { [f]: "S3Express bucket name is not a valid virtual hostable name.", [cq]: f }, ap = { [ct]: ruleset_d, [cu]: [{ [cv]: "UseS3ExpressControlEndpoint" }] }, aq = { [ct]: e, [cu]: [{ [cv]: "UseS3ExpressControlEndpoint" }, true] }, ar = { [ct]: ruleset_r, [cu]: [ruleset_Z] }, as = { [f]: "Unrecognized S3Express bucket name format.", [cq]: f }, ruleset_at = { [ct]: ruleset_r, [cu]: [ac] }, au = { [cv]: u }, av = { [cs]: [ar], [f]: "Expected a endpoint to be specified but no endpoint was found", [cq]: f }, aw = { [cA]: [{ [cB]: true, [ruleset_j]: ruleset_z, [cC]: ruleset_A, [cF]: ["*"] }, { [cB]: true, [ruleset_j]: "sigv4", [cC]: ruleset_A, [cD]: "{Region}" }] }, ax = { [ct]: e, [cu]: [{ [cv]: "ForcePathStyle" }, false] }, ay = { [cv]: "ForcePathStyle" }, az = { [ct]: e, [cu]: [{ [cv]: "Accelerate" }, false] }, aA = { [ct]: h, [cu]: [{ [cv]: "Region" }, "aws-global"] }, aB = { [cA]: [{ [cB]: true, [ruleset_j]: "sigv4", [cC]: ruleset_B, [cD]: "us-east-1" }] }, aC = { [ct]: ruleset_r, [cu]: [aA] }, aD = { [ct]: e, [cu]: [{ [cv]: "UseGlobalEndpoint" }, true] }, aE = { [cx]: "https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cy]: { [cA]: [{ [cB]: true, [ruleset_j]: "sigv4", [cC]: ruleset_B, [cD]: "{Region}" }] }, [cE]: {} }, aF = { [cA]: [{ [cB]: true, [ruleset_j]: "sigv4", [cC]: ruleset_B, [cD]: "{Region}" }] }, aG = { [ct]: e, [cu]: [{ [cv]: "UseGlobalEndpoint" }, false] }, aH = { [ct]: e, [cu]: [{ [cv]: "UseDualStack" }, false] }, aI = { [cx]: "https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}", [cy]: aF, [cE]: {} }, aJ = { [ct]: e, [cu]: [{ [cv]: "UseFIPS" }, false] }, aK = { [cx]: "https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}", [cy]: aF, [cE]: {} }, aL = { [cx]: "https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}", [cy]: aF, [cE]: {} }, aM = { [ct]: e, [cu]: [{ [ct]: i, [cu]: [aj, "isIp"] }, false] }, aN = { [cx]: ruleset_C, [cy]: aF, [cE]: {} }, aO = { [cx]: ruleset_q, [cy]: aF, [cE]: {} }, aP = { [n]: aO, [cq]: n }, aQ = { [cx]: ruleset_D, [cy]: aF, [cE]: {} }, aR = { [cx]: "https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}", [cy]: aF, [cE]: {} }, aS = { [f]: "Invalid region: region was not a valid DNS name.", [cq]: f }, aT = { [cv]: ruleset_G }, aU = { [cv]: ruleset_H }, aV = { [ct]: i, [cu]: [aT, "service"] }, aW = { [cv]: ruleset_L }, aX = { [cs]: [ruleset_Y], [f]: "S3 Object Lambda does not support Dual-stack", [cq]: f }, aY = { [cs]: [ruleset_W], [f]: "S3 Object Lambda does not support S3 Accelerate", [cq]: f }, aZ = { [cs]: [{ [ct]: ruleset_d, [cu]: [{ [cv]: "DisableAccessPoints" }] }, { [ct]: e, [cu]: [{ [cv]: "DisableAccessPoints" }, true] }], [f]: "Access points are not supported for this operation", [cq]: f }, ba = { [cs]: [{ [ct]: ruleset_d, [cu]: [{ [cv]: "UseArnRegion" }] }, { [ct]: e, [cu]: [{ [cv]: "UseArnRegion" }, false] }, { [ct]: ruleset_r, [cu]: [{ [ct]: h, [cu]: [{ [ct]: i, [cu]: [aT, "region"] }, "{Region}"] }] }], [f]: "Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`", [cq]: f }, bb = { [ct]: i, [cu]: [{ [cv]: "bucketPartition" }, ruleset_j] }, bc = { [ct]: i, [cu]: [aT, "accountId"] }, bd = { [cA]: [{ [cB]: true, [ruleset_j]: "sigv4", [cC]: ruleset_J, [cD]: "{bucketArn#region}" }] }, ruleset_be = { [f]: "Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`", [cq]: f }, bf = { [f]: "Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`", [cq]: f }, bg = { [f]: "Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)", [cq]: f }, bh = { [f]: "Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`", [cq]: f }, bi = { [f]: "Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.", [cq]: f }, bj = { [f]: "Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided", [cq]: f }, bk = { [cA]: [{ [cB]: true, [ruleset_j]: "sigv4", [cC]: ruleset_B, [cD]: "{bucketArn#region}" }] }, bl = { [cA]: [{ [cB]: true, [ruleset_j]: ruleset_z, [cC]: ruleset_A, [cF]: ["*"] }, { [cB]: true, [ruleset_j]: "sigv4", [cC]: ruleset_A, [cD]: "{bucketArn#region}" }] }, bm = { [ct]: ruleset_F, [cu]: [ad] }, bn = { [cx]: "https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cy]: aF, [cE]: {} }, bo = { [cx]: "https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cy]: aF, [cE]: {} }, bp = { [cx]: "https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cy]: aF, [cE]: {} }, bq = { [cx]: ruleset_Q, [cy]: aF, [cE]: {} }, br = { [cx]: "https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cy]: aF, [cE]: {} }, bs = { [cv]: "UseObjectLambdaEndpoint" }, bt = { [cA]: [{ [cB]: true, [ruleset_j]: "sigv4", [cC]: ruleset_J, [cD]: "{Region}" }] }, bu = { [cx]: "https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}", [cy]: aF, [cE]: {} }, bv = { [cx]: "https://s3-fips.{Region}.{partitionResult#dnsSuffix}", [cy]: aF, [cE]: {} }, bw = { [cx]: "https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}", [cy]: aF, [cE]: {} }, bx = { [cx]: t, [cy]: aF, [cE]: {} }, by = { [cx]: "https://s3.{Region}.{partitionResult#dnsSuffix}", [cy]: aF, [cE]: {} }, bz = [{ [cv]: "Region" }], bA = [{ [cv]: "Endpoint" }], bB = [ad], bC = [ruleset_Y], bD = [ruleset_W], bE = [ruleset_Z, ah], bF = [{ [ct]: ruleset_d, [cu]: [{ [cv]: "DisableS3ExpressSessionAuth" }] }, { [ct]: e, [cu]: [{ [cv]: "DisableS3ExpressSessionAuth" }, true] }], bG = [ak], bH = [an], bI = [aa], bJ = [ruleset_X], bK = [{ [ct]: ruleset_k, [cu]: [ad, 6, 14, true], [cw]: "s3expressAvailabilityZoneId" }, { [ct]: ruleset_k, [cu]: [ad, 14, 16, true], [cw]: "s3expressAvailabilityZoneDelim" }, { [ct]: h, [cu]: [{ [cv]: "s3expressAvailabilityZoneDelim" }, "--"] }], bL = [{ [cs]: [ruleset_X], [n]: { [cx]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cy]: al, [cE]: {} }, [cq]: n }, { [n]: { [cx]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cy]: al, [cE]: {} }, [cq]: n }], bM = [{ [ct]: ruleset_k, [cu]: [ad, 6, 15, true], [cw]: "s3expressAvailabilityZoneId" }, { [ct]: ruleset_k, [cu]: [ad, 15, 17, true], [cw]: "s3expressAvailabilityZoneDelim" }, { [ct]: h, [cu]: [{ [cv]: "s3expressAvailabilityZoneDelim" }, "--"] }], bN = [{ [ct]: ruleset_k, [cu]: [ad, 6, 19, true], [cw]: "s3expressAvailabilityZoneId" }, { [ct]: ruleset_k, [cu]: [ad, 19, 21, true], [cw]: "s3expressAvailabilityZoneDelim" }, { [ct]: h, [cu]: [{ [cv]: "s3expressAvailabilityZoneDelim" }, "--"] }], bO = [{ [ct]: ruleset_k, [cu]: [ad, 6, 20, true], [cw]: "s3expressAvailabilityZoneId" }, { [ct]: ruleset_k, [cu]: [ad, 20, 22, true], [cw]: "s3expressAvailabilityZoneDelim" }, { [ct]: h, [cu]: [{ [cv]: "s3expressAvailabilityZoneDelim" }, "--"] }], bP = [{ [ct]: ruleset_k, [cu]: [ad, 6, 26, true], [cw]: "s3expressAvailabilityZoneId" }, { [ct]: ruleset_k, [cu]: [ad, 26, 28, true], [cw]: "s3expressAvailabilityZoneDelim" }, { [ct]: h, [cu]: [{ [cv]: "s3expressAvailabilityZoneDelim" }, "--"] }], bQ = [{ [cs]: [ruleset_X], [n]: { [cx]: "https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cy]: { [cz]: "S3Express", [cA]: [{ [cB]: true, [ruleset_j]: "sigv4-s3express", [cC]: "s3express", [cD]: "{Region}" }] }, [cE]: {} }, [cq]: n }, { [n]: { [cx]: "https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}", [cy]: { [cz]: "S3Express", [cA]: [{ [cB]: true, [ruleset_j]: "sigv4-s3express", [cC]: "s3express", [cD]: "{Region}" }] }, [cE]: {} }, [cq]: n }], bR = [ad, 0, 7, true], bS = [{ [ct]: ruleset_k, [cu]: [ad, 7, 15, true], [cw]: "s3expressAvailabilityZoneId" }, { [ct]: ruleset_k, [cu]: [ad, 15, 17, true], [cw]: "s3expressAvailabilityZoneDelim" }, { [ct]: h, [cu]: [{ [cv]: "s3expressAvailabilityZoneDelim" }, "--"] }], bT = [{ [ct]: ruleset_k, [cu]: [ad, 7, 16, true], [cw]: "s3expressAvailabilityZoneId" }, { [ct]: ruleset_k, [cu]: [ad, 16, 18, true], [cw]: "s3expressAvailabilityZoneDelim" }, { [ct]: h, [cu]: [{ [cv]: "s3expressAvailabilityZoneDelim" }, "--"] }], bU = [{ [ct]: ruleset_k, [cu]: [ad, 7, 20, true], [cw]: "s3expressAvailabilityZoneId" }, { [ct]: ruleset_k, [cu]: [ad, 20, 22, true], [cw]: "s3expressAvailabilityZoneDelim" }, { [ct]: h, [cu]: [{ [cv]: "s3expressAvailabilityZoneDelim" }, "--"] }], bV = [{ [ct]: ruleset_k, [cu]: [ad, 7, 21, true], [cw]: "s3expressAvailabilityZoneId" }, { [ct]: ruleset_k, [cu]: [ad, 21, 23, true], [cw]: "s3expressAvailabilityZoneDelim" }, { [ct]: h, [cu]: [{ [cv]: "s3expressAvailabilityZoneDelim" }, "--"] }], bW = [{ [ct]: ruleset_k, [cu]: [ad, 7, 27, true], [cw]: "s3expressAvailabilityZoneId" }, { [ct]: ruleset_k, [cu]: [ad, 27, 29, true], [cw]: "s3expressAvailabilityZoneDelim" }, { [ct]: h, [cu]: [{ [cv]: "s3expressAvailabilityZoneDelim" }, "--"] }], bX = [ac], bY = [{ [ct]: ruleset_y, [cu]: [{ [cv]: ruleset_x }, false] }], bZ = [{ [ct]: h, [cu]: [{ [cv]: ruleset_v }, "beta"] }], ca = ["*"], cb = [{ [ct]: ruleset_y, [cu]: [{ [cv]: "Region" }, false] }], cc = [{ [ct]: h, [cu]: [{ [cv]: "Region" }, "us-east-1"] }], cd = [{ [ct]: h, [cu]: [aU, ruleset_K] }], ruleset_ce = [{ [ct]: i, [cu]: [aT, "resourceId[1]"], [cw]: ruleset_L }, { [ct]: ruleset_r, [cu]: [{ [ct]: h, [cu]: [aW, ruleset_I] }] }], cf = [aT, "resourceId[1]"], cg = [{ [ct]: ruleset_r, [cu]: [{ [ct]: h, [cu]: [{ [ct]: i, [cu]: [aT, "region"] }, ruleset_I] }] }], ch = [{ [ct]: ruleset_r, [cu]: [{ [ct]: ruleset_d, [cu]: [{ [ct]: i, [cu]: [aT, "resourceId[2]"] }] }] }], ci = [aT, "resourceId[2]"], cj = [{ [ct]: ruleset_g, [cu]: [{ [ct]: i, [cu]: [aT, "region"] }], [cw]: "bucketPartition" }], ck = [{ [ct]: h, [cu]: [bb, { [ct]: i, [cu]: [{ [cv]: "partitionResult" }, ruleset_j] }] }], cl = [{ [ct]: ruleset_y, [cu]: [{ [ct]: i, [cu]: [aT, "region"] }, true] }], cm = [{ [ct]: ruleset_y, [cu]: [bc, false] }], cn = [{ [ct]: ruleset_y, [cu]: [aW, false] }], co = [{ [ct]: ruleset_y, [cu]: [{ [cv]: "Region" }, true] }];
const _data = { version: "1.0", parameters: { Bucket: ruleset_T, Region: ruleset_T, UseFIPS: ruleset_U, UseDualStack: ruleset_U, Endpoint: ruleset_T, ForcePathStyle: ruleset_U, Accelerate: ruleset_U, UseGlobalEndpoint: ruleset_U, UseObjectLambdaEndpoint: ruleset_V, Key: ruleset_T, Prefix: ruleset_T, CopySource: ruleset_T, DisableAccessPoints: ruleset_V, DisableMultiRegionAccessPoints: ruleset_U, UseArnRegion: ruleset_V, UseS3ExpressControlEndpoint: ruleset_V, DisableS3ExpressSessionAuth: ruleset_V }, [cr]: [{ [cs]: [{ [ct]: ruleset_d, [cu]: bz }], [cr]: [{ [cs]: [ruleset_W, ruleset_X], error: "Accelerate cannot be used with FIPS", [cq]: f }, { [cs]: [ruleset_Y, ruleset_Z], error: "Cannot set dual-stack in combination with a custom endpoint.", [cq]: f }, { [cs]: [ruleset_Z, ruleset_X], error: "A custom endpoint cannot be combined with FIPS", [cq]: f }, { [cs]: [ruleset_Z, ruleset_W], error: "A custom endpoint cannot be combined with S3 Accelerate", [cq]: f }, { [cs]: [ruleset_X, aa, ab], error: "Partition does not support FIPS", [cq]: f }, { [cs]: [ac, { [ct]: ruleset_k, [cu]: [ad, 0, a, ruleset_c], [cw]: l }, { [ct]: h, [cu]: [{ [cv]: l }, "--x-s3"] }], [cr]: [ruleset_ae, af, ag, { [cs]: [ap, aq], [cr]: [{ [cs]: bI, [cr]: [{ [cs]: [ak, ar], [cr]: [{ [cs]: bJ, endpoint: { [cx]: "https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cy]: al, [cE]: am }, [cq]: n }, { endpoint: { [cx]: "https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cy]: al, [cE]: am }, [cq]: n }], [cq]: o }], [cq]: o }], [cq]: o }, { [cs]: bH, [cr]: [{ [cs]: bI, [cr]: [{ [cs]: bF, [cr]: [{ [cs]: bK, [cr]: bL, [cq]: o }, { [cs]: bM, [cr]: bL, [cq]: o }, { [cs]: bN, [cr]: bL, [cq]: o }, { [cs]: bO, [cr]: bL, [cq]: o }, { [cs]: bP, [cr]: bL, [cq]: o }, as], [cq]: o }, { [cs]: bK, [cr]: bQ, [cq]: o }, { [cs]: bM, [cr]: bQ, [cq]: o }, { [cs]: bN, [cr]: bQ, [cq]: o }, { [cs]: bO, [cr]: bQ, [cq]: o }, { [cs]: bP, [cr]: bQ, [cq]: o }, as], [cq]: o }], [cq]: o }, ao], [cq]: o }, { [cs]: [ac, { [ct]: ruleset_k, [cu]: bR, [cw]: ruleset_s }, { [ct]: h, [cu]: [{ [cv]: ruleset_s }, "--xa-s3"] }], [cr]: [ruleset_ae, af, ag, { [cs]: bH, [cr]: [{ [cs]: bI, [cr]: [{ [cs]: bF, [cr]: [{ [cs]: bS, [cr]: bL, [cq]: o }, { [cs]: bT, [cr]: bL, [cq]: o }, { [cs]: bU, [cr]: bL, [cq]: o }, { [cs]: bV, [cr]: bL, [cq]: o }, { [cs]: bW, [cr]: bL, [cq]: o }, as], [cq]: o }, { [cs]: bS, [cr]: bQ, [cq]: o }, { [cs]: bT, [cr]: bQ, [cq]: o }, { [cs]: bU, [cr]: bQ, [cq]: o }, { [cs]: bV, [cr]: bQ, [cq]: o }, { [cs]: bW, [cr]: bQ, [cq]: o }, as], [cq]: o }], [cq]: o }, ao], [cq]: o }, { [cs]: [ruleset_at, ap, aq], [cr]: [{ [cs]: bI, [cr]: [{ [cs]: bE, endpoint: { [cx]: t, [cy]: al, [cE]: am }, [cq]: n }, { [cs]: bJ, endpoint: { [cx]: "https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}", [cy]: al, [cE]: am }, [cq]: n }, { endpoint: { [cx]: "https://s3express-control.{Region}.{partitionResult#dnsSuffix}", [cy]: al, [cE]: am }, [cq]: n }], [cq]: o }], [cq]: o }, { [cs]: [ac, { [ct]: ruleset_k, [cu]: [ad, 49, 50, ruleset_c], [cw]: u }, { [ct]: ruleset_k, [cu]: [ad, 8, 12, ruleset_c], [cw]: ruleset_v }, { [ct]: ruleset_k, [cu]: bR, [cw]: ruleset_w }, { [ct]: ruleset_k, [cu]: [ad, 32, 49, ruleset_c], [cw]: ruleset_x }, { [ct]: ruleset_g, [cu]: bz, [cw]: "regionPartition" }, { [ct]: h, [cu]: [{ [cv]: ruleset_w }, "--op-s3"] }], [cr]: [{ [cs]: bY, [cr]: [{ [cs]: [{ [ct]: h, [cu]: [au, "e"] }], [cr]: [{ [cs]: bZ, [cr]: [av, { [cs]: bE, endpoint: { [cx]: "https://{Bucket}.ec2.{url#authority}", [cy]: aw, [cE]: am }, [cq]: n }], [cq]: o }, { endpoint: { [cx]: "https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}", [cy]: aw, [cE]: am }, [cq]: n }], [cq]: o }, { [cs]: [{ [ct]: h, [cu]: [au, "o"] }], [cr]: [{ [cs]: bZ, [cr]: [av, { [cs]: bE, endpoint: { [cx]: "https://{Bucket}.op-{outpostId}.{url#authority}", [cy]: aw, [cE]: am }, [cq]: n }], [cq]: o }, { endpoint: { [cx]: "https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}", [cy]: aw, [cE]: am }, [cq]: n }], [cq]: o }, { error: "Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"", [cq]: f }], [cq]: o }, { error: "Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.", [cq]: f }], [cq]: o }, { [cs]: bX, [cr]: [{ [cs]: [ruleset_Z, { [ct]: ruleset_r, [cu]: [{ [ct]: ruleset_d, [cu]: [{ [ct]: m, [cu]: bA }] }] }], error: "Custom endpoint `{Endpoint}` was not a valid URI", [cq]: f }, { [cs]: [ax, an], [cr]: [{ [cs]: bI, [cr]: [{ [cs]: cb, [cr]: [{ [cs]: [ruleset_W, ab], error: "S3 Accelerate cannot be used in this region", [cq]: f }, { [cs]: [ruleset_Y, ruleset_X, az, ar, aA], endpoint: { [cx]: "https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [ruleset_Y, ruleset_X, az, ar, aC, aD], [cr]: [{ endpoint: aE, [cq]: n }], [cq]: o }, { [cs]: [ruleset_Y, ruleset_X, az, ar, aC, aG], endpoint: aE, [cq]: n }, { [cs]: [aH, ruleset_X, az, ar, aA], endpoint: { [cx]: "https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}", [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aH, ruleset_X, az, ar, aC, aD], [cr]: [{ endpoint: aI, [cq]: n }], [cq]: o }, { [cs]: [aH, ruleset_X, az, ar, aC, aG], endpoint: aI, [cq]: n }, { [cs]: [ruleset_Y, aJ, ruleset_W, ar, aA], endpoint: { [cx]: "https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [ruleset_Y, aJ, ruleset_W, ar, aC, aD], [cr]: [{ endpoint: aK, [cq]: n }], [cq]: o }, { [cs]: [ruleset_Y, aJ, ruleset_W, ar, aC, aG], endpoint: aK, [cq]: n }, { [cs]: [ruleset_Y, aJ, az, ar, aA], endpoint: { [cx]: "https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [ruleset_Y, aJ, az, ar, aC, aD], [cr]: [{ endpoint: aL, [cq]: n }], [cq]: o }, { [cs]: [ruleset_Y, aJ, az, ar, aC, aG], endpoint: aL, [cq]: n }, { [cs]: [aH, aJ, az, ruleset_Z, ah, ai, aA], endpoint: { [cx]: ruleset_C, [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aH, aJ, az, ruleset_Z, ah, aM, aA], endpoint: { [cx]: ruleset_q, [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aH, aJ, az, ruleset_Z, ah, ai, aC, aD], [cr]: [{ [cs]: cc, endpoint: aN, [cq]: n }, { endpoint: aN, [cq]: n }], [cq]: o }, { [cs]: [aH, aJ, az, ruleset_Z, ah, aM, aC, aD], [cr]: [{ [cs]: cc, endpoint: aO, [cq]: n }, aP], [cq]: o }, { [cs]: [aH, aJ, az, ruleset_Z, ah, ai, aC, aG], endpoint: aN, [cq]: n }, { [cs]: [aH, aJ, az, ruleset_Z, ah, aM, aC, aG], endpoint: aO, [cq]: n }, { [cs]: [aH, aJ, ruleset_W, ar, aA], endpoint: { [cx]: ruleset_D, [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aH, aJ, ruleset_W, ar, aC, aD], [cr]: [{ [cs]: cc, endpoint: aQ, [cq]: n }, { endpoint: aQ, [cq]: n }], [cq]: o }, { [cs]: [aH, aJ, ruleset_W, ar, aC, aG], endpoint: aQ, [cq]: n }, { [cs]: [aH, aJ, az, ar, aA], endpoint: { [cx]: ruleset_E, [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aH, aJ, az, ar, aC, aD], [cr]: [{ [cs]: cc, endpoint: { [cx]: ruleset_E, [cy]: aF, [cE]: am }, [cq]: n }, { endpoint: aR, [cq]: n }], [cq]: o }, { [cs]: [aH, aJ, az, ar, aC, aG], endpoint: aR, [cq]: n }], [cq]: o }, aS], [cq]: o }], [cq]: o }, { [cs]: [ruleset_Z, ah, { [ct]: h, [cu]: [{ [ct]: i, [cu]: [aj, "scheme"] }, "http"] }, { [ct]: p, [cu]: [ad, ruleset_c] }, ax, aJ, aH, az], [cr]: [{ [cs]: bI, [cr]: [{ [cs]: cb, [cr]: [aP], [cq]: o }, aS], [cq]: o }], [cq]: o }, { [cs]: [ax, { [ct]: ruleset_F, [cu]: bB, [cw]: ruleset_G }], [cr]: [{ [cs]: [{ [ct]: i, [cu]: [aT, "resourceId[0]"], [cw]: ruleset_H }, { [ct]: ruleset_r, [cu]: [{ [ct]: h, [cu]: [aU, ruleset_I] }] }], [cr]: [{ [cs]: [{ [ct]: h, [cu]: [aV, ruleset_J] }], [cr]: [{ [cs]: cd, [cr]: [{ [cs]: ruleset_ce, [cr]: [aX, aY, { [cs]: cg, [cr]: [aZ, { [cs]: ch, [cr]: [ba, { [cs]: cj, [cr]: [{ [cs]: bI, [cr]: [{ [cs]: ck, [cr]: [{ [cs]: cl, [cr]: [{ [cs]: [{ [ct]: h, [cu]: [bc, ruleset_I] }], error: "Invalid ARN: Missing account id", [cq]: f }, { [cs]: cm, [cr]: [{ [cs]: cn, [cr]: [{ [cs]: bE, endpoint: { [cx]: ruleset_M, [cy]: bd, [cE]: am }, [cq]: n }, { [cs]: bJ, endpoint: { [cx]: "https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cy]: bd, [cE]: am }, [cq]: n }, { endpoint: { [cx]: "https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cy]: bd, [cE]: am }, [cq]: n }], [cq]: o }, ruleset_be], [cq]: o }, bf], [cq]: o }, bg], [cq]: o }, bh], [cq]: o }], [cq]: o }], [cq]: o }, bi], [cq]: o }, { error: "Invalid ARN: bucket ARN is missing a region", [cq]: f }], [cq]: o }, bj], [cq]: o }, { error: "Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`", [cq]: f }], [cq]: o }, { [cs]: cd, [cr]: [{ [cs]: ruleset_ce, [cr]: [{ [cs]: cg, [cr]: [{ [cs]: cd, [cr]: [{ [cs]: cg, [cr]: [aZ, { [cs]: ch, [cr]: [ba, { [cs]: cj, [cr]: [{ [cs]: bI, [cr]: [{ [cs]: [{ [ct]: h, [cu]: [bb, "{partitionResult#name}"] }], [cr]: [{ [cs]: cl, [cr]: [{ [cs]: [{ [ct]: h, [cu]: [aV, ruleset_B] }], [cr]: [{ [cs]: cm, [cr]: [{ [cs]: cn, [cr]: [{ [cs]: bD, error: "Access Points do not support S3 Accelerate", [cq]: f }, { [cs]: [ruleset_X, ruleset_Y], endpoint: { [cx]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cy]: bk, [cE]: am }, [cq]: n }, { [cs]: [ruleset_X, aH], endpoint: { [cx]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cy]: bk, [cE]: am }, [cq]: n }, { [cs]: [aJ, ruleset_Y], endpoint: { [cx]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cy]: bk, [cE]: am }, [cq]: n }, { [cs]: [aJ, aH, ruleset_Z, ah], endpoint: { [cx]: ruleset_M, [cy]: bk, [cE]: am }, [cq]: n }, { [cs]: [aJ, aH], endpoint: { [cx]: "https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cy]: bk, [cE]: am }, [cq]: n }], [cq]: o }, ruleset_be], [cq]: o }, bf], [cq]: o }, { error: "Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}", [cq]: f }], [cq]: o }, bg], [cq]: o }, bh], [cq]: o }], [cq]: o }], [cq]: o }, bi], [cq]: o }], [cq]: o }], [cq]: o }, { [cs]: [{ [ct]: ruleset_y, [cu]: [aW, ruleset_c] }], [cr]: [{ [cs]: bC, error: "S3 MRAP does not support dual-stack", [cq]: f }, { [cs]: bJ, error: "S3 MRAP does not support FIPS", [cq]: f }, { [cs]: bD, error: "S3 MRAP does not support S3 Accelerate", [cq]: f }, { [cs]: [{ [ct]: e, [cu]: [{ [cv]: "DisableMultiRegionAccessPoints" }, ruleset_c] }], error: "Invalid configuration: Multi-Region Access Point ARNs are disabled.", [cq]: f }, { [cs]: [{ [ct]: ruleset_g, [cu]: bz, [cw]: ruleset_N }], [cr]: [{ [cs]: [{ [ct]: h, [cu]: [{ [ct]: i, [cu]: [{ [cv]: ruleset_N }, ruleset_j] }, { [ct]: i, [cu]: [aT, "partition"] }] }], [cr]: [{ endpoint: { [cx]: "https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}", [cy]: { [cA]: [{ [cB]: ruleset_c, name: ruleset_z, [cC]: ruleset_B, [cF]: ca }] }, [cE]: am }, [cq]: n }], [cq]: o }, { error: "Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`", [cq]: f }], [cq]: o }], [cq]: o }, { error: "Invalid Access Point Name", [cq]: f }], [cq]: o }, bj], [cq]: o }, { [cs]: [{ [ct]: h, [cu]: [aV, ruleset_A] }], [cr]: [{ [cs]: bC, error: "S3 Outposts does not support Dual-stack", [cq]: f }, { [cs]: bJ, error: "S3 Outposts does not support FIPS", [cq]: f }, { [cs]: bD, error: "S3 Outposts does not support S3 Accelerate", [cq]: f }, { [cs]: [{ [ct]: ruleset_d, [cu]: [{ [ct]: i, [cu]: [aT, "resourceId[4]"] }] }], error: "Invalid Arn: Outpost Access Point ARN contains sub resources", [cq]: f }, { [cs]: [{ [ct]: i, [cu]: cf, [cw]: ruleset_x }], [cr]: [{ [cs]: bY, [cr]: [ba, { [cs]: cj, [cr]: [{ [cs]: bI, [cr]: [{ [cs]: ck, [cr]: [{ [cs]: cl, [cr]: [{ [cs]: cm, [cr]: [{ [cs]: [{ [ct]: i, [cu]: ci, [cw]: ruleset_O }], [cr]: [{ [cs]: [{ [ct]: i, [cu]: [aT, "resourceId[3]"], [cw]: ruleset_L }], [cr]: [{ [cs]: [{ [ct]: h, [cu]: [{ [cv]: ruleset_O }, ruleset_K] }], [cr]: [{ [cs]: bE, endpoint: { [cx]: "https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}", [cy]: bl, [cE]: am }, [cq]: n }, { endpoint: { [cx]: "https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}", [cy]: bl, [cE]: am }, [cq]: n }], [cq]: o }, { error: "Expected an outpost type `accesspoint`, found {outpostType}", [cq]: f }], [cq]: o }, { error: "Invalid ARN: expected an access point name", [cq]: f }], [cq]: o }, { error: "Invalid ARN: Expected a 4-component resource", [cq]: f }], [cq]: o }, bf], [cq]: o }, bg], [cq]: o }, bh], [cq]: o }], [cq]: o }], [cq]: o }, { error: "Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`", [cq]: f }], [cq]: o }, { error: "Invalid ARN: The Outpost Id was not set", [cq]: f }], [cq]: o }, { error: "Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})", [cq]: f }], [cq]: o }, { error: "Invalid ARN: No ARN type specified", [cq]: f }], [cq]: o }, { [cs]: [{ [ct]: ruleset_k, [cu]: [ad, 0, 4, ruleset_b], [cw]: ruleset_P }, { [ct]: h, [cu]: [{ [cv]: ruleset_P }, "arn:"] }, { [ct]: ruleset_r, [cu]: [{ [ct]: ruleset_d, [cu]: [bm] }] }], error: "Invalid ARN: `{Bucket}` was not a valid ARN", [cq]: f }, { [cs]: [{ [ct]: e, [cu]: [ay, ruleset_c] }, bm], error: "Path-style addressing cannot be used with ARN buckets", [cq]: f }, { [cs]: bG, [cr]: [{ [cs]: bI, [cr]: [{ [cs]: [az], [cr]: [{ [cs]: [ruleset_Y, ar, ruleset_X, aA], endpoint: { [cx]: "https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [ruleset_Y, ar, ruleset_X, aC, aD], [cr]: [{ endpoint: bn, [cq]: n }], [cq]: o }, { [cs]: [ruleset_Y, ar, ruleset_X, aC, aG], endpoint: bn, [cq]: n }, { [cs]: [aH, ar, ruleset_X, aA], endpoint: { [cx]: "https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aH, ar, ruleset_X, aC, aD], [cr]: [{ endpoint: bo, [cq]: n }], [cq]: o }, { [cs]: [aH, ar, ruleset_X, aC, aG], endpoint: bo, [cq]: n }, { [cs]: [ruleset_Y, ar, aJ, aA], endpoint: { [cx]: "https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}", [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [ruleset_Y, ar, aJ, aC, aD], [cr]: [{ endpoint: bp, [cq]: n }], [cq]: o }, { [cs]: [ruleset_Y, ar, aJ, aC, aG], endpoint: bp, [cq]: n }, { [cs]: [aH, ruleset_Z, ah, aJ, aA], endpoint: { [cx]: ruleset_Q, [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aH, ruleset_Z, ah, aJ, aC, aD], [cr]: [{ [cs]: cc, endpoint: bq, [cq]: n }, { endpoint: bq, [cq]: n }], [cq]: o }, { [cs]: [aH, ruleset_Z, ah, aJ, aC, aG], endpoint: bq, [cq]: n }, { [cs]: [aH, ar, aJ, aA], endpoint: { [cx]: ruleset_R, [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aH, ar, aJ, aC, aD], [cr]: [{ [cs]: cc, endpoint: { [cx]: ruleset_R, [cy]: aF, [cE]: am }, [cq]: n }, { endpoint: br, [cq]: n }], [cq]: o }, { [cs]: [aH, ar, aJ, aC, aG], endpoint: br, [cq]: n }], [cq]: o }, { error: "Path-style addressing cannot be used with S3 Accelerate", [cq]: f }], [cq]: o }], [cq]: o }], [cq]: o }, { [cs]: [{ [ct]: ruleset_d, [cu]: [bs] }, { [ct]: e, [cu]: [bs, ruleset_c] }], [cr]: [{ [cs]: bI, [cr]: [{ [cs]: co, [cr]: [aX, aY, { [cs]: bE, endpoint: { [cx]: t, [cy]: bt, [cE]: am }, [cq]: n }, { [cs]: bJ, endpoint: { [cx]: "https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}", [cy]: bt, [cE]: am }, [cq]: n }, { endpoint: { [cx]: "https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}", [cy]: bt, [cE]: am }, [cq]: n }], [cq]: o }, aS], [cq]: o }], [cq]: o }, { [cs]: [ruleset_at], [cr]: [{ [cs]: bI, [cr]: [{ [cs]: co, [cr]: [{ [cs]: [ruleset_X, ruleset_Y, ar, aA], endpoint: { [cx]: "https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [ruleset_X, ruleset_Y, ar, aC, aD], [cr]: [{ endpoint: bu, [cq]: n }], [cq]: o }, { [cs]: [ruleset_X, ruleset_Y, ar, aC, aG], endpoint: bu, [cq]: n }, { [cs]: [ruleset_X, aH, ar, aA], endpoint: { [cx]: "https://s3-fips.us-east-1.{partitionResult#dnsSuffix}", [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [ruleset_X, aH, ar, aC, aD], [cr]: [{ endpoint: bv, [cq]: n }], [cq]: o }, { [cs]: [ruleset_X, aH, ar, aC, aG], endpoint: bv, [cq]: n }, { [cs]: [aJ, ruleset_Y, ar, aA], endpoint: { [cx]: "https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}", [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aJ, ruleset_Y, ar, aC, aD], [cr]: [{ endpoint: bw, [cq]: n }], [cq]: o }, { [cs]: [aJ, ruleset_Y, ar, aC, aG], endpoint: bw, [cq]: n }, { [cs]: [aJ, aH, ruleset_Z, ah, aA], endpoint: { [cx]: t, [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aJ, aH, ruleset_Z, ah, aC, aD], [cr]: [{ [cs]: cc, endpoint: bx, [cq]: n }, { endpoint: bx, [cq]: n }], [cq]: o }, { [cs]: [aJ, aH, ruleset_Z, ah, aC, aG], endpoint: bx, [cq]: n }, { [cs]: [aJ, aH, ar, aA], endpoint: { [cx]: ruleset_S, [cy]: aB, [cE]: am }, [cq]: n }, { [cs]: [aJ, aH, ar, aC, aD], [cr]: [{ [cs]: cc, endpoint: { [cx]: ruleset_S, [cy]: aF, [cE]: am }, [cq]: n }, { endpoint: by, [cq]: n }], [cq]: o }, { [cs]: [aJ, aH, ar, aC, aG], endpoint: by, [cq]: n }], [cq]: o }, aS], [cq]: o }], [cq]: o }], [cq]: o }, { error: "A region must be set when sending requests to S3.", [cq]: f }] };
const ruleSet = _data;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/endpoint/endpointResolver.js



const endpointResolver_cache = new EndpointCache({
    size: 50,
    params: [
        "Accelerate",
        "Bucket",
        "DisableAccessPoints",
        "DisableMultiRegionAccessPoints",
        "DisableS3ExpressSessionAuth",
        "Endpoint",
        "ForcePathStyle",
        "Region",
        "UseArnRegion",
        "UseDualStack",
        "UseFIPS",
        "UseGlobalEndpoint",
        "UseObjectLambdaEndpoint",
        "UseS3ExpressControlEndpoint",
    ],
});
const defaultEndpointResolver = (endpointParams, context = {}) => {
    return endpointResolver_cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
        endpointParams: endpointParams,
        logger: context.logger,
    }));
};
customEndpointFunctions.aws = awsEndpointFunctions;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthSchemeProvider.js





const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
    if (!input) {
        throw new Error(`Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\``);
    }
    const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
    const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor
        ?.getEndpointParameterInstructions;
    if (!instructionsFn) {
        throw new Error(`getEndpointParameterInstructions() is not defined on \`${context.commandName}\``);
    }
    const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
    return Object.assign(defaultParameters, endpointParameters);
};
const _defaultS3HttpAuthSchemeParametersProvider = async (config, context, input) => {
    return {
        operation: getSmithyContext(context).operation,
        region: (await normalizeProvider_normalizeProvider(config.region)()) ||
            (() => {
                throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
            })(),
    };
};
const defaultS3HttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultS3HttpAuthSchemeParametersProvider);
function createAwsAuthSigv4HttpAuthOption(authParameters) {
    return {
        schemeId: "aws.auth#sigv4",
        signingProperties: {
            name: "s3",
            region: authParameters.region,
        },
        propertiesExtractor: (config, context) => ({
            signingProperties: {
                config,
                context,
            },
        }),
    };
}
function createAwsAuthSigv4aHttpAuthOption(authParameters) {
    return {
        schemeId: "aws.auth#sigv4a",
        signingProperties: {
            name: "s3",
            region: authParameters.region,
        },
        propertiesExtractor: (config, context) => ({
            signingProperties: {
                config,
                context,
            },
        }),
    };
}
const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
    const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
        const endpoint = defaultEndpointResolver(authParameters);
        const authSchemes = endpoint.properties?.authSchemes;
        if (!authSchemes) {
            return defaultHttpAuthSchemeResolver(authParameters);
        }
        const options = [];
        for (const scheme of authSchemes) {
            const { name: resolvedName, properties = {}, ...rest } = scheme;
            const name = resolvedName.toLowerCase();
            if (resolvedName !== name) {
                console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${resolvedName}\` to \`${name}\``);
            }
            let schemeId;
            if (name === "sigv4a") {
                schemeId = "aws.auth#sigv4a";
                const sigv4Present = authSchemes.find((s) => {
                    const name = s.name.toLowerCase();
                    return name !== "sigv4a" && name.startsWith("sigv4");
                });
                if (!signatureV4CrtContainer.CrtSignerV4 && sigv4Present) {
                    continue;
                }
            }
            else if (name.startsWith("sigv4")) {
                schemeId = "aws.auth#sigv4";
            }
            else {
                throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${name}\``);
            }
            const createOption = createHttpAuthOptionFunctions[schemeId];
            if (!createOption) {
                throw new Error(`Could not find HttpAuthOption create function for \`${schemeId}\``);
            }
            const option = createOption(authParameters);
            option.schemeId = schemeId;
            option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
            options.push(option);
        }
        return options;
    };
    return endpointRuleSetHttpAuthSchemeProvider;
};
const _defaultS3HttpAuthSchemeProvider = (authParameters) => {
    const options = [];
    switch (authParameters.operation) {
        default: {
            options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
            options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
        }
    }
    return options;
};
const defaultS3HttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultS3HttpAuthSchemeProvider, {
    "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
    "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
});
const resolveHttpAuthSchemeConfig = (config) => {
    const config_0 = resolveAwsSdkSigV4Config(config);
    const config_1 = resolveAwsSdkSigV4AConfig(config_0);
    return Object.assign(config_1, {});
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/endpoint/EndpointParameters.js
const resolveClientEndpointParameters = (options) => {
    return Object.assign(options, {
        useFipsEndpoint: options.useFipsEndpoint ?? false,
        useDualstackEndpoint: options.useDualstackEndpoint ?? false,
        forcePathStyle: options.forcePathStyle ?? false,
        useAccelerateEndpoint: options.useAccelerateEndpoint ?? false,
        useGlobalEndpoint: options.useGlobalEndpoint ?? false,
        disableMultiregionAccessPoints: options.disableMultiregionAccessPoints ?? false,
        defaultSigningName: "s3",
    });
};
const commonParams = {
    ForcePathStyle: { type: "clientContextParams", name: "forcePathStyle" },
    UseArnRegion: { type: "clientContextParams", name: "useArnRegion" },
    DisableMultiRegionAccessPoints: { type: "clientContextParams", name: "disableMultiregionAccessPoints" },
    Accelerate: { type: "clientContextParams", name: "useAccelerateEndpoint" },
    DisableS3ExpressSessionAuth: { type: "clientContextParams", name: "disableS3ExpressSessionAuth" },
    UseGlobalEndpoint: { type: "builtInParams", name: "useGlobalEndpoint" },
    UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
    Endpoint: { type: "builtInParams", name: "endpoint" },
    Region: { type: "builtInParams", name: "region" },
    UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/models/S3ServiceException.js


class S3ServiceException extends ServiceException {
    constructor(options) {
        super(options);
        Object.setPrototypeOf(this, S3ServiceException.prototype);
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/models/models_0.js


const RequestCharged = {
    requester: "requester",
};
const RequestPayer = {
    requester: "requester",
};
class NoSuchUpload extends S3ServiceException {
    name = "NoSuchUpload";
    $fault = "client";
    constructor(opts) {
        super({
            name: "NoSuchUpload",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, NoSuchUpload.prototype);
    }
}
const BucketAccelerateStatus = {
    Enabled: "Enabled",
    Suspended: "Suspended",
};
const models_0_Type = {
    AmazonCustomerByEmail: "AmazonCustomerByEmail",
    CanonicalUser: "CanonicalUser",
    Group: "Group",
};
const Permission = {
    FULL_CONTROL: "FULL_CONTROL",
    READ: "READ",
    READ_ACP: "READ_ACP",
    WRITE: "WRITE",
    WRITE_ACP: "WRITE_ACP",
};
const OwnerOverride = {
    Destination: "Destination",
};
const ChecksumType = {
    COMPOSITE: "COMPOSITE",
    FULL_OBJECT: "FULL_OBJECT",
};
const ServerSideEncryption = {
    AES256: "AES256",
    aws_kms: "aws:kms",
    aws_kms_dsse: "aws:kms:dsse",
};
const ObjectCannedACL = {
    authenticated_read: "authenticated-read",
    aws_exec_read: "aws-exec-read",
    bucket_owner_full_control: "bucket-owner-full-control",
    bucket_owner_read: "bucket-owner-read",
    private: "private",
    public_read: "public-read",
    public_read_write: "public-read-write",
};
const models_0_ChecksumAlgorithm = {
    CRC32: "CRC32",
    CRC32C: "CRC32C",
    CRC64NVME: "CRC64NVME",
    SHA1: "SHA1",
    SHA256: "SHA256",
};
const MetadataDirective = {
    COPY: "COPY",
    REPLACE: "REPLACE",
};
const ObjectLockLegalHoldStatus = {
    OFF: "OFF",
    ON: "ON",
};
const ObjectLockMode = {
    COMPLIANCE: "COMPLIANCE",
    GOVERNANCE: "GOVERNANCE",
};
const StorageClass = {
    DEEP_ARCHIVE: "DEEP_ARCHIVE",
    EXPRESS_ONEZONE: "EXPRESS_ONEZONE",
    GLACIER: "GLACIER",
    GLACIER_IR: "GLACIER_IR",
    INTELLIGENT_TIERING: "INTELLIGENT_TIERING",
    ONEZONE_IA: "ONEZONE_IA",
    OUTPOSTS: "OUTPOSTS",
    REDUCED_REDUNDANCY: "REDUCED_REDUNDANCY",
    SNOW: "SNOW",
    STANDARD: "STANDARD",
    STANDARD_IA: "STANDARD_IA",
};
const TaggingDirective = {
    COPY: "COPY",
    REPLACE: "REPLACE",
};
class ObjectNotInActiveTierError extends S3ServiceException {
    name = "ObjectNotInActiveTierError";
    $fault = "client";
    constructor(opts) {
        super({
            name: "ObjectNotInActiveTierError",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, ObjectNotInActiveTierError.prototype);
    }
}
class BucketAlreadyExists extends S3ServiceException {
    name = "BucketAlreadyExists";
    $fault = "client";
    constructor(opts) {
        super({
            name: "BucketAlreadyExists",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, BucketAlreadyExists.prototype);
    }
}
class BucketAlreadyOwnedByYou extends S3ServiceException {
    name = "BucketAlreadyOwnedByYou";
    $fault = "client";
    constructor(opts) {
        super({
            name: "BucketAlreadyOwnedByYou",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, BucketAlreadyOwnedByYou.prototype);
    }
}
const BucketCannedACL = {
    authenticated_read: "authenticated-read",
    private: "private",
    public_read: "public-read",
    public_read_write: "public-read-write",
};
const DataRedundancy = {
    SingleAvailabilityZone: "SingleAvailabilityZone",
    SingleLocalZone: "SingleLocalZone",
};
const BucketType = {
    Directory: "Directory",
};
const LocationType = {
    AvailabilityZone: "AvailabilityZone",
    LocalZone: "LocalZone",
};
const BucketLocationConstraint = {
    EU: "EU",
    af_south_1: "af-south-1",
    ap_east_1: "ap-east-1",
    ap_northeast_1: "ap-northeast-1",
    ap_northeast_2: "ap-northeast-2",
    ap_northeast_3: "ap-northeast-3",
    ap_south_1: "ap-south-1",
    ap_south_2: "ap-south-2",
    ap_southeast_1: "ap-southeast-1",
    ap_southeast_2: "ap-southeast-2",
    ap_southeast_3: "ap-southeast-3",
    ap_southeast_4: "ap-southeast-4",
    ap_southeast_5: "ap-southeast-5",
    ca_central_1: "ca-central-1",
    cn_north_1: "cn-north-1",
    cn_northwest_1: "cn-northwest-1",
    eu_central_1: "eu-central-1",
    eu_central_2: "eu-central-2",
    eu_north_1: "eu-north-1",
    eu_south_1: "eu-south-1",
    eu_south_2: "eu-south-2",
    eu_west_1: "eu-west-1",
    eu_west_2: "eu-west-2",
    eu_west_3: "eu-west-3",
    il_central_1: "il-central-1",
    me_central_1: "me-central-1",
    me_south_1: "me-south-1",
    sa_east_1: "sa-east-1",
    us_east_2: "us-east-2",
    us_gov_east_1: "us-gov-east-1",
    us_gov_west_1: "us-gov-west-1",
    us_west_1: "us-west-1",
    us_west_2: "us-west-2",
};
const ObjectOwnership = {
    BucketOwnerEnforced: "BucketOwnerEnforced",
    BucketOwnerPreferred: "BucketOwnerPreferred",
    ObjectWriter: "ObjectWriter",
};
const SessionMode = {
    ReadOnly: "ReadOnly",
    ReadWrite: "ReadWrite",
};
class NoSuchBucket extends S3ServiceException {
    name = "NoSuchBucket";
    $fault = "client";
    constructor(opts) {
        super({
            name: "NoSuchBucket",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, NoSuchBucket.prototype);
    }
}
var models_0_AnalyticsFilter;
(function (AnalyticsFilter) {
    AnalyticsFilter.visit = (value, visitor) => {
        if (value.Prefix !== undefined)
            return visitor.Prefix(value.Prefix);
        if (value.Tag !== undefined)
            return visitor.Tag(value.Tag);
        if (value.And !== undefined)
            return visitor.And(value.And);
        return visitor._(value.$unknown[0], value.$unknown[1]);
    };
})(models_0_AnalyticsFilter || (models_0_AnalyticsFilter = {}));
const AnalyticsS3ExportFileFormat = {
    CSV: "CSV",
};
const StorageClassAnalysisSchemaVersion = {
    V_1: "V_1",
};
const IntelligentTieringStatus = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
const IntelligentTieringAccessTier = {
    ARCHIVE_ACCESS: "ARCHIVE_ACCESS",
    DEEP_ARCHIVE_ACCESS: "DEEP_ARCHIVE_ACCESS",
};
const InventoryFormat = {
    CSV: "CSV",
    ORC: "ORC",
    Parquet: "Parquet",
};
const InventoryIncludedObjectVersions = {
    All: "All",
    Current: "Current",
};
const InventoryOptionalField = {
    BucketKeyStatus: "BucketKeyStatus",
    ChecksumAlgorithm: "ChecksumAlgorithm",
    ETag: "ETag",
    EncryptionStatus: "EncryptionStatus",
    IntelligentTieringAccessTier: "IntelligentTieringAccessTier",
    IsMultipartUploaded: "IsMultipartUploaded",
    LastModifiedDate: "LastModifiedDate",
    ObjectAccessControlList: "ObjectAccessControlList",
    ObjectLockLegalHoldStatus: "ObjectLockLegalHoldStatus",
    ObjectLockMode: "ObjectLockMode",
    ObjectLockRetainUntilDate: "ObjectLockRetainUntilDate",
    ObjectOwner: "ObjectOwner",
    ReplicationStatus: "ReplicationStatus",
    Size: "Size",
    StorageClass: "StorageClass",
};
const InventoryFrequency = {
    Daily: "Daily",
    Weekly: "Weekly",
};
const TransitionStorageClass = {
    DEEP_ARCHIVE: "DEEP_ARCHIVE",
    GLACIER: "GLACIER",
    GLACIER_IR: "GLACIER_IR",
    INTELLIGENT_TIERING: "INTELLIGENT_TIERING",
    ONEZONE_IA: "ONEZONE_IA",
    STANDARD_IA: "STANDARD_IA",
};
const ExpirationStatus = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
const TransitionDefaultMinimumObjectSize = {
    all_storage_classes_128K: "all_storage_classes_128K",
    varies_by_storage_class: "varies_by_storage_class",
};
const BucketLogsPermission = {
    FULL_CONTROL: "FULL_CONTROL",
    READ: "READ",
    WRITE: "WRITE",
};
const PartitionDateSource = {
    DeliveryTime: "DeliveryTime",
    EventTime: "EventTime",
};
var models_0_MetricsFilter;
(function (MetricsFilter) {
    MetricsFilter.visit = (value, visitor) => {
        if (value.Prefix !== undefined)
            return visitor.Prefix(value.Prefix);
        if (value.Tag !== undefined)
            return visitor.Tag(value.Tag);
        if (value.AccessPointArn !== undefined)
            return visitor.AccessPointArn(value.AccessPointArn);
        if (value.And !== undefined)
            return visitor.And(value.And);
        return visitor._(value.$unknown[0], value.$unknown[1]);
    };
})(models_0_MetricsFilter || (models_0_MetricsFilter = {}));
const models_0_Event = {
    s3_IntelligentTiering: "s3:IntelligentTiering",
    s3_LifecycleExpiration_: "s3:LifecycleExpiration:*",
    s3_LifecycleExpiration_Delete: "s3:LifecycleExpiration:Delete",
    s3_LifecycleExpiration_DeleteMarkerCreated: "s3:LifecycleExpiration:DeleteMarkerCreated",
    s3_LifecycleTransition: "s3:LifecycleTransition",
    s3_ObjectAcl_Put: "s3:ObjectAcl:Put",
    s3_ObjectCreated_: "s3:ObjectCreated:*",
    s3_ObjectCreated_CompleteMultipartUpload: "s3:ObjectCreated:CompleteMultipartUpload",
    s3_ObjectCreated_Copy: "s3:ObjectCreated:Copy",
    s3_ObjectCreated_Post: "s3:ObjectCreated:Post",
    s3_ObjectCreated_Put: "s3:ObjectCreated:Put",
    s3_ObjectRemoved_: "s3:ObjectRemoved:*",
    s3_ObjectRemoved_Delete: "s3:ObjectRemoved:Delete",
    s3_ObjectRemoved_DeleteMarkerCreated: "s3:ObjectRemoved:DeleteMarkerCreated",
    s3_ObjectRestore_: "s3:ObjectRestore:*",
    s3_ObjectRestore_Completed: "s3:ObjectRestore:Completed",
    s3_ObjectRestore_Delete: "s3:ObjectRestore:Delete",
    s3_ObjectRestore_Post: "s3:ObjectRestore:Post",
    s3_ObjectTagging_: "s3:ObjectTagging:*",
    s3_ObjectTagging_Delete: "s3:ObjectTagging:Delete",
    s3_ObjectTagging_Put: "s3:ObjectTagging:Put",
    s3_ReducedRedundancyLostObject: "s3:ReducedRedundancyLostObject",
    s3_Replication_: "s3:Replication:*",
    s3_Replication_OperationFailedReplication: "s3:Replication:OperationFailedReplication",
    s3_Replication_OperationMissedThreshold: "s3:Replication:OperationMissedThreshold",
    s3_Replication_OperationNotTracked: "s3:Replication:OperationNotTracked",
    s3_Replication_OperationReplicatedAfterThreshold: "s3:Replication:OperationReplicatedAfterThreshold",
};
const FilterRuleName = {
    prefix: "prefix",
    suffix: "suffix",
};
const DeleteMarkerReplicationStatus = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
const MetricsStatus = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
const ReplicationTimeStatus = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
const ExistingObjectReplicationStatus = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
const ReplicaModificationsStatus = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
const SseKmsEncryptedObjectsStatus = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
const ReplicationRuleStatus = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
const Payer = {
    BucketOwner: "BucketOwner",
    Requester: "Requester",
};
const MFADeleteStatus = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
const BucketVersioningStatus = {
    Enabled: "Enabled",
    Suspended: "Suspended",
};
const Protocol = {
    http: "http",
    https: "https",
};
const ReplicationStatus = {
    COMPLETE: "COMPLETE",
    COMPLETED: "COMPLETED",
    FAILED: "FAILED",
    PENDING: "PENDING",
    REPLICA: "REPLICA",
};
const ChecksumMode = {
    ENABLED: "ENABLED",
};
class InvalidObjectState extends S3ServiceException {
    name = "InvalidObjectState";
    $fault = "client";
    StorageClass;
    AccessTier;
    constructor(opts) {
        super({
            name: "InvalidObjectState",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, InvalidObjectState.prototype);
        this.StorageClass = opts.StorageClass;
        this.AccessTier = opts.AccessTier;
    }
}
class NoSuchKey extends S3ServiceException {
    name = "NoSuchKey";
    $fault = "client";
    constructor(opts) {
        super({
            name: "NoSuchKey",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, NoSuchKey.prototype);
    }
}
const ObjectAttributes = {
    CHECKSUM: "Checksum",
    ETAG: "ETag",
    OBJECT_PARTS: "ObjectParts",
    OBJECT_SIZE: "ObjectSize",
    STORAGE_CLASS: "StorageClass",
};
const ObjectLockEnabled = {
    Enabled: "Enabled",
};
const ObjectLockRetentionMode = {
    COMPLIANCE: "COMPLIANCE",
    GOVERNANCE: "GOVERNANCE",
};
class NotFound extends S3ServiceException {
    name = "NotFound";
    $fault = "client";
    constructor(opts) {
        super({
            name: "NotFound",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, NotFound.prototype);
    }
}
const ArchiveStatus = {
    ARCHIVE_ACCESS: "ARCHIVE_ACCESS",
    DEEP_ARCHIVE_ACCESS: "DEEP_ARCHIVE_ACCESS",
};
const EncodingType = {
    url: "url",
};
const ObjectStorageClass = {
    DEEP_ARCHIVE: "DEEP_ARCHIVE",
    EXPRESS_ONEZONE: "EXPRESS_ONEZONE",
    GLACIER: "GLACIER",
    GLACIER_IR: "GLACIER_IR",
    INTELLIGENT_TIERING: "INTELLIGENT_TIERING",
    ONEZONE_IA: "ONEZONE_IA",
    OUTPOSTS: "OUTPOSTS",
    REDUCED_REDUNDANCY: "REDUCED_REDUNDANCY",
    SNOW: "SNOW",
    STANDARD: "STANDARD",
    STANDARD_IA: "STANDARD_IA",
};
const OptionalObjectAttributes = {
    RESTORE_STATUS: "RestoreStatus",
};
const ObjectVersionStorageClass = {
    STANDARD: "STANDARD",
};
const CompleteMultipartUploadOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
});
const CompleteMultipartUploadRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
});
const CopyObjectOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
    ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }),
});
const CopyObjectRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
    ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }),
    ...(obj.CopySourceSSECustomerKey && { CopySourceSSECustomerKey: SENSITIVE_STRING }),
});
const CreateMultipartUploadOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
    ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }),
});
const CreateMultipartUploadRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
    ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }),
});
const SessionCredentialsFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SecretAccessKey && { SecretAccessKey: constants_SENSITIVE_STRING }),
    ...(obj.SessionToken && { SessionToken: constants_SENSITIVE_STRING }),
});
const CreateSessionOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: constants_SENSITIVE_STRING }),
    ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: constants_SENSITIVE_STRING }),
    ...(obj.Credentials && { Credentials: SessionCredentialsFilterSensitiveLog(obj.Credentials) }),
});
const CreateSessionRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: constants_SENSITIVE_STRING }),
    ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: constants_SENSITIVE_STRING }),
});
const ServerSideEncryptionByDefaultFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.KMSMasterKeyID && { KMSMasterKeyID: SENSITIVE_STRING }),
});
const ServerSideEncryptionRuleFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.ApplyServerSideEncryptionByDefault && {
        ApplyServerSideEncryptionByDefault: ServerSideEncryptionByDefaultFilterSensitiveLog(obj.ApplyServerSideEncryptionByDefault),
    }),
});
const models_0_ServerSideEncryptionConfigurationFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.Rules && { Rules: obj.Rules.map((item) => ServerSideEncryptionRuleFilterSensitiveLog(item)) }),
});
const GetBucketEncryptionOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.ServerSideEncryptionConfiguration && {
        ServerSideEncryptionConfiguration: models_0_ServerSideEncryptionConfigurationFilterSensitiveLog(obj.ServerSideEncryptionConfiguration),
    }),
});
const SSEKMSFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.KeyId && { KeyId: SENSITIVE_STRING }),
});
const InventoryEncryptionFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMS && { SSEKMS: SSEKMSFilterSensitiveLog(obj.SSEKMS) }),
});
const InventoryS3BucketDestinationFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.Encryption && { Encryption: InventoryEncryptionFilterSensitiveLog(obj.Encryption) }),
});
const InventoryDestinationFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.S3BucketDestination && {
        S3BucketDestination: InventoryS3BucketDestinationFilterSensitiveLog(obj.S3BucketDestination),
    }),
});
const models_0_InventoryConfigurationFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.Destination && { Destination: InventoryDestinationFilterSensitiveLog(obj.Destination) }),
});
const GetBucketInventoryConfigurationOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.InventoryConfiguration && {
        InventoryConfiguration: models_0_InventoryConfigurationFilterSensitiveLog(obj.InventoryConfiguration),
    }),
});
const GetObjectOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
});
const GetObjectRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
});
const GetObjectAttributesRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
});
const GetObjectTorrentOutputFilterSensitiveLog = (obj) => ({
    ...obj,
});
const HeadObjectOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
});
const HeadObjectRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
});
const ListBucketInventoryConfigurationsOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.InventoryConfigurationList && {
        InventoryConfigurationList: obj.InventoryConfigurationList.map((item) => models_0_InventoryConfigurationFilterSensitiveLog(item)),
    }),
});
const ListPartsRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
});

// EXTERNAL MODULE: ../../modules/utils/code/helpers/node_modules/fast-xml-parser/src/fxp.js
var fxp = __webpack_require__(6441);
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js

const collectBodyString = (streamBody, context) => collect_stream_body_collectBody(streamBody, context).then((body) => context.utf8Encoder(body));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js



const parseXmlBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
    if (encoded.length) {
        const parser = new fxp.XMLParser({
            attributeNamePrefix: "",
            htmlEntities: true,
            ignoreAttributes: false,
            ignoreDeclaration: true,
            parseTagValue: false,
            trimValues: false,
            tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
        });
        parser.addEntity("#xD", "\r");
        parser.addEntity("#10", "\n");
        let parsedObj;
        try {
            parsedObj = parser.parse(encoded, true);
        }
        catch (e) {
            if (e && typeof e === "object") {
                Object.defineProperty(e, "$responseBodyText", {
                    value: encoded,
                });
            }
            throw e;
        }
        const textNodeName = "#text";
        const key = Object.keys(parsedObj)[0];
        const parsedObjToReturn = parsedObj[key];
        if (parsedObjToReturn[textNodeName]) {
            parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
            delete parsedObjToReturn[textNodeName];
        }
        return getValueFromTextNode(parsedObjToReturn);
    }
    return {};
});
const parseXmlErrorBody = async (errorBody, context) => {
    const value = await parseXmlBody(errorBody, context);
    if (value.Error) {
        value.Error.message = value.Error.message ?? value.Error.Message;
    }
    return value;
};
const loadRestXmlErrorCode = (output, data) => {
    if (data?.Error?.Code !== undefined) {
        return data.Error.Code;
    }
    if (data?.Code !== undefined) {
        return data.Code;
    }
    if (output.statusCode == 404) {
        return "NotFound";
    }
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/models/models_1.js



const MFADelete = {
    Disabled: "Disabled",
    Enabled: "Enabled",
};
class EncryptionTypeMismatch extends S3ServiceException {
    name = "EncryptionTypeMismatch";
    $fault = "client";
    constructor(opts) {
        super({
            name: "EncryptionTypeMismatch",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, EncryptionTypeMismatch.prototype);
    }
}
class InvalidRequest extends S3ServiceException {
    name = "InvalidRequest";
    $fault = "client";
    constructor(opts) {
        super({
            name: "InvalidRequest",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, InvalidRequest.prototype);
    }
}
class InvalidWriteOffset extends S3ServiceException {
    name = "InvalidWriteOffset";
    $fault = "client";
    constructor(opts) {
        super({
            name: "InvalidWriteOffset",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, InvalidWriteOffset.prototype);
    }
}
class TooManyParts extends S3ServiceException {
    name = "TooManyParts";
    $fault = "client";
    constructor(opts) {
        super({
            name: "TooManyParts",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, TooManyParts.prototype);
    }
}
class ObjectAlreadyInActiveTierError extends S3ServiceException {
    name = "ObjectAlreadyInActiveTierError";
    $fault = "client";
    constructor(opts) {
        super({
            name: "ObjectAlreadyInActiveTierError",
            $fault: "client",
            ...opts,
        });
        Object.setPrototypeOf(this, ObjectAlreadyInActiveTierError.prototype);
    }
}
const Tier = {
    Bulk: "Bulk",
    Expedited: "Expedited",
    Standard: "Standard",
};
const ExpressionType = {
    SQL: "SQL",
};
const CompressionType = {
    BZIP2: "BZIP2",
    GZIP: "GZIP",
    NONE: "NONE",
};
const FileHeaderInfo = {
    IGNORE: "IGNORE",
    NONE: "NONE",
    USE: "USE",
};
const JSONType = {
    DOCUMENT: "DOCUMENT",
    LINES: "LINES",
};
const QuoteFields = {
    ALWAYS: "ALWAYS",
    ASNEEDED: "ASNEEDED",
};
const RestoreRequestType = {
    SELECT: "SELECT",
};
var SelectObjectContentEventStream;
(function (SelectObjectContentEventStream) {
    SelectObjectContentEventStream.visit = (value, visitor) => {
        if (value.Records !== undefined)
            return visitor.Records(value.Records);
        if (value.Stats !== undefined)
            return visitor.Stats(value.Stats);
        if (value.Progress !== undefined)
            return visitor.Progress(value.Progress);
        if (value.Cont !== undefined)
            return visitor.Cont(value.Cont);
        if (value.End !== undefined)
            return visitor.End(value.End);
        return visitor._(value.$unknown[0], value.$unknown[1]);
    };
})(SelectObjectContentEventStream || (SelectObjectContentEventStream = {}));
const PutBucketEncryptionRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.ServerSideEncryptionConfiguration && {
        ServerSideEncryptionConfiguration: ServerSideEncryptionConfigurationFilterSensitiveLog(obj.ServerSideEncryptionConfiguration),
    }),
});
const PutBucketInventoryConfigurationRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.InventoryConfiguration && {
        InventoryConfiguration: InventoryConfigurationFilterSensitiveLog(obj.InventoryConfiguration),
    }),
});
const PutObjectOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
    ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }),
});
const PutObjectRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
    ...(obj.SSEKMSEncryptionContext && { SSEKMSEncryptionContext: SENSITIVE_STRING }),
});
const EncryptionFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.KMSKeyId && { KMSKeyId: SENSITIVE_STRING }),
});
const S3LocationFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.Encryption && { Encryption: EncryptionFilterSensitiveLog(obj.Encryption) }),
});
const OutputLocationFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.S3 && { S3: S3LocationFilterSensitiveLog(obj.S3) }),
});
const RestoreRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.OutputLocation && { OutputLocation: OutputLocationFilterSensitiveLog(obj.OutputLocation) }),
});
const RestoreObjectRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.RestoreRequest && { RestoreRequest: RestoreRequestFilterSensitiveLog(obj.RestoreRequest) }),
});
const SelectObjectContentEventStreamFilterSensitiveLog = (obj) => {
    if (obj.Records !== undefined)
        return { Records: obj.Records };
    if (obj.Stats !== undefined)
        return { Stats: obj.Stats };
    if (obj.Progress !== undefined)
        return { Progress: obj.Progress };
    if (obj.Cont !== undefined)
        return { Cont: obj.Cont };
    if (obj.End !== undefined)
        return { End: obj.End };
    if (obj.$unknown !== undefined)
        return { [obj.$unknown[0]]: "UNKNOWN" };
};
const SelectObjectContentOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.Payload && { Payload: "STREAMING_CONTENT" }),
});
const SelectObjectContentRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
});
const UploadPartOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
});
const UploadPartRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
});
const UploadPartCopyOutputFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
});
const UploadPartCopyRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSECustomerKey && { SSECustomerKey: SENSITIVE_STRING }),
    ...(obj.CopySourceSSECustomerKey && { CopySourceSSECustomerKey: SENSITIVE_STRING }),
});
const WriteGetObjectResponseRequestFilterSensitiveLog = (obj) => ({
    ...obj,
    ...(obj.SSEKMSKeyId && { SSEKMSKeyId: SENSITIVE_STRING }),
});

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/protocols/Aws_restXml.js








const se_AbortMultipartUploadCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xaimit]: [() => isSerializableHeaderValue(input[_IMIT]), () => __dateToUtcString(input[_IMIT]).toString()],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_xi]: [, "AbortMultipartUpload"],
        [_uI]: [, __expectNonNull(input[_UI], `UploadId`)],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_CompleteMultipartUploadCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xacc]: input[_CCRC],
        [_xacc_]: input[_CCRCC],
        [_xacc__]: input[_CCRCNVME],
        [_xacs]: input[_CSHA],
        [_xacs_]: input[_CSHAh],
        [_xact]: input[_CT],
        [_xamos]: [() => isSerializableHeaderValue(input[_MOS]), () => input[_MOS].toString()],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_im]: input[_IM],
        [_inm]: input[_INM],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_uI]: [, __expectNonNull(input[_UI], `UploadId`)],
    });
    let body;
    let contents;
    if (input.MultipartUpload !== undefined) {
        contents = se_CompletedMultipartUpload(input.MultipartUpload, context);
        contents = contents.n("CompleteMultipartUpload");
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("POST").h(headers).q(query).b(body);
    return b.build();
};
const se_CopyObjectCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaa]: input[_ACL],
        [_cc]: input[_CC],
        [_xaca]: input[_CA],
        [_cd]: input[_CD],
        [_ce]: input[_CE],
        [_cl]: input[_CL],
        [_ct]: input[_CTo],
        [_xacs__]: input[_CS],
        [_xacsim]: input[_CSIM],
        [_xacsims]: [() => isSerializableHeaderValue(input[_CSIMS]), () => __dateToUtcString(input[_CSIMS]).toString()],
        [_xacsinm]: input[_CSINM],
        [_xacsius]: [() => isSerializableHeaderValue(input[_CSIUS]), () => __dateToUtcString(input[_CSIUS]).toString()],
        [Aws_restXml_e]: [() => isSerializableHeaderValue(input[_E]), () => __dateToUtcString(input[_E]).toString()],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagwa]: input[_GWACP],
        [_xamd]: input[_MD],
        [_xatd]: input[_TD],
        [_xasse]: input[_SSE],
        [_xasc]: input[_SC],
        [_xawrl]: input[_WRL],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xasseakki]: input[_SSEKMSKI],
        [_xassec]: input[_SSEKMSEC],
        [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()],
        [_xacssseca]: input[_CSSSECA],
        [_xacssseck]: input[_CSSSECK],
        [_xacssseckm]: input[_CSSSECKMD],
        [_xarp]: input[_RP],
        [_xat]: input[_T],
        [_xaolm]: input[_OLM],
        [_xaolrud]: [() => isSerializableHeaderValue(input[_OLRUD]), () => __serializeDateTime(input[_OLRUD]).toString()],
        [_xaollh]: input[_OLLHS],
        [_xaebo]: input[_EBO],
        [_xasebo]: input[_ESBO],
        ...(input.Metadata !== undefined &&
            Object.keys(input.Metadata).reduce((acc, suffix) => {
                acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix];
                return acc;
            }, {})),
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_xi]: [, "CopyObject"],
    });
    let body;
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_CreateBucketCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaa]: input[_ACL],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagw]: input[_GW],
        [_xagwa]: input[_GWACP],
        [_xabole]: [() => isSerializableHeaderValue(input[_OLEFB]), () => input[_OLEFB].toString()],
        [_xaoo]: input[_OO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    let body;
    let contents;
    if (input.CreateBucketConfiguration !== undefined) {
        contents = se_CreateBucketConfiguration(input.CreateBucketConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).b(body);
    return b.build();
};
const se_CreateBucketMetadataTableConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_mT]: [, ""],
    });
    let body;
    let contents;
    if (input.MetadataTableConfiguration !== undefined) {
        contents = se_MetadataTableConfiguration(input.MetadataTableConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("POST").h(headers).q(query).b(body);
    return b.build();
};
const se_CreateMultipartUploadCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaa]: input[_ACL],
        [_cc]: input[_CC],
        [_cd]: input[_CD],
        [_ce]: input[_CE],
        [_cl]: input[_CL],
        [_ct]: input[_CTo],
        [Aws_restXml_e]: [() => isSerializableHeaderValue(input[_E]), () => __dateToUtcString(input[_E]).toString()],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagwa]: input[_GWACP],
        [_xasse]: input[_SSE],
        [_xasc]: input[_SC],
        [_xawrl]: input[_WRL],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xasseakki]: input[_SSEKMSKI],
        [_xassec]: input[_SSEKMSEC],
        [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()],
        [_xarp]: input[_RP],
        [_xat]: input[_T],
        [_xaolm]: input[_OLM],
        [_xaolrud]: [() => isSerializableHeaderValue(input[_OLRUD]), () => __serializeDateTime(input[_OLRUD]).toString()],
        [_xaollh]: input[_OLLHS],
        [_xaebo]: input[_EBO],
        [_xaca]: input[_CA],
        [_xact]: input[_CT],
        ...(input.Metadata !== undefined &&
            Object.keys(input.Metadata).reduce((acc, suffix) => {
                acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix];
                return acc;
            }, {})),
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_u]: [, ""],
    });
    let body;
    b.m("POST").h(headers).q(query).b(body);
    return b.build();
};
const se_CreateSessionCommand = async (input, context) => {
    const b = requestBuilder(input, context);
    const headers = object_mapping_map({}, is_serializable_header_value_isSerializableHeaderValue, {
        [_xacsm]: input[_SM],
        [_xasse]: input[_SSE],
        [_xasseakki]: input[_SSEKMSKI],
        [_xassec]: input[_SSEKMSEC],
        [_xassebke]: [() => is_serializable_header_value_isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = object_mapping_map({
        [_s]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    let body;
    b.m("DELETE").h(headers).b(body);
    return b.build();
};
const se_DeleteBucketAnalyticsConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_a]: [, ""],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketCorsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_c]: [, ""],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketEncryptionCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_en]: [, ""],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketIntelligentTieringConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = {};
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_it]: [, ""],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketInventoryConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_in]: [, ""],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketLifecycleCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_l]: [, ""],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketMetadataTableConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_mT]: [, ""],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketMetricsConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_m]: [, ""],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketOwnershipControlsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_oC]: [, ""],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketPolicyCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_p]: [, ""],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketReplicationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_r]: [, ""],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketTaggingCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [Aws_restXml_t]: [, ""],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteBucketWebsiteCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_w]: [, ""],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteObjectCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xam]: input[_MFA],
        [_xarp]: input[_RP],
        [_xabgr]: [() => isSerializableHeaderValue(input[_BGR]), () => input[_BGR].toString()],
        [_xaebo]: input[_EBO],
        [_im]: input[_IM],
        [_xaimlmt]: [() => isSerializableHeaderValue(input[_IMLMT]), () => __dateToUtcString(input[_IMLMT]).toString()],
        [_xaims]: [() => isSerializableHeaderValue(input[_IMS]), () => input[_IMS].toString()],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_xi]: [, "DeleteObject"],
        [_vI]: [, input[_VI]],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteObjectsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xam]: input[_MFA],
        [_xarp]: input[_RP],
        [_xabgr]: [() => isSerializableHeaderValue(input[_BGR]), () => input[_BGR].toString()],
        [_xaebo]: input[_EBO],
        [_xasca]: input[_CA],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_d]: [, ""],
    });
    let body;
    let contents;
    if (input.Delete !== undefined) {
        contents = se_Delete(input.Delete, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("POST").h(headers).q(query).b(body);
    return b.build();
};
const se_DeleteObjectTaggingCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [Aws_restXml_t]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_DeletePublicAccessBlockCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_pAB]: [, ""],
    });
    let body;
    b.m("DELETE").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketAccelerateConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
        [_xarp]: input[_RP],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_ac]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketAclCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_acl]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketAnalyticsConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_a]: [, ""],
        [_xi]: [, "GetBucketAnalyticsConfiguration"],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketCorsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_c]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketEncryptionCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_en]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketIntelligentTieringConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = {};
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_it]: [, ""],
        [_xi]: [, "GetBucketIntelligentTieringConfiguration"],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketInventoryConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_in]: [, ""],
        [_xi]: [, "GetBucketInventoryConfiguration"],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketLifecycleConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_l]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketLocationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_lo]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketLoggingCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_log]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketMetadataTableConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_mT]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketMetricsConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_m]: [, ""],
        [_xi]: [, "GetBucketMetricsConfiguration"],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketNotificationConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_n]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketOwnershipControlsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_oC]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketPolicyCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_p]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketPolicyStatusCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_pS]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketReplicationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_r]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketRequestPaymentCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_rP]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketTaggingCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [Aws_restXml_t]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketVersioningCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_v]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetBucketWebsiteCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_w]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetObjectCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_im]: input[_IM],
        [_ims]: [() => isSerializableHeaderValue(input[_IMSf]), () => __dateToUtcString(input[_IMSf]).toString()],
        [_inm]: input[_INM],
        [_ius]: [() => isSerializableHeaderValue(input[_IUS]), () => __dateToUtcString(input[_IUS]).toString()],
        [_ra]: input[_R],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xacm]: input[_CM],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_xi]: [, "GetObject"],
        [_rcc]: [, input[_RCC]],
        [_rcd]: [, input[_RCD]],
        [_rce]: [, input[_RCE]],
        [_rcl]: [, input[_RCL]],
        [_rct]: [, input[_RCT]],
        [_re]: [() => input.ResponseExpires !== void 0, () => __dateToUtcString(input[_RE]).toString()],
        [_vI]: [, input[_VI]],
        [_pN]: [() => input.PartNumber !== void 0, () => input[_PN].toString()],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetObjectAclCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_acl]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetObjectAttributesCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xamp]: [() => isSerializableHeaderValue(input[_MP]), () => input[_MP].toString()],
        [_xapnm]: input[_PNM],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xaoa]: [() => isSerializableHeaderValue(input[_OA]), () => (input[_OA] || []).map(__quoteHeader).join(", ")],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_at]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetObjectLegalHoldCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_lh]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetObjectLockConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_ol]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetObjectRetentionCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_ret]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetObjectTaggingCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
        [_xarp]: input[_RP],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [Aws_restXml_t]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetObjectTorrentCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_to]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_GetPublicAccessBlockCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_pAB]: [, ""],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_HeadBucketCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    let body;
    b.m("HEAD").h(headers).b(body);
    return b.build();
};
const se_HeadObjectCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_im]: input[_IM],
        [_ims]: [() => isSerializableHeaderValue(input[_IMSf]), () => __dateToUtcString(input[_IMSf]).toString()],
        [_inm]: input[_INM],
        [_ius]: [() => isSerializableHeaderValue(input[_IUS]), () => __dateToUtcString(input[_IUS]).toString()],
        [_ra]: input[_R],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xacm]: input[_CM],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_rcc]: [, input[_RCC]],
        [_rcd]: [, input[_RCD]],
        [_rce]: [, input[_RCE]],
        [_rcl]: [, input[_RCL]],
        [_rct]: [, input[_RCT]],
        [_re]: [() => input.ResponseExpires !== void 0, () => __dateToUtcString(input[_RE]).toString()],
        [_vI]: [, input[_VI]],
        [_pN]: [() => input.PartNumber !== void 0, () => input[_PN].toString()],
    });
    let body;
    b.m("HEAD").h(headers).q(query).b(body);
    return b.build();
};
const se_ListBucketAnalyticsConfigurationsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_a]: [, ""],
        [_xi]: [, "ListBucketAnalyticsConfigurations"],
        [_ct_]: [, input[_CTon]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_ListBucketIntelligentTieringConfigurationsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = {};
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_it]: [, ""],
        [_xi]: [, "ListBucketIntelligentTieringConfigurations"],
        [_ct_]: [, input[_CTon]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_ListBucketInventoryConfigurationsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_in]: [, ""],
        [_xi]: [, "ListBucketInventoryConfigurations"],
        [_ct_]: [, input[_CTon]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_ListBucketMetricsConfigurationsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_m]: [, ""],
        [_xi]: [, "ListBucketMetricsConfigurations"],
        [_ct_]: [, input[_CTon]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_ListBucketsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = {};
    b.bp("/");
    const query = map({
        [_xi]: [, "ListBuckets"],
        [_mb]: [() => input.MaxBuckets !== void 0, () => input[_MB].toString()],
        [_ct_]: [, input[_CTon]],
        [_pr]: [, input[_P]],
        [_br]: [, input[_BR]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_ListDirectoryBucketsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = {};
    b.bp("/");
    const query = map({
        [_xi]: [, "ListDirectoryBuckets"],
        [_ct_]: [, input[_CTon]],
        [_mdb]: [() => input.MaxDirectoryBuckets !== void 0, () => input[_MDB].toString()],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_ListMultipartUploadsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
        [_xarp]: input[_RP],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_u]: [, ""],
        [_de]: [, input[_D]],
        [_et]: [, input[_ET]],
        [_km]: [, input[_KM]],
        [_mu]: [() => input.MaxUploads !== void 0, () => input[_MU].toString()],
        [_pr]: [, input[_P]],
        [_uim]: [, input[_UIM]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_ListObjectsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xaooa]: [() => isSerializableHeaderValue(input[_OOA]), () => (input[_OOA] || []).map(__quoteHeader).join(", ")],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_de]: [, input[_D]],
        [_et]: [, input[_ET]],
        [_ma]: [, input[_M]],
        [_mk]: [() => input.MaxKeys !== void 0, () => input[_MK].toString()],
        [_pr]: [, input[_P]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_ListObjectsV2Command = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xaooa]: [() => isSerializableHeaderValue(input[_OOA]), () => (input[_OOA] || []).map(__quoteHeader).join(", ")],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_lt]: [, "2"],
        [_de]: [, input[_D]],
        [_et]: [, input[_ET]],
        [_mk]: [() => input.MaxKeys !== void 0, () => input[_MK].toString()],
        [_pr]: [, input[_P]],
        [_ct_]: [, input[_CTon]],
        [_fo]: [() => input.FetchOwner !== void 0, () => input[_FO].toString()],
        [_sa]: [, input[_SA]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_ListObjectVersionsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xaebo]: input[_EBO],
        [_xarp]: input[_RP],
        [_xaooa]: [() => isSerializableHeaderValue(input[_OOA]), () => (input[_OOA] || []).map(__quoteHeader).join(", ")],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_ver]: [, ""],
        [_de]: [, input[_D]],
        [_et]: [, input[_ET]],
        [_km]: [, input[_KM]],
        [_mk]: [() => input.MaxKeys !== void 0, () => input[_MK].toString()],
        [_pr]: [, input[_P]],
        [_vim]: [, input[_VIM]],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_ListPartsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_xi]: [, "ListParts"],
        [_mp]: [() => input.MaxParts !== void 0, () => input[_MP].toString()],
        [_pnm]: [, input[_PNM]],
        [_uI]: [, __expectNonNull(input[_UI], `UploadId`)],
    });
    let body;
    b.m("GET").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketAccelerateConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaebo]: input[_EBO],
        [_xasca]: input[_CA],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_ac]: [, ""],
    });
    let body;
    let contents;
    if (input.AccelerateConfiguration !== undefined) {
        contents = se_AccelerateConfiguration(input.AccelerateConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketAclCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaa]: input[_ACL],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagw]: input[_GW],
        [_xagwa]: input[_GWACP],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_acl]: [, ""],
    });
    let body;
    let contents;
    if (input.AccessControlPolicy !== undefined) {
        contents = se_AccessControlPolicy(input.AccessControlPolicy, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketAnalyticsConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_a]: [, ""],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    let contents;
    if (input.AnalyticsConfiguration !== undefined) {
        contents = se_AnalyticsConfiguration(input.AnalyticsConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketCorsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_c]: [, ""],
    });
    let body;
    let contents;
    if (input.CORSConfiguration !== undefined) {
        contents = se_CORSConfiguration(input.CORSConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketEncryptionCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_en]: [, ""],
    });
    let body;
    let contents;
    if (input.ServerSideEncryptionConfiguration !== undefined) {
        contents = se_ServerSideEncryptionConfiguration(input.ServerSideEncryptionConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketIntelligentTieringConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = {
        "content-type": "application/xml",
    };
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_it]: [, ""],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    let contents;
    if (input.IntelligentTieringConfiguration !== undefined) {
        contents = se_IntelligentTieringConfiguration(input.IntelligentTieringConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketInventoryConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_in]: [, ""],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    let contents;
    if (input.InventoryConfiguration !== undefined) {
        contents = se_InventoryConfiguration(input.InventoryConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketLifecycleConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
        [_xatdmos]: input[_TDMOS],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_l]: [, ""],
    });
    let body;
    let contents;
    if (input.LifecycleConfiguration !== undefined) {
        contents = se_BucketLifecycleConfiguration(input.LifecycleConfiguration, context);
        contents = contents.n("LifecycleConfiguration");
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketLoggingCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_log]: [, ""],
    });
    let body;
    let contents;
    if (input.BucketLoggingStatus !== undefined) {
        contents = se_BucketLoggingStatus(input.BucketLoggingStatus, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketMetricsConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_m]: [, ""],
        [_i]: [, __expectNonNull(input[_I], `Id`)],
    });
    let body;
    let contents;
    if (input.MetricsConfiguration !== undefined) {
        contents = se_MetricsConfiguration(input.MetricsConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketNotificationConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaebo]: input[_EBO],
        [_xasdv]: [() => isSerializableHeaderValue(input[_SDV]), () => input[_SDV].toString()],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_n]: [, ""],
    });
    let body;
    let contents;
    if (input.NotificationConfiguration !== undefined) {
        contents = se_NotificationConfiguration(input.NotificationConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketOwnershipControlsCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_oC]: [, ""],
    });
    let body;
    let contents;
    if (input.OwnershipControls !== undefined) {
        contents = se_OwnershipControls(input.OwnershipControls, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketPolicyCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "text/plain",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xacrsba]: [() => isSerializableHeaderValue(input[_CRSBA]), () => input[_CRSBA].toString()],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_p]: [, ""],
    });
    let body;
    let contents;
    if (input.Policy !== undefined) {
        contents = input.Policy;
        body = contents;
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketReplicationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xabolt]: input[_To],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_r]: [, ""],
    });
    let body;
    let contents;
    if (input.ReplicationConfiguration !== undefined) {
        contents = se_ReplicationConfiguration(input.ReplicationConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketRequestPaymentCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_rP]: [, ""],
    });
    let body;
    let contents;
    if (input.RequestPaymentConfiguration !== undefined) {
        contents = se_RequestPaymentConfiguration(input.RequestPaymentConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketTaggingCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [Aws_restXml_t]: [, ""],
    });
    let body;
    let contents;
    if (input.Tagging !== undefined) {
        contents = se_Tagging(input.Tagging, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketVersioningCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xam]: input[_MFA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_v]: [, ""],
    });
    let body;
    let contents;
    if (input.VersioningConfiguration !== undefined) {
        contents = se_VersioningConfiguration(input.VersioningConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutBucketWebsiteCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_w]: [, ""],
    });
    let body;
    let contents;
    if (input.WebsiteConfiguration !== undefined) {
        contents = se_WebsiteConfiguration(input.WebsiteConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutObjectCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_ct]: input[_CTo] || "application/octet-stream",
        [_xaa]: input[_ACL],
        [_cc]: input[_CC],
        [_cd]: input[_CD],
        [_ce]: input[_CE],
        [_cl]: input[_CL],
        [_cl_]: [() => isSerializableHeaderValue(input[_CLo]), () => input[_CLo].toString()],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xacc]: input[_CCRC],
        [_xacc_]: input[_CCRCC],
        [_xacc__]: input[_CCRCNVME],
        [_xacs]: input[_CSHA],
        [_xacs_]: input[_CSHAh],
        [Aws_restXml_e]: [() => isSerializableHeaderValue(input[_E]), () => __dateToUtcString(input[_E]).toString()],
        [_im]: input[_IM],
        [_inm]: input[_INM],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagwa]: input[_GWACP],
        [_xawob]: [() => isSerializableHeaderValue(input[_WOB]), () => input[_WOB].toString()],
        [_xasse]: input[_SSE],
        [_xasc]: input[_SC],
        [_xawrl]: input[_WRL],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xasseakki]: input[_SSEKMSKI],
        [_xassec]: input[_SSEKMSEC],
        [_xassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()],
        [_xarp]: input[_RP],
        [_xat]: input[_T],
        [_xaolm]: input[_OLM],
        [_xaolrud]: [() => isSerializableHeaderValue(input[_OLRUD]), () => __serializeDateTime(input[_OLRUD]).toString()],
        [_xaollh]: input[_OLLHS],
        [_xaebo]: input[_EBO],
        ...(input.Metadata !== undefined &&
            Object.keys(input.Metadata).reduce((acc, suffix) => {
                acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix];
                return acc;
            }, {})),
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_xi]: [, "PutObject"],
    });
    let body;
    let contents;
    if (input.Body !== undefined) {
        contents = input.Body;
        body = contents;
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutObjectAclCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xaa]: input[_ACL],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xagfc]: input[_GFC],
        [_xagr]: input[_GR],
        [_xagra]: input[_GRACP],
        [_xagw]: input[_GW],
        [_xagwa]: input[_GWACP],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_acl]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    let contents;
    if (input.AccessControlPolicy !== undefined) {
        contents = se_AccessControlPolicy(input.AccessControlPolicy, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutObjectLegalHoldCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xarp]: input[_RP],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_lh]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    let contents;
    if (input.LegalHold !== undefined) {
        contents = se_ObjectLockLegalHold(input.LegalHold, context);
        contents = contents.n("LegalHold");
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutObjectLockConfigurationCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xarp]: input[_RP],
        [_xabolt]: input[_To],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_ol]: [, ""],
    });
    let body;
    let contents;
    if (input.ObjectLockConfiguration !== undefined) {
        contents = se_ObjectLockConfiguration(input.ObjectLockConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutObjectRetentionCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xarp]: input[_RP],
        [_xabgr]: [() => isSerializableHeaderValue(input[_BGR]), () => input[_BGR].toString()],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_ret]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    let contents;
    if (input.Retention !== undefined) {
        contents = se_ObjectLockRetention(input.Retention, context);
        contents = contents.n("Retention");
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutObjectTaggingCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
        [_xarp]: input[_RP],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [Aws_restXml_t]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    let contents;
    if (input.Tagging !== undefined) {
        contents = se_Tagging(input.Tagging, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_PutPublicAccessBlockCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    const query = map({
        [_pAB]: [, ""],
    });
    let body;
    let contents;
    if (input.PublicAccessBlockConfiguration !== undefined) {
        contents = se_PublicAccessBlockConfiguration(input.PublicAccessBlockConfiguration, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_RestoreObjectCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xarp]: input[_RP],
        [_xasca]: input[_CA],
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_res]: [, ""],
        [_vI]: [, input[_VI]],
    });
    let body;
    let contents;
    if (input.RestoreRequest !== undefined) {
        contents = se_RestoreRequest(input.RestoreRequest, context);
        body = _ve;
        contents.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
        body += contents.toString();
    }
    b.m("POST").h(headers).q(query).b(body);
    return b.build();
};
const se_SelectObjectContentCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/xml",
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_se]: [, ""],
        [_st]: [, "2"],
    });
    let body;
    body = _ve;
    const bn = new __XmlNode(_SOCR);
    bn.a("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/");
    bn.cc(input, _Ex);
    bn.cc(input, _ETx);
    if (input[_IS] != null) {
        bn.c(se_InputSerialization(input[_IS], context).n(_IS));
    }
    if (input[_OS] != null) {
        bn.c(se_OutputSerialization(input[_OS], context).n(_OS));
    }
    if (input[_RPe] != null) {
        bn.c(se_RequestProgress(input[_RPe], context).n(_RPe));
    }
    if (input[_SR] != null) {
        bn.c(se_ScanRange(input[_SR], context).n(_SR));
    }
    body += bn.toString();
    b.m("POST").h(headers).q(query).b(body);
    return b.build();
};
const se_UploadPartCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "content-type": "application/octet-stream",
        [_cl_]: [() => isSerializableHeaderValue(input[_CLo]), () => input[_CLo].toString()],
        [_cm]: input[_CMD],
        [_xasca]: input[_CA],
        [_xacc]: input[_CCRC],
        [_xacc_]: input[_CCRCC],
        [_xacc__]: input[_CCRCNVME],
        [_xacs]: input[_CSHA],
        [_xacs_]: input[_CSHAh],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_xi]: [, "UploadPart"],
        [_pN]: [__expectNonNull(input.PartNumber, `PartNumber`) != null, () => input[_PN].toString()],
        [_uI]: [, __expectNonNull(input[_UI], `UploadId`)],
    });
    let body;
    let contents;
    if (input.Body !== undefined) {
        contents = input.Body;
        body = contents;
    }
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_UploadPartCopyCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        [_xacs__]: input[_CS],
        [_xacsim]: input[_CSIM],
        [_xacsims]: [() => isSerializableHeaderValue(input[_CSIMS]), () => __dateToUtcString(input[_CSIMS]).toString()],
        [_xacsinm]: input[_CSINM],
        [_xacsius]: [() => isSerializableHeaderValue(input[_CSIUS]), () => __dateToUtcString(input[_CSIUS]).toString()],
        [_xacsr]: input[_CSR],
        [_xasseca]: input[_SSECA],
        [_xasseck]: input[_SSECK],
        [_xasseckm]: input[_SSECKMD],
        [_xacssseca]: input[_CSSSECA],
        [_xacssseck]: input[_CSSSECK],
        [_xacssseckm]: input[_CSSSECKMD],
        [_xarp]: input[_RP],
        [_xaebo]: input[_EBO],
        [_xasebo]: input[_ESBO],
    });
    b.bp("/{Key+}");
    b.p("Bucket", () => input.Bucket, "{Bucket}", false);
    b.p("Key", () => input.Key, "{Key+}", true);
    const query = map({
        [_xi]: [, "UploadPartCopy"],
        [_pN]: [__expectNonNull(input.PartNumber, `PartNumber`) != null, () => input[_PN].toString()],
        [_uI]: [, __expectNonNull(input[_UI], `UploadId`)],
    });
    let body;
    b.m("PUT").h(headers).q(query).b(body);
    return b.build();
};
const se_WriteGetObjectResponseCommand = async (input, context) => {
    const b = rb(input, context);
    const headers = map({}, isSerializableHeaderValue, {
        "x-amz-content-sha256": "UNSIGNED-PAYLOAD",
        "content-type": "application/octet-stream",
        [_xarr]: input[_RR],
        [_xart]: input[_RT],
        [_xafs]: [() => isSerializableHeaderValue(input[_SCt]), () => input[_SCt].toString()],
        [_xafec]: input[_EC],
        [_xafem]: input[_EM],
        [_xafhar]: input[_AR],
        [_xafhcc]: input[_CC],
        [_xafhcd]: input[_CD],
        [_xafhce]: input[_CE],
        [_xafhcl]: input[_CL],
        [_cl_]: [() => isSerializableHeaderValue(input[_CLo]), () => input[_CLo].toString()],
        [_xafhcr]: input[_CR],
        [_xafhct]: input[_CTo],
        [_xafhxacc]: input[_CCRC],
        [_xafhxacc_]: input[_CCRCC],
        [_xafhxacc__]: input[_CCRCNVME],
        [_xafhxacs]: input[_CSHA],
        [_xafhxacs_]: input[_CSHAh],
        [_xafhxadm]: [() => isSerializableHeaderValue(input[_DM]), () => input[_DM].toString()],
        [_xafhe]: input[_ETa],
        [_xafhe_]: [() => isSerializableHeaderValue(input[_E]), () => __dateToUtcString(input[_E]).toString()],
        [_xafhxae]: input[_Exp],
        [_xafhlm]: [() => isSerializableHeaderValue(input[_LM]), () => __dateToUtcString(input[_LM]).toString()],
        [_xafhxamm]: [() => isSerializableHeaderValue(input[_MM]), () => input[_MM].toString()],
        [_xafhxaolm]: input[_OLM],
        [_xafhxaollh]: input[_OLLHS],
        [_xafhxaolrud]: [
            () => isSerializableHeaderValue(input[_OLRUD]),
            () => __serializeDateTime(input[_OLRUD]).toString(),
        ],
        [_xafhxampc]: [() => isSerializableHeaderValue(input[_PC]), () => input[_PC].toString()],
        [_xafhxars]: input[_RS],
        [_xafhxarc]: input[_RC],
        [_xafhxar]: input[_Re],
        [_xafhxasse]: input[_SSE],
        [_xafhxasseca]: input[_SSECA],
        [_xafhxasseakki]: input[_SSEKMSKI],
        [_xafhxasseckm]: input[_SSECKMD],
        [_xafhxasc]: input[_SC],
        [_xafhxatc]: [() => isSerializableHeaderValue(input[_TC]), () => input[_TC].toString()],
        [_xafhxavi]: input[_VI],
        [_xafhxassebke]: [() => isSerializableHeaderValue(input[_BKE]), () => input[_BKE].toString()],
        ...(input.Metadata !== undefined &&
            Object.keys(input.Metadata).reduce((acc, suffix) => {
                acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix];
                return acc;
            }, {})),
    });
    b.bp("/WriteGetObjectResponse");
    let body;
    let contents;
    if (input.Body !== undefined) {
        contents = input.Body;
        body = contents;
    }
    let { hostname: resolvedHostname } = await context.endpoint();
    if (context.disableHostPrefix !== true) {
        resolvedHostname = "{RequestRoute}." + resolvedHostname;
        if (input.RequestRoute === undefined) {
            throw new Error("Empty value provided for input host prefix: RequestRoute.");
        }
        resolvedHostname = resolvedHostname.replace("{RequestRoute}", input.RequestRoute);
        if (!__isValidHostname(resolvedHostname)) {
            throw new Error("ValidationError: prefixed hostname must be hostname compatible.");
        }
    }
    b.hn(resolvedHostname);
    b.m("POST").h(headers).b(body);
    return b.build();
};
const de_AbortMultipartUploadCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_CompleteMultipartUploadCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_Exp]: [, output.headers[_xae]],
        [_SSE]: [, output.headers[_xasse]],
        [_VI]: [, output.headers[_xavi]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])],
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_B] != null) {
        contents[_B] = __expectString(data[_B]);
    }
    if (data[_CCRC] != null) {
        contents[_CCRC] = __expectString(data[_CCRC]);
    }
    if (data[_CCRCC] != null) {
        contents[_CCRCC] = __expectString(data[_CCRCC]);
    }
    if (data[_CCRCNVME] != null) {
        contents[_CCRCNVME] = __expectString(data[_CCRCNVME]);
    }
    if (data[_CSHA] != null) {
        contents[_CSHA] = __expectString(data[_CSHA]);
    }
    if (data[_CSHAh] != null) {
        contents[_CSHAh] = __expectString(data[_CSHAh]);
    }
    if (data[_CT] != null) {
        contents[_CT] = __expectString(data[_CT]);
    }
    if (data[_ETa] != null) {
        contents[_ETa] = __expectString(data[_ETa]);
    }
    if (data[_K] != null) {
        contents[_K] = __expectString(data[_K]);
    }
    if (data[_L] != null) {
        contents[_L] = __expectString(data[_L]);
    }
    return contents;
};
const de_CopyObjectCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_Exp]: [, output.headers[_xae]],
        [_CSVI]: [, output.headers[_xacsvi]],
        [_VI]: [, output.headers[_xavi]],
        [_SSE]: [, output.headers[_xasse]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_SSEKMSEC]: [, output.headers[_xassec]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])],
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.CopyObjectResult = de_CopyObjectResult(data, context);
    return contents;
};
const de_CreateBucketCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_L]: [, output.headers[_lo]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_CreateBucketMetadataTableConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_CreateMultipartUploadCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_AD]: [
            () => void 0 !== output.headers[_xaad],
            () => __expectNonNull(__parseRfc7231DateTime(output.headers[_xaad])),
        ],
        [_ARI]: [, output.headers[_xaari]],
        [_SSE]: [, output.headers[_xasse]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_SSEKMSEC]: [, output.headers[_xassec]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])],
        [_RC]: [, output.headers[_xarc]],
        [_CA]: [, output.headers[_xaca]],
        [_CT]: [, output.headers[_xact]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_B] != null) {
        contents[_B] = __expectString(data[_B]);
    }
    if (data[_K] != null) {
        contents[_K] = __expectString(data[_K]);
    }
    if (data[_UI] != null) {
        contents[_UI] = __expectString(data[_UI]);
    }
    return contents;
};
const de_CreateSessionCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = object_mapping_map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_SSE]: [, output.headers[_xasse]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_SSEKMSEC]: [, output.headers[_xassec]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => parseBoolean(output.headers[_xassebke])],
    });
    const data = expectNonNull(expectObject(await parseXmlBody(output.body, context)), "body");
    if (data[_C] != null) {
        contents[_C] = de_SessionCredentials(data[_C], context);
    }
    return contents;
};
const de_DeleteBucketCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketAnalyticsConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketCorsCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketEncryptionCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketIntelligentTieringConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketInventoryConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketLifecycleCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketMetadataTableConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketMetricsConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketOwnershipControlsCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketPolicyCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketReplicationCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketTaggingCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteBucketWebsiteCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteObjectCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_DM]: [() => void 0 !== output.headers[_xadm], () => __parseBoolean(output.headers[_xadm])],
        [_VI]: [, output.headers[_xavi]],
        [_RC]: [, output.headers[_xarc]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeleteObjectsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.Deleted === "") {
        contents[_De] = [];
    }
    else if (data[_De] != null) {
        contents[_De] = de_DeletedObjects(__getArrayIfSingleItem(data[_De]), context);
    }
    if (data.Error === "") {
        contents[_Err] = [];
    }
    else if (data[_Er] != null) {
        contents[_Err] = de_Errors(__getArrayIfSingleItem(data[_Er]), context);
    }
    return contents;
};
const de_DeleteObjectTaggingCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_VI]: [, output.headers[_xavi]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_DeletePublicAccessBlockCommand = async (output, context) => {
    if (output.statusCode !== 204 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_GetBucketAccelerateConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_S] != null) {
        contents[_S] = __expectString(data[_S]);
    }
    return contents;
};
const de_GetBucketAclCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.AccessControlList === "") {
        contents[_Gr] = [];
    }
    else if (data[_ACLc] != null && data[_ACLc][_G] != null) {
        contents[_Gr] = de_Grants(__getArrayIfSingleItem(data[_ACLc][_G]), context);
    }
    if (data[_O] != null) {
        contents[_O] = de_Owner(data[_O], context);
    }
    return contents;
};
const de_GetBucketAnalyticsConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.AnalyticsConfiguration = de_AnalyticsConfiguration(data, context);
    return contents;
};
const de_GetBucketCorsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.CORSRule === "") {
        contents[_CORSRu] = [];
    }
    else if (data[_CORSR] != null) {
        contents[_CORSRu] = de_CORSRules(__getArrayIfSingleItem(data[_CORSR]), context);
    }
    return contents;
};
const de_GetBucketEncryptionCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.ServerSideEncryptionConfiguration = de_ServerSideEncryptionConfiguration(data, context);
    return contents;
};
const de_GetBucketIntelligentTieringConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.IntelligentTieringConfiguration = de_IntelligentTieringConfiguration(data, context);
    return contents;
};
const de_GetBucketInventoryConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.InventoryConfiguration = de_InventoryConfiguration(data, context);
    return contents;
};
const de_GetBucketLifecycleConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_TDMOS]: [, output.headers[_xatdmos]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.Rule === "") {
        contents[_Rul] = [];
    }
    else if (data[_Ru] != null) {
        contents[_Rul] = de_LifecycleRules(__getArrayIfSingleItem(data[_Ru]), context);
    }
    return contents;
};
const de_GetBucketLocationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_LC] != null) {
        contents[_LC] = __expectString(data[_LC]);
    }
    return contents;
};
const de_GetBucketLoggingCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_LE] != null) {
        contents[_LE] = de_LoggingEnabled(data[_LE], context);
    }
    return contents;
};
const de_GetBucketMetadataTableConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.GetBucketMetadataTableConfigurationResult = de_GetBucketMetadataTableConfigurationResult(data, context);
    return contents;
};
const de_GetBucketMetricsConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.MetricsConfiguration = de_MetricsConfiguration(data, context);
    return contents;
};
const de_GetBucketNotificationConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_EBC] != null) {
        contents[_EBC] = de_EventBridgeConfiguration(data[_EBC], context);
    }
    if (data.CloudFunctionConfiguration === "") {
        contents[_LFC] = [];
    }
    else if (data[_CFC] != null) {
        contents[_LFC] = de_LambdaFunctionConfigurationList(__getArrayIfSingleItem(data[_CFC]), context);
    }
    if (data.QueueConfiguration === "") {
        contents[_QCu] = [];
    }
    else if (data[_QC] != null) {
        contents[_QCu] = de_QueueConfigurationList(__getArrayIfSingleItem(data[_QC]), context);
    }
    if (data.TopicConfiguration === "") {
        contents[_TCop] = [];
    }
    else if (data[_TCo] != null) {
        contents[_TCop] = de_TopicConfigurationList(__getArrayIfSingleItem(data[_TCo]), context);
    }
    return contents;
};
const de_GetBucketOwnershipControlsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.OwnershipControls = de_OwnershipControls(data, context);
    return contents;
};
const de_GetBucketPolicyCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = await Aws_restXml_collectBodyString(output.body, context);
    contents.Policy = __expectString(data);
    return contents;
};
const de_GetBucketPolicyStatusCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.PolicyStatus = de_PolicyStatus(data, context);
    return contents;
};
const de_GetBucketReplicationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.ReplicationConfiguration = de_ReplicationConfiguration(data, context);
    return contents;
};
const de_GetBucketRequestPaymentCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_Pa] != null) {
        contents[_Pa] = __expectString(data[_Pa]);
    }
    return contents;
};
const de_GetBucketTaggingCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.TagSet === "") {
        contents[_TS] = [];
    }
    else if (data[_TS] != null && data[_TS][_Ta] != null) {
        contents[_TS] = de_TagSet(__getArrayIfSingleItem(data[_TS][_Ta]), context);
    }
    return contents;
};
const de_GetBucketVersioningCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_MDf] != null) {
        contents[_MFAD] = __expectString(data[_MDf]);
    }
    if (data[_S] != null) {
        contents[_S] = __expectString(data[_S]);
    }
    return contents;
};
const de_GetBucketWebsiteCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_ED] != null) {
        contents[_ED] = de_ErrorDocument(data[_ED], context);
    }
    if (data[_ID] != null) {
        contents[_ID] = de_IndexDocument(data[_ID], context);
    }
    if (data[_RART] != null) {
        contents[_RART] = de_RedirectAllRequestsTo(data[_RART], context);
    }
    if (data.RoutingRules === "") {
        contents[_RRo] = [];
    }
    else if (data[_RRo] != null && data[_RRo][_RRou] != null) {
        contents[_RRo] = de_RoutingRules(__getArrayIfSingleItem(data[_RRo][_RRou]), context);
    }
    return contents;
};
const de_GetObjectCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_DM]: [() => void 0 !== output.headers[_xadm], () => __parseBoolean(output.headers[_xadm])],
        [_AR]: [, output.headers[_ar]],
        [_Exp]: [, output.headers[_xae]],
        [_Re]: [, output.headers[_xar]],
        [_LM]: [() => void 0 !== output.headers[_lm], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_lm]))],
        [_CLo]: [() => void 0 !== output.headers[_cl_], () => __strictParseLong(output.headers[_cl_])],
        [_ETa]: [, output.headers[_eta]],
        [_CCRC]: [, output.headers[_xacc]],
        [_CCRCC]: [, output.headers[_xacc_]],
        [_CCRCNVME]: [, output.headers[_xacc__]],
        [_CSHA]: [, output.headers[_xacs]],
        [_CSHAh]: [, output.headers[_xacs_]],
        [_CT]: [, output.headers[_xact]],
        [_MM]: [() => void 0 !== output.headers[_xamm], () => __strictParseInt32(output.headers[_xamm])],
        [_VI]: [, output.headers[_xavi]],
        [_CC]: [, output.headers[_cc]],
        [_CD]: [, output.headers[_cd]],
        [_CE]: [, output.headers[_ce]],
        [_CL]: [, output.headers[_cl]],
        [_CR]: [, output.headers[_cr]],
        [_CTo]: [, output.headers[_ct]],
        [_E]: [() => void 0 !== output.headers[Aws_restXml_e], () => __expectNonNull(__parseRfc7231DateTime(output.headers[Aws_restXml_e]))],
        [_ES]: [, output.headers[_ex]],
        [_WRL]: [, output.headers[_xawrl]],
        [_SSE]: [, output.headers[_xasse]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])],
        [_SC]: [, output.headers[_xasc]],
        [_RC]: [, output.headers[_xarc]],
        [_RS]: [, output.headers[_xars]],
        [_PC]: [() => void 0 !== output.headers[_xampc], () => __strictParseInt32(output.headers[_xampc])],
        [_TC]: [() => void 0 !== output.headers[_xatc], () => __strictParseInt32(output.headers[_xatc])],
        [_OLM]: [, output.headers[_xaolm]],
        [_OLRUD]: [
            () => void 0 !== output.headers[_xaolrud],
            () => __expectNonNull(__parseRfc3339DateTimeWithOffset(output.headers[_xaolrud])),
        ],
        [_OLLHS]: [, output.headers[_xaollh]],
        Metadata: [
            ,
            Object.keys(output.headers)
                .filter((header) => header.startsWith("x-amz-meta-"))
                .reduce((acc, header) => {
                acc[header.substring(11)] = output.headers[header];
                return acc;
            }, {}),
        ],
    });
    const data = output.body;
    context.sdkStreamMixin(data);
    contents.Body = data;
    return contents;
};
const de_GetObjectAclCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.AccessControlList === "") {
        contents[_Gr] = [];
    }
    else if (data[_ACLc] != null && data[_ACLc][_G] != null) {
        contents[_Gr] = de_Grants(__getArrayIfSingleItem(data[_ACLc][_G]), context);
    }
    if (data[_O] != null) {
        contents[_O] = de_Owner(data[_O], context);
    }
    return contents;
};
const de_GetObjectAttributesCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_DM]: [() => void 0 !== output.headers[_xadm], () => __parseBoolean(output.headers[_xadm])],
        [_LM]: [() => void 0 !== output.headers[_lm], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_lm]))],
        [_VI]: [, output.headers[_xavi]],
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_Ch] != null) {
        contents[_Ch] = de_Checksum(data[_Ch], context);
    }
    if (data[_ETa] != null) {
        contents[_ETa] = __expectString(data[_ETa]);
    }
    if (data[_OP] != null) {
        contents[_OP] = de_GetObjectAttributesParts(data[_OP], context);
    }
    if (data[_OSb] != null) {
        contents[_OSb] = __strictParseLong(data[_OSb]);
    }
    if (data[_SC] != null) {
        contents[_SC] = __expectString(data[_SC]);
    }
    return contents;
};
const de_GetObjectLegalHoldCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.LegalHold = de_ObjectLockLegalHold(data, context);
    return contents;
};
const de_GetObjectLockConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.ObjectLockConfiguration = de_ObjectLockConfiguration(data, context);
    return contents;
};
const de_GetObjectRetentionCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.Retention = de_ObjectLockRetention(data, context);
    return contents;
};
const de_GetObjectTaggingCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_VI]: [, output.headers[_xavi]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.TagSet === "") {
        contents[_TS] = [];
    }
    else if (data[_TS] != null && data[_TS][_Ta] != null) {
        contents[_TS] = de_TagSet(__getArrayIfSingleItem(data[_TS][_Ta]), context);
    }
    return contents;
};
const de_GetObjectTorrentCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    const data = output.body;
    context.sdkStreamMixin(data);
    contents.Body = data;
    return contents;
};
const de_GetPublicAccessBlockCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.PublicAccessBlockConfiguration = de_PublicAccessBlockConfiguration(data, context);
    return contents;
};
const de_HeadBucketCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_BLT]: [, output.headers[_xablt]],
        [_BLN]: [, output.headers[_xabln]],
        [_BR]: [, output.headers[_xabr]],
        [_APA]: [() => void 0 !== output.headers[_xaapa], () => __parseBoolean(output.headers[_xaapa])],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_HeadObjectCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_DM]: [() => void 0 !== output.headers[_xadm], () => __parseBoolean(output.headers[_xadm])],
        [_AR]: [, output.headers[_ar]],
        [_Exp]: [, output.headers[_xae]],
        [_Re]: [, output.headers[_xar]],
        [_AS]: [, output.headers[_xaas]],
        [_LM]: [() => void 0 !== output.headers[_lm], () => __expectNonNull(__parseRfc7231DateTime(output.headers[_lm]))],
        [_CLo]: [() => void 0 !== output.headers[_cl_], () => __strictParseLong(output.headers[_cl_])],
        [_CCRC]: [, output.headers[_xacc]],
        [_CCRCC]: [, output.headers[_xacc_]],
        [_CCRCNVME]: [, output.headers[_xacc__]],
        [_CSHA]: [, output.headers[_xacs]],
        [_CSHAh]: [, output.headers[_xacs_]],
        [_CT]: [, output.headers[_xact]],
        [_ETa]: [, output.headers[_eta]],
        [_MM]: [() => void 0 !== output.headers[_xamm], () => __strictParseInt32(output.headers[_xamm])],
        [_VI]: [, output.headers[_xavi]],
        [_CC]: [, output.headers[_cc]],
        [_CD]: [, output.headers[_cd]],
        [_CE]: [, output.headers[_ce]],
        [_CL]: [, output.headers[_cl]],
        [_CTo]: [, output.headers[_ct]],
        [_CR]: [, output.headers[_cr]],
        [_E]: [() => void 0 !== output.headers[Aws_restXml_e], () => __expectNonNull(__parseRfc7231DateTime(output.headers[Aws_restXml_e]))],
        [_ES]: [, output.headers[_ex]],
        [_WRL]: [, output.headers[_xawrl]],
        [_SSE]: [, output.headers[_xasse]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])],
        [_SC]: [, output.headers[_xasc]],
        [_RC]: [, output.headers[_xarc]],
        [_RS]: [, output.headers[_xars]],
        [_PC]: [() => void 0 !== output.headers[_xampc], () => __strictParseInt32(output.headers[_xampc])],
        [_OLM]: [, output.headers[_xaolm]],
        [_OLRUD]: [
            () => void 0 !== output.headers[_xaolrud],
            () => __expectNonNull(__parseRfc3339DateTimeWithOffset(output.headers[_xaolrud])),
        ],
        [_OLLHS]: [, output.headers[_xaollh]],
        Metadata: [
            ,
            Object.keys(output.headers)
                .filter((header) => header.startsWith("x-amz-meta-"))
                .reduce((acc, header) => {
                acc[header.substring(11)] = output.headers[header];
                return acc;
            }, {}),
        ],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_ListBucketAnalyticsConfigurationsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.AnalyticsConfiguration === "") {
        contents[_ACLn] = [];
    }
    else if (data[_AC] != null) {
        contents[_ACLn] = de_AnalyticsConfigurationList(__getArrayIfSingleItem(data[_AC]), context);
    }
    if (data[_CTon] != null) {
        contents[_CTon] = __expectString(data[_CTon]);
    }
    if (data[_IT] != null) {
        contents[_IT] = __parseBoolean(data[_IT]);
    }
    if (data[_NCT] != null) {
        contents[_NCT] = __expectString(data[_NCT]);
    }
    return contents;
};
const de_ListBucketIntelligentTieringConfigurationsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_CTon] != null) {
        contents[_CTon] = __expectString(data[_CTon]);
    }
    if (data.IntelligentTieringConfiguration === "") {
        contents[_ITCL] = [];
    }
    else if (data[_ITC] != null) {
        contents[_ITCL] = de_IntelligentTieringConfigurationList(__getArrayIfSingleItem(data[_ITC]), context);
    }
    if (data[_IT] != null) {
        contents[_IT] = __parseBoolean(data[_IT]);
    }
    if (data[_NCT] != null) {
        contents[_NCT] = __expectString(data[_NCT]);
    }
    return contents;
};
const de_ListBucketInventoryConfigurationsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_CTon] != null) {
        contents[_CTon] = __expectString(data[_CTon]);
    }
    if (data.InventoryConfiguration === "") {
        contents[_ICL] = [];
    }
    else if (data[_IC] != null) {
        contents[_ICL] = de_InventoryConfigurationList(__getArrayIfSingleItem(data[_IC]), context);
    }
    if (data[_IT] != null) {
        contents[_IT] = __parseBoolean(data[_IT]);
    }
    if (data[_NCT] != null) {
        contents[_NCT] = __expectString(data[_NCT]);
    }
    return contents;
};
const de_ListBucketMetricsConfigurationsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_CTon] != null) {
        contents[_CTon] = __expectString(data[_CTon]);
    }
    if (data[_IT] != null) {
        contents[_IT] = __parseBoolean(data[_IT]);
    }
    if (data.MetricsConfiguration === "") {
        contents[_MCL] = [];
    }
    else if (data[_MC] != null) {
        contents[_MCL] = de_MetricsConfigurationList(__getArrayIfSingleItem(data[_MC]), context);
    }
    if (data[_NCT] != null) {
        contents[_NCT] = __expectString(data[_NCT]);
    }
    return contents;
};
const de_ListBucketsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.Buckets === "") {
        contents[_Bu] = [];
    }
    else if (data[_Bu] != null && data[_Bu][_B] != null) {
        contents[_Bu] = de_Buckets(__getArrayIfSingleItem(data[_Bu][_B]), context);
    }
    if (data[_CTon] != null) {
        contents[_CTon] = __expectString(data[_CTon]);
    }
    if (data[_O] != null) {
        contents[_O] = de_Owner(data[_O], context);
    }
    if (data[_P] != null) {
        contents[_P] = __expectString(data[_P]);
    }
    return contents;
};
const de_ListDirectoryBucketsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.Buckets === "") {
        contents[_Bu] = [];
    }
    else if (data[_Bu] != null && data[_Bu][_B] != null) {
        contents[_Bu] = de_Buckets(__getArrayIfSingleItem(data[_Bu][_B]), context);
    }
    if (data[_CTon] != null) {
        contents[_CTon] = __expectString(data[_CTon]);
    }
    return contents;
};
const de_ListMultipartUploadsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_B] != null) {
        contents[_B] = __expectString(data[_B]);
    }
    if (data.CommonPrefixes === "") {
        contents[_CP] = [];
    }
    else if (data[_CP] != null) {
        contents[_CP] = de_CommonPrefixList(__getArrayIfSingleItem(data[_CP]), context);
    }
    if (data[_D] != null) {
        contents[_D] = __expectString(data[_D]);
    }
    if (data[_ET] != null) {
        contents[_ET] = __expectString(data[_ET]);
    }
    if (data[_IT] != null) {
        contents[_IT] = __parseBoolean(data[_IT]);
    }
    if (data[_KM] != null) {
        contents[_KM] = __expectString(data[_KM]);
    }
    if (data[_MU] != null) {
        contents[_MU] = __strictParseInt32(data[_MU]);
    }
    if (data[_NKM] != null) {
        contents[_NKM] = __expectString(data[_NKM]);
    }
    if (data[_NUIM] != null) {
        contents[_NUIM] = __expectString(data[_NUIM]);
    }
    if (data[_P] != null) {
        contents[_P] = __expectString(data[_P]);
    }
    if (data[_UIM] != null) {
        contents[_UIM] = __expectString(data[_UIM]);
    }
    if (data.Upload === "") {
        contents[_Up] = [];
    }
    else if (data[_U] != null) {
        contents[_Up] = de_MultipartUploadList(__getArrayIfSingleItem(data[_U]), context);
    }
    return contents;
};
const de_ListObjectsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.CommonPrefixes === "") {
        contents[_CP] = [];
    }
    else if (data[_CP] != null) {
        contents[_CP] = de_CommonPrefixList(__getArrayIfSingleItem(data[_CP]), context);
    }
    if (data.Contents === "") {
        contents[_Co] = [];
    }
    else if (data[_Co] != null) {
        contents[_Co] = de_ObjectList(__getArrayIfSingleItem(data[_Co]), context);
    }
    if (data[_D] != null) {
        contents[_D] = __expectString(data[_D]);
    }
    if (data[_ET] != null) {
        contents[_ET] = __expectString(data[_ET]);
    }
    if (data[_IT] != null) {
        contents[_IT] = __parseBoolean(data[_IT]);
    }
    if (data[_M] != null) {
        contents[_M] = __expectString(data[_M]);
    }
    if (data[_MK] != null) {
        contents[_MK] = __strictParseInt32(data[_MK]);
    }
    if (data[_N] != null) {
        contents[_N] = __expectString(data[_N]);
    }
    if (data[_NM] != null) {
        contents[_NM] = __expectString(data[_NM]);
    }
    if (data[_P] != null) {
        contents[_P] = __expectString(data[_P]);
    }
    return contents;
};
const de_ListObjectsV2Command = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.CommonPrefixes === "") {
        contents[_CP] = [];
    }
    else if (data[_CP] != null) {
        contents[_CP] = de_CommonPrefixList(__getArrayIfSingleItem(data[_CP]), context);
    }
    if (data.Contents === "") {
        contents[_Co] = [];
    }
    else if (data[_Co] != null) {
        contents[_Co] = de_ObjectList(__getArrayIfSingleItem(data[_Co]), context);
    }
    if (data[_CTon] != null) {
        contents[_CTon] = __expectString(data[_CTon]);
    }
    if (data[_D] != null) {
        contents[_D] = __expectString(data[_D]);
    }
    if (data[_ET] != null) {
        contents[_ET] = __expectString(data[_ET]);
    }
    if (data[_IT] != null) {
        contents[_IT] = __parseBoolean(data[_IT]);
    }
    if (data[_KC] != null) {
        contents[_KC] = __strictParseInt32(data[_KC]);
    }
    if (data[_MK] != null) {
        contents[_MK] = __strictParseInt32(data[_MK]);
    }
    if (data[_N] != null) {
        contents[_N] = __expectString(data[_N]);
    }
    if (data[_NCT] != null) {
        contents[_NCT] = __expectString(data[_NCT]);
    }
    if (data[_P] != null) {
        contents[_P] = __expectString(data[_P]);
    }
    if (data[_SA] != null) {
        contents[_SA] = __expectString(data[_SA]);
    }
    return contents;
};
const de_ListObjectVersionsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data.CommonPrefixes === "") {
        contents[_CP] = [];
    }
    else if (data[_CP] != null) {
        contents[_CP] = de_CommonPrefixList(__getArrayIfSingleItem(data[_CP]), context);
    }
    if (data.DeleteMarker === "") {
        contents[_DMe] = [];
    }
    else if (data[_DM] != null) {
        contents[_DMe] = de_DeleteMarkers(__getArrayIfSingleItem(data[_DM]), context);
    }
    if (data[_D] != null) {
        contents[_D] = __expectString(data[_D]);
    }
    if (data[_ET] != null) {
        contents[_ET] = __expectString(data[_ET]);
    }
    if (data[_IT] != null) {
        contents[_IT] = __parseBoolean(data[_IT]);
    }
    if (data[_KM] != null) {
        contents[_KM] = __expectString(data[_KM]);
    }
    if (data[_MK] != null) {
        contents[_MK] = __strictParseInt32(data[_MK]);
    }
    if (data[_N] != null) {
        contents[_N] = __expectString(data[_N]);
    }
    if (data[_NKM] != null) {
        contents[_NKM] = __expectString(data[_NKM]);
    }
    if (data[_NVIM] != null) {
        contents[_NVIM] = __expectString(data[_NVIM]);
    }
    if (data[_P] != null) {
        contents[_P] = __expectString(data[_P]);
    }
    if (data[_VIM] != null) {
        contents[_VIM] = __expectString(data[_VIM]);
    }
    if (data.Version === "") {
        contents[_Ve] = [];
    }
    else if (data[_V] != null) {
        contents[_Ve] = de_ObjectVersionList(__getArrayIfSingleItem(data[_V]), context);
    }
    return contents;
};
const de_ListPartsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_AD]: [
            () => void 0 !== output.headers[_xaad],
            () => __expectNonNull(__parseRfc7231DateTime(output.headers[_xaad])),
        ],
        [_ARI]: [, output.headers[_xaari]],
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
    if (data[_B] != null) {
        contents[_B] = __expectString(data[_B]);
    }
    if (data[_CA] != null) {
        contents[_CA] = __expectString(data[_CA]);
    }
    if (data[_CT] != null) {
        contents[_CT] = __expectString(data[_CT]);
    }
    if (data[_In] != null) {
        contents[_In] = de_Initiator(data[_In], context);
    }
    if (data[_IT] != null) {
        contents[_IT] = __parseBoolean(data[_IT]);
    }
    if (data[_K] != null) {
        contents[_K] = __expectString(data[_K]);
    }
    if (data[_MP] != null) {
        contents[_MP] = __strictParseInt32(data[_MP]);
    }
    if (data[_NPNM] != null) {
        contents[_NPNM] = __expectString(data[_NPNM]);
    }
    if (data[_O] != null) {
        contents[_O] = de_Owner(data[_O], context);
    }
    if (data[_PNM] != null) {
        contents[_PNM] = __expectString(data[_PNM]);
    }
    if (data.Part === "") {
        contents[_Part] = [];
    }
    else if (data[_Par] != null) {
        contents[_Part] = de_Parts(__getArrayIfSingleItem(data[_Par]), context);
    }
    if (data[_SC] != null) {
        contents[_SC] = __expectString(data[_SC]);
    }
    if (data[_UI] != null) {
        contents[_UI] = __expectString(data[_UI]);
    }
    return contents;
};
const de_PutBucketAccelerateConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketAclCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketAnalyticsConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketCorsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketEncryptionCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketIntelligentTieringConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketInventoryConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketLifecycleConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_TDMOS]: [, output.headers[_xatdmos]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketLoggingCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketMetricsConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketNotificationConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketOwnershipControlsCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketPolicyCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketReplicationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketRequestPaymentCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketTaggingCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketVersioningCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutBucketWebsiteCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutObjectCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_Exp]: [, output.headers[_xae]],
        [_ETa]: [, output.headers[_eta]],
        [_CCRC]: [, output.headers[_xacc]],
        [_CCRCC]: [, output.headers[_xacc_]],
        [_CCRCNVME]: [, output.headers[_xacc__]],
        [_CSHA]: [, output.headers[_xacs]],
        [_CSHAh]: [, output.headers[_xacs_]],
        [_CT]: [, output.headers[_xact]],
        [_SSE]: [, output.headers[_xasse]],
        [_VI]: [, output.headers[_xavi]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_SSEKMSEC]: [, output.headers[_xassec]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])],
        [_Si]: [() => void 0 !== output.headers[_xaos], () => __strictParseLong(output.headers[_xaos])],
        [_RC]: [, output.headers[_xarc]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutObjectAclCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutObjectLegalHoldCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutObjectLockConfigurationCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutObjectRetentionCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutObjectTaggingCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_VI]: [, output.headers[_xavi]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_PutPublicAccessBlockCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_RestoreObjectCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_RC]: [, output.headers[_xarc]],
        [_ROP]: [, output.headers[_xarop]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_SelectObjectContentCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    const data = output.body;
    contents.Payload = de_SelectObjectContentEventStream(data, context);
    return contents;
};
const de_UploadPartCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_SSE]: [, output.headers[_xasse]],
        [_ETa]: [, output.headers[_eta]],
        [_CCRC]: [, output.headers[_xacc]],
        [_CCRCC]: [, output.headers[_xacc_]],
        [_CCRCNVME]: [, output.headers[_xacc__]],
        [_CSHA]: [, output.headers[_xacs]],
        [_CSHAh]: [, output.headers[_xacs_]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])],
        [_RC]: [, output.headers[_xarc]],
    });
    await collectBody(output.body, context);
    return contents;
};
const de_UploadPartCopyCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
        [_CSVI]: [, output.headers[_xacsvi]],
        [_SSE]: [, output.headers[_xasse]],
        [_SSECA]: [, output.headers[_xasseca]],
        [_SSECKMD]: [, output.headers[_xasseckm]],
        [_SSEKMSKI]: [, output.headers[_xasseakki]],
        [_BKE]: [() => void 0 !== output.headers[_xassebke], () => __parseBoolean(output.headers[_xassebke])],
        [_RC]: [, output.headers[_xarc]],
    });
    const data = __expectObject(await parseBody(output.body, context));
    contents.CopyPartResult = de_CopyPartResult(data, context);
    return contents;
};
const de_WriteGetObjectResponseCommand = async (output, context) => {
    if (output.statusCode !== 200 && output.statusCode >= 300) {
        return de_CommandError(output, context);
    }
    const contents = map({
        $metadata: Aws_restXml_deserializeMetadata(output),
    });
    await collectBody(output.body, context);
    return contents;
};
const de_CommandError = async (output, context) => {
    const parsedOutput = {
        ...output,
        body: await parseXmlErrorBody(output.body, context),
    };
    const errorCode = loadRestXmlErrorCode(output, parsedOutput.body);
    switch (errorCode) {
        case "NoSuchUpload":
        case "com.amazonaws.s3#NoSuchUpload":
            throw await de_NoSuchUploadRes(parsedOutput, context);
        case "ObjectNotInActiveTierError":
        case "com.amazonaws.s3#ObjectNotInActiveTierError":
            throw await de_ObjectNotInActiveTierErrorRes(parsedOutput, context);
        case "BucketAlreadyExists":
        case "com.amazonaws.s3#BucketAlreadyExists":
            throw await de_BucketAlreadyExistsRes(parsedOutput, context);
        case "BucketAlreadyOwnedByYou":
        case "com.amazonaws.s3#BucketAlreadyOwnedByYou":
            throw await de_BucketAlreadyOwnedByYouRes(parsedOutput, context);
        case "NoSuchBucket":
        case "com.amazonaws.s3#NoSuchBucket":
            throw await de_NoSuchBucketRes(parsedOutput, context);
        case "InvalidObjectState":
        case "com.amazonaws.s3#InvalidObjectState":
            throw await de_InvalidObjectStateRes(parsedOutput, context);
        case "NoSuchKey":
        case "com.amazonaws.s3#NoSuchKey":
            throw await de_NoSuchKeyRes(parsedOutput, context);
        case "NotFound":
        case "com.amazonaws.s3#NotFound":
            throw await de_NotFoundRes(parsedOutput, context);
        case "EncryptionTypeMismatch":
        case "com.amazonaws.s3#EncryptionTypeMismatch":
            throw await de_EncryptionTypeMismatchRes(parsedOutput, context);
        case "InvalidRequest":
        case "com.amazonaws.s3#InvalidRequest":
            throw await de_InvalidRequestRes(parsedOutput, context);
        case "InvalidWriteOffset":
        case "com.amazonaws.s3#InvalidWriteOffset":
            throw await de_InvalidWriteOffsetRes(parsedOutput, context);
        case "TooManyParts":
        case "com.amazonaws.s3#TooManyParts":
            throw await de_TooManyPartsRes(parsedOutput, context);
        case "ObjectAlreadyInActiveTierError":
        case "com.amazonaws.s3#ObjectAlreadyInActiveTierError":
            throw await de_ObjectAlreadyInActiveTierErrorRes(parsedOutput, context);
        default:
            const parsedBody = parsedOutput.body;
            return Aws_restXml_throwDefaultError({
                output,
                parsedBody,
                errorCode,
            });
    }
};
const Aws_restXml_throwDefaultError = withBaseException(S3ServiceException);
const de_BucketAlreadyExistsRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new BucketAlreadyExists({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_BucketAlreadyOwnedByYouRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new BucketAlreadyOwnedByYou({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_EncryptionTypeMismatchRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new EncryptionTypeMismatch({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_InvalidObjectStateRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    if (data[_AT] != null) {
        contents[_AT] = expectString(data[_AT]);
    }
    if (data[_SC] != null) {
        contents[_SC] = expectString(data[_SC]);
    }
    const exception = new InvalidObjectState({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_InvalidRequestRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new InvalidRequest({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_InvalidWriteOffsetRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new InvalidWriteOffset({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_NoSuchBucketRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new NoSuchBucket({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_NoSuchKeyRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new NoSuchKey({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_NoSuchUploadRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new NoSuchUpload({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_NotFoundRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new NotFound({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_ObjectAlreadyInActiveTierErrorRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new ObjectAlreadyInActiveTierError({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_ObjectNotInActiveTierErrorRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new ObjectNotInActiveTierError({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_TooManyPartsRes = async (parsedOutput, context) => {
    const contents = object_mapping_map({});
    const data = parsedOutput.body;
    const exception = new TooManyParts({
        $metadata: Aws_restXml_deserializeMetadata(parsedOutput),
        ...contents,
    });
    return decorateServiceException(exception, parsedOutput.body);
};
const de_SelectObjectContentEventStream = (output, context) => {
    return context.eventStreamMarshaller.deserialize(output, async (event) => {
        if (event["Records"] != null) {
            return {
                Records: await de_RecordsEvent_event(event["Records"], context),
            };
        }
        if (event["Stats"] != null) {
            return {
                Stats: await de_StatsEvent_event(event["Stats"], context),
            };
        }
        if (event["Progress"] != null) {
            return {
                Progress: await de_ProgressEvent_event(event["Progress"], context),
            };
        }
        if (event["Cont"] != null) {
            return {
                Cont: await de_ContinuationEvent_event(event["Cont"], context),
            };
        }
        if (event["End"] != null) {
            return {
                End: await de_EndEvent_event(event["End"], context),
            };
        }
        return { $unknown: output };
    });
};
const de_ContinuationEvent_event = async (output, context) => {
    const contents = {};
    const data = await parseBody(output.body, context);
    Object.assign(contents, de_ContinuationEvent(data, context));
    return contents;
};
const de_EndEvent_event = async (output, context) => {
    const contents = {};
    const data = await parseBody(output.body, context);
    Object.assign(contents, de_EndEvent(data, context));
    return contents;
};
const de_ProgressEvent_event = async (output, context) => {
    const contents = {};
    const data = await parseBody(output.body, context);
    contents.Details = de_Progress(data, context);
    return contents;
};
const de_RecordsEvent_event = async (output, context) => {
    const contents = {};
    contents.Payload = output.body;
    return contents;
};
const de_StatsEvent_event = async (output, context) => {
    const contents = {};
    const data = await parseBody(output.body, context);
    contents.Details = de_Stats(data, context);
    return contents;
};
const se_AbortIncompleteMultipartUpload = (input, context) => {
    const bn = new __XmlNode(_AIMU);
    if (input[_DAI] != null) {
        bn.c(__XmlNode.of(_DAI, String(input[_DAI])).n(_DAI));
    }
    return bn;
};
const se_AccelerateConfiguration = (input, context) => {
    const bn = new __XmlNode(_ACc);
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_BAS, input[_S]).n(_S));
    }
    return bn;
};
const se_AccessControlPolicy = (input, context) => {
    const bn = new __XmlNode(_ACP);
    bn.lc(input, "Grants", "AccessControlList", () => se_Grants(input[_Gr], context));
    if (input[_O] != null) {
        bn.c(se_Owner(input[_O], context).n(_O));
    }
    return bn;
};
const se_AccessControlTranslation = (input, context) => {
    const bn = new __XmlNode(_ACT);
    if (input[_O] != null) {
        bn.c(__XmlNode.of(_OOw, input[_O]).n(_O));
    }
    return bn;
};
const se_AllowedHeaders = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = __XmlNode.of(_AH, entry);
        return n.n(_me);
    });
};
const se_AllowedMethods = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = __XmlNode.of(_AM, entry);
        return n.n(_me);
    });
};
const se_AllowedOrigins = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = __XmlNode.of(_AO, entry);
        return n.n(_me);
    });
};
const se_AnalyticsAndOperator = (input, context) => {
    const bn = new __XmlNode(_AAO);
    bn.cc(input, _P);
    bn.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context));
    return bn;
};
const se_AnalyticsConfiguration = (input, context) => {
    const bn = new __XmlNode(_AC);
    if (input[_I] != null) {
        bn.c(__XmlNode.of(_AI, input[_I]).n(_I));
    }
    if (input[_F] != null) {
        bn.c(se_AnalyticsFilter(input[_F], context).n(_F));
    }
    if (input[_SCA] != null) {
        bn.c(se_StorageClassAnalysis(input[_SCA], context).n(_SCA));
    }
    return bn;
};
const se_AnalyticsExportDestination = (input, context) => {
    const bn = new __XmlNode(_AED);
    if (input[_SBD] != null) {
        bn.c(se_AnalyticsS3BucketDestination(input[_SBD], context).n(_SBD));
    }
    return bn;
};
const se_AnalyticsFilter = (input, context) => {
    const bn = new __XmlNode(_AF);
    AnalyticsFilter.visit(input, {
        Prefix: (value) => {
            if (input[_P] != null) {
                bn.c(__XmlNode.of(_P, value).n(_P));
            }
        },
        Tag: (value) => {
            if (input[_Ta] != null) {
                bn.c(se_Tag(value, context).n(_Ta));
            }
        },
        And: (value) => {
            if (input[_A] != null) {
                bn.c(se_AnalyticsAndOperator(value, context).n(_A));
            }
        },
        _: (name, value) => {
            if (!(value instanceof __XmlNode || value instanceof __XmlText)) {
                throw new Error("Unable to serialize unknown union members in XML.");
            }
            bn.c(new __XmlNode(name).c(value));
        },
    });
    return bn;
};
const se_AnalyticsS3BucketDestination = (input, context) => {
    const bn = new __XmlNode(_ASBD);
    if (input[_Fo] != null) {
        bn.c(__XmlNode.of(_ASEFF, input[_Fo]).n(_Fo));
    }
    if (input[_BAI] != null) {
        bn.c(__XmlNode.of(_AIc, input[_BAI]).n(_BAI));
    }
    if (input[_B] != null) {
        bn.c(__XmlNode.of(_BN, input[_B]).n(_B));
    }
    bn.cc(input, _P);
    return bn;
};
const se_BucketInfo = (input, context) => {
    const bn = new __XmlNode(_BI);
    bn.cc(input, _DR);
    if (input[_Ty] != null) {
        bn.c(__XmlNode.of(_BT, input[_Ty]).n(_Ty));
    }
    return bn;
};
const se_BucketLifecycleConfiguration = (input, context) => {
    const bn = new __XmlNode(_BLC);
    bn.l(input, "Rules", "Rule", () => se_LifecycleRules(input[_Rul], context));
    return bn;
};
const se_BucketLoggingStatus = (input, context) => {
    const bn = new __XmlNode(_BLS);
    if (input[_LE] != null) {
        bn.c(se_LoggingEnabled(input[_LE], context).n(_LE));
    }
    return bn;
};
const se_CompletedMultipartUpload = (input, context) => {
    const bn = new __XmlNode(_CMU);
    bn.l(input, "Parts", "Part", () => se_CompletedPartList(input[_Part], context));
    return bn;
};
const se_CompletedPart = (input, context) => {
    const bn = new __XmlNode(_CPo);
    bn.cc(input, _ETa);
    bn.cc(input, _CCRC);
    bn.cc(input, _CCRCC);
    bn.cc(input, _CCRCNVME);
    bn.cc(input, _CSHA);
    bn.cc(input, _CSHAh);
    if (input[_PN] != null) {
        bn.c(__XmlNode.of(_PN, String(input[_PN])).n(_PN));
    }
    return bn;
};
const se_CompletedPartList = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_CompletedPart(entry, context);
        return n.n(_me);
    });
};
const se_Condition = (input, context) => {
    const bn = new __XmlNode(_Con);
    bn.cc(input, _HECRE);
    bn.cc(input, _KPE);
    return bn;
};
const se_CORSConfiguration = (input, context) => {
    const bn = new __XmlNode(_CORSC);
    bn.l(input, "CORSRules", "CORSRule", () => se_CORSRules(input[_CORSRu], context));
    return bn;
};
const se_CORSRule = (input, context) => {
    const bn = new __XmlNode(_CORSR);
    bn.cc(input, _ID_);
    bn.l(input, "AllowedHeaders", "AllowedHeader", () => se_AllowedHeaders(input[_AHl], context));
    bn.l(input, "AllowedMethods", "AllowedMethod", () => se_AllowedMethods(input[_AMl], context));
    bn.l(input, "AllowedOrigins", "AllowedOrigin", () => se_AllowedOrigins(input[_AOl], context));
    bn.l(input, "ExposeHeaders", "ExposeHeader", () => se_ExposeHeaders(input[_EH], context));
    if (input[_MAS] != null) {
        bn.c(__XmlNode.of(_MAS, String(input[_MAS])).n(_MAS));
    }
    return bn;
};
const se_CORSRules = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_CORSRule(entry, context);
        return n.n(_me);
    });
};
const se_CreateBucketConfiguration = (input, context) => {
    const bn = new __XmlNode(_CBC);
    if (input[_LC] != null) {
        bn.c(__XmlNode.of(_BLCu, input[_LC]).n(_LC));
    }
    if (input[_L] != null) {
        bn.c(se_LocationInfo(input[_L], context).n(_L));
    }
    if (input[_B] != null) {
        bn.c(se_BucketInfo(input[_B], context).n(_B));
    }
    return bn;
};
const se_CSVInput = (input, context) => {
    const bn = new __XmlNode(_CSVIn);
    bn.cc(input, _FHI);
    bn.cc(input, _Com);
    bn.cc(input, _QEC);
    bn.cc(input, _RD);
    bn.cc(input, _FD);
    bn.cc(input, _QCuo);
    if (input[_AQRD] != null) {
        bn.c(__XmlNode.of(_AQRD, String(input[_AQRD])).n(_AQRD));
    }
    return bn;
};
const se_CSVOutput = (input, context) => {
    const bn = new __XmlNode(_CSVO);
    bn.cc(input, _QF);
    bn.cc(input, _QEC);
    bn.cc(input, _RD);
    bn.cc(input, _FD);
    bn.cc(input, _QCuo);
    return bn;
};
const se_DefaultRetention = (input, context) => {
    const bn = new __XmlNode(_DRe);
    if (input[_Mo] != null) {
        bn.c(__XmlNode.of(_OLRM, input[_Mo]).n(_Mo));
    }
    if (input[_Da] != null) {
        bn.c(__XmlNode.of(_Da, String(input[_Da])).n(_Da));
    }
    if (input[_Y] != null) {
        bn.c(__XmlNode.of(_Y, String(input[_Y])).n(_Y));
    }
    return bn;
};
const se_Delete = (input, context) => {
    const bn = new __XmlNode(_Del);
    bn.l(input, "Objects", "Object", () => se_ObjectIdentifierList(input[_Ob], context));
    if (input[_Q] != null) {
        bn.c(__XmlNode.of(_Q, String(input[_Q])).n(_Q));
    }
    return bn;
};
const se_DeleteMarkerReplication = (input, context) => {
    const bn = new __XmlNode(_DMR);
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_DMRS, input[_S]).n(_S));
    }
    return bn;
};
const se_Destination = (input, context) => {
    const bn = new __XmlNode(_Des);
    if (input[_B] != null) {
        bn.c(__XmlNode.of(_BN, input[_B]).n(_B));
    }
    if (input[_Ac] != null) {
        bn.c(__XmlNode.of(_AIc, input[_Ac]).n(_Ac));
    }
    bn.cc(input, _SC);
    if (input[_ACT] != null) {
        bn.c(se_AccessControlTranslation(input[_ACT], context).n(_ACT));
    }
    if (input[_ECn] != null) {
        bn.c(se_EncryptionConfiguration(input[_ECn], context).n(_ECn));
    }
    if (input[_RTe] != null) {
        bn.c(se_ReplicationTime(input[_RTe], context).n(_RTe));
    }
    if (input[_Me] != null) {
        bn.c(se_Metrics(input[_Me], context).n(_Me));
    }
    return bn;
};
const se_Encryption = (input, context) => {
    const bn = new __XmlNode(_En);
    if (input[_ETn] != null) {
        bn.c(__XmlNode.of(_SSE, input[_ETn]).n(_ETn));
    }
    if (input[_KMSKI] != null) {
        bn.c(__XmlNode.of(_SSEKMSKI, input[_KMSKI]).n(_KMSKI));
    }
    bn.cc(input, _KMSC);
    return bn;
};
const se_EncryptionConfiguration = (input, context) => {
    const bn = new __XmlNode(_ECn);
    bn.cc(input, _RKKID);
    return bn;
};
const se_ErrorDocument = (input, context) => {
    const bn = new __XmlNode(_ED);
    if (input[_K] != null) {
        bn.c(__XmlNode.of(_OK, input[_K]).n(_K));
    }
    return bn;
};
const se_EventBridgeConfiguration = (input, context) => {
    const bn = new __XmlNode(_EBC);
    return bn;
};
const se_EventList = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = __XmlNode.of(_Ev, entry);
        return n.n(_me);
    });
};
const se_ExistingObjectReplication = (input, context) => {
    const bn = new __XmlNode(_EOR);
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_EORS, input[_S]).n(_S));
    }
    return bn;
};
const se_ExposeHeaders = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = __XmlNode.of(_EHx, entry);
        return n.n(_me);
    });
};
const se_FilterRule = (input, context) => {
    const bn = new __XmlNode(_FR);
    if (input[_N] != null) {
        bn.c(__XmlNode.of(_FRN, input[_N]).n(_N));
    }
    if (input[_Va] != null) {
        bn.c(__XmlNode.of(_FRV, input[_Va]).n(_Va));
    }
    return bn;
};
const se_FilterRuleList = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_FilterRule(entry, context);
        return n.n(_me);
    });
};
const se_GlacierJobParameters = (input, context) => {
    const bn = new __XmlNode(_GJP);
    bn.cc(input, _Ti);
    return bn;
};
const se_Grant = (input, context) => {
    const bn = new __XmlNode(_G);
    if (input[_Gra] != null) {
        const n = se_Grantee(input[_Gra], context).n(_Gra);
        n.a("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
        bn.c(n);
    }
    bn.cc(input, _Pe);
    return bn;
};
const se_Grantee = (input, context) => {
    const bn = new __XmlNode(_Gra);
    bn.cc(input, _DN);
    bn.cc(input, _EA);
    bn.cc(input, _ID_);
    bn.cc(input, _URI);
    bn.a("xsi:type", input[_Ty]);
    return bn;
};
const se_Grants = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_Grant(entry, context);
        return n.n(_G);
    });
};
const se_IndexDocument = (input, context) => {
    const bn = new __XmlNode(_ID);
    bn.cc(input, _Su);
    return bn;
};
const se_InputSerialization = (input, context) => {
    const bn = new __XmlNode(_IS);
    if (input[_CSV] != null) {
        bn.c(se_CSVInput(input[_CSV], context).n(_CSV));
    }
    bn.cc(input, _CTom);
    if (input[_JSON] != null) {
        bn.c(se_JSONInput(input[_JSON], context).n(_JSON));
    }
    if (input[_Parq] != null) {
        bn.c(se_ParquetInput(input[_Parq], context).n(_Parq));
    }
    return bn;
};
const se_IntelligentTieringAndOperator = (input, context) => {
    const bn = new __XmlNode(_ITAO);
    bn.cc(input, _P);
    bn.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context));
    return bn;
};
const se_IntelligentTieringConfiguration = (input, context) => {
    const bn = new __XmlNode(_ITC);
    if (input[_I] != null) {
        bn.c(__XmlNode.of(_ITI, input[_I]).n(_I));
    }
    if (input[_F] != null) {
        bn.c(se_IntelligentTieringFilter(input[_F], context).n(_F));
    }
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_ITS, input[_S]).n(_S));
    }
    bn.l(input, "Tierings", "Tiering", () => se_TieringList(input[_Tie], context));
    return bn;
};
const se_IntelligentTieringFilter = (input, context) => {
    const bn = new __XmlNode(_ITF);
    bn.cc(input, _P);
    if (input[_Ta] != null) {
        bn.c(se_Tag(input[_Ta], context).n(_Ta));
    }
    if (input[_A] != null) {
        bn.c(se_IntelligentTieringAndOperator(input[_A], context).n(_A));
    }
    return bn;
};
const se_InventoryConfiguration = (input, context) => {
    const bn = new __XmlNode(_IC);
    if (input[_Des] != null) {
        bn.c(se_InventoryDestination(input[_Des], context).n(_Des));
    }
    if (input[_IE] != null) {
        bn.c(__XmlNode.of(_IE, String(input[_IE])).n(_IE));
    }
    if (input[_F] != null) {
        bn.c(se_InventoryFilter(input[_F], context).n(_F));
    }
    if (input[_I] != null) {
        bn.c(__XmlNode.of(_II, input[_I]).n(_I));
    }
    if (input[_IOV] != null) {
        bn.c(__XmlNode.of(_IIOV, input[_IOV]).n(_IOV));
    }
    bn.lc(input, "OptionalFields", "OptionalFields", () => se_InventoryOptionalFields(input[_OF], context));
    if (input[_Sc] != null) {
        bn.c(se_InventorySchedule(input[_Sc], context).n(_Sc));
    }
    return bn;
};
const se_InventoryDestination = (input, context) => {
    const bn = new __XmlNode(_IDn);
    if (input[_SBD] != null) {
        bn.c(se_InventoryS3BucketDestination(input[_SBD], context).n(_SBD));
    }
    return bn;
};
const se_InventoryEncryption = (input, context) => {
    const bn = new __XmlNode(_IEn);
    if (input[_SSES] != null) {
        bn.c(se_SSES3(input[_SSES], context).n(_SS));
    }
    if (input[_SSEKMS] != null) {
        bn.c(se_SSEKMS(input[_SSEKMS], context).n(_SK));
    }
    return bn;
};
const se_InventoryFilter = (input, context) => {
    const bn = new __XmlNode(_IF);
    bn.cc(input, _P);
    return bn;
};
const se_InventoryOptionalFields = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = __XmlNode.of(_IOF, entry);
        return n.n(_Fi);
    });
};
const se_InventoryS3BucketDestination = (input, context) => {
    const bn = new __XmlNode(_ISBD);
    bn.cc(input, _AIc);
    if (input[_B] != null) {
        bn.c(__XmlNode.of(_BN, input[_B]).n(_B));
    }
    if (input[_Fo] != null) {
        bn.c(__XmlNode.of(_IFn, input[_Fo]).n(_Fo));
    }
    bn.cc(input, _P);
    if (input[_En] != null) {
        bn.c(se_InventoryEncryption(input[_En], context).n(_En));
    }
    return bn;
};
const se_InventorySchedule = (input, context) => {
    const bn = new __XmlNode(_ISn);
    if (input[_Fr] != null) {
        bn.c(__XmlNode.of(_IFnv, input[_Fr]).n(_Fr));
    }
    return bn;
};
const se_JSONInput = (input, context) => {
    const bn = new __XmlNode(_JSONI);
    if (input[_Ty] != null) {
        bn.c(__XmlNode.of(_JSONT, input[_Ty]).n(_Ty));
    }
    return bn;
};
const se_JSONOutput = (input, context) => {
    const bn = new __XmlNode(_JSONO);
    bn.cc(input, _RD);
    return bn;
};
const se_LambdaFunctionConfiguration = (input, context) => {
    const bn = new __XmlNode(_LFCa);
    if (input[_I] != null) {
        bn.c(__XmlNode.of(_NI, input[_I]).n(_I));
    }
    if (input[_LFA] != null) {
        bn.c(__XmlNode.of(_LFA, input[_LFA]).n(_CF));
    }
    bn.l(input, "Events", "Event", () => se_EventList(input[_Eve], context));
    if (input[_F] != null) {
        bn.c(se_NotificationConfigurationFilter(input[_F], context).n(_F));
    }
    return bn;
};
const se_LambdaFunctionConfigurationList = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_LambdaFunctionConfiguration(entry, context);
        return n.n(_me);
    });
};
const se_LifecycleExpiration = (input, context) => {
    const bn = new __XmlNode(_LEi);
    if (input[_Dat] != null) {
        bn.c(__XmlNode.of(_Dat, __serializeDateTime(input[_Dat]).toString()).n(_Dat));
    }
    if (input[_Da] != null) {
        bn.c(__XmlNode.of(_Da, String(input[_Da])).n(_Da));
    }
    if (input[_EODM] != null) {
        bn.c(__XmlNode.of(_EODM, String(input[_EODM])).n(_EODM));
    }
    return bn;
};
const se_LifecycleRule = (input, context) => {
    const bn = new __XmlNode(_LR);
    if (input[_Exp] != null) {
        bn.c(se_LifecycleExpiration(input[_Exp], context).n(_Exp));
    }
    bn.cc(input, _ID_);
    bn.cc(input, _P);
    if (input[_F] != null) {
        bn.c(se_LifecycleRuleFilter(input[_F], context).n(_F));
    }
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_ESx, input[_S]).n(_S));
    }
    bn.l(input, "Transitions", "Transition", () => se_TransitionList(input[_Tr], context));
    bn.l(input, "NoncurrentVersionTransitions", "NoncurrentVersionTransition", () => se_NoncurrentVersionTransitionList(input[_NVT], context));
    if (input[_NVE] != null) {
        bn.c(se_NoncurrentVersionExpiration(input[_NVE], context).n(_NVE));
    }
    if (input[_AIMU] != null) {
        bn.c(se_AbortIncompleteMultipartUpload(input[_AIMU], context).n(_AIMU));
    }
    return bn;
};
const se_LifecycleRuleAndOperator = (input, context) => {
    const bn = new __XmlNode(_LRAO);
    bn.cc(input, _P);
    bn.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context));
    if (input[_OSGT] != null) {
        bn.c(__XmlNode.of(_OSGTB, String(input[_OSGT])).n(_OSGT));
    }
    if (input[_OSLT] != null) {
        bn.c(__XmlNode.of(_OSLTB, String(input[_OSLT])).n(_OSLT));
    }
    return bn;
};
const se_LifecycleRuleFilter = (input, context) => {
    const bn = new __XmlNode(_LRF);
    bn.cc(input, _P);
    if (input[_Ta] != null) {
        bn.c(se_Tag(input[_Ta], context).n(_Ta));
    }
    if (input[_OSGT] != null) {
        bn.c(__XmlNode.of(_OSGTB, String(input[_OSGT])).n(_OSGT));
    }
    if (input[_OSLT] != null) {
        bn.c(__XmlNode.of(_OSLTB, String(input[_OSLT])).n(_OSLT));
    }
    if (input[_A] != null) {
        bn.c(se_LifecycleRuleAndOperator(input[_A], context).n(_A));
    }
    return bn;
};
const se_LifecycleRules = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_LifecycleRule(entry, context);
        return n.n(_me);
    });
};
const se_LocationInfo = (input, context) => {
    const bn = new __XmlNode(_LI);
    if (input[_Ty] != null) {
        bn.c(__XmlNode.of(_LT, input[_Ty]).n(_Ty));
    }
    if (input[_N] != null) {
        bn.c(__XmlNode.of(_LNAS, input[_N]).n(_N));
    }
    return bn;
};
const se_LoggingEnabled = (input, context) => {
    const bn = new __XmlNode(_LE);
    bn.cc(input, _TB);
    bn.lc(input, "TargetGrants", "TargetGrants", () => se_TargetGrants(input[_TG], context));
    bn.cc(input, _TP);
    if (input[_TOKF] != null) {
        bn.c(se_TargetObjectKeyFormat(input[_TOKF], context).n(_TOKF));
    }
    return bn;
};
const se_MetadataEntry = (input, context) => {
    const bn = new __XmlNode(_ME);
    if (input[_N] != null) {
        bn.c(__XmlNode.of(_MKe, input[_N]).n(_N));
    }
    if (input[_Va] != null) {
        bn.c(__XmlNode.of(_MV, input[_Va]).n(_Va));
    }
    return bn;
};
const se_MetadataTableConfiguration = (input, context) => {
    const bn = new __XmlNode(_MTC);
    if (input[_STD] != null) {
        bn.c(se_S3TablesDestination(input[_STD], context).n(_STD));
    }
    return bn;
};
const se_Metrics = (input, context) => {
    const bn = new __XmlNode(_Me);
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_MS, input[_S]).n(_S));
    }
    if (input[_ETv] != null) {
        bn.c(se_ReplicationTimeValue(input[_ETv], context).n(_ETv));
    }
    return bn;
};
const se_MetricsAndOperator = (input, context) => {
    const bn = new __XmlNode(_MAO);
    bn.cc(input, _P);
    bn.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context));
    bn.cc(input, _APAc);
    return bn;
};
const se_MetricsConfiguration = (input, context) => {
    const bn = new __XmlNode(_MC);
    if (input[_I] != null) {
        bn.c(__XmlNode.of(_MI, input[_I]).n(_I));
    }
    if (input[_F] != null) {
        bn.c(se_MetricsFilter(input[_F], context).n(_F));
    }
    return bn;
};
const se_MetricsFilter = (input, context) => {
    const bn = new __XmlNode(_MF);
    MetricsFilter.visit(input, {
        Prefix: (value) => {
            if (input[_P] != null) {
                bn.c(__XmlNode.of(_P, value).n(_P));
            }
        },
        Tag: (value) => {
            if (input[_Ta] != null) {
                bn.c(se_Tag(value, context).n(_Ta));
            }
        },
        AccessPointArn: (value) => {
            if (input[_APAc] != null) {
                bn.c(__XmlNode.of(_APAc, value).n(_APAc));
            }
        },
        And: (value) => {
            if (input[_A] != null) {
                bn.c(se_MetricsAndOperator(value, context).n(_A));
            }
        },
        _: (name, value) => {
            if (!(value instanceof __XmlNode || value instanceof __XmlText)) {
                throw new Error("Unable to serialize unknown union members in XML.");
            }
            bn.c(new __XmlNode(name).c(value));
        },
    });
    return bn;
};
const se_NoncurrentVersionExpiration = (input, context) => {
    const bn = new __XmlNode(_NVE);
    if (input[_ND] != null) {
        bn.c(__XmlNode.of(_Da, String(input[_ND])).n(_ND));
    }
    if (input[_NNV] != null) {
        bn.c(__XmlNode.of(_VC, String(input[_NNV])).n(_NNV));
    }
    return bn;
};
const se_NoncurrentVersionTransition = (input, context) => {
    const bn = new __XmlNode(_NVTo);
    if (input[_ND] != null) {
        bn.c(__XmlNode.of(_Da, String(input[_ND])).n(_ND));
    }
    if (input[_SC] != null) {
        bn.c(__XmlNode.of(_TSC, input[_SC]).n(_SC));
    }
    if (input[_NNV] != null) {
        bn.c(__XmlNode.of(_VC, String(input[_NNV])).n(_NNV));
    }
    return bn;
};
const se_NoncurrentVersionTransitionList = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_NoncurrentVersionTransition(entry, context);
        return n.n(_me);
    });
};
const se_NotificationConfiguration = (input, context) => {
    const bn = new __XmlNode(_NC);
    bn.l(input, "TopicConfigurations", "TopicConfiguration", () => se_TopicConfigurationList(input[_TCop], context));
    bn.l(input, "QueueConfigurations", "QueueConfiguration", () => se_QueueConfigurationList(input[_QCu], context));
    bn.l(input, "LambdaFunctionConfigurations", "CloudFunctionConfiguration", () => se_LambdaFunctionConfigurationList(input[_LFC], context));
    if (input[_EBC] != null) {
        bn.c(se_EventBridgeConfiguration(input[_EBC], context).n(_EBC));
    }
    return bn;
};
const se_NotificationConfigurationFilter = (input, context) => {
    const bn = new __XmlNode(_NCF);
    if (input[_K] != null) {
        bn.c(se_S3KeyFilter(input[_K], context).n(_SKe));
    }
    return bn;
};
const se_ObjectIdentifier = (input, context) => {
    const bn = new __XmlNode(_OI);
    if (input[_K] != null) {
        bn.c(__XmlNode.of(_OK, input[_K]).n(_K));
    }
    if (input[_VI] != null) {
        bn.c(__XmlNode.of(_OVI, input[_VI]).n(_VI));
    }
    bn.cc(input, _ETa);
    if (input[_LMT] != null) {
        bn.c(__XmlNode.of(_LMT, __dateToUtcString(input[_LMT]).toString()).n(_LMT));
    }
    if (input[_Si] != null) {
        bn.c(__XmlNode.of(_Si, String(input[_Si])).n(_Si));
    }
    return bn;
};
const se_ObjectIdentifierList = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_ObjectIdentifier(entry, context);
        return n.n(_me);
    });
};
const se_ObjectLockConfiguration = (input, context) => {
    const bn = new __XmlNode(_OLC);
    bn.cc(input, _OLE);
    if (input[_Ru] != null) {
        bn.c(se_ObjectLockRule(input[_Ru], context).n(_Ru));
    }
    return bn;
};
const se_ObjectLockLegalHold = (input, context) => {
    const bn = new __XmlNode(_OLLH);
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_OLLHS, input[_S]).n(_S));
    }
    return bn;
};
const se_ObjectLockRetention = (input, context) => {
    const bn = new __XmlNode(_OLR);
    if (input[_Mo] != null) {
        bn.c(__XmlNode.of(_OLRM, input[_Mo]).n(_Mo));
    }
    if (input[_RUD] != null) {
        bn.c(__XmlNode.of(_Dat, __serializeDateTime(input[_RUD]).toString()).n(_RUD));
    }
    return bn;
};
const se_ObjectLockRule = (input, context) => {
    const bn = new __XmlNode(_OLRb);
    if (input[_DRe] != null) {
        bn.c(se_DefaultRetention(input[_DRe], context).n(_DRe));
    }
    return bn;
};
const se_OutputLocation = (input, context) => {
    const bn = new __XmlNode(_OL);
    if (input[_S_] != null) {
        bn.c(se_S3Location(input[_S_], context).n(_S_));
    }
    return bn;
};
const se_OutputSerialization = (input, context) => {
    const bn = new __XmlNode(_OS);
    if (input[_CSV] != null) {
        bn.c(se_CSVOutput(input[_CSV], context).n(_CSV));
    }
    if (input[_JSON] != null) {
        bn.c(se_JSONOutput(input[_JSON], context).n(_JSON));
    }
    return bn;
};
const se_Owner = (input, context) => {
    const bn = new __XmlNode(_O);
    bn.cc(input, _DN);
    bn.cc(input, _ID_);
    return bn;
};
const se_OwnershipControls = (input, context) => {
    const bn = new __XmlNode(_OC);
    bn.l(input, "Rules", "Rule", () => se_OwnershipControlsRules(input[_Rul], context));
    return bn;
};
const se_OwnershipControlsRule = (input, context) => {
    const bn = new __XmlNode(_OCR);
    bn.cc(input, _OO);
    return bn;
};
const se_OwnershipControlsRules = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_OwnershipControlsRule(entry, context);
        return n.n(_me);
    });
};
const se_ParquetInput = (input, context) => {
    const bn = new __XmlNode(_PI);
    return bn;
};
const se_PartitionedPrefix = (input, context) => {
    const bn = new __XmlNode(_PP);
    bn.cc(input, _PDS);
    return bn;
};
const se_PublicAccessBlockConfiguration = (input, context) => {
    const bn = new __XmlNode(_PABC);
    if (input[_BPA] != null) {
        bn.c(__XmlNode.of(_Se, String(input[_BPA])).n(_BPA));
    }
    if (input[_IPA] != null) {
        bn.c(__XmlNode.of(_Se, String(input[_IPA])).n(_IPA));
    }
    if (input[_BPP] != null) {
        bn.c(__XmlNode.of(_Se, String(input[_BPP])).n(_BPP));
    }
    if (input[_RPB] != null) {
        bn.c(__XmlNode.of(_Se, String(input[_RPB])).n(_RPB));
    }
    return bn;
};
const se_QueueConfiguration = (input, context) => {
    const bn = new __XmlNode(_QC);
    if (input[_I] != null) {
        bn.c(__XmlNode.of(_NI, input[_I]).n(_I));
    }
    if (input[_QA] != null) {
        bn.c(__XmlNode.of(_QA, input[_QA]).n(_Qu));
    }
    bn.l(input, "Events", "Event", () => se_EventList(input[_Eve], context));
    if (input[_F] != null) {
        bn.c(se_NotificationConfigurationFilter(input[_F], context).n(_F));
    }
    return bn;
};
const se_QueueConfigurationList = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_QueueConfiguration(entry, context);
        return n.n(_me);
    });
};
const se_Redirect = (input, context) => {
    const bn = new __XmlNode(_Red);
    bn.cc(input, _HN);
    bn.cc(input, _HRC);
    bn.cc(input, _Pr);
    bn.cc(input, _RKPW);
    bn.cc(input, _RKW);
    return bn;
};
const se_RedirectAllRequestsTo = (input, context) => {
    const bn = new __XmlNode(_RART);
    bn.cc(input, _HN);
    bn.cc(input, _Pr);
    return bn;
};
const se_ReplicaModifications = (input, context) => {
    const bn = new __XmlNode(_RM);
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_RMS, input[_S]).n(_S));
    }
    return bn;
};
const se_ReplicationConfiguration = (input, context) => {
    const bn = new __XmlNode(_RCe);
    bn.cc(input, _Ro);
    bn.l(input, "Rules", "Rule", () => se_ReplicationRules(input[_Rul], context));
    return bn;
};
const se_ReplicationRule = (input, context) => {
    const bn = new __XmlNode(_RRe);
    bn.cc(input, _ID_);
    if (input[_Pri] != null) {
        bn.c(__XmlNode.of(_Pri, String(input[_Pri])).n(_Pri));
    }
    bn.cc(input, _P);
    if (input[_F] != null) {
        bn.c(se_ReplicationRuleFilter(input[_F], context).n(_F));
    }
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_RRS, input[_S]).n(_S));
    }
    if (input[_SSC] != null) {
        bn.c(se_SourceSelectionCriteria(input[_SSC], context).n(_SSC));
    }
    if (input[_EOR] != null) {
        bn.c(se_ExistingObjectReplication(input[_EOR], context).n(_EOR));
    }
    if (input[_Des] != null) {
        bn.c(se_Destination(input[_Des], context).n(_Des));
    }
    if (input[_DMR] != null) {
        bn.c(se_DeleteMarkerReplication(input[_DMR], context).n(_DMR));
    }
    return bn;
};
const se_ReplicationRuleAndOperator = (input, context) => {
    const bn = new __XmlNode(_RRAO);
    bn.cc(input, _P);
    bn.l(input, "Tags", "Tag", () => se_TagSet(input[_Tag], context));
    return bn;
};
const se_ReplicationRuleFilter = (input, context) => {
    const bn = new __XmlNode(_RRF);
    bn.cc(input, _P);
    if (input[_Ta] != null) {
        bn.c(se_Tag(input[_Ta], context).n(_Ta));
    }
    if (input[_A] != null) {
        bn.c(se_ReplicationRuleAndOperator(input[_A], context).n(_A));
    }
    return bn;
};
const se_ReplicationRules = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_ReplicationRule(entry, context);
        return n.n(_me);
    });
};
const se_ReplicationTime = (input, context) => {
    const bn = new __XmlNode(_RTe);
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_RTS, input[_S]).n(_S));
    }
    if (input[_Tim] != null) {
        bn.c(se_ReplicationTimeValue(input[_Tim], context).n(_Tim));
    }
    return bn;
};
const se_ReplicationTimeValue = (input, context) => {
    const bn = new __XmlNode(_RTV);
    if (input[_Mi] != null) {
        bn.c(__XmlNode.of(_Mi, String(input[_Mi])).n(_Mi));
    }
    return bn;
};
const se_RequestPaymentConfiguration = (input, context) => {
    const bn = new __XmlNode(_RPC);
    bn.cc(input, _Pa);
    return bn;
};
const se_RequestProgress = (input, context) => {
    const bn = new __XmlNode(_RPe);
    if (input[_Ena] != null) {
        bn.c(__XmlNode.of(_ERP, String(input[_Ena])).n(_Ena));
    }
    return bn;
};
const se_RestoreRequest = (input, context) => {
    const bn = new __XmlNode(_RRes);
    if (input[_Da] != null) {
        bn.c(__XmlNode.of(_Da, String(input[_Da])).n(_Da));
    }
    if (input[_GJP] != null) {
        bn.c(se_GlacierJobParameters(input[_GJP], context).n(_GJP));
    }
    if (input[_Ty] != null) {
        bn.c(__XmlNode.of(_RRT, input[_Ty]).n(_Ty));
    }
    bn.cc(input, _Ti);
    bn.cc(input, _Desc);
    if (input[_SP] != null) {
        bn.c(se_SelectParameters(input[_SP], context).n(_SP));
    }
    if (input[_OL] != null) {
        bn.c(se_OutputLocation(input[_OL], context).n(_OL));
    }
    return bn;
};
const se_RoutingRule = (input, context) => {
    const bn = new __XmlNode(_RRou);
    if (input[_Con] != null) {
        bn.c(se_Condition(input[_Con], context).n(_Con));
    }
    if (input[_Red] != null) {
        bn.c(se_Redirect(input[_Red], context).n(_Red));
    }
    return bn;
};
const se_RoutingRules = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_RoutingRule(entry, context);
        return n.n(_RRou);
    });
};
const se_S3KeyFilter = (input, context) => {
    const bn = new __XmlNode(_SKF);
    bn.l(input, "FilterRules", "FilterRule", () => se_FilterRuleList(input[_FRi], context));
    return bn;
};
const se_S3Location = (input, context) => {
    const bn = new __XmlNode(_SL);
    bn.cc(input, _BN);
    if (input[_P] != null) {
        bn.c(__XmlNode.of(_LP, input[_P]).n(_P));
    }
    if (input[_En] != null) {
        bn.c(se_Encryption(input[_En], context).n(_En));
    }
    if (input[_CACL] != null) {
        bn.c(__XmlNode.of(_OCACL, input[_CACL]).n(_CACL));
    }
    bn.lc(input, "AccessControlList", "AccessControlList", () => se_Grants(input[_ACLc], context));
    if (input[_T] != null) {
        bn.c(se_Tagging(input[_T], context).n(_T));
    }
    bn.lc(input, "UserMetadata", "UserMetadata", () => se_UserMetadata(input[_UM], context));
    bn.cc(input, _SC);
    return bn;
};
const se_S3TablesDestination = (input, context) => {
    const bn = new __XmlNode(_STD);
    if (input[_TBA] != null) {
        bn.c(__XmlNode.of(_STBA, input[_TBA]).n(_TBA));
    }
    if (input[_TN] != null) {
        bn.c(__XmlNode.of(_STN, input[_TN]).n(_TN));
    }
    return bn;
};
const se_ScanRange = (input, context) => {
    const bn = new __XmlNode(_SR);
    if (input[_St] != null) {
        bn.c(__XmlNode.of(_St, String(input[_St])).n(_St));
    }
    if (input[_End] != null) {
        bn.c(__XmlNode.of(_End, String(input[_End])).n(_End));
    }
    return bn;
};
const se_SelectParameters = (input, context) => {
    const bn = new __XmlNode(_SP);
    if (input[_IS] != null) {
        bn.c(se_InputSerialization(input[_IS], context).n(_IS));
    }
    bn.cc(input, _ETx);
    bn.cc(input, _Ex);
    if (input[_OS] != null) {
        bn.c(se_OutputSerialization(input[_OS], context).n(_OS));
    }
    return bn;
};
const se_ServerSideEncryptionByDefault = (input, context) => {
    const bn = new __XmlNode(_SSEBD);
    if (input[_SSEA] != null) {
        bn.c(__XmlNode.of(_SSE, input[_SSEA]).n(_SSEA));
    }
    if (input[_KMSMKID] != null) {
        bn.c(__XmlNode.of(_SSEKMSKI, input[_KMSMKID]).n(_KMSMKID));
    }
    return bn;
};
const se_ServerSideEncryptionConfiguration = (input, context) => {
    const bn = new __XmlNode(_SSEC);
    bn.l(input, "Rules", "Rule", () => se_ServerSideEncryptionRules(input[_Rul], context));
    return bn;
};
const se_ServerSideEncryptionRule = (input, context) => {
    const bn = new __XmlNode(_SSER);
    if (input[_ASSEBD] != null) {
        bn.c(se_ServerSideEncryptionByDefault(input[_ASSEBD], context).n(_ASSEBD));
    }
    if (input[_BKE] != null) {
        bn.c(__XmlNode.of(_BKE, String(input[_BKE])).n(_BKE));
    }
    return bn;
};
const se_ServerSideEncryptionRules = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_ServerSideEncryptionRule(entry, context);
        return n.n(_me);
    });
};
const se_SimplePrefix = (input, context) => {
    const bn = new __XmlNode(_SPi);
    return bn;
};
const se_SourceSelectionCriteria = (input, context) => {
    const bn = new __XmlNode(_SSC);
    if (input[_SKEO] != null) {
        bn.c(se_SseKmsEncryptedObjects(input[_SKEO], context).n(_SKEO));
    }
    if (input[_RM] != null) {
        bn.c(se_ReplicaModifications(input[_RM], context).n(_RM));
    }
    return bn;
};
const se_SSEKMS = (input, context) => {
    const bn = new __XmlNode(_SK);
    if (input[_KI] != null) {
        bn.c(__XmlNode.of(_SSEKMSKI, input[_KI]).n(_KI));
    }
    return bn;
};
const se_SseKmsEncryptedObjects = (input, context) => {
    const bn = new __XmlNode(_SKEO);
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_SKEOS, input[_S]).n(_S));
    }
    return bn;
};
const se_SSES3 = (input, context) => {
    const bn = new __XmlNode(_SS);
    return bn;
};
const se_StorageClassAnalysis = (input, context) => {
    const bn = new __XmlNode(_SCA);
    if (input[_DE] != null) {
        bn.c(se_StorageClassAnalysisDataExport(input[_DE], context).n(_DE));
    }
    return bn;
};
const se_StorageClassAnalysisDataExport = (input, context) => {
    const bn = new __XmlNode(_SCADE);
    if (input[_OSV] != null) {
        bn.c(__XmlNode.of(_SCASV, input[_OSV]).n(_OSV));
    }
    if (input[_Des] != null) {
        bn.c(se_AnalyticsExportDestination(input[_Des], context).n(_Des));
    }
    return bn;
};
const se_Tag = (input, context) => {
    const bn = new __XmlNode(_Ta);
    if (input[_K] != null) {
        bn.c(__XmlNode.of(_OK, input[_K]).n(_K));
    }
    bn.cc(input, _Va);
    return bn;
};
const se_Tagging = (input, context) => {
    const bn = new __XmlNode(_T);
    bn.lc(input, "TagSet", "TagSet", () => se_TagSet(input[_TS], context));
    return bn;
};
const se_TagSet = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_Tag(entry, context);
        return n.n(_Ta);
    });
};
const se_TargetGrant = (input, context) => {
    const bn = new __XmlNode(_TGa);
    if (input[_Gra] != null) {
        const n = se_Grantee(input[_Gra], context).n(_Gra);
        n.a("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
        bn.c(n);
    }
    if (input[_Pe] != null) {
        bn.c(__XmlNode.of(_BLP, input[_Pe]).n(_Pe));
    }
    return bn;
};
const se_TargetGrants = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_TargetGrant(entry, context);
        return n.n(_G);
    });
};
const se_TargetObjectKeyFormat = (input, context) => {
    const bn = new __XmlNode(_TOKF);
    if (input[_SPi] != null) {
        bn.c(se_SimplePrefix(input[_SPi], context).n(_SPi));
    }
    if (input[_PP] != null) {
        bn.c(se_PartitionedPrefix(input[_PP], context).n(_PP));
    }
    return bn;
};
const se_Tiering = (input, context) => {
    const bn = new __XmlNode(_Tier);
    if (input[_Da] != null) {
        bn.c(__XmlNode.of(_ITD, String(input[_Da])).n(_Da));
    }
    if (input[_AT] != null) {
        bn.c(__XmlNode.of(_ITAT, input[_AT]).n(_AT));
    }
    return bn;
};
const se_TieringList = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_Tiering(entry, context);
        return n.n(_me);
    });
};
const se_TopicConfiguration = (input, context) => {
    const bn = new __XmlNode(_TCo);
    if (input[_I] != null) {
        bn.c(__XmlNode.of(_NI, input[_I]).n(_I));
    }
    if (input[_TA] != null) {
        bn.c(__XmlNode.of(_TA, input[_TA]).n(_Top));
    }
    bn.l(input, "Events", "Event", () => se_EventList(input[_Eve], context));
    if (input[_F] != null) {
        bn.c(se_NotificationConfigurationFilter(input[_F], context).n(_F));
    }
    return bn;
};
const se_TopicConfigurationList = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_TopicConfiguration(entry, context);
        return n.n(_me);
    });
};
const se_Transition = (input, context) => {
    const bn = new __XmlNode(_Tra);
    if (input[_Dat] != null) {
        bn.c(__XmlNode.of(_Dat, __serializeDateTime(input[_Dat]).toString()).n(_Dat));
    }
    if (input[_Da] != null) {
        bn.c(__XmlNode.of(_Da, String(input[_Da])).n(_Da));
    }
    if (input[_SC] != null) {
        bn.c(__XmlNode.of(_TSC, input[_SC]).n(_SC));
    }
    return bn;
};
const se_TransitionList = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_Transition(entry, context);
        return n.n(_me);
    });
};
const se_UserMetadata = (input, context) => {
    return input
        .filter((e) => e != null)
        .map((entry) => {
        const n = se_MetadataEntry(entry, context);
        return n.n(_ME);
    });
};
const se_VersioningConfiguration = (input, context) => {
    const bn = new __XmlNode(_VCe);
    if (input[_MFAD] != null) {
        bn.c(__XmlNode.of(_MFAD, input[_MFAD]).n(_MDf));
    }
    if (input[_S] != null) {
        bn.c(__XmlNode.of(_BVS, input[_S]).n(_S));
    }
    return bn;
};
const se_WebsiteConfiguration = (input, context) => {
    const bn = new __XmlNode(_WC);
    if (input[_ED] != null) {
        bn.c(se_ErrorDocument(input[_ED], context).n(_ED));
    }
    if (input[_ID] != null) {
        bn.c(se_IndexDocument(input[_ID], context).n(_ID));
    }
    if (input[_RART] != null) {
        bn.c(se_RedirectAllRequestsTo(input[_RART], context).n(_RART));
    }
    bn.lc(input, "RoutingRules", "RoutingRules", () => se_RoutingRules(input[_RRo], context));
    return bn;
};
const de_AbortIncompleteMultipartUpload = (output, context) => {
    const contents = {};
    if (output[_DAI] != null) {
        contents[_DAI] = __strictParseInt32(output[_DAI]);
    }
    return contents;
};
const de_AccessControlTranslation = (output, context) => {
    const contents = {};
    if (output[_O] != null) {
        contents[_O] = __expectString(output[_O]);
    }
    return contents;
};
const de_AllowedHeaders = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return __expectString(entry);
    });
};
const de_AllowedMethods = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return __expectString(entry);
    });
};
const de_AllowedOrigins = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return __expectString(entry);
    });
};
const de_AnalyticsAndOperator = (output, context) => {
    const contents = {};
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output.Tag === "") {
        contents[_Tag] = [];
    }
    else if (output[_Ta] != null) {
        contents[_Tag] = de_TagSet(__getArrayIfSingleItem(output[_Ta]), context);
    }
    return contents;
};
const de_AnalyticsConfiguration = (output, context) => {
    const contents = {};
    if (output[_I] != null) {
        contents[_I] = __expectString(output[_I]);
    }
    if (output.Filter === "") {
    }
    else if (output[_F] != null) {
        contents[_F] = de_AnalyticsFilter(__expectUnion(output[_F]), context);
    }
    if (output[_SCA] != null) {
        contents[_SCA] = de_StorageClassAnalysis(output[_SCA], context);
    }
    return contents;
};
const de_AnalyticsConfigurationList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_AnalyticsConfiguration(entry, context);
    });
};
const de_AnalyticsExportDestination = (output, context) => {
    const contents = {};
    if (output[_SBD] != null) {
        contents[_SBD] = de_AnalyticsS3BucketDestination(output[_SBD], context);
    }
    return contents;
};
const de_AnalyticsFilter = (output, context) => {
    if (output[_P] != null) {
        return {
            Prefix: __expectString(output[_P]),
        };
    }
    if (output[_Ta] != null) {
        return {
            Tag: de_Tag(output[_Ta], context),
        };
    }
    if (output[_A] != null) {
        return {
            And: de_AnalyticsAndOperator(output[_A], context),
        };
    }
    return { $unknown: Object.entries(output)[0] };
};
const de_AnalyticsS3BucketDestination = (output, context) => {
    const contents = {};
    if (output[_Fo] != null) {
        contents[_Fo] = __expectString(output[_Fo]);
    }
    if (output[_BAI] != null) {
        contents[_BAI] = __expectString(output[_BAI]);
    }
    if (output[_B] != null) {
        contents[_B] = __expectString(output[_B]);
    }
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    return contents;
};
const de_Bucket = (output, context) => {
    const contents = {};
    if (output[_N] != null) {
        contents[_N] = __expectString(output[_N]);
    }
    if (output[_CDr] != null) {
        contents[_CDr] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_CDr]));
    }
    if (output[_BR] != null) {
        contents[_BR] = __expectString(output[_BR]);
    }
    return contents;
};
const de_Buckets = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_Bucket(entry, context);
    });
};
const de_Checksum = (output, context) => {
    const contents = {};
    if (output[_CCRC] != null) {
        contents[_CCRC] = __expectString(output[_CCRC]);
    }
    if (output[_CCRCC] != null) {
        contents[_CCRCC] = __expectString(output[_CCRCC]);
    }
    if (output[_CCRCNVME] != null) {
        contents[_CCRCNVME] = __expectString(output[_CCRCNVME]);
    }
    if (output[_CSHA] != null) {
        contents[_CSHA] = __expectString(output[_CSHA]);
    }
    if (output[_CSHAh] != null) {
        contents[_CSHAh] = __expectString(output[_CSHAh]);
    }
    if (output[_CT] != null) {
        contents[_CT] = __expectString(output[_CT]);
    }
    return contents;
};
const de_ChecksumAlgorithmList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return __expectString(entry);
    });
};
const de_CommonPrefix = (output, context) => {
    const contents = {};
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    return contents;
};
const de_CommonPrefixList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_CommonPrefix(entry, context);
    });
};
const de_Condition = (output, context) => {
    const contents = {};
    if (output[_HECRE] != null) {
        contents[_HECRE] = __expectString(output[_HECRE]);
    }
    if (output[_KPE] != null) {
        contents[_KPE] = __expectString(output[_KPE]);
    }
    return contents;
};
const de_ContinuationEvent = (output, context) => {
    const contents = {};
    return contents;
};
const de_CopyObjectResult = (output, context) => {
    const contents = {};
    if (output[_ETa] != null) {
        contents[_ETa] = __expectString(output[_ETa]);
    }
    if (output[_LM] != null) {
        contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM]));
    }
    if (output[_CT] != null) {
        contents[_CT] = __expectString(output[_CT]);
    }
    if (output[_CCRC] != null) {
        contents[_CCRC] = __expectString(output[_CCRC]);
    }
    if (output[_CCRCC] != null) {
        contents[_CCRCC] = __expectString(output[_CCRCC]);
    }
    if (output[_CCRCNVME] != null) {
        contents[_CCRCNVME] = __expectString(output[_CCRCNVME]);
    }
    if (output[_CSHA] != null) {
        contents[_CSHA] = __expectString(output[_CSHA]);
    }
    if (output[_CSHAh] != null) {
        contents[_CSHAh] = __expectString(output[_CSHAh]);
    }
    return contents;
};
const de_CopyPartResult = (output, context) => {
    const contents = {};
    if (output[_ETa] != null) {
        contents[_ETa] = __expectString(output[_ETa]);
    }
    if (output[_LM] != null) {
        contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM]));
    }
    if (output[_CCRC] != null) {
        contents[_CCRC] = __expectString(output[_CCRC]);
    }
    if (output[_CCRCC] != null) {
        contents[_CCRCC] = __expectString(output[_CCRCC]);
    }
    if (output[_CCRCNVME] != null) {
        contents[_CCRCNVME] = __expectString(output[_CCRCNVME]);
    }
    if (output[_CSHA] != null) {
        contents[_CSHA] = __expectString(output[_CSHA]);
    }
    if (output[_CSHAh] != null) {
        contents[_CSHAh] = __expectString(output[_CSHAh]);
    }
    return contents;
};
const de_CORSRule = (output, context) => {
    const contents = {};
    if (output[_ID_] != null) {
        contents[_ID_] = __expectString(output[_ID_]);
    }
    if (output.AllowedHeader === "") {
        contents[_AHl] = [];
    }
    else if (output[_AH] != null) {
        contents[_AHl] = de_AllowedHeaders(__getArrayIfSingleItem(output[_AH]), context);
    }
    if (output.AllowedMethod === "") {
        contents[_AMl] = [];
    }
    else if (output[_AM] != null) {
        contents[_AMl] = de_AllowedMethods(__getArrayIfSingleItem(output[_AM]), context);
    }
    if (output.AllowedOrigin === "") {
        contents[_AOl] = [];
    }
    else if (output[_AO] != null) {
        contents[_AOl] = de_AllowedOrigins(__getArrayIfSingleItem(output[_AO]), context);
    }
    if (output.ExposeHeader === "") {
        contents[_EH] = [];
    }
    else if (output[_EHx] != null) {
        contents[_EH] = de_ExposeHeaders(__getArrayIfSingleItem(output[_EHx]), context);
    }
    if (output[_MAS] != null) {
        contents[_MAS] = __strictParseInt32(output[_MAS]);
    }
    return contents;
};
const de_CORSRules = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_CORSRule(entry, context);
    });
};
const de_DefaultRetention = (output, context) => {
    const contents = {};
    if (output[_Mo] != null) {
        contents[_Mo] = __expectString(output[_Mo]);
    }
    if (output[_Da] != null) {
        contents[_Da] = __strictParseInt32(output[_Da]);
    }
    if (output[_Y] != null) {
        contents[_Y] = __strictParseInt32(output[_Y]);
    }
    return contents;
};
const de_DeletedObject = (output, context) => {
    const contents = {};
    if (output[_K] != null) {
        contents[_K] = __expectString(output[_K]);
    }
    if (output[_VI] != null) {
        contents[_VI] = __expectString(output[_VI]);
    }
    if (output[_DM] != null) {
        contents[_DM] = __parseBoolean(output[_DM]);
    }
    if (output[_DMVI] != null) {
        contents[_DMVI] = __expectString(output[_DMVI]);
    }
    return contents;
};
const de_DeletedObjects = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_DeletedObject(entry, context);
    });
};
const de_DeleteMarkerEntry = (output, context) => {
    const contents = {};
    if (output[_O] != null) {
        contents[_O] = de_Owner(output[_O], context);
    }
    if (output[_K] != null) {
        contents[_K] = __expectString(output[_K]);
    }
    if (output[_VI] != null) {
        contents[_VI] = __expectString(output[_VI]);
    }
    if (output[_IL] != null) {
        contents[_IL] = __parseBoolean(output[_IL]);
    }
    if (output[_LM] != null) {
        contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM]));
    }
    return contents;
};
const de_DeleteMarkerReplication = (output, context) => {
    const contents = {};
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    return contents;
};
const de_DeleteMarkers = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_DeleteMarkerEntry(entry, context);
    });
};
const de_Destination = (output, context) => {
    const contents = {};
    if (output[_B] != null) {
        contents[_B] = __expectString(output[_B]);
    }
    if (output[_Ac] != null) {
        contents[_Ac] = __expectString(output[_Ac]);
    }
    if (output[_SC] != null) {
        contents[_SC] = __expectString(output[_SC]);
    }
    if (output[_ACT] != null) {
        contents[_ACT] = de_AccessControlTranslation(output[_ACT], context);
    }
    if (output[_ECn] != null) {
        contents[_ECn] = de_EncryptionConfiguration(output[_ECn], context);
    }
    if (output[_RTe] != null) {
        contents[_RTe] = de_ReplicationTime(output[_RTe], context);
    }
    if (output[_Me] != null) {
        contents[_Me] = de_Metrics(output[_Me], context);
    }
    return contents;
};
const de_EncryptionConfiguration = (output, context) => {
    const contents = {};
    if (output[_RKKID] != null) {
        contents[_RKKID] = __expectString(output[_RKKID]);
    }
    return contents;
};
const de_EndEvent = (output, context) => {
    const contents = {};
    return contents;
};
const de__Error = (output, context) => {
    const contents = {};
    if (output[_K] != null) {
        contents[_K] = __expectString(output[_K]);
    }
    if (output[_VI] != null) {
        contents[_VI] = __expectString(output[_VI]);
    }
    if (output[_Cod] != null) {
        contents[_Cod] = __expectString(output[_Cod]);
    }
    if (output[_Mes] != null) {
        contents[_Mes] = __expectString(output[_Mes]);
    }
    return contents;
};
const de_ErrorDetails = (output, context) => {
    const contents = {};
    if (output[_EC] != null) {
        contents[_EC] = __expectString(output[_EC]);
    }
    if (output[_EM] != null) {
        contents[_EM] = __expectString(output[_EM]);
    }
    return contents;
};
const de_ErrorDocument = (output, context) => {
    const contents = {};
    if (output[_K] != null) {
        contents[_K] = __expectString(output[_K]);
    }
    return contents;
};
const de_Errors = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de__Error(entry, context);
    });
};
const de_EventBridgeConfiguration = (output, context) => {
    const contents = {};
    return contents;
};
const de_EventList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return __expectString(entry);
    });
};
const de_ExistingObjectReplication = (output, context) => {
    const contents = {};
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    return contents;
};
const de_ExposeHeaders = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return __expectString(entry);
    });
};
const de_FilterRule = (output, context) => {
    const contents = {};
    if (output[_N] != null) {
        contents[_N] = __expectString(output[_N]);
    }
    if (output[_Va] != null) {
        contents[_Va] = __expectString(output[_Va]);
    }
    return contents;
};
const de_FilterRuleList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_FilterRule(entry, context);
    });
};
const de_GetBucketMetadataTableConfigurationResult = (output, context) => {
    const contents = {};
    if (output[_MTCR] != null) {
        contents[_MTCR] = de_MetadataTableConfigurationResult(output[_MTCR], context);
    }
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    if (output[_Er] != null) {
        contents[_Er] = de_ErrorDetails(output[_Er], context);
    }
    return contents;
};
const de_GetObjectAttributesParts = (output, context) => {
    const contents = {};
    if (output[_PC] != null) {
        contents[_TPC] = __strictParseInt32(output[_PC]);
    }
    if (output[_PNM] != null) {
        contents[_PNM] = __expectString(output[_PNM]);
    }
    if (output[_NPNM] != null) {
        contents[_NPNM] = __expectString(output[_NPNM]);
    }
    if (output[_MP] != null) {
        contents[_MP] = __strictParseInt32(output[_MP]);
    }
    if (output[_IT] != null) {
        contents[_IT] = __parseBoolean(output[_IT]);
    }
    if (output.Part === "") {
        contents[_Part] = [];
    }
    else if (output[_Par] != null) {
        contents[_Part] = de_PartsList(__getArrayIfSingleItem(output[_Par]), context);
    }
    return contents;
};
const de_Grant = (output, context) => {
    const contents = {};
    if (output[_Gra] != null) {
        contents[_Gra] = de_Grantee(output[_Gra], context);
    }
    if (output[_Pe] != null) {
        contents[_Pe] = __expectString(output[_Pe]);
    }
    return contents;
};
const de_Grantee = (output, context) => {
    const contents = {};
    if (output[_DN] != null) {
        contents[_DN] = __expectString(output[_DN]);
    }
    if (output[_EA] != null) {
        contents[_EA] = __expectString(output[_EA]);
    }
    if (output[_ID_] != null) {
        contents[_ID_] = __expectString(output[_ID_]);
    }
    if (output[_URI] != null) {
        contents[_URI] = __expectString(output[_URI]);
    }
    if (output[_x] != null) {
        contents[_Ty] = __expectString(output[_x]);
    }
    return contents;
};
const de_Grants = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_Grant(entry, context);
    });
};
const de_IndexDocument = (output, context) => {
    const contents = {};
    if (output[_Su] != null) {
        contents[_Su] = __expectString(output[_Su]);
    }
    return contents;
};
const de_Initiator = (output, context) => {
    const contents = {};
    if (output[_ID_] != null) {
        contents[_ID_] = __expectString(output[_ID_]);
    }
    if (output[_DN] != null) {
        contents[_DN] = __expectString(output[_DN]);
    }
    return contents;
};
const de_IntelligentTieringAndOperator = (output, context) => {
    const contents = {};
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output.Tag === "") {
        contents[_Tag] = [];
    }
    else if (output[_Ta] != null) {
        contents[_Tag] = de_TagSet(__getArrayIfSingleItem(output[_Ta]), context);
    }
    return contents;
};
const de_IntelligentTieringConfiguration = (output, context) => {
    const contents = {};
    if (output[_I] != null) {
        contents[_I] = __expectString(output[_I]);
    }
    if (output[_F] != null) {
        contents[_F] = de_IntelligentTieringFilter(output[_F], context);
    }
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    if (output.Tiering === "") {
        contents[_Tie] = [];
    }
    else if (output[_Tier] != null) {
        contents[_Tie] = de_TieringList(__getArrayIfSingleItem(output[_Tier]), context);
    }
    return contents;
};
const de_IntelligentTieringConfigurationList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_IntelligentTieringConfiguration(entry, context);
    });
};
const de_IntelligentTieringFilter = (output, context) => {
    const contents = {};
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output[_Ta] != null) {
        contents[_Ta] = de_Tag(output[_Ta], context);
    }
    if (output[_A] != null) {
        contents[_A] = de_IntelligentTieringAndOperator(output[_A], context);
    }
    return contents;
};
const de_InventoryConfiguration = (output, context) => {
    const contents = {};
    if (output[_Des] != null) {
        contents[_Des] = de_InventoryDestination(output[_Des], context);
    }
    if (output[_IE] != null) {
        contents[_IE] = __parseBoolean(output[_IE]);
    }
    if (output[_F] != null) {
        contents[_F] = de_InventoryFilter(output[_F], context);
    }
    if (output[_I] != null) {
        contents[_I] = __expectString(output[_I]);
    }
    if (output[_IOV] != null) {
        contents[_IOV] = __expectString(output[_IOV]);
    }
    if (output.OptionalFields === "") {
        contents[_OF] = [];
    }
    else if (output[_OF] != null && output[_OF][_Fi] != null) {
        contents[_OF] = de_InventoryOptionalFields(__getArrayIfSingleItem(output[_OF][_Fi]), context);
    }
    if (output[_Sc] != null) {
        contents[_Sc] = de_InventorySchedule(output[_Sc], context);
    }
    return contents;
};
const de_InventoryConfigurationList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_InventoryConfiguration(entry, context);
    });
};
const de_InventoryDestination = (output, context) => {
    const contents = {};
    if (output[_SBD] != null) {
        contents[_SBD] = de_InventoryS3BucketDestination(output[_SBD], context);
    }
    return contents;
};
const de_InventoryEncryption = (output, context) => {
    const contents = {};
    if (output[_SS] != null) {
        contents[_SSES] = de_SSES3(output[_SS], context);
    }
    if (output[_SK] != null) {
        contents[_SSEKMS] = de_SSEKMS(output[_SK], context);
    }
    return contents;
};
const de_InventoryFilter = (output, context) => {
    const contents = {};
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    return contents;
};
const de_InventoryOptionalFields = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return __expectString(entry);
    });
};
const de_InventoryS3BucketDestination = (output, context) => {
    const contents = {};
    if (output[_AIc] != null) {
        contents[_AIc] = __expectString(output[_AIc]);
    }
    if (output[_B] != null) {
        contents[_B] = __expectString(output[_B]);
    }
    if (output[_Fo] != null) {
        contents[_Fo] = __expectString(output[_Fo]);
    }
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output[_En] != null) {
        contents[_En] = de_InventoryEncryption(output[_En], context);
    }
    return contents;
};
const de_InventorySchedule = (output, context) => {
    const contents = {};
    if (output[_Fr] != null) {
        contents[_Fr] = __expectString(output[_Fr]);
    }
    return contents;
};
const de_LambdaFunctionConfiguration = (output, context) => {
    const contents = {};
    if (output[_I] != null) {
        contents[_I] = __expectString(output[_I]);
    }
    if (output[_CF] != null) {
        contents[_LFA] = __expectString(output[_CF]);
    }
    if (output.Event === "") {
        contents[_Eve] = [];
    }
    else if (output[_Ev] != null) {
        contents[_Eve] = de_EventList(__getArrayIfSingleItem(output[_Ev]), context);
    }
    if (output[_F] != null) {
        contents[_F] = de_NotificationConfigurationFilter(output[_F], context);
    }
    return contents;
};
const de_LambdaFunctionConfigurationList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_LambdaFunctionConfiguration(entry, context);
    });
};
const de_LifecycleExpiration = (output, context) => {
    const contents = {};
    if (output[_Dat] != null) {
        contents[_Dat] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_Dat]));
    }
    if (output[_Da] != null) {
        contents[_Da] = __strictParseInt32(output[_Da]);
    }
    if (output[_EODM] != null) {
        contents[_EODM] = __parseBoolean(output[_EODM]);
    }
    return contents;
};
const de_LifecycleRule = (output, context) => {
    const contents = {};
    if (output[_Exp] != null) {
        contents[_Exp] = de_LifecycleExpiration(output[_Exp], context);
    }
    if (output[_ID_] != null) {
        contents[_ID_] = __expectString(output[_ID_]);
    }
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output[_F] != null) {
        contents[_F] = de_LifecycleRuleFilter(output[_F], context);
    }
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    if (output.Transition === "") {
        contents[_Tr] = [];
    }
    else if (output[_Tra] != null) {
        contents[_Tr] = de_TransitionList(__getArrayIfSingleItem(output[_Tra]), context);
    }
    if (output.NoncurrentVersionTransition === "") {
        contents[_NVT] = [];
    }
    else if (output[_NVTo] != null) {
        contents[_NVT] = de_NoncurrentVersionTransitionList(__getArrayIfSingleItem(output[_NVTo]), context);
    }
    if (output[_NVE] != null) {
        contents[_NVE] = de_NoncurrentVersionExpiration(output[_NVE], context);
    }
    if (output[_AIMU] != null) {
        contents[_AIMU] = de_AbortIncompleteMultipartUpload(output[_AIMU], context);
    }
    return contents;
};
const de_LifecycleRuleAndOperator = (output, context) => {
    const contents = {};
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output.Tag === "") {
        contents[_Tag] = [];
    }
    else if (output[_Ta] != null) {
        contents[_Tag] = de_TagSet(__getArrayIfSingleItem(output[_Ta]), context);
    }
    if (output[_OSGT] != null) {
        contents[_OSGT] = __strictParseLong(output[_OSGT]);
    }
    if (output[_OSLT] != null) {
        contents[_OSLT] = __strictParseLong(output[_OSLT]);
    }
    return contents;
};
const de_LifecycleRuleFilter = (output, context) => {
    const contents = {};
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output[_Ta] != null) {
        contents[_Ta] = de_Tag(output[_Ta], context);
    }
    if (output[_OSGT] != null) {
        contents[_OSGT] = __strictParseLong(output[_OSGT]);
    }
    if (output[_OSLT] != null) {
        contents[_OSLT] = __strictParseLong(output[_OSLT]);
    }
    if (output[_A] != null) {
        contents[_A] = de_LifecycleRuleAndOperator(output[_A], context);
    }
    return contents;
};
const de_LifecycleRules = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_LifecycleRule(entry, context);
    });
};
const de_LoggingEnabled = (output, context) => {
    const contents = {};
    if (output[_TB] != null) {
        contents[_TB] = __expectString(output[_TB]);
    }
    if (output.TargetGrants === "") {
        contents[_TG] = [];
    }
    else if (output[_TG] != null && output[_TG][_G] != null) {
        contents[_TG] = de_TargetGrants(__getArrayIfSingleItem(output[_TG][_G]), context);
    }
    if (output[_TP] != null) {
        contents[_TP] = __expectString(output[_TP]);
    }
    if (output[_TOKF] != null) {
        contents[_TOKF] = de_TargetObjectKeyFormat(output[_TOKF], context);
    }
    return contents;
};
const de_MetadataTableConfigurationResult = (output, context) => {
    const contents = {};
    if (output[_STDR] != null) {
        contents[_STDR] = de_S3TablesDestinationResult(output[_STDR], context);
    }
    return contents;
};
const de_Metrics = (output, context) => {
    const contents = {};
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    if (output[_ETv] != null) {
        contents[_ETv] = de_ReplicationTimeValue(output[_ETv], context);
    }
    return contents;
};
const de_MetricsAndOperator = (output, context) => {
    const contents = {};
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output.Tag === "") {
        contents[_Tag] = [];
    }
    else if (output[_Ta] != null) {
        contents[_Tag] = de_TagSet(__getArrayIfSingleItem(output[_Ta]), context);
    }
    if (output[_APAc] != null) {
        contents[_APAc] = __expectString(output[_APAc]);
    }
    return contents;
};
const de_MetricsConfiguration = (output, context) => {
    const contents = {};
    if (output[_I] != null) {
        contents[_I] = __expectString(output[_I]);
    }
    if (output.Filter === "") {
    }
    else if (output[_F] != null) {
        contents[_F] = de_MetricsFilter(__expectUnion(output[_F]), context);
    }
    return contents;
};
const de_MetricsConfigurationList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_MetricsConfiguration(entry, context);
    });
};
const de_MetricsFilter = (output, context) => {
    if (output[_P] != null) {
        return {
            Prefix: __expectString(output[_P]),
        };
    }
    if (output[_Ta] != null) {
        return {
            Tag: de_Tag(output[_Ta], context),
        };
    }
    if (output[_APAc] != null) {
        return {
            AccessPointArn: __expectString(output[_APAc]),
        };
    }
    if (output[_A] != null) {
        return {
            And: de_MetricsAndOperator(output[_A], context),
        };
    }
    return { $unknown: Object.entries(output)[0] };
};
const de_MultipartUpload = (output, context) => {
    const contents = {};
    if (output[_UI] != null) {
        contents[_UI] = __expectString(output[_UI]);
    }
    if (output[_K] != null) {
        contents[_K] = __expectString(output[_K]);
    }
    if (output[_Ini] != null) {
        contents[_Ini] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_Ini]));
    }
    if (output[_SC] != null) {
        contents[_SC] = __expectString(output[_SC]);
    }
    if (output[_O] != null) {
        contents[_O] = de_Owner(output[_O], context);
    }
    if (output[_In] != null) {
        contents[_In] = de_Initiator(output[_In], context);
    }
    if (output[_CA] != null) {
        contents[_CA] = __expectString(output[_CA]);
    }
    if (output[_CT] != null) {
        contents[_CT] = __expectString(output[_CT]);
    }
    return contents;
};
const de_MultipartUploadList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_MultipartUpload(entry, context);
    });
};
const de_NoncurrentVersionExpiration = (output, context) => {
    const contents = {};
    if (output[_ND] != null) {
        contents[_ND] = __strictParseInt32(output[_ND]);
    }
    if (output[_NNV] != null) {
        contents[_NNV] = __strictParseInt32(output[_NNV]);
    }
    return contents;
};
const de_NoncurrentVersionTransition = (output, context) => {
    const contents = {};
    if (output[_ND] != null) {
        contents[_ND] = __strictParseInt32(output[_ND]);
    }
    if (output[_SC] != null) {
        contents[_SC] = __expectString(output[_SC]);
    }
    if (output[_NNV] != null) {
        contents[_NNV] = __strictParseInt32(output[_NNV]);
    }
    return contents;
};
const de_NoncurrentVersionTransitionList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_NoncurrentVersionTransition(entry, context);
    });
};
const de_NotificationConfigurationFilter = (output, context) => {
    const contents = {};
    if (output[_SKe] != null) {
        contents[_K] = de_S3KeyFilter(output[_SKe], context);
    }
    return contents;
};
const de__Object = (output, context) => {
    const contents = {};
    if (output[_K] != null) {
        contents[_K] = __expectString(output[_K]);
    }
    if (output[_LM] != null) {
        contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM]));
    }
    if (output[_ETa] != null) {
        contents[_ETa] = __expectString(output[_ETa]);
    }
    if (output.ChecksumAlgorithm === "") {
        contents[_CA] = [];
    }
    else if (output[_CA] != null) {
        contents[_CA] = de_ChecksumAlgorithmList(__getArrayIfSingleItem(output[_CA]), context);
    }
    if (output[_CT] != null) {
        contents[_CT] = __expectString(output[_CT]);
    }
    if (output[_Si] != null) {
        contents[_Si] = __strictParseLong(output[_Si]);
    }
    if (output[_SC] != null) {
        contents[_SC] = __expectString(output[_SC]);
    }
    if (output[_O] != null) {
        contents[_O] = de_Owner(output[_O], context);
    }
    if (output[_RSe] != null) {
        contents[_RSe] = de_RestoreStatus(output[_RSe], context);
    }
    return contents;
};
const de_ObjectList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de__Object(entry, context);
    });
};
const de_ObjectLockConfiguration = (output, context) => {
    const contents = {};
    if (output[_OLE] != null) {
        contents[_OLE] = __expectString(output[_OLE]);
    }
    if (output[_Ru] != null) {
        contents[_Ru] = de_ObjectLockRule(output[_Ru], context);
    }
    return contents;
};
const de_ObjectLockLegalHold = (output, context) => {
    const contents = {};
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    return contents;
};
const de_ObjectLockRetention = (output, context) => {
    const contents = {};
    if (output[_Mo] != null) {
        contents[_Mo] = __expectString(output[_Mo]);
    }
    if (output[_RUD] != null) {
        contents[_RUD] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_RUD]));
    }
    return contents;
};
const de_ObjectLockRule = (output, context) => {
    const contents = {};
    if (output[_DRe] != null) {
        contents[_DRe] = de_DefaultRetention(output[_DRe], context);
    }
    return contents;
};
const de_ObjectPart = (output, context) => {
    const contents = {};
    if (output[_PN] != null) {
        contents[_PN] = __strictParseInt32(output[_PN]);
    }
    if (output[_Si] != null) {
        contents[_Si] = __strictParseLong(output[_Si]);
    }
    if (output[_CCRC] != null) {
        contents[_CCRC] = __expectString(output[_CCRC]);
    }
    if (output[_CCRCC] != null) {
        contents[_CCRCC] = __expectString(output[_CCRCC]);
    }
    if (output[_CCRCNVME] != null) {
        contents[_CCRCNVME] = __expectString(output[_CCRCNVME]);
    }
    if (output[_CSHA] != null) {
        contents[_CSHA] = __expectString(output[_CSHA]);
    }
    if (output[_CSHAh] != null) {
        contents[_CSHAh] = __expectString(output[_CSHAh]);
    }
    return contents;
};
const de_ObjectVersion = (output, context) => {
    const contents = {};
    if (output[_ETa] != null) {
        contents[_ETa] = __expectString(output[_ETa]);
    }
    if (output.ChecksumAlgorithm === "") {
        contents[_CA] = [];
    }
    else if (output[_CA] != null) {
        contents[_CA] = de_ChecksumAlgorithmList(__getArrayIfSingleItem(output[_CA]), context);
    }
    if (output[_CT] != null) {
        contents[_CT] = __expectString(output[_CT]);
    }
    if (output[_Si] != null) {
        contents[_Si] = __strictParseLong(output[_Si]);
    }
    if (output[_SC] != null) {
        contents[_SC] = __expectString(output[_SC]);
    }
    if (output[_K] != null) {
        contents[_K] = __expectString(output[_K]);
    }
    if (output[_VI] != null) {
        contents[_VI] = __expectString(output[_VI]);
    }
    if (output[_IL] != null) {
        contents[_IL] = __parseBoolean(output[_IL]);
    }
    if (output[_LM] != null) {
        contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM]));
    }
    if (output[_O] != null) {
        contents[_O] = de_Owner(output[_O], context);
    }
    if (output[_RSe] != null) {
        contents[_RSe] = de_RestoreStatus(output[_RSe], context);
    }
    return contents;
};
const de_ObjectVersionList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_ObjectVersion(entry, context);
    });
};
const de_Owner = (output, context) => {
    const contents = {};
    if (output[_DN] != null) {
        contents[_DN] = __expectString(output[_DN]);
    }
    if (output[_ID_] != null) {
        contents[_ID_] = __expectString(output[_ID_]);
    }
    return contents;
};
const de_OwnershipControls = (output, context) => {
    const contents = {};
    if (output.Rule === "") {
        contents[_Rul] = [];
    }
    else if (output[_Ru] != null) {
        contents[_Rul] = de_OwnershipControlsRules(__getArrayIfSingleItem(output[_Ru]), context);
    }
    return contents;
};
const de_OwnershipControlsRule = (output, context) => {
    const contents = {};
    if (output[_OO] != null) {
        contents[_OO] = __expectString(output[_OO]);
    }
    return contents;
};
const de_OwnershipControlsRules = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_OwnershipControlsRule(entry, context);
    });
};
const de_Part = (output, context) => {
    const contents = {};
    if (output[_PN] != null) {
        contents[_PN] = __strictParseInt32(output[_PN]);
    }
    if (output[_LM] != null) {
        contents[_LM] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_LM]));
    }
    if (output[_ETa] != null) {
        contents[_ETa] = __expectString(output[_ETa]);
    }
    if (output[_Si] != null) {
        contents[_Si] = __strictParseLong(output[_Si]);
    }
    if (output[_CCRC] != null) {
        contents[_CCRC] = __expectString(output[_CCRC]);
    }
    if (output[_CCRCC] != null) {
        contents[_CCRCC] = __expectString(output[_CCRCC]);
    }
    if (output[_CCRCNVME] != null) {
        contents[_CCRCNVME] = __expectString(output[_CCRCNVME]);
    }
    if (output[_CSHA] != null) {
        contents[_CSHA] = __expectString(output[_CSHA]);
    }
    if (output[_CSHAh] != null) {
        contents[_CSHAh] = __expectString(output[_CSHAh]);
    }
    return contents;
};
const de_PartitionedPrefix = (output, context) => {
    const contents = {};
    if (output[_PDS] != null) {
        contents[_PDS] = __expectString(output[_PDS]);
    }
    return contents;
};
const de_Parts = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_Part(entry, context);
    });
};
const de_PartsList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_ObjectPart(entry, context);
    });
};
const de_PolicyStatus = (output, context) => {
    const contents = {};
    if (output[_IP] != null) {
        contents[_IP] = __parseBoolean(output[_IP]);
    }
    return contents;
};
const de_Progress = (output, context) => {
    const contents = {};
    if (output[_BS] != null) {
        contents[_BS] = __strictParseLong(output[_BS]);
    }
    if (output[_BP] != null) {
        contents[_BP] = __strictParseLong(output[_BP]);
    }
    if (output[_BRy] != null) {
        contents[_BRy] = __strictParseLong(output[_BRy]);
    }
    return contents;
};
const de_PublicAccessBlockConfiguration = (output, context) => {
    const contents = {};
    if (output[_BPA] != null) {
        contents[_BPA] = __parseBoolean(output[_BPA]);
    }
    if (output[_IPA] != null) {
        contents[_IPA] = __parseBoolean(output[_IPA]);
    }
    if (output[_BPP] != null) {
        contents[_BPP] = __parseBoolean(output[_BPP]);
    }
    if (output[_RPB] != null) {
        contents[_RPB] = __parseBoolean(output[_RPB]);
    }
    return contents;
};
const de_QueueConfiguration = (output, context) => {
    const contents = {};
    if (output[_I] != null) {
        contents[_I] = __expectString(output[_I]);
    }
    if (output[_Qu] != null) {
        contents[_QA] = __expectString(output[_Qu]);
    }
    if (output.Event === "") {
        contents[_Eve] = [];
    }
    else if (output[_Ev] != null) {
        contents[_Eve] = de_EventList(__getArrayIfSingleItem(output[_Ev]), context);
    }
    if (output[_F] != null) {
        contents[_F] = de_NotificationConfigurationFilter(output[_F], context);
    }
    return contents;
};
const de_QueueConfigurationList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_QueueConfiguration(entry, context);
    });
};
const de_Redirect = (output, context) => {
    const contents = {};
    if (output[_HN] != null) {
        contents[_HN] = __expectString(output[_HN]);
    }
    if (output[_HRC] != null) {
        contents[_HRC] = __expectString(output[_HRC]);
    }
    if (output[_Pr] != null) {
        contents[_Pr] = __expectString(output[_Pr]);
    }
    if (output[_RKPW] != null) {
        contents[_RKPW] = __expectString(output[_RKPW]);
    }
    if (output[_RKW] != null) {
        contents[_RKW] = __expectString(output[_RKW]);
    }
    return contents;
};
const de_RedirectAllRequestsTo = (output, context) => {
    const contents = {};
    if (output[_HN] != null) {
        contents[_HN] = __expectString(output[_HN]);
    }
    if (output[_Pr] != null) {
        contents[_Pr] = __expectString(output[_Pr]);
    }
    return contents;
};
const de_ReplicaModifications = (output, context) => {
    const contents = {};
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    return contents;
};
const de_ReplicationConfiguration = (output, context) => {
    const contents = {};
    if (output[_Ro] != null) {
        contents[_Ro] = __expectString(output[_Ro]);
    }
    if (output.Rule === "") {
        contents[_Rul] = [];
    }
    else if (output[_Ru] != null) {
        contents[_Rul] = de_ReplicationRules(__getArrayIfSingleItem(output[_Ru]), context);
    }
    return contents;
};
const de_ReplicationRule = (output, context) => {
    const contents = {};
    if (output[_ID_] != null) {
        contents[_ID_] = __expectString(output[_ID_]);
    }
    if (output[_Pri] != null) {
        contents[_Pri] = __strictParseInt32(output[_Pri]);
    }
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output[_F] != null) {
        contents[_F] = de_ReplicationRuleFilter(output[_F], context);
    }
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    if (output[_SSC] != null) {
        contents[_SSC] = de_SourceSelectionCriteria(output[_SSC], context);
    }
    if (output[_EOR] != null) {
        contents[_EOR] = de_ExistingObjectReplication(output[_EOR], context);
    }
    if (output[_Des] != null) {
        contents[_Des] = de_Destination(output[_Des], context);
    }
    if (output[_DMR] != null) {
        contents[_DMR] = de_DeleteMarkerReplication(output[_DMR], context);
    }
    return contents;
};
const de_ReplicationRuleAndOperator = (output, context) => {
    const contents = {};
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output.Tag === "") {
        contents[_Tag] = [];
    }
    else if (output[_Ta] != null) {
        contents[_Tag] = de_TagSet(__getArrayIfSingleItem(output[_Ta]), context);
    }
    return contents;
};
const de_ReplicationRuleFilter = (output, context) => {
    const contents = {};
    if (output[_P] != null) {
        contents[_P] = __expectString(output[_P]);
    }
    if (output[_Ta] != null) {
        contents[_Ta] = de_Tag(output[_Ta], context);
    }
    if (output[_A] != null) {
        contents[_A] = de_ReplicationRuleAndOperator(output[_A], context);
    }
    return contents;
};
const de_ReplicationRules = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_ReplicationRule(entry, context);
    });
};
const de_ReplicationTime = (output, context) => {
    const contents = {};
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    if (output[_Tim] != null) {
        contents[_Tim] = de_ReplicationTimeValue(output[_Tim], context);
    }
    return contents;
};
const de_ReplicationTimeValue = (output, context) => {
    const contents = {};
    if (output[_Mi] != null) {
        contents[_Mi] = __strictParseInt32(output[_Mi]);
    }
    return contents;
};
const de_RestoreStatus = (output, context) => {
    const contents = {};
    if (output[_IRIP] != null) {
        contents[_IRIP] = __parseBoolean(output[_IRIP]);
    }
    if (output[_RED] != null) {
        contents[_RED] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_RED]));
    }
    return contents;
};
const de_RoutingRule = (output, context) => {
    const contents = {};
    if (output[_Con] != null) {
        contents[_Con] = de_Condition(output[_Con], context);
    }
    if (output[_Red] != null) {
        contents[_Red] = de_Redirect(output[_Red], context);
    }
    return contents;
};
const de_RoutingRules = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_RoutingRule(entry, context);
    });
};
const de_S3KeyFilter = (output, context) => {
    const contents = {};
    if (output.FilterRule === "") {
        contents[_FRi] = [];
    }
    else if (output[_FR] != null) {
        contents[_FRi] = de_FilterRuleList(__getArrayIfSingleItem(output[_FR]), context);
    }
    return contents;
};
const de_S3TablesDestinationResult = (output, context) => {
    const contents = {};
    if (output[_TBA] != null) {
        contents[_TBA] = __expectString(output[_TBA]);
    }
    if (output[_TN] != null) {
        contents[_TN] = __expectString(output[_TN]);
    }
    if (output[_TAa] != null) {
        contents[_TAa] = __expectString(output[_TAa]);
    }
    if (output[_TNa] != null) {
        contents[_TNa] = __expectString(output[_TNa]);
    }
    return contents;
};
const de_ServerSideEncryptionByDefault = (output, context) => {
    const contents = {};
    if (output[_SSEA] != null) {
        contents[_SSEA] = __expectString(output[_SSEA]);
    }
    if (output[_KMSMKID] != null) {
        contents[_KMSMKID] = __expectString(output[_KMSMKID]);
    }
    return contents;
};
const de_ServerSideEncryptionConfiguration = (output, context) => {
    const contents = {};
    if (output.Rule === "") {
        contents[_Rul] = [];
    }
    else if (output[_Ru] != null) {
        contents[_Rul] = de_ServerSideEncryptionRules(__getArrayIfSingleItem(output[_Ru]), context);
    }
    return contents;
};
const de_ServerSideEncryptionRule = (output, context) => {
    const contents = {};
    if (output[_ASSEBD] != null) {
        contents[_ASSEBD] = de_ServerSideEncryptionByDefault(output[_ASSEBD], context);
    }
    if (output[_BKE] != null) {
        contents[_BKE] = __parseBoolean(output[_BKE]);
    }
    return contents;
};
const de_ServerSideEncryptionRules = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_ServerSideEncryptionRule(entry, context);
    });
};
const de_SessionCredentials = (output, context) => {
    const contents = {};
    if (output[_AKI] != null) {
        contents[_AKI] = expectString(output[_AKI]);
    }
    if (output[_SAK] != null) {
        contents[_SAK] = expectString(output[_SAK]);
    }
    if (output[_ST] != null) {
        contents[_ST] = expectString(output[_ST]);
    }
    if (output[_Exp] != null) {
        contents[_Exp] = expectNonNull(parseRfc3339DateTimeWithOffset(output[_Exp]));
    }
    return contents;
};
const de_SimplePrefix = (output, context) => {
    const contents = {};
    return contents;
};
const de_SourceSelectionCriteria = (output, context) => {
    const contents = {};
    if (output[_SKEO] != null) {
        contents[_SKEO] = de_SseKmsEncryptedObjects(output[_SKEO], context);
    }
    if (output[_RM] != null) {
        contents[_RM] = de_ReplicaModifications(output[_RM], context);
    }
    return contents;
};
const de_SSEKMS = (output, context) => {
    const contents = {};
    if (output[_KI] != null) {
        contents[_KI] = __expectString(output[_KI]);
    }
    return contents;
};
const de_SseKmsEncryptedObjects = (output, context) => {
    const contents = {};
    if (output[_S] != null) {
        contents[_S] = __expectString(output[_S]);
    }
    return contents;
};
const de_SSES3 = (output, context) => {
    const contents = {};
    return contents;
};
const de_Stats = (output, context) => {
    const contents = {};
    if (output[_BS] != null) {
        contents[_BS] = __strictParseLong(output[_BS]);
    }
    if (output[_BP] != null) {
        contents[_BP] = __strictParseLong(output[_BP]);
    }
    if (output[_BRy] != null) {
        contents[_BRy] = __strictParseLong(output[_BRy]);
    }
    return contents;
};
const de_StorageClassAnalysis = (output, context) => {
    const contents = {};
    if (output[_DE] != null) {
        contents[_DE] = de_StorageClassAnalysisDataExport(output[_DE], context);
    }
    return contents;
};
const de_StorageClassAnalysisDataExport = (output, context) => {
    const contents = {};
    if (output[_OSV] != null) {
        contents[_OSV] = __expectString(output[_OSV]);
    }
    if (output[_Des] != null) {
        contents[_Des] = de_AnalyticsExportDestination(output[_Des], context);
    }
    return contents;
};
const de_Tag = (output, context) => {
    const contents = {};
    if (output[_K] != null) {
        contents[_K] = __expectString(output[_K]);
    }
    if (output[_Va] != null) {
        contents[_Va] = __expectString(output[_Va]);
    }
    return contents;
};
const de_TagSet = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_Tag(entry, context);
    });
};
const de_TargetGrant = (output, context) => {
    const contents = {};
    if (output[_Gra] != null) {
        contents[_Gra] = de_Grantee(output[_Gra], context);
    }
    if (output[_Pe] != null) {
        contents[_Pe] = __expectString(output[_Pe]);
    }
    return contents;
};
const de_TargetGrants = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_TargetGrant(entry, context);
    });
};
const de_TargetObjectKeyFormat = (output, context) => {
    const contents = {};
    if (output[_SPi] != null) {
        contents[_SPi] = de_SimplePrefix(output[_SPi], context);
    }
    if (output[_PP] != null) {
        contents[_PP] = de_PartitionedPrefix(output[_PP], context);
    }
    return contents;
};
const de_Tiering = (output, context) => {
    const contents = {};
    if (output[_Da] != null) {
        contents[_Da] = __strictParseInt32(output[_Da]);
    }
    if (output[_AT] != null) {
        contents[_AT] = __expectString(output[_AT]);
    }
    return contents;
};
const de_TieringList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_Tiering(entry, context);
    });
};
const de_TopicConfiguration = (output, context) => {
    const contents = {};
    if (output[_I] != null) {
        contents[_I] = __expectString(output[_I]);
    }
    if (output[_Top] != null) {
        contents[_TA] = __expectString(output[_Top]);
    }
    if (output.Event === "") {
        contents[_Eve] = [];
    }
    else if (output[_Ev] != null) {
        contents[_Eve] = de_EventList(__getArrayIfSingleItem(output[_Ev]), context);
    }
    if (output[_F] != null) {
        contents[_F] = de_NotificationConfigurationFilter(output[_F], context);
    }
    return contents;
};
const de_TopicConfigurationList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_TopicConfiguration(entry, context);
    });
};
const de_Transition = (output, context) => {
    const contents = {};
    if (output[_Dat] != null) {
        contents[_Dat] = __expectNonNull(__parseRfc3339DateTimeWithOffset(output[_Dat]));
    }
    if (output[_Da] != null) {
        contents[_Da] = __strictParseInt32(output[_Da]);
    }
    if (output[_SC] != null) {
        contents[_SC] = __expectString(output[_SC]);
    }
    return contents;
};
const de_TransitionList = (output, context) => {
    return (output || [])
        .filter((e) => e != null)
        .map((entry) => {
        return de_Transition(entry, context);
    });
};
const Aws_restXml_deserializeMetadata = (output) => ({
    httpStatusCode: output.statusCode,
    requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
    extendedRequestId: output.headers["x-amz-id-2"],
    cfId: output.headers["x-amz-cf-id"],
});
const Aws_restXml_collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
const _A = "And";
const _AAO = "AnalyticsAndOperator";
const _AC = "AnalyticsConfiguration";
const _ACL = "ACL";
const _ACLc = "AccessControlList";
const _ACLn = "AnalyticsConfigurationList";
const _ACP = "AccessControlPolicy";
const _ACT = "AccessControlTranslation";
const _ACc = "AccelerateConfiguration";
const _AD = "AbortDate";
const _AED = "AnalyticsExportDestination";
const _AF = "AnalyticsFilter";
const _AH = "AllowedHeader";
const _AHl = "AllowedHeaders";
const _AI = "AnalyticsId";
const _AIMU = "AbortIncompleteMultipartUpload";
const _AIc = "AccountId";
const _AKI = "AccessKeyId";
const _AM = "AllowedMethod";
const _AMl = "AllowedMethods";
const _AO = "AllowedOrigin";
const _AOl = "AllowedOrigins";
const _APA = "AccessPointAlias";
const _APAc = "AccessPointArn";
const _AQRD = "AllowQuotedRecordDelimiter";
const _AR = "AcceptRanges";
const _ARI = "AbortRuleId";
const _AS = "ArchiveStatus";
const _ASBD = "AnalyticsS3BucketDestination";
const _ASEFF = "AnalyticsS3ExportFileFormat";
const _ASSEBD = "ApplyServerSideEncryptionByDefault";
const _AT = "AccessTier";
const _Ac = "Account";
const _B = "Bucket";
const _BAI = "BucketAccountId";
const _BAS = "BucketAccelerateStatus";
const _BGR = "BypassGovernanceRetention";
const _BI = "BucketInfo";
const _BKE = "BucketKeyEnabled";
const _BLC = "BucketLifecycleConfiguration";
const _BLCu = "BucketLocationConstraint";
const _BLN = "BucketLocationName";
const _BLP = "BucketLogsPermission";
const _BLS = "BucketLoggingStatus";
const _BLT = "BucketLocationType";
const _BN = "BucketName";
const _BP = "BytesProcessed";
const _BPA = "BlockPublicAcls";
const _BPP = "BlockPublicPolicy";
const _BR = "BucketRegion";
const _BRy = "BytesReturned";
const _BS = "BytesScanned";
const _BT = "BucketType";
const _BVS = "BucketVersioningStatus";
const _Bu = "Buckets";
const _C = "Credentials";
const _CA = "ChecksumAlgorithm";
const _CACL = "CannedACL";
const _CBC = "CreateBucketConfiguration";
const _CC = "CacheControl";
const _CCRC = "ChecksumCRC32";
const _CCRCC = "ChecksumCRC32C";
const _CCRCNVME = "ChecksumCRC64NVME";
const _CD = "ContentDisposition";
const _CDr = "CreationDate";
const _CE = "ContentEncoding";
const _CF = "CloudFunction";
const _CFC = "CloudFunctionConfiguration";
const _CL = "ContentLanguage";
const _CLo = "ContentLength";
const _CM = "ChecksumMode";
const _CMD = "ContentMD5";
const _CMU = "CompletedMultipartUpload";
const _CORSC = "CORSConfiguration";
const _CORSR = "CORSRule";
const _CORSRu = "CORSRules";
const _CP = "CommonPrefixes";
const _CPo = "CompletedPart";
const _CR = "ContentRange";
const _CRSBA = "ConfirmRemoveSelfBucketAccess";
const _CS = "CopySource";
const _CSHA = "ChecksumSHA1";
const _CSHAh = "ChecksumSHA256";
const _CSIM = "CopySourceIfMatch";
const _CSIMS = "CopySourceIfModifiedSince";
const _CSINM = "CopySourceIfNoneMatch";
const _CSIUS = "CopySourceIfUnmodifiedSince";
const _CSR = "CopySourceRange";
const _CSSSECA = "CopySourceSSECustomerAlgorithm";
const _CSSSECK = "CopySourceSSECustomerKey";
const _CSSSECKMD = "CopySourceSSECustomerKeyMD5";
const _CSV = "CSV";
const _CSVI = "CopySourceVersionId";
const _CSVIn = "CSVInput";
const _CSVO = "CSVOutput";
const _CT = "ChecksumType";
const _CTo = "ContentType";
const _CTom = "CompressionType";
const _CTon = "ContinuationToken";
const _Ch = "Checksum";
const _Co = "Contents";
const _Cod = "Code";
const _Com = "Comments";
const _Con = "Condition";
const _D = "Delimiter";
const _DAI = "DaysAfterInitiation";
const _DE = "DataExport";
const _DM = "DeleteMarker";
const _DMR = "DeleteMarkerReplication";
const _DMRS = "DeleteMarkerReplicationStatus";
const _DMVI = "DeleteMarkerVersionId";
const _DMe = "DeleteMarkers";
const _DN = "DisplayName";
const _DR = "DataRedundancy";
const _DRe = "DefaultRetention";
const _Da = "Days";
const _Dat = "Date";
const _De = "Deleted";
const _Del = "Delete";
const _Des = "Destination";
const _Desc = "Description";
const _E = "Expires";
const _EA = "EmailAddress";
const _EBC = "EventBridgeConfiguration";
const _EBO = "ExpectedBucketOwner";
const _EC = "ErrorCode";
const _ECn = "EncryptionConfiguration";
const _ED = "ErrorDocument";
const _EH = "ExposeHeaders";
const _EHx = "ExposeHeader";
const _EM = "ErrorMessage";
const _EODM = "ExpiredObjectDeleteMarker";
const _EOR = "ExistingObjectReplication";
const _EORS = "ExistingObjectReplicationStatus";
const _ERP = "EnableRequestProgress";
const _ES = "ExpiresString";
const _ESBO = "ExpectedSourceBucketOwner";
const _ESx = "ExpirationStatus";
const _ET = "EncodingType";
const _ETa = "ETag";
const _ETn = "EncryptionType";
const _ETv = "EventThreshold";
const _ETx = "ExpressionType";
const _En = "Encryption";
const _Ena = "Enabled";
const _End = "End";
const _Er = "Error";
const _Err = "Errors";
const _Ev = "Event";
const _Eve = "Events";
const _Ex = "Expression";
const _Exp = "Expiration";
const _F = "Filter";
const _FD = "FieldDelimiter";
const _FHI = "FileHeaderInfo";
const _FO = "FetchOwner";
const _FR = "FilterRule";
const _FRN = "FilterRuleName";
const _FRV = "FilterRuleValue";
const _FRi = "FilterRules";
const _Fi = "Field";
const _Fo = "Format";
const _Fr = "Frequency";
const _G = "Grant";
const _GFC = "GrantFullControl";
const _GJP = "GlacierJobParameters";
const _GR = "GrantRead";
const _GRACP = "GrantReadACP";
const _GW = "GrantWrite";
const _GWACP = "GrantWriteACP";
const _Gr = "Grants";
const _Gra = "Grantee";
const _HECRE = "HttpErrorCodeReturnedEquals";
const _HN = "HostName";
const _HRC = "HttpRedirectCode";
const _I = "Id";
const _IC = "InventoryConfiguration";
const _ICL = "InventoryConfigurationList";
const _ID = "IndexDocument";
const _ID_ = "ID";
const _IDn = "InventoryDestination";
const _IE = "IsEnabled";
const _IEn = "InventoryEncryption";
const _IF = "InventoryFilter";
const _IFn = "InventoryFormat";
const _IFnv = "InventoryFrequency";
const _II = "InventoryId";
const _IIOV = "InventoryIncludedObjectVersions";
const _IL = "IsLatest";
const _IM = "IfMatch";
const _IMIT = "IfMatchInitiatedTime";
const _IMLMT = "IfMatchLastModifiedTime";
const _IMS = "IfMatchSize";
const _IMSf = "IfModifiedSince";
const _INM = "IfNoneMatch";
const _IOF = "InventoryOptionalField";
const _IOV = "IncludedObjectVersions";
const _IP = "IsPublic";
const _IPA = "IgnorePublicAcls";
const _IRIP = "IsRestoreInProgress";
const _IS = "InputSerialization";
const _ISBD = "InventoryS3BucketDestination";
const _ISn = "InventorySchedule";
const _IT = "IsTruncated";
const _ITAO = "IntelligentTieringAndOperator";
const _ITAT = "IntelligentTieringAccessTier";
const _ITC = "IntelligentTieringConfiguration";
const _ITCL = "IntelligentTieringConfigurationList";
const _ITD = "IntelligentTieringDays";
const _ITF = "IntelligentTieringFilter";
const _ITI = "IntelligentTieringId";
const _ITS = "IntelligentTieringStatus";
const _IUS = "IfUnmodifiedSince";
const _In = "Initiator";
const _Ini = "Initiated";
const _JSON = "JSON";
const _JSONI = "JSONInput";
const _JSONO = "JSONOutput";
const _JSONT = "JSONType";
const _K = "Key";
const _KC = "KeyCount";
const _KI = "KeyId";
const _KM = "KeyMarker";
const _KMSC = "KMSContext";
const _KMSKI = "KMSKeyId";
const _KMSMKID = "KMSMasterKeyID";
const _KPE = "KeyPrefixEquals";
const _L = "Location";
const _LC = "LocationConstraint";
const _LE = "LoggingEnabled";
const _LEi = "LifecycleExpiration";
const _LFA = "LambdaFunctionArn";
const _LFC = "LambdaFunctionConfigurations";
const _LFCa = "LambdaFunctionConfiguration";
const _LI = "LocationInfo";
const _LM = "LastModified";
const _LMT = "LastModifiedTime";
const _LNAS = "LocationNameAsString";
const _LP = "LocationPrefix";
const _LR = "LifecycleRule";
const _LRAO = "LifecycleRuleAndOperator";
const _LRF = "LifecycleRuleFilter";
const _LT = "LocationType";
const _M = "Marker";
const _MAO = "MetricsAndOperator";
const _MAS = "MaxAgeSeconds";
const _MB = "MaxBuckets";
const _MC = "MetricsConfiguration";
const _MCL = "MetricsConfigurationList";
const _MD = "MetadataDirective";
const _MDB = "MaxDirectoryBuckets";
const _MDf = "MfaDelete";
const _ME = "MetadataEntry";
const _MF = "MetricsFilter";
const _MFA = "MFA";
const _MFAD = "MFADelete";
const _MI = "MetricsId";
const _MK = "MaxKeys";
const _MKe = "MetadataKey";
const _MM = "MissingMeta";
const _MOS = "MpuObjectSize";
const _MP = "MaxParts";
const _MS = "MetricsStatus";
const _MTC = "MetadataTableConfiguration";
const _MTCR = "MetadataTableConfigurationResult";
const _MU = "MaxUploads";
const _MV = "MetadataValue";
const _Me = "Metrics";
const _Mes = "Message";
const _Mi = "Minutes";
const _Mo = "Mode";
const _N = "Name";
const _NC = "NotificationConfiguration";
const _NCF = "NotificationConfigurationFilter";
const _NCT = "NextContinuationToken";
const _ND = "NoncurrentDays";
const _NI = "NotificationId";
const _NKM = "NextKeyMarker";
const _NM = "NextMarker";
const _NNV = "NewerNoncurrentVersions";
const _NPNM = "NextPartNumberMarker";
const _NUIM = "NextUploadIdMarker";
const _NVE = "NoncurrentVersionExpiration";
const _NVIM = "NextVersionIdMarker";
const _NVT = "NoncurrentVersionTransitions";
const _NVTo = "NoncurrentVersionTransition";
const _O = "Owner";
const _OA = "ObjectAttributes";
const _OC = "OwnershipControls";
const _OCACL = "ObjectCannedACL";
const _OCR = "OwnershipControlsRule";
const _OF = "OptionalFields";
const _OI = "ObjectIdentifier";
const _OK = "ObjectKey";
const _OL = "OutputLocation";
const _OLC = "ObjectLockConfiguration";
const _OLE = "ObjectLockEnabled";
const _OLEFB = "ObjectLockEnabledForBucket";
const _OLLH = "ObjectLockLegalHold";
const _OLLHS = "ObjectLockLegalHoldStatus";
const _OLM = "ObjectLockMode";
const _OLR = "ObjectLockRetention";
const _OLRM = "ObjectLockRetentionMode";
const _OLRUD = "ObjectLockRetainUntilDate";
const _OLRb = "ObjectLockRule";
const _OO = "ObjectOwnership";
const _OOA = "OptionalObjectAttributes";
const _OOw = "OwnerOverride";
const _OP = "ObjectParts";
const _OS = "OutputSerialization";
const _OSGT = "ObjectSizeGreaterThan";
const _OSGTB = "ObjectSizeGreaterThanBytes";
const _OSLT = "ObjectSizeLessThan";
const _OSLTB = "ObjectSizeLessThanBytes";
const _OSV = "OutputSchemaVersion";
const _OSb = "ObjectSize";
const _OVI = "ObjectVersionId";
const _Ob = "Objects";
const _P = "Prefix";
const _PABC = "PublicAccessBlockConfiguration";
const _PC = "PartsCount";
const _PDS = "PartitionDateSource";
const _PI = "ParquetInput";
const _PN = "PartNumber";
const _PNM = "PartNumberMarker";
const _PP = "PartitionedPrefix";
const _Pa = "Payer";
const _Par = "Part";
const _Parq = "Parquet";
const _Part = "Parts";
const _Pe = "Permission";
const _Pr = "Protocol";
const _Pri = "Priority";
const _Q = "Quiet";
const _QA = "QueueArn";
const _QC = "QueueConfiguration";
const _QCu = "QueueConfigurations";
const _QCuo = "QuoteCharacter";
const _QEC = "QuoteEscapeCharacter";
const _QF = "QuoteFields";
const _Qu = "Queue";
const _R = "Range";
const _RART = "RedirectAllRequestsTo";
const _RC = "RequestCharged";
const _RCC = "ResponseCacheControl";
const _RCD = "ResponseContentDisposition";
const _RCE = "ResponseContentEncoding";
const _RCL = "ResponseContentLanguage";
const _RCT = "ResponseContentType";
const _RCe = "ReplicationConfiguration";
const _RD = "RecordDelimiter";
const _RE = "ResponseExpires";
const _RED = "RestoreExpiryDate";
const _RKKID = "ReplicaKmsKeyID";
const _RKPW = "ReplaceKeyPrefixWith";
const _RKW = "ReplaceKeyWith";
const _RM = "ReplicaModifications";
const _RMS = "ReplicaModificationsStatus";
const _ROP = "RestoreOutputPath";
const _RP = "RequestPayer";
const _RPB = "RestrictPublicBuckets";
const _RPC = "RequestPaymentConfiguration";
const _RPe = "RequestProgress";
const _RR = "RequestRoute";
const _RRAO = "ReplicationRuleAndOperator";
const _RRF = "ReplicationRuleFilter";
const _RRS = "ReplicationRuleStatus";
const _RRT = "RestoreRequestType";
const _RRe = "ReplicationRule";
const _RRes = "RestoreRequest";
const _RRo = "RoutingRules";
const _RRou = "RoutingRule";
const _RS = "ReplicationStatus";
const _RSe = "RestoreStatus";
const _RT = "RequestToken";
const _RTS = "ReplicationTimeStatus";
const _RTV = "ReplicationTimeValue";
const _RTe = "ReplicationTime";
const _RUD = "RetainUntilDate";
const _Re = "Restore";
const _Red = "Redirect";
const _Ro = "Role";
const _Ru = "Rule";
const _Rul = "Rules";
const _S = "Status";
const _SA = "StartAfter";
const _SAK = "SecretAccessKey";
const _SBD = "S3BucketDestination";
const _SC = "StorageClass";
const _SCA = "StorageClassAnalysis";
const _SCADE = "StorageClassAnalysisDataExport";
const _SCASV = "StorageClassAnalysisSchemaVersion";
const _SCt = "StatusCode";
const _SDV = "SkipDestinationValidation";
const _SK = "SSE-KMS";
const _SKEO = "SseKmsEncryptedObjects";
const _SKEOS = "SseKmsEncryptedObjectsStatus";
const _SKF = "S3KeyFilter";
const _SKe = "S3Key";
const _SL = "S3Location";
const _SM = "SessionMode";
const _SOCR = "SelectObjectContentRequest";
const _SP = "SelectParameters";
const _SPi = "SimplePrefix";
const _SR = "ScanRange";
const _SS = "SSE-S3";
const _SSC = "SourceSelectionCriteria";
const _SSE = "ServerSideEncryption";
const _SSEA = "SSEAlgorithm";
const _SSEBD = "ServerSideEncryptionByDefault";
const _SSEC = "ServerSideEncryptionConfiguration";
const _SSECA = "SSECustomerAlgorithm";
const _SSECK = "SSECustomerKey";
const _SSECKMD = "SSECustomerKeyMD5";
const _SSEKMS = "SSEKMS";
const _SSEKMSEC = "SSEKMSEncryptionContext";
const _SSEKMSKI = "SSEKMSKeyId";
const _SSER = "ServerSideEncryptionRule";
const _SSES = "SSES3";
const _ST = "SessionToken";
const _STBA = "S3TablesBucketArn";
const _STD = "S3TablesDestination";
const _STDR = "S3TablesDestinationResult";
const _STN = "S3TablesName";
const _S_ = "S3";
const _Sc = "Schedule";
const _Se = "Setting";
const _Si = "Size";
const _St = "Start";
const _Su = "Suffix";
const _T = "Tagging";
const _TA = "TopicArn";
const _TAa = "TableArn";
const _TB = "TargetBucket";
const _TBA = "TableBucketArn";
const _TC = "TagCount";
const _TCo = "TopicConfiguration";
const _TCop = "TopicConfigurations";
const _TD = "TaggingDirective";
const _TDMOS = "TransitionDefaultMinimumObjectSize";
const _TG = "TargetGrants";
const _TGa = "TargetGrant";
const _TN = "TableName";
const _TNa = "TableNamespace";
const _TOKF = "TargetObjectKeyFormat";
const _TP = "TargetPrefix";
const _TPC = "TotalPartsCount";
const _TS = "TagSet";
const _TSC = "TransitionStorageClass";
const _Ta = "Tag";
const _Tag = "Tags";
const _Ti = "Tier";
const _Tie = "Tierings";
const _Tier = "Tiering";
const _Tim = "Time";
const _To = "Token";
const _Top = "Topic";
const _Tr = "Transitions";
const _Tra = "Transition";
const _Ty = "Type";
const _U = "Upload";
const _UI = "UploadId";
const _UIM = "UploadIdMarker";
const _UM = "UserMetadata";
const _URI = "URI";
const _Up = "Uploads";
const _V = "Version";
const _VC = "VersionCount";
const _VCe = "VersioningConfiguration";
const _VI = "VersionId";
const _VIM = "VersionIdMarker";
const _Va = "Value";
const _Ve = "Versions";
const _WC = "WebsiteConfiguration";
const _WOB = "WriteOffsetBytes";
const _WRL = "WebsiteRedirectLocation";
const _Y = "Years";
const _a = "analytics";
const _ac = "accelerate";
const _acl = "acl";
const _ar = "accept-ranges";
const _at = "attributes";
const _br = "bucket-region";
const _c = "cors";
const _cc = "cache-control";
const _cd = "content-disposition";
const _ce = "content-encoding";
const _cl = "content-language";
const _cl_ = "content-length";
const _cm = "content-md5";
const _cr = "content-range";
const _ct = "content-type";
const _ct_ = "continuation-token";
const _d = "delete";
const _de = "delimiter";
const Aws_restXml_e = "expires";
const _en = "encryption";
const _et = "encoding-type";
const _eta = "etag";
const _ex = "expiresstring";
const _fo = "fetch-owner";
const _i = "id";
const _im = "if-match";
const _ims = "if-modified-since";
const _in = "inventory";
const _inm = "if-none-match";
const _it = "intelligent-tiering";
const _ius = "if-unmodified-since";
const _km = "key-marker";
const _l = "lifecycle";
const _lh = "legal-hold";
const _lm = "last-modified";
const _lo = "location";
const _log = "logging";
const _lt = "list-type";
const _m = "metrics";
const _mT = "metadataTable";
const _ma = "marker";
const _mb = "max-buckets";
const _mdb = "max-directory-buckets";
const _me = "member";
const _mk = "max-keys";
const _mp = "max-parts";
const _mu = "max-uploads";
const _n = "notification";
const _oC = "ownershipControls";
const _ol = "object-lock";
const _p = "policy";
const _pAB = "publicAccessBlock";
const _pN = "partNumber";
const _pS = "policyStatus";
const _pnm = "part-number-marker";
const _pr = "prefix";
const _r = "replication";
const _rP = "requestPayment";
const _ra = "range";
const _rcc = "response-cache-control";
const _rcd = "response-content-disposition";
const _rce = "response-content-encoding";
const _rcl = "response-content-language";
const _rct = "response-content-type";
const _re = "response-expires";
const _res = "restore";
const _ret = "retention";
const _s = "session";
const _sa = "start-after";
const _se = "select";
const _st = "select-type";
const Aws_restXml_t = "tagging";
const _to = "torrent";
const _u = "uploads";
const _uI = "uploadId";
const _uim = "upload-id-marker";
const _v = "versioning";
const _vI = "versionId";
const _ve = '<?xml version="1.0" encoding="UTF-8"?>';
const _ver = "versions";
const _vim = "version-id-marker";
const _w = "website";
const _x = "xsi:type";
const _xaa = "x-amz-acl";
const _xaad = "x-amz-abort-date";
const _xaapa = "x-amz-access-point-alias";
const _xaari = "x-amz-abort-rule-id";
const _xaas = "x-amz-archive-status";
const _xabgr = "x-amz-bypass-governance-retention";
const _xabln = "x-amz-bucket-location-name";
const _xablt = "x-amz-bucket-location-type";
const _xabole = "x-amz-bucket-object-lock-enabled";
const _xabolt = "x-amz-bucket-object-lock-token";
const _xabr = "x-amz-bucket-region";
const _xaca = "x-amz-checksum-algorithm";
const _xacc = "x-amz-checksum-crc32";
const _xacc_ = "x-amz-checksum-crc32c";
const _xacc__ = "x-amz-checksum-crc64nvme";
const _xacm = "x-amz-checksum-mode";
const _xacrsba = "x-amz-confirm-remove-self-bucket-access";
const _xacs = "x-amz-checksum-sha1";
const _xacs_ = "x-amz-checksum-sha256";
const _xacs__ = "x-amz-copy-source";
const _xacsim = "x-amz-copy-source-if-match";
const _xacsims = "x-amz-copy-source-if-modified-since";
const _xacsinm = "x-amz-copy-source-if-none-match";
const _xacsius = "x-amz-copy-source-if-unmodified-since";
const _xacsm = "x-amz-create-session-mode";
const _xacsr = "x-amz-copy-source-range";
const _xacssseca = "x-amz-copy-source-server-side-encryption-customer-algorithm";
const _xacssseck = "x-amz-copy-source-server-side-encryption-customer-key";
const _xacssseckm = "x-amz-copy-source-server-side-encryption-customer-key-md5";
const _xacsvi = "x-amz-copy-source-version-id";
const _xact = "x-amz-checksum-type";
const _xadm = "x-amz-delete-marker";
const _xae = "x-amz-expiration";
const _xaebo = "x-amz-expected-bucket-owner";
const _xafec = "x-amz-fwd-error-code";
const _xafem = "x-amz-fwd-error-message";
const _xafhar = "x-amz-fwd-header-accept-ranges";
const _xafhcc = "x-amz-fwd-header-cache-control";
const _xafhcd = "x-amz-fwd-header-content-disposition";
const _xafhce = "x-amz-fwd-header-content-encoding";
const _xafhcl = "x-amz-fwd-header-content-language";
const _xafhcr = "x-amz-fwd-header-content-range";
const _xafhct = "x-amz-fwd-header-content-type";
const _xafhe = "x-amz-fwd-header-etag";
const _xafhe_ = "x-amz-fwd-header-expires";
const _xafhlm = "x-amz-fwd-header-last-modified";
const _xafhxacc = "x-amz-fwd-header-x-amz-checksum-crc32";
const _xafhxacc_ = "x-amz-fwd-header-x-amz-checksum-crc32c";
const _xafhxacc__ = "x-amz-fwd-header-x-amz-checksum-crc64nvme";
const _xafhxacs = "x-amz-fwd-header-x-amz-checksum-sha1";
const _xafhxacs_ = "x-amz-fwd-header-x-amz-checksum-sha256";
const _xafhxadm = "x-amz-fwd-header-x-amz-delete-marker";
const _xafhxae = "x-amz-fwd-header-x-amz-expiration";
const _xafhxamm = "x-amz-fwd-header-x-amz-missing-meta";
const _xafhxampc = "x-amz-fwd-header-x-amz-mp-parts-count";
const _xafhxaollh = "x-amz-fwd-header-x-amz-object-lock-legal-hold";
const _xafhxaolm = "x-amz-fwd-header-x-amz-object-lock-mode";
const _xafhxaolrud = "x-amz-fwd-header-x-amz-object-lock-retain-until-date";
const _xafhxar = "x-amz-fwd-header-x-amz-restore";
const _xafhxarc = "x-amz-fwd-header-x-amz-request-charged";
const _xafhxars = "x-amz-fwd-header-x-amz-replication-status";
const _xafhxasc = "x-amz-fwd-header-x-amz-storage-class";
const _xafhxasse = "x-amz-fwd-header-x-amz-server-side-encryption";
const _xafhxasseakki = "x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id";
const _xafhxassebke = "x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled";
const _xafhxasseca = "x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm";
const _xafhxasseckm = "x-amz-fwd-header-x-amz-server-side-encryption-customer-key-md5";
const _xafhxatc = "x-amz-fwd-header-x-amz-tagging-count";
const _xafhxavi = "x-amz-fwd-header-x-amz-version-id";
const _xafs = "x-amz-fwd-status";
const _xagfc = "x-amz-grant-full-control";
const _xagr = "x-amz-grant-read";
const _xagra = "x-amz-grant-read-acp";
const _xagw = "x-amz-grant-write";
const _xagwa = "x-amz-grant-write-acp";
const _xaimit = "x-amz-if-match-initiated-time";
const _xaimlmt = "x-amz-if-match-last-modified-time";
const _xaims = "x-amz-if-match-size";
const _xam = "x-amz-mfa";
const _xamd = "x-amz-metadata-directive";
const _xamm = "x-amz-missing-meta";
const _xamos = "x-amz-mp-object-size";
const _xamp = "x-amz-max-parts";
const _xampc = "x-amz-mp-parts-count";
const _xaoa = "x-amz-object-attributes";
const _xaollh = "x-amz-object-lock-legal-hold";
const _xaolm = "x-amz-object-lock-mode";
const _xaolrud = "x-amz-object-lock-retain-until-date";
const _xaoo = "x-amz-object-ownership";
const _xaooa = "x-amz-optional-object-attributes";
const _xaos = "x-amz-object-size";
const _xapnm = "x-amz-part-number-marker";
const _xar = "x-amz-restore";
const _xarc = "x-amz-request-charged";
const _xarop = "x-amz-restore-output-path";
const _xarp = "x-amz-request-payer";
const _xarr = "x-amz-request-route";
const _xars = "x-amz-replication-status";
const _xart = "x-amz-request-token";
const _xasc = "x-amz-storage-class";
const _xasca = "x-amz-sdk-checksum-algorithm";
const _xasdv = "x-amz-skip-destination-validation";
const _xasebo = "x-amz-source-expected-bucket-owner";
const _xasse = "x-amz-server-side-encryption";
const _xasseakki = "x-amz-server-side-encryption-aws-kms-key-id";
const _xassebke = "x-amz-server-side-encryption-bucket-key-enabled";
const _xassec = "x-amz-server-side-encryption-context";
const _xasseca = "x-amz-server-side-encryption-customer-algorithm";
const _xasseck = "x-amz-server-side-encryption-customer-key";
const _xasseckm = "x-amz-server-side-encryption-customer-key-md5";
const _xat = "x-amz-tagging";
const _xatc = "x-amz-tagging-count";
const _xatd = "x-amz-tagging-directive";
const _xatdmos = "x-amz-transition-default-minimum-object-size";
const _xavi = "x-amz-version-id";
const _xawob = "x-amz-write-offset-bytes";
const _xawrl = "x-amz-website-redirect-location";
const _xi = "x-id";

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateSessionCommand.js








class CreateSessionCommand extends Command
    .classBuilder()
    .ep({
    ...commonParams,
    DisableS3ExpressSessionAuth: { type: "staticContextParams", value: true },
    Bucket: { type: "contextParams", name: "Bucket" },
})
    .m(function (Command, cs, config, o) {
    return [
        getSerdePlugin(config, this.serialize, this.deserialize),
        getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
        getThrow200ExceptionsPlugin(config),
    ];
})
    .s("AmazonS3", "CreateSession", {})
    .n("S3Client", "CreateSessionCommand")
    .f(CreateSessionRequestFilterSensitiveLog, CreateSessionOutputFilterSensitiveLog)
    .ser(se_CreateSessionCommand)
    .de(de_CreateSessionCommand)
    .build() {
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/package.json
var package_namespaceObject = {"rE":"3.796.0"};
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha1-browser/build/module/isEmptyData.js
function isEmptyData_isEmptyData(data) {
    if (typeof data === "string") {
        return data.length === 0;
    }
    return data.byteLength === 0;
}
//# sourceMappingURL=isEmptyData.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha1-browser/build/module/constants.js
var SHA_1_HASH = { name: "SHA-1" };
var SHA_1_HMAC_ALGO = {
    name: "HMAC",
    hash: SHA_1_HASH,
};
var EMPTY_DATA_SHA_1 = new Uint8Array([
    218,
    57,
    163,
    238,
    94,
    107,
    75,
    13,
    50,
    85,
    191,
    239,
    149,
    96,
    24,
    144,
    175,
    216,
    7,
    9,
]);
//# sourceMappingURL=constants.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-locate-window/dist-es/index.js
const fallbackWindow = {};
function locateWindow() {
    if (typeof window !== "undefined") {
        return window;
    }
    else if (typeof self !== "undefined") {
        return self;
    }
    return fallbackWindow;
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha1-browser/build/module/webCryptoSha1.js




var webCryptoSha1_Sha1 = /** @class */ (function () {
    function Sha1(secret) {
        this.toHash = new Uint8Array(0);
        if (secret !== void 0) {
            this.key = new Promise(function (resolve, reject) {
                locateWindow()
                    .crypto.subtle.importKey("raw", webCryptoSha1_convertToBuffer(secret), SHA_1_HMAC_ALGO, false, ["sign"])
                    .then(resolve, reject);
            });
            this.key.catch(function () { });
        }
    }
    Sha1.prototype.update = function (data) {
        if (isEmptyData_isEmptyData(data)) {
            return;
        }
        var update = webCryptoSha1_convertToBuffer(data);
        var typedArray = new Uint8Array(this.toHash.byteLength + update.byteLength);
        typedArray.set(this.toHash, 0);
        typedArray.set(update, this.toHash.byteLength);
        this.toHash = typedArray;
    };
    Sha1.prototype.digest = function () {
        var _this = this;
        if (this.key) {
            return this.key.then(function (key) {
                return locateWindow()
                    .crypto.subtle.sign(SHA_1_HMAC_ALGO, key, _this.toHash)
                    .then(function (data) { return new Uint8Array(data); });
            });
        }
        if (isEmptyData_isEmptyData(this.toHash)) {
            return Promise.resolve(EMPTY_DATA_SHA_1);
        }
        return Promise.resolve()
            .then(function () { return locateWindow().crypto.subtle.digest(SHA_1_HASH, _this.toHash); })
            .then(function (data) { return Promise.resolve(new Uint8Array(data)); });
    };
    Sha1.prototype.reset = function () {
        this.toHash = new Uint8Array(0);
    };
    return Sha1;
}());

function webCryptoSha1_convertToBuffer(data) {
    if (typeof data === "string") {
        return fromUtf8(data);
    }
    if (ArrayBuffer.isView(data)) {
        return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
    }
    return new Uint8Array(data);
}
//# sourceMappingURL=webCryptoSha1.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/supports-web-crypto/build/module/supportsWebCrypto.js

var subtleCryptoMethods = [
    "decrypt",
    "digest",
    "encrypt",
    "exportKey",
    "generateKey",
    "importKey",
    "sign",
    "verify"
];
function supportsWebCrypto(window) {
    if (supportsSecureRandom(window) &&
        typeof window.crypto.subtle === "object") {
        var subtle = window.crypto.subtle;
        return supportsSubtleCrypto(subtle);
    }
    return false;
}
function supportsSecureRandom(window) {
    if (typeof window === "object" && typeof window.crypto === "object") {
        var getRandomValues = window.crypto.getRandomValues;
        return typeof getRandomValues === "function";
    }
    return false;
}
function supportsSubtleCrypto(subtle) {
    return (subtle &&
        subtleCryptoMethods.every(function (methodName) { return typeof subtle[methodName] === "function"; }));
}
function supportsZeroByteGCM(subtle) {
    return __awaiter(this, void 0, void 0, function () {
        var key, zeroByteAuthTag, _a;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0:
                    if (!supportsSubtleCrypto(subtle))
                        return [2 /*return*/, false];
                    _b.label = 1;
                case 1:
                    _b.trys.push([1, 4, , 5]);
                    return [4 /*yield*/, subtle.generateKey({ name: "AES-GCM", length: 128 }, false, ["encrypt"])];
                case 2:
                    key = _b.sent();
                    return [4 /*yield*/, subtle.encrypt({
                            name: "AES-GCM",
                            iv: new Uint8Array(Array(12)),
                            additionalData: new Uint8Array(Array(16)),
                            tagLength: 128
                        }, key, new Uint8Array(0))];
                case 3:
                    zeroByteAuthTag = _b.sent();
                    return [2 /*return*/, zeroByteAuthTag.byteLength === 16];
                case 4:
                    _a = _b.sent();
                    return [2 /*return*/, false];
                case 5: return [2 /*return*/];
            }
        });
    });
}
//# sourceMappingURL=supportsWebCrypto.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha1-browser/build/module/crossPlatformSha1.js




var Sha1 = /** @class */ (function () {
    function Sha1(secret) {
        if (supportsWebCrypto(locateWindow())) {
            this.hash = new webCryptoSha1_Sha1(secret);
        }
        else {
            throw new Error("SHA1 not supported");
        }
    }
    Sha1.prototype.update = function (data, encoding) {
        this.hash.update(convertToBuffer(data));
    };
    Sha1.prototype.digest = function () {
        return this.hash.digest();
    };
    Sha1.prototype.reset = function () {
        this.hash.reset();
    };
    return Sha1;
}());

//# sourceMappingURL=crossPlatformSha1.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha1-browser/build/module/index.js


//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha256-browser/build/module/constants.js
var SHA_256_HASH = { name: "SHA-256" };
var SHA_256_HMAC_ALGO = {
    name: "HMAC",
    hash: SHA_256_HASH
};
var EMPTY_DATA_SHA_256 = new Uint8Array([
    227,
    176,
    196,
    66,
    152,
    252,
    28,
    20,
    154,
    251,
    244,
    200,
    153,
    111,
    185,
    36,
    39,
    174,
    65,
    228,
    100,
    155,
    147,
    76,
    164,
    149,
    153,
    27,
    120,
    82,
    184,
    85
]);
//# sourceMappingURL=constants.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha256-browser/build/module/webCryptoSha256.js



var webCryptoSha256_Sha256 = /** @class */ (function () {
    function Sha256(secret) {
        this.toHash = new Uint8Array(0);
        this.secret = secret;
        this.reset();
    }
    Sha256.prototype.update = function (data) {
        if (isEmptyData(data)) {
            return;
        }
        var update = convertToBuffer(data);
        var typedArray = new Uint8Array(this.toHash.byteLength + update.byteLength);
        typedArray.set(this.toHash, 0);
        typedArray.set(update, this.toHash.byteLength);
        this.toHash = typedArray;
    };
    Sha256.prototype.digest = function () {
        var _this = this;
        if (this.key) {
            return this.key.then(function (key) {
                return locateWindow()
                    .crypto.subtle.sign(SHA_256_HMAC_ALGO, key, _this.toHash)
                    .then(function (data) { return new Uint8Array(data); });
            });
        }
        if (isEmptyData(this.toHash)) {
            return Promise.resolve(EMPTY_DATA_SHA_256);
        }
        return Promise.resolve()
            .then(function () {
            return locateWindow().crypto.subtle.digest(SHA_256_HASH, _this.toHash);
        })
            .then(function (data) { return Promise.resolve(new Uint8Array(data)); });
    };
    Sha256.prototype.reset = function () {
        var _this = this;
        this.toHash = new Uint8Array(0);
        if (this.secret && this.secret !== void 0) {
            this.key = new Promise(function (resolve, reject) {
                locateWindow()
                    .crypto.subtle.importKey("raw", convertToBuffer(_this.secret), SHA_256_HMAC_ALGO, false, ["sign"])
                    .then(resolve, reject);
            });
            this.key.catch(function () { });
        }
    };
    return Sha256;
}());

//# sourceMappingURL=webCryptoSha256.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha256-js/build/module/constants.js
/**
 * @internal
 */
var BLOCK_SIZE = 64;
/**
 * @internal
 */
var DIGEST_LENGTH = 32;
/**
 * @internal
 */
var KEY = new Uint32Array([
    0x428a2f98,
    0x71374491,
    0xb5c0fbcf,
    0xe9b5dba5,
    0x3956c25b,
    0x59f111f1,
    0x923f82a4,
    0xab1c5ed5,
    0xd807aa98,
    0x12835b01,
    0x243185be,
    0x550c7dc3,
    0x72be5d74,
    0x80deb1fe,
    0x9bdc06a7,
    0xc19bf174,
    0xe49b69c1,
    0xefbe4786,
    0x0fc19dc6,
    0x240ca1cc,
    0x2de92c6f,
    0x4a7484aa,
    0x5cb0a9dc,
    0x76f988da,
    0x983e5152,
    0xa831c66d,
    0xb00327c8,
    0xbf597fc7,
    0xc6e00bf3,
    0xd5a79147,
    0x06ca6351,
    0x14292967,
    0x27b70a85,
    0x2e1b2138,
    0x4d2c6dfc,
    0x53380d13,
    0x650a7354,
    0x766a0abb,
    0x81c2c92e,
    0x92722c85,
    0xa2bfe8a1,
    0xa81a664b,
    0xc24b8b70,
    0xc76c51a3,
    0xd192e819,
    0xd6990624,
    0xf40e3585,
    0x106aa070,
    0x19a4c116,
    0x1e376c08,
    0x2748774c,
    0x34b0bcb5,
    0x391c0cb3,
    0x4ed8aa4a,
    0x5b9cca4f,
    0x682e6ff3,
    0x748f82ee,
    0x78a5636f,
    0x84c87814,
    0x8cc70208,
    0x90befffa,
    0xa4506ceb,
    0xbef9a3f7,
    0xc67178f2
]);
/**
 * @internal
 */
var INIT = [
    0x6a09e667,
    0xbb67ae85,
    0x3c6ef372,
    0xa54ff53a,
    0x510e527f,
    0x9b05688c,
    0x1f83d9ab,
    0x5be0cd19
];
/**
 * @internal
 */
var MAX_HASHABLE_LENGTH = Math.pow(2, 53) - 1;
//# sourceMappingURL=constants.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha256-js/build/module/RawSha256.js

/**
 * @internal
 */
var RawSha256 = /** @class */ (function () {
    function RawSha256() {
        this.state = Int32Array.from(INIT);
        this.temp = new Int32Array(64);
        this.buffer = new Uint8Array(64);
        this.bufferLength = 0;
        this.bytesHashed = 0;
        /**
         * @internal
         */
        this.finished = false;
    }
    RawSha256.prototype.update = function (data) {
        if (this.finished) {
            throw new Error("Attempted to update an already finished hash.");
        }
        var position = 0;
        var byteLength = data.byteLength;
        this.bytesHashed += byteLength;
        if (this.bytesHashed * 8 > MAX_HASHABLE_LENGTH) {
            throw new Error("Cannot hash more than 2^53 - 1 bits");
        }
        while (byteLength > 0) {
            this.buffer[this.bufferLength++] = data[position++];
            byteLength--;
            if (this.bufferLength === BLOCK_SIZE) {
                this.hashBuffer();
                this.bufferLength = 0;
            }
        }
    };
    RawSha256.prototype.digest = function () {
        if (!this.finished) {
            var bitsHashed = this.bytesHashed * 8;
            var bufferView = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength);
            var undecoratedLength = this.bufferLength;
            bufferView.setUint8(this.bufferLength++, 0x80);
            // Ensure the final block has enough room for the hashed length
            if (undecoratedLength % BLOCK_SIZE >= BLOCK_SIZE - 8) {
                for (var i = this.bufferLength; i < BLOCK_SIZE; i++) {
                    bufferView.setUint8(i, 0);
                }
                this.hashBuffer();
                this.bufferLength = 0;
            }
            for (var i = this.bufferLength; i < BLOCK_SIZE - 8; i++) {
                bufferView.setUint8(i, 0);
            }
            bufferView.setUint32(BLOCK_SIZE - 8, Math.floor(bitsHashed / 0x100000000), true);
            bufferView.setUint32(BLOCK_SIZE - 4, bitsHashed);
            this.hashBuffer();
            this.finished = true;
        }
        // The value in state is little-endian rather than big-endian, so flip
        // each word into a new Uint8Array
        var out = new Uint8Array(DIGEST_LENGTH);
        for (var i = 0; i < 8; i++) {
            out[i * 4] = (this.state[i] >>> 24) & 0xff;
            out[i * 4 + 1] = (this.state[i] >>> 16) & 0xff;
            out[i * 4 + 2] = (this.state[i] >>> 8) & 0xff;
            out[i * 4 + 3] = (this.state[i] >>> 0) & 0xff;
        }
        return out;
    };
    RawSha256.prototype.hashBuffer = function () {
        var _a = this, buffer = _a.buffer, state = _a.state;
        var state0 = state[0], state1 = state[1], state2 = state[2], state3 = state[3], state4 = state[4], state5 = state[5], state6 = state[6], state7 = state[7];
        for (var i = 0; i < BLOCK_SIZE; i++) {
            if (i < 16) {
                this.temp[i] =
                    ((buffer[i * 4] & 0xff) << 24) |
                        ((buffer[i * 4 + 1] & 0xff) << 16) |
                        ((buffer[i * 4 + 2] & 0xff) << 8) |
                        (buffer[i * 4 + 3] & 0xff);
            }
            else {
                var u = this.temp[i - 2];
                var t1_1 = ((u >>> 17) | (u << 15)) ^ ((u >>> 19) | (u << 13)) ^ (u >>> 10);
                u = this.temp[i - 15];
                var t2_1 = ((u >>> 7) | (u << 25)) ^ ((u >>> 18) | (u << 14)) ^ (u >>> 3);
                this.temp[i] =
                    ((t1_1 + this.temp[i - 7]) | 0) + ((t2_1 + this.temp[i - 16]) | 0);
            }
            var t1 = ((((((state4 >>> 6) | (state4 << 26)) ^
                ((state4 >>> 11) | (state4 << 21)) ^
                ((state4 >>> 25) | (state4 << 7))) +
                ((state4 & state5) ^ (~state4 & state6))) |
                0) +
                ((state7 + ((KEY[i] + this.temp[i]) | 0)) | 0)) |
                0;
            var t2 = ((((state0 >>> 2) | (state0 << 30)) ^
                ((state0 >>> 13) | (state0 << 19)) ^
                ((state0 >>> 22) | (state0 << 10))) +
                ((state0 & state1) ^ (state0 & state2) ^ (state1 & state2))) |
                0;
            state7 = state6;
            state6 = state5;
            state5 = state4;
            state4 = (state3 + t1) | 0;
            state3 = state2;
            state2 = state1;
            state1 = state0;
            state0 = (t1 + t2) | 0;
        }
        state[0] += state0;
        state[1] += state1;
        state[2] += state2;
        state[3] += state3;
        state[4] += state4;
        state[5] += state5;
        state[6] += state6;
        state[7] += state7;
    };
    return RawSha256;
}());

//# sourceMappingURL=RawSha256.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha256-js/build/module/jsSha256.js




var jsSha256_Sha256 = /** @class */ (function () {
    function Sha256(secret) {
        this.secret = secret;
        this.hash = new RawSha256();
        this.reset();
    }
    Sha256.prototype.update = function (toHash) {
        if (isEmptyData(toHash) || this.error) {
            return;
        }
        try {
            this.hash.update(convertToBuffer(toHash));
        }
        catch (e) {
            this.error = e;
        }
    };
    /* This synchronous method keeps compatibility
     * with the v2 aws-sdk.
     */
    Sha256.prototype.digestSync = function () {
        if (this.error) {
            throw this.error;
        }
        if (this.outer) {
            if (!this.outer.finished) {
                this.outer.update(this.hash.digest());
            }
            return this.outer.digest();
        }
        return this.hash.digest();
    };
    /* The underlying digest method here is synchronous.
     * To keep the same interface with the other hash functions
     * the default is to expose this as an async method.
     * However, it can sometimes be useful to have a sync method.
     */
    Sha256.prototype.digest = function () {
        return tslib_es6_awaiter(this, void 0, void 0, function () {
            return tslib_es6_generator(this, function (_a) {
                return [2 /*return*/, this.digestSync()];
            });
        });
    };
    Sha256.prototype.reset = function () {
        this.hash = new RawSha256();
        if (this.secret) {
            this.outer = new RawSha256();
            var inner = bufferFromSecret(this.secret);
            var outer = new Uint8Array(BLOCK_SIZE);
            outer.set(inner);
            for (var i = 0; i < BLOCK_SIZE; i++) {
                inner[i] ^= 0x36;
                outer[i] ^= 0x5c;
            }
            this.hash.update(inner);
            this.outer.update(outer);
            // overwrite the copied key in memory
            for (var i = 0; i < inner.byteLength; i++) {
                inner[i] = 0;
            }
        }
    };
    return Sha256;
}());

function bufferFromSecret(secret) {
    var input = convertToBuffer(secret);
    if (input.byteLength > BLOCK_SIZE) {
        var bufferHash = new RawSha256();
        bufferHash.update(input);
        input = bufferHash.digest();
    }
    var buffer = new Uint8Array(BLOCK_SIZE);
    buffer.set(input);
    return buffer;
}
//# sourceMappingURL=jsSha256.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha256-js/build/module/index.js

//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha256-browser/build/module/crossPlatformSha256.js





var Sha256 = /** @class */ (function () {
    function Sha256(secret) {
        if (supportsWebCrypto(locateWindow())) {
            this.hash = new webCryptoSha256_Sha256(secret);
        }
        else {
            this.hash = new jsSha256_Sha256(secret);
        }
    }
    Sha256.prototype.update = function (data, encoding) {
        this.hash.update(convertToBuffer(data));
    };
    Sha256.prototype.digest = function () {
        return this.hash.digest();
    };
    Sha256.prototype.reset = function () {
        this.hash.reset();
    };
    return Sha256;
}());

//# sourceMappingURL=crossPlatformSha256.js.map
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-crypto/sha256-browser/build/module/index.js


//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ../../modules/utils/code/helpers/node_modules/bowser/es5.js
var es5 = __webpack_require__(1981);
var es5_default = /*#__PURE__*/__webpack_require__.n(es5);
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js

const createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => async (config) => {
    const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent
        ? es5_default().parse(window.navigator.userAgent)
        : undefined;
    const sections = [
        ["aws-sdk-js", clientVersion],
        ["ua", "2.1"],
        [`os/${parsedUA?.os?.name || "other"}`, parsedUA?.os?.version],
        ["lang/js"],
        ["md/browser", `${parsedUA?.browser?.name ?? "unknown"}_${parsedUA?.browser?.version ?? "unknown"}`],
    ];
    if (serviceId) {
        sections.push([`api/${serviceId}`, clientVersion]);
    }
    const appId = await config?.userAgentAppId?.();
    if (appId) {
        sections.push([`app/${appId}`]);
    }
    return sections;
};
const defaultUserAgent = (/* unused pure expression or super */ null && (createDefaultUserAgentProvider));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-codec/dist-es/Int64.js

class Int64_Int64 {
    constructor(bytes) {
        this.bytes = bytes;
        if (bytes.byteLength !== 8) {
            throw new Error("Int64 buffers must be exactly 8 bytes");
        }
    }
    static fromNumber(number) {
        if (number > 9223372036854776000 || number < -9223372036854776000) {
            throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);
        }
        const bytes = new Uint8Array(8);
        for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {
            bytes[i] = remaining;
        }
        if (number < 0) {
            Int64_negate(bytes);
        }
        return new Int64_Int64(bytes);
    }
    valueOf() {
        const bytes = this.bytes.slice(0);
        const negative = bytes[0] & 0b10000000;
        if (negative) {
            Int64_negate(bytes);
        }
        return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
    }
    toString() {
        return String(this.valueOf());
    }
}
function Int64_negate(bytes) {
    for (let i = 0; i < 8; i++) {
        bytes[i] ^= 0xff;
    }
    for (let i = 7; i > -1; i--) {
        bytes[i]++;
        if (bytes[i] !== 0)
            break;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-codec/dist-es/HeaderMarshaller.js


class HeaderMarshaller {
    constructor(toUtf8, fromUtf8) {
        this.toUtf8 = toUtf8;
        this.fromUtf8 = fromUtf8;
    }
    format(headers) {
        const chunks = [];
        for (const headerName of Object.keys(headers)) {
            const bytes = this.fromUtf8(headerName);
            chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
        }
        const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));
        let position = 0;
        for (const chunk of chunks) {
            out.set(chunk, position);
            position += chunk.byteLength;
        }
        return out;
    }
    formatHeaderValue(header) {
        switch (header.type) {
            case "boolean":
                return Uint8Array.from([header.value ? 0 : 1]);
            case "byte":
                return Uint8Array.from([2, header.value]);
            case "short":
                const shortView = new DataView(new ArrayBuffer(3));
                shortView.setUint8(0, 3);
                shortView.setInt16(1, header.value, false);
                return new Uint8Array(shortView.buffer);
            case "integer":
                const intView = new DataView(new ArrayBuffer(5));
                intView.setUint8(0, 4);
                intView.setInt32(1, header.value, false);
                return new Uint8Array(intView.buffer);
            case "long":
                const longBytes = new Uint8Array(9);
                longBytes[0] = 5;
                longBytes.set(header.value.bytes, 1);
                return longBytes;
            case "binary":
                const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
                binView.setUint8(0, 6);
                binView.setUint16(1, header.value.byteLength, false);
                const binBytes = new Uint8Array(binView.buffer);
                binBytes.set(header.value, 3);
                return binBytes;
            case "string":
                const utf8Bytes = this.fromUtf8(header.value);
                const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
                strView.setUint8(0, 7);
                strView.setUint16(1, utf8Bytes.byteLength, false);
                const strBytes = new Uint8Array(strView.buffer);
                strBytes.set(utf8Bytes, 3);
                return strBytes;
            case "timestamp":
                const tsBytes = new Uint8Array(9);
                tsBytes[0] = 8;
                tsBytes.set(Int64_Int64.fromNumber(header.value.valueOf()).bytes, 1);
                return tsBytes;
            case "uuid":
                if (!HeaderMarshaller_UUID_PATTERN.test(header.value)) {
                    throw new Error(`Invalid UUID received: ${header.value}`);
                }
                const uuidBytes = new Uint8Array(17);
                uuidBytes[0] = 9;
                uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
                return uuidBytes;
        }
    }
    parse(headers) {
        const out = {};
        let position = 0;
        while (position < headers.byteLength) {
            const nameLength = headers.getUint8(position++);
            const name = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));
            position += nameLength;
            switch (headers.getUint8(position++)) {
                case 0:
                    out[name] = {
                        type: BOOLEAN_TAG,
                        value: true,
                    };
                    break;
                case 1:
                    out[name] = {
                        type: BOOLEAN_TAG,
                        value: false,
                    };
                    break;
                case 2:
                    out[name] = {
                        type: BYTE_TAG,
                        value: headers.getInt8(position++),
                    };
                    break;
                case 3:
                    out[name] = {
                        type: SHORT_TAG,
                        value: headers.getInt16(position, false),
                    };
                    position += 2;
                    break;
                case 4:
                    out[name] = {
                        type: INT_TAG,
                        value: headers.getInt32(position, false),
                    };
                    position += 4;
                    break;
                case 5:
                    out[name] = {
                        type: LONG_TAG,
                        value: new Int64_Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)),
                    };
                    position += 8;
                    break;
                case 6:
                    const binaryLength = headers.getUint16(position, false);
                    position += 2;
                    out[name] = {
                        type: BINARY_TAG,
                        value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength),
                    };
                    position += binaryLength;
                    break;
                case 7:
                    const stringLength = headers.getUint16(position, false);
                    position += 2;
                    out[name] = {
                        type: STRING_TAG,
                        value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength)),
                    };
                    position += stringLength;
                    break;
                case 8:
                    out[name] = {
                        type: TIMESTAMP_TAG,
                        value: new Date(new Int64_Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf()),
                    };
                    position += 8;
                    break;
                case 9:
                    const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);
                    position += 16;
                    out[name] = {
                        type: UUID_TAG,
                        value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`,
                    };
                    break;
                default:
                    throw new Error(`Unrecognized header type tag`);
            }
        }
        return out;
    }
}
var HeaderMarshaller_HEADER_VALUE_TYPE;
(function (HEADER_VALUE_TYPE) {
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolTrue"] = 0] = "boolTrue";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["boolFalse"] = 1] = "boolFalse";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byte"] = 2] = "byte";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["short"] = 3] = "short";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["integer"] = 4] = "integer";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["long"] = 5] = "long";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["byteArray"] = 6] = "byteArray";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["string"] = 7] = "string";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["timestamp"] = 8] = "timestamp";
    HEADER_VALUE_TYPE[HEADER_VALUE_TYPE["uuid"] = 9] = "uuid";
})(HeaderMarshaller_HEADER_VALUE_TYPE || (HeaderMarshaller_HEADER_VALUE_TYPE = {}));
const BOOLEAN_TAG = "boolean";
const BYTE_TAG = "byte";
const SHORT_TAG = "short";
const INT_TAG = "integer";
const LONG_TAG = "long";
const BINARY_TAG = "binary";
const STRING_TAG = "string";
const TIMESTAMP_TAG = "timestamp";
const UUID_TAG = "uuid";
const HeaderMarshaller_UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-codec/dist-es/splitMessage.js

const PRELUDE_MEMBER_LENGTH = 4;
const PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;
const CHECKSUM_LENGTH = 4;
const MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2;
function splitMessage({ byteLength, byteOffset, buffer }) {
    if (byteLength < MINIMUM_MESSAGE_LENGTH) {
        throw new Error("Provided message too short to accommodate event stream message overhead");
    }
    const view = new DataView(buffer, byteOffset, byteLength);
    const messageLength = view.getUint32(0, false);
    if (byteLength !== messageLength) {
        throw new Error("Reported message length does not match received message length");
    }
    const headerLength = view.getUint32(PRELUDE_MEMBER_LENGTH, false);
    const expectedPreludeChecksum = view.getUint32(PRELUDE_LENGTH, false);
    const expectedMessageChecksum = view.getUint32(byteLength - CHECKSUM_LENGTH, false);
    const checksummer = new Crc32().update(new Uint8Array(buffer, byteOffset, PRELUDE_LENGTH));
    if (expectedPreludeChecksum !== checksummer.digest()) {
        throw new Error(`The prelude checksum specified in the message (${expectedPreludeChecksum}) does not match the calculated CRC32 checksum (${checksummer.digest()})`);
    }
    checksummer.update(new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH, byteLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH)));
    if (expectedMessageChecksum !== checksummer.digest()) {
        throw new Error(`The message checksum (${checksummer.digest()}) did not match the expected value of ${expectedMessageChecksum}`);
    }
    return {
        headers: new DataView(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH, headerLength),
        body: new Uint8Array(buffer, byteOffset + PRELUDE_LENGTH + CHECKSUM_LENGTH + headerLength, messageLength - headerLength - (PRELUDE_LENGTH + CHECKSUM_LENGTH + CHECKSUM_LENGTH)),
    };
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-codec/dist-es/EventStreamCodec.js



class EventStreamCodec {
    constructor(toUtf8, fromUtf8) {
        this.headerMarshaller = new HeaderMarshaller(toUtf8, fromUtf8);
        this.messageBuffer = [];
        this.isEndOfStream = false;
    }
    feed(message) {
        this.messageBuffer.push(this.decode(message));
    }
    endOfStream() {
        this.isEndOfStream = true;
    }
    getMessage() {
        const message = this.messageBuffer.pop();
        const isEndOfStream = this.isEndOfStream;
        return {
            getMessage() {
                return message;
            },
            isEndOfStream() {
                return isEndOfStream;
            },
        };
    }
    getAvailableMessages() {
        const messages = this.messageBuffer;
        this.messageBuffer = [];
        const isEndOfStream = this.isEndOfStream;
        return {
            getMessages() {
                return messages;
            },
            isEndOfStream() {
                return isEndOfStream;
            },
        };
    }
    encode({ headers: rawHeaders, body }) {
        const headers = this.headerMarshaller.format(rawHeaders);
        const length = headers.byteLength + body.byteLength + 16;
        const out = new Uint8Array(length);
        const view = new DataView(out.buffer, out.byteOffset, out.byteLength);
        const checksum = new Crc32();
        view.setUint32(0, length, false);
        view.setUint32(4, headers.byteLength, false);
        view.setUint32(8, checksum.update(out.subarray(0, 8)).digest(), false);
        out.set(headers, 12);
        out.set(body, headers.byteLength + 12);
        view.setUint32(length - 4, checksum.update(out.subarray(8, length - 4)).digest(), false);
        return out;
    }
    decode(message) {
        const { headers, body } = splitMessage(message);
        return { headers: this.headerMarshaller.parse(headers), body };
    }
    formatHeaders(rawHeaders) {
        return this.headerMarshaller.format(rawHeaders);
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-codec/dist-es/MessageDecoderStream.js
class MessageDecoderStream {
    constructor(options) {
        this.options = options;
    }
    [Symbol.asyncIterator]() {
        return this.asyncIterator();
    }
    async *asyncIterator() {
        for await (const bytes of this.options.inputStream) {
            const decoded = this.options.decoder.decode(bytes);
            yield decoded;
        }
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js
class MessageEncoderStream {
    constructor(options) {
        this.options = options;
    }
    [Symbol.asyncIterator]() {
        return this.asyncIterator();
    }
    async *asyncIterator() {
        for await (const msg of this.options.messageStream) {
            const encoded = this.options.encoder.encode(msg);
            yield encoded;
        }
        if (this.options.includeEndFrame) {
            yield new Uint8Array(0);
        }
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageDecoderStream.js
class SmithyMessageDecoderStream {
    constructor(options) {
        this.options = options;
    }
    [Symbol.asyncIterator]() {
        return this.asyncIterator();
    }
    async *asyncIterator() {
        for await (const message of this.options.messageStream) {
            const deserialized = await this.options.deserializer(message);
            if (deserialized === undefined)
                continue;
            yield deserialized;
        }
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-codec/dist-es/SmithyMessageEncoderStream.js
class SmithyMessageEncoderStream {
    constructor(options) {
        this.options = options;
    }
    [Symbol.asyncIterator]() {
        return this.asyncIterator();
    }
    async *asyncIterator() {
        for await (const chunk of this.options.inputStream) {
            const payloadBuf = this.options.serializer(chunk);
            yield payloadBuf;
        }
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-codec/dist-es/index.js









;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-serde-universal/dist-es/getChunkedStream.js
function getChunkedStream(source) {
    let currentMessageTotalLength = 0;
    let currentMessagePendingLength = 0;
    let currentMessage = null;
    let messageLengthBuffer = null;
    const allocateMessage = (size) => {
        if (typeof size !== "number") {
            throw new Error("Attempted to allocate an event message where size was not a number: " + size);
        }
        currentMessageTotalLength = size;
        currentMessagePendingLength = 4;
        currentMessage = new Uint8Array(size);
        const currentMessageView = new DataView(currentMessage.buffer);
        currentMessageView.setUint32(0, size, false);
    };
    const iterator = async function* () {
        const sourceIterator = source[Symbol.asyncIterator]();
        while (true) {
            const { value, done } = await sourceIterator.next();
            if (done) {
                if (!currentMessageTotalLength) {
                    return;
                }
                else if (currentMessageTotalLength === currentMessagePendingLength) {
                    yield currentMessage;
                }
                else {
                    throw new Error("Truncated event message received.");
                }
                return;
            }
            const chunkLength = value.length;
            let currentOffset = 0;
            while (currentOffset < chunkLength) {
                if (!currentMessage) {
                    const bytesRemaining = chunkLength - currentOffset;
                    if (!messageLengthBuffer) {
                        messageLengthBuffer = new Uint8Array(4);
                    }
                    const numBytesForTotal = Math.min(4 - currentMessagePendingLength, bytesRemaining);
                    messageLengthBuffer.set(value.slice(currentOffset, currentOffset + numBytesForTotal), currentMessagePendingLength);
                    currentMessagePendingLength += numBytesForTotal;
                    currentOffset += numBytesForTotal;
                    if (currentMessagePendingLength < 4) {
                        break;
                    }
                    allocateMessage(new DataView(messageLengthBuffer.buffer).getUint32(0, false));
                    messageLengthBuffer = null;
                }
                const numBytesToWrite = Math.min(currentMessageTotalLength - currentMessagePendingLength, chunkLength - currentOffset);
                currentMessage.set(value.slice(currentOffset, currentOffset + numBytesToWrite), currentMessagePendingLength);
                currentMessagePendingLength += numBytesToWrite;
                currentOffset += numBytesToWrite;
                if (currentMessageTotalLength && currentMessageTotalLength === currentMessagePendingLength) {
                    yield currentMessage;
                    currentMessage = null;
                    currentMessageTotalLength = 0;
                    currentMessagePendingLength = 0;
                }
            }
        }
    };
    return {
        [Symbol.asyncIterator]: iterator,
    };
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-serde-universal/dist-es/getUnmarshalledStream.js
function getUnmarshalledStream(source, options) {
    const messageUnmarshaller = getMessageUnmarshaller(options.deserializer, options.toUtf8);
    return {
        [Symbol.asyncIterator]: async function* () {
            for await (const chunk of source) {
                const message = options.eventStreamCodec.decode(chunk);
                const type = await messageUnmarshaller(message);
                if (type === undefined)
                    continue;
                yield type;
            }
        },
    };
}
function getMessageUnmarshaller(deserializer, toUtf8) {
    return async function (message) {
        const { value: messageType } = message.headers[":message-type"];
        if (messageType === "error") {
            const unmodeledError = new Error(message.headers[":error-message"].value || "UnknownError");
            unmodeledError.name = message.headers[":error-code"].value;
            throw unmodeledError;
        }
        else if (messageType === "exception") {
            const code = message.headers[":exception-type"].value;
            const exception = { [code]: message };
            const deserializedException = await deserializer(exception);
            if (deserializedException.$unknown) {
                const error = new Error(toUtf8(message.body));
                error.name = code;
                throw error;
            }
            throw deserializedException[code];
        }
        else if (messageType === "event") {
            const event = {
                [message.headers[":event-type"].value]: message,
            };
            const deserialized = await deserializer(event);
            if (deserialized.$unknown)
                return;
            return deserialized;
        }
        else {
            throw Error(`Unrecognizable event type: ${message.headers[":event-type"].value}`);
        }
    };
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-serde-universal/dist-es/EventStreamMarshaller.js



class EventStreamMarshaller_EventStreamMarshaller {
    constructor({ utf8Encoder, utf8Decoder }) {
        this.eventStreamCodec = new EventStreamCodec(utf8Encoder, utf8Decoder);
        this.utfEncoder = utf8Encoder;
    }
    deserialize(body, deserializer) {
        const inputStream = getChunkedStream(body);
        return new SmithyMessageDecoderStream({
            messageStream: new MessageDecoderStream({ inputStream, decoder: this.eventStreamCodec }),
            deserializer: getMessageUnmarshaller(deserializer, this.utfEncoder),
        });
    }
    serialize(inputStream, serializer) {
        return new MessageEncoderStream({
            messageStream: new SmithyMessageEncoderStream({ inputStream, serializer }),
            encoder: this.eventStreamCodec,
            includeEndFrame: true,
        });
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-serde-universal/dist-es/provider.js

const eventStreamSerdeProvider = (options) => new EventStreamMarshaller(options);

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-serde-universal/dist-es/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-serde-browser/dist-es/utils.js
const readableStreamtoIterable = (readableStream) => ({
    [Symbol.asyncIterator]: async function* () {
        const reader = readableStream.getReader();
        try {
            while (true) {
                const { done, value } = await reader.read();
                if (done)
                    return;
                yield value;
            }
        }
        finally {
            reader.releaseLock();
        }
    },
});
const iterableToReadableStream = (asyncIterable) => {
    const iterator = asyncIterable[Symbol.asyncIterator]();
    return new ReadableStream({
        async pull(controller) {
            const { done, value } = await iterator.next();
            if (done) {
                return controller.close();
            }
            controller.enqueue(value);
        },
    });
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-serde-browser/dist-es/EventStreamMarshaller.js


class dist_es_EventStreamMarshaller_EventStreamMarshaller {
    constructor({ utf8Encoder, utf8Decoder }) {
        this.universalMarshaller = new EventStreamMarshaller_EventStreamMarshaller({
            utf8Decoder,
            utf8Encoder,
        });
    }
    deserialize(body, deserializer) {
        const bodyIterable = EventStreamMarshaller_isReadableStream(body) ? readableStreamtoIterable(body) : body;
        return this.universalMarshaller.deserialize(bodyIterable, deserializer);
    }
    serialize(input, serializer) {
        const serialziedIterable = this.universalMarshaller.serialize(input, serializer);
        return typeof ReadableStream === "function" ? iterableToReadableStream(serialziedIterable) : serialziedIterable;
    }
}
const EventStreamMarshaller_isReadableStream = (body) => typeof ReadableStream === "function" && body instanceof ReadableStream;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-serde-browser/dist-es/provider.js

const provider_eventStreamSerdeProvider = (options) => new dist_es_EventStreamMarshaller_EventStreamMarshaller(options);

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/eventstream-serde-browser/dist-es/index.js




;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/chunked-blob-reader/dist-es/index.js
async function blobReader(blob, onChunk, chunkSize = 1024 * 1024) {
    const size = blob.size;
    let totalBytesRead = 0;
    while (totalBytesRead < size) {
        const slice = blob.slice(totalBytesRead, Math.min(size, totalBytesRead + chunkSize));
        onChunk(new Uint8Array(await slice.arrayBuffer()));
        totalBytesRead += slice.size;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/hash-blob-browser/dist-es/index.js

const blobHasher = async function blobHasher(hashCtor, blob) {
    const hash = new hashCtor();
    await blobReader(blob, (chunk) => {
        hash.update(chunk);
    });
    return hash.digest();
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/invalid-dependency/dist-es/invalidProvider.js
const invalidProvider = (message) => () => Promise.reject(message);

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/md5-js/dist-es/constants.js
const constants_BLOCK_SIZE = 64;
const constants_DIGEST_LENGTH = 16;
const constants_INIT = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476];

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/md5-js/dist-es/index.js


class Md5 {
    constructor() {
        this.reset();
    }
    update(sourceData) {
        if (dist_es_isEmptyData(sourceData)) {
            return;
        }
        else if (this.finished) {
            throw new Error("Attempted to update an already finished hash.");
        }
        const data = dist_es_convertToBuffer(sourceData);
        let position = 0;
        let { byteLength } = data;
        this.bytesHashed += byteLength;
        while (byteLength > 0) {
            this.buffer.setUint8(this.bufferLength++, data[position++]);
            byteLength--;
            if (this.bufferLength === constants_BLOCK_SIZE) {
                this.hashBuffer();
                this.bufferLength = 0;
            }
        }
    }
    async digest() {
        if (!this.finished) {
            const { buffer, bufferLength: undecoratedLength, bytesHashed } = this;
            const bitsHashed = bytesHashed * 8;
            buffer.setUint8(this.bufferLength++, 0b10000000);
            if (undecoratedLength % constants_BLOCK_SIZE >= constants_BLOCK_SIZE - 8) {
                for (let i = this.bufferLength; i < constants_BLOCK_SIZE; i++) {
                    buffer.setUint8(i, 0);
                }
                this.hashBuffer();
                this.bufferLength = 0;
            }
            for (let i = this.bufferLength; i < constants_BLOCK_SIZE - 8; i++) {
                buffer.setUint8(i, 0);
            }
            buffer.setUint32(constants_BLOCK_SIZE - 8, bitsHashed >>> 0, true);
            buffer.setUint32(constants_BLOCK_SIZE - 4, Math.floor(bitsHashed / 0x100000000), true);
            this.hashBuffer();
            this.finished = true;
        }
        const out = new DataView(new ArrayBuffer(constants_DIGEST_LENGTH));
        for (let i = 0; i < 4; i++) {
            out.setUint32(i * 4, this.state[i], true);
        }
        return new Uint8Array(out.buffer, out.byteOffset, out.byteLength);
    }
    hashBuffer() {
        const { buffer, state } = this;
        let a = state[0], b = state[1], c = state[2], d = state[3];
        a = ff(a, b, c, d, buffer.getUint32(0, true), 7, 0xd76aa478);
        d = ff(d, a, b, c, buffer.getUint32(4, true), 12, 0xe8c7b756);
        c = ff(c, d, a, b, buffer.getUint32(8, true), 17, 0x242070db);
        b = ff(b, c, d, a, buffer.getUint32(12, true), 22, 0xc1bdceee);
        a = ff(a, b, c, d, buffer.getUint32(16, true), 7, 0xf57c0faf);
        d = ff(d, a, b, c, buffer.getUint32(20, true), 12, 0x4787c62a);
        c = ff(c, d, a, b, buffer.getUint32(24, true), 17, 0xa8304613);
        b = ff(b, c, d, a, buffer.getUint32(28, true), 22, 0xfd469501);
        a = ff(a, b, c, d, buffer.getUint32(32, true), 7, 0x698098d8);
        d = ff(d, a, b, c, buffer.getUint32(36, true), 12, 0x8b44f7af);
        c = ff(c, d, a, b, buffer.getUint32(40, true), 17, 0xffff5bb1);
        b = ff(b, c, d, a, buffer.getUint32(44, true), 22, 0x895cd7be);
        a = ff(a, b, c, d, buffer.getUint32(48, true), 7, 0x6b901122);
        d = ff(d, a, b, c, buffer.getUint32(52, true), 12, 0xfd987193);
        c = ff(c, d, a, b, buffer.getUint32(56, true), 17, 0xa679438e);
        b = ff(b, c, d, a, buffer.getUint32(60, true), 22, 0x49b40821);
        a = gg(a, b, c, d, buffer.getUint32(4, true), 5, 0xf61e2562);
        d = gg(d, a, b, c, buffer.getUint32(24, true), 9, 0xc040b340);
        c = gg(c, d, a, b, buffer.getUint32(44, true), 14, 0x265e5a51);
        b = gg(b, c, d, a, buffer.getUint32(0, true), 20, 0xe9b6c7aa);
        a = gg(a, b, c, d, buffer.getUint32(20, true), 5, 0xd62f105d);
        d = gg(d, a, b, c, buffer.getUint32(40, true), 9, 0x02441453);
        c = gg(c, d, a, b, buffer.getUint32(60, true), 14, 0xd8a1e681);
        b = gg(b, c, d, a, buffer.getUint32(16, true), 20, 0xe7d3fbc8);
        a = gg(a, b, c, d, buffer.getUint32(36, true), 5, 0x21e1cde6);
        d = gg(d, a, b, c, buffer.getUint32(56, true), 9, 0xc33707d6);
        c = gg(c, d, a, b, buffer.getUint32(12, true), 14, 0xf4d50d87);
        b = gg(b, c, d, a, buffer.getUint32(32, true), 20, 0x455a14ed);
        a = gg(a, b, c, d, buffer.getUint32(52, true), 5, 0xa9e3e905);
        d = gg(d, a, b, c, buffer.getUint32(8, true), 9, 0xfcefa3f8);
        c = gg(c, d, a, b, buffer.getUint32(28, true), 14, 0x676f02d9);
        b = gg(b, c, d, a, buffer.getUint32(48, true), 20, 0x8d2a4c8a);
        a = hh(a, b, c, d, buffer.getUint32(20, true), 4, 0xfffa3942);
        d = hh(d, a, b, c, buffer.getUint32(32, true), 11, 0x8771f681);
        c = hh(c, d, a, b, buffer.getUint32(44, true), 16, 0x6d9d6122);
        b = hh(b, c, d, a, buffer.getUint32(56, true), 23, 0xfde5380c);
        a = hh(a, b, c, d, buffer.getUint32(4, true), 4, 0xa4beea44);
        d = hh(d, a, b, c, buffer.getUint32(16, true), 11, 0x4bdecfa9);
        c = hh(c, d, a, b, buffer.getUint32(28, true), 16, 0xf6bb4b60);
        b = hh(b, c, d, a, buffer.getUint32(40, true), 23, 0xbebfbc70);
        a = hh(a, b, c, d, buffer.getUint32(52, true), 4, 0x289b7ec6);
        d = hh(d, a, b, c, buffer.getUint32(0, true), 11, 0xeaa127fa);
        c = hh(c, d, a, b, buffer.getUint32(12, true), 16, 0xd4ef3085);
        b = hh(b, c, d, a, buffer.getUint32(24, true), 23, 0x04881d05);
        a = hh(a, b, c, d, buffer.getUint32(36, true), 4, 0xd9d4d039);
        d = hh(d, a, b, c, buffer.getUint32(48, true), 11, 0xe6db99e5);
        c = hh(c, d, a, b, buffer.getUint32(60, true), 16, 0x1fa27cf8);
        b = hh(b, c, d, a, buffer.getUint32(8, true), 23, 0xc4ac5665);
        a = ii(a, b, c, d, buffer.getUint32(0, true), 6, 0xf4292244);
        d = ii(d, a, b, c, buffer.getUint32(28, true), 10, 0x432aff97);
        c = ii(c, d, a, b, buffer.getUint32(56, true), 15, 0xab9423a7);
        b = ii(b, c, d, a, buffer.getUint32(20, true), 21, 0xfc93a039);
        a = ii(a, b, c, d, buffer.getUint32(48, true), 6, 0x655b59c3);
        d = ii(d, a, b, c, buffer.getUint32(12, true), 10, 0x8f0ccc92);
        c = ii(c, d, a, b, buffer.getUint32(40, true), 15, 0xffeff47d);
        b = ii(b, c, d, a, buffer.getUint32(4, true), 21, 0x85845dd1);
        a = ii(a, b, c, d, buffer.getUint32(32, true), 6, 0x6fa87e4f);
        d = ii(d, a, b, c, buffer.getUint32(60, true), 10, 0xfe2ce6e0);
        c = ii(c, d, a, b, buffer.getUint32(24, true), 15, 0xa3014314);
        b = ii(b, c, d, a, buffer.getUint32(52, true), 21, 0x4e0811a1);
        a = ii(a, b, c, d, buffer.getUint32(16, true), 6, 0xf7537e82);
        d = ii(d, a, b, c, buffer.getUint32(44, true), 10, 0xbd3af235);
        c = ii(c, d, a, b, buffer.getUint32(8, true), 15, 0x2ad7d2bb);
        b = ii(b, c, d, a, buffer.getUint32(36, true), 21, 0xeb86d391);
        state[0] = (a + state[0]) & 0xffffffff;
        state[1] = (b + state[1]) & 0xffffffff;
        state[2] = (c + state[2]) & 0xffffffff;
        state[3] = (d + state[3]) & 0xffffffff;
    }
    reset() {
        this.state = Uint32Array.from(constants_INIT);
        this.buffer = new DataView(new ArrayBuffer(constants_BLOCK_SIZE));
        this.bufferLength = 0;
        this.bytesHashed = 0;
        this.finished = false;
    }
}
function cmn(q, a, b, x, s, t) {
    a = (((a + q) & 0xffffffff) + ((x + t) & 0xffffffff)) & 0xffffffff;
    return (((a << s) | (a >>> (32 - s))) + b) & 0xffffffff;
}
function ff(a, b, c, d, x, s, t) {
    return cmn((b & c) | (~b & d), a, b, x, s, t);
}
function gg(a, b, c, d, x, s, t) {
    return cmn((b & d) | (c & ~d), a, b, x, s, t);
}
function hh(a, b, c, d, x, s, t) {
    return cmn(b ^ c ^ d, a, b, x, s, t);
}
function ii(a, b, c, d, x, s, t) {
    return cmn(c ^ (b | ~d), a, b, x, s, t);
}
function dist_es_isEmptyData(data) {
    if (typeof data === "string") {
        return data.length === 0;
    }
    return data.byteLength === 0;
}
function dist_es_convertToBuffer(data) {
    if (typeof data === "string") {
        return fromUtf8(data);
    }
    if (ArrayBuffer.isView(data)) {
        return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
    }
    return new Uint8Array(data);
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-body-length-browser/dist-es/calculateBodyLength.js
const TEXT_ENCODER = typeof TextEncoder == "function" ? new TextEncoder() : null;
const calculateBodyLength = (body) => {
    if (typeof body === "string") {
        if (TEXT_ENCODER) {
            return TEXT_ENCODER.encode(body).byteLength;
        }
        let len = body.length;
        for (let i = len - 1; i >= 0; i--) {
            const code = body.charCodeAt(i);
            if (code > 0x7f && code <= 0x7ff)
                len++;
            else if (code > 0x7ff && code <= 0xffff)
                len += 2;
            if (code >= 0xdc00 && code <= 0xdfff)
                i--;
        }
        return len;
    }
    else if (typeof body.byteLength === "number") {
        return body.byteLength;
    }
    else if (typeof body.size === "number") {
        return body.size;
    }
    throw new Error(`Body Length computation failed for ${body}`);
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-body-length-browser/dist-es/index.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js
const getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js

const getDateHeader = (response) => httpResponse_HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : undefined;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js

const isClockSkewed = (clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 300000;

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js

const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => {
    const clockTimeInMs = Date.parse(clockTime);
    if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
        return clockTimeInMs - Date.now();
    }
    return currentSystemClockOffset;
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js


const throwSigningPropertyError = (name, property) => {
    if (!property) {
        throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
    }
    return property;
};
const validateSigningProperties = async (signingProperties) => {
    const context = throwSigningPropertyError("context", signingProperties.context);
    const config = throwSigningPropertyError("config", signingProperties.config);
    const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
    const signerFunction = throwSigningPropertyError("signer", config.signer);
    const signer = await signerFunction(authScheme);
    const signingRegion = signingProperties?.signingRegion;
    const signingRegionSet = signingProperties?.signingRegionSet;
    const signingName = signingProperties?.signingName;
    return {
        config,
        signer,
        signingRegion,
        signingRegionSet,
        signingName,
    };
};
class AwsSdkSigV4Signer {
    async sign(httpRequest, identity, signingProperties) {
        if (!httpRequest_HttpRequest.isInstance(httpRequest)) {
            throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
        }
        const validatedProps = await validateSigningProperties(signingProperties);
        const { config, signer } = validatedProps;
        let { signingRegion, signingName } = validatedProps;
        const handlerExecutionContext = signingProperties.context;
        if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {
            const [first, second] = handlerExecutionContext.authSchemes;
            if (first?.name === "sigv4a" && second?.name === "sigv4") {
                signingRegion = second?.signingRegion ?? signingRegion;
                signingName = second?.signingName ?? signingName;
            }
        }
        const signedRequest = await signer.sign(httpRequest, {
            signingDate: getSkewCorrectedDate(config.systemClockOffset),
            signingRegion: signingRegion,
            signingService: signingName,
        });
        return signedRequest;
    }
    errorHandler(signingProperties) {
        return (error) => {
            const serverTime = error.ServerTime ?? getDateHeader(error.$response);
            if (serverTime) {
                const config = throwSigningPropertyError("config", signingProperties.config);
                const initialSystemClockOffset = config.systemClockOffset;
                config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
                const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
                if (clockSkewCorrected && error.$metadata) {
                    error.$metadata.clockSkewCorrected = true;
                }
            }
            throw error;
        };
    }
    successHandler(httpResponse, signingProperties) {
        const dateHeader = getDateHeader(httpResponse);
        if (dateHeader) {
            const config = throwSigningPropertyError("config", signingProperties.config);
            config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
        }
    }
}
const AWSSDKSigV4Signer = (/* unused pure expression or super */ null && (AwsSdkSigV4Signer));

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.js



class AwsSdkSigV4ASigner extends AwsSdkSigV4Signer {
    async sign(httpRequest, identity, signingProperties) {
        if (!httpRequest_HttpRequest.isInstance(httpRequest)) {
            throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
        }
        const { config, signer, signingRegion, signingRegionSet, signingName } = await validateSigningProperties(signingProperties);
        const configResolvedSigningRegionSet = await config.sigv4aSigningRegionSet?.();
        const multiRegionOverride = (configResolvedSigningRegionSet ??
            signingRegionSet ?? [signingRegion]).join(",");
        const signedRequest = await signer.sign(httpRequest, {
            signingDate: getSkewCorrectedDate(config.systemClockOffset),
            signingRegion: multiRegionOverride,
            signingService: signingName,
        });
        return signedRequest;
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.shared.js









const getRuntimeConfig = (config) => {
    return {
        apiVersion: "2006-03-01",
        base64Decoder: config?.base64Decoder ?? fromBase64,
        base64Encoder: config?.base64Encoder ?? toBase64_browser_toBase64,
        disableHostPrefix: config?.disableHostPrefix ?? false,
        endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
        extensions: config?.extensions ?? [],
        getAwsChunkedEncodingStream: config?.getAwsChunkedEncodingStream ?? getAwsChunkedEncodingStream,
        httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultS3HttpAuthSchemeProvider,
        httpAuthSchemes: config?.httpAuthSchemes ?? [
            {
                schemeId: "aws.auth#sigv4",
                identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
                signer: new AwsSdkSigV4Signer(),
            },
            {
                schemeId: "aws.auth#sigv4a",
                identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
                signer: new AwsSdkSigV4ASigner(),
            },
        ],
        logger: config?.logger ?? new NoOpLogger_NoOpLogger(),
        sdkStreamMixin: config?.sdkStreamMixin ?? sdkStreamMixin,
        serviceId: config?.serviceId ?? "S3",
        signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
        signingEscapePath: config?.signingEscapePath ?? false,
        urlParser: config?.urlParser ?? parseUrl,
        useArnRegion: config?.useArnRegion ?? false,
        utf8Decoder: config?.utf8Decoder ?? fromUtf8,
        utf8Encoder: config?.utf8Encoder ?? toUtf8,
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-defaults-mode-browser/dist-es/constants.js
const DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"];

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js



const resolveDefaultsModeConfig = ({ defaultsMode, } = {}) => dist_es_memoize_memoize(async () => {
    const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
    switch (mode?.toLowerCase()) {
        case "auto":
            return Promise.resolve(isMobileBrowser() ? "mobile" : "standard");
        case "mobile":
        case "in-region":
        case "cross-region":
        case "standard":
        case "legacy":
            return Promise.resolve(mode?.toLocaleLowerCase());
        case undefined:
            return Promise.resolve("legacy");
        default:
            throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`);
    }
});
const isMobileBrowser = () => {
    const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent
        ? es5_default().parse(window.navigator.userAgent)
        : undefined;
    const platform = parsedUA?.platform?.type;
    return platform === "tablet" || platform === "mobile";
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@smithy/util-defaults-mode-browser/dist-es/index.js


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.browser.js















const runtimeConfig_browser_getRuntimeConfig = (config) => {
    const defaultsMode = resolveDefaultsModeConfig(config);
    const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
    const clientSharedValues = getRuntimeConfig(config);
    return {
        ...clientSharedValues,
        ...config,
        runtime: "browser",
        defaultsMode,
        bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
        credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
        defaultUserAgentProvider: config?.defaultUserAgentProvider ??
            createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: package_namespaceObject.rE }),
        eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? provider_eventStreamSerdeProvider,
        maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
        md5: config?.md5 ?? Md5,
        region: config?.region ?? invalidProvider("Region is missing"),
        requestHandler: FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
        retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
        sha1: config?.sha1 ?? Sha1,
        sha256: config?.sha256 ?? Sha256,
        streamCollector: config?.streamCollector ?? streamCollector,
        streamHasher: config?.streamHasher ?? blobHasher,
        useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
        useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js
const getAwsRegionExtensionConfiguration = (runtimeConfig) => {
    return {
        setRegion(region) {
            runtimeConfig.region = region;
        },
        region() {
            return runtimeConfig.region;
        },
    };
};
const resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => {
    return {
        region: awsRegionExtensionConfiguration.region(),
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/config.js
const config_REGION_ENV_NAME = "AWS_REGION";
const config_REGION_INI_NAME = "region";
const config_NODE_REGION_CONFIG_OPTIONS = {
    environmentVariableSelector: (env) => env[config_REGION_ENV_NAME],
    configFileSelector: (profile) => profile[config_REGION_INI_NAME],
    default: () => {
        throw new Error("Region is missing");
    },
};
const config_NODE_REGION_CONFIG_FILE_OPTIONS = {
    preferredFile: "credentials",
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/region-config-resolver/dist-es/index.js



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthExtensionConfiguration.js
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
    const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
    let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
    let _credentials = runtimeConfig.credentials;
    return {
        setHttpAuthScheme(httpAuthScheme) {
            const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
            if (index === -1) {
                _httpAuthSchemes.push(httpAuthScheme);
            }
            else {
                _httpAuthSchemes.splice(index, 1, httpAuthScheme);
            }
        },
        httpAuthSchemes() {
            return _httpAuthSchemes;
        },
        setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
            _httpAuthSchemeProvider = httpAuthSchemeProvider;
        },
        httpAuthSchemeProvider() {
            return _httpAuthSchemeProvider;
        },
        setCredentials(credentials) {
            _credentials = credentials;
        },
        credentials() {
            return _credentials;
        },
    };
};
const resolveHttpAuthRuntimeConfig = (config) => {
    return {
        httpAuthSchemes: config.httpAuthSchemes(),
        httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
        credentials: config.credentials(),
    };
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/runtimeExtensions.js




const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
    const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
    extensions.forEach((extension) => extension.configure(extensionConfiguration));
    return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), defaultExtensionConfiguration_resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
};

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js




















class S3Client extends Client {
    config;
    constructor(...[configuration]) {
        const _config_0 = runtimeConfig_browser_getRuntimeConfig(configuration || {});
        super(_config_0);
        this.initConfig = _config_0;
        const _config_1 = resolveClientEndpointParameters(_config_0);
        const _config_2 = resolveUserAgentConfig(_config_1);
        const _config_3 = resolveFlexibleChecksumsConfig(_config_2);
        const _config_4 = resolveRetryConfig(_config_3);
        const _config_5 = resolveRegionConfig(_config_4);
        const _config_6 = resolveHostHeaderConfig(_config_5);
        const _config_7 = resolveEndpointConfig(_config_6);
        const _config_8 = resolveEventStreamSerdeConfig(_config_7);
        const _config_9 = resolveHttpAuthSchemeConfig(_config_8);
        const _config_10 = resolveS3Config(_config_9, { session: [() => this, CreateSessionCommand] });
        const _config_11 = resolveRuntimeExtensions(_config_10, configuration?.extensions || []);
        this.config = _config_11;
        this.middlewareStack.use(getUserAgentPlugin(this.config));
        this.middlewareStack.use(getRetryPlugin(this.config));
        this.middlewareStack.use(getContentLengthPlugin(this.config));
        this.middlewareStack.use(getHostHeaderPlugin(this.config));
        this.middlewareStack.use(getLoggerPlugin(this.config));
        this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
        this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
            httpAuthSchemeParametersProvider: defaultS3HttpAuthSchemeParametersProvider,
            identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
                "aws.auth#sigv4": config.credentials,
                "aws.auth#sigv4a": config.credentials,
            }),
        }));
        this.middlewareStack.use(getHttpSigningPlugin(this.config));
        this.middlewareStack.use(getValidateBucketNamePlugin(this.config));
        this.middlewareStack.use(getAddExpectContinuePlugin(this.config));
        this.middlewareStack.use(getRegionRedirectMiddlewarePlugin(this.config));
        this.middlewareStack.use(getS3ExpressPlugin(this.config));
        this.middlewareStack.use(getS3ExpressHttpSigningPlugin(this.config));
    }
    destroy() {
        super.destroy();
    }
}

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/s3/writeStreamToS3.ts


function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }

// Create clients
var s3Client = new S3Client();

/**
 * Create the write stream abstraction for uploading data to S3
 * @param Bucket
 * @param Key
 * @param Body
 * @param ContentType
 * @param ACL
 * @param CacheControl
 * @returns {Promise<PutObjectCommandOutput>}
 */
/* harmony default export */ var writeStreamToS3 = (/*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
    var Bucket, Key, Body, ContentType, ACL, CacheControl;
    return _regeneratorRuntime().wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          Bucket = _ref.Bucket, Key = _ref.Key, Body = _ref.Body, ContentType = _ref.ContentType, ACL = _ref.ACL, CacheControl = _ref.CacheControl;
          return _context.abrupt("return", s3Client.send(new PutObjectCommand({
            Bucket: Bucket,
            Key: Key,
            Body: Body,
            ContentType: ContentType,
            ACL: ACL,
            CacheControl: CacheControl
          })));
        case 2:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
  return function (_x) {
    return _ref2.apply(this, arguments);
  };
}())));
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/s3/index.ts

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/errorHandler/log.ts

/**
 * ```
 *  NONE: 0, // no logs whatsoever
 *  ERROR: 1, // only log errors
 *  INFO: 2, // log errors and some information logs
 *  DEBUG: 3, // log anything including fine details
 * ```
 * @Enum {{NONE: '0', DEBUG: '1' , INFO: '2', ERROR: '3'}}
 */
var log_LogLevel = /*#__PURE__*/function (LogLevel) {
  LogLevel["NONE"] = "0";
  LogLevel["ERROR"] = "1";
  LogLevel["INFO"] = "2";
  LogLevel["DEBUG"] = "3";
  return LogLevel;
}({});
var LogLabel = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, log_LogLevel.NONE, 'none'), log_LogLevel.ERROR, 'error'), log_LogLevel.INFO, 'info'), log_LogLevel.DEBUG, 'debug');

/**
 * Log in JSON format or in plain text.
 *
 * CloudWatch Logs Insights can work well with JSON format due to its ability to parse structured data efficiently.
 * @Enum {{JSON: string, TEXT: string}}
 */
var LogFormat = /*#__PURE__*/function (LogFormat) {
  LogFormat["JSON"] = "json";
  LogFormat["TEXT"] = "text";
  return LogFormat;
}({});
var colorText = function colorText(logMessage, loglevel) {
  if (loglevel === log_LogLevel.ERROR) {
    return "\x1B[31m ".concat(logMessage, " \x1B[0m");
  }
  if (loglevel === log_LogLevel.INFO) {
    return "\x1B[32m ".concat(logMessage, " \x1B[0m");
  }
  return logMessage;
};

/**
 * Function for logging messages.
 *```
 * In local environments, the messages will be logged in the console.
 * In production environments, the messages will be logged in cloudwatch.
 * In development environments, the messages will be logged in cloudwatch.
 *```
 * Don't forget to declare the process.env.LOG_LEVEL [default=LogLevel.ERROR] in your project config file.
 *
 * @example
 * log({message: 'hello world', file: 'index.ts', level: LogLevel.DEBUG, group: 'general', label: 'general'});
 *
 * @param {Object} params - object containing the parameters
 * @param {string} params.message - message to log
 * @param {string} params.file - file name where the log is coming from or N/A if not applicable
 * @param {string} [params.group=general] - group name
 * @param {string} [params.label=general] - label name
 * @param {LogLevel} [params.level=LogLevel.DEBUG] - log priority - compare against process.env.LOG_LEVEL
 * @param {LogFormat} [params.format=LogFormat.JSON] - log format
 */
var log_log = function log(_ref) {
  var message = _ref.message,
    file = _ref.file,
    _ref$level = _ref.level,
    level = _ref$level === void 0 ? log_LogLevel.ERROR : _ref$level,
    _ref$group = _ref.group,
    group = _ref$group === void 0 ? 'general' : _ref$group,
    _ref$label = _ref.label,
    label = _ref$label === void 0 ? 'general' : _ref$label,
    _ref$format = _ref.format,
    format = _ref$format === void 0 ? LogFormat.JSON : _ref$format;
  var processLogLevel = ({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).LOG_LEVEL || log_LogLevel.ERROR;

  // Global logLevel is defined in the config file, it can be different for each environment.
  if (parseInt(level, 10) > parseInt(processLogLevel, 10)) {
    return;
  }
  var formattedLog;
  if (format === LogFormat.TEXT) {
    formattedLog = "".concat(message, " | ").concat(group, " | ").concat(label, " | ").concat(file, " | ").concat(level, " | ") + "".concat(LogLabel[level], " | ").concat(format, " | ").concat(new Date().toISOString());
  } else {
    formattedLog = JSON.stringify({
      level: level,
      logType: LogLabel[level],
      message: message,
      group: group,
      label: label,
      file: file,
      dateTime: new Date().toISOString()
    });
  }
  if (processLogLevel === log_LogLevel.DEBUG) {
    console.log(colorText(formattedLog, level));
  } else if (level === log_LogLevel.ERROR) {
    console.error(formattedLog);
  } else {
    console.log(formattedLog);
  }
};
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/sqs/addToSqsQueue.ts


function addToSqsQueue_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ addToSqsQueue_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }


/**
 * Add message to the specified SQS
 * @param sqsProperties
 * @param body
 * @returns {Promise<boolean>}
 */
/* harmony default export */ var addToSqsQueue = (/*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  var _ref = _asyncToGenerator(/*#__PURE__*/addToSqsQueue_regeneratorRuntime().mark(function _callee(sqsProperties, body) {
    var sqsClient, command;
    return addToSqsQueue_regeneratorRuntime().wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          _context.prev = 0;
          sqsClient = new SQSClient(sqsProperties);
          command = new SendMessageCommand({
            QueueUrl: sqsProperties.endpoint,
            MessageBody: JSON.stringify(body)
          });
          _context.next = 5;
          return sqsClient.send(command);
        case 5:
          return _context.abrupt("return", true);
        case 8:
          _context.prev = 8;
          _context.t0 = _context["catch"](0);
          log({
            message: _context.t0.message,
            file: 'addToSqsQueue.ts',
            level: LogLevel.ERROR,
            group: 'addToSqsQueue'
          });
          return _context.abrupt("return", false);
        case 12:
        case "end":
          return _context.stop();
      }
    }, _callee, null, [[0, 8]]);
  }));
  return function (_x, _x2) {
    return _ref.apply(this, arguments);
  };
}())));
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/sqs/index.ts

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/player/constants/Flipbook.ts
var Flipbook_Flipbook = {
  PUBLISHED: 'published'
};
var SharedVisibility = {
  PRIVATE_EMAIL: 'PRIVATE_EMAIL',
  SHARED_TEAM: 'SHARED_TEAM',
  PRIVATE_SSO: 'PRIVATE_SSO',
  PRIVATE_OTP: 'PRIVATE_OTP'
};
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/player/isSharedWithUsers.ts


/**
 * Return true when flipbook visibility is shared type
 * @param {string} visibility
 * @returns {boolean}
 */

/* harmony default export */ var isSharedWithUsers = (function (visibility) {
  return Object.values(SharedVisibility).includes(visibility);
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/player/getMandatoryActionsByStage.ts



/**
 * Get all the mandatory actions for each stage
 */
/* harmony default export */ var getMandatoryActionsByStage = (function (pagesData, pagesOrder, quizElementType, quizDataLocalStorage) {
  var mandatoryActionsByPage = {};
  var mandatoryActionsByStage = {};
  var listOfQuizzesTaken = getParsedJson(quizDataLocalStorage, []).map(function (val) {
    return parseInt(val.toString().split('_')[0], 10);
  });
  Object.values(pagesData).forEach(function (page) {
    page.elements.forEach(function (element) {
      var pageId = element.pageId,
        id = element.id,
        attributes = element.attributes,
        type = element.type;

      // Expand the mandatory actions for other elements
      if (attributes && type === quizElementType && 'mandatory' in attributes && attributes.mandatory && !listOfQuizzesTaken.includes(id)) {
        if (!mandatoryActionsByPage[pageId]) {
          mandatoryActionsByPage[pageId] = [];
        }
        mandatoryActionsByPage[pageId].push(id);
      }
    });
  });

  // We use the order to manage mandatory actions across the entire stage (for single and double page layout)
  pagesOrder.forEach(function (stages) {
    var keyNameForMandatoryStage = stages.join(' ');
    var listOfMandatoryActionsByStage = [];
    stages.forEach(function (pageId) {
      if (mandatoryActionsByPage[pageId]) {
        listOfMandatoryActionsByStage = [].concat(toConsumableArray_toConsumableArray(listOfMandatoryActionsByStage), toConsumableArray_toConsumableArray(mandatoryActionsByPage[pageId]));
        mandatoryActionsByStage[keyNameForMandatoryStage] = listOfMandatoryActionsByStage;
      }
    });
  });
  return mandatoryActionsByStage;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/player/index.ts


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/colors/hexToRGB.ts
/* harmony default export */ var hexToRGB = (function (color) {
  var hex = color.replace(/[^0-9a-f]+/i, '');
  if (Number.isNaN(parseInt(hex, 16))) {
    throw new Error('Invalid color hex');
  }
  var r = hex.length >= 6 ? parseInt(hex.substring(0, 2), 16) : parseInt(hex.substring(0, 1) + hex.substring(0, 1), 16);
  var g = hex.length >= 6 ? parseInt(hex.substring(2, 4), 16) : parseInt(hex.substring(1, 2) + hex.substring(1, 2), 16);
  var b = hex.length >= 6 ? parseInt(hex.substring(4, 6), 16) : parseInt(hex.substring(2, 3) + hex.substring(2, 3), 16);
  return {
    r: r,
    g: g,
    b: b
  };
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/colors/isColorLighten.ts
/* harmony default export */ var isColorLighten = (function () {
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
      r: 0,
      g: 0,
      b: 0
    },
    r = _ref.r,
    g = _ref.g,
    b = _ref.b;
  var luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
  return luma > 120;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/colors/index.ts


// EXTERNAL MODULE: https (ignored)
var https_ignored_ = __webpack_require__(5860);
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/request/graphQLRequest.ts
/* provided dependency */ var graphQLRequest_Buffer = __webpack_require__(8287)["Buffer"];

/* harmony default export */ var graphQLRequest = (function (host, serverKey, query) {
  var variables = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  return new Promise(function (resolve, reject) {
    var payload = JSON.stringify({
      query: query,
      variables: variables
    });
    var options = {
      host: host,
      method: 'POST',
      port: 443,
      path: '/',
      headers: {
        authorization: graphQLRequest_Buffer.from("".concat(serverKey, ":0")).toString('base64'),
        'Content-Type': 'application/json',
        'Content-Length': payload.length,
        accept: 'application/json'
      }
    };
    var req = https.request(options, function (res) {
      var data = '';
      if (res.statusCode !== 200) {
        reject(new Error("Request failed with status code ".concat(res.statusCode)));
      } else {
        res.on('data', function (chunk) {
          data += chunk;
        });
        res.on('end', function () {
          if (data && typeof data === 'string') {
            var parsedData = JSON.parse(data);
            if (parsedData.errors) {
              reject(new Error(JSON.stringify(parsedData.errors)));
            } else {
              resolve(parsedData.data);
            }
          } else {
            reject(new Error('No data!'));
          }
        });
      }
    });
    req.on('error', function (err) {
      return reject(err);
    });
    req.write(payload);
    req.end();
  });
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/request/index.ts

;// CONCATENATED MODULE: ../../modules/utils/code/constants/src/documentDb.ts
var documentDb_Db = {
  JSON: 'app',
  APP: 'app',
  COLLECTION: 'collection'
};
var documentDb_Collection = {
  BASE: 'base',
  PAGE: 'page',
  WORKSPACE_SETTINGS: 'workspaceSettings',
  MLS: 'multipleListingService'
};
var RECONNECT_TRIES = 3;
var RECONNECT_TIMEOUT = 1000;
var SERVER_SELECTION_TIMEOUT = 5000;
var AUTH_MECHANISM = 'SCRAM-SHA-1';
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/getFlipbookJsonPagesData.ts


function getFlipbookJsonPagesData_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ getFlipbookJsonPagesData_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }




/**
 * Gets flipbook pages data from documentDB
 *
 * @param {MongoClient} collectionsDocDbClient
 * @param {FlipbookJsonBaseType} flipbookJsonBase
 * @returns {Promise<FlipbookJsonPagesDataType | null>}
 */
/* harmony default export */ var flipbookJson_getFlipbookJsonPagesData = (/*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  var _ref = _asyncToGenerator(/*#__PURE__*/getFlipbookJsonPagesData_regeneratorRuntime().mark(function _callee(collectionsDocDbClient, flipbookJsonBase) {
    var pagesCollection, flipbookPagesShardKeys, flipbookPagesData;
    return getFlipbookJsonPagesData_regeneratorRuntime().wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          pagesCollection = collectionsDocDbClient.db(Db.COLLECTION).collection(Collection.PAGE);
          flipbookPagesShardKeys = getFlipbookPagesShardKeys(flipbookJsonBase);
          if (!flipbookPagesShardKeys) {
            _context.next = 7;
            break;
          }
          _context.next = 5;
          return pagesCollection.find({
            pageId: {
              $in: flipbookPagesShardKeys
            }
          }).toArray();
        case 5:
          flipbookPagesData = _context.sent;
          return _context.abrupt("return", flipbookPagesData.reduce(function (accumulator, page) {
            // TODO:: Not nice at all!!!
            //  This is a temporary solution for production environment for duplicate pages in documentDb.
            //  Get first occurrence of duplicate pages - saving is only happening on first occurrence
            if (!accumulator[page.json.id]) {
              accumulator[page.json.id] = page.json;
            } else {
              log({
                message: "Found a duplicate page in DocumentDB - (pageId: ".concat(page.pageId, ")"),
                file: 'getFlipbookJsonPagesData.ts',
                level: LogLevel.INFO,
                group: 'DuplicatePageInDocumentDb',
                label: page.collectionHash
              });
            }
            return accumulator;
          }, {}));
        case 7:
          return _context.abrupt("return", null);
        case 8:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
  return function (_x, _x2) {
    return _ref.apply(this, arguments);
  };
}())));
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/getFlipbookJsonFromDocumentDB.ts



function getFlipbookJsonFromDocumentDB_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ getFlipbookJsonFromDocumentDB_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function getFlipbookJsonFromDocumentDB_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function getFlipbookJsonFromDocumentDB_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? getFlipbookJsonFromDocumentDB_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : getFlipbookJsonFromDocumentDB_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }



/**
 * Gets json base from DocumentDb and all pages from DocumentDB pages and merge them to form draftJson.
 *
 * @param {MongoClient} collectionsDocDbClient
 * @param {string} flipbookHash
 * @return {Promise<FlipbookJsonType | null>}
 */
/* harmony default export */ var getFlipbookJsonFromDocumentDB = (/*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  var _ref = _asyncToGenerator(/*#__PURE__*/getFlipbookJsonFromDocumentDB_regeneratorRuntime().mark(function _callee(collectionsDocDbClient, flipbookHash) {
    var documentDBBase, flipbookJsonBase, flipbookJsonPages;
    return getFlipbookJsonFromDocumentDB_regeneratorRuntime().wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          documentDBBase = collectionsDocDbClient.db(Db.COLLECTION).collection(Collection.BASE);
          _context.next = 3;
          return documentDBBase.findOne({
            collectionHash: flipbookHash
          });
        case 3:
          flipbookJsonBase = _context.sent;
          if (flipbookJsonBase) {
            _context.next = 6;
            break;
          }
          return _context.abrupt("return", null);
        case 6:
          _context.next = 8;
          return getFlipbookJsonPagesData(collectionsDocDbClient, flipbookJsonBase.json);
        case 8:
          flipbookJsonPages = _context.sent;
          if (flipbookJsonPages) {
            _context.next = 11;
            break;
          }
          return _context.abrupt("return", null);
        case 11:
          return _context.abrupt("return", getFlipbookJsonFromDocumentDB_objectSpread(getFlipbookJsonFromDocumentDB_objectSpread({}, flipbookJsonBase.json), {}, {
            pages: {
              order: flipbookJsonBase.json.pages.order,
              data: flipbookJsonPages
            }
          }));
        case 12:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
  return function (_x, _x2) {
    return _ref.apply(this, arguments);
  };
}())));
// EXTERNAL MODULE: ./node_modules/browserify-zlib/lib/index.js
var lib = __webpack_require__(8559);
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/decompress.ts


/**
 * Decompresses (unzips) a zipped input file.
 *
 * @param {InputType} body
 * @return {Promise<string>}
 */
/* harmony default export */ var decompress = (function (body) {
  return new Promise(function (resolve, reject) {
    zlib.gunzip(body, function (err, data) {
      if (err) {
        reject(err);
      } else if (!data) {
        reject(new Error('Data is empty.'));
      } else {
        resolve(data.toString());
      }
    });
  });
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/streamToBuffer.ts
/* provided dependency */ var streamToBuffer_Buffer = __webpack_require__(8287)["Buffer"];


function streamToBuffer_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ streamToBuffer_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, return: function _return(r) { var n = this.s.return; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, throw: function _throw(r) { var n = this.s.return; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
/**
 * Converts a readable stream to a Buffer.
 *
 * @param stream - The readable stream from the S3 object response
 * @returns A promise that resolves to a Buffer
 */
/* harmony default export */ var streamToBuffer = (/*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  var _ref = _asyncToGenerator(/*#__PURE__*/streamToBuffer_regeneratorRuntime().mark(function _callee(stream) {
    var chunks, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, chunk;
    return streamToBuffer_regeneratorRuntime().wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          chunks = [];
          _iteratorAbruptCompletion = false;
          _didIteratorError = false;
          _context.prev = 3;
          _iterator = _asyncIterator(stream);
        case 5:
          _context.next = 7;
          return _iterator.next();
        case 7:
          if (!(_iteratorAbruptCompletion = !(_step = _context.sent).done)) {
            _context.next = 13;
            break;
          }
          chunk = _step.value;
          chunks.push(chunk);
        case 10:
          _iteratorAbruptCompletion = false;
          _context.next = 5;
          break;
        case 13:
          _context.next = 19;
          break;
        case 15:
          _context.prev = 15;
          _context.t0 = _context["catch"](3);
          _didIteratorError = true;
          _iteratorError = _context.t0;
        case 19:
          _context.prev = 19;
          _context.prev = 20;
          if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
            _context.next = 24;
            break;
          }
          _context.next = 24;
          return _iterator.return();
        case 24:
          _context.prev = 24;
          if (!_didIteratorError) {
            _context.next = 27;
            break;
          }
          throw _iteratorError;
        case 27:
          return _context.finish(24);
        case 28:
          return _context.finish(19);
        case 29:
          return _context.abrupt("return", streamToBuffer_Buffer.concat(chunks));
        case 30:
        case "end":
          return _context.stop();
      }
    }, _callee, null, [[3, 15, 19, 29], [20,, 24, 28]]);
  }));
  return function (_x) {
    return _ref.apply(this, arguments);
  };
}())));
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/index.ts



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/isTableElementType.ts


/**
 * Checks if the element is Table
 * @param element
 */
/* harmony default export */ var isTableElementType = (function (element) {
  return element.type === FlipbookElementType.TABLE;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/isTextBoxElementType.ts


/**
 * Checks if the element is TextBox
 * @param element
 */
/* harmony default export */ var isTextBoxElementType = (function (element) {
  return element.type === FlipbookElementType.TEXT_BOX;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/transformTableFontsListToV3.ts

function transformTableFontsListToV3_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function transformTableFontsListToV3_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? transformTableFontsListToV3_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : transformTableFontsListToV3_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


/* harmony default export */ var transformTableFontsListToV3 = (function (fontListItem) {
  var organizationHash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  var newFontListItem = transformTableFontsListToV3_objectSpread({}, fontListItem);
  if ('location' in fontListItem) {
    return newFontListItem;
  }
  if (fontListItem.source === FontSource.ADMIN || isFlipsnackFont(fontListItem.family)) {
    newFontListItem.location = ResourceLocation.PUBLIC;
  } else {
    newFontListItem.location = ResourceLocation.WORKSPACE;
    if (fontListItem.isSuperUser && organizationHash.length) {
      newFontListItem.locationHash = organizationHash;
    }
  }
  delete newFontListItem.source;
  delete newFontListItem.isSuperUser;
  return newFontListItem;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/transformFontV2ToV3.ts

function transformFontV2ToV3_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function transformFontV2ToV3_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? transformFontV2ToV3_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : transformFontV2ToV3_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }




/**
 * Transform font structure from V2 to V3
 */
/* harmony default export */ var transformFontV2ToV3 = (function (font) {
  var organizationHash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  if (!isFontV3Type(font)) {
    var fontV3 = transformFontV2ToV3_objectSpread({}, font);
    if (font.source === FontSource.ADMIN || isFlipsnackFont(font.family)) {
      fontV3.location = ResourceLocation.PUBLIC;
    } else {
      fontV3.location = ResourceLocation.WORKSPACE;
      if (font.isSuperUser && organizationHash.length) {
        fontV3.locationHash = organizationHash;
      }
    }
    delete fontV3.source;
    delete fontV3.isSuperUser;
    return fontV3;
  }
  return font;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/isImageElementType.ts


/**
 * Checks if the element is Image
 * @param element
 */
/* harmony default export */ var isImageElementType = (function (element) {
  return element.type === FlipbookElementType.IMAGE;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/isImageMaskElementType.ts


/**
 * Checks if the element is ImageMask
 * @param element
 */
/* harmony default export */ var isImageMaskElementType = (function (element) {
  return element.type === FlipbookElementType.IMAGE_MASK;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/s3/generateCopyParams.ts
/* eslint-disable max-len */


/* harmony default export */ var generateCopyParams = (function (_ref) {
  var sourceWorkspaceHash = _ref.sourceWorkspaceHash,
    targetWorkspaceHash = _ref.targetWorkspaceHash,
    flipbookHash = _ref.flipbookHash,
    resourceType = _ref.resourceType,
    resourceHash = _ref.resourceHash,
    sourceBucket = _ref.sourceBucket,
    targetBucket = _ref.targetBucket;
  switch (resourceType) {
    case ResourceType.LEGACY_VIDEO:
    case ResourceType.LEGACY_IMAGE:
      return {
        Bucket: targetBucket,
        CopySource: "".concat(sourceBucket, "/").concat(PublicResourcePath[resourceType], "/").concat(resourceHash),
        Key: "".concat(targetWorkspaceHash, "/collections/").concat(flipbookHash, "/").concat(PrivateResourcePath[resourceType], "/").concat(resourceHash),
        ACL: CannedACL.PRIVATE
      };
    case ResourceType.LOGO:
      return {
        Bucket: targetBucket,
        CopySource: "".concat(sourceBucket, "/").concat(sourceWorkspaceHash, "/library/images/").concat(resourceHash),
        Key: "".concat(targetWorkspaceHash, "/collections/").concat(flipbookHash, "/library/images/").concat(resourceHash),
        ACL: CannedACL.PUBLIC_READ
      };
    case ResourceType.WORKSPACE_LEGACY_VIDEO:
    case ResourceType.WORKSPACE_LEGACY_IMAGE:
      return {
        Bucket: targetBucket,
        CopySource: "".concat(sourceBucket, "/").concat(PublicResourcePath[resourceType], "/").concat(resourceHash),
        Key: "".concat(targetWorkspaceHash, "/").concat(PrivateResourcePath[resourceType], "/").concat(resourceHash),
        ACL: CannedACL.PRIVATE
      };
    case ResourceType.WORKSPACE_LOGO:
    case ResourceType.WORKSPACE_FONT:
    case ResourceType.WORKSPACE_IMAGE:
    case ResourceType.WORKSPACE_VIDEO:
      return {
        Bucket: targetBucket,
        CopySource: "".concat(sourceBucket, "/").concat(sourceWorkspaceHash, "/").concat(PrivateResourcePath[resourceType], "/").concat(resourceHash),
        Key: "".concat(targetWorkspaceHash, "/").concat(PrivateResourcePath[resourceType], "/").concat(resourceHash),
        ACL: CannedACL.PRIVATE
      };
    default:
      return {
        Bucket: targetBucket,
        CopySource: "".concat(sourceBucket, "/").concat(sourceWorkspaceHash, "/").concat(PrivateResourcePath[resourceType], "/").concat(resourceHash),
        Key: "".concat(targetWorkspaceHash, "/collections/").concat(flipbookHash, "/").concat(PrivateResourcePath[resourceType], "/").concat(resourceHash),
        ACL: CannedACL.PRIVATE
      };
  }
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/normalizeBackgroundColor.ts


/**
 * Returns a valid CSS background color (gradient or hex).
 * @param color string
 */
/* harmony default export */ var normalizeBackgroundColor = (function (color) {
  var hasHash = color.startsWith('#');
  return isGradient(color) || hasHash ? color : "#".concat(color);
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/index.ts










;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/localStorage/getLocalStorage.ts
/**
 * Gets data from Local storage
 *
 * @param keyName
 * @return {string | null}
 */
var getLocalStorage = function getLocalStorage(keyName) {
  try {
    return localStorage.getItem(keyName);
  } catch (_unused) {
    return null;
  }
};
/* harmony default export */ var localStorage_getLocalStorage = (getLocalStorage);
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/localStorage/setLocalStorage.ts
/**
 * Sets data to Local storage
 *
 * @param keyName
 * @param value
 */
var setLocalStorage = function setLocalStorage(keyName, value) {
  localStorage.setItem(keyName, value);
};
/* harmony default export */ var localStorage_setLocalStorage = (setLocalStorage);
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/localStorage/index.ts



;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/cart/getDisplaySku.ts
/**
 * Returns the sku of a product or its variant
 * @param sku
 * @param variantSku
 */
/* harmony default export */ var getDisplaySku = (function (sku) {
  var variantSku = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  var isInternalVariant = variantSku.startsWith('fs-') ? '' : variantSku;
  return isInternalVariant ? variantSku : sku;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/cart/index.ts

;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/calculatePercentage.ts
/**
 * Calculate percentage from a total
 * @param {number} num
 * @param {number} total
 * @returns {number}
 */

/* harmony default export */ var calculatePercentage = (function (num, total) {
  return total ? Math.round(Number((num / total * 100).toFixed(2))) : 0;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/errorHandler/setLogLevel.ts


function setLogLevel_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ setLogLevel_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }

var hash = 'workerLogLevel';
var isLogLevelType = function isLogLevelType(level) {
  return Object.values(LogLevel).includes(level);
};
var getLogLevelFromRedis = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  var _ref = _asyncToGenerator(/*#__PURE__*/setLogLevel_regeneratorRuntime().mark(function _callee(hashKey, workerKey, redisClient) {
    return setLogLevel_regeneratorRuntime().wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          return _context.abrupt("return", new Promise(function (resolve) {
            redisClient.hget(hashKey, workerKey, function (err, replies) {
              if (isLogLevelType(replies)) {
                return resolve(replies);
              }
              return resolve(LogLevel.ERROR);
            });
          }));
        case 1:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
  return function getLogLevelFromRedis(_x, _x2, _x3) {
    return _ref.apply(this, arguments);
  };
}()));

/**
 * Read the current log level from redis and set it to process.env
 *
 * @param redisClient
 * @param workerKey
 * @return {Promise<boolean>}
 */
var setLogLevel = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  var _ref2 = _asyncToGenerator(/*#__PURE__*/setLogLevel_regeneratorRuntime().mark(function _callee2(redisClient, workerKey) {
    return setLogLevel_regeneratorRuntime().wrap(function _callee2$(_context2) {
      while (1) switch (_context2.prev = _context2.next) {
        case 0:
          _context2.next = 2;
          return getLogLevelFromRedis(hash, workerKey, redisClient);
        case 2:
          ({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).LOG_LEVEL = _context2.sent;
          return _context2.abrupt("return", true);
        case 4:
        case "end":
          return _context2.stop();
      }
    }, _callee2);
  }));
  return function setLogLevel(_x4, _x5) {
    return _ref2.apply(this, arguments);
  };
}()));
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/isTouchEvent.ts
/**
 * Check if event is a touch event
 *
 * @param event
 * @return boolean
 */
/* harmony default export */ var isTouchEvent = (function (event) {
  return window.TouchEvent && (event instanceof TouchEvent || 'nativeEvent' in event && event.nativeEvent instanceof TouchEvent);
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/objectToURLParams.ts
/**
 * Transform an object into url encoded string
 * @return string
 */
/* harmony default export */ var objectToURLParams = (function (params) {
  return Object.keys(params).map(function (key) {
    return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(params[key]));
  }).join('&');
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/domainValidation/isOnFlipsnackDomain.ts
/**
 * Check if the URL belongs to the flipsnack domain.
 *
 * @param url
 * @return boolean
 */

var flipsnackDomains = 'https://[a-z0-9.-]*.flipsnack.(com|io|net)';
var regex = new RegExp(flipsnackDomains, 'i');
/* harmony default export */ var isOnFlipsnackDomain = (function (url) {
  if (!url) {
    return false;
  }

  // Or it may contain the 'fd' parameter set by us as a reference from flipsnack domain.
  var hasFdParameter = !!new URL(url).searchParams.get('fd');
  return regex.test(url) || hasFdParameter;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/domainValidation/isOnFlipsnackCustomDomain.ts
/**
 * Check if the custom domain is present in the player url.
 *
 * @param {string} url - The URL containing the custom domain to be checked against the player url.
 * @return boolean
 */

/* harmony default export */ var isOnFlipsnackCustomDomain = (function (url) {
  var _customDomain$match;
  if (!url) {
    return false;
  }
  var regexDomain = /^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:/\n?]+)/;
  var urlDomain = url.match(regexDomain);
  var customDomain = new URLSearchParams(window.location.search).get('cd');
  return urlDomain && customDomain ? ((_customDomain$match = customDomain.match(regexDomain)) === null || _customDomain$match === void 0 ? void 0 : _customDomain$match[1]) === urlDomain[1] : false;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/domainValidation/index.ts


;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/isInIframe.ts
/**
 * Verifies if the flipbook is embedded in an iframe
 *
 * @return {boolean} the boolean that decides if the flipbook is embedded in an iframe
 */
/* harmony default export */ var isInIframe = (function () {
  return window.self !== window.top;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/getCurrentUrl.ts


/**
 * Determines if the flipbook is embedded in an iframe.
 *
 * @returns {string} The URL of the parent document if the flipbook is in an iframe,
 *                   otherwise, the URL of the current document.
 */
/* harmony default export */ var getCurrentUrl = (function () {
  var url = window.location.href;
  if (isInIframe()) {
    url = document.referrer;

    // The window.top.location.href can be blocked by cross-origin policy
    try {
      var _window$top;
      // Modern iframe parent url check
      var ancestorOrigins = window.location.ancestorOrigins;
      if (ancestorOrigins && ancestorOrigins.length) {
        var topUrl = ancestorOrigins[ancestorOrigins.length - 1];
        if (topUrl && topUrl !== 'null') {
          url = topUrl;
        }
      } else if ((_window$top = window.top) !== null && _window$top !== void 0 && (_window$top = _window$top.location) !== null && _window$top !== void 0 && _window$top.href) {
        url = window.top.location.href;
      }
    } catch (e) {
      // Preview value
    }
  }
  return url;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/environment/types.ts
var RootDomain = /*#__PURE__*/function (RootDomain) {
  RootDomain["LOCAL"] = "flipsnack.io";
  RootDomain["DEVELOPMENT"] = "flipsnack.net";
  RootDomain["PRODUCTION"] = "flipsnack.com";
  return RootDomain;
}({});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/environment/getBranchFromOrigin.ts


/**
* Get the branch name from the origin URL.
*/
/* harmony default export */ var getBranchFromOrigin = (function () {
  var usePathName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  var _window$location = window.location,
    origin = _window$location.origin,
    pathname = _window$location.pathname;
  if (origin.includes(".".concat(RootDomain.DEVELOPMENT))) {
    // Get the branch name from the path name
    if (usePathName) {
      return pathname.split('/')[1];
    }

    // Remove the protocol part (https://)
    var withoutProtocol = origin.replace('https://', '');

    // Split the remaining string by dots
    var parts = withoutProtocol.split('.');
    return parts[0];
  }
  return '';
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/isSlideshowElementType.ts


/**
 * Checks if the element is photo slideshow
 */
/* harmony default export */ var isSlideshowElementType = (function (element) {
  return element.type === FlipbookElementType.SLIDESHOW;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/isVideoElementType.ts


/**
 * Checks if the element is Video
 */
/* harmony default export */ var isVideoElementType = (function (element) {
  return element.type === FlipbookElementType.VIDEO_WIDGET;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/isOutlineElementType.ts


/**
 * Checks if the element is outline
 */
/* harmony default export */ var elements_isOutlineElementType = (function (element) {
  return element.type === FlipbookElementType.OUTLINE;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/flipbookJson/elements/isPopupSlideshowElementType.ts



/**
 * Checks if the element is popup slideshow
 */
/* harmony default export */ var isPopupSlideshowElementType = (function (element) {
  return isOutlineElementType(element) && element.action === FlipbookElementActionType.PHOTO_SLIDESHOW;
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/getParsedJson.ts
/* harmony default export */ var getParsedJson = (function (value, defaultValue) {
  try {
    return JSON.parse(value);
  } catch (_unused) {
    return defaultValue;
  }
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/isWithinThreshold.ts
var THRESHOLD_TYPE = /*#__PURE__*/function (THRESHOLD_TYPE) {
  THRESHOLD_TYPE[THRESHOLD_TYPE["LESS_THAN"] = 0] = "LESS_THAN";
  THRESHOLD_TYPE[THRESHOLD_TYPE["LESS_OR_EQUAL"] = 1] = "LESS_OR_EQUAL";
  THRESHOLD_TYPE[THRESHOLD_TYPE["BETWEEN"] = 2] = "BETWEEN";
  THRESHOLD_TYPE[THRESHOLD_TYPE["GREATER_THAN"] = 3] = "GREATER_THAN";
  THRESHOLD_TYPE[THRESHOLD_TYPE["GREATER_OR_EQUAL"] = 4] = "GREATER_OR_EQUAL";
  return THRESHOLD_TYPE;
}({});
var isWithinThreshold = function isWithinThreshold(left, right) {
  var thresholds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [2];
  var type = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : THRESHOLD_TYPE.LESS_OR_EQUAL;
  switch (type) {
    case THRESHOLD_TYPE.LESS_THAN:
      return Math.abs(left - right) < thresholds[0];
    case THRESHOLD_TYPE.LESS_OR_EQUAL:
      return Math.abs(left - right) <= thresholds[0];
    case THRESHOLD_TYPE.BETWEEN:
      return Math.abs(left - right) >= thresholds[0] && Math.abs(left - right) <= thresholds[1];
    case THRESHOLD_TYPE.GREATER_THAN:
      return Math.abs(left - right) > thresholds[0];
    case THRESHOLD_TYPE.GREATER_OR_EQUAL:
      return Math.abs(left - right) >= thresholds[0];
    default:
      return false;
  }
};
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/hasPrivateResources.ts

/* harmony default export */ var hasPrivateResources = (function (flipbookJson) {
  return Number("".concat(flipbookJson.properties.version.schema, ".").concat(flipbookJson.properties.version.revision)) >= JsonVersions['3.2'];
});
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/shapeGradientTools.ts



/**
 * Converts a shadow object into a CSS drop-shadow string, taking zoom into account.
 *
 * @param {Object} shadow - The shadow object containing r, g, b, a, x, y, blur values.
 * @param {number} zoom - A multiplier applied to shadow offsets and blur for scaling.
 * @returns {string} A CSS `drop-shadow(...)` filter string or an empty string if no shadow is provided.
 */
var decodeShadowFilter = function decodeShadowFilter(shadow, zoom) {
  if (shadow) {
    var rgbaColor = "rgba(".concat(shadow.r, ", ").concat(shadow.g, ", ").concat(shadow.b, ", ").concat(shadow.a, ")");
    return "drop-shadow(".concat(shadow.x * zoom, "px ").concat(shadow.y * zoom, "px ").concat(shadow.blur * zoom, "px ").concat(rgbaColor, ")");
  }
  return '';
};

/**
 * Checks if a given color string represents a CSS gradient.
 *
 * @param {string} [color=''] - The color string to test.
 * @returns {boolean} True if the color is a linear or radial gradient, false otherwise.
 */
var shapeGradientTools_isGradient = function isGradient() {
  var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  return color.startsWith('linear-gradient') || color.startsWith('radial-gradient');
};

/**
 * Converts a gradient angle (in degrees) into SVG coordinate space.
 *
 * @param {string} direction - The angle of the gradient in degrees (as a string).
 */
var directionToSvgCoords = function directionToSvgCoords(direction) {
  var angleDeg = parseFloat(direction);
  var angleRad = angleDeg % 360 * (Math.PI / 180);

  // Direction vector for a square centered at (0.5, 0.5)
  var x = Math.sin(angleRad);
  var y = Math.cos(angleRad);

  // Map direction vector to 0%-100% coordinates
  var x1 = 50 - x * 50;
  var y1 = 50 + y * 50;
  var x2 = 50 + x * 50;
  var y2 = 50 - y * 50;
  return {
    x1: "".concat(x1, "%"),
    y1: "".concat(y1, "%"),
    x2: "".concat(x2, "%"),
    y2: "".concat(y2, "%")
  };
};

/**
 * Extracts color stops from a CSS gradient match using a safe split that ignores commas inside functions.
 *
 * @param {RegExpMatchArray} match - The regex match array containing gradient components.
 * @returns {string[]} An array of raw stop strings from the gradient definition.
 */
var getStopsRaw = function getStopsRaw(match) {
  return match[2].split(/,(?![^(]*\))/).map(function (stop) {
    return stop.trim();
  });
};

/**
 * Parses a CSS gradient string (linear or radial) into an equivalent SVG gradient object.
 *
 * @param {string} cssGradient - The CSS gradient string to convert.
 */
var parseGradientToSvg = function parseGradientToSvg(cssGradient) {
  var linearRegex = /linear-gradient\(([\d.]+)deg\s*,\s*(.+)\)/i;
  var radialRegex = /radial-gradient\s*\(\s*(circle)?\s*,\s*(.+)\)/i;

  // LINEAR
  if (linearRegex.test(cssGradient)) {
    var match = cssGradient.match(linearRegex);
    if (!match) {
      return null;
    }
    var _directionToSvgCoords = directionToSvgCoords(match[1]),
      x1 = _directionToSvgCoords.x1,
      y1 = _directionToSvgCoords.y1,
      x2 = _directionToSvgCoords.x2,
      y2 = _directionToSvgCoords.y2;
    var stopsRaw = getStopsRaw(match);
    var stops = stopsRaw.map(function (stopStr, index) {
      var _stopStr$split = stopStr.split(/\s+(?=\d+%?$)/),
        _stopStr$split2 = slicedToArray_slicedToArray(_stopStr$split, 2),
        color = _stopStr$split2[0],
        offsetRaw = _stopStr$split2[1];
      return {
        color: color.trim(),
        offset: offsetRaw ? offsetRaw.trim() : "".concat(index / (stopsRaw.length - 1) * 100, "%")
      };
    });
    return {
      type: GradientTypes.LINEAR,
      x1: x1,
      y1: y1,
      x2: x2,
      y2: y2,
      stops: stops
    };
  }

  // RADIAL
  if (radialRegex.test(cssGradient)) {
    var _match = cssGradient.match(radialRegex);
    if (!_match) {
      return null;
    }
    var _stopsRaw = getStopsRaw(_match);
    var _stops = _stopsRaw.map(function (stopStr, index) {
      var _stopStr$split3 = stopStr.split(/\s+(?=\d+%?$)/),
        _stopStr$split4 = slicedToArray_slicedToArray(_stopStr$split3, 2),
        color = _stopStr$split4[0],
        offsetRaw = _stopStr$split4[1];
      return {
        color: color.trim(),
        offset: offsetRaw ? offsetRaw.trim() : "".concat(index / (_stopsRaw.length - 1) * 100, "%")
      };
    });
    return {
      type: GradientTypes.RADIAL,
      cx: '50%',
      cy: '50%',
      r: '50%',
      fx: '50%',
      fy: '50%',
      stops: _stops
    };
  }
  return null; // not a valid gradient
};
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/index.ts



































;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PasswordStrength/styles.tsx
/* eslint-disable max-len */


var _componentsTheme$pass = componentsTheme.passwordStrengthTheme,
  textColor = _componentsTheme$pass.textColor,
  focusedText = _componentsTheme$pass.focusedText,
  inputBorder = _componentsTheme$pass.inputBorder,
  inputBackground = _componentsTheme$pass.inputBackground,
  passwordScoreBar = _componentsTheme$pass.passwordScoreBar,
  passwordStrong = _componentsTheme$pass.passwordStrong,
  passwordScoreText = _componentsTheme$pass.passwordScoreText;
var PasswordStrengthContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__PasswordStrengthContainer",
  componentId: "sc-18ulhn1-0"
})(["display:flex;flex-direction:column;box-sizing:border-box;"]);
var PasswordLabel = styled_components_browser_esm.div.withConfig({
  displayName: "styles__PasswordLabel",
  componentId: "sc-18ulhn1-1"
})(["color:", ";padding:0 0 5px 0;font-size:14px;font-family:\"Roboto\",\"Helvetica\",\"Arial\",sans-serif;font-weight:500;line-height:1;letter-spacing:0.1px;transition:100ms ease-in-out;"], function (props) {
  return props.isFocused ? focusedText : textColor;
});
var styles_Input = styled_components_browser_esm.input.withConfig({
  displayName: "styles__Input",
  componentId: "sc-18ulhn1-2"
})(["border-radius:3px;border:solid 1px ", ";background-color:", ";width:100%;height:40px;font-family:\"Roboto\",\"Helvetica\",\"Arial\",sans-serif;font-size:14px;font-weight:normal;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal;color:", ";padding:0 12px;margin:0 0 16px 0;outline:none;transition:100ms ease-in-out;&:focus{border:1px solid ", ";}"], inputBorder, inputBackground, textColor, focusedText);
var StrengthScore = styled_components_browser_esm.div.withConfig({
  displayName: "styles__StrengthScore",
  componentId: "sc-18ulhn1-3"
})(["position:relative;width:100%;height:20px;background-color:", ";border-radius:2px;&::after{content:'';position:absolute;left:0;top:0;width:", "%;height:100%;padding-top:3px;transition:all 300ms ease;background-color:", ";margin-bottom:10px;overflow:hidden;border-radius:2px;}"], passwordScoreBar, function (props) {
  return props['data-progress'];
}, function (props) {
  return props['data-color'];
});
var PasswordCharacteristicsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__PasswordCharacteristicsContainer",
  componentId: "sc-18ulhn1-4"
})(["display:flex;flex-direction:row;justify-content:center;"]);
var PasswordCharacteristics = styled_components_browser_esm.div.withConfig({
  displayName: "styles__PasswordCharacteristics",
  componentId: "sc-18ulhn1-5"
})(["color:", ";display:flex;flex-direction:row;font-family:\"Roboto\",\"Helvetica\",\"Arial\",sans-serif;font-size:12px;padding:9px 0 0 0;margin:0 5px 0 0;@media (max-width:430px){font-size:10px;margin:0 4px 0 0;}"], function (props) {
  return props.active ? passwordStrong : passwordScoreText;
});
var CheckboxSVG = styled_components_browser_esm.span.withConfig({
  displayName: "styles__CheckboxSVG",
  componentId: "sc-18ulhn1-6"
})(["width:9px;height:9px;background-size:contain;background-repeat:no-repeat;margin:auto 5px;background-image:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5IiBoZWlnaHQ9IjciIHZpZXdCb3g9IjAgMCA5IDciPgogICAgPHBhdGggZmlsbD0iIzAwQkI2MCIgZD0iTTcwNy42OTUgNTg0TDcwNCA1ODAuNzAzIDcwNS4wNjMgNTc5LjYwMiA3MDcuNTM1IDU4MS44MjIgNzExLjc4NSA1NzcgNzEzIDU3Ny45NDh6IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNzA0IC01NzcpIi8+Cjwvc3ZnPgo=\");"]);
var CloseSVG = styled_components_browser_esm.span.withConfig({
  displayName: "styles__CloseSVG",
  componentId: "sc-18ulhn1-7"
})(["width:8px;height:8px;background-size:contain;background-repeat:no-repeat;margin:auto 5px;background-image:url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5IiBoZWlnaHQ9IjkiIHZpZXdCb3g9IjAgMCA5IDkiPgogICAgPHBhdGggZmlsbC1vcGFjaXR5PSIuMjciIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTguNTg4LjQwN2MuMjUuMjUuMjUuNjU2IDAgLjkwNkw1LjQwNiA0LjVsMy4xODQgMy4xODdjLjI1LjI1LjI1LjY1NiAwIC45MDZzLS42NTUuMjUtLjkwNSAwTDQuNSA1LjQwNCAxLjMxNiA4LjU5MmMtLjIyNy4yMjgtLjU4My4yNDgtLjgzMy4wNjNMLjQxIDguNTkzYy0uMjUtLjI1MS0uMjUtLjY1NyAwLS45MDdMMy41OTUgNC41LjQxIDEuMzEzQy4xNiAxLjA2My4xNi42NTcuNDEuNDA3LjYzNy4xOC45OTIuMTYgMS4yNDMuMzQ1bC4wNzEuMDYyTDQuNSAzLjU5MyA3LjY4NC40MDdjLjI1LS4yNS42NTQtLjI1LjkwNCAweiIvPgo8L3N2Zz4K\");"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PasswordStrength/index.tsx






var passwordStrengthTheme = [{
  color: componentsTheme.passwordStrengthTheme.passwordStrong,
  score: 1,
  progress: 100
}, {
  color: componentsTheme.passwordStrengthTheme.passwordMedium,
  score: 0.8,
  progress: 85
}, {
  color: componentsTheme.passwordStrengthTheme.passwordMedium,
  score: 0.6,
  progress: 50
}, {
  color: componentsTheme.passwordStrengthTheme.passwordWeak,
  score: 0.4,
  progress: 44.5
}, {
  color: componentsTheme.passwordStrengthTheme.passwordWeak,
  score: 0.2,
  progress: 19.5
}, {
  color: componentsTheme.passwordStrengthTheme.passwordWeak,
  score: 0,
  progress: 0
}];
var passwordStrengthAttributes = [{
  label: 'Upper case',
  prop: 'uppercase'
}, {
  label: 'Lower case',
  prop: 'lowercase'
}, {
  label: 'Numbers',
  prop: 'numbers'
}, {
  label: 'Symbols',
  prop: 'symbols'
}, {
  label: 'Min.8 char.',
  prop: 'minLength'
}];
var PasswordStrength = function PasswordStrength(_ref) {
  var label = _ref.label,
    onChange = _ref.onChange,
    placeholder = _ref.placeholder,
    _ref$maxLength = _ref.maxLength,
    maxLength = _ref$maxLength === void 0 ? 64 : _ref$maxLength,
    _ref$hasError = _ref.hasError,
    hasError = _ref$hasError === void 0 ? false : _ref$hasError,
    _ref$helperText = _ref.helperText,
    helperText = _ref$helperText === void 0 ? '' : _ref$helperText;
  var _useState = useState(''),
    _useState2 = _slicedToArray(_useState, 2),
    color = _useState2[0],
    setColor = _useState2[1];
  var _useState3 = useState(''),
    _useState4 = _slicedToArray(_useState3, 2),
    value = _useState4[0],
    setValue = _useState4[1];
  var _useState5 = useState(0),
    _useState6 = _slicedToArray(_useState5, 2),
    progress = _useState6[0],
    setProgress = _useState6[1];
  var _useState7 = useState(passwordStrengthAttributes.map(function (attribute) {
      return /*#__PURE__*/React.createElement(Styled.PasswordCharacteristics, {
        key: attribute.prop,
        active: false
      }, /*#__PURE__*/React.createElement(Styled.CloseSVG, null), /*#__PURE__*/React.createElement("span", null, attribute.label));
    })),
    _useState8 = _slicedToArray(_useState7, 2),
    attributes = _useState8[0],
    setAttributes = _useState8[1];
  var selectStrengthTheme = function selectStrengthTheme(score) {
    var i;
    for (i = 0; i < passwordStrengthTheme.length; i++) {
      if (score >= passwordStrengthTheme[i].score) {
        break;
      }
    }
    setColor(passwordStrengthTheme[i].color);
    setProgress(passwordStrengthTheme[i].progress);
  };
  var selectAttributes = function selectAttributes(passwordStrength) {
    setAttributes(passwordStrengthAttributes.map(function (attribute) {
      return /*#__PURE__*/React.createElement(Styled.PasswordCharacteristics, {
        key: attribute.prop,
        active: !!passwordStrength[attribute.prop]
      }, passwordStrength[attribute.prop] ? /*#__PURE__*/React.createElement(Styled.CheckboxSVG, null) : /*#__PURE__*/React.createElement(Styled.CloseSVG, null), /*#__PURE__*/React.createElement("span", null, attribute.label));
    }));
  };
  var handleChange = function handleChange(e) {
    var _e$target;
    var targetValue = (e === null || e === void 0 || (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) || '';
    var passwordStrength = getPasswordStrength(targetValue);
    setValue(targetValue);
    selectStrengthTheme(passwordStrength.score);
    selectAttributes(passwordStrength);
    if (onChange) {
      onChange(e, passwordStrength.score);
    }
  };
  return /*#__PURE__*/React.createElement(Styled.PasswordStrengthContainer, null, /*#__PURE__*/React.createElement(LabeledInput, {
    id: "password",
    type: "password",
    label: label,
    value: value,
    onChange: handleChange,
    placeholder: placeholder || '',
    maxLength: maxLength,
    error: hasError,
    helperText: helperText
  }), /*#__PURE__*/React.createElement(Styled.StrengthScore, {
    style: {
      marginTop: '18px'
    },
    "data-color": color,
    "data-progress": progress
  }), /*#__PURE__*/React.createElement(Styled.PasswordCharacteristicsContainer, null, attributes));
};
/* harmony default export */ var src_PasswordStrength = ((/* unused pure expression or super */ null && (PasswordStrength)));
// EXTERNAL MODULE: ../../modules/ui/code/content-icons/src/index.tsx + 94 modules
var src = __webpack_require__(9854);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Embed/styles.tsx


var EmbedContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__EmbedContainer",
  componentId: "sc-1eouj1k-0"
})(["width:19%;height:25%;"]);
var ContentContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__ContentContainer",
  componentId: "sc-1eouj1k-1"
})(["", " width:", "px;height:", "px;position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;"], function (props) {
  if (!props.isValid) {
    return "background-color: ".concat(componentsTheme.embed.containerBackground, ";");
  }
  return '';
}, function (props) {
  return props.embedWidth;
}, function (props) {
  return props.embedHeight;
});
var EmbedCover = styled_components_browser_esm.img.withConfig({
  displayName: "styles__EmbedCover",
  componentId: "sc-1eouj1k-2"
})(["width:100%;height:100%;object-fit:cover;"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Embed/index.tsx

/* eslint-disable react/no-danger */





var Embed = function Embed(_ref) {
  var _ref$embedCode = _ref.embedCode,
    embedCode = _ref$embedCode === void 0 ? '' : _ref$embedCode,
    _ref$embedCover = _ref.embedCover,
    embedCover = _ref$embedCover === void 0 ? '' : _ref$embedCover,
    _ref$embedWidth = _ref.embedWidth,
    embedWidth = _ref$embedWidth === void 0 ? componentsTheme.embed.containerWidth : _ref$embedWidth,
    _ref$embedHeight = _ref.embedHeight,
    embedHeight = _ref$embedHeight === void 0 ? componentsTheme.embed.containerHeight : _ref$embedHeight;
  var validateContent = function validateContent() {
    var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
    var content = {
      isValid: false,
      embed: ''
    };
    var div = document.createElement('div');
    div.innerHTML = value;
    var iframe = div.querySelector('iframe');
    if (iframe && typeof_typeof(iframe) === 'object' && iframe instanceof HTMLIFrameElement) {
      var src = iframe.getAttribute('src');
      iframe.setAttribute('frameborder', '0');
      iframe.setAttribute('width', '100%');
      iframe.setAttribute('height', '100%');
      iframe.setAttribute('allowfullscreen', 'false');
      iframe.setAttribute('tabIndex', "".concat(TabIndex.UNREACHABLE));
      content.isValid = !!src;
      content.embed = div.innerHTML;
    }
    return content;
  };
  var content = validateContent(embedCode);
  var embedContent = embedCover === '' ? /*#__PURE__*/react.createElement(EmbedContainer, null, /*#__PURE__*/react.createElement(src.EmbedViewIcon, {
    fill: componentsTheme.embed.iconColor
  })) : /*#__PURE__*/react.createElement(EmbedCover, {
    src: embedCover
  });
  if (content.embed && content.isValid) {
    return /*#__PURE__*/react.createElement("div", {
      style: {
        width: '100%',
        height: '100%'
      },
      dangerouslySetInnerHTML: {
        __html: content.embed
      }
    });
  }
  return /*#__PURE__*/react.createElement(ContentContainer, {
    isValid: content.isValid && !!content.embed,
    embedWidth: embedWidth,
    embedHeight: embedHeight
  }, embedContent);
};
/* harmony default export */ var src_Embed = (Embed);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PulsatingIcon/style.tsx

var rotate = Ue(["0%{transform:scale3d(1,1,1);}50%{transform:scale3d(0.77,0.77,1);}100%{transform:scale3d(1,1,1);}"]);
var Pulsating = styled_components_browser_esm.div.withConfig({
  displayName: "style__Pulsating",
  componentId: "sc-46itd1-0"
})(["height:", "px;width:", "px;", " display:inline-block;animation:", " 1.2s  infinite;will-change:contents;"], function (_ref) {
  var $height = _ref.$height;
  return $height;
}, function (_ref2) {
  var $width = _ref2.$width;
  return $width;
}, function (_ref3) {
  var alpha = _ref3.alpha;
  return typeof alpha === 'number' ? "opacity: ".concat(alpha, ";") : '';
}, rotate);
var NotPulsating = styled_components_browser_esm.div.withConfig({
  displayName: "style__NotPulsating",
  componentId: "sc-46itd1-1"
})(["height:", "px;width:", "px;", " display:inline-block;"], function (_ref4) {
  var $height = _ref4.$height;
  return $height;
}, function (_ref5) {
  var $width = _ref5.$width;
  return $width;
}, function (_ref6) {
  var alpha = _ref6.alpha;
  return typeof alpha === 'number' ? "opacity: ".concat(alpha, ";") : '';
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PulsatingIcon/index.tsx



var PulsatingIcon = function PulsatingIcon(props) {
  var Component = props.isPulsating ? Pulsating : NotPulsating;
  return /*#__PURE__*/react.createElement(Component, {
    $width: props.width,
    $height: props.height,
    alpha: typeof props.alpha === 'number' ? props.alpha : 1
  }, props.children);
};
PulsatingIcon.propTypes = {
  isPulsating: (prop_types_default()).bool,
  height: (prop_types_default()).number.isRequired,
  width: (prop_types_default()).number.isRequired,
  alpha: (prop_types_default()).number.isRequired,
  children: prop_types_default().oneOfType([prop_types_default().arrayOf((prop_types_default()).node), (prop_types_default()).node]).isRequired
};
PulsatingIcon.defaultProps = {
  isPulsating: true
};
/* harmony default export */ var src_PulsatingIcon = (PulsatingIcon);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/IconButton/types.tsx
var ButtonVariants = /*#__PURE__*/function (ButtonVariants) {
  ButtonVariants["CONTAINED"] = "CONTAINED";
  ButtonVariants["OUTLINED"] = "OUTLINED";
  return ButtonVariants;
}({});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/IconButton/styles.tsx


var Svg = styled_components_browser_esm.div.withConfig({
  displayName: "styles__Svg",
  componentId: "sc-1qx7kkg-0"
})(["display:flex;justify-content:center;height:55%;margin:auto;svg{fill:", ";}"], function (props) {
  return props.svgFill;
});
var SvgWithLabel = styled_components_browser_esm.div.withConfig({
  displayName: "styles__SvgWithLabel",
  componentId: "sc-1qx7kkg-1"
})(["height:", ";display:flex;justify-content:center;width:", "px;margin-left:", "px;margin-right:", "px;svg{fill:", ";}"], function (props) {
  return props.fullSizeIcon ? '100%' : '50%';
}, function (props) {
  return props.width;
}, function (props) {
  return props.marginLeftAndRight;
}, function (props) {
  return props.marginLeftAndRight;
}, function (props) {
  return props.svgFill;
});
var LabelStyle = styled_components_browser_esm.span.withConfig({
  displayName: "styles__LabelStyle",
  componentId: "sc-1qx7kkg-2"
})(["", " ", " ", " color:", ";white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"], function (props) {
  return props.fontSize ? "font-size: ".concat(props.fontSize, "px;") : '';
}, function (props) {
  return props.fontSize ? "line-height: ".concat(props.fontSize, "px;") : '';
}, function (props) {
  return props.fontWeight ? "font-weight: ".concat(props.fontWeight, ";") : '';
}, function (props) {
  return props.labelColor;
});
var StyleIconButton = styled_components_browser_esm.div.withConfig({
  displayName: "styles__StyleIconButton",
  componentId: "sc-1qx7kkg-3"
})(["transition:background-color .1s linear;background:", ";", " width:", ";height:", ";border:", ";border-radius:", ";display:flex;align-items:center;", " overflow:hidden;text-decoration:none;", " ", ""], function (props) {
  return props.variant === ButtonVariants.OUTLINED ? 'transparent' : props.bgColor;
}, function (_ref) {
  var alpha = _ref.alpha;
  return typeof alpha === 'number' ? "opacity: ".concat(alpha, ";") : '';
}, function (props) {
  return props.width ? "".concat(props.width, "px") : 'auto';
}, function (props) {
  return props.height ? "".concat(props.height, "px") : '100%';
}, function (props) {
  return props.variant === ButtonVariants.OUTLINED ? "1px solid ".concat(props.borderColor) : 'none';
}, function (props) {
  return props.radius;
}, function (props) {
  return props.centeredText ? 'justify-content: center;' : '';
}, function (props) {
  return props.padding ? "padding: ".concat(props.padding, ";") : '';
}, function (props) {
  return props.hoverColor ? "\n            &:hover {\n                background-color: ".concat(props.hoverColor, ";\n                }\n            };\n        ") : '';
});
var StyleIconA = StyleIconButton.withComponent('a');
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/IconButton/getIconContrastColor.ts
/**
 * Returns an appropriate color (black/white) for icon
 * @param color
 * @return color
 */
/* harmony default export */ var getIconContrastColor = (function (color) {
  // TODO: Return contrast color for other colors closed to white
  if (color && (color === '#fff' || color === '#ffffff')) {
    return '#000';
  }
  return '#fff';
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/IconButton/index.tsx







var _componentsTheme$icon = componentsTheme.iconButton,
  iconLeftRightMargin = _componentsTheme$icon.iconLeftRightMargin,
  iconScaleFactor = _componentsTheme$icon.iconScaleFactor,
  iconWidth = _componentsTheme$icon.iconWidth,
  defaultFontSize = _componentsTheme$icon.fontSize,
  fontScaleFactor = _componentsTheme$icon.fontScaleFactor,
  buttonBackground = _componentsTheme$icon.buttonBackground,
  buttonOpacity = _componentsTheme$icon.buttonOpacity,
  buttonRadius = _componentsTheme$icon.buttonRadius;
var getAlpha = function getAlpha(alpha) {
  if (alpha !== null) {
    return alpha !== undefined ? alpha : buttonOpacity;
  }
  return null;
};
var src_IconButton_IconButton = function IconButton(_ref) {
  var bgColor = _ref.bgColor,
    alpha = _ref.alpha,
    width = _ref.width,
    height = _ref.height,
    radius = _ref.radius,
    label = _ref.label,
    labelColor = _ref.labelColor,
    icon = _ref.icon,
    href = _ref.href,
    variant = _ref.variant,
    padding = _ref.padding,
    centeredText = _ref.centeredText,
    fontSize = _ref.fontSize,
    hoverColor = _ref.hoverColor,
    fontWeight = _ref.fontWeight,
    shape = _ref.shape,
    fullSizeIcon = _ref.fullSizeIcon,
    tabIndex = _ref.tabIndex;
  var marginLeftAndRight = height ? height * iconLeftRightMargin / iconScaleFactor : 0;
  var contrastColor = getIconContrastColor(bgColor);
  var iconAndLabelColor = labelColor || contrastColor || componentsTheme.iconButton.labelColor;
  var opacity = getAlpha(alpha);
  var renderLabel = label ? /*#__PURE__*/react.createElement(LabelStyle, {
    fontSize: fontSize || (height ? height * defaultFontSize / fontScaleFactor : 0),
    labelColor: iconAndLabelColor,
    fontWeight: fontWeight,
    "aria-hidden": true
  }, label) : null;
  var ButtonContent = /*#__PURE__*/react.createElement(react.Fragment, null, label && icon ? /*#__PURE__*/react.createElement(SvgWithLabel, {
    width: height ? height * iconWidth / iconScaleFactor : 0,
    marginLeftAndRight: marginLeftAndRight,
    svgFill: iconAndLabelColor,
    fullSizeIcon: fullSizeIcon,
    "aria-hidden": true
  }, icon) : icon && /*#__PURE__*/react.createElement(Svg, {
    svgFill: iconAndLabelColor,
    "aria-hidden": true
  }, icon), renderLabel);
  return /*#__PURE__*/react.createElement("div", {
    style: {
      width: "".concat(width ? "".concat(width, "px") : '100%'),
      height: "".concat(height ? "".concat(height, "px") : '100%')
    },
    "aria-hidden": true
  }, href ? /*#__PURE__*/react.createElement(StyleIconA, {
    bgColor: bgColor,
    borderColor: labelColor,
    alpha: opacity,
    radius: radius,
    variant: variant,
    href: href,
    padding: padding,
    centeredText: centeredText,
    hoverColor: hoverColor,
    rel: "nofollow noopener",
    role: "button",
    target: "_blank",
    tabIndex: tabIndex !== null && tabIndex !== void 0 ? tabIndex : TabIndex.UNREACHABLE,
    "aria-label": label
  }, ButtonContent) : /*#__PURE__*/react.createElement(StyleIconButton, {
    bgColor: bgColor,
    alpha: opacity,
    radius: radius,
    variant: variant,
    borderColor: labelColor,
    padding: padding,
    centeredText: centeredText,
    hoverColor: hoverColor,
    shape: shape
  }, ButtonContent));
};
src_IconButton_IconButton.propTypes = {
  icon: (prop_types_default()).element,
  bgColor: (prop_types_default()).string,
  alpha: (prop_types_default()).number,
  width: (prop_types_default()).number,
  height: (prop_types_default()).number,
  radius: (prop_types_default()).string,
  label: (prop_types_default()).string,
  labelColor: (prop_types_default()).string,
  href: (prop_types_default()).string,
  variant: prop_types_default().oneOf(Object.values(ButtonVariants)),
  padding: (prop_types_default()).string,
  centeredText: (prop_types_default()).bool,
  fontSize: (prop_types_default()).number,
  hoverColor: (prop_types_default()).string,
  shape: (prop_types_default()).string
};
src_IconButton_IconButton.defaultProps = {
  icon: null,
  bgColor: buttonBackground,
  alpha: null,
  width: 0,
  height: 0,
  radius: buttonRadius,
  label: '',
  labelColor: '',
  href: '',
  variant: ButtonVariants.CONTAINED,
  padding: '',
  centeredText: false,
  fontSize: 0,
  hoverColor: '',
  shape: ''
};
/* harmony default export */ var src_IconButton = (src_IconButton_IconButton);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Image/styles.tsx

var Vignette = styled_components_browser_esm.div.withConfig({
  displayName: "styles__Vignette",
  componentId: "sc-1wqmzvm-0"
})(["width:", "px;height:", "px;position:absolute;box-shadow:", ";z-index:1;"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (props) {
  return props.$boxShadow;
});
var CropContainerDiv = styled_components_browser_esm.div.withConfig({
  displayName: "styles__CropContainerDiv",
  componentId: "sc-1wqmzvm-1"
})(["width:", "px;height:", "px;position:relative;overflow:hidden;"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
});
var CropImageWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "styles__CropImageWrapper",
  componentId: "sc-1wqmzvm-2"
})(["top:", "px;left:", "px;position:absolute;overflow:hidden;"], function (props) {
  return props.$cropTop;
}, function (props) {
  return props.$cropLeft;
});
var ImageWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "styles__ImageWrapper",
  componentId: "sc-1wqmzvm-3"
})(["width:", "px;height:", "px;opacity:", ";"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (props) {
  return props.$opacity;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Shadow/styles.tsx

var ShadowDiv = styled_components_browser_esm.div.withConfig({
  displayName: "styles__ShadowDiv",
  componentId: "sc-rx3edh-0"
})(["filter:", ""], function (props) {
  return "\n        drop-shadow(rgba(".concat(props.shadowR, ",\n        ").concat(props.shadowG, ",\n        ").concat(props.shadowB, ",\n        ").concat(props.shadowA, ") ").concat(props.offsetX, "px ").concat(props.offsetY, "px ").concat(props.shadowBlur, "px);\n    ");
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Shadow/index.tsx



var Shadow = function Shadow(_ref) {
  var shadow = _ref.shadow,
    offsetX = _ref.offsetX,
    offsetY = _ref.offsetY,
    shadowBlur = _ref.shadowBlur,
    children = _ref.children,
    shadowR = _ref.shadowR,
    shadowG = _ref.shadowG,
    shadowB = _ref.shadowB,
    shadowA = _ref.shadowA;
  if (shadow) {
    return /*#__PURE__*/react.createElement(ShadowDiv, {
      offsetX: offsetX,
      offsetY: offsetY,
      shadowBlur: shadowBlur,
      shadowR: shadowR,
      shadowG: shadowG,
      shadowB: shadowB,
      shadowA: shadowA
    }, children);
  }
  return children;
};
Shadow.propTypes = {
  shadow: (prop_types_default()).bool,
  offsetX: (prop_types_default()).number,
  offsetY: (prop_types_default()).number,
  shadowBlur: (prop_types_default()).number,
  shadowR: (prop_types_default()).number,
  shadowG: (prop_types_default()).number,
  shadowB: (prop_types_default()).number,
  shadowA: (prop_types_default()).number
};
Shadow.defaultProps = {
  shadow: false,
  offsetX: 10,
  offsetY: 10,
  shadowBlur: 0,
  shadowR: 0,
  shadowG: 0,
  shadowB: 0,
  shadowA: 1
};
/* harmony default export */ var src_Shadow = (Shadow);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/RoundedBorder/style.tsx

var RoundedBorderDiv = styled_components_browser_esm.div.withConfig({
  displayName: "style__RoundedBorderDiv",
  componentId: "sc-1ohnbgf-0"
})(["border:", ";border-radius:", "px;width:", "px;height:", "px;position:absolute;overflow:hidden;"], function (props) {
  return "".concat(props.$borderWidth, "px solid ").concat(props.$borderColor);
}, function (props) {
  return props.$borderRadius;
}, function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
});
var ContinerDiv = styled_components_browser_esm.div.withConfig({
  displayName: "style__ContinerDiv",
  componentId: "sc-1ohnbgf-1"
})(["background-color:transparent;width:", "px;height:", "px;overflow:hidden;"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/RoundedBorder/index.tsx



var RoundedBorder = function RoundedBorder(_ref) {
  var width = _ref.width,
    height = _ref.height,
    borderWidth = _ref.borderWidth,
    borderColor = _ref.borderColor,
    borderRadius = _ref.borderRadius,
    children = _ref.children;
  if (borderWidth || borderRadius) {
    var decreaseBorderWidth = borderWidth ? borderWidth * 2 : 0;
    return /*#__PURE__*/react.createElement(RoundedBorderDiv, {
      $width: width,
      $height: height,
      $borderWidth: borderWidth,
      $borderColor: borderColor,
      $borderRadius: borderRadius
    }, /*#__PURE__*/react.createElement(ContinerDiv, {
      $width: width - decreaseBorderWidth,
      $height: height - decreaseBorderWidth
    }, children));
  }
  return /*#__PURE__*/react.createElement(ContinerDiv, {
    $width: width,
    $height: height
  }, children);
};
RoundedBorder.propTypes = {
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  borderWidth: (prop_types_default()).number,
  borderColor: (prop_types_default()).string,
  borderRadius: (prop_types_default()).number
};
RoundedBorder.defaultProps = {
  borderWidth: 0,
  borderColor: '',
  borderRadius: 0
};
/* harmony default export */ var src_RoundedBorder = (RoundedBorder);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Image/ImageFilters/styles.tsx

var FiltersDiv = styled_components_browser_esm.div.withConfig({
  displayName: "styles__FiltersDiv",
  componentId: "sc-zoibg4-0"
})(["position:absolute;display:block;", ";", ";filter:", ";"], function (_ref) {
  var width = _ref.width;
  return width ? "width: ".concat(width) : '';
}, function (_ref2) {
  var height = _ref2.height;
  return height ? "height: ".concat(height) : '';
}, function (props) {
  return "\n    ".concat(props.contrast ? "contrast(".concat(props.contrast, ")") : '', "\n    ").concat(typeof props.saturate === 'number' ? "saturate(".concat(props.saturate, ")") : '', "\n    ").concat(props.sepia ? "sepia(".concat(props.sepia, ")") : '', "\n    ").concat(props.brightness ? "brightness(".concat(props.brightness, ")") : '', "\n    ").concat(props.blur ? "blur(".concat(props.blur, "px)") : '', "\n    ").concat(props.hueRotate ? "hue-rotate(".concat(props.hueRotate, "turn)") : '', "\n    ");
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Image/ImageFilters/index.tsx


var ImageFilters = function ImageFilters(_ref) {
  var blur = _ref.blur,
    hueRotate = _ref.hueRotate,
    contrast = _ref.contrast,
    saturate = _ref.saturate,
    sepia = _ref.sepia,
    brightness = _ref.brightness,
    children = _ref.children,
    width = _ref.width,
    height = _ref.height;
  return /*#__PURE__*/react.createElement(FiltersDiv, {
    blur: blur,
    hueRotate: hueRotate,
    contrast: contrast,
    saturate: saturate,
    sepia: sepia,
    brightness: brightness,
    width: width,
    height: height
  }, children);
};
/* harmony default export */ var Image_ImageFilters = (ImageFilters);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Image/index.tsx







var getVignetteStyle = function getVignetteStyle(vignette, width, height) {
  var imgSize = Math.min(width, height);
  var alpha = Math.max(typeof vignette === 'number' ? vignette : 0, 0.01);
  var blurRadius = imgSize / 2;
  var spreadRadius = blurRadius / 4;
  return "rgba(0,0,0,".concat(alpha, ") 0 0 ").concat(blurRadius, "px ").concat(spreadRadius, "px inset");
};
var Image_Image = function Image(_ref) {
  var width = _ref.width,
    height = _ref.height,
    src = _ref.src,
    _ref$fallbackSrc = _ref.fallbackSrc,
    fallbackSrc = _ref$fallbackSrc === void 0 ? '' : _ref$fallbackSrc,
    alt = _ref.alt,
    filtersData = _ref.filtersData,
    cropData = _ref.cropData,
    shadowData = _ref.shadowData,
    roundedBorderData = _ref.roundedBorderData,
    opacity = _ref.opacity,
    imageScale = _ref.imageScale,
    _ref$countImages = _ref.countImages,
    countImages = _ref$countImages === void 0 ? function () {} : _ref$countImages,
    _ref$countImagesLoade = _ref.countImagesLoaded,
    countImagesLoaded = _ref$countImagesLoade === void 0 ? function () {} : _ref$countImagesLoade,
    hideCropContainer = _ref.hideCropContainer;
  var _ref2 = filtersData,
    blur = _ref2.blur,
    hueRotate = _ref2.hueRotate,
    contrast = _ref2.contrast,
    saturate = _ref2.saturate,
    sepia = _ref2.sepia,
    brightness = _ref2.brightness;
  var _ref3 = filtersData,
    vignette = _ref3.vignette;
  var _ref4 = roundedBorderData,
    borderColor = _ref4.borderColor,
    borderRadius = _ref4.borderRadius,
    borderWidth = _ref4.borderWidth;
  var _ref5 = cropData,
    cropWidth = _ref5.cropWidth,
    cropHeight = _ref5.cropHeight,
    cropTop = _ref5.cropTop,
    cropLeft = _ref5.cropLeft;
  var _ref6 = shadowData,
    offsetX = _ref6.offsetX,
    offsetY = _ref6.offsetY,
    shadow = _ref6.shadow,
    shadowA = _ref6.shadowA,
    shadowB = _ref6.shadowB,
    shadowBlur = _ref6.shadowBlur,
    shadowG = _ref6.shadowG,
    shadowR = _ref6.shadowR;
  var vignetteStyle = getVignetteStyle(vignette, width, height);
  var decreaseBorderWidth = borderWidth ? borderWidth * 2 : 0;
  var image = /*#__PURE__*/react.createElement(src_BaseImage, {
    width: width - decreaseBorderWidth,
    height: height - decreaseBorderWidth,
    src: src,
    alt: alt,
    objectFit: hideCropContainer ? 'cover' : 'fill',
    fallbackSrc: fallbackSrc,
    imageScale: imageScale,
    setCountImages: countImages,
    setCountImagesLoaded: countImagesLoaded
  });
  return /*#__PURE__*/react.createElement(ImageWrapper, {
    $width: cropWidth || width,
    $height: cropHeight || height,
    $opacity: opacity
  }, /*#__PURE__*/react.createElement(src_Shadow, {
    shadow: shadow,
    offsetX: offsetX,
    offsetY: offsetY,
    shadowBlur: shadowBlur,
    shadowR: shadowR,
    shadowG: shadowG,
    shadowB: shadowB,
    shadowA: shadowA
  }, /*#__PURE__*/react.createElement(src_RoundedBorder, {
    width: cropWidth || width,
    height: cropHeight || height,
    borderWidth: borderWidth,
    borderColor: borderColor,
    borderRadius: borderRadius
  }, /*#__PURE__*/react.createElement(Image_ImageFilters, {
    blur: blur,
    hueRotate: hueRotate,
    contrast: contrast,
    saturate: saturate,
    sepia: sepia,
    brightness: brightness,
    width: hideCropContainer ? '100%' : '',
    height: hideCropContainer ? '100%' : ''
  }, /*#__PURE__*/react.createElement(react.Fragment, null, vignette > 0 && /*#__PURE__*/react.createElement(Vignette, {
    $width: cropWidth || width,
    $height: cropHeight || height,
    $boxShadow: vignetteStyle
  }), cropHeight || cropWidth ? /*#__PURE__*/react.createElement(CropContainerDiv, {
    $width: cropWidth,
    $height: cropHeight
  }, /*#__PURE__*/react.createElement(CropImageWrapper, {
    $cropTop: cropTop,
    $cropLeft: cropLeft
  }, image)) : image)))));
};
Image_Image.propTypes = {
  src: (prop_types_default()).string.isRequired,
  fallbackSrc: (prop_types_default()).string,
  alt: (prop_types_default()).string,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  opacity: (prop_types_default()).number,
  filtersData: prop_types_default().shape({
    vignette: (prop_types_default()).number,
    blur: (prop_types_default()).number,
    hueRotate: (prop_types_default()).number,
    contrast: (prop_types_default()).number,
    saturate: (prop_types_default()).number,
    sepia: (prop_types_default()).number,
    brightness: (prop_types_default()).number
  }),
  cropData: prop_types_default().shape({
    cropWidth: (prop_types_default()).number,
    cropHeight: (prop_types_default()).number,
    cropTop: (prop_types_default()).number,
    cropLeft: (prop_types_default()).number
  }),
  shadowData: prop_types_default().shape({
    shadow: (prop_types_default()).bool,
    offsetX: (prop_types_default()).number,
    offsetY: (prop_types_default()).number,
    shadowBlur: (prop_types_default()).number,
    shadowR: (prop_types_default()).number,
    shadowG: (prop_types_default()).number,
    shadowB: (prop_types_default()).number,
    shadowA: (prop_types_default()).number
  }),
  roundedBorderData: prop_types_default().shape({
    borderWidth: (prop_types_default()).number,
    borderColor: (prop_types_default()).string,
    borderRadius: (prop_types_default()).number
  }),
  imageScale: prop_types_default().shape({
    x: (prop_types_default()).number,
    y: (prop_types_default()).number
  }),
  countImages: (prop_types_default()).func,
  countImagesLoaded: (prop_types_default()).func,
  hideCropContainer: (prop_types_default()).bool
};
Image_Image.defaultProps = {
  alt: '',
  fallbackSrc: '',
  opacity: 1,
  filtersData: {
    vignette: 0,
    blur: 0,
    hueRotate: 0,
    contrast: 1,
    saturate: 1,
    sepia: 0,
    brightness: 1
  },
  cropData: {
    cropWidth: 0,
    cropHeight: 0,
    cropTop: 0,
    cropLeft: 0
  },
  shadowData: {
    shadow: false,
    offsetX: 10,
    offsetY: 10,
    shadowBlur: 0,
    shadowR: 0,
    shadowG: 0,
    shadowB: 0,
    shadowA: 1
  },
  roundedBorderData: {
    borderWidth: 0,
    borderColor: '',
    borderRadius: 0
  },
  imageScale: {
    x: 1,
    y: 1
  },
  hideCropContainer: true,
  countImages: function countImages() {},
  countImagesLoaded: function countImagesLoaded() {}
};
/* harmony default export */ var src_Image = (Image_Image);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ImageMask/styles.tsx

var MaskContainer = styled_components_browser_esm.div.attrs(function (props) {
  return {
    style: {
      width: "".concat(props.containerWidth, "px"),
      height: "".concat(props.containerHeight, "px")
    }
  };
}).withConfig({
  displayName: "styles__MaskContainer",
  componentId: "sc-83zlrw-0"
})([""]);
var MaskStyled = styled_components_browser_esm.svg.withConfig({
  displayName: "styles__MaskStyled",
  componentId: "sc-83zlrw-1"
})(["width:100%;height:100%;opacity:", ";overflow:visible;"], function (_ref) {
  var opacity = _ref.opacity;
  return opacity;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ImageMask/index.tsx




var ImageMask = function ImageMask(_ref) {
  var url = _ref.url,
    alpha = _ref.alpha,
    containerWidth = _ref.containerWidth,
    containerHeight = _ref.containerHeight,
    shapeProps = _ref.shapeProps,
    renderCount = _ref.renderCount,
    _ref$onLoad = _ref.onLoad,
    onLoad = _ref$onLoad === void 0 ? function () {} : _ref$onLoad,
    fallbackSrc = _ref.fallbackSrc,
    _ref$objectFit = _ref.objectFit,
    objectFit = _ref$objectFit === void 0 ? OBJECT_FIT_VALUES.COVER : _ref$objectFit;
  var imageUrl = url || fallbackSrc;
  var shapeId = shapeProps.shapeId,
    patternId = shapeProps.patternId;
  var imageRef = (0,react.useRef)(null);
  var onError = function onError() {
    var _imageRef$current;
    if (fallbackSrc && (imageRef === null || imageRef === void 0 || (_imageRef$current = imageRef.current) === null || _imageRef$current === void 0 ? void 0 : _imageRef$current.getAttribute('href')) !== fallbackSrc) {
      var _imageRef$current2;
      imageRef === null || imageRef === void 0 || (_imageRef$current2 = imageRef.current) === null || _imageRef$current2 === void 0 || _imageRef$current2.setAttribute('href', fallbackSrc);
    }
  };
  (0,react.useEffect)(function () {
    var imageElement = imageRef.current;
    if (imageElement) {
      imageElement.addEventListener('load', onLoad);
      imageElement.addEventListener('error', onError);
      imageElement.setAttribute('href', imageUrl);
    }
    return function () {
      if (imageElement) {
        imageElement.removeEventListener('load', onLoad);
        imageElement.removeEventListener('error', onError);
      }
    };
  }, [imageUrl]);
  return imageUrl && imageUrl.length > 0 ? /*#__PURE__*/react.createElement(MaskContainer, {
    containerWidth: containerWidth,
    containerHeight: containerHeight
  }, /*#__PURE__*/react.createElement(MaskStyled, {
    xmlns: "http://www.w3.org/2000/svg",
    xmlnsXlink: "http://www.w3.org/1999/xlink",
    viewBox: "0 0 ".concat(containerWidth, " ").concat(containerHeight),
    version: "1.1",
    opacity: alpha
  }, /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("pattern", {
    id: "pattern-".concat(patternId, "-").concat(renderCount),
    patternUnits: "objectBoundingBox",
    patternContentUnits: "objectBoundingBox",
    width: "1",
    height: "1",
    viewBox: "0 0 ".concat(containerWidth, " ").concat(containerHeight),
    preserveAspectRatio: "none"
  }, /*#__PURE__*/react.createElement("image", {
    ref: imageRef,
    width: "100%",
    height: "100%",
    x: "0",
    y: "0",
    href: imageUrl,
    preserveAspectRatio: "xMidYMid ".concat(objectFit === OBJECT_FIT_VALUES.CONTAIN ? PRESERVE_ASPECT_RATIO_MODES.MEET : PRESERVE_ASPECT_RATIO_MODES.SLICE)
  }))), /*#__PURE__*/react.createElement("use", {
    href: "#icon-".concat(shapeId),
    fill: "url(#pattern-".concat(patternId, "-").concat(renderCount, ")")
  }))) : null;
};
ImageMask.propTypes = {
  url: (prop_types_default()).string.isRequired,
  shapeProps: prop_types_default().shape({
    shapeId: (prop_types_default()).string.isRequired,
    patternId: (prop_types_default()).number.isRequired
  }).isRequired,
  containerWidth: (prop_types_default()).number.isRequired,
  containerHeight: (prop_types_default()).number.isRequired,
  renderCount: (prop_types_default()).number,
  onLoad: (prop_types_default()).func,
  fallbackSrc: (prop_types_default()).string,
  objectFit: (prop_types_default()).string
};
ImageMask.defaultProps = {
  renderCount: 0,
  onLoad: function onLoad() {},
  fallbackSrc: ''
};
/* harmony default export */ var src_ImageMask = (ImageMask);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ImageMask/exportImageMask.tsx





var ImageMaskClipPath = function ImageMaskClipPath(_ref) {
  var url = _ref.url,
    containerWidth = _ref.containerWidth,
    containerHeight = _ref.containerHeight,
    shapeProps = _ref.shapeProps,
    viewBox = _ref.viewBox,
    svgPath = _ref.svgPath,
    alpha = _ref.alpha,
    fallbackSrc = _ref.fallbackSrc,
    _ref$objectFit = _ref.objectFit,
    objectFit = _ref$objectFit === void 0 ? OBJECT_FIT_VALUES.COVER : _ref$objectFit;
  var imageUrl = url || '';
  var shapeId = shapeProps.shapeId;
  var ref = (0,react.useRef)(null);
  var imageRef = (0,react.useRef)(null);
  var svgSize = viewBox.split(' ');
  var onError = function onError() {
    var _imageRef$current;
    if (fallbackSrc && (imageRef === null || imageRef === void 0 || (_imageRef$current = imageRef.current) === null || _imageRef$current === void 0 ? void 0 : _imageRef$current.getAttribute('href')) !== fallbackSrc) {
      var _imageRef$current2;
      imageRef === null || imageRef === void 0 || (_imageRef$current2 = imageRef.current) === null || _imageRef$current2 === void 0 || _imageRef$current2.setAttribute('href', fallbackSrc);
    }
  };
  (0,react.useEffect)(function () {
    var imageElement = imageRef.current;
    if (imageElement) {
      imageElement.addEventListener('error', onError);
    }
    return function () {
      if (imageElement) {
        imageElement.removeEventListener('error', onError);
      }
    };
  }, []);
  (0,react.useLayoutEffect)(function () {
    var _ref$current;
    var _svgSize = slicedToArray_slicedToArray(svgSize, 4),
      svgWidth = _svgSize[2],
      svgHeight = _svgSize[3];
    var scaleWidth = containerWidth / (parseInt(svgWidth, 10) || 1);
    var scaleHeight = containerHeight / (parseInt(svgHeight, 10) || 1);
    if (ref !== null && ref !== void 0 && (_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.style) {
      ref.current.style.transform = "scale(".concat(scaleWidth, ", ").concat(scaleHeight, ")");
    }
  }, [containerHeight, containerWidth]);
  return imageUrl && imageUrl.length > 0 ? /*#__PURE__*/react.createElement(MaskContainer, {
    containerWidth: containerWidth,
    containerHeight: containerHeight
  }, /*#__PURE__*/react.createElement(MaskStyled, {
    xmlns: "http://www.w3.org/2000/svg",
    xmlnsXlink: "http://www.w3.org/1999/xlink",
    opacity: alpha
  }, /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("clipPath", {
    /* eslint-disable-next-line */
    viewBox: viewBox,
    ref: ref,
    id: "clip-".concat(shapeId),
    xmlns: "http://www.w3.org/2000/svg",
    stroke: "none",
    preserveAspectRatio: "none",
    dangerouslySetInnerHTML: {
      __html: svgPath
    }
  })), /*#__PURE__*/react.createElement("image", {
    ref: imageRef,
    clipPath: "url(#clip-".concat(shapeId, ")"),
    width: "100%",
    height: "100%",
    x: "0",
    y: "0",
    href: imageUrl,
    preserveAspectRatio: "xMidYMid ".concat(objectFit === OBJECT_FIT_VALUES.CONTAIN ? PRESERVE_ASPECT_RATIO_MODES.MEET : PRESERVE_ASPECT_RATIO_MODES.SLICE)
  }))) : null;
};
ImageMaskClipPath.propTypes = {
  url: (prop_types_default()).string.isRequired,
  shapeProps: prop_types_default().shape({
    shapeId: (prop_types_default()).string.isRequired,
    patternId: (prop_types_default()).number.isRequired
  }).isRequired,
  containerWidth: (prop_types_default()).number.isRequired,
  containerHeight: (prop_types_default()).number.isRequired,
  viewBox: (prop_types_default()).string.isRequired
};
/* harmony default export */ var exportImageMask = (ImageMaskClipPath);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/CaptionButton/styles.tsx

var ButtonStyle = styled_components_browser_esm.div.withConfig({
  displayName: "styles__ButtonStyle",
  componentId: "sc-vsrv6j-0"
})(["width:50%;height:50%;margin-left:25%;"]);
var Container = styled_components_browser_esm.div.withConfig({
  displayName: "styles__Container",
  componentId: "sc-vsrv6j-1"
})(["width:", "px;height:", "px;background-color:", ";border-radius:", ";display:flex;align-items:center;overflow:hidden;"], function (props) {
  return props.width;
}, function (props) {
  return props.height;
}, function (props) {
  return props.buttonColor;
}, function (props) {
  return props.buttonRadius;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/CaptionButton/index.tsx





var CaptionButton = function CaptionButton(_ref) {
  var buttonRadius = _ref.buttonRadius,
    selected = _ref.selected,
    width = _ref.width,
    height = _ref.height,
    buttonColor = _ref.buttonColor,
    iconColor = _ref.iconColor;
  var buttonRef = (0,react.useRef)(null);
  return /*#__PURE__*/react.createElement(Container, {
    width: width,
    height: height,
    buttonColor: buttonColor,
    buttonRadius: buttonRadius,
    role: "button",
    tabIndex: 0,
    ref: buttonRef
  }, /*#__PURE__*/react.createElement(ButtonStyle, null, selected ? /*#__PURE__*/react.createElement(src.MinusIcon, {
    fill: iconColor
  }) : /*#__PURE__*/react.createElement(src.PlusIcon, {
    fill: iconColor
  })));
};
CaptionButton.propTypes = {
  buttonRadius: (prop_types_default()).string,
  selected: (prop_types_default()).bool,
  width: (prop_types_default()).number,
  height: (prop_types_default()).number,
  buttonColor: (prop_types_default()).string,
  iconColor: (prop_types_default()).string
};
CaptionButton.defaultProps = {
  buttonRadius: componentsTheme.iconButton.buttonRadius,
  selected: false,
  width: componentsTheme.iconButton.buttonWidth,
  height: componentsTheme.iconButton.buttonHeight,
  buttonColor: componentsTheme.iconButton.buttonBackground,
  iconColor: componentsTheme.iconButton.labelColor
};
/* harmony default export */ var src_CaptionButton = ((/* unused pure expression or super */ null && (CaptionButton)));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/CaptionPopOverContent/styles.tsx

var MainContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__MainContainer",
  componentId: "sc-ou0utj-0"
})(["border:1px solid #6f7685;position:absolute;padding:0.4em 12px;width:", "px;"], function (props) {
  return props.width;
});
var TextElement = styled_components_browser_esm.div.withConfig({
  displayName: "styles__TextElement",
  componentId: "sc-ou0utj-1"
})(["font-family:", ";font-size:", ";overflow-wrap:break-word;white-space:pre-wrap;text-align:left;color:rgb(78,85,101);opacity:1;font-weight:inherit;line-height:1.2;letter-spacing:0px;"], function (props) {
  return props.fontFamily;
}, function (props) {
  return props.fontSize;
});
var CaptionLink = styled_components_browser_esm.a.withConfig({
  displayName: "styles__CaptionLink",
  componentId: "sc-ou0utj-2"
})(["color:#017be3;text-decoration:none;font-family:\"Roboto\",\"Helvetica\",\"Arial\",sans-serif;font-size:14px;&:hover{text-decoration:underline;}"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/CaptionPopOverContent/index.tsx



var CaptionPopOverContent = function CaptionPopOverContent(_ref) {
  var label = _ref.label,
    fontFamily = _ref.fontFamily,
    fontSize = _ref.fontSize,
    url = _ref.url,
    width = _ref.width;
  return /*#__PURE__*/react.createElement(MainContainer, {
    width: width
  }, /*#__PURE__*/react.createElement(TextElement, {
    fontFamily: fontFamily,
    fontSize: fontSize
  }, label), url && /*#__PURE__*/react.createElement(CaptionLink, {
    href: url,
    rel: "noopener noreferrer",
    target: "_blank"
  }, "Open link"));
};
CaptionPopOverContent.propTypes = {
  label: (prop_types_default()).string.isRequired,
  fontSize: (prop_types_default()).string,
  fontFamily: (prop_types_default()).string,
  url: (prop_types_default()).string,
  width: (prop_types_default()).number
};
CaptionPopOverContent.defaultProps = {
  fontSize: '',
  fontFamily: '',
  url: '',
  width: 0
};
/* harmony default export */ var src_CaptionPopOverContent = ((/* unused pure expression or super */ null && (CaptionPopOverContent)));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/TooltipView/styles.tsx

var styles_Container = styled_components_browser_esm.div.withConfig({
  displayName: "styles__Container",
  componentId: "sc-64fl7d-0"
})(["color:", ";font-size:", ";text-align:center;position:absolute;padding:2px 8px;border:1px solid rgba(0,0,0,0.3);border-radius:3px;"], function (props) {
  return props.fontColor;
}, function (props) {
  return props.fontSize;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/TooltipView/index.tsx


var TooltipView = function TooltipView(_ref) {
  var label = _ref.label,
    fontColor = _ref.fontColor,
    fontSize = _ref.fontSize;
  return /*#__PURE__*/React.createElement(Styled.Container, {
    fontColor: fontColor,
    fontSize: fontSize
  }, label);
};
/* harmony default export */ var src_TooltipView = ((/* unused pure expression or super */ null && (TooltipView)));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/VideoCover/styles.tsx


var VideoCoverContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__VideoCoverContainer",
  componentId: "sc-g6t0nh-0"
})(["position:relative;display:flex;justify-content:center;align-items:center;background-color:", ";"], componentsTheme.videoCover.containerBackground);
var IconContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__IconContainer",
  componentId: "sc-g6t0nh-1"
})(["position:absolute;height:30%;width:30%;"]);
var VideoCoverBackground = styled_components_browser_esm.div.withConfig({
  displayName: "styles__VideoCoverBackground",
  componentId: "sc-g6t0nh-2"
})(["width:100%;height:100%;background-color:", ";"], componentsTheme.videoCover.containerBackground);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/VideoCover/index.tsx






var VideoCover = function VideoCover(_ref) {
  var videoCover = _ref.videoCover,
    _ref$width = _ref.width,
    width = _ref$width === void 0 ? 339 : _ref$width,
    height = _ref.height;
  return /*#__PURE__*/react.createElement(VideoCoverContainer, {
    style: {
      width: "".concat(width, "px"),
      height: "".concat(typeof height === 'string' ? height : "".concat(height, "px"))
    }
  }, /*#__PURE__*/react.createElement(src_BaseImage, {
    width: width,
    height: height,
    objectFit: "fill",
    src: videoCover
  }), /*#__PURE__*/react.createElement(IconContainer, null, /*#__PURE__*/react.createElement(src.VideoWidgetViewIcon, {
    fill: componentsTheme.videoCover.svgColor
  })));
};
VideoCover.propTypes = {
  width: (prop_types_default()).number,
  height: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).number]),
  videoCover: (prop_types_default()).string.isRequired
};
VideoCover.defaultProps = {
  width: 339,
  height: 189
};
/* harmony default export */ var src_VideoCover = ((/* unused pure expression or super */ null && (VideoCover)));
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/classnames/index.js
var classnames = __webpack_require__(1953);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/TextBoxView/constants.tsx
var TextWrapTypes = {
  WRAP: 'wrap',
  CLIP: 'clip'
};
var TextOverflow = {
  HIDDEN: 'hidden',
  UNSET: 'unset'
};
var TextBoxVerticalAlignmentTypes = {
  TOP: 'TOP',
  CENTER: 'CENTER',
  BOTTOM: 'BOTTOM'
};
var constants_TextAlign = {
  CENTER: 'center',
  LEFT: 'left',
  RIGHT: 'right',
  JUSTIFY: 'justify'
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/TextBoxView/helpers.tsx
/**
 * Transform fragments data [{ text, tag, style }] into html
 *
 * @param fragmentsData - text fragments ( array of objects )
 * @param isTableCell is used for adding extra style for the text inside a tabel cell
 * @param usePreWrap
 * @param direction
 * @return returns the escaped html content, with '&lt;' instead of '<', etc...
 */

var escapeTextBoxHTML = function escapeTextBoxHTML(fragmentsData) {
  var usePreWrap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  var isTableCell = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  var direction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
  var div = document.createElement('div');
  fragmentsData.forEach(function (n, k) {
    var nodeTag = n.tag || 'span';
    var tag = document.createElement(nodeTag);
    var text = document.createTextNode(n.text);
    if (n.style) {
      var styles = Object.keys(n.style);
      tag.appendChild(text);
      if (styles.length) {
        styles.forEach(function (style) {
          // Add 'px' to fontSize and letterSpacing
          if (style === 'fontSize' || style === 'letterSpacing') {
            tag.style[style] = "".concat(n.style[style], "px");
          } else if (style === 'font') {
            tag.style.fontFamily = "".concat(n.style[style].family);
          } else {
            tag.style[style] = n.style[style];
          }
        });
      }
    }
    tag.setAttribute('data-order', k.toString());
    tag.className += "fragment-".concat(k);
    div.appendChild(tag);
  });
  var style = usePreWrap ? 'white-space: pre-wrap;' : '';
  if (isTableCell) {
    style += 'padding: 10px; max-width: 100%; display: block; overflow-wrap: break-word;';
  } else {
    style += 'overflow-wrap: break-word;';
  }
  var result = "<span class=\"text-box-inner\"  style=\"".concat(style, "\">").concat(div.innerHTML, "</span>");
  if (direction === 'rtl') {
    result = "<span class=\"text-box-inner\" dir=\"".concat(direction, "\" style=\"").concat(style, "\">").concat(div.innerHTML, "</span>");
  }
  if (div instanceof HTMLElement) {
    return result;
  }
  return '<span />';
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/TextBoxView/styles.tsx


/**
 * Calculate overflow
 * @param overflow
 * @param contentEditable
 * @param textWrap
 * @return {string}
 */
var getOverflow = function getOverflow(_ref) {
  var overflow = _ref.overflow,
    contentEditable = _ref.contentEditable,
    textWrap = _ref.textWrap;
  if (overflow) {
    return overflow;
  }
  return textWrap === TextWrapTypes.CLIP && !contentEditable ? 'hidden' : 'unset';
};
var TextBoxView = styled_components_browser_esm.div.withConfig({
  displayName: "styles__TextBoxView",
  componentId: "sc-t183fr-0"
})(["font-family:", ";text-align:", ";width:", ";height:", ";", " transform-origin:left top 0;line-height:0;@supports (-moz-appearance:none){white-space:pre-line;}white-space:pre-wrap;letter-spacing:", ";overflow:", ";display:", ";justify-content:", ";align-items:", ";"], function (_ref2) {
  var fontFamily = _ref2.fontFamily;
  return fontFamily;
}, function (_ref3) {
  var textAlign = _ref3.textAlign;
  return textAlign;
}, function (_ref4) {
  var $width = _ref4.$width;
  return $width;
}, function (_ref5) {
  var $height = _ref5.$height;
  return $height;
}, function (_ref6) {
  var $transform = _ref6.$transform;
  return $transform ? "transform: ".concat($transform, ";") : '';
}, function (_ref7) {
  var letterSpacing = _ref7.letterSpacing;
  return letterSpacing;
}, function (props) {
  return getOverflow(props);
}, function (_ref8) {
  var verticalAlign = _ref8.verticalAlign;
  return verticalAlign === TextBoxVerticalAlignmentTypes.CENTER ? 'flex' : 'block';
}, function (_ref9) {
  var verticalAlign = _ref9.verticalAlign;
  return verticalAlign === TextBoxVerticalAlignmentTypes.CENTER ? 'center' : 'unset';
}, function (_ref10) {
  var verticalAlign = _ref10.verticalAlign;
  return verticalAlign === TextBoxVerticalAlignmentTypes.CENTER ? 'center' : 'unset';
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/TextBoxView/index.tsx






var TextBoxView_TextBoxView = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
  var customClass = _ref.customClass,
    editable = _ref.editable,
    textStyle = _ref.textStyle,
    onInput = _ref.onInput,
    onPaste = _ref.onPaste,
    onKeyDown = _ref.onKeyDown,
    onMouseDown = _ref.onMouseDown,
    onBlur = _ref.onBlur,
    onClick = _ref.onClick,
    nodes = _ref.nodes,
    onDrop = _ref.onDrop,
    isTableCell = _ref.isTableCell,
    disabled = _ref.disabled,
    direction = _ref.direction,
    zoom = _ref.zoom;
  // defaultRefValue is a hack for when useRef should not be null
  var defaultRefValue = document.createElement('div');
  var editableRef = (0,react.useRef)(defaultRefValue);
  react.useImperativeHandle(ref, function () {
    return editableRef.current;
  });
  var onFocus = function onFocus() {
    if (!editable) {
      editableRef === null || editableRef === void 0 || editableRef.current.blur();
    }
  };
  var transform = zoom && zoom !== 1 ? "scale(".concat(zoom, ")") : '';
  var width = textStyle.width ? textStyle.width.toString() : '0';
  var height = textStyle.height ? textStyle.height.toString() : '0';
  return /*#__PURE__*/react.createElement(TextBoxView, {
    role: "presentation",
    className: classnames_default()({
      editable: editable
    }, customClass, 'text-box-element'),
    contentEditable: !disabled,
    onInput: onInput,
    onPaste: onPaste,
    onKeyDown: onKeyDown,
    onMouseDown: onMouseDown,
    onFocus: onFocus,
    onBlur: onBlur,
    onClick: onClick,
    dangerouslySetInnerHTML: {
      __html: escapeTextBoxHTML(JSON.parse(nodes), textStyle.textAlign !== constants_TextAlign.JUSTIFY, isTableCell, direction || 'ltr')
    },
    ref: editableRef,
    fontFamily: textStyle.fontFamily,
    overflow: textStyle.overflow,
    textAlign: textStyle.textAlign,
    $width: width && width.indexOf('%') === -1 ? "".concat(width, "px") : '',
    $height: height && height.indexOf('%') === -1 ? "".concat(height, "px") : '',
    $transform: transform,
    letterSpacing: textStyle.letterSpacing,
    textWrap: textStyle.textWrap,
    verticalAlign: textStyle.verticalAlign,
    onDrop: onDrop,
    dir: direction || 'ltr'
  });
});
TextBoxView_TextBoxView.propTypes = {
  customClass: (prop_types_default()).string,
  editable: (prop_types_default()).bool,
  isTableCell: (prop_types_default()).bool,
  direction: (prop_types_default()).string,
  textStyle: prop_types_default().instanceOf(Object).isRequired,
  onInput: (prop_types_default()).func,
  onPaste: (prop_types_default()).func,
  onKeyDown: (prop_types_default()).func,
  onMouseDown: (prop_types_default()).func,
  onBlur: (prop_types_default()).func,
  onClick: (prop_types_default()).func,
  onDrop: (prop_types_default()).func,
  nodes: (prop_types_default()).string.isRequired,
  disabled: (prop_types_default()).bool.isRequired,
  zoom: (prop_types_default()).number.isRequired
};
TextBoxView_TextBoxView.defaultProps = {
  customClass: '',
  direction: 'ltr',
  isTableCell: false,
  onInput: function onInput() {},
  onPaste: function onPaste() {},
  onKeyDown: function onKeyDown() {},
  onMouseDown: function onMouseDown() {},
  onBlur: function onBlur() {},
  onClick: function onClick() {},
  onDrop: function onDrop() {},
  editable: false
};
/* harmony default export */ var src_TextBoxView = (TextBoxView_TextBoxView);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/TableCell/styles.tsx

var TableCellContent = styled_components_browser_esm.div.withConfig({
  displayName: "styles__TableCellContent",
  componentId: "sc-3k1ibg-0"
})(["position:absolute;height:0;"]);
var TableCellData = styled_components_browser_esm.td.withConfig({
  displayName: "styles__TableCellData",
  componentId: "sc-3k1ibg-1"
})(["vertical-align:top;text-align:center;padding:0;margin:0;border-collapse:collapse;width:", "px;height:", "px;outline:", ";outline-offset:", "px;border-top:", ";border-right:", ";border-bottom:", ";border-left:", ";background-color:", ";"], function (_ref) {
  var $width = _ref.$width;
  return $width;
}, function (_ref2) {
  var $height = _ref2.$height;
  return $height;
}, function (_ref3) {
  var $outline = _ref3.$outline;
  return $outline;
}, function (_ref4) {
  var $offset = _ref4.$offset;
  return $offset;
}, function (_ref5) {
  var $borderTop = _ref5.$borderTop;
  return $borderTop;
}, function (_ref6) {
  var $borderRight = _ref6.$borderRight;
  return $borderRight;
}, function (_ref7) {
  var $borderBottom = _ref7.$borderBottom;
  return $borderBottom;
}, function (_ref8) {
  var $borderLeft = _ref8.$borderLeft;
  return $borderLeft;
}, function (_ref9) {
  var $backgroundColor = _ref9.$backgroundColor;
  return $backgroundColor;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/TableTextBox/styles.tsx

var TableTextBoxWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "styles__TableTextBoxWrapper",
  componentId: "sc-2s8u8w-0"
})(["position:absolute;height:0;"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/helpers/editText.tsx

function editText_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function editText_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? editText_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : editText_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
// Default text content for an empty cell
var emptyTextObject = {
  style: {
    color: '#000000',
    fontSize: 26,
    letterSpacing: 0,
    lineHeight: 1.2
  },
  color: '#000000',
  fontSize: 26,
  letterSpacing: 0,
  lineHeight: 1.2,
  tag: 'span',
  text: ' '
};

/**
 * Transforma continutul html al div-ului in structura de json. Dupa editarea in div content editable, la onBlur se
 * parcurge continutul html si se regenereaza.
 * fragmentele de text din json
 * @param html
 * @param nodes
 * @returns {Array}
 */
/* harmony default export */ var editText = (function (html, nodes) {
  // inseram intr-un div c sa putem manipula ca html
  var newNodes = [];
  var tempContainer = document.createElement('div');
  tempContainer.innerHTML = html;
  var children = tempContainer.children;

  // trateaza cazurile cand doar s-a editat/sters din contenteditable
  if (children.length === 1) {
    nodes.forEach(function (n, k) {
      var span = children[0].getElementsByClassName("fragment-".concat(k));
      if (span.length) {
        var firstElement = span[0];
        newNodes.push(editText_objectSpread(editText_objectSpread({}, n), {}, {
          text: firstElement.innerText
        }));
      }
    });
  }
  if (!newNodes.length) {
    newNodes.push(emptyTextObject);
  }
  return newNodes;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/helpers/setTextRange.ts
/**
 * Set text selection on given node
 * @param selection
 * @param node
 * @param position
 * @param selectAll
 */
/* harmony default export */ var setTextRange = (function (selection, node, position) {
  var selectAll = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  var range = document.createRange();
  try {
    if (node) {
      if (selectAll) {
        range.selectNodeContents(node);
      } else {
        range.setStart(node, position);
        range.collapse(true);
      }
    }

    // Necessary for some browsers that overwrite the range after it is set. ex: Firefox overwrites the range on
    // triple click
    setTimeout(function () {
      selection.removeAllRanges();
      selection.addRange(range);
    }, 0);
  } catch (e) {
    // Prevent set range to trigger too fast for and avoiding text crash
  }
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/helpers/handleKeyboardInput.ts


var SelectionType = {
  RANGE: 'Range',
  CARET: 'Caret'
};

/**
 * Prevent text to be empty. Workaround for content editable that destroys the styled span when is empty
 */
var handleEmptyText = function handleEmptyText(selection, textNode, text) {
  var validCaretPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  if (selection) {
    var left = Math.min(selection.anchorOffset, selection.focusOffset);
    var right = Math.max(selection.anchorOffset, selection.focusOffset);
    var selected = selection.type === SelectionType.RANGE && left === 0 && right === text.length;
    var lastChar = selection.type === SelectionType.CARET && selection.anchorOffset === validCaretPosition && text.length === 1;
    if (selected || lastChar) {
      var targetElement = textNode;
      targetElement.innerHTML = ' ';
      setTextRange(selection, targetElement.firstChild, 0, true);
      return true;
    }
  }
  return false;
};

/**
 * Handle backspace key input. Apply backspace action and place the caret
 */
var handleBackspace = function handleBackspace(selection, textNode, text) {
  var targetElement = textNode;

  // Break execution if text will be emptied
  if (handleEmptyText(selection, textNode, text, 1)) {
    return;
  }
  if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.RANGE) {
    var start = Math.min(selection.anchorOffset, selection.focusOffset);
    var end = Math.max(selection.anchorOffset, selection.focusOffset);
    targetElement.innerHTML = text.slice(0, start) + text.slice(end);
    setTextRange(selection, textNode.firstChild, start);
  } else if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.CARET) {
    var position = selection.focusOffset;
    if (position > 0) {
      targetElement.innerHTML = text.slice(0, position - 1) + text.slice(position);
      setTextRange(selection, textNode.firstChild, position - 1);
    }
  }
};

/**
 * Handle delete key press. Apply to delete function accordingly to the selection and place the caret
 */
var handleDelete = function handleDelete(selection, textNode, text) {
  var targetElement = textNode;

  // Break execution if text will be emptied
  if (handleEmptyText(selection, textNode, text, 0)) {
    return;
  }
  if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.RANGE) {
    var start = Math.min(selection.anchorOffset, selection.focusOffset);
    var end = Math.max(selection.anchorOffset, selection.focusOffset);
    targetElement.innerHTML = text.slice(0, start) + text.slice(end);
    setTextRange(selection, textNode.firstChild, start);
  } else if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.CARET) {
    var position = selection.focusOffset;
    if (position < text.length) {
      targetElement.innerHTML = text.slice(0, position) + text.slice(position + 1);
      setTextRange(selection, textNode.firstChild, position - 1);
    }
  }
};

/**
 * Handle space key down. Insert new line character and place the caret
 */
var handleSpace = function handleSpace(selection, textNode, text) {
  var enter = ' ';
  var targetElement = textNode;
  if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.RANGE) {
    var start = Math.min(selection.anchorOffset, selection.focusOffset);
    var end = Math.max(selection.anchorOffset, selection.focusOffset);
    if (!Number.isNaN(start) && !Number.isNaN(end)) {
      targetElement.innerHTML = "".concat(text.slice(0, start)).concat(enter).concat(text.slice(end));
      setTextRange(selection, textNode.firstChild, start);
    }
  } else if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.CARET) {
    var position = selection.focusOffset;
    targetElement.innerHTML = "".concat(text.slice(0, position)).concat(enter).concat(text.slice(position));
    setTextRange(selection, textNode.firstChild, position + 1);
  }
};

/**
 * Handle enter key down. Insert new line character and place the caret
 */
var handleEnter = function handleEnter(selection, textNode, text) {
  var enter = '\n\r';
  var targetElement = textNode;
  if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.RANGE) {
    var start = Math.min(selection.anchorOffset, selection.focusOffset);
    var end = Math.max(selection.anchorOffset, selection.focusOffset);
    if (!Number.isNaN(start) && !Number.isNaN(end)) {
      targetElement.innerHTML = "".concat(text.slice(0, start)).concat(enter).concat(text.slice(end));
      setTextRange(selection, textNode.firstChild, start + 1);
    }
  } else if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.CARET) {
    var position = selection.focusOffset;
    targetElement.innerHTML = "".concat(text.slice(0, position)).concat(enter).concat(text.slice(position));
    setTextRange(selection, textNode.firstChild, position + 1);
  }
};

/**
 * Handle cut user action. Prevent default behavior to avoid empty text
 */
var handleCut = function handleCut(selection, textNode, text) {
  var targetElement = textNode;
  if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.RANGE && Math.abs(selection.anchorOffset - selection.focusOffset) === text.length) {
    document.execCommand('copy', false, text);
    targetElement.innerHTML = ' ';
    selection && setTextRange(selection, textNode, 0, true);
  } else {
    document.execCommand('cut');
  }
};

/**
 * Handle paste into content editable
 */
var handleKeyboardInput_handlePaste = function handlePaste(selection, textNode, clipboardText, resize) {
  var targetElement = textNode;
  var text = textNode === null || textNode === void 0 ? void 0 : textNode.textContent;
  if (text) {
    if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.RANGE) {
      var start = Math.min(selection.anchorOffset, selection.focusOffset);
      var end = Math.max(selection.anchorOffset, selection.focusOffset);
      if (!Number.isNaN(start) && !Number.isNaN(end)) {
        targetElement.innerHTML = "".concat(text.slice(0, start)).concat(clipboardText).concat(text.slice(end));
        setTextRange(selection, textNode.firstChild, start + clipboardText.length);
      }
    } else if ((selection === null || selection === void 0 ? void 0 : selection.type) === SelectionType.CARET) {
      var position = selection.focusOffset;
      targetElement.innerHTML = "".concat(text.slice(0, position)).concat(clipboardText).concat(text.slice(position));
      setTextRange(selection, textNode.firstChild, position + clipboardText.length);
    }
  }
  resize();
};

/**
 * Make sure that the selection is on the right node
 */
var normalizeSelection = function normalizeSelection(selection, textNode) {
  if (selection) {
    if (selection.type === SelectionType.RANGE && selection.anchorNode !== textNode.firstChild) {
      setTextRange(selection, textNode.firstChild, 0, true);
    }
  }
};
var isKeyboardInputValid = function isKeyboardInputValid(event) {
  return event.code === KeyboardCodes.BACKSPACE || event.code === KeyboardCodes.ENTER || event.code === KeyboardCodes.NUMPAD_ENTER || event.code === KeyboardCodes.DELETE || event.code === KeyboardCodes.SPACE || event.code === KeyboardCodes.A && (event.metaKey || event.ctrlKey) || event.code === KeyboardCodes.X && (event.metaKey || event.ctrlKey);
};

/**
 * Handle special key input
 */
/* harmony default export */ var handleKeyboardInput = (function (textBoxContentRef, event, resize) {
  if (isKeyboardInputValid(event)) {
    var _textBoxContentRef$cu;
    event.preventDefault();
    var selection = window.getSelection();
    var textNode = textBoxContentRef === null || textBoxContentRef === void 0 || (_textBoxContentRef$cu = textBoxContentRef.current) === null || _textBoxContentRef$cu === void 0 || (_textBoxContentRef$cu = _textBoxContentRef$cu.childNodes[0]) === null || _textBoxContentRef$cu === void 0 ? void 0 : _textBoxContentRef$cu.childNodes[0];
    if (textNode instanceof HTMLElement && textNode && textNode.textContent) {
      var text = textNode === null || textNode === void 0 ? void 0 : textNode.textContent;

      // Before applying the action, set the selection to the right node
      normalizeSelection(selection, textNode);
      switch (event.code) {
        case KeyboardCodes.BACKSPACE:
          handleBackspace(selection, textNode, text);
          break;
        case KeyboardCodes.ENTER:
        case KeyboardCodes.NUMPAD_ENTER:
          handleEnter(selection, textNode, text);
          break;
        // Cmd/Ctrl + a must be handled because mozilla firefox has a different default behaviour
        case KeyboardCodes.DELETE:
          handleDelete(selection, textNode, text);
          break;
        case KeyboardCodes.A:
          if (selection) {
            setTextRange(selection, textNode.firstChild, 0, true);
          }
          break;
        case KeyboardCodes.X:
          handleCut(selection, textNode, text);
          break;
        case KeyboardCodes.SPACE:
          handleSpace(selection, textNode, text);
          break;
        default:
          break;
      }
    }
    resize();
  }
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/TableTextBox/index.tsx


function TableTextBox_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function TableTextBox_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? TableTextBox_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : TableTextBox_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }








var TableTextBox = function TableTextBox(_ref) {
  var _firstNodeStyle$font;
  var _ref$customClass = _ref.customClass,
    customClass = _ref$customClass === void 0 ? '' : _ref$customClass,
    _ref$onChange = _ref.onChange,
    onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
    editable = _ref.editable,
    _ref$inputCharacter = _ref.inputCharacter,
    inputCharacter = _ref$inputCharacter === void 0 ? '' : _ref$inputCharacter,
    _ref$setInputCharacte = _ref.setInputCharacter,
    setInputCharacter = _ref$setInputCharacte === void 0 ? function () {} : _ref$setInputCharacte,
    _ref$onHeightChange = _ref.onHeightChange,
    onHeightChange = _ref$onHeightChange === void 0 ? function () {} : _ref$onHeightChange,
    selected = _ref.selected,
    _ref$selectedCells = _ref.selectedCells,
    selectedCells = _ref$selectedCells === void 0 ? '' : _ref$selectedCells,
    disabled = _ref.disabled,
    elementProps = _ref.elementProps,
    zoom = _ref.zoom,
    cellHeight = _ref.cellHeight,
    tableStyleHashCode = _ref.tableStyleHashCode,
    refTableStyleHashCode = _ref.refTableStyleHashCode;
  var _useState = (0,react.useState)(0),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    elementHeight = _useState2[0],
    setElementHeight = _useState2[1];
  var textBoxContentRef = (0,react.useRef)(document.createElement('div'));
  var nodes = elementProps.nodes,
    textStyle = elementProps.textStyle;
  var _useState3 = (0,react.useState)(false),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    edited = _useState4[0],
    setEdited = _useState4[1];
  var _nodes$ = nodes[0],
    firstNodeStyle = _nodes$.style,
    text = _nodes$.text;
  var _firstNodeStyle$fontS = firstNodeStyle.fontSize,
    fontSize = _firstNodeStyle$fontS === void 0 ? 0 : _firstNodeStyle$fontS,
    _firstNodeStyle$fontW = firstNodeStyle.fontWeight,
    fontWeight = _firstNodeStyle$fontW === void 0 ? '' : _firstNodeStyle$fontW;
  var fontFamily = ((_firstNodeStyle$font = firstNodeStyle.font) === null || _firstNodeStyle$font === void 0 ? void 0 : _firstNodeStyle$font.family) || '';

  // This will handle old elements that have styles on 'textStyle' node
  var parsedTextStyle = TableTextBox_objectSpread(TableTextBox_objectSpread(TableTextBox_objectSpread({}, firstNodeStyle), textStyle), {}, {
    height: cellHeight / zoom,
    zoom: zoom,
    verticalAlign: TextBoxVerticalAlignmentTypes.CENTER,
    overflow: TextOverflow.HIDDEN
  });
  var getTextBoxViewOffsetHeight = function getTextBoxViewOffsetHeight() {
    var textBoxViewOffsetHeight = 0;
    if (textBoxContentRef && textBoxContentRef.current) {
      textBoxContentRef.current.childNodes.forEach(function (childNode) {
        if (childNode instanceof HTMLElement) {
          textBoxViewOffsetHeight += childNode.offsetHeight || 0;
        }
      });
    }
    return textBoxViewOffsetHeight;
  };
  var handleChange = function handleChange() {
    if (onChange) {
      var _textBoxContentRef$cu;
      var html = (_textBoxContentRef$cu = textBoxContentRef.current) === null || _textBoxContentRef$cu === void 0 ? void 0 : _textBoxContentRef$cu.innerHTML;
      var editedNodes = editText(html, nodes);
      var selection = window.getSelection();
      // Ensure that the text height is the current text ref height
      var offsetHeight = getTextBoxViewOffsetHeight();
      selection === null || selection === void 0 || selection.removeAllRanges();
      onChange({
        elements: [{
          textStyle: TableTextBox_objectSpread(TableTextBox_objectSpread({}, textStyle), {}, {
            height: offsetHeight
          }),
          nodes: editedNodes
        }]
      });
    }
  };
  var onBlur = function onBlur() {
    if (editable) {
      handleChange();
    }
  };
  (0,react.useEffect)(function () {
    if (editable) {
      var _textBoxContentRef$cu2, _nodes$2;
      var selection = window.getSelection();
      var textNode = textBoxContentRef === null || textBoxContentRef === void 0 || (_textBoxContentRef$cu2 = textBoxContentRef.current) === null || _textBoxContentRef$cu2 === void 0 || (_textBoxContentRef$cu2 = _textBoxContentRef$cu2.childNodes[0]) === null || _textBoxContentRef$cu2 === void 0 ? void 0 : _textBoxContentRef$cu2.childNodes[0];
      var emptyText = ((_nodes$2 = nodes[0]) === null || _nodes$2 === void 0 ? void 0 : _nodes$2.text) === ' ' && !inputCharacter;
      setEdited(true);
      if (selection && textNode instanceof HTMLElement) {
        if (inputCharacter && typeof inputCharacter === 'string' && setInputCharacter && textNode) {
          textNode.innerText = inputCharacter;
          setInputCharacter('');
        }

        // If the text is empty (contains only one space character), then set the range to contain the space
        if (!emptyText && textNode.textContent) {
          setTextRange(selection, textNode.firstChild, textNode.textContent.length);
        } else {
          setTextRange(selection, textNode.firstChild, 0, true);
        }
      }
    } else if (edited) {
      handleChange();
    }
  }, [editable, selectedCells]);
  (0,react.useEffect)(function () {
    if (!selected) {
      var selection = window.getSelection();
      setEdited(false);
      selection === null || selection === void 0 || selection.removeAllRanges();
    }
  }, [selected]);
  var handleResize = function handleResize() {
    var offsetHeight = getTextBoxViewOffsetHeight();

    // The tableStyleHashCode is a dynamic hash code that changes whenever the entire table is styled,
    // and the refTableStyleHashCode represents the old tableStyleHashCode.
    var isTableStyleChanged = refTableStyleHashCode !== tableStyleHashCode;
    if (onHeightChange && (offsetHeight !== elementHeight || isTableStyleChanged)) {
      setElementHeight(offsetHeight);
      onHeightChange(offsetHeight);
    }
  };
  (0,react.useEffect)(function () {
    handleResize();
  }, [fontFamily, fontSize, fontWeight, text, tableStyleHashCode]);
  var handleKeyDown = function handleKeyDown(event) {
    var _selection$anchorNode;
    var selection = window.getSelection();
    var isRightSelection = selection === null || selection === void 0 || (_selection$anchorNode = selection.anchorNode) === null || _selection$anchorNode === void 0 || (_selection$anchorNode = _selection$anchorNode.parentElement) === null || _selection$anchorNode === void 0 ? void 0 : _selection$anchorNode.hasAttribute('data-order');

    // Prevent writing outside the styled span. Mozilla firefox workaround
    if (editable && !isRightSelection) {
      event.preventDefault();
    }
    if (editable && selected && isRightSelection) {
      handleKeyboardInput(textBoxContentRef, event, handleResize);
    }
  };
  var handlePaste = function handlePaste(event) {
    var _textBoxContentRef$cu3;
    event.preventDefault();
    var clipboard = event.clipboardData;
    var clipboardData = (clipboard === null || clipboard === void 0 ? void 0 : clipboard.getData('Text')) || '';
    var selection = window.getSelection();
    var textNode = textBoxContentRef === null || textBoxContentRef === void 0 || (_textBoxContentRef$cu3 = textBoxContentRef.current) === null || _textBoxContentRef$cu3 === void 0 || (_textBoxContentRef$cu3 = _textBoxContentRef$cu3.childNodes[0]) === null || _textBoxContentRef$cu3 === void 0 ? void 0 : _textBoxContentRef$cu3.childNodes[0];
    if (editable && textNode instanceof HTMLElement) {
      handleKeyboardInput_handlePaste(selection, textNode, clipboardData, handleResize);
    }
  };
  var handleOnClick = function handleOnClick(event) {
    // Prevent breaking selection after more than two clicks (firefox change selection focus after second click)
    if (event.detail >= 3) {
      var _textBoxContentRef$cu4;
      var selection = window.getSelection();
      var textNode = textBoxContentRef === null || textBoxContentRef === void 0 || (_textBoxContentRef$cu4 = textBoxContentRef.current) === null || _textBoxContentRef$cu4 === void 0 || (_textBoxContentRef$cu4 = _textBoxContentRef$cu4.childNodes[0]) === null || _textBoxContentRef$cu4 === void 0 ? void 0 : _textBoxContentRef$cu4.childNodes[0];
      if (textNode instanceof HTMLElement) {
        normalizeSelection(selection, textNode);
      }
    }
  };

  // Prevent dragging things in cell
  var onDrop = function onDrop(e) {
    e.preventDefault();
  };
  if (!nodes[0]) {
    return null;
  }
  return /*#__PURE__*/react.createElement(TableTextBoxWrapper, null, /*#__PURE__*/react.createElement(src_TextBoxView, {
    editable: editable,
    textStyle: TableTextBox_objectSpread({}, parsedTextStyle),
    zoom: zoom,
    customClass: customClass,
    nodes: JSON.stringify(nodes),
    ref: textBoxContentRef,
    onInput: handleResize,
    onKeyDown: handleKeyDown,
    onPaste: handlePaste,
    onClick: handleOnClick,
    onBlur: onBlur,
    onDrop: onDrop,
    disabled: disabled,
    isTableCell: true
  }));
};
TableTextBox.propTypes = {
  customClass: (prop_types_default()).string,
  onChange: (prop_types_default()).func,
  inputCharacter: (prop_types_default()).string,
  setInputCharacter: (prop_types_default()).func,
  onHeightChange: (prop_types_default()).func,
  selected: (prop_types_default()).bool.isRequired,
  selectedCells: (prop_types_default()).string,
  disabled: (prop_types_default()).bool.isRequired,
  zoom: (prop_types_default()).number.isRequired
};
/* harmony default export */ var Table_TableTextBox = (TableTextBox);
;// CONCATENATED MODULE: ../../modules/ui/code/constants/colors.ts
var colors_Colors = /*#__PURE__*/function (Colors) {
  Colors["BLUE"] = "#0362fc";
  Colors["BLACK"] = "#000000";
  Colors["GREY"] = "#00000061";
  Colors["WHITE"] = "#ffffff";
  Colors["CYAN"] = "#00f4fe";
  Colors["YELLOW"] = "#ffc600";
  Colors["RED"] = "#db2b39";
  Colors["GREEN"] = "#00ad11";
  Colors["PURPLE"] = "#8F03B2";
  Colors["DEEP_PURPLE"] = "#D1C4E9";
  Colors["DEEP_DARK_PURPLE"] = "#311B92";
  Colors["LIGHT_GREEN"] = "#CEF3D2";
  Colors["LIGHT_YELLOW"] = "#FFF1C2";
  Colors["LIGHT_PURPLE"] = "#EBD6FF";
  Colors["LIGHT_GRAY"] = "#DEE0E3";
  Colors["LIGHT_RED"] = "#FAC7CB";
  Colors["LIGHT_CYAN"] = "#C5FAFC";
  Colors["DARK_GREEN"] = "#005208";
  Colors["DARK_YELLOW"] = "#664F00";
  Colors["DARK_PURPLE"] = "#7A1F5B";
  Colors["DARK_GREY"] = "#4C5058";
  Colors["DARK_RED"] = "#5B0B12";
  Colors["DARK_CYAN"] = "#006266";
  return Colors;
}(colors_Colors || {});
var lighterColor = function lighterColor(color) {
  var lightPercentage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 90;
  return "color-mix(in srgb, ".concat(color, ", ").concat(colors_Colors.WHITE, " ").concat(lightPercentage, "%)");
};
var darkerColor = function darkerColor(color) {
  var darkPercentage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
  return "color-mix(in srgb, ".concat(color, ", ").concat(colors_Colors.BLACK, " ").concat(darkPercentage, "%)");
};
/* harmony default export */ var colors = (colors_Colors);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/TableCell/index.tsx

function TableCell_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function TableCell_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? TableCell_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : TableCell_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





var getCellFrame = function getCellFrame(selected, parsedBorder, scale) {
  // Fix rendering borders when scaling is too small
  var calculateBorderWidth = function calculateBorderWidth(borderWidth) {
    return Math.ceil(borderWidth * scale);
  };
  if (selected) {
    return {
      outline: "2px solid ".concat(colors.BLUE),
      outlineOffset: -1,
      borderTop: 'none',
      borderRight: 'none',
      borderBottom: 'none',
      borderLeft: 'none'
    };
  }
  return {
    outline: 'none',
    outlineOffset: 0,
    borderTop: "".concat(calculateBorderWidth(parsedBorder.top.width), "px solid ").concat(parsedBorder.top.color),
    borderRight: "".concat(calculateBorderWidth(parsedBorder.right.width), "px solid ").concat(parsedBorder.right.color),
    borderBottom: "".concat(calculateBorderWidth(parsedBorder.bottom.width), "px solid ").concat(parsedBorder.bottom.color),
    borderLeft: "".concat(calculateBorderWidth(parsedBorder.left.width), "px solid ").concat(parsedBorder.left.color)
  };
};
var TableCell = function TableCell(_ref) {
  var _ref$elements = _ref.elements,
    elements = _ref$elements === void 0 ? '[]' : _ref$elements,
    zoom = _ref.zoom,
    _ref$onDoubleClick = _ref.onDoubleClick,
    onDoubleClick = _ref$onDoubleClick === void 0 ? function () {} : _ref$onDoubleClick,
    _ref$onChange = _ref.onChange,
    onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
    row = _ref.row,
    col = _ref.col,
    cellWidth = _ref.cellWidth,
    cellHeight = _ref.cellHeight,
    _ref$onCellSelect = _ref.onCellSelect,
    onCellSelect = _ref$onCellSelect === void 0 ? function () {} : _ref$onCellSelect,
    selected = _ref.selected,
    elementId = _ref.elementId,
    editable = _ref.editable,
    canSelectCell = _ref.canSelectCell,
    inputCharacter = _ref.inputCharacter,
    _ref$setInputCharacte = _ref.setInputCharacter,
    setInputCharacter = _ref$setInputCharacte === void 0 ? function () {} : _ref$setInputCharacte,
    _ref$onHeightChange = _ref.onHeightChange,
    onHeightChange = _ref$onHeightChange === void 0 ? function () {} : _ref$onHeightChange,
    _ref$isMultipleSelect = _ref.isMultipleSelected,
    isMultipleSelected = _ref$isMultipleSelect === void 0 ? false : _ref$isMultipleSelect,
    _ref$selectedCells = _ref.selectedCells,
    selectedCells = _ref$selectedCells === void 0 ? '' : _ref$selectedCells,
    _ref$isBottomCell = _ref.isBottomCell,
    isBottomCell = _ref$isBottomCell === void 0 ? false : _ref$isBottomCell,
    backgroundColor = _ref.backgroundColor,
    border = _ref.border,
    disabled = _ref.disabled,
    scale = _ref.scale,
    tableStyleHashCode = _ref.tableStyleHashCode,
    refTableStyleHashCode = _ref.refTableStyleHashCode;
  var parsedElements = JSON.parse(elements || '[]');
  var elementProps = TableCell_objectSpread({}, parsedElements[0]); // For now, we have only 1 text element
  var parsedBorder = JSON.parse(border);
  var cellFrame = (0,react.useMemo)(function () {
    return getCellFrame(selected, parsedBorder, scale);
  }, [selected, border, scale]);
  var onCellDoubleClick = function onCellDoubleClick() {
    if (!isMultipleSelected && onCellSelect && !disabled) {
      onCellSelect({
        row: row,
        col: col,
        elementId: elementId
      });
      if (onDoubleClick) {
        onDoubleClick();
      }
    }
  };
  var onCellChange = function onCellChange(data) {
    if (onChange) {
      onChange({
        row: row,
        col: col,
        elements: data.elements
      }, elementId);
    }
  };

  // Calculate text element size in cell
  if (!elementProps.textStyle) {
    elementProps.textStyle = {
      width: cellWidth,
      height: cellHeight
    };
  }
  var onCellMouseUp = function onCellMouseUp() {
    if (canSelectCell && !isMultipleSelected && onCellSelect && !disabled) {
      onCellSelect({
        row: row,
        col: col,
        elementId: elementId
      });
    }
  };
  var onCellMouseDown = function onCellMouseDown(e) {
    // Stop event propagation when the cell is selected and also in editable mode. Prevent selection text and
    // dragging table in the same time if the editable cell is grabbed
    if (selected && editable && !disabled) {
      e.stopPropagation();
    }
  };
  return /*#__PURE__*/react.createElement(TableCellData, {
    key: "cell-".concat(row + 1, "-").concat(col + 1),
    $width: cellWidth,
    $height: isBottomCell ? cellHeight - 1 : cellHeight,
    $outline: cellFrame.outline,
    $offset: cellFrame.outlineOffset,
    $borderTop: cellFrame.borderTop,
    $borderRight: cellFrame.borderRight,
    $borderBottom: cellFrame.borderBottom,
    $borderLeft: cellFrame.borderLeft,
    $backgroundColor: backgroundColor,
    onMouseDown: onCellMouseDown,
    onMouseUp: onCellMouseUp,
    onDoubleClick: onCellDoubleClick
  }, /*#__PURE__*/react.createElement(TableCellContent, null, /*#__PURE__*/react.createElement(Table_TableTextBox, {
    onChange: onCellChange,
    editable: editable,
    inputCharacter: inputCharacter,
    setInputCharacter: setInputCharacter,
    onHeightChange: onHeightChange,
    selected: selected,
    selectedCells: selectedCells,
    disabled: disabled,
    elementProps: elementProps,
    zoom: zoom,
    cellHeight: cellHeight,
    tableStyleHashCode: tableStyleHashCode,
    refTableStyleHashCode: refTableStyleHashCode
  })));
};
TableCell.propTypes = {
  elements: (prop_types_default()).string,
  zoom: (prop_types_default()).number.isRequired,
  onDoubleClick: (prop_types_default()).func,
  onChange: (prop_types_default()).func,
  onCellSelect: (prop_types_default()).func,
  row: (prop_types_default()).number.isRequired,
  col: (prop_types_default()).number.isRequired,
  selected: (prop_types_default()).bool.isRequired,
  elementId: (prop_types_default()).number.isRequired,
  inputCharacter: (prop_types_default()).string.isRequired,
  setInputCharacter: (prop_types_default()).func,
  onHeightChange: (prop_types_default()).func,
  selectedCells: (prop_types_default()).string,
  backgroundColor: (prop_types_default()).string.isRequired,
  border: (prop_types_default()).string.isRequired,
  isBottomCell: (prop_types_default()).bool,
  isMultipleSelected: (prop_types_default()).bool,
  disabled: (prop_types_default()).bool.isRequired,
  scale: (prop_types_default()).number.isRequired
};
/* harmony default export */ var Table_TableCell = (TableCell);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/TableView/TableView.styles.ts

var ResizeLine = styled_components_browser_esm.div.withConfig({
  displayName: "TableViewstyles__ResizeLine",
  componentId: "sc-fwz6wb-0"
})(["position:absolute;background:#000;opacity:0.3;top:", "px;left:", "px;height:", "px;width:", "px;"], function (_ref) {
  var $top = _ref.$top;
  return $top;
}, function (_ref2) {
  var $left = _ref2.$left;
  return $left;
}, function (_ref3) {
  var $height = _ref3.$height;
  return $height;
}, function (_ref4) {
  var $width = _ref4.$width;
  return $width;
});
var TableRow = styled_components_browser_esm.tr.withConfig({
  displayName: "TableViewstyles__TableRow",
  componentId: "sc-fwz6wb-1"
})(["padding:0;margin:0;border-collapse:collapse;"]);
var TableEditable = styled_components_browser_esm.table.withConfig({
  displayName: "TableViewstyles__TableEditable",
  componentId: "sc-fwz6wb-2"
})(["table-layout:fixed;border-style:solid;border-color:#000;border-spacing:0;border-width:1px;border-collapse:collapse;", ";", ";", ";"], function (_ref5) {
  var $alpha = _ref5.$alpha;
  return "opacity: ".concat($alpha);
}, function (_ref6) {
  var $width = _ref6.$width;
  return $width ? "width: ".concat($width, "px") : '';
}, function (_ref7) {
  var $height = _ref7.$height;
  return $height ? "height: ".concat($height, "px") : '';
});
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/react-immutable-proptypes/dist/ImmutablePropTypes.js
var ImmutablePropTypes = __webpack_require__(5301);
var ImmutablePropTypes_default = /*#__PURE__*/__webpack_require__.n(ImmutablePropTypes);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/TableDraggers/TableDraggers.styles.ts


var primaryLightColor50 = lighterColor(colors.BLUE, 50);
var primaryLightColor88 = lighterColor(colors.BLUE, 88);
var RowSizerContainer = styled_components_browser_esm.div.withConfig({
  displayName: "TableDraggersstyles__RowSizerContainer",
  componentId: "sc-17vgpy2-0"
})(["position:absolute;display:flex;flex-direction:column;left:", "px;"], function (_ref) {
  var $left = _ref.$left;
  return -$left;
});
var RowSizer = styled_components_browser_esm.div.withConfig({
  displayName: "TableDraggersstyles__RowSizer",
  componentId: "sc-17vgpy2-1"
})(["text-align:center;color:", ";font-weight:500;width:20px;background-color:", ";border:", ";position:relative;height:", "px;font-size:", "px;display:flex;align-items:center;justify-content:center;margin:1px 0;border-radius:4px;"], function (_ref2) {
  var $active = _ref2.$active;
  return $active ? colors.WHITE : colors.BLUE;
}, function (_ref3) {
  var $active = _ref3.$active;
  return $active ? colors.BLUE : primaryLightColor88;
}, function (_ref4) {
  var $active = _ref4.$active;
  return $active ? '1px solid rgba(0, 0, 0, 0.1)' : "1px solid ".concat(primaryLightColor50);
}, function (_ref5) {
  var $height = _ref5.$height;
  return $height - 2;
}, function (_ref6) {
  var $fontSize = _ref6.$fontSize;
  return $fontSize;
});
var RowDraggable = styled_components_browser_esm.div.withConfig({
  displayName: "TableDraggersstyles__RowDraggable",
  componentId: "sc-17vgpy2-2"
})(["height:4px;width:100%;cursor:row-resize;position:absolute;bottom:-4px;z-index:5;"]);
var ColumnSizerContainer = styled_components_browser_esm.div.withConfig({
  displayName: "TableDraggersstyles__ColumnSizerContainer",
  componentId: "sc-17vgpy2-3"
})(["position:absolute;height:20px;display:flex;flex-direction:row;top:", "px;"], function (_ref7) {
  var $top = _ref7.$top;
  return -$top;
});
var ColumnSizer = styled_components_browser_esm.div.withConfig({
  displayName: "TableDraggersstyles__ColumnSizer",
  componentId: "sc-17vgpy2-4"
})(["text-align:center;color:", ";font-weight:500;vertical-align:top;width:", "px;background-color:", ";border:", ";position:relative;height:", "px;font-size:", "px;display:flex;align-items:center;justify-content:center;margin:0 1px;border-radius:4px;"], function (_ref8) {
  var $active = _ref8.$active;
  return $active ? colors.WHITE : colors.BLUE;
}, function (_ref9) {
  var $width = _ref9.$width;
  return $width - 2;
}, function (_ref10) {
  var $active = _ref10.$active;
  return $active ? colors.BLUE : primaryLightColor88;
}, function (_ref11) {
  var $active = _ref11.$active;
  return $active ? '1px solid rgba(0, 0, 0, 0.1)' : "1px solid ".concat(primaryLightColor50);
}, function (_ref12) {
  var $height = _ref12.$height;
  return $height;
}, function (_ref13) {
  var $fontSize = _ref13.$fontSize;
  return $fontSize;
});
var ColumnDraggable = styled_components_browser_esm.div.withConfig({
  displayName: "TableDraggersstyles__ColumnDraggable",
  componentId: "sc-17vgpy2-5"
})(["width:4px;height:100%;cursor:col-resize;position:absolute;top:0;right:-4px;z-index:5;"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/helpers/getNextColumnLabel.tsx
/**
 * Returns the next column label: B, C, D ...
 * @param currentLabel
 */

/* harmony default export */ var getNextColumnLabel = (function (currentLabel) {
  return String.fromCharCode(currentLabel.charCodeAt(0) + 1);
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/helpers/resizeCell.tsx
/**
 * Returns the available dragging space for the horizontal cell resize
 * @param startingIndex
 * @param tableCols
 * @param zoom
 */
var getHorizontalLimits = function getHorizontalLimits(startingIndex, tableCols, zoom) {
  var leftWidth = tableCols.getIn(["".concat(startingIndex), 'width']) * zoom;
  var rightWidth = tableCols.getIn(["".concat(startingIndex + 1), 'width']) * zoom;
  return {
    leftWidth: leftWidth,
    rightWidth: rightWidth
  };
};

/**
 * Returns the available space when the rows is resized to the top
 * @param startingIndex
 * @param tableRows
 * @param zoom
 */
var getUpperLimit = function getUpperLimit(startingIndex, tableRows, zoom) {
  return tableRows.getIn(["".concat(startingIndex), 'height']) * zoom;
};
var RESIZE_TYPES = {
  COLUMN: 'column',
  ROW: 'row'
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/TableDraggers/index.tsx







var MIN_LIMIT = 40;
var TableDraggers = function TableDraggers(_ref) {
  var zoom = _ref.zoom,
    tableRows = _ref.tableRows,
    selectedCoordinates = _ref.selectedCoordinates,
    parsedCells = _ref.parsedCells,
    tableRef = _ref.tableRef,
    resizing = _ref.resizing,
    setResizing = _ref.setResizing,
    setClickedPosition = _ref.setClickedPosition,
    setResizeType = _ref.setResizeType,
    resizeType = _ref.resizeType,
    setClickedOrigin = _ref.setClickedOrigin,
    clickedOrigin = _ref.clickedOrigin,
    sizes = _ref.sizes,
    resizeColumn = _ref.resizeColumn,
    resizeRow = _ref.resizeRow;
  var rows = [];
  if (tableRows) {
    rows = JSON.parse(tableRows);
  }
  var columnLabel = 'A';
  var sizerSize = 20; // px
  var sizerFontSize = 12; // px
  var rowsLength = rows.length;
  var columnsLength = rows[0].length;
  var mousePosition = (0,react.useRef)(clickedOrigin);
  var _useState = (0,react.useState)({
      left: 0,
      right: 0
    }),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    horizontalLimits = _useState2[0],
    setHorizontalLimits = _useState2[1];
  var _useState3 = (0,react.useState)(0),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    topLimit = _useState4[0],
    setTopLimit = _useState4[1];
  var _useState5 = (0,react.useState)(-1),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    lineIndex = _useState6[0],
    setLineIndex = _useState6[1];
  var onResizeStart = function onResizeStart(e, index, type) {
    e.stopPropagation();
    setResizing(true);
    setResizeType(type);
    setLineIndex(index);
    var tableRect;
    if (tableRef && tableRef.current) {
      tableRect = tableRef.current.getBoundingClientRect();
      var x = tableRect && 'x' in tableRect ? tableRect.x : 0;
      var y = tableRect && 'y' in tableRect ? tableRect.y : 0;
      if (type === RESIZE_TYPES.COLUMN) {
        var _getHorizontalLimits = getHorizontalLimits(index, sizes.get('cols'), zoom),
          leftWidth = _getHorizontalLimits.leftWidth,
          rightWidth = _getHorizontalLimits.rightWidth;
        setClickedPosition(e.clientX - x);
        setClickedOrigin(e.clientX - x);
        setHorizontalLimits({
          left: leftWidth,
          right: rightWidth
        });
      } else {
        setClickedOrigin(e.clientY - y);
        setClickedPosition(e.clientY - y);
        var upperLimit = getUpperLimit(index, sizes.get('rows'), zoom);
        setTopLimit(upperLimit);
      }
    }
  };
  (0,react.useEffect)(function () {
    var onMouseMove = function onMouseMove(e) {
      if (resizing && setClickedPosition) {
        var tableRect;
        if (tableRef && tableRef.current) {
          tableRect = tableRef.current.getBoundingClientRect();
          var x = tableRect && 'x' in tableRect ? tableRect.x : 0;
          var y = tableRect && 'y' in tableRect ? tableRect.y : 0;
          if (resizeType === RESIZE_TYPES.COLUMN) {
            var leftLimit = Math.round(clickedOrigin - horizontalLimits.left + MIN_LIMIT);
            var rightLimit = Math.round(clickedOrigin + horizontalLimits.right - MIN_LIMIT);
            if (leftLimit >= Math.round(e.clientX - x)) {
              setClickedPosition(leftLimit);
              mousePosition.current = leftLimit;
            } else if (rightLimit <= Math.round(e.clientX - x)) {
              setClickedPosition(rightLimit);
              mousePosition.current = rightLimit;
            } else {
              setClickedPosition(e.clientX - x);
              mousePosition.current = e.clientX - x;
            }
          } else {
            var upperLimit = Math.round(clickedOrigin - topLimit + MIN_LIMIT / 2);
            if (upperLimit >= Math.round(e.clientY - y)) {
              setClickedPosition(upperLimit);
              mousePosition.current = e.clientY - y;
            } else {
              setClickedPosition(e.clientY - y);
              mousePosition.current = e.clientY - y;
            }
          }
        }
      }
    };
    var onResizeEnd = function onResizeEnd(e) {
      if (resizeColumn && resizeRow) {
        var tableRect;
        if (tableRef && tableRef.current) {
          tableRect = tableRef.current.getBoundingClientRect();
          var x = tableRect && 'x' in tableRect ? tableRect.x : 0;
          var y = tableRect && 'y' in tableRect ? tableRect.y : 0;

          // Resize only if the dragger was moved
          if (resizeType === RESIZE_TYPES.COLUMN && clickedOrigin - (e.clientX - x) !== 0) {
            resizeColumn({
              colIndex: lineIndex,
              columns: sizes.get('cols'),
              resizeValue: clickedOrigin - mousePosition.current
            });
          } else if (resizeType === RESIZE_TYPES.ROW && clickedOrigin - (e.clientY - y) !== 0) {
            resizeRow({
              rowIndex: lineIndex,
              auxRows: sizes.get('rows'),
              resizeValue: clickedOrigin - mousePosition.current
            });
          }
        }
        setResizing(false);
        setResizeType('');
      }
    };
    if (resizing) {
      window.addEventListener('mousemove', onMouseMove);
      window.addEventListener('mouseup', onResizeEnd);
    }
    return function () {
      window.removeEventListener('mousemove', onMouseMove);
      window.removeEventListener('mouseup', onResizeEnd);
    };
  }, [resizing]);
  var getColumnSizer = (0,react.useMemo)(function () {
    var columnSizer = rows[0].map(function (cell, cellIndex) {
      var width = sizes.getIn(['cols', String(cellIndex), 'width']) * zoom;
      var column = /*#__PURE__*/react.createElement(ColumnSizer, {
        key: "column-sizer-".concat(cellIndex + 1),
        $width: width,
        $height: sizerSize,
        $fontSize: sizerFontSize,
        $active: selectedCoordinates.columns.includes(cellIndex)
      }, /*#__PURE__*/react.createElement("span", null, columnLabel), rows[0][cellIndex] && /*#__PURE__*/react.createElement(ColumnDraggable, {
        role: "presentation",
        key: "column-draggable-".concat(cellIndex + 1),
        onMouseDown: function onMouseDown(e) {
          return onResizeStart(e, cellIndex, RESIZE_TYPES.COLUMN);
        }
      }));
      columnLabel = getNextColumnLabel(columnLabel);
      return column;
    });
    return /*#__PURE__*/react.createElement(ColumnSizerContainer, {
      $top: 25
    }, columnSizer);
  }, [columnsLength, zoom, parsedCells.join(), resizeType === RESIZE_TYPES.COLUMN, sizes]);
  var getRowSizer = (0,react.useMemo)(function () {
    var rowSizer = rows.map(function (row, rowIndex) {
      var height = sizes.getIn(['rows', String(rowIndex), 'height']) * zoom;
      return /*#__PURE__*/react.createElement(RowSizer, {
        key: "row-sizer-".concat(rowIndex + 1),
        $height: height,
        $fontSize: sizerFontSize,
        $active: selectedCoordinates.rows.includes(rowIndex)
      }, rowIndex + 1, rows[rowIndex] && /*#__PURE__*/react.createElement(RowDraggable, {
        role: "presentation",
        key: "row-draggable-".concat(rowIndex + 1),
        onMouseDown: function onMouseDown(e) {
          return onResizeStart(e, rowIndex, RESIZE_TYPES.ROW);
        }
      }));
    });
    return /*#__PURE__*/react.createElement(RowSizerContainer, {
      $left: 25
    }, rowSizer);
  }, [rowsLength, zoom, parsedCells.join(), resizeType === RESIZE_TYPES.ROW, sizes]);
  return /*#__PURE__*/react.createElement(react.Fragment, null, getRowSizer, getColumnSizer);
};
TableDraggers.propTypes = {
  zoom: (prop_types_default()).number.isRequired,
  tableRows: (prop_types_default()).string.isRequired,
  selectedCoordinates: prop_types_default().shape({
    rows: prop_types_default().arrayOf((prop_types_default()).number.isRequired).isRequired,
    columns: prop_types_default().arrayOf((prop_types_default()).number.isRequired).isRequired
  }).isRequired,
  sizes: ImmutablePropTypes_default().mapContains({
    background: (prop_types_default()).string.isRequired,
    cols: prop_types_default().shape({}).isRequired,
    height: (prop_types_default()).number.isRequired,
    lock: prop_types_default().instanceOf(Object).isRequired,
    rows: prop_types_default().shape({}).isRequired,
    width: (prop_types_default()).number.isRequired
  }).isRequired,
  parsedCells: prop_types_default().arrayOf((prop_types_default()).string.isRequired).isRequired,
  resizing: (prop_types_default()).bool.isRequired,
  clickedOrigin: (prop_types_default()).number.isRequired,
  resizeType: (prop_types_default()).string.isRequired,
  setResizing: (prop_types_default()).func.isRequired,
  setClickedPosition: (prop_types_default()).func.isRequired,
  setResizeType: (prop_types_default()).func.isRequired,
  setClickedOrigin: (prop_types_default()).func.isRequired,
  resizeColumn: (prop_types_default()).func.isRequired,
  resizeRow: (prop_types_default()).func.isRequired
};
/* harmony default export */ var Table_TableDraggers = (TableDraggers);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Table/TableView/index.tsx







var LINE_THICKNESS = 2;
var CELL_WIDTH = 200;
var CELL_HEIGHT = 50;
var TableView = function TableView(_ref) {
  var zoom = _ref.zoom,
    _ref$onChange = _ref.onChange,
    onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
    tableRows = _ref.tableRows,
    _ref$selected = _ref.selected,
    selected = _ref$selected === void 0 ? false : _ref$selected,
    _ref$selectedCells = _ref.selectedCells,
    selectedCells = _ref$selectedCells === void 0 ? '' : _ref$selectedCells,
    id = _ref.id,
    _ref$onCellSelect = _ref.onCellSelect,
    onCellSelect = _ref$onCellSelect === void 0 ? function () {} : _ref$onCellSelect,
    _ref$editable = _ref.editable,
    editable = _ref$editable === void 0 ? false : _ref$editable,
    onCellDoubleClick = _ref.onCellDoubleClick,
    _ref$onMouseDown = _ref.onMouseDown,
    onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
    _ref$onMouseMove = _ref.onMouseMove,
    onMouseMove = _ref$onMouseMove === void 0 ? function () {} : _ref$onMouseMove,
    canSelectCell = _ref.canSelectCell,
    _ref$inputCharacter = _ref.inputCharacter,
    inputCharacter = _ref$inputCharacter === void 0 ? '' : _ref$inputCharacter,
    _ref$setInputCharacte = _ref.setInputCharacter,
    setInputCharacter = _ref$setInputCharacte === void 0 ? function () {} : _ref$setInputCharacte,
    onRowHeightChange = _ref.onRowHeightChange,
    _ref$isMultipleSelect = _ref.isMultipleSelected,
    isMultipleSelected = _ref$isMultipleSelect === void 0 ? false : _ref$isMultipleSelect,
    elementSizes = _ref.elementSizes,
    resizeColumn = _ref.resizeColumn,
    resizeRow = _ref.resizeRow,
    _ref$tableHashCode = _ref.tableHashCode,
    tableHashCode = _ref$tableHashCode === void 0 ? 0 : _ref$tableHashCode,
    _ref$disabled = _ref.disabled,
    disabled = _ref$disabled === void 0 ? true : _ref$disabled,
    _ref$scale = _ref.scale,
    scale = _ref$scale === void 0 ? 1 : _ref$scale,
    alpha = _ref.alpha,
    tableStyleHashCode = _ref.tableStyleHashCode,
    refTableStyleHashCode = _ref.refTableStyleHashCode;
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    resizing = _useState2[0],
    setResizing = _useState2[1];
  var _useState3 = (0,react.useState)(0),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    clickedPosition = _useState4[0],
    setClickedPosition = _useState4[1];
  var _useState5 = (0,react.useState)(0),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    clickedOrigin = _useState6[0],
    setClickedOrigin = _useState6[1];
  var _useState7 = (0,react.useState)(''),
    _useState8 = slicedToArray_slicedToArray(_useState7, 2),
    resizeType = _useState8[0],
    setResizeType = _useState8[1];
  var tableRef = (0,react.useRef)(null);
  var selectedCoordinates = {
    rows: [],
    columns: []
  };
  var parsedCells = [];
  var rows = [];
  if (selectedCells) {
    parsedCells = JSON.parse(selectedCells);
    parsedCells.forEach(function (cell) {
      selectedCoordinates.rows.push(Number(cell.split('_')[0]));
      selectedCoordinates.columns.push(Number(cell.split('_')[1]));
    });
  }
  if (tableRows) {
    rows = JSON.parse(tableRows);
  }
  if (selectedCells) {
    parsedCells = JSON.parse(selectedCells);
  }
  var generateTableBody = (0,react.useMemo)(function () {
    var tableBody = [];
    rows.forEach(function (row, rowIndex) {
      var rowCells = [];

      // Apply the maximum height from each row of the table
      var maxRowHeight = CELL_HEIGHT;
      if (elementSizes) {
        maxRowHeight = elementSizes.getIn(['rows', String(rowIndex), 'height'], CELL_HEIGHT);
      } else {
        maxRowHeight = row.reduce(function (prev, current) {
          return prev.height > current.height ? prev : current;
        }).height;
      }
      maxRowHeight *= zoom;
      row.forEach(function (cell, cellIndex) {
        var isCellSelected = selectedCoordinates.rows.includes(rowIndex) && selectedCoordinates.columns.includes(cellIndex);
        var onHeightChange = function onHeightChange(offsetHeight) {
          if (onRowHeightChange) {
            onRowHeightChange(rowIndex, cellIndex, offsetHeight);
          }
        };
        var cellWidth = elementSizes ? elementSizes.getIn(['cols', String(cellIndex), 'width']) * zoom : cell.width * zoom;
        rowCells.push(/*#__PURE__*/react.createElement(Table_TableCell, {
          key: "td-".concat(cellIndex + 1),
          row: rowIndex,
          col: cellIndex,
          elements: JSON.stringify(cell.elements),
          zoom: zoom,
          onChange: onChange,
          cellWidth: cellWidth,
          cellHeight: maxRowHeight,
          onDoubleClick: onCellDoubleClick,
          onCellSelect: onCellSelect,
          selected: isCellSelected,
          elementId: id,
          editable: isCellSelected && editable,
          canSelectCell: canSelectCell && !resizing && selected,
          inputCharacter: inputCharacter,
          setInputCharacter: setInputCharacter,
          onHeightChange: onHeightChange,
          isMultipleSelected: isMultipleSelected,
          selectedCells: selectedCells,
          isBottomCell: selected && rowIndex === rows.length - 1,
          backgroundColor: cell.background,
          border: JSON.stringify(cell.border),
          disabled: disabled,
          scale: scale || 1,
          tableStyleHashCode: tableStyleHashCode,
          refTableStyleHashCode: refTableStyleHashCode
        }));
      });
      tableBody.push(/*#__PURE__*/react.createElement(TableRow, {
        key: "row-".concat(rowIndex + 1)
      }, rowCells));
    });
    return tableBody;
  }, [zoom, editable, selectedCells, elementSizes, canSelectCell, tableHashCode, scale, isMultipleSelected]);
  var resizeLineStyle = resizeType === RESIZE_TYPES.COLUMN ? {
    top: 0,
    left: clickedPosition,
    height: elementSizes ? Number(elementSizes.get('height')) * zoom : CELL_HEIGHT * zoom,
    width: LINE_THICKNESS
  } : {
    left: 0,
    top: clickedPosition,
    width: elementSizes ? Number(elementSizes.get('width')) * zoom : CELL_WIDTH * zoom,
    height: LINE_THICKNESS
  };
  return /*#__PURE__*/react.createElement(react.Fragment, null, selected && elementSizes && zoom > 0.1 && /*#__PURE__*/react.createElement(Table_TableDraggers, {
    zoom: zoom,
    tableRows: tableRows,
    selectedCoordinates: selectedCoordinates,
    parsedCells: parsedCells,
    tableRef: tableRef,
    resizing: resizing,
    setResizing: setResizing,
    setResizeType: setResizeType,
    resizeType: resizeType,
    setClickedPosition: setClickedPosition,
    setClickedOrigin: setClickedOrigin,
    clickedOrigin: clickedOrigin,
    sizes: elementSizes,
    resizeColumn: resizeColumn,
    resizeRow: resizeRow
  }), resizing && /*#__PURE__*/react.createElement(ResizeLine, {
    $top: resizeLineStyle.top,
    $left: resizeLineStyle.left,
    $height: resizeLineStyle.height,
    $width: resizeLineStyle.width
  }), /*#__PURE__*/react.createElement("div", {
    role: "presentation",
    onMouseDown: onMouseDown,
    onMouseMove: onMouseMove,
    className: "item-table-staged",
    ref: tableRef
  }, /*#__PURE__*/react.createElement(TableEditable, {
    $width: elementSizes ? Number(elementSizes.get('width')) * zoom : '',
    $height: elementSizes ? Number(elementSizes.get('height')) * zoom : '',
    cellPadding: "0",
    cellSpacing: "0",
    $scale: scale || 1,
    $alpha: typeof alpha !== 'undefined' ? alpha : 1
  }, /*#__PURE__*/react.createElement("tbody", null, generateTableBody))));
};
TableView.propTypes = {
  zoom: (prop_types_default()).number.isRequired,
  onChange: (prop_types_default()).func,
  onCellSelect: (prop_types_default()).func,
  tableRows: (prop_types_default()).string.isRequired,
  selected: (prop_types_default()).bool,
  editable: (prop_types_default()).bool,
  selectedCells: (prop_types_default()).string,
  id: (prop_types_default()).number.isRequired,
  isMultipleSelected: (prop_types_default()).bool,
  tableHashCode: (prop_types_default()).number,
  onMouseDown: (prop_types_default()).func,
  onMouseMove: (prop_types_default()).func,
  inputCharacter: (prop_types_default()).string,
  setInputCharacter: (prop_types_default()).func,
  onRowHeightChange: (prop_types_default()).func,
  disabled: (prop_types_default()).bool,
  scale: (prop_types_default()).number,
  alpha: (prop_types_default()).number.isRequired
};
/* harmony default export */ var Table_TableView = (TableView);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ShapesAndPatterns/DefsGradient.tsx



var DefsGradient = function DefsGradient(props) {
  var gradient = parseGradientToSvg(props.color);
  return /*#__PURE__*/react.createElement("defs", null, (gradient === null || gradient === void 0 ? void 0 : gradient.type) === GradientTypes.LINEAR && /*#__PURE__*/react.createElement("linearGradient", {
    id: props.gradientId,
    x1: gradient.x1,
    y1: gradient.y1,
    x2: gradient.x2,
    y2: gradient.y2
  }, gradient.stops.map(function (stop, index) {
    return /*#__PURE__*/react.createElement("stop", {
      key: "stop-".concat(index),
      offset: stop.offset,
      stopColor: stop.color
    });
  })), (gradient === null || gradient === void 0 ? void 0 : gradient.type) === GradientTypes.RADIAL && /*#__PURE__*/react.createElement("radialGradient", {
    id: props.gradientId,
    cx: gradient.cx,
    cy: gradient.cy,
    r: gradient.r,
    fx: gradient.fx,
    fy: gradient.fy
  }, gradient.stops.map(function (stop, index) {
    return /*#__PURE__*/react.createElement("stop", {
      key: "stop-".concat(index),
      offset: stop.offset,
      stopColor: stop.color
    });
  })));
};
/* harmony default export */ var ShapesAndPatterns_DefsGradient = (DefsGradient);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ShapesAndPatterns/styles.tsx

var ShapeContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__ShapeContainer",
  componentId: "sc-ox7ydu-0"
})(["width:", "px;height:", "px;"], function (props) {
  return props.containerWidth;
}, function (props) {
  return props.containerHeight;
});
var SvgShape = styled_components_browser_esm.svg.withConfig({
  displayName: "styles__SvgShape",
  componentId: "sc-ox7ydu-1"
})(["width:", "px;height:", "px;stroke:", ";fill:", ";opacity:", ";border-radius:", "px;filter:", ";pointerEvents:", ";display:block;"], function (props) {
  return props.containerWidth;
}, function (props) {
  return props.containerHeight;
}, function (props) {
  return props.shapeStroke;
}, function (props) {
  return props.shapeColor;
}, function (props) {
  return props.shapeOpacity;
}, function (props) {
  return props.shapeBorderRadius;
}, function (props) {
  return props.shapeFilter;
}, function (props) {
  return props.shapePointerEvents;
});
var SvgPattern = styled_components_browser_esm(SvgShape).attrs(function (props) {
  return {
    viewBox: "0 0 ".concat(props.shapeHeight * (props.containerWidth / props.containerHeight), " ").concat(props.shapeHeight)
  };
}).withConfig({
  displayName: "styles__SvgPattern",
  componentId: "sc-ox7ydu-2"
})([""]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ShapesAndPatterns/Shape.tsx





var Shape = function Shape(_ref) {
  var containerWidth = _ref.containerWidth,
    containerHeight = _ref.containerHeight,
    shapeProps = _ref.shapeProps,
    hasLinePattern = _ref.hasLinePattern,
    shadowProps = _ref.shadowProps,
    id = _ref.id;
  var _ref2 = shadowProps || {
      shadow: false,
      offsetX: 10,
      offsetY: 10,
      shadowBlur: 0,
      shadowR: 0,
      shadowG: 0,
      shadowB: 0,
      shadowA: 1
    },
    shadow = _ref2.shadow,
    offsetX = _ref2.offsetX,
    offsetY = _ref2.offsetY,
    shadowBlur = _ref2.shadowBlur,
    shadowR = _ref2.shadowR,
    shadowG = _ref2.shadowG,
    shadowB = _ref2.shadowB,
    shadowA = _ref2.shadowA;

  /**
   * !!! @shapeWidth and @shapeHeight are the values that are set in viewBox for every svg
   * This values are set only in redux under shapes -> shapeList -> 'element' -> width/height
   */
  var _ref3 = shapeProps,
    shapeId = _ref3.shapeId,
    shapeWidth = _ref3.shapeWidth,
    shapeHeight = _ref3.shapeHeight,
    shapeColor = _ref3.shapeColor,
    shapeOpacity = _ref3.shapeOpacity,
    shapeBorderRadius = _ref3.shapeBorderRadius;
  var isGradientColor = shapeGradientTools_isGradient(shapeColor);
  var gradientId = "defs-gradient-".concat(shapeId, "-").concat(id);
  var color = isGradientColor ? "url(#".concat(gradientId, ")") : shapeColor;
  return /*#__PURE__*/react.createElement(ShapeContainer, {
    containerWidth: containerWidth,
    containerHeight: containerHeight
  }, /*#__PURE__*/react.createElement(src_Shadow, {
    shadow: shadow,
    offsetX: offsetX,
    offsetY: offsetY,
    shadowBlur: shadowBlur,
    shadowR: shadowR,
    shadowG: shadowG,
    shadowB: shadowB,
    shadowA: shadowA
  }, hasLinePattern ? /*#__PURE__*/react.createElement(SvgPattern, {
    containerWidth: containerWidth,
    containerHeight: containerHeight,
    shapeWidth: shapeWidth,
    shapeHeight: shapeHeight,
    shapeColor: shapeColor,
    shapeOpacity: shapeOpacity,
    shapeBorderRadius: shapeBorderRadius
  }, /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("pattern", {
    x: "0",
    y: "0",
    width: "".concat(shapeWidth, "px"),
    height: "".concat(shapeHeight, "px"),
    patternUnits: "userSpaceOnUse",
    id: "pattern-".concat(shapeId)
  }, /*#__PURE__*/react.createElement("use", {
    stroke: "none",
    href: "#icon-".concat(shapeId),
    width: "".concat(shapeWidth, "px"),
    height: "".concat(shapeHeight, "px")
  }))), /*#__PURE__*/react.createElement("rect", {
    stroke: "none",
    x: "0",
    y: "0",
    width: "100%",
    height: "100%",
    fill: "url(#pattern-".concat(shapeId, ")")
  })) : /*#__PURE__*/react.createElement(SvgShape, {
    containerWidth: containerWidth,
    containerHeight: containerHeight,
    shapeColor: color,
    shapeStroke: color,
    shapeOpacity: shapeOpacity,
    shapeBorderRadius: shapeBorderRadius
  }, isGradientColor && /*#__PURE__*/react.createElement(ShapesAndPatterns_DefsGradient, {
    color: shapeColor,
    gradientId: gradientId
  }), /*#__PURE__*/react.createElement("use", {
    href: "#icon-".concat(shapeId)
  }))));
};
/* harmony default export */ var ShapesAndPatterns_Shape = (Shape);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ShapesAndPatterns/index.tsx


/* harmony default export */ var ShapesAndPatterns = (ShapesAndPatterns_Shape);

;// CONCATENATED MODULE: ../../modules/ui/code/core/src/LeadForm/styles.tsx

var LeadFormContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__LeadFormContainer",
  componentId: "sc-1pegj1v-0"
})(["padding:18px 0 18px 18px;pointer-events:auto;font-weight:300;z-index:3;"]);
var LeadFormContent = styled_components_browser_esm.div.withConfig({
  displayName: "styles__LeadFormContent",
  componentId: "sc-1pegj1v-1"
})(["-webkit-overflow-scrolling:touch;overflow-y:visible;overflow-x:hidden;display:flex;align-items:center;"]);
var ImageSection = styled_components_browser_esm.div.withConfig({
  displayName: "styles__ImageSection",
  componentId: "sc-1pegj1v-2"
})(["margin:1px 21px 1px 1px;box-shadow:0 0 2px 0 #cbcfd9;"]);
var LeadForm_styles_Image = styled_components_browser_esm.img.withConfig({
  displayName: "styles__Image",
  componentId: "sc-1pegj1v-3"
})(["max-width:150px;margin:6px 6px 2px 6px;src:", ";"], function (props) {
  return props.src;
});
var ImagePlaceholder = styled_components_browser_esm.div.withConfig({
  displayName: "styles__ImagePlaceholder",
  componentId: "sc-1pegj1v-4"
})(["width:150px;height:212px;display:flex;justify-content:center;align-items:center;border:solid 1px #dce0e4;margin:6px;font-weight:700;color:#dce0e4;"]);
var EmailForm = styled_components_browser_esm.div.withConfig({
  displayName: "styles__EmailForm",
  componentId: "sc-1pegj1v-5"
})(["word-wrap:break-word;display:flex;flex-direction:column;"]);
var Title = styled_components_browser_esm.div.withConfig({
  displayName: "styles__Title",
  componentId: "sc-1pegj1v-6"
})(["font-size:27px;color:#566c81;line-height:1.22;letter-spacing:.1px;margin-bottom:16px;max-width:221px;"]);
var EmailInput = styled_components_browser_esm.input.withConfig({
  displayName: "styles__EmailInput",
  componentId: "sc-1pegj1v-7"
})(["padding-left:14px;width:240px;height:37px;border-radius:3px;background-color:#fff;border:1px solid ", ";font-size:14px;letter-spacing:.1px;color:#656e83;outline:none;"], function (props) {
  return props.borderColor;
});
var SubmitButton = styled_components_browser_esm.button.withConfig({
  displayName: "styles__SubmitButton",
  componentId: "sc-1pegj1v-8"
})(["cursor:pointer;margin-top:15px;padding:0 7px;color:#fff;text-align:center;line-height:15px;width:133px;height:37px;border-radius:2px;background-color:#0362fc;font-size:12px;font-weight:500;letter-spacing:0.1px;text-transform:uppercase;border:0px;outline:none;"]);
var ErrorMessage = styled_components_browser_esm.div.withConfig({
  displayName: "styles__ErrorMessage",
  componentId: "sc-1pegj1v-9"
})(["color:#d80000;width:100%;white-space:nowrap;line-height:12px;margin-top:15px;font-size:12px;"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/LeadForm/helpers.tsx
var isValidaEmail = function isValidaEmail(email, setHasError) {
  var re = /\S+@\S+\.\S+/;
  if (!re.test(String(email).toLowerCase())) {
    setHasError(true);
    return false;
  }
  setHasError(false);
  return true;
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/LeadForm/index.tsx





var LeadForm = function LeadForm(_ref) {
  var src = _ref.src,
    title = _ref.title,
    placeholderText = _ref.placeholderText,
    buttonText = _ref.buttonText;
  var DEFAULT_BORDER_COLOR = '#d5d8dd';
  var ERROR_BORDER_COLOR = '#D80000';
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    hasError = _useState2[0],
    setHasError = _useState2[1];
  var inputBorderColor = hasError ? ERROR_BORDER_COLOR : DEFAULT_BORDER_COLOR;
  var image = /*#__PURE__*/react.createElement(LeadForm_styles_Image, {
    src: src
  });
  var imagePlaceholder = /*#__PURE__*/react.createElement(ImagePlaceholder, null, "COVER");
  var ref = (0,react.useRef)(null);
  var imageSection = src ? image : imagePlaceholder;
  var errorMessage = /*#__PURE__*/react.createElement(ErrorMessage, null, "Please enter a valid email address.");
  var checkEmail = function checkEmail() {
    if (ref && ref.current && ref.current.value) {
      isValidaEmail(ref.current.value, setHasError);
    } else {
      setHasError(true);
    }
  };
  return /*#__PURE__*/react.createElement(LeadFormContainer, null, /*#__PURE__*/react.createElement(LeadFormContent, null, /*#__PURE__*/react.createElement(ImageSection, null, imageSection), /*#__PURE__*/react.createElement(EmailForm, null, /*#__PURE__*/react.createElement(Title, null, title), /*#__PURE__*/react.createElement(EmailInput, {
    placeholder: placeholderText,
    ref: ref,
    onSelect: function onSelect() {
      return setHasError(false);
    },
    borderColor: inputBorderColor
  }), hasError && errorMessage, /*#__PURE__*/react.createElement(SubmitButton, {
    onClick: checkEmail
  }, buttonText))));
};
LeadForm.propTypes = {
  src: (prop_types_default()).string,
  title: (prop_types_default()).string,
  placeholderText: (prop_types_default()).string,
  buttonText: (prop_types_default()).string
};
LeadForm.defaultProps = {
  src: '',
  title: 'Fill out this form to keep reading',
  placeholderText: 'Enter your email here',
  buttonText: 'Submit'
};
/* harmony default export */ var src_LeadForm = ((/* unused pure expression or super */ null && (LeadForm)));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/TextView/styles.tsx

var ElementStyles = Ce(["", ""], function (_ref) {
  var rawAttributes = _ref.rawAttributes;
  return rawAttributes;
});
var styles_TextView = styled_components_browser_esm.div.withConfig({
  displayName: "styles__TextView",
  componentId: "sc-6mg8wj-0"
})(["width:", ";height:", ";", ";font-family:", ";white-space:pre-wrap;line-height:1;"], function (_ref2) {
  var width = _ref2.width;
  return width;
}, function (_ref3) {
  var height = _ref3.height;
  return height;
}, ElementStyles, function (_ref4) {
  var fontFamily = _ref4.fontFamily;
  return fontFamily;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/TextView/helpers.tsx
/**
 * Transform node data [{ text, style }] into html
 *
 * @param nodeData - text nodes ( array of objects )
 * @return returns the escaped html content, with '&lt;' instead of '<', etc...
 */

var escapeTextViewHTML = function escapeTextViewHTML(nodeData) {
  var div = document.createElement('div');
  nodeData.forEach(function (n) {
    var tag = document.createElement('span');
    var text = n.text.replace(/\n/g, '<br />');
    if (n.style) {
      var styles = Object.keys(n.style);
      tag.innerHTML = text;
      if (styles.length) {
        styles.forEach(function (style) {
          var newStyleValue = n.style[style];
          if (newStyleValue) {
            newStyleValue = n.style[style].replace(';', '');
          }
          tag.style[style] = newStyleValue;
        });
      }
    }
    div.appendChild(tag);
  });
  var result = "<span class=\"text-box-inner\">".concat(div.innerHTML, "</span>");
  if (div instanceof HTMLElement) {
    return result;
  }
  return '<span />';
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/TextView/index.tsx




var TextView = function TextView(_ref) {
  var _ref$width = _ref.width,
    width = _ref$width === void 0 ? 0 : _ref$width,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? 0 : _ref$height,
    nodes = _ref.nodes,
    _ref$rawAttributes = _ref.rawAttributes,
    rawAttributes = _ref$rawAttributes === void 0 ? '{}' : _ref$rawAttributes,
    _ref$fontFamily = _ref.fontFamily,
    fontFamily = _ref$fontFamily === void 0 ? '' : _ref$fontFamily;
  var attributes = JSON.parse(rawAttributes);
  return /*#__PURE__*/react.createElement(styles_TextView, {
    role: "presentation",
    width: "".concat(width, "px"),
    height: "".concat(height, "px"),
    fontFamily: fontFamily,
    rawAttributes: attributes
  }, /*#__PURE__*/react.createElement("div", {
    dangerouslySetInnerHTML: {
      __html: escapeTextViewHTML(nodes)
    }
  }));
};
TextView.propTypes = {
  width: (prop_types_default()).number,
  height: (prop_types_default()).number,
  nodes: prop_types_default().arrayOf(prop_types_default().shape({
    text: (prop_types_default()).string.isRequired,
    style: prop_types_default().shape({
      letterSpacing: (prop_types_default()).string.isRequired
    }).isRequired
  }).isRequired).isRequired,
  rawAttributes: (prop_types_default()).string,
  fontFamily: (prop_types_default()).string
};
TextView.defaultProps = {
  width: 0,
  height: 0,
  rawAttributes: '{}',
  fontFamily: ''
};
/* harmony default export */ var src_TextView = ((/* unused pure expression or super */ null && (TextView)));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/IFrame/helpers.tsx
/**
 * Generates the document to embed in the iframe.
 * @param {string} html
 * @return {string}
 */
var getDocumentSrc = function getDocumentSrc(html) {
  return "data:text/html;charset=utf-8,".concat(encodeURI("<html style=\"height:100%;overflow:hidden;\"><body style=\"height:100%; margin:0;\">".concat(html, "</body></html>")));
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/IFrame/constants.tsx
var DEFAULT_SANDBOX_OPTIONS = ['allow-forms', 'allow-downloads', 'allow-modals', 'allow-popups', 'allow-same-origin', 'allow-scripts'];
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/IFrame/index.tsx





var IFrame = function IFrame(_ref) {
  var encodedHtml = _ref.encodedHtml,
    title = _ref.title;
  var srcDoc = decodeURI(encodedHtml);
  var src = getDocumentSrc(srcDoc);

  // Note: display flex prevents the iframe to add a scrollbar when it's not needed, it is a wired rendering bug
  return /*#__PURE__*/react.createElement("iframe", {
    style: {
      display: 'flex'
    },
    title: title,
    sandbox: DEFAULT_SANDBOX_OPTIONS.join(' '),
    srcDoc: "\n                <html style=\"height:100%;\"><body style=\"height:100%; margin:0;display:flex;\">".concat(srcDoc, "</body></html>\n            "),
    src: src,
    allowFullScreen: false,
    frameBorder: "0",
    width: "100%",
    height: "100%",
    tabIndex: TabIndex.UNREACHABLE
  });
};
IFrame.propTypes = {
  encodedHtml: (prop_types_default()).string.isRequired,
  title: (prop_types_default()).string.isRequired
};
/* harmony default export */ var src_IFrame = (IFrame);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Preloader/Preloader.styles.ts


var PreloaderContainer = styled_components_browser_esm.div.withConfig({
  displayName: "Preloaderstyles__PreloaderContainer",
  componentId: "sc-z5ixqd-0"
})(["width:", "px;height:", "px;background-color:#fff;display:flex;align-items:center;justify-content:center;position:absolute;top:0;pointer-events:all;"], function (_ref) {
  var $width = _ref.$width;
  return $width;
}, function (_ref2) {
  var $height = _ref2.$height;
  return $height;
});
var PreloaderIcon = styled_components_browser_esm.div.withConfig({
  displayName: "Preloaderstyles__PreloaderIcon",
  componentId: "sc-z5ixqd-1"
})(["background:", ";animation:PreloaderIconAnimation 1s infinite ease-in-out;width:", "px;height:", "px;:before,:after{background:", ";animation:PreloaderIconAnimation 1s infinite ease-in-out;width:", "px;height:", "px;}align-self:center;color:", ";margin:0 auto;position:relative;font-size:6px;animation-delay:-0.16s;:before,:after{position:absolute;top:0;content:'';}:before{left:-", "px;animation-delay:-0.32s;}:after{left:", "px;}@keyframes PreloaderIconAnimation{0%,80%,100%{transform:scaleY(1);}40%{transform:scaleY(1.5);}}"], themes.colors.black, function (_ref3) {
  var size = _ref3.size;
  return size;
}, function (_ref4) {
  var size = _ref4.size;
  return 4 * size;
}, themes.colors.black, function (_ref5) {
  var size = _ref5.size;
  return size;
}, function (_ref6) {
  var size = _ref6.size;
  return 4 * size;
}, themes.colors.black, function (_ref7) {
  var size = _ref7.size;
  return 2 * size;
}, function (_ref8) {
  var size = _ref8.size;
  return 2 * size;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Preloader/Preloader.tsx


var PRELOADER_PERCENTAGE = 0.5;
var PRELOADER_MIN_SIZE = 2;
var Preloader = function Preloader(props) {
  var size = (0,react.useMemo)(function () {
    if (props.preloaderSize) {
      return props.preloaderSize;
    }
    return Math.max(Math.floor(Math.min(props.width, props.height) * (PRELOADER_PERCENTAGE / 100)), PRELOADER_MIN_SIZE);
  }, [props.width, props.height, props.preloaderSize]);
  return /*#__PURE__*/react.createElement(PreloaderContainer, {
    $width: props.width,
    $height: props.height
  }, /*#__PURE__*/react.createElement(PreloaderIcon, {
    size: size
  }));
};
/* harmony default export */ var Preloader_Preloader = (Preloader);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Preloader/index.tsx

// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/react-image-gallery/build/image-gallery.js
var image_gallery = __webpack_require__(6302);
var image_gallery_default = /*#__PURE__*/__webpack_require__.n(image_gallery);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
var injectStylesIntoStyleTag = __webpack_require__(5072);
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleDomAPI.js
var styleDomAPI = __webpack_require__(7825);
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertBySelector.js
var insertBySelector = __webpack_require__(7659);
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
var setAttributesWithoutAttributes = __webpack_require__(5056);
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertStyleElement.js
var insertStyleElement = __webpack_require__(540);
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleTagTransform.js
var styleTagTransform = __webpack_require__(1113);
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!../../modules/ui/code/core/node_modules/react-image-gallery/styles/css/image-gallery.css
var css_image_gallery = __webpack_require__(8101);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-image-gallery/styles/css/image-gallery.css

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (styleTagTransform_default());
options.setAttributes = (setAttributesWithoutAttributes_default());

      options.insert = insertBySelector_default().bind(null, "head");
    
options.domAPI = (styleDomAPI_default());
options.insertStyleElement = (insertStyleElement_default());

var image_gallery_update = injectStylesIntoStyleTag_default()(css_image_gallery/* default */.A, options);




       /* harmony default export */ var styles_css_image_gallery = (css_image_gallery/* default */.A && css_image_gallery/* default */.A.locals ? css_image_gallery/* default */.A.locals : undefined);

;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Slideshow/constants.ts
var LEFT = 'LEFT';
var RIGHT = 'RIGHT';
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Slideshow/styles.tsx



var buttonSize = componentsTheme.slideshow.buttonSize;
var getScaledPosition = function getScaledPosition(scale, size) {
  return "".concat(scale * (size / 2), "px");
};
var getRightAndLeftCSS = function getRightAndLeftCSS(areTwoSlides, translateX) {
  return areTwoSlides ? "animation: hide 300ms ease;\n         opacity: 0;" : "transform: translateX(".concat(translateX, "px);");
};
var styles_ContentContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__ContentContainer",
  componentId: "sc-1nenlpk-0"
})(["width:", ";opacity:", ";overflow:hidden;.image-gallery-slide{transition:transform 300ms ease !important;", " ", ";}.image-gallery-bullets{bottom:", "px;.image-gallery-bullet{background-color:", ";border:1px solid ", ";box-shadow:0 0 1px transparent;padding:", "px;margin:0 ", "px;;transition:background-color 100ms ease;&.active,&:hover,&:focus{background-color:", ";border:1px solid ", ";}}}@keyframes hide{0%{opacity:1;}99%{opacity:1;}100%{opacity:0;}}"], function (_ref) {
  var $width = _ref.$width;
  return $width ? "".concat($width, "px") : '100%';
}, function (_ref2) {
  var $alpha = _ref2.$alpha;
  return $alpha;
}, function (_ref3) {
  var $stopRendering = _ref3.$stopRendering;
  return $stopRendering ? 'transition: none !important;' : '';
}, function (_ref4) {
  var $areTwoSlides = _ref4.$areTwoSlides;
  return "\n        &.right > img {\n            ".concat(getRightAndLeftCSS($areTwoSlides, 2), "\n        }\n        &.left > img {\n            ").concat(getRightAndLeftCSS($areTwoSlides, -2), "\n        }");
}, function (_ref5) {
  var $scale = _ref5.$scale;
  return 20 * $scale;
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.colors.white;
}, function (_ref7) {
  var theme = _ref7.theme;
  return theme.colors.withOpacity('black', 0.2);
}, function (_ref8) {
  var $scale = _ref8.$scale;
  return 3 * $scale;
}, function (_ref9) {
  var $scale = _ref9.$scale;
  return 3 * $scale;
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.colors.primary;
}, function (_ref11) {
  var theme = _ref11.theme;
  return theme.colors.withOpacity('black', 0.2);
});
var ArrowStyle = styled_components_browser_esm.div.withConfig({
  displayName: "styles__ArrowStyle",
  componentId: "sc-1nenlpk-1"
})(["background-color:transparent;cursor:pointer;position:absolute;z-index:4;width:", "px;height:", "px;top:50%;transform:translateY(-50%) translateZ(0);right:", ";left:", ";"], function (_ref12) {
  var $scale = _ref12.$scale;
  return 30 * $scale;
}, function (_ref13) {
  var $scale = _ref13.$scale;
  return 30 * $scale;
}, function (_ref14) {
  var $direction = _ref14.$direction,
    $scale = _ref14.$scale;
  return $direction === RIGHT ? getScaledPosition($scale, buttonSize) : 'unset';
}, function (_ref15) {
  var $direction = _ref15.$direction,
    $scale = _ref15.$scale;
  return $direction === LEFT ? getScaledPosition($scale, buttonSize) : 'unset';
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Slideshow/Arrow.tsx





var Arrow = function Arrow(_ref) {
  var scale = _ref.scale,
    handleClick = _ref.handleClick,
    direction = _ref.direction,
    stopPropagation = _ref.stopPropagation,
    isIOS = _ref.isIOS;
  var elemRef = (0,react.useRef)(null);
  (0,react.useEffect)(function () {
    var _elemRef$current5;
    var stopImmediatePropagation = function stopImmediatePropagation(e) {
      e.stopImmediatePropagation();
      handleClick(e);
    };
    var onKeyDown = function onKeyDown(e) {
      if (e.code === KeyboardCodes.ENTER) {
        var _elemRef$current;
        e.preventDefault();
        elemRef === null || elemRef === void 0 || (_elemRef$current = elemRef.current) === null || _elemRef$current === void 0 || _elemRef$current.click();
      }
    };
    if (stopPropagation) {
      var _elemRef$current2, _elemRef$current3;
      elemRef === null || elemRef === void 0 || (_elemRef$current2 = elemRef.current) === null || _elemRef$current2 === void 0 || _elemRef$current2.addEventListener('mousedown', stopImmediatePropagation);
      elemRef === null || elemRef === void 0 || (_elemRef$current3 = elemRef.current) === null || _elemRef$current3 === void 0 || _elemRef$current3.addEventListener('click', stopImmediatePropagation);
    } else {
      var _elemRef$current4;
      elemRef === null || elemRef === void 0 || (_elemRef$current4 = elemRef.current) === null || _elemRef$current4 === void 0 || _elemRef$current4.addEventListener('click', handleClick);
    }
    elemRef === null || elemRef === void 0 || (_elemRef$current5 = elemRef.current) === null || _elemRef$current5 === void 0 || _elemRef$current5.addEventListener('keydown', onKeyDown);
    return function () {
      var _elemRef$current9;
      if (stopPropagation) {
        var _elemRef$current6, _elemRef$current7;
        elemRef === null || elemRef === void 0 || (_elemRef$current6 = elemRef.current) === null || _elemRef$current6 === void 0 || _elemRef$current6.removeEventListener('mousedown', stopImmediatePropagation);
        elemRef === null || elemRef === void 0 || (_elemRef$current7 = elemRef.current) === null || _elemRef$current7 === void 0 || _elemRef$current7.removeEventListener('click', stopImmediatePropagation);
      } else {
        var _elemRef$current8;
        elemRef === null || elemRef === void 0 || (_elemRef$current8 = elemRef.current) === null || _elemRef$current8 === void 0 || _elemRef$current8.removeEventListener('click', handleClick);
      }
      elemRef === null || elemRef === void 0 || (_elemRef$current9 = elemRef.current) === null || _elemRef$current9 === void 0 || _elemRef$current9.removeEventListener('keydown', onKeyDown);
    };
  }, [direction, stopPropagation]);
  switch (direction) {
    case LEFT:
      {
        return /*#__PURE__*/react.createElement(ArrowStyle, {
          ref: elemRef,
          $direction: direction,
          $scale: scale,
          $isIOS: isIOS,
          "aria-label": "Prev Slide",
          tabIndex: TabIndex.DEFAULT
        }, /*#__PURE__*/react.createElement(src.ArrowLeftIcon, null));
      }
    case RIGHT:
      {
        return /*#__PURE__*/react.createElement(ArrowStyle, {
          ref: elemRef,
          $direction: direction,
          $scale: scale,
          $isIOS: isIOS,
          "aria-label": "Next Slide",
          tabIndex: TabIndex.DEFAULT
        }, /*#__PURE__*/react.createElement(src.ArrowRightIcon, null));
      }
    default:
      return null;
  }
};
/* harmony default export */ var Slideshow_Arrow = (/*#__PURE__*/react.memo(Arrow));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Slideshow/index.tsx


// @ts-ignore The types are not up-to-date. It is better to ignore it

// eslint-disable-next-line





var SlideshowDefaultProps = {
  stopArrowPropagation: false,
  stopRendering: false,
  alpha: 1,
  disableKeyDown: true,
  objectFit: 'contain',
  countImages: function countImages() {},
  countImagesLoaded: function countImagesLoaded() {},
  showBullets: true,
  showArrows: true,
  autoplay: false,
  scale: 1,
  infinite: true,
  showThumbnails: false,
  renderThumbInner: null
};
var Slideshow = /*#__PURE__*/(0,react.forwardRef)(function (_ref, elementRef) {
  var items = _ref.items,
    width = _ref.width,
    height = _ref.height,
    slideInterval = _ref.slideInterval,
    getImageSrc = _ref.getImageSrc,
    isIOS = _ref.isIOS,
    _ref$infinite = _ref.infinite,
    infinite = _ref$infinite === void 0 ? SlideshowDefaultProps.infinite : _ref$infinite,
    _ref$alpha = _ref.alpha,
    alpha = _ref$alpha === void 0 ? SlideshowDefaultProps.alpha : _ref$alpha,
    _ref$showBullets = _ref.showBullets,
    showBullets = _ref$showBullets === void 0 ? SlideshowDefaultProps.showBullets : _ref$showBullets,
    _ref$showArrows = _ref.showArrows,
    showArrows = _ref$showArrows === void 0 ? SlideshowDefaultProps.showArrows : _ref$showArrows,
    _ref$autoplay = _ref.autoplay,
    autoplay = _ref$autoplay === void 0 ? SlideshowDefaultProps.autoplay : _ref$autoplay,
    _ref$stopArrowPropaga = _ref.stopArrowPropagation,
    stopArrowPropagation = _ref$stopArrowPropaga === void 0 ? SlideshowDefaultProps.stopArrowPropagation : _ref$stopArrowPropaga,
    _ref$stopRendering = _ref.stopRendering,
    stopRendering = _ref$stopRendering === void 0 ? SlideshowDefaultProps.stopRendering : _ref$stopRendering,
    _ref$disableKeyDown = _ref.disableKeyDown,
    disableKeyDown = _ref$disableKeyDown === void 0 ? SlideshowDefaultProps.disableKeyDown : _ref$disableKeyDown,
    _ref$objectFit = _ref.objectFit,
    objectFit = _ref$objectFit === void 0 ? SlideshowDefaultProps.objectFit : _ref$objectFit,
    _ref$scale = _ref.scale,
    scale = _ref$scale === void 0 ? SlideshowDefaultProps.scale : _ref$scale,
    _ref$countImages = _ref.countImages,
    countImages = _ref$countImages === void 0 ? SlideshowDefaultProps.countImages : _ref$countImages,
    _ref$countImagesLoade = _ref.countImagesLoaded,
    countImagesLoaded = _ref$countImagesLoade === void 0 ? SlideshowDefaultProps.countImagesLoaded : _ref$countImagesLoade,
    _ref$showThumbnails = _ref.showThumbnails,
    showThumbnails = _ref$showThumbnails === void 0 ? SlideshowDefaultProps.showThumbnails : _ref$showThumbnails,
    _ref$renderThumbInner = _ref.renderThumbInner,
    renderThumbInner = _ref$renderThumbInner === void 0 ? SlideshowDefaultProps.renderThumbInner : _ref$renderThumbInner;
  var _useState = (0,react.useState)(0),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    currentSlide = _useState2[0],
    setCurrentSlide = _useState2[1];
  var galleryKey = (0,react.useMemo)(function () {
    return items.map(function (item) {
      return item.hash || '';
    }).join('-');
  }, [items]);
  var renderLeftNav = function renderLeftNav(onClick) {
    return showArrows && /*#__PURE__*/react.createElement(Slideshow_Arrow, {
      scale: scale,
      handleClick: onClick,
      direction: LEFT,
      stopPropagation: !!stopArrowPropagation,
      isIOS: isIOS
    });
  };
  var renderRightNav = function renderRightNav(onClick) {
    return showArrows && /*#__PURE__*/react.createElement(Slideshow_Arrow, {
      scale: scale,
      handleClick: onClick,
      direction: RIGHT,
      stopPropagation: !!stopArrowPropagation,
      isIOS: isIOS
    });
  };
  var renderItem = function renderItem(image) {
    return /*#__PURE__*/react.createElement(src_BaseImage, {
      width: image.originalWidth,
      height: image.originalHeight,
      src: image.original,
      objectFit: objectFit,
      setCountImages: countImages,
      setCountImagesLoaded: countImagesLoaded
    });
  };

  /**
   * In some browsers like, Safari, a button must be focused manually from js in order to work with accessibility
   * @param event
   */
  var onBulletClick = function onBulletClick(event) {
    // @ts-ignore The event target is a button, it is focusable.
    event.target.focus();
  };

  // Reset the current slide index to 0 whenever the items array changes.
  (0,react.useEffect)(function () {
    setCurrentSlide(0);
  }, [items]);
  return /*#__PURE__*/react.createElement(styles_ContentContainer, {
    $width: width,
    $alpha: alpha,
    $scale: scale,
    $stopRendering: stopRendering,
    $areTwoSlides: items.length === 2
  }, /*#__PURE__*/react.createElement((image_gallery_default()), {
    key: galleryKey,
    ref: elementRef,
    items: items.map(function (item) {
      return {
        original: getImageSrc(item.hash, item.provider),
        thumbnail: items.length > 1 ? getImageSrc(item.hash, item.provider) : '',
        originalWidth: width,
        originalHeight: height,
        renderItem: renderItem
      };
    }),
    showBullets: showBullets,
    infinite: infinite,
    slideInterval: slideInterval,
    autoPlay: autoplay,
    showThumbnails: showThumbnails,
    showPlayButton: false,
    showFullscreenButton: false,
    useBrowserFullscreen: false,
    lazyLoad: true,
    disableKeyDown: disableKeyDown,
    stopPropagation: true,
    renderLeftNav: renderLeftNav,
    renderRightNav: renderRightNav,
    swipingTransitionDuration: 300,
    onBulletClick: onBulletClick,
    useTranslate3D: false,
    startIndex: currentSlide,
    onSlide: setCurrentSlide,
    renderThumbInner: renderThumbInner
  }));
});
/* harmony default export */ var src_Slideshow = (/*#__PURE__*/react.memo(Slideshow));
// EXTERNAL MODULE: ./node_modules/lodash.debounce/index.js
var lodash_debounce = __webpack_require__(181);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/CheckBox/index.tsx




var StyledCheckBox = styled_components_browser_esm.div.withConfig({
  displayName: "CheckBox__StyledCheckBox",
  componentId: "sc-1forb5a-0"
})(["display:flex;width:34px;height:34px;border-radius:4px;transition:background 100ms ease;margin-left:4px;", " > svg{margin:auto;}"], function (_ref) {
  var disabled = _ref.disabled;
  return disabled ? "\n            opacity: 0.2;\n        " : "\n            &:hover {\n                cursor: pointer;\n                background: rgba(255, 255, 255, 0.1);\n            }\n        ";
});
var CheckBoxIcon = function CheckBoxIcon(_ref2) {
  var outline = _ref2.outline,
    checked = _ref2.checked;
  if (outline) {
    return /*#__PURE__*/React.createElement(Toggle.CheckBoxOutlineBlank, null);
  }
  if (checked) {
    return /*#__PURE__*/React.createElement(Toggle.CheckBox, null);
  }
  return /*#__PURE__*/React.createElement(Toggle.CheckBoxIndeterminate, null);
};
var CheckBox_CheckBox = function CheckBox(_ref3) {
  var disabled = _ref3.disabled,
    checked = _ref3.checked,
    outline = _ref3.outline,
    onClick = _ref3.onClick;
  var triggerClick = useCallback(debounce(onClick, 100), [onClick]);
  return /*#__PURE__*/React.createElement(StyledCheckBox, {
    disabled: disabled,
    onClick: triggerClick
  }, /*#__PURE__*/React.createElement(CheckBoxIcon, {
    outline: outline,
    checked: checked
  }));
};
/* harmony default export */ var src_CheckBox = (/*#__PURE__*/(/* unused pure expression or super */ null && (React.memo(CheckBox_CheckBox))));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ChartView/types.ts
var Chart;
(function (_Chart) {
  var lineType = /*#__PURE__*/function (lineType) {
    lineType["basis"] = "basis";
    lineType["linear"] = "linear";
    lineType["natural"] = "natural";
    lineType["step"] = "step";
    return lineType;
  }({});
  _Chart.lineType = lineType;
  // Pie chart
  var labelPosition = /*#__PURE__*/function (labelPosition) {
    labelPosition["INSIDE"] = "INSIDE";
    labelPosition["OUTSIDE"] = "OUTSIDE";
    return labelPosition;
  }({}); // Bar chart
  // Chart
})(Chart || (Chart = {}));
// EXTERNAL MODULE: ./node_modules/lodash/isEqual.js
var isEqual = __webpack_require__(2404);
var isEqual_default = /*#__PURE__*/__webpack_require__.n(isEqual);
// EXTERNAL MODULE: ./node_modules/lodash/isFunction.js
var lodash_isFunction = __webpack_require__(1882);
var isFunction_default = /*#__PURE__*/__webpack_require__.n(lodash_isFunction);
// EXTERNAL MODULE: ./node_modules/lodash/isNil.js
var isNil = __webpack_require__(9843);
var isNil_default = /*#__PURE__*/__webpack_require__.n(isNil);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/fast-equals/dist/esm/index.mjs
var getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols;
var esm_hasOwnProperty = Object.prototype.hasOwnProperty;
/**
 * Combine two comparators into a single comparators.
 */
function combineComparators(comparatorA, comparatorB) {
    return function isEqual(a, b, state) {
        return comparatorA(a, b, state) && comparatorB(a, b, state);
    };
}
/**
 * Wrap the provided `areItemsEqual` method to manage the circular state, allowing
 * for circular references to be safely included in the comparison without creating
 * stack overflows.
 */
function createIsCircular(areItemsEqual) {
    return function isCircular(a, b, state) {
        if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
            return areItemsEqual(a, b, state);
        }
        var cache = state.cache;
        var cachedA = cache.get(a);
        var cachedB = cache.get(b);
        if (cachedA && cachedB) {
            return cachedA === b && cachedB === a;
        }
        cache.set(a, b);
        cache.set(b, a);
        var result = areItemsEqual(a, b, state);
        cache.delete(a);
        cache.delete(b);
        return result;
    };
}
/**
 * Get the properties to strictly examine, which include both own properties that are
 * not enumerable and symbol properties.
 */
function getStrictProperties(object) {
    return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
}
/**
 * Whether the object contains the property passed as an own property.
 */
var hasOwn = Object.hasOwn ||
    (function (object, property) {
        return esm_hasOwnProperty.call(object, property);
    });
/**
 * Whether the values passed are strictly equal or both NaN.
 */
function sameValueZeroEqual(a, b) {
    return a || b ? a === b : a === b || (a !== a && b !== b);
}

var OWNER = '_owner';
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, esm_keys = Object.keys;
/**
 * Whether the arrays are equal in value.
 */
function areArraysEqual(a, b, state) {
    var index = a.length;
    if (b.length !== index) {
        return false;
    }
    while (index-- > 0) {
        if (!state.equals(a[index], b[index], index, index, a, b, state)) {
            return false;
        }
    }
    return true;
}
/**
 * Whether the dates passed are equal in value.
 */
function areDatesEqual(a, b) {
    return sameValueZeroEqual(a.getTime(), b.getTime());
}
/**
 * Whether the `Map`s are equal in value.
 */
function areMapsEqual(a, b, state) {
    if (a.size !== b.size) {
        return false;
    }
    var matchedIndices = {};
    var aIterable = a.entries();
    var index = 0;
    var aResult;
    var bResult;
    while ((aResult = aIterable.next())) {
        if (aResult.done) {
            break;
        }
        var bIterable = b.entries();
        var hasMatch = false;
        var matchIndex = 0;
        while ((bResult = bIterable.next())) {
            if (bResult.done) {
                break;
            }
            var _a = aResult.value, aKey = _a[0], aValue = _a[1];
            var _b = bResult.value, bKey = _b[0], bValue = _b[1];
            if (!hasMatch &&
                !matchedIndices[matchIndex] &&
                (hasMatch =
                    state.equals(aKey, bKey, index, matchIndex, a, b, state) &&
                        state.equals(aValue, bValue, aKey, bKey, a, b, state))) {
                matchedIndices[matchIndex] = true;
            }
            matchIndex++;
        }
        if (!hasMatch) {
            return false;
        }
        index++;
    }
    return true;
}
/**
 * Whether the objects are equal in value.
 */
function areObjectsEqual(a, b, state) {
    var properties = esm_keys(a);
    var index = properties.length;
    if (esm_keys(b).length !== index) {
        return false;
    }
    var property;
    // Decrementing `while` showed faster results than either incrementing or
    // decrementing `for` loop and than an incrementing `while` loop. Declarative
    // methods like `some` / `every` were not used to avoid incurring the garbage
    // cost of anonymous callbacks.
    while (index-- > 0) {
        property = properties[index];
        if (property === OWNER &&
            (a.$$typeof || b.$$typeof) &&
            a.$$typeof !== b.$$typeof) {
            return false;
        }
        if (!hasOwn(b, property) ||
            !state.equals(a[property], b[property], property, property, a, b, state)) {
            return false;
        }
    }
    return true;
}
/**
 * Whether the objects are equal in value with strict property checking.
 */
function areObjectsEqualStrict(a, b, state) {
    var properties = getStrictProperties(a);
    var index = properties.length;
    if (getStrictProperties(b).length !== index) {
        return false;
    }
    var property;
    var descriptorA;
    var descriptorB;
    // Decrementing `while` showed faster results than either incrementing or
    // decrementing `for` loop and than an incrementing `while` loop. Declarative
    // methods like `some` / `every` were not used to avoid incurring the garbage
    // cost of anonymous callbacks.
    while (index-- > 0) {
        property = properties[index];
        if (property === OWNER &&
            (a.$$typeof || b.$$typeof) &&
            a.$$typeof !== b.$$typeof) {
            return false;
        }
        if (!hasOwn(b, property)) {
            return false;
        }
        if (!state.equals(a[property], b[property], property, property, a, b, state)) {
            return false;
        }
        descriptorA = getOwnPropertyDescriptor(a, property);
        descriptorB = getOwnPropertyDescriptor(b, property);
        if ((descriptorA || descriptorB) &&
            (!descriptorA ||
                !descriptorB ||
                descriptorA.configurable !== descriptorB.configurable ||
                descriptorA.enumerable !== descriptorB.enumerable ||
                descriptorA.writable !== descriptorB.writable)) {
            return false;
        }
    }
    return true;
}
/**
 * Whether the primitive wrappers passed are equal in value.
 */
function arePrimitiveWrappersEqual(a, b) {
    return sameValueZeroEqual(a.valueOf(), b.valueOf());
}
/**
 * Whether the regexps passed are equal in value.
 */
function areRegExpsEqual(a, b) {
    return a.source === b.source && a.flags === b.flags;
}
/**
 * Whether the `Set`s are equal in value.
 */
function areSetsEqual(a, b, state) {
    if (a.size !== b.size) {
        return false;
    }
    var matchedIndices = {};
    var aIterable = a.values();
    var aResult;
    var bResult;
    while ((aResult = aIterable.next())) {
        if (aResult.done) {
            break;
        }
        var bIterable = b.values();
        var hasMatch = false;
        var matchIndex = 0;
        while ((bResult = bIterable.next())) {
            if (bResult.done) {
                break;
            }
            if (!hasMatch &&
                !matchedIndices[matchIndex] &&
                (hasMatch = state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state))) {
                matchedIndices[matchIndex] = true;
            }
            matchIndex++;
        }
        if (!hasMatch) {
            return false;
        }
    }
    return true;
}
/**
 * Whether the TypedArray instances are equal in value.
 */
function areTypedArraysEqual(a, b) {
    var index = a.length;
    if (b.length !== index) {
        return false;
    }
    while (index-- > 0) {
        if (a[index] !== b[index]) {
            return false;
        }
    }
    return true;
}

var ARGUMENTS_TAG = '[object Arguments]';
var esm_BOOLEAN_TAG = '[object Boolean]';
var DATE_TAG = '[object Date]';
var MAP_TAG = '[object Map]';
var NUMBER_TAG = '[object Number]';
var OBJECT_TAG = '[object Object]';
var REG_EXP_TAG = '[object RegExp]';
var SET_TAG = '[object Set]';
var esm_STRING_TAG = '[object String]';
var isArray = Array.isArray;
var isTypedArray = typeof ArrayBuffer === 'function' && ArrayBuffer.isView
    ? ArrayBuffer.isView
    : null;
var esm_assign = Object.assign;
var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
/**
 * Create a comparator method based on the type-specific equality comparators passed.
 */
function createEqualityComparator(_a) {
    var areArraysEqual = _a.areArraysEqual, areDatesEqual = _a.areDatesEqual, areMapsEqual = _a.areMapsEqual, areObjectsEqual = _a.areObjectsEqual, arePrimitiveWrappersEqual = _a.arePrimitiveWrappersEqual, areRegExpsEqual = _a.areRegExpsEqual, areSetsEqual = _a.areSetsEqual, areTypedArraysEqual = _a.areTypedArraysEqual;
    /**
     * compare the value of the two objects and return true if they are equivalent in values
     */
    return function comparator(a, b, state) {
        // If the items are strictly equal, no need to do a value comparison.
        if (a === b) {
            return true;
        }
        // If the items are not non-nullish objects, then the only possibility
        // of them being equal but not strictly is if they are both `NaN`. Since
        // `NaN` is uniquely not equal to itself, we can use self-comparison of
        // both objects, which is faster than `isNaN()`.
        if (a == null ||
            b == null ||
            typeof a !== 'object' ||
            typeof b !== 'object') {
            return a !== a && b !== b;
        }
        var constructor = a.constructor;
        // Checks are listed in order of commonality of use-case:
        //   1. Common complex object types (plain object, array)
        //   2. Common data values (date, regexp)
        //   3. Less-common complex object types (map, set)
        //   4. Less-common data values (promise, primitive wrappers)
        // Inherently this is both subjective and assumptive, however
        // when reviewing comparable libraries in the wild this order
        // appears to be generally consistent.
        // Constructors should match, otherwise there is potential for false positives
        // between class and subclass or custom object and POJO.
        if (constructor !== b.constructor) {
            return false;
        }
        // `isPlainObject` only checks against the object's own realm. Cross-realm
        // comparisons are rare, and will be handled in the ultimate fallback, so
        // we can avoid capturing the string tag.
        if (constructor === Object) {
            return areObjectsEqual(a, b, state);
        }
        // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing
        // the string tag or doing an `instanceof` check.
        if (isArray(a)) {
            return areArraysEqual(a, b, state);
        }
        // `isTypedArray()` works on all possible TypedArray classes, so we can avoid
        // capturing the string tag or comparing against all possible constructors.
        if (isTypedArray != null && isTypedArray(a)) {
            return areTypedArraysEqual(a, b, state);
        }
        // Try to fast-path equality checks for other complex object types in the
        // same realm to avoid capturing the string tag. Strict equality is used
        // instead of `instanceof` because it is more performant for the common
        // use-case. If someone is subclassing a native class, it will be handled
        // with the string tag comparison.
        if (constructor === Date) {
            return areDatesEqual(a, b, state);
        }
        if (constructor === RegExp) {
            return areRegExpsEqual(a, b, state);
        }
        if (constructor === Map) {
            return areMapsEqual(a, b, state);
        }
        if (constructor === Set) {
            return areSetsEqual(a, b, state);
        }
        // Since this is a custom object, capture the string tag to determing its type.
        // This is reasonably performant in modern environments like v8 and SpiderMonkey.
        var tag = getTag(a);
        if (tag === DATE_TAG) {
            return areDatesEqual(a, b, state);
        }
        if (tag === REG_EXP_TAG) {
            return areRegExpsEqual(a, b, state);
        }
        if (tag === MAP_TAG) {
            return areMapsEqual(a, b, state);
        }
        if (tag === SET_TAG) {
            return areSetsEqual(a, b, state);
        }
        if (tag === OBJECT_TAG) {
            // The exception for value comparison is custom `Promise`-like class instances. These should
            // be treated the same as standard `Promise` objects, which means strict equality, and if
            // it reaches this point then that strict equality comparison has already failed.
            return (typeof a.then !== 'function' &&
                typeof b.then !== 'function' &&
                areObjectsEqual(a, b, state));
        }
        // If an arguments tag, it should be treated as a standard object.
        if (tag === ARGUMENTS_TAG) {
            return areObjectsEqual(a, b, state);
        }
        // As the penultimate fallback, check if the values passed are primitive wrappers. This
        // is very rare in modern JS, which is why it is deprioritized compared to all other object
        // types.
        if (tag === esm_BOOLEAN_TAG || tag === NUMBER_TAG || tag === esm_STRING_TAG) {
            return arePrimitiveWrappersEqual(a, b, state);
        }
        // If not matching any tags that require a specific type of comparison, then we hard-code false because
        // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
        //   - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
        //     comparison that can be made.
        //   - For types that can be introspected, but rarely have requirements to be compared
        //     (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
        //     use-cases (may be included in a future release, if requested enough).
        //   - For types that can be introspected but do not have an objective definition of what
        //     equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
        // In all cases, these decisions should be reevaluated based on changes to the language and
        // common development practices.
        return false;
    };
}
/**
 * Create the configuration object used for building comparators.
 */
function createEqualityComparatorConfig(_a) {
    var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
    var config = {
        areArraysEqual: strict
            ? areObjectsEqualStrict
            : areArraysEqual,
        areDatesEqual: areDatesEqual,
        areMapsEqual: strict
            ? combineComparators(areMapsEqual, areObjectsEqualStrict)
            : areMapsEqual,
        areObjectsEqual: strict
            ? areObjectsEqualStrict
            : areObjectsEqual,
        arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,
        areRegExpsEqual: areRegExpsEqual,
        areSetsEqual: strict
            ? combineComparators(areSetsEqual, areObjectsEqualStrict)
            : areSetsEqual,
        areTypedArraysEqual: strict
            ? areObjectsEqualStrict
            : areTypedArraysEqual,
    };
    if (createCustomConfig) {
        config = esm_assign({}, config, createCustomConfig(config));
    }
    if (circular) {
        var areArraysEqual$1 = createIsCircular(config.areArraysEqual);
        var areMapsEqual$1 = createIsCircular(config.areMapsEqual);
        var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);
        var areSetsEqual$1 = createIsCircular(config.areSetsEqual);
        config = esm_assign({}, config, {
            areArraysEqual: areArraysEqual$1,
            areMapsEqual: areMapsEqual$1,
            areObjectsEqual: areObjectsEqual$1,
            areSetsEqual: areSetsEqual$1,
        });
    }
    return config;
}
/**
 * Default equality comparator pass-through, used as the standard `isEqual` creator for
 * use inside the built comparator.
 */
function createInternalEqualityComparator(compare) {
    return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
        return compare(a, b, state);
    };
}
/**
 * Create the `isEqual` function used by the consuming application.
 */
function createIsEqual(_a) {
    var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
    if (createState) {
        return function isEqual(a, b) {
            var _a = createState(), _b = _a.cache, cache = _b === void 0 ? circular ? new WeakMap() : undefined : _b, meta = _a.meta;
            return comparator(a, b, {
                cache: cache,
                equals: equals,
                meta: meta,
                strict: strict,
            });
        };
    }
    if (circular) {
        return function isEqual(a, b) {
            return comparator(a, b, {
                cache: new WeakMap(),
                equals: equals,
                meta: undefined,
                strict: strict,
            });
        };
    }
    var state = {
        cache: undefined,
        equals: equals,
        meta: undefined,
        strict: strict,
    };
    return function isEqual(a, b) {
        return comparator(a, b, state);
    };
}

/**
 * Whether the items passed are deeply-equal in value.
 */
var deepEqual = createCustomEqual();
/**
 * Whether the items passed are deeply-equal in value based on strict comparison.
 */
var strictDeepEqual = createCustomEqual({ strict: true });
/**
 * Whether the items passed are deeply-equal in value, including circular references.
 */
var circularDeepEqual = createCustomEqual({ circular: true });
/**
 * Whether the items passed are deeply-equal in value, including circular references,
 * based on strict comparison.
 */
var strictCircularDeepEqual = createCustomEqual({
    circular: true,
    strict: true,
});
/**
 * Whether the items passed are shallowly-equal in value.
 */
var shallowEqual = createCustomEqual({
    createInternalComparator: function () { return sameValueZeroEqual; },
});
/**
 * Whether the items passed are shallowly-equal in value based on strict comparison
 */
var strictShallowEqual = createCustomEqual({
    strict: true,
    createInternalComparator: function () { return sameValueZeroEqual; },
});
/**
 * Whether the items passed are shallowly-equal in value, including circular references.
 */
var circularShallowEqual = createCustomEqual({
    circular: true,
    createInternalComparator: function () { return sameValueZeroEqual; },
});
/**
 * Whether the items passed are shallowly-equal in value, including circular references,
 * based on strict comparison.
 */
var strictCircularShallowEqual = createCustomEqual({
    circular: true,
    createInternalComparator: function () { return sameValueZeroEqual; },
    strict: true,
});
/**
 * Create a custom equality comparison method.
 *
 * This can be done to create very targeted comparisons in extreme hot-path scenarios
 * where the standard methods are not performant enough, but can also be used to provide
 * support for legacy environments that do not support expected features like
 * `RegExp.prototype.flags` out of the box.
 */
function createCustomEqual(options) {
    if (options === void 0) { options = {}; }
    var _a = options.circular, circular = _a === void 0 ? false : _a, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _b = options.strict, strict = _b === void 0 ? false : _b;
    var config = createEqualityComparatorConfig(options);
    var comparator = createEqualityComparator(config);
    var equals = createCustomInternalComparator
        ? createCustomInternalComparator(comparator)
        : createInternalEqualityComparator(comparator);
    return createIsEqual({ circular: circular, comparator: comparator, createState: createState, equals: equals, strict: strict });
}


//# sourceMappingURL=index.mjs.map

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-smooth/es6/setRafTimeout.js
function setRafTimeout(callback) {
  var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  var currTime = -1;
  var shouldUpdate = function shouldUpdate(now) {
    if (currTime < 0) {
      currTime = now;
    }
    if (now - currTime > timeout) {
      callback(now);
      currTime = -1;
    } else {
      requestAnimationFrame(shouldUpdate);
    }
  };
  requestAnimationFrame(shouldUpdate);
}
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-smooth/es6/AnimateManager.js
function AnimateManager_typeof(obj) { "@babel/helpers - typeof"; return AnimateManager_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; }, AnimateManager_typeof(obj); }
function _toArray(arr) { return AnimateManager_arrayWithHoles(arr) || AnimateManager_iterableToArray(arr) || AnimateManager_unsupportedIterableToArray(arr) || AnimateManager_nonIterableRest(); }
function AnimateManager_nonIterableRest() { 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 AnimateManager_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return AnimateManager_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 AnimateManager_arrayLikeToArray(o, minLen); }
function AnimateManager_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 AnimateManager_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function AnimateManager_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

function createAnimateManager() {
  var currStyle = {};
  var handleChange = function handleChange() {
    return null;
  };
  var shouldStop = false;
  var setStyle = function setStyle(_style) {
    if (shouldStop) {
      return;
    }
    if (Array.isArray(_style)) {
      if (!_style.length) {
        return;
      }
      var styles = _style;
      var _styles = _toArray(styles),
        curr = _styles[0],
        restStyles = _styles.slice(1);
      if (typeof curr === 'number') {
        setRafTimeout(setStyle.bind(null, restStyles), curr);
        return;
      }
      setStyle(curr);
      setRafTimeout(setStyle.bind(null, restStyles));
      return;
    }
    if (AnimateManager_typeof(_style) === 'object') {
      currStyle = _style;
      handleChange(currStyle);
    }
    if (typeof _style === 'function') {
      _style();
    }
  };
  return {
    stop: function stop() {
      shouldStop = true;
    },
    start: function start(style) {
      shouldStop = false;
      setStyle(style);
    },
    subscribe: function subscribe(_handleChange) {
      handleChange = _handleChange;
      return function () {
        handleChange = function handleChange() {
          return null;
        };
      };
    }
  };
}
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-smooth/es6/util.js
function util_typeof(obj) { "@babel/helpers - typeof"; return util_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; }, util_typeof(obj); }
function util_ownKeys(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 util_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? util_ownKeys(Object(source), !0).forEach(function (key) { util_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : util_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function util_defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return util_typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (util_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (util_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/* eslint no-console: 0 */
var PREFIX_LIST = ['Webkit', 'Moz', 'O', 'ms'];
var IN_LINE_PREFIX_LIST = ['-webkit-', '-moz-', '-o-', '-ms-'];
var IN_COMPATIBLE_PROPERTY = ['transform', 'transformOrigin', 'transition'];
var getIntersectionKeys = function getIntersectionKeys(preObj, nextObj) {
  return [Object.keys(preObj), Object.keys(nextObj)].reduce(function (a, b) {
    return a.filter(function (c) {
      return b.includes(c);
    });
  });
};
var identity = function identity(param) {
  return param;
};

/*
 * @description: convert camel case to dash case
 * string => string
 */
var getDashCase = function getDashCase(name) {
  return name.replace(/([A-Z])/g, function (v) {
    return "-".concat(v.toLowerCase());
  });
};

/*
 * @description: add compatible style prefix
 * (string, string) => object
 */
var generatePrefixStyle = function generatePrefixStyle(name, value) {
  if (IN_COMPATIBLE_PROPERTY.indexOf(name) === -1) {
    return util_defineProperty({}, name, Number.isNaN(value) ? 0 : value);
  }
  var isTransition = name === 'transition';
  var camelName = name.replace(/(\w)/, function (v) {
    return v.toUpperCase();
  });
  var styleVal = value;
  return PREFIX_LIST.reduce(function (result, property, i) {
    if (isTransition) {
      styleVal = value.replace(/(transform|transform-origin)/gim, "".concat(IN_LINE_PREFIX_LIST[i], "$1"));
    }
    return util_objectSpread(util_objectSpread({}, result), {}, util_defineProperty({}, property + camelName, styleVal));
  }, {});
};
var util_log = function log() {
  var _console;
  (_console = console).log.apply(_console, arguments);
};

/*
 * @description: log the value of a varible
 * string => any => any
 */
var debug = function debug(name) {
  return function (item) {
    util_log(name, item);
    return item;
  };
};

/*
 * @description: log name, args, return value of a function
 * function => function
 */
var debugf = function debugf(tag, f) {
  return function () {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    var res = f.apply(void 0, args);
    var name = tag || f.name || 'anonymous function';
    var argNames = "(".concat(args.map(JSON.stringify).join(', '), ")");
    util_log("".concat(name, ": ").concat(argNames, " => ").concat(JSON.stringify(res)));
    return res;
  };
};

/*
 * @description: map object on every element in this object.
 * (function, object) => object
 */
var mapObject = function mapObject(fn, obj) {
  return Object.keys(obj).reduce(function (res, key) {
    return util_objectSpread(util_objectSpread({}, res), {}, util_defineProperty({}, key, fn(key, obj[key])));
  }, {});
};

/*
 * @description: add compatible prefix to style
 * object => object
 */
var translateStyle = function translateStyle(style) {
  return Object.keys(style).reduce(function (res, key) {
    return util_objectSpread(util_objectSpread({}, res), generatePrefixStyle(key, res[key]));
  }, style);
};
var compose = function compose() {
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    args[_key2] = arguments[_key2];
  }
  if (!args.length) {
    return identity;
  }
  var fns = args.reverse();
  // first function can receive multiply arguments
  var firstFn = fns[0];
  var tailsFn = fns.slice(1);
  return function () {
    return tailsFn.reduce(function (res, fn) {
      return fn(res);
    }, firstFn.apply(void 0, arguments));
  };
};
var getTransitionVal = function getTransitionVal(props, duration, easing) {
  return props.map(function (prop) {
    return "".concat(getDashCase(prop), " ").concat(duration, "ms ").concat(easing);
  }).join(',');
};
var isDev = "production" !== 'production';
var warn = function warn(condition, format, a, b, c, d, e, f) {
  if (isDev && typeof console !== 'undefined' && console.warn) {
    if (format === undefined) {
      console.warn('LogUtils requires an error message argument');
    }
    if (!condition) {
      if (format === undefined) {
        console.warn('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
      } else {
        var args = [a, b, c, d, e, f];
        var argIndex = 0;
        console.warn(format.replace(/%s/g, function () {
          return args[argIndex++];
        }));
      }
    }
  }
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-smooth/es6/easing.js
function easing_slicedToArray(arr, i) { return easing_arrayWithHoles(arr) || easing_iterableToArrayLimit(arr, i) || easing_unsupportedIterableToArray(arr, i) || easing_nonIterableRest(); }
function easing_nonIterableRest() { 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 easing_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function easing_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function easing_toConsumableArray(arr) { return easing_arrayWithoutHoles(arr) || easing_iterableToArray(arr) || easing_unsupportedIterableToArray(arr) || easing_nonIterableSpread(); }
function easing_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."); }
function easing_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return easing_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 easing_arrayLikeToArray(o, minLen); }
function easing_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function easing_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return easing_arrayLikeToArray(arr); }
function easing_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; }

var ACCURACY = 1e-4;
var cubicBezierFactor = function cubicBezierFactor(c1, c2) {
  return [0, 3 * c1, 3 * c2 - 6 * c1, 3 * c1 - 3 * c2 + 1];
};
var multyTime = function multyTime(params, t) {
  return params.map(function (param, i) {
    return param * Math.pow(t, i);
  }).reduce(function (pre, curr) {
    return pre + curr;
  });
};
var cubicBezier = function cubicBezier(c1, c2) {
  return function (t) {
    var params = cubicBezierFactor(c1, c2);
    return multyTime(params, t);
  };
};
var derivativeCubicBezier = function derivativeCubicBezier(c1, c2) {
  return function (t) {
    var params = cubicBezierFactor(c1, c2);
    var newParams = [].concat(easing_toConsumableArray(params.map(function (param, i) {
      return param * i;
    }).slice(1)), [0]);
    return multyTime(newParams, t);
  };
};

// calculate cubic-bezier using Newton's method
var configBezier = function configBezier() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  var x1 = args[0],
    y1 = args[1],
    x2 = args[2],
    y2 = args[3];
  if (args.length === 1) {
    switch (args[0]) {
      case 'linear':
        x1 = 0.0;
        y1 = 0.0;
        x2 = 1.0;
        y2 = 1.0;
        break;
      case 'ease':
        x1 = 0.25;
        y1 = 0.1;
        x2 = 0.25;
        y2 = 1.0;
        break;
      case 'ease-in':
        x1 = 0.42;
        y1 = 0.0;
        x2 = 1.0;
        y2 = 1.0;
        break;
      case 'ease-out':
        x1 = 0.42;
        y1 = 0.0;
        x2 = 0.58;
        y2 = 1.0;
        break;
      case 'ease-in-out':
        x1 = 0.0;
        y1 = 0.0;
        x2 = 0.58;
        y2 = 1.0;
        break;
      default:
        {
          var easing = args[0].split('(');
          if (easing[0] === 'cubic-bezier' && easing[1].split(')')[0].split(',').length === 4) {
            var _easing$1$split$0$spl = easing[1].split(')')[0].split(',').map(function (x) {
              return parseFloat(x);
            });
            var _easing$1$split$0$spl2 = easing_slicedToArray(_easing$1$split$0$spl, 4);
            x1 = _easing$1$split$0$spl2[0];
            y1 = _easing$1$split$0$spl2[1];
            x2 = _easing$1$split$0$spl2[2];
            y2 = _easing$1$split$0$spl2[3];
          } else {
            warn(false, '[configBezier]: arguments should be one of ' + "oneOf 'linear', 'ease', 'ease-in', 'ease-out', " + "'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s", args);
          }
        }
    }
  }
  warn([x1, x2, y1, y2].every(function (num) {
    return typeof num === 'number' && num >= 0 && num <= 1;
  }), '[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s', args);
  var curveX = cubicBezier(x1, x2);
  var curveY = cubicBezier(y1, y2);
  var derCurveX = derivativeCubicBezier(x1, x2);
  var rangeValue = function rangeValue(value) {
    if (value > 1) {
      return 1;
    }
    if (value < 0) {
      return 0;
    }
    return value;
  };
  var bezier = function bezier(_t) {
    var t = _t > 1 ? 1 : _t;
    var x = t;
    for (var i = 0; i < 8; ++i) {
      var evalT = curveX(x) - t;
      var derVal = derCurveX(x);
      if (Math.abs(evalT - t) < ACCURACY || derVal < ACCURACY) {
        return curveY(x);
      }
      x = rangeValue(x - evalT / derVal);
    }
    return curveY(x);
  };
  bezier.isStepper = false;
  return bezier;
};
var configSpring = function configSpring() {
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var _config$stiff = config.stiff,
    stiff = _config$stiff === void 0 ? 100 : _config$stiff,
    _config$damping = config.damping,
    damping = _config$damping === void 0 ? 8 : _config$damping,
    _config$dt = config.dt,
    dt = _config$dt === void 0 ? 17 : _config$dt;
  var stepper = function stepper(currX, destX, currV) {
    var FSpring = -(currX - destX) * stiff;
    var FDamping = currV * damping;
    var newV = currV + (FSpring - FDamping) * dt / 1000;
    var newX = currV * dt / 1000 + currX;
    if (Math.abs(newX - destX) < ACCURACY && Math.abs(newV) < ACCURACY) {
      return [destX, 0];
    }
    return [newX, newV];
  };
  stepper.isStepper = true;
  stepper.dt = dt;
  return stepper;
};
var configEasing = function configEasing() {
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    args[_key2] = arguments[_key2];
  }
  var easing = args[0];
  if (typeof easing === 'string') {
    switch (easing) {
      case 'ease':
      case 'ease-in-out':
      case 'ease-out':
      case 'ease-in':
      case 'linear':
        return configBezier(easing);
      case 'spring':
        return configSpring();
      default:
        if (easing.split('(')[0] === 'cubic-bezier') {
          return configBezier(easing);
        }
        warn(false, "[configEasing]: first argument should be one of 'ease', 'ease-in', " + "'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead  received %s", args);
    }
  }
  if (typeof easing === 'function') {
    return easing;
  }
  warn(false, '[configEasing]: first argument type should be function or string, instead received %s', args);
  return null;
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-smooth/es6/configUpdate.js
function configUpdate_typeof(obj) { "@babel/helpers - typeof"; return configUpdate_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; }, configUpdate_typeof(obj); }
function configUpdate_toConsumableArray(arr) { return configUpdate_arrayWithoutHoles(arr) || configUpdate_iterableToArray(arr) || configUpdate_unsupportedIterableToArray(arr) || configUpdate_nonIterableSpread(); }
function configUpdate_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."); }
function configUpdate_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function configUpdate_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return configUpdate_arrayLikeToArray(arr); }
function configUpdate_ownKeys(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 configUpdate_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? configUpdate_ownKeys(Object(source), !0).forEach(function (key) { configUpdate_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : configUpdate_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function configUpdate_defineProperty(obj, key, value) { key = configUpdate_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function configUpdate_toPropertyKey(arg) { var key = configUpdate_toPrimitive(arg, "string"); return configUpdate_typeof(key) === "symbol" ? key : String(key); }
function configUpdate_toPrimitive(input, hint) { if (configUpdate_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (configUpdate_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function configUpdate_slicedToArray(arr, i) { return configUpdate_arrayWithHoles(arr) || configUpdate_iterableToArrayLimit(arr, i) || configUpdate_unsupportedIterableToArray(arr, i) || configUpdate_nonIterableRest(); }
function configUpdate_nonIterableRest() { 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 configUpdate_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return configUpdate_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 configUpdate_arrayLikeToArray(o, minLen); }
function configUpdate_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 configUpdate_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function configUpdate_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

var configUpdate_alpha = function alpha(begin, end, k) {
  return begin + (end - begin) * k;
};
var needContinue = function needContinue(_ref) {
  var from = _ref.from,
    to = _ref.to;
  return from !== to;
};

/*
 * @description: cal new from value and velocity in each stepper
 * @return: { [styleProperty]: { from, to, velocity } }
 */
var calStepperVals = function calStepperVals(easing, preVals, steps) {
  var nextStepVals = mapObject(function (key, val) {
    if (needContinue(val)) {
      var _easing = easing(val.from, val.to, val.velocity),
        _easing2 = configUpdate_slicedToArray(_easing, 2),
        newX = _easing2[0],
        newV = _easing2[1];
      return configUpdate_objectSpread(configUpdate_objectSpread({}, val), {}, {
        from: newX,
        velocity: newV
      });
    }
    return val;
  }, preVals);
  if (steps < 1) {
    return mapObject(function (key, val) {
      if (needContinue(val)) {
        return configUpdate_objectSpread(configUpdate_objectSpread({}, val), {}, {
          velocity: configUpdate_alpha(val.velocity, nextStepVals[key].velocity, steps),
          from: configUpdate_alpha(val.from, nextStepVals[key].from, steps)
        });
      }
      return val;
    }, preVals);
  }
  return calStepperVals(easing, nextStepVals, steps - 1);
};

// configure update function
/* harmony default export */ var configUpdate = (function (from, to, easing, duration, render) {
  var interKeys = getIntersectionKeys(from, to);
  var timingStyle = interKeys.reduce(function (res, key) {
    return configUpdate_objectSpread(configUpdate_objectSpread({}, res), {}, configUpdate_defineProperty({}, key, [from[key], to[key]]));
  }, {});
  var stepperStyle = interKeys.reduce(function (res, key) {
    return configUpdate_objectSpread(configUpdate_objectSpread({}, res), {}, configUpdate_defineProperty({}, key, {
      from: from[key],
      velocity: 0,
      to: to[key]
    }));
  }, {});
  var cafId = -1;
  var preTime;
  var beginTime;
  var update = function update() {
    return null;
  };
  var getCurrStyle = function getCurrStyle() {
    return mapObject(function (key, val) {
      return val.from;
    }, stepperStyle);
  };
  var shouldStopAnimation = function shouldStopAnimation() {
    return !Object.values(stepperStyle).filter(needContinue).length;
  };

  // stepper timing function like spring
  var stepperUpdate = function stepperUpdate(now) {
    if (!preTime) {
      preTime = now;
    }
    var deltaTime = now - preTime;
    var steps = deltaTime / easing.dt;
    stepperStyle = calStepperVals(easing, stepperStyle, steps);
    // get union set and add compatible prefix
    render(configUpdate_objectSpread(configUpdate_objectSpread(configUpdate_objectSpread({}, from), to), getCurrStyle(stepperStyle)));
    preTime = now;
    if (!shouldStopAnimation()) {
      cafId = requestAnimationFrame(update);
    }
  };

  // t => val timing function like cubic-bezier
  var timingUpdate = function timingUpdate(now) {
    if (!beginTime) {
      beginTime = now;
    }
    var t = (now - beginTime) / duration;
    var currStyle = mapObject(function (key, val) {
      return configUpdate_alpha.apply(void 0, configUpdate_toConsumableArray(val).concat([easing(t)]));
    }, timingStyle);

    // get union set and add compatible prefix
    render(configUpdate_objectSpread(configUpdate_objectSpread(configUpdate_objectSpread({}, from), to), currStyle));
    if (t < 1) {
      cafId = requestAnimationFrame(update);
    } else {
      var finalStyle = mapObject(function (key, val) {
        return configUpdate_alpha.apply(void 0, configUpdate_toConsumableArray(val).concat([easing(1)]));
      }, timingStyle);
      render(configUpdate_objectSpread(configUpdate_objectSpread(configUpdate_objectSpread({}, from), to), finalStyle));
    }
  };
  update = easing.isStepper ? stepperUpdate : timingUpdate;

  // return start animation method
  return function () {
    requestAnimationFrame(update);

    // return stop animation method
    return function () {
      cancelAnimationFrame(cafId);
    };
  };
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-smooth/es6/Animate.js
function Animate_typeof(obj) { "@babel/helpers - typeof"; return Animate_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; }, Animate_typeof(obj); }
var Animate_excluded = ["children", "begin", "duration", "attributeName", "easing", "isActive", "steps", "from", "to", "canBegin", "onAnimationEnd", "shouldReAnimate", "onAnimationReStart"];
function Animate_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Animate_objectWithoutPropertiesLoose(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 Animate_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; }
function Animate_toConsumableArray(arr) { return Animate_arrayWithoutHoles(arr) || Animate_iterableToArray(arr) || Animate_unsupportedIterableToArray(arr) || Animate_nonIterableSpread(); }
function Animate_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."); }
function Animate_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Animate_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 Animate_arrayLikeToArray(o, minLen); }
function Animate_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function Animate_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Animate_arrayLikeToArray(arr); }
function Animate_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 Animate_ownKeys(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 Animate_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Animate_ownKeys(Object(source), !0).forEach(function (key) { Animate_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Animate_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Animate_defineProperty(obj, key, value) { key = Animate_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Animate_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, Animate_toPropertyKey(descriptor.key), descriptor); } }
function Animate_createClass(Constructor, protoProps, staticProps) { if (protoProps) Animate_defineProperties(Constructor.prototype, protoProps); if (staticProps) Animate_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function Animate_toPropertyKey(arg) { var key = Animate_toPrimitive(arg, "string"); return Animate_typeof(key) === "symbol" ? key : String(key); }
function Animate_toPrimitive(input, hint) { if (Animate_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Animate_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Animate_setPrototypeOf(subClass, superClass); }
function Animate_setPrototypeOf(o, p) { Animate_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Animate_setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (Animate_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Animate_assertThisInitialized(self); }
function Animate_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }







var Animate = /*#__PURE__*/function (_PureComponent) {
  _inherits(Animate, _PureComponent);
  var _super = _createSuper(Animate);
  function Animate(props, context) {
    var _this;
    _classCallCheck(this, Animate);
    _this = _super.call(this, props, context);
    var _this$props = _this.props,
      isActive = _this$props.isActive,
      attributeName = _this$props.attributeName,
      from = _this$props.from,
      to = _this$props.to,
      steps = _this$props.steps,
      children = _this$props.children,
      duration = _this$props.duration;
    _this.handleStyleChange = _this.handleStyleChange.bind(Animate_assertThisInitialized(_this));
    _this.changeStyle = _this.changeStyle.bind(Animate_assertThisInitialized(_this));
    if (!isActive || duration <= 0) {
      _this.state = {
        style: {}
      };

      // if children is a function and animation is not active, set style to 'to'
      if (typeof children === 'function') {
        _this.state = {
          style: to
        };
      }
      return _possibleConstructorReturn(_this);
    }
    if (steps && steps.length) {
      _this.state = {
        style: steps[0].style
      };
    } else if (from) {
      if (typeof children === 'function') {
        _this.state = {
          style: from
        };
        return _possibleConstructorReturn(_this);
      }
      _this.state = {
        style: attributeName ? Animate_defineProperty({}, attributeName, from) : from
      };
    } else {
      _this.state = {
        style: {}
      };
    }
    return _this;
  }
  Animate_createClass(Animate, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      var _this$props2 = this.props,
        isActive = _this$props2.isActive,
        canBegin = _this$props2.canBegin;
      this.mounted = true;
      if (!isActive || !canBegin) {
        return;
      }
      this.runAnimation(this.props);
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate(prevProps) {
      var _this$props3 = this.props,
        isActive = _this$props3.isActive,
        canBegin = _this$props3.canBegin,
        attributeName = _this$props3.attributeName,
        shouldReAnimate = _this$props3.shouldReAnimate,
        to = _this$props3.to,
        currentFrom = _this$props3.from;
      var style = this.state.style;
      if (!canBegin) {
        return;
      }
      if (!isActive) {
        var newState = {
          style: attributeName ? Animate_defineProperty({}, attributeName, to) : to
        };
        if (this.state && style) {
          if (attributeName && style[attributeName] !== to || !attributeName && style !== to) {
            // eslint-disable-next-line react/no-did-update-set-state
            this.setState(newState);
          }
        }
        return;
      }
      if (deepEqual(prevProps.to, to) && prevProps.canBegin && prevProps.isActive) {
        return;
      }
      var isTriggered = !prevProps.canBegin || !prevProps.isActive;
      if (this.manager) {
        this.manager.stop();
      }
      if (this.stopJSAnimation) {
        this.stopJSAnimation();
      }
      var from = isTriggered || shouldReAnimate ? currentFrom : prevProps.to;
      if (this.state && style) {
        var _newState = {
          style: attributeName ? Animate_defineProperty({}, attributeName, from) : from
        };
        if (attributeName && [attributeName] !== from || !attributeName && style !== from) {
          // eslint-disable-next-line react/no-did-update-set-state
          this.setState(_newState);
        }
      }
      this.runAnimation(Animate_objectSpread(Animate_objectSpread({}, this.props), {}, {
        from: from,
        begin: 0
      }));
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.mounted = false;
      if (this.unSubscribe) {
        this.unSubscribe();
      }
      if (this.manager) {
        this.manager.stop();
        this.manager = null;
      }
      if (this.stopJSAnimation) {
        this.stopJSAnimation();
      }
    }
  }, {
    key: "handleStyleChange",
    value: function handleStyleChange(style) {
      this.changeStyle(style);
    }
  }, {
    key: "changeStyle",
    value: function changeStyle(style) {
      if (this.mounted) {
        this.setState({
          style: style
        });
      }
    }
  }, {
    key: "runJSAnimation",
    value: function runJSAnimation(props) {
      var _this2 = this;
      var from = props.from,
        to = props.to,
        duration = props.duration,
        easing = props.easing,
        begin = props.begin,
        onAnimationEnd = props.onAnimationEnd,
        onAnimationStart = props.onAnimationStart;
      var startAnimation = configUpdate(from, to, configEasing(easing), duration, this.changeStyle);
      var finalStartAnimation = function finalStartAnimation() {
        _this2.stopJSAnimation = startAnimation();
      };
      this.manager.start([onAnimationStart, begin, finalStartAnimation, duration, onAnimationEnd]);
    }
  }, {
    key: "runStepAnimation",
    value: function runStepAnimation(props) {
      var _this3 = this;
      var steps = props.steps,
        begin = props.begin,
        onAnimationStart = props.onAnimationStart;
      var _steps$ = steps[0],
        initialStyle = _steps$.style,
        _steps$$duration = _steps$.duration,
        initialTime = _steps$$duration === void 0 ? 0 : _steps$$duration;
      var addStyle = function addStyle(sequence, nextItem, index) {
        if (index === 0) {
          return sequence;
        }
        var duration = nextItem.duration,
          _nextItem$easing = nextItem.easing,
          easing = _nextItem$easing === void 0 ? 'ease' : _nextItem$easing,
          style = nextItem.style,
          nextProperties = nextItem.properties,
          onAnimationEnd = nextItem.onAnimationEnd;
        var preItem = index > 0 ? steps[index - 1] : nextItem;
        var properties = nextProperties || Object.keys(style);
        if (typeof easing === 'function' || easing === 'spring') {
          return [].concat(Animate_toConsumableArray(sequence), [_this3.runJSAnimation.bind(_this3, {
            from: preItem.style,
            to: style,
            duration: duration,
            easing: easing
          }), duration]);
        }
        var transition = getTransitionVal(properties, duration, easing);
        var newStyle = Animate_objectSpread(Animate_objectSpread(Animate_objectSpread({}, preItem.style), style), {}, {
          transition: transition
        });
        return [].concat(Animate_toConsumableArray(sequence), [newStyle, duration, onAnimationEnd]).filter(identity);
      };
      return this.manager.start([onAnimationStart].concat(Animate_toConsumableArray(steps.reduce(addStyle, [initialStyle, Math.max(initialTime, begin)])), [props.onAnimationEnd]));
    }
  }, {
    key: "runAnimation",
    value: function runAnimation(props) {
      if (!this.manager) {
        this.manager = createAnimateManager();
      }
      var begin = props.begin,
        duration = props.duration,
        attributeName = props.attributeName,
        propsTo = props.to,
        easing = props.easing,
        onAnimationStart = props.onAnimationStart,
        onAnimationEnd = props.onAnimationEnd,
        steps = props.steps,
        children = props.children;
      var manager = this.manager;
      this.unSubscribe = manager.subscribe(this.handleStyleChange);
      if (typeof easing === 'function' || typeof children === 'function' || easing === 'spring') {
        this.runJSAnimation(props);
        return;
      }
      if (steps.length > 1) {
        this.runStepAnimation(props);
        return;
      }
      var to = attributeName ? Animate_defineProperty({}, attributeName, propsTo) : propsTo;
      var transition = getTransitionVal(Object.keys(to), duration, easing);
      manager.start([onAnimationStart, begin, Animate_objectSpread(Animate_objectSpread({}, to), {}, {
        transition: transition
      }), duration, onAnimationEnd]);
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props4 = this.props,
        children = _this$props4.children,
        begin = _this$props4.begin,
        duration = _this$props4.duration,
        attributeName = _this$props4.attributeName,
        easing = _this$props4.easing,
        isActive = _this$props4.isActive,
        steps = _this$props4.steps,
        from = _this$props4.from,
        to = _this$props4.to,
        canBegin = _this$props4.canBegin,
        onAnimationEnd = _this$props4.onAnimationEnd,
        shouldReAnimate = _this$props4.shouldReAnimate,
        onAnimationReStart = _this$props4.onAnimationReStart,
        others = Animate_objectWithoutProperties(_this$props4, Animate_excluded);
      var count = react.Children.count(children);
      // eslint-disable-next-line react/destructuring-assignment
      var stateStyle = translateStyle(this.state.style);
      if (typeof children === 'function') {
        return children(stateStyle);
      }
      if (!isActive || count === 0 || duration <= 0) {
        return children;
      }
      var cloneContainer = function cloneContainer(container) {
        var _container$props = container.props,
          _container$props$styl = _container$props.style,
          style = _container$props$styl === void 0 ? {} : _container$props$styl,
          className = _container$props.className;
        var res = /*#__PURE__*/(0,react.cloneElement)(container, Animate_objectSpread(Animate_objectSpread({}, others), {}, {
          style: Animate_objectSpread(Animate_objectSpread({}, style), stateStyle),
          className: className
        }));
        return res;
      };
      if (count === 1) {
        return cloneContainer(react.Children.only(children));
      }
      return /*#__PURE__*/react.createElement("div", null, react.Children.map(children, function (child) {
        return cloneContainer(child);
      }));
    }
  }]);
  return Animate;
}(react.PureComponent);
Animate.displayName = 'Animate';
Animate.defaultProps = {
  begin: 0,
  duration: 1000,
  from: '',
  to: '',
  attributeName: '',
  easing: 'ease',
  isActive: true,
  canBegin: true,
  steps: [],
  onAnimationEnd: function onAnimationEnd() {},
  onAnimationStart: function onAnimationStart() {}
};
Animate.propTypes = {
  from: prop_types_default().oneOfType([(prop_types_default()).object, (prop_types_default()).string]),
  to: prop_types_default().oneOfType([(prop_types_default()).object, (prop_types_default()).string]),
  attributeName: (prop_types_default()).string,
  // animation duration
  duration: (prop_types_default()).number,
  begin: (prop_types_default()).number,
  easing: prop_types_default().oneOfType([(prop_types_default()).string, (prop_types_default()).func]),
  steps: prop_types_default().arrayOf(prop_types_default().shape({
    duration: (prop_types_default()).number.isRequired,
    style: (prop_types_default()).object.isRequired,
    easing: prop_types_default().oneOfType([prop_types_default().oneOf(['ease', 'ease-in', 'ease-out', 'ease-in-out', 'linear']), (prop_types_default()).func]),
    // transition css properties(dash case), optional
    properties: prop_types_default().arrayOf('string'),
    onAnimationEnd: (prop_types_default()).func
  })),
  children: prop_types_default().oneOfType([(prop_types_default()).node, (prop_types_default()).func]),
  isActive: (prop_types_default()).bool,
  canBegin: (prop_types_default()).bool,
  onAnimationEnd: (prop_types_default()).func,
  // decide if it should reanimate with initial from style when props change
  shouldReAnimate: (prop_types_default()).bool,
  onAnimationStart: (prop_types_default()).func,
  onAnimationReStart: (prop_types_default()).func
};
/* harmony default export */ var es6_Animate = (Animate);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-smooth/es6/AnimateGroupChild.js
var AnimateGroupChild_excluded = ["children", "appearOptions", "enterOptions", "leaveOptions"];
function AnimateGroupChild_typeof(obj) { "@babel/helpers - typeof"; return AnimateGroupChild_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; }, AnimateGroupChild_typeof(obj); }
function AnimateGroupChild_extends() { AnimateGroupChild_extends = Object.assign ? Object.assign.bind() : 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 AnimateGroupChild_extends.apply(this, arguments); }
function AnimateGroupChild_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = AnimateGroupChild_objectWithoutPropertiesLoose(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 AnimateGroupChild_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; }
function AnimateGroupChild_ownKeys(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 AnimateGroupChild_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? AnimateGroupChild_ownKeys(Object(source), !0).forEach(function (key) { AnimateGroupChild_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : AnimateGroupChild_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function AnimateGroupChild_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function AnimateGroupChild_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, AnimateGroupChild_toPropertyKey(descriptor.key), descriptor); } }
function AnimateGroupChild_createClass(Constructor, protoProps, staticProps) { if (protoProps) AnimateGroupChild_defineProperties(Constructor.prototype, protoProps); if (staticProps) AnimateGroupChild_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function AnimateGroupChild_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) AnimateGroupChild_setPrototypeOf(subClass, superClass); }
function AnimateGroupChild_setPrototypeOf(o, p) { AnimateGroupChild_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AnimateGroupChild_setPrototypeOf(o, p); }
function AnimateGroupChild_createSuper(Derived) { var hasNativeReflectConstruct = AnimateGroupChild_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = AnimateGroupChild_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = AnimateGroupChild_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return AnimateGroupChild_possibleConstructorReturn(this, result); }; }
function AnimateGroupChild_possibleConstructorReturn(self, call) { if (call && (AnimateGroupChild_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return AnimateGroupChild_assertThisInitialized(self); }
function AnimateGroupChild_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function AnimateGroupChild_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function AnimateGroupChild_getPrototypeOf(o) { AnimateGroupChild_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AnimateGroupChild_getPrototypeOf(o); }
function AnimateGroupChild_defineProperty(obj, key, value) { key = AnimateGroupChild_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function AnimateGroupChild_toPropertyKey(arg) { var key = AnimateGroupChild_toPrimitive(arg, "string"); return AnimateGroupChild_typeof(key) === "symbol" ? key : String(key); }
function AnimateGroupChild_toPrimitive(input, hint) { if (AnimateGroupChild_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (AnimateGroupChild_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }




if (Number.isFinite === undefined) {
  Number.isFinite = function (value) {
    return typeof value === 'number' && isFinite(value);
  };
}
var parseDurationOfSingleTransition = function parseDurationOfSingleTransition() {
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var steps = options.steps,
    duration = options.duration;
  if (steps && steps.length) {
    return steps.reduce(function (result, entry) {
      return result + (Number.isFinite(entry.duration) && entry.duration > 0 ? entry.duration : 0);
    }, 0);
  }
  if (Number.isFinite(duration)) {
    return duration;
  }
  return 0;
};
var AnimateGroupChild = /*#__PURE__*/function (_Component) {
  AnimateGroupChild_inherits(AnimateGroupChild, _Component);
  var _super = AnimateGroupChild_createSuper(AnimateGroupChild);
  function AnimateGroupChild() {
    var _this;
    AnimateGroupChild_classCallCheck(this, AnimateGroupChild);
    _this = _super.call(this);
    AnimateGroupChild_defineProperty(AnimateGroupChild_assertThisInitialized(_this), "handleEnter", function (node, isAppearing) {
      var _this$props = _this.props,
        appearOptions = _this$props.appearOptions,
        enterOptions = _this$props.enterOptions;
      _this.handleStyleActive(isAppearing ? appearOptions : enterOptions);
    });
    AnimateGroupChild_defineProperty(AnimateGroupChild_assertThisInitialized(_this), "handleExit", function () {
      var leaveOptions = _this.props.leaveOptions;
      _this.handleStyleActive(leaveOptions);
    });
    _this.state = {
      isActive: false
    };
    return _this;
  }
  AnimateGroupChild_createClass(AnimateGroupChild, [{
    key: "handleStyleActive",
    value: function handleStyleActive(style) {
      if (style) {
        var onAnimationEnd = style.onAnimationEnd ? function () {
          style.onAnimationEnd();
        } : null;
        this.setState(AnimateGroupChild_objectSpread(AnimateGroupChild_objectSpread({}, style), {}, {
          onAnimationEnd: onAnimationEnd,
          isActive: true
        }));
      }
    }
  }, {
    key: "parseTimeout",
    value: function parseTimeout() {
      var _this$props2 = this.props,
        appearOptions = _this$props2.appearOptions,
        enterOptions = _this$props2.enterOptions,
        leaveOptions = _this$props2.leaveOptions;
      return parseDurationOfSingleTransition(appearOptions) + parseDurationOfSingleTransition(enterOptions) + parseDurationOfSingleTransition(leaveOptions);
    }
  }, {
    key: "render",
    value: function render() {
      var _this2 = this;
      var _this$props3 = this.props,
        children = _this$props3.children,
        appearOptions = _this$props3.appearOptions,
        enterOptions = _this$props3.enterOptions,
        leaveOptions = _this$props3.leaveOptions,
        props = AnimateGroupChild_objectWithoutProperties(_this$props3, AnimateGroupChild_excluded);
      return /*#__PURE__*/react.createElement(esm_Transition, AnimateGroupChild_extends({}, props, {
        onEnter: this.handleEnter,
        onExit: this.handleExit,
        timeout: this.parseTimeout()
      }), function () {
        return /*#__PURE__*/react.createElement(es6_Animate, _this2.state, react.Children.only(children));
      });
    }
  }]);
  return AnimateGroupChild;
}(react.Component);
AnimateGroupChild.propTypes = {
  appearOptions: (prop_types_default()).object,
  enterOptions: (prop_types_default()).object,
  leaveOptions: (prop_types_default()).object,
  children: (prop_types_default()).element
};
/* harmony default export */ var es6_AnimateGroupChild = (AnimateGroupChild);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-smooth/es6/AnimateGroup.js




function AnimateGroup(props) {
  var component = props.component,
    children = props.children,
    appear = props.appear,
    enter = props.enter,
    leave = props.leave;
  return /*#__PURE__*/react.createElement(esm_TransitionGroup, {
    component: component
  }, react.Children.map(children, function (child, index) {
    return /*#__PURE__*/react.createElement(es6_AnimateGroupChild, {
      appearOptions: appear,
      enterOptions: enter,
      leaveOptions: leave,
      key: "child-".concat(index) // eslint-disable-line
    }, child);
  }));
}
AnimateGroup.propTypes = {
  appear: (prop_types_default()).object,
  enter: (prop_types_default()).object,
  leave: (prop_types_default()).object,
  children: prop_types_default().oneOfType([(prop_types_default()).array, (prop_types_default()).element]),
  component: (prop_types_default()).any
};
AnimateGroup.defaultProps = {
  component: 'span'
};
/* harmony default export */ var es6_AnimateGroup = ((/* unused pure expression or super */ null && (AnimateGroup)));
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-smooth/es6/index.js





/* harmony default export */ var es6 = (es6_Animate);
// EXTERNAL MODULE: ./node_modules/lodash/isArray.js
var lodash_isArray = __webpack_require__(6449);
var isArray_default = /*#__PURE__*/__webpack_require__.n(lodash_isArray);
// EXTERNAL MODULE: ./node_modules/lodash/upperFirst.js
var upperFirst = __webpack_require__(5808);
var upperFirst_default = /*#__PURE__*/__webpack_require__.n(upperFirst);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/noop.js
/* harmony default export */ function src_noop() {}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/curve/basis.js
function point(that, x, y) {
  that._context.bezierCurveTo(
    (2 * that._x0 + that._x1) / 3,
    (2 * that._y0 + that._y1) / 3,
    (that._x0 + 2 * that._x1) / 3,
    (that._y0 + 2 * that._y1) / 3,
    (that._x0 + 4 * that._x1 + x) / 6,
    (that._y0 + 4 * that._y1 + y) / 6
  );
}

function Basis(context) {
  this._context = context;
}

Basis.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 =
    this._y0 = this._y1 = NaN;
    this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 3: point(this, this._x1, this._y1); // falls through
      case 2: this._context.lineTo(this._x1, this._y1); break;
    }
    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
    this._line = 1 - this._line;
  },
  point: function(x, y) {
    x = +x, y = +y;
    switch (this._point) {
      case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
      case 1: this._point = 2; break;
      case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through
      default: point(this, x, y); break;
    }
    this._x0 = this._x1, this._x1 = x;
    this._y0 = this._y1, this._y1 = y;
  }
};

/* harmony default export */ function basis(context) {
  return new Basis(context);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/curve/basisClosed.js



function BasisClosed(context) {
  this._context = context;
}

BasisClosed.prototype = {
  areaStart: src_noop,
  areaEnd: src_noop,
  lineStart: function() {
    this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =
    this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
    this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 1: {
        this._context.moveTo(this._x2, this._y2);
        this._context.closePath();
        break;
      }
      case 2: {
        this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
        this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
        this._context.closePath();
        break;
      }
      case 3: {
        this.point(this._x2, this._y2);
        this.point(this._x3, this._y3);
        this.point(this._x4, this._y4);
        break;
      }
    }
  },
  point: function(x, y) {
    x = +x, y = +y;
    switch (this._point) {
      case 0: this._point = 1; this._x2 = x, this._y2 = y; break;
      case 1: this._point = 2; this._x3 = x, this._y3 = y; break;
      case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;
      default: point(this, x, y); break;
    }
    this._x0 = this._x1, this._x1 = x;
    this._y0 = this._y1, this._y1 = y;
  }
};

/* harmony default export */ function basisClosed(context) {
  return new BasisClosed(context);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/curve/basisOpen.js


function BasisOpen(context) {
  this._context = context;
}

BasisOpen.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 =
    this._y0 = this._y1 = NaN;
    this._point = 0;
  },
  lineEnd: function() {
    if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();
    this._line = 1 - this._line;
  },
  point: function(x, y) {
    x = +x, y = +y;
    switch (this._point) {
      case 0: this._point = 1; break;
      case 1: this._point = 2; break;
      case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;
      case 3: this._point = 4; // falls through
      default: point(this, x, y); break;
    }
    this._x0 = this._x1, this._x1 = x;
    this._y0 = this._y1, this._y1 = y;
  }
};

/* harmony default export */ function basisOpen(context) {
  return new BasisOpen(context);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/curve/bump.js


class Bump {
  constructor(context, x) {
    this._context = context;
    this._x = x;
  }
  areaStart() {
    this._line = 0;
  }
  areaEnd() {
    this._line = NaN;
  }
  lineStart() {
    this._point = 0;
  }
  lineEnd() {
    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
    this._line = 1 - this._line;
  }
  point(x, y) {
    x = +x, y = +y;
    switch (this._point) {
      case 0: {
        this._point = 1;
        if (this._line) this._context.lineTo(x, y);
        else this._context.moveTo(x, y);
        break;
      }
      case 1: this._point = 2; // falls through
      default: {
        if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);
        else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);
        break;
      }
    }
    this._x0 = x, this._y0 = y;
  }
}

class BumpRadial {
  constructor(context) {
    this._context = context;
  }
  lineStart() {
    this._point = 0;
  }
  lineEnd() {}
  point(x, y) {
    x = +x, y = +y;
    if (this._point === 0) {
      this._point = 1;
    } else {
      const p0 = pointRadial(this._x0, this._y0);
      const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);
      const p2 = pointRadial(x, this._y0);
      const p3 = pointRadial(x, y);
      this._context.moveTo(...p0);
      this._context.bezierCurveTo(...p1, ...p2, ...p3);
    }
    this._x0 = x, this._y0 = y;
  }
}

function bumpX(context) {
  return new Bump(context, true);
}

function bumpY(context) {
  return new Bump(context, false);
}

function bumpRadial(context) {
  return new BumpRadial(context);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/curve/linearClosed.js


function LinearClosed(context) {
  this._context = context;
}

LinearClosed.prototype = {
  areaStart: src_noop,
  areaEnd: src_noop,
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    if (this._point) this._context.closePath();
  },
  point: function(x, y) {
    x = +x, y = +y;
    if (this._point) this._context.lineTo(x, y);
    else this._point = 1, this._context.moveTo(x, y);
  }
};

/* harmony default export */ function linearClosed(context) {
  return new LinearClosed(context);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/curve/linear.js
function Linear(context) {
  this._context = context;
}

Linear.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
    this._line = 1 - this._line;
  },
  point: function(x, y) {
    x = +x, y = +y;
    switch (this._point) {
      case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
      case 1: this._point = 2; // falls through
      default: this._context.lineTo(x, y); break;
    }
  }
};

/* harmony default export */ function linear(context) {
  return new Linear(context);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/curve/monotone.js
function sign(x) {
  return x < 0 ? -1 : 1;
}

// Calculate the slopes of the tangents (Hermite-type interpolation) based on
// the following paper: Steffen, M. 1990. A Simple Method for Monotonic
// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.
// NOV(II), P. 443, 1990.
function slope3(that, x2, y2) {
  var h0 = that._x1 - that._x0,
      h1 = x2 - that._x1,
      s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),
      s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),
      p = (s0 * h1 + s1 * h0) / (h0 + h1);
  return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;
}

// Calculate a one-sided slope.
function slope2(that, t) {
  var h = that._x1 - that._x0;
  return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;
}

// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations
// "you can express cubic Hermite interpolation in terms of cubic Bézier curves
// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1".
function monotone_point(that, t0, t1) {
  var x0 = that._x0,
      y0 = that._y0,
      x1 = that._x1,
      y1 = that._y1,
      dx = (x1 - x0) / 3;
  that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);
}

function MonotoneX(context) {
  this._context = context;
}

MonotoneX.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 =
    this._y0 = this._y1 =
    this._t0 = NaN;
    this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 2: this._context.lineTo(this._x1, this._y1); break;
      case 3: monotone_point(this, this._t0, slope2(this, this._t0)); break;
    }
    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
    this._line = 1 - this._line;
  },
  point: function(x, y) {
    var t1 = NaN;

    x = +x, y = +y;
    if (x === this._x1 && y === this._y1) return; // Ignore coincident points.
    switch (this._point) {
      case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
      case 1: this._point = 2; break;
      case 2: this._point = 3; monotone_point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;
      default: monotone_point(this, this._t0, t1 = slope3(this, x, y)); break;
    }

    this._x0 = this._x1, this._x1 = x;
    this._y0 = this._y1, this._y1 = y;
    this._t0 = t1;
  }
}

function MonotoneY(context) {
  this._context = new ReflectContext(context);
}

(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {
  MonotoneX.prototype.point.call(this, y, x);
};

function ReflectContext(context) {
  this._context = context;
}

ReflectContext.prototype = {
  moveTo: function(x, y) { this._context.moveTo(y, x); },
  closePath: function() { this._context.closePath(); },
  lineTo: function(x, y) { this._context.lineTo(y, x); },
  bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }
};

function monotoneX(context) {
  return new MonotoneX(context);
}

function monotoneY(context) {
  return new MonotoneY(context);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/curve/natural.js
function Natural(context) {
  this._context = context;
}

Natural.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x = [];
    this._y = [];
  },
  lineEnd: function() {
    var x = this._x,
        y = this._y,
        n = x.length;

    if (n) {
      this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);
      if (n === 2) {
        this._context.lineTo(x[1], y[1]);
      } else {
        var px = controlPoints(x),
            py = controlPoints(y);
        for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {
          this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);
        }
      }
    }

    if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();
    this._line = 1 - this._line;
    this._x = this._y = null;
  },
  point: function(x, y) {
    this._x.push(+x);
    this._y.push(+y);
  }
};

// See https://www.particleincell.com/2012/bezier-splines/ for derivation.
function controlPoints(x) {
  var i,
      n = x.length - 1,
      m,
      a = new Array(n),
      b = new Array(n),
      r = new Array(n);
  a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];
  for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];
  a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];
  for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];
  a[n - 1] = r[n - 1] / b[n - 1];
  for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];
  b[n - 1] = (x[n] + a[n - 1]) / 2;
  for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];
  return [a, b];
}

/* harmony default export */ function natural(context) {
  return new Natural(context);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/curve/step.js
function Step(context, t) {
  this._context = context;
  this._t = t;
}

Step.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x = this._y = NaN;
    this._point = 0;
  },
  lineEnd: function() {
    if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);
    if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
    if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;
  },
  point: function(x, y) {
    x = +x, y = +y;
    switch (this._point) {
      case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
      case 1: this._point = 2; // falls through
      default: {
        if (this._t <= 0) {
          this._context.lineTo(this._x, y);
          this._context.lineTo(x, y);
        } else {
          var x1 = this._x * (1 - this._t) + x * this._t;
          this._context.lineTo(x1, this._y);
          this._context.lineTo(x1, y);
        }
        break;
      }
    }
    this._x = x, this._y = y;
  }
};

/* harmony default export */ function step(context) {
  return new Step(context, 0.5);
}

function stepBefore(context) {
  return new Step(context, 0);
}

function stepAfter(context) {
  return new Step(context, 1);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/array.js
var slice = Array.prototype.slice;

/* harmony default export */ function array(x) {
  return typeof x === "object" && "length" in x
    ? x // Array, TypedArray, NodeList, array-like
    : Array.from(x); // Map, Set, iterable, string, or anything else
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/constant.js
/* harmony default export */ function src_constant(x) {
  return function constant() {
    return x;
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-path/src/path.js
const pi = Math.PI,
    tau = 2 * pi,
    epsilon = 1e-6,
    tauEpsilon = tau - epsilon;

function src_append(strings) {
  this._ += strings[0];
  for (let i = 1, n = strings.length; i < n; ++i) {
    this._ += arguments[i] + strings[i];
  }
}

function appendRound(digits) {
  let d = Math.floor(digits);
  if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);
  if (d > 15) return src_append;
  const k = 10 ** d;
  return function(strings) {
    this._ += strings[0];
    for (let i = 1, n = strings.length; i < n; ++i) {
      this._ += Math.round(arguments[i] * k) / k + strings[i];
    }
  };
}

class Path {
  constructor(digits) {
    this._x0 = this._y0 = // start of current subpath
    this._x1 = this._y1 = null; // end of current subpath
    this._ = "";
    this._append = digits == null ? src_append : appendRound(digits);
  }
  moveTo(x, y) {
    this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;
  }
  closePath() {
    if (this._x1 !== null) {
      this._x1 = this._x0, this._y1 = this._y0;
      this._append`Z`;
    }
  }
  lineTo(x, y) {
    this._append`L${this._x1 = +x},${this._y1 = +y}`;
  }
  quadraticCurveTo(x1, y1, x, y) {
    this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;
  }
  bezierCurveTo(x1, y1, x2, y2, x, y) {
    this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;
  }
  arcTo(x1, y1, x2, y2, r) {
    x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;

    // Is the radius negative? Error.
    if (r < 0) throw new Error(`negative radius: ${r}`);

    let x0 = this._x1,
        y0 = this._y1,
        x21 = x2 - x1,
        y21 = y2 - y1,
        x01 = x0 - x1,
        y01 = y0 - y1,
        l01_2 = x01 * x01 + y01 * y01;

    // Is this path empty? Move to (x1,y1).
    if (this._x1 === null) {
      this._append`M${this._x1 = x1},${this._y1 = y1}`;
    }

    // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.
    else if (!(l01_2 > epsilon));

    // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?
    // Equivalently, is (x1,y1) coincident with (x2,y2)?
    // Or, is the radius zero? Line to (x1,y1).
    else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {
      this._append`L${this._x1 = x1},${this._y1 = y1}`;
    }

    // Otherwise, draw an arc!
    else {
      let x20 = x2 - x0,
          y20 = y2 - y0,
          l21_2 = x21 * x21 + y21 * y21,
          l20_2 = x20 * x20 + y20 * y20,
          l21 = Math.sqrt(l21_2),
          l01 = Math.sqrt(l01_2),
          l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),
          t01 = l / l01,
          t21 = l / l21;

      // If the start tangent is not coincident with (x0,y0), line to.
      if (Math.abs(t01 - 1) > epsilon) {
        this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;
      }

      this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;
    }
  }
  arc(x, y, r, a0, a1, ccw) {
    x = +x, y = +y, r = +r, ccw = !!ccw;

    // Is the radius negative? Error.
    if (r < 0) throw new Error(`negative radius: ${r}`);

    let dx = r * Math.cos(a0),
        dy = r * Math.sin(a0),
        x0 = x + dx,
        y0 = y + dy,
        cw = 1 ^ ccw,
        da = ccw ? a0 - a1 : a1 - a0;

    // Is this path empty? Move to (x0,y0).
    if (this._x1 === null) {
      this._append`M${x0},${y0}`;
    }

    // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).
    else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
      this._append`L${x0},${y0}`;
    }

    // Is this arc empty? We’re done.
    if (!r) return;

    // Does the angle go the wrong way? Flip the direction.
    if (da < 0) da = da % tau + tau;

    // Is this a complete circle? Draw two arcs to complete the circle.
    if (da > tauEpsilon) {
      this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;
    }

    // Is this arc non-empty? Draw an arc!
    else if (da > epsilon) {
      this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;
    }
  }
  rect(x, y, w, h) {
    this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;
  }
  toString() {
    return this._;
  }
}

function path() {
  return new Path;
}

// Allow instanceof d3.path
path.prototype = Path.prototype;

function pathRound(digits = 3) {
  return new Path(+digits);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/path.js


function withPath(shape) {
  let digits = 3;

  shape.digits = function(_) {
    if (!arguments.length) return digits;
    if (_ == null) {
      digits = null;
    } else {
      const d = Math.floor(_);
      if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);
      digits = d;
    }
    return shape;
  };

  return () => new Path(digits);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/point.js
function point_x(p) {
  return p[0];
}

function point_y(p) {
  return p[1];
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/line.js






/* harmony default export */ function line(x, y) {
  var defined = src_constant(true),
      context = null,
      curve = linear,
      output = null,
      path = withPath(line);

  x = typeof x === "function" ? x : (x === undefined) ? point_x : src_constant(x);
  y = typeof y === "function" ? y : (y === undefined) ? point_y : src_constant(y);

  function line(data) {
    var i,
        n = (data = array(data)).length,
        d,
        defined0 = false,
        buffer;

    if (context == null) output = curve(buffer = path());

    for (i = 0; i <= n; ++i) {
      if (!(i < n && defined(d = data[i], i, data)) === defined0) {
        if (defined0 = !defined0) output.lineStart();
        else output.lineEnd();
      }
      if (defined0) output.point(+x(d, i, data), +y(d, i, data));
    }

    if (buffer) return output = null, buffer + "" || null;
  }

  line.x = function(_) {
    return arguments.length ? (x = typeof _ === "function" ? _ : src_constant(+_), line) : x;
  };

  line.y = function(_) {
    return arguments.length ? (y = typeof _ === "function" ? _ : src_constant(+_), line) : y;
  };

  line.defined = function(_) {
    return arguments.length ? (defined = typeof _ === "function" ? _ : src_constant(!!_), line) : defined;
  };

  line.curve = function(_) {
    return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
  };

  line.context = function(_) {
    return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
  };

  return line;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/area.js







/* harmony default export */ function src_area(x0, y0, y1) {
  var x1 = null,
      defined = src_constant(true),
      context = null,
      curve = linear,
      output = null,
      path = withPath(area);

  x0 = typeof x0 === "function" ? x0 : (x0 === undefined) ? point_x : src_constant(+x0);
  y0 = typeof y0 === "function" ? y0 : (y0 === undefined) ? src_constant(0) : src_constant(+y0);
  y1 = typeof y1 === "function" ? y1 : (y1 === undefined) ? point_y : src_constant(+y1);

  function area(data) {
    var i,
        j,
        k,
        n = (data = array(data)).length,
        d,
        defined0 = false,
        buffer,
        x0z = new Array(n),
        y0z = new Array(n);

    if (context == null) output = curve(buffer = path());

    for (i = 0; i <= n; ++i) {
      if (!(i < n && defined(d = data[i], i, data)) === defined0) {
        if (defined0 = !defined0) {
          j = i;
          output.areaStart();
          output.lineStart();
        } else {
          output.lineEnd();
          output.lineStart();
          for (k = i - 1; k >= j; --k) {
            output.point(x0z[k], y0z[k]);
          }
          output.lineEnd();
          output.areaEnd();
        }
      }
      if (defined0) {
        x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);
        output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);
      }
    }

    if (buffer) return output = null, buffer + "" || null;
  }

  function arealine() {
    return line().defined(defined).curve(curve).context(context);
  }

  area.x = function(_) {
    return arguments.length ? (x0 = typeof _ === "function" ? _ : src_constant(+_), x1 = null, area) : x0;
  };

  area.x0 = function(_) {
    return arguments.length ? (x0 = typeof _ === "function" ? _ : src_constant(+_), area) : x0;
  };

  area.x1 = function(_) {
    return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : src_constant(+_), area) : x1;
  };

  area.y = function(_) {
    return arguments.length ? (y0 = typeof _ === "function" ? _ : src_constant(+_), y1 = null, area) : y0;
  };

  area.y0 = function(_) {
    return arguments.length ? (y0 = typeof _ === "function" ? _ : src_constant(+_), area) : y0;
  };

  area.y1 = function(_) {
    return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : src_constant(+_), area) : y1;
  };

  area.lineX0 =
  area.lineY0 = function() {
    return arealine().x(x0).y(y0);
  };

  area.lineY1 = function() {
    return arealine().x(x0).y(y1);
  };

  area.lineX1 = function() {
    return arealine().x(x1).y(y0);
  };

  area.defined = function(_) {
    return arguments.length ? (defined = typeof _ === "function" ? _ : src_constant(!!_), area) : defined;
  };

  area.curve = function(_) {
    return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;
  };

  area.context = function(_) {
    return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;
  };

  return area;
}

// EXTERNAL MODULE: ./node_modules/lodash/isObject.js
var isObject = __webpack_require__(3805);
var isObject_default = /*#__PURE__*/__webpack_require__.n(isObject);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/types.js

function types_typeof(obj) { "@babel/helpers - typeof"; return types_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; }, types_typeof(obj); }


//
// Event Handler Types -- Copied from @types/react/index.d.ts and adapted for Props.
//
var SVGContainerPropKeys = ['viewBox', 'children'];
var SVGElementPropKeys = ['aria-activedescendant', 'aria-atomic', 'aria-autocomplete', 'aria-busy', 'aria-checked', 'aria-colcount', 'aria-colindex', 'aria-colspan', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-errormessage', 'aria-expanded', 'aria-flowto', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-level', 'aria-live', 'aria-modal', 'aria-multiline', 'aria-multiselectable', 'aria-orientation', 'aria-owns', 'aria-placeholder', 'aria-posinset', 'aria-pressed', 'aria-readonly', 'aria-relevant', 'aria-required', 'aria-roledescription', 'aria-rowcount', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-setsize', 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext', 'className', 'color', 'height', 'id', 'lang', 'max', 'media', 'method', 'min', 'name', 'style',
/*
 * removed 'type' SVGElementPropKey because we do not currently use any SVG elements
 * that can use it and it conflicts with the recharts prop 'type'
 * https://github.com/recharts/recharts/pull/3327
 * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/type
 */
// 'type',
'target', 'width', 'role', 'tabIndex', 'accentHeight', 'accumulate', 'additive', 'alignmentBaseline', 'allowReorder', 'alphabetic', 'amplitude', 'arabicForm', 'ascent', 'attributeName', 'attributeType', 'autoReverse', 'azimuth', 'baseFrequency', 'baselineShift', 'baseProfile', 'bbox', 'begin', 'bias', 'by', 'calcMode', 'capHeight', 'clip', 'clipPath', 'clipPathUnits', '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', 'fx', 'fy', 'g1', 'g2', 'glyphName', 'glyphOrientationHorizontal', 'glyphOrientationVertical', 'glyphRef', 'gradientTransform', 'gradientUnits', 'hanging', 'horizAdvX', 'horizOriginX', 'href', 'ideographic', 'imageRendering', 'in2', 'in', 'intercept', 'k1', 'k2', 'k3', 'k4', 'k', 'kernelMatrix', 'kernelUnitLength', 'kerning', 'keyPoints', 'keySplines', 'keyTimes', 'lengthAdjust', 'letterSpacing', 'lightingColor', 'limitingConeAngle', 'local', 'markerEnd', 'markerHeight', 'markerMid', 'markerStart', 'markerUnits', 'markerWidth', 'mask', 'maskContentUnits', 'maskUnits', 'mathematical', 'mode', 'numOctaves', 'offset', 'opacity', 'operator', 'order', 'orient', 'orientation', 'origin', 'overflow', 'overlinePosition', 'overlineThickness', 'paintOrder', 'panose1', 'pathLength', 'patternContentUnits', 'patternTransform', 'patternUnits', 'pointerEvents', 'pointsAtX', 'pointsAtY', 'pointsAtZ', 'preserveAlpha', 'preserveAspectRatio', 'primitiveUnits', 'r', 'radius', 'refX', 'refY', 'renderingIntent', 'repeatCount', 'repeatDur', 'requiredExtensions', 'requiredFeatures', 'restart', 'result', 'rotate', 'rx', 'ry', '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', 'textLength', 'textRendering', 'to', 'transform', 'u1', 'u2', 'underlinePosition', 'underlineThickness', 'unicode', 'unicodeBidi', 'unicodeRange', 'unitsPerEm', 'vAlphabetic', 'values', 'vectorEffect', 'version', 'vertAdvY', 'vertOriginX', 'vertOriginY', 'vHanging', 'vIdeographic', 'viewTarget', 'visibility', 'vMathematical', 'widths', 'wordSpacing', 'writingMode', 'x1', 'x2', 'x', 'xChannelSelector', 'xHeight', 'xlinkActuate', 'xlinkArcrole', 'xlinkHref', 'xlinkRole', 'xlinkShow', 'xlinkTitle', 'xlinkType', 'xmlBase', 'xmlLang', 'xmlns', 'xmlnsXlink', 'xmlSpace', 'y1', 'y2', 'y', 'yChannelSelector', 'z', 'zoomAndPan', 'ref', 'key', 'angle'];
var PolyElementKeys = ['points', 'pathLength'];

/** svg element types that have specific attribute filtration requirements */

/** map of svg element types to unique svg attributes that belong to that element */
var FilteredElementKeyMap = {
  svg: SVGContainerPropKeys,
  polygon: PolyElementKeys,
  polyline: PolyElementKeys
};
var EventKeys = ['dangerouslySetInnerHTML', 'onCopy', 'onCopyCapture', 'onCut', 'onCutCapture', 'onPaste', 'onPasteCapture', 'onCompositionEnd', 'onCompositionEndCapture', 'onCompositionStart', 'onCompositionStartCapture', 'onCompositionUpdate', 'onCompositionUpdateCapture', 'onFocus', 'onFocusCapture', 'onBlur', 'onBlurCapture', 'onChange', 'onChangeCapture', 'onBeforeInput', 'onBeforeInputCapture', 'onInput', 'onInputCapture', 'onReset', 'onResetCapture', 'onSubmit', 'onSubmitCapture', 'onInvalid', 'onInvalidCapture', 'onLoad', 'onLoadCapture', 'onError', 'onErrorCapture', 'onKeyDown', 'onKeyDownCapture', 'onKeyPress', 'onKeyPressCapture', 'onKeyUp', 'onKeyUpCapture', 'onAbort', 'onAbortCapture', 'onCanPlay', 'onCanPlayCapture', 'onCanPlayThrough', 'onCanPlayThroughCapture', 'onDurationChange', 'onDurationChangeCapture', 'onEmptied', 'onEmptiedCapture', 'onEncrypted', 'onEncryptedCapture', 'onEnded', 'onEndedCapture', 'onLoadedData', 'onLoadedDataCapture', 'onLoadedMetadata', 'onLoadedMetadataCapture', 'onLoadStart', 'onLoadStartCapture', 'onPause', 'onPauseCapture', 'onPlay', 'onPlayCapture', 'onPlaying', 'onPlayingCapture', 'onProgress', 'onProgressCapture', 'onRateChange', 'onRateChangeCapture', 'onSeeked', 'onSeekedCapture', 'onSeeking', 'onSeekingCapture', 'onStalled', 'onStalledCapture', 'onSuspend', 'onSuspendCapture', 'onTimeUpdate', 'onTimeUpdateCapture', 'onVolumeChange', 'onVolumeChangeCapture', 'onWaiting', 'onWaitingCapture', 'onAuxClick', 'onAuxClickCapture', 'onClick', 'onClickCapture', 'onContextMenu', 'onContextMenuCapture', 'onDoubleClick', 'onDoubleClickCapture', 'onDrag', 'onDragCapture', 'onDragEnd', 'onDragEndCapture', 'onDragEnter', 'onDragEnterCapture', 'onDragExit', 'onDragExitCapture', 'onDragLeave', 'onDragLeaveCapture', 'onDragOver', 'onDragOverCapture', 'onDragStart', 'onDragStartCapture', 'onDrop', 'onDropCapture', 'onMouseDown', 'onMouseDownCapture', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseMoveCapture', 'onMouseOut', 'onMouseOutCapture', 'onMouseOver', 'onMouseOverCapture', 'onMouseUp', 'onMouseUpCapture', 'onSelect', 'onSelectCapture', 'onTouchCancel', 'onTouchCancelCapture', 'onTouchEnd', 'onTouchEndCapture', 'onTouchMove', 'onTouchMoveCapture', 'onTouchStart', 'onTouchStartCapture', 'onPointerDown', 'onPointerDownCapture', 'onPointerMove', 'onPointerMoveCapture', 'onPointerUp', 'onPointerUpCapture', 'onPointerCancel', 'onPointerCancelCapture', 'onPointerEnter', 'onPointerEnterCapture', 'onPointerLeave', 'onPointerLeaveCapture', 'onPointerOver', 'onPointerOverCapture', 'onPointerOut', 'onPointerOutCapture', 'onGotPointerCapture', 'onGotPointerCaptureCapture', 'onLostPointerCapture', 'onLostPointerCaptureCapture', 'onScroll', 'onScrollCapture', 'onWheel', 'onWheelCapture', 'onAnimationStart', 'onAnimationStartCapture', 'onAnimationEnd', 'onAnimationEndCapture', 'onAnimationIteration', 'onAnimationIterationCapture', 'onTransitionEnd', 'onTransitionEndCapture'];

/** The type of easing function to use for animations */

/** Specifies the duration of animation, the unit of this option is ms. */

/** the offset of a chart, which define the blank space all around */

/** The domain of axis */

/** The props definition of base axis */

var adaptEventHandlers = function adaptEventHandlers(props, newHandler) {
  if (!props || typeof props === 'function' || typeof props === 'boolean') {
    return null;
  }
  var inputProps = props;
  if ( /*#__PURE__*/(0,react.isValidElement)(props)) {
    inputProps = props.props;
  }
  if (!isObject_default()(inputProps)) {
    return null;
  }
  var out = {};
  Object.keys(inputProps).forEach(function (key) {
    if (EventKeys.includes(key)) {
      out[key] = newHandler || function (e) {
        return inputProps[key](inputProps, e);
      };
    }
  });
  return out;
};
var getEventHandlerOfChild = function getEventHandlerOfChild(originalHandler, data, index) {
  return function (e) {
    originalHandler(data, index, e);
    return null;
  };
};
var adaptEventsOfChild = function adaptEventsOfChild(props, data, index) {
  if (!isObject_default()(props) || types_typeof(props) !== 'object') {
    return null;
  }
  var out = null;
  Object.keys(props).forEach(function (key) {
    var item = props[key];
    if (EventKeys.includes(key) && typeof item === 'function') {
      if (!out) out = {};
      out[key] = getEventHandlerOfChild(item, data, index);
    }
  });
  return out;
};
// EXTERNAL MODULE: ./node_modules/lodash/isString.js
var isString = __webpack_require__(5015);
var isString_default = /*#__PURE__*/__webpack_require__.n(isString);
// EXTERNAL MODULE: ./node_modules/lodash/get.js
var get = __webpack_require__(8156);
var get_default = /*#__PURE__*/__webpack_require__.n(get);
// EXTERNAL MODULE: ./node_modules/lodash/isNaN.js
var lodash_isNaN = __webpack_require__(4122);
var isNaN_default = /*#__PURE__*/__webpack_require__.n(lodash_isNaN);
// EXTERNAL MODULE: ./node_modules/lodash/isNumber.js
var lodash_isNumber = __webpack_require__(8023);
var isNumber_default = /*#__PURE__*/__webpack_require__.n(lodash_isNumber);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/DataUtils.js





var mathSign = function mathSign(value) {
  if (value === 0) {
    return 0;
  }
  if (value > 0) {
    return 1;
  }
  return -1;
};
var isPercent = function isPercent(value) {
  return isString_default()(value) && value.indexOf('%') === value.length - 1;
};
var isNumber = function isNumber(value) {
  return isNumber_default()(value) && !isNaN_default()(value);
};
var isNumOrStr = function isNumOrStr(value) {
  return isNumber(value) || isString_default()(value);
};
var idCounter = 0;
var uniqueId = function uniqueId(prefix) {
  var id = ++idCounter;
  return "".concat(prefix || '').concat(id);
};

/**
 * Get percent value of a total value
 * @param {number|string} percent A percent
 * @param {number} totalValue     Total value
 * @param {number} defaultValue   The value returned when percent is undefined or invalid
 * @param {boolean} validate      If set to be true, the result will be validated
 * @return {number} value
 */
var getPercentValue = function getPercentValue(percent, totalValue) {
  var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  var validate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  if (!isNumber(percent) && !isString_default()(percent)) {
    return defaultValue;
  }
  var value;
  if (isPercent(percent)) {
    var index = percent.indexOf('%');
    value = totalValue * parseFloat(percent.slice(0, index)) / 100;
  } else {
    value = +percent;
  }
  if (isNaN_default()(value)) {
    value = defaultValue;
  }
  if (validate && value > totalValue) {
    value = totalValue;
  }
  return value;
};
var getAnyElementOfObject = function getAnyElementOfObject(obj) {
  if (!obj) {
    return null;
  }
  var keys = Object.keys(obj);
  if (keys && keys.length) {
    return obj[keys[0]];
  }
  return null;
};
var hasDuplicate = function hasDuplicate(ary) {
  if (!isArray_default()(ary)) {
    return false;
  }
  var len = ary.length;
  var cache = {};
  for (var i = 0; i < len; i++) {
    if (!cache[ary[i]]) {
      cache[ary[i]] = true;
    } else {
      return true;
    }
  }
  return false;
};

/* @todo consider to rename this function into `getInterpolator` */
var interpolateNumber = function interpolateNumber(numberA, numberB) {
  if (isNumber(numberA) && isNumber(numberB)) {
    return function (t) {
      return numberA + t * (numberB - numberA);
    };
  }
  return function () {
    return numberB;
  };
};
function findEntryInArray(ary, specifiedKey, specifiedValue) {
  if (!ary || !ary.length) {
    return null;
  }
  return ary.find(function (entry) {
    return entry && (typeof specifiedKey === 'function' ? specifiedKey(entry) : get_default()(entry, specifiedKey)) === specifiedValue;
  });
}

/**
 * The least square linear regression
 * @param {Array} data The array of points
 * @returns {Object} The domain of x, and the parameter of linear function
 */
var getLinearRegression = function getLinearRegression(data) {
  if (!data || !data.length) {
    return null;
  }
  var len = data.length;
  var xsum = 0;
  var ysum = 0;
  var xysum = 0;
  var xxsum = 0;
  var xmin = Infinity;
  var xmax = -Infinity;
  var xcurrent = 0;
  var ycurrent = 0;
  for (var i = 0; i < len; i++) {
    xcurrent = data[i].cx || 0;
    ycurrent = data[i].cy || 0;
    xsum += xcurrent;
    ysum += ycurrent;
    xysum += xcurrent * ycurrent;
    xxsum += xcurrent * xcurrent;
    xmin = Math.min(xmin, xcurrent);
    xmax = Math.max(xmax, xcurrent);
  }
  var a = len * xxsum !== xsum * xsum ? (len * xysum - xsum * ysum) / (len * xxsum - xsum * xsum) : 0;
  return {
    xmin: xmin,
    xmax: xmax,
    a: a,
    b: (ysum - a * xsum) / len
  };
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/ShallowEqual.js
function ShallowEqual_shallowEqual(a, b) {
  /* eslint-disable no-restricted-syntax */
  for (var key in a) {
    if ({}.hasOwnProperty.call(a, key) && (!{}.hasOwnProperty.call(b, key) || a[key] !== b[key])) {
      return false;
    }
  }
  for (var _key in b) {
    if ({}.hasOwnProperty.call(b, _key) && !{}.hasOwnProperty.call(a, _key)) {
      return false;
    }
  }
  return true;
}
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/ReactUtils.js






var ReactUtils_excluded = ["children"],
  ReactUtils_excluded2 = ["children"];
function ReactUtils_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = ReactUtils_objectWithoutPropertiesLoose(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 ReactUtils_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; }
function ReactUtils_typeof(obj) { "@babel/helpers - typeof"; return ReactUtils_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; }, ReactUtils_typeof(obj); }





var REACT_BROWSER_EVENT_MAP = {
  click: 'onClick',
  mousedown: 'onMouseDown',
  mouseup: 'onMouseUp',
  mouseover: 'onMouseOver',
  mousemove: 'onMouseMove',
  mouseout: 'onMouseOut',
  mouseenter: 'onMouseEnter',
  mouseleave: 'onMouseLeave',
  touchcancel: 'onTouchCancel',
  touchend: 'onTouchEnd',
  touchmove: 'onTouchMove',
  touchstart: 'onTouchStart'
};
var SCALE_TYPES = (/* unused pure expression or super */ null && (['auto', 'linear', 'pow', 'sqrt', 'log', 'identity', 'time', 'band', 'point', 'ordinal', 'quantile', 'quantize', 'utc', 'sequential', 'threshold']));
var LEGEND_TYPES = (/* unused pure expression or super */ null && (['plainline', 'line', 'square', 'rect', 'circle', 'cross', 'diamond', 'star', 'triangle', 'wye', 'none']));
var TOOLTIP_TYPES = (/* unused pure expression or super */ null && (['none']));

/**
 * Get the display name of a component
 * @param  {Object} Comp Specified Component
 * @return {String}      Display name of Component
 */
var getDisplayName = function getDisplayName(Comp) {
  if (typeof Comp === 'string') {
    return Comp;
  }
  if (!Comp) {
    return '';
  }
  return Comp.displayName || Comp.name || 'Component';
};

// `toArray` gets called multiple times during the render
// so we can memoize last invocation (since reference to `children` is the same)
var lastChildren = null;
var lastResult = null;
var toArray = function toArray(children) {
  if (children === lastChildren && isArray_default()(lastResult)) {
    return lastResult;
  }
  var result = [];
  react.Children.forEach(children, function (child) {
    if (isNil_default()(child)) return;
    if ((0,react_is_production.isFragment)(child)) {
      result = result.concat(toArray(child.props.children));
    } else {
      result.push(child);
    }
  });
  lastResult = result;
  lastChildren = children;
  return result;
};

/*
 * Find and return all matched children by type.
 * `type` must be a React.ComponentType
 */
function findAllByType(children, type) {
  var result = [];
  var types = [];
  if (isArray_default()(type)) {
    types = type.map(function (t) {
      return getDisplayName(t);
    });
  } else {
    types = [getDisplayName(type)];
  }
  toArray(children).forEach(function (child) {
    var childType = get_default()(child, 'type.displayName') || get_default()(child, 'type.name');
    if (types.indexOf(childType) !== -1) {
      result.push(child);
    }
  });
  return result;
}

/*
 * Return the first matched child by type, return null otherwise.
 * `type` must be a React.ComponentType
 */
function findChildByType(children, type) {
  var result = findAllByType(children, type);
  return result && result[0];
}

/*
 * Create a new array of children excluding the ones matched the type
 */
var withoutType = function withoutType(children, type) {
  var newChildren = [];
  var types;
  if (_isArray(type)) {
    types = type.map(function (t) {
      return getDisplayName(t);
    });
  } else {
    types = [getDisplayName(type)];
  }
  toArray(children).forEach(function (child) {
    var displayName = _get(child, 'type.displayName');
    if (displayName && types.indexOf(displayName) !== -1) {
      return;
    }
    newChildren.push(child);
  });
  return newChildren;
};

/**
 * validate the width and height props of a chart element
 * @param  {Object} el A chart element
 * @return {Boolean}   true If the props width and height are number, and greater than 0
 */
var validateWidthHeight = function validateWidthHeight(el) {
  if (!el || !el.props) {
    return false;
  }
  var _el$props = el.props,
    width = _el$props.width,
    height = _el$props.height;
  if (!isNumber(width) || width <= 0 || !isNumber(height) || height <= 0) {
    return false;
  }
  return true;
};
var SVG_TAGS = ['a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', 'animateMotion', 'animateTransform', 'circle', 'clipPath', 'color-profile', 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColormatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter', 'font', 'font-face', 'font-face-format', 'font-face-name', 'font-face-url', 'foreignObject', 'g', 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'lineGradient', 'marker', 'mask', 'metadata', 'missing-glyph', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'set', 'stop', 'style', 'svg', 'switch', 'symbol', 'text', 'textPath', 'title', 'tref', 'tspan', 'use', 'view', 'vkern'];
var isSvgElement = function isSvgElement(child) {
  return child && child.type && isString_default()(child.type) && SVG_TAGS.indexOf(child.type) >= 0;
};
var isDotProps = function isDotProps(dot) {
  return dot && ReactUtils_typeof(dot) === 'object' && 'cx' in dot && 'cy' in dot && 'r' in dot;
};

/**
 * Checks if the property is valid to spread onto an SVG element or onto a specific component
 * @param {unknown} property property value currently being compared
 * @param {string} key property key currently being compared
 * @param {boolean} includeEvents if events are included in spreadable props
 * @param {boolean} svgElementType checks against map of SVG element types to attributes
 * @returns {boolean} is prop valid
 */
var isValidSpreadableProp = function isValidSpreadableProp(property, key, includeEvents, svgElementType) {
  var _FilteredElementKeyMa;
  /**
   * If the svg element type is explicitly included, check against the filtered element key map
   * to determine if there are attributes that should only exist on that element type.
   * @todo Add an internal cjs version of https://github.com/wooorm/svg-element-attributes for full coverage.
   */
  var matchingElementTypeKeys = (_FilteredElementKeyMa = FilteredElementKeyMap === null || FilteredElementKeyMap === void 0 ? void 0 : FilteredElementKeyMap[svgElementType]) !== null && _FilteredElementKeyMa !== void 0 ? _FilteredElementKeyMa : [];
  return !isFunction_default()(property) && (svgElementType && matchingElementTypeKeys.includes(key) || SVGElementPropKeys.includes(key)) || includeEvents && EventKeys.includes(key);
};

/**
 * Filter all the svg elements of children
 * @param  {Array} children The children of a react element
 * @return {Array}          All the svg elements
 */
var filterSvgElements = function filterSvgElements(children) {
  var svgElements = [];
  toArray(children).forEach(function (entry) {
    if (isSvgElement(entry)) {
      svgElements.push(entry);
    }
  });
  return svgElements;
};
var filterProps = function filterProps(props, includeEvents, svgElementType) {
  if (!props || typeof props === 'function' || typeof props === 'boolean') {
    return null;
  }
  var inputProps = props;
  if ( /*#__PURE__*/(0,react.isValidElement)(props)) {
    inputProps = props.props;
  }
  if (!isObject_default()(inputProps)) {
    return null;
  }
  var out = {};

  /**
   * Props are blindly spread onto SVG elements. This loop filters out properties that we don't want to spread.
   * Items filtered out are as follows:
   *   - functions in properties that are SVG attributes (functions are included when includeEvents is true)
   *   - props that are SVG attributes but don't matched the passed svgElementType
   *   - any prop that is not in SVGElementPropKeys (or in EventKeys if includeEvents is true)
   */
  Object.keys(inputProps).forEach(function (key) {
    var _inputProps;
    if (isValidSpreadableProp((_inputProps = inputProps) === null || _inputProps === void 0 ? void 0 : _inputProps[key], key, includeEvents, svgElementType)) {
      out[key] = inputProps[key];
    }
  });
  return out;
};

/**
 * Wether props of children changed
 * @param  {Object} nextChildren The latest children
 * @param  {Object} prevChildren The prev children
 * @return {Boolean}             equal or not
 */
var isChildrenEqual = function isChildrenEqual(nextChildren, prevChildren) {
  if (nextChildren === prevChildren) {
    return true;
  }
  var count = react.Children.count(nextChildren);
  if (count !== react.Children.count(prevChildren)) {
    return false;
  }
  if (count === 0) {
    return true;
  }
  if (count === 1) {
    // eslint-disable-next-line @typescript-eslint/no-use-before-define
    return isSingleChildEqual(isArray_default()(nextChildren) ? nextChildren[0] : nextChildren, isArray_default()(prevChildren) ? prevChildren[0] : prevChildren);
  }
  for (var i = 0; i < count; i++) {
    var nextChild = nextChildren[i];
    var prevChild = prevChildren[i];
    if (isArray_default()(nextChild) || isArray_default()(prevChild)) {
      if (!isChildrenEqual(nextChild, prevChild)) {
        return false;
      }
      // eslint-disable-next-line @typescript-eslint/no-use-before-define
    } else if (!isSingleChildEqual(nextChild, prevChild)) {
      return false;
    }
  }
  return true;
};
var isSingleChildEqual = function isSingleChildEqual(nextChild, prevChild) {
  if (isNil_default()(nextChild) && isNil_default()(prevChild)) {
    return true;
  }
  if (!isNil_default()(nextChild) && !isNil_default()(prevChild)) {
    var _ref = nextChild.props || {},
      nextChildren = _ref.children,
      nextProps = ReactUtils_objectWithoutProperties(_ref, ReactUtils_excluded);
    var _ref2 = prevChild.props || {},
      prevChildren = _ref2.children,
      prevProps = ReactUtils_objectWithoutProperties(_ref2, ReactUtils_excluded2);
    if (nextChildren && prevChildren) {
      return ShallowEqual_shallowEqual(nextProps, prevProps) && isChildrenEqual(nextChildren, prevChildren);
    }
    if (!nextChildren && !prevChildren) {
      return ShallowEqual_shallowEqual(nextProps, prevProps);
    }
    return false;
  }
  return false;
};
var renderByOrder = function renderByOrder(children, renderMap) {
  var elements = [];
  var record = {};
  toArray(children).forEach(function (child, index) {
    if (isSvgElement(child)) {
      elements.push(child);
    } else if (child) {
      var displayName = getDisplayName(child.type);
      var _ref3 = renderMap[displayName] || {},
        handler = _ref3.handler,
        once = _ref3.once;
      if (handler && (!once || !record[displayName])) {
        var results = handler(child, displayName, index);
        elements.push(results);
        record[displayName] = true;
      }
    }
  });
  return elements;
};
var getReactEventByType = function getReactEventByType(e) {
  var type = e && e.type;
  if (type && REACT_BROWSER_EVENT_MAP[type]) {
    return REACT_BROWSER_EVENT_MAP[type];
  }
  return null;
};
var parseChildIndex = function parseChildIndex(child, children) {
  return toArray(children).indexOf(child);
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/shape/Curve.js



function Curve_typeof(obj) { "@babel/helpers - typeof"; return Curve_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; }, Curve_typeof(obj); }
function Curve_extends() { Curve_extends = Object.assign ? Object.assign.bind() : 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 Curve_extends.apply(this, arguments); }
function Curve_ownKeys(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 Curve_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Curve_ownKeys(Object(source), !0).forEach(function (key) { Curve_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Curve_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Curve_defineProperty(obj, key, value) { key = Curve_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Curve_toPropertyKey(arg) { var key = Curve_toPrimitive(arg, "string"); return Curve_typeof(key) === "symbol" ? key : String(key); }
function Curve_toPrimitive(input, hint) { if (Curve_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Curve_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Curve
 */






var CURVE_FACTORIES = {
  curveBasisClosed: basisClosed,
  curveBasisOpen: basisOpen,
  curveBasis: basis,
  curveBumpX: bumpX,
  curveBumpY: bumpY,
  curveLinearClosed: linearClosed,
  curveLinear: linear,
  curveMonotoneX: monotoneX,
  curveMonotoneY: monotoneY,
  curveNatural: natural,
  curveStep: step,
  curveStepAfter: stepAfter,
  curveStepBefore: stepBefore
};
var defined = function defined(p) {
  return p.x === +p.x && p.y === +p.y;
};
var getX = function getX(p) {
  return p.x;
};
var getY = function getY(p) {
  return p.y;
};
var getCurveFactory = function getCurveFactory(type, layout) {
  if (isFunction_default()(type)) {
    return type;
  }
  var name = "curve".concat(upperFirst_default()(type));
  if ((name === 'curveMonotone' || name === 'curveBump') && layout) {
    return CURVE_FACTORIES["".concat(name).concat(layout === 'vertical' ? 'Y' : 'X')];
  }
  return CURVE_FACTORIES[name] || linear;
};
/**
 * Calculate the path of curve
 * @return {String} path
 */
var getPath = function getPath(_ref) {
  var _ref$type = _ref.type,
    type = _ref$type === void 0 ? 'linear' : _ref$type,
    _ref$points = _ref.points,
    points = _ref$points === void 0 ? [] : _ref$points,
    baseLine = _ref.baseLine,
    layout = _ref.layout,
    _ref$connectNulls = _ref.connectNulls,
    connectNulls = _ref$connectNulls === void 0 ? false : _ref$connectNulls;
  var curveFactory = getCurveFactory(type, layout);
  var formatPoints = connectNulls ? points.filter(function (entry) {
    return defined(entry);
  }) : points;
  var lineFunction;
  if (isArray_default()(baseLine)) {
    var formatBaseLine = connectNulls ? baseLine.filter(function (base) {
      return defined(base);
    }) : baseLine;
    var areaPoints = formatPoints.map(function (entry, index) {
      return Curve_objectSpread(Curve_objectSpread({}, entry), {}, {
        base: formatBaseLine[index]
      });
    });
    if (layout === 'vertical') {
      lineFunction = src_area().y(getY).x1(getX).x0(function (d) {
        return d.base.x;
      });
    } else {
      lineFunction = src_area().x(getX).y1(getY).y0(function (d) {
        return d.base.y;
      });
    }
    lineFunction.defined(defined).curve(curveFactory);
    return lineFunction(areaPoints);
  }
  if (layout === 'vertical' && isNumber(baseLine)) {
    lineFunction = src_area().y(getY).x1(getX).x0(baseLine);
  } else if (isNumber(baseLine)) {
    lineFunction = src_area().x(getX).y1(getY).y0(baseLine);
  } else {
    lineFunction = line().x(getX).y(getY);
  }
  lineFunction.defined(defined).curve(curveFactory);
  return lineFunction(formatPoints);
};
var Curve = function Curve(props) {
  var className = props.className,
    points = props.points,
    path = props.path,
    pathRef = props.pathRef;
  if ((!points || !points.length) && !path) {
    return null;
  }
  var realPath = points && points.length ? getPath(props) : path;
  return /*#__PURE__*/react.createElement("path", Curve_extends({}, filterProps(props), adaptEventHandlers(props), {
    className: classnames_default()('recharts-curve', className),
    d: realPath,
    ref: pathRef
  }));
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/shape/Dot.js
function Dot_extends() { Dot_extends = Object.assign ? Object.assign.bind() : 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 Dot_extends.apply(this, arguments); }
/**
 * @fileOverview Dot
 */




var Dot = function Dot(props) {
  var cx = props.cx,
    cy = props.cy,
    r = props.r,
    className = props.className;
  var layerClass = classnames_default()('recharts-dot', className);
  if (cx === +cx && cy === +cy && r === +r) {
    return /*#__PURE__*/react.createElement("circle", Dot_extends({}, filterProps(props), adaptEventHandlers(props), {
      className: layerClass,
      cx: cx,
      cy: cy,
      r: r
    }));
  }
  return null;
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/container/Layer.js
var Layer_excluded = ["children", "className"];
function Layer_extends() { Layer_extends = Object.assign ? Object.assign.bind() : 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 Layer_extends.apply(this, arguments); }
function Layer_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Layer_objectWithoutPropertiesLoose(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 Layer_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; }
/**
 * @fileOverview Layer
 */



var Layer = /*#__PURE__*/react.forwardRef(function (props, ref) {
  var children = props.children,
    className = props.className,
    others = Layer_objectWithoutProperties(props, Layer_excluded);
  var layerClass = classnames_default()('recharts-layer', className);
  return /*#__PURE__*/react.createElement("g", Layer_extends({
    className: layerClass
  }, filterProps(others, true), {
    ref: ref
  }), children);
});
// EXTERNAL MODULE: ./node_modules/lodash/last.js
var last = __webpack_require__(8090);
var last_default = /*#__PURE__*/__webpack_require__.n(last);
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/reduce-css-calc/dist/index.js
var dist = __webpack_require__(8618);
var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/Global.js
var parseIsSsrByDefault = function parseIsSsrByDefault() {
  return !(typeof window !== 'undefined' && window.document && window.document.createElement && window.setTimeout);
};
var Global = {
  isSsr: parseIsSsrByDefault(),
  get: function get(key) {
    return Global[key];
  },
  set: function set(key, value) {
    if (typeof key === 'string') {
      Global[key] = value;
    } else {
      var keys = Object.keys(key);
      if (keys && keys.length) {
        keys.forEach(function (k) {
          Global[k] = key[k];
        });
      }
    }
  }
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/DOMUtils.js
function DOMUtils_typeof(obj) { "@babel/helpers - typeof"; return DOMUtils_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; }, DOMUtils_typeof(obj); }
function DOMUtils_ownKeys(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 DOMUtils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? DOMUtils_ownKeys(Object(source), !0).forEach(function (key) { DOMUtils_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : DOMUtils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function DOMUtils_defineProperty(obj, key, value) { key = DOMUtils_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function DOMUtils_toPropertyKey(arg) { var key = DOMUtils_toPrimitive(arg, "string"); return DOMUtils_typeof(key) === "symbol" ? key : String(key); }
function DOMUtils_toPrimitive(input, hint) { if (DOMUtils_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (DOMUtils_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function DOMUtils_toConsumableArray(arr) { return DOMUtils_arrayWithoutHoles(arr) || DOMUtils_iterableToArray(arr) || DOMUtils_unsupportedIterableToArray(arr) || DOMUtils_nonIterableSpread(); }
function DOMUtils_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."); }
function DOMUtils_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return DOMUtils_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 DOMUtils_arrayLikeToArray(o, minLen); }
function DOMUtils_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function DOMUtils_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return DOMUtils_arrayLikeToArray(arr); }
function DOMUtils_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; }

var stringCache = {
  widthCache: {},
  cacheCount: 0
};
var MAX_CACHE_NUM = 2000;
var SPAN_STYLE = {
  position: 'absolute',
  top: '-20000px',
  left: 0,
  padding: 0,
  margin: 0,
  border: 'none',
  whiteSpace: 'pre'
};
var STYLE_LIST = ['minWidth', 'maxWidth', 'width', 'minHeight', 'maxHeight', 'height', 'top', 'left', 'fontSize', 'lineHeight', 'padding', 'margin', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom'];
var MEASUREMENT_SPAN_ID = 'recharts_measurement_span';
function autoCompleteStyle(name, value) {
  if (STYLE_LIST.indexOf(name) >= 0 && value === +value) {
    return "".concat(value, "px");
  }
  return value;
}
function camelToMiddleLine(text) {
  var strs = text.split('');
  var formatStrs = strs.reduce(function (result, entry) {
    if (entry === entry.toUpperCase()) {
      return [].concat(DOMUtils_toConsumableArray(result), ['-', entry.toLowerCase()]);
    }
    return [].concat(DOMUtils_toConsumableArray(result), [entry]);
  }, []);
  return formatStrs.join('');
}
var getStyleString = function getStyleString(style) {
  return Object.keys(style).reduce(function (result, s) {
    return "".concat(result).concat(camelToMiddleLine(s), ":").concat(autoCompleteStyle(s, style[s]), ";");
  }, '');
};
var getStringSize = function getStringSize(text) {
  var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  if (text === undefined || text === null || Global.isSsr) {
    return {
      width: 0,
      height: 0
    };
  }
  var str = "".concat(text);
  var styleString = getStyleString(style);
  var cacheKey = "".concat(str, "-").concat(styleString);
  if (stringCache.widthCache[cacheKey]) {
    return stringCache.widthCache[cacheKey];
  }
  try {
    var measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
    if (!measurementSpan) {
      measurementSpan = document.createElement('span');
      measurementSpan.setAttribute('id', MEASUREMENT_SPAN_ID);
      measurementSpan.setAttribute('aria-hidden', 'true');
      document.body.appendChild(measurementSpan);
    }
    // Need to use CSS Object Model (CSSOM) to be able to comply with Content Security Policy (CSP)
    // https://en.wikipedia.org/wiki/Content_Security_Policy
    var measurementSpanStyle = DOMUtils_objectSpread(DOMUtils_objectSpread({}, SPAN_STYLE), style);
    Object.keys(measurementSpanStyle).map(function (styleKey) {
      measurementSpan.style[styleKey] = measurementSpanStyle[styleKey];
      return styleKey;
    });
    measurementSpan.textContent = str;
    var rect = measurementSpan.getBoundingClientRect();
    var result = {
      width: rect.width,
      height: rect.height
    };
    stringCache.widthCache[cacheKey] = result;
    if (++stringCache.cacheCount > MAX_CACHE_NUM) {
      stringCache.cacheCount = 0;
      stringCache.widthCache = {};
    }
    return result;
  } catch (e) {
    return {
      width: 0,
      height: 0
    };
  }
};
var DOMUtils_getOffset = function getOffset(el) {
  var html = el.ownerDocument.documentElement;
  var box = {
    top: 0,
    left: 0
  };

  // If we don't have gBCR, just use 0,0 rather than error
  // BlackBerry 5, iOS 3 (original iPhone)
  if (typeof el.getBoundingClientRect !== 'undefined') {
    box = el.getBoundingClientRect();
  }
  return {
    top: box.top + window.pageYOffset - html.clientTop,
    left: box.left + window.pageXOffset - html.clientLeft
  };
};

/**
 * Calculate coordinate of cursor in chart
 * @param  {Object} event  Event object
 * @param  {Object} offset The offset of main part in the svg element
 * @return {Object}        {chartX, chartY}
 */
var calculateChartCoordinate = function calculateChartCoordinate(event, offset) {
  return {
    chartX: Math.round(event.pageX - offset.left),
    chartY: Math.round(event.pageY - offset.top)
  };
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/component/Text.js

var Text_excluded = ["x", "y", "lineHeight", "capHeight", "scaleToFit", "textAnchor", "verticalAnchor", "fill"],
  Text_excluded2 = ["dx", "dy", "angle", "className", "breakAll"];
function Text_extends() { Text_extends = Object.assign ? Object.assign.bind() : 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 Text_extends.apply(this, arguments); }
function Text_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Text_objectWithoutPropertiesLoose(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 Text_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; }
function Text_slicedToArray(arr, i) { return Text_arrayWithHoles(arr) || Text_iterableToArrayLimit(arr, i) || Text_unsupportedIterableToArray(arr, i) || Text_nonIterableRest(); }
function Text_nonIterableRest() { 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 Text_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Text_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 Text_arrayLikeToArray(o, minLen); }
function Text_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 Text_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function Text_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }







var BREAKING_SPACES = /[ \f\n\r\t\v\u2028\u2029]+/;
var calculateWordWidths = function calculateWordWidths(_ref) {
  var children = _ref.children,
    breakAll = _ref.breakAll,
    style = _ref.style;
  try {
    var words = [];
    if (!isNil_default()(children)) {
      if (breakAll) {
        words = children.toString().split('');
      } else {
        words = children.toString().split(BREAKING_SPACES);
      }
    }
    var wordsWithComputedWidth = words.map(function (word) {
      return {
        word: word,
        width: getStringSize(word, style).width
      };
    });
    var spaceWidth = breakAll ? 0 : getStringSize("\xA0", style).width;
    return {
      wordsWithComputedWidth: wordsWithComputedWidth,
      spaceWidth: spaceWidth
    };
  } catch (e) {
    return null;
  }
};
var calculateWordsByLines = function calculateWordsByLines(_ref2, initialWordsWithComputedWith, spaceWidth, lineWidth, scaleToFit) {
  var maxLines = _ref2.maxLines,
    children = _ref2.children,
    style = _ref2.style,
    breakAll = _ref2.breakAll;
  var shouldLimitLines = isNumber(maxLines);
  var text = children;
  var calculate = function calculate() {
    var words = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
    return words.reduce(function (result, _ref3) {
      var word = _ref3.word,
        width = _ref3.width;
      var currentLine = result[result.length - 1];
      if (currentLine && (lineWidth == null || scaleToFit || currentLine.width + width + spaceWidth < Number(lineWidth))) {
        // Word can be added to an existing line
        currentLine.words.push(word);
        currentLine.width += width + spaceWidth;
      } else {
        // Add first word to line or word is too long to scaleToFit on existing line
        var newLine = {
          words: [word],
          width: width
        };
        result.push(newLine);
      }
      return result;
    }, []);
  };
  var originalResult = calculate(initialWordsWithComputedWith);
  var findLongestLine = function findLongestLine(words) {
    return words.reduce(function (a, b) {
      return a.width > b.width ? a : b;
    });
  };
  if (!shouldLimitLines) {
    return originalResult;
  }
  var suffix = '…';
  var checkOverflow = function checkOverflow(index) {
    var tempText = text.slice(0, index);
    var words = calculateWordWidths({
      breakAll: breakAll,
      style: style,
      children: tempText + suffix
    }).wordsWithComputedWidth;
    var result = calculate(words);
    var doesOverflow = result.length > maxLines || findLongestLine(result).width > Number(lineWidth);
    return [doesOverflow, result];
  };
  var start = 0;
  var end = text.length - 1;
  var iterations = 0;
  var trimmedResult;
  while (start <= end && iterations <= text.length - 1) {
    var middle = Math.floor((start + end) / 2);
    var prev = middle - 1;
    var _checkOverflow = checkOverflow(prev),
      _checkOverflow2 = Text_slicedToArray(_checkOverflow, 2),
      doesPrevOverflow = _checkOverflow2[0],
      result = _checkOverflow2[1];
    var _checkOverflow3 = checkOverflow(middle),
      _checkOverflow4 = Text_slicedToArray(_checkOverflow3, 1),
      doesMiddleOverflow = _checkOverflow4[0];
    if (!doesPrevOverflow && !doesMiddleOverflow) {
      start = middle + 1;
    }
    if (doesPrevOverflow && doesMiddleOverflow) {
      end = middle - 1;
    }
    if (!doesPrevOverflow && doesMiddleOverflow) {
      trimmedResult = result;
      break;
    }
    iterations++;
  }

  // Fallback to originalResult (result without trimming) if we cannot find the
  // where to trim.  This should not happen :tm:
  return trimmedResult || originalResult;
};
var getWordsWithoutCalculate = function getWordsWithoutCalculate(children) {
  var words = !isNil_default()(children) ? children.toString().split(BREAKING_SPACES) : [];
  return [{
    words: words
  }];
};
var getWordsByLines = function getWordsByLines(_ref4) {
  var width = _ref4.width,
    scaleToFit = _ref4.scaleToFit,
    children = _ref4.children,
    style = _ref4.style,
    breakAll = _ref4.breakAll,
    maxLines = _ref4.maxLines;
  // Only perform calculations if using features that require them (multiline, scaleToFit)
  if ((width || scaleToFit) && !Global.isSsr) {
    var wordsWithComputedWidth, spaceWidth;
    var wordWidths = calculateWordWidths({
      breakAll: breakAll,
      children: children,
      style: style
    });
    if (wordWidths) {
      var wcw = wordWidths.wordsWithComputedWidth,
        sw = wordWidths.spaceWidth;
      wordsWithComputedWidth = wcw;
      spaceWidth = sw;
    } else {
      return getWordsWithoutCalculate(children);
    }
    return calculateWordsByLines({
      breakAll: breakAll,
      children: children,
      maxLines: maxLines,
      style: style
    }, wordsWithComputedWidth, spaceWidth, width, scaleToFit);
  }
  return getWordsWithoutCalculate(children);
};
var DEFAULT_FILL = '#808080';
var Text = function Text(_ref5) {
  var _ref5$x = _ref5.x,
    propsX = _ref5$x === void 0 ? 0 : _ref5$x,
    _ref5$y = _ref5.y,
    propsY = _ref5$y === void 0 ? 0 : _ref5$y,
    _ref5$lineHeight = _ref5.lineHeight,
    lineHeight = _ref5$lineHeight === void 0 ? '1em' : _ref5$lineHeight,
    _ref5$capHeight = _ref5.capHeight,
    capHeight = _ref5$capHeight === void 0 ? '0.71em' : _ref5$capHeight,
    _ref5$scaleToFit = _ref5.scaleToFit,
    scaleToFit = _ref5$scaleToFit === void 0 ? false : _ref5$scaleToFit,
    _ref5$textAnchor = _ref5.textAnchor,
    textAnchor = _ref5$textAnchor === void 0 ? 'start' : _ref5$textAnchor,
    _ref5$verticalAnchor = _ref5.verticalAnchor,
    verticalAnchor = _ref5$verticalAnchor === void 0 ? 'end' : _ref5$verticalAnchor,
    _ref5$fill = _ref5.fill,
    fill = _ref5$fill === void 0 ? DEFAULT_FILL : _ref5$fill,
    props = Text_objectWithoutProperties(_ref5, Text_excluded);
  var wordsByLines = (0,react.useMemo)(function () {
    return getWordsByLines({
      breakAll: props.breakAll,
      children: props.children,
      maxLines: props.maxLines,
      scaleToFit: scaleToFit,
      style: props.style,
      width: props.width
    });
  }, [props.breakAll, props.children, props.maxLines, scaleToFit, props.style, props.width]);
  var dx = props.dx,
    dy = props.dy,
    angle = props.angle,
    className = props.className,
    breakAll = props.breakAll,
    textProps = Text_objectWithoutProperties(props, Text_excluded2);
  if (!isNumOrStr(propsX) || !isNumOrStr(propsY)) {
    return null;
  }
  var x = propsX + (isNumber(dx) ? dx : 0);
  var y = propsY + (isNumber(dy) ? dy : 0);
  var startDy;
  switch (verticalAnchor) {
    case 'start':
      startDy = dist_default()("calc(".concat(capHeight, ")"));
      break;
    case 'middle':
      startDy = dist_default()("calc(".concat((wordsByLines.length - 1) / 2, " * -").concat(lineHeight, " + (").concat(capHeight, " / 2))"));
      break;
    default:
      startDy = dist_default()("calc(".concat(wordsByLines.length - 1, " * -").concat(lineHeight, ")"));
      break;
  }
  var transforms = [];
  if (scaleToFit) {
    var lineWidth = wordsByLines[0].width;
    var width = props.width;
    transforms.push("scale(".concat((isNumber(width) ? width / lineWidth : 1) / lineWidth, ")"));
  }
  if (angle) {
    transforms.push("rotate(".concat(angle, ", ").concat(x, ", ").concat(y, ")"));
  }
  if (transforms.length) {
    textProps.transform = transforms.join(' ');
  }
  return /*#__PURE__*/react.createElement("text", Text_extends({}, filterProps(textProps, true), {
    x: x,
    y: y,
    className: classnames_default()('recharts-text', className),
    textAnchor: textAnchor,
    fill: fill.includes('url') ? DEFAULT_FILL : fill
  }), wordsByLines.map(function (line, index) {
    return (
      /*#__PURE__*/
      // eslint-disable-next-line react/no-array-index-key
      react.createElement("tspan", {
        x: x,
        dy: index === 0 ? startDy : lineHeight,
        key: index
      }, line.words.join(breakAll ? '' : ' '))
    );
  }));
};
// EXTERNAL MODULE: ./node_modules/lodash/sortBy.js
var sortBy = __webpack_require__(3031);
var sortBy_default = /*#__PURE__*/__webpack_require__.n(sortBy);
// EXTERNAL MODULE: ./node_modules/lodash/max.js
var max = __webpack_require__(4506);
var max_default = /*#__PURE__*/__webpack_require__.n(max);
// EXTERNAL MODULE: ./node_modules/lodash/min.js
var min = __webpack_require__(1684);
var min_default = /*#__PURE__*/__webpack_require__.n(min);
// EXTERNAL MODULE: ./node_modules/lodash/flatMap.js
var flatMap = __webpack_require__(7307);
var flatMap_default = /*#__PURE__*/__webpack_require__.n(flatMap);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/range.js
function range(start, stop, step) {
  start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;

  var i = -1,
      n = Math.max(0, Math.ceil((stop - start) / step)) | 0,
      range = new Array(n);

  while (++i < n) {
    range[i] = start + i * step;
  }

  return range;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/init.js
function initRange(domain, range) {
  switch (arguments.length) {
    case 0: break;
    case 1: this.range(domain); break;
    default: this.range(range).domain(domain); break;
  }
  return this;
}

function initInterpolator(domain, interpolator) {
  switch (arguments.length) {
    case 0: break;
    case 1: {
      if (typeof domain === "function") this.interpolator(domain);
      else this.range(domain);
      break;
    }
    default: {
      this.domain(domain);
      if (typeof interpolator === "function") this.interpolator(interpolator);
      else this.range(interpolator);
      break;
    }
  }
  return this;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/internmap/src/index.js
class InternMap extends Map {
  constructor(entries, key = keyof) {
    super();
    Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});
    if (entries != null) for (const [key, value] of entries) this.set(key, value);
  }
  get(key) {
    return super.get(intern_get(this, key));
  }
  has(key) {
    return super.has(intern_get(this, key));
  }
  set(key, value) {
    return super.set(intern_set(this, key), value);
  }
  delete(key) {
    return super.delete(intern_delete(this, key));
  }
}

class InternSet extends Set {
  constructor(values, key = keyof) {
    super();
    Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});
    if (values != null) for (const value of values) this.add(value);
  }
  has(value) {
    return super.has(intern_get(this, value));
  }
  add(value) {
    return super.add(intern_set(this, value));
  }
  delete(value) {
    return super.delete(intern_delete(this, value));
  }
}

function intern_get({_intern, _key}, value) {
  const key = _key(value);
  return _intern.has(key) ? _intern.get(key) : value;
}

function intern_set({_intern, _key}, value) {
  const key = _key(value);
  if (_intern.has(key)) return _intern.get(key);
  _intern.set(key, value);
  return value;
}

function intern_delete({_intern, _key}, value) {
  const key = _key(value);
  if (_intern.has(key)) {
    value = _intern.get(key);
    _intern.delete(key);
  }
  return value;
}

function keyof(value) {
  return value !== null && typeof value === "object" ? value.valueOf() : value;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/ordinal.js



const implicit = Symbol("implicit");

function ordinal() {
  var index = new InternMap(),
      domain = [],
      range = [],
      unknown = implicit;

  function scale(d) {
    let i = index.get(d);
    if (i === undefined) {
      if (unknown !== implicit) return unknown;
      index.set(d, i = domain.push(d) - 1);
    }
    return range[i % range.length];
  }

  scale.domain = function(_) {
    if (!arguments.length) return domain.slice();
    domain = [], index = new InternMap();
    for (const value of _) {
      if (index.has(value)) continue;
      index.set(value, domain.push(value) - 1);
    }
    return scale;
  };

  scale.range = function(_) {
    return arguments.length ? (range = Array.from(_), scale) : range.slice();
  };

  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };

  scale.copy = function() {
    return ordinal(domain, range).unknown(unknown);
  };

  initRange.apply(scale, arguments);

  return scale;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/band.js




function band() {
  var scale = ordinal().unknown(undefined),
      domain = scale.domain,
      ordinalRange = scale.range,
      r0 = 0,
      r1 = 1,
      step,
      bandwidth,
      round = false,
      paddingInner = 0,
      paddingOuter = 0,
      align = 0.5;

  delete scale.unknown;

  function rescale() {
    var n = domain().length,
        reverse = r1 < r0,
        start = reverse ? r1 : r0,
        stop = reverse ? r0 : r1;
    step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
    if (round) step = Math.floor(step);
    start += (stop - start - step * (n - paddingInner)) * align;
    bandwidth = step * (1 - paddingInner);
    if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
    var values = range(n).map(function(i) { return start + step * i; });
    return ordinalRange(reverse ? values.reverse() : values);
  }

  scale.domain = function(_) {
    return arguments.length ? (domain(_), rescale()) : domain();
  };

  scale.range = function(_) {
    return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
  };

  scale.rangeRound = function(_) {
    return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
  };

  scale.bandwidth = function() {
    return bandwidth;
  };

  scale.step = function() {
    return step;
  };

  scale.round = function(_) {
    return arguments.length ? (round = !!_, rescale()) : round;
  };

  scale.padding = function(_) {
    return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
  };

  scale.paddingInner = function(_) {
    return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
  };

  scale.paddingOuter = function(_) {
    return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
  };

  scale.align = function(_) {
    return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
  };

  scale.copy = function() {
    return band(domain(), [r0, r1])
        .round(round)
        .paddingInner(paddingInner)
        .paddingOuter(paddingOuter)
        .align(align);
  };

  return initRange.apply(rescale(), arguments);
}

function pointish(scale) {
  var copy = scale.copy;

  scale.padding = scale.paddingOuter;
  delete scale.paddingInner;
  delete scale.paddingOuter;

  scale.copy = function() {
    return pointish(copy());
  };

  return scale;
}

function band_point() {
  return pointish(band.apply(null, arguments).paddingInner(1));
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/ticks.js
const e10 = Math.sqrt(50),
    e5 = Math.sqrt(10),
    e2 = Math.sqrt(2);

function tickSpec(start, stop, count) {
  const step = (stop - start) / Math.max(0, count),
      power = Math.floor(Math.log10(step)),
      error = step / Math.pow(10, power),
      factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
  let i1, i2, inc;
  if (power < 0) {
    inc = Math.pow(10, -power) / factor;
    i1 = Math.round(start * inc);
    i2 = Math.round(stop * inc);
    if (i1 / inc < start) ++i1;
    if (i2 / inc > stop) --i2;
    inc = -inc;
  } else {
    inc = Math.pow(10, power) * factor;
    i1 = Math.round(start / inc);
    i2 = Math.round(stop / inc);
    if (i1 * inc < start) ++i1;
    if (i2 * inc > stop) --i2;
  }
  if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);
  return [i1, i2, inc];
}

function ticks(start, stop, count) {
  stop = +stop, start = +start, count = +count;
  if (!(count > 0)) return [];
  if (start === stop) return [start];
  const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);
  if (!(i2 >= i1)) return [];
  const n = i2 - i1 + 1, ticks = new Array(n);
  if (reverse) {
    if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;
    else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;
  } else {
    if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;
    else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;
  }
  return ticks;
}

function tickIncrement(start, stop, count) {
  stop = +stop, start = +start, count = +count;
  return tickSpec(start, stop, count)[2];
}

function tickStep(start, stop, count) {
  stop = +stop, start = +start, count = +count;
  const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);
  return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/ascending.js
function ascending(a, b) {
  return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/descending.js
function descending(a, b) {
  return a == null || b == null ? NaN
    : b < a ? -1
    : b > a ? 1
    : b >= a ? 0
    : NaN;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/bisector.js



function bisector(f) {
  let compare1, compare2, delta;

  // If an accessor is specified, promote it to a comparator. In this case we
  // can test whether the search value is (self-) comparable. We can’t do this
  // for a comparator (except for specific, known comparators) because we can’t
  // tell if the comparator is symmetric, and an asymmetric comparator can’t be
  // used to test whether a single value is comparable.
  if (f.length !== 2) {
    compare1 = ascending;
    compare2 = (d, x) => ascending(f(d), x);
    delta = (d, x) => f(d) - x;
  } else {
    compare1 = f === ascending || f === descending ? f : zero;
    compare2 = f;
    delta = f;
  }

  function left(a, x, lo = 0, hi = a.length) {
    if (lo < hi) {
      if (compare1(x, x) !== 0) return hi;
      do {
        const mid = (lo + hi) >>> 1;
        if (compare2(a[mid], x) < 0) lo = mid + 1;
        else hi = mid;
      } while (lo < hi);
    }
    return lo;
  }

  function right(a, x, lo = 0, hi = a.length) {
    if (lo < hi) {
      if (compare1(x, x) !== 0) return hi;
      do {
        const mid = (lo + hi) >>> 1;
        if (compare2(a[mid], x) <= 0) lo = mid + 1;
        else hi = mid;
      } while (lo < hi);
    }
    return lo;
  }

  function center(a, x, lo = 0, hi = a.length) {
    const i = left(a, x, lo, hi - 1);
    return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
  }

  return {left, center, right};
}

function zero() {
  return 0;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/number.js
function number_number(x) {
  return x === null ? NaN : +x;
}

function* numbers(values, valueof) {
  if (valueof === undefined) {
    for (let value of values) {
      if (value != null && (value = +value) >= value) {
        yield value;
      }
    }
  } else {
    let index = -1;
    for (let value of values) {
      if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
        yield value;
      }
    }
  }
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/bisect.js




const ascendingBisect = bisector(ascending);
const bisectRight = ascendingBisect.right;
const bisectLeft = ascendingBisect.left;
const bisectCenter = bisector(number_number).center;
/* harmony default export */ var bisect = (bisectRight);

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-color/src/define.js
/* harmony default export */ function src_define(constructor, factory, prototype) {
  constructor.prototype = factory.prototype = prototype;
  prototype.constructor = constructor;
}

function extend(parent, definition) {
  var prototype = Object.create(parent.prototype);
  for (var key in definition) prototype[key] = definition[key];
  return prototype;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-color/src/color.js


function color_Color() {}

var darker = 0.7;
var brighter = 1 / darker;

var reI = "\\s*([+-]?\\d+)\\s*",
    reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
    reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
    reHex = /^#([0-9a-f]{3,8})$/,
    reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`),
    reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`),
    reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`),
    reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`),
    reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`),
    reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);

var named = {
  aliceblue: 0xf0f8ff,
  antiquewhite: 0xfaebd7,
  aqua: 0x00ffff,
  aquamarine: 0x7fffd4,
  azure: 0xf0ffff,
  beige: 0xf5f5dc,
  bisque: 0xffe4c4,
  black: 0x000000,
  blanchedalmond: 0xffebcd,
  blue: 0x0000ff,
  blueviolet: 0x8a2be2,
  brown: 0xa52a2a,
  burlywood: 0xdeb887,
  cadetblue: 0x5f9ea0,
  chartreuse: 0x7fff00,
  chocolate: 0xd2691e,
  coral: 0xff7f50,
  cornflowerblue: 0x6495ed,
  cornsilk: 0xfff8dc,
  crimson: 0xdc143c,
  cyan: 0x00ffff,
  darkblue: 0x00008b,
  darkcyan: 0x008b8b,
  darkgoldenrod: 0xb8860b,
  darkgray: 0xa9a9a9,
  darkgreen: 0x006400,
  darkgrey: 0xa9a9a9,
  darkkhaki: 0xbdb76b,
  darkmagenta: 0x8b008b,
  darkolivegreen: 0x556b2f,
  darkorange: 0xff8c00,
  darkorchid: 0x9932cc,
  darkred: 0x8b0000,
  darksalmon: 0xe9967a,
  darkseagreen: 0x8fbc8f,
  darkslateblue: 0x483d8b,
  darkslategray: 0x2f4f4f,
  darkslategrey: 0x2f4f4f,
  darkturquoise: 0x00ced1,
  darkviolet: 0x9400d3,
  deeppink: 0xff1493,
  deepskyblue: 0x00bfff,
  dimgray: 0x696969,
  dimgrey: 0x696969,
  dodgerblue: 0x1e90ff,
  firebrick: 0xb22222,
  floralwhite: 0xfffaf0,
  forestgreen: 0x228b22,
  fuchsia: 0xff00ff,
  gainsboro: 0xdcdcdc,
  ghostwhite: 0xf8f8ff,
  gold: 0xffd700,
  goldenrod: 0xdaa520,
  gray: 0x808080,
  green: 0x008000,
  greenyellow: 0xadff2f,
  grey: 0x808080,
  honeydew: 0xf0fff0,
  hotpink: 0xff69b4,
  indianred: 0xcd5c5c,
  indigo: 0x4b0082,
  ivory: 0xfffff0,
  khaki: 0xf0e68c,
  lavender: 0xe6e6fa,
  lavenderblush: 0xfff0f5,
  lawngreen: 0x7cfc00,
  lemonchiffon: 0xfffacd,
  lightblue: 0xadd8e6,
  lightcoral: 0xf08080,
  lightcyan: 0xe0ffff,
  lightgoldenrodyellow: 0xfafad2,
  lightgray: 0xd3d3d3,
  lightgreen: 0x90ee90,
  lightgrey: 0xd3d3d3,
  lightpink: 0xffb6c1,
  lightsalmon: 0xffa07a,
  lightseagreen: 0x20b2aa,
  lightskyblue: 0x87cefa,
  lightslategray: 0x778899,
  lightslategrey: 0x778899,
  lightsteelblue: 0xb0c4de,
  lightyellow: 0xffffe0,
  lime: 0x00ff00,
  limegreen: 0x32cd32,
  linen: 0xfaf0e6,
  magenta: 0xff00ff,
  maroon: 0x800000,
  mediumaquamarine: 0x66cdaa,
  mediumblue: 0x0000cd,
  mediumorchid: 0xba55d3,
  mediumpurple: 0x9370db,
  mediumseagreen: 0x3cb371,
  mediumslateblue: 0x7b68ee,
  mediumspringgreen: 0x00fa9a,
  mediumturquoise: 0x48d1cc,
  mediumvioletred: 0xc71585,
  midnightblue: 0x191970,
  mintcream: 0xf5fffa,
  mistyrose: 0xffe4e1,
  moccasin: 0xffe4b5,
  navajowhite: 0xffdead,
  navy: 0x000080,
  oldlace: 0xfdf5e6,
  olive: 0x808000,
  olivedrab: 0x6b8e23,
  orange: 0xffa500,
  orangered: 0xff4500,
  orchid: 0xda70d6,
  palegoldenrod: 0xeee8aa,
  palegreen: 0x98fb98,
  paleturquoise: 0xafeeee,
  palevioletred: 0xdb7093,
  papayawhip: 0xffefd5,
  peachpuff: 0xffdab9,
  peru: 0xcd853f,
  pink: 0xffc0cb,
  plum: 0xdda0dd,
  powderblue: 0xb0e0e6,
  purple: 0x800080,
  rebeccapurple: 0x663399,
  red: 0xff0000,
  rosybrown: 0xbc8f8f,
  royalblue: 0x4169e1,
  saddlebrown: 0x8b4513,
  salmon: 0xfa8072,
  sandybrown: 0xf4a460,
  seagreen: 0x2e8b57,
  seashell: 0xfff5ee,
  sienna: 0xa0522d,
  silver: 0xc0c0c0,
  skyblue: 0x87ceeb,
  slateblue: 0x6a5acd,
  slategray: 0x708090,
  slategrey: 0x708090,
  snow: 0xfffafa,
  springgreen: 0x00ff7f,
  steelblue: 0x4682b4,
  tan: 0xd2b48c,
  teal: 0x008080,
  thistle: 0xd8bfd8,
  tomato: 0xff6347,
  turquoise: 0x40e0d0,
  violet: 0xee82ee,
  wheat: 0xf5deb3,
  white: 0xffffff,
  whitesmoke: 0xf5f5f5,
  yellow: 0xffff00,
  yellowgreen: 0x9acd32
};

src_define(color_Color, color, {
  copy(channels) {
    return Object.assign(new this.constructor, this, channels);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: color_formatHex, // Deprecated! Use color.formatHex.
  formatHex: color_formatHex,
  formatHex8: color_formatHex8,
  formatHsl: color_formatHsl,
  formatRgb: color_formatRgb,
  toString: color_formatRgb
});

function color_formatHex() {
  return this.rgb().formatHex();
}

function color_formatHex8() {
  return this.rgb().formatHex8();
}

function color_formatHsl() {
  return hslConvert(this).formatHsl();
}

function color_formatRgb() {
  return this.rgb().formatRgb();
}

function color(format) {
  var m, l;
  format = (format + "").trim().toLowerCase();
  return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
      : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
      : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
      : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
      : null) // invalid hex
      : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
      : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
      : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
      : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
      : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
      : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
      : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
      : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
      : null;
}

function rgbn(n) {
  return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
}

function rgba(r, g, b, a) {
  if (a <= 0) r = g = b = NaN;
  return new Rgb(r, g, b, a);
}

function rgbConvert(o) {
  if (!(o instanceof color_Color)) o = color(o);
  if (!o) return new Rgb;
  o = o.rgb();
  return new Rgb(o.r, o.g, o.b, o.opacity);
}

function color_rgb(r, g, b, opacity) {
  return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
}

function Rgb(r, g, b, opacity) {
  this.r = +r;
  this.g = +g;
  this.b = +b;
  this.opacity = +opacity;
}

src_define(Rgb, color_rgb, extend(color_Color, {
  brighter(k) {
    k = k == null ? brighter : Math.pow(brighter, k);
    return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
  },
  darker(k) {
    k = k == null ? darker : Math.pow(darker, k);
    return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
  },
  rgb() {
    return this;
  },
  clamp() {
    return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
  },
  displayable() {
    return (-0.5 <= this.r && this.r < 255.5)
        && (-0.5 <= this.g && this.g < 255.5)
        && (-0.5 <= this.b && this.b < 255.5)
        && (0 <= this.opacity && this.opacity <= 1);
  },
  hex: rgb_formatHex, // Deprecated! Use color.formatHex.
  formatHex: rgb_formatHex,
  formatHex8: rgb_formatHex8,
  formatRgb: rgb_formatRgb,
  toString: rgb_formatRgb
}));

function rgb_formatHex() {
  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
}

function rgb_formatHex8() {
  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}

function rgb_formatRgb() {
  const a = clampa(this.opacity);
  return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
}

function clampa(opacity) {
  return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
}

function clampi(value) {
  return Math.max(0, Math.min(255, Math.round(value) || 0));
}

function hex(value) {
  value = clampi(value);
  return (value < 16 ? "0" : "") + value.toString(16);
}

function hsla(h, s, l, a) {
  if (a <= 0) h = s = l = NaN;
  else if (l <= 0 || l >= 1) h = s = NaN;
  else if (s <= 0) h = NaN;
  return new Hsl(h, s, l, a);
}

function hslConvert(o) {
  if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
  if (!(o instanceof color_Color)) o = color(o);
  if (!o) return new Hsl;
  if (o instanceof Hsl) return o;
  o = o.rgb();
  var r = o.r / 255,
      g = o.g / 255,
      b = o.b / 255,
      min = Math.min(r, g, b),
      max = Math.max(r, g, b),
      h = NaN,
      s = max - min,
      l = (max + min) / 2;
  if (s) {
    if (r === max) h = (g - b) / s + (g < b) * 6;
    else if (g === max) h = (b - r) / s + 2;
    else h = (r - g) / s + 4;
    s /= l < 0.5 ? max + min : 2 - max - min;
    h *= 60;
  } else {
    s = l > 0 && l < 1 ? 0 : h;
  }
  return new Hsl(h, s, l, o.opacity);
}

function hsl(h, s, l, opacity) {
  return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
}

function Hsl(h, s, l, opacity) {
  this.h = +h;
  this.s = +s;
  this.l = +l;
  this.opacity = +opacity;
}

src_define(Hsl, hsl, extend(color_Color, {
  brighter(k) {
    k = k == null ? brighter : Math.pow(brighter, k);
    return new Hsl(this.h, this.s, this.l * k, this.opacity);
  },
  darker(k) {
    k = k == null ? darker : Math.pow(darker, k);
    return new Hsl(this.h, this.s, this.l * k, this.opacity);
  },
  rgb() {
    var h = this.h % 360 + (this.h < 0) * 360,
        s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
        l = this.l,
        m2 = l + (l < 0.5 ? l : 1 - l) * s,
        m1 = 2 * l - m2;
    return new Rgb(
      hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
      hsl2rgb(h, m1, m2),
      hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
      this.opacity
    );
  },
  clamp() {
    return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
  },
  displayable() {
    return (0 <= this.s && this.s <= 1 || isNaN(this.s))
        && (0 <= this.l && this.l <= 1)
        && (0 <= this.opacity && this.opacity <= 1);
  },
  formatHsl() {
    const a = clampa(this.opacity);
    return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
  }
}));

function clamph(value) {
  value = (value || 0) % 360;
  return value < 0 ? value + 360 : value;
}

function clampt(value) {
  return Math.max(0, Math.min(1, value || 0));
}

/* From FvD 13.37, CSS Color Module Level 3 */
function hsl2rgb(h, m1, m2) {
  return (h < 60 ? m1 + (m2 - m1) * h / 60
      : h < 180 ? m2
      : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
      : m1) * 255;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/basis.js
function basis_basis(t1, v0, v1, v2, v3) {
  var t2 = t1 * t1, t3 = t2 * t1;
  return ((1 - 3 * t1 + 3 * t2 - t3) * v0
      + (4 - 6 * t2 + 3 * t3) * v1
      + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2
      + t3 * v3) / 6;
}

/* harmony default export */ function src_basis(values) {
  var n = values.length - 1;
  return function(t) {
    var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
        v1 = values[i],
        v2 = values[i + 1],
        v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
        v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
    return basis_basis((t - i / n) * n, v0, v1, v2, v3);
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/basisClosed.js


/* harmony default export */ function src_basisClosed(values) {
  var n = values.length;
  return function(t) {
    var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
        v0 = values[(i + n - 1) % n],
        v1 = values[i % n],
        v2 = values[(i + 1) % n],
        v3 = values[(i + 2) % n];
    return basis_basis((t - i / n) * n, v0, v1, v2, v3);
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/constant.js
/* harmony default export */ var d3_interpolate_src_constant = (x => () => x);

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/color.js


function color_linear(a, d) {
  return function(t) {
    return a + t * d;
  };
}

function exponential(a, b, y) {
  return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
    return Math.pow(a + t * b, y);
  };
}

function hue(a, b) {
  var d = b - a;
  return d ? color_linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);
}

function gamma(y) {
  return (y = +y) === 1 ? nogamma : function(a, b) {
    return b - a ? exponential(a, b, y) : d3_interpolate_src_constant(isNaN(a) ? b : a);
  };
}

function nogamma(a, b) {
  var d = b - a;
  return d ? color_linear(a, d) : d3_interpolate_src_constant(isNaN(a) ? b : a);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/rgb.js





/* harmony default export */ var rgb = ((function rgbGamma(y) {
  var color = gamma(y);

  function rgb(start, end) {
    var r = color((start = color_rgb(start)).r, (end = color_rgb(end)).r),
        g = color(start.g, end.g),
        b = color(start.b, end.b),
        opacity = nogamma(start.opacity, end.opacity);
    return function(t) {
      start.r = r(t);
      start.g = g(t);
      start.b = b(t);
      start.opacity = opacity(t);
      return start + "";
    };
  }

  rgb.gamma = rgbGamma;

  return rgb;
})(1));

function rgbSpline(spline) {
  return function(colors) {
    var n = colors.length,
        r = new Array(n),
        g = new Array(n),
        b = new Array(n),
        i, color;
    for (i = 0; i < n; ++i) {
      color = color_rgb(colors[i]);
      r[i] = color.r || 0;
      g[i] = color.g || 0;
      b[i] = color.b || 0;
    }
    r = spline(r);
    g = spline(g);
    b = spline(b);
    color.opacity = 1;
    return function(t) {
      color.r = r(t);
      color.g = g(t);
      color.b = b(t);
      return color + "";
    };
  };
}

var rgbBasis = rgbSpline(src_basis);
var rgbBasisClosed = rgbSpline(src_basisClosed);

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/array.js



/* harmony default export */ function src_array(a, b) {
  return (isNumberArray(b) ? numberArray : genericArray)(a, b);
}

function genericArray(a, b) {
  var nb = b ? b.length : 0,
      na = a ? Math.min(nb, a.length) : 0,
      x = new Array(na),
      c = new Array(nb),
      i;

  for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);
  for (; i < nb; ++i) c[i] = b[i];

  return function(t) {
    for (i = 0; i < na; ++i) c[i] = x[i](t);
    return c;
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/date.js
/* harmony default export */ function date(a, b) {
  var d = new Date;
  return a = +a, b = +b, function(t) {
    return d.setTime(a * (1 - t) + b * t), d;
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/number.js
/* harmony default export */ function src_number(a, b) {
  return a = +a, b = +b, function(t) {
    return a * (1 - t) + b * t;
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/object.js


/* harmony default export */ function object(a, b) {
  var i = {},
      c = {},
      k;

  if (a === null || typeof a !== "object") a = {};
  if (b === null || typeof b !== "object") b = {};

  for (k in b) {
    if (k in a) {
      i[k] = value(a[k], b[k]);
    } else {
      c[k] = b[k];
    }
  }

  return function(t) {
    for (k in i) c[k] = i[k](t);
    return c;
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/string.js


var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
    reB = new RegExp(reA.source, "g");

function string_zero(b) {
  return function() {
    return b;
  };
}

function one(b) {
  return function(t) {
    return b(t) + "";
  };
}

/* harmony default export */ function string(a, b) {
  var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
      am, // current match in a
      bm, // current match in b
      bs, // string preceding current number in b, if any
      i = -1, // index in s
      s = [], // string constants and placeholders
      q = []; // number interpolators

  // Coerce inputs to strings.
  a = a + "", b = b + "";

  // Interpolate pairs of numbers in a & b.
  while ((am = reA.exec(a))
      && (bm = reB.exec(b))) {
    if ((bs = bm.index) > bi) { // a string precedes the next number in b
      bs = b.slice(bi, bs);
      if (s[i]) s[i] += bs; // coalesce with previous string
      else s[++i] = bs;
    }
    if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
      if (s[i]) s[i] += bm; // coalesce with previous string
      else s[++i] = bm;
    } else { // interpolate non-matching numbers
      s[++i] = null;
      q.push({i: i, x: src_number(am, bm)});
    }
    bi = reB.lastIndex;
  }

  // Add remains of b.
  if (bi < b.length) {
    bs = b.slice(bi);
    if (s[i]) s[i] += bs; // coalesce with previous string
    else s[++i] = bs;
  }

  // Special optimization for only a single match.
  // Otherwise, interpolate each of the numbers and rejoin the string.
  return s.length < 2 ? (q[0]
      ? one(q[0].x)
      : string_zero(b))
      : (b = q.length, function(t) {
          for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
          return s.join("");
        });
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/numberArray.js
/* harmony default export */ function src_numberArray(a, b) {
  if (!b) b = [];
  var n = a ? Math.min(b.length, a.length) : 0,
      c = b.slice(),
      i;
  return function(t) {
    for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
    return c;
  };
}

function numberArray_isNumberArray(x) {
  return ArrayBuffer.isView(x) && !(x instanceof DataView);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/value.js










/* harmony default export */ function value(a, b) {
  var t = typeof b, c;
  return b == null || t === "boolean" ? d3_interpolate_src_constant(b)
      : (t === "number" ? src_number
      : t === "string" ? ((c = color(b)) ? (b = c, rgb) : string)
      : b instanceof color ? rgb
      : b instanceof Date ? date
      : numberArray_isNumberArray(b) ? src_numberArray
      : Array.isArray(b) ? genericArray
      : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
      : src_number)(a, b);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/round.js
/* harmony default export */ function src_round(a, b) {
  return a = +a, b = +b, function(t) {
    return Math.round(a * (1 - t) + b * t);
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/constant.js
function constants(x) {
  return function() {
    return x;
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/number.js
function src_number_number(x) {
  return +x;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/continuous.js





var unit = [0, 1];

function continuous_identity(x) {
  return x;
}

function normalize(a, b) {
  return (b -= (a = +a))
      ? function(x) { return (x - a) / b; }
      : constants(isNaN(b) ? NaN : 0.5);
}

function clamper(a, b) {
  var t;
  if (a > b) t = a, a = b, b = t;
  return function(x) { return Math.max(a, Math.min(b, x)); };
}

// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
function bimap(domain, range, interpolate) {
  var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
  if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
  else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
  return function(x) { return r0(d0(x)); };
}

function polymap(domain, range, interpolate) {
  var j = Math.min(domain.length, range.length) - 1,
      d = new Array(j),
      r = new Array(j),
      i = -1;

  // Reverse descending domains.
  if (domain[j] < domain[0]) {
    domain = domain.slice().reverse();
    range = range.slice().reverse();
  }

  while (++i < j) {
    d[i] = normalize(domain[i], domain[i + 1]);
    r[i] = interpolate(range[i], range[i + 1]);
  }

  return function(x) {
    var i = bisect(domain, x, 1, j) - 1;
    return r[i](d[i](x));
  };
}

function src_copy(source, target) {
  return target
      .domain(source.domain())
      .range(source.range())
      .interpolate(source.interpolate())
      .clamp(source.clamp())
      .unknown(source.unknown());
}

function transformer() {
  var domain = unit,
      range = unit,
      interpolate = value,
      transform,
      untransform,
      unknown,
      clamp = continuous_identity,
      piecewise,
      output,
      input;

  function rescale() {
    var n = Math.min(domain.length, range.length);
    if (clamp !== continuous_identity) clamp = clamper(domain[0], domain[n - 1]);
    piecewise = n > 2 ? polymap : bimap;
    output = input = null;
    return scale;
  }

  function scale(x) {
    return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));
  }

  scale.invert = function(y) {
    return clamp(untransform((input || (input = piecewise(range, domain.map(transform), src_number)))(y)));
  };

  scale.domain = function(_) {
    return arguments.length ? (domain = Array.from(_, src_number_number), rescale()) : domain.slice();
  };

  scale.range = function(_) {
    return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
  };

  scale.rangeRound = function(_) {
    return range = Array.from(_), interpolate = src_round, rescale();
  };

  scale.clamp = function(_) {
    return arguments.length ? (clamp = _ ? true : continuous_identity, rescale()) : clamp !== continuous_identity;
  };

  scale.interpolate = function(_) {
    return arguments.length ? (interpolate = _, rescale()) : interpolate;
  };

  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };

  return function(t, u) {
    transform = t, untransform = u;
    return rescale();
  };
}

function continuous() {
  return transformer()(continuous_identity, continuous_identity);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/formatSpecifier.js
// [[fill]align][sign][symbol][0][width][,][.precision][~][type]
var formatSpecifier_re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;

function formatSpecifier(specifier) {
  if (!(match = formatSpecifier_re.exec(specifier))) throw new Error("invalid format: " + specifier);
  var match;
  return new FormatSpecifier({
    fill: match[1],
    align: match[2],
    sign: match[3],
    symbol: match[4],
    zero: match[5],
    width: match[6],
    comma: match[7],
    precision: match[8] && match[8].slice(1),
    trim: match[9],
    type: match[10]
  });
}

formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof

function FormatSpecifier(specifier) {
  this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
  this.align = specifier.align === undefined ? ">" : specifier.align + "";
  this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
  this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
  this.zero = !!specifier.zero;
  this.width = specifier.width === undefined ? undefined : +specifier.width;
  this.comma = !!specifier.comma;
  this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
  this.trim = !!specifier.trim;
  this.type = specifier.type === undefined ? "" : specifier.type + "";
}

FormatSpecifier.prototype.toString = function() {
  return this.fill
      + this.align
      + this.sign
      + this.symbol
      + (this.zero ? "0" : "")
      + (this.width === undefined ? "" : Math.max(1, this.width | 0))
      + (this.comma ? "," : "")
      + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0))
      + (this.trim ? "~" : "")
      + this.type;
};

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/formatDecimal.js
/* harmony default export */ function formatDecimal(x) {
  return Math.abs(x = Math.round(x)) >= 1e21
      ? x.toLocaleString("en").replace(/,/g, "")
      : x.toString(10);
}

// Computes the decimal coefficient and exponent of the specified number x with
// significant digits p, where x is positive and p is in [1, 21] or undefined.
// For example, formatDecimalParts(1.23) returns ["123", 0].
function formatDecimalParts(x, p) {
  if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
  var i, coefficient = x.slice(0, i);

  // The string returned by toExponential either has the form \d\.\d+e[-+]\d+
  // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
  return [
    coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
    +x.slice(i + 1)
  ];
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/exponent.js


/* harmony default export */ function exponent(x) {
  return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/precisionPrefix.js


/* harmony default export */ function precisionPrefix(step, value) {
  return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/formatGroup.js
/* harmony default export */ function formatGroup(grouping, thousands) {
  return function(value, width) {
    var i = value.length,
        t = [],
        j = 0,
        g = grouping[0],
        length = 0;

    while (i > 0 && g > 0) {
      if (length + g + 1 > width) g = Math.max(1, width - length);
      t.push(value.substring(i -= g, i + g));
      if ((length += g + 1) > width) break;
      g = grouping[j = (j + 1) % grouping.length];
    }

    return t.reverse().join(thousands);
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/formatNumerals.js
/* harmony default export */ function formatNumerals(numerals) {
  return function(value) {
    return value.replace(/[0-9]/g, function(i) {
      return numerals[+i];
    });
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/formatTrim.js
// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
/* harmony default export */ function formatTrim(s) {
  out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
    switch (s[i]) {
      case ".": i0 = i1 = i; break;
      case "0": if (i0 === 0) i0 = i; i1 = i; break;
      default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;
    }
  }
  return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/formatPrefixAuto.js


var prefixExponent;

/* harmony default export */ function formatPrefixAuto(x, p) {
  var d = formatDecimalParts(x, p);
  if (!d) return x + "";
  var coefficient = d[0],
      exponent = d[1],
      i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
      n = coefficient.length;
  return i === n ? coefficient
      : i > n ? coefficient + new Array(i - n + 1).join("0")
      : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
      : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/formatRounded.js


/* harmony default export */ function formatRounded(x, p) {
  var d = formatDecimalParts(x, p);
  if (!d) return x + "";
  var coefficient = d[0],
      exponent = d[1];
  return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
      : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
      : coefficient + new Array(exponent - coefficient.length + 2).join("0");
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/formatTypes.js




/* harmony default export */ var formatTypes = ({
  "%": (x, p) => (x * 100).toFixed(p),
  "b": (x) => Math.round(x).toString(2),
  "c": (x) => x + "",
  "d": formatDecimal,
  "e": (x, p) => x.toExponential(p),
  "f": (x, p) => x.toFixed(p),
  "g": (x, p) => x.toPrecision(p),
  "o": (x) => Math.round(x).toString(8),
  "p": (x, p) => formatRounded(x * 100, p),
  "r": formatRounded,
  "s": formatPrefixAuto,
  "X": (x) => Math.round(x).toString(16).toUpperCase(),
  "x": (x) => Math.round(x).toString(16)
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/identity.js
/* harmony default export */ function src_identity(x) {
  return x;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/locale.js









var locale_map = Array.prototype.map,
    prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];

/* harmony default export */ function locale(locale) {
  var group = locale.grouping === undefined || locale.thousands === undefined ? src_identity : formatGroup(locale_map.call(locale.grouping, Number), locale.thousands + ""),
      currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
      currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
      decimal = locale.decimal === undefined ? "." : locale.decimal + "",
      numerals = locale.numerals === undefined ? src_identity : formatNumerals(locale_map.call(locale.numerals, String)),
      percent = locale.percent === undefined ? "%" : locale.percent + "",
      minus = locale.minus === undefined ? "−" : locale.minus + "",
      nan = locale.nan === undefined ? "NaN" : locale.nan + "";

  function newFormat(specifier) {
    specifier = formatSpecifier(specifier);

    var fill = specifier.fill,
        align = specifier.align,
        sign = specifier.sign,
        symbol = specifier.symbol,
        zero = specifier.zero,
        width = specifier.width,
        comma = specifier.comma,
        precision = specifier.precision,
        trim = specifier.trim,
        type = specifier.type;

    // The "n" type is an alias for ",g".
    if (type === "n") comma = true, type = "g";

    // The "" type, and any invalid type, is an alias for ".12~g".
    else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g";

    // If zero fill is specified, padding goes after sign and before digits.
    if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";

    // Compute the prefix and suffix.
    // For SI-prefix, the suffix is lazily computed.
    var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
        suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";

    // What format function should we use?
    // Is this an integer type?
    // Can this type generate exponential notation?
    var formatType = formatTypes[type],
        maybeSuffix = /[defgprs%]/.test(type);

    // Set the default precision if not specified,
    // or clamp the specified precision to the supported range.
    // For significant precision, it must be in [1, 21].
    // For fixed precision, it must be in [0, 20].
    precision = precision === undefined ? 6
        : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
        : Math.max(0, Math.min(20, precision));

    function format(value) {
      var valuePrefix = prefix,
          valueSuffix = suffix,
          i, n, c;

      if (type === "c") {
        valueSuffix = formatType(value) + valueSuffix;
        value = "";
      } else {
        value = +value;

        // Determine the sign. -0 is not less than 0, but 1 / -0 is!
        var valueNegative = value < 0 || 1 / value < 0;

        // Perform the initial formatting.
        value = isNaN(value) ? nan : formatType(Math.abs(value), precision);

        // Trim insignificant zeros.
        if (trim) value = formatTrim(value);

        // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.
        if (valueNegative && +value === 0 && sign !== "+") valueNegative = false;

        // Compute the prefix and suffix.
        valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
        valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");

        // Break the formatted value into the integer “value” part that can be
        // grouped, and fractional or exponential “suffix” part that is not.
        if (maybeSuffix) {
          i = -1, n = value.length;
          while (++i < n) {
            if (c = value.charCodeAt(i), 48 > c || c > 57) {
              valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
              value = value.slice(0, i);
              break;
            }
          }
        }
      }

      // If the fill character is not "0", grouping is applied before padding.
      if (comma && !zero) value = group(value, Infinity);

      // Compute the padding.
      var length = valuePrefix.length + value.length + valueSuffix.length,
          padding = length < width ? new Array(width - length + 1).join(fill) : "";

      // If the fill character is "0", grouping is applied after padding.
      if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";

      // Reconstruct the final output based on the desired alignment.
      switch (align) {
        case "<": value = valuePrefix + value + valueSuffix + padding; break;
        case "=": value = valuePrefix + padding + value + valueSuffix; break;
        case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;
        default: value = padding + valuePrefix + value + valueSuffix; break;
      }

      return numerals(value);
    }

    format.toString = function() {
      return specifier + "";
    };

    return format;
  }

  function formatPrefix(specifier, value) {
    var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
        e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
        k = Math.pow(10, -e),
        prefix = prefixes[8 + e / 3];
    return function(value) {
      return f(k * value) + prefix;
    };
  }

  return {
    format: newFormat,
    formatPrefix: formatPrefix
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/defaultLocale.js


var defaultLocale_locale;
var format;
var formatPrefix;

defaultLocale({
  thousands: ",",
  grouping: [3],
  currency: ["$", ""]
});

function defaultLocale(definition) {
  defaultLocale_locale = locale(definition);
  format = defaultLocale_locale.format;
  formatPrefix = defaultLocale_locale.formatPrefix;
  return defaultLocale_locale;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/precisionRound.js


/* harmony default export */ function precisionRound(step, max) {
  step = Math.abs(step), max = Math.abs(max) - step;
  return Math.max(0, exponent(max) - exponent(step)) + 1;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-format/src/precisionFixed.js


/* harmony default export */ function precisionFixed(step) {
  return Math.max(0, -exponent(Math.abs(step)));
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/tickFormat.js



function tickFormat(start, stop, count, specifier) {
  var step = tickStep(start, stop, count),
      precision;
  specifier = formatSpecifier(specifier == null ? ",f" : specifier);
  switch (specifier.type) {
    case "s": {
      var value = Math.max(Math.abs(start), Math.abs(stop));
      if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
      return formatPrefix(specifier, value);
    }
    case "":
    case "e":
    case "g":
    case "p":
    case "r": {
      if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
      break;
    }
    case "f":
    case "%": {
      if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
      break;
    }
  }
  return format(specifier);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/linear.js





function linearish(scale) {
  var domain = scale.domain;

  scale.ticks = function(count) {
    var d = domain();
    return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
  };

  scale.tickFormat = function(count, specifier) {
    var d = domain();
    return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
  };

  scale.nice = function(count) {
    if (count == null) count = 10;

    var d = domain();
    var i0 = 0;
    var i1 = d.length - 1;
    var start = d[i0];
    var stop = d[i1];
    var prestep;
    var step;
    var maxIter = 10;

    if (stop < start) {
      step = start, start = stop, stop = step;
      step = i0, i0 = i1, i1 = step;
    }
    
    while (maxIter-- > 0) {
      step = tickIncrement(start, stop, count);
      if (step === prestep) {
        d[i0] = start
        d[i1] = stop
        return domain(d);
      } else if (step > 0) {
        start = Math.floor(start / step) * step;
        stop = Math.ceil(stop / step) * step;
      } else if (step < 0) {
        start = Math.ceil(start * step) / step;
        stop = Math.floor(stop * step) / step;
      } else {
        break;
      }
      prestep = step;
    }

    return scale;
  };

  return scale;
}

function linear_linear() {
  var scale = continuous();

  scale.copy = function() {
    return src_copy(scale, linear_linear());
  };

  initRange.apply(scale, arguments);

  return linearish(scale);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/identity.js



function identity_identity(domain) {
  var unknown;

  function scale(x) {
    return x == null || isNaN(x = +x) ? unknown : x;
  }

  scale.invert = scale;

  scale.domain = scale.range = function(_) {
    return arguments.length ? (domain = Array.from(_, src_number_number), scale) : domain.slice();
  };

  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };

  scale.copy = function() {
    return identity_identity(domain).unknown(unknown);
  };

  domain = arguments.length ? Array.from(domain, src_number_number) : [0, 1];

  return linearish(scale);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/nice.js
function nice(domain, interval) {
  domain = domain.slice();

  var i0 = 0,
      i1 = domain.length - 1,
      x0 = domain[i0],
      x1 = domain[i1],
      t;

  if (x1 < x0) {
    t = i0, i0 = i1, i1 = t;
    t = x0, x0 = x1, x1 = t;
  }

  domain[i0] = interval.floor(x0);
  domain[i1] = interval.ceil(x1);
  return domain;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/log.js






function transformLog(x) {
  return Math.log(x);
}

function transformExp(x) {
  return Math.exp(x);
}

function transformLogn(x) {
  return -Math.log(-x);
}

function transformExpn(x) {
  return -Math.exp(-x);
}

function pow10(x) {
  return isFinite(x) ? +("1e" + x) : x < 0 ? 0 : x;
}

function powp(base) {
  return base === 10 ? pow10
      : base === Math.E ? Math.exp
      : x => Math.pow(base, x);
}

function logp(base) {
  return base === Math.E ? Math.log
      : base === 10 && Math.log10
      || base === 2 && Math.log2
      || (base = Math.log(base), x => Math.log(x) / base);
}

function reflect(f) {
  return (x, k) => -f(-x, k);
}

function loggish(transform) {
  const scale = transform(transformLog, transformExp);
  const domain = scale.domain;
  let base = 10;
  let logs;
  let pows;

  function rescale() {
    logs = logp(base), pows = powp(base);
    if (domain()[0] < 0) {
      logs = reflect(logs), pows = reflect(pows);
      transform(transformLogn, transformExpn);
    } else {
      transform(transformLog, transformExp);
    }
    return scale;
  }

  scale.base = function(_) {
    return arguments.length ? (base = +_, rescale()) : base;
  };

  scale.domain = function(_) {
    return arguments.length ? (domain(_), rescale()) : domain();
  };

  scale.ticks = count => {
    const d = domain();
    let u = d[0];
    let v = d[d.length - 1];
    const r = v < u;

    if (r) ([u, v] = [v, u]);

    let i = logs(u);
    let j = logs(v);
    let k;
    let t;
    const n = count == null ? 10 : +count;
    let z = [];

    if (!(base % 1) && j - i < n) {
      i = Math.floor(i), j = Math.ceil(j);
      if (u > 0) for (; i <= j; ++i) {
        for (k = 1; k < base; ++k) {
          t = i < 0 ? k / pows(-i) : k * pows(i);
          if (t < u) continue;
          if (t > v) break;
          z.push(t);
        }
      } else for (; i <= j; ++i) {
        for (k = base - 1; k >= 1; --k) {
          t = i > 0 ? k / pows(-i) : k * pows(i);
          if (t < u) continue;
          if (t > v) break;
          z.push(t);
        }
      }
      if (z.length * 2 < n) z = ticks(u, v, n);
    } else {
      z = ticks(i, j, Math.min(j - i, n)).map(pows);
    }
    return r ? z.reverse() : z;
  };

  scale.tickFormat = (count, specifier) => {
    if (count == null) count = 10;
    if (specifier == null) specifier = base === 10 ? "s" : ",";
    if (typeof specifier !== "function") {
      if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;
      specifier = format(specifier);
    }
    if (count === Infinity) return specifier;
    const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?
    return d => {
      let i = d / pows(Math.round(logs(d)));
      if (i * base < base - 0.5) i *= base;
      return i <= k ? specifier(d) : "";
    };
  };

  scale.nice = () => {
    return domain(nice(domain(), {
      floor: x => pows(Math.floor(logs(x))),
      ceil: x => pows(Math.ceil(logs(x)))
    }));
  };

  return scale;
}

function src_log_log() {
  const scale = loggish(transformer()).domain([1, 10]);
  scale.copy = () => src_copy(scale, src_log_log()).base(scale.base());
  initRange.apply(scale, arguments);
  return scale;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/symlog.js




function transformSymlog(c) {
  return function(x) {
    return Math.sign(x) * Math.log1p(Math.abs(x / c));
  };
}

function transformSymexp(c) {
  return function(x) {
    return Math.sign(x) * Math.expm1(Math.abs(x)) * c;
  };
}

function symlogish(transform) {
  var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));

  scale.constant = function(_) {
    return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;
  };

  return linearish(scale);
}

function symlog() {
  var scale = symlogish(transformer());

  scale.copy = function() {
    return src_copy(scale, symlog()).constant(scale.constant());
  };

  return initRange.apply(scale, arguments);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/pow.js




function transformPow(exponent) {
  return function(x) {
    return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
  };
}

function transformSqrt(x) {
  return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
}

function transformSquare(x) {
  return x < 0 ? -x * x : x * x;
}

function powish(transform) {
  var scale = transform(continuous_identity, continuous_identity),
      exponent = 1;

  function rescale() {
    return exponent === 1 ? transform(continuous_identity, continuous_identity)
        : exponent === 0.5 ? transform(transformSqrt, transformSquare)
        : transform(transformPow(exponent), transformPow(1 / exponent));
  }

  scale.exponent = function(_) {
    return arguments.length ? (exponent = +_, rescale()) : exponent;
  };

  return linearish(scale);
}

function pow() {
  var scale = powish(transformer());

  scale.copy = function() {
    return src_copy(scale, pow()).exponent(scale.exponent());
  };

  initRange.apply(scale, arguments);

  return scale;
}

function sqrt() {
  return pow.apply(null, arguments).exponent(0.5);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/radial.js





function square(x) {
  return Math.sign(x) * x * x;
}

function unsquare(x) {
  return Math.sign(x) * Math.sqrt(Math.abs(x));
}

function radial() {
  var squared = continuous(),
      range = [0, 1],
      round = false,
      unknown;

  function scale(x) {
    var y = unsquare(squared(x));
    return isNaN(y) ? unknown : round ? Math.round(y) : y;
  }

  scale.invert = function(y) {
    return squared.invert(square(y));
  };

  scale.domain = function(_) {
    return arguments.length ? (squared.domain(_), scale) : squared.domain();
  };

  scale.range = function(_) {
    return arguments.length ? (squared.range((range = Array.from(_, src_number_number)).map(square)), scale) : range.slice();
  };

  scale.rangeRound = function(_) {
    return scale.range(_).round(true);
  };

  scale.round = function(_) {
    return arguments.length ? (round = !!_, scale) : round;
  };

  scale.clamp = function(_) {
    return arguments.length ? (squared.clamp(_), scale) : squared.clamp();
  };

  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };

  scale.copy = function() {
    return radial(squared.domain(), range)
        .round(round)
        .clamp(squared.clamp())
        .unknown(unknown);
  };

  initRange.apply(scale, arguments);

  return linearish(scale);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/max.js
function max_max(values, valueof) {
  let max;
  if (valueof === undefined) {
    for (const value of values) {
      if (value != null
          && (max < value || (max === undefined && value >= value))) {
        max = value;
      }
    }
  } else {
    let index = -1;
    for (let value of values) {
      if ((value = valueof(value, ++index, values)) != null
          && (max < value || (max === undefined && value >= value))) {
        max = value;
      }
    }
  }
  return max;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/min.js
function min_min(values, valueof) {
  let min;
  if (valueof === undefined) {
    for (const value of values) {
      if (value != null
          && (min > value || (min === undefined && value >= value))) {
        min = value;
      }
    }
  } else {
    let index = -1;
    for (let value of values) {
      if ((value = valueof(value, ++index, values)) != null
          && (min > value || (min === undefined && value >= value))) {
        min = value;
      }
    }
  }
  return min;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/sort.js



function sort(values, ...F) {
  if (typeof values[Symbol.iterator] !== "function") throw new TypeError("values is not iterable");
  values = Array.from(values);
  let [f] = F;
  if ((f && f.length !== 2) || F.length > 1) {
    const index = Uint32Array.from(values, (d, i) => i);
    if (F.length > 1) {
      F = F.map(f => values.map(f));
      index.sort((i, j) => {
        for (const f of F) {
          const c = sort_ascendingDefined(f[i], f[j]);
          if (c) return c;
        }
      });
    } else {
      f = values.map(f);
      index.sort((i, j) => sort_ascendingDefined(f[i], f[j]));
    }
    return permute(values, index);
  }
  return values.sort(compareDefined(f));
}

function compareDefined(compare = ascending) {
  if (compare === ascending) return sort_ascendingDefined;
  if (typeof compare !== "function") throw new TypeError("compare is not a function");
  return (a, b) => {
    const x = compare(a, b);
    if (x || x === 0) return x;
    return (compare(b, b) === 0) - (compare(a, a) === 0);
  };
}

function sort_ascendingDefined(a, b) {
  return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/quickselect.js


// Based on https://github.com/mourner/quickselect
// ISC license, Copyright 2018 Vladimir Agafonkin.
function quickselect_quickselect(array, k, left = 0, right = Infinity, compare) {
  k = Math.floor(k);
  left = Math.floor(Math.max(0, left));
  right = Math.floor(Math.min(array.length - 1, right));

  if (!(left <= k && k <= right)) return array;

  compare = compare === undefined ? sort_ascendingDefined : compareDefined(compare);

  while (right > left) {
    if (right - left > 600) {
      const n = right - left + 1;
      const m = k - left + 1;
      const z = Math.log(n);
      const s = 0.5 * Math.exp(2 * z / 3);
      const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
      const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
      const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
      quickselect_quickselect(array, k, newLeft, newRight, compare);
    }

    const t = array[k];
    let i = left;
    let j = right;

    swap(array, left, k);
    if (compare(array[right], t) > 0) swap(array, left, right);

    while (i < j) {
      swap(array, i, j), ++i, --j;
      while (compare(array[i], t) < 0) ++i;
      while (compare(array[j], t) > 0) --j;
    }

    if (compare(array[left], t) === 0) swap(array, left, j);
    else ++j, swap(array, j, right);

    if (j <= k) left = j + 1;
    if (k <= j) right = j - 1;
  }

  return array;
}

function swap(array, i, j) {
  const t = array[i];
  array[i] = array[j];
  array[j] = t;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-array/src/quantile.js









function quantile(values, p, valueof) {
  values = Float64Array.from(numbers(values, valueof));
  if (!(n = values.length) || isNaN(p = +p)) return;
  if (p <= 0 || n < 2) return min_min(values);
  if (p >= 1) return max_max(values);
  var n,
      i = (n - 1) * p,
      i0 = Math.floor(i),
      value0 = max_max(quickselect_quickselect(values, i0).subarray(0, i0 + 1)),
      value1 = min_min(values.subarray(i0 + 1));
  return value0 + (value1 - value0) * (i - i0);
}

function quantileSorted(values, p, valueof = number_number) {
  if (!(n = values.length) || isNaN(p = +p)) return;
  if (p <= 0 || n < 2) return +valueof(values[0], 0, values);
  if (p >= 1) return +valueof(values[n - 1], n - 1, values);
  var n,
      i = (n - 1) * p,
      i0 = Math.floor(i),
      value0 = +valueof(values[i0], i0, values),
      value1 = +valueof(values[i0 + 1], i0 + 1, values);
  return value0 + (value1 - value0) * (i - i0);
}

function quantileIndex(values, p, valueof = number) {
  if (isNaN(p = +p)) return;
  numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));
  if (p <= 0) return minIndex(numbers);
  if (p >= 1) return maxIndex(numbers);
  var numbers,
      index = Uint32Array.from(values, (_, i) => i),
      j = numbers.length - 1,
      i = Math.floor(j * p);
  quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));
  i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);
  return i >= 0 ? i : -1;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/quantile.js



function quantile_quantile() {
  var domain = [],
      range = [],
      thresholds = [],
      unknown;

  function rescale() {
    var i = 0, n = Math.max(1, range.length);
    thresholds = new Array(n - 1);
    while (++i < n) thresholds[i - 1] = quantileSorted(domain, i / n);
    return scale;
  }

  function scale(x) {
    return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];
  }

  scale.invertExtent = function(y) {
    var i = range.indexOf(y);
    return i < 0 ? [NaN, NaN] : [
      i > 0 ? thresholds[i - 1] : domain[0],
      i < thresholds.length ? thresholds[i] : domain[domain.length - 1]
    ];
  };

  scale.domain = function(_) {
    if (!arguments.length) return domain.slice();
    domain = [];
    for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);
    domain.sort(ascending);
    return rescale();
  };

  scale.range = function(_) {
    return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
  };

  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };

  scale.quantiles = function() {
    return thresholds.slice();
  };

  scale.copy = function() {
    return quantile_quantile()
        .domain(domain)
        .range(range)
        .unknown(unknown);
  };

  return initRange.apply(scale, arguments);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/quantize.js




function quantize() {
  var x0 = 0,
      x1 = 1,
      n = 1,
      domain = [0.5],
      range = [0, 1],
      unknown;

  function scale(x) {
    return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;
  }

  function rescale() {
    var i = -1;
    domain = new Array(n);
    while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);
    return scale;
  }

  scale.domain = function(_) {
    return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];
  };

  scale.range = function(_) {
    return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();
  };

  scale.invertExtent = function(y) {
    var i = range.indexOf(y);
    return i < 0 ? [NaN, NaN]
        : i < 1 ? [x0, domain[0]]
        : i >= n ? [domain[n - 1], x1]
        : [domain[i - 1], domain[i]];
  };

  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : scale;
  };

  scale.thresholds = function() {
    return domain.slice();
  };

  scale.copy = function() {
    return quantize()
        .domain([x0, x1])
        .range(range)
        .unknown(unknown);
  };

  return initRange.apply(linearish(scale), arguments);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/threshold.js



function threshold() {
  var domain = [0.5],
      range = [0, 1],
      unknown,
      n = 1;

  function scale(x) {
    return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;
  }

  scale.domain = function(_) {
    return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();
  };

  scale.range = function(_) {
    return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();
  };

  scale.invertExtent = function(y) {
    var i = range.indexOf(y);
    return [domain[i - 1], domain[i]];
  };

  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };

  scale.copy = function() {
    return threshold()
        .domain(domain)
        .range(range)
        .unknown(unknown);
  };

  return initRange.apply(scale, arguments);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/duration.js
const durationSecond = 1000;
const durationMinute = durationSecond * 60;
const durationHour = durationMinute * 60;
const durationDay = durationHour * 24;
const durationWeek = durationDay * 7;
const durationMonth = durationDay * 30;
const durationYear = durationDay * 365;

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/interval.js
const t0 = new Date, t1 = new Date;

function timeInterval(floori, offseti, count, field) {

  function interval(date) {
    return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
  }

  interval.floor = (date) => {
    return floori(date = new Date(+date)), date;
  };

  interval.ceil = (date) => {
    return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
  };

  interval.round = (date) => {
    const d0 = interval(date), d1 = interval.ceil(date);
    return date - d0 < d1 - date ? d0 : d1;
  };

  interval.offset = (date, step) => {
    return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
  };

  interval.range = (start, stop, step) => {
    const range = [];
    start = interval.ceil(start);
    step = step == null ? 1 : Math.floor(step);
    if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
    let previous;
    do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
    while (previous < start && start < stop);
    return range;
  };

  interval.filter = (test) => {
    return timeInterval((date) => {
      if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
    }, (date, step) => {
      if (date >= date) {
        if (step < 0) while (++step <= 0) {
          while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
        } else while (--step >= 0) {
          while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
        }
      }
    });
  };

  if (count) {
    interval.count = (start, end) => {
      t0.setTime(+start), t1.setTime(+end);
      floori(t0), floori(t1);
      return Math.floor(count(t0, t1));
    };

    interval.every = (step) => {
      step = Math.floor(step);
      return !isFinite(step) || !(step > 0) ? null
          : !(step > 1) ? interval
          : interval.filter(field
              ? (d) => field(d) % step === 0
              : (d) => interval.count(0, d) % step === 0);
    };
  }

  return interval;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/millisecond.js


const millisecond = timeInterval(() => {
  // noop
}, (date, step) => {
  date.setTime(+date + step);
}, (start, end) => {
  return end - start;
});

// An optimized implementation for this simple case.
millisecond.every = (k) => {
  k = Math.floor(k);
  if (!isFinite(k) || !(k > 0)) return null;
  if (!(k > 1)) return millisecond;
  return timeInterval((date) => {
    date.setTime(Math.floor(date / k) * k);
  }, (date, step) => {
    date.setTime(+date + step * k);
  }, (start, end) => {
    return (end - start) / k;
  });
};

const milliseconds = millisecond.range;

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/second.js



const second = timeInterval((date) => {
  date.setTime(date - date.getMilliseconds());
}, (date, step) => {
  date.setTime(+date + step * durationSecond);
}, (start, end) => {
  return (end - start) / durationSecond;
}, (date) => {
  return date.getUTCSeconds();
});

const seconds = second.range;

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/minute.js



const timeMinute = timeInterval((date) => {
  date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
}, (date, step) => {
  date.setTime(+date + step * durationMinute);
}, (start, end) => {
  return (end - start) / durationMinute;
}, (date) => {
  return date.getMinutes();
});

const timeMinutes = timeMinute.range;

const utcMinute = timeInterval((date) => {
  date.setUTCSeconds(0, 0);
}, (date, step) => {
  date.setTime(+date + step * durationMinute);
}, (start, end) => {
  return (end - start) / durationMinute;
}, (date) => {
  return date.getUTCMinutes();
});

const utcMinutes = utcMinute.range;

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/hour.js



const timeHour = timeInterval((date) => {
  date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
}, (date, step) => {
  date.setTime(+date + step * durationHour);
}, (start, end) => {
  return (end - start) / durationHour;
}, (date) => {
  return date.getHours();
});

const timeHours = timeHour.range;

const utcHour = timeInterval((date) => {
  date.setUTCMinutes(0, 0, 0);
}, (date, step) => {
  date.setTime(+date + step * durationHour);
}, (start, end) => {
  return (end - start) / durationHour;
}, (date) => {
  return date.getUTCHours();
});

const utcHours = utcHour.range;

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/day.js



const timeDay = timeInterval(
  date => date.setHours(0, 0, 0, 0),
  (date, step) => date.setDate(date.getDate() + step),
  (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
  date => date.getDate() - 1
);

const timeDays = timeDay.range;

const utcDay = timeInterval((date) => {
  date.setUTCHours(0, 0, 0, 0);
}, (date, step) => {
  date.setUTCDate(date.getUTCDate() + step);
}, (start, end) => {
  return (end - start) / durationDay;
}, (date) => {
  return date.getUTCDate() - 1;
});

const utcDays = utcDay.range;

const unixDay = timeInterval((date) => {
  date.setUTCHours(0, 0, 0, 0);
}, (date, step) => {
  date.setUTCDate(date.getUTCDate() + step);
}, (start, end) => {
  return (end - start) / durationDay;
}, (date) => {
  return Math.floor(date / durationDay);
});

const unixDays = unixDay.range;

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/week.js



function timeWeekday(i) {
  return timeInterval((date) => {
    date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
    date.setHours(0, 0, 0, 0);
  }, (date, step) => {
    date.setDate(date.getDate() + step * 7);
  }, (start, end) => {
    return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
  });
}

const timeSunday = timeWeekday(0);
const timeMonday = timeWeekday(1);
const timeTuesday = timeWeekday(2);
const timeWednesday = timeWeekday(3);
const timeThursday = timeWeekday(4);
const timeFriday = timeWeekday(5);
const timeSaturday = timeWeekday(6);

const timeSundays = timeSunday.range;
const timeMondays = timeMonday.range;
const timeTuesdays = timeTuesday.range;
const timeWednesdays = timeWednesday.range;
const timeThursdays = timeThursday.range;
const timeFridays = timeFriday.range;
const timeSaturdays = timeSaturday.range;

function utcWeekday(i) {
  return timeInterval((date) => {
    date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
    date.setUTCHours(0, 0, 0, 0);
  }, (date, step) => {
    date.setUTCDate(date.getUTCDate() + step * 7);
  }, (start, end) => {
    return (end - start) / durationWeek;
  });
}

const utcSunday = utcWeekday(0);
const utcMonday = utcWeekday(1);
const utcTuesday = utcWeekday(2);
const utcWednesday = utcWeekday(3);
const utcThursday = utcWeekday(4);
const utcFriday = utcWeekday(5);
const utcSaturday = utcWeekday(6);

const utcSundays = utcSunday.range;
const utcMondays = utcMonday.range;
const utcTuesdays = utcTuesday.range;
const utcWednesdays = utcWednesday.range;
const utcThursdays = utcThursday.range;
const utcFridays = utcFriday.range;
const utcSaturdays = utcSaturday.range;

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/month.js


const timeMonth = timeInterval((date) => {
  date.setDate(1);
  date.setHours(0, 0, 0, 0);
}, (date, step) => {
  date.setMonth(date.getMonth() + step);
}, (start, end) => {
  return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
}, (date) => {
  return date.getMonth();
});

const timeMonths = timeMonth.range;

const utcMonth = timeInterval((date) => {
  date.setUTCDate(1);
  date.setUTCHours(0, 0, 0, 0);
}, (date, step) => {
  date.setUTCMonth(date.getUTCMonth() + step);
}, (start, end) => {
  return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
}, (date) => {
  return date.getUTCMonth();
});

const utcMonths = utcMonth.range;

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/year.js


const timeYear = timeInterval((date) => {
  date.setMonth(0, 1);
  date.setHours(0, 0, 0, 0);
}, (date, step) => {
  date.setFullYear(date.getFullYear() + step);
}, (start, end) => {
  return end.getFullYear() - start.getFullYear();
}, (date) => {
  return date.getFullYear();
});

// An optimized implementation for this simple case.
timeYear.every = (k) => {
  return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
    date.setFullYear(Math.floor(date.getFullYear() / k) * k);
    date.setMonth(0, 1);
    date.setHours(0, 0, 0, 0);
  }, (date, step) => {
    date.setFullYear(date.getFullYear() + step * k);
  });
};

const timeYears = timeYear.range;

const utcYear = timeInterval((date) => {
  date.setUTCMonth(0, 1);
  date.setUTCHours(0, 0, 0, 0);
}, (date, step) => {
  date.setUTCFullYear(date.getUTCFullYear() + step);
}, (start, end) => {
  return end.getUTCFullYear() - start.getUTCFullYear();
}, (date) => {
  return date.getUTCFullYear();
});

// An optimized implementation for this simple case.
utcYear.every = (k) => {
  return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
    date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
    date.setUTCMonth(0, 1);
    date.setUTCHours(0, 0, 0, 0);
  }, (date, step) => {
    date.setUTCFullYear(date.getUTCFullYear() + step * k);
  });
};

const utcYears = utcYear.range;

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time/src/ticks.js











function ticker(year, month, week, day, hour, minute) {

  const tickIntervals = [
    [second,  1,      durationSecond],
    [second,  5,  5 * durationSecond],
    [second, 15, 15 * durationSecond],
    [second, 30, 30 * durationSecond],
    [minute,  1,      durationMinute],
    [minute,  5,  5 * durationMinute],
    [minute, 15, 15 * durationMinute],
    [minute, 30, 30 * durationMinute],
    [  hour,  1,      durationHour  ],
    [  hour,  3,  3 * durationHour  ],
    [  hour,  6,  6 * durationHour  ],
    [  hour, 12, 12 * durationHour  ],
    [   day,  1,      durationDay   ],
    [   day,  2,  2 * durationDay   ],
    [  week,  1,      durationWeek  ],
    [ month,  1,      durationMonth ],
    [ month,  3,  3 * durationMonth ],
    [  year,  1,      durationYear  ]
  ];

  function ticks(start, stop, count) {
    const reverse = stop < start;
    if (reverse) [start, stop] = [stop, start];
    const interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count);
    const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop
    return reverse ? ticks.reverse() : ticks;
  }

  function tickInterval(start, stop, count) {
    const target = Math.abs(stop - start) / count;
    const i = bisector(([,, step]) => step).right(tickIntervals, target);
    if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));
    if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));
    const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
    return t.every(step);
  }

  return [ticks, tickInterval];
}

const [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);
const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);



;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time-format/src/locale.js


function localDate(d) {
  if (0 <= d.y && d.y < 100) {
    var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
    date.setFullYear(d.y);
    return date;
  }
  return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
}

function utcDate(d) {
  if (0 <= d.y && d.y < 100) {
    var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
    date.setUTCFullYear(d.y);
    return date;
  }
  return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
}

function newDate(y, m, d) {
  return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};
}

function formatLocale(locale) {
  var locale_dateTime = locale.dateTime,
      locale_date = locale.date,
      locale_time = locale.time,
      locale_periods = locale.periods,
      locale_weekdays = locale.days,
      locale_shortWeekdays = locale.shortDays,
      locale_months = locale.months,
      locale_shortMonths = locale.shortMonths;

  var periodRe = formatRe(locale_periods),
      periodLookup = formatLookup(locale_periods),
      weekdayRe = formatRe(locale_weekdays),
      weekdayLookup = formatLookup(locale_weekdays),
      shortWeekdayRe = formatRe(locale_shortWeekdays),
      shortWeekdayLookup = formatLookup(locale_shortWeekdays),
      monthRe = formatRe(locale_months),
      monthLookup = formatLookup(locale_months),
      shortMonthRe = formatRe(locale_shortMonths),
      shortMonthLookup = formatLookup(locale_shortMonths);

  var formats = {
    "a": formatShortWeekday,
    "A": formatWeekday,
    "b": formatShortMonth,
    "B": formatMonth,
    "c": null,
    "d": formatDayOfMonth,
    "e": formatDayOfMonth,
    "f": formatMicroseconds,
    "g": formatYearISO,
    "G": formatFullYearISO,
    "H": formatHour24,
    "I": formatHour12,
    "j": formatDayOfYear,
    "L": formatMilliseconds,
    "m": formatMonthNumber,
    "M": formatMinutes,
    "p": formatPeriod,
    "q": formatQuarter,
    "Q": formatUnixTimestamp,
    "s": formatUnixTimestampSeconds,
    "S": formatSeconds,
    "u": formatWeekdayNumberMonday,
    "U": formatWeekNumberSunday,
    "V": formatWeekNumberISO,
    "w": formatWeekdayNumberSunday,
    "W": formatWeekNumberMonday,
    "x": null,
    "X": null,
    "y": formatYear,
    "Y": formatFullYear,
    "Z": formatZone,
    "%": formatLiteralPercent
  };

  var utcFormats = {
    "a": formatUTCShortWeekday,
    "A": formatUTCWeekday,
    "b": formatUTCShortMonth,
    "B": formatUTCMonth,
    "c": null,
    "d": formatUTCDayOfMonth,
    "e": formatUTCDayOfMonth,
    "f": formatUTCMicroseconds,
    "g": formatUTCYearISO,
    "G": formatUTCFullYearISO,
    "H": formatUTCHour24,
    "I": formatUTCHour12,
    "j": formatUTCDayOfYear,
    "L": formatUTCMilliseconds,
    "m": formatUTCMonthNumber,
    "M": formatUTCMinutes,
    "p": formatUTCPeriod,
    "q": formatUTCQuarter,
    "Q": formatUnixTimestamp,
    "s": formatUnixTimestampSeconds,
    "S": formatUTCSeconds,
    "u": formatUTCWeekdayNumberMonday,
    "U": formatUTCWeekNumberSunday,
    "V": formatUTCWeekNumberISO,
    "w": formatUTCWeekdayNumberSunday,
    "W": formatUTCWeekNumberMonday,
    "x": null,
    "X": null,
    "y": formatUTCYear,
    "Y": formatUTCFullYear,
    "Z": formatUTCZone,
    "%": formatLiteralPercent
  };

  var parses = {
    "a": parseShortWeekday,
    "A": parseWeekday,
    "b": parseShortMonth,
    "B": parseMonth,
    "c": parseLocaleDateTime,
    "d": parseDayOfMonth,
    "e": parseDayOfMonth,
    "f": parseMicroseconds,
    "g": parseYear,
    "G": parseFullYear,
    "H": parseHour24,
    "I": parseHour24,
    "j": parseDayOfYear,
    "L": locale_parseMilliseconds,
    "m": parseMonthNumber,
    "M": parseMinutes,
    "p": parsePeriod,
    "q": parseQuarter,
    "Q": parseUnixTimestamp,
    "s": parseUnixTimestampSeconds,
    "S": parseSeconds,
    "u": parseWeekdayNumberMonday,
    "U": parseWeekNumberSunday,
    "V": parseWeekNumberISO,
    "w": parseWeekdayNumberSunday,
    "W": parseWeekNumberMonday,
    "x": parseLocaleDate,
    "X": parseLocaleTime,
    "y": parseYear,
    "Y": parseFullYear,
    "Z": parseZone,
    "%": parseLiteralPercent
  };

  // These recursive directive definitions must be deferred.
  formats.x = newFormat(locale_date, formats);
  formats.X = newFormat(locale_time, formats);
  formats.c = newFormat(locale_dateTime, formats);
  utcFormats.x = newFormat(locale_date, utcFormats);
  utcFormats.X = newFormat(locale_time, utcFormats);
  utcFormats.c = newFormat(locale_dateTime, utcFormats);

  function newFormat(specifier, formats) {
    return function(date) {
      var string = [],
          i = -1,
          j = 0,
          n = specifier.length,
          c,
          pad,
          format;

      if (!(date instanceof Date)) date = new Date(+date);

      while (++i < n) {
        if (specifier.charCodeAt(i) === 37) {
          string.push(specifier.slice(j, i));
          if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
          else pad = c === "e" ? " " : "0";
          if (format = formats[c]) c = format(date, pad);
          string.push(c);
          j = i + 1;
        }
      }

      string.push(specifier.slice(j, i));
      return string.join("");
    };
  }

  function newParse(specifier, Z) {
    return function(string) {
      var d = newDate(1900, undefined, 1),
          i = parseSpecifier(d, specifier, string += "", 0),
          week, day;
      if (i != string.length) return null;

      // If a UNIX timestamp is specified, return it.
      if ("Q" in d) return new Date(d.Q);
      if ("s" in d) return new Date(d.s * 1000 + ("L" in d ? d.L : 0));

      // If this is utcParse, never use the local timezone.
      if (Z && !("Z" in d)) d.Z = 0;

      // The am-pm flag is 0 for AM, and 1 for PM.
      if ("p" in d) d.H = d.H % 12 + d.p * 12;

      // If the month was not specified, inherit from the quarter.
      if (d.m === undefined) d.m = "q" in d ? d.q : 0;

      // Convert day-of-week and week-of-year to day-of-year.
      if ("V" in d) {
        if (d.V < 1 || d.V > 53) return null;
        if (!("w" in d)) d.w = 1;
        if ("Z" in d) {
          week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
          week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
          week = utcDay.offset(week, (d.V - 1) * 7);
          d.y = week.getUTCFullYear();
          d.m = week.getUTCMonth();
          d.d = week.getUTCDate() + (d.w + 6) % 7;
        } else {
          week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
          week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
          week = timeDay.offset(week, (d.V - 1) * 7);
          d.y = week.getFullYear();
          d.m = week.getMonth();
          d.d = week.getDate() + (d.w + 6) % 7;
        }
      } else if ("W" in d || "U" in d) {
        if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
        day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
        d.m = 0;
        d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
      }

      // If a time zone is specified, all fields are interpreted as UTC and then
      // offset according to the specified time zone.
      if ("Z" in d) {
        d.H += d.Z / 100 | 0;
        d.M += d.Z % 100;
        return utcDate(d);
      }

      // Otherwise, all fields are in local time.
      return localDate(d);
    };
  }

  function parseSpecifier(d, specifier, string, j) {
    var i = 0,
        n = specifier.length,
        m = string.length,
        c,
        parse;

    while (i < n) {
      if (j >= m) return -1;
      c = specifier.charCodeAt(i++);
      if (c === 37) {
        c = specifier.charAt(i++);
        parse = parses[c in pads ? specifier.charAt(i++) : c];
        if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
      } else if (c != string.charCodeAt(j++)) {
        return -1;
      }
    }

    return j;
  }

  function parsePeriod(d, string, i) {
    var n = periodRe.exec(string.slice(i));
    return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
  }

  function parseShortWeekday(d, string, i) {
    var n = shortWeekdayRe.exec(string.slice(i));
    return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
  }

  function parseWeekday(d, string, i) {
    var n = weekdayRe.exec(string.slice(i));
    return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
  }

  function parseShortMonth(d, string, i) {
    var n = shortMonthRe.exec(string.slice(i));
    return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
  }

  function parseMonth(d, string, i) {
    var n = monthRe.exec(string.slice(i));
    return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
  }

  function parseLocaleDateTime(d, string, i) {
    return parseSpecifier(d, locale_dateTime, string, i);
  }

  function parseLocaleDate(d, string, i) {
    return parseSpecifier(d, locale_date, string, i);
  }

  function parseLocaleTime(d, string, i) {
    return parseSpecifier(d, locale_time, string, i);
  }

  function formatShortWeekday(d) {
    return locale_shortWeekdays[d.getDay()];
  }

  function formatWeekday(d) {
    return locale_weekdays[d.getDay()];
  }

  function formatShortMonth(d) {
    return locale_shortMonths[d.getMonth()];
  }

  function formatMonth(d) {
    return locale_months[d.getMonth()];
  }

  function formatPeriod(d) {
    return locale_periods[+(d.getHours() >= 12)];
  }

  function formatQuarter(d) {
    return 1 + ~~(d.getMonth() / 3);
  }

  function formatUTCShortWeekday(d) {
    return locale_shortWeekdays[d.getUTCDay()];
  }

  function formatUTCWeekday(d) {
    return locale_weekdays[d.getUTCDay()];
  }

  function formatUTCShortMonth(d) {
    return locale_shortMonths[d.getUTCMonth()];
  }

  function formatUTCMonth(d) {
    return locale_months[d.getUTCMonth()];
  }

  function formatUTCPeriod(d) {
    return locale_periods[+(d.getUTCHours() >= 12)];
  }

  function formatUTCQuarter(d) {
    return 1 + ~~(d.getUTCMonth() / 3);
  }

  return {
    format: function(specifier) {
      var f = newFormat(specifier += "", formats);
      f.toString = function() { return specifier; };
      return f;
    },
    parse: function(specifier) {
      var p = newParse(specifier += "", false);
      p.toString = function() { return specifier; };
      return p;
    },
    utcFormat: function(specifier) {
      var f = newFormat(specifier += "", utcFormats);
      f.toString = function() { return specifier; };
      return f;
    },
    utcParse: function(specifier) {
      var p = newParse(specifier += "", true);
      p.toString = function() { return specifier; };
      return p;
    }
  };
}

var pads = {"-": "", "_": " ", "0": "0"},
    numberRe = /^\s*\d+/, // note: ignores next directive
    percentRe = /^%/,
    requoteRe = /[\\^$*+?|[\]().{}]/g;

function pad(value, fill, width) {
  var sign = value < 0 ? "-" : "",
      string = (sign ? -value : value) + "",
      length = string.length;
  return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
}

function requote(s) {
  return s.replace(requoteRe, "\\$&");
}

function formatRe(names) {
  return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
}

function formatLookup(names) {
  return new Map(names.map((name, i) => [name.toLowerCase(), i]));
}

function parseWeekdayNumberSunday(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 1));
  return n ? (d.w = +n[0], i + n[0].length) : -1;
}

function parseWeekdayNumberMonday(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 1));
  return n ? (d.u = +n[0], i + n[0].length) : -1;
}

function parseWeekNumberSunday(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 2));
  return n ? (d.U = +n[0], i + n[0].length) : -1;
}

function parseWeekNumberISO(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 2));
  return n ? (d.V = +n[0], i + n[0].length) : -1;
}

function parseWeekNumberMonday(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 2));
  return n ? (d.W = +n[0], i + n[0].length) : -1;
}

function parseFullYear(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 4));
  return n ? (d.y = +n[0], i + n[0].length) : -1;
}

function parseYear(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 2));
  return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
}

function parseZone(d, string, i) {
  var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
  return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
}

function parseQuarter(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 1));
  return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
}

function parseMonthNumber(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 2));
  return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
}

function parseDayOfMonth(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 2));
  return n ? (d.d = +n[0], i + n[0].length) : -1;
}

function parseDayOfYear(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 3));
  return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
}

function parseHour24(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 2));
  return n ? (d.H = +n[0], i + n[0].length) : -1;
}

function parseMinutes(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 2));
  return n ? (d.M = +n[0], i + n[0].length) : -1;
}

function parseSeconds(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 2));
  return n ? (d.S = +n[0], i + n[0].length) : -1;
}

function locale_parseMilliseconds(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 3));
  return n ? (d.L = +n[0], i + n[0].length) : -1;
}

function parseMicroseconds(d, string, i) {
  var n = numberRe.exec(string.slice(i, i + 6));
  return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;
}

function parseLiteralPercent(d, string, i) {
  var n = percentRe.exec(string.slice(i, i + 1));
  return n ? i + n[0].length : -1;
}

function parseUnixTimestamp(d, string, i) {
  var n = numberRe.exec(string.slice(i));
  return n ? (d.Q = +n[0], i + n[0].length) : -1;
}

function parseUnixTimestampSeconds(d, string, i) {
  var n = numberRe.exec(string.slice(i));
  return n ? (d.s = +n[0], i + n[0].length) : -1;
}

function formatDayOfMonth(d, p) {
  return pad(d.getDate(), p, 2);
}

function formatHour24(d, p) {
  return pad(d.getHours(), p, 2);
}

function formatHour12(d, p) {
  return pad(d.getHours() % 12 || 12, p, 2);
}

function formatDayOfYear(d, p) {
  return pad(1 + timeDay.count(timeYear(d), d), p, 3);
}

function formatMilliseconds(d, p) {
  return pad(d.getMilliseconds(), p, 3);
}

function formatMicroseconds(d, p) {
  return formatMilliseconds(d, p) + "000";
}

function formatMonthNumber(d, p) {
  return pad(d.getMonth() + 1, p, 2);
}

function formatMinutes(d, p) {
  return pad(d.getMinutes(), p, 2);
}

function formatSeconds(d, p) {
  return pad(d.getSeconds(), p, 2);
}

function formatWeekdayNumberMonday(d) {
  var day = d.getDay();
  return day === 0 ? 7 : day;
}

function formatWeekNumberSunday(d, p) {
  return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);
}

function dISO(d) {
  var day = d.getDay();
  return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);
}

function formatWeekNumberISO(d, p) {
  d = dISO(d);
  return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);
}

function formatWeekdayNumberSunday(d) {
  return d.getDay();
}

function formatWeekNumberMonday(d, p) {
  return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);
}

function formatYear(d, p) {
  return pad(d.getFullYear() % 100, p, 2);
}

function formatYearISO(d, p) {
  d = dISO(d);
  return pad(d.getFullYear() % 100, p, 2);
}

function formatFullYear(d, p) {
  return pad(d.getFullYear() % 10000, p, 4);
}

function formatFullYearISO(d, p) {
  var day = d.getDay();
  d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);
  return pad(d.getFullYear() % 10000, p, 4);
}

function formatZone(d) {
  var z = d.getTimezoneOffset();
  return (z > 0 ? "-" : (z *= -1, "+"))
      + pad(z / 60 | 0, "0", 2)
      + pad(z % 60, "0", 2);
}

function formatUTCDayOfMonth(d, p) {
  return pad(d.getUTCDate(), p, 2);
}

function formatUTCHour24(d, p) {
  return pad(d.getUTCHours(), p, 2);
}

function formatUTCHour12(d, p) {
  return pad(d.getUTCHours() % 12 || 12, p, 2);
}

function formatUTCDayOfYear(d, p) {
  return pad(1 + utcDay.count(utcYear(d), d), p, 3);
}

function formatUTCMilliseconds(d, p) {
  return pad(d.getUTCMilliseconds(), p, 3);
}

function formatUTCMicroseconds(d, p) {
  return formatUTCMilliseconds(d, p) + "000";
}

function formatUTCMonthNumber(d, p) {
  return pad(d.getUTCMonth() + 1, p, 2);
}

function formatUTCMinutes(d, p) {
  return pad(d.getUTCMinutes(), p, 2);
}

function formatUTCSeconds(d, p) {
  return pad(d.getUTCSeconds(), p, 2);
}

function formatUTCWeekdayNumberMonday(d) {
  var dow = d.getUTCDay();
  return dow === 0 ? 7 : dow;
}

function formatUTCWeekNumberSunday(d, p) {
  return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);
}

function UTCdISO(d) {
  var day = d.getUTCDay();
  return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
}

function formatUTCWeekNumberISO(d, p) {
  d = UTCdISO(d);
  return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);
}

function formatUTCWeekdayNumberSunday(d) {
  return d.getUTCDay();
}

function formatUTCWeekNumberMonday(d, p) {
  return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);
}

function formatUTCYear(d, p) {
  return pad(d.getUTCFullYear() % 100, p, 2);
}

function formatUTCYearISO(d, p) {
  d = UTCdISO(d);
  return pad(d.getUTCFullYear() % 100, p, 2);
}

function formatUTCFullYear(d, p) {
  return pad(d.getUTCFullYear() % 10000, p, 4);
}

function formatUTCFullYearISO(d, p) {
  var day = d.getUTCDay();
  d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);
  return pad(d.getUTCFullYear() % 10000, p, 4);
}

function formatUTCZone() {
  return "+0000";
}

function formatLiteralPercent() {
  return "%";
}

function formatUnixTimestamp(d) {
  return +d;
}

function formatUnixTimestampSeconds(d) {
  return Math.floor(+d / 1000);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-time-format/src/defaultLocale.js


var src_defaultLocale_locale;
var timeFormat;
var timeParse;
var utcFormat;
var utcParse;

defaultLocale_defaultLocale({
  dateTime: "%x, %X",
  date: "%-m/%-d/%Y",
  time: "%-I:%M:%S %p",
  periods: ["AM", "PM"],
  days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
  shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
});

function defaultLocale_defaultLocale(definition) {
  src_defaultLocale_locale = formatLocale(definition);
  timeFormat = src_defaultLocale_locale.format;
  timeParse = src_defaultLocale_locale.parse;
  utcFormat = src_defaultLocale_locale.utcFormat;
  utcParse = src_defaultLocale_locale.utcParse;
  return src_defaultLocale_locale;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/time.js






function time_date(t) {
  return new Date(t);
}

function time_number(t) {
  return t instanceof Date ? +t : +new Date(+t);
}

function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {
  var scale = continuous(),
      invert = scale.invert,
      domain = scale.domain;

  var formatMillisecond = format(".%L"),
      formatSecond = format(":%S"),
      formatMinute = format("%I:%M"),
      formatHour = format("%I %p"),
      formatDay = format("%a %d"),
      formatWeek = format("%b %d"),
      formatMonth = format("%B"),
      formatYear = format("%Y");

  function tickFormat(date) {
    return (second(date) < date ? formatMillisecond
        : minute(date) < date ? formatSecond
        : hour(date) < date ? formatMinute
        : day(date) < date ? formatHour
        : month(date) < date ? (week(date) < date ? formatDay : formatWeek)
        : year(date) < date ? formatMonth
        : formatYear)(date);
  }

  scale.invert = function(y) {
    return new Date(invert(y));
  };

  scale.domain = function(_) {
    return arguments.length ? domain(Array.from(_, time_number)) : domain().map(time_date);
  };

  scale.ticks = function(interval) {
    var d = domain();
    return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);
  };

  scale.tickFormat = function(count, specifier) {
    return specifier == null ? tickFormat : format(specifier);
  };

  scale.nice = function(interval) {
    var d = domain();
    if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);
    return interval ? domain(nice(d, interval)) : scale;
  };

  scale.copy = function() {
    return src_copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
  };

  return scale;
}

function time() {
  return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/utcTime.js





function utcTime() {
  return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/sequential.js








function sequential_transformer() {
  var x0 = 0,
      x1 = 1,
      t0,
      t1,
      k10,
      transform,
      interpolator = continuous_identity,
      clamp = false,
      unknown;

  function scale(x) {
    return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));
  }

  scale.domain = function(_) {
    return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];
  };

  scale.clamp = function(_) {
    return arguments.length ? (clamp = !!_, scale) : clamp;
  };

  scale.interpolator = function(_) {
    return arguments.length ? (interpolator = _, scale) : interpolator;
  };

  function range(interpolate) {
    return function(_) {
      var r0, r1;
      return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];
    };
  }

  scale.range = range(value);

  scale.rangeRound = range(src_round);

  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };

  return function(t) {
    transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);
    return scale;
  };
}

function sequential_copy(source, target) {
  return target
      .domain(source.domain())
      .interpolator(source.interpolator())
      .clamp(source.clamp())
      .unknown(source.unknown());
}

function sequential() {
  var scale = linearish(sequential_transformer()(continuous_identity));

  scale.copy = function() {
    return sequential_copy(scale, sequential());
  };

  return initInterpolator.apply(scale, arguments);
}

function sequentialLog() {
  var scale = loggish(sequential_transformer()).domain([1, 10]);

  scale.copy = function() {
    return sequential_copy(scale, sequentialLog()).base(scale.base());
  };

  return initInterpolator.apply(scale, arguments);
}

function sequentialSymlog() {
  var scale = symlogish(sequential_transformer());

  scale.copy = function() {
    return sequential_copy(scale, sequentialSymlog()).constant(scale.constant());
  };

  return initInterpolator.apply(scale, arguments);
}

function sequentialPow() {
  var scale = powish(sequential_transformer());

  scale.copy = function() {
    return sequential_copy(scale, sequentialPow()).exponent(scale.exponent());
  };

  return initInterpolator.apply(scale, arguments);
}

function sequentialSqrt() {
  return sequentialPow.apply(null, arguments).exponent(0.5);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/sequentialQuantile.js




function sequentialQuantile() {
  var domain = [],
      interpolator = continuous_identity;

  function scale(x) {
    if (x != null && !isNaN(x = +x)) return interpolator((bisect(domain, x, 1) - 1) / (domain.length - 1));
  }

  scale.domain = function(_) {
    if (!arguments.length) return domain.slice();
    domain = [];
    for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);
    domain.sort(ascending);
    return scale;
  };

  scale.interpolator = function(_) {
    return arguments.length ? (interpolator = _, scale) : interpolator;
  };

  scale.range = function() {
    return domain.map((d, i) => interpolator(i / (domain.length - 1)));
  };

  scale.quantiles = function(n) {
    return Array.from({length: n + 1}, (_, i) => quantile(domain, i / n));
  };

  scale.copy = function() {
    return sequentialQuantile(interpolator).domain(domain);
  };

  return initInterpolator.apply(scale, arguments);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-interpolate/src/piecewise.js


function piecewise(interpolate, values) {
  if (values === undefined) values = interpolate, interpolate = value;
  var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);
  while (i < n) I[i] = interpolate(v, v = values[++i]);
  return function(t) {
    var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
    return I[i](t - i);
  };
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/diverging.js









function diverging_transformer() {
  var x0 = 0,
      x1 = 0.5,
      x2 = 1,
      s = 1,
      t0,
      t1,
      t2,
      k10,
      k21,
      interpolator = continuous_identity,
      transform,
      clamp = false,
      unknown;

  function scale(x) {
    return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));
  }

  scale.domain = function(_) {
    return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];
  };

  scale.clamp = function(_) {
    return arguments.length ? (clamp = !!_, scale) : clamp;
  };

  scale.interpolator = function(_) {
    return arguments.length ? (interpolator = _, scale) : interpolator;
  };

  function range(interpolate) {
    return function(_) {
      var r0, r1, r2;
      return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];
    };
  }

  scale.range = range(value);

  scale.rangeRound = range(src_round);

  scale.unknown = function(_) {
    return arguments.length ? (unknown = _, scale) : unknown;
  };

  return function(t) {
    transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;
    return scale;
  };
}

function diverging() {
  var scale = linearish(diverging_transformer()(continuous_identity));

  scale.copy = function() {
    return sequential_copy(scale, diverging());
  };

  return initInterpolator.apply(scale, arguments);
}

function divergingLog() {
  var scale = loggish(diverging_transformer()).domain([0.1, 1, 10]);

  scale.copy = function() {
    return sequential_copy(scale, divergingLog()).base(scale.base());
  };

  return initInterpolator.apply(scale, arguments);
}

function divergingSymlog() {
  var scale = symlogish(diverging_transformer());

  scale.copy = function() {
    return sequential_copy(scale, divergingSymlog()).constant(scale.constant());
  };

  return initInterpolator.apply(scale, arguments);
}

function divergingPow() {
  var scale = powish(diverging_transformer());

  scale.copy = function() {
    return sequential_copy(scale, divergingPow()).exponent(scale.exponent());
  };

  return initInterpolator.apply(scale, arguments);
}

function divergingSqrt() {
  return divergingPow.apply(null, arguments).exponent(0.5);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-scale/src/index.js


































;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/victory-vendor/es/d3-scale.js

// `victory-vendor/d3-scale` (ESM)
// See upstream license: https://github.com/d3/d3-scale/blob/main/LICENSE
//
// Our ESM package uses the underlying installed dependencies of `node_modules/d3-scale`


;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/offset/none.js
/* harmony default export */ function none(series, order) {
  if (!((n = series.length) > 1)) return;
  for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {
    s0 = s1, s1 = series[order[i]];
    for (j = 0; j < m; ++j) {
      s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
    }
  }
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/offset/expand.js


/* harmony default export */ function expand(series, order) {
  if (!((n = series.length) > 0)) return;
  for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {
    for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;
    if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;
  }
  none(series, order);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/offset/silhouette.js


/* harmony default export */ function silhouette(series, order) {
  if (!((n = series.length) > 0)) return;
  for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {
    for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;
    s0[j][1] += s0[j][0] = -y / 2;
  }
  none(series, order);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/offset/wiggle.js


/* harmony default export */ function wiggle(series, order) {
  if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;
  for (var y = 0, j = 1, s0, m, n; j < m; ++j) {
    for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {
      var si = series[order[i]],
          sij0 = si[j][1] || 0,
          sij1 = si[j - 1][1] || 0,
          s3 = (sij0 - sij1) / 2;
      for (var k = 0; k < i; ++k) {
        var sk = series[order[k]],
            skj0 = sk[j][1] || 0,
            skj1 = sk[j - 1][1] || 0;
        s3 += skj0 - skj1;
      }
      s1 += sij0, s2 += s3 * sij0;
    }
    s0[j - 1][1] += s0[j - 1][0] = y;
    if (s1) y -= s2 / s1;
  }
  s0[j - 1][1] += s0[j - 1][0] = y;
  none(series, order);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/order/none.js
/* harmony default export */ function order_none(series) {
  var n = series.length, o = new Array(n);
  while (--n >= 0) o[n] = n;
  return o;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/stack.js





function stackValue(d, key) {
  return d[key];
}

function stackSeries(key) {
  const series = [];
  series.key = key;
  return series;
}

/* harmony default export */ function src_stack() {
  var keys = src_constant([]),
      order = order_none,
      offset = none,
      value = stackValue;

  function stack(data) {
    var sz = Array.from(keys.apply(this, arguments), stackSeries),
        i, n = sz.length, j = -1,
        oz;

    for (const d of data) {
      for (i = 0, ++j; i < n; ++i) {
        (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;
      }
    }

    for (i = 0, oz = array(order(sz)); i < n; ++i) {
      sz[oz[i]].index = i;
    }

    offset(sz, oz);
    return sz;
  }

  stack.keys = function(_) {
    return arguments.length ? (keys = typeof _ === "function" ? _ : src_constant(Array.from(_)), stack) : keys;
  };

  stack.value = function(_) {
    return arguments.length ? (value = typeof _ === "function" ? _ : src_constant(+_), stack) : value;
  };

  stack.order = function(_) {
    return arguments.length ? (order = _ == null ? order_none : typeof _ === "function" ? _ : src_constant(Array.from(_)), stack) : order;
  };

  stack.offset = function(_) {
    return arguments.length ? (offset = _ == null ? none : _, stack) : offset;
  };

  return stack;
}

// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/decimal.js-light/decimal.js
var decimal = __webpack_require__(667);
var decimal_default = /*#__PURE__*/__webpack_require__.n(decimal);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts-scale/es6/util/utils.js
function utils_toConsumableArray(arr) { return utils_arrayWithoutHoles(arr) || utils_iterableToArray(arr) || utils_unsupportedIterableToArray(arr) || utils_nonIterableSpread(); }

function utils_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."); }

function utils_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return utils_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 utils_arrayLikeToArray(o, minLen); }

function utils_iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }

function utils_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return utils_arrayLikeToArray(arr); }

function utils_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; }

var utils_identity = function identity(i) {
  return i;
};

var PLACE_HOLDER = {
  '@@functional/placeholder': true
};

var isPlaceHolder = function isPlaceHolder(val) {
  return val === PLACE_HOLDER;
};

var curry0 = function curry0(fn) {
  return function _curried() {
    if (arguments.length === 0 || arguments.length === 1 && isPlaceHolder(arguments.length <= 0 ? undefined : arguments[0])) {
      return _curried;
    }

    return fn.apply(void 0, arguments);
  };
};

var curryN = function curryN(n, fn) {
  if (n === 1) {
    return fn;
  }

  return curry0(function () {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    var argsLength = args.filter(function (arg) {
      return arg !== PLACE_HOLDER;
    }).length;

    if (argsLength >= n) {
      return fn.apply(void 0, args);
    }

    return curryN(n - argsLength, curry0(function () {
      for (var _len2 = arguments.length, restArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        restArgs[_key2] = arguments[_key2];
      }

      var newArgs = args.map(function (arg) {
        return isPlaceHolder(arg) ? restArgs.shift() : arg;
      });
      return fn.apply(void 0, utils_toConsumableArray(newArgs).concat(restArgs));
    }));
  });
};

var curry = function curry(fn) {
  return curryN(fn.length, fn);
};
var utils_range = function range(begin, end) {
  var arr = [];

  for (var i = begin; i < end; ++i) {
    arr[i - begin] = i;
  }

  return arr;
};
var utils_map = curry(function (fn, arr) {
  if (Array.isArray(arr)) {
    return arr.map(fn);
  }

  return Object.keys(arr).map(function (key) {
    return arr[key];
  }).map(fn);
});
var utils_compose = function compose() {
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
    args[_key3] = arguments[_key3];
  }

  if (!args.length) {
    return utils_identity;
  }

  var fns = args.reverse(); // first function can receive multiply arguments

  var firstFn = fns[0];
  var tailsFn = fns.slice(1);
  return function () {
    return tailsFn.reduce(function (res, fn) {
      return fn(res);
    }, firstFn.apply(void 0, arguments));
  };
};
var reverse = function reverse(arr) {
  if (Array.isArray(arr)) {
    return arr.reverse();
  } // can be string


  return arr.split('').reverse.join('');
};
var utils_memoize = function memoize(fn) {
  var lastArgs = null;
  var lastResult = null;
  return function () {
    for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
      args[_key4] = arguments[_key4];
    }

    if (lastArgs && args.every(function (val, i) {
      return val === lastArgs[i];
    })) {
      return lastResult;
    }

    lastArgs = args;
    lastResult = fn.apply(void 0, args);
    return lastResult;
  };
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts-scale/es6/util/arithmetic.js
/**
 * @fileOverview 一些公用的运算方法
 * @author xile611
 * @date 2015-09-17
 */


/**
 * 获取数值的位数
 * 其中绝对值属于区间[0.1, 1)， 得到的值为0
 * 绝对值属于区间[0.01, 0.1)，得到的位数为 -1
 * 绝对值属于区间[0.001, 0.01)，得到的位数为 -2
 *
 * @param  {Number} value 数值
 * @return {Integer} 位数
 */

function getDigitCount(value) {
  var result;

  if (value === 0) {
    result = 1;
  } else {
    result = Math.floor(new (decimal_default())(value).abs().log(10).toNumber()) + 1;
  }

  return result;
}
/**
 * 按照固定的步长获取[start, end)这个区间的数据
 * 并且需要处理js计算精度的问题
 *
 * @param  {Decimal} start 起点
 * @param  {Decimal} end   终点，不包含该值
 * @param  {Decimal} step  步长
 * @return {Array}         若干数值
 */


function rangeStep(start, end, step) {
  var num = new (decimal_default())(start);
  var i = 0;
  var result = []; // magic number to prevent infinite loop

  while (num.lt(end) && i < 100000) {
    result.push(num.toNumber());
    num = num.add(step);
    i++;
  }

  return result;
}
/**
 * 对数值进行线性插值
 *
 * @param  {Number} a  定义域的极点
 * @param  {Number} b  定义域的极点
 * @param  {Number} t  [0, 1]内的某个值
 * @return {Number}    定义域内的某个值
 */


var arithmetic_interpolateNumber = curry(function (a, b, t) {
  var newA = +a;
  var newB = +b;
  return newA + t * (newB - newA);
});
/**
 * 线性插值的逆运算
 *
 * @param  {Number} a 定义域的极点
 * @param  {Number} b 定义域的极点
 * @param  {Number} x 可以认为是插值后的一个输出值
 * @return {Number}   当x在 a ~ b这个范围内时，返回值属于[0, 1]
 */

var uninterpolateNumber = curry(function (a, b, x) {
  var diff = b - +a;
  diff = diff || Infinity;
  return (x - a) / diff;
});
/**
 * 线性插值的逆运算，并且有截断的操作
 *
 * @param  {Number} a 定义域的极点
 * @param  {Number} b 定义域的极点
 * @param  {Number} x 可以认为是插值后的一个输出值
 * @return {Number}   当x在 a ~ b这个区间内时，返回值属于[0, 1]，
 * 当x不在 a ~ b这个区间时，会截断到 a ~ b 这个区间
 */

var uninterpolateTruncation = curry(function (a, b, x) {
  var diff = b - +a;
  diff = diff || Infinity;
  return Math.max(0, Math.min(1, (x - a) / diff));
});
/* harmony default export */ var arithmetic = ({
  rangeStep: rangeStep,
  getDigitCount: getDigitCount,
  interpolateNumber: arithmetic_interpolateNumber,
  uninterpolateNumber: uninterpolateNumber,
  uninterpolateTruncation: uninterpolateTruncation
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts-scale/es6/getNiceTickValues.js
function getNiceTickValues_toConsumableArray(arr) { return getNiceTickValues_arrayWithoutHoles(arr) || getNiceTickValues_iterableToArray(arr) || getNiceTickValues_unsupportedIterableToArray(arr) || getNiceTickValues_nonIterableSpread(); }

function getNiceTickValues_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."); }

function getNiceTickValues_iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }

function getNiceTickValues_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return getNiceTickValues_arrayLikeToArray(arr); }

function getNiceTickValues_slicedToArray(arr, i) { return getNiceTickValues_arrayWithHoles(arr) || getNiceTickValues_iterableToArrayLimit(arr, i) || getNiceTickValues_unsupportedIterableToArray(arr, i) || getNiceTickValues_nonIterableRest(); }

function getNiceTickValues_nonIterableRest() { 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 getNiceTickValues_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return getNiceTickValues_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 getNiceTickValues_arrayLikeToArray(o, minLen); }

function getNiceTickValues_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 getNiceTickValues_iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 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 getNiceTickValues_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

/**
 * @fileOverview calculate tick values of scale
 * @author xile611, arcthur
 * @date 2015-09-17
 */



/**
 * Calculate a interval of a minimum value and a maximum value
 *
 * @param  {Number} min       The minimum value
 * @param  {Number} max       The maximum value
 * @return {Array} An interval
 */

function getValidInterval(_ref) {
  var _ref2 = getNiceTickValues_slicedToArray(_ref, 2),
      min = _ref2[0],
      max = _ref2[1];

  var validMin = min,
      validMax = max; // exchange

  if (min > max) {
    validMin = max;
    validMax = min;
  }

  return [validMin, validMax];
}
/**
 * Calculate the step which is easy to understand between ticks, like 10, 20, 25
 *
 * @param  {Decimal} roughStep        The rough step calculated by deviding the
 * difference by the tickCount
 * @param  {Boolean} allowDecimals    Allow the ticks to be decimals or not
 * @param  {Integer} correctionFactor A correction factor
 * @return {Decimal} The step which is easy to understand between two ticks
 */


function getFormatStep(roughStep, allowDecimals, correctionFactor) {
  if (roughStep.lte(0)) {
    return new (decimal_default())(0);
  }

  var digitCount = arithmetic.getDigitCount(roughStep.toNumber()); // The ratio between the rough step and the smallest number which has a bigger
  // order of magnitudes than the rough step

  var digitCountValue = new (decimal_default())(10).pow(digitCount);
  var stepRatio = roughStep.div(digitCountValue); // When an integer and a float multiplied, the accuracy of result may be wrong

  var stepRatioScale = digitCount !== 1 ? 0.05 : 0.1;
  var amendStepRatio = new (decimal_default())(Math.ceil(stepRatio.div(stepRatioScale).toNumber())).add(correctionFactor).mul(stepRatioScale);
  var formatStep = amendStepRatio.mul(digitCountValue);
  return allowDecimals ? formatStep : new (decimal_default())(Math.ceil(formatStep));
}
/**
 * calculate the ticks when the minimum value equals to the maximum value
 *
 * @param  {Number}  value         The minimum valuue which is also the maximum value
 * @param  {Integer} tickCount     The count of ticks
 * @param  {Boolean} allowDecimals Allow the ticks to be decimals or not
 * @return {Array}                 ticks
 */


function getTickOfSingleValue(value, tickCount, allowDecimals) {
  var step = 1; // calculate the middle value of ticks

  var middle = new (decimal_default())(value);

  if (!middle.isint() && allowDecimals) {
    var absVal = Math.abs(value);

    if (absVal < 1) {
      // The step should be a float number when the difference is smaller than 1
      step = new (decimal_default())(10).pow(arithmetic.getDigitCount(value) - 1);
      middle = new (decimal_default())(Math.floor(middle.div(step).toNumber())).mul(step);
    } else if (absVal > 1) {
      // Return the maximum integer which is smaller than 'value' when 'value' is greater than 1
      middle = new (decimal_default())(Math.floor(value));
    }
  } else if (value === 0) {
    middle = new (decimal_default())(Math.floor((tickCount - 1) / 2));
  } else if (!allowDecimals) {
    middle = new (decimal_default())(Math.floor(value));
  }

  var middleIndex = Math.floor((tickCount - 1) / 2);
  var fn = utils_compose(utils_map(function (n) {
    return middle.add(new (decimal_default())(n - middleIndex).mul(step)).toNumber();
  }), utils_range);
  return fn(0, tickCount);
}
/**
 * Calculate the step
 *
 * @param  {Number}  min              The minimum value of an interval
 * @param  {Number}  max              The maximum value of an interval
 * @param  {Integer} tickCount        The count of ticks
 * @param  {Boolean} allowDecimals    Allow the ticks to be decimals or not
 * @param  {Number}  correctionFactor A correction factor
 * @return {Object}  The step, minimum value of ticks, maximum value of ticks
 */


function calculateStep(min, max, tickCount, allowDecimals) {
  var correctionFactor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;

  // dirty hack (for recharts' test)
  if (!Number.isFinite((max - min) / (tickCount - 1))) {
    return {
      step: new (decimal_default())(0),
      tickMin: new (decimal_default())(0),
      tickMax: new (decimal_default())(0)
    };
  } // The step which is easy to understand between two ticks


  var step = getFormatStep(new (decimal_default())(max).sub(min).div(tickCount - 1), allowDecimals, correctionFactor); // A medial value of ticks

  var middle; // When 0 is inside the interval, 0 should be a tick

  if (min <= 0 && max >= 0) {
    middle = new (decimal_default())(0);
  } else {
    // calculate the middle value
    middle = new (decimal_default())(min).add(max).div(2); // minus modulo value

    middle = middle.sub(new (decimal_default())(middle).mod(step));
  }

  var belowCount = Math.ceil(middle.sub(min).div(step).toNumber());
  var upCount = Math.ceil(new (decimal_default())(max).sub(middle).div(step).toNumber());
  var scaleCount = belowCount + upCount + 1;

  if (scaleCount > tickCount) {
    // When more ticks need to cover the interval, step should be bigger.
    return calculateStep(min, max, tickCount, allowDecimals, correctionFactor + 1);
  }

  if (scaleCount < tickCount) {
    // When less ticks can cover the interval, we should add some additional ticks
    upCount = max > 0 ? upCount + (tickCount - scaleCount) : upCount;
    belowCount = max > 0 ? belowCount : belowCount + (tickCount - scaleCount);
  }

  return {
    step: step,
    tickMin: middle.sub(new (decimal_default())(belowCount).mul(step)),
    tickMax: middle.add(new (decimal_default())(upCount).mul(step))
  };
}
/**
 * Calculate the ticks of an interval, the count of ticks will be guraranteed
 *
 * @param  {Number}  min, max      min: The minimum value, max: The maximum value
 * @param  {Integer} tickCount     The count of ticks
 * @param  {Boolean} allowDecimals Allow the ticks to be decimals or not
 * @return {Array}   ticks
 */


function getNiceTickValuesFn(_ref3) {
  var _ref4 = getNiceTickValues_slicedToArray(_ref3, 2),
      min = _ref4[0],
      max = _ref4[1];

  var tickCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  // More than two ticks should be return
  var count = Math.max(tickCount, 2);

  var _getValidInterval = getValidInterval([min, max]),
      _getValidInterval2 = getNiceTickValues_slicedToArray(_getValidInterval, 2),
      cormin = _getValidInterval2[0],
      cormax = _getValidInterval2[1];

  if (cormin === -Infinity || cormax === Infinity) {
    var _values = cormax === Infinity ? [cormin].concat(getNiceTickValues_toConsumableArray(utils_range(0, tickCount - 1).map(function () {
      return Infinity;
    }))) : [].concat(getNiceTickValues_toConsumableArray(utils_range(0, tickCount - 1).map(function () {
      return -Infinity;
    })), [cormax]);

    return min > max ? reverse(_values) : _values;
  }

  if (cormin === cormax) {
    return getTickOfSingleValue(cormin, tickCount, allowDecimals);
  } // Get the step between two ticks


  var _calculateStep = calculateStep(cormin, cormax, count, allowDecimals),
      step = _calculateStep.step,
      tickMin = _calculateStep.tickMin,
      tickMax = _calculateStep.tickMax;

  var values = arithmetic.rangeStep(tickMin, tickMax.add(new (decimal_default())(0.1).mul(step)), step);
  return min > max ? reverse(values) : values;
}
/**
 * Calculate the ticks of an interval, the count of ticks won't be guraranteed
 *
 * @param  {Number}  min, max      min: The minimum value, max: The maximum value
 * @param  {Integer} tickCount     The count of ticks
 * @param  {Boolean} allowDecimals Allow the ticks to be decimals or not
 * @return {Array}   ticks
 */


function getTickValuesFn(_ref5) {
  var _ref6 = getNiceTickValues_slicedToArray(_ref5, 2),
      min = _ref6[0],
      max = _ref6[1];

  var tickCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  // More than two ticks should be return
  var count = Math.max(tickCount, 2);

  var _getValidInterval3 = getValidInterval([min, max]),
      _getValidInterval4 = getNiceTickValues_slicedToArray(_getValidInterval3, 2),
      cormin = _getValidInterval4[0],
      cormax = _getValidInterval4[1];

  if (cormin === -Infinity || cormax === Infinity) {
    return [min, max];
  }

  if (cormin === cormax) {
    return getTickOfSingleValue(cormin, tickCount, allowDecimals);
  }

  var step = getFormatStep(new (decimal_default())(cormax).sub(cormin).div(count - 1), allowDecimals, 0);
  var fn = utils_compose(utils_map(function (n) {
    return new (decimal_default())(cormin).add(new (decimal_default())(n).mul(step)).toNumber();
  }), utils_range);
  var values = fn(0, count).filter(function (entry) {
    return entry >= cormin && entry <= cormax;
  });
  return min > max ? reverse(values) : values;
}
/**
 * Calculate the ticks of an interval, the count of ticks won't be guraranteed,
 * but the domain will be guaranteed
 *
 * @param  {Number}  min, max      min: The minimum value, max: The maximum value
 * @param  {Integer} tickCount     The count of ticks
 * @param  {Boolean} allowDecimals Allow the ticks to be decimals or not
 * @return {Array}   ticks
 */


function getTickValuesFixedDomainFn(_ref7, tickCount) {
  var _ref8 = getNiceTickValues_slicedToArray(_ref7, 2),
      min = _ref8[0],
      max = _ref8[1];

  var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;

  // More than two ticks should be return
  var _getValidInterval5 = getValidInterval([min, max]),
      _getValidInterval6 = getNiceTickValues_slicedToArray(_getValidInterval5, 2),
      cormin = _getValidInterval6[0],
      cormax = _getValidInterval6[1];

  if (cormin === -Infinity || cormax === Infinity) {
    return [min, max];
  }

  if (cormin === cormax) {
    return [cormin];
  }

  var count = Math.max(tickCount, 2);
  var step = getFormatStep(new (decimal_default())(cormax).sub(cormin).div(count - 1), allowDecimals, 0);
  var values = [].concat(getNiceTickValues_toConsumableArray(arithmetic.rangeStep(new (decimal_default())(cormin), new (decimal_default())(cormax).sub(new (decimal_default())(0.99).mul(step)), step)), [cormax]);
  return min > max ? reverse(values) : values;
}

var getNiceTickValues = utils_memoize(getNiceTickValuesFn);
var getTickValues = utils_memoize(getTickValuesFn);
var getTickValuesFixedDomain = utils_memoize(getTickValuesFixedDomainFn);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts-scale/es6/index.js

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/ErrorBar.js
var ErrorBar_excluded = ["offset", "layout", "width", "dataKey", "data", "dataPointFormatter", "xAxis", "yAxis"];
function ErrorBar_extends() { ErrorBar_extends = Object.assign ? Object.assign.bind() : 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 ErrorBar_extends.apply(this, arguments); }
function ErrorBar_slicedToArray(arr, i) { return ErrorBar_arrayWithHoles(arr) || ErrorBar_iterableToArrayLimit(arr, i) || ErrorBar_unsupportedIterableToArray(arr, i) || ErrorBar_nonIterableRest(); }
function ErrorBar_nonIterableRest() { 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 ErrorBar_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ErrorBar_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 ErrorBar_arrayLikeToArray(o, minLen); }
function ErrorBar_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 ErrorBar_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function ErrorBar_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function ErrorBar_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = ErrorBar_objectWithoutPropertiesLoose(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 ErrorBar_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; }
/**
 * @fileOverview Render a group of error bar
 */



function ErrorBar(props) {
  var offset = props.offset,
    layout = props.layout,
    width = props.width,
    dataKey = props.dataKey,
    data = props.data,
    dataPointFormatter = props.dataPointFormatter,
    xAxis = props.xAxis,
    yAxis = props.yAxis,
    others = ErrorBar_objectWithoutProperties(props, ErrorBar_excluded);
  var svgProps = filterProps(others);
  var errorBars = data.map(function (entry, i) {
    var _dataPointFormatter = dataPointFormatter(entry, dataKey),
      x = _dataPointFormatter.x,
      y = _dataPointFormatter.y,
      value = _dataPointFormatter.value,
      errorVal = _dataPointFormatter.errorVal;
    if (!errorVal) {
      return null;
    }
    var lineCoordinates = [];
    var lowBound, highBound;
    if (Array.isArray(errorVal)) {
      var _errorVal = ErrorBar_slicedToArray(errorVal, 2);
      lowBound = _errorVal[0];
      highBound = _errorVal[1];
    } else {
      lowBound = highBound = errorVal;
    }
    if (layout === 'vertical') {
      // error bar for horizontal charts, the y is fixed, x is a range value
      var scale = xAxis.scale;
      var yMid = y + offset;
      var yMin = yMid + width;
      var yMax = yMid - width;
      var xMin = scale(value - lowBound);
      var xMax = scale(value + highBound);

      // the right line of |--|
      lineCoordinates.push({
        x1: xMax,
        y1: yMin,
        x2: xMax,
        y2: yMax
      });
      // the middle line of |--|
      lineCoordinates.push({
        x1: xMin,
        y1: yMid,
        x2: xMax,
        y2: yMid
      });
      // the left line of |--|
      lineCoordinates.push({
        x1: xMin,
        y1: yMin,
        x2: xMin,
        y2: yMax
      });
    } else if (layout === 'horizontal') {
      // error bar for horizontal charts, the x is fixed, y is a range value
      var _scale = yAxis.scale;
      var xMid = x + offset;
      var _xMin = xMid - width;
      var _xMax = xMid + width;
      var _yMin = _scale(value - lowBound);
      var _yMax = _scale(value + highBound);

      // the top line
      lineCoordinates.push({
        x1: _xMin,
        y1: _yMax,
        x2: _xMax,
        y2: _yMax
      });
      // the middle line
      lineCoordinates.push({
        x1: xMid,
        y1: _yMin,
        x2: xMid,
        y2: _yMax
      });
      // the bottom line
      lineCoordinates.push({
        x1: _xMin,
        y1: _yMin,
        x2: _xMax,
        y2: _yMin
      });
    }
    return (
      /*#__PURE__*/
      // eslint-disable-next-line react/no-array-index-key
      react.createElement(Layer, ErrorBar_extends({
        className: "recharts-errorBar",
        key: "bar-".concat(i)
      }, svgProps), lineCoordinates.map(function (coordinates, index) {
        return (
          /*#__PURE__*/
          // eslint-disable-next-line react/no-array-index-key
          react.createElement("line", ErrorBar_extends({}, coordinates, {
            key: "line-".concat(index)
          }))
        );
      }))
    );
  });
  return /*#__PURE__*/react.createElement(Layer, {
    className: "recharts-errorBars"
  }, errorBars);
}
ErrorBar.defaultProps = {
  stroke: 'black',
  strokeWidth: 1.5,
  width: 5,
  offset: 0,
  layout: 'horizontal'
};
ErrorBar.displayName = 'ErrorBar';
// EXTERNAL MODULE: ./node_modules/lodash/uniqBy.js
var uniqBy = __webpack_require__(14);
var uniqBy_default = /*#__PURE__*/__webpack_require__.n(uniqBy);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/container/Surface.js
var Surface_excluded = ["children", "width", "height", "viewBox", "className", "style"];
function Surface_extends() { Surface_extends = Object.assign ? Object.assign.bind() : 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 Surface_extends.apply(this, arguments); }
function Surface_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Surface_objectWithoutPropertiesLoose(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 Surface_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; }
/**
 * @fileOverview Surface
 */



function Surface(props) {
  var children = props.children,
    width = props.width,
    height = props.height,
    viewBox = props.viewBox,
    className = props.className,
    style = props.style,
    others = Surface_objectWithoutProperties(props, Surface_excluded);
  var svgView = viewBox || {
    width: width,
    height: height,
    x: 0,
    y: 0
  };
  var layerClass = classnames_default()('recharts-surface', className);
  return /*#__PURE__*/react.createElement("svg", Surface_extends({}, filterProps(others, true, 'svg'), {
    className: layerClass,
    width: width,
    height: height,
    style: style,
    viewBox: "".concat(svgView.x, " ").concat(svgView.y, " ").concat(svgView.width, " ").concat(svgView.height)
  }), /*#__PURE__*/react.createElement("title", null, props.title), /*#__PURE__*/react.createElement("desc", null, props.desc), children);
}
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/math.js
const abs = Math.abs;
const atan2 = Math.atan2;
const cos = Math.cos;
const math_max = Math.max;
const math_min = Math.min;
const sin = Math.sin;
const math_sqrt = Math.sqrt;

const math_epsilon = 1e-12;
const math_pi = Math.PI;
const halfPi = math_pi / 2;
const math_tau = 2 * math_pi;

function acos(x) {
  return x > 1 ? 0 : x < -1 ? math_pi : Math.acos(x);
}

function asin(x) {
  return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/circle.js


/* harmony default export */ var circle = ({
  draw(context, size) {
    const r = math_sqrt(size / math_pi);
    context.moveTo(r, 0);
    context.arc(0, 0, r, 0, math_tau);
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/cross.js


/* harmony default export */ var cross = ({
  draw(context, size) {
    const r = math_sqrt(size / 5) / 2;
    context.moveTo(-3 * r, -r);
    context.lineTo(-r, -r);
    context.lineTo(-r, -3 * r);
    context.lineTo(r, -3 * r);
    context.lineTo(r, -r);
    context.lineTo(3 * r, -r);
    context.lineTo(3 * r, r);
    context.lineTo(r, r);
    context.lineTo(r, 3 * r);
    context.lineTo(-r, 3 * r);
    context.lineTo(-r, r);
    context.lineTo(-3 * r, r);
    context.closePath();
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/diamond.js


const tan30 = math_sqrt(1 / 3);
const tan30_2 = tan30 * 2;

/* harmony default export */ var diamond = ({
  draw(context, size) {
    const y = math_sqrt(size / tan30_2);
    const x = y * tan30;
    context.moveTo(0, -y);
    context.lineTo(x, 0);
    context.lineTo(0, y);
    context.lineTo(-x, 0);
    context.closePath();
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/square.js


/* harmony default export */ var symbol_square = ({
  draw(context, size) {
    const w = math_sqrt(size);
    const x = -w / 2;
    context.rect(x, x, w, w);
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/star.js


const ka = 0.89081309152928522810;
const kr = sin(math_pi / 10) / sin(7 * math_pi / 10);
const kx = sin(math_tau / 10) * kr;
const ky = -cos(math_tau / 10) * kr;

/* harmony default export */ var star = ({
  draw(context, size) {
    const r = math_sqrt(size * ka);
    const x = kx * r;
    const y = ky * r;
    context.moveTo(0, -r);
    context.lineTo(x, y);
    for (let i = 1; i < 5; ++i) {
      const a = math_tau * i / 5;
      const c = cos(a);
      const s = sin(a);
      context.lineTo(s * r, -c * r);
      context.lineTo(c * x - s * y, s * x + c * y);
    }
    context.closePath();
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/triangle.js


const sqrt3 = math_sqrt(3);

/* harmony default export */ var triangle = ({
  draw(context, size) {
    const y = -math_sqrt(size / (sqrt3 * 3));
    context.moveTo(0, y * 2);
    context.lineTo(-sqrt3 * y, -y);
    context.lineTo(sqrt3 * y, -y);
    context.closePath();
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/wye.js


const wye_c = -0.5;
const wye_s = math_sqrt(3) / 2;
const wye_k = 1 / math_sqrt(12);
const wye_a = (wye_k / 2 + 1) * 3;

/* harmony default export */ var wye = ({
  draw(context, size) {
    const r = math_sqrt(size / wye_a);
    const x0 = r / 2, y0 = r * wye_k;
    const x1 = x0, y1 = r * wye_k + r;
    const x2 = -x1, y2 = y1;
    context.moveTo(x0, y0);
    context.lineTo(x1, y1);
    context.lineTo(x2, y2);
    context.lineTo(wye_c * x0 - wye_s * y0, wye_s * x0 + wye_c * y0);
    context.lineTo(wye_c * x1 - wye_s * y1, wye_s * x1 + wye_c * y1);
    context.lineTo(wye_c * x2 - wye_s * y2, wye_s * x2 + wye_c * y2);
    context.lineTo(wye_c * x0 + wye_s * y0, wye_c * y0 - wye_s * x0);
    context.lineTo(wye_c * x1 + wye_s * y1, wye_c * y1 - wye_s * x1);
    context.lineTo(wye_c * x2 + wye_s * y2, wye_c * y2 - wye_s * x2);
    context.closePath();
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/asterisk.js


const asterisk_sqrt3 = math_sqrt(3);

/* harmony default export */ var asterisk = ({
  draw(context, size) {
    const r = math_sqrt(size + math_min(size / 28, 0.75)) * 0.59436;
    const t = r / 2;
    const u = t * asterisk_sqrt3;
    context.moveTo(0, r);
    context.lineTo(0, -r);
    context.moveTo(-u, -t);
    context.lineTo(u, t);
    context.moveTo(-u, t);
    context.lineTo(u, -t);
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/diamond2.js


/* harmony default export */ var diamond2 = ({
  draw(context, size) {
    const r = math_sqrt(size) * 0.62625;
    context.moveTo(0, -r);
    context.lineTo(r, 0);
    context.lineTo(0, r);
    context.lineTo(-r, 0);
    context.closePath();
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/plus.js


/* harmony default export */ var plus = ({
  draw(context, size) {
    const r = math_sqrt(size - math_min(size / 7, 2)) * 0.87559;
    context.moveTo(-r, 0);
    context.lineTo(r, 0);
    context.moveTo(0, r);
    context.lineTo(0, -r);
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/square2.js


/* harmony default export */ var square2 = ({
  draw(context, size) {
    const r = math_sqrt(size) * 0.4431;
    context.moveTo(r, r);
    context.lineTo(r, -r);
    context.lineTo(-r, -r);
    context.lineTo(-r, r);
    context.closePath();
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/triangle2.js


const triangle2_sqrt3 = math_sqrt(3);

/* harmony default export */ var triangle2 = ({
  draw(context, size) {
    const s = math_sqrt(size) * 0.6824;
    const t = s  / 2;
    const u = (s * triangle2_sqrt3) / 2; // cos(Math.PI / 6)
    context.moveTo(0, -s);
    context.lineTo(u, t);
    context.lineTo(-u, t);
    context.closePath();
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol/times.js


/* harmony default export */ var times = ({
  draw(context, size) {
    const r = math_sqrt(size - math_min(size / 6, 1.7)) * 0.6189;
    context.moveTo(-r, -r);
    context.lineTo(r, r);
    context.moveTo(-r, r);
    context.lineTo(r, -r);
  }
});

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/d3-shape/src/symbol.js
















// These symbols are designed to be filled.
const symbolsFill = [
  circle,
  cross,
  diamond,
  symbol_square,
  star,
  triangle,
  wye
];

// These symbols are designed to be stroked (with a width of 1.5px and round caps).
const symbolsStroke = [
  circle,
  plus,
  times,
  triangle2,
  asterisk,
  square2,
  diamond2
];

function symbol_Symbol(type, size) {
  let context = null,
      path = withPath(symbol);

  type = typeof type === "function" ? type : src_constant(type || circle);
  size = typeof size === "function" ? size : src_constant(size === undefined ? 64 : +size);

  function symbol() {
    let buffer;
    if (!context) context = buffer = path();
    type.apply(this, arguments).draw(context, +size.apply(this, arguments));
    if (buffer) return context = null, buffer + "" || null;
  }

  symbol.type = function(_) {
    return arguments.length ? (type = typeof _ === "function" ? _ : src_constant(_), symbol) : type;
  };

  symbol.size = function(_) {
    return arguments.length ? (size = typeof _ === "function" ? _ : src_constant(+_), symbol) : size;
  };

  symbol.context = function(_) {
    return arguments.length ? (context = _ == null ? null : _, symbol) : context;
  };

  return symbol;
}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/shape/Symbols.js
function Symbols_typeof(obj) { "@babel/helpers - typeof"; return Symbols_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; }, Symbols_typeof(obj); }

var Symbols_excluded = ["type", "size", "sizeType"];
function Symbols_extends() { Symbols_extends = Object.assign ? Object.assign.bind() : 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 Symbols_extends.apply(this, arguments); }
function Symbols_ownKeys(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 Symbols_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Symbols_ownKeys(Object(source), !0).forEach(function (key) { Symbols_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Symbols_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Symbols_defineProperty(obj, key, value) { key = Symbols_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Symbols_toPropertyKey(arg) { var key = Symbols_toPrimitive(arg, "string"); return Symbols_typeof(key) === "symbol" ? key : String(key); }
function Symbols_toPrimitive(input, hint) { if (Symbols_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Symbols_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function Symbols_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Symbols_objectWithoutPropertiesLoose(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 Symbols_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; }
/**
 * @fileOverview Curve
 */




var symbolFactories = {
  symbolCircle: circle,
  symbolCross: cross,
  symbolDiamond: diamond,
  symbolSquare: symbol_square,
  symbolStar: star,
  symbolTriangle: triangle,
  symbolWye: wye
};
var RADIAN = Math.PI / 180;
var getSymbolFactory = function getSymbolFactory(type) {
  var name = "symbol".concat(upperFirst_default()(type));
  return symbolFactories[name] || circle;
};
var calculateAreaSize = function calculateAreaSize(size, sizeType, type) {
  if (sizeType === 'area') {
    return size;
  }
  switch (type) {
    case 'cross':
      return 5 * size * size / 9;
    case 'diamond':
      return 0.5 * size * size / Math.sqrt(3);
    case 'square':
      return size * size;
    case 'star':
      {
        var angle = 18 * RADIAN;
        return 1.25 * size * size * (Math.tan(angle) - Math.tan(angle * 2) * Math.pow(Math.tan(angle), 2));
      }
    case 'triangle':
      return Math.sqrt(3) * size * size / 4;
    case 'wye':
      return (21 - 10 * Math.sqrt(3)) * size * size / 8;
    default:
      return Math.PI * size * size / 4;
  }
};
var registerSymbol = function registerSymbol(key, factory) {
  symbolFactories["symbol".concat(upperFirst_default()(key))] = factory;
};
var Symbols = function Symbols(_ref) {
  var _ref$type = _ref.type,
    type = _ref$type === void 0 ? 'circle' : _ref$type,
    _ref$size = _ref.size,
    size = _ref$size === void 0 ? 64 : _ref$size,
    _ref$sizeType = _ref.sizeType,
    sizeType = _ref$sizeType === void 0 ? 'area' : _ref$sizeType,
    rest = Symbols_objectWithoutProperties(_ref, Symbols_excluded);
  var props = Symbols_objectSpread(Symbols_objectSpread({}, rest), {}, {
    type: type,
    size: size,
    sizeType: sizeType
  });

  /**
   * Calculate the path of curve
   * @return {String} path
   */
  var getPath = function getPath() {
    var symbolFactory = getSymbolFactory(type);
    var symbol = symbol_Symbol().type(symbolFactory).size(calculateAreaSize(size, sizeType, type));
    return symbol();
  };
  var className = props.className,
    cx = props.cx,
    cy = props.cy;
  var filteredProps = filterProps(props, true);
  if (cx === +cx && cy === +cy && size === +size) {
    return /*#__PURE__*/react.createElement("path", Symbols_extends({}, filteredProps, {
      className: classnames_default()('recharts-symbols', className),
      transform: "translate(".concat(cx, ", ").concat(cy, ")"),
      d: getPath()
    }));
  }
  return null;
};
Symbols.registerSymbol = registerSymbol;
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/component/DefaultLegendContent.js
function DefaultLegendContent_typeof(obj) { "@babel/helpers - typeof"; return DefaultLegendContent_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; }, DefaultLegendContent_typeof(obj); }
function DefaultLegendContent_extends() { DefaultLegendContent_extends = Object.assign ? Object.assign.bind() : 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 DefaultLegendContent_extends.apply(this, arguments); }
function DefaultLegendContent_ownKeys(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 DefaultLegendContent_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? DefaultLegendContent_ownKeys(Object(source), !0).forEach(function (key) { DefaultLegendContent_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : DefaultLegendContent_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function DefaultLegendContent_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function DefaultLegendContent_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, DefaultLegendContent_toPropertyKey(descriptor.key), descriptor); } }
function DefaultLegendContent_createClass(Constructor, protoProps, staticProps) { if (protoProps) DefaultLegendContent_defineProperties(Constructor.prototype, protoProps); if (staticProps) DefaultLegendContent_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function DefaultLegendContent_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) DefaultLegendContent_setPrototypeOf(subClass, superClass); }
function DefaultLegendContent_setPrototypeOf(o, p) { DefaultLegendContent_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DefaultLegendContent_setPrototypeOf(o, p); }
function DefaultLegendContent_createSuper(Derived) { var hasNativeReflectConstruct = DefaultLegendContent_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = DefaultLegendContent_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = DefaultLegendContent_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return DefaultLegendContent_possibleConstructorReturn(this, result); }; }
function DefaultLegendContent_possibleConstructorReturn(self, call) { if (call && (DefaultLegendContent_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return DefaultLegendContent_assertThisInitialized(self); }
function DefaultLegendContent_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function DefaultLegendContent_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function DefaultLegendContent_getPrototypeOf(o) { DefaultLegendContent_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DefaultLegendContent_getPrototypeOf(o); }
function DefaultLegendContent_defineProperty(obj, key, value) { key = DefaultLegendContent_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function DefaultLegendContent_toPropertyKey(arg) { var key = DefaultLegendContent_toPrimitive(arg, "string"); return DefaultLegendContent_typeof(key) === "symbol" ? key : String(key); }
function DefaultLegendContent_toPrimitive(input, hint) { if (DefaultLegendContent_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (DefaultLegendContent_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Default Legend Content
 */





var DefaultLegendContent_SIZE = 32;
var DefaultLegendContent = /*#__PURE__*/function (_PureComponent) {
  DefaultLegendContent_inherits(DefaultLegendContent, _PureComponent);
  var _super = DefaultLegendContent_createSuper(DefaultLegendContent);
  function DefaultLegendContent() {
    DefaultLegendContent_classCallCheck(this, DefaultLegendContent);
    return _super.apply(this, arguments);
  }
  DefaultLegendContent_createClass(DefaultLegendContent, [{
    key: "renderIcon",
    value:
    /**
     * Render the path of icon
     * @param {Object} data Data of each legend item
     * @return {String} Path element
     */
    function renderIcon(data) {
      var inactiveColor = this.props.inactiveColor;
      var halfSize = DefaultLegendContent_SIZE / 2;
      var sixthSize = DefaultLegendContent_SIZE / 6;
      var thirdSize = DefaultLegendContent_SIZE / 3;
      var color = data.inactive ? inactiveColor : data.color;
      if (data.type === 'plainline') {
        return /*#__PURE__*/react.createElement("line", {
          strokeWidth: 4,
          fill: "none",
          stroke: color,
          strokeDasharray: data.payload.strokeDasharray,
          x1: 0,
          y1: halfSize,
          x2: DefaultLegendContent_SIZE,
          y2: halfSize,
          className: "recharts-legend-icon"
        });
      }
      if (data.type === 'line') {
        return /*#__PURE__*/react.createElement("path", {
          strokeWidth: 4,
          fill: "none",
          stroke: color,
          d: "M0,".concat(halfSize, "h").concat(thirdSize, "\n            A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(2 * thirdSize, ",").concat(halfSize, "\n            H").concat(DefaultLegendContent_SIZE, "M").concat(2 * thirdSize, ",").concat(halfSize, "\n            A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(thirdSize, ",").concat(halfSize),
          className: "recharts-legend-icon"
        });
      }
      if (data.type === 'rect') {
        return /*#__PURE__*/react.createElement("path", {
          stroke: "none",
          fill: color,
          d: "M0,".concat(DefaultLegendContent_SIZE / 8, "h").concat(DefaultLegendContent_SIZE, "v").concat(DefaultLegendContent_SIZE * 3 / 4, "h").concat(-DefaultLegendContent_SIZE, "z"),
          className: "recharts-legend-icon"
        });
      }
      if ( /*#__PURE__*/react.isValidElement(data.legendIcon)) {
        var iconProps = DefaultLegendContent_objectSpread({}, data);
        delete iconProps.legendIcon;
        return /*#__PURE__*/react.cloneElement(data.legendIcon, iconProps);
      }
      return /*#__PURE__*/react.createElement(Symbols, {
        fill: color,
        cx: halfSize,
        cy: halfSize,
        size: DefaultLegendContent_SIZE,
        sizeType: "diameter",
        type: data.type
      });
    }

    /**
     * Draw items of legend
     * @return {ReactElement} Items
     */
  }, {
    key: "renderItems",
    value: function renderItems() {
      var _this = this;
      var _this$props = this.props,
        payload = _this$props.payload,
        iconSize = _this$props.iconSize,
        layout = _this$props.layout,
        formatter = _this$props.formatter,
        inactiveColor = _this$props.inactiveColor;
      var viewBox = {
        x: 0,
        y: 0,
        width: DefaultLegendContent_SIZE,
        height: DefaultLegendContent_SIZE
      };
      var itemStyle = {
        display: layout === 'horizontal' ? 'inline-block' : 'block',
        marginRight: 10
      };
      var svgStyle = {
        display: 'inline-block',
        verticalAlign: 'middle',
        marginRight: 4
      };
      return payload.map(function (entry, i) {
        var _classNames;
        var finalFormatter = entry.formatter || formatter;
        var className = classnames_default()((_classNames = {
          'recharts-legend-item': true
        }, DefaultLegendContent_defineProperty(_classNames, "legend-item-".concat(i), true), DefaultLegendContent_defineProperty(_classNames, "inactive", entry.inactive), _classNames));
        if (entry.type === 'none') {
          return null;
        }
        var color = entry.inactive ? inactiveColor : entry.color;
        return /*#__PURE__*/react.createElement("li", DefaultLegendContent_extends({
          className: className,
          style: itemStyle,
          key: "legend-item-".concat(i) // eslint-disable-line react/no-array-index-key
        }, adaptEventsOfChild(_this.props, entry, i)), /*#__PURE__*/react.createElement(Surface, {
          width: iconSize,
          height: iconSize,
          viewBox: viewBox,
          style: svgStyle
        }, _this.renderIcon(entry)), /*#__PURE__*/react.createElement("span", {
          className: "recharts-legend-item-text",
          style: {
            color: color
          }
        }, finalFormatter ? finalFormatter(entry.value, entry, i) : entry.value));
      });
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props2 = this.props,
        payload = _this$props2.payload,
        layout = _this$props2.layout,
        align = _this$props2.align;
      if (!payload || !payload.length) {
        return null;
      }
      var finalStyle = {
        padding: 0,
        margin: 0,
        textAlign: layout === 'horizontal' ? align : 'left'
      };
      return /*#__PURE__*/react.createElement("ul", {
        className: "recharts-default-legend",
        style: finalStyle
      }, this.renderItems());
    }
  }]);
  return DefaultLegendContent;
}(react.PureComponent);
DefaultLegendContent_defineProperty(DefaultLegendContent, "displayName", 'Legend');
DefaultLegendContent_defineProperty(DefaultLegendContent, "defaultProps", {
  iconSize: 14,
  layout: 'horizontal',
  align: 'center',
  verticalAlign: 'middle',
  inactiveColor: '#ccc'
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/component/Legend.js
function Legend_typeof(obj) { "@babel/helpers - typeof"; return Legend_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; }, Legend_typeof(obj); }


var Legend_excluded = ["ref"];
function Legend_ownKeys(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 Legend_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Legend_ownKeys(Object(source), !0).forEach(function (key) { Legend_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Legend_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Legend_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Legend_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, Legend_toPropertyKey(descriptor.key), descriptor); } }
function Legend_createClass(Constructor, protoProps, staticProps) { if (protoProps) Legend_defineProperties(Constructor.prototype, protoProps); if (staticProps) Legend_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function Legend_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Legend_setPrototypeOf(subClass, superClass); }
function Legend_setPrototypeOf(o, p) { Legend_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Legend_setPrototypeOf(o, p); }
function Legend_createSuper(Derived) { var hasNativeReflectConstruct = Legend_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Legend_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Legend_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Legend_possibleConstructorReturn(this, result); }; }
function Legend_possibleConstructorReturn(self, call) { if (call && (Legend_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Legend_assertThisInitialized(self); }
function Legend_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Legend_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function Legend_getPrototypeOf(o) { Legend_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Legend_getPrototypeOf(o); }
function Legend_defineProperty(obj, key, value) { key = Legend_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Legend_toPropertyKey(arg) { var key = Legend_toPrimitive(arg, "string"); return Legend_typeof(key) === "symbol" ? key : String(key); }
function Legend_toPrimitive(input, hint) { if (Legend_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Legend_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function Legend_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Legend_objectWithoutPropertiesLoose(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 Legend_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; }
/**
 * @fileOverview Legend
 */



function defaultUniqBy(entry) {
  return entry.value;
}
function getUniqPayload(option, payload) {
  if (option === true) {
    return uniqBy_default()(payload, defaultUniqBy);
  }
  if (isFunction_default()(option)) {
    return uniqBy_default()(payload, option);
  }
  return payload;
}
function renderContent(content, props) {
  if ( /*#__PURE__*/react.isValidElement(content)) {
    return /*#__PURE__*/react.cloneElement(content, props);
  }
  if (isFunction_default()(content)) {
    return /*#__PURE__*/react.createElement(content, props);
  }
  var ref = props.ref,
    otherProps = Legend_objectWithoutProperties(props, Legend_excluded);
  return /*#__PURE__*/react.createElement(DefaultLegendContent, otherProps);
}
var EPS = 1;
var Legend = /*#__PURE__*/function (_PureComponent) {
  Legend_inherits(Legend, _PureComponent);
  var _super = Legend_createSuper(Legend);
  function Legend() {
    var _this;
    Legend_classCallCheck(this, Legend);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    Legend_defineProperty(Legend_assertThisInitialized(_this), "state", {
      boxWidth: -1,
      boxHeight: -1
    });
    return _this;
  }
  Legend_createClass(Legend, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.updateBBox();
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate() {
      this.updateBBox();
    }
  }, {
    key: "getBBox",
    value: function getBBox() {
      if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
        return this.wrapperNode.getBoundingClientRect();
      }
      return null;
    }
  }, {
    key: "getBBoxSnapshot",
    value: function getBBoxSnapshot() {
      var _this$state = this.state,
        boxWidth = _this$state.boxWidth,
        boxHeight = _this$state.boxHeight;
      if (boxWidth >= 0 && boxHeight >= 0) {
        return {
          width: boxWidth,
          height: boxHeight
        };
      }
      return null;
    }
  }, {
    key: "getDefaultPosition",
    value: function getDefaultPosition(style) {
      var _this$props = this.props,
        layout = _this$props.layout,
        align = _this$props.align,
        verticalAlign = _this$props.verticalAlign,
        margin = _this$props.margin,
        chartWidth = _this$props.chartWidth,
        chartHeight = _this$props.chartHeight;
      var hPos, vPos;
      if (!style || (style.left === undefined || style.left === null) && (style.right === undefined || style.right === null)) {
        if (align === 'center' && layout === 'vertical') {
          var _box = this.getBBoxSnapshot() || {
            width: 0
          };
          hPos = {
            left: ((chartWidth || 0) - _box.width) / 2
          };
        } else {
          hPos = align === 'right' ? {
            right: margin && margin.right || 0
          } : {
            left: margin && margin.left || 0
          };
        }
      }
      if (!style || (style.top === undefined || style.top === null) && (style.bottom === undefined || style.bottom === null)) {
        if (verticalAlign === 'middle') {
          var _box2 = this.getBBoxSnapshot() || {
            height: 0
          };
          vPos = {
            top: ((chartHeight || 0) - _box2.height) / 2
          };
        } else {
          vPos = verticalAlign === 'bottom' ? {
            bottom: margin && margin.bottom || 0
          } : {
            top: margin && margin.top || 0
          };
        }
      }
      return Legend_objectSpread(Legend_objectSpread({}, hPos), vPos);
    }
  }, {
    key: "updateBBox",
    value: function updateBBox() {
      var _this$state2 = this.state,
        boxWidth = _this$state2.boxWidth,
        boxHeight = _this$state2.boxHeight;
      var onBBoxUpdate = this.props.onBBoxUpdate;
      if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
        var _box3 = this.wrapperNode.getBoundingClientRect();
        if (Math.abs(_box3.width - boxWidth) > EPS || Math.abs(_box3.height - boxHeight) > EPS) {
          this.setState({
            boxWidth: _box3.width,
            boxHeight: _box3.height
          }, function () {
            if (onBBoxUpdate) {
              onBBoxUpdate(_box3);
            }
          });
        }
      } else if (boxWidth !== -1 || boxHeight !== -1) {
        this.setState({
          boxWidth: -1,
          boxHeight: -1
        }, function () {
          if (onBBoxUpdate) {
            onBBoxUpdate(null);
          }
        });
      }
    }
  }, {
    key: "render",
    value: function render() {
      var _this2 = this;
      var _this$props2 = this.props,
        content = _this$props2.content,
        width = _this$props2.width,
        height = _this$props2.height,
        wrapperStyle = _this$props2.wrapperStyle,
        payloadUniqBy = _this$props2.payloadUniqBy,
        payload = _this$props2.payload;
      var outerStyle = Legend_objectSpread(Legend_objectSpread({
        position: 'absolute',
        width: width || 'auto',
        height: height || 'auto'
      }, this.getDefaultPosition(wrapperStyle)), wrapperStyle);
      return /*#__PURE__*/react.createElement("div", {
        className: "recharts-legend-wrapper",
        style: outerStyle,
        ref: function ref(node) {
          _this2.wrapperNode = node;
        }
      }, renderContent(content, Legend_objectSpread(Legend_objectSpread({}, this.props), {}, {
        payload: getUniqPayload(payloadUniqBy, payload)
      })));
    }
  }], [{
    key: "getWithHeight",
    value: function getWithHeight(item, chartWidth) {
      var layout = item.props.layout;
      if (layout === 'vertical' && isNumber(item.props.height)) {
        return {
          height: item.props.height
        };
      }
      if (layout === 'horizontal') {
        return {
          width: item.props.width || chartWidth
        };
      }
      return null;
    }
  }]);
  return Legend;
}(react.PureComponent);
Legend_defineProperty(Legend, "displayName", 'Legend');
Legend_defineProperty(Legend, "defaultProps", {
  iconSize: 14,
  layout: 'horizontal',
  align: 'center',
  verticalAlign: 'bottom'
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/ChartUtils.js












function ChartUtils_typeof(obj) { "@babel/helpers - typeof"; return ChartUtils_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; }, ChartUtils_typeof(obj); }
function ChartUtils_toConsumableArray(arr) { return ChartUtils_arrayWithoutHoles(arr) || ChartUtils_iterableToArray(arr) || ChartUtils_unsupportedIterableToArray(arr) || ChartUtils_nonIterableSpread(); }
function ChartUtils_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."); }
function ChartUtils_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ChartUtils_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 ChartUtils_arrayLikeToArray(o, minLen); }
function ChartUtils_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function ChartUtils_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return ChartUtils_arrayLikeToArray(arr); }
function ChartUtils_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 ChartUtils_ownKeys(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 ChartUtils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ChartUtils_ownKeys(Object(source), !0).forEach(function (key) { ChartUtils_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ChartUtils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function ChartUtils_defineProperty(obj, key, value) { key = ChartUtils_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function ChartUtils_toPropertyKey(arg) { var key = ChartUtils_toPrimitive(arg, "string"); return ChartUtils_typeof(key) === "symbol" ? key : String(key); }
function ChartUtils_toPrimitive(input, hint) { if (ChartUtils_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (ChartUtils_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }







// TODO: Cause of circular dependency. Needs refactor.
// import { RadiusAxisProps, AngleAxisProps } from '../polar/types';
function getValueByDataKey(obj, dataKey, defaultValue) {
  if (isNil_default()(obj) || isNil_default()(dataKey)) {
    return defaultValue;
  }
  if (isNumOrStr(dataKey)) {
    return get_default()(obj, dataKey, defaultValue);
  }
  if (isFunction_default()(dataKey)) {
    return dataKey(obj);
  }
  return defaultValue;
}
/**
 * Get domain of data by key
 * @param  {Array}   data      The data displayed in the chart
 * @param  {String}  key       The unique key of a group of data
 * @param  {String}  type      The type of axis
 * @param  {Boolean} filterNil Whether or not filter nil values
 * @return {Array} Domain of data
 */
function getDomainOfDataByKey(data, key, type, filterNil) {
  var flattenData = flatMap_default()(data, function (entry) {
    return getValueByDataKey(entry, key);
  });
  if (type === 'number') {
    var domain = flattenData.filter(function (entry) {
      return isNumber(entry) || parseFloat(entry);
    });
    return domain.length ? [min_default()(domain), max_default()(domain)] : [Infinity, -Infinity];
  }
  var validateData = filterNil ? flattenData.filter(function (entry) {
    return !isNil_default()(entry);
  }) : flattenData;

  // 支持Date类型的x轴
  return validateData.map(function (entry) {
    return isNumOrStr(entry) || entry instanceof Date ? entry : '';
  });
}
var calculateActiveTickIndex = function calculateActiveTickIndex(coordinate) {
  var _ticks$length;
  var ticks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  var unsortedTicks = arguments.length > 2 ? arguments[2] : undefined;
  var axis = arguments.length > 3 ? arguments[3] : undefined;
  var index = -1;
  var len = (_ticks$length = ticks === null || ticks === void 0 ? void 0 : ticks.length) !== null && _ticks$length !== void 0 ? _ticks$length : 0;

  // if there are 1 or less ticks ticks then the active tick is at index 0
  if (len <= 1) {
    return 0;
  }
  if (axis && axis.axisType === 'angleAxis' && Math.abs(Math.abs(axis.range[1] - axis.range[0]) - 360) <= 1e-6) {
    var range = axis.range;
    // ticks are distributed in a circle
    for (var i = 0; i < len; i++) {
      var before = i > 0 ? unsortedTicks[i - 1].coordinate : unsortedTicks[len - 1].coordinate;
      var cur = unsortedTicks[i].coordinate;
      var after = i >= len - 1 ? unsortedTicks[0].coordinate : unsortedTicks[i + 1].coordinate;
      var sameDirectionCoord = void 0;
      if (mathSign(cur - before) !== mathSign(after - cur)) {
        var diffInterval = [];
        if (mathSign(after - cur) === mathSign(range[1] - range[0])) {
          sameDirectionCoord = after;
          var curInRange = cur + range[1] - range[0];
          diffInterval[0] = Math.min(curInRange, (curInRange + before) / 2);
          diffInterval[1] = Math.max(curInRange, (curInRange + before) / 2);
        } else {
          sameDirectionCoord = before;
          var afterInRange = after + range[1] - range[0];
          diffInterval[0] = Math.min(cur, (afterInRange + cur) / 2);
          diffInterval[1] = Math.max(cur, (afterInRange + cur) / 2);
        }
        var sameInterval = [Math.min(cur, (sameDirectionCoord + cur) / 2), Math.max(cur, (sameDirectionCoord + cur) / 2)];
        if (coordinate > sameInterval[0] && coordinate <= sameInterval[1] || coordinate >= diffInterval[0] && coordinate <= diffInterval[1]) {
          index = unsortedTicks[i].index;
          break;
        }
      } else {
        var min = Math.min(before, after);
        var max = Math.max(before, after);
        if (coordinate > (min + cur) / 2 && coordinate <= (max + cur) / 2) {
          index = unsortedTicks[i].index;
          break;
        }
      }
    }
  } else {
    // ticks are distributed in a single direction
    for (var _i = 0; _i < len; _i++) {
      if (_i === 0 && coordinate <= (ticks[_i].coordinate + ticks[_i + 1].coordinate) / 2 || _i > 0 && _i < len - 1 && coordinate > (ticks[_i].coordinate + ticks[_i - 1].coordinate) / 2 && coordinate <= (ticks[_i].coordinate + ticks[_i + 1].coordinate) / 2 || _i === len - 1 && coordinate > (ticks[_i].coordinate + ticks[_i - 1].coordinate) / 2) {
        index = ticks[_i].index;
        break;
      }
    }
  }
  return index;
};

/**
 * Get the main color of each graphic item
 * @param  {ReactElement} item A graphic item
 * @return {String}            Color
 */
var getMainColorOfGraphicItem = function getMainColorOfGraphicItem(item) {
  var _ref = item,
    displayName = _ref.type.displayName; // TODO: check if displayName is valid.
  var _item$props = item.props,
    stroke = _item$props.stroke,
    fill = _item$props.fill;
  var result;
  switch (displayName) {
    case 'Line':
      result = stroke;
      break;
    case 'Area':
    case 'Radar':
      result = stroke && stroke !== 'none' ? stroke : fill;
      break;
    default:
      result = fill;
      break;
  }
  return result;
};
var getLegendProps = function getLegendProps(_ref2) {
  var children = _ref2.children,
    formattedGraphicalItems = _ref2.formattedGraphicalItems,
    legendWidth = _ref2.legendWidth,
    legendContent = _ref2.legendContent;
  var legendItem = findChildByType(children, Legend);
  if (!legendItem) {
    return null;
  }
  var legendData;
  if (legendItem.props && legendItem.props.payload) {
    legendData = legendItem.props && legendItem.props.payload;
  } else if (legendContent === 'children') {
    legendData = (formattedGraphicalItems || []).reduce(function (result, _ref3) {
      var item = _ref3.item,
        props = _ref3.props;
      var data = props.sectors || props.data || [];
      return result.concat(data.map(function (entry) {
        return {
          type: legendItem.props.iconType || item.props.legendType,
          value: entry.name,
          color: entry.fill,
          payload: entry
        };
      }));
    }, []);
  } else {
    legendData = (formattedGraphicalItems || []).map(function (_ref4) {
      var item = _ref4.item;
      var _item$props2 = item.props,
        dataKey = _item$props2.dataKey,
        name = _item$props2.name,
        legendType = _item$props2.legendType,
        hide = _item$props2.hide;
      return {
        inactive: hide,
        dataKey: dataKey,
        type: legendItem.props.iconType || legendType || 'square',
        color: getMainColorOfGraphicItem(item),
        value: name || dataKey,
        payload: item.props
      };
    });
  }
  return ChartUtils_objectSpread(ChartUtils_objectSpread(ChartUtils_objectSpread({}, legendItem.props), Legend.getWithHeight(legendItem, legendWidth)), {}, {
    payload: legendData,
    item: legendItem
  });
};
/**
 * Calculate the size of all groups for stacked bar graph
 * @param  {Object} stackGroups The items grouped by axisId and stackId
 * @return {Object} The size of all groups
 */
var getBarSizeList = function getBarSizeList(_ref5) {
  var globalSize = _ref5.barSize,
    _ref5$stackGroups = _ref5.stackGroups,
    stackGroups = _ref5$stackGroups === void 0 ? {} : _ref5$stackGroups;
  if (!stackGroups) {
    return {};
  }
  var result = {};
  var numericAxisIds = Object.keys(stackGroups);
  for (var i = 0, len = numericAxisIds.length; i < len; i++) {
    var sgs = stackGroups[numericAxisIds[i]].stackGroups;
    var stackIds = Object.keys(sgs);
    for (var j = 0, sLen = stackIds.length; j < sLen; j++) {
      var _sgs$stackIds$j = sgs[stackIds[j]],
        items = _sgs$stackIds$j.items,
        cateAxisId = _sgs$stackIds$j.cateAxisId;
      var barItems = items.filter(function (item) {
        return getDisplayName(item.type).indexOf('Bar') >= 0;
      });
      if (barItems && barItems.length) {
        var selfSize = barItems[0].props.barSize;
        var cateId = barItems[0].props[cateAxisId];
        if (!result[cateId]) {
          result[cateId] = [];
        }
        result[cateId].push({
          item: barItems[0],
          stackList: barItems.slice(1),
          barSize: isNil_default()(selfSize) ? globalSize : selfSize
        });
      }
    }
  }
  return result;
};

/**
 * Calculate the size of each bar and the gap between two bars
 * @param  {Number} bandSize  The size of each category
 * @param  {sizeList} sizeList  The size of all groups
 * @param  {maxBarSize} maxBarSize The maximum size of bar
 * @return {Number} The size of each bar and the gap between two bars
 */
var getBarPosition = function getBarPosition(_ref6) {
  var barGap = _ref6.barGap,
    barCategoryGap = _ref6.barCategoryGap,
    bandSize = _ref6.bandSize,
    _ref6$sizeList = _ref6.sizeList,
    sizeList = _ref6$sizeList === void 0 ? [] : _ref6$sizeList,
    maxBarSize = _ref6.maxBarSize;
  var len = sizeList.length;
  if (len < 1) return null;
  var realBarGap = getPercentValue(barGap, bandSize, 0, true);
  var result;

  // whether or not is barSize setted by user
  if (sizeList[0].barSize === +sizeList[0].barSize) {
    var useFull = false;
    var fullBarSize = bandSize / len;
    var sum = sizeList.reduce(function (res, entry) {
      return res + entry.barSize || 0;
    }, 0);
    sum += (len - 1) * realBarGap;
    if (sum >= bandSize) {
      sum -= (len - 1) * realBarGap;
      realBarGap = 0;
    }
    if (sum >= bandSize && fullBarSize > 0) {
      useFull = true;
      fullBarSize *= 0.9;
      sum = len * fullBarSize;
    }
    var offset = (bandSize - sum) / 2 >> 0;
    var prev = {
      offset: offset - realBarGap,
      size: 0
    };
    result = sizeList.reduce(function (res, entry) {
      var newRes = [].concat(ChartUtils_toConsumableArray(res), [{
        item: entry.item,
        position: {
          offset: prev.offset + prev.size + realBarGap,
          size: useFull ? fullBarSize : entry.barSize
        }
      }]);
      prev = newRes[newRes.length - 1].position;
      if (entry.stackList && entry.stackList.length) {
        entry.stackList.forEach(function (item) {
          newRes.push({
            item: item,
            position: prev
          });
        });
      }
      return newRes;
    }, []);
  } else {
    var _offset = getPercentValue(barCategoryGap, bandSize, 0, true);
    if (bandSize - 2 * _offset - (len - 1) * realBarGap <= 0) {
      realBarGap = 0;
    }
    var originalSize = (bandSize - 2 * _offset - (len - 1) * realBarGap) / len;
    if (originalSize > 1) {
      originalSize >>= 0;
    }
    var size = maxBarSize === +maxBarSize ? Math.min(originalSize, maxBarSize) : originalSize;
    result = sizeList.reduce(function (res, entry, i) {
      var newRes = [].concat(ChartUtils_toConsumableArray(res), [{
        item: entry.item,
        position: {
          offset: _offset + (originalSize + realBarGap) * i + (originalSize - size) / 2,
          size: size
        }
      }]);
      if (entry.stackList && entry.stackList.length) {
        entry.stackList.forEach(function (item) {
          newRes.push({
            item: item,
            position: newRes[newRes.length - 1].position
          });
        });
      }
      return newRes;
    }, []);
  }
  return result;
};
var appendOffsetOfLegend = function appendOffsetOfLegend(offset, items, props, legendBox) {
  var children = props.children,
    width = props.width,
    margin = props.margin;
  var legendWidth = width - (margin.left || 0) - (margin.right || 0);
  // const legendHeight = height - (margin.top || 0) - (margin.bottom || 0);
  var legendProps = getLegendProps({
    children: children,
    legendWidth: legendWidth
  });
  var newOffset = offset;
  if (legendProps) {
    var box = legendBox || {};
    var align = legendProps.align,
      verticalAlign = legendProps.verticalAlign,
      layout = legendProps.layout;
    if ((layout === 'vertical' || layout === 'horizontal' && verticalAlign === 'middle') && isNumber(offset[align])) {
      newOffset = ChartUtils_objectSpread(ChartUtils_objectSpread({}, offset), {}, ChartUtils_defineProperty({}, align, newOffset[align] + (box.width || 0)));
    }
    if ((layout === 'horizontal' || layout === 'vertical' && align === 'center') && isNumber(offset[verticalAlign])) {
      newOffset = ChartUtils_objectSpread(ChartUtils_objectSpread({}, offset), {}, ChartUtils_defineProperty({}, verticalAlign, newOffset[verticalAlign] + (box.height || 0)));
    }
  }
  return newOffset;
};
var isErrorBarRelevantForAxis = function isErrorBarRelevantForAxis(layout, axisType, direction) {
  if (isNil_default()(axisType)) {
    return true;
  }
  if (layout === 'horizontal') {
    return axisType === 'yAxis';
  }
  if (layout === 'vertical') {
    return axisType === 'xAxis';
  }
  if (direction === 'x') {
    return axisType === 'xAxis';
  }
  if (direction === 'y') {
    return axisType === 'yAxis';
  }
  return true;
};
var getDomainOfErrorBars = function getDomainOfErrorBars(data, item, dataKey, layout, axisType) {
  var children = item.props.children;
  var errorBars = findAllByType(children, ErrorBar).filter(function (errorBarChild) {
    return isErrorBarRelevantForAxis(layout, axisType, errorBarChild.props.direction);
  });
  if (errorBars && errorBars.length) {
    var keys = errorBars.map(function (errorBarChild) {
      return errorBarChild.props.dataKey;
    });
    return data.reduce(function (result, entry) {
      var entryValue = getValueByDataKey(entry, dataKey, 0);
      var mainValue = isArray_default()(entryValue) ? [min_default()(entryValue), max_default()(entryValue)] : [entryValue, entryValue];
      var errorDomain = keys.reduce(function (prevErrorArr, k) {
        var errorValue = getValueByDataKey(entry, k, 0);
        var lowerValue = mainValue[0] - Math.abs(isArray_default()(errorValue) ? errorValue[0] : errorValue);
        var upperValue = mainValue[1] + Math.abs(isArray_default()(errorValue) ? errorValue[1] : errorValue);
        return [Math.min(lowerValue, prevErrorArr[0]), Math.max(upperValue, prevErrorArr[1])];
      }, [Infinity, -Infinity]);
      return [Math.min(errorDomain[0], result[0]), Math.max(errorDomain[1], result[1])];
    }, [Infinity, -Infinity]);
  }
  return null;
};
var parseErrorBarsOfAxis = function parseErrorBarsOfAxis(data, items, dataKey, axisType, layout) {
  var domains = items.map(function (item) {
    return getDomainOfErrorBars(data, item, dataKey, layout, axisType);
  }).filter(function (entry) {
    return !isNil_default()(entry);
  });
  if (domains && domains.length) {
    return domains.reduce(function (result, entry) {
      return [Math.min(result[0], entry[0]), Math.max(result[1], entry[1])];
    }, [Infinity, -Infinity]);
  }
  return null;
};

/**
 * Get domain of data by the configuration of item element
 * @param  {Array}   data      The data displayed in the chart
 * @param  {Array}   items     The instances of item
 * @param  {String}  type      The type of axis, number - Number Axis, category - Category Axis
 * @param  {LayoutType} layout The type of layout
 * @param  {Boolean} filterNil Whether or not filter nil values
 * @return {Array}        Domain
 */
var getDomainOfItemsWithSameAxis = function getDomainOfItemsWithSameAxis(data, items, type, layout, filterNil) {
  var domains = items.map(function (item) {
    var dataKey = item.props.dataKey;
    if (type === 'number' && dataKey) {
      return getDomainOfErrorBars(data, item, dataKey, layout) || getDomainOfDataByKey(data, dataKey, type, filterNil);
    }
    return getDomainOfDataByKey(data, dataKey, type, filterNil);
  });
  if (type === 'number') {
    // Calculate the domain of number axis
    return domains.reduce(function (result, entry) {
      return [Math.min(result[0], entry[0]), Math.max(result[1], entry[1])];
    }, [Infinity, -Infinity]);
  }
  var tag = {};
  // Get the union set of category axis
  return domains.reduce(function (result, entry) {
    for (var i = 0, len = entry.length; i < len; i++) {
      if (!tag[entry[i]]) {
        tag[entry[i]] = true;
        result.push(entry[i]);
      }
    }
    return result;
  }, []);
};
var isCategoricalAxis = function isCategoricalAxis(layout, axisType) {
  return layout === 'horizontal' && axisType === 'xAxis' || layout === 'vertical' && axisType === 'yAxis' || layout === 'centric' && axisType === 'angleAxis' || layout === 'radial' && axisType === 'radiusAxis';
};

/**
 * Calculate the Coordinates of grid
 * @param  {Array} ticks The ticks in axis
 * @param {Number} min   The minimun value of axis
 * @param {Number} max   The maximun value of axis
 * @return {Array}       Coordinates
 */
var getCoordinatesOfGrid = function getCoordinatesOfGrid(ticks, min, max) {
  var hasMin, hasMax;
  var values = ticks.map(function (entry) {
    if (entry.coordinate === min) {
      hasMin = true;
    }
    if (entry.coordinate === max) {
      hasMax = true;
    }
    return entry.coordinate;
  });
  if (!hasMin) {
    values.push(min);
  }
  if (!hasMax) {
    values.push(max);
  }
  return values;
};

/**
 * Get the ticks of an axis
 * @param  {Object}  axis The configuration of an axis
 * @param {Boolean} isGrid Whether or not are the ticks in grid
 * @param {Boolean} isAll Return the ticks of all the points or not
 * @return {Array}  Ticks
 */
var getTicksOfAxis = function getTicksOfAxis(axis, isGrid, isAll) {
  if (!axis) return null;
  var scale = axis.scale;
  var duplicateDomain = axis.duplicateDomain,
    type = axis.type,
    range = axis.range;
  var offsetForBand = axis.realScaleType === 'scaleBand' ? scale.bandwidth() / 2 : 2;
  var offset = (isGrid || isAll) && type === 'category' && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0;
  offset = axis.axisType === 'angleAxis' && (range === null || range === void 0 ? void 0 : range.length) >= 2 ? mathSign(range[0] - range[1]) * 2 * offset : offset;

  // The ticks set by user should only affect the ticks adjacent to axis line
  if (isGrid && (axis.ticks || axis.niceTicks)) {
    var result = (axis.ticks || axis.niceTicks).map(function (entry) {
      var scaleContent = duplicateDomain ? duplicateDomain.indexOf(entry) : entry;
      return {
        // If the scaleContent is not a number, the coordinate will be NaN.
        // That could be the case for example with a PointScale and a string as domain.
        coordinate: scale(scaleContent) + offset,
        value: entry,
        offset: offset
      };
    });
    return result.filter(function (row) {
      return !isNaN_default()(row.coordinate);
    });
  }

  // When axis is a categorial axis, but the type of axis is number or the scale of axis is not "auto"
  if (axis.isCategorical && axis.categoricalDomain) {
    return axis.categoricalDomain.map(function (entry, index) {
      return {
        coordinate: scale(entry) + offset,
        value: entry,
        index: index,
        offset: offset
      };
    });
  }
  if (scale.ticks && !isAll) {
    return scale.ticks(axis.tickCount).map(function (entry) {
      return {
        coordinate: scale(entry) + offset,
        value: entry,
        offset: offset
      };
    });
  }

  // When axis has duplicated text, serial numbers are used to generate scale
  return scale.domain().map(function (entry, index) {
    return {
      coordinate: scale(entry) + offset,
      value: duplicateDomain ? duplicateDomain[entry] : entry,
      index: index,
      offset: offset
    };
  });
};

/**
 * combine the handlers
 * @param  {Function} defaultHandler Internal private handler
 * @param  {Function} parentHandler  Handler function specified in parent component
 * @param  {Function} childHandler   Handler function specified in child component
 * @return {Function}                The combined handler
 */
var combineEventHandlers = function combineEventHandlers(defaultHandler, parentHandler, childHandler) {
  var customizedHandler;
  if (isFunction_default()(childHandler)) {
    customizedHandler = childHandler;
  } else if (isFunction_default()(parentHandler)) {
    customizedHandler = parentHandler;
  }
  if (isFunction_default()(defaultHandler) || customizedHandler) {
    return function (arg1, arg2, arg3, arg4) {
      if (isFunction_default()(defaultHandler)) {
        defaultHandler(arg1, arg2, arg3, arg4);
      }
      if (isFunction_default()(customizedHandler)) {
        customizedHandler(arg1, arg2, arg3, arg4);
      }
    };
  }
  return null;
};
/**
 * Parse the scale function of axis
 * @param  {Object}   axis          The option of axis
 * @param  {String}   chartType     The displayName of chart
 * @param  {Boolean}  hasBar        if it has a bar
 * @return {Function}               The scale function
 */
var parseScale = function parseScale(axis, chartType, hasBar) {
  var scale = axis.scale,
    type = axis.type,
    layout = axis.layout,
    axisType = axis.axisType;
  if (scale === 'auto') {
    if (layout === 'radial' && axisType === 'radiusAxis') {
      return {
        scale: band(),
        realScaleType: 'band'
      };
    }
    if (layout === 'radial' && axisType === 'angleAxis') {
      return {
        scale: linear_linear(),
        realScaleType: 'linear'
      };
    }
    if (type === 'category' && chartType && (chartType.indexOf('LineChart') >= 0 || chartType.indexOf('AreaChart') >= 0 || chartType.indexOf('ComposedChart') >= 0 && !hasBar)) {
      return {
        scale: band_point(),
        realScaleType: 'point'
      };
    }
    if (type === 'category') {
      return {
        scale: band(),
        realScaleType: 'band'
      };
    }
    return {
      scale: linear_linear(),
      realScaleType: 'linear'
    };
  }
  if (isString_default()(scale)) {
    var name = "scale".concat(upperFirst_default()(scale));
    return {
      scale: (d3_scale_namespaceObject[name] || band_point)(),
      realScaleType: d3_scale_namespaceObject[name] ? name : 'point'
    };
  }
  return isFunction_default()(scale) ? {
    scale: scale
  } : {
    scale: band_point(),
    realScaleType: 'point'
  };
};
var ChartUtils_EPS = 1e-4;
var checkDomainOfScale = function checkDomainOfScale(scale) {
  var domain = scale.domain();
  if (!domain || domain.length <= 2) {
    return;
  }
  var len = domain.length;
  var range = scale.range();
  var min = Math.min(range[0], range[1]) - ChartUtils_EPS;
  var max = Math.max(range[0], range[1]) + ChartUtils_EPS;
  var first = scale(domain[0]);
  var last = scale(domain[len - 1]);
  if (first < min || first > max || last < min || last > max) {
    scale.domain([domain[0], domain[len - 1]]);
  }
};
var findPositionOfBar = function findPositionOfBar(barPosition, child) {
  if (!barPosition) {
    return null;
  }
  for (var i = 0, len = barPosition.length; i < len; i++) {
    if (barPosition[i].item === child) {
      return barPosition[i].position;
    }
  }
  return null;
};
var truncateByDomain = function truncateByDomain(value, domain) {
  if (!domain || domain.length !== 2 || !isNumber(domain[0]) || !isNumber(domain[1])) {
    return value;
  }
  var min = Math.min(domain[0], domain[1]);
  var max = Math.max(domain[0], domain[1]);
  var result = [value[0], value[1]];
  if (!isNumber(value[0]) || value[0] < min) {
    result[0] = min;
  }
  if (!isNumber(value[1]) || value[1] > max) {
    result[1] = max;
  }
  if (result[0] > max) {
    result[0] = max;
  }
  if (result[1] < min) {
    result[1] = min;
  }
  return result;
};

/* eslint no-param-reassign: 0 */
var offsetSign = function offsetSign(series) {
  var n = series.length;
  if (n <= 0) {
    return;
  }
  for (var j = 0, m = series[0].length; j < m; ++j) {
    var positive = 0;
    var negative = 0;
    for (var i = 0; i < n; ++i) {
      var value = isNaN_default()(series[i][j][1]) ? series[i][j][0] : series[i][j][1];

      /* eslint-disable prefer-destructuring */
      if (value >= 0) {
        series[i][j][0] = positive;
        series[i][j][1] = positive + value;
        positive = series[i][j][1];
      } else {
        series[i][j][0] = negative;
        series[i][j][1] = negative + value;
        negative = series[i][j][1];
      }
      /* eslint-enable prefer-destructuring */
    }
  }
};

var offsetPositive = function offsetPositive(series) {
  var n = series.length;
  if (n <= 0) {
    return;
  }
  for (var j = 0, m = series[0].length; j < m; ++j) {
    var positive = 0;
    for (var i = 0; i < n; ++i) {
      var value = isNaN_default()(series[i][j][1]) ? series[i][j][0] : series[i][j][1];

      /* eslint-disable prefer-destructuring */
      if (value >= 0) {
        series[i][j][0] = positive;
        series[i][j][1] = positive + value;
        positive = series[i][j][1];
      } else {
        series[i][j][0] = 0;
        series[i][j][1] = 0;
      }
      /* eslint-enable prefer-destructuring */
    }
  }
};

var STACK_OFFSET_MAP = {
  sign: offsetSign,
  expand: expand,
  none: none,
  silhouette: silhouette,
  wiggle: wiggle,
  positive: offsetPositive
};
var getStackedData = function getStackedData(data, stackItems, offsetType) {
  var dataKeys = stackItems.map(function (item) {
    return item.props.dataKey;
  });
  var stack = src_stack().keys(dataKeys).value(function (d, key) {
    return +getValueByDataKey(d, key, 0);
  }).order(order_none).offset(STACK_OFFSET_MAP[offsetType]);
  return stack(data);
};
var getStackGroupsByAxisId = function getStackGroupsByAxisId(data, _items, numericAxisId, cateAxisId, offsetType, reverseStackOrder) {
  if (!data) {
    return null;
  }

  // reversing items to affect render order (for layering)
  var items = reverseStackOrder ? _items.reverse() : _items;
  var stackGroups = items.reduce(function (result, item) {
    var _item$props3 = item.props,
      stackId = _item$props3.stackId,
      hide = _item$props3.hide;
    if (hide) {
      return result;
    }
    var axisId = item.props[numericAxisId];
    var parentGroup = result[axisId] || {
      hasStack: false,
      stackGroups: {}
    };
    if (isNumOrStr(stackId)) {
      var childGroup = parentGroup.stackGroups[stackId] || {
        numericAxisId: numericAxisId,
        cateAxisId: cateAxisId,
        items: []
      };
      childGroup.items.push(item);
      parentGroup.hasStack = true;
      parentGroup.stackGroups[stackId] = childGroup;
    } else {
      parentGroup.stackGroups[uniqueId('_stackId_')] = {
        numericAxisId: numericAxisId,
        cateAxisId: cateAxisId,
        items: [item]
      };
    }
    return ChartUtils_objectSpread(ChartUtils_objectSpread({}, result), {}, ChartUtils_defineProperty({}, axisId, parentGroup));
  }, {});
  return Object.keys(stackGroups).reduce(function (result, axisId) {
    var group = stackGroups[axisId];
    if (group.hasStack) {
      group.stackGroups = Object.keys(group.stackGroups).reduce(function (res, stackId) {
        var g = group.stackGroups[stackId];
        return ChartUtils_objectSpread(ChartUtils_objectSpread({}, res), {}, ChartUtils_defineProperty({}, stackId, {
          numericAxisId: numericAxisId,
          cateAxisId: cateAxisId,
          items: g.items,
          stackedData: getStackedData(data, g.items, offsetType)
        }));
      }, {});
    }
    return ChartUtils_objectSpread(ChartUtils_objectSpread({}, result), {}, ChartUtils_defineProperty({}, axisId, group));
  }, {});
};

/**
 * Configure the scale function of axis
 * @param {Object} scale The scale function
 * @param {Object} opts  The configuration of axis
 * @return {Object}      null
 */
var getTicksOfScale = function getTicksOfScale(scale, opts) {
  var realScaleType = opts.realScaleType,
    type = opts.type,
    tickCount = opts.tickCount,
    originalDomain = opts.originalDomain,
    allowDecimals = opts.allowDecimals;
  var scaleType = realScaleType || opts.scale;
  if (scaleType !== 'auto' && scaleType !== 'linear') {
    return null;
  }
  if (tickCount && type === 'number' && originalDomain && (originalDomain[0] === 'auto' || originalDomain[1] === 'auto')) {
    // Calculate the ticks by the number of grid when the axis is a number axis
    var domain = scale.domain();
    if (!domain.length) {
      return null;
    }
    var tickValues = getNiceTickValues(domain, tickCount, allowDecimals);
    scale.domain([min_default()(tickValues), max_default()(tickValues)]);
    return {
      niceTicks: tickValues
    };
  }
  if (tickCount && type === 'number') {
    var _domain = scale.domain();
    var _tickValues = getTickValuesFixedDomain(_domain, tickCount, allowDecimals);
    return {
      niceTicks: _tickValues
    };
  }
  return null;
};
var getCateCoordinateOfLine = function getCateCoordinateOfLine(_ref7) {
  var axis = _ref7.axis,
    ticks = _ref7.ticks,
    bandSize = _ref7.bandSize,
    entry = _ref7.entry,
    index = _ref7.index,
    dataKey = _ref7.dataKey;
  if (axis.type === 'category') {
    // find coordinate of category axis by the value of category
    if (!axis.allowDuplicatedCategory && axis.dataKey && !isNil_default()(entry[axis.dataKey])) {
      var matchedTick = findEntryInArray(ticks, 'value', entry[axis.dataKey]);
      if (matchedTick) {
        return matchedTick.coordinate + bandSize / 2;
      }
    }
    return ticks[index] ? ticks[index].coordinate + bandSize / 2 : null;
  }
  var value = getValueByDataKey(entry, !isNil_default()(dataKey) ? dataKey : axis.dataKey);
  return !isNil_default()(value) ? axis.scale(value) : null;
};
var getCateCoordinateOfBar = function getCateCoordinateOfBar(_ref8) {
  var axis = _ref8.axis,
    ticks = _ref8.ticks,
    offset = _ref8.offset,
    bandSize = _ref8.bandSize,
    entry = _ref8.entry,
    index = _ref8.index;
  if (axis.type === 'category') {
    return ticks[index] ? ticks[index].coordinate + offset : null;
  }
  var value = getValueByDataKey(entry, axis.dataKey, axis.domain[index]);
  return !isNil_default()(value) ? axis.scale(value) - bandSize / 2 + offset : null;
};
var getBaseValueOfBar = function getBaseValueOfBar(_ref9) {
  var numericAxis = _ref9.numericAxis;
  var domain = numericAxis.scale.domain();
  if (numericAxis.type === 'number') {
    var min = Math.min(domain[0], domain[1]);
    var max = Math.max(domain[0], domain[1]);
    if (min <= 0 && max >= 0) {
      return 0;
    }
    if (max < 0) {
      return max;
    }
    return min;
  }
  return domain[0];
};
var getStackedDataOfItem = function getStackedDataOfItem(item, stackGroups) {
  var stackId = item.props.stackId;
  if (isNumOrStr(stackId)) {
    var group = stackGroups[stackId];
    if (group && group.items.length) {
      var itemIndex = -1;
      for (var i = 0, len = group.items.length; i < len; i++) {
        if (group.items[i] === item) {
          itemIndex = i;
          break;
        }
      }
      return itemIndex >= 0 ? group.stackedData[itemIndex] : null;
    }
  }
  return null;
};
var getDomainOfSingle = function getDomainOfSingle(data) {
  return data.reduce(function (result, entry) {
    return [min_default()(entry.concat([result[0]]).filter(isNumber)), max_default()(entry.concat([result[1]]).filter(isNumber))];
  }, [Infinity, -Infinity]);
};
var getDomainOfStackGroups = function getDomainOfStackGroups(stackGroups, startIndex, endIndex) {
  return Object.keys(stackGroups).reduce(function (result, stackId) {
    var group = stackGroups[stackId];
    var stackedData = group.stackedData;
    var domain = stackedData.reduce(function (res, entry) {
      var s = getDomainOfSingle(entry.slice(startIndex, endIndex + 1));
      return [Math.min(res[0], s[0]), Math.max(res[1], s[1])];
    }, [Infinity, -Infinity]);
    return [Math.min(domain[0], result[0]), Math.max(domain[1], result[1])];
  }, [Infinity, -Infinity]).map(function (result) {
    return result === Infinity || result === -Infinity ? 0 : result;
  });
};
var MIN_VALUE_REG = /^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/;
var MAX_VALUE_REG = /^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/;
var parseSpecifiedDomain = function parseSpecifiedDomain(specifiedDomain, dataDomain, allowDataOverflow) {
  if (isFunction_default()(specifiedDomain)) {
    return specifiedDomain(dataDomain, allowDataOverflow);
  }
  if (!isArray_default()(specifiedDomain)) {
    return dataDomain;
  }
  var domain = [];

  /* eslint-disable prefer-destructuring */
  if (isNumber(specifiedDomain[0])) {
    domain[0] = allowDataOverflow ? specifiedDomain[0] : Math.min(specifiedDomain[0], dataDomain[0]);
  } else if (MIN_VALUE_REG.test(specifiedDomain[0])) {
    var value = +MIN_VALUE_REG.exec(specifiedDomain[0])[1];
    domain[0] = dataDomain[0] - value;
  } else if (isFunction_default()(specifiedDomain[0])) {
    domain[0] = specifiedDomain[0](dataDomain[0]);
  } else {
    domain[0] = dataDomain[0];
  }
  if (isNumber(specifiedDomain[1])) {
    domain[1] = allowDataOverflow ? specifiedDomain[1] : Math.max(specifiedDomain[1], dataDomain[1]);
  } else if (MAX_VALUE_REG.test(specifiedDomain[1])) {
    var _value = +MAX_VALUE_REG.exec(specifiedDomain[1])[1];
    domain[1] = dataDomain[1] + _value;
  } else if (isFunction_default()(specifiedDomain[1])) {
    domain[1] = specifiedDomain[1](dataDomain[1]);
  } else {
    domain[1] = dataDomain[1];
  }
  /* eslint-enable prefer-destructuring */

  return domain;
};

/**
 * Calculate the size between two category
 * @param  {Object} axis  The options of axis
 * @param  {Array}  ticks The ticks of axis
 * @param  {Boolean} isBar if items in axis are bars
 * @return {Number} Size
 */
var getBandSizeOfAxis = function getBandSizeOfAxis(axis, ticks, isBar) {
  if (axis && axis.scale && axis.scale.bandwidth) {
    var bandWidth = axis.scale.bandwidth();
    if (!isBar || bandWidth > 0) {
      return bandWidth;
    }
  }
  if (axis && ticks && ticks.length >= 2) {
    var orderedTicks = sortBy_default()(ticks, function (o) {
      return o.coordinate;
    });
    var bandSize = Infinity;
    for (var i = 1, len = orderedTicks.length; i < len; i++) {
      var cur = orderedTicks[i];
      var prev = orderedTicks[i - 1];
      bandSize = Math.min((cur.coordinate || 0) - (prev.coordinate || 0), bandSize);
    }
    return bandSize === Infinity ? 0 : bandSize;
  }
  return isBar ? undefined : 0;
};
/**
 * parse the domain of a category axis when a domain is specified
 * @param   {Array}        specifiedDomain  The domain specified by users
 * @param   {Array}        calculatedDomain The domain calculated by dateKey
 * @param   {ReactElement} axisChild        The axis element
 * @returns {Array}        domains
 */
var parseDomainOfCategoryAxis = function parseDomainOfCategoryAxis(specifiedDomain, calculatedDomain, axisChild) {
  if (!specifiedDomain || !specifiedDomain.length) {
    return calculatedDomain;
  }
  if (isEqual_default()(specifiedDomain, get_default()(axisChild, 'type.defaultProps.domain'))) {
    return calculatedDomain;
  }
  return specifiedDomain;
};
var getTooltipItem = function getTooltipItem(graphicalItem, payload) {
  var _graphicalItem$props = graphicalItem.props,
    dataKey = _graphicalItem$props.dataKey,
    name = _graphicalItem$props.name,
    unit = _graphicalItem$props.unit,
    formatter = _graphicalItem$props.formatter,
    tooltipType = _graphicalItem$props.tooltipType,
    chartType = _graphicalItem$props.chartType;
  return ChartUtils_objectSpread(ChartUtils_objectSpread({}, filterProps(graphicalItem)), {}, {
    dataKey: dataKey,
    unit: unit,
    formatter: formatter,
    name: name || dataKey,
    color: getMainColorOfGraphicItem(graphicalItem),
    value: getValueByDataKey(payload, dataKey),
    type: tooltipType,
    payload: payload,
    chartType: chartType
  });
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/PolarUtils.js
function PolarUtils_typeof(obj) { "@babel/helpers - typeof"; return PolarUtils_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; }, PolarUtils_typeof(obj); }

function PolarUtils_ownKeys(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 PolarUtils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? PolarUtils_ownKeys(Object(source), !0).forEach(function (key) { PolarUtils_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : PolarUtils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function PolarUtils_defineProperty(obj, key, value) { key = PolarUtils_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function PolarUtils_toPropertyKey(arg) { var key = PolarUtils_toPrimitive(arg, "string"); return PolarUtils_typeof(key) === "symbol" ? key : String(key); }
function PolarUtils_toPrimitive(input, hint) { if (PolarUtils_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (PolarUtils_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function PolarUtils_slicedToArray(arr, i) { return PolarUtils_arrayWithHoles(arr) || PolarUtils_iterableToArrayLimit(arr, i) || PolarUtils_unsupportedIterableToArray(arr, i) || PolarUtils_nonIterableRest(); }
function PolarUtils_nonIterableRest() { 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 PolarUtils_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return PolarUtils_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 PolarUtils_arrayLikeToArray(o, minLen); }
function PolarUtils_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 PolarUtils_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function PolarUtils_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }


var PolarUtils_RADIAN = Math.PI / 180;
var degreeToRadian = function degreeToRadian(angle) {
  return angle * Math.PI / 180;
};
var radianToDegree = function radianToDegree(angleInRadian) {
  return angleInRadian * 180 / Math.PI;
};
var polarToCartesian = function polarToCartesian(cx, cy, radius, angle) {
  return {
    x: cx + Math.cos(-PolarUtils_RADIAN * angle) * radius,
    y: cy + Math.sin(-PolarUtils_RADIAN * angle) * radius
  };
};
var getMaxRadius = function getMaxRadius(width, height) {
  var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
  return Math.min(Math.abs(width - (offset.left || 0) - (offset.right || 0)), Math.abs(height - (offset.top || 0) - (offset.bottom || 0))) / 2;
};

/**
 * Calculate the scale function, position, width, height of axes
 * @param  {Object} props     Latest props
 * @param  {Object} axisMap   The configuration of axes
 * @param  {Object} offset    The offset of main part in the svg element
 * @param  {Object} axisType  The type of axes, radius-axis or angle-axis
 * @param  {String} chartName The name of chart
 * @return {Object} Configuration
 */
var formatAxisMap = function formatAxisMap(props, axisMap, offset, axisType, chartName) {
  var width = props.width,
    height = props.height;
  var startAngle = props.startAngle,
    endAngle = props.endAngle;
  var cx = getPercentValue(props.cx, width, width / 2);
  var cy = getPercentValue(props.cy, height, height / 2);
  var maxRadius = getMaxRadius(width, height, offset);
  var innerRadius = getPercentValue(props.innerRadius, maxRadius, 0);
  var outerRadius = getPercentValue(props.outerRadius, maxRadius, maxRadius * 0.8);
  var ids = Object.keys(axisMap);
  return ids.reduce(function (result, id) {
    var axis = axisMap[id];
    var domain = axis.domain,
      reversed = axis.reversed;
    var range;
    if (isNil_default()(axis.range)) {
      if (axisType === 'angleAxis') {
        range = [startAngle, endAngle];
      } else if (axisType === 'radiusAxis') {
        range = [innerRadius, outerRadius];
      }
      if (reversed) {
        range = [range[1], range[0]];
      }
    } else {
      range = axis.range;
      var _range = range;
      var _range2 = PolarUtils_slicedToArray(_range, 2);
      startAngle = _range2[0];
      endAngle = _range2[1];
    }
    var _parseScale = parseScale(axis, chartName),
      realScaleType = _parseScale.realScaleType,
      scale = _parseScale.scale;
    scale.domain(domain).range(range);
    checkDomainOfScale(scale);
    var ticks = getTicksOfScale(scale, PolarUtils_objectSpread(PolarUtils_objectSpread({}, axis), {}, {
      realScaleType: realScaleType
    }));
    var finalAxis = PolarUtils_objectSpread(PolarUtils_objectSpread(PolarUtils_objectSpread({}, axis), ticks), {}, {
      range: range,
      radius: outerRadius,
      realScaleType: realScaleType,
      scale: scale,
      cx: cx,
      cy: cy,
      innerRadius: innerRadius,
      outerRadius: outerRadius,
      startAngle: startAngle,
      endAngle: endAngle
    });
    return PolarUtils_objectSpread(PolarUtils_objectSpread({}, result), {}, PolarUtils_defineProperty({}, id, finalAxis));
  }, {});
};
var distanceBetweenPoints = function distanceBetweenPoints(point, anotherPoint) {
  var x1 = point.x,
    y1 = point.y;
  var x2 = anotherPoint.x,
    y2 = anotherPoint.y;
  return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
};
var getAngleOfPoint = function getAngleOfPoint(_ref, _ref2) {
  var x = _ref.x,
    y = _ref.y;
  var cx = _ref2.cx,
    cy = _ref2.cy;
  var radius = distanceBetweenPoints({
    x: x,
    y: y
  }, {
    x: cx,
    y: cy
  });
  if (radius <= 0) {
    return {
      radius: radius
    };
  }
  var cos = (x - cx) / radius;
  var angleInRadian = Math.acos(cos);
  if (y > cy) {
    angleInRadian = 2 * Math.PI - angleInRadian;
  }
  return {
    radius: radius,
    angle: radianToDegree(angleInRadian),
    angleInRadian: angleInRadian
  };
};
var formatAngleOfSector = function formatAngleOfSector(_ref3) {
  var startAngle = _ref3.startAngle,
    endAngle = _ref3.endAngle;
  var startCnt = Math.floor(startAngle / 360);
  var endCnt = Math.floor(endAngle / 360);
  var min = Math.min(startCnt, endCnt);
  return {
    startAngle: startAngle - min * 360,
    endAngle: endAngle - min * 360
  };
};
var reverseFormatAngleOfSetor = function reverseFormatAngleOfSetor(angle, _ref4) {
  var startAngle = _ref4.startAngle,
    endAngle = _ref4.endAngle;
  var startCnt = Math.floor(startAngle / 360);
  var endCnt = Math.floor(endAngle / 360);
  var min = Math.min(startCnt, endCnt);
  return angle + min * 360;
};
var inRangeOfSector = function inRangeOfSector(_ref5, sector) {
  var x = _ref5.x,
    y = _ref5.y;
  var _getAngleOfPoint = getAngleOfPoint({
      x: x,
      y: y
    }, sector),
    radius = _getAngleOfPoint.radius,
    angle = _getAngleOfPoint.angle;
  var innerRadius = sector.innerRadius,
    outerRadius = sector.outerRadius;
  if (radius < innerRadius || radius > outerRadius) {
    return false;
  }
  if (radius === 0) {
    return true;
  }
  var _formatAngleOfSector = formatAngleOfSector(sector),
    startAngle = _formatAngleOfSector.startAngle,
    endAngle = _formatAngleOfSector.endAngle;
  var formatAngle = angle;
  var inRange;
  if (startAngle <= endAngle) {
    while (formatAngle > endAngle) {
      formatAngle -= 360;
    }
    while (formatAngle < startAngle) {
      formatAngle += 360;
    }
    inRange = formatAngle >= startAngle && formatAngle <= endAngle;
  } else {
    while (formatAngle > startAngle) {
      formatAngle -= 360;
    }
    while (formatAngle < endAngle) {
      formatAngle += 360;
    }
    inRange = formatAngle >= endAngle && formatAngle <= startAngle;
  }
  if (inRange) {
    return PolarUtils_objectSpread(PolarUtils_objectSpread({}, sector), {}, {
      radius: radius,
      angle: reverseFormatAngleOfSetor(formatAngle, sector)
    });
  }
  return null;
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/component/Label.js
function Label_typeof(obj) { "@babel/helpers - typeof"; return Label_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; }, Label_typeof(obj); }



var Label_excluded = ["offset"];
function Label_toConsumableArray(arr) { return Label_arrayWithoutHoles(arr) || Label_iterableToArray(arr) || Label_unsupportedIterableToArray(arr) || Label_nonIterableSpread(); }
function Label_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."); }
function Label_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Label_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 Label_arrayLikeToArray(o, minLen); }
function Label_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function Label_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Label_arrayLikeToArray(arr); }
function Label_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 Label_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Label_objectWithoutPropertiesLoose(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 Label_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; }
function Label_ownKeys(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 Label_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Label_ownKeys(Object(source), !0).forEach(function (key) { Label_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Label_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Label_defineProperty(obj, key, value) { key = Label_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Label_toPropertyKey(arg) { var key = Label_toPrimitive(arg, "string"); return Label_typeof(key) === "symbol" ? key : String(key); }
function Label_toPrimitive(input, hint) { if (Label_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Label_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function Label_extends() { Label_extends = Object.assign ? Object.assign.bind() : 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 Label_extends.apply(this, arguments); }






var getLabel = function getLabel(props) {
  var value = props.value,
    formatter = props.formatter;
  var label = isNil_default()(props.children) ? value : props.children;
  if (isFunction_default()(formatter)) {
    return formatter(label);
  }
  return label;
};
var getDeltaAngle = function getDeltaAngle(startAngle, endAngle) {
  var sign = mathSign(endAngle - startAngle);
  var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360);
  return sign * deltaAngle;
};
var renderRadialLabel = function renderRadialLabel(labelProps, label, attrs) {
  var position = labelProps.position,
    viewBox = labelProps.viewBox,
    offset = labelProps.offset,
    className = labelProps.className;
  var _ref = viewBox,
    cx = _ref.cx,
    cy = _ref.cy,
    innerRadius = _ref.innerRadius,
    outerRadius = _ref.outerRadius,
    startAngle = _ref.startAngle,
    endAngle = _ref.endAngle,
    clockWise = _ref.clockWise;
  var radius = (innerRadius + outerRadius) / 2;
  var deltaAngle = getDeltaAngle(startAngle, endAngle);
  var sign = deltaAngle >= 0 ? 1 : -1;
  var labelAngle, direction;
  if (position === 'insideStart') {
    labelAngle = startAngle + sign * offset;
    direction = clockWise;
  } else if (position === 'insideEnd') {
    labelAngle = endAngle - sign * offset;
    direction = !clockWise;
  } else if (position === 'end') {
    labelAngle = endAngle + sign * offset;
    direction = clockWise;
  }
  direction = deltaAngle <= 0 ? direction : !direction;
  var startPoint = polarToCartesian(cx, cy, radius, labelAngle);
  var endPoint = polarToCartesian(cx, cy, radius, labelAngle + (direction ? 1 : -1) * 359);
  var path = "M".concat(startPoint.x, ",").concat(startPoint.y, "\n    A").concat(radius, ",").concat(radius, ",0,1,").concat(direction ? 0 : 1, ",\n    ").concat(endPoint.x, ",").concat(endPoint.y);
  var id = isNil_default()(labelProps.id) ? uniqueId('recharts-radial-line-') : labelProps.id;
  return /*#__PURE__*/react.createElement("text", Label_extends({}, attrs, {
    dominantBaseline: "central",
    className: classnames_default()('recharts-radial-bar-label', className)
  }), /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("path", {
    id: id,
    d: path
  })), /*#__PURE__*/react.createElement("textPath", {
    xlinkHref: "#".concat(id)
  }, label));
};
var getAttrsOfPolarLabel = function getAttrsOfPolarLabel(props) {
  var viewBox = props.viewBox,
    offset = props.offset,
    position = props.position;
  var _ref2 = viewBox,
    cx = _ref2.cx,
    cy = _ref2.cy,
    innerRadius = _ref2.innerRadius,
    outerRadius = _ref2.outerRadius,
    startAngle = _ref2.startAngle,
    endAngle = _ref2.endAngle;
  var midAngle = (startAngle + endAngle) / 2;
  if (position === 'outside') {
    var _polarToCartesian = polarToCartesian(cx, cy, outerRadius + offset, midAngle),
      _x = _polarToCartesian.x,
      _y = _polarToCartesian.y;
    return {
      x: _x,
      y: _y,
      textAnchor: _x >= cx ? 'start' : 'end',
      verticalAnchor: 'middle'
    };
  }
  if (position === 'center') {
    return {
      x: cx,
      y: cy,
      textAnchor: 'middle',
      verticalAnchor: 'middle'
    };
  }
  if (position === 'centerTop') {
    return {
      x: cx,
      y: cy,
      textAnchor: 'middle',
      verticalAnchor: 'start'
    };
  }
  if (position === 'centerBottom') {
    return {
      x: cx,
      y: cy,
      textAnchor: 'middle',
      verticalAnchor: 'end'
    };
  }
  var r = (innerRadius + outerRadius) / 2;
  var _polarToCartesian2 = polarToCartesian(cx, cy, r, midAngle),
    x = _polarToCartesian2.x,
    y = _polarToCartesian2.y;
  return {
    x: x,
    y: y,
    textAnchor: 'middle',
    verticalAnchor: 'middle'
  };
};
var getAttrsOfCartesianLabel = function getAttrsOfCartesianLabel(props) {
  var viewBox = props.viewBox,
    parentViewBox = props.parentViewBox,
    offset = props.offset,
    position = props.position;
  var _ref3 = viewBox,
    x = _ref3.x,
    y = _ref3.y,
    width = _ref3.width,
    height = _ref3.height;

  // Define vertical offsets and position inverts based on the value being positive or negative
  var verticalSign = height >= 0 ? 1 : -1;
  var verticalOffset = verticalSign * offset;
  var verticalEnd = verticalSign > 0 ? 'end' : 'start';
  var verticalStart = verticalSign > 0 ? 'start' : 'end';

  // Define horizontal offsets and position inverts based on the value being positive or negative
  var horizontalSign = width >= 0 ? 1 : -1;
  var horizontalOffset = horizontalSign * offset;
  var horizontalEnd = horizontalSign > 0 ? 'end' : 'start';
  var horizontalStart = horizontalSign > 0 ? 'start' : 'end';
  if (position === 'top') {
    var attrs = {
      x: x + width / 2,
      y: y - verticalSign * offset,
      textAnchor: 'middle',
      verticalAnchor: verticalEnd
    };
    return Label_objectSpread(Label_objectSpread({}, attrs), parentViewBox ? {
      height: Math.max(y - parentViewBox.y, 0),
      width: width
    } : {});
  }
  if (position === 'bottom') {
    var _attrs = {
      x: x + width / 2,
      y: y + height + verticalOffset,
      textAnchor: 'middle',
      verticalAnchor: verticalStart
    };
    return Label_objectSpread(Label_objectSpread({}, _attrs), parentViewBox ? {
      height: Math.max(parentViewBox.y + parentViewBox.height - (y + height), 0),
      width: width
    } : {});
  }
  if (position === 'left') {
    var _attrs2 = {
      x: x - horizontalOffset,
      y: y + height / 2,
      textAnchor: horizontalEnd,
      verticalAnchor: 'middle'
    };
    return Label_objectSpread(Label_objectSpread({}, _attrs2), parentViewBox ? {
      width: Math.max(_attrs2.x - parentViewBox.x, 0),
      height: height
    } : {});
  }
  if (position === 'right') {
    var _attrs3 = {
      x: x + width + horizontalOffset,
      y: y + height / 2,
      textAnchor: horizontalStart,
      verticalAnchor: 'middle'
    };
    return Label_objectSpread(Label_objectSpread({}, _attrs3), parentViewBox ? {
      width: Math.max(parentViewBox.x + parentViewBox.width - _attrs3.x, 0),
      height: height
    } : {});
  }
  var sizeAttrs = parentViewBox ? {
    width: width,
    height: height
  } : {};
  if (position === 'insideLeft') {
    return Label_objectSpread({
      x: x + horizontalOffset,
      y: y + height / 2,
      textAnchor: horizontalStart,
      verticalAnchor: 'middle'
    }, sizeAttrs);
  }
  if (position === 'insideRight') {
    return Label_objectSpread({
      x: x + width - horizontalOffset,
      y: y + height / 2,
      textAnchor: horizontalEnd,
      verticalAnchor: 'middle'
    }, sizeAttrs);
  }
  if (position === 'insideTop') {
    return Label_objectSpread({
      x: x + width / 2,
      y: y + verticalOffset,
      textAnchor: 'middle',
      verticalAnchor: verticalStart
    }, sizeAttrs);
  }
  if (position === 'insideBottom') {
    return Label_objectSpread({
      x: x + width / 2,
      y: y + height - verticalOffset,
      textAnchor: 'middle',
      verticalAnchor: verticalEnd
    }, sizeAttrs);
  }
  if (position === 'insideTopLeft') {
    return Label_objectSpread({
      x: x + horizontalOffset,
      y: y + verticalOffset,
      textAnchor: horizontalStart,
      verticalAnchor: verticalStart
    }, sizeAttrs);
  }
  if (position === 'insideTopRight') {
    return Label_objectSpread({
      x: x + width - horizontalOffset,
      y: y + verticalOffset,
      textAnchor: horizontalEnd,
      verticalAnchor: verticalStart
    }, sizeAttrs);
  }
  if (position === 'insideBottomLeft') {
    return Label_objectSpread({
      x: x + horizontalOffset,
      y: y + height - verticalOffset,
      textAnchor: horizontalStart,
      verticalAnchor: verticalEnd
    }, sizeAttrs);
  }
  if (position === 'insideBottomRight') {
    return Label_objectSpread({
      x: x + width - horizontalOffset,
      y: y + height - verticalOffset,
      textAnchor: horizontalEnd,
      verticalAnchor: verticalEnd
    }, sizeAttrs);
  }
  if (isObject_default()(position) && (isNumber(position.x) || isPercent(position.x)) && (isNumber(position.y) || isPercent(position.y))) {
    return Label_objectSpread({
      x: x + getPercentValue(position.x, width),
      y: y + getPercentValue(position.y, height),
      textAnchor: 'end',
      verticalAnchor: 'end'
    }, sizeAttrs);
  }
  return Label_objectSpread({
    x: x + width / 2,
    y: y + height / 2,
    textAnchor: 'middle',
    verticalAnchor: 'middle'
  }, sizeAttrs);
};
var isPolar = function isPolar(viewBox) {
  return 'cx' in viewBox && isNumber(viewBox.cx);
};
function Label(_ref4) {
  var _ref4$offset = _ref4.offset,
    offset = _ref4$offset === void 0 ? 5 : _ref4$offset,
    restProps = Label_objectWithoutProperties(_ref4, Label_excluded);
  var props = Label_objectSpread({
    offset: offset
  }, restProps);
  var viewBox = props.viewBox,
    position = props.position,
    value = props.value,
    children = props.children,
    content = props.content,
    _props$className = props.className,
    className = _props$className === void 0 ? '' : _props$className,
    textBreakAll = props.textBreakAll;
  if (!viewBox || isNil_default()(value) && isNil_default()(children) && ! /*#__PURE__*/(0,react.isValidElement)(content) && !isFunction_default()(content)) {
    return null;
  }
  if ( /*#__PURE__*/(0,react.isValidElement)(content)) {
    return /*#__PURE__*/(0,react.cloneElement)(content, props);
  }
  var label;
  if (isFunction_default()(content)) {
    label = /*#__PURE__*/(0,react.createElement)(content, props);
    if ( /*#__PURE__*/(0,react.isValidElement)(label)) {
      return label;
    }
  } else {
    label = getLabel(props);
  }
  var isPolarLabel = isPolar(viewBox);
  var attrs = filterProps(props, true);
  if (isPolarLabel && (position === 'insideStart' || position === 'insideEnd' || position === 'end')) {
    return renderRadialLabel(props, label, attrs);
  }
  var positionAttrs = isPolarLabel ? getAttrsOfPolarLabel(props) : getAttrsOfCartesianLabel(props);
  return /*#__PURE__*/react.createElement(Text, Label_extends({
    className: classnames_default()('recharts-label', className)
  }, attrs, positionAttrs, {
    breakAll: textBreakAll
  }), label);
}
Label.displayName = 'Label';
var parseViewBox = function parseViewBox(props) {
  var cx = props.cx,
    cy = props.cy,
    angle = props.angle,
    startAngle = props.startAngle,
    endAngle = props.endAngle,
    r = props.r,
    radius = props.radius,
    innerRadius = props.innerRadius,
    outerRadius = props.outerRadius,
    x = props.x,
    y = props.y,
    top = props.top,
    left = props.left,
    width = props.width,
    height = props.height,
    clockWise = props.clockWise,
    labelViewBox = props.labelViewBox;
  if (labelViewBox) {
    return labelViewBox;
  }
  if (isNumber(width) && isNumber(height)) {
    if (isNumber(x) && isNumber(y)) {
      return {
        x: x,
        y: y,
        width: width,
        height: height
      };
    }
    if (isNumber(top) && isNumber(left)) {
      return {
        x: top,
        y: left,
        width: width,
        height: height
      };
    }
  }
  if (isNumber(x) && isNumber(y)) {
    return {
      x: x,
      y: y,
      width: 0,
      height: 0
    };
  }
  if (isNumber(cx) && isNumber(cy)) {
    return {
      cx: cx,
      cy: cy,
      startAngle: startAngle || angle || 0,
      endAngle: endAngle || angle || 0,
      innerRadius: innerRadius || 0,
      outerRadius: outerRadius || radius || r || 0,
      clockWise: clockWise
    };
  }
  if (props.viewBox) {
    return props.viewBox;
  }
  return {};
};
var parseLabel = function parseLabel(label, viewBox) {
  if (!label) {
    return null;
  }
  if (label === true) {
    return /*#__PURE__*/react.createElement(Label, {
      key: "label-implicit",
      viewBox: viewBox
    });
  }
  if (isNumOrStr(label)) {
    return /*#__PURE__*/react.createElement(Label, {
      key: "label-implicit",
      viewBox: viewBox,
      value: label
    });
  }
  if ( /*#__PURE__*/(0,react.isValidElement)(label)) {
    if (label.type === Label) {
      return /*#__PURE__*/(0,react.cloneElement)(label, {
        key: 'label-implicit',
        viewBox: viewBox
      });
    }
    return /*#__PURE__*/react.createElement(Label, {
      key: "label-implicit",
      content: label,
      viewBox: viewBox
    });
  }
  if (isFunction_default()(label)) {
    return /*#__PURE__*/react.createElement(Label, {
      key: "label-implicit",
      content: label,
      viewBox: viewBox
    });
  }
  if (isObject_default()(label)) {
    return /*#__PURE__*/react.createElement(Label, Label_extends({
      viewBox: viewBox
    }, label, {
      key: "label-implicit"
    }));
  }
  return null;
};
var renderCallByParent = function renderCallByParent(parentProps, viewBox) {
  var checkPropsLabel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  if (!parentProps || !parentProps.children && checkPropsLabel && !parentProps.label) {
    return null;
  }
  var children = parentProps.children;
  var parentViewBox = parseViewBox(parentProps);
  var explicitChildren = findAllByType(children, Label).map(function (child, index) {
    return /*#__PURE__*/(0,react.cloneElement)(child, {
      viewBox: viewBox || parentViewBox,
      // eslint-disable-next-line react/no-array-index-key
      key: "label-".concat(index)
    });
  });
  if (!checkPropsLabel) {
    return explicitChildren;
  }
  var implicitLabel = parseLabel(parentProps.label, viewBox || parentViewBox);
  return [implicitLabel].concat(Label_toConsumableArray(explicitChildren));
};
Label.parseViewBox = parseViewBox;
Label.renderCallByParent = renderCallByParent;
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/component/LabelList.js
function LabelList_typeof(obj) { "@babel/helpers - typeof"; return LabelList_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; }, LabelList_typeof(obj); }





var LabelList_excluded = ["valueAccessor"],
  LabelList_excluded2 = ["data", "dataKey", "clockWise", "id", "textBreakAll"];
function LabelList_toConsumableArray(arr) { return LabelList_arrayWithoutHoles(arr) || LabelList_iterableToArray(arr) || LabelList_unsupportedIterableToArray(arr) || LabelList_nonIterableSpread(); }
function LabelList_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."); }
function LabelList_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return LabelList_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 LabelList_arrayLikeToArray(o, minLen); }
function LabelList_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function LabelList_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return LabelList_arrayLikeToArray(arr); }
function LabelList_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 LabelList_extends() { LabelList_extends = Object.assign ? Object.assign.bind() : 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 LabelList_extends.apply(this, arguments); }
function LabelList_ownKeys(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 LabelList_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? LabelList_ownKeys(Object(source), !0).forEach(function (key) { LabelList_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : LabelList_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function LabelList_defineProperty(obj, key, value) { key = LabelList_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function LabelList_toPropertyKey(arg) { var key = LabelList_toPrimitive(arg, "string"); return LabelList_typeof(key) === "symbol" ? key : String(key); }
function LabelList_toPrimitive(input, hint) { if (LabelList_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (LabelList_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function LabelList_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = LabelList_objectWithoutPropertiesLoose(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 LabelList_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; }





var defaultAccessor = function defaultAccessor(entry) {
  return isArray_default()(entry.value) ? last_default()(entry.value) : entry.value;
};
function LabelList(_ref) {
  var _ref$valueAccessor = _ref.valueAccessor,
    valueAccessor = _ref$valueAccessor === void 0 ? defaultAccessor : _ref$valueAccessor,
    restProps = LabelList_objectWithoutProperties(_ref, LabelList_excluded);
  var data = restProps.data,
    dataKey = restProps.dataKey,
    clockWise = restProps.clockWise,
    id = restProps.id,
    textBreakAll = restProps.textBreakAll,
    others = LabelList_objectWithoutProperties(restProps, LabelList_excluded2);
  if (!data || !data.length) {
    return null;
  }
  return /*#__PURE__*/react.createElement(Layer, {
    className: "recharts-label-list"
  }, data.map(function (entry, index) {
    var value = isNil_default()(dataKey) ? valueAccessor(entry, index) : getValueByDataKey(entry && entry.payload, dataKey);
    var idProps = isNil_default()(id) ? {} : {
      id: "".concat(id, "-").concat(index)
    };
    return /*#__PURE__*/react.createElement(Label, LabelList_extends({}, filterProps(entry, true), others, idProps, {
      parentViewBox: entry.parentViewBox,
      index: index,
      value: value,
      textBreakAll: textBreakAll,
      viewBox: Label.parseViewBox(isNil_default()(clockWise) ? entry : LabelList_objectSpread(LabelList_objectSpread({}, entry), {}, {
        clockWise: clockWise
      })),
      key: "label-".concat(index) // eslint-disable-line react/no-array-index-key
    }));
  }));
}

LabelList.displayName = 'LabelList';
function parseLabelList(label, data) {
  if (!label) {
    return null;
  }
  if (label === true) {
    return /*#__PURE__*/react.createElement(LabelList, {
      key: "labelList-implicit",
      data: data
    });
  }
  if ( /*#__PURE__*/react.isValidElement(label) || isFunction_default()(label)) {
    return /*#__PURE__*/react.createElement(LabelList, {
      key: "labelList-implicit",
      data: data,
      content: label
    });
  }
  if (isObject_default()(label)) {
    return /*#__PURE__*/react.createElement(LabelList, LabelList_extends({
      data: data
    }, label, {
      key: "labelList-implicit"
    }));
  }
  return null;
}
function LabelList_renderCallByParent(parentProps, data) {
  var checkPropsLabel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  if (!parentProps || !parentProps.children && checkPropsLabel && !parentProps.label) {
    return null;
  }
  var children = parentProps.children;
  var explicitChildren = findAllByType(children, LabelList).map(function (child, index) {
    return /*#__PURE__*/(0,react.cloneElement)(child, {
      data: data,
      // eslint-disable-next-line react/no-array-index-key
      key: "labelList-".concat(index)
    });
  });
  if (!checkPropsLabel) {
    return explicitChildren;
  }
  var implicitLabelList = parseLabelList(parentProps.label, data);
  return [implicitLabelList].concat(LabelList_toConsumableArray(explicitChildren));
}
LabelList.renderCallByParent = LabelList_renderCallByParent;
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/Line.js



var Line_excluded = ["type", "layout", "connectNulls", "ref"];
function Line_typeof(obj) { "@babel/helpers - typeof"; return Line_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; }, Line_typeof(obj); }
function Line_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Line_objectWithoutPropertiesLoose(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 Line_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; }
function Line_extends() { Line_extends = Object.assign ? Object.assign.bind() : 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 Line_extends.apply(this, arguments); }
function Line_ownKeys(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 Line_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Line_ownKeys(Object(source), !0).forEach(function (key) { Line_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Line_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Line_toConsumableArray(arr) { return Line_arrayWithoutHoles(arr) || Line_iterableToArray(arr) || Line_unsupportedIterableToArray(arr) || Line_nonIterableSpread(); }
function Line_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."); }
function Line_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Line_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 Line_arrayLikeToArray(o, minLen); }
function Line_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function Line_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Line_arrayLikeToArray(arr); }
function Line_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 Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Line_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, Line_toPropertyKey(descriptor.key), descriptor); } }
function Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) Line_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function Line_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Line_setPrototypeOf(subClass, superClass); }
function Line_setPrototypeOf(o, p) { Line_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Line_setPrototypeOf(o, p); }
function Line_createSuper(Derived) { var hasNativeReflectConstruct = Line_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Line_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Line_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Line_possibleConstructorReturn(this, result); }; }
function Line_possibleConstructorReturn(self, call) { if (call && (Line_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Line_assertThisInitialized(self); }
function Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Line_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function Line_getPrototypeOf(o) { Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Line_getPrototypeOf(o); }
function Line_defineProperty(obj, key, value) { key = Line_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Line_toPropertyKey(arg) { var key = Line_toPrimitive(arg, "string"); return Line_typeof(key) === "symbol" ? key : String(key); }
function Line_toPrimitive(input, hint) { if (Line_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Line_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Line
 */












var Line = /*#__PURE__*/function (_PureComponent) {
  Line_inherits(Line, _PureComponent);
  var _super = Line_createSuper(Line);
  function Line() {
    var _this;
    Line_classCallCheck(this, Line);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    Line_defineProperty(Line_assertThisInitialized(_this), "state", {
      isAnimationFinished: true,
      totalLength: 0
    });
    Line_defineProperty(Line_assertThisInitialized(_this), "getStrokeDasharray", function (length, totalLength, lines) {
      var lineLength = lines.reduce(function (pre, next) {
        return pre + next;
      });
      var count = Math.floor(length / lineLength);
      var remainLength = length % lineLength;
      var restLength = totalLength - length;
      var remainLines = [];
      for (var i = 0, sum = 0;; sum += lines[i], ++i) {
        if (sum + lines[i] > remainLength) {
          remainLines = [].concat(Line_toConsumableArray(lines.slice(0, i)), [remainLength - sum]);
          break;
        }
      }
      var emptyLines = remainLines.length % 2 === 0 ? [0, restLength] : [restLength];
      return [].concat(Line_toConsumableArray(Line.repeat(lines, count)), Line_toConsumableArray(remainLines), emptyLines).map(function (line) {
        return "".concat(line, "px");
      }).join(', ');
    });
    Line_defineProperty(Line_assertThisInitialized(_this), "id", uniqueId('recharts-line-'));
    Line_defineProperty(Line_assertThisInitialized(_this), "pathRef", function (node) {
      _this.mainCurve = node;
    });
    Line_defineProperty(Line_assertThisInitialized(_this), "handleAnimationEnd", function () {
      _this.setState({
        isAnimationFinished: true
      });
      if (_this.props.onAnimationEnd) {
        _this.props.onAnimationEnd();
      }
    });
    Line_defineProperty(Line_assertThisInitialized(_this), "handleAnimationStart", function () {
      _this.setState({
        isAnimationFinished: false
      });
      if (_this.props.onAnimationStart) {
        _this.props.onAnimationStart();
      }
    });
    return _this;
  }
  Line_createClass(Line, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      if (!this.props.isAnimationActive) {
        return;
      }
      var totalLength = this.getTotalLength();
      this.setState({
        totalLength: totalLength
      });
    }
  }, {
    key: "getTotalLength",
    value: function getTotalLength() {
      var curveDom = this.mainCurve;
      try {
        return curveDom && curveDom.getTotalLength && curveDom.getTotalLength() || 0;
      } catch (err) {
        return 0;
      }
    }
  }, {
    key: "renderErrorBar",
    value: function renderErrorBar(needClip, clipPathId) {
      if (this.props.isAnimationActive && !this.state.isAnimationFinished) {
        return null;
      }
      var _this$props = this.props,
        points = _this$props.points,
        xAxis = _this$props.xAxis,
        yAxis = _this$props.yAxis,
        layout = _this$props.layout,
        children = _this$props.children;
      var errorBarItems = findAllByType(children, ErrorBar);
      if (!errorBarItems) {
        return null;
      }
      var dataPointFormatter = function dataPointFormatter(dataPoint, dataKey) {
        return {
          x: dataPoint.x,
          y: dataPoint.y,
          value: dataPoint.value,
          errorVal: getValueByDataKey(dataPoint.payload, dataKey)
        };
      };
      var errorBarProps = {
        clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
      };
      return /*#__PURE__*/react.createElement(Layer, errorBarProps, errorBarItems.map(function (item, i) {
        return /*#__PURE__*/react.cloneElement(item, {
          // eslint-disable-next-line react/no-array-index-key
          key: "bar-".concat(i),
          data: points,
          xAxis: xAxis,
          yAxis: yAxis,
          layout: layout,
          dataPointFormatter: dataPointFormatter
        });
      }));
    }
  }, {
    key: "renderDots",
    value: function renderDots(needClip, clipDot, clipPathId) {
      var isAnimationActive = this.props.isAnimationActive;
      if (isAnimationActive && !this.state.isAnimationFinished) {
        return null;
      }
      var _this$props2 = this.props,
        dot = _this$props2.dot,
        points = _this$props2.points,
        dataKey = _this$props2.dataKey;
      var lineProps = filterProps(this.props);
      var customDotProps = filterProps(dot, true);
      var dots = points.map(function (entry, i) {
        var dotProps = Line_objectSpread(Line_objectSpread(Line_objectSpread({
          key: "dot-".concat(i),
          r: 3
        }, lineProps), customDotProps), {}, {
          value: entry.value,
          dataKey: dataKey,
          cx: entry.x,
          cy: entry.y,
          index: i,
          payload: entry.payload
        });
        return Line.renderDotItem(dot, dotProps);
      });
      var dotsProps = {
        clipPath: needClip ? "url(#clipPath-".concat(clipDot ? '' : 'dots-').concat(clipPathId, ")") : null
      };
      return /*#__PURE__*/react.createElement(Layer, Line_extends({
        className: "recharts-line-dots",
        key: "dots"
      }, dotsProps), dots);
    }
  }, {
    key: "renderCurveStatically",
    value: function renderCurveStatically(points, needClip, clipPathId, props) {
      var _this$props3 = this.props,
        type = _this$props3.type,
        layout = _this$props3.layout,
        connectNulls = _this$props3.connectNulls,
        ref = _this$props3.ref,
        others = Line_objectWithoutProperties(_this$props3, Line_excluded);
      var curveProps = Line_objectSpread(Line_objectSpread(Line_objectSpread({}, filterProps(others, true)), {}, {
        fill: 'none',
        className: 'recharts-line-curve',
        clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null,
        points: points
      }, props), {}, {
        type: type,
        layout: layout,
        connectNulls: connectNulls
      });
      return /*#__PURE__*/react.createElement(Curve, Line_extends({}, curveProps, {
        pathRef: this.pathRef
      }));
    }
  }, {
    key: "renderCurveWithAnimation",
    value: function renderCurveWithAnimation(needClip, clipPathId) {
      var _this2 = this;
      var _this$props4 = this.props,
        points = _this$props4.points,
        strokeDasharray = _this$props4.strokeDasharray,
        isAnimationActive = _this$props4.isAnimationActive,
        animationBegin = _this$props4.animationBegin,
        animationDuration = _this$props4.animationDuration,
        animationEasing = _this$props4.animationEasing,
        animationId = _this$props4.animationId,
        animateNewValues = _this$props4.animateNewValues,
        width = _this$props4.width,
        height = _this$props4.height;
      var _this$state = this.state,
        prevPoints = _this$state.prevPoints,
        totalLength = _this$state.totalLength;
      return /*#__PURE__*/react.createElement(es6, {
        begin: animationBegin,
        duration: animationDuration,
        isActive: isAnimationActive,
        easing: animationEasing,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "line-".concat(animationId),
        onAnimationEnd: this.handleAnimationEnd,
        onAnimationStart: this.handleAnimationStart
      }, function (_ref) {
        var t = _ref.t;
        if (prevPoints) {
          var prevPointsDiffFactor = prevPoints.length / points.length;
          var stepData = points.map(function (entry, index) {
            var prevPointIndex = Math.floor(index * prevPointsDiffFactor);
            if (prevPoints[prevPointIndex]) {
              var prev = prevPoints[prevPointIndex];
              var interpolatorX = interpolateNumber(prev.x, entry.x);
              var interpolatorY = interpolateNumber(prev.y, entry.y);
              return Line_objectSpread(Line_objectSpread({}, entry), {}, {
                x: interpolatorX(t),
                y: interpolatorY(t)
              });
            }

            // magic number of faking previous x and y location
            if (animateNewValues) {
              var _interpolatorX = interpolateNumber(width * 2, entry.x);
              var _interpolatorY = interpolateNumber(height / 2, entry.y);
              return Line_objectSpread(Line_objectSpread({}, entry), {}, {
                x: _interpolatorX(t),
                y: _interpolatorY(t)
              });
            }
            return Line_objectSpread(Line_objectSpread({}, entry), {}, {
              x: entry.x,
              y: entry.y
            });
          });
          return _this2.renderCurveStatically(stepData, needClip, clipPathId);
        }
        var interpolator = interpolateNumber(0, totalLength);
        var curLength = interpolator(t);
        var currentStrokeDasharray;
        if (strokeDasharray) {
          var lines = "".concat(strokeDasharray).split(/[,\s]+/gim).map(function (num) {
            return parseFloat(num);
          });
          currentStrokeDasharray = _this2.getStrokeDasharray(curLength, totalLength, lines);
        } else {
          currentStrokeDasharray = "".concat(curLength, "px ").concat(totalLength - curLength, "px");
        }
        return _this2.renderCurveStatically(points, needClip, clipPathId, {
          strokeDasharray: currentStrokeDasharray
        });
      });
    }
  }, {
    key: "renderCurve",
    value: function renderCurve(needClip, clipPathId) {
      var _this$props5 = this.props,
        points = _this$props5.points,
        isAnimationActive = _this$props5.isAnimationActive;
      var _this$state2 = this.state,
        prevPoints = _this$state2.prevPoints,
        totalLength = _this$state2.totalLength;
      if (isAnimationActive && points && points.length && (!prevPoints && totalLength > 0 || !isEqual_default()(prevPoints, points))) {
        return this.renderCurveWithAnimation(needClip, clipPathId);
      }
      return this.renderCurveStatically(points, needClip, clipPathId);
    }
  }, {
    key: "render",
    value: function render() {
      var _filterProps;
      var _this$props6 = this.props,
        hide = _this$props6.hide,
        dot = _this$props6.dot,
        points = _this$props6.points,
        className = _this$props6.className,
        xAxis = _this$props6.xAxis,
        yAxis = _this$props6.yAxis,
        top = _this$props6.top,
        left = _this$props6.left,
        width = _this$props6.width,
        height = _this$props6.height,
        isAnimationActive = _this$props6.isAnimationActive,
        id = _this$props6.id;
      if (hide || !points || !points.length) {
        return null;
      }
      var isAnimationFinished = this.state.isAnimationFinished;
      var hasSinglePoint = points.length === 1;
      var layerClass = classnames_default()('recharts-line', className);
      var needClipX = xAxis && xAxis.allowDataOverflow;
      var needClipY = yAxis && yAxis.allowDataOverflow;
      var needClip = needClipX || needClipY;
      var clipPathId = isNil_default()(id) ? this.id : id;
      var _ref2 = (_filterProps = filterProps(dot)) !== null && _filterProps !== void 0 ? _filterProps : {
          r: 3,
          strokeWidth: 2
        },
        _ref2$r = _ref2.r,
        r = _ref2$r === void 0 ? 3 : _ref2$r,
        _ref2$strokeWidth = _ref2.strokeWidth,
        strokeWidth = _ref2$strokeWidth === void 0 ? 2 : _ref2$strokeWidth;
      var _ref3 = isDotProps(dot) ? dot : {},
        _ref3$clipDot = _ref3.clipDot,
        clipDot = _ref3$clipDot === void 0 ? true : _ref3$clipDot;
      var dotSize = r * 2 + strokeWidth;
      return /*#__PURE__*/react.createElement(Layer, {
        className: layerClass
      }, needClipX || needClipY ? /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("clipPath", {
        id: "clipPath-".concat(clipPathId)
      }, /*#__PURE__*/react.createElement("rect", {
        x: needClipX ? left : left - width / 2,
        y: needClipY ? top : top - height / 2,
        width: needClipX ? width : width * 2,
        height: needClipY ? height : height * 2
      })), !clipDot && /*#__PURE__*/react.createElement("clipPath", {
        id: "clipPath-dots-".concat(clipPathId)
      }, /*#__PURE__*/react.createElement("rect", {
        x: left - dotSize / 2,
        y: top - dotSize / 2,
        width: width + dotSize,
        height: height + dotSize
      }))) : null, !hasSinglePoint && this.renderCurve(needClip, clipPathId), this.renderErrorBar(needClip, clipPathId), (hasSinglePoint || dot) && this.renderDots(needClip, clipDot, clipPathId), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, points));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      if (nextProps.animationId !== prevState.prevAnimationId) {
        return {
          prevAnimationId: nextProps.animationId,
          curPoints: nextProps.points,
          prevPoints: prevState.curPoints
        };
      }
      if (nextProps.points !== prevState.curPoints) {
        return {
          curPoints: nextProps.points
        };
      }
      return null;
    }
  }, {
    key: "repeat",
    value: function repeat(lines, count) {
      var linesUnit = lines.length % 2 !== 0 ? [].concat(Line_toConsumableArray(lines), [0]) : lines;
      var result = [];
      for (var i = 0; i < count; ++i) {
        result = [].concat(Line_toConsumableArray(result), Line_toConsumableArray(linesUnit));
      }
      return result;
    }
  }, {
    key: "renderDotItem",
    value: function renderDotItem(option, props) {
      var dotItem;
      if ( /*#__PURE__*/react.isValidElement(option)) {
        dotItem = /*#__PURE__*/react.cloneElement(option, props);
      } else if (isFunction_default()(option)) {
        dotItem = option(props);
      } else {
        var className = classnames_default()('recharts-line-dot', option ? option.className : '');
        dotItem = /*#__PURE__*/react.createElement(Dot, Line_extends({}, props, {
          className: className
        }));
      }
      return dotItem;
    }
  }]);
  return Line;
}(react.PureComponent);
Line_defineProperty(Line, "displayName", 'Line');
Line_defineProperty(Line, "defaultProps", {
  xAxisId: 0,
  yAxisId: 0,
  connectNulls: false,
  activeDot: true,
  dot: true,
  legendType: 'line',
  stroke: '#3182bd',
  strokeWidth: 1,
  fill: '#fff',
  points: [],
  isAnimationActive: !Global.isSsr,
  animateNewValues: true,
  animationBegin: 0,
  animationDuration: 1500,
  animationEasing: 'ease',
  hide: false,
  label: false
});
/**
 * Compose the data of each group
 * @param {Object} props The props from the component
 * @param  {Object} xAxis   The configuration of x-axis
 * @param  {Object} yAxis   The configuration of y-axis
 * @param  {String} dataKey The unique key of a group
 * @return {Array}  Composed data
 */
Line_defineProperty(Line, "getComposedData", function (_ref4) {
  var props = _ref4.props,
    xAxis = _ref4.xAxis,
    yAxis = _ref4.yAxis,
    xAxisTicks = _ref4.xAxisTicks,
    yAxisTicks = _ref4.yAxisTicks,
    dataKey = _ref4.dataKey,
    bandSize = _ref4.bandSize,
    displayedData = _ref4.displayedData,
    offset = _ref4.offset;
  var layout = props.layout;
  var points = displayedData.map(function (entry, index) {
    var value = getValueByDataKey(entry, dataKey);
    if (layout === 'horizontal') {
      return {
        x: getCateCoordinateOfLine({
          axis: xAxis,
          ticks: xAxisTicks,
          bandSize: bandSize,
          entry: entry,
          index: index
        }),
        y: isNil_default()(value) ? null : yAxis.scale(value),
        value: value,
        payload: entry
      };
    }
    return {
      x: isNil_default()(value) ? null : xAxis.scale(value),
      y: getCateCoordinateOfLine({
        axis: yAxis,
        ticks: yAxisTicks,
        bandSize: bandSize,
        entry: entry,
        index: index
      }),
      value: value,
      payload: entry
    };
  });
  return Line_objectSpread({
    points: points,
    layout: layout
  }, offset);
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/YAxis.js
/**
 * @fileOverview Y Axis
 */

var YAxis = function YAxis() {
  return null;
};
YAxis.displayName = 'YAxis';
YAxis.defaultProps = {
  allowDuplicatedCategory: true,
  allowDecimals: true,
  hide: false,
  orientation: 'left',
  width: 60,
  height: 0,
  mirror: false,
  yAxisId: 0,
  tickCount: 5,
  type: 'number',
  padding: {
    top: 0,
    bottom: 0
  },
  allowDataOverflow: false,
  scale: 'auto',
  reversed: false
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/XAxis.js
/**
 * @fileOverview X Axis
 */

/** Define of XAxis props */

var XAxis = function XAxis() {
  return null;
};
XAxis.displayName = 'XAxis';
XAxis.defaultProps = {
  allowDecimals: true,
  hide: false,
  orientation: 'bottom',
  width: 0,
  height: 30,
  mirror: false,
  xAxisId: 0,
  tickCount: 5,
  type: 'category',
  padding: {
    left: 0,
    right: 0
  },
  allowDataOverflow: false,
  scale: 'auto',
  reversed: false,
  allowDuplicatedCategory: true
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/CartesianGrid.js

var CartesianGrid_excluded = ["x1", "y1", "x2", "y2", "key"];
function CartesianGrid_typeof(obj) { "@babel/helpers - typeof"; return CartesianGrid_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; }, CartesianGrid_typeof(obj); }
function CartesianGrid_extends() { CartesianGrid_extends = Object.assign ? Object.assign.bind() : 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 CartesianGrid_extends.apply(this, arguments); }
function CartesianGrid_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = CartesianGrid_objectWithoutPropertiesLoose(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 CartesianGrid_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; }
function CartesianGrid_ownKeys(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 CartesianGrid_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? CartesianGrid_ownKeys(Object(source), !0).forEach(function (key) { CartesianGrid_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : CartesianGrid_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function CartesianGrid_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function CartesianGrid_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, CartesianGrid_toPropertyKey(descriptor.key), descriptor); } }
function CartesianGrid_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartesianGrid_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartesianGrid_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function CartesianGrid_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) CartesianGrid_setPrototypeOf(subClass, superClass); }
function CartesianGrid_setPrototypeOf(o, p) { CartesianGrid_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CartesianGrid_setPrototypeOf(o, p); }
function CartesianGrid_createSuper(Derived) { var hasNativeReflectConstruct = CartesianGrid_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = CartesianGrid_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = CartesianGrid_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return CartesianGrid_possibleConstructorReturn(this, result); }; }
function CartesianGrid_possibleConstructorReturn(self, call) { if (call && (CartesianGrid_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return CartesianGrid_assertThisInitialized(self); }
function CartesianGrid_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function CartesianGrid_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function CartesianGrid_getPrototypeOf(o) { CartesianGrid_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CartesianGrid_getPrototypeOf(o); }
function CartesianGrid_defineProperty(obj, key, value) { key = CartesianGrid_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function CartesianGrid_toPropertyKey(arg) { var key = CartesianGrid_toPrimitive(arg, "string"); return CartesianGrid_typeof(key) === "symbol" ? key : String(key); }
function CartesianGrid_toPrimitive(input, hint) { if (CartesianGrid_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (CartesianGrid_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Cartesian Grid
 */



var CartesianGrid = /*#__PURE__*/function (_PureComponent) {
  CartesianGrid_inherits(CartesianGrid, _PureComponent);
  var _super = CartesianGrid_createSuper(CartesianGrid);
  function CartesianGrid() {
    CartesianGrid_classCallCheck(this, CartesianGrid);
    return _super.apply(this, arguments);
  }
  CartesianGrid_createClass(CartesianGrid, [{
    key: "renderHorizontal",
    value:
    /**
     * Draw the horizontal grid lines
     * @param {Array} horizontalPoints either passed in as props or generated from function
     * @return {Group} Horizontal lines
     */
    function renderHorizontal(horizontalPoints) {
      var _this = this;
      var _this$props = this.props,
        x = _this$props.x,
        width = _this$props.width,
        horizontal = _this$props.horizontal;
      if (!horizontalPoints || !horizontalPoints.length) {
        return null;
      }
      var items = horizontalPoints.map(function (entry, i) {
        var props = CartesianGrid_objectSpread(CartesianGrid_objectSpread({}, _this.props), {}, {
          x1: x,
          y1: entry,
          x2: x + width,
          y2: entry,
          key: "line-".concat(i),
          index: i
        });
        return CartesianGrid.renderLineItem(horizontal, props);
      });
      return /*#__PURE__*/react.createElement("g", {
        className: "recharts-cartesian-grid-horizontal"
      }, items);
    }

    /**
     * Draw vertical grid lines
     * @param {Array} verticalPoints either passed in as props or generated from function
     * @return {Group} Vertical lines
     */
  }, {
    key: "renderVertical",
    value: function renderVertical(verticalPoints) {
      var _this2 = this;
      var _this$props2 = this.props,
        y = _this$props2.y,
        height = _this$props2.height,
        vertical = _this$props2.vertical;
      if (!verticalPoints || !verticalPoints.length) {
        return null;
      }
      var items = verticalPoints.map(function (entry, i) {
        var props = CartesianGrid_objectSpread(CartesianGrid_objectSpread({}, _this2.props), {}, {
          x1: entry,
          y1: y,
          x2: entry,
          y2: y + height,
          key: "line-".concat(i),
          index: i
        });
        return CartesianGrid.renderLineItem(vertical, props);
      });
      return /*#__PURE__*/react.createElement("g", {
        className: "recharts-cartesian-grid-vertical"
      }, items);
    }

    /**
     * Draw vertical grid stripes filled by colors
     * @param {Array} verticalPoints either passed in as props or generated from function
     * @return {Group} Vertical stripes
     */
  }, {
    key: "renderVerticalStripes",
    value: function renderVerticalStripes(verticalPoints) {
      var verticalFill = this.props.verticalFill;
      if (!verticalFill || !verticalFill.length) {
        return null;
      }
      var _this$props3 = this.props,
        fillOpacity = _this$props3.fillOpacity,
        x = _this$props3.x,
        y = _this$props3.y,
        width = _this$props3.width,
        height = _this$props3.height;
      var roundedSortedVerticalPoints = verticalPoints.map(function (e) {
        return Math.round(e + x - x);
      }).sort(function (a, b) {
        return a - b;
      });
      if (x !== roundedSortedVerticalPoints[0]) {
        roundedSortedVerticalPoints.unshift(0);
      }
      var items = roundedSortedVerticalPoints.map(function (entry, i) {
        var lastStripe = !roundedSortedVerticalPoints[i + 1];
        var lineWidth = lastStripe ? x + width - entry : roundedSortedVerticalPoints[i + 1] - entry;
        if (lineWidth <= 0) {
          return null;
        }
        var colorIndex = i % verticalFill.length;
        return /*#__PURE__*/react.createElement("rect", {
          key: "react-".concat(i) // eslint-disable-line react/no-array-index-key
          ,
          x: entry,
          y: y,
          width: lineWidth,
          height: height,
          stroke: "none",
          fill: verticalFill[colorIndex],
          fillOpacity: fillOpacity,
          className: "recharts-cartesian-grid-bg"
        });
      });
      return /*#__PURE__*/react.createElement("g", {
        className: "recharts-cartesian-gridstripes-vertical"
      }, items);
    }

    /**
     * Draw horizontal grid stripes filled by colors
     * @param {Array} horizontalPoints either passed in as props or generated from function
     * @return {Group} Horizontal stripes
     */
  }, {
    key: "renderHorizontalStripes",
    value: function renderHorizontalStripes(horizontalPoints) {
      var horizontalFill = this.props.horizontalFill;
      if (!horizontalFill || !horizontalFill.length) {
        return null;
      }
      var _this$props4 = this.props,
        fillOpacity = _this$props4.fillOpacity,
        x = _this$props4.x,
        y = _this$props4.y,
        width = _this$props4.width,
        height = _this$props4.height;
      var roundedSortedHorizontalPoints = horizontalPoints.map(function (e) {
        return Math.round(e + y - y);
      }).sort(function (a, b) {
        return a - b;
      });
      if (y !== roundedSortedHorizontalPoints[0]) {
        roundedSortedHorizontalPoints.unshift(0);
      }
      var items = roundedSortedHorizontalPoints.map(function (entry, i) {
        var lastStripe = !roundedSortedHorizontalPoints[i + 1];
        var lineHeight = lastStripe ? y + height - entry : roundedSortedHorizontalPoints[i + 1] - entry;
        if (lineHeight <= 0) {
          return null;
        }
        var colorIndex = i % horizontalFill.length;
        return /*#__PURE__*/react.createElement("rect", {
          key: "react-".concat(i) // eslint-disable-line react/no-array-index-key
          ,
          y: entry,
          x: x,
          height: lineHeight,
          width: width,
          stroke: "none",
          fill: horizontalFill[colorIndex],
          fillOpacity: fillOpacity,
          className: "recharts-cartesian-grid-bg"
        });
      });
      return /*#__PURE__*/react.createElement("g", {
        className: "recharts-cartesian-gridstripes-horizontal"
      }, items);
    }
  }, {
    key: "renderBackground",
    value: function renderBackground() {
      var fill = this.props.fill;
      if (!fill || fill === 'none') {
        return null;
      }
      var _this$props5 = this.props,
        fillOpacity = _this$props5.fillOpacity,
        x = _this$props5.x,
        y = _this$props5.y,
        width = _this$props5.width,
        height = _this$props5.height;
      return /*#__PURE__*/react.createElement("rect", {
        x: x,
        y: y,
        width: width,
        height: height,
        stroke: "none",
        fill: fill,
        fillOpacity: fillOpacity,
        className: "recharts-cartesian-grid-bg"
      });
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props6 = this.props,
        x = _this$props6.x,
        y = _this$props6.y,
        width = _this$props6.width,
        height = _this$props6.height,
        horizontal = _this$props6.horizontal,
        vertical = _this$props6.vertical,
        horizontalCoordinatesGenerator = _this$props6.horizontalCoordinatesGenerator,
        verticalCoordinatesGenerator = _this$props6.verticalCoordinatesGenerator,
        xAxis = _this$props6.xAxis,
        yAxis = _this$props6.yAxis,
        offset = _this$props6.offset,
        chartWidth = _this$props6.chartWidth,
        chartHeight = _this$props6.chartHeight;
      if (!isNumber(width) || width <= 0 || !isNumber(height) || height <= 0 || !isNumber(x) || x !== +x || !isNumber(y) || y !== +y) {
        return null;
      }
      var _this$props7 = this.props,
        horizontalPoints = _this$props7.horizontalPoints,
        verticalPoints = _this$props7.verticalPoints;

      // No horizontal points are specified
      if ((!horizontalPoints || !horizontalPoints.length) && isFunction_default()(horizontalCoordinatesGenerator)) {
        horizontalPoints = horizontalCoordinatesGenerator({
          yAxis: yAxis,
          width: chartWidth,
          height: chartHeight,
          offset: offset
        });
      }

      // No vertical points are specified
      if ((!verticalPoints || !verticalPoints.length) && isFunction_default()(verticalCoordinatesGenerator)) {
        verticalPoints = verticalCoordinatesGenerator({
          xAxis: xAxis,
          width: chartWidth,
          height: chartHeight,
          offset: offset
        });
      }
      return /*#__PURE__*/react.createElement("g", {
        className: "recharts-cartesian-grid"
      }, this.renderBackground(), horizontal && this.renderHorizontal(horizontalPoints), vertical && this.renderVertical(verticalPoints), horizontal && this.renderHorizontalStripes(horizontalPoints), vertical && this.renderVerticalStripes(verticalPoints));
    }
  }], [{
    key: "renderLineItem",
    value: function renderLineItem(option, props) {
      var lineItem;
      if ( /*#__PURE__*/react.isValidElement(option)) {
        lineItem = /*#__PURE__*/react.cloneElement(option, props);
      } else if (isFunction_default()(option)) {
        lineItem = option(props);
      } else {
        var x1 = props.x1,
          y1 = props.y1,
          x2 = props.x2,
          y2 = props.y2,
          key = props.key,
          others = CartesianGrid_objectWithoutProperties(props, CartesianGrid_excluded);
        lineItem = /*#__PURE__*/react.createElement("line", CartesianGrid_extends({}, filterProps(others), {
          x1: x1,
          y1: y1,
          x2: x2,
          y2: y2,
          fill: "none",
          key: key
        }));
      }
      return lineItem;
    }
  }]);
  return CartesianGrid;
}(react.PureComponent);
CartesianGrid_defineProperty(CartesianGrid, "displayName", 'CartesianGrid');
CartesianGrid_defineProperty(CartesianGrid, "defaultProps", {
  horizontal: true,
  vertical: true,
  // The ordinates of horizontal grid lines
  horizontalPoints: [],
  // The abscissas of vertical grid lines
  verticalPoints: [],
  stroke: '#ccc',
  fill: 'none',
  // The fill of colors of grid lines
  verticalFill: [],
  horizontalFill: []
});
// EXTERNAL MODULE: ./node_modules/lodash/debounce.js
var node_modules_lodash_debounce = __webpack_require__(8221);
var debounce_default = /*#__PURE__*/__webpack_require__.n(node_modules_lodash_debounce);
// EXTERNAL MODULE: ./node_modules/lodash/throttle.js
var throttle = __webpack_require__(7350);
var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/react-resize-detector/build/index.esm.js
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */

var index_esm_extendStatics = function(d, b) {
    index_esm_extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return index_esm_extendStatics(d, b);
};

function index_esm_extends(d, b) {
    index_esm_extendStatics(d, b);
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

var index_esm_assign = function() {
    index_esm_assign = Object.assign || function __assign(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    };
    return index_esm_assign.apply(this, arguments);
};

function index_esm_rest(s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
}var patchResizeHandler = function (resizeCallback, refreshMode, refreshRate, refreshOptions) {
    switch (refreshMode) {
        case 'debounce':
            return debounce_default()(resizeCallback, refreshRate, refreshOptions);
        case 'throttle':
            return throttle_default()(resizeCallback, refreshRate, refreshOptions);
        default:
            return resizeCallback;
    }
};
var index_esm_isFunction = function (fn) { return typeof fn === 'function'; };
var isSSR = function () { return typeof window === 'undefined'; };
var isDOMElement = function (element) {
    return element instanceof Element || element instanceof HTMLDocument;
};
var createNotifier = function (setSize, handleWidth, handleHeight) {
    return function (_a) {
        var width = _a.width, height = _a.height;
        setSize(function (prev) {
            if (prev.width === width && prev.height === height) {
                // skip if dimensions haven't changed
                return prev;
            }
            if ((prev.width === width && !handleHeight) || (prev.height === height && !handleWidth)) {
                // process `handleHeight/handleWidth` props
                return prev;
            }
            return { width: width, height: height };
        });
    };
};var ResizeDetector = /** @class */ (function (_super) {
    index_esm_extends(ResizeDetector, _super);
    function ResizeDetector(props) {
        var _this = _super.call(this, props) || this;
        _this.cancelHandler = function () {
            if (_this.resizeHandler && _this.resizeHandler.cancel) {
                // cancel debounced handler
                _this.resizeHandler.cancel();
                _this.resizeHandler = null;
            }
        };
        _this.attachObserver = function () {
            var _a = _this.props, targetRef = _a.targetRef, observerOptions = _a.observerOptions;
            if (isSSR()) {
                return;
            }
            if (targetRef && targetRef.current) {
                _this.targetRef.current = targetRef.current;
            }
            var element = _this.getElement();
            if (!element) {
                // can't find element to observe
                return;
            }
            if (_this.observableElement && _this.observableElement === element) {
                // element is already observed
                return;
            }
            _this.observableElement = element;
            _this.resizeObserver.observe(element, observerOptions);
        };
        _this.getElement = function () {
            var _a = _this.props, querySelector = _a.querySelector, targetDomEl = _a.targetDomEl;
            if (isSSR())
                return null;
            // in case we pass a querySelector
            if (querySelector)
                return document.querySelector(querySelector);
            // in case we pass a DOM element
            if (targetDomEl && isDOMElement(targetDomEl))
                return targetDomEl;
            // in case we pass a React ref using React.createRef()
            if (_this.targetRef && isDOMElement(_this.targetRef.current))
                return _this.targetRef.current;
            // the worse case when we don't receive any information from the parent and the library doesn't add any wrappers
            // we have to use a deprecated `findDOMNode` method in order to find a DOM element to attach to
            var currentElement = (0,react_dom.findDOMNode)(_this);
            if (!currentElement)
                return null;
            var renderType = _this.getRenderType();
            switch (renderType) {
                case 'renderProp':
                    return currentElement;
                case 'childFunction':
                    return currentElement;
                case 'child':
                    return currentElement;
                case 'childArray':
                    return currentElement;
                default:
                    return currentElement.parentElement;
            }
        };
        _this.createResizeHandler = function (entries) {
            var _a = _this.props, _b = _a.handleWidth, handleWidth = _b === void 0 ? true : _b, _c = _a.handleHeight, handleHeight = _c === void 0 ? true : _c, onResize = _a.onResize;
            if (!handleWidth && !handleHeight)
                return;
            var notifyResize = createNotifier(function (setStateFunc) { return _this.setState(setStateFunc, function () { return onResize === null || onResize === void 0 ? void 0 : onResize(_this.state.width, _this.state.height); }); }, handleWidth, handleHeight);
            entries.forEach(function (entry) {
                var _a = (entry && entry.contentRect) || {}, width = _a.width, height = _a.height;
                var shouldSetSize = !_this.skipOnMount && !isSSR();
                if (shouldSetSize) {
                    notifyResize({ width: width, height: height });
                }
                _this.skipOnMount = false;
            });
        };
        _this.getRenderType = function () {
            var _a = _this.props, render = _a.render, children = _a.children;
            if (index_esm_isFunction(render)) {
                // DEPRECATED. Use `Child Function Pattern` instead
                return 'renderProp';
            }
            if (index_esm_isFunction(children)) {
                return 'childFunction';
            }
            if ((0,react.isValidElement)(children)) {
                return 'child';
            }
            if (Array.isArray(children)) {
                // DEPRECATED. Wrap children with a single parent
                return 'childArray';
            }
            // DEPRECATED. Use `Child Function Pattern` instead
            return 'parent';
        };
        var skipOnMount = props.skipOnMount, refreshMode = props.refreshMode, _a = props.refreshRate, refreshRate = _a === void 0 ? 1000 : _a, refreshOptions = props.refreshOptions;
        _this.state = {
            width: undefined,
            height: undefined
        };
        _this.skipOnMount = skipOnMount;
        _this.targetRef = (0,react.createRef)();
        _this.observableElement = null;
        if (isSSR()) {
            return _this;
        }
        _this.resizeHandler = patchResizeHandler(_this.createResizeHandler, refreshMode, refreshRate, refreshOptions);
        _this.resizeObserver = new window.ResizeObserver(_this.resizeHandler);
        return _this;
    }
    ResizeDetector.prototype.componentDidMount = function () {
        this.attachObserver();
    };
    ResizeDetector.prototype.componentDidUpdate = function () {
        this.attachObserver();
    };
    ResizeDetector.prototype.componentWillUnmount = function () {
        if (isSSR()) {
            return;
        }
        this.observableElement = null;
        this.resizeObserver.disconnect();
        this.cancelHandler();
    };
    ResizeDetector.prototype.render = function () {
        var _a = this.props, render = _a.render, children = _a.children, _b = _a.nodeType, WrapperTag = _b === void 0 ? 'div' : _b;
        var _c = this.state, width = _c.width, height = _c.height;
        var childProps = { width: width, height: height, targetRef: this.targetRef };
        var renderType = this.getRenderType();
        switch (renderType) {
            case 'renderProp':
                return render === null || render === void 0 ? void 0 : render(childProps);
            case 'childFunction': {
                var childFunction = children;
                return childFunction === null || childFunction === void 0 ? void 0 : childFunction(childProps);
            }
            case 'child': {
                // @TODO bug prone logic
                var child = children;
                if (child.type && typeof child.type === 'string') {
                    // child is a native DOM elements such as div, span etc
                    // eslint-disable-next-line @typescript-eslint/no-unused-vars
                    childProps.targetRef; var nativeProps = index_esm_rest(childProps, ["targetRef"]);
                    return (0,react.cloneElement)(child, nativeProps);
                }
                // class or functional component otherwise
                return (0,react.cloneElement)(child, childProps);
            }
            case 'childArray': {
                var childArray = children;
                return childArray.map(function (el) { return !!el && (0,react.cloneElement)(el, childProps); });
            }
            default:
                return react.createElement(WrapperTag, null);
        }
    };
    return ResizeDetector;
}(react.PureComponent));function withResizeDetector(ComponentInner, options) {
    if (options === void 0) { options = {}; }
    var ResizeDetectorHOC = /** @class */ (function (_super) {
        index_esm_extends(ResizeDetectorHOC, _super);
        function ResizeDetectorHOC() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.ref = createRef();
            return _this;
        }
        ResizeDetectorHOC.prototype.render = function () {
            var _a = this.props, forwardedRef = _a.forwardedRef, rest = index_esm_rest(_a, ["forwardedRef"]);
            var targetRef = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : this.ref;
            return (React.createElement(ResizeDetector, index_esm_assign({}, options, { targetRef: targetRef }),
                React.createElement(ComponentInner, index_esm_assign({ targetRef: targetRef }, rest))));
        };
        return ResizeDetectorHOC;
    }(Component));
    function forwardRefWrapper(props, ref) {
        return React.createElement(ResizeDetectorHOC, index_esm_assign({}, props, { forwardedRef: ref }));
    }
    var name = ComponentInner.displayName || ComponentInner.name;
    forwardRefWrapper.displayName = "withResizeDetector(".concat(name, ")");
    return forwardRef(forwardRefWrapper);
}var index_esm_useEnhancedEffect = isSSR() ? react.useEffect : react.useLayoutEffect;
function useResizeDetector(_a) {
    var _b = _a === void 0 ? {} : _a, _c = _b.skipOnMount, skipOnMount = _c === void 0 ? false : _c, refreshMode = _b.refreshMode, _d = _b.refreshRate, refreshRate = _d === void 0 ? 1000 : _d, refreshOptions = _b.refreshOptions, _e = _b.handleWidth, handleWidth = _e === void 0 ? true : _e, _f = _b.handleHeight, handleHeight = _f === void 0 ? true : _f, targetRef = _b.targetRef, observerOptions = _b.observerOptions, onResize = _b.onResize;
    var skipResize = useRef(skipOnMount);
    var localRef = useRef(null);
    var resizeHandler = useRef();
    var ref = targetRef !== null && targetRef !== void 0 ? targetRef : localRef;
    var _g = useState({
        width: undefined,
        height: undefined
    }), size = _g[0], setSize = _g[1];
    index_esm_useEnhancedEffect(function () {
        if (!handleWidth && !handleHeight)
            return;
        var notifyResize = createNotifier(setSize, handleWidth, handleHeight);
        var resizeCallback = function (entries) {
            if (!handleWidth && !handleHeight)
                return;
            entries.forEach(function (entry) {
                var _a = (entry && entry.contentRect) || {}, width = _a.width, height = _a.height;
                var shouldSetSize = !skipResize.current;
                if (shouldSetSize) {
                    notifyResize({ width: width, height: height });
                }
                skipResize.current = false;
            });
        };
        resizeHandler.current = patchResizeHandler(resizeCallback, refreshMode, refreshRate, refreshOptions);
        var resizeObserver = new window.ResizeObserver(resizeHandler.current);
        if (ref.current) {
            resizeObserver.observe(ref.current, observerOptions);
        }
        return function () {
            var _a, _b;
            resizeObserver.disconnect();
            (_b = (_a = resizeHandler.current).cancel) === null || _b === void 0 ? void 0 : _b.call(_a);
        };
    }, [refreshMode, refreshRate, refreshOptions, handleWidth, handleHeight, observerOptions, ref.current]);
    useEffect(function () {
        onResize === null || onResize === void 0 ? void 0 : onResize(size.width, size.height);
    }, [size]);
    return index_esm_assign({ ref: ref }, size);
}//# sourceMappingURL=index.esm.js.map

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/LogUtils.js
/* eslint no-console: 0 */
var LogUtils_isDev = "production" !== 'production';
var LogUtils_warn = function warn(condition, format) {
  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    args[_key - 2] = arguments[_key];
  }
  if (LogUtils_isDev && typeof console !== 'undefined' && console.warn) {
    if (format === undefined) {
      console.warn('LogUtils requires an error message argument');
    }
    if (!condition) {
      if (format === undefined) {
        console.warn('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
      } else {
        var argIndex = 0;
        console.warn(format.replace(/%s/g, function () {
          return args[argIndex++];
        }));
      }
    }
  }
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/component/ResponsiveContainer.js
function ResponsiveContainer_extends() { ResponsiveContainer_extends = Object.assign ? Object.assign.bind() : 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 ResponsiveContainer_extends.apply(this, arguments); }
function ResponsiveContainer_slicedToArray(arr, i) { return ResponsiveContainer_arrayWithHoles(arr) || ResponsiveContainer_iterableToArrayLimit(arr, i) || ResponsiveContainer_unsupportedIterableToArray(arr, i) || ResponsiveContainer_nonIterableRest(); }
function ResponsiveContainer_nonIterableRest() { 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 ResponsiveContainer_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ResponsiveContainer_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 ResponsiveContainer_arrayLikeToArray(o, minLen); }
function ResponsiveContainer_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 ResponsiveContainer_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function ResponsiveContainer_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
/**
 * @fileOverview Wrapper component to make charts adapt to the size of parent * DOM
 */





var ResponsiveContainer = /*#__PURE__*/(0,react.forwardRef)(function (_ref, ref) {
  var aspect = _ref.aspect,
    _ref$initialDimension = _ref.initialDimension,
    initialDimension = _ref$initialDimension === void 0 ? {
      width: -1,
      height: -1
    } : _ref$initialDimension,
    _ref$width = _ref.width,
    width = _ref$width === void 0 ? '100%' : _ref$width,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? '100%' : _ref$height,
    _ref$minWidth = _ref.minWidth,
    minWidth = _ref$minWidth === void 0 ? 0 : _ref$minWidth,
    minHeight = _ref.minHeight,
    maxHeight = _ref.maxHeight,
    children = _ref.children,
    _ref$debounce = _ref.debounce,
    debounce = _ref$debounce === void 0 ? 0 : _ref$debounce,
    id = _ref.id,
    className = _ref.className,
    onResize = _ref.onResize;
  var _useState = (0,react.useState)({
      containerWidth: initialDimension.width,
      containerHeight: initialDimension.height
    }),
    _useState2 = ResponsiveContainer_slicedToArray(_useState, 2),
    sizes = _useState2[0],
    setSizes = _useState2[1];
  var containerRef = (0,react.useRef)(null);
  (0,react.useImperativeHandle)(ref, function () {
    return containerRef;
  }, [containerRef]);
  var getContainerSize = (0,react.useCallback)(function () {
    if (!containerRef.current) {
      return null;
    }
    return {
      containerWidth: containerRef.current.clientWidth,
      containerHeight: containerRef.current.clientHeight
    };
  }, []);
  var updateDimensionsImmediate = (0,react.useCallback)(function () {
    var newSize = getContainerSize();
    if (newSize) {
      var containerWidth = newSize.containerWidth,
        containerHeight = newSize.containerHeight;
      if (onResize) onResize(containerWidth, containerHeight);
      setSizes(function (currentSizes) {
        var oldWidth = currentSizes.containerWidth,
          oldHeight = currentSizes.containerHeight;
        if (containerWidth !== oldWidth || containerHeight !== oldHeight) {
          return {
            containerWidth: containerWidth,
            containerHeight: containerHeight
          };
        }
        return currentSizes;
      });
    }
  }, [getContainerSize, onResize]);
  var chartContent = (0,react.useMemo)(function () {
    var containerWidth = sizes.containerWidth,
      containerHeight = sizes.containerHeight;
    if (containerWidth < 0 || containerHeight < 0) {
      return null;
    }
    LogUtils_warn(isPercent(width) || isPercent(height), "The width(%s) and height(%s) are both fixed numbers,\n       maybe you don't need to use a ResponsiveContainer.", width, height);
    LogUtils_warn(!aspect || aspect > 0, 'The aspect(%s) must be greater than zero.', aspect);
    var calculatedWidth = isPercent(width) ? containerWidth : width;
    var calculatedHeight = isPercent(height) ? containerHeight : height;
    if (aspect && aspect > 0) {
      // Preserve the desired aspect ratio
      if (calculatedWidth) {
        // Will default to using width for aspect ratio
        calculatedHeight = calculatedWidth / aspect;
      } else if (calculatedHeight) {
        // But we should also take height into consideration
        calculatedWidth = calculatedHeight * aspect;
      }

      // if maxHeight is set, overwrite if calculatedHeight is greater than maxHeight
      if (maxHeight && calculatedHeight > maxHeight) {
        calculatedHeight = maxHeight;
      }
    }
    LogUtils_warn(calculatedWidth > 0 || calculatedHeight > 0, "The width(%s) and height(%s) of chart should be greater than 0,\n       please check the style of container, or the props width(%s) and height(%s),\n       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n       height and width.", calculatedWidth, calculatedHeight, width, height, minWidth, minHeight, aspect);
    return /*#__PURE__*/(0,react.cloneElement)(children, {
      width: calculatedWidth,
      height: calculatedHeight
    });
  }, [aspect, children, height, maxHeight, minHeight, minWidth, sizes, width]);
  (0,react.useEffect)(function () {
    var size = getContainerSize();
    if (size) {
      setSizes(size);
    }
  }, [getContainerSize]);
  var style = {
    width: width,
    height: height,
    minWidth: minWidth,
    minHeight: minHeight,
    maxHeight: maxHeight
  };
  return /*#__PURE__*/react.createElement(ResizeDetector, {
    handleWidth: true,
    handleHeight: true,
    onResize: updateDimensionsImmediate,
    targetRef: containerRef,
    refreshMode: debounce > 0 ? 'debounce' : undefined,
    refreshRate: debounce
  }, /*#__PURE__*/react.createElement("div", ResponsiveContainer_extends({}, id != null ? {
    id: "".concat(id)
  } : {}, {
    className: classnames_default()('recharts-responsive-container', className),
    style: style,
    ref: containerRef
  }), chartContent));
});
// EXTERNAL MODULE: ./node_modules/lodash/every.js
var every = __webpack_require__(9747);
var every_default = /*#__PURE__*/__webpack_require__.n(every);
// EXTERNAL MODULE: ./node_modules/lodash/find.js
var lodash_find = __webpack_require__(7309);
var find_default = /*#__PURE__*/__webpack_require__.n(lodash_find);
// EXTERNAL MODULE: ./node_modules/lodash/range.js
var lodash_range = __webpack_require__(3181);
var range_default = /*#__PURE__*/__webpack_require__.n(lodash_range);
// EXTERNAL MODULE: ./node_modules/lodash/isBoolean.js
var isBoolean = __webpack_require__(3812);
var isBoolean_default = /*#__PURE__*/__webpack_require__.n(isBoolean);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/getEveryNthWithCondition.js
/**
 * Given an array and a number N, return a new array which contains every nTh
 * element of the input array. For n below 1, an empty array is returned.
 * If isValid is provided, all candidates must suffice the condition, else undefined is returned.
 * @param {T[]} array An input array.
 * @param {integer} n A number
 * @param {Function} isValid A function to evaluate a candidate form the array
 * @returns {T[]} The result array of the same type as the input array.
 */
function getEveryNthWithCondition(array, n, isValid) {
  if (n < 1) {
    return [];
  }
  if (n === 1 && isValid === undefined) {
    return array;
  }
  var result = [];
  for (var i = 0; i < array.length; i += n) {
    if (isValid === undefined || isValid(array[i]) === true) {
      result.push(array[i]);
    } else {
      return undefined;
    }
  }
  return result;
}
// EXTERNAL MODULE: ./node_modules/lodash/mapValues.js
var mapValues = __webpack_require__(3916);
var mapValues_default = /*#__PURE__*/__webpack_require__.n(mapValues);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/shape/Rectangle.js
function Rectangle_typeof(obj) { "@babel/helpers - typeof"; return Rectangle_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; }, Rectangle_typeof(obj); }
function Rectangle_extends() { Rectangle_extends = Object.assign ? Object.assign.bind() : 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 Rectangle_extends.apply(this, arguments); }
function Rectangle_slicedToArray(arr, i) { return Rectangle_arrayWithHoles(arr) || Rectangle_iterableToArrayLimit(arr, i) || Rectangle_unsupportedIterableToArray(arr, i) || Rectangle_nonIterableRest(); }
function Rectangle_nonIterableRest() { 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 Rectangle_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Rectangle_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 Rectangle_arrayLikeToArray(o, minLen); }
function Rectangle_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 Rectangle_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function Rectangle_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function Rectangle_ownKeys(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 Rectangle_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Rectangle_ownKeys(Object(source), !0).forEach(function (key) { Rectangle_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Rectangle_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Rectangle_defineProperty(obj, key, value) { key = Rectangle_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Rectangle_toPropertyKey(arg) { var key = Rectangle_toPrimitive(arg, "string"); return Rectangle_typeof(key) === "symbol" ? key : String(key); }
function Rectangle_toPrimitive(input, hint) { if (Rectangle_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Rectangle_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Rectangle
 */




var getRectanglePath = function getRectanglePath(x, y, width, height, radius) {
  var maxRadius = Math.min(Math.abs(width) / 2, Math.abs(height) / 2);
  var ySign = height >= 0 ? 1 : -1;
  var xSign = width >= 0 ? 1 : -1;
  var clockWise = height >= 0 && width >= 0 || height < 0 && width < 0 ? 1 : 0;
  var path;
  if (maxRadius > 0 && radius instanceof Array) {
    var newRadius = [0, 0, 0, 0];
    for (var i = 0, len = 4; i < len; i++) {
      newRadius[i] = radius[i] > maxRadius ? maxRadius : radius[i];
    }
    path = "M".concat(x, ",").concat(y + ySign * newRadius[0]);
    if (newRadius[0] > 0) {
      path += "A ".concat(newRadius[0], ",").concat(newRadius[0], ",0,0,").concat(clockWise, ",").concat(x + xSign * newRadius[0], ",").concat(y);
    }
    path += "L ".concat(x + width - xSign * newRadius[1], ",").concat(y);
    if (newRadius[1] > 0) {
      path += "A ".concat(newRadius[1], ",").concat(newRadius[1], ",0,0,").concat(clockWise, ",\n        ").concat(x + width, ",").concat(y + ySign * newRadius[1]);
    }
    path += "L ".concat(x + width, ",").concat(y + height - ySign * newRadius[2]);
    if (newRadius[2] > 0) {
      path += "A ".concat(newRadius[2], ",").concat(newRadius[2], ",0,0,").concat(clockWise, ",\n        ").concat(x + width - xSign * newRadius[2], ",").concat(y + height);
    }
    path += "L ".concat(x + xSign * newRadius[3], ",").concat(y + height);
    if (newRadius[3] > 0) {
      path += "A ".concat(newRadius[3], ",").concat(newRadius[3], ",0,0,").concat(clockWise, ",\n        ").concat(x, ",").concat(y + height - ySign * newRadius[3]);
    }
    path += 'Z';
  } else if (maxRadius > 0 && radius === +radius && radius > 0) {
    var _newRadius = Math.min(maxRadius, radius);
    path = "M ".concat(x, ",").concat(y + ySign * _newRadius, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x + xSign * _newRadius, ",").concat(y, "\n            L ").concat(x + width - xSign * _newRadius, ",").concat(y, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x + width, ",").concat(y + ySign * _newRadius, "\n            L ").concat(x + width, ",").concat(y + height - ySign * _newRadius, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x + width - xSign * _newRadius, ",").concat(y + height, "\n            L ").concat(x + xSign * _newRadius, ",").concat(y + height, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x, ",").concat(y + height - ySign * _newRadius, " Z");
  } else {
    path = "M ".concat(x, ",").concat(y, " h ").concat(width, " v ").concat(height, " h ").concat(-width, " Z");
  }
  return path;
};
var isInRectangle = function isInRectangle(point, rect) {
  if (!point || !rect) {
    return false;
  }
  var px = point.x,
    py = point.y;
  var x = rect.x,
    y = rect.y,
    width = rect.width,
    height = rect.height;
  if (Math.abs(width) > 0 && Math.abs(height) > 0) {
    var minX = Math.min(x, x + width);
    var maxX = Math.max(x, x + width);
    var minY = Math.min(y, y + height);
    var maxY = Math.max(y, y + height);
    return px >= minX && px <= maxX && py >= minY && py <= maxY;
  }
  return false;
};
var Rectangle_defaultProps = {
  x: 0,
  y: 0,
  width: 0,
  height: 0,
  // The radius of border
  // The radius of four corners when radius is a number
  // The radius of left-top, right-top, right-bottom, left-bottom when radius is an array
  radius: 0,
  isAnimationActive: false,
  isUpdateAnimationActive: false,
  animationBegin: 0,
  animationDuration: 1500,
  animationEasing: 'ease'
};
var Rectangle = function Rectangle(rectangleProps) {
  var props = Rectangle_objectSpread(Rectangle_objectSpread({}, Rectangle_defaultProps), rectangleProps);
  var pathRef = (0,react.useRef)();
  var _useState = (0,react.useState)(-1),
    _useState2 = Rectangle_slicedToArray(_useState, 2),
    totalLength = _useState2[0],
    setTotalLength = _useState2[1];
  (0,react.useEffect)(function () {
    if (pathRef.current && pathRef.current.getTotalLength) {
      try {
        var pathTotalLength = pathRef.current.getTotalLength();
        if (pathTotalLength) {
          setTotalLength(pathTotalLength);
        }
      } catch (err) {
        // calculate total length error
      }
    }
  }, []);
  var x = props.x,
    y = props.y,
    width = props.width,
    height = props.height,
    radius = props.radius,
    className = props.className;
  var animationEasing = props.animationEasing,
    animationDuration = props.animationDuration,
    animationBegin = props.animationBegin,
    isAnimationActive = props.isAnimationActive,
    isUpdateAnimationActive = props.isUpdateAnimationActive;
  if (x !== +x || y !== +y || width !== +width || height !== +height || width === 0 || height === 0) {
    return null;
  }
  var layerClass = classnames_default()('recharts-rectangle', className);
  if (!isUpdateAnimationActive) {
    return /*#__PURE__*/react.createElement("path", Rectangle_extends({}, filterProps(props, true), {
      className: layerClass,
      d: getRectanglePath(x, y, width, height, radius)
    }));
  }
  return /*#__PURE__*/react.createElement(es6, {
    canBegin: totalLength > 0,
    from: {
      width: width,
      height: height,
      x: x,
      y: y
    },
    to: {
      width: width,
      height: height,
      x: x,
      y: y
    },
    duration: animationDuration,
    animationEasing: animationEasing,
    isActive: isUpdateAnimationActive
  }, function (_ref) {
    var currWidth = _ref.width,
      currHeight = _ref.height,
      currX = _ref.x,
      currY = _ref.y;
    return /*#__PURE__*/react.createElement(es6, {
      canBegin: totalLength > 0,
      from: "0px ".concat(totalLength === -1 ? 1 : totalLength, "px"),
      to: "".concat(totalLength, "px 0px"),
      attributeName: "strokeDasharray",
      begin: animationBegin,
      duration: animationDuration,
      isActive: isAnimationActive,
      easing: animationEasing
    }, /*#__PURE__*/react.createElement("path", Rectangle_extends({}, filterProps(props, true), {
      className: layerClass,
      d: getRectanglePath(currX, currY, currWidth, currHeight, radius),
      ref: pathRef
    })));
  });
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/component/Cell.js
/**
 * @fileOverview Cross
 */

var Cell = function Cell(_props) {
  return null;
};
Cell.displayName = 'Cell';
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/Bar.js




var Bar_excluded = ["value", "background"];
function Bar_typeof(obj) { "@babel/helpers - typeof"; return Bar_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; }, Bar_typeof(obj); }
function Bar_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Bar_objectWithoutPropertiesLoose(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 Bar_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; }
function Bar_extends() { Bar_extends = Object.assign ? Object.assign.bind() : 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 Bar_extends.apply(this, arguments); }
function Bar_ownKeys(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 Bar_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Bar_ownKeys(Object(source), !0).forEach(function (key) { Bar_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Bar_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Bar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Bar_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, Bar_toPropertyKey(descriptor.key), descriptor); } }
function Bar_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function Bar_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Bar_setPrototypeOf(subClass, superClass); }
function Bar_setPrototypeOf(o, p) { Bar_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar_setPrototypeOf(o, p); }
function Bar_createSuper(Derived) { var hasNativeReflectConstruct = Bar_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Bar_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Bar_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Bar_possibleConstructorReturn(this, result); }; }
function Bar_possibleConstructorReturn(self, call) { if (call && (Bar_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Bar_assertThisInitialized(self); }
function Bar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Bar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function Bar_getPrototypeOf(o) { Bar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar_getPrototypeOf(o); }
function Bar_defineProperty(obj, key, value) { key = Bar_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Bar_toPropertyKey(arg) { var key = Bar_toPrimitive(arg, "string"); return Bar_typeof(key) === "symbol" ? key : String(key); }
function Bar_toPrimitive(input, hint) { if (Bar_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Bar_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Render a group of bar
 */













var Bar = /*#__PURE__*/function (_PureComponent) {
  Bar_inherits(Bar, _PureComponent);
  var _super = Bar_createSuper(Bar);
  function Bar() {
    var _this;
    Bar_classCallCheck(this, Bar);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    Bar_defineProperty(Bar_assertThisInitialized(_this), "state", {
      isAnimationFinished: false
    });
    Bar_defineProperty(Bar_assertThisInitialized(_this), "id", uniqueId('recharts-bar-'));
    Bar_defineProperty(Bar_assertThisInitialized(_this), "handleAnimationEnd", function () {
      var onAnimationEnd = _this.props.onAnimationEnd;
      _this.setState({
        isAnimationFinished: true
      });
      if (onAnimationEnd) {
        onAnimationEnd();
      }
    });
    Bar_defineProperty(Bar_assertThisInitialized(_this), "handleAnimationStart", function () {
      var onAnimationStart = _this.props.onAnimationStart;
      _this.setState({
        isAnimationFinished: false
      });
      if (onAnimationStart) {
        onAnimationStart();
      }
    });
    return _this;
  }
  Bar_createClass(Bar, [{
    key: "renderRectanglesStatically",
    value: function renderRectanglesStatically(data) {
      var _this2 = this;
      var shape = this.props.shape;
      var baseProps = filterProps(this.props);
      return data && data.map(function (entry, i) {
        var props = Bar_objectSpread(Bar_objectSpread(Bar_objectSpread({}, baseProps), entry), {}, {
          index: i
        });
        return /*#__PURE__*/react.createElement(Layer, Bar_extends({
          className: "recharts-bar-rectangle"
        }, adaptEventsOfChild(_this2.props, entry, i), {
          key: "rectangle-".concat(i) // eslint-disable-line react/no-array-index-key
        }), Bar.renderRectangle(shape, props));
      });
    }
  }, {
    key: "renderRectanglesWithAnimation",
    value: function renderRectanglesWithAnimation() {
      var _this3 = this;
      var _this$props = this.props,
        data = _this$props.data,
        layout = _this$props.layout,
        isAnimationActive = _this$props.isAnimationActive,
        animationBegin = _this$props.animationBegin,
        animationDuration = _this$props.animationDuration,
        animationEasing = _this$props.animationEasing,
        animationId = _this$props.animationId;
      var prevData = this.state.prevData;
      return /*#__PURE__*/react.createElement(es6, {
        begin: animationBegin,
        duration: animationDuration,
        isActive: isAnimationActive,
        easing: animationEasing,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "bar-".concat(animationId),
        onAnimationEnd: this.handleAnimationEnd,
        onAnimationStart: this.handleAnimationStart
      }, function (_ref) {
        var t = _ref.t;
        var stepData = data.map(function (entry, index) {
          var prev = prevData && prevData[index];
          if (prev) {
            var interpolatorX = interpolateNumber(prev.x, entry.x);
            var interpolatorY = interpolateNumber(prev.y, entry.y);
            var interpolatorWidth = interpolateNumber(prev.width, entry.width);
            var interpolatorHeight = interpolateNumber(prev.height, entry.height);
            return Bar_objectSpread(Bar_objectSpread({}, entry), {}, {
              x: interpolatorX(t),
              y: interpolatorY(t),
              width: interpolatorWidth(t),
              height: interpolatorHeight(t)
            });
          }
          if (layout === 'horizontal') {
            var _interpolatorHeight = interpolateNumber(0, entry.height);
            var h = _interpolatorHeight(t);
            return Bar_objectSpread(Bar_objectSpread({}, entry), {}, {
              y: entry.y + entry.height - h,
              height: h
            });
          }
          var interpolator = interpolateNumber(0, entry.width);
          var w = interpolator(t);
          return Bar_objectSpread(Bar_objectSpread({}, entry), {}, {
            width: w
          });
        });
        return /*#__PURE__*/react.createElement(Layer, null, _this3.renderRectanglesStatically(stepData));
      });
    }
  }, {
    key: "renderRectangles",
    value: function renderRectangles() {
      var _this$props2 = this.props,
        data = _this$props2.data,
        isAnimationActive = _this$props2.isAnimationActive;
      var prevData = this.state.prevData;
      if (isAnimationActive && data && data.length && (!prevData || !isEqual_default()(prevData, data))) {
        return this.renderRectanglesWithAnimation();
      }
      return this.renderRectanglesStatically(data);
    }
  }, {
    key: "renderBackground",
    value: function renderBackground() {
      var _this4 = this;
      var data = this.props.data;
      var backgroundProps = filterProps(this.props.background);
      return data.map(function (entry, i) {
        var value = entry.value,
          background = entry.background,
          rest = Bar_objectWithoutProperties(entry, Bar_excluded);
        if (!background) {
          return null;
        }
        var props = Bar_objectSpread(Bar_objectSpread(Bar_objectSpread(Bar_objectSpread(Bar_objectSpread({}, rest), {}, {
          fill: '#eee'
        }, background), backgroundProps), adaptEventsOfChild(_this4.props, entry, i)), {}, {
          index: i,
          key: "background-bar-".concat(i),
          className: 'recharts-bar-background-rectangle'
        });
        return Bar.renderRectangle(_this4.props.background, props);
      });
    }
  }, {
    key: "renderErrorBar",
    value: function renderErrorBar(needClip, clipPathId) {
      if (this.props.isAnimationActive && !this.state.isAnimationFinished) {
        return null;
      }
      var _this$props3 = this.props,
        data = _this$props3.data,
        xAxis = _this$props3.xAxis,
        yAxis = _this$props3.yAxis,
        layout = _this$props3.layout,
        children = _this$props3.children;
      var errorBarItems = findAllByType(children, ErrorBar);
      if (!errorBarItems) {
        return null;
      }
      var offset = layout === 'vertical' ? data[0].height / 2 : data[0].width / 2;
      var dataPointFormatter = function dataPointFormatter(dataPoint, dataKey) {
        /**
         * if the value coming from `getComposedData` is an array then this is a stacked bar chart.
         * arr[1] represents end value of the bar since the data is in the form of [startValue, endValue].
         * */
        var value = Array.isArray(dataPoint.value) ? dataPoint.value[1] : dataPoint.value;
        return {
          x: dataPoint.x,
          y: dataPoint.y,
          value: value,
          errorVal: getValueByDataKey(dataPoint, dataKey)
        };
      };
      var errorBarProps = {
        clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
      };
      return /*#__PURE__*/react.createElement(Layer, errorBarProps, errorBarItems.map(function (item, i) {
        return /*#__PURE__*/react.cloneElement(item, {
          key: "error-bar-".concat(i),
          // eslint-disable-line react/no-array-index-key
          data: data,
          xAxis: xAxis,
          yAxis: yAxis,
          layout: layout,
          offset: offset,
          dataPointFormatter: dataPointFormatter
        });
      }));
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props4 = this.props,
        hide = _this$props4.hide,
        data = _this$props4.data,
        className = _this$props4.className,
        xAxis = _this$props4.xAxis,
        yAxis = _this$props4.yAxis,
        left = _this$props4.left,
        top = _this$props4.top,
        width = _this$props4.width,
        height = _this$props4.height,
        isAnimationActive = _this$props4.isAnimationActive,
        background = _this$props4.background,
        id = _this$props4.id;
      if (hide || !data || !data.length) {
        return null;
      }
      var isAnimationFinished = this.state.isAnimationFinished;
      var layerClass = classnames_default()('recharts-bar', className);
      var needClipX = xAxis && xAxis.allowDataOverflow;
      var needClipY = yAxis && yAxis.allowDataOverflow;
      var needClip = needClipX || needClipY;
      var clipPathId = isNil_default()(id) ? this.id : id;
      return /*#__PURE__*/react.createElement(Layer, {
        className: layerClass
      }, needClipX || needClipY ? /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("clipPath", {
        id: "clipPath-".concat(clipPathId)
      }, /*#__PURE__*/react.createElement("rect", {
        x: needClipX ? left : left - width / 2,
        y: needClipY ? top : top - height / 2,
        width: needClipX ? width : width * 2,
        height: needClipY ? height : height * 2
      }))) : null, /*#__PURE__*/react.createElement(Layer, {
        className: "recharts-bar-rectangles",
        clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
      }, background ? this.renderBackground() : null, this.renderRectangles()), this.renderErrorBar(needClip, clipPathId), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, data));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      if (nextProps.animationId !== prevState.prevAnimationId) {
        return {
          prevAnimationId: nextProps.animationId,
          curData: nextProps.data,
          prevData: prevState.curData
        };
      }
      if (nextProps.data !== prevState.curData) {
        return {
          curData: nextProps.data
        };
      }
      return null;
    }
  }, {
    key: "renderRectangle",
    value: function renderRectangle(option, props) {
      var rectangle;
      if ( /*#__PURE__*/react.isValidElement(option)) {
        rectangle = /*#__PURE__*/react.cloneElement(option, props);
      } else if (isFunction_default()(option)) {
        rectangle = option(props);
      } else {
        rectangle = /*#__PURE__*/react.createElement(Rectangle, props);
      }
      return rectangle;
    }
  }]);
  return Bar;
}(react.PureComponent);
Bar_defineProperty(Bar, "displayName", 'Bar');
Bar_defineProperty(Bar, "defaultProps", {
  xAxisId: 0,
  yAxisId: 0,
  legendType: 'rect',
  minPointSize: 0,
  hide: false,
  data: [],
  layout: 'vertical',
  isAnimationActive: !Global.isSsr,
  animationBegin: 0,
  animationDuration: 400,
  animationEasing: 'ease'
});
/**
 * Compose the data of each group
 * @param {Object} props Props for the component
 * @param {Object} item        An instance of Bar
 * @param {Array} barPosition  The offset and size of each bar
 * @param {Object} xAxis       The configuration of x-axis
 * @param {Object} yAxis       The configuration of y-axis
 * @param {Array} stackedData  The stacked data of a bar item
 * @return{Array} Composed data
 */
Bar_defineProperty(Bar, "getComposedData", function (_ref2) {
  var props = _ref2.props,
    item = _ref2.item,
    barPosition = _ref2.barPosition,
    bandSize = _ref2.bandSize,
    xAxis = _ref2.xAxis,
    yAxis = _ref2.yAxis,
    xAxisTicks = _ref2.xAxisTicks,
    yAxisTicks = _ref2.yAxisTicks,
    stackedData = _ref2.stackedData,
    dataStartIndex = _ref2.dataStartIndex,
    displayedData = _ref2.displayedData,
    offset = _ref2.offset;
  var pos = findPositionOfBar(barPosition, item);
  if (!pos) {
    return null;
  }
  var layout = props.layout;
  var _item$props = item.props,
    dataKey = _item$props.dataKey,
    children = _item$props.children,
    minPointSize = _item$props.minPointSize;
  var numericAxis = layout === 'horizontal' ? yAxis : xAxis;
  var stackedDomain = stackedData ? numericAxis.scale.domain() : null;
  var baseValue = getBaseValueOfBar({
    numericAxis: numericAxis
  });
  var cells = findAllByType(children, Cell);
  var rects = displayedData.map(function (entry, index) {
    var value, x, y, width, height, background;
    if (stackedData) {
      value = truncateByDomain(stackedData[dataStartIndex + index], stackedDomain);
    } else {
      value = getValueByDataKey(entry, dataKey);
      if (!isArray_default()(value)) {
        value = [baseValue, value];
      }
    }
    if (layout === 'horizontal') {
      var _ref4;
      var _ref3 = [yAxis.scale(value[0]), yAxis.scale(value[1])],
        baseValueScale = _ref3[0],
        currentValueScale = _ref3[1];
      x = getCateCoordinateOfBar({
        axis: xAxis,
        ticks: xAxisTicks,
        bandSize: bandSize,
        offset: pos.offset,
        entry: entry,
        index: index
      });
      y = (_ref4 = currentValueScale !== null && currentValueScale !== void 0 ? currentValueScale : baseValueScale) !== null && _ref4 !== void 0 ? _ref4 : undefined;
      width = pos.size;
      var computedHeight = baseValueScale - currentValueScale;
      height = Number.isNaN(computedHeight) ? 0 : computedHeight;
      background = {
        x: x,
        y: yAxis.y,
        width: width,
        height: yAxis.height
      };
      if (Math.abs(minPointSize) > 0 && Math.abs(height) < Math.abs(minPointSize)) {
        var delta = mathSign(height || minPointSize) * (Math.abs(minPointSize) - Math.abs(height));
        y -= delta;
        height += delta;
      }
    } else {
      var _ref5 = [xAxis.scale(value[0]), xAxis.scale(value[1])],
        _baseValueScale = _ref5[0],
        _currentValueScale = _ref5[1];
      x = _baseValueScale;
      y = getCateCoordinateOfBar({
        axis: yAxis,
        ticks: yAxisTicks,
        bandSize: bandSize,
        offset: pos.offset,
        entry: entry,
        index: index
      });
      width = _currentValueScale - _baseValueScale;
      height = pos.size;
      background = {
        x: xAxis.x,
        y: y,
        width: xAxis.width,
        height: height
      };
      if (Math.abs(minPointSize) > 0 && Math.abs(width) < Math.abs(minPointSize)) {
        var _delta = mathSign(width || minPointSize) * (Math.abs(minPointSize) - Math.abs(width));
        width += _delta;
      }
    }
    return Bar_objectSpread(Bar_objectSpread(Bar_objectSpread({}, entry), {}, {
      x: x,
      y: y,
      width: width,
      height: height,
      value: stackedData ? value : value[1],
      payload: entry,
      background: background
    }, cells && cells[index] && cells[index].props), {}, {
      tooltipPayload: [getTooltipItem(item, entry)],
      tooltipPosition: {
        x: x + width / 2,
        y: y + height / 2
      }
    });
  });
  return Bar_objectSpread({
    data: rects,
    layout: layout
  }, offset);
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/CartesianUtils.js


function CartesianUtils_typeof(obj) { "@babel/helpers - typeof"; return CartesianUtils_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; }, CartesianUtils_typeof(obj); }
function CartesianUtils_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function CartesianUtils_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, CartesianUtils_toPropertyKey(descriptor.key), descriptor); } }
function CartesianUtils_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartesianUtils_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartesianUtils_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function CartesianUtils_ownKeys(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 CartesianUtils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? CartesianUtils_ownKeys(Object(source), !0).forEach(function (key) { CartesianUtils_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : CartesianUtils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function CartesianUtils_defineProperty(obj, key, value) { key = CartesianUtils_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function CartesianUtils_toPropertyKey(arg) { var key = CartesianUtils_toPrimitive(arg, "string"); return CartesianUtils_typeof(key) === "symbol" ? key : String(key); }
function CartesianUtils_toPrimitive(input, hint) { if (CartesianUtils_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (CartesianUtils_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }





/**
 * Calculate the scale function, position, width, height of axes
 * @param  {Object} props     Latest props
 * @param  {Object} axisMap   The configuration of axes
 * @param  {Object} offset    The offset of main part in the svg element
 * @param  {String} axisType  The type of axes, x-axis or y-axis
 * @param  {String} chartName The name of chart
 * @return {Object} Configuration
 */
var CartesianUtils_formatAxisMap = function formatAxisMap(props, axisMap, offset, axisType, chartName) {
  var width = props.width,
    height = props.height,
    layout = props.layout,
    children = props.children;
  var ids = Object.keys(axisMap);
  var steps = {
    left: offset.left,
    leftMirror: offset.left,
    right: width - offset.right,
    rightMirror: width - offset.right,
    top: offset.top,
    topMirror: offset.top,
    bottom: height - offset.bottom,
    bottomMirror: height - offset.bottom
  };
  var hasBar = !!findChildByType(children, Bar);
  return ids.reduce(function (result, id) {
    var axis = axisMap[id];
    var orientation = axis.orientation,
      domain = axis.domain,
      _axis$padding = axis.padding,
      padding = _axis$padding === void 0 ? {} : _axis$padding,
      mirror = axis.mirror,
      reversed = axis.reversed;
    var offsetKey = "".concat(orientation).concat(mirror ? 'Mirror' : '');
    var calculatedPadding, range, x, y, needSpace;
    if (axis.type === 'number' && (axis.padding === 'gap' || axis.padding === 'no-gap')) {
      var diff = domain[1] - domain[0];
      var smallestDistanceBetweenValues = Infinity;
      var sortedValues = axis.categoricalDomain.sort();
      sortedValues.forEach(function (value, index) {
        if (index > 0) {
          smallestDistanceBetweenValues = Math.min((value || 0) - (sortedValues[index - 1] || 0), smallestDistanceBetweenValues);
        }
      });
      var smallestDistanceInPercent = smallestDistanceBetweenValues / diff;
      var rangeWidth = axis.layout === 'vertical' ? offset.height : offset.width;
      if (axis.padding === 'gap') {
        calculatedPadding = smallestDistanceInPercent * rangeWidth / 2;
      }
      if (axis.padding === 'no-gap') {
        var gap = getPercentValue(props.barCategoryGap, smallestDistanceInPercent * rangeWidth);
        var halfBand = smallestDistanceInPercent * rangeWidth / 2;
        calculatedPadding = halfBand - gap - (halfBand - gap) / rangeWidth * gap;
      }
    }
    if (axisType === 'xAxis') {
      range = [offset.left + (padding.left || 0) + (calculatedPadding || 0), offset.left + offset.width - (padding.right || 0) - (calculatedPadding || 0)];
    } else if (axisType === 'yAxis') {
      range = layout === 'horizontal' ? [offset.top + offset.height - (padding.bottom || 0), offset.top + (padding.top || 0)] : [offset.top + (padding.top || 0) + (calculatedPadding || 0), offset.top + offset.height - (padding.bottom || 0) - (calculatedPadding || 0)];
    } else {
      range = axis.range;
    }
    if (reversed) {
      range = [range[1], range[0]];
    }
    var _parseScale = parseScale(axis, chartName, hasBar),
      scale = _parseScale.scale,
      realScaleType = _parseScale.realScaleType;
    scale.domain(domain).range(range);
    checkDomainOfScale(scale);
    var ticks = getTicksOfScale(scale, CartesianUtils_objectSpread(CartesianUtils_objectSpread({}, axis), {}, {
      realScaleType: realScaleType
    }));
    if (axisType === 'xAxis') {
      needSpace = orientation === 'top' && !mirror || orientation === 'bottom' && mirror;
      x = offset.left;
      y = steps[offsetKey] - needSpace * axis.height;
    } else if (axisType === 'yAxis') {
      needSpace = orientation === 'left' && !mirror || orientation === 'right' && mirror;
      x = steps[offsetKey] - needSpace * axis.width;
      y = offset.top;
    }
    var finalAxis = CartesianUtils_objectSpread(CartesianUtils_objectSpread(CartesianUtils_objectSpread({}, axis), ticks), {}, {
      realScaleType: realScaleType,
      x: x,
      y: y,
      scale: scale,
      width: axisType === 'xAxis' ? offset.width : axis.width,
      height: axisType === 'yAxis' ? offset.height : axis.height
    });
    finalAxis.bandSize = getBandSizeOfAxis(finalAxis, ticks);
    if (!axis.hide && axisType === 'xAxis') {
      steps[offsetKey] += (needSpace ? -1 : 1) * finalAxis.height;
    } else if (!axis.hide) {
      steps[offsetKey] += (needSpace ? -1 : 1) * finalAxis.width;
    }
    return CartesianUtils_objectSpread(CartesianUtils_objectSpread({}, result), {}, CartesianUtils_defineProperty({}, id, finalAxis));
  }, {});
};
var rectWithPoints = function rectWithPoints(_ref, _ref2) {
  var x1 = _ref.x,
    y1 = _ref.y;
  var x2 = _ref2.x,
    y2 = _ref2.y;
  return {
    x: Math.min(x1, x2),
    y: Math.min(y1, y2),
    width: Math.abs(x2 - x1),
    height: Math.abs(y2 - y1)
  };
};

/**
 * Compute the x, y, width, and height of a box from two reference points.
 * @param  {Object} coords     x1, x2, y1, and y2
 * @return {Object} object
 */
var rectWithCoords = function rectWithCoords(_ref3) {
  var x1 = _ref3.x1,
    y1 = _ref3.y1,
    x2 = _ref3.x2,
    y2 = _ref3.y2;
  return rectWithPoints({
    x: x1,
    y: y1
  }, {
    x: x2,
    y: y2
  });
};
var ScaleHelper = /*#__PURE__*/function () {
  function ScaleHelper(scale) {
    CartesianUtils_classCallCheck(this, ScaleHelper);
    this.scale = scale;
  }
  CartesianUtils_createClass(ScaleHelper, [{
    key: "domain",
    get: function get() {
      return this.scale.domain;
    }
  }, {
    key: "range",
    get: function get() {
      return this.scale.range;
    }
  }, {
    key: "rangeMin",
    get: function get() {
      return this.range()[0];
    }
  }, {
    key: "rangeMax",
    get: function get() {
      return this.range()[1];
    }
  }, {
    key: "bandwidth",
    get: function get() {
      return this.scale.bandwidth;
    }
  }, {
    key: "apply",
    value: function apply(value) {
      var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
        bandAware = _ref4.bandAware,
        position = _ref4.position;
      if (value === undefined) {
        return undefined;
      }
      if (position) {
        switch (position) {
          case 'start':
            {
              return this.scale(value);
            }
          case 'middle':
            {
              var offset = this.bandwidth ? this.bandwidth() / 2 : 0;
              return this.scale(value) + offset;
            }
          case 'end':
            {
              var _offset = this.bandwidth ? this.bandwidth() : 0;
              return this.scale(value) + _offset;
            }
          default:
            {
              return this.scale(value);
            }
        }
      }
      if (bandAware) {
        var _offset2 = this.bandwidth ? this.bandwidth() / 2 : 0;
        return this.scale(value) + _offset2;
      }
      return this.scale(value);
    }
  }, {
    key: "isInRange",
    value: function isInRange(value) {
      var range = this.range();
      var first = range[0];
      var last = range[range.length - 1];
      return first <= last ? value >= first && value <= last : value >= last && value <= first;
    }
  }], [{
    key: "create",
    value: function create(obj) {
      return new ScaleHelper(obj);
    }
  }]);
  return ScaleHelper;
}();
CartesianUtils_defineProperty(ScaleHelper, "EPS", 1e-4);
var createLabeledScales = function createLabeledScales(options) {
  var scales = Object.keys(options).reduce(function (res, key) {
    return CartesianUtils_objectSpread(CartesianUtils_objectSpread({}, res), {}, CartesianUtils_defineProperty({}, key, ScaleHelper.create(options[key])));
  }, {});
  return CartesianUtils_objectSpread(CartesianUtils_objectSpread({}, scales), {}, {
    apply: function apply(coord) {
      var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
        bandAware = _ref5.bandAware,
        position = _ref5.position;
      return mapValues_default()(coord, function (value, label) {
        return scales[label].apply(value, {
          bandAware: bandAware,
          position: position
        });
      });
    },
    isInRange: function isInRange(coord) {
      return every_default()(coord, function (value, label) {
        return scales[label].isInRange(value);
      });
    }
  });
};

/** Normalizes the angle so that 0 <= angle < 180.
 * @param {number} angle Angle in degrees.
 * @return {number} the normalized angle with a value of at least 0 and never greater or equal to 180. */
function normalizeAngle(angle) {
  return (angle % 180 + 180) % 180;
}

/** Calculates the width of the largest horizontal line that fits inside a rectangle that is displayed at an angle.
 * @param {Object} size Width and height of the text in a horizontal position.
 * @param {number} angle Angle in degrees in which the text is displayed.
 * @return {number} The width of the largest horizontal line that fits inside a rectangle that is displayed at an angle.
 */
var getAngledRectangleWidth = function getAngledRectangleWidth(_ref6) {
  var width = _ref6.width,
    height = _ref6.height;
  var angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  // Ensure angle is >= 0 && < 180
  var normalizedAngle = normalizeAngle(angle);
  var angleRadians = normalizedAngle * Math.PI / 180;

  /* Depending on the height and width of the rectangle, we may need to use different formulas to calculate the angled
   * width. This threshold defines when each formula should kick in. */
  var angleThreshold = Math.atan(height / width);
  var angledWidth = angleRadians > angleThreshold && angleRadians < Math.PI - angleThreshold ? height / Math.sin(angleRadians) : width / Math.cos(angleRadians);
  return Math.abs(angledWidth);
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/getTicks.js

function getTicks_typeof(obj) { "@babel/helpers - typeof"; return getTicks_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; }, getTicks_typeof(obj); }
function getTicks_ownKeys(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 getTicks_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? getTicks_ownKeys(Object(source), !0).forEach(function (key) { getTicks_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : getTicks_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function getTicks_defineProperty(obj, key, value) { key = getTicks_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function getTicks_toPropertyKey(arg) { var key = getTicks_toPrimitive(arg, "string"); return getTicks_typeof(key) === "symbol" ? key : String(key); }
function getTicks_toPrimitive(input, hint) { if (getTicks_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (getTicks_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }






/**
 * Given an array of ticks, find N, the lowest possible number for which every
 * nTH tick in the ticks array isShow == true and return the array of every nTh tick.
 * @param {CartesianTickItem[]} ticks An array of CartesianTickItem with the
 * information whether they can be shown without overlapping with their neighbour isShow.
 * @returns {CartesianTickItem[]} Every nTh tick in an array.
 */
function getEveryNThTick(ticks) {
  var N = 1;
  var previous = getEveryNthWithCondition(ticks, N, function (tickItem) {
    return tickItem.isShow;
  });
  while (N <= ticks.length) {
    if (previous !== undefined) {
      return previous;
    }
    N++;
    previous = getEveryNthWithCondition(ticks, N, function (tickItem) {
      return tickItem.isShow;
    });
  }
  return ticks.slice(0, 1);
}
function getNumberIntervalTicks(ticks, interval) {
  return getEveryNthWithCondition(ticks, interval + 1);
}
function getAngledTickWidth(contentSize, unitSize, angle) {
  var size = {
    width: contentSize.width + unitSize.width,
    height: contentSize.height + unitSize.height
  };
  return getAngledRectangleWidth(size, angle);
}
function getTicksEnd(_ref) {
  var angle = _ref.angle,
    ticks = _ref.ticks,
    tickFormatter = _ref.tickFormatter,
    viewBox = _ref.viewBox,
    orientation = _ref.orientation,
    minTickGap = _ref.minTickGap,
    unit = _ref.unit,
    fontSize = _ref.fontSize,
    letterSpacing = _ref.letterSpacing;
  var x = viewBox.x,
    y = viewBox.y,
    width = viewBox.width,
    height = viewBox.height;
  var sizeKey = orientation === 'top' || orientation === 'bottom' ? 'width' : 'height';
  // we need add the width of 'unit' only when sizeKey === 'width'
  var unitSize = unit && sizeKey === 'width' ? getStringSize(unit, {
    fontSize: fontSize,
    letterSpacing: letterSpacing
  }) : {
    width: 0,
    height: 0
  };
  var result = (ticks || []).slice();
  var len = result.length;
  var sign = len >= 2 ? mathSign(result[1].coordinate - result[0].coordinate) : 1;
  var start, end;
  if (sign === 1) {
    start = sizeKey === 'width' ? x : y;
    end = sizeKey === 'width' ? x + width : y + height;
  } else {
    start = sizeKey === 'width' ? x + width : y + height;
    end = sizeKey === 'width' ? x : y;
  }
  for (var i = len - 1; i >= 0; i--) {
    var entry = result[i];
    var content = isFunction_default()(tickFormatter) ? tickFormatter(entry.value, len - i - 1) : entry.value;
    // Recharts only supports angles when sizeKey === 'width'
    var size = sizeKey === 'width' ? getAngledTickWidth(getStringSize(content, {
      fontSize: fontSize,
      letterSpacing: letterSpacing
    }), unitSize, angle) : getStringSize(content, {
      fontSize: fontSize,
      letterSpacing: letterSpacing
    })[sizeKey];
    if (i === len - 1) {
      var gap = sign * (entry.coordinate + sign * size / 2 - end);
      result[i] = entry = getTicks_objectSpread(getTicks_objectSpread({}, entry), {}, {
        tickCoord: gap > 0 ? entry.coordinate - gap * sign : entry.coordinate
      });
    } else {
      result[i] = entry = getTicks_objectSpread(getTicks_objectSpread({}, entry), {}, {
        tickCoord: entry.coordinate
      });
    }
    var isShow = sign * (entry.tickCoord - sign * size / 2 - start) >= 0 && sign * (entry.tickCoord + sign * size / 2 - end) <= 0;
    if (isShow) {
      end = entry.tickCoord - sign * (size / 2 + minTickGap);
      result[i] = getTicks_objectSpread(getTicks_objectSpread({}, entry), {}, {
        isShow: true
      });
    }
  }
  return result;
}
function getTicksStart(_ref2, preserveEnd) {
  var angle = _ref2.angle,
    ticks = _ref2.ticks,
    tickFormatter = _ref2.tickFormatter,
    viewBox = _ref2.viewBox,
    orientation = _ref2.orientation,
    minTickGap = _ref2.minTickGap,
    unit = _ref2.unit,
    fontSize = _ref2.fontSize,
    letterSpacing = _ref2.letterSpacing;
  var x = viewBox.x,
    y = viewBox.y,
    width = viewBox.width,
    height = viewBox.height;
  var sizeKey = orientation === 'top' || orientation === 'bottom' ? 'width' : 'height';
  var result = (ticks || []).slice();
  // we need add the width of 'unit' only when sizeKey === 'width'
  var unitSize = unit && sizeKey === 'width' ? getStringSize(unit, {
    fontSize: fontSize,
    letterSpacing: letterSpacing
  }) : {
    width: 0,
    height: 0
  };
  var len = result.length;
  var sign = len >= 2 ? mathSign(result[1].coordinate - result[0].coordinate) : 1;
  var start, end;
  if (sign === 1) {
    start = sizeKey === 'width' ? x : y;
    end = sizeKey === 'width' ? x + width : y + height;
  } else {
    start = sizeKey === 'width' ? x + width : y + height;
    end = sizeKey === 'width' ? x : y;
  }
  if (preserveEnd) {
    // Try to guarantee the tail to be displayed
    var tail = ticks[len - 1];
    var tailContent = isFunction_default()(tickFormatter) ? tickFormatter(tail.value, len - 1) : tail.value;
    // Recharts only supports angles when sizeKey === 'width'
    var tailSize = sizeKey === 'width' ? getAngledTickWidth(getStringSize(tailContent, {
      fontSize: fontSize,
      letterSpacing: letterSpacing
    }), unitSize, angle) : getStringSize(tailContent, {
      fontSize: fontSize,
      letterSpacing: letterSpacing
    })[sizeKey];
    var tailGap = sign * (tail.coordinate + sign * tailSize / 2 - end);
    result[len - 1] = tail = getTicks_objectSpread(getTicks_objectSpread({}, tail), {}, {
      tickCoord: tailGap > 0 ? tail.coordinate - tailGap * sign : tail.coordinate
    });
    var isTailShow = sign * (tail.tickCoord - sign * tailSize / 2 - start) >= 0 && sign * (tail.tickCoord + sign * tailSize / 2 - end) <= 0;
    if (isTailShow) {
      end = tail.tickCoord - sign * (tailSize / 2 + minTickGap);
      result[len - 1] = getTicks_objectSpread(getTicks_objectSpread({}, tail), {}, {
        isShow: true
      });
    }
  }
  var count = preserveEnd ? len - 1 : len;
  for (var i = 0; i < count; i++) {
    var entry = result[i];
    var content = isFunction_default()(tickFormatter) ? tickFormatter(entry.value, i) : entry.value;
    var size = sizeKey === 'width' ? getAngledTickWidth(getStringSize(content, {
      fontSize: fontSize,
      letterSpacing: letterSpacing
    }), unitSize, angle) : getStringSize(content, {
      fontSize: fontSize,
      letterSpacing: letterSpacing
    })[sizeKey];
    if (i === 0) {
      var gap = sign * (entry.coordinate - sign * size / 2 - start);
      result[i] = entry = getTicks_objectSpread(getTicks_objectSpread({}, entry), {}, {
        tickCoord: gap < 0 ? entry.coordinate - gap * sign : entry.coordinate
      });
    } else {
      result[i] = entry = getTicks_objectSpread(getTicks_objectSpread({}, entry), {}, {
        tickCoord: entry.coordinate
      });
    }
    var isShow = sign * (entry.tickCoord - sign * size / 2 - start) >= 0 && sign * (entry.tickCoord + sign * size / 2 - end) <= 0;
    if (isShow) {
      start = entry.tickCoord + sign * (size / 2 + minTickGap);
      result[i] = getTicks_objectSpread(getTicks_objectSpread({}, entry), {}, {
        isShow: true
      });
    }
  }
  return result;
}
function getTicks(props, fontSize, letterSpacing) {
  var tick = props.tick,
    ticks = props.ticks,
    viewBox = props.viewBox,
    minTickGap = props.minTickGap,
    orientation = props.orientation,
    interval = props.interval,
    tickFormatter = props.tickFormatter,
    unit = props.unit,
    angle = props.angle;
  if (!ticks || !ticks.length || !tick) {
    return [];
  }
  if (isNumber(interval) || Global.isSsr) {
    return getNumberIntervalTicks(ticks, typeof interval === 'number' && isNumber(interval) ? interval : 0);
  }
  var candidates = [];
  if (interval === 'equidistantPreserveStart') {
    candidates = getTicksStart({
      angle: angle,
      ticks: ticks,
      tickFormatter: tickFormatter,
      viewBox: viewBox,
      orientation: orientation,
      minTickGap: minTickGap,
      unit: unit,
      fontSize: fontSize,
      letterSpacing: letterSpacing
    });
    return getEveryNThTick(candidates);
  }
  if (interval === 'preserveStart' || interval === 'preserveStartEnd') {
    candidates = getTicksStart({
      angle: angle,
      ticks: ticks,
      tickFormatter: tickFormatter,
      viewBox: viewBox,
      orientation: orientation,
      minTickGap: minTickGap,
      unit: unit,
      fontSize: fontSize,
      letterSpacing: letterSpacing
    }, interval === 'preserveStartEnd');
  } else {
    candidates = getTicksEnd({
      angle: angle,
      ticks: ticks,
      tickFormatter: tickFormatter,
      viewBox: viewBox,
      orientation: orientation,
      minTickGap: minTickGap,
      unit: unit,
      fontSize: fontSize,
      letterSpacing: letterSpacing
    });
  }
  return candidates.filter(function (entry) {
    return entry.isShow;
  });
}
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/component/DefaultTooltipContent.js



/**
 * @fileOverview Default Tooltip Content
 */
function DefaultTooltipContent_typeof(obj) { "@babel/helpers - typeof"; return DefaultTooltipContent_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; }, DefaultTooltipContent_typeof(obj); }
function DefaultTooltipContent_slicedToArray(arr, i) { return DefaultTooltipContent_arrayWithHoles(arr) || DefaultTooltipContent_iterableToArrayLimit(arr, i) || DefaultTooltipContent_unsupportedIterableToArray(arr, i) || DefaultTooltipContent_nonIterableRest(); }
function DefaultTooltipContent_nonIterableRest() { 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 DefaultTooltipContent_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return DefaultTooltipContent_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 DefaultTooltipContent_arrayLikeToArray(o, minLen); }
function DefaultTooltipContent_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 DefaultTooltipContent_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function DefaultTooltipContent_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function DefaultTooltipContent_ownKeys(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 DefaultTooltipContent_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? DefaultTooltipContent_ownKeys(Object(source), !0).forEach(function (key) { DefaultTooltipContent_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : DefaultTooltipContent_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function DefaultTooltipContent_defineProperty(obj, key, value) { key = DefaultTooltipContent_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function DefaultTooltipContent_toPropertyKey(arg) { var key = DefaultTooltipContent_toPrimitive(arg, "string"); return DefaultTooltipContent_typeof(key) === "symbol" ? key : String(key); }
function DefaultTooltipContent_toPrimitive(input, hint) { if (DefaultTooltipContent_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (DefaultTooltipContent_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }



function defaultFormatter(value) {
  return isArray_default()(value) && isNumOrStr(value[0]) && isNumOrStr(value[1]) ? value.join(' ~ ') : value;
}
var DefaultTooltipContent = function DefaultTooltipContent(props) {
  var _props$separator = props.separator,
    separator = _props$separator === void 0 ? ' : ' : _props$separator,
    _props$contentStyle = props.contentStyle,
    contentStyle = _props$contentStyle === void 0 ? {} : _props$contentStyle,
    _props$itemStyle = props.itemStyle,
    itemStyle = _props$itemStyle === void 0 ? {} : _props$itemStyle,
    _props$labelStyle = props.labelStyle,
    labelStyle = _props$labelStyle === void 0 ? {} : _props$labelStyle,
    payload = props.payload,
    formatter = props.formatter,
    itemSorter = props.itemSorter,
    wrapperClassName = props.wrapperClassName,
    labelClassName = props.labelClassName,
    label = props.label,
    labelFormatter = props.labelFormatter;
  var renderContent = function renderContent() {
    if (payload && payload.length) {
      var listStyle = {
        padding: 0,
        margin: 0
      };
      var items = (itemSorter ? sortBy_default()(payload, itemSorter) : payload).map(function (entry, i) {
        if (entry.type === 'none') {
          return null;
        }
        var finalItemStyle = DefaultTooltipContent_objectSpread({
          display: 'block',
          paddingTop: 4,
          paddingBottom: 4,
          color: entry.color || '#000'
        }, itemStyle);
        var finalFormatter = entry.formatter || formatter || defaultFormatter;
        var value = entry.value,
          name = entry.name;
        var finalValue = value;
        var finalName = name;
        if (finalFormatter && finalValue != null && finalName != null) {
          var formatted = finalFormatter(value, name, entry, i, payload);
          if (Array.isArray(formatted)) {
            var _formatted = DefaultTooltipContent_slicedToArray(formatted, 2);
            finalValue = _formatted[0];
            finalName = _formatted[1];
          } else {
            finalValue = formatted;
          }
        }
        return (
          /*#__PURE__*/
          // eslint-disable-next-line react/no-array-index-key
          react.createElement("li", {
            className: "recharts-tooltip-item",
            key: "tooltip-item-".concat(i),
            style: finalItemStyle
          }, isNumOrStr(finalName) ? /*#__PURE__*/react.createElement("span", {
            className: "recharts-tooltip-item-name"
          }, finalName) : null, isNumOrStr(finalName) ? /*#__PURE__*/react.createElement("span", {
            className: "recharts-tooltip-item-separator"
          }, separator) : null, /*#__PURE__*/react.createElement("span", {
            className: "recharts-tooltip-item-value"
          }, finalValue), /*#__PURE__*/react.createElement("span", {
            className: "recharts-tooltip-item-unit"
          }, entry.unit || ''))
        );
      });
      return /*#__PURE__*/react.createElement("ul", {
        className: "recharts-tooltip-item-list",
        style: listStyle
      }, items);
    }
    return null;
  };
  var finalStyle = DefaultTooltipContent_objectSpread({
    margin: 0,
    padding: 10,
    backgroundColor: '#fff',
    border: '1px solid #ccc',
    whiteSpace: 'nowrap'
  }, contentStyle);
  var finalLabelStyle = DefaultTooltipContent_objectSpread({
    margin: 0
  }, labelStyle);
  var hasLabel = !isNil_default()(label);
  var finalLabel = hasLabel ? label : '';
  var wrapperCN = classnames_default()('recharts-default-tooltip', wrapperClassName);
  var labelCN = classnames_default()('recharts-tooltip-label', labelClassName);
  if (hasLabel && labelFormatter && payload !== undefined && payload !== null) {
    finalLabel = labelFormatter(label, payload);
  }
  return /*#__PURE__*/react.createElement("div", {
    className: wrapperCN,
    style: finalStyle
  }, /*#__PURE__*/react.createElement("p", {
    className: labelCN,
    style: finalLabelStyle
  }, /*#__PURE__*/react.isValidElement(finalLabel) ? finalLabel : "".concat(finalLabel)), renderContent());
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/component/Tooltip.js



function Tooltip_typeof(obj) { "@babel/helpers - typeof"; return Tooltip_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; }, Tooltip_typeof(obj); }
function Tooltip_ownKeys(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 Tooltip_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Tooltip_ownKeys(Object(source), !0).forEach(function (key) { Tooltip_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Tooltip_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Tooltip_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Tooltip_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, Tooltip_toPropertyKey(descriptor.key), descriptor); } }
function Tooltip_createClass(Constructor, protoProps, staticProps) { if (protoProps) Tooltip_defineProperties(Constructor.prototype, protoProps); if (staticProps) Tooltip_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function Tooltip_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Tooltip_setPrototypeOf(subClass, superClass); }
function Tooltip_setPrototypeOf(o, p) { Tooltip_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Tooltip_setPrototypeOf(o, p); }
function Tooltip_createSuper(Derived) { var hasNativeReflectConstruct = Tooltip_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Tooltip_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Tooltip_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Tooltip_possibleConstructorReturn(this, result); }; }
function Tooltip_possibleConstructorReturn(self, call) { if (call && (Tooltip_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Tooltip_assertThisInitialized(self); }
function Tooltip_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Tooltip_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function Tooltip_getPrototypeOf(o) { Tooltip_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Tooltip_getPrototypeOf(o); }
function Tooltip_defineProperty(obj, key, value) { key = Tooltip_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Tooltip_toPropertyKey(arg) { var key = Tooltip_toPrimitive(arg, "string"); return Tooltip_typeof(key) === "symbol" ? key : String(key); }
function Tooltip_toPrimitive(input, hint) { if (Tooltip_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Tooltip_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Tooltip
 */






var CLS_PREFIX = 'recharts-tooltip-wrapper';
var Tooltip_EPS = 1;
function Tooltip_defaultUniqBy(entry) {
  return entry.dataKey;
}
function Tooltip_getUniqPayload(option, payload) {
  if (option === true) {
    return uniqBy_default()(payload, Tooltip_defaultUniqBy);
  }
  if (isFunction_default()(option)) {
    return uniqBy_default()(payload, option);
  }
  return payload;
}
function Tooltip_renderContent(content, props) {
  if ( /*#__PURE__*/react.isValidElement(content)) {
    return /*#__PURE__*/react.cloneElement(content, props);
  }
  if (isFunction_default()(content)) {
    return /*#__PURE__*/react.createElement(content, props);
  }
  return /*#__PURE__*/react.createElement(DefaultTooltipContent, props);
}
var component_Tooltip_Tooltip = /*#__PURE__*/function (_PureComponent) {
  Tooltip_inherits(Tooltip, _PureComponent);
  var _super = Tooltip_createSuper(Tooltip);
  function Tooltip() {
    var _this;
    Tooltip_classCallCheck(this, Tooltip);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    Tooltip_defineProperty(Tooltip_assertThisInitialized(_this), "state", {
      boxWidth: -1,
      boxHeight: -1,
      dismissed: false,
      dismissedAtCoordinate: {
        x: 0,
        y: 0
      }
    });
    Tooltip_defineProperty(Tooltip_assertThisInitialized(_this), "handleKeyDown", function (event) {
      if (event.key === 'Escape') {
        _this.setState({
          dismissed: true,
          dismissedAtCoordinate: Tooltip_objectSpread(Tooltip_objectSpread({}, _this.state.dismissedAtCoordinate), {}, {
            x: _this.props.coordinate.x,
            y: _this.props.coordinate.y
          })
        });
      }
    });
    Tooltip_defineProperty(Tooltip_assertThisInitialized(_this), "getTranslate", function (_ref) {
      var key = _ref.key,
        tooltipDimension = _ref.tooltipDimension,
        viewBoxDimension = _ref.viewBoxDimension;
      var _this$props = _this.props,
        allowEscapeViewBox = _this$props.allowEscapeViewBox,
        reverseDirection = _this$props.reverseDirection,
        coordinate = _this$props.coordinate,
        offset = _this$props.offset,
        position = _this$props.position,
        viewBox = _this$props.viewBox;
      if (position && isNumber(position[key])) {
        return position[key];
      }
      var negative = coordinate[key] - tooltipDimension - offset;
      var positive = coordinate[key] + offset;
      if (allowEscapeViewBox[key]) {
        return reverseDirection[key] ? negative : positive;
      }
      if (reverseDirection[key]) {
        var _tooltipBoundary = negative;
        var _viewBoxBoundary = viewBox[key];
        if (_tooltipBoundary < _viewBoxBoundary) {
          return Math.max(positive, viewBox[key]);
        }
        return Math.max(negative, viewBox[key]);
      }
      var tooltipBoundary = positive + tooltipDimension;
      var viewBoxBoundary = viewBox[key] + viewBoxDimension;
      if (tooltipBoundary > viewBoxBoundary) {
        return Math.max(negative, viewBox[key]);
      }
      return Math.max(positive, viewBox[key]);
    });
    return _this;
  }
  Tooltip_createClass(Tooltip, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.updateBBox();
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      document.removeEventListener('keydown', this.handleKeyDown);
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate() {
      this.updateBBox();
    }
  }, {
    key: "updateBBox",
    value: function updateBBox() {
      var _this$state = this.state,
        boxWidth = _this$state.boxWidth,
        boxHeight = _this$state.boxHeight,
        dismissed = _this$state.dismissed;
      if (dismissed) {
        document.removeEventListener('keydown', this.handleKeyDown);
        if (this.props.coordinate.x !== this.state.dismissedAtCoordinate.x || this.props.coordinate.y !== this.state.dismissedAtCoordinate.y) {
          this.setState({
            dismissed: false
          });
        }
      } else {
        document.addEventListener('keydown', this.handleKeyDown);
      }
      if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
        var box = this.wrapperNode.getBoundingClientRect();
        if (Math.abs(box.width - boxWidth) > Tooltip_EPS || Math.abs(box.height - boxHeight) > Tooltip_EPS) {
          this.setState({
            boxWidth: box.width,
            boxHeight: box.height
          });
        }
      } else if (boxWidth !== -1 || boxHeight !== -1) {
        this.setState({
          boxWidth: -1,
          boxHeight: -1
        });
      }
    }
  }, {
    key: "render",
    value: function render() {
      var _classNames,
        _this2 = this;
      var _this$props2 = this.props,
        payload = _this$props2.payload,
        isAnimationActive = _this$props2.isAnimationActive,
        animationDuration = _this$props2.animationDuration,
        animationEasing = _this$props2.animationEasing,
        filterNull = _this$props2.filterNull,
        payloadUniqBy = _this$props2.payloadUniqBy;
      var finalPayload = Tooltip_getUniqPayload(payloadUniqBy, filterNull && payload && payload.length ? payload.filter(function (entry) {
        return !isNil_default()(entry.value);
      }) : payload);
      var hasPayload = finalPayload && finalPayload.length;
      var _this$props3 = this.props,
        content = _this$props3.content,
        viewBox = _this$props3.viewBox,
        coordinate = _this$props3.coordinate,
        position = _this$props3.position,
        active = _this$props3.active,
        wrapperStyle = _this$props3.wrapperStyle;
      var outerStyle = Tooltip_objectSpread({
        pointerEvents: 'none',
        visibility: !this.state.dismissed && active && hasPayload ? 'visible' : 'hidden',
        position: 'absolute',
        top: 0,
        left: 0
      }, wrapperStyle);
      var translateX, translateY;
      if (position && isNumber(position.x) && isNumber(position.y)) {
        translateX = position.x;
        translateY = position.y;
      } else {
        var _this$state2 = this.state,
          boxWidth = _this$state2.boxWidth,
          boxHeight = _this$state2.boxHeight;
        if (boxWidth > 0 && boxHeight > 0 && coordinate) {
          translateX = this.getTranslate({
            key: 'x',
            tooltipDimension: boxWidth,
            viewBoxDimension: viewBox.width
          });
          translateY = this.getTranslate({
            key: 'y',
            tooltipDimension: boxHeight,
            viewBoxDimension: viewBox.height
          });
        } else {
          outerStyle.visibility = 'hidden';
        }
      }
      outerStyle = Tooltip_objectSpread(Tooltip_objectSpread({}, translateStyle({
        transform: this.props.useTranslate3d ? "translate3d(".concat(translateX, "px, ").concat(translateY, "px, 0)") : "translate(".concat(translateX, "px, ").concat(translateY, "px)")
      })), outerStyle);
      if (isAnimationActive && active) {
        outerStyle = Tooltip_objectSpread(Tooltip_objectSpread({}, translateStyle({
          transition: "transform ".concat(animationDuration, "ms ").concat(animationEasing)
        })), outerStyle);
      }
      var cls = classnames_default()(CLS_PREFIX, (_classNames = {}, Tooltip_defineProperty(_classNames, "".concat(CLS_PREFIX, "-right"), isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX >= coordinate.x), Tooltip_defineProperty(_classNames, "".concat(CLS_PREFIX, "-left"), isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX < coordinate.x), Tooltip_defineProperty(_classNames, "".concat(CLS_PREFIX, "-bottom"), isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY >= coordinate.y), Tooltip_defineProperty(_classNames, "".concat(CLS_PREFIX, "-top"), isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY < coordinate.y), _classNames));
      return (
        /*#__PURE__*/
        // ESLint is disabled to allow listening to the `Escape` key. Refer to
        // https://github.com/recharts/recharts/pull/2925
        // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
        react.createElement("div", {
          tabIndex: -1,
          role: "dialog",
          className: cls,
          style: outerStyle,
          ref: function ref(node) {
            _this2.wrapperNode = node;
          }
        }, Tooltip_renderContent(content, Tooltip_objectSpread(Tooltip_objectSpread({}, this.props), {}, {
          payload: finalPayload
        })))
      );
    }
  }]);
  return Tooltip;
}(react.PureComponent);
Tooltip_defineProperty(component_Tooltip_Tooltip, "displayName", 'Tooltip');
Tooltip_defineProperty(component_Tooltip_Tooltip, "defaultProps", {
  active: false,
  allowEscapeViewBox: {
    x: false,
    y: false
  },
  reverseDirection: {
    x: false,
    y: false
  },
  offset: 10,
  viewBox: {
    x: 0,
    y: 0,
    height: 0,
    width: 0
  },
  coordinate: {
    x: 0,
    y: 0
  },
  cursorStyle: {},
  separator: ' : ',
  wrapperStyle: {},
  contentStyle: {},
  itemStyle: {},
  labelStyle: {},
  cursor: true,
  trigger: 'hover',
  isAnimationActive: !Global.isSsr,
  animationEasing: 'ease',
  animationDuration: 400,
  filterNull: true,
  useTranslate3d: false
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/shape/Cross.js
function Cross_typeof(obj) { "@babel/helpers - typeof"; return Cross_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; }, Cross_typeof(obj); }
var Cross_excluded = ["x", "y", "top", "left", "width", "height", "className"];
function Cross_extends() { Cross_extends = Object.assign ? Object.assign.bind() : 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 Cross_extends.apply(this, arguments); }
function Cross_ownKeys(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 Cross_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Cross_ownKeys(Object(source), !0).forEach(function (key) { Cross_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Cross_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Cross_defineProperty(obj, key, value) { key = Cross_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Cross_toPropertyKey(arg) { var key = Cross_toPrimitive(arg, "string"); return Cross_typeof(key) === "symbol" ? key : String(key); }
function Cross_toPrimitive(input, hint) { if (Cross_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Cross_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function Cross_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Cross_objectWithoutPropertiesLoose(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 Cross_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; }
/**
 * @fileOverview Cross
 */




var Cross_getPath = function getPath(x, y, width, height, top, left) {
  return "M".concat(x, ",").concat(top, "v").concat(height, "M").concat(left, ",").concat(y, "h").concat(width);
};
var Cross = function Cross(_ref) {
  var _ref$x = _ref.x,
    x = _ref$x === void 0 ? 0 : _ref$x,
    _ref$y = _ref.y,
    y = _ref$y === void 0 ? 0 : _ref$y,
    _ref$top = _ref.top,
    top = _ref$top === void 0 ? 0 : _ref$top,
    _ref$left = _ref.left,
    left = _ref$left === void 0 ? 0 : _ref$left,
    _ref$width = _ref.width,
    width = _ref$width === void 0 ? 0 : _ref$width,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? 0 : _ref$height,
    className = _ref.className,
    rest = Cross_objectWithoutProperties(_ref, Cross_excluded);
  var props = Cross_objectSpread({
    x: x,
    y: y,
    top: top,
    left: left,
    width: width,
    height: height
  }, rest);
  if (!isNumber(x) || !isNumber(y) || !isNumber(width) || !isNumber(height) || !isNumber(top) || !isNumber(left)) {
    return null;
  }
  return /*#__PURE__*/react.createElement("path", Cross_extends({}, filterProps(props, true), {
    className: classnames_default()('recharts-cross', className),
    d: Cross_getPath(x, y, width, height, top, left)
  }));
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/shape/Sector.js
function Sector_typeof(obj) { "@babel/helpers - typeof"; return Sector_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; }, Sector_typeof(obj); }
function Sector_extends() { Sector_extends = Object.assign ? Object.assign.bind() : 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 Sector_extends.apply(this, arguments); }
function Sector_ownKeys(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 Sector_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Sector_ownKeys(Object(source), !0).forEach(function (key) { Sector_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Sector_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Sector_defineProperty(obj, key, value) { key = Sector_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Sector_toPropertyKey(arg) { var key = Sector_toPrimitive(arg, "string"); return Sector_typeof(key) === "symbol" ? key : String(key); }
function Sector_toPrimitive(input, hint) { if (Sector_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Sector_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Sector
 */





var Sector_getDeltaAngle = function getDeltaAngle(startAngle, endAngle) {
  var sign = mathSign(endAngle - startAngle);
  var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 359.999);
  return sign * deltaAngle;
};
var getTangentCircle = function getTangentCircle(_ref) {
  var cx = _ref.cx,
    cy = _ref.cy,
    radius = _ref.radius,
    angle = _ref.angle,
    sign = _ref.sign,
    isExternal = _ref.isExternal,
    cornerRadius = _ref.cornerRadius,
    cornerIsExternal = _ref.cornerIsExternal;
  var centerRadius = cornerRadius * (isExternal ? 1 : -1) + radius;
  var theta = Math.asin(cornerRadius / centerRadius) / PolarUtils_RADIAN;
  var centerAngle = cornerIsExternal ? angle : angle + sign * theta;
  var center = polarToCartesian(cx, cy, centerRadius, centerAngle);
  // The coordinate of point which is tangent to the circle
  var circleTangency = polarToCartesian(cx, cy, radius, centerAngle);
  // The coordinate of point which is tangent to the radius line
  var lineTangencyAngle = cornerIsExternal ? angle - sign * theta : angle;
  var lineTangency = polarToCartesian(cx, cy, centerRadius * Math.cos(theta * PolarUtils_RADIAN), lineTangencyAngle);
  return {
    center: center,
    circleTangency: circleTangency,
    lineTangency: lineTangency,
    theta: theta
  };
};
var getSectorPath = function getSectorPath(_ref2) {
  var cx = _ref2.cx,
    cy = _ref2.cy,
    innerRadius = _ref2.innerRadius,
    outerRadius = _ref2.outerRadius,
    startAngle = _ref2.startAngle,
    endAngle = _ref2.endAngle;
  var angle = Sector_getDeltaAngle(startAngle, endAngle);

  // When the angle of sector equals to 360, star point and end point coincide
  var tempEndAngle = startAngle + angle;
  var outerStartPoint = polarToCartesian(cx, cy, outerRadius, startAngle);
  var outerEndPoint = polarToCartesian(cx, cy, outerRadius, tempEndAngle);
  var path = "M ".concat(outerStartPoint.x, ",").concat(outerStartPoint.y, "\n    A ").concat(outerRadius, ",").concat(outerRadius, ",0,\n    ").concat(+(Math.abs(angle) > 180), ",").concat(+(startAngle > tempEndAngle), ",\n    ").concat(outerEndPoint.x, ",").concat(outerEndPoint.y, "\n  ");
  if (innerRadius > 0) {
    var innerStartPoint = polarToCartesian(cx, cy, innerRadius, startAngle);
    var innerEndPoint = polarToCartesian(cx, cy, innerRadius, tempEndAngle);
    path += "L ".concat(innerEndPoint.x, ",").concat(innerEndPoint.y, "\n            A ").concat(innerRadius, ",").concat(innerRadius, ",0,\n            ").concat(+(Math.abs(angle) > 180), ",").concat(+(startAngle <= tempEndAngle), ",\n            ").concat(innerStartPoint.x, ",").concat(innerStartPoint.y, " Z");
  } else {
    path += "L ".concat(cx, ",").concat(cy, " Z");
  }
  return path;
};
var getSectorWithCorner = function getSectorWithCorner(_ref3) {
  var cx = _ref3.cx,
    cy = _ref3.cy,
    innerRadius = _ref3.innerRadius,
    outerRadius = _ref3.outerRadius,
    cornerRadius = _ref3.cornerRadius,
    forceCornerRadius = _ref3.forceCornerRadius,
    cornerIsExternal = _ref3.cornerIsExternal,
    startAngle = _ref3.startAngle,
    endAngle = _ref3.endAngle;
  var sign = mathSign(endAngle - startAngle);
  var _getTangentCircle = getTangentCircle({
      cx: cx,
      cy: cy,
      radius: outerRadius,
      angle: startAngle,
      sign: sign,
      cornerRadius: cornerRadius,
      cornerIsExternal: cornerIsExternal
    }),
    soct = _getTangentCircle.circleTangency,
    solt = _getTangentCircle.lineTangency,
    sot = _getTangentCircle.theta;
  var _getTangentCircle2 = getTangentCircle({
      cx: cx,
      cy: cy,
      radius: outerRadius,
      angle: endAngle,
      sign: -sign,
      cornerRadius: cornerRadius,
      cornerIsExternal: cornerIsExternal
    }),
    eoct = _getTangentCircle2.circleTangency,
    eolt = _getTangentCircle2.lineTangency,
    eot = _getTangentCircle2.theta;
  var outerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sot - eot;
  if (outerArcAngle < 0) {
    if (forceCornerRadius) {
      return "M ".concat(solt.x, ",").concat(solt.y, "\n        a").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,1,").concat(cornerRadius * 2, ",0\n        a").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,1,").concat(-cornerRadius * 2, ",0\n      ");
    }
    return getSectorPath({
      cx: cx,
      cy: cy,
      innerRadius: innerRadius,
      outerRadius: outerRadius,
      startAngle: startAngle,
      endAngle: endAngle
    });
  }
  var path = "M ".concat(solt.x, ",").concat(solt.y, "\n    A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign < 0), ",").concat(soct.x, ",").concat(soct.y, "\n    A").concat(outerRadius, ",").concat(outerRadius, ",0,").concat(+(outerArcAngle > 180), ",").concat(+(sign < 0), ",").concat(eoct.x, ",").concat(eoct.y, "\n    A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign < 0), ",").concat(eolt.x, ",").concat(eolt.y, "\n  ");
  if (innerRadius > 0) {
    var _getTangentCircle3 = getTangentCircle({
        cx: cx,
        cy: cy,
        radius: innerRadius,
        angle: startAngle,
        sign: sign,
        isExternal: true,
        cornerRadius: cornerRadius,
        cornerIsExternal: cornerIsExternal
      }),
      sict = _getTangentCircle3.circleTangency,
      silt = _getTangentCircle3.lineTangency,
      sit = _getTangentCircle3.theta;
    var _getTangentCircle4 = getTangentCircle({
        cx: cx,
        cy: cy,
        radius: innerRadius,
        angle: endAngle,
        sign: -sign,
        isExternal: true,
        cornerRadius: cornerRadius,
        cornerIsExternal: cornerIsExternal
      }),
      eict = _getTangentCircle4.circleTangency,
      eilt = _getTangentCircle4.lineTangency,
      eit = _getTangentCircle4.theta;
    var innerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sit - eit;
    if (innerArcAngle < 0 && cornerRadius === 0) {
      return "".concat(path, "L").concat(cx, ",").concat(cy, "Z");
    }
    path += "L".concat(eilt.x, ",").concat(eilt.y, "\n      A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign < 0), ",").concat(eict.x, ",").concat(eict.y, "\n      A").concat(innerRadius, ",").concat(innerRadius, ",0,").concat(+(innerArcAngle > 180), ",").concat(+(sign > 0), ",").concat(sict.x, ",").concat(sict.y, "\n      A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign < 0), ",").concat(silt.x, ",").concat(silt.y, "Z");
  } else {
    path += "L".concat(cx, ",").concat(cy, "Z");
  }
  return path;
};
var Sector_defaultProps = {
  cx: 0,
  cy: 0,
  innerRadius: 0,
  outerRadius: 0,
  startAngle: 0,
  endAngle: 0,
  cornerRadius: 0,
  forceCornerRadius: false,
  cornerIsExternal: false
};
var Sector = function Sector(sectorProps) {
  var props = Sector_objectSpread(Sector_objectSpread({}, Sector_defaultProps), sectorProps);
  var cx = props.cx,
    cy = props.cy,
    innerRadius = props.innerRadius,
    outerRadius = props.outerRadius,
    cornerRadius = props.cornerRadius,
    forceCornerRadius = props.forceCornerRadius,
    cornerIsExternal = props.cornerIsExternal,
    startAngle = props.startAngle,
    endAngle = props.endAngle,
    className = props.className;
  if (outerRadius < innerRadius || startAngle === endAngle) {
    return null;
  }
  var layerClass = classnames_default()('recharts-sector', className);
  var deltaRadius = outerRadius - innerRadius;
  var cr = getPercentValue(cornerRadius, deltaRadius, 0, true);
  var path;
  if (cr > 0 && Math.abs(startAngle - endAngle) < 360) {
    path = getSectorWithCorner({
      cx: cx,
      cy: cy,
      innerRadius: innerRadius,
      outerRadius: outerRadius,
      cornerRadius: Math.min(cr, deltaRadius / 2),
      forceCornerRadius: forceCornerRadius,
      cornerIsExternal: cornerIsExternal,
      startAngle: startAngle,
      endAngle: endAngle
    });
  } else {
    path = getSectorPath({
      cx: cx,
      cy: cy,
      innerRadius: innerRadius,
      outerRadius: outerRadius,
      startAngle: startAngle,
      endAngle: endAngle
    });
  }
  return /*#__PURE__*/react.createElement("path", Sector_extends({}, filterProps(props, true), {
    className: layerClass,
    d: path,
    role: "img"
  }));
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/CartesianAxis.js


var CartesianAxis_excluded = ["viewBox"],
  CartesianAxis_excluded2 = ["viewBox"],
  CartesianAxis_excluded3 = ["ticks"];
function CartesianAxis_typeof(obj) { "@babel/helpers - typeof"; return CartesianAxis_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; }, CartesianAxis_typeof(obj); }
function CartesianAxis_extends() { CartesianAxis_extends = Object.assign ? Object.assign.bind() : 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 CartesianAxis_extends.apply(this, arguments); }
function CartesianAxis_ownKeys(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 CartesianAxis_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? CartesianAxis_ownKeys(Object(source), !0).forEach(function (key) { CartesianAxis_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : CartesianAxis_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function CartesianAxis_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = CartesianAxis_objectWithoutPropertiesLoose(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 CartesianAxis_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; }
function CartesianAxis_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function CartesianAxis_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, CartesianAxis_toPropertyKey(descriptor.key), descriptor); } }
function CartesianAxis_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartesianAxis_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartesianAxis_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function CartesianAxis_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) CartesianAxis_setPrototypeOf(subClass, superClass); }
function CartesianAxis_setPrototypeOf(o, p) { CartesianAxis_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CartesianAxis_setPrototypeOf(o, p); }
function CartesianAxis_createSuper(Derived) { var hasNativeReflectConstruct = CartesianAxis_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = CartesianAxis_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = CartesianAxis_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return CartesianAxis_possibleConstructorReturn(this, result); }; }
function CartesianAxis_possibleConstructorReturn(self, call) { if (call && (CartesianAxis_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return CartesianAxis_assertThisInitialized(self); }
function CartesianAxis_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function CartesianAxis_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function CartesianAxis_getPrototypeOf(o) { CartesianAxis_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CartesianAxis_getPrototypeOf(o); }
function CartesianAxis_defineProperty(obj, key, value) { key = CartesianAxis_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function CartesianAxis_toPropertyKey(arg) { var key = CartesianAxis_toPrimitive(arg, "string"); return CartesianAxis_typeof(key) === "symbol" ? key : String(key); }
function CartesianAxis_toPrimitive(input, hint) { if (CartesianAxis_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (CartesianAxis_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Cartesian Axis
 */










var CartesianAxis = /*#__PURE__*/function (_Component) {
  CartesianAxis_inherits(CartesianAxis, _Component);
  var _super = CartesianAxis_createSuper(CartesianAxis);
  function CartesianAxis(props) {
    var _this;
    CartesianAxis_classCallCheck(this, CartesianAxis);
    _this = _super.call(this, props);
    _this.state = {
      fontSize: '',
      letterSpacing: ''
    };
    return _this;
  }
  CartesianAxis_createClass(CartesianAxis, [{
    key: "shouldComponentUpdate",
    value: function shouldComponentUpdate(_ref, nextState) {
      var viewBox = _ref.viewBox,
        restProps = CartesianAxis_objectWithoutProperties(_ref, CartesianAxis_excluded);
      // props.viewBox is sometimes generated every time -
      // check that specially as object equality is likely to fail
      var _this$props = this.props,
        viewBoxOld = _this$props.viewBox,
        restPropsOld = CartesianAxis_objectWithoutProperties(_this$props, CartesianAxis_excluded2);
      return !ShallowEqual_shallowEqual(viewBox, viewBoxOld) || !ShallowEqual_shallowEqual(restProps, restPropsOld) || !ShallowEqual_shallowEqual(nextState, this.state);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      var htmlLayer = this.layerReference;
      if (!htmlLayer) return;
      var tick = htmlLayer.getElementsByClassName('recharts-cartesian-axis-tick-value')[0];
      if (tick) {
        this.setState({
          fontSize: window.getComputedStyle(tick).fontSize,
          letterSpacing: window.getComputedStyle(tick).letterSpacing
        });
      }
    }

    /**
     * Calculate the coordinates of endpoints in ticks
     * @param  {Object} data The data of a simple tick
     * @return {Object} (x1, y1): The coordinate of endpoint close to tick text
     *  (x2, y2): The coordinate of endpoint close to axis
     */
  }, {
    key: "getTickLineCoord",
    value: function getTickLineCoord(data) {
      var _this$props2 = this.props,
        x = _this$props2.x,
        y = _this$props2.y,
        width = _this$props2.width,
        height = _this$props2.height,
        orientation = _this$props2.orientation,
        tickSize = _this$props2.tickSize,
        mirror = _this$props2.mirror,
        tickMargin = _this$props2.tickMargin;
      var x1, x2, y1, y2, tx, ty;
      var sign = mirror ? -1 : 1;
      var finalTickSize = data.tickSize || tickSize;
      var tickCoord = isNumber(data.tickCoord) ? data.tickCoord : data.coordinate;
      switch (orientation) {
        case 'top':
          x1 = x2 = data.coordinate;
          y2 = y + +!mirror * height;
          y1 = y2 - sign * finalTickSize;
          ty = y1 - sign * tickMargin;
          tx = tickCoord;
          break;
        case 'left':
          y1 = y2 = data.coordinate;
          x2 = x + +!mirror * width;
          x1 = x2 - sign * finalTickSize;
          tx = x1 - sign * tickMargin;
          ty = tickCoord;
          break;
        case 'right':
          y1 = y2 = data.coordinate;
          x2 = x + +mirror * width;
          x1 = x2 + sign * finalTickSize;
          tx = x1 + sign * tickMargin;
          ty = tickCoord;
          break;
        default:
          x1 = x2 = data.coordinate;
          y2 = y + +mirror * height;
          y1 = y2 + sign * finalTickSize;
          ty = y1 + sign * tickMargin;
          tx = tickCoord;
          break;
      }
      return {
        line: {
          x1: x1,
          y1: y1,
          x2: x2,
          y2: y2
        },
        tick: {
          x: tx,
          y: ty
        }
      };
    }
  }, {
    key: "getTickTextAnchor",
    value: function getTickTextAnchor() {
      var _this$props3 = this.props,
        orientation = _this$props3.orientation,
        mirror = _this$props3.mirror;
      var textAnchor;
      switch (orientation) {
        case 'left':
          textAnchor = mirror ? 'start' : 'end';
          break;
        case 'right':
          textAnchor = mirror ? 'end' : 'start';
          break;
        default:
          textAnchor = 'middle';
          break;
      }
      return textAnchor;
    }
  }, {
    key: "getTickVerticalAnchor",
    value: function getTickVerticalAnchor() {
      var _this$props4 = this.props,
        orientation = _this$props4.orientation,
        mirror = _this$props4.mirror;
      var verticalAnchor = 'end';
      switch (orientation) {
        case 'left':
        case 'right':
          verticalAnchor = 'middle';
          break;
        case 'top':
          verticalAnchor = mirror ? 'start' : 'end';
          break;
        default:
          verticalAnchor = mirror ? 'end' : 'start';
          break;
      }
      return verticalAnchor;
    }
  }, {
    key: "renderAxisLine",
    value: function renderAxisLine() {
      var _this$props5 = this.props,
        x = _this$props5.x,
        y = _this$props5.y,
        width = _this$props5.width,
        height = _this$props5.height,
        orientation = _this$props5.orientation,
        mirror = _this$props5.mirror,
        axisLine = _this$props5.axisLine;
      var props = CartesianAxis_objectSpread(CartesianAxis_objectSpread(CartesianAxis_objectSpread({}, filterProps(this.props)), filterProps(axisLine)), {}, {
        fill: 'none'
      });
      if (orientation === 'top' || orientation === 'bottom') {
        var needHeight = +(orientation === 'top' && !mirror || orientation === 'bottom' && mirror);
        props = CartesianAxis_objectSpread(CartesianAxis_objectSpread({}, props), {}, {
          x1: x,
          y1: y + needHeight * height,
          x2: x + width,
          y2: y + needHeight * height
        });
      } else {
        var needWidth = +(orientation === 'left' && !mirror || orientation === 'right' && mirror);
        props = CartesianAxis_objectSpread(CartesianAxis_objectSpread({}, props), {}, {
          x1: x + needWidth * width,
          y1: y,
          x2: x + needWidth * width,
          y2: y + height
        });
      }
      return /*#__PURE__*/react.createElement("line", CartesianAxis_extends({}, props, {
        className: classnames_default()('recharts-cartesian-axis-line', get_default()(axisLine, 'className'))
      }));
    }
  }, {
    key: "renderTicks",
    value:
    /**
     * render the ticks
     * @param {Array} ticks The ticks to actually render (overrides what was passed in props)
     * @param {string} fontSize Fontsize to consider for tick spacing
     * @param {string} letterSpacing Letterspacing to consider for tick spacing
     * @return {ReactComponent} renderedTicks
     */
    function renderTicks(ticks, fontSize, letterSpacing) {
      var _this2 = this;
      var _this$props6 = this.props,
        tickLine = _this$props6.tickLine,
        stroke = _this$props6.stroke,
        tick = _this$props6.tick,
        tickFormatter = _this$props6.tickFormatter,
        unit = _this$props6.unit;
      var finalTicks = getTicks(CartesianAxis_objectSpread(CartesianAxis_objectSpread({}, this.props), {}, {
        ticks: ticks
      }), fontSize, letterSpacing);
      var textAnchor = this.getTickTextAnchor();
      var verticalAnchor = this.getTickVerticalAnchor();
      var axisProps = filterProps(this.props);
      var customTickProps = filterProps(tick);
      var tickLineProps = CartesianAxis_objectSpread(CartesianAxis_objectSpread({}, axisProps), {}, {
        fill: 'none'
      }, filterProps(tickLine));
      var items = finalTicks.map(function (entry, i) {
        var _this2$getTickLineCoo = _this2.getTickLineCoord(entry),
          lineCoord = _this2$getTickLineCoo.line,
          tickCoord = _this2$getTickLineCoo.tick;
        var tickProps = CartesianAxis_objectSpread(CartesianAxis_objectSpread(CartesianAxis_objectSpread(CartesianAxis_objectSpread({
          textAnchor: textAnchor,
          verticalAnchor: verticalAnchor
        }, axisProps), {}, {
          stroke: 'none',
          fill: stroke
        }, customTickProps), tickCoord), {}, {
          index: i,
          payload: entry,
          visibleTicksCount: finalTicks.length,
          tickFormatter: tickFormatter
        });
        return /*#__PURE__*/react.createElement(Layer, CartesianAxis_extends({
          className: "recharts-cartesian-axis-tick",
          key: "tick-".concat(i) // eslint-disable-line react/no-array-index-key
        }, adaptEventsOfChild(_this2.props, entry, i)), tickLine && /*#__PURE__*/react.createElement("line", CartesianAxis_extends({}, tickLineProps, lineCoord, {
          className: classnames_default()('recharts-cartesian-axis-tick-line', get_default()(tickLine, 'className'))
        })), tick && CartesianAxis.renderTickItem(tick, tickProps, "".concat(isFunction_default()(tickFormatter) ? tickFormatter(entry.value, i) : entry.value).concat(unit || '')));
      });
      return /*#__PURE__*/react.createElement("g", {
        className: "recharts-cartesian-axis-ticks"
      }, items);
    }
  }, {
    key: "render",
    value: function render() {
      var _this3 = this;
      var _this$props7 = this.props,
        axisLine = _this$props7.axisLine,
        width = _this$props7.width,
        height = _this$props7.height,
        ticksGenerator = _this$props7.ticksGenerator,
        className = _this$props7.className,
        hide = _this$props7.hide;
      if (hide) {
        return null;
      }
      var _this$props8 = this.props,
        ticks = _this$props8.ticks,
        noTicksProps = CartesianAxis_objectWithoutProperties(_this$props8, CartesianAxis_excluded3);
      var finalTicks = ticks;
      if (isFunction_default()(ticksGenerator)) {
        finalTicks = ticks && ticks.length > 0 ? ticksGenerator(this.props) : ticksGenerator(noTicksProps);
      }
      if (width <= 0 || height <= 0 || !finalTicks || !finalTicks.length) {
        return null;
      }
      return /*#__PURE__*/react.createElement(Layer, {
        className: classnames_default()('recharts-cartesian-axis', className),
        ref: function ref(_ref2) {
          _this3.layerReference = _ref2;
        }
      }, axisLine && this.renderAxisLine(), this.renderTicks(finalTicks, this.state.fontSize, this.state.letterSpacing), Label.renderCallByParent(this.props));
    }
  }], [{
    key: "renderTickItem",
    value: function renderTickItem(option, props, value) {
      var tickItem;
      if ( /*#__PURE__*/react.isValidElement(option)) {
        tickItem = /*#__PURE__*/react.cloneElement(option, props);
      } else if (isFunction_default()(option)) {
        tickItem = option(props);
      } else {
        tickItem = /*#__PURE__*/react.createElement(Text, CartesianAxis_extends({}, props, {
          className: "recharts-cartesian-axis-tick-value"
        }), value);
      }
      return tickItem;
    }
  }]);
  return CartesianAxis;
}(react.Component);
CartesianAxis_defineProperty(CartesianAxis, "displayName", 'CartesianAxis');
CartesianAxis_defineProperty(CartesianAxis, "defaultProps", {
  x: 0,
  y: 0,
  width: 0,
  height: 0,
  viewBox: {
    x: 0,
    y: 0,
    width: 0,
    height: 0
  },
  // The orientation of axis
  orientation: 'bottom',
  // The ticks
  ticks: [],
  stroke: '#666',
  tickLine: true,
  axisLine: true,
  tick: true,
  mirror: false,
  minTickGap: 5,
  // The width or height of tick
  tickSize: 6,
  tickMargin: 2,
  interval: 'preserveEnd'
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/CssPrefixUtils.js
function CssPrefixUtils_typeof(obj) { "@babel/helpers - typeof"; return CssPrefixUtils_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; }, CssPrefixUtils_typeof(obj); }
function CssPrefixUtils_ownKeys(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 CssPrefixUtils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? CssPrefixUtils_ownKeys(Object(source), !0).forEach(function (key) { CssPrefixUtils_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : CssPrefixUtils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function CssPrefixUtils_defineProperty(obj, key, value) { key = CssPrefixUtils_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function CssPrefixUtils_toPropertyKey(arg) { var key = CssPrefixUtils_toPrimitive(arg, "string"); return CssPrefixUtils_typeof(key) === "symbol" ? key : String(key); }
function CssPrefixUtils_toPrimitive(input, hint) { if (CssPrefixUtils_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (CssPrefixUtils_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var CssPrefixUtils_PREFIX_LIST = ['Webkit', 'Moz', 'O', 'ms'];
var CssPrefixUtils_generatePrefixStyle = function generatePrefixStyle(name, value) {
  if (!name) {
    return null;
  }
  var camelName = name.replace(/(\w)/, function (v) {
    return v.toUpperCase();
  });
  var result = CssPrefixUtils_PREFIX_LIST.reduce(function (res, entry) {
    return CssPrefixUtils_objectSpread(CssPrefixUtils_objectSpread({}, res), {}, CssPrefixUtils_defineProperty({}, entry + camelName, value));
  }, {});
  result[name] = value;
  return result;
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/Brush.js


function Brush_typeof(obj) { "@babel/helpers - typeof"; return Brush_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; }, Brush_typeof(obj); }
function Brush_extends() { Brush_extends = Object.assign ? Object.assign.bind() : 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 Brush_extends.apply(this, arguments); }
function Brush_ownKeys(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 Brush_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Brush_ownKeys(Object(source), !0).forEach(function (key) { Brush_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Brush_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Brush_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Brush_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, Brush_toPropertyKey(descriptor.key), descriptor); } }
function Brush_createClass(Constructor, protoProps, staticProps) { if (protoProps) Brush_defineProperties(Constructor.prototype, protoProps); if (staticProps) Brush_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function Brush_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Brush_setPrototypeOf(subClass, superClass); }
function Brush_setPrototypeOf(o, p) { Brush_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Brush_setPrototypeOf(o, p); }
function Brush_createSuper(Derived) { var hasNativeReflectConstruct = Brush_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Brush_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Brush_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Brush_possibleConstructorReturn(this, result); }; }
function Brush_possibleConstructorReturn(self, call) { if (call && (Brush_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Brush_assertThisInitialized(self); }
function Brush_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Brush_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function Brush_getPrototypeOf(o) { Brush_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Brush_getPrototypeOf(o); }
function Brush_defineProperty(obj, key, value) { key = Brush_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Brush_toPropertyKey(arg) { var key = Brush_toPrimitive(arg, "string"); return Brush_typeof(key) === "symbol" ? key : String(key); }
function Brush_toPrimitive(input, hint) { if (Brush_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Brush_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Brush
 */









var createScale = function createScale(_ref) {
  var data = _ref.data,
    startIndex = _ref.startIndex,
    endIndex = _ref.endIndex,
    x = _ref.x,
    width = _ref.width,
    travellerWidth = _ref.travellerWidth;
  if (!data || !data.length) {
    return {};
  }
  var len = data.length;
  var scale = band_point().domain(range_default()(0, len)).range([x, x + width - travellerWidth]);
  var scaleValues = scale.domain().map(function (entry) {
    return scale(entry);
  });
  return {
    isTextActive: false,
    isSlideMoving: false,
    isTravellerMoving: false,
    isTravellerFocused: false,
    startX: scale(startIndex),
    endX: scale(endIndex),
    scale: scale,
    scaleValues: scaleValues
  };
};
var Brush_isTouch = function isTouch(e) {
  return e.changedTouches && !!e.changedTouches.length;
};
var Brush = /*#__PURE__*/function (_PureComponent) {
  Brush_inherits(Brush, _PureComponent);
  var _super = Brush_createSuper(Brush);
  function Brush(props) {
    var _this;
    Brush_classCallCheck(this, Brush);
    _this = _super.call(this, props);
    Brush_defineProperty(Brush_assertThisInitialized(_this), "handleDrag", function (e) {
      if (_this.leaveTimer) {
        clearTimeout(_this.leaveTimer);
        _this.leaveTimer = null;
      }
      if (_this.state.isTravellerMoving) {
        _this.handleTravellerMove(e);
      } else if (_this.state.isSlideMoving) {
        _this.handleSlideDrag(e);
      }
    });
    Brush_defineProperty(Brush_assertThisInitialized(_this), "handleTouchMove", function (e) {
      if (e.changedTouches != null && e.changedTouches.length > 0) {
        _this.handleDrag(e.changedTouches[0]);
      }
    });
    Brush_defineProperty(Brush_assertThisInitialized(_this), "handleDragEnd", function () {
      _this.setState({
        isTravellerMoving: false,
        isSlideMoving: false
      });
      _this.detachDragEndListener();
    });
    Brush_defineProperty(Brush_assertThisInitialized(_this), "handleLeaveWrapper", function () {
      if (_this.state.isTravellerMoving || _this.state.isSlideMoving) {
        _this.leaveTimer = window.setTimeout(_this.handleDragEnd, _this.props.leaveTimeOut);
      }
    });
    Brush_defineProperty(Brush_assertThisInitialized(_this), "handleEnterSlideOrTraveller", function () {
      _this.setState({
        isTextActive: true
      });
    });
    Brush_defineProperty(Brush_assertThisInitialized(_this), "handleLeaveSlideOrTraveller", function () {
      _this.setState({
        isTextActive: false
      });
    });
    Brush_defineProperty(Brush_assertThisInitialized(_this), "handleSlideDragStart", function (e) {
      var event = Brush_isTouch(e) ? e.changedTouches[0] : e;
      _this.setState({
        isTravellerMoving: false,
        isSlideMoving: true,
        slideMoveStartX: event.pageX
      });
      _this.attachDragEndListener();
    });
    _this.travellerDragStartHandlers = {
      startX: _this.handleTravellerDragStart.bind(Brush_assertThisInitialized(_this), 'startX'),
      endX: _this.handleTravellerDragStart.bind(Brush_assertThisInitialized(_this), 'endX')
    };
    _this.state = {};
    return _this;
  }
  Brush_createClass(Brush, [{
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      if (this.leaveTimer) {
        clearTimeout(this.leaveTimer);
        this.leaveTimer = null;
      }
      this.detachDragEndListener();
    }
  }, {
    key: "getIndex",
    value: function getIndex(_ref2) {
      var startX = _ref2.startX,
        endX = _ref2.endX;
      var scaleValues = this.state.scaleValues;
      var _this$props = this.props,
        gap = _this$props.gap,
        data = _this$props.data;
      var lastIndex = data.length - 1;
      var min = Math.min(startX, endX);
      var max = Math.max(startX, endX);
      var minIndex = Brush.getIndexInRange(scaleValues, min);
      var maxIndex = Brush.getIndexInRange(scaleValues, max);
      return {
        startIndex: minIndex - minIndex % gap,
        endIndex: maxIndex === lastIndex ? lastIndex : maxIndex - maxIndex % gap
      };
    }
  }, {
    key: "getTextOfTick",
    value: function getTextOfTick(index) {
      var _this$props2 = this.props,
        data = _this$props2.data,
        tickFormatter = _this$props2.tickFormatter,
        dataKey = _this$props2.dataKey;
      var text = getValueByDataKey(data[index], dataKey, index);
      return isFunction_default()(tickFormatter) ? tickFormatter(text, index) : text;
    }
  }, {
    key: "attachDragEndListener",
    value: function attachDragEndListener() {
      window.addEventListener('mouseup', this.handleDragEnd, true);
      window.addEventListener('touchend', this.handleDragEnd, true);
      window.addEventListener('mousemove', this.handleDrag, true);
    }
  }, {
    key: "detachDragEndListener",
    value: function detachDragEndListener() {
      window.removeEventListener('mouseup', this.handleDragEnd, true);
      window.removeEventListener('touchend', this.handleDragEnd, true);
      window.removeEventListener('mousemove', this.handleDrag, true);
    }
  }, {
    key: "handleSlideDrag",
    value: function handleSlideDrag(e) {
      var _this$state = this.state,
        slideMoveStartX = _this$state.slideMoveStartX,
        startX = _this$state.startX,
        endX = _this$state.endX;
      var _this$props3 = this.props,
        x = _this$props3.x,
        width = _this$props3.width,
        travellerWidth = _this$props3.travellerWidth,
        startIndex = _this$props3.startIndex,
        endIndex = _this$props3.endIndex,
        onChange = _this$props3.onChange;
      var delta = e.pageX - slideMoveStartX;
      if (delta > 0) {
        delta = Math.min(delta, x + width - travellerWidth - endX, x + width - travellerWidth - startX);
      } else if (delta < 0) {
        delta = Math.max(delta, x - startX, x - endX);
      }
      var newIndex = this.getIndex({
        startX: startX + delta,
        endX: endX + delta
      });
      if ((newIndex.startIndex !== startIndex || newIndex.endIndex !== endIndex) && onChange) {
        onChange(newIndex);
      }
      this.setState({
        startX: startX + delta,
        endX: endX + delta,
        slideMoveStartX: e.pageX
      });
    }
  }, {
    key: "handleTravellerDragStart",
    value: function handleTravellerDragStart(id, e) {
      var event = Brush_isTouch(e) ? e.changedTouches[0] : e;
      this.setState({
        isSlideMoving: false,
        isTravellerMoving: true,
        movingTravellerId: id,
        brushMoveStartX: event.pageX
      });
      this.attachDragEndListener();
    }
  }, {
    key: "handleTravellerMove",
    value: function handleTravellerMove(e) {
      var _this$setState;
      var _this$state2 = this.state,
        brushMoveStartX = _this$state2.brushMoveStartX,
        movingTravellerId = _this$state2.movingTravellerId,
        endX = _this$state2.endX,
        startX = _this$state2.startX;
      var prevValue = this.state[movingTravellerId];
      var _this$props4 = this.props,
        x = _this$props4.x,
        width = _this$props4.width,
        travellerWidth = _this$props4.travellerWidth,
        onChange = _this$props4.onChange,
        gap = _this$props4.gap,
        data = _this$props4.data;
      var params = {
        startX: this.state.startX,
        endX: this.state.endX
      };
      var delta = e.pageX - brushMoveStartX;
      if (delta > 0) {
        delta = Math.min(delta, x + width - travellerWidth - prevValue);
      } else if (delta < 0) {
        delta = Math.max(delta, x - prevValue);
      }
      params[movingTravellerId] = prevValue + delta;
      var newIndex = this.getIndex(params);
      var startIndex = newIndex.startIndex,
        endIndex = newIndex.endIndex;
      var isFullGap = function isFullGap() {
        var lastIndex = data.length - 1;
        if (movingTravellerId === 'startX' && (endX > startX ? startIndex % gap === 0 : endIndex % gap === 0) || endX < startX && endIndex === lastIndex || movingTravellerId === 'endX' && (endX > startX ? endIndex % gap === 0 : startIndex % gap === 0) || endX > startX && endIndex === lastIndex) {
          return true;
        }
        return false;
      };
      this.setState((_this$setState = {}, Brush_defineProperty(_this$setState, movingTravellerId, prevValue + delta), Brush_defineProperty(_this$setState, "brushMoveStartX", e.pageX), _this$setState), function () {
        if (onChange) {
          if (isFullGap()) {
            onChange(newIndex);
          }
        }
      });
    }
  }, {
    key: "handleTravellerMoveKeyboard",
    value: function handleTravellerMoveKeyboard(direction, id) {
      var _this2 = this;
      // scaleValues are a list of coordinates. For example: [65, 250, 435, 620, 805, 990].
      var _this$state3 = this.state,
        scaleValues = _this$state3.scaleValues,
        startX = _this$state3.startX,
        endX = _this$state3.endX;
      // currentScaleValue refers to which coordinate the current traveller should be placed at.
      var currentScaleValue = this.state[id];
      var currentIndex = scaleValues.indexOf(currentScaleValue);
      if (currentIndex === -1) {
        return;
      }
      var newIndex = currentIndex + direction;
      if (newIndex === -1 || newIndex >= scaleValues.length) {
        return;
      }
      var newScaleValue = scaleValues[newIndex];

      // Prevent travellers from being on top of each other or overlapping
      if (id === 'startX' && newScaleValue >= endX || id === 'endX' && newScaleValue <= startX) {
        return;
      }
      this.setState(Brush_defineProperty({}, id, newScaleValue), function () {
        _this2.props.onChange(_this2.getIndex({
          startX: _this2.state.startX,
          endX: _this2.state.endX
        }));
      });
    }
  }, {
    key: "renderBackground",
    value: function renderBackground() {
      var _this$props5 = this.props,
        x = _this$props5.x,
        y = _this$props5.y,
        width = _this$props5.width,
        height = _this$props5.height,
        fill = _this$props5.fill,
        stroke = _this$props5.stroke;
      return /*#__PURE__*/react.createElement("rect", {
        stroke: stroke,
        fill: fill,
        x: x,
        y: y,
        width: width,
        height: height
      });
    }
  }, {
    key: "renderPanorama",
    value: function renderPanorama() {
      var _this$props6 = this.props,
        x = _this$props6.x,
        y = _this$props6.y,
        width = _this$props6.width,
        height = _this$props6.height,
        data = _this$props6.data,
        children = _this$props6.children,
        padding = _this$props6.padding;
      var chartElement = react.Children.only(children);
      if (!chartElement) {
        return null;
      }
      return /*#__PURE__*/react.cloneElement(chartElement, {
        x: x,
        y: y,
        width: width,
        height: height,
        margin: padding,
        compact: true,
        data: data
      });
    }
  }, {
    key: "renderTravellerLayer",
    value: function renderTravellerLayer(travellerX, id) {
      var _this3 = this;
      var _this$props7 = this.props,
        y = _this$props7.y,
        travellerWidth = _this$props7.travellerWidth,
        height = _this$props7.height,
        traveller = _this$props7.traveller;
      var x = Math.max(travellerX, this.props.x);
      var travellerProps = Brush_objectSpread(Brush_objectSpread({}, filterProps(this.props)), {}, {
        x: x,
        y: y,
        width: travellerWidth,
        height: height
      });
      return /*#__PURE__*/react.createElement(Layer, {
        tabIndex: 0,
        role: "slider",
        className: "recharts-brush-traveller",
        onMouseEnter: this.handleEnterSlideOrTraveller,
        onMouseLeave: this.handleLeaveSlideOrTraveller,
        onMouseDown: this.travellerDragStartHandlers[id],
        onTouchStart: this.travellerDragStartHandlers[id],
        onKeyDown: function onKeyDown(e) {
          if (!['ArrowLeft', 'ArrowRight'].includes(e.key)) {
            return;
          }
          e.preventDefault();
          e.stopPropagation();
          _this3.handleTravellerMoveKeyboard(e.key === 'ArrowRight' ? 1 : -1, id);
        },
        onFocus: function onFocus() {
          _this3.setState({
            isTravellerFocused: true
          });
        },
        onBlur: function onBlur() {
          _this3.setState({
            isTravellerFocused: false
          });
        },
        style: {
          cursor: 'col-resize'
        }
      }, Brush.renderTraveller(traveller, travellerProps));
    }
  }, {
    key: "renderSlide",
    value: function renderSlide(startX, endX) {
      var _this$props8 = this.props,
        y = _this$props8.y,
        height = _this$props8.height,
        stroke = _this$props8.stroke,
        travellerWidth = _this$props8.travellerWidth;
      var x = Math.min(startX, endX) + travellerWidth;
      var width = Math.max(Math.abs(endX - startX) - travellerWidth, 0);
      return /*#__PURE__*/react.createElement("rect", {
        className: "recharts-brush-slide",
        onMouseEnter: this.handleEnterSlideOrTraveller,
        onMouseLeave: this.handleLeaveSlideOrTraveller,
        onMouseDown: this.handleSlideDragStart,
        onTouchStart: this.handleSlideDragStart,
        style: {
          cursor: 'move'
        },
        stroke: "none",
        fill: stroke,
        fillOpacity: 0.2,
        x: x,
        y: y,
        width: width,
        height: height
      });
    }
  }, {
    key: "renderText",
    value: function renderText() {
      var _this$props9 = this.props,
        startIndex = _this$props9.startIndex,
        endIndex = _this$props9.endIndex,
        y = _this$props9.y,
        height = _this$props9.height,
        travellerWidth = _this$props9.travellerWidth,
        stroke = _this$props9.stroke;
      var _this$state4 = this.state,
        startX = _this$state4.startX,
        endX = _this$state4.endX;
      var offset = 5;
      var attrs = {
        pointerEvents: 'none',
        fill: stroke
      };
      return /*#__PURE__*/react.createElement(Layer, {
        className: "recharts-brush-texts"
      }, /*#__PURE__*/react.createElement(Text, Brush_extends({
        textAnchor: "end",
        verticalAnchor: "middle",
        x: Math.min(startX, endX) - offset,
        y: y + height / 2
      }, attrs), this.getTextOfTick(startIndex)), /*#__PURE__*/react.createElement(Text, Brush_extends({
        textAnchor: "start",
        verticalAnchor: "middle",
        x: Math.max(startX, endX) + travellerWidth + offset,
        y: y + height / 2
      }, attrs), this.getTextOfTick(endIndex)));
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props10 = this.props,
        data = _this$props10.data,
        className = _this$props10.className,
        children = _this$props10.children,
        x = _this$props10.x,
        y = _this$props10.y,
        width = _this$props10.width,
        height = _this$props10.height,
        alwaysShowText = _this$props10.alwaysShowText;
      var _this$state5 = this.state,
        startX = _this$state5.startX,
        endX = _this$state5.endX,
        isTextActive = _this$state5.isTextActive,
        isSlideMoving = _this$state5.isSlideMoving,
        isTravellerMoving = _this$state5.isTravellerMoving,
        isTravellerFocused = _this$state5.isTravellerFocused;
      if (!data || !data.length || !isNumber(x) || !isNumber(y) || !isNumber(width) || !isNumber(height) || width <= 0 || height <= 0) {
        return null;
      }
      var layerClass = classnames_default()('recharts-brush', className);
      var isPanoramic = react.Children.count(children) === 1;
      var style = CssPrefixUtils_generatePrefixStyle('userSelect', 'none');
      return /*#__PURE__*/react.createElement(Layer, {
        className: layerClass,
        onMouseLeave: this.handleLeaveWrapper,
        onTouchMove: this.handleTouchMove,
        style: style
      }, this.renderBackground(), isPanoramic && this.renderPanorama(), this.renderSlide(startX, endX), this.renderTravellerLayer(startX, 'startX'), this.renderTravellerLayer(endX, 'endX'), (isTextActive || isSlideMoving || isTravellerMoving || isTravellerFocused || alwaysShowText) && this.renderText());
    }
  }], [{
    key: "renderDefaultTraveller",
    value: function renderDefaultTraveller(props) {
      var x = props.x,
        y = props.y,
        width = props.width,
        height = props.height,
        stroke = props.stroke;
      var lineY = Math.floor(y + height / 2) - 1;
      return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("rect", {
        x: x,
        y: y,
        width: width,
        height: height,
        fill: stroke,
        stroke: "none"
      }), /*#__PURE__*/react.createElement("line", {
        x1: x + 1,
        y1: lineY,
        x2: x + width - 1,
        y2: lineY,
        fill: "none",
        stroke: "#fff"
      }), /*#__PURE__*/react.createElement("line", {
        x1: x + 1,
        y1: lineY + 2,
        x2: x + width - 1,
        y2: lineY + 2,
        fill: "none",
        stroke: "#fff"
      }));
    }
  }, {
    key: "renderTraveller",
    value: function renderTraveller(option, props) {
      var rectangle;
      if ( /*#__PURE__*/react.isValidElement(option)) {
        rectangle = /*#__PURE__*/react.cloneElement(option, props);
      } else if (isFunction_default()(option)) {
        rectangle = option(props);
      } else {
        rectangle = Brush.renderDefaultTraveller(props);
      }
      return rectangle;
    }
  }, {
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      var data = nextProps.data,
        width = nextProps.width,
        x = nextProps.x,
        travellerWidth = nextProps.travellerWidth,
        updateId = nextProps.updateId,
        startIndex = nextProps.startIndex,
        endIndex = nextProps.endIndex;
      if (data !== prevState.prevData || updateId !== prevState.prevUpdateId) {
        return Brush_objectSpread({
          prevData: data,
          prevTravellerWidth: travellerWidth,
          prevUpdateId: updateId,
          prevX: x,
          prevWidth: width
        }, data && data.length ? createScale({
          data: data,
          width: width,
          x: x,
          travellerWidth: travellerWidth,
          startIndex: startIndex,
          endIndex: endIndex
        }) : {
          scale: null,
          scaleValues: null
        });
      }
      if (prevState.scale && (width !== prevState.prevWidth || x !== prevState.prevX || travellerWidth !== prevState.prevTravellerWidth)) {
        prevState.scale.range([x, x + width - travellerWidth]);
        var scaleValues = prevState.scale.domain().map(function (entry) {
          return prevState.scale(entry);
        });
        return {
          prevData: data,
          prevTravellerWidth: travellerWidth,
          prevUpdateId: updateId,
          prevX: x,
          prevWidth: width,
          startX: prevState.scale(nextProps.startIndex),
          endX: prevState.scale(nextProps.endIndex),
          scaleValues: scaleValues
        };
      }
      return null;
    }
  }, {
    key: "getIndexInRange",
    value: function getIndexInRange(range, x) {
      var len = range.length;
      var start = 0;
      var end = len - 1;
      while (end - start > 1) {
        var middle = Math.floor((start + end) / 2);
        if (range[middle] > x) {
          end = middle;
        } else {
          start = middle;
        }
      }
      return x >= range[end] ? end : start;
    }
  }]);
  return Brush;
}(react.PureComponent);
Brush_defineProperty(Brush, "displayName", 'Brush');
Brush_defineProperty(Brush, "defaultProps", {
  height: 40,
  travellerWidth: 5,
  gap: 1,
  fill: '#fff',
  stroke: '#666',
  padding: {
    top: 1,
    right: 1,
    bottom: 1,
    left: 1
  },
  leaveTimeOut: 1000,
  alwaysShowText: false
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/IfOverflowMatches.js
var ifOverflowMatches = function ifOverflowMatches(props, value) {
  var alwaysShow = props.alwaysShow;
  var ifOverflow = props.ifOverflow;
  if (alwaysShow) {
    ifOverflow = 'extendDomain';
  }
  return ifOverflow === value;
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/ReferenceDot.js

function ReferenceDot_typeof(obj) { "@babel/helpers - typeof"; return ReferenceDot_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; }, ReferenceDot_typeof(obj); }
function ReferenceDot_extends() { ReferenceDot_extends = Object.assign ? Object.assign.bind() : 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 ReferenceDot_extends.apply(this, arguments); }
function ReferenceDot_ownKeys(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 ReferenceDot_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ReferenceDot_ownKeys(Object(source), !0).forEach(function (key) { ReferenceDot_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ReferenceDot_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function ReferenceDot_defineProperty(obj, key, value) { key = ReferenceDot_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function ReferenceDot_toPropertyKey(arg) { var key = ReferenceDot_toPrimitive(arg, "string"); return ReferenceDot_typeof(key) === "symbol" ? key : String(key); }
function ReferenceDot_toPrimitive(input, hint) { if (ReferenceDot_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (ReferenceDot_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Reference Dot
 */










var getCoordinate = function getCoordinate(props) {
  var x = props.x,
    y = props.y,
    xAxis = props.xAxis,
    yAxis = props.yAxis;
  var scales = createLabeledScales({
    x: xAxis.scale,
    y: yAxis.scale
  });
  var result = scales.apply({
    x: x,
    y: y
  }, {
    bandAware: true
  });
  if (ifOverflowMatches(props, 'discard') && !scales.isInRange(result)) {
    return null;
  }
  return result;
};
function ReferenceDot(props) {
  var x = props.x,
    y = props.y,
    r = props.r,
    alwaysShow = props.alwaysShow,
    clipPathId = props.clipPathId;
  var isX = isNumOrStr(x);
  var isY = isNumOrStr(y);
  LogUtils_warn(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
  if (!isX || !isY) {
    return null;
  }
  var coordinate = getCoordinate(props);
  if (!coordinate) {
    return null;
  }
  var cx = coordinate.x,
    cy = coordinate.y;
  var shape = props.shape,
    className = props.className;
  var clipPath = ifOverflowMatches(props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
  var dotProps = ReferenceDot_objectSpread(ReferenceDot_objectSpread({
    clipPath: clipPath
  }, filterProps(props, true)), {}, {
    cx: cx,
    cy: cy
  });
  return /*#__PURE__*/react.createElement(Layer, {
    className: classnames_default()('recharts-reference-dot', className)
  }, ReferenceDot.renderDot(shape, dotProps), Label.renderCallByParent(props, {
    x: cx - r,
    y: cy - r,
    width: 2 * r,
    height: 2 * r
  }));
}
ReferenceDot.displayName = 'ReferenceDot';
ReferenceDot.defaultProps = {
  isFront: false,
  ifOverflow: 'discard',
  xAxisId: 0,
  yAxisId: 0,
  r: 10,
  fill: '#fff',
  stroke: '#ccc',
  fillOpacity: 1,
  strokeWidth: 1
};
ReferenceDot.renderDot = function (option, props) {
  var dot;
  if ( /*#__PURE__*/react.isValidElement(option)) {
    dot = /*#__PURE__*/react.cloneElement(option, props);
  } else if (isFunction_default()(option)) {
    dot = option(props);
  } else {
    dot = /*#__PURE__*/react.createElement(Dot, ReferenceDot_extends({}, props, {
      cx: props.cx,
      cy: props.cy,
      className: "recharts-reference-dot-dot"
    }));
  }
  return dot;
};
// EXTERNAL MODULE: ./node_modules/lodash/some.js
var some = __webpack_require__(2426);
var some_default = /*#__PURE__*/__webpack_require__.n(some);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/ReferenceLine.js
function ReferenceLine_typeof(obj) { "@babel/helpers - typeof"; return ReferenceLine_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; }, ReferenceLine_typeof(obj); }


function ReferenceLine_ownKeys(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 ReferenceLine_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ReferenceLine_ownKeys(Object(source), !0).forEach(function (key) { ReferenceLine_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ReferenceLine_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function ReferenceLine_defineProperty(obj, key, value) { key = ReferenceLine_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function ReferenceLine_toPropertyKey(arg) { var key = ReferenceLine_toPrimitive(arg, "string"); return ReferenceLine_typeof(key) === "symbol" ? key : String(key); }
function ReferenceLine_toPrimitive(input, hint) { if (ReferenceLine_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (ReferenceLine_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function ReferenceLine_slicedToArray(arr, i) { return ReferenceLine_arrayWithHoles(arr) || ReferenceLine_iterableToArrayLimit(arr, i) || ReferenceLine_unsupportedIterableToArray(arr, i) || ReferenceLine_nonIterableRest(); }
function ReferenceLine_nonIterableRest() { 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 ReferenceLine_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ReferenceLine_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 ReferenceLine_arrayLikeToArray(o, minLen); }
function ReferenceLine_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 ReferenceLine_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function ReferenceLine_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function ReferenceLine_extends() { ReferenceLine_extends = Object.assign ? Object.assign.bind() : 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 ReferenceLine_extends.apply(this, arguments); }
/**
 * @fileOverview Reference Line
 */









var renderLine = function renderLine(option, props) {
  var line;
  if ( /*#__PURE__*/react.isValidElement(option)) {
    line = /*#__PURE__*/react.cloneElement(option, props);
  } else if (isFunction_default()(option)) {
    line = option(props);
  } else {
    line = /*#__PURE__*/react.createElement("line", ReferenceLine_extends({}, props, {
      className: "recharts-reference-line-line"
    }));
  }
  return line;
};

// TODO: ScaleHelper
var getEndPoints = function getEndPoints(scales, isFixedX, isFixedY, isSegment, props) {
  var _props$viewBox = props.viewBox,
    x = _props$viewBox.x,
    y = _props$viewBox.y,
    width = _props$viewBox.width,
    height = _props$viewBox.height,
    position = props.position;
  if (isFixedY) {
    var yCoord = props.y,
      orientation = props.yAxis.orientation;
    var coord = scales.y.apply(yCoord, {
      position: position
    });
    if (ifOverflowMatches(props, 'discard') && !scales.y.isInRange(coord)) {
      return null;
    }
    var points = [{
      x: x + width,
      y: coord
    }, {
      x: x,
      y: coord
    }];
    return orientation === 'left' ? points.reverse() : points;
  }
  if (isFixedX) {
    var xCoord = props.x,
      _orientation = props.xAxis.orientation;
    var _coord = scales.x.apply(xCoord, {
      position: position
    });
    if (ifOverflowMatches(props, 'discard') && !scales.x.isInRange(_coord)) {
      return null;
    }
    var _points = [{
      x: _coord,
      y: y + height
    }, {
      x: _coord,
      y: y
    }];
    return _orientation === 'top' ? _points.reverse() : _points;
  }
  if (isSegment) {
    var segment = props.segment;
    var _points2 = segment.map(function (p) {
      return scales.apply(p, {
        position: position
      });
    });
    if (ifOverflowMatches(props, 'discard') && some_default()(_points2, function (p) {
      return !scales.isInRange(p);
    })) {
      return null;
    }
    return _points2;
  }
  return null;
};
function ReferenceLine(props) {
  var fixedX = props.x,
    fixedY = props.y,
    segment = props.segment,
    xAxis = props.xAxis,
    yAxis = props.yAxis,
    shape = props.shape,
    className = props.className,
    alwaysShow = props.alwaysShow,
    clipPathId = props.clipPathId;
  LogUtils_warn(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
  var scales = createLabeledScales({
    x: xAxis.scale,
    y: yAxis.scale
  });
  var isX = isNumOrStr(fixedX);
  var isY = isNumOrStr(fixedY);
  var isSegment = segment && segment.length === 2;
  var endPoints = getEndPoints(scales, isX, isY, isSegment, props);
  if (!endPoints) {
    return null;
  }
  var _endPoints = ReferenceLine_slicedToArray(endPoints, 2),
    _endPoints$ = _endPoints[0],
    x1 = _endPoints$.x,
    y1 = _endPoints$.y,
    _endPoints$2 = _endPoints[1],
    x2 = _endPoints$2.x,
    y2 = _endPoints$2.y;
  var clipPath = ifOverflowMatches(props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
  var lineProps = ReferenceLine_objectSpread(ReferenceLine_objectSpread({
    clipPath: clipPath
  }, filterProps(props, true)), {}, {
    x1: x1,
    y1: y1,
    x2: x2,
    y2: y2
  });
  return /*#__PURE__*/react.createElement(Layer, {
    className: classnames_default()('recharts-reference-line', className)
  }, renderLine(shape, lineProps), Label.renderCallByParent(props, rectWithCoords({
    x1: x1,
    y1: y1,
    x2: x2,
    y2: y2
  })));
}
ReferenceLine.displayName = 'ReferenceLine';
ReferenceLine.defaultProps = {
  isFront: false,
  ifOverflow: 'discard',
  xAxisId: 0,
  yAxisId: 0,
  fill: 'none',
  stroke: '#ccc',
  fillOpacity: 1,
  strokeWidth: 1,
  position: 'middle'
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/cartesian/ReferenceArea.js

function ReferenceArea_typeof(obj) { "@babel/helpers - typeof"; return ReferenceArea_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; }, ReferenceArea_typeof(obj); }
function ReferenceArea_extends() { ReferenceArea_extends = Object.assign ? Object.assign.bind() : 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 ReferenceArea_extends.apply(this, arguments); }
function ReferenceArea_ownKeys(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 ReferenceArea_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ReferenceArea_ownKeys(Object(source), !0).forEach(function (key) { ReferenceArea_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ReferenceArea_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function ReferenceArea_defineProperty(obj, key, value) { key = ReferenceArea_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function ReferenceArea_toPropertyKey(arg) { var key = ReferenceArea_toPrimitive(arg, "string"); return ReferenceArea_typeof(key) === "symbol" ? key : String(key); }
function ReferenceArea_toPrimitive(input, hint) { if (ReferenceArea_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (ReferenceArea_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Reference Line
 */










var getRect = function getRect(hasX1, hasX2, hasY1, hasY2, props) {
  var xValue1 = props.x1,
    xValue2 = props.x2,
    yValue1 = props.y1,
    yValue2 = props.y2,
    xAxis = props.xAxis,
    yAxis = props.yAxis;
  if (!xAxis || !yAxis) return null;
  var scales = createLabeledScales({
    x: xAxis.scale,
    y: yAxis.scale
  });
  var p1 = {
    x: hasX1 ? scales.x.apply(xValue1, {
      position: 'start'
    }) : scales.x.rangeMin,
    y: hasY1 ? scales.y.apply(yValue1, {
      position: 'start'
    }) : scales.y.rangeMin
  };
  var p2 = {
    x: hasX2 ? scales.x.apply(xValue2, {
      position: 'end'
    }) : scales.x.rangeMax,
    y: hasY2 ? scales.y.apply(yValue2, {
      position: 'end'
    }) : scales.y.rangeMax
  };
  if (ifOverflowMatches(props, 'discard') && (!scales.isInRange(p1) || !scales.isInRange(p2))) {
    return null;
  }
  return rectWithPoints(p1, p2);
};
function ReferenceArea(props) {
  var x1 = props.x1,
    x2 = props.x2,
    y1 = props.y1,
    y2 = props.y2,
    className = props.className,
    alwaysShow = props.alwaysShow,
    clipPathId = props.clipPathId;
  LogUtils_warn(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
  var hasX1 = isNumOrStr(x1);
  var hasX2 = isNumOrStr(x2);
  var hasY1 = isNumOrStr(y1);
  var hasY2 = isNumOrStr(y2);
  var shape = props.shape;
  if (!hasX1 && !hasX2 && !hasY1 && !hasY2 && !shape) {
    return null;
  }
  var rect = getRect(hasX1, hasX2, hasY1, hasY2, props);
  if (!rect && !shape) {
    return null;
  }
  var clipPath = ifOverflowMatches(props, 'hidden') ? "url(#".concat(clipPathId, ")") : undefined;
  return /*#__PURE__*/react.createElement(Layer, {
    className: classnames_default()('recharts-reference-area', className)
  }, ReferenceArea.renderRect(shape, ReferenceArea_objectSpread(ReferenceArea_objectSpread({
    clipPath: clipPath
  }, filterProps(props, true)), rect)), Label.renderCallByParent(props, rect));
}
ReferenceArea.displayName = 'ReferenceArea';
ReferenceArea.defaultProps = {
  isFront: false,
  ifOverflow: 'discard',
  xAxisId: 0,
  yAxisId: 0,
  r: 10,
  fill: '#ccc',
  fillOpacity: 0.5,
  stroke: 'none',
  strokeWidth: 1
};
ReferenceArea.renderRect = function (option, props) {
  var rect;
  if ( /*#__PURE__*/react.isValidElement(option)) {
    rect = /*#__PURE__*/react.cloneElement(option, props);
  } else if (isFunction_default()(option)) {
    rect = option(props);
  } else {
    rect = /*#__PURE__*/react.createElement(Rectangle, ReferenceArea_extends({}, props, {
      className: "recharts-reference-area-rect"
    }));
  }
  return rect;
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/DetectReferenceElementsDomain.js
function DetectReferenceElementsDomain_toConsumableArray(arr) { return DetectReferenceElementsDomain_arrayWithoutHoles(arr) || DetectReferenceElementsDomain_iterableToArray(arr) || DetectReferenceElementsDomain_unsupportedIterableToArray(arr) || DetectReferenceElementsDomain_nonIterableSpread(); }
function DetectReferenceElementsDomain_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."); }
function DetectReferenceElementsDomain_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return DetectReferenceElementsDomain_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 DetectReferenceElementsDomain_arrayLikeToArray(o, minLen); }
function DetectReferenceElementsDomain_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function DetectReferenceElementsDomain_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return DetectReferenceElementsDomain_arrayLikeToArray(arr); }
function DetectReferenceElementsDomain_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; }






var detectReferenceElementsDomain = function detectReferenceElementsDomain(children, domain, axisId, axisType, specifiedTicks) {
  var lines = findAllByType(children, ReferenceLine);
  var dots = findAllByType(children, ReferenceDot);
  var elements = [].concat(DetectReferenceElementsDomain_toConsumableArray(lines), DetectReferenceElementsDomain_toConsumableArray(dots));
  var areas = findAllByType(children, ReferenceArea);
  var idKey = "".concat(axisType, "Id");
  var valueKey = axisType[0];
  var finalDomain = domain;
  if (elements.length) {
    finalDomain = elements.reduce(function (result, el) {
      if (el.props[idKey] === axisId && ifOverflowMatches(el.props, 'extendDomain') && isNumber(el.props[valueKey])) {
        var value = el.props[valueKey];
        return [Math.min(result[0], value), Math.max(result[1], value)];
      }
      return result;
    }, finalDomain);
  }
  if (areas.length) {
    var key1 = "".concat(valueKey, "1");
    var key2 = "".concat(valueKey, "2");
    finalDomain = areas.reduce(function (result, el) {
      if (el.props[idKey] === axisId && ifOverflowMatches(el.props, 'extendDomain') && isNumber(el.props[key1]) && isNumber(el.props[key2])) {
        var value1 = el.props[key1];
        var value2 = el.props[key2];
        return [Math.min(result[0], value1, value2), Math.max(result[1], value1, value2)];
      }
      return result;
    }, finalDomain);
  }
  if (specifiedTicks && specifiedTicks.length) {
    finalDomain = specifiedTicks.reduce(function (result, tick) {
      if (isNumber(tick)) {
        return [Math.min(result[0], tick), Math.max(result[1], tick)];
      }
      return result;
    }, finalDomain);
  }
  return finalDomain;
};
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/eventemitter3/index.js
var eventemitter3 = __webpack_require__(1640);
var eventemitter3_default = /*#__PURE__*/__webpack_require__.n(eventemitter3);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/util/Events.js

var eventCenter = new (eventemitter3_default())();
if (eventCenter.setMaxListeners) {
  eventCenter.setMaxListeners(10);
}

var SYNC_EVENT = 'recharts.syncMouseEvents';
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/chart/AccessibilityManager.js
function AccessibilityManager_typeof(obj) { "@babel/helpers - typeof"; return AccessibilityManager_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; }, AccessibilityManager_typeof(obj); }
function AccessibilityManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function AccessibilityManager_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, AccessibilityManager_toPropertyKey(descriptor.key), descriptor); } }
function AccessibilityManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) AccessibilityManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) AccessibilityManager_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function AccessibilityManager_defineProperty(obj, key, value) { key = AccessibilityManager_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function AccessibilityManager_toPropertyKey(arg) { var key = AccessibilityManager_toPrimitive(arg, "string"); return AccessibilityManager_typeof(key) === "symbol" ? key : String(key); }
function AccessibilityManager_toPrimitive(input, hint) { if (AccessibilityManager_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (AccessibilityManager_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var AccessibilityManager = /*#__PURE__*/function () {
  function AccessibilityManager() {
    AccessibilityManager_classCallCheck(this, AccessibilityManager);
    AccessibilityManager_defineProperty(this, "activeIndex", 0);
    AccessibilityManager_defineProperty(this, "coordinateList", []);
    AccessibilityManager_defineProperty(this, "layout", 'horizontal');
  }
  AccessibilityManager_createClass(AccessibilityManager, [{
    key: "setDetails",
    value: function setDetails(_ref) {
      var _ref$coordinateList = _ref.coordinateList,
        coordinateList = _ref$coordinateList === void 0 ? [] : _ref$coordinateList,
        _ref$container = _ref.container,
        container = _ref$container === void 0 ? null : _ref$container,
        _ref$layout = _ref.layout,
        layout = _ref$layout === void 0 ? null : _ref$layout,
        _ref$offset = _ref.offset,
        offset = _ref$offset === void 0 ? null : _ref$offset,
        _ref$mouseHandlerCall = _ref.mouseHandlerCallback,
        mouseHandlerCallback = _ref$mouseHandlerCall === void 0 ? null : _ref$mouseHandlerCall;
      this.coordinateList = coordinateList !== null && coordinateList !== void 0 ? coordinateList : this.coordinateList;
      this.container = container !== null && container !== void 0 ? container : this.container;
      this.layout = layout !== null && layout !== void 0 ? layout : this.layout;
      this.offset = offset !== null && offset !== void 0 ? offset : this.offset;
      this.mouseHandlerCallback = mouseHandlerCallback !== null && mouseHandlerCallback !== void 0 ? mouseHandlerCallback : this.mouseHandlerCallback;

      // Keep activeIndex in the bounds between 0 and the last coordinate index
      this.activeIndex = Math.min(Math.max(this.activeIndex, 0), this.coordinateList.length - 1);
    }
  }, {
    key: "focus",
    value: function focus() {
      this.spoofMouse();
    }
  }, {
    key: "keyboardEvent",
    value: function keyboardEvent(e) {
      // The AccessibilityManager relies on the Tooltip component. When tooltips suddenly stop existing,
      // it can cause errors. We use this function to check. We don't want arrow keys to be processed
      // if there are no tooltips, since that will cause unexpected behavior of users.
      if (this.coordinateList.length === 0) {
        return;
      }
      switch (e.key) {
        case 'ArrowRight':
          {
            if (this.layout !== 'horizontal') {
              return;
            }
            this.activeIndex = Math.min(this.activeIndex + 1, this.coordinateList.length - 1);
            this.spoofMouse();
            break;
          }
        case 'ArrowLeft':
          {
            if (this.layout !== 'horizontal') {
              return;
            }
            this.activeIndex = Math.max(this.activeIndex - 1, 0);
            this.spoofMouse();
            break;
          }
        default:
          {
            break;
          }
      }
    }
  }, {
    key: "spoofMouse",
    value: function spoofMouse() {
      if (this.layout !== 'horizontal') {
        return;
      }

      // This can happen when the tooltips suddenly stop existing as children of the component
      // That update doesn't otherwise fire events, so we have to double check here.
      if (this.coordinateList.length === 0) {
        return;
      }
      var _this$container$getBo = this.container.getBoundingClientRect(),
        x = _this$container$getBo.x,
        y = _this$container$getBo.y,
        height = _this$container$getBo.height;
      var coordinate = this.coordinateList[this.activeIndex].coordinate;
      var pageX = x + coordinate;
      var pageY = y + this.offset.top + height / 2;
      this.mouseHandlerCallback({
        pageX: pageX,
        pageY: pageY
      });
    }
  }]);
  return AccessibilityManager;
}();
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/chart/generateCategoricalChart.js










var generateCategoricalChart_excluded = ["item"],
  generateCategoricalChart_excluded2 = ["children", "className", "width", "height", "style", "compact", "title", "desc"];
function generateCategoricalChart_typeof(obj) { "@babel/helpers - typeof"; return generateCategoricalChart_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; }, generateCategoricalChart_typeof(obj); }
function generateCategoricalChart_slicedToArray(arr, i) { return generateCategoricalChart_arrayWithHoles(arr) || generateCategoricalChart_iterableToArrayLimit(arr, i) || generateCategoricalChart_unsupportedIterableToArray(arr, i) || generateCategoricalChart_nonIterableRest(); }
function generateCategoricalChart_nonIterableRest() { 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 generateCategoricalChart_iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function generateCategoricalChart_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function generateCategoricalChart_extends() { generateCategoricalChart_extends = Object.assign ? Object.assign.bind() : 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 generateCategoricalChart_extends.apply(this, arguments); }
function generateCategoricalChart_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = generateCategoricalChart_objectWithoutPropertiesLoose(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 generateCategoricalChart_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; }
function generateCategoricalChart_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function generateCategoricalChart_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, generateCategoricalChart_toPropertyKey(descriptor.key), descriptor); } }
function generateCategoricalChart_createClass(Constructor, protoProps, staticProps) { if (protoProps) generateCategoricalChart_defineProperties(Constructor.prototype, protoProps); if (staticProps) generateCategoricalChart_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function generateCategoricalChart_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) generateCategoricalChart_setPrototypeOf(subClass, superClass); }
function generateCategoricalChart_setPrototypeOf(o, p) { generateCategoricalChart_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return generateCategoricalChart_setPrototypeOf(o, p); }
function generateCategoricalChart_createSuper(Derived) { var hasNativeReflectConstruct = generateCategoricalChart_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = generateCategoricalChart_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = generateCategoricalChart_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return generateCategoricalChart_possibleConstructorReturn(this, result); }; }
function generateCategoricalChart_possibleConstructorReturn(self, call) { if (call && (generateCategoricalChart_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return generateCategoricalChart_assertThisInitialized(self); }
function generateCategoricalChart_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function generateCategoricalChart_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function generateCategoricalChart_getPrototypeOf(o) { generateCategoricalChart_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return generateCategoricalChart_getPrototypeOf(o); }
function generateCategoricalChart_toConsumableArray(arr) { return generateCategoricalChart_arrayWithoutHoles(arr) || generateCategoricalChart_iterableToArray(arr) || generateCategoricalChart_unsupportedIterableToArray(arr) || generateCategoricalChart_nonIterableSpread(); }
function generateCategoricalChart_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."); }
function generateCategoricalChart_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return generateCategoricalChart_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 generateCategoricalChart_arrayLikeToArray(o, minLen); }
function generateCategoricalChart_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function generateCategoricalChart_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return generateCategoricalChart_arrayLikeToArray(arr); }
function generateCategoricalChart_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 generateCategoricalChart_ownKeys(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 generateCategoricalChart_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? generateCategoricalChart_ownKeys(Object(source), !0).forEach(function (key) { generateCategoricalChart_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : generateCategoricalChart_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function generateCategoricalChart_defineProperty(obj, key, value) { key = generateCategoricalChart_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function generateCategoricalChart_toPropertyKey(arg) { var key = generateCategoricalChart_toPrimitive(arg, "string"); return generateCategoricalChart_typeof(key) === "symbol" ? key : String(key); }
function generateCategoricalChart_toPrimitive(input, hint) { if (generateCategoricalChart_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (generateCategoricalChart_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
























var ORIENT_MAP = {
  xAxis: ['bottom', 'top'],
  yAxis: ['left', 'right']
};
var originCoordinate = {
  x: 0,
  y: 0
};

// use legacy isFinite only if there is a problem (aka IE)
// eslint-disable-next-line no-restricted-globals
var isFinit = Number.isFinite ? Number.isFinite : isFinite;
var defer =
// eslint-disable-next-line no-nested-ternary
typeof requestAnimationFrame === 'function' ? requestAnimationFrame : typeof setImmediate === 'function' ? setImmediate : setTimeout;
var deferClear =
// eslint-disable-next-line no-nested-ternary
typeof cancelAnimationFrame === 'function' ? cancelAnimationFrame : typeof clearImmediate === 'function' ? clearImmediate : clearTimeout;
var calculateTooltipPos = function calculateTooltipPos(rangeObj, layout) {
  if (layout === 'horizontal') {
    return rangeObj.x;
  }
  if (layout === 'vertical') {
    return rangeObj.y;
  }
  if (layout === 'centric') {
    return rangeObj.angle;
  }
  return rangeObj.radius;
};
var getActiveCoordinate = function getActiveCoordinate(layout, tooltipTicks, activeIndex, rangeObj) {
  var entry = tooltipTicks.find(function (tick) {
    return tick && tick.index === activeIndex;
  });
  if (entry) {
    if (layout === 'horizontal') {
      return {
        x: entry.coordinate,
        y: rangeObj.y
      };
    }
    if (layout === 'vertical') {
      return {
        x: rangeObj.x,
        y: entry.coordinate
      };
    }
    if (layout === 'centric') {
      var _angle = entry.coordinate;
      var _radius = rangeObj.radius;
      return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, rangeObj), polarToCartesian(rangeObj.cx, rangeObj.cy, _radius, _angle)), {}, {
        angle: _angle,
        radius: _radius
      });
    }
    var radius = entry.coordinate;
    var angle = rangeObj.angle;
    return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, rangeObj), polarToCartesian(rangeObj.cx, rangeObj.cy, radius, angle)), {}, {
      angle: angle,
      radius: radius
    });
  }
  return originCoordinate;
};
var getDisplayedData = function getDisplayedData(data, _ref, item) {
  var graphicalItems = _ref.graphicalItems,
    dataStartIndex = _ref.dataStartIndex,
    dataEndIndex = _ref.dataEndIndex;
  var itemsData = (graphicalItems || []).reduce(function (result, child) {
    var itemData = child.props.data;
    if (itemData && itemData.length) {
      return [].concat(generateCategoricalChart_toConsumableArray(result), generateCategoricalChart_toConsumableArray(itemData));
    }
    return result;
  }, []);
  if (itemsData && itemsData.length > 0) {
    return itemsData;
  }
  if (item && item.props && item.props.data && item.props.data.length > 0) {
    return item.props.data;
  }
  if (data && data.length && isNumber(dataStartIndex) && isNumber(dataEndIndex)) {
    return data.slice(dataStartIndex, dataEndIndex + 1);
  }
  return [];
};

/**
 * Takes a domain and user props to determine whether he provided the domain via props or if we need to calculate it.
 * @param   {AxisDomain}  domain              The potential domain from props
 * @param   {Boolean}     allowDataOverflow   from props
 * @param   {String}      axisType            from props
 * @returns {Boolean}                         `true` if domain is specified by user
 */
function isDomainSpecifiedByUser(domain, allowDataOverflow, axisType) {
  if (axisType === 'number' && allowDataOverflow === true && Array.isArray(domain)) {
    var domainStart = domain === null || domain === void 0 ? void 0 : domain[0];
    var domainEnd = domain === null || domain === void 0 ? void 0 : domain[1];

    /*
     * The `isNumber` check is needed because the user could also provide strings like "dataMin" via the domain props.
     * In such case, we have to compute the domain from the data.
     */
    if (!!domainStart && !!domainEnd && isNumber(domainStart) && isNumber(domainEnd)) {
      return true;
    }
  }
  return false;
}
function getDefaultDomainByAxisType(axisType) {
  return axisType === 'number' ? [0, 'auto'] : undefined;
}

/**
 * Get the content to be displayed in the tooltip
 * @param  {Object} state          Current state
 * @param  {Array}  chartData      The data defined in chart
 * @param  {Number} activeIndex    Active index of data
 * @param  {String} activeLabel    Active label of data
 * @return {Array}                 The content of tooltip
 */
var getTooltipContent = function getTooltipContent(state, chartData, activeIndex, activeLabel) {
  var graphicalItems = state.graphicalItems,
    tooltipAxis = state.tooltipAxis;
  var displayedData = getDisplayedData(chartData, state);
  if (activeIndex < 0 || !graphicalItems || !graphicalItems.length || activeIndex >= displayedData.length) {
    return null;
  }
  // get data by activeIndex when the axis don't allow duplicated category
  return graphicalItems.reduce(function (result, child) {
    var hide = child.props.hide;
    if (hide) {
      return result;
    }
    var data = child.props.data;
    var payload;
    if (tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory) {
      // graphic child has data props
      var entries = data === undefined ? displayedData : data;
      payload = findEntryInArray(entries, tooltipAxis.dataKey, activeLabel);
    } else {
      payload = data && data[activeIndex] || displayedData[activeIndex];
    }
    if (!payload) {
      return result;
    }
    return [].concat(generateCategoricalChart_toConsumableArray(result), [getTooltipItem(child, payload)]);
  }, []);
};

/**
 * Returns tooltip data based on a mouse position (as a parameter or in state)
 * @param  {Object} state     current state
 * @param  {Array}  chartData the data defined in chart
 * @param  {String} layout     The layout type of chart
 * @param  {Object} rangeObj  { x, y } coordinates
 * @return {Object}           Tooltip data data
 */
var getTooltipData = function getTooltipData(state, chartData, layout, rangeObj) {
  var rangeData = rangeObj || {
    x: state.chartX,
    y: state.chartY
  };
  var pos = calculateTooltipPos(rangeData, layout);
  var ticks = state.orderedTooltipTicks,
    axis = state.tooltipAxis,
    tooltipTicks = state.tooltipTicks;
  var activeIndex = calculateActiveTickIndex(pos, ticks, tooltipTicks, axis);
  if (activeIndex >= 0 && tooltipTicks) {
    var activeLabel = tooltipTicks[activeIndex] && tooltipTicks[activeIndex].value;
    var activePayload = getTooltipContent(state, chartData, activeIndex, activeLabel);
    var activeCoordinate = getActiveCoordinate(layout, ticks, activeIndex, rangeData);
    return {
      activeTooltipIndex: activeIndex,
      activeLabel: activeLabel,
      activePayload: activePayload,
      activeCoordinate: activeCoordinate
    };
  }
  return null;
};

/**
 * Get the configuration of axis by the options of axis instance
 * @param  {Object} props         Latest props
 * @param {Array}  axes           The instance of axes
 * @param  {Array} graphicalItems The instances of item
 * @param  {String} axisType      The type of axis, xAxis - x-axis, yAxis - y-axis
 * @param  {String} axisIdKey     The unique id of an axis
 * @param  {Object} stackGroups   The items grouped by axisId and stackId
 * @param {Number} dataStartIndex The start index of the data series when a brush is applied
 * @param {Number} dataEndIndex   The end index of the data series when a brush is applied
 * @return {Object}      Configuration
 */
var getAxisMapByAxes = function getAxisMapByAxes(props, _ref2) {
  var axes = _ref2.axes,
    graphicalItems = _ref2.graphicalItems,
    axisType = _ref2.axisType,
    axisIdKey = _ref2.axisIdKey,
    stackGroups = _ref2.stackGroups,
    dataStartIndex = _ref2.dataStartIndex,
    dataEndIndex = _ref2.dataEndIndex;
  var layout = props.layout,
    children = props.children,
    stackOffset = props.stackOffset;
  var isCategorical = isCategoricalAxis(layout, axisType);

  // Eliminate duplicated axes
  var axisMap = axes.reduce(function (result, child) {
    var _child$props$domain2;
    var _child$props = child.props,
      type = _child$props.type,
      dataKey = _child$props.dataKey,
      allowDataOverflow = _child$props.allowDataOverflow,
      allowDuplicatedCategory = _child$props.allowDuplicatedCategory,
      scale = _child$props.scale,
      ticks = _child$props.ticks,
      includeHidden = _child$props.includeHidden;
    var axisId = child.props[axisIdKey];
    if (result[axisId]) {
      return result;
    }
    var displayedData = getDisplayedData(props.data, {
      graphicalItems: graphicalItems.filter(function (item) {
        return item.props[axisIdKey] === axisId;
      }),
      dataStartIndex: dataStartIndex,
      dataEndIndex: dataEndIndex
    });
    var len = displayedData.length;
    var domain, duplicateDomain, categoricalDomain;

    /*
     * This is a hack to short-circuit the domain creation here to enhance performance.
     * Usually, the data is used to determine the domain, but when the user specifies
     * a domain upfront (via props), there is no need to calculate the domain start and end,
     * which is very expensive for a larger amount of data.
     * The only thing that would prohibit short-circuiting is when the user doesn't allow data overflow,
     * because the axis is supposed to ignore the specified domain that way.
     */
    if (isDomainSpecifiedByUser(child.props.domain, allowDataOverflow, type)) {
      domain = parseSpecifiedDomain(child.props.domain, null, allowDataOverflow);
      /* The chart can be categorical and have the domain specified in numbers
       * we still need to calculate the categorical domain
       * TODO: refactor this more
       */
      if (isCategorical && (type === 'number' || scale !== 'auto')) {
        categoricalDomain = getDomainOfDataByKey(displayedData, dataKey, 'category');
      }
    }

    // if the domain is defaulted we need this for `originalDomain` as well
    var defaultDomain = getDefaultDomainByAxisType(type);

    // we didn't create the domain from user's props above, so we need to calculate it
    if (!domain || domain.length === 0) {
      var _child$props$domain;
      var childDomain = (_child$props$domain = child.props.domain) !== null && _child$props$domain !== void 0 ? _child$props$domain : defaultDomain;
      if (dataKey) {
        // has dataKey in <Axis />
        domain = getDomainOfDataByKey(displayedData, dataKey, type);
        if (type === 'category' && isCategorical) {
          // the field type is category data and this axis is categorical axis
          var duplicate = hasDuplicate(domain);
          if (allowDuplicatedCategory && duplicate) {
            duplicateDomain = domain;
            // When category axis has duplicated text, serial numbers are used to generate scale
            domain = range_default()(0, len);
          } else if (!allowDuplicatedCategory) {
            // remove duplicated category
            domain = parseDomainOfCategoryAxis(childDomain, domain, child).reduce(function (finalDomain, entry) {
              return finalDomain.indexOf(entry) >= 0 ? finalDomain : [].concat(generateCategoricalChart_toConsumableArray(finalDomain), [entry]);
            }, []);
          }
        } else if (type === 'category') {
          // the field type is category data and this axis is numerical axis
          if (!allowDuplicatedCategory) {
            domain = parseDomainOfCategoryAxis(childDomain, domain, child).reduce(function (finalDomain, entry) {
              return finalDomain.indexOf(entry) >= 0 || entry === '' || isNil_default()(entry) ? finalDomain : [].concat(generateCategoricalChart_toConsumableArray(finalDomain), [entry]);
            }, []);
          } else {
            // eliminate undefined or null or empty string
            domain = domain.filter(function (entry) {
              return entry !== '' && !isNil_default()(entry);
            });
          }
        } else if (type === 'number') {
          // the field type is numerical
          var errorBarsDomain = parseErrorBarsOfAxis(displayedData, graphicalItems.filter(function (item) {
            return item.props[axisIdKey] === axisId && (includeHidden || !item.props.hide);
          }), dataKey, axisType, layout);
          if (errorBarsDomain) {
            domain = errorBarsDomain;
          }
        }
        if (isCategorical && (type === 'number' || scale !== 'auto')) {
          categoricalDomain = getDomainOfDataByKey(displayedData, dataKey, 'category');
        }
      } else if (isCategorical) {
        // the axis is a categorical axis
        domain = range_default()(0, len);
      } else if (stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack && type === 'number') {
        // when stackOffset is 'expand', the domain may be calculated as [0, 1.000000000002]
        domain = stackOffset === 'expand' ? [0, 1] : getDomainOfStackGroups(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex);
      } else {
        domain = getDomainOfItemsWithSameAxis(displayedData, graphicalItems.filter(function (item) {
          return item.props[axisIdKey] === axisId && (includeHidden || !item.props.hide);
        }), type, layout, true);
      }
      if (type === 'number') {
        // To detect wether there is any reference lines whose props alwaysShow is true
        domain = detectReferenceElementsDomain(children, domain, axisId, axisType, ticks);
        if (childDomain) {
          domain = parseSpecifiedDomain(childDomain, domain, allowDataOverflow);
        }
      } else if (type === 'category' && childDomain) {
        var axisDomain = childDomain;
        var isDomainValid = domain.every(function (entry) {
          return axisDomain.indexOf(entry) >= 0;
        });
        if (isDomainValid) {
          domain = axisDomain;
        }
      }
    }
    return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, result), {}, generateCategoricalChart_defineProperty({}, axisId, generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, child.props), {}, {
      axisType: axisType,
      domain: domain,
      categoricalDomain: categoricalDomain,
      duplicateDomain: duplicateDomain,
      originalDomain: (_child$props$domain2 = child.props.domain) !== null && _child$props$domain2 !== void 0 ? _child$props$domain2 : defaultDomain,
      isCategorical: isCategorical,
      layout: layout
    })));
  }, {});
  return axisMap;
};

/**
 * Get the configuration of axis by the options of item,
 * this kind of axis does not display in chart
 * @param  {Object} props         Latest props
 * @param  {Array} graphicalItems The instances of item
 * @param  {ReactElement} Axis    Axis Component
 * @param  {String} axisType      The type of axis, xAxis - x-axis, yAxis - y-axis
 * @param  {String} axisIdKey     The unique id of an axis
 * @param  {Object} stackGroups   The items grouped by axisId and stackId
 * @param {Number} dataStartIndex The start index of the data series when a brush is applied
 * @param {Number} dataEndIndex   The end index of the data series when a brush is applied
 * @return {Object}               Configuration
 */
var getAxisMapByItems = function getAxisMapByItems(props, _ref3) {
  var graphicalItems = _ref3.graphicalItems,
    Axis = _ref3.Axis,
    axisType = _ref3.axisType,
    axisIdKey = _ref3.axisIdKey,
    stackGroups = _ref3.stackGroups,
    dataStartIndex = _ref3.dataStartIndex,
    dataEndIndex = _ref3.dataEndIndex;
  var layout = props.layout,
    children = props.children;
  var displayedData = getDisplayedData(props.data, {
    graphicalItems: graphicalItems,
    dataStartIndex: dataStartIndex,
    dataEndIndex: dataEndIndex
  });
  var len = displayedData.length;
  var isCategorical = isCategoricalAxis(layout, axisType);
  var index = -1;

  // The default type of x-axis is category axis,
  // The default contents of x-axis is the serial numbers of data
  // The default type of y-axis is number axis
  // The default contents of y-axis is the domain of data
  var axisMap = graphicalItems.reduce(function (result, child) {
    var axisId = child.props[axisIdKey];
    var originalDomain = getDefaultDomainByAxisType('number');
    if (!result[axisId]) {
      index++;
      var domain;
      if (isCategorical) {
        domain = range_default()(0, len);
      } else if (stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack) {
        domain = getDomainOfStackGroups(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex);
        domain = detectReferenceElementsDomain(children, domain, axisId, axisType);
      } else {
        domain = parseSpecifiedDomain(originalDomain, getDomainOfItemsWithSameAxis(displayedData, graphicalItems.filter(function (item) {
          return item.props[axisIdKey] === axisId && !item.props.hide;
        }), 'number', layout), Axis.defaultProps.allowDataOverflow);
        domain = detectReferenceElementsDomain(children, domain, axisId, axisType);
      }
      return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, result), {}, generateCategoricalChart_defineProperty({}, axisId, generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({
        axisType: axisType
      }, Axis.defaultProps), {}, {
        hide: true,
        orientation: get_default()(ORIENT_MAP, "".concat(axisType, ".").concat(index % 2), null),
        domain: domain,
        originalDomain: originalDomain,
        isCategorical: isCategorical,
        layout: layout
        // specify scale when no Axis
        // scale: isCategorical ? 'band' : 'linear',
      })));
    }

    return result;
  }, {});
  return axisMap;
};

/**
 * Get the configuration of all x-axis or y-axis
 * @param  {Object} props          Latest props
 * @param  {String} axisType       The type of axis
 * @param  {Array}  graphicalItems The instances of item
 * @param  {Object} stackGroups    The items grouped by axisId and stackId
 * @param {Number} dataStartIndex  The start index of the data series when a brush is applied
 * @param {Number} dataEndIndex    The end index of the data series when a brush is applied
 * @return {Object}          Configuration
 */
var getAxisMap = function getAxisMap(props, _ref4) {
  var _ref4$axisType = _ref4.axisType,
    axisType = _ref4$axisType === void 0 ? 'xAxis' : _ref4$axisType,
    AxisComp = _ref4.AxisComp,
    graphicalItems = _ref4.graphicalItems,
    stackGroups = _ref4.stackGroups,
    dataStartIndex = _ref4.dataStartIndex,
    dataEndIndex = _ref4.dataEndIndex;
  var children = props.children;
  var axisIdKey = "".concat(axisType, "Id");
  // Get all the instance of Axis
  var axes = findAllByType(children, AxisComp);
  var axisMap = {};
  if (axes && axes.length) {
    axisMap = getAxisMapByAxes(props, {
      axes: axes,
      graphicalItems: graphicalItems,
      axisType: axisType,
      axisIdKey: axisIdKey,
      stackGroups: stackGroups,
      dataStartIndex: dataStartIndex,
      dataEndIndex: dataEndIndex
    });
  } else if (graphicalItems && graphicalItems.length) {
    axisMap = getAxisMapByItems(props, {
      Axis: AxisComp,
      graphicalItems: graphicalItems,
      axisType: axisType,
      axisIdKey: axisIdKey,
      stackGroups: stackGroups,
      dataStartIndex: dataStartIndex,
      dataEndIndex: dataEndIndex
    });
  }
  return axisMap;
};
var tooltipTicksGenerator = function tooltipTicksGenerator(axisMap) {
  var axis = getAnyElementOfObject(axisMap);
  var tooltipTicks = getTicksOfAxis(axis, false, true);
  return {
    tooltipTicks: tooltipTicks,
    orderedTooltipTicks: sortBy_default()(tooltipTicks, function (o) {
      return o.coordinate;
    }),
    tooltipAxis: axis,
    tooltipAxisBandSize: getBandSizeOfAxis(axis, tooltipTicks)
  };
};

/**
 * Returns default, reset state for the categorical chart.
 * @param {Object} props Props object to use when creating the default state
 * @return {Object} Whole new state
 */
var createDefaultState = function createDefaultState(props) {
  var _brushItem$props, _brushItem$props2;
  var children = props.children,
    defaultShowTooltip = props.defaultShowTooltip;
  var brushItem = findChildByType(children, Brush);
  var startIndex = brushItem && brushItem.props && brushItem.props.startIndex || 0;
  var endIndex = (brushItem === null || brushItem === void 0 ? void 0 : (_brushItem$props = brushItem.props) === null || _brushItem$props === void 0 ? void 0 : _brushItem$props.endIndex) !== undefined ? brushItem === null || brushItem === void 0 ? void 0 : (_brushItem$props2 = brushItem.props) === null || _brushItem$props2 === void 0 ? void 0 : _brushItem$props2.endIndex : props.data && props.data.length - 1 || 0;
  return {
    chartX: 0,
    chartY: 0,
    dataStartIndex: startIndex,
    dataEndIndex: endIndex,
    activeTooltipIndex: -1,
    isTooltipActive: !isNil_default()(defaultShowTooltip) ? defaultShowTooltip : false
  };
};
var hasGraphicalBarItem = function hasGraphicalBarItem(graphicalItems) {
  if (!graphicalItems || !graphicalItems.length) {
    return false;
  }
  return graphicalItems.some(function (item) {
    var name = getDisplayName(item && item.type);
    return name && name.indexOf('Bar') >= 0;
  });
};
var getAxisNameByLayout = function getAxisNameByLayout(layout) {
  if (layout === 'horizontal') {
    return {
      numericAxisName: 'yAxis',
      cateAxisName: 'xAxis'
    };
  }
  if (layout === 'vertical') {
    return {
      numericAxisName: 'xAxis',
      cateAxisName: 'yAxis'
    };
  }
  if (layout === 'centric') {
    return {
      numericAxisName: 'radiusAxis',
      cateAxisName: 'angleAxis'
    };
  }
  return {
    numericAxisName: 'angleAxis',
    cateAxisName: 'radiusAxis'
  };
};

/**
 * Calculate the offset of main part in the svg element
 * @param  {Object} props          Latest props
 * graphicalItems The instances of item
 * xAxisMap       The configuration of x-axis
 * yAxisMap       The configuration of y-axis
 * @param  {Object} prevLegendBBox          the boundary box of legend
 * @return {Object} The offset of main part in the svg element
 */
var calculateOffset = function calculateOffset(_ref5, prevLegendBBox) {
  var props = _ref5.props,
    graphicalItems = _ref5.graphicalItems,
    _ref5$xAxisMap = _ref5.xAxisMap,
    xAxisMap = _ref5$xAxisMap === void 0 ? {} : _ref5$xAxisMap,
    _ref5$yAxisMap = _ref5.yAxisMap,
    yAxisMap = _ref5$yAxisMap === void 0 ? {} : _ref5$yAxisMap;
  var width = props.width,
    height = props.height,
    children = props.children;
  var margin = props.margin || {};
  var brushItem = findChildByType(children, Brush);
  var legendItem = findChildByType(children, Legend);
  var offsetH = Object.keys(yAxisMap).reduce(function (result, id) {
    var entry = yAxisMap[id];
    var orientation = entry.orientation;
    if (!entry.mirror && !entry.hide) {
      return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, result), {}, generateCategoricalChart_defineProperty({}, orientation, result[orientation] + entry.width));
    }
    return result;
  }, {
    left: margin.left || 0,
    right: margin.right || 0
  });
  var offsetV = Object.keys(xAxisMap).reduce(function (result, id) {
    var entry = xAxisMap[id];
    var orientation = entry.orientation;
    if (!entry.mirror && !entry.hide) {
      return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, result), {}, generateCategoricalChart_defineProperty({}, orientation, get_default()(result, "".concat(orientation)) + entry.height));
    }
    return result;
  }, {
    top: margin.top || 0,
    bottom: margin.bottom || 0
  });
  var offset = generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, offsetV), offsetH);
  var brushBottom = offset.bottom;
  if (brushItem) {
    offset.bottom += brushItem.props.height || Brush.defaultProps.height;
  }
  if (legendItem && prevLegendBBox) {
    offset = appendOffsetOfLegend(offset, graphicalItems, props, prevLegendBBox);
  }
  return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({
    brushBottom: brushBottom
  }, offset), {}, {
    width: width - offset.left - offset.right,
    height: height - offset.top - offset.bottom
  });
};
var generateCategoricalChart = function generateCategoricalChart(_ref6) {
  var _class;
  var chartName = _ref6.chartName,
    GraphicalChild = _ref6.GraphicalChild,
    _ref6$defaultTooltipE = _ref6.defaultTooltipEventType,
    defaultTooltipEventType = _ref6$defaultTooltipE === void 0 ? 'axis' : _ref6$defaultTooltipE,
    _ref6$validateTooltip = _ref6.validateTooltipEventTypes,
    validateTooltipEventTypes = _ref6$validateTooltip === void 0 ? ['axis'] : _ref6$validateTooltip,
    axisComponents = _ref6.axisComponents,
    legendContent = _ref6.legendContent,
    formatAxisMap = _ref6.formatAxisMap,
    defaultProps = _ref6.defaultProps;
  var getFormatItems = function getFormatItems(props, currentState) {
    var graphicalItems = currentState.graphicalItems,
      stackGroups = currentState.stackGroups,
      offset = currentState.offset,
      updateId = currentState.updateId,
      dataStartIndex = currentState.dataStartIndex,
      dataEndIndex = currentState.dataEndIndex;
    var barSize = props.barSize,
      layout = props.layout,
      barGap = props.barGap,
      barCategoryGap = props.barCategoryGap,
      globalMaxBarSize = props.maxBarSize;
    var _getAxisNameByLayout = getAxisNameByLayout(layout),
      numericAxisName = _getAxisNameByLayout.numericAxisName,
      cateAxisName = _getAxisNameByLayout.cateAxisName;
    var hasBar = hasGraphicalBarItem(graphicalItems);
    var sizeList = hasBar && getBarSizeList({
      barSize: barSize,
      stackGroups: stackGroups
    });
    var formattedItems = [];
    graphicalItems.forEach(function (item, index) {
      var displayedData = getDisplayedData(props.data, {
        dataStartIndex: dataStartIndex,
        dataEndIndex: dataEndIndex
      }, item);
      var _item$props = item.props,
        dataKey = _item$props.dataKey,
        childMaxBarSize = _item$props.maxBarSize;
      var numericAxisId = item.props["".concat(numericAxisName, "Id")];
      var cateAxisId = item.props["".concat(cateAxisName, "Id")];
      var axisObj = axisComponents.reduce(function (result, entry) {
        var _objectSpread6;
        var axisMap = currentState["".concat(entry.axisType, "Map")];
        var id = item.props["".concat(entry.axisType, "Id")];
        var axis = axisMap && axisMap[id];
        return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, result), {}, (_objectSpread6 = {}, generateCategoricalChart_defineProperty(_objectSpread6, entry.axisType, axis), generateCategoricalChart_defineProperty(_objectSpread6, "".concat(entry.axisType, "Ticks"), getTicksOfAxis(axis)), _objectSpread6));
      }, {});
      var cateAxis = axisObj[cateAxisName];
      var cateTicks = axisObj["".concat(cateAxisName, "Ticks")];
      var stackedData = stackGroups && stackGroups[numericAxisId] && stackGroups[numericAxisId].hasStack && getStackedDataOfItem(item, stackGroups[numericAxisId].stackGroups);
      var itemIsBar = getDisplayName(item.type).indexOf('Bar') >= 0;
      var bandSize = getBandSizeOfAxis(cateAxis, cateTicks);
      var barPosition = [];
      if (itemIsBar) {
        var _ref7, _getBandSizeOfAxis;
        // 如果是bar，计算bar的位置
        var maxBarSize = isNil_default()(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;
        var barBandSize = (_ref7 = (_getBandSizeOfAxis = getBandSizeOfAxis(cateAxis, cateTicks, true)) !== null && _getBandSizeOfAxis !== void 0 ? _getBandSizeOfAxis : maxBarSize) !== null && _ref7 !== void 0 ? _ref7 : 0;
        barPosition = getBarPosition({
          barGap: barGap,
          barCategoryGap: barCategoryGap,
          bandSize: barBandSize !== bandSize ? barBandSize : bandSize,
          sizeList: sizeList[cateAxisId],
          maxBarSize: maxBarSize
        });
        if (barBandSize !== bandSize) {
          barPosition = barPosition.map(function (pos) {
            return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, pos), {}, {
              position: generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, pos.position), {}, {
                offset: pos.position.offset - barBandSize / 2
              })
            });
          });
        }
      }
      var composedFn = item && item.type && item.type.getComposedData;
      if (composedFn) {
        var _objectSpread7;
        formattedItems.push({
          props: generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, composedFn(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, axisObj), {}, {
            displayedData: displayedData,
            props: props,
            dataKey: dataKey,
            item: item,
            bandSize: bandSize,
            barPosition: barPosition,
            offset: offset,
            stackedData: stackedData,
            layout: layout,
            dataStartIndex: dataStartIndex,
            dataEndIndex: dataEndIndex
          }))), {}, (_objectSpread7 = {
            key: item.key || "item-".concat(index)
          }, generateCategoricalChart_defineProperty(_objectSpread7, numericAxisName, axisObj[numericAxisName]), generateCategoricalChart_defineProperty(_objectSpread7, cateAxisName, axisObj[cateAxisName]), generateCategoricalChart_defineProperty(_objectSpread7, "animationId", updateId), _objectSpread7)),
          childIndex: parseChildIndex(item, props.children),
          item: item
        });
      }
    });
    return formattedItems;
  };

  /**
   * The AxisMaps are expensive to render on large data sets
   * so provide the ability to store them in state and only update them when necessary
   * they are dependent upon the start and end index of
   * the brush so it's important that this method is called _after_
   * the state is updated with any new start/end indices
   *
   * @param {Object} props          The props object to be used for updating the axismaps
   * dataStartIndex: The start index of the data series when a brush is applied
   * dataEndIndex: The end index of the data series when a brush is applied
   * updateId: The update id
   * @param {Object} prevState      Prev state
   * @return {Object} state New state to set
   */
  var updateStateOfAxisMapsOffsetAndStackGroups = function updateStateOfAxisMapsOffsetAndStackGroups(_ref8, prevState) {
    var props = _ref8.props,
      dataStartIndex = _ref8.dataStartIndex,
      dataEndIndex = _ref8.dataEndIndex,
      updateId = _ref8.updateId;
    if (!validateWidthHeight({
      props: props
    })) {
      return null;
    }
    var children = props.children,
      layout = props.layout,
      stackOffset = props.stackOffset,
      data = props.data,
      reverseStackOrder = props.reverseStackOrder;
    var _getAxisNameByLayout2 = getAxisNameByLayout(layout),
      numericAxisName = _getAxisNameByLayout2.numericAxisName,
      cateAxisName = _getAxisNameByLayout2.cateAxisName;
    var graphicalItems = findAllByType(children, GraphicalChild);
    var stackGroups = getStackGroupsByAxisId(data, graphicalItems, "".concat(numericAxisName, "Id"), "".concat(cateAxisName, "Id"), stackOffset, reverseStackOrder);
    var axisObj = axisComponents.reduce(function (result, entry) {
      var name = "".concat(entry.axisType, "Map");
      return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, result), {}, generateCategoricalChart_defineProperty({}, name, getAxisMap(props, generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, entry), {}, {
        graphicalItems: graphicalItems,
        stackGroups: entry.axisType === numericAxisName && stackGroups,
        dataStartIndex: dataStartIndex,
        dataEndIndex: dataEndIndex
      }))));
    }, {});
    var offset = calculateOffset(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, axisObj), {}, {
      props: props,
      graphicalItems: graphicalItems
    }), prevState === null || prevState === void 0 ? void 0 : prevState.legendBBox);
    Object.keys(axisObj).forEach(function (key) {
      axisObj[key] = formatAxisMap(props, axisObj[key], offset, key.replace('Map', ''), chartName);
    });
    var cateAxisMap = axisObj["".concat(cateAxisName, "Map")];
    var ticksObj = tooltipTicksGenerator(cateAxisMap);
    var formattedGraphicalItems = getFormatItems(props, generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, axisObj), {}, {
      dataStartIndex: dataStartIndex,
      dataEndIndex: dataEndIndex,
      updateId: updateId,
      graphicalItems: graphicalItems,
      stackGroups: stackGroups,
      offset: offset
    }));
    return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({
      formattedGraphicalItems: formattedGraphicalItems,
      graphicalItems: graphicalItems,
      offset: offset,
      stackGroups: stackGroups
    }, ticksObj), axisObj);
  };
  return _class = /*#__PURE__*/function (_Component) {
    generateCategoricalChart_inherits(CategoricalChartWrapper, _Component);
    var _super = generateCategoricalChart_createSuper(CategoricalChartWrapper);
    function CategoricalChartWrapper(_props) {
      var _this;
      generateCategoricalChart_classCallCheck(this, CategoricalChartWrapper);
      _this = _super.call(this, _props);
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "accessibilityManager", new AccessibilityManager());
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "clearDeferId", function () {
        if (!isNil_default()(_this.deferId) && deferClear) {
          deferClear(_this.deferId);
        }
        _this.deferId = null;
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleLegendBBoxUpdate", function (box) {
        if (box) {
          var _this$state = _this.state,
            dataStartIndex = _this$state.dataStartIndex,
            dataEndIndex = _this$state.dataEndIndex,
            updateId = _this$state.updateId;
          _this.setState(generateCategoricalChart_objectSpread({
            legendBBox: box
          }, updateStateOfAxisMapsOffsetAndStackGroups({
            props: _this.props,
            dataStartIndex: dataStartIndex,
            dataEndIndex: dataEndIndex,
            updateId: updateId
          }, generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, _this.state), {}, {
            legendBBox: box
          }))));
        }
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleReceiveSyncEvent", function (cId, chartId, data) {
        var syncId = _this.props.syncId;
        if (syncId === cId && chartId !== _this.uniqueChartId) {
          _this.clearDeferId();
          _this.deferId = defer && defer(_this.applySyncEvent.bind(generateCategoricalChart_assertThisInitialized(_this), data));
        }
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleBrushChange", function (_ref9) {
        var startIndex = _ref9.startIndex,
          endIndex = _ref9.endIndex;
        // Only trigger changes if the extents of the brush have actually changed
        if (startIndex !== _this.state.dataStartIndex || endIndex !== _this.state.dataEndIndex) {
          var updateId = _this.state.updateId;
          _this.setState(function () {
            return generateCategoricalChart_objectSpread({
              dataStartIndex: startIndex,
              dataEndIndex: endIndex
            }, updateStateOfAxisMapsOffsetAndStackGroups({
              props: _this.props,
              dataStartIndex: startIndex,
              dataEndIndex: endIndex,
              updateId: updateId
            }, _this.state));
          });
          _this.triggerSyncEvent({
            dataStartIndex: startIndex,
            dataEndIndex: endIndex
          });
        }
      });
      /**
       * The handler of mouse entering chart
       * @param  {Object} e              Event object
       * @return {Null}                  null
       */
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleMouseEnter", function (e) {
        var onMouseEnter = _this.props.onMouseEnter;
        var mouse = _this.getMouseInfo(e);
        if (mouse) {
          var _nextState = generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, mouse), {}, {
            isTooltipActive: true
          });
          _this.setState(_nextState);
          _this.triggerSyncEvent(_nextState);
          if (isFunction_default()(onMouseEnter)) {
            onMouseEnter(_nextState, e);
          }
        }
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "triggeredAfterMouseMove", function (e) {
        var onMouseMove = _this.props.onMouseMove;
        var mouse = _this.getMouseInfo(e);
        var nextState = mouse ? generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, mouse), {}, {
          isTooltipActive: true
        }) : {
          isTooltipActive: false
        };
        _this.setState(nextState);
        _this.triggerSyncEvent(nextState);
        if (isFunction_default()(onMouseMove)) {
          onMouseMove(nextState, e);
        }
      });
      /**
       * The handler of mouse entering a scatter
       * @param {Object} el The active scatter
       * @return {Object} no return
       */
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleItemMouseEnter", function (el) {
        _this.setState(function () {
          return {
            isTooltipActive: true,
            activeItem: el,
            activePayload: el.tooltipPayload,
            activeCoordinate: el.tooltipPosition || {
              x: el.cx,
              y: el.cy
            }
          };
        });
      });
      /**
       * The handler of mouse leaving a scatter
       * @return {Object} no return
       */
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleItemMouseLeave", function () {
        _this.setState(function () {
          return {
            isTooltipActive: false
          };
        });
      });
      /**
       * The handler of mouse moving in chart
       * @param  {Object} e        Event object
       * @return {Null} no return
       */
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleMouseMove", function (e) {
        if (e && isFunction_default()(e.persist)) {
          e.persist();
        }
        _this.triggeredAfterMouseMove(e);
      });
      /**
       * The handler if mouse leaving chart
       * @param {Object} e Event object
       * @return {Null} no return
       */
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleMouseLeave", function (e) {
        var onMouseLeave = _this.props.onMouseLeave;
        var nextState = {
          isTooltipActive: false
        };
        _this.setState(nextState);
        _this.triggerSyncEvent(nextState);
        if (isFunction_default()(onMouseLeave)) {
          onMouseLeave(nextState, e);
        }
        _this.cancelThrottledTriggerAfterMouseMove();
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleOuterEvent", function (e) {
        var eventName = getReactEventByType(e);
        var event = get_default()(_this.props, "".concat(eventName));
        if (eventName && isFunction_default()(event)) {
          var mouse;
          if (/.*touch.*/i.test(eventName)) {
            mouse = _this.getMouseInfo(e.changedTouches[0]);
          } else {
            mouse = _this.getMouseInfo(e);
          }
          var handler = event;

          // eslint-disable-next-line @typescript-eslint/ban-ts-comment
          // @ts-ignore
          handler(mouse, e);
        }
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleClick", function (e) {
        var onClick = _this.props.onClick;
        var mouse = _this.getMouseInfo(e);
        if (mouse) {
          var _nextState2 = generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, mouse), {}, {
            isTooltipActive: true
          });
          _this.setState(_nextState2);
          _this.triggerSyncEvent(_nextState2);
          if (isFunction_default()(onClick)) {
            onClick(_nextState2, e);
          }
        }
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleMouseDown", function (e) {
        var onMouseDown = _this.props.onMouseDown;
        if (isFunction_default()(onMouseDown)) {
          var _nextState3 = _this.getMouseInfo(e);
          onMouseDown(_nextState3, e);
        }
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleMouseUp", function (e) {
        var onMouseUp = _this.props.onMouseUp;
        if (isFunction_default()(onMouseUp)) {
          var _nextState4 = _this.getMouseInfo(e);
          onMouseUp(_nextState4, e);
        }
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleTouchMove", function (e) {
        if (e.changedTouches != null && e.changedTouches.length > 0) {
          _this.handleMouseMove(e.changedTouches[0]);
        }
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleTouchStart", function (e) {
        if (e.changedTouches != null && e.changedTouches.length > 0) {
          _this.handleMouseDown(e.changedTouches[0]);
        }
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "handleTouchEnd", function (e) {
        if (e.changedTouches != null && e.changedTouches.length > 0) {
          _this.handleMouseUp(e.changedTouches[0]);
        }
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "verticalCoordinatesGenerator", function (_ref10) {
        var xAxis = _ref10.xAxis,
          width = _ref10.width,
          height = _ref10.height,
          offset = _ref10.offset;
        return getCoordinatesOfGrid(getTicks(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, CartesianAxis.defaultProps), xAxis), {}, {
          ticks: getTicksOfAxis(xAxis, true),
          viewBox: {
            x: 0,
            y: 0,
            width: width,
            height: height
          }
        })), offset.left, offset.left + offset.width);
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "horizontalCoordinatesGenerator", function (_ref11) {
        var yAxis = _ref11.yAxis,
          width = _ref11.width,
          height = _ref11.height,
          offset = _ref11.offset;
        return getCoordinatesOfGrid(getTicks(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, CartesianAxis.defaultProps), yAxis), {}, {
          ticks: getTicksOfAxis(yAxis, true),
          viewBox: {
            x: 0,
            y: 0,
            width: width,
            height: height
          }
        })), offset.top, offset.top + offset.height);
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "axesTicksGenerator", function (axis) {
        return getTicksOfAxis(axis, true);
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderCursor", function (element) {
        var _this$state2 = _this.state,
          isTooltipActive = _this$state2.isTooltipActive,
          activeCoordinate = _this$state2.activeCoordinate,
          activePayload = _this$state2.activePayload,
          offset = _this$state2.offset,
          activeTooltipIndex = _this$state2.activeTooltipIndex;
        var tooltipEventType = _this.getTooltipEventType();
        if (!element || !element.props.cursor || !isTooltipActive || !activeCoordinate || chartName !== 'ScatterChart' && tooltipEventType !== 'axis') {
          return null;
        }
        var layout = _this.props.layout;
        var restProps;
        var cursorComp = Curve;
        if (chartName === 'ScatterChart') {
          restProps = activeCoordinate;
          cursorComp = Cross;
        } else if (chartName === 'BarChart') {
          restProps = _this.getCursorRectangle();
          cursorComp = Rectangle;
        } else if (layout === 'radial') {
          var _this$getCursorPoints = _this.getCursorPoints(),
            cx = _this$getCursorPoints.cx,
            cy = _this$getCursorPoints.cy,
            radius = _this$getCursorPoints.radius,
            startAngle = _this$getCursorPoints.startAngle,
            endAngle = _this$getCursorPoints.endAngle;
          restProps = {
            cx: cx,
            cy: cy,
            startAngle: startAngle,
            endAngle: endAngle,
            innerRadius: radius,
            outerRadius: radius
          };
          cursorComp = Sector;
        } else {
          restProps = {
            points: _this.getCursorPoints()
          };
          cursorComp = Curve;
        }
        var key = element.key || '_recharts-cursor';
        var cursorProps = generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({
          stroke: '#ccc',
          pointerEvents: 'none'
        }, offset), restProps), filterProps(element.props.cursor)), {}, {
          payload: activePayload,
          payloadIndex: activeTooltipIndex,
          key: key,
          className: 'recharts-tooltip-cursor'
        });
        return /*#__PURE__*/(0,react.isValidElement)(element.props.cursor) ? /*#__PURE__*/(0,react.cloneElement)(element.props.cursor, cursorProps) : /*#__PURE__*/(0,react.createElement)(cursorComp, cursorProps);
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderPolarAxis", function (element, displayName, index) {
        var axisType = get_default()(element, 'type.axisType');
        var axisMap = get_default()(_this.state, "".concat(axisType, "Map"));
        var axisOption = axisMap && axisMap[element.props["".concat(axisType, "Id")]];
        return /*#__PURE__*/(0,react.cloneElement)(element, generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, axisOption), {}, {
          className: axisType,
          key: element.key || "".concat(displayName, "-").concat(index),
          ticks: getTicksOfAxis(axisOption, true)
        }));
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderXAxis", function (element, displayName, index) {
        var xAxisMap = _this.state.xAxisMap;
        var axisObj = xAxisMap[element.props.xAxisId];
        return _this.renderAxis(axisObj, element, displayName, index);
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderYAxis", function (element, displayName, index) {
        var yAxisMap = _this.state.yAxisMap;
        var axisObj = yAxisMap[element.props.yAxisId];
        return _this.renderAxis(axisObj, element, displayName, index);
      });
      /**
       * Draw grid
       * @param  {ReactElement} element the grid item
       * @return {ReactElement} The instance of grid
       */
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderGrid", function (element) {
        var _this$state3 = _this.state,
          xAxisMap = _this$state3.xAxisMap,
          yAxisMap = _this$state3.yAxisMap,
          offset = _this$state3.offset;
        var _this$props = _this.props,
          width = _this$props.width,
          height = _this$props.height;
        var xAxis = getAnyElementOfObject(xAxisMap);
        var yAxisWithFiniteDomain = find_default()(yAxisMap, function (axis) {
          return every_default()(axis.domain, isFinit);
        });
        var yAxis = yAxisWithFiniteDomain || getAnyElementOfObject(yAxisMap);
        var props = element.props || {};
        return /*#__PURE__*/(0,react.cloneElement)(element, {
          key: element.key || 'grid',
          x: isNumber(props.x) ? props.x : offset.left,
          y: isNumber(props.y) ? props.y : offset.top,
          width: isNumber(props.width) ? props.width : offset.width,
          height: isNumber(props.height) ? props.height : offset.height,
          xAxis: xAxis,
          yAxis: yAxis,
          offset: offset,
          chartWidth: width,
          chartHeight: height,
          verticalCoordinatesGenerator: props.verticalCoordinatesGenerator || _this.verticalCoordinatesGenerator,
          horizontalCoordinatesGenerator: props.horizontalCoordinatesGenerator || _this.horizontalCoordinatesGenerator
        });
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderPolarGrid", function (element) {
        var _element$props = element.props,
          radialLines = _element$props.radialLines,
          polarAngles = _element$props.polarAngles,
          polarRadius = _element$props.polarRadius;
        var _this$state4 = _this.state,
          radiusAxisMap = _this$state4.radiusAxisMap,
          angleAxisMap = _this$state4.angleAxisMap;
        var radiusAxis = getAnyElementOfObject(radiusAxisMap);
        var angleAxis = getAnyElementOfObject(angleAxisMap);
        var cx = angleAxis.cx,
          cy = angleAxis.cy,
          innerRadius = angleAxis.innerRadius,
          outerRadius = angleAxis.outerRadius;
        return /*#__PURE__*/(0,react.cloneElement)(element, {
          polarAngles: isArray_default()(polarAngles) ? polarAngles : getTicksOfAxis(angleAxis, true).map(function (entry) {
            return entry.coordinate;
          }),
          polarRadius: isArray_default()(polarRadius) ? polarRadius : getTicksOfAxis(radiusAxis, true).map(function (entry) {
            return entry.coordinate;
          }),
          cx: cx,
          cy: cy,
          innerRadius: innerRadius,
          outerRadius: outerRadius,
          key: element.key || 'polar-grid',
          radialLines: radialLines
        });
      });
      /**
       * Draw legend
       * @return {ReactElement}            The instance of Legend
       */
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderLegend", function () {
        var formattedGraphicalItems = _this.state.formattedGraphicalItems;
        var _this$props2 = _this.props,
          children = _this$props2.children,
          width = _this$props2.width,
          height = _this$props2.height;
        var margin = _this.props.margin || {};
        var legendWidth = width - (margin.left || 0) - (margin.right || 0);
        var props = getLegendProps({
          children: children,
          formattedGraphicalItems: formattedGraphicalItems,
          legendWidth: legendWidth,
          legendContent: legendContent
        });
        if (!props) {
          return null;
        }
        var item = props.item,
          otherProps = generateCategoricalChart_objectWithoutProperties(props, generateCategoricalChart_excluded);
        return /*#__PURE__*/(0,react.cloneElement)(item, generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, otherProps), {}, {
          chartWidth: width,
          chartHeight: height,
          margin: margin,
          ref: function ref(legend) {
            _this.legendInstance = legend;
          },
          onBBoxUpdate: _this.handleLegendBBoxUpdate
        }));
      });
      /**
       * Draw Tooltip
       * @return {ReactElement}  The instance of Tooltip
       */
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderTooltip", function () {
        var children = _this.props.children;
        var tooltipItem = findChildByType(children, component_Tooltip_Tooltip);
        if (!tooltipItem) {
          return null;
        }
        var _this$state5 = _this.state,
          isTooltipActive = _this$state5.isTooltipActive,
          activeCoordinate = _this$state5.activeCoordinate,
          activePayload = _this$state5.activePayload,
          activeLabel = _this$state5.activeLabel,
          offset = _this$state5.offset;
        return /*#__PURE__*/(0,react.cloneElement)(tooltipItem, {
          viewBox: generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, offset), {}, {
            x: offset.left,
            y: offset.top
          }),
          active: isTooltipActive,
          label: activeLabel,
          payload: isTooltipActive ? activePayload : [],
          coordinate: activeCoordinate
        });
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderBrush", function (element) {
        var _this$props3 = _this.props,
          margin = _this$props3.margin,
          data = _this$props3.data;
        var _this$state6 = _this.state,
          offset = _this$state6.offset,
          dataStartIndex = _this$state6.dataStartIndex,
          dataEndIndex = _this$state6.dataEndIndex,
          updateId = _this$state6.updateId;

        // TODO: update brush when children update
        return /*#__PURE__*/(0,react.cloneElement)(element, {
          key: element.key || '_recharts-brush',
          onChange: combineEventHandlers(_this.handleBrushChange, null, element.props.onChange),
          data: data,
          x: isNumber(element.props.x) ? element.props.x : offset.left,
          y: isNumber(element.props.y) ? element.props.y : offset.top + offset.height + offset.brushBottom - (margin.bottom || 0),
          width: isNumber(element.props.width) ? element.props.width : offset.width,
          startIndex: dataStartIndex,
          endIndex: dataEndIndex,
          updateId: "brush-".concat(updateId)
        });
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderReferenceElement", function (element, displayName, index) {
        if (!element) {
          return null;
        }
        var _assertThisInitialize = generateCategoricalChart_assertThisInitialized(_this),
          clipPathId = _assertThisInitialize.clipPathId;
        var _this$state7 = _this.state,
          xAxisMap = _this$state7.xAxisMap,
          yAxisMap = _this$state7.yAxisMap,
          offset = _this$state7.offset;
        var _element$props2 = element.props,
          xAxisId = _element$props2.xAxisId,
          yAxisId = _element$props2.yAxisId;
        return /*#__PURE__*/(0,react.cloneElement)(element, {
          key: element.key || "".concat(displayName, "-").concat(index),
          xAxis: xAxisMap[xAxisId],
          yAxis: yAxisMap[yAxisId],
          viewBox: {
            x: offset.left,
            y: offset.top,
            width: offset.width,
            height: offset.height
          },
          clipPathId: clipPathId
        });
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderActivePoints", function (_ref12) {
        var item = _ref12.item,
          activePoint = _ref12.activePoint,
          basePoint = _ref12.basePoint,
          childIndex = _ref12.childIndex,
          isRange = _ref12.isRange;
        var result = [];
        var key = item.props.key;
        var _item$item$props = item.item.props,
          activeDot = _item$item$props.activeDot,
          dataKey = _item$item$props.dataKey;
        var dotProps = generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({
          index: childIndex,
          dataKey: dataKey,
          cx: activePoint.x,
          cy: activePoint.y,
          r: 4,
          fill: getMainColorOfGraphicItem(item.item),
          strokeWidth: 2,
          stroke: '#fff',
          payload: activePoint.payload,
          value: activePoint.value,
          key: "".concat(key, "-activePoint-").concat(childIndex)
        }, filterProps(activeDot)), adaptEventHandlers(activeDot));
        result.push(CategoricalChartWrapper.renderActiveDot(activeDot, dotProps));
        if (basePoint) {
          result.push(CategoricalChartWrapper.renderActiveDot(activeDot, generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, dotProps), {}, {
            cx: basePoint.x,
            cy: basePoint.y,
            key: "".concat(key, "-basePoint-").concat(childIndex)
          })));
        } else if (isRange) {
          result.push(null);
        }
        return result;
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderGraphicChild", function (element, displayName, index) {
        var item = _this.filterFormatItem(element, displayName, index);
        if (!item) {
          return null;
        }
        var tooltipEventType = _this.getTooltipEventType();
        var _this$state8 = _this.state,
          isTooltipActive = _this$state8.isTooltipActive,
          tooltipAxis = _this$state8.tooltipAxis,
          activeTooltipIndex = _this$state8.activeTooltipIndex,
          activeLabel = _this$state8.activeLabel;
        var children = _this.props.children;
        var tooltipItem = findChildByType(children, component_Tooltip_Tooltip);
        var _item$props2 = item.props,
          points = _item$props2.points,
          isRange = _item$props2.isRange,
          baseLine = _item$props2.baseLine;
        var _item$item$props2 = item.item.props,
          activeDot = _item$item$props2.activeDot,
          hide = _item$item$props2.hide;
        var hasActive = !hide && isTooltipActive && tooltipItem && activeDot && activeTooltipIndex >= 0;
        var itemEvents = {};
        if (tooltipEventType !== 'axis' && tooltipItem && tooltipItem.props.trigger === 'click') {
          itemEvents = {
            onClick: combineEventHandlers(_this.handleItemMouseEnter, null, element.props.onCLick)
          };
        } else if (tooltipEventType !== 'axis') {
          itemEvents = {
            onMouseLeave: combineEventHandlers(_this.handleItemMouseLeave, null, element.props.onMouseLeave),
            onMouseEnter: combineEventHandlers(_this.handleItemMouseEnter, null, element.props.onMouseEnter)
          };
        }
        var graphicalItem = /*#__PURE__*/(0,react.cloneElement)(element, generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, item.props), itemEvents));
        function findWithPayload(entry) {
          // TODO needs to verify dataKey is Function
          return typeof tooltipAxis.dataKey === 'function' ? tooltipAxis.dataKey(entry.payload) : null;
        }
        if (hasActive) {
          var activePoint, basePoint;
          if (tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory) {
            // number transform to string
            var specifiedKey = typeof tooltipAxis.dataKey === 'function' ? findWithPayload : 'payload.'.concat(tooltipAxis.dataKey.toString());
            activePoint = findEntryInArray(points, specifiedKey, activeLabel);
            basePoint = isRange && baseLine && findEntryInArray(baseLine, specifiedKey, activeLabel);
          } else {
            activePoint = points[activeTooltipIndex];
            basePoint = isRange && baseLine && baseLine[activeTooltipIndex];
          }
          if (!isNil_default()(activePoint)) {
            return [graphicalItem].concat(generateCategoricalChart_toConsumableArray(_this.renderActivePoints({
              item: item,
              activePoint: activePoint,
              basePoint: basePoint,
              childIndex: activeTooltipIndex,
              isRange: isRange
            })));
          }
        }
        if (isRange) {
          return [graphicalItem, null, null];
        }
        return [graphicalItem, null];
      });
      generateCategoricalChart_defineProperty(generateCategoricalChart_assertThisInitialized(_this), "renderCustomized", function (element, displayName, index) {
        return /*#__PURE__*/(0,react.cloneElement)(element, generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({
          key: "recharts-customized-".concat(index)
        }, _this.props), _this.state));
      });
      _this.uniqueChartId = isNil_default()(_props.id) ? uniqueId('recharts') : _props.id;
      _this.clipPathId = "".concat(_this.uniqueChartId, "-clip");
      if (_props.throttleDelay) {
        _this.triggeredAfterMouseMove = throttle_default()(_this.triggeredAfterMouseMove, _props.throttleDelay);
      }
      _this.state = {};
      return _this;
    }
    generateCategoricalChart_createClass(CategoricalChartWrapper, [{
      key: "componentDidMount",
      value: function componentDidMount() {
        var _this$props$margin$le, _this$props$margin$to;
        if (!isNil_default()(this.props.syncId)) {
          this.addListener();
        }
        this.accessibilityManager.setDetails({
          container: this.container,
          offset: {
            left: (_this$props$margin$le = this.props.margin.left) !== null && _this$props$margin$le !== void 0 ? _this$props$margin$le : 0,
            top: (_this$props$margin$to = this.props.margin.top) !== null && _this$props$margin$to !== void 0 ? _this$props$margin$to : 0
          },
          coordinateList: this.state.tooltipTicks,
          mouseHandlerCallback: this.handleMouseMove,
          layout: this.props.layout
        });
      }
    }, {
      key: "getSnapshotBeforeUpdate",
      value: function getSnapshotBeforeUpdate(prevProps, prevState) {
        if (!this.props.accessibilityLayer) {
          return null;
        }
        if (this.state.tooltipTicks !== prevState.tooltipTicks) {
          this.accessibilityManager.setDetails({
            coordinateList: this.state.tooltipTicks
          });
        }
        if (this.props.layout !== prevProps.layout) {
          this.accessibilityManager.setDetails({
            layout: this.props.layout
          });
        }
        if (this.props.margin !== prevProps.margin) {
          var _this$props$margin$le2, _this$props$margin$to2;
          this.accessibilityManager.setDetails({
            offset: {
              left: (_this$props$margin$le2 = this.props.margin.left) !== null && _this$props$margin$le2 !== void 0 ? _this$props$margin$le2 : 0,
              top: (_this$props$margin$to2 = this.props.margin.top) !== null && _this$props$margin$to2 !== void 0 ? _this$props$margin$to2 : 0
            }
          });
        }

        // Something has to be returned for getSnapshotBeforeUpdate
        return null;
      }
    }, {
      key: "componentDidUpdate",
      value: function componentDidUpdate(prevProps) {
        // add syncId
        if (isNil_default()(prevProps.syncId) && !isNil_default()(this.props.syncId)) {
          this.addListener();
        }
        // remove syncId
        if (!isNil_default()(prevProps.syncId) && isNil_default()(this.props.syncId)) {
          this.removeListener();
        }
      }
    }, {
      key: "componentWillUnmount",
      value: function componentWillUnmount() {
        this.clearDeferId();
        if (!isNil_default()(this.props.syncId)) {
          this.removeListener();
        }
        this.cancelThrottledTriggerAfterMouseMove();
      }
    }, {
      key: "cancelThrottledTriggerAfterMouseMove",
      value: function cancelThrottledTriggerAfterMouseMove() {
        if (typeof this.triggeredAfterMouseMove.cancel === 'function') {
          this.triggeredAfterMouseMove.cancel();
        }
      }
    }, {
      key: "getTooltipEventType",
      value: function getTooltipEventType() {
        var tooltipItem = findChildByType(this.props.children, component_Tooltip_Tooltip);
        if (tooltipItem && isBoolean_default()(tooltipItem.props.shared)) {
          var eventType = tooltipItem.props.shared ? 'axis' : 'item';
          return validateTooltipEventTypes.indexOf(eventType) >= 0 ? eventType : defaultTooltipEventType;
        }
        return defaultTooltipEventType;
      }

      /**
       * Get the information of mouse in chart, return null when the mouse is not in the chart
       * @param  {Object} event    The event object
       * @return {Object}          Mouse data
       */
    }, {
      key: "getMouseInfo",
      value: function getMouseInfo(event) {
        if (!this.container) {
          return null;
        }
        var containerOffset = DOMUtils_getOffset(this.container);
        var e = calculateChartCoordinate(event, containerOffset);
        var rangeObj = this.inRange(e.chartX, e.chartY);
        if (!rangeObj) {
          return null;
        }
        var _this$state9 = this.state,
          xAxisMap = _this$state9.xAxisMap,
          yAxisMap = _this$state9.yAxisMap;
        var tooltipEventType = this.getTooltipEventType();
        if (tooltipEventType !== 'axis' && xAxisMap && yAxisMap) {
          var xScale = getAnyElementOfObject(xAxisMap).scale;
          var yScale = getAnyElementOfObject(yAxisMap).scale;
          var xValue = xScale && xScale.invert ? xScale.invert(e.chartX) : null;
          var yValue = yScale && yScale.invert ? yScale.invert(e.chartY) : null;
          return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, e), {}, {
            xValue: xValue,
            yValue: yValue
          });
        }
        var toolTipData = getTooltipData(this.state, this.props.data, this.props.layout, rangeObj);
        if (toolTipData) {
          return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, e), toolTipData);
        }
        return null;
      }
    }, {
      key: "getCursorRectangle",
      value: function getCursorRectangle() {
        var layout = this.props.layout;
        var _this$state10 = this.state,
          activeCoordinate = _this$state10.activeCoordinate,
          offset = _this$state10.offset,
          tooltipAxisBandSize = _this$state10.tooltipAxisBandSize;
        var halfSize = tooltipAxisBandSize / 2;
        return {
          stroke: 'none',
          fill: '#ccc',
          x: layout === 'horizontal' ? activeCoordinate.x - halfSize : offset.left + 0.5,
          y: layout === 'horizontal' ? offset.top + 0.5 : activeCoordinate.y - halfSize,
          width: layout === 'horizontal' ? tooltipAxisBandSize : offset.width - 1,
          height: layout === 'horizontal' ? offset.height - 1 : tooltipAxisBandSize
        };
      }
    }, {
      key: "getCursorPoints",
      value: function getCursorPoints() {
        var layout = this.props.layout;
        var _this$state11 = this.state,
          activeCoordinate = _this$state11.activeCoordinate,
          offset = _this$state11.offset;
        var x1, y1, x2, y2;
        if (layout === 'horizontal') {
          x1 = activeCoordinate.x;
          x2 = x1;
          y1 = offset.top;
          y2 = offset.top + offset.height;
        } else if (layout === 'vertical') {
          y1 = activeCoordinate.y;
          y2 = y1;
          x1 = offset.left;
          x2 = offset.left + offset.width;
        } else if (!isNil_default()(activeCoordinate.cx) || !isNil_default()(activeCoordinate.cy)) {
          if (layout === 'centric') {
            var cx = activeCoordinate.cx,
              cy = activeCoordinate.cy,
              innerRadius = activeCoordinate.innerRadius,
              outerRadius = activeCoordinate.outerRadius,
              angle = activeCoordinate.angle;
            var innerPoint = polarToCartesian(cx, cy, innerRadius, angle);
            var outerPoint = polarToCartesian(cx, cy, outerRadius, angle);
            x1 = innerPoint.x;
            y1 = innerPoint.y;
            x2 = outerPoint.x;
            y2 = outerPoint.y;
          } else {
            var _cx = activeCoordinate.cx,
              _cy = activeCoordinate.cy,
              radius = activeCoordinate.radius,
              startAngle = activeCoordinate.startAngle,
              endAngle = activeCoordinate.endAngle;
            var startPoint = polarToCartesian(_cx, _cy, radius, startAngle);
            var endPoint = polarToCartesian(_cx, _cy, radius, endAngle);
            return {
              points: [startPoint, endPoint],
              cx: _cx,
              cy: _cy,
              radius: radius,
              startAngle: startAngle,
              endAngle: endAngle
            };
          }
        }
        return [{
          x: x1,
          y: y1
        }, {
          x: x2,
          y: y2
        }];
      }
    }, {
      key: "inRange",
      value: function inRange(x, y) {
        var layout = this.props.layout;
        if (layout === 'horizontal' || layout === 'vertical') {
          var offset = this.state.offset;
          var isInRange = x >= offset.left && x <= offset.left + offset.width && y >= offset.top && y <= offset.top + offset.height;
          return isInRange ? {
            x: x,
            y: y
          } : null;
        }
        var _this$state12 = this.state,
          angleAxisMap = _this$state12.angleAxisMap,
          radiusAxisMap = _this$state12.radiusAxisMap;
        if (angleAxisMap && radiusAxisMap) {
          var angleAxis = getAnyElementOfObject(angleAxisMap);
          return inRangeOfSector({
            x: x,
            y: y
          }, angleAxis);
        }
        return null;
      }
    }, {
      key: "parseEventsOfWrapper",
      value: function parseEventsOfWrapper() {
        var children = this.props.children;
        var tooltipEventType = this.getTooltipEventType();
        var tooltipItem = findChildByType(children, component_Tooltip_Tooltip);
        var tooltipEvents = {};
        if (tooltipItem && tooltipEventType === 'axis') {
          if (tooltipItem.props.trigger === 'click') {
            tooltipEvents = {
              onClick: this.handleClick
            };
          } else {
            tooltipEvents = {
              onMouseEnter: this.handleMouseEnter,
              onMouseMove: this.handleMouseMove,
              onMouseLeave: this.handleMouseLeave,
              onTouchMove: this.handleTouchMove,
              onTouchStart: this.handleTouchStart,
              onTouchEnd: this.handleTouchEnd
            };
          }
        }
        var outerEvents = adaptEventHandlers(this.props, this.handleOuterEvent);
        return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, outerEvents), tooltipEvents);
      }

      /* eslint-disable  no-underscore-dangle */
    }, {
      key: "addListener",
      value: function addListener() {
        eventCenter.on(SYNC_EVENT, this.handleReceiveSyncEvent);
        if (eventCenter.setMaxListeners && eventCenter._maxListeners) {
          eventCenter.setMaxListeners(eventCenter._maxListeners + 1);
        }
      }
    }, {
      key: "removeListener",
      value: function removeListener() {
        eventCenter.removeListener(SYNC_EVENT, this.handleReceiveSyncEvent);
        if (eventCenter.setMaxListeners && eventCenter._maxListeners) {
          eventCenter.setMaxListeners(eventCenter._maxListeners - 1);
        }
      }
    }, {
      key: "triggerSyncEvent",
      value: function triggerSyncEvent(data) {
        var syncId = this.props.syncId;
        if (!isNil_default()(syncId)) {
          eventCenter.emit(SYNC_EVENT, syncId, this.uniqueChartId, data);
        }
      }
    }, {
      key: "applySyncEvent",
      value: function applySyncEvent(data) {
        var _this$props4 = this.props,
          layout = _this$props4.layout,
          syncMethod = _this$props4.syncMethod;
        var updateId = this.state.updateId;
        var dataStartIndex = data.dataStartIndex,
          dataEndIndex = data.dataEndIndex;
        if (!isNil_default()(data.dataStartIndex) || !isNil_default()(data.dataEndIndex)) {
          this.setState(generateCategoricalChart_objectSpread({
            dataStartIndex: dataStartIndex,
            dataEndIndex: dataEndIndex
          }, updateStateOfAxisMapsOffsetAndStackGroups({
            props: this.props,
            dataStartIndex: dataStartIndex,
            dataEndIndex: dataEndIndex,
            updateId: updateId
          }, this.state)));
        } else if (!isNil_default()(data.activeTooltipIndex)) {
          var chartX = data.chartX,
            chartY = data.chartY;
          var activeTooltipIndex = data.activeTooltipIndex;
          var _this$state13 = this.state,
            offset = _this$state13.offset,
            tooltipTicks = _this$state13.tooltipTicks;
          if (!offset) {
            return;
          }
          if (typeof syncMethod === 'function') {
            // Call a callback function. If there is an application specific algorithm
            activeTooltipIndex = syncMethod(tooltipTicks, data);
          } else if (syncMethod === 'value') {
            // Set activeTooltipIndex to the index with the same value as data.activeLabel
            // For loop instead of findIndex because the latter is very slow in some browsers
            activeTooltipIndex = -1; // in case we cannot find the element
            for (var i = 0; i < tooltipTicks.length; i++) {
              if (tooltipTicks[i].value === data.activeLabel) {
                activeTooltipIndex = i;
                break;
              }
            }
          }
          var viewBox = generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, offset), {}, {
            x: offset.left,
            y: offset.top
          });
          // When a categorical chart is combined with another chart, the value of chartX
          // and chartY may beyond the boundaries.
          var validateChartX = Math.min(chartX, viewBox.x + viewBox.width);
          var validateChartY = Math.min(chartY, viewBox.y + viewBox.height);
          var activeLabel = tooltipTicks[activeTooltipIndex] && tooltipTicks[activeTooltipIndex].value;
          var activePayload = getTooltipContent(this.state, this.props.data, activeTooltipIndex);
          var activeCoordinate = tooltipTicks[activeTooltipIndex] ? {
            x: layout === 'horizontal' ? tooltipTicks[activeTooltipIndex].coordinate : validateChartX,
            y: layout === 'horizontal' ? validateChartY : tooltipTicks[activeTooltipIndex].coordinate
          } : originCoordinate;
          this.setState(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, data), {}, {
            activeLabel: activeLabel,
            activeCoordinate: activeCoordinate,
            activePayload: activePayload,
            activeTooltipIndex: activeTooltipIndex
          }));
        } else {
          this.setState(data);
        }
      }
    }, {
      key: "filterFormatItem",
      value: function filterFormatItem(item, displayName, childIndex) {
        var formattedGraphicalItems = this.state.formattedGraphicalItems;
        for (var i = 0, len = formattedGraphicalItems.length; i < len; i++) {
          var entry = formattedGraphicalItems[i];
          if (entry.item === item || entry.props.key === item.key || displayName === getDisplayName(entry.item.type) && childIndex === entry.childIndex) {
            return entry;
          }
        }
        return null;
      }
    }, {
      key: "renderAxis",
      value:
      /**
       * Draw axis
       * @param {Object} axisOptions The options of axis
       * @param {Object} element      The axis element
       * @param {String} displayName  The display name of axis
       * @param {Number} index        The index of element
       * @return {ReactElement}       The instance of x-axes
       */
      function renderAxis(axisOptions, element, displayName, index) {
        var _this$props5 = this.props,
          width = _this$props5.width,
          height = _this$props5.height;
        return /*#__PURE__*/react.createElement(CartesianAxis, generateCategoricalChart_extends({}, axisOptions, {
          className: classnames_default()("recharts-".concat(axisOptions.axisType, " ").concat(axisOptions.axisType), axisOptions.className),
          key: element.key || "".concat(displayName, "-").concat(index),
          viewBox: {
            x: 0,
            y: 0,
            width: width,
            height: height
          },
          ticksGenerator: this.axesTicksGenerator
        }));
      }
    }, {
      key: "renderClipPath",
      value: function renderClipPath() {
        var clipPathId = this.clipPathId;
        var _this$state$offset = this.state.offset,
          left = _this$state$offset.left,
          top = _this$state$offset.top,
          height = _this$state$offset.height,
          width = _this$state$offset.width;
        return /*#__PURE__*/react.createElement("defs", null, /*#__PURE__*/react.createElement("clipPath", {
          id: clipPathId
        }, /*#__PURE__*/react.createElement("rect", {
          x: left,
          y: top,
          height: height,
          width: width
        })));
      }
    }, {
      key: "getXScales",
      value: function getXScales() {
        var xAxisMap = this.state.xAxisMap;
        return xAxisMap ? Object.entries(xAxisMap).reduce(function (res, _ref13) {
          var _ref14 = generateCategoricalChart_slicedToArray(_ref13, 2),
            axisId = _ref14[0],
            axisProps = _ref14[1];
          return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, res), {}, generateCategoricalChart_defineProperty({}, axisId, axisProps.scale));
        }, {}) : null;
      }
    }, {
      key: "getYScales",
      value: function getYScales() {
        var yAxisMap = this.state.yAxisMap;
        return yAxisMap ? Object.entries(yAxisMap).reduce(function (res, _ref15) {
          var _ref16 = generateCategoricalChart_slicedToArray(_ref15, 2),
            axisId = _ref16[0],
            axisProps = _ref16[1];
          return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, res), {}, generateCategoricalChart_defineProperty({}, axisId, axisProps.scale));
        }, {}) : null;
      }
    }, {
      key: "getXScaleByAxisId",
      value: function getXScaleByAxisId(axisId) {
        var _this$state$xAxisMap, _this$state$xAxisMap$;
        return (_this$state$xAxisMap = this.state.xAxisMap) === null || _this$state$xAxisMap === void 0 ? void 0 : (_this$state$xAxisMap$ = _this$state$xAxisMap[axisId]) === null || _this$state$xAxisMap$ === void 0 ? void 0 : _this$state$xAxisMap$.scale;
      }
    }, {
      key: "getYScaleByAxisId",
      value: function getYScaleByAxisId(axisId) {
        var _this$state$yAxisMap, _this$state$yAxisMap$;
        return (_this$state$yAxisMap = this.state.yAxisMap) === null || _this$state$yAxisMap === void 0 ? void 0 : (_this$state$yAxisMap$ = _this$state$yAxisMap[axisId]) === null || _this$state$yAxisMap$ === void 0 ? void 0 : _this$state$yAxisMap$.scale;
      }
    }, {
      key: "getItemByXY",
      value: function getItemByXY(chartXY) {
        var formattedGraphicalItems = this.state.formattedGraphicalItems;
        if (formattedGraphicalItems && formattedGraphicalItems.length) {
          for (var i = 0, len = formattedGraphicalItems.length; i < len; i++) {
            var graphicalItem = formattedGraphicalItems[i];
            var props = graphicalItem.props,
              item = graphicalItem.item;
            var itemDisplayName = getDisplayName(item.type);
            if (itemDisplayName === 'Bar') {
              var activeBarItem = (props.data || []).find(function (entry) {
                return isInRectangle(chartXY, entry);
              });
              if (activeBarItem) {
                return {
                  graphicalItem: graphicalItem,
                  payload: activeBarItem
                };
              }
            } else if (itemDisplayName === 'RadialBar') {
              var _activeBarItem = (props.data || []).find(function (entry) {
                return inRangeOfSector(chartXY, entry);
              });
              if (_activeBarItem) {
                return {
                  graphicalItem: graphicalItem,
                  payload: _activeBarItem
                };
              }
            }
          }
        }
        return null;
      }
    }, {
      key: "render",
      value: function render() {
        var _this2 = this;
        if (!validateWidthHeight(this)) {
          return null;
        }
        var _this$props6 = this.props,
          children = _this$props6.children,
          className = _this$props6.className,
          width = _this$props6.width,
          height = _this$props6.height,
          style = _this$props6.style,
          compact = _this$props6.compact,
          title = _this$props6.title,
          desc = _this$props6.desc,
          others = generateCategoricalChart_objectWithoutProperties(_this$props6, generateCategoricalChart_excluded2);
        var attrs = filterProps(others);
        var map = {
          CartesianGrid: {
            handler: this.renderGrid,
            once: true
          },
          ReferenceArea: {
            handler: this.renderReferenceElement
          },
          ReferenceLine: {
            handler: this.renderReferenceElement
          },
          ReferenceDot: {
            handler: this.renderReferenceElement
          },
          XAxis: {
            handler: this.renderXAxis
          },
          YAxis: {
            handler: this.renderYAxis
          },
          Brush: {
            handler: this.renderBrush,
            once: true
          },
          Bar: {
            handler: this.renderGraphicChild
          },
          Line: {
            handler: this.renderGraphicChild
          },
          Area: {
            handler: this.renderGraphicChild
          },
          Radar: {
            handler: this.renderGraphicChild
          },
          RadialBar: {
            handler: this.renderGraphicChild
          },
          Scatter: {
            handler: this.renderGraphicChild
          },
          Pie: {
            handler: this.renderGraphicChild
          },
          Funnel: {
            handler: this.renderGraphicChild
          },
          Tooltip: {
            handler: this.renderCursor,
            once: true
          },
          PolarGrid: {
            handler: this.renderPolarGrid,
            once: true
          },
          PolarAngleAxis: {
            handler: this.renderPolarAxis
          },
          PolarRadiusAxis: {
            handler: this.renderPolarAxis
          },
          Customized: {
            handler: this.renderCustomized
          }
        };

        // The "compact" mode is mainly used as the panorama within Brush
        if (compact) {
          return /*#__PURE__*/react.createElement(Surface, generateCategoricalChart_extends({}, attrs, {
            width: width,
            height: height,
            title: title,
            desc: desc
          }), this.renderClipPath(), renderByOrder(children, map));
        }
        if (this.props.accessibilityLayer) {
          var _2, _img;
          // Set tabIndex to 0 by default (can be overwritten)
          attrs.tabIndex = (_2 = 0) !== null && _2 !== void 0 ? _2 : this.props.tabIndex;
          // Set role to img by default (can be overwritten)
          attrs.role = (_img = 'img') !== null && _img !== void 0 ? _img : this.props.role;
          attrs.onKeyDown = function (e) {
            _this2.accessibilityManager.keyboardEvent(e);
            // 'onKeyDown' is not currently a supported prop that can be passed through
            // if it's added, this should be added: this.props.onKeyDown(e);
          };

          attrs.onFocus = function () {
            _this2.accessibilityManager.focus();
            // 'onFocus' is not currently a supported prop that can be passed through
            // if it's added, the focus event should be forwarded to the prop
          };
        }

        var events = this.parseEventsOfWrapper();
        return /*#__PURE__*/react.createElement("div", generateCategoricalChart_extends({
          className: classnames_default()('recharts-wrapper', className),
          style: generateCategoricalChart_objectSpread({
            position: 'relative',
            cursor: 'default',
            width: width,
            height: height
          }, style)
        }, events, {
          ref: function ref(node) {
            _this2.container = node;
          },
          role: "region"
        }), /*#__PURE__*/react.createElement(Surface, generateCategoricalChart_extends({}, attrs, {
          width: width,
          height: height,
          title: title,
          desc: desc
        }), this.renderClipPath(), renderByOrder(children, map)), this.renderLegend(), this.renderTooltip());
      }
    }]);
    return CategoricalChartWrapper;
  }(react.Component), generateCategoricalChart_defineProperty(_class, "displayName", chartName), generateCategoricalChart_defineProperty(_class, "defaultProps", generateCategoricalChart_objectSpread({
    layout: 'horizontal',
    stackOffset: 'none',
    barCategoryGap: '10%',
    barGap: 4,
    margin: {
      top: 5,
      right: 5,
      bottom: 5,
      left: 5
    },
    reverseStackOrder: false,
    syncMethod: 'index'
  }, defaultProps)), generateCategoricalChart_defineProperty(_class, "getDerivedStateFromProps", function (nextProps, prevState) {
    var data = nextProps.data,
      children = nextProps.children,
      width = nextProps.width,
      height = nextProps.height,
      layout = nextProps.layout,
      stackOffset = nextProps.stackOffset,
      margin = nextProps.margin;
    if (isNil_default()(prevState.updateId)) {
      var defaultState = createDefaultState(nextProps);
      return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, defaultState), {}, {
        updateId: 0
      }, updateStateOfAxisMapsOffsetAndStackGroups(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({
        props: nextProps
      }, defaultState), {}, {
        updateId: 0
      }), prevState)), {}, {
        prevData: data,
        prevWidth: width,
        prevHeight: height,
        prevLayout: layout,
        prevStackOffset: stackOffset,
        prevMargin: margin,
        prevChildren: children
      });
    }
    if (data !== prevState.prevData || width !== prevState.prevWidth || height !== prevState.prevHeight || layout !== prevState.prevLayout || stackOffset !== prevState.prevStackOffset || !ShallowEqual_shallowEqual(margin, prevState.prevMargin)) {
      var _defaultState = createDefaultState(nextProps);

      // Fixes https://github.com/recharts/recharts/issues/2143
      var keepFromPrevState = {
        // (chartX, chartY) are (0,0) in default state, but we want to keep the last mouse position to avoid
        // any flickering
        chartX: prevState.chartX,
        chartY: prevState.chartY,
        // The tooltip should stay active when it was active in the previous render. If this is not
        // the case, the tooltip disappears and immediately re-appears, causing a flickering effect
        isTooltipActive: prevState.isTooltipActive
      };
      var updatesToState = generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, getTooltipData(prevState, data, layout)), {}, {
        updateId: prevState.updateId + 1
      });
      var newState = generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, _defaultState), keepFromPrevState), updatesToState);
      return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({}, newState), updateStateOfAxisMapsOffsetAndStackGroups(generateCategoricalChart_objectSpread({
        props: nextProps
      }, newState), prevState)), {}, {
        prevData: data,
        prevWidth: width,
        prevHeight: height,
        prevLayout: layout,
        prevStackOffset: stackOffset,
        prevMargin: margin,
        prevChildren: children
      });
    }
    if (!isChildrenEqual(children, prevState.prevChildren)) {
      // update configuration in children
      var hasGlobalData = !isNil_default()(data);
      var newUpdateId = hasGlobalData ? prevState.updateId : prevState.updateId + 1;
      return generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({
        updateId: newUpdateId
      }, updateStateOfAxisMapsOffsetAndStackGroups(generateCategoricalChart_objectSpread(generateCategoricalChart_objectSpread({
        props: nextProps
      }, prevState), {}, {
        updateId: newUpdateId
      }), prevState)), {}, {
        prevChildren: children
      });
    }
    return null;
  }), generateCategoricalChart_defineProperty(_class, "renderActiveDot", function (option, props) {
    var dot;
    if ( /*#__PURE__*/(0,react.isValidElement)(option)) {
      dot = /*#__PURE__*/(0,react.cloneElement)(option, props);
    } else if (isFunction_default()(option)) {
      dot = option(props);
    } else {
      dot = /*#__PURE__*/react.createElement(Dot, props);
    }
    return /*#__PURE__*/react.createElement(Layer, {
      className: "recharts-active-dot",
      key: props.key
    }, dot);
  }), _class;
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/chart/LineChart.js
/**
 * @fileOverview Line Chart
 */





var LineChart = generateCategoricalChart({
  chartName: 'LineChart',
  GraphicalChild: Line,
  axisComponents: [{
    axisType: 'xAxis',
    AxisComp: XAxis
  }, {
    axisType: 'yAxis',
    AxisComp: YAxis
  }],
  formatAxisMap: CartesianUtils_formatAxisMap
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ChartView/variants/LineChart.tsx

function LineChart_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function LineChart_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? LineChart_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : LineChart_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }




var defaultLineType = 'linear';
var LineChartComponent = function LineChartComponent(_ref) {
  var options = _ref.options,
    styles = _ref.styles,
    values = _ref.values,
    width = _ref.width,
    height = _ref.height,
    isAnimationActive = _ref.isAnimationActive,
    order = _ref.order;
  // This function returns a set of Line components whose values are interpreted from the data set
  var getLines = (0,react.useCallback)(function (data, opts, dataStyles) {
    return data.reduce(function (acc) {
      var lines = LineChart_objectSpread({}, acc);
      order.forEach(function (key, i) {
        if (!lines[key]) {
          var _dataStyles$key, _dataStyles$key2;
          lines[key] = /*#__PURE__*/react.createElement(Line, {
            isAnimationActive: isAnimationActive,
            dataKey: key,
            key: key,
            type: ((_dataStyles$key = dataStyles[key]) === null || _dataStyles$key === void 0 ? void 0 : _dataStyles$key.type) || defaultLineType,
            stroke: ((_dataStyles$key2 = dataStyles[key]) === null || _dataStyles$key2 === void 0 ? void 0 : _dataStyles$key2.color) || variants_colors[i % variants_colors.length],
            strokeWidth: 2
          });
        }
      });
      return lines;
    }, {});
  }, [isAnimationActive, order]);

  // This function returns an ordered set of line components, such that it corresponds to the uploaded document
  var getLinesView = function getLinesView() {
    var lines = getLines(values, options, styles);
    return order.map(function (orderKey) {
      return lines[orderKey];
    });
  };
  var getAxis = (0,react.useCallback)(function (optionParams) {
    var axis = [/*#__PURE__*/react.createElement(YAxis, {
      stroke: optionParams.axisColor,
      hide: !optionParams.showAxis,
      key: "yAxis"
    })];
    axis.push(/*#__PURE__*/react.createElement(XAxis, {
      key: "xAxis",
      stroke: optionParams.axisColor,
      dataKey: "name",
      hide: !optionParams.showAxis
    }));
    return axis;
  }, []);
  var getGrid = (0,react.useCallback)(function (opts) {
    if (!opts.showGrid) {
      return null;
    }
    return /*#__PURE__*/react.createElement(CartesianGrid, {
      stroke: "#ccc",
      strokeDasharray: "5 5"
    });
  }, []);
  var getLegend = (0,react.useCallback)(function (opts) {
    if (opts.showLegend) {
      return /*#__PURE__*/react.createElement(Legend, {
        wrapperStyle: {
          bottom: 0
        }
      });
    }
    return null;
  }, []);
  return /*#__PURE__*/react.createElement(ResponsiveContainer, {
    width: width,
    height: height
  }, /*#__PURE__*/react.createElement(LineChart, {
    data: values
  }, getAxis(options), getGrid(options), /*#__PURE__*/react.createElement(component_Tooltip_Tooltip, {
    isAnimationActive: false
  }), getLegend(options), getLinesView()));
};
LineChartComponent.propTypes = {
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  options: prop_types_default().objectOf((prop_types_default()).any).isRequired,
  styles: prop_types_default().objectOf((prop_types_default()).any).isRequired,
  values: prop_types_default().arrayOf(prop_types_default().objectOf((prop_types_default()).any)).isRequired,
  order: prop_types_default().arrayOf((prop_types_default()).string).isRequired,
  isAnimationActive: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var variants_LineChart = (/*#__PURE__*/react.memo(LineChartComponent));
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/shape/Polygon.js
var Polygon_excluded = ["points", "className", "baseLinePoints", "connectNulls"];
function Polygon_extends() { Polygon_extends = Object.assign ? Object.assign.bind() : 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 Polygon_extends.apply(this, arguments); }
function Polygon_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Polygon_objectWithoutPropertiesLoose(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 Polygon_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; }
function Polygon_toConsumableArray(arr) { return Polygon_arrayWithoutHoles(arr) || Polygon_iterableToArray(arr) || Polygon_unsupportedIterableToArray(arr) || Polygon_nonIterableSpread(); }
function Polygon_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."); }
function Polygon_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Polygon_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 Polygon_arrayLikeToArray(o, minLen); }
function Polygon_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function Polygon_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Polygon_arrayLikeToArray(arr); }
function Polygon_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; }
/**
 * @fileOverview Polygon
 */



var isValidatePoint = function isValidatePoint(point) {
  return point && point.x === +point.x && point.y === +point.y;
};
var getParsedPoints = function getParsedPoints() {
  var points = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  var segmentPoints = [[]];
  points.forEach(function (entry) {
    if (isValidatePoint(entry)) {
      segmentPoints[segmentPoints.length - 1].push(entry);
    } else if (segmentPoints[segmentPoints.length - 1].length > 0) {
      // add another path
      segmentPoints.push([]);
    }
  });
  if (isValidatePoint(points[0])) {
    segmentPoints[segmentPoints.length - 1].push(points[0]);
  }
  if (segmentPoints[segmentPoints.length - 1].length <= 0) {
    segmentPoints = segmentPoints.slice(0, -1);
  }
  return segmentPoints;
};
var getSinglePolygonPath = function getSinglePolygonPath(points, connectNulls) {
  var segmentPoints = getParsedPoints(points);
  if (connectNulls) {
    segmentPoints = [segmentPoints.reduce(function (res, segPoints) {
      return [].concat(Polygon_toConsumableArray(res), Polygon_toConsumableArray(segPoints));
    }, [])];
  }
  var polygonPath = segmentPoints.map(function (segPoints) {
    return segPoints.reduce(function (path, point, index) {
      return "".concat(path).concat(index === 0 ? 'M' : 'L').concat(point.x, ",").concat(point.y);
    }, '');
  }).join('');
  return segmentPoints.length === 1 ? "".concat(polygonPath, "Z") : polygonPath;
};
var getRanglePath = function getRanglePath(points, baseLinePoints, connectNulls) {
  var outerPath = getSinglePolygonPath(points, connectNulls);
  return "".concat(outerPath.slice(-1) === 'Z' ? outerPath.slice(0, -1) : outerPath, "L").concat(getSinglePolygonPath(baseLinePoints.reverse(), connectNulls).slice(1));
};
var Polygon = function Polygon(props) {
  var points = props.points,
    className = props.className,
    baseLinePoints = props.baseLinePoints,
    connectNulls = props.connectNulls,
    others = Polygon_objectWithoutProperties(props, Polygon_excluded);
  if (!points || !points.length) {
    return null;
  }
  var layerClass = classnames_default()('recharts-polygon', className);
  if (baseLinePoints && baseLinePoints.length) {
    var hasStroke = others.stroke && others.stroke !== 'none';
    var rangePath = getRanglePath(points, baseLinePoints, connectNulls);
    return /*#__PURE__*/react.createElement("g", {
      className: layerClass
    }, /*#__PURE__*/react.createElement("path", Polygon_extends({}, filterProps(others, true), {
      fill: rangePath.slice(-1) === 'Z' ? others.fill : 'none',
      stroke: "none",
      d: rangePath
    })), hasStroke ? /*#__PURE__*/react.createElement("path", Polygon_extends({}, filterProps(others, true), {
      fill: "none",
      d: getSinglePolygonPath(points, connectNulls)
    })) : null, hasStroke ? /*#__PURE__*/react.createElement("path", Polygon_extends({}, filterProps(others, true), {
      fill: "none",
      d: getSinglePolygonPath(baseLinePoints, connectNulls)
    })) : null);
  }
  var singlePath = getSinglePolygonPath(points, connectNulls);
  return /*#__PURE__*/react.createElement("path", Polygon_extends({}, filterProps(others, true), {
    fill: singlePath.slice(-1) === 'Z' ? others.fill : 'none',
    className: layerClass,
    d: singlePath
  }));
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/polar/PolarAngleAxis.js

function PolarAngleAxis_typeof(obj) { "@babel/helpers - typeof"; return PolarAngleAxis_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; }, PolarAngleAxis_typeof(obj); }
function PolarAngleAxis_extends() { PolarAngleAxis_extends = Object.assign ? Object.assign.bind() : 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 PolarAngleAxis_extends.apply(this, arguments); }
function PolarAngleAxis_ownKeys(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 PolarAngleAxis_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? PolarAngleAxis_ownKeys(Object(source), !0).forEach(function (key) { PolarAngleAxis_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : PolarAngleAxis_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function PolarAngleAxis_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function PolarAngleAxis_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, PolarAngleAxis_toPropertyKey(descriptor.key), descriptor); } }
function PolarAngleAxis_createClass(Constructor, protoProps, staticProps) { if (protoProps) PolarAngleAxis_defineProperties(Constructor.prototype, protoProps); if (staticProps) PolarAngleAxis_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function PolarAngleAxis_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) PolarAngleAxis_setPrototypeOf(subClass, superClass); }
function PolarAngleAxis_setPrototypeOf(o, p) { PolarAngleAxis_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PolarAngleAxis_setPrototypeOf(o, p); }
function PolarAngleAxis_createSuper(Derived) { var hasNativeReflectConstruct = PolarAngleAxis_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = PolarAngleAxis_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = PolarAngleAxis_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return PolarAngleAxis_possibleConstructorReturn(this, result); }; }
function PolarAngleAxis_possibleConstructorReturn(self, call) { if (call && (PolarAngleAxis_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return PolarAngleAxis_assertThisInitialized(self); }
function PolarAngleAxis_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function PolarAngleAxis_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function PolarAngleAxis_getPrototypeOf(o) { PolarAngleAxis_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PolarAngleAxis_getPrototypeOf(o); }
function PolarAngleAxis_defineProperty(obj, key, value) { key = PolarAngleAxis_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function PolarAngleAxis_toPropertyKey(arg) { var key = PolarAngleAxis_toPrimitive(arg, "string"); return PolarAngleAxis_typeof(key) === "symbol" ? key : String(key); }
function PolarAngleAxis_toPrimitive(input, hint) { if (PolarAngleAxis_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (PolarAngleAxis_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Axis of radial direction
 */








var PolarAngleAxis_RADIAN = Math.PI / 180;
var eps = 1e-5;
var PolarAngleAxis = /*#__PURE__*/function (_PureComponent) {
  PolarAngleAxis_inherits(PolarAngleAxis, _PureComponent);
  var _super = PolarAngleAxis_createSuper(PolarAngleAxis);
  function PolarAngleAxis() {
    PolarAngleAxis_classCallCheck(this, PolarAngleAxis);
    return _super.apply(this, arguments);
  }
  PolarAngleAxis_createClass(PolarAngleAxis, [{
    key: "getTickLineCoord",
    value:
    /**
     * Calculate the coordinate of line endpoint
     * @param  {Object} data The Data if ticks
     * @return {Object} (x0, y0): The start point of text,
     *                  (x1, y1): The end point close to text,
     *                  (x2, y2): The end point close to axis
     */
    function getTickLineCoord(data) {
      var _this$props = this.props,
        cx = _this$props.cx,
        cy = _this$props.cy,
        radius = _this$props.radius,
        orientation = _this$props.orientation,
        tickSize = _this$props.tickSize;
      var tickLineSize = tickSize || 8;
      var p1 = polarToCartesian(cx, cy, radius, data.coordinate);
      var p2 = polarToCartesian(cx, cy, radius + (orientation === 'inner' ? -1 : 1) * tickLineSize, data.coordinate);
      return {
        x1: p1.x,
        y1: p1.y,
        x2: p2.x,
        y2: p2.y
      };
    }

    /**
     * Get the text-anchor of each tick
     * @param  {Object} data Data of ticks
     * @return {String} text-anchor
     */
  }, {
    key: "getTickTextAnchor",
    value: function getTickTextAnchor(data) {
      var orientation = this.props.orientation;
      var cos = Math.cos(-data.coordinate * PolarAngleAxis_RADIAN);
      var textAnchor;
      if (cos > eps) {
        textAnchor = orientation === 'outer' ? 'start' : 'end';
      } else if (cos < -eps) {
        textAnchor = orientation === 'outer' ? 'end' : 'start';
      } else {
        textAnchor = 'middle';
      }
      return textAnchor;
    }
  }, {
    key: "renderAxisLine",
    value: function renderAxisLine() {
      var _this$props2 = this.props,
        cx = _this$props2.cx,
        cy = _this$props2.cy,
        radius = _this$props2.radius,
        axisLine = _this$props2.axisLine,
        axisLineType = _this$props2.axisLineType;
      var props = PolarAngleAxis_objectSpread(PolarAngleAxis_objectSpread({}, filterProps(this.props)), {}, {
        fill: 'none'
      }, filterProps(axisLine));
      if (axisLineType === 'circle') {
        return /*#__PURE__*/react.createElement(Dot, PolarAngleAxis_extends({
          className: "recharts-polar-angle-axis-line"
        }, props, {
          cx: cx,
          cy: cy,
          r: radius
        }));
      }
      var ticks = this.props.ticks;
      var points = ticks.map(function (entry) {
        return polarToCartesian(cx, cy, radius, entry.coordinate);
      });
      return /*#__PURE__*/react.createElement(Polygon, PolarAngleAxis_extends({
        className: "recharts-polar-angle-axis-line"
      }, props, {
        points: points
      }));
    }
  }, {
    key: "renderTicks",
    value: function renderTicks() {
      var _this = this;
      var _this$props3 = this.props,
        ticks = _this$props3.ticks,
        tick = _this$props3.tick,
        tickLine = _this$props3.tickLine,
        tickFormatter = _this$props3.tickFormatter,
        stroke = _this$props3.stroke;
      var axisProps = filterProps(this.props);
      var customTickProps = filterProps(tick);
      var tickLineProps = PolarAngleAxis_objectSpread(PolarAngleAxis_objectSpread({}, axisProps), {}, {
        fill: 'none'
      }, filterProps(tickLine));
      var items = ticks.map(function (entry, i) {
        var lineCoord = _this.getTickLineCoord(entry);
        var textAnchor = _this.getTickTextAnchor(entry);
        var tickProps = PolarAngleAxis_objectSpread(PolarAngleAxis_objectSpread(PolarAngleAxis_objectSpread({
          textAnchor: textAnchor
        }, axisProps), {}, {
          stroke: 'none',
          fill: stroke
        }, customTickProps), {}, {
          index: i,
          payload: entry,
          x: lineCoord.x2,
          y: lineCoord.y2
        });
        return /*#__PURE__*/react.createElement(Layer, PolarAngleAxis_extends({
          className: "recharts-polar-angle-axis-tick",
          key: "tick-".concat(i) // eslint-disable-line react/no-array-index-key
        }, adaptEventsOfChild(_this.props, entry, i)), tickLine && /*#__PURE__*/react.createElement("line", PolarAngleAxis_extends({
          className: "recharts-polar-angle-axis-tick-line"
        }, tickLineProps, lineCoord)), tick && PolarAngleAxis.renderTickItem(tick, tickProps, tickFormatter ? tickFormatter(entry.value, i) : entry.value));
      });
      return /*#__PURE__*/react.createElement(Layer, {
        className: "recharts-polar-angle-axis-ticks"
      }, items);
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props4 = this.props,
        ticks = _this$props4.ticks,
        radius = _this$props4.radius,
        axisLine = _this$props4.axisLine;
      if (radius <= 0 || !ticks || !ticks.length) {
        return null;
      }
      return /*#__PURE__*/react.createElement(Layer, {
        className: "recharts-polar-angle-axis"
      }, axisLine && this.renderAxisLine(), this.renderTicks());
    }
  }], [{
    key: "renderTickItem",
    value: function renderTickItem(option, props, value) {
      var tickItem;
      if ( /*#__PURE__*/react.isValidElement(option)) {
        tickItem = /*#__PURE__*/react.cloneElement(option, props);
      } else if (isFunction_default()(option)) {
        tickItem = option(props);
      } else {
        tickItem = /*#__PURE__*/react.createElement(Text, PolarAngleAxis_extends({}, props, {
          className: "recharts-polar-angle-axis-tick-value"
        }), value);
      }
      return tickItem;
    }
  }]);
  return PolarAngleAxis;
}(react.PureComponent);
PolarAngleAxis_defineProperty(PolarAngleAxis, "displayName", 'PolarAngleAxis');
PolarAngleAxis_defineProperty(PolarAngleAxis, "axisType", 'angleAxis');
PolarAngleAxis_defineProperty(PolarAngleAxis, "defaultProps", {
  type: 'category',
  angleAxisId: 0,
  scale: 'auto',
  cx: 0,
  cy: 0,
  orientation: 'outer',
  axisLine: true,
  tickLine: true,
  tickSize: 8,
  tick: true,
  hide: false,
  allowDuplicatedCategory: true
});
// EXTERNAL MODULE: ./node_modules/lodash/minBy.js
var minBy = __webpack_require__(6533);
var minBy_default = /*#__PURE__*/__webpack_require__.n(minBy);
// EXTERNAL MODULE: ./node_modules/lodash/maxBy.js
var maxBy = __webpack_require__(7551);
var maxBy_default = /*#__PURE__*/__webpack_require__.n(maxBy);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/polar/PolarRadiusAxis.js



var PolarRadiusAxis_excluded = ["cx", "cy", "angle", "ticks", "axisLine"],
  PolarRadiusAxis_excluded2 = ["ticks", "tick", "angle", "tickFormatter", "stroke"];
function PolarRadiusAxis_typeof(obj) { "@babel/helpers - typeof"; return PolarRadiusAxis_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; }, PolarRadiusAxis_typeof(obj); }
function PolarRadiusAxis_extends() { PolarRadiusAxis_extends = Object.assign ? Object.assign.bind() : 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 PolarRadiusAxis_extends.apply(this, arguments); }
function PolarRadiusAxis_ownKeys(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 PolarRadiusAxis_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? PolarRadiusAxis_ownKeys(Object(source), !0).forEach(function (key) { PolarRadiusAxis_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : PolarRadiusAxis_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function PolarRadiusAxis_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = PolarRadiusAxis_objectWithoutPropertiesLoose(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 PolarRadiusAxis_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; }
function PolarRadiusAxis_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function PolarRadiusAxis_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, PolarRadiusAxis_toPropertyKey(descriptor.key), descriptor); } }
function PolarRadiusAxis_createClass(Constructor, protoProps, staticProps) { if (protoProps) PolarRadiusAxis_defineProperties(Constructor.prototype, protoProps); if (staticProps) PolarRadiusAxis_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function PolarRadiusAxis_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) PolarRadiusAxis_setPrototypeOf(subClass, superClass); }
function PolarRadiusAxis_setPrototypeOf(o, p) { PolarRadiusAxis_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PolarRadiusAxis_setPrototypeOf(o, p); }
function PolarRadiusAxis_createSuper(Derived) { var hasNativeReflectConstruct = PolarRadiusAxis_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = PolarRadiusAxis_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = PolarRadiusAxis_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return PolarRadiusAxis_possibleConstructorReturn(this, result); }; }
function PolarRadiusAxis_possibleConstructorReturn(self, call) { if (call && (PolarRadiusAxis_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return PolarRadiusAxis_assertThisInitialized(self); }
function PolarRadiusAxis_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function PolarRadiusAxis_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function PolarRadiusAxis_getPrototypeOf(o) { PolarRadiusAxis_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PolarRadiusAxis_getPrototypeOf(o); }
function PolarRadiusAxis_defineProperty(obj, key, value) { key = PolarRadiusAxis_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function PolarRadiusAxis_toPropertyKey(arg) { var key = PolarRadiusAxis_toPrimitive(arg, "string"); return PolarRadiusAxis_typeof(key) === "symbol" ? key : String(key); }
function PolarRadiusAxis_toPrimitive(input, hint) { if (PolarRadiusAxis_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (PolarRadiusAxis_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview The axis of polar coordinate system
 */







var PolarRadiusAxis = /*#__PURE__*/function (_PureComponent) {
  PolarRadiusAxis_inherits(PolarRadiusAxis, _PureComponent);
  var _super = PolarRadiusAxis_createSuper(PolarRadiusAxis);
  function PolarRadiusAxis() {
    PolarRadiusAxis_classCallCheck(this, PolarRadiusAxis);
    return _super.apply(this, arguments);
  }
  PolarRadiusAxis_createClass(PolarRadiusAxis, [{
    key: "getTickValueCoord",
    value:
    /**
     * Calculate the coordinate of tick
     * @param  {Number} coordinate The radius of tick
     * @return {Object} (x, y)
     */
    function getTickValueCoord(_ref) {
      var coordinate = _ref.coordinate;
      var _this$props = this.props,
        angle = _this$props.angle,
        cx = _this$props.cx,
        cy = _this$props.cy;
      return polarToCartesian(cx, cy, coordinate, angle);
    }
  }, {
    key: "getTickTextAnchor",
    value: function getTickTextAnchor() {
      var orientation = this.props.orientation;
      var textAnchor;
      switch (orientation) {
        case 'left':
          textAnchor = 'end';
          break;
        case 'right':
          textAnchor = 'start';
          break;
        default:
          textAnchor = 'middle';
          break;
      }
      return textAnchor;
    }
  }, {
    key: "getViewBox",
    value: function getViewBox() {
      var _this$props2 = this.props,
        cx = _this$props2.cx,
        cy = _this$props2.cy,
        angle = _this$props2.angle,
        ticks = _this$props2.ticks;
      var maxRadiusTick = maxBy_default()(ticks, function (entry) {
        return entry.coordinate || 0;
      });
      var minRadiusTick = minBy_default()(ticks, function (entry) {
        return entry.coordinate || 0;
      });
      return {
        cx: cx,
        cy: cy,
        startAngle: angle,
        endAngle: angle,
        innerRadius: minRadiusTick.coordinate || 0,
        outerRadius: maxRadiusTick.coordinate || 0
      };
    }
  }, {
    key: "renderAxisLine",
    value: function renderAxisLine() {
      var _this$props3 = this.props,
        cx = _this$props3.cx,
        cy = _this$props3.cy,
        angle = _this$props3.angle,
        ticks = _this$props3.ticks,
        axisLine = _this$props3.axisLine,
        others = PolarRadiusAxis_objectWithoutProperties(_this$props3, PolarRadiusAxis_excluded);
      var extent = ticks.reduce(function (result, entry) {
        return [Math.min(result[0], entry.coordinate), Math.max(result[1], entry.coordinate)];
      }, [Infinity, -Infinity]);
      var point0 = polarToCartesian(cx, cy, extent[0], angle);
      var point1 = polarToCartesian(cx, cy, extent[1], angle);
      var props = PolarRadiusAxis_objectSpread(PolarRadiusAxis_objectSpread(PolarRadiusAxis_objectSpread({}, filterProps(others)), {}, {
        fill: 'none'
      }, filterProps(axisLine)), {}, {
        x1: point0.x,
        y1: point0.y,
        x2: point1.x,
        y2: point1.y
      });
      return /*#__PURE__*/react.createElement("line", PolarRadiusAxis_extends({
        className: "recharts-polar-radius-axis-line"
      }, props));
    }
  }, {
    key: "renderTicks",
    value: function renderTicks() {
      var _this = this;
      var _this$props4 = this.props,
        ticks = _this$props4.ticks,
        tick = _this$props4.tick,
        angle = _this$props4.angle,
        tickFormatter = _this$props4.tickFormatter,
        stroke = _this$props4.stroke,
        others = PolarRadiusAxis_objectWithoutProperties(_this$props4, PolarRadiusAxis_excluded2);
      var textAnchor = this.getTickTextAnchor();
      var axisProps = filterProps(others);
      var customTickProps = filterProps(tick);
      var items = ticks.map(function (entry, i) {
        var coord = _this.getTickValueCoord(entry);
        var tickProps = PolarRadiusAxis_objectSpread(PolarRadiusAxis_objectSpread(PolarRadiusAxis_objectSpread(PolarRadiusAxis_objectSpread({
          textAnchor: textAnchor,
          transform: "rotate(".concat(90 - angle, ", ").concat(coord.x, ", ").concat(coord.y, ")")
        }, axisProps), {}, {
          stroke: 'none',
          fill: stroke
        }, customTickProps), {}, {
          index: i
        }, coord), {}, {
          payload: entry
        });
        return /*#__PURE__*/react.createElement(Layer, PolarRadiusAxis_extends({
          className: "recharts-polar-radius-axis-tick",
          key: "tick-".concat(i) // eslint-disable-line react/no-array-index-key
        }, adaptEventsOfChild(_this.props, entry, i)), PolarRadiusAxis.renderTickItem(tick, tickProps, tickFormatter ? tickFormatter(entry.value, i) : entry.value));
      });
      return /*#__PURE__*/react.createElement(Layer, {
        className: "recharts-polar-radius-axis-ticks"
      }, items);
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props5 = this.props,
        ticks = _this$props5.ticks,
        axisLine = _this$props5.axisLine,
        tick = _this$props5.tick;
      if (!ticks || !ticks.length) {
        return null;
      }
      return /*#__PURE__*/react.createElement(Layer, {
        className: "recharts-polar-radius-axis"
      }, axisLine && this.renderAxisLine(), tick && this.renderTicks(), Label.renderCallByParent(this.props, this.getViewBox()));
    }
  }], [{
    key: "renderTickItem",
    value: function renderTickItem(option, props, value) {
      var tickItem;
      if ( /*#__PURE__*/react.isValidElement(option)) {
        tickItem = /*#__PURE__*/react.cloneElement(option, props);
      } else if (isFunction_default()(option)) {
        tickItem = option(props);
      } else {
        tickItem = /*#__PURE__*/react.createElement(Text, PolarRadiusAxis_extends({}, props, {
          className: "recharts-polar-radius-axis-tick-value"
        }), value);
      }
      return tickItem;
    }
  }]);
  return PolarRadiusAxis;
}(react.PureComponent);
PolarRadiusAxis_defineProperty(PolarRadiusAxis, "displayName", 'PolarRadiusAxis');
PolarRadiusAxis_defineProperty(PolarRadiusAxis, "axisType", 'radiusAxis');
PolarRadiusAxis_defineProperty(PolarRadiusAxis, "defaultProps", {
  type: 'number',
  radiusAxisId: 0,
  cx: 0,
  cy: 0,
  angle: 0,
  orientation: 'right',
  stroke: '#ccc',
  axisLine: true,
  tick: true,
  tickCount: 5,
  allowDataOverflow: false,
  scale: 'auto',
  allowDuplicatedCategory: true
});
// EXTERNAL MODULE: ./node_modules/lodash/isPlainObject.js
var lodash_isPlainObject = __webpack_require__(1331);
var isPlainObject_default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject);
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/polar/Pie.js





function Pie_typeof(obj) { "@babel/helpers - typeof"; return Pie_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; }, Pie_typeof(obj); }
function Pie_extends() { Pie_extends = Object.assign ? Object.assign.bind() : 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 Pie_extends.apply(this, arguments); }
function Pie_ownKeys(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 Pie_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Pie_ownKeys(Object(source), !0).forEach(function (key) { Pie_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Pie_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function Pie_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function Pie_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, Pie_toPropertyKey(descriptor.key), descriptor); } }
function Pie_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pie_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pie_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function Pie_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) Pie_setPrototypeOf(subClass, superClass); }
function Pie_setPrototypeOf(o, p) { Pie_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Pie_setPrototypeOf(o, p); }
function Pie_createSuper(Derived) { var hasNativeReflectConstruct = Pie_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Pie_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Pie_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Pie_possibleConstructorReturn(this, result); }; }
function Pie_possibleConstructorReturn(self, call) { if (call && (Pie_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return Pie_assertThisInitialized(self); }
function Pie_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function Pie_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function Pie_getPrototypeOf(o) { Pie_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Pie_getPrototypeOf(o); }
function Pie_defineProperty(obj, key, value) { key = Pie_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function Pie_toPropertyKey(arg) { var key = Pie_toPrimitive(arg, "string"); return Pie_typeof(key) === "symbol" ? key : String(key); }
function Pie_toPrimitive(input, hint) { if (Pie_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Pie_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
 * @fileOverview Render sectors of a pie
 */

















var Pie = /*#__PURE__*/function (_PureComponent) {
  Pie_inherits(Pie, _PureComponent);
  var _super = Pie_createSuper(Pie);
  function Pie(props) {
    var _this;
    Pie_classCallCheck(this, Pie);
    _this = _super.call(this, props);
    Pie_defineProperty(Pie_assertThisInitialized(_this), "pieRef", null);
    Pie_defineProperty(Pie_assertThisInitialized(_this), "sectorRefs", []);
    Pie_defineProperty(Pie_assertThisInitialized(_this), "id", uniqueId('recharts-pie-'));
    Pie_defineProperty(Pie_assertThisInitialized(_this), "handleAnimationEnd", function () {
      var onAnimationEnd = _this.props.onAnimationEnd;
      _this.setState({
        isAnimationFinished: true
      });
      if (isFunction_default()(onAnimationEnd)) {
        onAnimationEnd();
      }
    });
    Pie_defineProperty(Pie_assertThisInitialized(_this), "handleAnimationStart", function () {
      var onAnimationStart = _this.props.onAnimationStart;
      _this.setState({
        isAnimationFinished: false
      });
      if (isFunction_default()(onAnimationStart)) {
        onAnimationStart();
      }
    });
    _this.state = {
      isAnimationFinished: !props.isAnimationActive,
      prevIsAnimationActive: props.isAnimationActive,
      prevAnimationId: props.animationId,
      sectorToFocus: 0
    };
    return _this;
  }
  Pie_createClass(Pie, [{
    key: "isActiveIndex",
    value: function isActiveIndex(i) {
      var activeIndex = this.props.activeIndex;
      if (Array.isArray(activeIndex)) {
        return activeIndex.indexOf(i) !== -1;
      }
      return i === activeIndex;
    }
  }, {
    key: "hasActiveIndex",
    value: function hasActiveIndex() {
      var activeIndex = this.props.activeIndex;
      return Array.isArray(activeIndex) ? activeIndex.length !== 0 : activeIndex || activeIndex === 0;
    }
  }, {
    key: "renderLabels",
    value: function renderLabels(sectors) {
      var isAnimationActive = this.props.isAnimationActive;
      if (isAnimationActive && !this.state.isAnimationFinished) {
        return null;
      }
      var _this$props = this.props,
        label = _this$props.label,
        labelLine = _this$props.labelLine,
        dataKey = _this$props.dataKey,
        valueKey = _this$props.valueKey;
      var pieProps = filterProps(this.props);
      var customLabelProps = filterProps(label);
      var customLabelLineProps = filterProps(labelLine);
      var offsetRadius = label && label.offsetRadius || 20;
      var labels = sectors.map(function (entry, i) {
        var midAngle = (entry.startAngle + entry.endAngle) / 2;
        var endPoint = polarToCartesian(entry.cx, entry.cy, entry.outerRadius + offsetRadius, midAngle);
        var labelProps = Pie_objectSpread(Pie_objectSpread(Pie_objectSpread(Pie_objectSpread({}, pieProps), entry), {}, {
          stroke: 'none'
        }, customLabelProps), {}, {
          index: i,
          textAnchor: Pie.getTextAnchor(endPoint.x, entry.cx)
        }, endPoint);
        var lineProps = Pie_objectSpread(Pie_objectSpread(Pie_objectSpread(Pie_objectSpread({}, pieProps), entry), {}, {
          fill: 'none',
          stroke: entry.fill
        }, customLabelLineProps), {}, {
          index: i,
          points: [polarToCartesian(entry.cx, entry.cy, entry.outerRadius, midAngle), endPoint],
          key: 'line'
        });
        var realDataKey = dataKey;
        // TODO: compatible to lower versions
        if (isNil_default()(dataKey) && isNil_default()(valueKey)) {
          realDataKey = 'value';
        } else if (isNil_default()(dataKey)) {
          realDataKey = valueKey;
        }
        return (
          /*#__PURE__*/
          // eslint-disable-next-line react/no-array-index-key
          react.createElement(Layer, {
            key: "label-".concat(i)
          }, labelLine && Pie.renderLabelLineItem(labelLine, lineProps), Pie.renderLabelItem(label, labelProps, getValueByDataKey(entry, realDataKey)))
        );
      });
      return /*#__PURE__*/react.createElement(Layer, {
        className: "recharts-pie-labels"
      }, labels);
    }
  }, {
    key: "renderSectorsStatically",
    value: function renderSectorsStatically(sectors) {
      var _this2 = this;
      var _this$props2 = this.props,
        activeShape = _this$props2.activeShape,
        blendStroke = _this$props2.blendStroke,
        inactiveShapeProp = _this$props2.inactiveShape;
      return sectors.map(function (entry, i) {
        var inactiveShape = inactiveShapeProp && _this2.hasActiveIndex() ? inactiveShapeProp : null;
        var sectorOptions = _this2.isActiveIndex(i) ? activeShape : inactiveShape;
        var sectorProps = Pie_objectSpread(Pie_objectSpread({}, entry), {}, {
          stroke: blendStroke ? entry.fill : entry.stroke
        });
        return /*#__PURE__*/react.createElement(Layer, Pie_extends({
          ref: function ref(_ref) {
            if (_ref && !_this2.sectorRefs.includes(_ref)) {
              _this2.sectorRefs.push(_ref);
            }
          },
          tabIndex: -1,
          className: "recharts-pie-sector"
        }, adaptEventsOfChild(_this2.props, entry, i), {
          key: "sector-".concat(i) // eslint-disable-line react/no-array-index-key
        }), Pie.renderSectorItem(sectorOptions, sectorProps));
      });
    }
  }, {
    key: "renderSectorsWithAnimation",
    value: function renderSectorsWithAnimation() {
      var _this3 = this;
      var _this$props3 = this.props,
        sectors = _this$props3.sectors,
        isAnimationActive = _this$props3.isAnimationActive,
        animationBegin = _this$props3.animationBegin,
        animationDuration = _this$props3.animationDuration,
        animationEasing = _this$props3.animationEasing,
        animationId = _this$props3.animationId;
      var _this$state = this.state,
        prevSectors = _this$state.prevSectors,
        prevIsAnimationActive = _this$state.prevIsAnimationActive;
      return /*#__PURE__*/react.createElement(es6, {
        begin: animationBegin,
        duration: animationDuration,
        isActive: isAnimationActive,
        easing: animationEasing,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "pie-".concat(animationId, "-").concat(prevIsAnimationActive),
        onAnimationStart: this.handleAnimationStart,
        onAnimationEnd: this.handleAnimationEnd
      }, function (_ref2) {
        var t = _ref2.t;
        var stepData = [];
        var first = sectors && sectors[0];
        var curAngle = first.startAngle;
        sectors.forEach(function (entry, index) {
          var prev = prevSectors && prevSectors[index];
          var paddingAngle = index > 0 ? get_default()(entry, 'paddingAngle', 0) : 0;
          if (prev) {
            var angleIp = interpolateNumber(prev.endAngle - prev.startAngle, entry.endAngle - entry.startAngle);
            var latest = Pie_objectSpread(Pie_objectSpread({}, entry), {}, {
              startAngle: curAngle + paddingAngle,
              endAngle: curAngle + angleIp(t) + paddingAngle
            });
            stepData.push(latest);
            curAngle = latest.endAngle;
          } else {
            var endAngle = entry.endAngle,
              startAngle = entry.startAngle;
            var interpolatorAngle = interpolateNumber(0, endAngle - startAngle);
            var deltaAngle = interpolatorAngle(t);
            var _latest = Pie_objectSpread(Pie_objectSpread({}, entry), {}, {
              startAngle: curAngle + paddingAngle,
              endAngle: curAngle + deltaAngle + paddingAngle
            });
            stepData.push(_latest);
            curAngle = _latest.endAngle;
          }
        });
        return /*#__PURE__*/react.createElement(Layer, null, _this3.renderSectorsStatically(stepData));
      });
    }
  }, {
    key: "attachKeyboardHandlers",
    value: function attachKeyboardHandlers(pieRef) {
      var _this4 = this;
      // eslint-disable-next-line no-param-reassign
      pieRef.onkeydown = function (e) {
        if (!e.altKey) {
          switch (e.key) {
            case 'ArrowLeft':
              {
                var next = ++_this4.state.sectorToFocus % _this4.sectorRefs.length;
                _this4.sectorRefs[next].focus();
                _this4.setState({
                  sectorToFocus: next
                });
                break;
              }
            case 'ArrowRight':
              {
                var _next = --_this4.state.sectorToFocus < 0 ? _this4.sectorRefs.length - 1 : _this4.state.sectorToFocus % _this4.sectorRefs.length;
                _this4.sectorRefs[_next].focus();
                _this4.setState({
                  sectorToFocus: _next
                });
                break;
              }
            case 'Escape':
              {
                _this4.sectorRefs[_this4.state.sectorToFocus].blur();
                _this4.setState({
                  sectorToFocus: 0
                });
                break;
              }
            default:
              {
                // There is nothing to do here
              }
          }
        }
      };
    }
  }, {
    key: "renderSectors",
    value: function renderSectors() {
      var _this$props4 = this.props,
        sectors = _this$props4.sectors,
        isAnimationActive = _this$props4.isAnimationActive;
      var prevSectors = this.state.prevSectors;
      if (isAnimationActive && sectors && sectors.length && (!prevSectors || !isEqual_default()(prevSectors, sectors))) {
        return this.renderSectorsWithAnimation();
      }
      return this.renderSectorsStatically(sectors);
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      if (this.pieRef) {
        this.attachKeyboardHandlers(this.pieRef);
      }
    }
  }, {
    key: "render",
    value: function render() {
      var _this5 = this;
      var _this$props5 = this.props,
        hide = _this$props5.hide,
        sectors = _this$props5.sectors,
        className = _this$props5.className,
        label = _this$props5.label,
        cx = _this$props5.cx,
        cy = _this$props5.cy,
        innerRadius = _this$props5.innerRadius,
        outerRadius = _this$props5.outerRadius,
        isAnimationActive = _this$props5.isAnimationActive;
      var isAnimationFinished = this.state.isAnimationFinished;
      if (hide || !sectors || !sectors.length || !isNumber(cx) || !isNumber(cy) || !isNumber(innerRadius) || !isNumber(outerRadius)) {
        return null;
      }
      var layerClass = classnames_default()('recharts-pie', className);
      return /*#__PURE__*/react.createElement(Layer, {
        tabIndex: this.props.rootTabIndex,
        className: layerClass,
        ref: function ref(_ref3) {
          _this5.pieRef = _ref3;
        }
      }, this.renderSectors(), label && this.renderLabels(sectors), Label.renderCallByParent(this.props, null, false), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, sectors, false));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(nextProps, prevState) {
      if (prevState.prevIsAnimationActive !== nextProps.isAnimationActive) {
        return {
          prevIsAnimationActive: nextProps.isAnimationActive,
          prevAnimationId: nextProps.animationId,
          curSectors: nextProps.sectors,
          prevSectors: [],
          isAnimationFinished: true
        };
      }
      if (nextProps.isAnimationActive && nextProps.animationId !== prevState.prevAnimationId) {
        return {
          prevAnimationId: nextProps.animationId,
          curSectors: nextProps.sectors,
          prevSectors: prevState.curSectors,
          isAnimationFinished: true
        };
      }
      if (nextProps.sectors !== prevState.curSectors) {
        return {
          curSectors: nextProps.sectors,
          isAnimationFinished: true
        };
      }
      return null;
    }
  }, {
    key: "getTextAnchor",
    value: function getTextAnchor(x, cx) {
      if (x > cx) {
        return 'start';
      }
      if (x < cx) {
        return 'end';
      }
      return 'middle';
    }
  }, {
    key: "renderLabelLineItem",
    value: function renderLabelLineItem(option, props) {
      if ( /*#__PURE__*/react.isValidElement(option)) {
        return /*#__PURE__*/react.cloneElement(option, props);
      }
      if (isFunction_default()(option)) {
        return option(props);
      }
      return /*#__PURE__*/react.createElement(Curve, Pie_extends({}, props, {
        type: "linear",
        className: "recharts-pie-label-line"
      }));
    }
  }, {
    key: "renderLabelItem",
    value: function renderLabelItem(option, props, value) {
      if ( /*#__PURE__*/react.isValidElement(option)) {
        return /*#__PURE__*/react.cloneElement(option, props);
      }
      var label = value;
      if (isFunction_default()(option)) {
        label = option(props);
        if ( /*#__PURE__*/react.isValidElement(label)) {
          return label;
        }
      }
      return /*#__PURE__*/react.createElement(Text, Pie_extends({}, props, {
        alignmentBaseline: "middle",
        className: "recharts-pie-label-text"
      }), label);
    }
  }, {
    key: "renderSectorItem",
    value: function renderSectorItem(option, props) {
      if ( /*#__PURE__*/react.isValidElement(option)) {
        return /*#__PURE__*/react.cloneElement(option, props);
      }
      if (isFunction_default()(option)) {
        return option(props);
      }
      if (isPlainObject_default()(option)) {
        return /*#__PURE__*/react.createElement(Sector, Pie_extends({
          tabIndex: -1
        }, props, option));
      }
      return /*#__PURE__*/react.createElement(Sector, Pie_extends({
        tabIndex: -1
      }, props));
    }
  }]);
  return Pie;
}(react.PureComponent);
Pie_defineProperty(Pie, "displayName", 'Pie');
Pie_defineProperty(Pie, "defaultProps", {
  stroke: '#fff',
  fill: '#808080',
  legendType: 'rect',
  cx: '50%',
  cy: '50%',
  startAngle: 0,
  endAngle: 360,
  innerRadius: 0,
  outerRadius: '80%',
  paddingAngle: 0,
  labelLine: true,
  hide: false,
  minAngle: 0,
  isAnimationActive: !Global.isSsr,
  animationBegin: 400,
  animationDuration: 1500,
  animationEasing: 'ease',
  nameKey: 'name',
  blendStroke: false,
  rootTabIndex: 0
});
Pie_defineProperty(Pie, "parseDeltaAngle", function (startAngle, endAngle) {
  var sign = mathSign(endAngle - startAngle);
  var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360);
  return sign * deltaAngle;
});
Pie_defineProperty(Pie, "getRealPieData", function (item) {
  var _item$props = item.props,
    data = _item$props.data,
    children = _item$props.children;
  var presentationProps = filterProps(item.props);
  var cells = findAllByType(children, Cell);
  if (data && data.length) {
    return data.map(function (entry, index) {
      return Pie_objectSpread(Pie_objectSpread(Pie_objectSpread({
        payload: entry
      }, presentationProps), entry), cells && cells[index] && cells[index].props);
    });
  }
  if (cells && cells.length) {
    return cells.map(function (cell) {
      return Pie_objectSpread(Pie_objectSpread({}, presentationProps), cell.props);
    });
  }
  return [];
});
Pie_defineProperty(Pie, "parseCoordinateOfPie", function (item, offset) {
  var top = offset.top,
    left = offset.left,
    width = offset.width,
    height = offset.height;
  var maxPieRadius = getMaxRadius(width, height);
  var cx = left + getPercentValue(item.props.cx, width, width / 2);
  var cy = top + getPercentValue(item.props.cy, height, height / 2);
  var innerRadius = getPercentValue(item.props.innerRadius, maxPieRadius, 0);
  var outerRadius = getPercentValue(item.props.outerRadius, maxPieRadius, maxPieRadius * 0.8);
  var maxRadius = item.props.maxRadius || Math.sqrt(width * width + height * height) / 2;
  return {
    cx: cx,
    cy: cy,
    innerRadius: innerRadius,
    outerRadius: outerRadius,
    maxRadius: maxRadius
  };
});
Pie_defineProperty(Pie, "getComposedData", function (_ref4) {
  var item = _ref4.item,
    offset = _ref4.offset;
  var pieData = Pie.getRealPieData(item);
  if (!pieData || !pieData.length) {
    return null;
  }
  var _item$props2 = item.props,
    cornerRadius = _item$props2.cornerRadius,
    startAngle = _item$props2.startAngle,
    endAngle = _item$props2.endAngle,
    paddingAngle = _item$props2.paddingAngle,
    dataKey = _item$props2.dataKey,
    nameKey = _item$props2.nameKey,
    valueKey = _item$props2.valueKey,
    tooltipType = _item$props2.tooltipType;
  var minAngle = Math.abs(item.props.minAngle);
  var coordinate = Pie.parseCoordinateOfPie(item, offset);
  var deltaAngle = Pie.parseDeltaAngle(startAngle, endAngle);
  var absDeltaAngle = Math.abs(deltaAngle);
  var realDataKey = dataKey;
  if (isNil_default()(dataKey) && isNil_default()(valueKey)) {
    LogUtils_warn(false, "Use \"dataKey\" to specify the value of pie,\n      the props \"valueKey\" will be deprecated in 1.1.0");
    realDataKey = 'value';
  } else if (isNil_default()(dataKey)) {
    LogUtils_warn(false, "Use \"dataKey\" to specify the value of pie,\n      the props \"valueKey\" will be deprecated in 1.1.0");
    realDataKey = valueKey;
  }
  var notZeroItemCount = pieData.filter(function (entry) {
    return getValueByDataKey(entry, realDataKey, 0) !== 0;
  }).length;
  var totalPadingAngle = (absDeltaAngle >= 360 ? notZeroItemCount : notZeroItemCount - 1) * paddingAngle;
  var realTotalAngle = absDeltaAngle - notZeroItemCount * minAngle - totalPadingAngle;
  var sum = pieData.reduce(function (result, entry) {
    var val = getValueByDataKey(entry, realDataKey, 0);
    return result + (isNumber(val) ? val : 0);
  }, 0);
  var sectors;
  if (sum > 0) {
    var prev;
    sectors = pieData.map(function (entry, i) {
      var val = getValueByDataKey(entry, realDataKey, 0);
      var name = getValueByDataKey(entry, nameKey, i);
      var percent = (isNumber(val) ? val : 0) / sum;
      var tempStartAngle;
      if (i) {
        tempStartAngle = prev.endAngle + mathSign(deltaAngle) * paddingAngle * (val !== 0 ? 1 : 0);
      } else {
        tempStartAngle = startAngle;
      }
      var tempEndAngle = tempStartAngle + mathSign(deltaAngle) * ((val !== 0 ? minAngle : 0) + percent * realTotalAngle);
      var midAngle = (tempStartAngle + tempEndAngle) / 2;
      var middleRadius = (coordinate.innerRadius + coordinate.outerRadius) / 2;
      var tooltipPayload = [{
        name: name,
        value: val,
        payload: entry,
        dataKey: realDataKey,
        type: tooltipType
      }];
      var tooltipPosition = polarToCartesian(coordinate.cx, coordinate.cy, middleRadius, midAngle);
      prev = Pie_objectSpread(Pie_objectSpread(Pie_objectSpread({
        percent: percent,
        cornerRadius: cornerRadius,
        name: name,
        tooltipPayload: tooltipPayload,
        midAngle: midAngle,
        middleRadius: middleRadius,
        tooltipPosition: tooltipPosition
      }, entry), coordinate), {}, {
        value: getValueByDataKey(entry, realDataKey),
        startAngle: tempStartAngle,
        endAngle: tempEndAngle,
        payload: entry,
        paddingAngle: mathSign(deltaAngle) * paddingAngle
      });
      return prev;
    });
  }
  return Pie_objectSpread(Pie_objectSpread({}, coordinate), {}, {
    sectors: sectors,
    data: pieData
  });
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/chart/PieChart.js
/**
 * @fileOverview Pie Chart
 */





var PieChart = generateCategoricalChart({
  chartName: 'PieChart',
  GraphicalChild: Pie,
  validateTooltipEventTypes: ['item'],
  defaultTooltipEventType: 'item',
  legendContent: 'children',
  axisComponents: [{
    axisType: 'angleAxis',
    AxisComp: PolarAngleAxis
  }, {
    axisType: 'radiusAxis',
    AxisComp: PolarRadiusAxis
  }],
  formatAxisMap: formatAxisMap,
  defaultProps: {
    layout: 'centric',
    startAngle: 0,
    endAngle: 360,
    cx: '50%',
    cy: '50%',
    innerRadius: 0,
    outerRadius: '80%'
  }
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ChartView/variants/PieChart.tsx

function PieChart_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function PieChart_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? PieChart_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : PieChart_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }




var PieChartComponent = function PieChartComponent(_ref) {
  var width = _ref.width,
    height = _ref.height,
    options = _ref.options,
    styles = _ref.styles,
    values = _ref.values,
    order = _ref.order,
    isAnimationActive = _ref.isAnimationActive,
    isMobileTheme = _ref.isMobileTheme;
  var getCells = (0,react.useCallback)(function (data, dataStyles) {
    var piesComponents = data.reduce(function (acc) {
      var items = PieChart_objectSpread({}, acc);
      order.forEach(function (key, i) {
        if (!items[key]) {
          var _dataStyles$key;
          items[key] = /*#__PURE__*/react.createElement(Cell, {
            key: "cell-".concat(key),
            fill: ((_dataStyles$key = dataStyles[key]) === null || _dataStyles$key === void 0 ? void 0 : _dataStyles$key.color) || variants_colors[i % variants_colors.length]
          });
        }
      });
      return items;
    }, {});
    return Object.values(piesComponents);
  }, [isAnimationActive]);
  var getLegend = (0,react.useCallback)(function (opts) {
    return opts !== null && opts !== void 0 && opts.showLegend ? /*#__PURE__*/react.createElement(Legend, {
      wrapperStyle: {
        bottom: 0
      }
    }) : null;
  }, []);
  var getLabelLine = (0,react.useCallback)(function (opts) {
    return opts.showLabel && opts.labelPosition === labelPosition.OUTSIDE;
  }, [options.showLabel, options.labelPosition]);
  var renderCustomizedLabel = (0,react.useCallback)(function (_ref2) {
    var cx = _ref2.cx,
      cy = _ref2.cy,
      midAngle = _ref2.midAngle,
      innerRadius = _ref2.innerRadius,
      outerRadius = _ref2.outerRadius,
      percent = _ref2.percent;
    var RADIAN = Math.PI / 180;
    var radius = options.labelPosition === labelPosition.INSIDE ? innerRadius + (outerRadius - innerRadius) * 0.5 : outerRadius * (isMobileTheme ? 1.2 : 1.1);
    var x = cx + radius * Math.cos(-midAngle * RADIAN);
    var y = cy + radius * Math.sin(-midAngle * RADIAN);
    var value = "".concat((percent * 100).toFixed(0), "%");
    return /*#__PURE__*/react.createElement("text", {
      x: x,
      y: y,
      fill: options.labelColor,
      textAnchor: x > cx ? 'start' : 'end',
      fontSize: "12px"
    }, value);
  }, [options.showLabel, options.labelPosition, options.labelColor]);
  var getLabel = (0,react.useCallback)(function (opts) {
    if (opts.showLabel) {
      return renderCustomizedLabel;
    }
    return false;
  }, [options.showLabel, options.labelPosition, options.labelColor]);
  return /*#__PURE__*/react.createElement(ResponsiveContainer, {
    width: width,
    height: height
  }, /*#__PURE__*/react.createElement(PieChart, null, /*#__PURE__*/react.createElement(Pie, {
    data: values,
    labelLine: getLabelLine(options),
    label: getLabel(options),
    outerRadius: isMobileTheme ? '60%' : '90%',
    fill: "#000",
    dataKey: "value",
    isAnimationActive: isAnimationActive
  }, getCells(values, styles)), getLegend(options)));
};
PieChartComponent.propTypes = {
  isAnimationActive: (prop_types_default()).bool.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  options: prop_types_default().objectOf((prop_types_default()).any).isRequired,
  styles: prop_types_default().objectOf((prop_types_default()).any).isRequired,
  values: prop_types_default().arrayOf(prop_types_default().objectOf((prop_types_default()).any)).isRequired,
  order: prop_types_default().arrayOf((prop_types_default()).string).isRequired,
  isMobileTheme: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var variants_PieChart = (/*#__PURE__*/react.memo(PieChartComponent));
;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/recharts/es6/chart/BarChart.js
/**
 * @fileOverview Bar Chart
 */





var BarChart = generateCategoricalChart({
  chartName: 'BarChart',
  GraphicalChild: Bar,
  defaultTooltipEventType: 'axis',
  validateTooltipEventTypes: ['axis', 'item'],
  axisComponents: [{
    axisType: 'xAxis',
    AxisComp: XAxis
  }, {
    axisType: 'yAxis',
    AxisComp: YAxis
  }],
  formatAxisMap: CartesianUtils_formatAxisMap
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ChartView/variants/BarChart.tsx

function BarChart_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function BarChart_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? BarChart_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : BarChart_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }




var BarChartComponent = function BarChartComponent(_ref) {
  var options = _ref.options,
    styles = _ref.styles,
    values = _ref.values,
    width = _ref.width,
    height = _ref.height,
    pageId = _ref.pageId,
    elementId = _ref.elementId,
    isAnimationActive = _ref.isAnimationActive,
    order = _ref.order;
  // This function returns a set of Bar components whose values are interpreted from the data set
  var getBars = (0,react.useCallback)(function (data, opts, dataStyles) {
    return data.reduce(function (acc) {
      var bars = BarChart_objectSpread({}, acc);
      order.forEach(function (key, i) {
        if (!bars[key]) {
          var _dataStyles$key;
          bars[key] = /*#__PURE__*/react.createElement(Bar, {
            isAnimationActive: isAnimationActive,
            dataKey: key,
            key: key,
            stackId: opts.stack ? "".concat(pageId, "-").concat(elementId) : undefined,
            fill: ((_dataStyles$key = dataStyles[key]) === null || _dataStyles$key === void 0 ? void 0 : _dataStyles$key.color) || variants_colors[i % variants_colors.length]
          });
        }
      });
      return bars;
    }, {});
  }, [isAnimationActive]);

  // This function returns an ordered set of bar components, such that it corresponds to the uploaded document
  var getBarsView = function getBarsView() {
    var bars = getBars(values, options, styles);
    return order.map(function (orderKey) {
      return bars[orderKey];
    });
  };
  var getAxis = (0,react.useCallback)(function (opts) {
    var axis = [/*#__PURE__*/react.createElement(YAxis, {
      stroke: opts.axisColor,
      hide: !opts.showAxis,
      key: "yAxis"
    })];
    axis.push(/*#__PURE__*/react.createElement(XAxis, {
      key: "xAxis",
      stroke: opts.axisColor,
      dataKey: "name",
      hide: !opts.showAxis
    }));
    return axis;
  }, []);
  var getGrid = (0,react.useCallback)(function (opts) {
    if (!opts.showGrid) {
      return null;
    }
    return /*#__PURE__*/react.createElement(CartesianGrid, {
      stroke: "#ccc",
      strokeDasharray: "5 5"
    });
  }, []);
  var getLegend = (0,react.useCallback)(function (opts) {
    if (opts.showLegend) {
      return /*#__PURE__*/react.createElement(Legend, {
        wrapperStyle: {
          bottom: 0
        }
      });
    }
    return null;
  }, []);
  return /*#__PURE__*/react.createElement(ResponsiveContainer, {
    width: width,
    height: height
  }, /*#__PURE__*/react.createElement(BarChart, {
    data: values
  }, getGrid(options), getAxis(options), /*#__PURE__*/react.createElement(component_Tooltip_Tooltip, {
    isAnimationActive: false
  }), getLegend(options), getBarsView()));
};
BarChartComponent.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementId: (prop_types_default()).number.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  options: prop_types_default().objectOf((prop_types_default()).any).isRequired,
  styles: prop_types_default().objectOf((prop_types_default()).any).isRequired,
  values: prop_types_default().arrayOf(prop_types_default().objectOf((prop_types_default()).any)).isRequired,
  order: prop_types_default().arrayOf((prop_types_default()).string).isRequired,
  isAnimationActive: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var variants_BarChart = (/*#__PURE__*/react.memo(BarChartComponent));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ChartView/variants/index.tsx



var LINE = 'LINE';
var PIE = 'PIE';
var BAR = 'BAR';
var variants_colors = ['#7041B1', '#3263DE', '#DCAE20', '#FF056E', '#6DC8B4', '#535941', '#B732B1', '#18DB70', '#C6FCC5', '#B337BF', '#C022A7', '#36E789', '#992659', '#61F6EC', '#C9FF1A', '#FEA115', '#95B7D3', '#16D3C2', '#D33C91', '#85B75D', '#24BC6C', '#2F2D7F', '#195FD2', '#1A557E', '#6F4279', '#F9DB64', '#893A6B', '#984F72', '#19C6E3', '#45387B', '#27502B', '#4A475B', '#3E47DC', '#AE5644', '#A99E21', '#958E5B', '#A95F1A', '#B490C7', '#C651DA', '#674F67', '#1FC9E2', '#58BA7C', '#531F3E', '#6F5C12', '#77AB70', '#38002E', '#276D2E', '#A82C75', '#AE50A6', '#21EDD6', '#E0FE11', '#C3931B', '#2C448B', '#939E44', '#575443', '#A34A15', '#BE951A', '#137580', '#114B08', '#F6F5A4', '#857DF9', '#2B7B19', '#62DD85', '#E97257', '#A4DAA8', '#E3E50E', '#F2A6EB', '#F5EC36', '#110835', '#0E9E84'];
var labelPosition = {
  INSIDE: 'INSIDE',
  OUTSIDE: 'OUTSIDE'
};

var ChartNameByVariant = {
  LINE: 'line',
  BAR: 'bar',
  PIE: 'pie'
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ChartView/EmptyChart.tsx

function EmptyChart_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function EmptyChart_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? EmptyChart_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : EmptyChart_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var svg = {
  LINE: /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "155",
    height: "150",
    viewBox: "0 0 40 40"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M22.11,32.37a1,1,0,0,1-.71-.29l-8.16-8.16L7.76,29a1,1,0,0,1-1.42-.06A1,1,0,0,1,6.4,27.5l6.19-5.7a1,1,0,0,1,1.39,0L22,29.88l5-6.08a1.08,1.08,0,0,1,.4-.3l5.12-2.06a1,1,0,0,1,.75,1.86l-4.89,2L22.88,32a1,1,0,0,1-.73.37Z"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M21.44,18.82a1.05,1.05,0,0,1-.49-.13l-8.11-4.63L8.15,17.4a1,1,0,0,1-1.39-.23A1,1,0,0,1,7,15.77l5.2-3.71A1,1,0,0,1,13.27,12l8,4.57L30.81,7.2a1,1,0,1,1,1.41,1.42L22.14,18.53A1,1,0,0,1,21.44,18.82Z"
  })),
  BAR: /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "155",
    height: "150",
    viewBox: "0 0 40 40"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M11.43,34.26h-3a2,2,0,0,1-2-2v-15a2,2,0,0,1,2-2h3a2,2,0,0,1,2,2v15A2,2,0,0,1,11.43,34.26Zm-3-17v15h3v-15Z"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M21.5,34.26h-3a2,2,0,0,1-2-2V8.5a2,2,0,0,1,2-2h3a2,2,0,0,1,2,2V32.26A2,2,0,0,1,21.5,34.26ZM18.5,8.5V32.26h3V8.5Z"
  }), /*#__PURE__*/react.createElement("path", {
    d: "M31.57,34.26h-3a2,2,0,0,1-2-2V21.38a2,2,0,0,1,2-2h3a2,2,0,0,1,2,2V32.26A2,2,0,0,1,31.57,34.26Zm0-2v0Zm-3-10.88V32.26h3V21.38Z"
  })),
  PIE: /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "155",
    height: "150",
    viewBox: "0 0 40 40"
  }, /*#__PURE__*/react.createElement("path", {
    d: "M19.94,6.94A13.06,13.06,0,1,0,33,20,13.07,13.07,0,0,0,19.94,6.94Zm1,2.05A11.06,11.06,0,0,1,31,19.11h-10Zm-12,11A11.07,11.07,0,0,1,18.94,9V31A11.06,11.06,0,0,1,8.89,20ZM20.94,31V21.11h10A11,11,0,0,1,20.94,31Z"
  }))
};
var EmptyChart = function EmptyChart(_ref) {
  var variant = _ref.variant,
    width = _ref.width,
    height = _ref.height;
  var wrapperStyle = {
    width: "".concat(width, "px"),
    height: "".concat(height, "px")
  };
  return /*#__PURE__*/react.createElement("div", {
    className: "chart-element",
    style: EmptyChart_objectSpread({}, wrapperStyle)
  }, /*#__PURE__*/react.createElement("div", {
    className: "chart-placeholder"
  }, svg[variant]));
};
EmptyChart.propTypes = {
  variant: (prop_types_default()).string.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired
};
/* harmony default export */ var ChartView_EmptyChart = (/*#__PURE__*/react.memo(EmptyChart));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ChartView/view.tsx




var ChartView = function ChartView(_ref) {
  var pageId = _ref.pageId,
    elementId = _ref.elementId,
    options = _ref.options,
    values = _ref.values,
    variant = _ref.variant,
    styles = _ref.styles,
    width = _ref.width,
    height = _ref.height,
    isAnimationActive = _ref.isAnimationActive,
    isMobileTheme = _ref.isMobileTheme,
    order = _ref.order;
  var getVariant = function getVariant() {
    switch (variant) {
      case LINE:
        {
          var Component = variants_LineChart;
          return /*#__PURE__*/react.createElement(Component, {
            width: width,
            height: height,
            options: options,
            values: values,
            styles: styles,
            order: order,
            isAnimationActive: isAnimationActive
          });
        }
      case BAR:
        {
          var _Component = variants_BarChart;
          return /*#__PURE__*/react.createElement(_Component, {
            pageId: pageId,
            elementId: elementId,
            width: width,
            height: height,
            options: options,
            values: values,
            styles: styles,
            order: order,
            isAnimationActive: isAnimationActive
          });
        }
      case PIE:
        {
          var _Component2 = variants_PieChart;
          return /*#__PURE__*/react.createElement(_Component2, {
            width: width,
            height: height,
            options: options,
            values: values,
            styles: styles,
            order: order,
            isAnimationActive: isAnimationActive,
            isMobileTheme: isMobileTheme
          });
        }
      default:
        return /*#__PURE__*/react.createElement("div", null);
    }
  };
  return values.length > 0 ? /*#__PURE__*/react.createElement("div", null, getVariant()) : /*#__PURE__*/react.createElement(ChartView_EmptyChart, {
    variant: variant,
    width: width,
    height: height
  });
};
ChartView.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementId: (prop_types_default()).number.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  options: prop_types_default().objectOf((prop_types_default()).any),
  styles: prop_types_default().objectOf((prop_types_default()).any),
  variant: (prop_types_default()).string.isRequired,
  isAnimationActive: (prop_types_default()).bool.isRequired,
  isMobileTheme: (prop_types_default()).bool.isRequired,
  values: prop_types_default().arrayOf(prop_types_default().objectOf((prop_types_default()).any)).isRequired,
  order: prop_types_default().arrayOf((prop_types_default()).string).isRequired
};
ChartView.defaultProps = {
  options: {
    showAxis: true,
    axisColor: '#000',
    showTitles: true,
    showLegend: true,
    showGrid: true
  },
  styles: {}
};
/* harmony default export */ var view = (/*#__PURE__*/react.memo(ChartView));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ChartView/index.ts



/* harmony default export */ var src_ChartView = ({
  component: view,
  types: ChartView_types_namespaceObject,
  Variants: variants_namespaceObject
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/IndividualCharacterInput/styles.tsx

var styles_StyledInput = styled_components_browser_esm.input.withConfig({
  displayName: "styles__StyledInput",
  componentId: "sc-20z6dc-0"
})(["justify-content:space-between;width:38px;height:38px;margin:5px;border:1px solid rgba(0,0,0,0.23);border-radius:3px;text-align:center;font-size:20px;&:focus{outline:none;border-color:#0362FC;}"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/IndividualCharacterInput/InputBox.tsx



var InputBox = function InputBox(props) {
  return /*#__PURE__*/react.createElement(styles_StyledInput, {
    type: props.type
    // @ts-ignore
    ,
    onKeyDown: props.handleKeyDown,
    onChange: props.handleChange,
    onFocus: props.handleFocus,
    maxLength: 1,
    name: props.name,
    ref: props.inputRef,
    onPaste: props.onPaste
  });
};
InputBox.propTypes = {
  name: (prop_types_default()).string.isRequired,
  handleKeyDown: (prop_types_default()).func,
  type: (prop_types_default()).string,
  handleFocus: (prop_types_default()).func,
  handleChange: (prop_types_default()).func,
  onPaste: (prop_types_default()).func,
  // eslint-disable-next-line react/forbid-prop-types
  inputRef: (prop_types_default()).any
};
InputBox.defaultProps = {
  type: 'text',
  handleKeyDown: function handleKeyDown() {},
  handleFocus: function handleFocus() {},
  handleChange: function handleChange() {},
  onPaste: function onPaste() {},
  inputRef: undefined
};
/* harmony default export */ var IndividualCharacterInput_InputBox = (InputBox);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/IndividualCharacterInput/index.tsx




var IndividualCharacterInput = function IndividualCharacterInput(props) {
  var inputElements = {};
  var _useState = (0,react.useState)(Array(props.amount).fill(null)),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    characterArray = _useState2[0],
    setCharacterArray = _useState2[1];
  (0,react.useEffect)(function () {
    if (props.autoFocus && inputElements.input0) {
      inputElements.input0.select();
    }
  }, []);
  var focusPrevChar = function focusPrevChar(target) {
    var previousElement = target.previousElementSibling;
    if (previousElement !== null) {
      previousElement.focus();
    }
  };
  var focusNextChar = function focusNextChar(target) {
    var nextElement = target.nextElementSibling;
    if (nextElement !== null) {
      nextElement.focus();
    }
  };
  var setModuleOutput = function setModuleOutput() {
    var updatedCharacters = characterArray.map(function (character, number) {
      return inputElements["input".concat(number)].value;
    });
    setCharacterArray(updatedCharacters);
    props.handleOutputString(updatedCharacters.join(''));
  };
  var handleKeyDown = function handleKeyDown(_ref) {
    var target = _ref.target,
      key = _ref.key;
    var targetCopy = target;
    var previousElement = targetCopy.previousElementSibling;
    if (key === 'Backspace') {
      if (targetCopy.value === '' && targetCopy.previousElementSibling !== null) {
        previousElement.value = '';
        focusPrevChar(targetCopy);
      } else {
        targetCopy.value = '';
      }
      setModuleOutput();
    } else if (key === 'ArrowLeft') {
      focusPrevChar(targetCopy);
    } else if (key === 'ArrowRight' || key === ' ') {
      focusNextChar(targetCopy);
    } else if (key === 'Enter') {
      props.handleEnterKey && props.handleEnterKey(characterArray.join(''));
    }
  };
  var handleFocus = function handleFocus(_ref2) {
    var target = _ref2.target;
    var el = target;

    // In most browsers .select() does not work without the added timeout.
    setTimeout(function () {
      el.select();
    }, 0);
  };
  var handleChange = function handleChange(_ref3) {
    var target = _ref3.target;
    var targetCopy = target;
    if (!props.inputRegExp || targetCopy.value.match(props.inputRegExp)) {
      focusNextChar(targetCopy);
      setModuleOutput();
    } else {
      targetCopy.value = characterArray[targetCopy.name.replace('input', '')];
    }
  };
  var onRefSet = function onRefSet(ref) {
    if (ref) {
      inputElements[ref.name] = ref;
    }
  };
  var onPaste = function onPaste(event) {
    if (props.allowPaste) {
      event.preventDefault();
      var clipboardText = event.clipboardData.getData('text');
      var length = 0;
      characterArray.forEach(function (inputValue, index) {
        if (clipboardText[index] && (!props.inputRegExp || clipboardText[index].match(props.inputRegExp))) {
          inputElements["input".concat(index)].value = clipboardText[index];
          length++;
        }
      });
      if (inputElements["input".concat(length - 1)]) {
        inputElements["input".concat(length - 1)].focus();
      }
      setModuleOutput();
    }
  };
  var renderItems = function renderItems(amount) {
    var items = [];
    for (var i = 0; i < amount; i++) {
      items.push(/*#__PURE__*/react.createElement(IndividualCharacterInput_InputBox, {
        type: "text",
        key: i,
        handleKeyDown: handleKeyDown,
        handleFocus: handleFocus,
        handleChange: handleChange,
        name: "input".concat(i),
        inputRef: onRefSet,
        onPaste: onPaste
      }));
    }
    return items;
  };
  return /*#__PURE__*/react.createElement("div", {
    id: "confirmation-code"
  }, renderItems(props.amount));
};
IndividualCharacterInput.propTypes = {
  amount: (prop_types_default()).number.isRequired,
  handleOutputString: (prop_types_default()).func.isRequired,
  handleEnterKey: (prop_types_default()).func,
  autoFocus: (prop_types_default()).bool,
  allowPaste: (prop_types_default()).bool,
  inputRegExp: prop_types_default().instanceOf(RegExp)
};
IndividualCharacterInput.defaultProps = {
  handleEnterKey: undefined,
  autoFocus: false,
  allowPaste: false,
  inputRegExp: /^[0-9]$/
};
/* harmony default export */ var src_IndividualCharacterInput = ((/* unused pure expression or super */ null && (IndividualCharacterInput)));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/CartView/types.ts
var CardViewType;
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/CartView/constants.ts

var CartType = {
  BUTTON: 'button',
  MODAL: 'modal'
};
var constants_CartDisplayIcon = {
  AREA: 'area',
  BUTTON: 'button'
};
var CartCustomizableProductDefaults = {
  active: false,
  label: 'Write your message',
  required: false,
  paidPersonalization: {
    active: false,
    pricingMethod: CartPricingMethod.FLAT_FEE,
    extraPrice: '2.5',
    characterLimit: 20
  },
  attributeBasedPersonalization: {
    active: false,
    attribute: '',
    optionName: 'Customize product'
  }
};
var CartCurrencyDefault = 'USD';
var CartRadius = 8;
var CartQuantityLimits = {
  MIN: 1,
  MAX: 9999999
};

;// CONCATENATED MODULE: ../../modules/ui/code/core/src/CartView/styles.tsx

var CartArea = styled_components_browser_esm.div.withConfig({
  displayName: "styles__CartArea",
  componentId: "sc-1uigeqg-0"
})(["cursor:pointer;width:", "px;height:", "px;", " background:", ";"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (_ref) {
  var $alpha = _ref.$alpha;
  return $alpha >= 0 ? "opacity: ".concat($alpha, ";") : '';
}, function (props) {
  return props.$color;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/CartView/CartView.tsx







var CartIcons = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, src.CartIconTypes.CART_ICON, src.CartElementIcons.CartIcon), src.CartIconTypes.FAVORITE_ICON, src.CartElementIcons.CartFavoriteIcon), src.CartIconTypes.STAR_ICON, src.CartElementIcons.CartStarIcon), src.CartIconTypes.BAG_ICON, src.CartElementIcons.CartBagIcon);
var CartView = function CartView(_ref) {
  var cartIcon = _ref.cartIcon,
    alpha = _ref.alpha,
    width = _ref.width,
    color = _ref.color,
    height = _ref.height,
    _ref$radius = _ref.radius,
    radius = _ref$radius === void 0 ? 8 : _ref$radius,
    _ref$label = _ref.label,
    label = _ref$label === void 0 ? '' : _ref$label,
    _ref$labelColor = _ref.labelColor,
    labelColor = _ref$labelColor === void 0 ? '#fff' : _ref$labelColor,
    _ref$shopIcon = _ref.shopIcon,
    shopIcon = _ref$shopIcon === void 0 ? src.CartIconTypes.BAG_ICON : _ref$shopIcon;
  if (cartIcon === constants_CartDisplayIcon.BUTTON) {
    var IconComponent = CartIcons[shopIcon] || src.CartElementIcons.CartBagIcon;
    return /*#__PURE__*/react.createElement(src_IconButton, {
      bgColor: color,
      alpha: alpha,
      width: width,
      height: height,
      radius: "".concat(radius, "px"),
      icon: /*#__PURE__*/react.createElement(IconComponent, {
        fill: labelColor
      }),
      label: label,
      labelColor: labelColor
    });
  }
  return /*#__PURE__*/react.createElement(CartArea, {
    $width: width,
    $height: height,
    $alpha: alpha,
    $color: color
  });
};
CartView.propTypes = {
  cartIcon: (prop_types_default()).string.isRequired,
  alpha: (prop_types_default()).number,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  color: (prop_types_default()).string.isRequired,
  label: (prop_types_default()).string,
  labelColor: (prop_types_default()).string,
  radius: (prop_types_default()).number,
  shopIcon: (prop_types_default()).string
};
/* harmony default export */ var CartView_CartView = (CartView);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/CartView/index.tsx



/* harmony default export */ var src_CartView = ({
  view: CartView_CartView,
  types: CartView_types_namespaceObject,
  constants: CartView_constants_namespaceObject
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PollView/constants.ts

var PollOptionState = {
  BASE: 0,
  HOVER: 1,
  ACTIVE: 2,
  SELECTED: 3
};
var PollOptionStateClass = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, PollOptionState.BASE, ''), PollOptionState.HOVER, 'hovered'), PollOptionState.ACTIVE, 'active'), PollOptionState.SELECTED, 'selected');
var DefaultOptionState = {
  optionIndex: -1,
  currentState: PollOptionState.BASE
};
var PollDefaults = {
  width: 281,
  height: 173,
  showResults: false,
  question: {
    backgroundColor: '#000000',
    body: 'What\'s my name?'
  },
  options: [{
    text: '',
    votes: 0
  }, {
    text: '',
    votes: 0
  }],
  zoom: 1,
  optionState: DefaultOptionState,
  selectedOption: -1
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PollView/types.ts

function types_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function types_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? types_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : types_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var PollViewPropTypes = {
  width: (prop_types_default()).number.isRequired,
  question: prop_types_default().shape({
    backgroundColor: (prop_types_default()).string.isRequired,
    body: (prop_types_default()).string.isRequired
  }).isRequired,
  options: prop_types_default().arrayOf(prop_types_default().shape({
    text: (prop_types_default()).string.isRequired,
    votes: (prop_types_default()).number.isRequired
  }).isRequired).isRequired,
  showResults: (prop_types_default()).bool.isRequired || undefined,
  zoom: (prop_types_default()).number,
  optionState: prop_types_default().shape({
    optionIndex: (prop_types_default()).number.isRequired || undefined,
    currentState: (prop_types_default()).number.isRequired || undefined
  }).isRequired || undefined,
  selectedOption: (prop_types_default()).number.isRequired || undefined
};

// NOTE: Option index starts at 0, but we're defaulting to -1 so the condition based on it
// can also default to the NORMAL PollOptionState
var PollViewDefaultProps = types_objectSpread({}, PollDefaults);
var PollOptionPropTypes = {
  showResults: (prop_types_default()).bool.isRequired || undefined,
  text: (prop_types_default()).string.isRequired,
  votes: (prop_types_default()).number.isRequired,
  totalVotes: (prop_types_default()).number.isRequired,
  shouldChangeState: (prop_types_default()).bool.isRequired || undefined,
  state: (prop_types_default()).number.isRequired || undefined,
  voted: (prop_types_default()).bool.isRequired || undefined
};
var PollOptionDefaultProps = {
  showResults: false,
  shouldChangeState: false,
  state: PollOptionState.BASE,
  voted: false
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PollView/styles.tsx


var _themes$colors = themes.colors,
  white = _themes$colors.white,
  lightBlue = _themes$colors.lightBlue,
  grey100 = _themes$colors.grey100,
  grey200 = _themes$colors.grey200,
  primary = _themes$colors.primary;
var poll = componentsTheme.poll;
var PollViewContainerMask = styled_components_browser_esm.div.withConfig({
  displayName: "styles__PollViewContainerMask",
  componentId: "sc-ycks4x-0"
})(["width:", "px;border-radius:8px;transform-origin:left top;", ""], function (_ref) {
  var $width = _ref.$width;
  return $width;
}, function (_ref2) {
  var $transform = _ref2.$transform;
  return $transform ? "transform: ".concat($transform, ";") : '';
});
var PollViewContainer = styled_components_browser_esm(PollViewContainerMask).withConfig({
  displayName: "styles__PollViewContainer",
  componentId: "sc-ycks4x-1"
})(["background-color:", ";box-shadow:0px 0px 1px -1px rgba(0,0,0,0.2),0px 0px 1px rgba(0,0,0,0.14),0px 1px 3px rgba(0,0,0,0.12);"], white);
var PollQuestionContainerMask = styled_components_browser_esm.div.withConfig({
  displayName: "styles__PollQuestionContainerMask",
  componentId: "sc-ycks4x-2"
})(["box-sizing:border-box;text-align:center;width:", "%;border-radius:", "px ", "px 0 0;min-height:", "px;word-break:break-word;overflow-wrap:break-word;"], poll.question.container.width, poll.question.container.borderRadius, poll.question.container.borderRadius, poll.question.container.minHeight);
var PollQuestionContainer = styled_components_browser_esm(PollQuestionContainerMask).withConfig({
  displayName: "styles__PollQuestionContainer",
  componentId: "sc-ycks4x-3"
})(["background-color:", ";color:", ";"], function (_ref3) {
  var $backgroundColor = _ref3.$backgroundColor;
  return $backgroundColor;
}, white);
var PollQuestion = styled_components_browser_esm.h3.withConfig({
  displayName: "styles__PollQuestion",
  componentId: "sc-ycks4x-4"
})(["font-size:18px;line-height:21px;margin:", ";padding:", "px;"], poll.question.heading.margin, poll.question.heading.padding);
var PollOptionContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__PollOptionContainer",
  componentId: "sc-ycks4x-5"
})(["width:", "%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:", "px;"], poll.option.container.width, poll.option.container.padding);
var PollOptionMask = styled_components_browser_esm.div.withConfig({
  displayName: "styles__PollOptionMask",
  componentId: "sc-ycks4x-6"
})(["&:last-child{margin-bottom:", ";}cursor:pointer;display:flex;height:", "px;align-items:center;justify-content:space-between;width:", "%;border-radius:", "px;box-sizing:border-box;padding:", "px;border:", "px solid transparent;margin-bottom:", "px;"], poll.option.lastChild.marginBottom, poll.option.height, poll.option.width, poll.option.borderRadius, poll.option.padding, poll.option.borderSize, poll.option.marginBottom);
var styles_PollOption = styled_components_browser_esm(PollOptionMask).withConfig({
  displayName: "styles__PollOption",
  componentId: "sc-ycks4x-7"
})(["&.hovered{background:", ";border:1px solid ", ";}&.active{border:1px solid ", ";background:}&.selected{background:", ";border:1px solid ", ";}cursor:initial;border:", "px solid ", ";background:", ""], grey100, grey200, primary, function (_ref4) {
  var percentage = _ref4.percentage;
  return "linear-gradient(90deg, ".concat(lightBlue, " ").concat(percentage, "%, ").concat(white, " ").concat(percentage + 0.01, "%)");
}, primary, poll.option.borderSize, grey200, function (_ref5) {
  var showResults = _ref5.showResults,
    percentage = _ref5.percentage;
  return showResults ? "linear-gradient(90deg, ".concat(poll.option.vote.percentageColor, " ").concat(percentage, "%, ").concat(white, " ").concat(percentage + 0.01, "%);") : "".concat(white);
});
var PollOptionText = styled_components_browser_esm.span.withConfig({
  displayName: "styles__PollOptionText",
  componentId: "sc-ycks4x-8"
})(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;"]);
var PollOptionVotePercentage = styled_components_browser_esm.span.withConfig({
  displayName: "styles__PollOptionVotePercentage",
  componentId: "sc-ycks4x-9"
})(["padding-left:", "px;font-size:14px;"], poll.option.vote.paddingLeft);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PollView/PollOption.tsx





var PollOption = function PollOption(_ref) {
  var showResults = _ref.showResults,
    text = _ref.text,
    votes = _ref.votes,
    totalVotes = _ref.totalVotes,
    shouldChangeState = _ref.shouldChangeState,
    state = _ref.state,
    voted = _ref.voted;
  var percentage = calculatePercentage(votes, totalVotes);
  var stateClass = (0,react.useMemo)(function () {
    if (voted) {
      return PollOptionStateClass[PollOptionState.SELECTED];
    }
    if (shouldChangeState) {
      switch (state) {
        case PollOptionState.HOVER:
          return PollOptionStateClass[PollOptionState.HOVER];
        case PollOptionState.ACTIVE:
          return PollOptionStateClass[PollOptionState.ACTIVE];
        default:
          return PollOptionStateClass[PollOptionState.BASE];
      }
    }
    return PollOptionStateClass[PollOptionState.BASE];
  }, [shouldChangeState, state, voted]);
  return /*#__PURE__*/react.createElement(styles_PollOption, {
    className: stateClass,
    showResults: showResults,
    percentage: percentage
  }, /*#__PURE__*/react.createElement(PollOptionText, null, text), showResults && /*#__PURE__*/react.createElement(PollOptionVotePercentage, null, percentage, "%"));
};
PollOption.propTypes = PollOptionPropTypes;
PollOption.defaultProps = PollOptionDefaultProps;
/* harmony default export */ var PollView_PollOption = (PollOption);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PollView/PollView.tsx




var PollView = function PollView(_ref) {
  var width = _ref.width,
    question = _ref.question,
    options = _ref.options,
    showResults = _ref.showResults,
    zoom = _ref.zoom,
    optionState = _ref.optionState,
    selectedOption = _ref.selectedOption;
  var totalVotes = options.reduce(function (prev, current) {
    return prev + current.votes;
  }, 0);
  var transform = zoom !== 1 ? "scale(".concat(zoom, ")") : '';
  return /*#__PURE__*/react.createElement(PollViewContainer, {
    $width: width,
    $transform: transform
  }, /*#__PURE__*/react.createElement(PollQuestionContainer, {
    $backgroundColor: question.backgroundColor
  }, /*#__PURE__*/react.createElement(PollQuestion, null, question.body)), /*#__PURE__*/react.createElement(PollOptionContainer, null, options.map(function (option, index) {
    return /*#__PURE__*/react.createElement(PollView_PollOption, {
      key: "option-".concat(index + 1),
      totalVotes: totalVotes,
      showResults: showResults,
      text: option.text,
      votes: option.votes,
      shouldChangeState: index === optionState.optionIndex,
      state: optionState.currentState,
      voted: index === selectedOption
    });
  })));
};
PollView.propTypes = PollViewPropTypes;
PollView.defaultProps = PollViewDefaultProps;
/* harmony default export */ var PollView_PollView = (PollView);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PollView/index.tsx




/* harmony default export */ var src_PollView = ({
  component: PollView_PollView,
  defaults: PollDefaults,
  types: PollView_types_namespaceObject,
  styles: PollView_styles_namespaceObject,
  constants: {
    PollOptionState: PollOptionState
  }
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/QuizView/styles.tsx

var QuizArea = styled_components_browser_esm.div.withConfig({
  displayName: "styles__QuizArea",
  componentId: "sc-1odr8yp-0"
})(["cursor:pointer;width:", "px;height:", "px;", " background:", ";"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (_ref) {
  var $alpha = _ref.$alpha;
  return $alpha >= 0 ? "opacity: ".concat($alpha, ";") : '';
}, function (props) {
  return props.$color;
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/QuizView/QuizView.tsx


var QuizView = function QuizView(props) {
  return /*#__PURE__*/react.createElement(QuizArea, {
    $alpha: props.alpha ? props.alpha : -1,
    $width: props.width,
    $height: props.height,
    $color: props.color
  });
};
/* harmony default export */ var QuizView_QuizView = (QuizView);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/QuizView/constants.ts

var _QuizDefaults;
// Quiz defaults for the latest version of the quiz element. Always add here the new properties for quiz.
var QuizProperties = {
  FORM_NAME: 'formName',
  FROM_DESCRIPTION: 'formDescription',
  START_BUTTON_LABEL: 'startButtonLabel',
  COLLECT_DATA: 'collectData',
  MANDATORY: 'mandatory',
  MANDATORY_INSTRUCTION: 'mandatoryInstruction',
  MULTIPLE_QUESTIONS_PER_PAGE: 'multipleQuestionsPerPage',
  SPLIT_THANK_YOU_MESSAGE: 'splitThankYouMessage',
  THANK_YOU_MESSAGE: 'thankYouMessage',
  SHOW_CORRECT_ANSWER: 'showCorrectAnswer',
  ALLOW_RETAKE: 'allowRetake',
  PRIVACY_POLICY: 'privacyPolicy',
  GDPR_COMPLIANCE: 'gdprCompliance',
  QUESTIONS: 'questions',
  ANSWERS: 'answers',
  FEEDBACKS: 'feedbacks'
};
var THANK_YOU_MESSAGE_OPTIONS = {
  DEFAULT: 'default',
  PASSED: 'passed',
  FAILED: 'failed'
};
var PRIVACY_POLICY_PROPERTIES = {
  ACTIVE: 'active',
  COMPANY_NAME: 'companyName',
  POLICY_LINK: 'policyLink'
};
var GDPR_PROPERTIES = {
  ACTIVE: 'active',
  MESSAGE: 'message'
};
var FEEDBACK_PROPERTIES = {
  CA: 'ca',
  IA: 'ia'
};

// Quiz defaults for the latest version of the quiz element.
var QuizDefaults = (_QuizDefaults = {
  color: '#7BC2FF'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_QuizDefaults, QuizProperties.FORM_NAME, 'Untitled quiz'), QuizProperties.FROM_DESCRIPTION, ''), QuizProperties.START_BUTTON_LABEL, 'Start quiz'), QuizProperties.COLLECT_DATA, false), QuizProperties.MANDATORY, false), QuizProperties.MANDATORY_INSTRUCTION, 'Please complete the highlighted quiz before proceeding.'), QuizProperties.MULTIPLE_QUESTIONS_PER_PAGE, false), QuizProperties.SPLIT_THANK_YOU_MESSAGE, true), QuizProperties.THANK_YOU_MESSAGE, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, THANK_YOU_MESSAGE_OPTIONS.DEFAULT, 'Your response has been submitted.'), THANK_YOU_MESSAGE_OPTIONS.PASSED, 'Congratulations, you passed the quiz! Well done!'), THANK_YOU_MESSAGE_OPTIONS.FAILED, 'You failed the quiz, but don’t give up! Try again!')), QuizProperties.SHOW_CORRECT_ANSWER, true), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_QuizDefaults, QuizProperties.ALLOW_RETAKE, true), QuizProperties.PRIVACY_POLICY, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, PRIVACY_POLICY_PROPERTIES.ACTIVE, false), PRIVACY_POLICY_PROPERTIES.COMPANY_NAME, 'Flipsnack'), PRIVACY_POLICY_PROPERTIES.POLICY_LINK, 'https://legal.flipsnack.com/privacy-policy')), QuizProperties.GDPR_COMPLIANCE, defineProperty_defineProperty(defineProperty_defineProperty({}, GDPR_PROPERTIES.ACTIVE, false), GDPR_PROPERTIES.MESSAGE, 'I agree to receive marketing materials')), QuizProperties.FEEDBACKS, defineProperty_defineProperty(defineProperty_defineProperty({}, FEEDBACK_PROPERTIES.CA, 'Feedback for correct answer.'), FEEDBACK_PROPERTIES.IA, 'Feedback for incorrect answer.')));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/QuizView/index.ts


/* harmony default export */ var src_QuizView = ({
  component: QuizView_QuizView,
  defaults: QuizDefaults,
  quizProperties: QuizProperties,
  thankYouMessageOptions: THANK_YOU_MESSAGE_OPTIONS,
  privacyPolicyProperties: PRIVACY_POLICY_PROPERTIES,
  gdprProperties: GDPR_PROPERTIES,
  feedbackProperties: FEEDBACK_PROPERTIES
});
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/internal/svg-icons/Cancel.js
'use client';




/**
 * @ignore - internal component.
 */

/* harmony default export */ var Cancel = ((0,createSvgIcon/* default */.A)( /*#__PURE__*/(0,jsx_runtime.jsx)("path", {
  d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"
}), 'Cancel'));
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Chip/chipClasses.js


function getChipUtilityClass(slot) {
  return (0,generateUtilityClass_generateUtilityClass/* default */.Ay)('MuiChip', slot);
}
const chipClasses = (0,generateUtilityClasses/* default */.A)('MuiChip', ['root', 'sizeSmall', 'sizeMedium', 'colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'disabled', 'clickable', 'clickableColorPrimary', 'clickableColorSecondary', 'deletable', 'deletableColorPrimary', 'deletableColorSecondary', 'outlined', 'filled', 'outlinedPrimary', 'outlinedSecondary', 'filledPrimary', 'filledSecondary', 'avatar', 'avatarSmall', 'avatarMedium', 'avatarColorPrimary', 'avatarColorSecondary', 'icon', 'iconSmall', 'iconMedium', 'iconColorPrimary', 'iconColorSecondary', 'label', 'labelSmall', 'labelMedium', 'deleteIcon', 'deleteIconSmall', 'deleteIconMedium', 'deleteIconColorPrimary', 'deleteIconColorSecondary', 'deleteIconOutlinedColorPrimary', 'deleteIconOutlinedColorSecondary', 'deleteIconFilledColorPrimary', 'deleteIconFilledColorSecondary', 'focusVisible']);
/* harmony default export */ var Chip_chipClasses = (chipClasses);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/material/Chip/Chip.js
'use client';



const Chip_excluded = ["avatar", "className", "clickable", "color", "component", "deleteIcon", "disabled", "icon", "label", "onClick", "onDelete", "onKeyDown", "onKeyUp", "size", "variant", "tabIndex", "skipFocusWhenDisabled"];















const Chip_useUtilityClasses = ownerState => {
  const {
    classes,
    disabled,
    size,
    color,
    iconColor,
    onDelete,
    clickable,
    variant
  } = ownerState;
  const slots = {
    root: ['root', variant, disabled && 'disabled', `size${(0,utils_capitalize/* default */.A)(size)}`, `color${(0,utils_capitalize/* default */.A)(color)}`, clickable && 'clickable', clickable && `clickableColor${(0,utils_capitalize/* default */.A)(color)}`, onDelete && 'deletable', onDelete && `deletableColor${(0,utils_capitalize/* default */.A)(color)}`, `${variant}${(0,utils_capitalize/* default */.A)(color)}`],
    label: ['label', `label${(0,utils_capitalize/* default */.A)(size)}`],
    avatar: ['avatar', `avatar${(0,utils_capitalize/* default */.A)(size)}`, `avatarColor${(0,utils_capitalize/* default */.A)(color)}`],
    icon: ['icon', `icon${(0,utils_capitalize/* default */.A)(size)}`, `iconColor${(0,utils_capitalize/* default */.A)(iconColor)}`],
    deleteIcon: ['deleteIcon', `deleteIcon${(0,utils_capitalize/* default */.A)(size)}`, `deleteIconColor${(0,utils_capitalize/* default */.A)(color)}`, `deleteIcon${(0,utils_capitalize/* default */.A)(variant)}Color${(0,utils_capitalize/* default */.A)(color)}`]
  };
  return (0,composeClasses/* default */.A)(slots, getChipUtilityClass, classes);
};
const ChipRoot = (0,styled/* default */.Ay)('div', {
  name: 'MuiChip',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    const {
      color,
      iconColor,
      clickable,
      onDelete,
      size,
      variant
    } = ownerState;
    return [{
      [`& .${Chip_chipClasses.avatar}`]: styles.avatar
    }, {
      [`& .${Chip_chipClasses.avatar}`]: styles[`avatar${(0,utils_capitalize/* default */.A)(size)}`]
    }, {
      [`& .${Chip_chipClasses.avatar}`]: styles[`avatarColor${(0,utils_capitalize/* default */.A)(color)}`]
    }, {
      [`& .${Chip_chipClasses.icon}`]: styles.icon
    }, {
      [`& .${Chip_chipClasses.icon}`]: styles[`icon${(0,utils_capitalize/* default */.A)(size)}`]
    }, {
      [`& .${Chip_chipClasses.icon}`]: styles[`iconColor${(0,utils_capitalize/* default */.A)(iconColor)}`]
    }, {
      [`& .${Chip_chipClasses.deleteIcon}`]: styles.deleteIcon
    }, {
      [`& .${Chip_chipClasses.deleteIcon}`]: styles[`deleteIcon${(0,utils_capitalize/* default */.A)(size)}`]
    }, {
      [`& .${Chip_chipClasses.deleteIcon}`]: styles[`deleteIconColor${(0,utils_capitalize/* default */.A)(color)}`]
    }, {
      [`& .${Chip_chipClasses.deleteIcon}`]: styles[`deleteIcon${(0,utils_capitalize/* default */.A)(variant)}Color${(0,utils_capitalize/* default */.A)(color)}`]
    }, styles.root, styles[`size${(0,utils_capitalize/* default */.A)(size)}`], styles[`color${(0,utils_capitalize/* default */.A)(color)}`], clickable && styles.clickable, clickable && color !== 'default' && styles[`clickableColor${(0,utils_capitalize/* default */.A)(color)})`], onDelete && styles.deletable, onDelete && color !== 'default' && styles[`deletableColor${(0,utils_capitalize/* default */.A)(color)}`], styles[variant], styles[`${variant}${(0,utils_capitalize/* default */.A)(color)}`]];
  }
})(({
  theme,
  ownerState
}) => {
  const textColor = theme.palette.mode === 'light' ? theme.palette.grey[700] : theme.palette.grey[300];
  return (0,esm_extends/* default */.A)({
    maxWidth: '100%',
    fontFamily: theme.typography.fontFamily,
    fontSize: theme.typography.pxToRem(13),
    display: 'inline-flex',
    alignItems: 'center',
    justifyContent: 'center',
    height: 32,
    color: (theme.vars || theme).palette.text.primary,
    backgroundColor: (theme.vars || theme).palette.action.selected,
    borderRadius: 32 / 2,
    whiteSpace: 'nowrap',
    transition: theme.transitions.create(['background-color', 'box-shadow']),
    // reset cursor explicitly in case ButtonBase is used
    cursor: 'unset',
    // We disable the focus ring for mouse, touch and keyboard users.
    outline: 0,
    textDecoration: 'none',
    border: 0,
    // Remove `button` border
    padding: 0,
    // Remove `button` padding
    verticalAlign: 'middle',
    boxSizing: 'border-box',
    [`&.${Chip_chipClasses.disabled}`]: {
      opacity: (theme.vars || theme).palette.action.disabledOpacity,
      pointerEvents: 'none'
    },
    [`& .${Chip_chipClasses.avatar}`]: {
      marginLeft: 5,
      marginRight: -6,
      width: 24,
      height: 24,
      color: theme.vars ? theme.vars.palette.Chip.defaultAvatarColor : textColor,
      fontSize: theme.typography.pxToRem(12)
    },
    [`& .${Chip_chipClasses.avatarColorPrimary}`]: {
      color: (theme.vars || theme).palette.primary.contrastText,
      backgroundColor: (theme.vars || theme).palette.primary.dark
    },
    [`& .${Chip_chipClasses.avatarColorSecondary}`]: {
      color: (theme.vars || theme).palette.secondary.contrastText,
      backgroundColor: (theme.vars || theme).palette.secondary.dark
    },
    [`& .${Chip_chipClasses.avatarSmall}`]: {
      marginLeft: 4,
      marginRight: -4,
      width: 18,
      height: 18,
      fontSize: theme.typography.pxToRem(10)
    },
    [`& .${Chip_chipClasses.icon}`]: (0,esm_extends/* default */.A)({
      marginLeft: 5,
      marginRight: -6
    }, ownerState.size === 'small' && {
      fontSize: 18,
      marginLeft: 4,
      marginRight: -4
    }, ownerState.iconColor === ownerState.color && (0,esm_extends/* default */.A)({
      color: theme.vars ? theme.vars.palette.Chip.defaultIconColor : textColor
    }, ownerState.color !== 'default' && {
      color: 'inherit'
    })),
    [`& .${Chip_chipClasses.deleteIcon}`]: (0,esm_extends/* default */.A)({
      WebkitTapHighlightColor: 'transparent',
      color: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / 0.26)` : (0,colorManipulator/* alpha */.X4)(theme.palette.text.primary, 0.26),
      fontSize: 22,
      cursor: 'pointer',
      margin: '0 5px 0 -6px',
      '&:hover': {
        color: theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / 0.4)` : (0,colorManipulator/* alpha */.X4)(theme.palette.text.primary, 0.4)
      }
    }, ownerState.size === 'small' && {
      fontSize: 16,
      marginRight: 4,
      marginLeft: -4
    }, ownerState.color !== 'default' && {
      color: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].contrastTextChannel} / 0.7)` : (0,colorManipulator/* alpha */.X4)(theme.palette[ownerState.color].contrastText, 0.7),
      '&:hover, &:active': {
        color: (theme.vars || theme).palette[ownerState.color].contrastText
      }
    })
  }, ownerState.size === 'small' && {
    height: 24
  }, ownerState.color !== 'default' && {
    backgroundColor: (theme.vars || theme).palette[ownerState.color].main,
    color: (theme.vars || theme).palette[ownerState.color].contrastText
  }, ownerState.onDelete && {
    [`&.${Chip_chipClasses.focusVisible}`]: {
      backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.selectedChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.focusOpacity}))` : (0,colorManipulator/* alpha */.X4)(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
    }
  }, ownerState.onDelete && ownerState.color !== 'default' && {
    [`&.${Chip_chipClasses.focusVisible}`]: {
      backgroundColor: (theme.vars || theme).palette[ownerState.color].dark
    }
  });
}, ({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({}, ownerState.clickable && {
  userSelect: 'none',
  WebkitTapHighlightColor: 'transparent',
  cursor: 'pointer',
  '&:hover': {
    backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.selectedChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.hoverOpacity}))` : (0,colorManipulator/* alpha */.X4)(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity)
  },
  [`&.${Chip_chipClasses.focusVisible}`]: {
    backgroundColor: theme.vars ? `rgba(${theme.vars.palette.action.selectedChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.focusOpacity}))` : (0,colorManipulator/* alpha */.X4)(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)
  },
  '&:active': {
    boxShadow: (theme.vars || theme).shadows[1]
  }
}, ownerState.clickable && ownerState.color !== 'default' && {
  [`&:hover, &.${Chip_chipClasses.focusVisible}`]: {
    backgroundColor: (theme.vars || theme).palette[ownerState.color].dark
  }
}), ({
  theme,
  ownerState
}) => (0,esm_extends/* default */.A)({}, ownerState.variant === 'outlined' && {
  backgroundColor: 'transparent',
  border: theme.vars ? `1px solid ${theme.vars.palette.Chip.defaultBorder}` : `1px solid ${theme.palette.mode === 'light' ? theme.palette.grey[400] : theme.palette.grey[700]}`,
  [`&.${Chip_chipClasses.clickable}:hover`]: {
    backgroundColor: (theme.vars || theme).palette.action.hover
  },
  [`&.${Chip_chipClasses.focusVisible}`]: {
    backgroundColor: (theme.vars || theme).palette.action.focus
  },
  [`& .${Chip_chipClasses.avatar}`]: {
    marginLeft: 4
  },
  [`& .${Chip_chipClasses.avatarSmall}`]: {
    marginLeft: 2
  },
  [`& .${Chip_chipClasses.icon}`]: {
    marginLeft: 4
  },
  [`& .${Chip_chipClasses.iconSmall}`]: {
    marginLeft: 2
  },
  [`& .${Chip_chipClasses.deleteIcon}`]: {
    marginRight: 5
  },
  [`& .${Chip_chipClasses.deleteIconSmall}`]: {
    marginRight: 3
  }
}, ownerState.variant === 'outlined' && ownerState.color !== 'default' && {
  color: (theme.vars || theme).palette[ownerState.color].main,
  border: `1px solid ${theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.7)` : (0,colorManipulator/* alpha */.X4)(theme.palette[ownerState.color].main, 0.7)}`,
  [`&.${Chip_chipClasses.clickable}:hover`]: {
    backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.hoverOpacity})` : (0,colorManipulator/* alpha */.X4)(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity)
  },
  [`&.${Chip_chipClasses.focusVisible}`]: {
    backgroundColor: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / ${theme.vars.palette.action.focusOpacity})` : (0,colorManipulator/* alpha */.X4)(theme.palette[ownerState.color].main, theme.palette.action.focusOpacity)
  },
  [`& .${Chip_chipClasses.deleteIcon}`]: {
    color: theme.vars ? `rgba(${theme.vars.palette[ownerState.color].mainChannel} / 0.7)` : (0,colorManipulator/* alpha */.X4)(theme.palette[ownerState.color].main, 0.7),
    '&:hover, &:active': {
      color: (theme.vars || theme).palette[ownerState.color].main
    }
  }
}));
const ChipLabel = (0,styled/* default */.Ay)('span', {
  name: 'MuiChip',
  slot: 'Label',
  overridesResolver: (props, styles) => {
    const {
      ownerState
    } = props;
    const {
      size
    } = ownerState;
    return [styles.label, styles[`label${(0,utils_capitalize/* default */.A)(size)}`]];
  }
})(({
  ownerState
}) => (0,esm_extends/* default */.A)({
  overflow: 'hidden',
  textOverflow: 'ellipsis',
  paddingLeft: 12,
  paddingRight: 12,
  whiteSpace: 'nowrap'
}, ownerState.variant === 'outlined' && {
  paddingLeft: 11,
  paddingRight: 11
}, ownerState.size === 'small' && {
  paddingLeft: 8,
  paddingRight: 8
}, ownerState.size === 'small' && ownerState.variant === 'outlined' && {
  paddingLeft: 7,
  paddingRight: 7
}));
function isDeleteKeyboardEvent(keyboardEvent) {
  return keyboardEvent.key === 'Backspace' || keyboardEvent.key === 'Delete';
}

/**
 * Chips represent complex entities in small blocks, such as a contact.
 */
const Chip_Chip_Chip = /*#__PURE__*/react.forwardRef(function Chip(inProps, ref) {
  const props = (0,useThemeProps/* default */.A)({
    props: inProps,
    name: 'MuiChip'
  });
  const {
      avatar: avatarProp,
      className,
      clickable: clickableProp,
      color = 'default',
      component: ComponentProp,
      deleteIcon: deleteIconProp,
      disabled = false,
      icon: iconProp,
      label,
      onClick,
      onDelete,
      onKeyDown,
      onKeyUp,
      size = 'medium',
      variant = 'filled',
      tabIndex,
      skipFocusWhenDisabled = false // TODO v6: Rename to `focusableWhenDisabled`.
    } = props,
    other = (0,objectWithoutPropertiesLoose/* default */.A)(props, Chip_excluded);
  const chipRef = react.useRef(null);
  const handleRef = (0,utils_useForkRef/* default */.A)(chipRef, ref);
  const handleDeleteIconClick = event => {
    // Stop the event from bubbling up to the `Chip`
    event.stopPropagation();
    if (onDelete) {
      onDelete(event);
    }
  };
  const handleKeyDown = event => {
    // Ignore events from children of `Chip`.
    if (event.currentTarget === event.target && isDeleteKeyboardEvent(event)) {
      // Will be handled in keyUp, otherwise some browsers
      // might init navigation
      event.preventDefault();
    }
    if (onKeyDown) {
      onKeyDown(event);
    }
  };
  const handleKeyUp = event => {
    // Ignore events from children of `Chip`.
    if (event.currentTarget === event.target) {
      if (onDelete && isDeleteKeyboardEvent(event)) {
        onDelete(event);
      } else if (event.key === 'Escape' && chipRef.current) {
        chipRef.current.blur();
      }
    }
    if (onKeyUp) {
      onKeyUp(event);
    }
  };
  const clickable = clickableProp !== false && onClick ? true : clickableProp;
  const component = clickable || onDelete ? material_ButtonBase_ButtonBase : ComponentProp || 'div';
  const ownerState = (0,esm_extends/* default */.A)({}, props, {
    component,
    disabled,
    size,
    color,
    iconColor: /*#__PURE__*/react.isValidElement(iconProp) ? iconProp.props.color || color : color,
    onDelete: !!onDelete,
    clickable,
    variant
  });
  const classes = Chip_useUtilityClasses(ownerState);
  const moreProps = component === material_ButtonBase_ButtonBase ? (0,esm_extends/* default */.A)({
    component: ComponentProp || 'div',
    focusVisibleClassName: classes.focusVisible
  }, onDelete && {
    disableRipple: true
  }) : {};
  let deleteIcon = null;
  if (onDelete) {
    deleteIcon = deleteIconProp && /*#__PURE__*/react.isValidElement(deleteIconProp) ? ( /*#__PURE__*/react.cloneElement(deleteIconProp, {
      className: (0,clsx_m/* default */.A)(deleteIconProp.props.className, classes.deleteIcon),
      onClick: handleDeleteIconClick
    })) : /*#__PURE__*/(0,jsx_runtime.jsx)(Cancel, {
      className: (0,clsx_m/* default */.A)(classes.deleteIcon),
      onClick: handleDeleteIconClick
    });
  }
  let avatar = null;
  if (avatarProp && /*#__PURE__*/react.isValidElement(avatarProp)) {
    avatar = /*#__PURE__*/react.cloneElement(avatarProp, {
      className: (0,clsx_m/* default */.A)(classes.avatar, avatarProp.props.className)
    });
  }
  let icon = null;
  if (iconProp && /*#__PURE__*/react.isValidElement(iconProp)) {
    icon = /*#__PURE__*/react.cloneElement(iconProp, {
      className: (0,clsx_m/* default */.A)(classes.icon, iconProp.props.className)
    });
  }
  if (false) {}
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(ChipRoot, (0,esm_extends/* default */.A)({
    as: component,
    className: (0,clsx_m/* default */.A)(classes.root, className),
    disabled: clickable && disabled ? true : undefined,
    onClick: onClick,
    onKeyDown: handleKeyDown,
    onKeyUp: handleKeyUp,
    ref: handleRef,
    tabIndex: skipFocusWhenDisabled && disabled ? -1 : tabIndex,
    ownerState: ownerState
  }, moreProps, other, {
    children: [avatar || icon, /*#__PURE__*/(0,jsx_runtime.jsx)(ChipLabel, {
      className: (0,clsx_m/* default */.A)(classes.label),
      ownerState: ownerState,
      children: label
    }), deleteIcon]
  }));
});
 false ? 0 : void 0;
/* harmony default export */ var material_Chip_Chip = (Chip_Chip_Chip);
// EXTERNAL MODULE: ../../modules/ui/code/mui/node_modules/@mui/icons-material/Close.js
var icons_material_Close = __webpack_require__(8315);
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@mui/base/ClickAwayListener/ClickAwayListener.js
'use client';





// TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1

function mapEventPropToEvent(eventProp) {
  return eventProp.substring(2).toLowerCase();
}
function clickedRootScrollbar(event, doc) {
  return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;
}
/**
 * Listen for click events that occur somewhere in the document, outside of the element itself.
 * For instance, if you need to hide a menu when people click anywhere else on your page.
 *
 * Demos:
 *
 * - [Click-Away Listener](https://mui.com/base-ui/react-click-away-listener/)
 *
 * API:
 *
 * - [ClickAwayListener API](https://mui.com/base-ui/react-click-away-listener/components-api/#click-away-listener)
 */
function ClickAwayListener(props) {
  const {
    children,
    disableReactTree = false,
    mouseEvent = 'onClick',
    onClickAway,
    touchEvent = 'onTouchEnd'
  } = props;
  const movedRef = react.useRef(false);
  const nodeRef = react.useRef(null);
  const activatedRef = react.useRef(false);
  const syntheticEventRef = react.useRef(false);
  react.useEffect(() => {
    // Ensure that this component is not "activated" synchronously.
    // https://github.com/facebook/react/issues/20074
    setTimeout(() => {
      activatedRef.current = true;
    }, 0);
    return () => {
      activatedRef.current = false;
    };
  }, []);
  const handleRef = (0,useForkRef_useForkRef/* default */.A)(
  // @ts-expect-error TODO upstream fix
  children.ref, nodeRef);

  // The handler doesn't take event.defaultPrevented into account:
  //
  // event.preventDefault() is meant to stop default behaviors like
  // clicking a checkbox to check it, hitting a button to submit a form,
  // and hitting left arrow to move the cursor in a text input etc.
  // Only special HTML elements have these default behaviors.
  const handleClickAway = (0,esm_useEventCallback_useEventCallback/* default */.A)(event => {
    // Given developers can stop the propagation of the synthetic event,
    // we can only be confident with a positive value.
    const insideReactTree = syntheticEventRef.current;
    syntheticEventRef.current = false;
    const doc = (0,ownerDocument/* default */.A)(nodeRef.current);

    // 1. IE11 support, which trigger the handleClickAway even after the unbind
    // 2. The child might render null.
    // 3. Behave like a blur listener.
    if (!activatedRef.current || !nodeRef.current || 'clientX' in event && clickedRootScrollbar(event, doc)) {
      return;
    }

    // Do not act if user performed touchmove
    if (movedRef.current) {
      movedRef.current = false;
      return;
    }
    let insideDOM;

    // If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js
    if (event.composedPath) {
      insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;
    } else {
      insideDOM = !doc.documentElement.contains(
      // @ts-expect-error returns `false` as intended when not dispatched from a Node
      event.target) || nodeRef.current.contains(
      // @ts-expect-error returns `false` as intended when not dispatched from a Node
      event.target);
    }
    if (!insideDOM && (disableReactTree || !insideReactTree)) {
      onClickAway(event);
    }
  });

  // Keep track of mouse/touch events that bubbled up through the portal.
  const createHandleSynthetic = handlerName => event => {
    syntheticEventRef.current = true;
    const childrenPropsHandler = children.props[handlerName];
    if (childrenPropsHandler) {
      childrenPropsHandler(event);
    }
  };
  const childrenProps = {
    ref: handleRef
  };
  if (touchEvent !== false) {
    childrenProps[touchEvent] = createHandleSynthetic(touchEvent);
  }
  react.useEffect(() => {
    if (touchEvent !== false) {
      const mappedTouchEvent = mapEventPropToEvent(touchEvent);
      const doc = (0,ownerDocument/* default */.A)(nodeRef.current);
      const handleTouchMove = () => {
        movedRef.current = true;
      };
      doc.addEventListener(mappedTouchEvent, handleClickAway);
      doc.addEventListener('touchmove', handleTouchMove);
      return () => {
        doc.removeEventListener(mappedTouchEvent, handleClickAway);
        doc.removeEventListener('touchmove', handleTouchMove);
      };
    }
    return undefined;
  }, [handleClickAway, touchEvent]);
  if (mouseEvent !== false) {
    childrenProps[mouseEvent] = createHandleSynthetic(mouseEvent);
  }
  react.useEffect(() => {
    if (mouseEvent !== false) {
      const mappedMouseEvent = mapEventPropToEvent(mouseEvent);
      const doc = (0,ownerDocument/* default */.A)(nodeRef.current);
      doc.addEventListener(mappedMouseEvent, handleClickAway);
      return () => {
        doc.removeEventListener(mappedMouseEvent, handleClickAway);
      };
    }
    return undefined;
  }, [handleClickAway, mouseEvent]);
  return /*#__PURE__*/(0,jsx_runtime.jsx)(react.Fragment, {
    children: /*#__PURE__*/react.cloneElement(children, childrenProps)
  });
}
 false ? 0 : void 0;
if (false) {}

;// CONCATENATED MODULE: ../../modules/ui/code/core/node_modules/mui-chips-input/dist/mui-chips-input.es.js








const mui_chips_input_es_T = {
  enter: "Enter",
  backspace: "Backspace"
}, It = {
  ime: 229
}, At = (0,styled/* default */.Ay)(material_Chip_Chip)(({ theme: e, size: n }) => `
    max-width: 100%;
    margin: 2px 4px;
    height: ${n === "small" ? "26px" : "32px"};


    &[aria-disabled="true"] > svg {
      color: ${e.palette.action.disabled};
      cursor: default;
    }

    &.MuiChipsInput-Chip-Editing {
      background-color: ${e.palette.primary.light};
      color: ${e.palette.primary.contrastText};
    }
  `), wt = {
  ChipStyled: At
}, mui_chips_input_es_v = ({
  className: e,
  index: n,
  onDelete: c,
  disabled: l,
  onEdit: C,
  isEditing: h,
  disableEdition: p,
  ...y
}) => {
  const I = (s) => {
    s.key === mui_chips_input_es_T.enter && c(n);
  }, E = (s) => {
    s?.preventDefault?.(), s?.stopPropagation?.(), c(n);
  }, A = (s) => {
    s.target.textContent === y.label && (l || C(n));
  };
  return /* @__PURE__ */ (0,jsx_runtime.jsx)(
    wt.ChipStyled,
    {
      className: `MuiChipsInput-Chip ${h ? "MuiChipsInput-Chip-Editing" : ""} ${e || ""}`,
      onKeyDown: I,
      disabled: l,
      onDoubleClick: p ? void 0 : A,
      tabIndex: l ? -1 : 0,
      "aria-disabled": l,
      onDelete: E,
      ...y
    }
  );
};
function $t(e) {
  return typeof e == "boolean";
}
function kt(e) {
  return typeof e == "object" && !Array.isArray(e) && e !== null;
}
function mui_chips_input_es_W(e, n) {
  typeof n == "function" ? n(e) : n && kt(n) && "current" in n && (n.current = e);
}
const mui_chips_input_es_bt = (0,styled/* default */.Ay)("div")`
  top: 50%;
  transform: translateY(-50%);
  right: 10px;
  position: absolute;
`, Tt = (0,styled/* default */.Ay)(material_TextField_TextField)((e) => `
    max-width: 100%;

    .MuiInputBase-root {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      row-gap: 5px;
      padding-top: ${e.size === "small" ? "5px" : "9px"};
      padding-right: ${e.InputProps?.endAdornment ? "30px" : "9px"};
      padding-bottom: ${e.size === "small" ? "5px" : "9px"};
      padding-left: 10px;

      input {
        min-width: 30px;
        width: auto;
        flex-grow: 1;
        text-overflow: ellipsis;
        padding: ${e.size === "small" ? "3.5px 4px" : "7.5px 4px"};
        align-self: center;
      }
    }
  `), St = (0,styled/* default */.Ay)(material_Chip_Chip)(({ theme: e, size: n }) => `
    max-width: 100%;
    margin: 2px 4px;
    height: ${n === "small" ? "26px" : "32px"};

    &[aria-disabled="true"] > svg.MuiChip-deleteIcon {
      color: ${e.palette.action.disabled};
      cursor: default;
    }
  `), tt = {
  ChipStyled: St,
  TextFieldStyled: Tt,
  EndAdornmentClose: mui_chips_input_es_bt
}, Rt = react.forwardRef(
  ({
    chips: e,
    onAddChip: n,
    onEditChip: c,
    onDeleteChip: l,
    InputProps: C,
    onInputChange: h,
    disabled: p,
    clearInputOnBlur: y,
    addOnBlur: I,
    validate: E,
    error: A,
    helperText: s,
    hideClearAll: w,
    inputProps: k,
    size: b,
    disableDeleteOnBackspace: R,
    disableEdition: B,
    className: F,
    renderChip: M,
    addOnWhichKey: $,
    onFocus: z,
    onDeleteAllChips: j,
    inputRef: o,
    inputValue: a,
    ...K
  }, P) => {
    const [nt, rt] = react.useState(""), [_, L] = react.useState(""), N = react.useRef(null), V = react.useRef(!1), lt = react.useRef(
      typeof a == "string"
    ), [d, O] = react.useState(null), { onKeyDown: ot, ...it } = k || {}, { inputRef: Pt, ...st } = C || {}, U = () => {
      L("");
    }, G = lt.current, x = G ? a : nt, Y = (t) => {
      h?.(t), G || rt(t);
    }, at = (t) => {
      Y(e[t]), O(t), U();
    }, D = () => {
      O(null);
    }, f = () => {
      U(), Y("");
    }, ut = (t) => {
      Y(t.target.value);
    }, q = (t, r) => (u) => {
      if (typeof E == "function") {
        const i = E(t);
        if (i === !1) {
          r?.preventDefault();
          return;
        }
        if (!$t(i) && i.isError) {
          r?.preventDefault(), L(i.textError);
          return;
        }
      }
      u();
    }, H = (t, r, u) => {
      q(
        t,
        u
      )(() => {
        c?.(t, r), D(), f();
      });
    }, J = (t, r) => {
      q(
        t,
        r
      )(() => {
        n?.(x.trim()), f();
      });
    }, Q = () => {
      if (V.current) {
        if (d !== null)
          D(), f();
        else if (I) {
          if (x.length > 0) {
            const t = x.trim();
            t.length === 0 ? f() : d !== null ? H(t, d) : J(t);
          }
        } else
          y && f();
        V.current = !1;
      }
    }, ct = (t) => {
      N.current = t, o && mui_chips_input_es_W(t, o), P && mui_chips_input_es_W(t, P);
    }, pt = (t, r) => r === It.ime ? !1 : $ ? Array.isArray($) ? $.some((u) => u === t) : $ === t : t === mui_chips_input_es_T.enter, dt = (t) => {
      const r = pt(t.key, t.keyCode), u = t.key === mui_chips_input_es_T.backspace, i = x.trim();
      if (!r && t.code === "Tab") {
        Q();
        return;
      }
      if (r && t.preventDefault(), x.length > 0 && r)
        i.length === 0 ? f() : d !== null ? H(i, d, t) : J(i, t);
      else if (u && x.length === 0 && e.length > 0 && !R) {
        const Z = e.length - 1;
        l?.(Z), d === Z && D();
      }
      ot?.(t);
    }, ft = (t) => {
      t.preventDefault(), z?.(t), V.current = !0;
    }, ht = (t) => {
      t.preventDefault(), !w && !p && (j?.(), f(), D());
    }, mt = (t) => {
      t === d ? (f(), D()) : at(t), N.current?.focus();
    }, Ct = (t) => {
      p || (l?.(t), d !== null && (D(), f()));
    }, X = e.length > 0;
    return /* @__PURE__ */ (0,jsx_runtime.jsx)(ClickAwayListener, { onClickAway: Q, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(
      tt.TextFieldStyled,
      {
        value: x,
        onChange: ut,
        ref: P,
        className: `MuiChipsInput-TextField ${F || ""}`,
        size: b,
        placeholder: "Type and press enter",
        onFocus: ft,
        inputProps: {
          onKeyDown: dt,
          ...it
        },
        disabled: p,
        error: !!_ || A,
        helperText: _ || s,
        InputProps: {
          inputRef: ct,
          startAdornment: X ? e.map((t, r) => {
            const u = `chip-${r}`, i = {
              index: r,
              onEdit: mt,
              label: t,
              title: t,
              isEditing: r === d,
              size: b,
              disabled: p,
              disableEdition: B,
              onDelete: Ct
            };
            return M ? M(mui_chips_input_es_v, u, i) : /* @__PURE__ */ (0,react.createElement)(mui_chips_input_es_v, { ...i, key: u });
          }) : null,
          endAdornment: w ? null : /* @__PURE__ */ (0,jsx_runtime.jsx)(
            tt.EndAdornmentClose,
            {
              style: { visibility: X ? "visible" : "hidden" },
              children: /* @__PURE__ */ (0,jsx_runtime.jsx)(
                material_IconButton_IconButton,
                {
                  "aria-label": "Clear",
                  title: "Clear",
                  disabled: p,
                  size: "small",
                  onClick: ht,
                  children: /* @__PURE__ */ (0,jsx_runtime.jsx)(icons_material_Close/* default */.A, { fontSize: "small" })
                }
              )
            }
          ),
          ...st
        },
        ...K
      }
    ) });
  }
);
function Bt(e, n) {
  return [...e, n];
}
function Ft(e, n) {
  return e.filter((c, l) => n !== l);
}
function Mt(e, n, c) {
  return e.map((l, C) => n === C ? c : l);
}
const Kt = [], Ut = react.forwardRef(
  ({
    value: e = Kt,
    onChange: n,
    onAddChip: c,
    onInputChange: l,
    onDeleteChip: C,
    disabled: h,
    validate: p,
    clearInputOnBlur: y,
    addOnBlur: I,
    hideClearAll: E,
    disableDeleteOnBackspace: A,
    onEditChip: s,
    renderChip: w,
    disableEdition: k,
    addOnWhichKey: b = mui_chips_input_es_T.enter,
    inputValue: R,
    ...B
  }, F) => /* @__PURE__ */ (0,jsx_runtime.jsx)(
    Rt,
    {
      chips: e,
      onAddChip: (o) => {
        if (h)
          return;
        const a = Bt(e, o), K = a.length - 1;
        c?.(o, K), n?.(a);
      },
      onInputChange: l,
      disableDeleteOnBackspace: A,
      onDeleteChip: (o) => {
        if (h)
          return;
        const a = e[o];
        n?.(Ft(e, o)), C?.(a, o);
      },
      onEditChip: (o, a) => {
        h || k || (n?.(Mt(e, a, o)), s?.(o, a));
      },
      renderChip: w,
      onDeleteAllChips: () => {
        n?.([]);
      },
      clearInputOnBlur: y,
      addOnBlur: I,
      disabled: h,
      disableEdition: k,
      validate: p,
      inputValue: R,
      hideClearAll: E,
      addOnWhichKey: b,
      ...B,
      ref: F
    }
  )
);


;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ChipInput/styles.tsx



var ChipsInputStyled = styled_components_browser_esm(Ut).withConfig({
  displayName: "styles__ChipsInputStyled",
  componentId: "sc-1mns36n-0"
})(function (props) {
  return {
    width: '100%',
    '& input, textarea': {
      fontSize: '14px',
      border: 0
    },
    '& .MuiInputBase-root': {
      border: "solid 1px ".concat(props.error ? themes.colors.error : themes.colors.grey),
      borderRadius: '4px',
      backgroundColor: themes.colors.white,
      maxHeight: "".concat(props.removeScroll ? '100%' : '73px'),
      overflowY: "".concat(props.removeScroll ? 'unset' : 'scroll'),
      padding: '7px 0 7px 10px',
      gap: '9px 5px',
      height: '100%',
      display: 'flex',
      flexWrap: 'wrap',
      marginTop: "".concat(props.removeMarginTop ? '0' : '4px'),
      '& .MuiChipsInput-Chip': {
        fontSize: '12px',
        margin: 0,
        height: 24,
        '& svg': {
          fontSize: '20px',
          fill: themes.colors.grey400,
          cursor: 'pointer',
          '&:hover': {
            fill: themes.colors.grey500
          }
        }
      },
      '& .MuiOutlinedInput-input': {
        padding: 0,
        width: 'auto',
        flexGrow: 1,
        textOverflow: 'ellipsis',
        height: 24,
        '&:focus': {
          border: 0
        }
      },
      '& .MuiInputBase-inputMultiline': {
        width: '100%'
      },
      '& .MuiOutlinedInput-notchedOutline': {
        border: 0
      }
    },
    '& .Mui-focused': {
      borderColor: props.error ? themes.colors.error : themes.colors.primary
    }
  };
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/ChipInput/index.tsx


/* harmony default export */ var ChipInput = (function (props) {
  return /*#__PURE__*/React.createElement(Styled.ChipsInputStyled, props);
});
// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/react-device-detect/main.js
var main = __webpack_require__(4350);
;// CONCATENATED MODULE: ../../modules/ui/code/constants/constants.ts
var ELEMENT_LINKS_REL_DEFAULT_REL = 'nofollow noopener';
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Anchor/Anchor.styles.tsx

var Anchor_styles_Link = styled_components_browser_esm.a.attrs(function (props) {
  return {
    href: props.href ? props.href : undefined,
    draggable: false,
    $inline: props.$inline,
    rel: props.rel
  };
}).withConfig({
  displayName: "Anchorstyles__Link",
  componentId: "sc-s7sqch-0"
})(["", ""], function (props) {
  return !props.$inline ? '' + "width: 100%;\n         height: 100%;\n         display: block;\n         text-decoration: none;" : '';
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Anchor/Anchor.tsx







var Anchor = function Anchor(props) {
  var anchorRef = (0,react.useRef)(null);
  var isDrag = (0,react.useRef)(false);
  var _props$tabIndex = props.tabIndex,
    tabIndex = _props$tabIndex === void 0 ? TabIndex.UNREACHABLE : _props$tabIndex,
    _props$rel = props.rel,
    rel = _props$rel === void 0 ? ELEMENT_LINKS_REL_DEFAULT_REL : _props$rel,
    _props$ariaLabel = props.ariaLabel,
    ariaLabel = _props$ariaLabel === void 0 ? '' : _props$ariaLabel;
  var mouseDown = function mouseDown(e) {
    if (!isDrag.current || isTouchEvent(e) && 'touches' in e && e.touches.length === 1 || e instanceof MouseEvent) {
      e.stopPropagation();
    }
  };
  var actionEnd = function actionEnd(e) {
    if (isDrag.current) {
      e.stopPropagation();
    }
  };
  (0,react.useEffect)(function () {
    var setDrag = function setDrag() {
      isDrag.current = true;
    };
    var setNotDrag = function setNotDrag() {
      isDrag.current = false;
    };
    if (main/* isMobile */.Fr) {
      var _anchorRef$current;
      anchorRef === null || anchorRef === void 0 || (_anchorRef$current = anchorRef.current) === null || _anchorRef$current === void 0 || _anchorRef$current.addEventListener('touchstart', mouseDown);
    } else {
      var _anchorRef$current2, _anchorRef$current3, _anchorRef$current4;
      anchorRef === null || anchorRef === void 0 || (_anchorRef$current2 = anchorRef.current) === null || _anchorRef$current2 === void 0 || _anchorRef$current2.addEventListener('mousedown', setNotDrag);
      anchorRef === null || anchorRef === void 0 || (_anchorRef$current3 = anchorRef.current) === null || _anchorRef$current3 === void 0 || _anchorRef$current3.addEventListener('mousemove', setDrag);
      anchorRef === null || anchorRef === void 0 || (_anchorRef$current4 = anchorRef.current) === null || _anchorRef$current4 === void 0 || _anchorRef$current4.addEventListener('mouseup', actionEnd);
    }
    return function () {
      if (main/* isMobile */.Fr) {
        var _anchorRef$current5;
        anchorRef === null || anchorRef === void 0 || (_anchorRef$current5 = anchorRef.current) === null || _anchorRef$current5 === void 0 || _anchorRef$current5.removeEventListener('touchstart', mouseDown);
      } else {
        var _anchorRef$current6, _anchorRef$current7;
        anchorRef === null || anchorRef === void 0 || (_anchorRef$current6 = anchorRef.current) === null || _anchorRef$current6 === void 0 || _anchorRef$current6.removeEventListener('mousedown', setNotDrag);
        anchorRef === null || anchorRef === void 0 || (_anchorRef$current7 = anchorRef.current) === null || _anchorRef$current7 === void 0 || _anchorRef$current7.removeEventListener('mousemove', setDrag);
      }
    };
  }, []);
  return /*#__PURE__*/react.createElement(Anchor_styles_Link, (0,esm_extends/* default */.A)({}, props, {
    ref: anchorRef,
    tabIndex: tabIndex,
    rel: rel,
    "aria-label": ariaLabel
  }), props.children);
};
/* harmony default export */ var Anchor_Anchor = (Anchor);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PlayerLogo/PlayerLogo.styles.tsx

var LogoContainer = styled_components_browser_esm.div.withConfig({
  displayName: "PlayerLogostyles__LogoContainer",
  componentId: "sc-13tvjaq-0"
})(["padding:2px;box-sizing:content-box;align-self:center;z-index:", ";"], function (props) {
  return props.$zIndex;
});
var LogoImage = styled_components_browser_esm.img.withConfig({
  displayName: "PlayerLogostyles__LogoImage",
  componentId: "sc-13tvjaq-1"
})(["height:auto;max-height:50px;max-width:200px;width:auto;"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/PlayerLogo/PlayerLogo.tsx





var Status = {
  INITIAL: 'initial',
  SUCCESS: 'success',
  ERROR: 'error'
};
var PlayerLogo = function PlayerLogo(_ref) {
  var src = _ref.src,
    href = _ref.href,
    ariaLabel = _ref.ariaLabel,
    effect = _ref.effect;
  var _useState = (0,react.useState)(Status.INITIAL),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    imgLoadingStatus = _useState2[0],
    setImgLoadingStatus = _useState2[1];
  var onDragStart = function onDragStart(e) {
    e.preventDefault();
  };
  (0,react.useEffect)(function () {
    var currentImg = new Image();
    var setImgSuccess = function setImgSuccess() {
      setImgLoadingStatus(Status.SUCCESS);
    };
    var setImgError = function setImgError() {
      setImgLoadingStatus(Status.ERROR);
    };
    currentImg.addEventListener('load', setImgSuccess);
    currentImg.addEventListener('error', setImgError);
    currentImg.src = src;
    return function () {
      currentImg.removeEventListener('load', setImgSuccess);
      currentImg.removeEventListener('error', setImgError);
    };
  }, [src]);
  if (imgLoadingStatus === Status.INITIAL) {
    return /*#__PURE__*/react.createElement("div", null);
  }
  var logo = /*#__PURE__*/react.createElement(LogoImage, {
    "aria-hidden": true,
    alt: "logo",
    src: src,
    onDragStart: onDragStart
  });
  if (href) {
    logo = /*#__PURE__*/react.createElement(Anchor_Anchor, {
      href: href,
      target: "_blank",
      tabIndex: TabIndex.DEFAULT,
      ariaLabel: ariaLabel
    }, logo);
  }
  return /*#__PURE__*/react.createElement(LogoContainer, {
    $zIndex: effect === playerTypes_PlayerEffect.SCROLL ? 1 : 'inherit'
  }, logo);
};
/* harmony default export */ var PlayerLogo_PlayerLogo = (PlayerLogo);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/BrandedPreloader/BrandedPreloader.styles.tsx

var BrandedPreloader_styles_PreloaderContainer = styled_components_browser_esm.div.withConfig({
  displayName: "BrandedPreloaderstyles__PreloaderContainer",
  componentId: "sc-1dlr4gn-0"
})(["", " display:flex;position:absolute;width:100%;height:100%;align-items:center;justify-content:center;top:0;"], function (_ref) {
  var $backgroundColor = _ref.$backgroundColor;
  return $backgroundColor !== '#000' ? "\n            @keyframes fadeInContainer {\n                0%   { background-color: #000; }\n                100%  { background-color: ".concat($backgroundColor, "; }\n            };\n            animation: fadeInContainer 0.5s ease-in-out;\n            animation-fill-mode: forwards;\n            ") : "background-color: ".concat($backgroundColor, ";");
});
var BrandedPreloader_styles_Preloader = styled_components_browser_esm.div.withConfig({
  displayName: "BrandedPreloaderstyles__Preloader",
  componentId: "sc-1dlr4gn-1"
})(["display:flex;flex-direction:column;max-width:20em;max-height:10em;gap:4.5em;position:relative;"]);
var BrandedPreloader_styles_LogoImage = styled_components_browser_esm.img.withConfig({
  displayName: "BrandedPreloaderstyles__LogoImage",
  componentId: "sc-1dlr4gn-2"
})(["height:5em;position:absolute;top:-100px;right:0;left:50%;transform:translateX(-50%);animation:fadeInLogo .3s;transition:opacity .3s ease-in;@keyframes fadeInLogo{from{opacity:0;}to{opacity:1;}};"]);
var PreloaderIconContainer = styled_components_browser_esm.div.withConfig({
  displayName: "BrandedPreloaderstyles__PreloaderIconContainer",
  componentId: "sc-1dlr4gn-3"
})([""]);
var BrandedPreloader_styles_PreloaderIcon = styled_components_browser_esm.div.withConfig({
  displayName: "BrandedPreloaderstyles__PreloaderIcon",
  componentId: "sc-1dlr4gn-4"
})(["background:#fff;animation:PreloaderIconAnimation 1s infinite ease-in-out;width:1em;height:4em;box-shadow:0 1px 4px #3333334C;:before,:after{background:#fff;animation:PreloaderIconAnimation 1s infinite ease-in-out;width:1em;height:4em;box-shadow:0 1px 4px #3333334C;position:absolute;top:0;content:'';}align-self:center;color:#fff;margin:0 auto;position:relative;font-size:6px;transform:translateZ(0);animation-delay:-0.16s;:before{left:-2em;animation-delay:-0.32s;}:after{left:2em;}@keyframes PreloaderIconAnimation{0%,80%,100%{transform:scaleY(0.8);}40%{transform:scaleY(1.2);}}"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/BrandedPreloader/index.tsx



var BackgroundEnumType = /*#__PURE__*/function (BackgroundEnumType) {
  BackgroundEnumType["COLOR"] = "color";
  BackgroundEnumType["IMAGE"] = "image";
  return BackgroundEnumType;
}(BackgroundEnumType || {});
var blackColor = '#000';
var getBackgroundColor = function getBackgroundColor(_ref) {
  var _ref$type = _ref.type,
    backgroundType = _ref$type === void 0 ? '' : _ref$type,
    _ref$color = _ref.color,
    color = _ref$color === void 0 ? blackColor : _ref$color,
    _ref$opacity = _ref.opacity,
    opacity = _ref$opacity === void 0 ? 1 : _ref$opacity;
  if (opacity === 0) {
    return 'transparent';
  }
  return backgroundType === BackgroundEnumType.COLOR ? color : blackColor;
};
var BrandedPreloader = function BrandedPreloader(_ref2) {
  var _ref2$logoPath = _ref2.logoPath,
    logoPath = _ref2$logoPath === void 0 ? '' : _ref2$logoPath,
    _ref2$logoPathFallbac = _ref2.logoPathFallback,
    logoPathFallback = _ref2$logoPathFallbac === void 0 ? '' : _ref2$logoPathFallbac,
    _ref2$background = _ref2.background,
    background = _ref2$background === void 0 ? {} : _ref2$background;
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    imageLoaded = _useState2[0],
    setImageLoaded = _useState2[1];
  var _useState3 = (0,react.useState)(logoPath),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    logoUrl = _useState4[0],
    setLogoUrl = _useState4[1];
  (0,react.useEffect)(function () {
    if (logoPath) {
      if (!logoUrl) {
        setLogoUrl(logoPath);
      } else {
        var img = new Image();
        img.src = logoUrl;
        img.onload = function () {
          setImageLoaded(true);
        };
        img.onerror = function () {
          if (logoPathFallback) {
            setLogoUrl(logoPathFallback);
          }
        };
      }
    }
  }, [logoPath, logoUrl]);
  return /*#__PURE__*/react.createElement(BrandedPreloader_styles_PreloaderContainer, {
    $backgroundColor: getBackgroundColor(background || {})
  }, /*#__PURE__*/react.createElement(BrandedPreloader_styles_Preloader, null, imageLoaded && /*#__PURE__*/react.createElement(BrandedPreloader_styles_LogoImage, {
    src: logoUrl,
    alt: "logo"
  }), /*#__PURE__*/react.createElement(PreloaderIconContainer, null, /*#__PURE__*/react.createElement(BrandedPreloader_styles_PreloaderIcon, null))));
};
/* harmony default export */ var src_BrandedPreloader = (BrandedPreloader);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/EmbedCover/styles.tsx

var ImageContainer = styled_components_browser_esm.img.withConfig({
  displayName: "styles__ImageContainer",
  componentId: "sc-8b2pcq-0"
})(["width:100%;height:100%;object-fit:cover;"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/EmbedCover/index.tsx



var EmbedCover_EmbedCover = function EmbedCover(_ref) {
  var src = _ref.src;
  return /*#__PURE__*/react.createElement(ImageContainer, {
    src: src
  });
};
EmbedCover_EmbedCover.propTypes = {
  src: (prop_types_default()).string
};
EmbedCover_EmbedCover.defaultProps = {
  src: ''
};
/* harmony default export */ var src_EmbedCover = ((/* unused pure expression or super */ null && (EmbedCover_EmbedCover)));
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/QuestionView/constants.ts
var QuestionDefaults = {
  color: '#7BC2FF',
  textQuestion: 'Add your question here...',
  tooltip: 'Click to answer question',
  buttonLabel: 'Submit',
  thankYouMessage: 'Your response has been submitted.',
  collectData: false,
  privacyPolicy: {
    active: false,
    companyName: 'Flipsnack',
    policyLink: 'https://legal.flipsnack.com/privacy-policy'
  },
  gdprCompliance: {
    active: false,
    message: 'I agree to receive marketing materials.'
  }
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/QuestionView/styles.ts

var Question = styled_components_browser_esm.div.withConfig({
  displayName: "styles__Question",
  componentId: "sc-y4qlkp-0"
})(["cursor:pointer;width:", "px;height:", "px;background:", ";", ""], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (props) {
  return props.$color;
}, function (_ref) {
  var $alpha = _ref.$alpha;
  return $alpha !== undefined ? "opacity: ".concat($alpha, ";") : '';
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/QuestionView/QuestionView.tsx


var QuestionView = function QuestionView(props) {
  return /*#__PURE__*/react.createElement(Question, {
    $width: props.width,
    $height: props.height,
    $alpha: props.alpha,
    $color: props.color
  });
};
/* harmony default export */ var QuestionView_QuestionView = (QuestionView);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/QuestionView/index.ts


/* harmony default export */ var src_QuestionView = ({
  component: QuestionView_QuestionView,
  defaults: QuestionDefaults
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/helpers/helpers.ts

function helpers_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function helpers_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? helpers_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : helpers_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


/**
 * Get the arrow style for dropdown
 * @param {boolean} isOpen
 * @returns {{borderColor: string, top: number}}
 */
var arrowStyle = function arrowStyle(isOpen) {
  return {
    borderColor: isOpen ? 'transparent transparent #000 transparent' : '#000 transparent transparent transparent',
    top: isOpen ? 11 : 15
  };
};

/**
 * Creates variations of possible disabled hashes
 * @param propertiesOrder
 * @param {{[p: string]: string}} activeOption
 * @param option
 * @returns {string[]}
 */
var createDisabledVariantsForDropdown = function createDisabledVariantsForDropdown(propertiesOrder, activeOption, option) {
  var variations = [];
  var _loop = function _loop(activeKey) {
    if (Object.prototype.hasOwnProperty.call(activeOption, activeKey)) {
      Object.keys(propertiesOrder).forEach(function () {
        // Create a variation by combining property with propertyHash
        var variation = helpers_objectSpread(helpers_objectSpread({}, activeOption), {}, defineProperty_defineProperty({}, activeKey, option));
        variations.push(variation);
      });
    }
  };
  for (var activeKey in activeOption) {
    _loop(activeKey);
  }
  return variations.map(function (variation) {
    return Object.values(variation).join('_');
  });
};
var removeSpacing = function removeSpacing(value) {
  return value.replaceAll(' ', '');
};

/**
 * Update product price by paid personalization settings
 * @param extraPriceActive
 * @param pricingMethod
 * @param extraPrice
 * @param countCharacters
 * @param price
 * @returns string
 */
var getFinalPrice = function getFinalPrice(extraPriceActive, pricingMethod, extraPrice, countCharacters, price) {
  if (extraPriceActive && extraPrice && countCharacters) {
    var parseFloatPrice = parseFloat(price) || 0;
    var parseFloatExtraPrice = parseFloat(extraPrice);
    if (pricingMethod === CartPricingMethod.PER_CHARACTER) {
      return "".concat(parseFloatPrice + countCharacters * parseFloatExtraPrice);
    }
    if (pricingMethod === CartPricingMethod.FLAT_FEE) {
      return "".concat(parseFloatPrice + parseFloatExtraPrice);
    }
  }
  return price;
};
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Dropdown/styles.tsx

var DropdownContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__DropdownContainer",
  componentId: "sc-nene67-0"
})(["display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:0;gap:4px;width:", ";@media screen and (max-width:480px) and (orientation:portrait){width:100%;max-width:100%;}"], function (_ref) {
  var fullWidth = _ref.fullWidth;
  return fullWidth ? '100%' : '180px';
});
var styles_Label = styled_components_browser_esm.label.withConfig({
  displayName: "styles__Label",
  componentId: "sc-nene67-1"
})(["font-style:normal;font-weight:500;font-size:12px;line-height:12px;letter-spacing:0.15px;"]);
var DropdownSelectorContainer = styled_components_browser_esm.div.withConfig({
  displayName: "styles__DropdownSelectorContainer",
  componentId: "sc-nene67-2"
})(["color:#333;width:100%;font-size:14px;position:relative;"]);
var DropdownSelector = styled_components_browser_esm.div.withConfig({
  displayName: "styles__DropdownSelector",
  componentId: "sc-nene67-3"
})(["cursor:pointer;border-radius:4px;padding:8px 16px 8px 8px;border:1px solid rgba(0,0,0,0.12);&:after{position:absolute;content:\"\";right:10px;width:0;height:0;border:4px solid transparent;border-color:", ";top:", "px}"], function (props) {
  return props.$borderColor;
}, function (props) {
  return props.$top;
});
var DropdownText = styled_components_browser_esm.div.withConfig({
  displayName: "styles__DropdownText",
  componentId: "sc-nene67-4"
})(["overflow:hidden;word-wrap:break-word;text-overflow:ellipsis;", ";"], function (_ref2) {
  var $disabled = _ref2.$disabled,
    theme = _ref2.theme;
  return $disabled ? "color: ".concat(theme.colors.disabled, ";") : '';
});
var DropdownOptions = styled_components_browser_esm.div.withConfig({
  displayName: "styles__DropdownOptions",
  componentId: "sc-nene67-5"
})(["box-shadow:0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px rgba(0,0,0,0.14),0px 1px 5px rgba(0,0,0,0.12);border-radius:0px 0px 8px 8px;position:absolute;width:calc(100% - 4px);overflow:hidden;background-color:#fff;z-index:1;max-height:101px;left:2px;", ";@media screen and (max-width:480px) and (orientation:portrait){width:calc(100% - 4px);}"], function (_ref3) {
  var $scroll = _ref3.$scroll;
  return $scroll;
});
var DropdownOption = styled_components_browser_esm(DropdownText).withConfig({
  displayName: "styles__DropdownOption",
  componentId: "sc-nene67-6"
})(["padding:8px;cursor:pointer;", ";&:hover{box-shadow:inset 0 0 40px rgba(0,0,0,0.04);}"], function (_ref4) {
  var $disabled = _ref4.$disabled,
    theme = _ref4.theme;
  return $disabled ? "color: ".concat(theme.colors.disabled, "; cursor: default;") : '';
});
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Dropdown/index.tsx





var MAX_VISIBLE_OPTIONS = 3;
var Dropdown = function Dropdown(_ref) {
  var _properties$selectedO;
  var label = _ref.label,
    disabledVariants = _ref.disabledVariants,
    fullWidth = _ref.fullWidth,
    placeholder = _ref.placeholder,
    onSelect = _ref.onSelect,
    attribute = _ref.attribute,
    properties = _ref.properties,
    optionsOrder = _ref.optionsOrder,
    activeOption = _ref.activeOption,
    setActiveOption = _ref.setActiveOption;
  var startOption = placeholder ? '' : optionsOrder[0];
  var _useState = (0,react.useState)(startOption),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    selectedOption = _useState2[0],
    setSelectedOption = _useState2[1];
  var _useState3 = (0,react.useState)(startOption),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    ariaActiveDescendent = _useState4[0],
    setAriaActiveDescendent = _useState4[1];
  var _useState5 = (0,react.useState)(false),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    isOpen = _useState6[0],
    setIsOpen = _useState6[1];
  var optionsRef = (0,react.useRef)(null);
  var dropdownRef = (0,react.useRef)(null);
  var _arrowStyle = arrowStyle(isOpen),
    borderColor = _arrowStyle.borderColor,
    top = _arrowStyle.top;
  var optionsOverflow = optionsOrder.length > MAX_VISIBLE_OPTIONS ? 'overflow-y: scroll;' : '';
  (0,react.useEffect)(function () {
    // If no placeholder, set the first option as default in the dropdown
    if (!placeholder) {
      setActiveOption(attribute, optionsOrder[0]);
    }
    var handleClickOutside = function handleClickOutside(_ref2) {
      var _optionsRef$current, _dropdownRef$current;
      var target = _ref2.target;
      // Hide the dropdown only if it's an outside click
      if (!(optionsRef !== null && optionsRef !== void 0 && (_optionsRef$current = optionsRef.current) !== null && _optionsRef$current !== void 0 && _optionsRef$current.contains(target)) && !(dropdownRef !== null && dropdownRef !== void 0 && (_dropdownRef$current = dropdownRef.current) !== null && _dropdownRef$current !== void 0 && _dropdownRef$current.contains(target))) {
        setIsOpen(false);
      }
    };
    window.addEventListener('click', handleClickOutside, true);
    return function () {
      window.removeEventListener('click', handleClickOutside, true);
    };
  }, []);
  var optionOnClickHandler = function optionOnClickHandler(e) {
    var target = e.target;
    var id = target.getAttribute('id');
    if (id && selectedOption !== id) {
      setSelectedOption(id);
      onSelect(id);
    }
    setIsOpen(false);
  };
  var toggleDropdown = function toggleDropdown() {
    setIsOpen(!isOpen);
  };
  var selectOnKeyDownHandler = function selectOnKeyDownHandler(event) {
    switch (event.code) {
      case KeyboardCodes.ARROW_DOWN:
      case KeyboardCodes.ARROW_UP:
        {
          event.preventDefault();
          if (!isOpen) {
            setIsOpen(true);
          } else {
            var currentIndex = optionsOrder.indexOf(selectedOption);
            var nextIndex;
            nextIndex = event.code === KeyboardCodes.ARROW_DOWN ? currentIndex + 1 : currentIndex - 1;
            // Keep index in range
            nextIndex = nextIndex >= 0 ? nextIndex % optionsOrder.length : optionsOrder.length + nextIndex;
            setSelectedOption(optionsOrder[nextIndex]);
            setAriaActiveDescendent(optionsOrder[nextIndex]);
          }
          break;
        }
      case KeyboardCodes.ENTER:
      case KeyboardCodes.SPACE:
        {
          event.preventDefault();
          if (isOpen) {
            var _currentIndex = optionsOrder.indexOf(selectedOption);
            onSelect(optionsOrder[_currentIndex]);
            setIsOpen(false);
          } else {
            setIsOpen(!isOpen);
          }
          break;
        }
      case KeyboardCodes.TAB:
        setIsOpen(false);
        break;
      default:
        break;
    }
  };
  return /*#__PURE__*/react.createElement(DropdownContainer, {
    fullWidth: fullWidth
  }, label && /*#__PURE__*/react.createElement(styles_Label, null, label), /*#__PURE__*/react.createElement(DropdownSelectorContainer, null, /*#__PURE__*/react.createElement(DropdownSelector, {
    $top: top,
    ref: dropdownRef,
    role: "combobox",
    $borderColor: borderColor,
    tabIndex: TabIndex.DEFAULT,
    "aria-label": "".concat(label, " ").concat((_properties$selectedO = properties[selectedOption]) !== null && _properties$selectedO !== void 0 ? _properties$selectedO : ''),
    "aria-haspopup": "listbox",
    "aria-expanded": isOpen,
    "aria-activedescendant": ariaActiveDescendent,
    onClick: toggleDropdown,
    onKeyDown: selectOnKeyDownHandler
  }, /*#__PURE__*/react.createElement(DropdownText, {
    $disabled: !properties[selectedOption]
  }, properties[selectedOption] || placeholder)), isOpen && /*#__PURE__*/react.createElement(DropdownOptions, {
    ref: optionsRef,
    $scroll: optionsOverflow,
    role: "listbox"
  }, optionsOrder.map(function (option, index) {
    var getDisabledPossibilities = createDisabledVariantsForDropdown(optionsOrder, activeOption, option);
    var disabledVariant = getDisabledPossibilities.find(function (hash) {
      return disabledVariants[hash];
    });
    var key = "".concat(index, "-").concat(option);
    return /*#__PURE__*/react.createElement(DropdownOption, {
      id: option,
      key: key,
      role: "option",
      $background: option === selectedOption ? 'background: rgba(0, 0, 0, 0.08);' : '',
      $disabled: (disabledVariant === null || disabledVariant === void 0 ? void 0 : disabledVariant.includes(option)) || false,
      "aria-label": properties[option],
      "aria-selected": option === selectedOption,
      onClick: optionOnClickHandler
    }, properties[option]);
  }))));
};
Dropdown.defaultProps = {
  label: '',
  disabledVariants: {},
  fullWidth: false,
  placeholder: ''
};
/* harmony default export */ var src_Dropdown = (Dropdown);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Select/style.tsx

var SelectContainer = styled_components_browser_esm.div.withConfig({
  displayName: "style__SelectContainer",
  componentId: "sc-10ggu11-0"
})(["position:relative;width:100%;"]);
var style_Select = styled_components_browser_esm.select.withConfig({
  displayName: "style__Select",
  componentId: "sc-10ggu11-1"
})(["width:100%;margin-top:4px;flex-basis:65%;appearance:none;border:1px solid rgba(0,0,0,0.2);border-radius:", "px;color:", ";height:", "px;padding:", ";font-size:", "px;:focus{border:1px solid ", ";outline:0;}"], function (_ref) {
  var theme = _ref.theme;
  return theme.defaults.borderRadius;
}, function (_ref2) {
  var isPlaceholderSelected = _ref2.isPlaceholderSelected;
  return isPlaceholderSelected ? 'rgba(0, 0, 0, 0.5)' : 'black';
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.input.height;
}, function (_ref4) {
  var theme = _ref4.theme;
  return "".concat(theme.leadForm.paddingX, "px ").concat(theme.leadForm.paddingY, "px");
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.typography.size.smallerParagraph;
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.defaultColors.primary;
});
var ArrowDropdownContainer = styled_components_browser_esm.div.withConfig({
  displayName: "style__ArrowDropdownContainer",
  componentId: "sc-10ggu11-2"
})(["position:absolute;pointer-events:none;top:16px;right:8px;"]);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/Select/Select.tsx





var src_Select_Select_Select = function Select(props) {
  var _useState = (0,react.useState)(props.value),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    selectedValue = _useState2[0],
    setSelectedValue = _useState2[1];
  var onChangeSelectHandler = function onChangeSelectHandler(e) {
    var selectedIndex = e.target.selectedIndex;
    var selectedOption = e.target.options[selectedIndex];
    setSelectedValue(selectedOption.value);
    props.onChange(selectedOption.value);
  };
  return /*#__PURE__*/react.createElement(SelectContainer, null, /*#__PURE__*/react.createElement(style_Select, {
    onChange: onChangeSelectHandler,
    defaultValue: "",
    isPlaceholderSelected: !selectedValue,
    tabIndex: TabIndex.DEFAULT,
    value: selectedValue
  }, /*#__PURE__*/react.createElement("option", {
    value: "",
    disabled: true,
    hidden: true
  }, props.placeholder), props.options.map(function (option) {
    return /*#__PURE__*/react.createElement("option", {
      key: option.key,
      value: option.value
    }, option.label);
  })), /*#__PURE__*/react.createElement(ArrowDropdownContainer, null, /*#__PURE__*/react.createElement(src.ArrowDropdownDown, null)));
};
/* harmony default export */ var src_Select_Select = (src_Select_Select_Select);
;// CONCATENATED MODULE: ../../modules/ui/code/core/src/index.tsx









































;// CONCATENATED MODULE: ./node_modules/js-base64/base64.mjs
/* provided dependency */ var base64_Buffer = __webpack_require__(8287)["Buffer"];
/**
 *  base64.ts
 *
 *  Licensed under the BSD 3-Clause License.
 *    http://opensource.org/licenses/BSD-3-Clause
 *
 *  References:
 *    http://en.wikipedia.org/wiki/Base64
 *
 * @author Dan Kogai (https://github.com/dankogai)
 */
const version = '3.7.7';
/**
 * @deprecated use lowercase `version`.
 */
const VERSION = version;
const _hasBuffer = typeof base64_Buffer === 'function';
const base64_TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
const _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
const b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
const b64chs = Array.prototype.slice.call(b64ch);
const b64tab = ((a) => {
    let tab = {};
    a.forEach((c, i) => tab[c] = i);
    return tab;
})(b64chs);
const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
const _fromCC = String.fromCharCode.bind(String);
const _U8Afrom = typeof Uint8Array.from === 'function'
    ? Uint8Array.from.bind(Uint8Array)
    : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));
const _mkUriSafe = (src) => src
    .replace(/=/g, '').replace(/[+\/]/g, (m0) => m0 == '+' ? '-' : '_');
const _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, '');
/**
 * polyfill version of `btoa`
 */
const btoaPolyfill = (bin) => {
    // console.log('polyfilled');
    let u32, c0, c1, c2, asc = '';
    const pad = bin.length % 3;
    for (let i = 0; i < bin.length;) {
        if ((c0 = bin.charCodeAt(i++)) > 255 ||
            (c1 = bin.charCodeAt(i++)) > 255 ||
            (c2 = bin.charCodeAt(i++)) > 255)
            throw new TypeError('invalid character found');
        u32 = (c0 << 16) | (c1 << 8) | c2;
        asc += b64chs[u32 >> 18 & 63]
            + b64chs[u32 >> 12 & 63]
            + b64chs[u32 >> 6 & 63]
            + b64chs[u32 & 63];
    }
    return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
};
/**
 * does what `window.btoa` of web browsers do.
 * @param {String} bin binary string
 * @returns {string} Base64-encoded string
 */
const _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)
    : _hasBuffer ? (bin) => base64_Buffer.from(bin, 'binary').toString('base64')
        : btoaPolyfill;
const _fromUint8Array = _hasBuffer
    ? (u8a) => base64_Buffer.from(u8a).toString('base64')
    : (u8a) => {
        // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
        const maxargs = 0x1000;
        let strs = [];
        for (let i = 0, l = u8a.length; i < l; i += maxargs) {
            strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
        }
        return _btoa(strs.join(''));
    };
/**
 * converts a Uint8Array to a Base64 string.
 * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
 * @returns {string} Base64 string
 */
const fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
// const utob = (src: string) => unescape(encodeURIComponent(src));
// reverting good old fationed regexp
const cb_utob = (c) => {
    if (c.length < 2) {
        var cc = c.charCodeAt(0);
        return cc < 0x80 ? c
            : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
                + _fromCC(0x80 | (cc & 0x3f)))
                : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
                    + _fromCC(0x80 | ((cc >>> 6) & 0x3f))
                    + _fromCC(0x80 | (cc & 0x3f)));
    }
    else {
        var cc = 0x10000
            + (c.charCodeAt(0) - 0xD800) * 0x400
            + (c.charCodeAt(1) - 0xDC00);
        return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
            + _fromCC(0x80 | ((cc >>> 12) & 0x3f))
            + _fromCC(0x80 | ((cc >>> 6) & 0x3f))
            + _fromCC(0x80 | (cc & 0x3f)));
    }
};
const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
/**
 * @deprecated should have been internal use only.
 * @param {string} src UTF-8 string
 * @returns {string} UTF-16 string
 */
const utob = (u) => u.replace(re_utob, cb_utob);
//
const _encode = _hasBuffer
    ? (s) => base64_Buffer.from(s, 'utf8').toString('base64')
    : _TE
        ? (s) => _fromUint8Array(_TE.encode(s))
        : (s) => _btoa(utob(s));
/**
 * converts a UTF-8-encoded string to a Base64 string.
 * @param {boolean} [urlsafe] if `true` make the result URL-safe
 * @returns {string} Base64 string
 */
const encode = (src, urlsafe = false) => urlsafe
    ? _mkUriSafe(_encode(src))
    : _encode(src);
/**
 * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
 * @returns {string} Base64 string
 */
const base64_encodeURI = (src) => encode(src, true);
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
// const btou = (src: string) => decodeURIComponent(escape(src));
// reverting good old fationed regexp
const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
const cb_btou = (cccc) => {
    switch (cccc.length) {
        case 4:
            var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
                | ((0x3f & cccc.charCodeAt(1)) << 12)
                | ((0x3f & cccc.charCodeAt(2)) << 6)
                | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
            return (_fromCC((offset >>> 10) + 0xD800)
                + _fromCC((offset & 0x3FF) + 0xDC00));
        case 3:
            return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
                | ((0x3f & cccc.charCodeAt(1)) << 6)
                | (0x3f & cccc.charCodeAt(2)));
        default:
            return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
                | (0x3f & cccc.charCodeAt(1)));
    }
};
/**
 * @deprecated should have been internal use only.
 * @param {string} src UTF-16 string
 * @returns {string} UTF-8 string
 */
const btou = (b) => b.replace(re_btou, cb_btou);
/**
 * polyfill version of `atob`
 */
const atobPolyfill = (asc) => {
    // console.log('polyfilled');
    asc = asc.replace(/\s+/g, '');
    if (!b64re.test(asc))
        throw new TypeError('malformed base64.');
    asc += '=='.slice(2 - (asc.length & 3));
    let u24, bin = '', r1, r2;
    for (let i = 0; i < asc.length;) {
        u24 = b64tab[asc.charAt(i++)] << 18
            | b64tab[asc.charAt(i++)] << 12
            | (r1 = b64tab[asc.charAt(i++)]) << 6
            | (r2 = b64tab[asc.charAt(i++)]);
        bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
            : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
                : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
    }
    return bin;
};
/**
 * does what `window.atob` of web browsers do.
 * @param {String} asc Base64-encoded string
 * @returns {string} binary string
 */
const _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))
    : _hasBuffer ? (asc) => base64_Buffer.from(asc, 'base64').toString('binary')
        : atobPolyfill;
//
const _toUint8Array = _hasBuffer
    ? (a) => _U8Afrom(base64_Buffer.from(a, 'base64'))
    : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));
/**
 * converts a Base64 string to a Uint8Array.
 */
const base64_toUint8Array = (a) => _toUint8Array(_unURI(a));
//
const _decode = _hasBuffer
    ? (a) => base64_Buffer.from(a, 'base64').toString('utf8')
    : base64_TD
        ? (a) => base64_TD.decode(_toUint8Array(a))
        : (a) => btou(_atob(a));
const _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));
/**
 * converts a Base64 string to a UTF-8 string.
 * @param {String} src Base64 string.  Both normal and URL-safe are supported
 * @returns {string} UTF-8 string
 */
const decode = (src) => _decode(_unURI(src));
/**
 * check if a value is a valid Base64 string
 * @param {String} src a value to check
  */
const isValid = (src) => {
    if (typeof src !== 'string')
        return false;
    const s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
    return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
};
//
const _noEnum = (v) => {
    return {
        value: v, enumerable: false, writable: true, configurable: true
    };
};
/**
 * extend String.prototype with relevant methods
 */
const extendString = function () {
    const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));
    _add('fromBase64', function () { return decode(this); });
    _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });
    _add('toBase64URI', function () { return encode(this, true); });
    _add('toBase64URL', function () { return encode(this, true); });
    _add('toUint8Array', function () { return base64_toUint8Array(this); });
};
/**
 * extend Uint8Array.prototype with relevant methods
 */
const extendUint8Array = function () {
    const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));
    _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });
    _add('toBase64URI', function () { return fromUint8Array(this, true); });
    _add('toBase64URL', function () { return fromUint8Array(this, true); });
};
/**
 * extend Builtin prototypes with relevant methods
 */
const extendBuiltins = () => {
    extendString();
    extendUint8Array();
};
const gBase64 = {
    version: version,
    VERSION: VERSION,
    atob: _atob,
    atobPolyfill: atobPolyfill,
    btoa: _btoa,
    btoaPolyfill: btoaPolyfill,
    fromBase64: decode,
    toBase64: encode,
    encode: encode,
    encodeURI: base64_encodeURI,
    encodeURL: base64_encodeURI,
    utob: utob,
    btou: btou,
    decode: decode,
    isValid: isValid,
    fromUint8Array: fromUint8Array,
    toUint8Array: base64_toUint8Array,
    extendString: extendString,
    extendUint8Array: extendUint8Array,
    extendBuiltins: extendBuiltins
};
// makecjs:CUT //




















// and finally,


;// CONCATENATED MODULE: ./config/index.ts

function config_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function config_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? config_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : config_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

var branch = getBranchFromOrigin(true);
var config_config = {
  amazon: {
    s3: {
      cloudfront: window.cloudfrontBase,
      cloudfrontContent: window.cloudfrontContentBase,
      cloudfrontStatic: window.cloudfrontStaticBase,
      cloudfrontPrivate: window.cloudfrontPrivate
    }
  },
  graphapi: {
    endpoint: window.apiEndpoint
  },
  googleAnalytics: {
    enableGATracking: window.gaTracking === 'true'
  },
  statisticsEndpoint: window.statisticsEndpoint,
  leadFormEndpoint: window.leadFormEndpoint,
  siteBase: window.siteBase,
  appUrl: window.appUrl,
  enableWatermark: window.enableWatermark === 'true',
  enableCollectStats: window.enableCollectStats === 'true',
  downloadMode: window.downloadMode === 'true',
  exportName: window.exportName,
  recaptchaListKey: window.recaptchaListKey,
  orderEmailEndpoint: branch ? "".concat(window.orderEmailEndpoint, "_").concat(branch) : window.orderEmailEndpoint,
  signatureFetchUrl: window.signatureFetchUrl,
  signatureInterval: window.signatureInterval,
  env: window.env,
  interactivityElementsEndpoint: window.interactivityElementsEndpoint,
  interactivityResultsEndpoint: window.interactivityResultsEndpoint,
  trackOrdersEndpoint: window.trackOrdersEndpoint
};
/* harmony default export */ var config_0 = (config_objectSpread({}, config_config));
;// CONCATENATED MODULE: ../../modules/statistics/code/src/constants/index.ts
var WindowVisibility = {
  VISIBLE: 'visible',
  HIDDEN: 'hidden'
};
var StatsDevice = {
  DEVICE_DESKTOP: 0,
  DEVICE_TABLET: 1,
  DEVICE_MOBILE: 2
};
var StatsReferrer = {
  REFERRER_FLIPSNACK: 0,
  REFERRER_EMBED: 2
};
var StatsPingInterval = 5000; // Ping events interval (time event + view event) in milliseconds
var StatsEventFrequency = 500; // Min frequency to send stats request in milliseconds
var StatsTimeToSendViews = 2000; // Views are send only after 2 sec of interaction
;// CONCATENATED MODULE: ../../modules/statistics/code/src/utils/getStatsTime.ts
/**
 * Return time in milliseconds
 *
 * @return number
 */
/* harmony default export */ var getStatsTime = (function () {
  return Math.floor(new Date().getTime());
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/utils/fetchApi.ts
/**
 * Fetch Api
 *
 * @param url
 * @return Promise<Object>
 */
/* harmony default export */ var fetchApi = (function (url) {
  return new Promise(function (resolve, reject) {
    fetch(url, {
      keepalive: true
    }).then(function (response) {
      resolve(response);
    }).catch(function (e) {
      reject(e);
    });
  });
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/utils/sendStatistics.ts


/**
 * Send statistics to sqs
 *
 * @return Promise<boolean>
 */
/* harmony default export */ var sendStatistics = (function (data, endpoint) {
  return new Promise(function (resolve, reject) {
    if (!endpoint) {
      resolve(false);
    } else {
      var statisticsData = {
        ih: data.impressionHash,
        ch: data.collectionHash,
        cih: data.collectionItemHash,
        e: data.events,
        ts: Math.floor(new Date().getTime() / 1000)
      };

      // Send tracking data if it exists
      if (data.trackingData) {
        statisticsData.td = data.trackingData;
      }
      var payload = {
        Action: 'SendMessage',
        MessageBody: JSON.stringify(statisticsData)
      };
      fetchApi("".concat(endpoint, "?").concat(objectToURLParams(payload))).then(function (response) {
        resolve(!!response);
      }).catch(function (e) {
        reject(e);
      });
    }
  });
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/hooks/useStatistics.ts






/**
    * Hook that registers events and sends them to the server
    * @param enableCollectStats - boolean that enables or disables the stats collection
    * @param statisticsEndpoint - the endpoint where the stats are sent
    * @param collectionHash - the collection hash
    * @param impressionHash - the impression hash
    * @param collectionItemHash - the collection item hash
    * @param trackingData - the tracking data
    * @param allowedEvents - the allowed events
*/
/* harmony default export */ var useStatistics = (function (enableCollectStats, statisticsEndpoint, collectionHash, impressionHash) {
  var collectionItemHash = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '';
  var trackingData = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : '';
  var allowedEvents = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : undefined;
  var eventList = (0,react.useRef)([]);
  var lastSentTime = (0,react.useRef)(getStatsTime() - 500);
  var sendStatsEvent = function sendStatsEvent() {
    // TODO: If the user closes the tab, we need to send the stats event immediately
    //  otherwise we lose data from events that were not sent,
    //  most likely the page view events thar are registered every 5sec
    if (enableCollectStats && document.visibilityState === WindowVisibility.VISIBLE) {
      var eventListLength = eventList.current.length;
      var statsEvents = toConsumableArray_toConsumableArray(eventList.current);

      // Remove events from the array - overwrite the array by reference
      eventList.current = eventList.current.slice(eventListLength);
      sendStatistics({
        impressionHash: impressionHash,
        collectionHash: collectionHash,
        collectionItemHash: collectionItemHash,
        events: statsEvents,
        trackingData: trackingData
      }, statisticsEndpoint).finally(function () {
        // TODO - this is not the best solution
        //  if sendStatistics is called n times in a row,
        //  it will send n requests before the first one is finished
        lastSentTime.current = getStatsTime();
      });
    }
  };
  var registerEvents = function registerEvents(events) {
    var _eventList$current;
    var newEvents = allowedEvents ? events.filter(function (event) {
      return allowedEvents.has(event.eid);
    }) : events;
    (_eventList$current = eventList.current).push.apply(_eventList$current, toConsumableArray_toConsumableArray(newEvents));
    if (eventList.current.length && getStatsTime() - lastSentTime.current > StatsEventFrequency) {
      sendStatsEvent();
    }
  };
  return {
    registerEvents: registerEvents
  };
});
;// CONCATENATED MODULE: ../../modules/utils/code/types/src/configType.ts
var RenderAreas = /*#__PURE__*/function (RenderAreas) {
  RenderAreas["EDITOR"] = "editor";
  RenderAreas["DETAILS"] = "details";
  RenderAreas["EMBED"] = "embed";
  return RenderAreas;
}({});
// EXTERNAL MODULE: ../../modules/utils/code/types/src/fontsType.ts
var fontsType = __webpack_require__(8404);
// EXTERNAL MODULE: ../../modules/utils/code/types/src/graphapiType.ts
var graphapiType = __webpack_require__(7592);
;// CONCATENATED MODULE: ../../modules/utils/code/types/src/playerTypes.ts
var playerTypes_PlayerBackgroundTypes = /*#__PURE__*/function (PlayerBackgroundTypes) {
  PlayerBackgroundTypes["COLOR"] = "color";
  PlayerBackgroundTypes["IMAGE"] = "image";
  PlayerBackgroundTypes["PATTERN"] = "pattern";
  return PlayerBackgroundTypes;
}({});
var playerTypes_PlayerLayoutTypes = /*#__PURE__*/function (PlayerLayoutTypes) {
  PlayerLayoutTypes["SINGLE"] = "singlePage";
  PlayerLayoutTypes["DOUBLE"] = "doublePage";
  PlayerLayoutTypes["SMART"] = "smartView";
  return PlayerLayoutTypes;
}({});
var src_playerTypes_PlayerEffect = /*#__PURE__*/function (PlayerEffect) {
  PlayerEffect["SLIDE"] = "slide";
  PlayerEffect["SCROLL"] = "scroll";
  PlayerEffect["FLIP"] = "flip";
  return PlayerEffect;
}({});
var playerTypes_SkinTypes = /*#__PURE__*/function (SkinTypes) {
  SkinTypes["CLASSIC"] = "classic";
  SkinTypes["MODERN"] = "default";
  SkinTypes["WIDGET_MODERN"] = "player";
  return SkinTypes;
}({});
var PreviewModes = /*#__PURE__*/function (PreviewModes) {
  PreviewModes["DESKTOP_VIEW"] = "desktop";
  PreviewModes["MOBILE_VIEW"] = "mobile";
  return PreviewModes;
}({});
// EXTERNAL MODULE: ../../modules/utils/code/types/src/resourceType.ts
var resourceType = __webpack_require__(8184);
;// CONCATENATED MODULE: ../../modules/utils/code/types/src/statsType.ts
/*
eid: event id
elid: element id
pid: page id
d: device
s: referrer
 */

var StatsType = /*#__PURE__*/function (StatsType) {
  StatsType[StatsType["IMPRESSION"] = 1] = "IMPRESSION";
  StatsType[StatsType["VIEW"] = 2] = "VIEW";
  StatsType[StatsType["TIME"] = 3] = "TIME";
  StatsType[StatsType["DOWNLOAD_COLLECTION"] = 4] = "DOWNLOAD_COLLECTION";
  StatsType[StatsType["DOWNLOAD_ITEM"] = 5] = "DOWNLOAD_ITEM";
  // Deprecated
  StatsType[StatsType["VIEW_PAGE"] = 6] = "VIEW_PAGE";
  StatsType[StatsType["CLICK_ELEMENT"] = 7] = "CLICK_ELEMENT";
  StatsType[StatsType["CLICK_LINK"] = 8] = "CLICK_LINK";
  // Deprecated
  StatsType[StatsType["VIEW_ITEM"] = 9] = "VIEW_ITEM";
  StatsType[StatsType["TIME_PAGE"] = 10] = "TIME_PAGE";
  StatsType[StatsType["PRINT"] = 11] = "PRINT";
  StatsType[StatsType["OPEN_FORM"] = 12] = "OPEN_FORM"; // Event for open form (ex: quiz, contact form, question)
  return StatsType;
}({});
;// CONCATENATED MODULE: ../../modules/utils/code/types/src/urlType.ts
// TODO Clean this file from unused types

var UrlType = {
  PROFILE: 'profile',
  SHARE: 'share'
};
;// CONCATENATED MODULE: ../../modules/utils/code/types/src/index.ts










;// CONCATENATED MODULE: ../../modules/statistics/code/src/hooks/useViewEvents.ts






/* harmony default export */ var useViewEvents = (function (registerEvents, enableCollectStats, memoizedEventCallbacks) {
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    firstImpressionEventSent = _useState2[0],
    setFirstImpressionEventSent = _useState2[1];
  var lastSentTime = (0,react.useRef)(getStatsTime());
  var timeSpentOnPageInterval = (0,react.useRef)(0);
  (0,react.useEffect)(function () {
    // Send impression once
    if (!firstImpressionEventSent && enableCollectStats) {
      var sendFirstViewEvent = function sendFirstViewEvent() {
        registerEvents([{
          eid: StatsType.IMPRESSION
        }]);
        setFirstImpressionEventSent(true);
        lastSentTime.current = getStatsTime();
      };
      var windowVisibilityChange = function windowVisibilityChange() {
        if (document.visibilityState === WindowVisibility.VISIBLE) {
          // TODO:: also send user first interaction
          sendFirstViewEvent();
        }
      };

      // Send impression and first view event
      if (document.visibilityState === WindowVisibility.VISIBLE) {
        // TODO:: also send user first interaction
        sendFirstViewEvent();
      } else {
        // In case the document is not visible - when opening new tab without focus  - we need to
        // add an event listener in order to detect when the tab becomes visible
        document.addEventListener('visibilitychange', windowVisibilityChange);
      }
      return function () {
        document.removeEventListener('visibilitychange', windowVisibilityChange);
      };
    }

    // Empty cleanup - nothing to do
    return function () {};
  }, [firstImpressionEventSent]);
  (0,react.useEffect)(function () {
    var stopTimeSpentOnPageInterval = function stopTimeSpentOnPageInterval() {
      if (timeSpentOnPageInterval.current) {
        clearInterval(timeSpentOnPageInterval.current);
        timeSpentOnPageInterval.current = 0;
        // Send time spent on page event when the interval is stopped to send the remaining time
        var events = memoizedEventCallbacks.reduce(function (acc, callback) {
          return [].concat(toConsumableArray_toConsumableArray(acc), toConsumableArray_toConsumableArray(callback(getStatsTime() - lastSentTime.current)));
        }, []);
        registerEvents(events);
      }
    };
    var createTimeSpentOnPageInterval = function createTimeSpentOnPageInterval() {
      stopTimeSpentOnPageInterval();
      lastSentTime.current = getStatsTime();

      // Send time spent on page event periodically (StatsPingInterval)
      // In case the interval is stopped - send the remaining time that was not sent before x seconds
      // For example: if the interval is stopped after 3 seconds - send the remaining 3 seconds spent on page
      timeSpentOnPageInterval.current = window.setInterval(function () {
        if (document.visibilityState === WindowVisibility.VISIBLE) {
          var events = memoizedEventCallbacks.reduce(function (acc, callback) {
            return [].concat(toConsumableArray_toConsumableArray(acc), toConsumableArray_toConsumableArray(callback(getStatsTime() - lastSentTime.current)));
          }, []);
          registerEvents(events);
        }
        lastSentTime.current = getStatsTime();
      }, StatsPingInterval);
    };
    var toggleOnVisibilityChange = function toggleOnVisibilityChange() {
      if (document.visibilityState === WindowVisibility.VISIBLE) {
        createTimeSpentOnPageInterval();
      } else {
        stopTimeSpentOnPageInterval();
      }
    };

    // Send page view events and send time spent on page periodically
    // Do not send any events until first view event is not sent.
    if (firstImpressionEventSent && enableCollectStats && memoizedEventCallbacks.length !== 0) {
      createTimeSpentOnPageInterval();
      document.addEventListener('visibilitychange', toggleOnVisibilityChange);
    }
    return function () {
      stopTimeSpentOnPageInterval();
      document.removeEventListener('visibilitychange', toggleOnVisibilityChange);
    };
  }, [firstImpressionEventSent, enableCollectStats, memoizedEventCallbacks]);
  return {
    firstImpressionEventSent: firstImpressionEventSent
  };
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/events/getDeviceType.ts



/**
 * Returns the device type
 * @return number
 */
/* harmony default export */ var getDeviceType = (function () {
  if (main/* isMobileOnly */.XF) {
    return StatsDevice.DEVICE_MOBILE;
  }
  if (main/* isTablet */.v1) {
    return StatsDevice.DEVICE_TABLET;
  }
  return StatsDevice.DEVICE_DESKTOP;
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/events/getPageTimeEvent.ts


/**
 * Return page time event
 *
 * @param pageId
 * @param timeSpent
 * @return Object
 */
/* harmony default export */ var getPageTimeEvent = (function (pageId, timeSpent) {
  return {
    eid: StatsType.TIME_PAGE,
    pid: pageId,
    t: timeSpent
  };
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/events/getPageViewEvent.ts


/**
 * Return page view event
 *
 * @param pageId
 * @return Object
 */
/* harmony default export */ var getPageViewEvent = (function (pageId) {
  return {
    eid: StatsType.VIEW_PAGE,
    pid: pageId
  };
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/events/getTimeEvent.ts


/**
 * Return stats time event
 *
 * @param timeSpent
 * @return Object
 */
/* harmony default export */ var getTimeEvent = (function (timeSpent) {
  return {
    eid: StatsType.TIME,
    t: timeSpent
  };
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/events/getPingEvents.ts



/**
 * Return ping events
 *
 * @param pageIds
 * @param timeSpent
 * @return Array<object>
 */
/* harmony default export */ var getPingEvents = (function (pageIds, timeSpent) {
  var events = [getTimeEvent(timeSpent)];
  pageIds.forEach(function (pageId) {
    events.push(getPageTimeEvent(pageId, timeSpent));
  });
  return events;
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/events/getReferrerType.ts




/**
 * Returns the referrer type
 * @return number
 */
/* harmony default export */ var getReferrerType = (function () {
  var url = getCurrentUrl();
  if (isOnFlipsnackDomain(url) || isOnFlipsnackCustomDomain(url)) {
    return StatsReferrer.REFERRER_FLIPSNACK;
  }
  return StatsReferrer.REFERRER_EMBED;
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/utils/isOnFlipsnackAdminDomain.ts
/**
 * Check if reader is embedded on Flipsnack admin
 *
 * @return boolean
 */
/* harmony default export */ var isOnFlipsnackAdminDomain = (function () {
  var ref = document.referrer || window.location.hostname;
  var flipsnackDomains = ['(http(s?)://)?admin.flipsnack.com', '(http(s?)://)?admin-prelive.flipsnack.com', '(http(s?)://)?[a-z0-9-.]*admin.flipsnack.net', '(http(s?)://)?admin.flipsnack.io'];
  var regex = new RegExp(flipsnackDomains.join('|'), 'i');
  return regex.test(ref);
});
;// CONCATENATED MODULE: ../../modules/statistics/code/src/index.ts
// HOOKS



// EVENTS







// UTILS


// CONSTANTS

// EXTERNAL MODULE: ../../modules/bookshelf/code/node_modules/fscreen/lib/index.js
var fscreen_lib = __webpack_require__(1062);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/constants/index.ts
var WAIT_USER_INTERACTION_MS = 100;

// We use the A4 ratio to calculate the max thumb height
var THUMB_CONTAINER_RATIO = 0.77;
var FLIPBOOK_CARD_MARGIN = 10;
var SHELF_ROW_MARGIN_BOTTOM = 40;
var SHELF_PADDING = 20;
var MAX_SHELF_THUMB_ITEM_WIDTH = 150;
var FlipbookVisibilityType = {
  PUBLIC: 'PUBLIC',
  UNLISTED: 'UNLISTED',
  PRIVATE: 'PRIVATE_EMAIL',
  SHARED: 'SHARED',
  SHARED_TEAM: 'SHARED_TEAM'
};
var BackgroundTypes = {
  COLOR: 'color',
  IMAGE: 'image'
};
var BackgroundScaleTypes = {
  SCALE_CROP: 'scaleCrop',
  CENTER: 'center',
  TILE: 'tile'
};
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/constants/defaultConfig.ts
var defaultConfig_config = {
  cdnBase: '',
  cdnContent: '',
  cdnStatic: '',
  siteBase: '',
  siteAppUrl: '',
  statisticsEndpoint: '',
  leadFormEndpoint: '',
  enableCollectStats: false,
  enableGATracking: false,
  fullscreenUrl: '',
  enableWatermark: false,
  accountId: '',
  recaptchaListKey: '',
  orderEmailEndpoint: '',
  interactivityElementsEndpoint: '',
  interactivityResultsEndpoint: '',
  trackOrdersEndpoint: ''
};
/* harmony default export */ var defaultConfig = (defaultConfig_config);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/contexts/FlipbookOpenDataContext.tsx

var FlipbookRequestContextDefault = {
  setOpenFlipbook: function setOpenFlipbook() {},
  openFlipbook: false
};
var FlipbookOpenDataContext = /*#__PURE__*/react.createContext(FlipbookRequestContextDefault);
var FlipbookOpenDataProvider = FlipbookOpenDataContext.Provider;
/* harmony default export */ var contexts_FlipbookOpenDataContext = (FlipbookOpenDataContext);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/contexts/FlipbookRequestContext.tsx

var FlipbookRequestContext_FlipbookRequestContextDefault = {
  getFlipbookJson: function getFlipbookJson() {}
};
var FlipbookRequestContext = /*#__PURE__*/react.createContext(FlipbookRequestContext_FlipbookRequestContextDefault);
var FlipbookRequestProvider = FlipbookRequestContext.Provider;
/* harmony default export */ var contexts_FlipbookRequestContext = (FlipbookRequestContext);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/propTypes.ts


/* ------ Bookshelf props -------- */

var configProps = {
  config: prop_types_default().shape({
    cdnBase: (prop_types_default()).string.isRequired,
    cdnStatic: (prop_types_default()).string.isRequired,
    cdnContent: (prop_types_default()).string.isRequired,
    siteBase: (prop_types_default()).string.isRequired,
    siteAppUrl: (prop_types_default()).string.isRequired,
    enableGATracking: (prop_types_default()).bool.isRequired,
    enableCollectStats: (prop_types_default()).bool.isRequired,
    statisticsEndpoint: (prop_types_default()).string.isRequired,
    leadFormEndpoint: (prop_types_default()).string.isRequired,
    fullscreenUrl: (prop_types_default()).string.isRequired,
    enableWatermark: (prop_types_default()).bool.isRequired,
    accountId: (prop_types_default()).string.isRequired,
    recaptchaListKey: (prop_types_default()).string.isRequired,
    orderEmailEndpoint: (prop_types_default()).string.isRequired
  }).isRequired
};
var propertiesProps = {
  properties: prop_types_default().shape({
    title: (prop_types_default()).string.isRequired,
    description: (prop_types_default()).string.isRequired,
    link: prop_types_default().shape({
      name: (prop_types_default()).string.isRequired,
      profile: (prop_types_default()).string.isRequired,
      domain: (prop_types_default()).string.isRequired
    }).isRequired,
    type: (prop_types_default()).string.isRequired,
    visibility: (prop_types_default()).string.isRequired,
    resourceVersion: (prop_types_default()).number.isRequired
  }).isRequired
};
var optionsProps = {
  options: prop_types_default().shape({
    background: prop_types_default().shape({
      color: (prop_types_default()).string.isRequired,
      opacity: (prop_types_default()).number.isRequired,
      src: (prop_types_default()).string.isRequired,
      type: (prop_types_default()).string.isRequired,
      scale: (prop_types_default()).string.isRequired
    }).isRequired,
    shelfColor: (prop_types_default()).string.isRequired,
    width: (prop_types_default()).number.isRequired,
    height: (prop_types_default()).number.isRequired,
    language: (prop_types_default()).string.isRequired,
    itemsWidth: (prop_types_default()).number.isRequired,
    restrictedDomainsSettings: prop_types_default().shape({
      useRestrictedDomains: (prop_types_default()).bool.isRequired,
      restrictedDomains: prop_types_default().arrayOf((prop_types_default()).string.isRequired).isRequired
    }).isRequired,
    openInNewTab: (prop_types_default()).bool.isRequired,
    showSearchInBookshelf: (prop_types_default()).bool.isRequired,
    logoImage: (prop_types_default()).string.isRequired,
    logoImageURL: (prop_types_default()).string.isRequired,
    logoImageLocation: (prop_types_default()).string,
    showFlipbookTitleOnHover: (prop_types_default()).bool.isRequired
  }).isRequired
};
var featuresProps = {
  features: prop_types_default().shape({
    FLIP_PAGES: (prop_types_default()).number.isRequired,
    FLIP_FILES: (prop_types_default()).number.isRequired,
    WIDGET_NO_WATERMARK: (prop_types_default()).bool.isRequired,
    WIDGET_RTL_ORIENTATION: (prop_types_default()).bool.isRequired,
    WIDGET_SINGLE_PAGE_VIEW: (prop_types_default()).bool.isRequired,
    WIDGET_SEARCH: (prop_types_default()).bool.isRequired,
    CUSTOM_FONTS: (prop_types_default()).bool.isRequired,
    WIDGET_SHELF: (prop_types_default()).bool.isRequired,
    WIDGET_LOGO: (prop_types_default()).bool.isRequired,
    WIDGET_PASSWORD: (prop_types_default()).bool.isRequired,
    WIDGET_ANALYTICS: (prop_types_default()).bool.isRequired,
    WIDGET_PRINT: (prop_types_default()).bool.isRequired,
    WIDGET_MEDIA: (prop_types_default()).bool.isRequired,
    WIDGET_TAGS: (prop_types_default()).bool.isRequired,
    WIDGET_FORMS: (prop_types_default()).bool.isRequired,
    WIDGET_SHOPPING: (prop_types_default()).bool.isRequired,
    WIDGET_DOMAIN_RESTRICTIONS: (prop_types_default()).bool.isRequired,
    DOWNLOAD_PDF: (prop_types_default()).bool.isRequired,
    LAYOUTS: (prop_types_default()).bool.isRequired,
    TABLE_OF_CONTENT: (prop_types_default()).bool.isRequired,
    LINKS_FROM_TEXT: (prop_types_default()).bool.isRequired,
    EMBED: (prop_types_default()).bool.isRequired,
    UPLOAD_VIDEO: (prop_types_default()).bool.isRequired,
    PRODUCT_TAG: (prop_types_default()).bool.isRequired,
    POPUP_FRAME: (prop_types_default()).bool.isRequired,
    SPOTLIGHT: (prop_types_default()).bool.isRequired
  }).isRequired
};
var flipbookProps = prop_types_default().shape({
  hash: (prop_types_default()).string.isRequired,
  name: (prop_types_default()).string.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  linkName: (prop_types_default()).string.isRequired,
  coverPath: (prop_types_default()).string.isRequired
}).isRequired;
var collectionsProps = {
  collection: prop_types_default().arrayOf(flipbookProps).isRequired
};
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/constants/defaultJsonValues.ts
var defaultJsonValues_defaultOptions = {
  background: {
    color: '',
    opacity: 1
  },
  shelfColor: '',
  width: 0,
  height: 0,
  language: 'English',
  itemsWidth: 100,
  restrictedDomainsSettings: {
    useRestrictedDomains: false,
    restrictedDomains: []
  },
  openInNewTab: false,
  showSearchInBookshelf: false,
  showFlipbookTitleOnHover: false,
  logoImage: '',
  logoImageURL: '',
  logoImageLocation: ''
};
var defaultJsonValues_defaultFeatures = {
  FLIP_PAGES: 15,
  FLIP_FILES: 3,
  WIDGET_NO_WATERMARK: false,
  WIDGET_RTL_ORIENTATION: false,
  WIDGET_SINGLE_PAGE_VIEW: false,
  WIDGET_SEARCH: false,
  CUSTOM_FONTS: false,
  WIDGET_SHELF: false,
  WIDGET_LOGO: false,
  WIDGET_PASSWORD: false,
  WIDGET_ANALYTICS: false,
  WIDGET_PRINT: false,
  WIDGET_MEDIA: false,
  WIDGET_TAGS: false,
  WIDGET_FORMS: false,
  WIDGET_SHOPPING: false,
  WIDGET_DOMAIN_RESTRICTIONS: false,
  DOWNLOAD_PDF: false,
  LAYOUTS: false,
  TABLE_OF_CONTENT: false,
  LINKS_FROM_TEXT: false,
  EMBED: false,
  UPLOAD_VIDEO: false,
  PRODUCT_TAG: false,
  POPUP_FRAME: false,
  SPOTLIGHT: false
};
var defaultJsonValues_defaultProperties = {
  title: '',
  description: '',
  link: {
    name: '',
    profile: '',
    domain: ''
  },
  type: '',
  visibility: '',
  userProfile: '',
  resourceVersion: 1
};
var defaultJsonValues_defaultNewJson = {
  collection: [],
  options: defaultJsonValues_defaultOptions,
  properties: defaultJsonValues_defaultProperties,
  features: defaultJsonValues_defaultFeatures,
  trackingData: ''
};
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/contexts/BookshelfJsonContext.tsx

function BookshelfJsonContext_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function BookshelfJsonContext_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? BookshelfJsonContext_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : BookshelfJsonContext_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }



var defaultValue = BookshelfJsonContext_objectSpread(BookshelfJsonContext_objectSpread({
  config: BookshelfJsonContext_objectSpread({}, defaultConfig)
}, defaultJsonValues_defaultNewJson), {}, {
  signature: '',
  hash: ''
});
var BookshelfContext = /*#__PURE__*/react.createContext(defaultValue);
/* harmony default export */ var BookshelfJsonContext = (BookshelfContext);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/providers/ShelfJsonProvider/ShelfJsonProvider.tsx

function ShelfJsonProvider_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function ShelfJsonProvider_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ShelfJsonProvider_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ShelfJsonProvider_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }




var ShelfJsonProvider = function ShelfJsonProvider(props) {
  var ShelfProviderValue = (0,react.useMemo)(function () {
    return {
      config: props.config,
      properties: props.properties,
      collection: props.collection,
      features: props.features,
      options: props.options,
      trackingData: props.trackingData,
      signature: props.signature,
      hash: props.hash
    };
  }, [props.shelfJsonHashCode]);
  return /*#__PURE__*/react.createElement(BookshelfJsonContext.Provider, {
    value: ShelfProviderValue
  }, props.children);
};
ShelfJsonProvider.propTypes = ShelfJsonProvider_objectSpread(ShelfJsonProvider_objectSpread(ShelfJsonProvider_objectSpread(ShelfJsonProvider_objectSpread(ShelfJsonProvider_objectSpread(ShelfJsonProvider_objectSpread({}, collectionsProps), optionsProps), configProps), propertiesProps), featuresProps), {}, {
  trackingData: (prop_types_default()).string.isRequired,
  shelfJsonHashCode: (prop_types_default()).number.isRequired
});
/* harmony default export */ var ShelfJsonProvider_ShelfJsonProvider = (ShelfJsonProvider);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/providers/ShelfJsonProvider/index.ts

;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/utils/getImageCss.ts

/* harmony default export */ var getImageCss = (function (backgroundObj, configObj) {
  var backgroundImageUrl = "".concat(configObj.cdnBase, "/collections/customize/").concat(backgroundObj.src);
  switch (backgroundObj.scale) {
    case BackgroundScaleTypes.SCALE_CROP:
      return {
        backgroundImage: "url('".concat(backgroundImageUrl, "?v=1')"),
        backgroundSize: 'cover',
        backgroundPosition: 'center center'
      };
    case BackgroundScaleTypes.CENTER:
      return {
        backgroundImage: "url('".concat(backgroundImageUrl, "?v=1')"),
        backgroundRepeat: 'no-repeat',
        backgroundPosition: 'center'
      };
    default:
      return {
        backgroundImage: "url('".concat(backgroundImageUrl, "?v=1')")
      };
  }
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/utils/getBackgroundCss.ts


/* harmony default export */ var getBackgroundCss = (function (_ref) {
  var $background = _ref.$background,
    $config = _ref.$config;
  if ($background.type === BackgroundTypes.IMAGE) {
    return getImageCss($background, $config);
  }
  return {
    background: $background.opacity !== 0 ? $background.color : 'transparent'
  };
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/BookshelfContainer/BookshelfContainer.styles.tsx


var backgroundCss = Ce(["", ""], function (bookshelfContainerProps) {
  return getBackgroundCss(bookshelfContainerProps);
});
var BookshelfContainer = styled_components_browser_esm.div.withConfig({
  displayName: "BookshelfContainerstyles__BookshelfContainer",
  componentId: "sc-9pxkls-0"
})(["height:100%;justify-content:center;align-items:center;z-index:1;position:relative;", ""], backgroundCss);
var BookshelfPlayerContainer = styled_components_browser_esm.div.withConfig({
  displayName: "BookshelfContainerstyles__BookshelfPlayerContainer",
  componentId: "sc-9pxkls-1"
})([""]);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/BackgroundContainer/BackgroundContainer.tsx



var BackgroundContainer = function BackgroundContainer(props) {
  var _useContext = (0,react.useContext)(BookshelfJsonContext),
    config = _useContext.config;
  return /*#__PURE__*/react.createElement(BookshelfContainer, {
    $background: props.background,
    $config: config
  }, props.children);
};
/* harmony default export */ var BackgroundContainer_BackgroundContainer = (BackgroundContainer);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/BackgroundContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/contexts/ActivePageContext.ts

var ActivePageContext_defaultValue = {
  activePageIndex: 0,
  setActivePageIndex: function setActivePageIndex() {}
};
var ActivePageContext = /*#__PURE__*/react.createContext(ActivePageContext_defaultValue);
/* harmony default export */ var contexts_ActivePageContext = (ActivePageContext);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/providers/ActivePageProvider/ActivePageProvider.tsx




var ActivePageProvider = function ActivePageProvider(props) {
  var _useState = (0,react.useState)(0),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    activePageIndex = _useState2[0],
    setActivePageIndex = _useState2[1];
  var value = (0,react.useMemo)(function () {
    return {
      activePageIndex: activePageIndex,
      setActivePageIndex: setActivePageIndex
    };
  }, [activePageIndex]);
  return /*#__PURE__*/react.createElement(contexts_ActivePageContext.Provider, {
    value: value
  }, props.children);
};
ActivePageProvider.propTypes = {
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var ActivePageProvider_ActivePageProvider = (ActivePageProvider);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/providers/ActivePageProvider/index.ts

;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/contexts/BookshelfDataContext.tsx

var BookshelfDataContext_defaultValue = {
  nrOfPages: 1,
  setNrOfPages: function setNrOfPages() {}
};
var BookshelfDataContext = /*#__PURE__*/react.createContext(BookshelfDataContext_defaultValue);
/* harmony default export */ var contexts_BookshelfDataContext = (BookshelfDataContext);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/NavigationContainer/NavigationContainer.styles.ts

var NavigationContainer_styles_NavigationContainer = styled_components_browser_esm.div.withConfig({
  displayName: "NavigationContainerstyles__NavigationContainer",
  componentId: "sc-ej1unx-0"
})(["display:flex;flex-direction:row;align-items:center;width:100%;height:100%;"]);
var ArrowContainer = styled_components_browser_esm.div.withConfig({
  displayName: "NavigationContainerstyles__ArrowContainer",
  componentId: "sc-ej1unx-1"
})(["width:60px;height:60px;position:absolute;z-index:2;right:", ";left:", ";"], function (props) {
  var _props$$position;
  return ((_props$$position = props.$position) === null || _props$$position === void 0 ? void 0 : _props$$position.right) || 'unset';
}, function (props) {
  var _props$$position2;
  return ((_props$$position2 = props.$position) === null || _props$$position2 === void 0 ? void 0 : _props$$position2.left) || 'unset';
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/theme/defaultBookshelf.ts
var DefaultColors = {
  black: '#000000',
  white: '#fff'
};
var DefaultComponentsStyle = {
  navigationButton: {
    color: DefaultColors.white,
    borderColor: DefaultColors.black
  }
};
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/IconButton/IconButton.styles.ts

var IconButton_styles_IconButton = styled_components_browser_esm.button.withConfig({
  displayName: "IconButtonstyles__IconButton",
  componentId: "sc-1cl8yye-0"
})(["background:transparent;border:none;", ""], function (props) {
  return !props.disabled ? 'cursor: pointer;' : 'pointer-events: none;';
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/IconButton/IconButton.tsx



var components_IconButton_IconButton_IconButton = function IconButton(props) {
  var attributes = {
    disabled: props.disabled,
    'aria-label': props.ariaLabel,
    type: 'button',
    onClick: props.onClick,
    tabIndex: props.tabIndex,
    role: props.role
  };
  return /*#__PURE__*/react.createElement(IconButton_styles_IconButton, attributes, props.children);
};
components_IconButton_IconButton_IconButton.propTypes = {
  disabled: (prop_types_default()).bool,
  onClick: (prop_types_default()).func.isRequired,
  ariaLabel: (prop_types_default()).string.isRequired,
  tabIndex: (prop_types_default()).number,
  role: (prop_types_default()).string
};
components_IconButton_IconButton_IconButton.defaultProps = {
  disabled: false,
  tabIndex: 1,
  role: 'button'
};
/* harmony default export */ var components_IconButton_IconButton = (components_IconButton_IconButton_IconButton);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/IconButton/index.tsx

;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/NavigationContainer/NavigationContainer.tsx








var NavigationContainer = function NavigationContainer(props) {
  var _useContext = (0,react.useContext)(contexts_ActivePageContext),
    activePageIndex = _useContext.activePageIndex,
    setActivePageIndex = _useContext.setActivePageIndex;
  var _useContext2 = (0,react.useContext)(contexts_BookshelfDataContext),
    nrOfPages = _useContext2.nrOfPages;
  var setNextPage = function setNextPage() {
    setActivePageIndex(activePageIndex + 1);
  };
  var setPrevPage = function setPrevPage() {
    setActivePageIndex(activePageIndex - 1);
  };
  return (0,react.useMemo)(function () {
    return /*#__PURE__*/react.createElement(NavigationContainer_styles_NavigationContainer, null, /*#__PURE__*/react.createElement(ArrowContainer, {
      $position: {
        left: '0'
      }
    }, activePageIndex > 0 && /*#__PURE__*/react.createElement(components_IconButton_IconButton, {
      ariaLabel: "Previous page",
      onClick: setPrevPage,
      tabIndex: TabIndex.DEFAULT,
      role: "button"
    }, /*#__PURE__*/react.createElement(src.WidgetPreviousPage, {
      color: DefaultComponentsStyle.navigationButton.color,
      borderColor: DefaultComponentsStyle.navigationButton.borderColor
    }))), props.children, /*#__PURE__*/react.createElement(ArrowContainer, {
      $position: {
        right: '0'
      }
    }, nrOfPages > 0 && activePageIndex < nrOfPages - 1 && /*#__PURE__*/react.createElement(components_IconButton_IconButton, {
      ariaLabel: "Next page",
      onClick: setNextPage,
      tabIndex: TabIndex.DEFAULT,
      role: "button"
    }, /*#__PURE__*/react.createElement(src.WidgetNextPage, {
      color: DefaultComponentsStyle.navigationButton.color,
      borderColor: DefaultComponentsStyle.navigationButton.borderColor
    }))));
  }, [nrOfPages, activePageIndex]);
};
/* harmony default export */ var NavigationContainer_NavigationContainer = (NavigationContainer);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/NavigationContainer/index.ts

// EXTERNAL MODULE: ./node_modules/lodash/lodash.js
var lodash = __webpack_require__(2543);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/hooks/useResize.ts




/**
 * Custom hook for resize event
 * @param elementRef
 * @return Object
 */
/* harmony default export */ var useResize = (function (elementRef) {
  var _useState = (0,react.useState)({
      width: 0,
      height: 0
    }),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    size = _useState2[0],
    setSize = _useState2[1];
  var handleResize = function handleResize() {
    if (elementRef !== null && elementRef !== void 0 && elementRef.current) {
      var _elementRef$current, _elementRef$current2;
      setSize({
        width: ((_elementRef$current = elementRef.current) === null || _elementRef$current === void 0 ? void 0 : _elementRef$current.offsetWidth) || 0,
        height: ((_elementRef$current2 = elementRef.current) === null || _elementRef$current2 === void 0 ? void 0 : _elementRef$current2.offsetHeight) || 0
      });
    }
  };
  var debounceResizeRef = (0,react.useRef)((0,lodash.debounce)(handleResize, WAIT_USER_INTERACTION_MS));
  (0,react.useEffect)(function () {
    window.addEventListener('resize', debounceResizeRef.current);
    return function () {
      window.removeEventListener('resize', debounceResizeRef.current);
    };
  }, []);
  return size;
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/utils/getFillColor.ts


/**
 * Get fill color
 * @param {string} color
 * @param {number} opacity
 * @param {boolean} isImageBackgroundWithoutResults
 * @return {string}
 */
var getFillColor = function getFillColor(color, opacity, isImageBackgroundWithoutResults) {
  var isEmbed = window.location !== window.parent.location;
  var isTransparent = opacity === 0;
  if (!isTransparent && color && !isColorLighten(hexToRGB(color))) {
    return '#ffffff';
  }
  if (isTransparent && isEmbed && document.referrer && isOnFlipsnackDomain(document.referrer)) {
    return '#ffffff'; // Flipbook embedded on our direct link
  }
  if (isImageBackgroundWithoutResults) {
    return '#ffffff';
  }

  // Flipbook embedded on an external website
  // OR can not be determined, use black as default
  return '#000000';
};
/* harmony default export */ var utils_getFillColor = (getFillColor);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/utils/getLogoUrl.ts
/**
 * Get the logo's URL
 * @param {ConfigType} config
 * @param {JsonOptionsType} options
 * @param {string} bookshelfHash
 * @param {string} signature
 * @returns {string}
 */
/* harmony default export */ var getLogoUrl = (function (config, options, bookshelfHash, signature) {
  if (options.logoImage) {
    if (options.logoImageLocation) {
      if (signature) {
        return "".concat(config.privateContentCdn, "/").concat(config.accountId, "/collections/").concat(bookshelfHash, "/library/images/") + "".concat(options.logoImage, "?").concat(signature);
      }
      return "".concat(config.privateContentCdn, "/").concat(config.accountId, "/library/images/").concat(options.logoImage);
    }
    return "".concat(config.cdnBase, "/collections/customize/").concat(options.logoImage);
  }
  return '';
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/utils/getFallbackLogoUrl.ts
/**
 * Get the logo's URL
 * @param {ConfigType} config
 * @param {JsonOptionsType} options
 * @param {string} bookshelfHash
 * @param {string} signature
 * @returns {string}
 */
/* harmony default export */ var getFallbackLogoUrl = (function (config, options, bookshelfHash, signature) {
  if (options.logoImage) {
    if (options.logoImageLocation) {
      if (signature) {
        return "".concat(config.privateContentCdn, "/").concat(config.accountId, "/collections/").concat(bookshelfHash, "/logos/") + "".concat(options.logoImage, "?").concat(signature);
      }
      return "".concat(config.privateContentCdn, "/").concat(config.accountId, "/library/logos/").concat(options.logoImage);
    }
    return "".concat(config.cdnBase, "/collections/customize/").concat(options.logoImage);
  }
  return '';
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/Bookshelf/helpers/getBookshelfStructure.ts

/**
 * Receives and array of objects with the flipbook data and returns a structure for mapping and the nr of pages
 * receives[ {flip1}, {flip2}, {flip3}] =>  {
 *     structure: [
 *         [ [flip1], [flip2]]
 *         [  [flip3]]
 *     ],
 *     nrOfPages: 2
 * };
 * This means that we have 2 pages with 2 rows on page and1 flipbook on row
 * @param collection
 * @param itemsWidth
 * @param width
 * @param height
 * return the structured data
 */
/* harmony default export */ var getBookshelfStructure = (function (collection, itemsWidth, _ref) {
  var width = _ref.width,
    height = _ref.height;
  var structure = [];

  // The image container item height and width
  var itemHeight = Math.round(itemsWidth / THUMB_CONTAINER_RATIO) + 2 * FLIPBOOK_CARD_MARGIN + SHELF_ROW_MARGIN_BOTTOM;
  var itemWidth = itemsWidth + 2 * FLIPBOOK_CARD_MARGIN;
  var nrOfFlipOnRows = Math.trunc((width - 2 * SHELF_PADDING) / itemWidth) || 1;
  var nrOfRows = Math.trunc(height / itemHeight) || 1;
  var flipsPerPage = nrOfRows * nrOfFlipOnRows;
  var nrOfPages = Math.ceil(collection.length / flipsPerPage);
  var lastPageFlipIndex = 0;
  for (var pageIndex = 0; pageIndex < nrOfPages; pageIndex++) {
    var pageArray = [];
    var end = 0;
    for (var rowIndex = 0; rowIndex < nrOfRows; rowIndex++) {
      var start = rowIndex * nrOfFlipOnRows + lastPageFlipIndex;
      end = start + nrOfFlipOnRows;
      var flipRows = collection.slice(start, end);
      if (!flipRows || !flipRows.length) {
        break;
      }
      pageArray.push(collection.slice(start, end));
    }
    lastPageFlipIndex = end;
    structure.push(pageArray);
  }
  return {
    structure: structure,
    nrOfPages: nrOfPages
  };
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/FlipbookCard/FlipbookCard.styles.ts

var FlipbookCard_styles_ImageContainer = styled_components_browser_esm.div.withConfig({
  displayName: "FlipbookCardstyles__ImageContainer",
  componentId: "sc-12bnrjt-0"
})(["align-items:baseline;justify-content:center;display:flex;position:relative;width:", "px;height:", "px;margin:", "px;transition:transform 0.3s ease;img{transition:filter 0.3s ease;box-shadow:0 0 16px 4px rgba(0,0,0,0.08);}&:hover{transform:scale(1.05);top:-2px;img{filter:", ";}.title-container{display:flex;}}"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (props) {
  return props.$margin;
}, function (props) {
  return props.$showFlipbookTitleOnHover ? 'brightness(0.5)' : '';
});
var FlipbookCard_styles_Image = styled_components_browser_esm.img.withConfig({
  displayName: "FlipbookCardstyles__Image",
  componentId: "sc-12bnrjt-1"
})(["align-self:flex-end;justify-content:center;display:flex;max-width:100%;max-height:100%;"]);
var BlankCard = styled_components_browser_esm.div.withConfig({
  displayName: "FlipbookCardstyles__BlankCard",
  componentId: "sc-12bnrjt-2"
})(["background:#fff;width:100%;height:100%;"]);
var TitleContainer = styled_components_browser_esm.div.withConfig({
  displayName: "FlipbookCardstyles__TitleContainer",
  componentId: "sc-12bnrjt-3"
})(["position:absolute;display:none;align-items:flex-end;bottom:0;width:", ";height:", ";background:", ";"], function (props) {
  return "".concat(props.$width, "px");
}, function (props) {
  return "".concat(props.$height, "px");
}, function (props) {
  return !props.$imageLoadedSuccess ? 'rgba(0, 0, 0, 0.5)' : '';
});
var FlipbookCard_styles_Title = styled_components_browser_esm.div.withConfig({
  displayName: "FlipbookCardstyles__Title",
  componentId: "sc-12bnrjt-4"
})(["display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;font-weight:500;font-size:12px;line-height:12px;letter-spacing:0.15px;margin:8px;color:#FFFFFF;"]);
// EXTERNAL MODULE: ../../modules/widget-player/code/node_modules/base-64/base64.js
var base64 = __webpack_require__(9464);
var base64_default = /*#__PURE__*/__webpack_require__.n(base64);
// EXTERNAL MODULE: ./node_modules/js-cookie/src/js.cookie.js
var js_cookie = __webpack_require__(2215);
var js_cookie_default = /*#__PURE__*/__webpack_require__.n(js_cookie);
;// CONCATENATED MODULE: ../../modules/utils/code/helpers/src/getFullViewUrl.ts



/** Set the 'fd' parameter if the link comes from an iframe on the flipsnack domain.
 * @param {string} baseUrl
 * @param {object} paramsObj
 * @return {URL} URL
 */
/* harmony default export */ var getFullViewUrl = (function (baseUrl) {
  var paramsObj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  var url = new URL(baseUrl);
  for (var _i = 0, _Object$entries = Object.entries(paramsObj); _i < _Object$entries.length; _i++) {
    var _Object$entries$_i = slicedToArray_slicedToArray(_Object$entries[_i], 2),
      key = _Object$entries$_i[0],
      value = _Object$entries$_i[1];
    url.searchParams.append(key, value);
  }
  if (window.location !== window.parent.location && (isOnFlipsnackDomain(document.referrer) || isOnFlipsnackCustomDomain(document.referrer))) {
    url.searchParams.append('fd', 'true');
  }
  return url;
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/FlipbookCard/FlipbookLink.tsx







var FlipbookLink = function FlipbookLink(props) {
  var _useContext = (0,react.useContext)(BookshelfJsonContext),
    _useContext$config = _useContext.config,
    fullscreenUrl = _useContext$config.fullscreenUrl,
    siteBase = _useContext$config.siteBase,
    accountId = _useContext$config.accountId,
    trackingData = _useContext.trackingData;
  var url = new URL(fullscreenUrl);
  var baseUrl = '';
  var paramsObj = {};
  if (props.openInNewTab) {
    var customDomain = new URLSearchParams(window.location.search).get('cd');
    if (window.location !== window.parent.location && customDomain) {
      url = new URL("https://".concat(customDomain));
      baseUrl = "".concat(url.origin).concat(url.pathname).concat(props.linkName, "/full-view.html");
    } else {
      url = new URL(siteBase);
      baseUrl = "".concat(url.origin).concat(url.pathname).concat(props.profile, "/").concat(props.linkName, "/full-view.html");
    }

    // Added the p key to the query string of Flipbook links in a bookshelf.
    // This prevents URL caching issues
    paramsObj.p = '1';
  } else {
    baseUrl = "".concat(url.origin).concat(url.pathname);
    paramsObj.hash = base64_default().encode("".concat(accountId, "+").concat(props.hash));
  }
  if (trackingData) {
    paramsObj.td = trackingData;
  }
  var urlInterface = getFullViewUrl(baseUrl, paramsObj);
  var setFullscreenCookie = function setFullscreenCookie() {
    var cookieExpire = new Date(new Date().getTime() + 0.25 * 60 * 1000); // 15 sec.

    js_cookie_default().set('isFullscreenUrl', 'true', {
      expires: cookieExpire,
      domain: urlInterface.hostname
    });
  };
  return /*#__PURE__*/react.createElement("a", {
    href: urlInterface.href,
    target: "_blank",
    rel: "noreferrer",
    onClick: setFullscreenCookie,
    "aria-label": props.flipbookTitle,
    tabIndex: TabIndex.DEFAULT
  }, props.children);
};
FlipbookLink.propTypes = {
  hash: (prop_types_default()).string.isRequired
};
/* harmony default export */ var FlipbookCard_FlipbookLink = (FlipbookLink);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/FlipbookCard/FlipbookCard.tsx










var FlipbookCard = function FlipbookCard(props) {
  var _useContext = (0,react.useContext)(BookshelfJsonContext),
    _useContext$options = _useContext.options,
    openInNewTab = _useContext$options.openInNewTab,
    showFlipbookTitleOnHover = _useContext$options.showFlipbookTitleOnHover,
    profile = _useContext.properties.link.profile;
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    imageLoadedSuccess = _useState2[0],
    setImageLoadedSuccess = _useState2[1];
  var _useState3 = (0,react.useState)({
      width: props.width,
      height: Math.round(props.width / THUMB_CONTAINER_RATIO)
    }),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    size = _useState4[0],
    setSize = _useState4[1];
  var onClickOnFlipbook = function onClickOnFlipbook() {
    if (!main/* isSafari */.nr && main/* isMobile */.Fr || !main/* isMobile */.Fr && !openInNewTab) {
      props.onClick(props.hash);
    }
  };
  var coverPath = props.width > MAX_SHELF_THUMB_ITEM_WIDTH ? props.coverPath.replace('/thumb', '/small') : props.coverPath;
  (0,react.useEffect)(function () {
    var img = new Image();
    img.onload = function () {
      var width;
      var height;
      if (img.width >= img.height) {
        var ratio = img.height / img.width;
        width = props.width;
        height = width * ratio;
      } else {
        var _ratio = img.width / img.height;
        height = Math.round(props.width / THUMB_CONTAINER_RATIO);
        width = height * _ratio;
      }
      setSize({
        width: width,
        height: height
      });
      setImageLoadedSuccess(true);
    };
    img.onerror = function () {
      setImageLoadedSuccess(false);
    };
    img.src = coverPath;
  }, [props.width, coverPath]);
  var flipbookTitle = showFlipbookTitleOnHover && /*#__PURE__*/react.createElement(TitleContainer, {
    className: "title-container",
    $width: size.width,
    $height: size.height,
    $imageLoadedSuccess: imageLoadedSuccess
  }, /*#__PURE__*/react.createElement(FlipbookCard_styles_Title, null, props.name));
  var image = /*#__PURE__*/react.createElement(FlipbookCard_styles_ImageContainer, {
    $width: props.width,
    $height: size.height,
    $margin: FLIPBOOK_CARD_MARGIN,
    onClick: onClickOnFlipbook,
    onFocus: props.onFocus,
    $showFlipbookTitleOnHover: showFlipbookTitleOnHover,
    onKeyDown: function onKeyDown(e) {
      if (e.key === 'Enter' || e.key === ' ') {
        e.preventDefault();
        onClickOnFlipbook();
      }
    },
    tabIndex: openInNewTab ? TabIndex.UNREACHABLE : TabIndex.DEFAULT,
    "aria-label": props.name,
    role: "button"
  }, imageLoadedSuccess ? /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(FlipbookCard_styles_Image, {
    src: coverPath,
    alt: props.name
  }), flipbookTitle) : /*#__PURE__*/react.createElement(BlankCard, null, flipbookTitle));

  // WARNING: The keyboard functionality is unavailable on Safari tablets even in fullscreen mode.
  // Therefore, we are enforcing the player link.
  if (main/* isSafari */.nr && main/* isMobile */.Fr || !fscreen_lib/* default */.A.fullscreenEnabled || openInNewTab) {
    return /*#__PURE__*/react.createElement(FlipbookCard_FlipbookLink, {
      hash: props.hash,
      openInNewTab: openInNewTab,
      profile: profile,
      linkName: props.linkName,
      flipbookTitle: props.name
    }, image);
  }
  return image;
};
FlipbookCard.propTypes = {
  width: (prop_types_default()).number.isRequired,
  coverPath: (prop_types_default()).string.isRequired,
  hash: (prop_types_default()).string.isRequired,
  linkName: (prop_types_default()).string.isRequired,
  name: (prop_types_default()).string.isRequired,
  onClick: (prop_types_default()).func.isRequired,
  onFocus: (prop_types_default()).func.isRequired
};
/* harmony default export */ var FlipbookCard_FlipbookCard = (FlipbookCard);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/FlipbookCard/index.ts

;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/FlipbooksShelf/FlipbookShelf.styles.ts

var Shelf = styled_components_browser_esm.div.withConfig({
  displayName: "FlipbookShelfstyles__Shelf",
  componentId: "sc-1jp7wyh-0"
})(["position:relative;"]);
var ShelfTop = styled_components_browser_esm.div.withConfig({
  displayName: "FlipbookShelfstyles__ShelfTop",
  componentId: "sc-1jp7wyh-1"
})(["opacity:0.76;width:100%;border-bottom:20px solid ", ";border-left:22px solid transparent;border-right:22px solid transparent;position:absolute;marginLeft:0;bottom:-2px;"], function (props) {
  return props.$color;
});
var ShelfFront = styled_components_browser_esm.div.withConfig({
  displayName: "FlipbookShelfstyles__ShelfFront",
  componentId: "sc-1jp7wyh-2"
})(["content:'';height:9px;width:100%;position:absolute;bottom:-11px;left:0;right:0;z-index:1;margin:0;background-color:", ";"], function (props) {
  return props.$color;
});
var ShelfShadow = styled_components_browser_esm.div.withConfig({
  displayName: "FlipbookShelfstyles__ShelfShadow",
  componentId: "sc-1jp7wyh-3"
})(["width:100%;height:10px;position:absolute;bottom:-21px;left:0;display:flex;background:linear-gradient(180deg,rgba(0,0,0,0.2) 0%,rgba(0,0,0,0) 100%);opacity:0.4;"]);
var ShelfFlipbooksRow = styled_components_browser_esm.div.withConfig({
  displayName: "FlipbookShelfstyles__ShelfFlipbooksRow",
  componentId: "sc-1jp7wyh-4"
})(["display:flex;align-items:baseline;justify-content:center;flex-wrap:wrap;padding:0 ", "px;position:relative;z-index:1;"], function (props) {
  return props.$padding;
});
var ShelfFlipbooksRowContainer = styled_components_browser_esm.div.withConfig({
  displayName: "FlipbookShelfstyles__ShelfFlipbooksRowContainer",
  componentId: "sc-1jp7wyh-5"
})(["margin-bottom:", "px;"], function (props) {
  return props.$margin;
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/FlipbooksShelf/FlipbooksShelf.tsx






var FlipbooksShelf = function FlipbooksShelf(props) {
  var lastFocusedRef = (0,react.useRef)(null);
  var handleFocus = function handleFocus(element) {
    lastFocusedRef.current = element;
  };
  (0,react.useEffect)(function () {
    if (lastFocusedRef.current) {
      lastFocusedRef.current.focus();
    }
  }, [props.rows]);
  return /*#__PURE__*/react.createElement(ShelfFlipbooksRowContainer, {
    $margin: SHELF_ROW_MARGIN_BOTTOM
  }, /*#__PURE__*/react.createElement(ShelfFlipbooksRow, {
    $padding: SHELF_PADDING
  }, props.rows.map(function (flipbook) {
    return /*#__PURE__*/react.createElement(FlipbookCard_FlipbookCard, {
      coverPath: flipbook.coverPath,
      width: props.itemsWidth,
      hash: flipbook.hash,
      name: flipbook.name,
      linkName: flipbook.linkName,
      onClick: props.onClick,
      key: flipbook.hash,
      onFocus: function onFocus(e) {
        return handleFocus(e.target);
      } // Pass focus handler
    });
  })), /*#__PURE__*/react.createElement(Shelf, null, /*#__PURE__*/react.createElement(ShelfTop, {
    $color: props.shelfColor
  }), /*#__PURE__*/react.createElement(ShelfFront, {
    className: "shelf-front",
    $color: props.shelfColor
  }), /*#__PURE__*/react.createElement(ShelfShadow, null)));
};
FlipbooksShelf.propTypes = {
  rows: prop_types_default().arrayOf(flipbookProps).isRequired,
  shelfColor: (prop_types_default()).string.isRequired,
  itemsWidth: (prop_types_default()).number.isRequired,
  onClick: (prop_types_default()).func.isRequired
};
/* harmony default export */ var FlipbooksShelf_FlipbooksShelf = (FlipbooksShelf);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/FlipbooksShelf/index.ts

;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/BookshelfPagesContainer/BookshelfPagesContainer.styles.ts

var BookshelfPagesContainer_styles_BookshelfPagesContainer = styled_components_browser_esm.div.withConfig({
  displayName: "BookshelfPagesContainerstyles__BookshelfPagesContainer",
  componentId: "sc-1x6ssch-0"
})(["width:100%;height:100%;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;padding:20px;", ""], function (_ref) {
  var $isImageBackgroundWithoutResults = _ref.$isImageBackgroundWithoutResults;
  return $isImageBackgroundWithoutResults && "\n            background-color: rgba(0, 0, 0, 0.3);\n    ";
});
var Header = styled_components_browser_esm.div.withConfig({
  displayName: "BookshelfPagesContainerstyles__Header",
  componentId: "sc-1x6ssch-1"
})(["width:100%;display:flex;justify-content:space-between;align-items:center;"]);
var SearchInBookshelfContainer = styled_components_browser_esm.div.withConfig({
  displayName: "BookshelfPagesContainerstyles__SearchInBookshelfContainer",
  componentId: "sc-1x6ssch-2"
})(["display:flex;align-items:center;background:white;justify-content:space-between;height:40px;padding:8px 10px;margin-right:", ";border-radius:4px;border:1px solid rgba(9,10,11,0.23);"], function (props) {
  return props.$isMobile ? '0' : '20px';
});
var Icon = styled_components_browser_esm.div.withConfig({
  displayName: "BookshelfPagesContainerstyles__Icon",
  componentId: "sc-1x6ssch-3"
})(["width:20px;height:20px;display:flex;align-items:center;justify-content:space-around;"]);
var SearchInput = styled_components_browser_esm.input.withConfig({
  displayName: "BookshelfPagesContainerstyles__SearchInput",
  componentId: "sc-1x6ssch-4"
})(["padding:0;border:0;margin:0 8px;height:20px;width:", ";color:rgba(19,20,22);font-size:14px;"], function (props) {
  return props.$isMobile ? '80px' : '144px';
});
var Content = styled_components_browser_esm.div.withConfig({
  displayName: "BookshelfPagesContainerstyles__Content",
  componentId: "sc-1x6ssch-5"
})(["height:100%;display:flex;justify-content:center;align-items:center;"]);
var NoSearchResultContainer = styled_components_browser_esm.div.withConfig({
  displayName: "BookshelfPagesContainerstyles__NoSearchResultContainer",
  componentId: "sc-1x6ssch-6"
})(["display:flex;flex-direction:column;align-items:center;"]);
var NoSearchResultLabel = styled_components_browser_esm.h3.withConfig({
  displayName: "BookshelfPagesContainerstyles__NoSearchResultLabel",
  componentId: "sc-1x6ssch-7"
})(["margin:20px 0 0 0;font-size:", ";text-align:center;color:", ";"], function (props) {
  return "".concat(props.size, "px");
}, function (props) {
  return props.color;
});
var NoSearchResultDescription = styled_components_browser_esm.p.withConfig({
  displayName: "BookshelfPagesContainerstyles__NoSearchResultDescription",
  componentId: "sc-1x6ssch-8"
})(["margin-top:10px;font-weight:300;text-align:center;color:", ";"], function (props) {
  return props.color;
});
var BookshelfPage = styled_components_browser_esm.div.withConfig({
  displayName: "BookshelfPagesContainerstyles__BookshelfPage",
  componentId: "sc-1x6ssch-9"
})(["display:", ""], function (props) {
  return props.$display;
});
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/BookshelfPagesContainer/BookshelfPagesContainer.tsx



















var BookshelfPagesContainer = function BookshelfPagesContainer() {
  var ref = (0,react.useRef)(null);
  var _useContext = (0,react.useContext)(contexts_ActivePageContext),
    activePageIndex = _useContext.activePageIndex,
    setActivePageIndex = _useContext.setActivePageIndex;
  var _useContext2 = (0,react.useContext)(BookshelfJsonContext),
    collection = _useContext2.collection,
    options = _useContext2.options,
    config = _useContext2.config,
    signature = _useContext2.signature,
    hash = _useContext2.hash;
  var _useContext3 = (0,react.useContext)(contexts_FlipbookRequestContext),
    getFlipbookJson = _useContext3.getFlipbookJson;
  var _useContext4 = (0,react.useContext)(contexts_BookshelfDataContext),
    setNrOfPages = _useContext4.setNrOfPages;
  var _useState = (0,react.useState)({
      width: 0,
      height: 0
    }),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    pageContainerBounds = _useState2[0],
    setBounds = _useState2[1];
  var _useState3 = (0,react.useState)(''),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    inputSearchValue = _useState4[0],
    setInputSearchValue = _useState4[1];
  var width = pageContainerBounds.width,
    height = pageContainerBounds.height;
  var resizeBounds = useResize(ref);
  var playerLogoURL = getLogoUrl(config, options, hash, signature);
  var playerFallbackLogoURL = getFallbackLogoUrl(config, options, hash, signature);
  (0,react.useEffect)(function () {
    setBounds({
      width: resizeBounds.width,
      height: resizeBounds.height
    });
  }, [resizeBounds.width, resizeBounds.height]);
  var _getStructure = getBookshelfStructure(collection.filter(function (col) {
      return col.name.toLowerCase().includes(inputSearchValue);
    }), options.itemsWidth, {
      width: width - 2 * SHELF_PADDING,
      height: height - 2 * SHELF_PADDING
    }),
    structure = _getStructure.structure,
    nrOfPages = _getStructure.nrOfPages;
  (0,react.useEffect)(function () {
    var _ref$current, _ref$current2;
    setBounds({
      width: (ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.offsetWidth) || 0,
      height: (ref === null || ref === void 0 || (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.offsetHeight) || 0
    });
  }, []);
  (0,react.useEffect)(function () {
    setNrOfPages(nrOfPages);

    // Handles the scenario where the screen is resized to a larger size while on the second page
    setActivePageIndex(function (prevState) {
      return nrOfPages <= prevState ? Math.min(prevState, nrOfPages - 1) : prevState;
    });
  }, [nrOfPages]);
  var onClickFlipbook = function onClickFlipbook(flipbookHash) {
    getFlipbookJson && getFlipbookJson(flipbookHash);
  };
  var onChangeInputSearch = (0,react.useCallback)((0,lodash.debounce)(function (e) {
    setInputSearchValue(e.target.value.toLowerCase());
    if (activePageIndex !== 0) {
      setActivePageIndex(0);
    }
  }, 250), [activePageIndex]);
  var isImageBackgroundWithoutResults = options.background.type === 'image' && !structure.length;
  var fillColor = utils_getFillColor(options.background.color, options.background.opacity, isImageBackgroundWithoutResults);
  return /*#__PURE__*/react.createElement(BookshelfPagesContainer_styles_BookshelfPagesContainer, {
    ref: ref,
    $isImageBackgroundWithoutResults: isImageBackgroundWithoutResults
  }, /*#__PURE__*/react.createElement(Header, null, /*#__PURE__*/react.createElement("div", {
    className: "icon"
  }, options.logoImage && /*#__PURE__*/react.createElement(PlayerLogo_PlayerLogo, {
    src: playerLogoURL,
    fallbackSrc: playerFallbackLogoURL,
    href: options.logoImageURL,
    ariaLabel: "Bookshelf logo image"
  })), options.showSearchInBookshelf && /*#__PURE__*/react.createElement(SearchInBookshelfContainer, {
    $isMobile: main/* isMobile */.Fr
  }, /*#__PURE__*/react.createElement(Icon, null, /*#__PURE__*/react.createElement(src.SearchIcon, {
    fill: "#000"
  })), /*#__PURE__*/react.createElement(SearchInput, {
    $isMobile: main/* isMobile */.Fr,
    type: "search",
    placeholder: "Search flipbooks",
    onChange: onChangeInputSearch,
    maxLength: 100
  }))), /*#__PURE__*/react.createElement(Content, null, !!structure.length && structure.map(function (page, index) {
    return /*#__PURE__*/react.createElement(BookshelfPage, {
      $display: index === activePageIndex ? 'block' : 'none',
      key: index
    }, page.map(function (rows, rowIndex) {
      return /*#__PURE__*/react.createElement(FlipbooksShelf_FlipbooksShelf, {
        rows: rows,
        itemsWidth: options.itemsWidth,
        shelfColor: options.shelfColor,
        key: "".concat(index, "-").concat(rowIndex),
        onClick: onClickFlipbook
      });
    }));
  }), !structure.length && /*#__PURE__*/react.createElement(NoSearchResultContainer, {
    tabIndex: TabIndex.DEFAULT,
    "aria-labelledby": "no-search-results-title no-search-results-desc"
  }, /*#__PURE__*/react.createElement(src.SearchIconNoResults, {
    fill: fillColor,
    size: main/* isMobile */.Fr ? '104' : '180'
  }), /*#__PURE__*/react.createElement(NoSearchResultLabel, {
    id: "no-search-results-title",
    size: main/* isMobile */.Fr ? 24 : 28,
    color: fillColor
  }, "There were no results for \"".concat(inputSearchValue, "\".")), /*#__PURE__*/react.createElement(NoSearchResultDescription, {
    color: fillColor,
    id: "no-search-results-desc"
  }, "Make sure your spelling is correct, or maybe try a different keyword."))));
};
/* harmony default export */ var BookshelfPagesContainer_BookshelfPagesContainer = (BookshelfPagesContainer);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/BookshelfPagesContainer/index.ts

;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/providers/BookshelfDataProvider/BookshelfDataProvider.tsx




var BookshelfDataProvider = function BookshelfDataProvider(props) {
  var _useState = (0,react.useState)(1),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    nrOfPages = _useState2[0],
    setNrOfPages = _useState2[1];
  var value = (0,react.useMemo)(function () {
    return {
      nrOfPages: nrOfPages,
      setNrOfPages: setNrOfPages
    };
  }, [nrOfPages]);
  return /*#__PURE__*/react.createElement(contexts_BookshelfDataContext.Provider, {
    value: value
  }, props.children);
};
BookshelfDataProvider.propTypes = {
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var BookshelfDataProvider_BookshelfDataProvider = (BookshelfDataProvider);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/providers/BookshelfDataProvider/index.ts

;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/Bookshelf/Bookshelf.styles.ts

var Bookshelf_styles_Bookshelf = styled_components_browser_esm.div.withConfig({
  displayName: "Bookshelfstyles__Bookshelf",
  componentId: "sc-yrimld-0"
})(["display:flex;flex-direction:row;align-items:center;width:100%;height:100%;"]);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/Bookshelf/Bookshelf.tsx






var Bookshelf = function Bookshelf() {
  return /*#__PURE__*/react.createElement(Bookshelf_styles_Bookshelf, null, /*#__PURE__*/react.createElement(BookshelfDataProvider_BookshelfDataProvider, null, /*#__PURE__*/react.createElement(ActivePageProvider_ActivePageProvider, null, /*#__PURE__*/react.createElement(NavigationContainer_NavigationContainer, null, /*#__PURE__*/react.createElement(BookshelfPagesContainer_BookshelfPagesContainer, null)))));
};
/* harmony default export */ var Bookshelf_Bookshelf = (Bookshelf);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/Bookshelf/index.ts

;// CONCATENATED MODULE: ./node_modules/jotai/esm/vanilla.mjs
let keyCount = 0;
function vanilla_atom(read, write) {
  const key = `atom${++keyCount}`;
  const config = {
    toString: () => key
  };
  if (typeof read === "function") {
    config.read = read;
  } else {
    config.init = read;
    config.read = defaultRead;
    config.write = defaultWrite;
  }
  if (write) {
    config.write = write;
  }
  return config;
}
function defaultRead(get) {
  return get(this);
}
function defaultWrite(get, set, arg) {
  return set(
    this,
    typeof arg === "function" ? arg(get(this)) : arg
  );
}

const isSelfAtom = (atom, a) => atom.unstable_is ? atom.unstable_is(a) : a === atom;
const hasInitialValue = (atom) => "init" in atom;
const isActuallyWritableAtom = (atom) => !!atom.write;
const cancelPromiseMap = /* @__PURE__ */ new WeakMap();
const registerCancelPromise = (promise, cancel) => {
  cancelPromiseMap.set(promise, cancel);
  promise.catch(() => {
  }).finally(() => cancelPromiseMap.delete(promise));
};
const cancelPromise = (promise, next) => {
  const cancel = cancelPromiseMap.get(promise);
  if (cancel) {
    cancelPromiseMap.delete(promise);
    cancel(next);
  }
};
const resolvePromise = (promise, value) => {
  promise.status = "fulfilled";
  promise.value = value;
};
const rejectPromise = (promise, e) => {
  promise.status = "rejected";
  promise.reason = e;
};
const isPromiseLike = (x) => typeof (x == null ? void 0 : x.then) === "function";
const isEqualAtomValue = (a, b) => !!a && "v" in a && "v" in b && Object.is(a.v, b.v);
const isEqualAtomError = (a, b) => !!a && "e" in a && "e" in b && Object.is(a.e, b.e);
const hasPromiseAtomValue = (a) => !!a && "v" in a && a.v instanceof Promise;
const isEqualPromiseAtomValue = (a, b) => "v" in a && "v" in b && a.v.orig && a.v.orig === b.v.orig;
const returnAtomValue = (atomState) => {
  if ("e" in atomState) {
    throw atomState.e;
  }
  return atomState.v;
};
const createStore$1 = () => {
  const atomStateMap = /* @__PURE__ */ new WeakMap();
  const mountedMap = /* @__PURE__ */ new WeakMap();
  const pendingStack = [];
  const pendingMap = /* @__PURE__ */ new WeakMap();
  let devListenersRev2;
  let mountedAtoms;
  if (( false ? 0 : void 0) !== "production") {
    devListenersRev2 = /* @__PURE__ */ new Set();
    mountedAtoms = /* @__PURE__ */ new Set();
  }
  const getAtomState = (atom) => atomStateMap.get(atom);
  const addPendingDependent = (atom, atomState) => {
    atomState.d.forEach((_, a) => {
      var _a;
      if (!pendingMap.has(a)) {
        const aState = getAtomState(a);
        (_a = pendingStack[pendingStack.length - 1]) == null ? void 0 : _a.add(a);
        pendingMap.set(a, [aState, /* @__PURE__ */ new Set()]);
        if (aState) {
          addPendingDependent(a, aState);
        }
      }
      pendingMap.get(a)[1].add(atom);
    });
  };
  const setAtomState = (atom, atomState) => {
    var _a;
    if (( false ? 0 : void 0) !== "production") {
      Object.freeze(atomState);
    }
    const prevAtomState = getAtomState(atom);
    atomStateMap.set(atom, atomState);
    if (!pendingMap.has(atom)) {
      (_a = pendingStack[pendingStack.length - 1]) == null ? void 0 : _a.add(atom);
      pendingMap.set(atom, [prevAtomState, /* @__PURE__ */ new Set()]);
      addPendingDependent(atom, atomState);
    }
    if (hasPromiseAtomValue(prevAtomState)) {
      const next = "v" in atomState ? atomState.v instanceof Promise ? atomState.v : Promise.resolve(atomState.v) : Promise.reject(atomState.e);
      if (prevAtomState.v !== next) {
        cancelPromise(prevAtomState.v, next);
      }
    }
  };
  const updateDependencies = (atom, nextAtomState, nextDependencies, keepPreviousDependencies) => {
    const dependencies = new Map(
      keepPreviousDependencies ? nextAtomState.d : null
    );
    let changed = false;
    nextDependencies.forEach((aState, a) => {
      if (!aState && isSelfAtom(atom, a)) {
        aState = nextAtomState;
      }
      if (aState) {
        dependencies.set(a, aState);
        if (nextAtomState.d.get(a) !== aState) {
          changed = true;
        }
      } else if (( false ? 0 : void 0) !== "production") {
        console.warn("[Bug] atom state not found");
      }
    });
    if (changed || nextAtomState.d.size !== dependencies.size) {
      nextAtomState.d = dependencies;
    }
  };
  const setAtomValue = (atom, value, nextDependencies, keepPreviousDependencies) => {
    const prevAtomState = getAtomState(atom);
    const nextAtomState = {
      d: (prevAtomState == null ? void 0 : prevAtomState.d) || /* @__PURE__ */ new Map(),
      v: value
    };
    if (nextDependencies) {
      updateDependencies(
        atom,
        nextAtomState,
        nextDependencies,
        keepPreviousDependencies
      );
    }
    if (isEqualAtomValue(prevAtomState, nextAtomState) && prevAtomState.d === nextAtomState.d) {
      return prevAtomState;
    }
    if (hasPromiseAtomValue(prevAtomState) && hasPromiseAtomValue(nextAtomState) && isEqualPromiseAtomValue(prevAtomState, nextAtomState)) {
      if (prevAtomState.d === nextAtomState.d) {
        return prevAtomState;
      } else {
        nextAtomState.v = prevAtomState.v;
      }
    }
    setAtomState(atom, nextAtomState);
    return nextAtomState;
  };
  const setAtomValueOrPromise = (atom, valueOrPromise, nextDependencies, abortPromise) => {
    if (isPromiseLike(valueOrPromise)) {
      let continuePromise;
      const updatePromiseDependencies = () => {
        const prevAtomState = getAtomState(atom);
        if (!hasPromiseAtomValue(prevAtomState) || prevAtomState.v !== promise) {
          return;
        }
        const nextAtomState = setAtomValue(
          atom,
          promise,
          nextDependencies
        );
        if (mountedMap.has(atom) && prevAtomState.d !== nextAtomState.d) {
          mountDependencies(atom, nextAtomState, prevAtomState.d);
        }
      };
      const promise = new Promise((resolve, reject) => {
        let settled = false;
        valueOrPromise.then(
          (v) => {
            if (!settled) {
              settled = true;
              resolvePromise(promise, v);
              resolve(v);
              updatePromiseDependencies();
            }
          },
          (e) => {
            if (!settled) {
              settled = true;
              rejectPromise(promise, e);
              reject(e);
              updatePromiseDependencies();
            }
          }
        );
        continuePromise = (next) => {
          if (!settled) {
            settled = true;
            next.then(
              (v) => resolvePromise(promise, v),
              (e) => rejectPromise(promise, e)
            );
            resolve(next);
          }
        };
      });
      promise.orig = valueOrPromise;
      promise.status = "pending";
      registerCancelPromise(promise, (next) => {
        if (next) {
          continuePromise(next);
        }
        abortPromise == null ? void 0 : abortPromise();
      });
      return setAtomValue(atom, promise, nextDependencies, true);
    }
    return setAtomValue(atom, valueOrPromise, nextDependencies);
  };
  const setAtomError = (atom, error, nextDependencies) => {
    const prevAtomState = getAtomState(atom);
    const nextAtomState = {
      d: (prevAtomState == null ? void 0 : prevAtomState.d) || /* @__PURE__ */ new Map(),
      e: error
    };
    if (nextDependencies) {
      updateDependencies(atom, nextAtomState, nextDependencies);
    }
    if (isEqualAtomError(prevAtomState, nextAtomState) && prevAtomState.d === nextAtomState.d) {
      return prevAtomState;
    }
    setAtomState(atom, nextAtomState);
    return nextAtomState;
  };
  const readAtomState = (atom, force) => {
    const atomState = getAtomState(atom);
    if (!force && atomState) {
      if (mountedMap.has(atom)) {
        return atomState;
      }
      if (Array.from(atomState.d).every(([a, s]) => {
        if (a === atom) {
          return true;
        }
        const aState = readAtomState(a);
        return aState === s || isEqualAtomValue(aState, s);
      })) {
        return atomState;
      }
    }
    const nextDependencies = /* @__PURE__ */ new Map();
    let isSync = true;
    const getter = (a) => {
      if (isSelfAtom(atom, a)) {
        const aState2 = getAtomState(a);
        if (aState2) {
          nextDependencies.set(a, aState2);
          return returnAtomValue(aState2);
        }
        if (hasInitialValue(a)) {
          nextDependencies.set(a, void 0);
          return a.init;
        }
        throw new Error("no atom init");
      }
      const aState = readAtomState(a);
      nextDependencies.set(a, aState);
      return returnAtomValue(aState);
    };
    let controller;
    let setSelf;
    const options = {
      get signal() {
        if (!controller) {
          controller = new AbortController();
        }
        return controller.signal;
      },
      get setSelf() {
        if (( false ? 0 : void 0) !== "production" && !isActuallyWritableAtom(atom)) {
          console.warn("setSelf function cannot be used with read-only atom");
        }
        if (!setSelf && isActuallyWritableAtom(atom)) {
          setSelf = (...args) => {
            if (( false ? 0 : void 0) !== "production" && isSync) {
              console.warn("setSelf function cannot be called in sync");
            }
            if (!isSync) {
              return writeAtom(atom, ...args);
            }
          };
        }
        return setSelf;
      }
    };
    try {
      const valueOrPromise = atom.read(getter, options);
      return setAtomValueOrPromise(
        atom,
        valueOrPromise,
        nextDependencies,
        () => controller == null ? void 0 : controller.abort()
      );
    } catch (error) {
      return setAtomError(atom, error, nextDependencies);
    } finally {
      isSync = false;
    }
  };
  const readAtom = (atom) => returnAtomValue(readAtomState(atom));
  const recomputeDependents = (atom) => {
    const getDependents = (a) => {
      var _a, _b;
      const dependents = new Set((_a = mountedMap.get(a)) == null ? void 0 : _a.t);
      (_b = pendingMap.get(a)) == null ? void 0 : _b[1].forEach((dependent) => {
        dependents.add(dependent);
      });
      return dependents;
    };
    const topsortedAtoms = new Array();
    const markedAtoms = /* @__PURE__ */ new Set();
    const visit = (n) => {
      if (markedAtoms.has(n)) {
        return;
      }
      markedAtoms.add(n);
      for (const m of getDependents(n)) {
        if (n !== m) {
          visit(m);
        }
      }
      topsortedAtoms.push(n);
    };
    visit(atom);
    const changedAtoms = /* @__PURE__ */ new Set([atom]);
    for (let i = topsortedAtoms.length - 1; i >= 0; --i) {
      const a = topsortedAtoms[i];
      const prevAtomState = getAtomState(a);
      if (!prevAtomState) {
        continue;
      }
      let hasChangedDeps = false;
      for (const dep of prevAtomState.d.keys()) {
        if (dep !== a && changedAtoms.has(dep)) {
          hasChangedDeps = true;
          break;
        }
      }
      if (hasChangedDeps) {
        const nextAtomState = readAtomState(a, true);
        if (!isEqualAtomValue(prevAtomState, nextAtomState)) {
          changedAtoms.add(a);
        }
      }
    }
  };
  const writeAtomState = (atom, ...args) => {
    const getter = (a) => returnAtomValue(readAtomState(a));
    const setter = (a, ...args2) => {
      const isSync = pendingStack.length > 0;
      if (!isSync) {
        pendingStack.push(/* @__PURE__ */ new Set([a]));
      }
      let r;
      if (isSelfAtom(atom, a)) {
        if (!hasInitialValue(a)) {
          throw new Error("atom not writable");
        }
        const prevAtomState = getAtomState(a);
        const nextAtomState = setAtomValueOrPromise(a, args2[0]);
        if (!isEqualAtomValue(prevAtomState, nextAtomState)) {
          recomputeDependents(a);
        }
      } else {
        r = writeAtomState(a, ...args2);
      }
      if (!isSync) {
        const flushed = flushPending(pendingStack.pop());
        if (( false ? 0 : void 0) !== "production") {
          devListenersRev2.forEach(
            (l) => l({ type: "async-write", flushed })
          );
        }
      }
      return r;
    };
    const result = atom.write(getter, setter, ...args);
    return result;
  };
  const writeAtom = (atom, ...args) => {
    pendingStack.push(/* @__PURE__ */ new Set([atom]));
    const result = writeAtomState(atom, ...args);
    const flushed = flushPending(pendingStack.pop());
    if (( false ? 0 : void 0) !== "production") {
      devListenersRev2.forEach((l) => l({ type: "write", flushed }));
    }
    return result;
  };
  const mountAtom = (atom, initialDependent, onMountQueue) => {
    var _a;
    const existingMount = mountedMap.get(atom);
    if (existingMount) {
      if (initialDependent) {
        existingMount.t.add(initialDependent);
      }
      return existingMount;
    }
    const queue = onMountQueue || [];
    (_a = getAtomState(atom)) == null ? void 0 : _a.d.forEach((_, a) => {
      if (a !== atom) {
        mountAtom(a, atom, queue);
      }
    });
    readAtomState(atom);
    const mounted = {
      t: new Set(initialDependent && [initialDependent]),
      l: /* @__PURE__ */ new Set()
    };
    mountedMap.set(atom, mounted);
    if (( false ? 0 : void 0) !== "production") {
      mountedAtoms.add(atom);
    }
    if (isActuallyWritableAtom(atom) && atom.onMount) {
      const { onMount } = atom;
      queue.push(() => {
        const onUnmount = onMount((...args) => writeAtom(atom, ...args));
        if (onUnmount) {
          mounted.u = onUnmount;
        }
      });
    }
    if (!onMountQueue) {
      queue.forEach((f) => f());
    }
    return mounted;
  };
  const canUnmountAtom = (atom, mounted) => !mounted.l.size && (!mounted.t.size || mounted.t.size === 1 && mounted.t.has(atom));
  const tryUnmountAtom = (atom, mounted) => {
    if (!canUnmountAtom(atom, mounted)) {
      return;
    }
    const onUnmount = mounted.u;
    if (onUnmount) {
      onUnmount();
    }
    mountedMap.delete(atom);
    if (( false ? 0 : void 0) !== "production") {
      mountedAtoms.delete(atom);
    }
    const atomState = getAtomState(atom);
    if (atomState) {
      if (hasPromiseAtomValue(atomState)) {
        cancelPromise(atomState.v);
      }
      atomState.d.forEach((_, a) => {
        if (a !== atom) {
          const mountedDep = mountedMap.get(a);
          if (mountedDep) {
            mountedDep.t.delete(atom);
            tryUnmountAtom(a, mountedDep);
          }
        }
      });
    } else if (( false ? 0 : void 0) !== "production") {
      console.warn("[Bug] could not find atom state to unmount", atom);
    }
  };
  const mountDependencies = (atom, atomState, prevDependencies) => {
    const depSet = new Set(atomState.d.keys());
    const maybeUnmountAtomSet = /* @__PURE__ */ new Set();
    prevDependencies == null ? void 0 : prevDependencies.forEach((_, a) => {
      if (depSet.has(a)) {
        depSet.delete(a);
        return;
      }
      maybeUnmountAtomSet.add(a);
      const mounted = mountedMap.get(a);
      if (mounted) {
        mounted.t.delete(atom);
      }
    });
    depSet.forEach((a) => {
      mountAtom(a, atom);
    });
    maybeUnmountAtomSet.forEach((a) => {
      const mounted = mountedMap.get(a);
      if (mounted) {
        tryUnmountAtom(a, mounted);
      }
    });
  };
  const flushPending = (pendingAtoms) => {
    let flushed;
    if (( false ? 0 : void 0) !== "production") {
      flushed = /* @__PURE__ */ new Set();
    }
    const pending = [];
    const collectPending = (pendingAtom) => {
      var _a;
      if (!pendingMap.has(pendingAtom)) {
        return;
      }
      const [prevAtomState, dependents] = pendingMap.get(pendingAtom);
      pendingMap.delete(pendingAtom);
      pending.push([pendingAtom, prevAtomState]);
      dependents.forEach(collectPending);
      (_a = getAtomState(pendingAtom)) == null ? void 0 : _a.d.forEach((_, a) => collectPending(a));
    };
    pendingAtoms.forEach(collectPending);
    pending.forEach(([atom, prevAtomState]) => {
      const atomState = getAtomState(atom);
      if (!atomState) {
        if (( false ? 0 : void 0) !== "production") {
          console.warn("[Bug] no atom state to flush");
        }
        return;
      }
      if (atomState !== prevAtomState) {
        const mounted = mountedMap.get(atom);
        if (mounted && atomState.d !== (prevAtomState == null ? void 0 : prevAtomState.d)) {
          mountDependencies(atom, atomState, prevAtomState == null ? void 0 : prevAtomState.d);
        }
        if (mounted && !// TODO This seems pretty hacky. Hope to fix it.
        // Maybe we could `mountDependencies` in `setAtomState`?
        (!hasPromiseAtomValue(prevAtomState) && (isEqualAtomValue(prevAtomState, atomState) || isEqualAtomError(prevAtomState, atomState)))) {
          mounted.l.forEach((listener) => listener());
          if (( false ? 0 : void 0) !== "production") {
            flushed.add(atom);
          }
        }
      }
    });
    if (( false ? 0 : void 0) !== "production") {
      return flushed;
    }
  };
  const subscribeAtom = (atom, listener) => {
    const mounted = mountAtom(atom);
    const flushed = flushPending([atom]);
    const listeners = mounted.l;
    listeners.add(listener);
    if (( false ? 0 : void 0) !== "production") {
      devListenersRev2.forEach(
        (l) => l({ type: "sub", flushed })
      );
    }
    return () => {
      listeners.delete(listener);
      tryUnmountAtom(atom, mounted);
      if (( false ? 0 : void 0) !== "production") {
        devListenersRev2.forEach((l) => l({ type: "unsub" }));
      }
    };
  };
  if (( false ? 0 : void 0) !== "production") {
    return {
      get: readAtom,
      set: writeAtom,
      sub: subscribeAtom,
      // store dev methods (these are tentative and subject to change without notice)
      dev_subscribe_store: (l) => {
        devListenersRev2.add(l);
        return () => {
          devListenersRev2.delete(l);
        };
      },
      dev_get_mounted_atoms: () => mountedAtoms.values(),
      dev_get_atom_state: (a) => atomStateMap.get(a),
      dev_get_mounted: (a) => mountedMap.get(a),
      dev_restore_atoms: (values) => {
        pendingStack.push(/* @__PURE__ */ new Set());
        for (const [atom, valueOrPromise] of values) {
          if (hasInitialValue(atom)) {
            setAtomValueOrPromise(atom, valueOrPromise);
            recomputeDependents(atom);
          }
        }
        const flushed = flushPending(pendingStack.pop());
        devListenersRev2.forEach(
          (l) => l({ type: "restore", flushed })
        );
      }
    };
  }
  return {
    get: readAtom,
    set: writeAtom,
    sub: subscribeAtom
  };
};
let defaultStore;
const getDefaultStore$1 = () => {
  if (!defaultStore) {
    defaultStore = createStore$1();
    if (( false ? 0 : void 0) !== "production") {
      globalThis.__JOTAI_DEFAULT_STORE__ || (globalThis.__JOTAI_DEFAULT_STORE__ = defaultStore);
      if (globalThis.__JOTAI_DEFAULT_STORE__ !== defaultStore) {
        console.warn(
          "Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"
        );
      }
    }
  }
  return defaultStore;
};

Symbol(
  ( false ? 0 : void 0) !== "production" ? "CONTINUE_PROMISE" : ""
);

const vanilla_createStore = createStore$1;
const getDefaultStore = getDefaultStore$1;



;// CONCATENATED MODULE: ./node_modules/jotai/esm/react.mjs
'use client';



const StoreContext = (0,react.createContext)(
  void 0
);
const react_useStore = (options) => {
  const store = (0,react.useContext)(StoreContext);
  return (options == null ? void 0 : options.store) || store || getDefaultStore();
};
const Provider = ({
  children,
  store
}) => {
  const storeRef = (0,react.useRef)();
  if (!store && !storeRef.current) {
    storeRef.current = vanilla_createStore();
  }
  return (0,react.createElement)(
    StoreContext.Provider,
    {
      value: store || storeRef.current
    },
    children
  );
};

const react_isPromiseLike = (x) => typeof (x == null ? void 0 : x.then) === "function";
const use = react.use || ((promise) => {
  if (promise.status === "pending") {
    throw promise;
  } else if (promise.status === "fulfilled") {
    return promise.value;
  } else if (promise.status === "rejected") {
    throw promise.reason;
  } else {
    promise.status = "pending";
    promise.then(
      (v) => {
        promise.status = "fulfilled";
        promise.value = v;
      },
      (e) => {
        promise.status = "rejected";
        promise.reason = e;
      }
    );
    throw promise;
  }
});
function react_useAtomValue(atom, options) {
  const store = react_useStore(options);
  const [[valueFromReducer, storeFromReducer, atomFromReducer], rerender] = (0,react.useReducer)(
    (prev) => {
      const nextValue = store.get(atom);
      if (Object.is(prev[0], nextValue) && prev[1] === store && prev[2] === atom) {
        return prev;
      }
      return [nextValue, store, atom];
    },
    void 0,
    () => [store.get(atom), store, atom]
  );
  let value = valueFromReducer;
  if (storeFromReducer !== store || atomFromReducer !== atom) {
    rerender();
    value = store.get(atom);
  }
  const delay = options == null ? void 0 : options.delay;
  (0,react.useEffect)(() => {
    const unsub = store.sub(atom, () => {
      if (typeof delay === "number") {
        setTimeout(rerender, delay);
        return;
      }
      rerender();
    });
    rerender();
    return unsub;
  }, [store, atom, delay]);
  (0,react.useDebugValue)(value);
  return react_isPromiseLike(value) ? use(value) : value;
}

function react_useSetAtom(atom, options) {
  const store = react_useStore(options);
  const setAtom = (0,react.useCallback)(
    (...args) => {
      if (( false ? 0 : void 0) !== "production" && !("write" in atom)) {
        throw new Error("not writable atom");
      }
      return store.set(atom, ...args);
    },
    [store, atom]
  );
  return setAtom;
}

function react_useAtom(atom, options) {
  return [
    react_useAtomValue(atom, options),
    // We do wrong type assertion here, which results in throwing an error.
    react_useSetAtom(atom, options)
  ];
}



;// CONCATENATED MODULE: ../../modules/utils/code/store/src/json/features.ts

function features_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function features_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? features_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : features_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var featuresAtom = vanilla_atom(features_objectSpread({}, defaultFeatures));
featuresAtom.debugLabel = "featuresAtom";
;// CONCATENATED MODULE: ../../modules/utils/code/store/src/json/properties.ts

function properties_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function properties_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? properties_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : properties_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var propertiesAtom = vanilla_atom(properties_objectSpread({}, defaultProperties));
propertiesAtom.debugLabel = "propertiesAtom";
;// CONCATENATED MODULE: ../../modules/utils/code/store/src/json/rootPrimitives.ts

function rootPrimitives_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function rootPrimitives_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? rootPrimitives_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : rootPrimitives_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var rootPrimitivesAtom = vanilla_atom(rootPrimitives_objectSpread({}, rootPrimitives));
rootPrimitivesAtom.debugLabel = "rootPrimitivesAtom";
;// CONCATENATED MODULE: ../../modules/utils/code/store/src/json/index.ts










var setJsonAtom = vanilla_atom(null, function (get, set, jsonData) {
  if (jsonData.features && get(featuresAtom) !== jsonData.features) {
    set(featuresAtom, jsonData.features);
  }
  if (jsonData.properties && get(propertiesAtom) !== jsonData.properties) {
    set(propertiesAtom, jsonData.properties);
  }
  if (jsonData.rootPrimitives && get(rootPrimitivesAtom) !== jsonData.rootPrimitives) {
    set(rootPrimitivesAtom, jsonData.rootPrimitives);
  }
});
setJsonAtom.debugLabel = "setJsonAtom";
;// CONCATENATED MODULE: ../../modules/utils/code/constants/src/ai.ts

// All models should be associated with a model provider (via 'ModelProviderMapping')!
var Model = /*#__PURE__*/function (Model) {
  Model["GPT_4O"] = "gpt-4o";
  return Model;
}({});
var ModelProvider = /*#__PURE__*/function (ModelProvider) {
  ModelProvider["OPENAI"] = "OPENAI";
  return ModelProvider;
}({});
var ModelProviderMapping = defineProperty_defineProperty({}, Model.GPT_4O, ModelProvider.OPENAI);
var AiProcessType = /*#__PURE__*/function (AiProcessType) {
  AiProcessType["FEED_MAPPING"] = "FEED_MAPPING";
  return AiProcessType;
}({});
var AiProcessStatus = /*#__PURE__*/function (AiProcessStatus) {
  AiProcessStatus["PROCESSING"] = "PROCESSING";
  AiProcessStatus["FAILED"] = "FAILED";
  AiProcessStatus["COMPLETED"] = "COMPLETED";
  return AiProcessStatus;
}({});
;// CONCATENATED MODULE: ../../modules/utils/code/constants/src/automation.ts
var FlipsnackOption = /*#__PURE__*/function (FlipsnackOption) {
  FlipsnackOption["PRODUCT_TYPE"] = "product_type";
  FlipsnackOption["CODE"] = "code";
  FlipsnackOption["PARENT_CODE"] = "parent_code";
  FlipsnackOption["TITLE"] = "title";
  FlipsnackOption["DESCRIPTION"] = "description";
  FlipsnackOption["IMAGE_LINK"] = "image_link";
  FlipsnackOption["SELL_PRICE"] = "sell_price";
  FlipsnackOption["CURRENCY"] = "currency";
  FlipsnackOption["DISCOUNT_PRICE"] = "discount_price";
  FlipsnackOption["VISIBLE"] = "visible";
  FlipsnackOption["QUANTITY"] = "quantity";
  FlipsnackOption["MIN_PURCHASABLE_QTY"] = "min_purchasable_qty";
  FlipsnackOption["MAX_PURCHASABLE_QTY"] = "max_purchasable_qty";
  FlipsnackOption["ATTRIBUTE_NAME1"] = "attribute_name1";
  FlipsnackOption["ATTRIBUTE_OPTIONS1"] = "attribute_options1";
  FlipsnackOption["ATTRIBUTE_NAME2"] = "attribute_name2";
  FlipsnackOption["ATTRIBUTE_OPTIONS2"] = "attribute_options2";
  FlipsnackOption["ATTRIBUTE_NAME3"] = "attribute_name3";
  FlipsnackOption["ATTRIBUTE_OPTIONS3"] = "attribute_options3";
  FlipsnackOption["IMAGE_ATTRIBUTE"] = "image_attribute";
  FlipsnackOption["VARIANT_IMAGE_LINK"] = "variant_image_link";
  FlipsnackOption["VARIANT_PRICE"] = "variant_price";
  FlipsnackOption["VARIANT_DISCOUNT_PRICE"] = "variant_discount_price";
  FlipsnackOption["SHOP_ELEMENT"] = "shop_element";
  FlipsnackOption["AREA_ELEMENT_TOOLTIP"] = "area_element_tooltip";
  FlipsnackOption["AREA_ELEMENT_COLOR"] = "area_element_color";
  FlipsnackOption["AREA_ELEMENT_OPACITY"] = "area_element_opacity";
  FlipsnackOption["SHOP_BUTTON_COLOR"] = "shop_button_color";
  FlipsnackOption["SHOP_BUTTON_LABEL"] = "shop_button_label";
  FlipsnackOption["SHOP_LABEL_COLOR"] = "shop_label_color";
  FlipsnackOption["WEBSITE_BUTTON"] = "website_button";
  FlipsnackOption["WEBSITE_BUTTON_LABEL"] = "website_button_label";
  FlipsnackOption["WEBSITE_LINK"] = "website_link";
  FlipsnackOption["CUSTOMIZABLE_PRODUCT"] = "customizable_product";
  FlipsnackOption["CUSTOMIZABLE_PRODUCT_INSTRUCTIONS"] = "customizable_product_instructions";
  FlipsnackOption["CUSTOMIZABLE_PRODUCT_FLAT_FEE"] = "customizable_product_flat_fee";
  FlipsnackOption["CUSTOMIZABLE_PRODUCT_PER_CHARACTER"] = "customizable_product_per_character";
  FlipsnackOption["CUSTOMIZABLE_PRODUCT_CHARACTER_LENGTH"] = "customizable_product_character_length";
  FlipsnackOption["CUSTOMIZABLE_PRODUCT_MANDATORY"] = "customizable_product_mandatory";
  return FlipsnackOption;
}({});
var MappingKeys = {
  PRODUCT_TYPE: 'product_type',
  CODE: 'code',
  PARENT_CODE: 'parent_code',
  TITLE: 'title',
  DESCRIPTION: 'description',
  IMAGE_LINK: 'image_link',
  SELL_PRICE: 'sell_price',
  CURRENCY: 'currency',
  DISCOUNT_PRICE: 'discount_price',
  VISIBLE: 'visible',
  QUANTITY: 'quantity',
  MIN_PURCHASABLE_QTY: 'min_purchasable_qty',
  MAX_PURCHASABLE_QTY: 'max_purchasable_qty',
  ATTRIBUTE_NAME1: 'attribute_name1',
  ATTRIBUTE_OPTIONS1: 'attribute_options1',
  ATTRIBUTE_NAME2: 'attribute_name2',
  ATTRIBUTE_OPTIONS2: 'attribute_options2',
  ATTRIBUTE_NAME3: 'attribute_name3',
  ATTRIBUTE_OPTIONS3: 'attribute_options3',
  IMAGE_ATTRIBUTE: 'image_attribute',
  VARIANT_IMAGE_LINK: 'variant_image_link',
  VARIANT_PRICE: 'variant_price',
  VARIANT_DISCOUNT_PRICE: 'variant_discount_price',
  SHOP_ELEMENT: 'shop_element',
  AREA_ELEMENT_TOOLTIP: 'area_element_tooltip',
  AREA_ELEMENT_COLOR: 'area_element_color',
  AREA_ELEMENT_OPACITY: 'area_element_opacity',
  SHOP_BUTTON_COLOR: 'shop_button_color',
  SHOP_BUTTON_LABEL: 'shop_button_label',
  SHOP_LABEL_COLOR: 'shop_label_color',
  WEBSITE_BUTTON: 'website_button',
  WEBSITE_BUTTON_LABEL: 'website_button_label',
  WEBSITE_LINK: 'website_link',
  CUSTOMIZABLE_PRODUCT: 'customizable_product',
  CUSTOMIZABLE_PRODUCT_INSTRUCTIONS: 'customizable_product_instructions',
  CUSTOMIZABLE_PRODUCT_FLAT_FEE: 'customizable_product_flat_fee',
  CUSTOMIZABLE_PRODUCT_PER_CHARACTER: 'customizable_product_per_character',
  CUSTOMIZABLE_PRODUCT_CHARACTER_LENGTH: 'customizable_product_character_length',
  CUSTOMIZABLE_PRODUCT_MANDATORY: 'customizable_product_mandatory'
};
;// CONCATENATED MODULE: ../../modules/utils/code/constants/src/defaultConfig.ts
var src_defaultConfig_config = {
  cdnBase: '',
  cdnContent: '',
  cdnStatic: '',
  siteBase: '',
  siteAppUrl: '',
  trackingData: '',
  statisticsEndpoint: '',
  leadFormEndpoint: '',
  enableCollectStats: false,
  enableGATracking: false,
  fullscreenUrl: '',
  enableWatermark: false,
  orderEmailEndpoint: '',
  recaptchaListKey: '',
  privateContentCdn: '',
  interactivityElementsEndpoint: '',
  trackOrdersEndpoint: '',
  interactivityResultsEndpoint: '',
  renderedFrom: ''
};
;// CONCATENATED MODULE: ../../modules/utils/code/constants/src/logo.ts
var LogoLocation = {
  COLLECTION: 'collection'
};
;// CONCATENATED MODULE: ../../modules/utils/code/constants/src/flipbook.ts
var ItemExtensions = {
  PDF: 'pdf',
  JPEG: 'jpeg',
  JPG: 'jpg',
  PNG: 'png',
  MP4: 'mp4',
  CUSTOM: 'custom'
};
;// CONCATENATED MODULE: ../../modules/utils/code/constants/src/cartShopSettings.ts
var CartEmailSubject = {
  SELLER: 'You received a new order!',
  BUYER: 'We received your order!'
};
;// CONCATENATED MODULE: ../../modules/utils/code/constants/src/emailBrandingDefaults.ts
var emailBrandingDefaults = {
  logo: '',
  fileName: 'email-logo.png',
  accentColor: '#0362FC',
  companyName: 'Flipsnack',
  footerDescription: "\xA9 Copyright ".concat(new Date().getFullYear(), " Flipsnack\n    7310 Ruth Dr, Sterling Heights, Michigan, 48312-1977, USA"),
  textColor: '#FFFFFF'
};
;// CONCATENATED MODULE: ../../modules/utils/code/constants/src/creationEntryPoints.ts
var CREATION_ENTRY_POINTS = /*#__PURE__*/function (CREATION_ENTRY_POINTS) {
  CREATION_ENTRY_POINTS["ADOBE_INDESIGN"] = "adobe_indesign";
  CREATION_ENTRY_POINTS["MARQ"] = "marq";
  CREATION_ENTRY_POINTS["CATALOG_GENERATOR"] = "catalog_generator";
  CREATION_ENTRY_POINTS["GOOGLE_DRIVE"] = "google_drive";
  CREATION_ENTRY_POINTS["UPLOAD_PDF"] = "upload_pdf";
  CREATION_ENTRY_POINTS["CREATE_FROM_SCRATCH"] = "create_scratch";
  CREATION_ENTRY_POINTS["USE_TEMPLATE"] = "use_template";
  CREATION_ENTRY_POINTS["DUPLICATE"] = "duplicate";
  CREATION_ENTRY_POINTS["UPLOAD_API"] = "upload_api";
  return CREATION_ENTRY_POINTS;
}({});
;// CONCATENATED MODULE: ../../modules/utils/code/constants/src/index.ts













;// CONCATENATED MODULE: ../../modules/utils/code/store/src/static/config.ts

function static_config_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function static_config_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? static_config_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : static_config_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

var configInstance = static_config_objectSpread({}, src_defaultConfig_config);
var setConfig = function setConfig(config) {
  configInstance = static_config_objectSpread(static_config_objectSpread({}, src_defaultConfig_config), config);
};
var getConfig = function getConfig() {
  return configInstance;
};
var getCdnBase = function getCdnBase() {
  return configInstance.cdnBase;
};
var getContent = function getContent() {
  return configInstance.cdnContent;
};
var getPrivateContent = function getPrivateContent() {
  return configInstance.privateContentCdn;
};
var getSiteBase = function getSiteBase() {
  return configInstance.siteBase;
};
var getSiteAppUrl = function getSiteAppUrl() {
  return configInstance.siteAppUrl;
};
var getFullScreenUrl = function getFullScreenUrl() {
  return configInstance.fullscreenUrl;
};
var getLeadFormEndpoint = function getLeadFormEndpoint() {
  return configInstance.leadFormEndpoint;
};
var getInteractivityElementsEndpoint = function getInteractivityElementsEndpoint() {
  return configInstance.interactivityElementsEndpoint;
};
var getTrackOrdersEndpoint = function getTrackOrdersEndpoint() {
  return configInstance.trackOrdersEndpoint;
};
var getInteractivityResultsEndpoint = function getInteractivityResultsEndpoint() {
  return configInstance.interactivityResultsEndpoint;
};
var getTrackingData = function getTrackingData() {
  return configInstance.trackingData;
};
var resetConfig = function resetConfig() {
  return setConfig(static_config_objectSpread({}, src_defaultConfig_config));
};
;// CONCATENATED MODULE: ../../modules/utils/code/store/src/static/index.ts


;// CONCATENATED MODULE: ../../modules/utils/code/store/src/index.ts




;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/removeCartFromLocalStorage.ts
/**
 * @param {string} itemKey
 */
/* harmony default export */ var removeCartFromLocalStorage = (function (itemKey) {
  try {
    localStorage.removeItem(itemKey);
  } catch (e) {
    // Nothing to do
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/getAddToCartPrice.ts
/**
 * Display the product price value based on the price and discount price
 * @param {string} price
 * @param {string} discountPrice
 * @returns {string}
 */
/* harmony default export */ var getAddToCartPrice = (function (price, discountPrice) {
  if (price) {
    return discountPrice || price;
  }
  return price || '';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/getCartFromLocalStorage.ts
/**
 * Get the cart object from the local storage
 * @param {string} playerToken
 * @returns {CartType}
 */
/* harmony default export */ var getCartFromLocalStorage = (function (playerToken) {
  try {
    var flipbookCartStringified = localStorage && localStorage.getItem("".concat(playerToken, "cart"));
    if (!flipbookCartStringified) {
      return {};
    }
    var cart = JSON.parse(flipbookCartStringified);
    if (!cart.products) {
      cart = {
        products: cart,
        order: Object.keys(cart),
        publishDate: cart.publishDate,
        isWhatsAppCheckout: cart.isWhatsAppCheckout
      };
    }
    return cart;
  } catch (e) {
    return {};
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/setCartToLocalStorage.ts


/**
 * Set the cart object to local storage
 * @param {string} playerToken
 * @param {CartType} cart
 * @param order
 * @param {number | undefined} datePublished
 * @param {boolean} isWhatsAppCheckout
 */

/* harmony default export */ var setCartToLocalStorage = (function (playerToken, cart, order, datePublished, isWhatsAppCheckout) {
  try {
    if (localStorage) {
      var publishDate;

      // If we have a datePublished use it
      if (datePublished !== undefined) {
        publishDate = datePublished;
        // Otherwise use the publishDate from the local storage
      } else {
        var _getCartFromLocalStor = getCartFromLocalStorage(playerToken);
        publishDate = _getCartFromLocalStor.publishDate;
      }
      localStorage.setItem("".concat(playerToken, "cart"), JSON.stringify({
        products: cart.products,
        order: order,
        publishDate: publishDate,
        isWhatsAppCheckout: isWhatsAppCheckout
      }));
    }
  } catch (e) {
    // If we don't have local storage do nothing
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/cart/cart.ts

function cart_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function cart_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? cart_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : cart_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }






/**
 * Object representing the cart
 */
var cartAtom = vanilla_atom({
  products: {},
  order: []
});

/**
 * Boolean representing the cart panel footer visibility (display more precisely)
 * ! THIS ATOM HIDES THE WHOLE NAVIGATION BAR TOO IF IT'S TRUE !
 */
cartAtom.debugLabel = "cartAtom";
var hideCartPanelFooterAtom = vanilla_atom(false);
hideCartPanelFooterAtom.debugLabel = "hideCartPanelFooterAtom";
var addedCartItemAtomDefault = {
  show: false,
  imgSrc: '',
  isFirstItemAdded: false
};

/**
 * Represents the added cart item for 3 seconds (right after it was added to the cart)
 */
var addedCartItemAtom = vanilla_atom(addedCartItemAtomDefault);
addedCartItemAtom.debugLabel = "addedCartItemAtom";
/**
 * Add an item (product) to the cart or increase its quantity if its already in the cart
 */
var addItemToCartAtom = vanilla_atom(null, function (get, set, _ref) {
  var playerToken = _ref.playerToken,
    newCartItem = _ref.newCartItem,
    datePublished = _ref.datePublished,
    addToCartAnimation = _ref.addToCartAnimation;
  var cart = get(cartAtom);
  var order = (cart === null || cart === void 0 ? void 0 : cart.order) || [];

  // If we have nothing in the list, it means this is the first product added to the cart.
  var isFirstItemAdded = !order.length;
  var elementId = newCartItem.elementId,
    title = newCartItem.title,
    price = newCartItem.price,
    code = newCartItem.code,
    variantSku = newCartItem.variantSku,
    discountPrice = newCartItem.discountPrice,
    media = newCartItem.media,
    quantity = newCartItem.quantity,
    website = newCartItem.website,
    customizableProduct = newCartItem.customizableProduct;
  var firstImgSrc = addToCartAnimation.firstImgSrc,
    addToCartAnimationDelay = addToCartAnimation.addToCartAnimationDelay;

  // The 'add to cart' animation will have a delay if the function was called from a button in a modal else the
  // startAddToCartAnimation will be 0 (the animation will start instant)
  var startAddToCartAnimation = function startAddToCartAnimation() {
    return setTimeout(function () {
      return set(addedCartItemAtom, {
        show: true,
        imgSrc: firstImgSrc,
        isFirstItemAdded: isFirstItemAdded
      });
    }, addToCartAnimationDelay);
  };

  // Verify if the product exists in the cart
  if (cart.products && cart.products[elementId]) {
    // Verify if the seller let the customer add more than 1 product (of this type) in the cart
    if (quantity.enabled) {
      var MAX = src_CartView.constants.CartQuantityLimits.MAX;
      cart.products[elementId].quantityProperties = quantity;
      // If there exists a range for the quantity of an item and the user exceeds it
      // then the value for the quantity is the upper limit itself
      if (quantity.hasRange && cart.products[elementId].quantity >= quantity.max) {
        cart.products[elementId].quantity = quantity.max;
        // If there is no range for the quantity of an item but the user exceeds
        // the maximum possible value that can be reached for an item(9999)
        // then the value for the quantity is the maximum upper limit
      } else if (cart.products[elementId].quantity >= MAX) {
        cart.products[elementId].quantity = MAX;
      } else {
        var add = quantity.value || 1;
        cart.products[elementId].quantity += add;
        startAddToCartAnimation();
      }
    } else {
      cart.products[elementId].quantityProperties.enabled = false;
    }
  } else {
    var customizableProductPropertiesData = customizableProduct !== null && customizableProduct !== void 0 && customizableProduct.value ? {
      customizableProductProperties: {
        label: customizableProduct.label,
        value: customizableProduct === null || customizableProduct === void 0 ? void 0 : customizableProduct.value
      }
    } : {};
    var mediaData = media !== null && media !== void 0 && media.length ? {
      media: media
    } : {};
    cart.products[elementId] = cart_objectSpread(cart_objectSpread(cart_objectSpread({
      title: title,
      price: getAddToCartPrice(price, discountPrice),
      code: code,
      variantSku: variantSku || '',
      quantityProperties: {
        enabled: quantity.enabled,
        hasRange: quantity.hasRange,
        hasMOQ: quantity.hasMOQ || false,
        min: quantity.min,
        max: quantity.max
      }
    }, customizableProductPropertiesData), {}, {
      quantity: quantity.value || 1
    }, mediaData), {}, {
      websiteUrl: (website === null || website === void 0 ? void 0 : website.websiteUrl) || ''
    });
    startAddToCartAnimation();
  }

  // Add the elementID to the order array
  if (!order.includes(elementId)) {
    order.push(elementId);
  }
  set(cartAtom, {
    products: cart_objectSpread({}, cart.products),
    order: order
  });
  setCartToLocalStorage(playerToken, cart, order, datePublished);
});

/**
 * Change the quantity of an item in the cart
 */
addItemToCartAtom.debugLabel = "addItemToCartAtom";
var changeItemQuantityInCartAtom = vanilla_atom(null, function (get, set, _ref2) {
  var playerToken = _ref2.playerToken,
    elementId = _ref2.elementId,
    newQuantity = _ref2.newQuantity;
  var cart = get(cartAtom);
  cart.products[elementId].quantity = newQuantity;
  set(cartAtom, {
    products: cart_objectSpread({}, cart.products),
    order: cart.order
  });
  setCartToLocalStorage(playerToken, cart, cart.order);
});

/**
 * Delete an item from the cart
 */
changeItemQuantityInCartAtom.debugLabel = "changeItemQuantityInCartAtom";
var deleteItemFromCartAtom = vanilla_atom(null, function (get, set, _ref3) {
  var playerToken = _ref3.playerToken,
    elementId = _ref3.elementId;
  var cart = get(cartAtom);
  delete cart.products[elementId];
  cart.order = cart.order.filter(function (element) {
    return element !== elementId;
  });
  set(cartAtom, {
    products: cart_objectSpread({}, cart.products),
    order: cart.order
  });
  setCartToLocalStorage(playerToken, cart, cart.order);
  if (!Object.keys(cart).length) {
    removeCartFromLocalStorage("".concat(playerToken, "cart"));
  }
});

/**
 * Delete all items from the cart
 */
deleteItemFromCartAtom.debugLabel = "deleteItemFromCartAtom";
var deleteAllItemsFromCartAtom = vanilla_atom(null, function (get, set, playerToken) {
  set(cartAtom, {
    products: {},
    order: []
  });
  removeCartFromLocalStorage("".concat(playerToken, "cart"));
});

/**
 * Change WhatsApp checkout order state
 */
deleteAllItemsFromCartAtom.debugLabel = "deleteAllItemsFromCartAtom";
var setCheckoutViaWhatsAppCartAtom = vanilla_atom(null, function (get, set, playerToken) {
  var cart = get(cartAtom);
  set(cartAtom, {
    products: cart.products,
    order: cart.order,
    isWhatsAppCheckout: true
  });
  setCartToLocalStorage(playerToken, cart, cart.order, undefined, true);
});
setCheckoutViaWhatsAppCartAtom.debugLabel = "setCheckoutViaWhatsAppCartAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/flipbook.ts
var DOWNLOAD_PDF_SUFFIX = 'download-pdf';
var PRINT_PDF_SUFFIX = 'print-pdf';
var PlayerJsonTokenDelimiter = '+';
var ElementAttributesVariants = {
  MODAL: 'modal'
};
var PasswordEncryptionVersion = /*#__PURE__*/function (PasswordEncryptionVersion) {
  PasswordEncryptionVersion[PasswordEncryptionVersion["NONE"] = 0] = "NONE";
  PasswordEncryptionVersion[PasswordEncryptionVersion["V1"] = 1] = "V1";
  // sha1
  PasswordEncryptionVersion[PasswordEncryptionVersion["V2"] = 2] = "V2"; // salt
  return PasswordEncryptionVersion;
}({});
var flipbook_ItemResourceBucket = /*#__PURE__*/function (ItemResourceBucket) {
  ItemResourceBucket["DEFAULT"] = "default";
  ItemResourceBucket["CONTENT"] = "content";
  return ItemResourceBucket;
}({});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/getPlayerToken.ts


/* harmony default export */ var getPlayerToken = (function (accountId, flipbookHash) {
  return base64_default().encode("".concat(accountId).concat(PlayerJsonTokenDelimiter).concat(flipbookHash));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useCart.ts







/* harmony default export */ var useCart = (function (hash, accountId, flipbookPublishDate) {
  var _useAtom = react_useAtom(cartAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    setCart = _useAtom2[1];
  (0,react.useEffect)(function () {
    var _window;
    (_window = window) === null || _window === void 0 || (_window = _window.top) === null || _window === void 0 || _window.postMessage("getCartAccess-".concat(hash), '*');

    // Get the cart from the local storage and set it to its atom
    var playerToken = getPlayerToken(accountId, hash);
    var cartFromLocalStorage = getCartFromLocalStorage(playerToken);
    var publishDate = cartFromLocalStorage.publishDate;

    // Reset cart if the user republishes the flipbook
    if (publishDate !== flipbookPublishDate) {
      removeCartFromLocalStorage("".concat(playerToken, "cart"));
      setCart({
        products: {},
        order: []
      });
    } else {
      setCart({
        products: (cartFromLocalStorage === null || cartFromLocalStorage === void 0 ? void 0 : cartFromLocalStorage.products) || {},
        order: (cartFromLocalStorage === null || cartFromLocalStorage === void 0 ? void 0 : cartFromLocalStorage.order) || Object.keys((cartFromLocalStorage === null || cartFromLocalStorage === void 0 ? void 0 : cartFromLocalStorage.products) || {}),
        isWhatsAppCheckout: (cartFromLocalStorage === null || cartFromLocalStorage === void 0 ? void 0 : cartFromLocalStorage.isWhatsAppCheckout) || false
      });
    }
  }, [hash]);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/signature/signature.ts

var signature = vanilla_atom('');

/**
 * Read & Write signature atom
 */
signature.debugLabel = "signature";
var signatureAtom = vanilla_atom(function (get) {
  return get(signature);
}, function (get, set, newSignature) {
  if (get(signature) !== newSignature) {
    set(signature, newSignature);
  }
});
signatureAtom.debugLabel = "signatureAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getSkinType.ts



/**
 * Function that returns modern skin type on mobile and for old widget player skin type
 * @param {SkinTypes} skinType
 * @return {SkinTypes.CLASSIC | SkinTypes.MODERN}
 */
/* harmony default export */ var getSkinType = (function (skinType) {
  if (main/* isMobile */.Fr || skinType === playerTypes_SkinTypes.WIDGET_MODERN) {
    return playerTypes_SkinTypes.MODERN;
  }
  return skinType;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/getFlipbookEffect.ts


/**
 * Returns flipbook effect whether flipbook is on mobile or desktop view
 *
 * @param flipbookOptions
 * @param hasAccessToPageTransitionScroll
 *
 * @return string
 */
/* harmony default export */ var getFlipbookEffect = (function (flipbookOptions) {
  var hasAccessToPageTransitionScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var effect = flipbookOptions.content.effect;
  if (flipbookOptions.content.isMobilePreview || main/* isMobileOnly */.XF) {
    var _flipbookOptions$cont2;
    if (hasAccessToPageTransitionScroll) {
      var _flipbookOptions$cont;
      effect = (_flipbookOptions$cont = flipbookOptions.content.mobileEffect) !== null && _flipbookOptions$cont !== void 0 ? _flipbookOptions$cont : effect;
    } else if (!hasAccessToPageTransitionScroll && ((_flipbookOptions$cont2 = flipbookOptions.content) === null || _flipbookOptions$cont2 === void 0 ? void 0 : _flipbookOptions$cont2.mobileEffect) === playerTypes_PlayerEffect.SCROLL) {
      return effect;
    } else {
      var _flipbookOptions$cont3;
      effect = (_flipbookOptions$cont3 = flipbookOptions.content.mobileEffect) !== null && _flipbookOptions$cont3 !== void 0 ? _flipbookOptions$cont3 : effect;
    }
  }
  return effect;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/index.ts
var constants_WidgetLayoutTypes = {
  SINGLE: 'singlePage',
  DOUBLE: 'doublePage',
  SMART: 'smartView'
};
var SLIDE = 'slide';
var ZOOM_MIN_VALUE = 1;
var ZOOM_MAX_VALUE = 5;
var IconSize = /*#__PURE__*/function (IconSize) {
  IconSize["small"] = "small";
  IconSize["medium"] = "medium";
  IconSize["large"] = "large";
  return IconSize;
}({});
var Effect = {
  SLIDE: 'slide',
  SCROLL: 'scroll',
  FLIP: 'flip'
};
var ScrollExecutionWaitTime = 150; // ms

var constants_BackgroundTypes = {
  COLOR: 'color',
  IMAGE: 'image',
  PATTERN: 'pattern'
};
var TOOLTIP_CURSOR_PADDING = 5;
var constants_WindowVisibility = {
  VISIBLE: 'visible',
  HIDDEN: 'hidden'
};
var Panel = {
  ACCESSIBILITY: 'ACCESSIBILITY',
  SEARCH: 'SEARCH',
  SHARE: 'SHARE',
  TOC: 'TOC',
  CART: 'CART',
  ZOOM: 'ZOOM'
};
var PanelPosition = /*#__PURE__*/function (PanelPosition) {
  PanelPosition["BOTTOM_RIGHT"] = "bottom-right";
  PanelPosition["TOP_CENTER"] = "top-center";
  PanelPosition["TOP_RIGHT"] = "top-right";
  PanelPosition["TOP_LEFT"] = "top-left";
  PanelPosition["LEFT"] = "left";
  return PanelPosition;
}({});
var WAIT_CONTROLLER_BAR_HIDE_MS = 2000;
var SCROLLABLE_POPOVER_MAX_HEIGHT = 146;
var constants_WAIT_USER_INTERACTION_MS = 300;
var SearchTextLimits = {
  BEFORE: 10,
  AFTER: 30
};
var AriaLabel = {
  ACCESSIBILITY_BUTTON: 'Accessibility',
  INCREASE_FONT_SIZE: 'Increase font size',
  DECREASE_FONT_SIZE: 'Decrease font size',
  CLOSE_BUTTON: 'Close',
  CLEAR_BUTTON: 'Clear',
  PREVIOUS: 'Previous',
  NEXT: 'Next',
  EMAIL: 'Email',
  REMOVE_ITEM_BUTTON: 'Remove item button'
};
var HtmlButtonTypes = {
  BUTTON: 'button',
  SUBMIT: 'submit',
  RESET: 'reset'
};
var AccessibilityTextSize = [{
  pagination: {
    FONT_SIZE: 20,
    LINE_HEIGHT: 23,
    FONT_WEIGHT: 700
  },
  title: {
    FONT_SIZE: 20,
    LINE_HEIGHT: 30,
    LETTER_SPACING: 1.8,
    FONT_WEIGHT: 700
  },
  description: {
    FONT_SIZE: 18,
    LINE_HEIGHT: 26,
    LETTER_SPACING: 1.8,
    FONT_WEIGHT: 400
  }
}, {
  pagination: {
    FONT_SIZE: 36,
    LINE_HEIGHT: 52,
    FONT_WEIGHT: 700
  },
  title: {
    FONT_SIZE: 30,
    LINE_HEIGHT: 39,
    LETTER_SPACING: 1.8,
    FONT_WEIGHT: 700
  },
  description: {
    FONT_SIZE: 30,
    LINE_HEIGHT: 42,
    LETTER_SPACING: 1.8,
    FONT_WEIGHT: 400
  }
}, {
  pagination: {
    FONT_SIZE: 55,
    LINE_HEIGHT: 64,
    FONT_WEIGHT: 700
  },
  title: {
    FONT_SIZE: 52,
    LINE_HEIGHT: 54,
    LETTER_SPACING: 1.8,
    FONT_WEIGHT: 700
  },
  description: {
    FONT_SIZE: 52,
    LINE_HEIGHT: 54,
    LETTER_SPACING: 1.8,
    FONT_WEIGHT: 400
  }
}];
var constants_Orientation = {
  LANDSCAPE: 'landscape',
  PORTRAIT: 'portrait'
};
var LEAD_FORM_ID = 'lead-form';
var LEAD_FORM_COMPLETED = 'lead-form-completed';
var PAGES_MODAL_ID = 'pages-modal';
var PASSWORD_MODAL_ID = 'password-modal';
var CART_SEND_ORDER_MODAL_ID = 'cart-send-order-modal';
var CART_CLEAR_LIST_MODAL_ID = 'cart-clear-list-modal';
var MANDATORY_MODAL_ID = 'mandatory-modal';
var LAST_PAGE_INDEX = (/* unused pure expression or super */ null && (-1)); // Otherwise we need stage length dependency

var DEFAULT_SCALE_CONTENT = 1;
var TRANSITION_EFFECT_DONE = 'transitionEffectDone';
var TRANSITION_EFFECT_START = 'transitionEffectStart';
var WATERMARK_BAR_HEIGHT = 36;
var Directions = {
  RIGHT_TO_LEFT: 'rtl',
  LEFT_TO_RIGHT: 'ltr'
};
var TypesOfSpacing = {
  PADDING: 'padding',
  MARGIN: 'margin'
};
var ChangeAction = /*#__PURE__*/function (ChangeAction) {
  ChangeAction[ChangeAction["Next"] = 0] = "Next";
  ChangeAction[ChangeAction["Previous"] = 1] = "Previous";
  return ChangeAction;
}({});
var DefaultCartConfig = {
  customerContactFields: [{
    id: 0,
    fieldName: 'Email address',
    validation: 'email',
    required: true,
    noOfRows: 1,
    userInput: '',
    valid: false
  }],
  currency: 'USD',
  showCartInPlayer: true,
  privacyPolicy: {
    enabled: false,
    company: '',
    website: ''
  },
  showOrderNumber: true,
  confirmationMessage: '',
  buyerContactSectionTitle: 'Contact details',
  buyerContactDescription: 'To send the order you must enter your contact details.' + ' Once we receive your order, we will get back to you as soon as possible.'
};
var CONDITIONAL_EMAIL_HASH = 'conditionalEmailHash';
var EmailInboxType = {
  CONDITIONAL: 'CONDITIONAL',
  SIMPLE: 'SIMPLE'
};
var TopMenuPosition = /*#__PURE__*/function (TopMenuPosition) {
  TopMenuPosition["RIGHT"] = "right";
  TopMenuPosition["CENTER"] = "center";
  return TopMenuPosition;
}({});
var InteractivityType = /*#__PURE__*/function (InteractivityType) {
  InteractivityType["QUIZ"] = "quiz";
  InteractivityType["POLL"] = "poll";
  InteractivityType["QUESTION"] = "question";
  InteractivityType["CONTACT_FORM"] = "contact_form";
  return InteractivityType;
}({});
var LEAD_FORM_TITLE_WIDTH = 370; // Custom for design

var FLIPBOOK_MIN_MARGIN = 64;
var LOAD_FLIPBOOK_PAGES_BUFFER = 2;
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/defaultUI.ts

var defaultUI = {
  // TODO: use immutable or primitives instead of objects
  stageSize: {
    width: 0,
    height: 0
  },
  panelType: '',
  orientation: constants_Orientation.LANDSCAPE,
  leadFormStageIndex: -1
};
/* harmony default export */ var constants_defaultUI = (defaultUI);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/theme/types.ts
var ColorsWithOpacity = /*#__PURE__*/function (ColorsWithOpacity) {
  ColorsWithOpacity["PRIMARY"] = "primary";
  ColorsWithOpacity["BLACK"] = "black";
  ColorsWithOpacity["GREY"] = "grey";
  ColorsWithOpacity["WHITE"] = "white";
  ColorsWithOpacity["DANGER"] = "danger";
  ColorsWithOpacity["DANGER_TEXT"] = "dangerText";
  ColorsWithOpacity["DISABLED"] = "disabled";
  ColorsWithOpacity["SUCCESS"] = "success";
  ColorsWithOpacity["SUCCESS_TEXT"] = "successText";
  ColorsWithOpacity["WARNING"] = "warning";
  return ColorsWithOpacity;
}({});
var DeviceSize = /*#__PURE__*/function (DeviceSize) {
  DeviceSize[DeviceSize["mobileS"] = 319] = "mobileS";
  DeviceSize[DeviceSize["mobileM"] = 359] = "mobileM";
  DeviceSize[DeviceSize["mobileL"] = 413] = "mobileL";
  DeviceSize[DeviceSize["tabletXS"] = 510] = "tabletXS";
  DeviceSize[DeviceSize["tabletS"] = 640] = "tabletS";
  DeviceSize[DeviceSize["tabletM"] = 767] = "tabletM";
  DeviceSize[DeviceSize["tabletL"] = 840] = "tabletL";
  DeviceSize[DeviceSize["tabletXL"] = 959] = "tabletXL";
  DeviceSize[DeviceSize["laptopS"] = 1023] = "laptopS";
  DeviceSize[DeviceSize["laptopM"] = 1279] = "laptopM";
  DeviceSize[DeviceSize["laptopL"] = 1439] = "laptopL";
  DeviceSize[DeviceSize["laptopFHD"] = 1919] = "laptopFHD";
  DeviceSize[DeviceSize["desktop"] = 2559] = "desktop";
  return DeviceSize;
}({});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/ui/panel.ts




var panel = vanilla_atom(constants_defaultUI.panelType);

/**
 * Read & write Atom
 */
panel.debugLabel = "panel";
var fixedPanelAtom = vanilla_atom(constants_defaultUI.panelType, function (get, set, newPanelType) {
  if (get(fixedPanelAtom) !== newPanelType) {
    if (get(panel)) {
      if (main/* isMobileOnly */.XF || window.innerWidth <= DeviceSize.tabletS) {
        set(panel, '');
      }
    }
    set(fixedPanelAtom, newPanelType);
  }
});

/**
 * Read & write Atom
 */
fixedPanelAtom.debugLabel = "fixedPanelAtom";
var panelAtom = vanilla_atom(function (get) {
  return get(panel);
}, function (get, set, newPanelType) {
  if (get(panel) !== newPanelType) {
    if (get(fixedPanelAtom)) {
      if (main/* isMobileOnly */.XF || window.innerWidth <= DeviceSize.tabletS) {
        set(fixedPanelAtom, '');
      }
    }
    set(panel, newPanelType);
  }
});

/**
 * Write only Atom
 */
panelAtom.debugLabel = "panelAtom";
var closePanelAtom = vanilla_atom(null, function (get, set) {
  if (get(panel)) {
    set(panel, '');
  }
});
closePanelAtom.debugLabel = "closePanelAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/ui/controllerBar.ts



// For local use only
var isVisible = vanilla_atom(true);
isVisible.debugLabel = "isVisible";
var controllerBarVisibleAtom = vanilla_atom(function (get) {
  return get(isVisible);
}, function (get, set, visible) {
  if (get(isVisible) !== visible && !get(panelAtom)) {
    set(isVisible, visible);
  }
});
controllerBarVisibleAtom.debugLabel = "controllerBarVisibleAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/keyCodes.ts
// Key events (not supported by IE)
var ARROW_LEFT = 'ArrowLeft';
var ARROW_RIGHT = 'ArrowRight';
var ESCAPE = 'Escape';
var ENTER = 'Enter';
var PAGE_UP = 'PageUp';
var PAGE_DOWN = 'PageDown';

// IE/Edge specific value
var keyCodes_LEFT = 'Left';
var keyCodes_RIGHT = 'ArrowRight';
var ESC = 'Esc';

// Key events supported by all browsers
var F_KEY = 'f';
var P_KEY = 'p';
var SUBTRACT_KEY = '-';
var ADD_KEY = '+';
var TAB_KEY = 'Tab';

// Keys that are used for player interaction
var validKeysForPlayerInteraction = [F_KEY, P_KEY, SUBTRACT_KEY, ADD_KEY, ESC, ESCAPE];
var nextPageKeys = new Set([ARROW_RIGHT, keyCodes_RIGHT, PAGE_DOWN]);
var previousPageKeys = new Set([ARROW_LEFT, keyCodes_LEFT, PAGE_UP]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/ModalContext.ts

var stageContextDefault = {
  setOpen: function setOpen() {},
  active: '',
  disabled: false,
  setDisabled: function setDisabled() {}
};
var ModalContext = /*#__PURE__*/react.createContext(stageContextDefault);
var ModalProvider = ModalContext.Provider;
/* harmony default export */ var contexts_ModalContext = (ModalContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/ui/mouseOverPlayer.ts

var mouseOverPlayerAtom = vanilla_atom(true);
mouseOverPlayerAtom.debugLabel = "mouseOverPlayerAtom";
var setMouseOverPlayerAtom = vanilla_atom(function (get) {
  return get(mouseOverPlayerAtom);
}, function (get, set, overPlayer) {
  if (get(mouseOverPlayerAtom) !== overPlayer) {
    set(mouseOverPlayerAtom, overPlayer);
  }
});
setMouseOverPlayerAtom.debugLabel = "setMouseOverPlayerAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBarManager/DeviceControllerBarManager/DesktopControllerBarManager.tsx








/**
 * For desktop:
 * - Should be always hidden when mouse is not over iframe
 * - Should be visible on the first and second click outside the navigation container
 * - Should be visible on player navigation
 * - Should be visible when mouse is moving
 * - Should be visible when Tab key is pressed
 */

var DesktopControllerBarManager = function DesktopControllerBarManager(_ref) {
  var hideControlsWithDelay = _ref.hideControlsWithDelay,
    controllerBarActive = _ref.controllerBarActive;
  var isMouseOverPlayer = react_useAtomValue(mouseOverPlayerAtom);
  var _useAtom = react_useAtom(controllerBarVisibleAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    isControllerBarVisible = _useAtom2[0],
    setControllerBarVisible = _useAtom2[1];
  var _useContext = (0,react.useContext)(contexts_ModalContext),
    modalActive = _useContext.active;
  (0,react.useEffect)(function () {
    // We use controllerBarActive to keep the control bar active on the customize page
    if (controllerBarActive) {
      setControllerBarVisible(true);
    } else if (!isMouseOverPlayer) {
      setControllerBarVisible(false);
    } else if (!modalActive) {
      var handleAutoHide = function handleAutoHide() {
        hideControlsWithDelay.cancel();
        if (!isControllerBarVisible) {
          setControllerBarVisible(true);
        }
        hideControlsWithDelay();
      };
      var onKeyPress = function onKeyPress(_ref2) {
        var key = _ref2.key;
        if (key === TAB_KEY) {
          handleAutoHide();
        }
      };
      window.addEventListener('click', handleAutoHide);
      window.addEventListener('mousemove', handleAutoHide);
      window.addEventListener('keyup', onKeyPress);
      return function () {
        window.removeEventListener('click', handleAutoHide);
        window.removeEventListener('mousemove', handleAutoHide);
        window.removeEventListener('keyup', onKeyPress);
      };
    } else {
      setControllerBarVisible(true);
    }
    return function () {};
  }, [isControllerBarVisible, isMouseOverPlayer, modalActive, controllerBarActive]);
  return null;
};
/* harmony default export */ var DeviceControllerBarManager_DesktopControllerBarManager = (DesktopControllerBarManager);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/constants.ts
var DoubleClickZoomValue = 2;
var DoubleTapTimeout = 200; // ms
var InitialScaleValue = 1;
var KeyframeOptions = {
  duration: 200,
  easing: 'ease',
  fill: 'forwards'
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBarManager/DeviceControllerBarManager/MobileControllerBarManager.tsx









/**
 * For mobile:
 * - Should be visible on the first tap outside the navigation container
 * - Should be hidden on the second tap outside the navigation container
 * - Should be hidden on player navigation
 */

var MobileControllerBarManager = function MobileControllerBarManager(_ref) {
  var hideControlsWithDelay = _ref.hideControlsWithDelay;
  var isMouseOverPlayer = react_useAtomValue(mouseOverPlayerAtom);
  var _useAtom = react_useAtom(controllerBarVisibleAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    isControllerBarVisible = _useAtom2[0],
    setControllerBarVisible = _useAtom2[1];
  var _useContext = (0,react.useContext)(contexts_ModalContext),
    active = _useContext.active;
  (0,react.useEffect)(function () {
    if (!active) {
      // Handle touch action on mobile screen
      // We use the debounce method to let the double click event trigger for zoom action
      var onTouchStart = (0,lodash.debounce)(function () {
        hideControlsWithDelay.cancel();
        setControllerBarVisible(!isControllerBarVisible);
        hideControlsWithDelay();
      }, DoubleTapTimeout);
      window.addEventListener('touchstart', onTouchStart);
      return function () {
        onTouchStart.cancel();
        window.removeEventListener('touchstart', onTouchStart);
      };
    }
    setControllerBarVisible(true);
    return function () {};
  }, [isControllerBarVisible, isMouseOverPlayer, active]);
  return null;
};
/* harmony default export */ var DeviceControllerBarManager_MobileControllerBarManager = (MobileControllerBarManager);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBarManager/DeviceControllerBarManager/index.ts


;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBarManager/ControllerBarManager.tsx









/**
 * This component has the responsibility to decide when controls & full screen button should be visible on stage.
 * The native behaviour of the controller bar is to disappear after 2 seconds if there is no action on player.
 * Also, it should be always visible when a panel is open.
 * On some interactions with the player, the controller bar is displayed differently depending on device.
 * For that, there are two different components to handle the visibility
 */

var ControllerBarManager = function ControllerBarManager(_ref) {
  var controllerBarActive = _ref.controllerBarActive;
  var setControllerBarVisible = react_useSetAtom(controllerBarVisibleAtom);
  var panel = react_useAtomValue(panelAtom);
  var hideControlsWithDelay = (0,react.useCallback)((0,lodash.debounce)(function () {
    setControllerBarVisible(false);
  }, WAIT_CONTROLLER_BAR_HIDE_MS), []);
  (0,react.useEffect)(function () {
    if (!panel) {
      hideControlsWithDelay.cancel();
      hideControlsWithDelay();
    }
  }, [panel]);
  return main/* isMobile */.Fr ? /*#__PURE__*/react.createElement(DeviceControllerBarManager_MobileControllerBarManager, {
    hideControlsWithDelay: hideControlsWithDelay
  }) : /*#__PURE__*/react.createElement(DeviceControllerBarManager_DesktopControllerBarManager, {
    hideControlsWithDelay: hideControlsWithDelay,
    controllerBarActive: controllerBarActive
  });
};
/* harmony default export */ var ControllerBarManager_ControllerBarManager = (ControllerBarManager);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBarManager/index.ts

;// CONCATENATED MODULE: ./node_modules/jotai/esm/react/utils.mjs
'use client';





function useResetAtom(anAtom, options) {
  const setAtom = useSetAtom(anAtom, options);
  const resetAtom = useCallback(() => setAtom(RESET), [setAtom]);
  return resetAtom;
}

function useReducerAtom(anAtom, reducer, options) {
  if (( false ? 0 : void 0) !== "production") {
    console.warn(
      "[DEPRECATED] useReducerAtom is deprecated and will be removed in the future. Please create your own version using the recipe. https://github.com/pmndrs/jotai/pull/2467"
    );
  }
  const [state, setState] = useAtom(anAtom, options);
  const dispatch = useCallback(
    (action) => {
      setState((prev) => reducer(prev, action));
    },
    [setState, reducer]
  );
  return [state, dispatch];
}

function useAtomCallback(callback, options) {
  const anAtom = useMemo(
    () => atom(null, (get, set, ...args) => callback(get, set, ...args)),
    [callback]
  );
  return useSetAtom(anAtom, options);
}

const hydratedMap = /* @__PURE__ */ new WeakMap();
function utils_useHydrateAtoms(values, options) {
  const store = react_useStore(options);
  const hydratedSet = getHydratedSet(store);
  for (const [atom, value] of values) {
    if (!hydratedSet.has(atom) || (options == null ? void 0 : options.dangerouslyForceHydrate)) {
      hydratedSet.add(atom);
      store.set(atom, value);
    }
  }
}
const getHydratedSet = (store) => {
  let hydratedSet = hydratedMap.get(store);
  if (!hydratedSet) {
    hydratedSet = /* @__PURE__ */ new WeakSet();
    hydratedMap.set(store, hydratedSet);
  }
  return hydratedSet;
};



;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/HydrateAtoms/HydrateAtoms.tsx

/**
 * Hydrate atoms with initial values
 * This is only called once on render and populates the atoms with the initial values
 * In order to keep atom updated, set them in a useEffect if needed
 * @param initialValues
 * @param children
 * @return {any}
 * @constructor
 */
var HydrateAtoms = function HydrateAtoms(_ref) {
  var initialValues = _ref.initialValues,
    children = _ref.children;
  utils_useHydrateAtoms(initialValues);
  return children;
};
/* harmony default export */ var HydrateAtoms_HydrateAtoms = (HydrateAtoms);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PlayerContainer/withJotaiProvider.tsx






/**
 * Wrap the component with Provider and HydrateAtoms in order to enable atoms
 * HydrateAtoms is used to hydrate atoms with initial values
 */
/* harmony default export */ var withJotaiProvider = (function (Component) {
  return function (props) {
    return /*#__PURE__*/react.createElement(Provider, null, /*#__PURE__*/react.createElement(HydrateAtoms_HydrateAtoms, {
      initialValues: [[signatureAtom, props.signature], [featuresAtom, props.features], [propertiesAtom, props.properties], [rootPrimitivesAtom, {
        downloadMode: !!props.downloadMode,
        exportName: props.exportName
      }]]
    }, /*#__PURE__*/react.createElement(Component, props)));
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/links.ts
var FlipsnackPrivacyPolicy = 'https://www.flipsnack.com/legal-information/privacy-policy.html';
var PrivateFlipbooks = '/private';
var InteractivePdf = '/interactive-pdf';
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/PlayerRefContext.ts

var PlayerRefContextDefault = {
  playerRef: null,
  setPlayerRef: function setPlayerRef() {}
};
var PlayerRefContext = /*#__PURE__*/react.createContext(PlayerRefContextDefault);
var PlayerRefProvider = PlayerRefContext.Provider;
/* harmony default export */ var contexts_PlayerRefContext = (PlayerRefContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/PlayerRefProvider/PlayerRefProvider.tsx


var PlayerRefProviderContainer = function PlayerRefProviderContainer(props) {
  return /*#__PURE__*/react.createElement(PlayerRefProvider, {
    value: {
      playerRef: props.playerRef,
      setPlayerRef: props.setPlayerRef
    }
  }, props.children);
};
/* harmony default export */ var PlayerRefProvider_PlayerRefProvider = (PlayerRefProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/PlayerRefProvider/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/correctHextColor.ts
/**
 * Format a HEX color to be valid. For example:
 * #A -> #A00000
 * #AB -> #AB0000
 * #ABC -> #ABC
 * #ABCD -> #ABCD00
 * #ABCDE -> #ABCDE0
 * #ABCDEF -> #ABCDEF
 * @param {string} color - the original color
 * @returns {string} the formatted color
 */
/* harmony default export */ var correctHextColor = (function (color) {
  if (color) {
    if (color.length < 4) {
      return color.padEnd(4, '0');
    }
    if (color.length === 4) {
      return color;
    }
    if (color.length < 7) {
      return color.padEnd(7, '0');
    }
    return color;
  }
  return undefined;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/setAlphaToHex.ts
/**
 * Ads an alfa value to a hex color format
 *  #RRGGBBAA color format avoids ExportPage bugs
 * @param {string} hexString
 * @param {number} alpha
 * @returns {`${string}${string}`}
 */
var setAlphaToHex = function setAlphaToHex(hexString) {
  var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  var alphaPercentage = alpha * 100;
  var AA = Math.floor(alphaPercentage * 255 / 100).toString(16).toUpperCase().padStart(2, '0');
  return "".concat(hexString).concat(AA);
};
/* harmony default export */ var utils_setAlphaToHex = (setAlphaToHex);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/theme/defaultPlayer.ts


var _DefaultColors;
function defaultPlayer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function defaultPlayer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? defaultPlayer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : defaultPlayer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





var getLuminanceByColor = function getLuminanceByColor(backgroundColor) {
  var r;
  var g;
  var b;
  if (backgroundColor.startsWith('#')) {
    r = parseInt(backgroundColor.slice(1, 3), 16);
    g = parseInt(backgroundColor.slice(3, 5), 16);
    b = parseInt(backgroundColor.slice(5, 7), 16);
  } else if (backgroundColor.startsWith('rgb')) {
    var rgbValues = backgroundColor.match(/\d+/g);
    if (!rgbValues) throw new Error('Invalid RGB color format');
    var _rgbValues$map = rgbValues.map(Number);
    var _rgbValues$map2 = slicedToArray_slicedToArray(_rgbValues$map, 3);
    r = _rgbValues$map2[0];
    g = _rgbValues$map2[1];
    b = _rgbValues$map2[2];
  } else {
    throw new Error('Unsupported color format');
  }
  var getLuminance = function getLuminance(channel) {
    var colorValue = channel / 255;
    return colorValue <= 0.03928 ? colorValue / 12.92 : Math.pow((colorValue + 0.055) / 1.055, 2.4);
  };
  return 0.2126 * getLuminance(r) + 0.7152 * getLuminance(g) + 0.0722 * getLuminance(b);
};
var defaultPlayer_DefaultColors = (_DefaultColors = {}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_DefaultColors, ColorsWithOpacity.PRIMARY, '#0362FC'), ColorsWithOpacity.BLACK, '#000000'), ColorsWithOpacity.GREY, '#333333'), ColorsWithOpacity.WHITE, '#FFFFFF'), ColorsWithOpacity.DANGER, '#DB2B39'), ColorsWithOpacity.DANGER_TEXT, '#5B0B12'), ColorsWithOpacity.DISABLED, '#828282'), ColorsWithOpacity.SUCCESS, '#31c940'), ColorsWithOpacity.SUCCESS_TEXT, '#005208'), ColorsWithOpacity.WARNING, '#FFC600'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_DefaultColors, "transparent", 'transparent'), "withOpacity", function withOpacity(color) {
  var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  return utils_setAlphaToHex(this[color], alpha);
}), "getTextColor", function getTextColor(backgroundColor) {
  return getLuminanceByColor(backgroundColor) > 0.62 ? ColorsWithOpacity.BLACK : ColorsWithOpacity.WHITE;
}), "getButtonColor", function getButtonColor(backgroundColor) {
  return getLuminanceByColor(backgroundColor) > 0.9 ? '#F5F5F5' : backgroundColor;
}), "getTextButtonColor", function getTextButtonColor(backgroundColor) {
  return getLuminanceByColor(backgroundColor) > 0.62 ? ColorsWithOpacity.BLACK : backgroundColor;
}), "getLinkColor", function getLinkColor(backgroundColor) {
  var luminance = getLuminanceByColor(backgroundColor);

  // If color is near white or near black, use the default link color of the browser
  return luminance > 0.62 || luminance < 0.04 ? 'revert' : backgroundColor;
}));
var defaultPlayer_lighterColor = function lighterColor(color) {
  var lightPercentage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 90;
  return "color-mix(in srgb, ".concat(color, ", ").concat(colors.WHITE, " ").concat(lightPercentage, "%)");
};
function CreateReaderStyles(colors) {
  return {
    border: {
      style: 'solid',
      width: 0,
      color: colors.transparent
    },
    typography: {
      weight: {
        thin: 100,
        extraLight: 200,
        light: 300,
        regular: 400,
        medium: 500,
        semiBold: 600,
        bold: 700,
        extraBold: 800,
        black: 900
      },
      family: {
        sans: 'Roboto,Helvetica,Arial,sans-serif'
      },
      size: {
        largeButton: 17,
        button: 14,
        smallButton: 12,
        h1: 32,
        h2: 24,
        h3: 18,
        h4: 16,
        h5: 14,
        paragraph: 16,
        smallerParagraph: 14,
        inputLabel: 14
      },
      lineHeight: {
        h1: 37,
        h2: 28,
        h3: 21,
        h4: 19,
        h5: 16,
        paragraph: 24,
        smallerParagraph: 20,
        tooltip: 14,
        inputLabel: 16
      },
      style: {
        normal: 'normal',
        italic: 'italic'
      }
    },
    button: {
      default: {
        background: colors.transparent,
        padding: 8,
        border: 'none',
        borderRadius: 8,
        activeBackgroundColor: colors.primary,
        activeFocusBackgroundColor: utils_setAlphaToHex(colors.primary, 0.4),
        focusBackgroundColor: utils_setAlphaToHex(colors.white, 0.4),
        hoverBackgroundColor: utils_setAlphaToHex(colors.white, 0.2),
        hoverActiveBackgroundColor: utils_setAlphaToHex(colors.primary, 0.8),
        disabledOpacity: 0.4
      },
      primary: {},
      secondary: {}
    }
  };
}
function CreateComponentsStyles(colors, readerStyle) {
  return {
    defaults: {
      borderRadius: 4
    },
    deviceSize: defaultPlayer_objectSpread({}, DeviceSize),
    typography: defaultPlayer_objectSpread({}, readerStyle.typography),
    button: {
      default: defaultPlayer_objectSpread(defaultPlayer_objectSpread({}, readerStyle.button.default), {}, {
        border: "".concat(readerStyle.border.width, "px\n                ").concat(readerStyle.border.style, "\n                ").concat(readerStyle.border.color),
        fontFamily: readerStyle.typography.family.sans,
        fontSize: readerStyle.typography.size.button,
        fontWeight: readerStyle.typography.weight.extraBold,
        color: defaultPlayer_DefaultColors.white,
        cursor: 'pointer',
        width: 'auto',
        height: 36
      }),
      icon: defaultPlayer_objectSpread(defaultPlayer_objectSpread({}, readerStyle.button.default), {}, {
        border: "".concat(readerStyle.border.width, "px\n                ").concat(readerStyle.border.style, "\n                ").concat(readerStyle.border.color),
        size: {
          small: {
            width: 24,
            height: 24
          },
          medium: {
            width: 36,
            height: 36
          },
          large: {
            width: 52,
            height: 52
          }
        },
        contained: {
          border: "1px solid ".concat(utils_setAlphaToHex(defaultPlayer_DefaultColors.black, 0.2)),
          backgroundColor: defaultPlayer_DefaultColors.white,
          focusBackgroundColor: defaultPlayer_lighterColor(colors.primary),
          hoverBackgroundColor: defaultPlayer_lighterColor(colors.primary, 85)
        }
      }),
      close: {
        width: 32,
        height: 32,
        spacing: 8
      }
    },
    controllerBar: {
      top: {
        height: 64
      },
      height: 52,
      shadowHeight: 130,
      backgroundColor: colors.black,
      color: colors.white,
      container: {
        height: 40,
        marginTop: 0,
        marginBottom: 0,
        marginRight: 8,
        marginLeft: 8,
        paddingTop: 0,
        paddingBottom: 0,
        paddingRight: 16,
        paddingLeft: 16
      },
      iconsContainer: {
        zIndex: 1,
        width: 52,
        height: 52,
        hover: {
          cursor: 'pointer'
        }
      },
      modernSkinWrapper: {
        justifyContent: 'space-between'
      }
    },
    slider: {
      trackColor: utils_setAlphaToHex(colors.white, 0.2),
      trackBorderRadius: 8,
      trackHeight: 8,
      trackProgressHeight: 8,
      trackProgressColor: colors.primary,
      trackProgressBorderRadius: 8,
      thumbWidth: 16,
      thumbHeight: 16,
      thumbBorderRadius: 16,
      thumbColor: colors.white,
      classicTrackHeight: 4,
      classicTrackColor: utils_setAlphaToHex(colors.white, 0.4),
      snapRatio: 0.25 // Must be between 0 and 1
    },
    pageNumber: {
      minWidth: 110
    },
    icons: {
      size: {
        small: {
          width: 20,
          height: 20
        },
        medium: {
          width: 24,
          height: 24
        },
        large: {
          width: 28,
          height: 28
        }
      }
    },
    modal: {
      padding: 24,
      marginTop: 64,
      marginRight: 24,
      marginBottom: 24,
      marginLeft: 24,
      mobilePadding: 16,
      radius: 16,
      backgroundColor: utils_setAlphaToHex(colors.black, 0.8),
      blackBackground: colors.black,
      backdropFilter: 20,
      minWidth: 320,
      submitButton: {
        disabledBackgroundColor: 'rgba(0, 0, 0, 0.12)',
        minWidth: 72,
        disabledTextColor: utils_setAlphaToHex(colors.black, 0.3)
      },
      shoppingList: {
        minWidthButton: 50
      }
    },
    popoverSizes: {
      default: {
        width: 320,
        height: 186
      },
      widthText: {
        width: 320,
        height: 230
      }
    },
    tooltip: {
      maxWidth: 220,
      fontFamily: readerStyle.typography.family.sans,
      backgroundColor: colors.white,
      color: colors.black,
      paddingTop: 4,
      paddingRight: 8,
      paddingBottom: 4,
      paddingLeft: 8,
      fontSize: 12,
      lineHeight: "".concat(readerStyle.typography.lineHeight.tooltip, "px"),
      fontWeight: readerStyle.typography.weight.medium,
      fontStyle: readerStyle.typography.style.normal,
      textAlign: 'center',
      borderRadius: 4,
      borderWidth: 0,
      borderStyle: 'solid',
      borderColor: utils_setAlphaToHex(colors.black, 0.3),
      textOverflow: 'ellipsis',
      whiteSpace: 'nowrap',
      overflow: 'hidden',
      pointerEvents: 'none',
      boxShadow: '0 0 4px rgba(0, 0, 0, .25)'
    },
    navigationButton: {
      color: colors.white,
      borderColor: colors.black,
      border: 0,
      background: colors.transparent,
      margin: 0,
      zIndex: 1,
      width: 68,
      height: 68
    },
    zoomSlider: {
      width: 80
    },
    popover: {
      radius: 15,
      padding: 15,
      backgroundColor: colors.white,
      boxShadow: '0 0 8px 1px rgba(0,0,0,.1), 0 0 2px 1px rgba(0,0,0,.1)'
    },
    panel: {
      background: utils_setAlphaToHex(colors.black, 0.8),
      backdropFilter: 20,
      color: colors.white,
      borderRadius: 16,
      padding: 8
    },
    colors: defaultPlayer_objectSpread({}, colors),
    accessibility: {
      button: {
        backgroundColor: colors.black
      },
      panel: {
        backgroundColor: colors.black,
        color: colors.white,
        buttonLabel: {
          backgroundColor: colors.white
        }
      }
    },
    toc: {
      panel: {
        width: '400px',
        backgroundColor: '#404243'
      }
    },
    leadForm: {
      popoverSizes: {
        width: 520,
        height: 143
      },
      paddingX: 10,
      paddingY: 14
    },
    input: {
      height: 40,
      paddingX: 10,
      paddingY: 14,
      background: colors.white,
      border: "1px ".concat(readerStyle.border.style, " ").concat(utils_setAlphaToHex(colors.black, 0.2)),
      borderRadius: 4,
      color: colors.black,
      focusBorderColor: defaultPlayer_DefaultColors.primary
    },
    passwordModal: {
      width: 552,
      height: 220
    },
    pageOverview: {
      width: 98,
      height: 200,
      margin: 2,
      gridGap: 16,
      outlineWidth: 4,
      horizontalOutline: 8,
      scrollbarWidth: 13
    },
    cart: {
      quantityInput: {
        fontSize: 14
      },
      websiteButton: {
        height: 32,
        padding: '8px 16px'
      },
      downloadAsButton: {
        padding: '4px 10px 4px 1px'
      },
      whatsAppOrderButton: {
        padding: '4px 10px 4px 1px',
        width: '100%'
      },
      button: {
        disabledBackgroundColor: 'rgba(255, 255, 255, 0.12)',
        disabledTextColor: 'rgba(255, 255, 255, 0.38)'
      },
      borderRadius: 8,
      dropdown: {
        backgroundColor: '#272727'
      }
    },
    spacing: {
      small: {
        top: 8,
        right: 8,
        bottom: 8,
        left: 8
      },
      large: {
        top: 68,
        right: 68,
        bottom: 68,
        left: 68
      }
    },
    link: {
      hoverOpacity: 0.8
    },
    chip: {
      padding: '4px 12px',
      backgroundColor: 'rgba(0, 0, 0, 0.08)',
      borderRadius: '30px'
    }
  };
}
var customizableTheme = function customizableTheme() {
  var customColors = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultPlayer_DefaultColors;
  var customPlayerColors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var colors = {};
  if (customColors !== null && customColors !== void 0 && customColors.primary && customPlayerColors) {
    colors.primary = correctHextColor(customColors.primary);
  }
  var colorPaletteWithAccentColor = defaultPlayer_objectSpread(defaultPlayer_objectSpread({}, defaultPlayer_DefaultColors), colors);
  var readerStylesWithAccentColor = CreateReaderStyles(colorPaletteWithAccentColor);
  var componentsStylesWithAccentColor = CreateComponentsStyles(colorPaletteWithAccentColor, readerStylesWithAccentColor);
  return defaultPlayer_objectSpread(defaultPlayer_objectSpread({}, componentsStylesWithAccentColor), {}, {
    defaultColors: defaultPlayer_DefaultColors
  });
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/ZoomContext.ts


var ZoomContextDefault = {
  zoom: ZOOM_MIN_VALUE,
  previousZoom: ZOOM_MIN_VALUE,
  setZoom: function setZoom() {}
};
var ZoomContext = /*#__PURE__*/react.createContext(ZoomContextDefault);
var ZoomProvider = ZoomContext.Provider;
/* harmony default export */ var contexts_ZoomContext = (ZoomContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/elements.ts

var _elementsWithoutToolt, _ElementDefaults, _ElementActionToFeatu;
var LinkType = {
  OUTLINE: 0,
  CART: 1,
  CREDIT_CARD: 2,
  CART_WITH_LABEL: 4,
  CREDIT_CARD_WITH_LABEL: 5,
  FACEBOOK: 7,
  TWITTER: 8,
  LINKEDIN: 9,
  YOUTUBE: 10,
  FLICKR: 11,
  GOOGLE: 12,
  PINTEREST: 13,
  SOUNDCLOUD: 14,
  VIMEO: 15,
  PREVIOUS_PAGE: 18,
  NEXT_PAGE: 19,
  FIRST_PAGE: 20,
  LAST_PAGE: 21,
  PAGE: 22,
  LINK_ELEMENT: 26,
  EMAIL: 27,
  TEXT: 28,
  CAPTION: 29,
  VIDEO: 30,
  AUDIO: 31,
  PAYPAL: 33,
  PAYPAL_WITH_TOOLTIP: 34,
  BLOCK_FORM: 35,
  IMAGE: 37,
  PHONE_NUMBER: 40,
  VIDEO_WIDGET: 46,
  TAG: 48,
  INSTAGRAM: 49,
  SHAPE_ELEMENT: 50,
  IMAGE_MASK: 51,
  FORM: 52,
  TEXT_BOX: 53,
  PRODUCT_TAG: 54,
  BEHANCE: 55,
  SPOTIFY: 56,
  CART_ITEM_WITH_LABEL: 57,
  CREDIT_CARD_ITEM_WITH_LABEL: 58,
  MESSENGER: 59,
  SNAPCHAT: 60,
  REDDIT: 61,
  TIKTOK: 62,
  TABLE: 63,
  CONVERT_TEXT: 66,
  SLIDESHOW: 67,
  CHARTS_LINE: 68,
  CHARTS_BAR: 69,
  CHARTS_PIE: 70,
  CART_BUTTON: 71,
  CART_HYPERLINK: 72,
  POLL: 74,
  QUIZ: 75,
  QUESTION: 76,
  CONTACT_FORM: 77,
  WHATSAPP: 78,
  GROUP: 100,
  EMBED: 101
  // DO NOT CONTINUE FROM 101!
};
var RoundedInteractiveElements = [LinkType.TAG, LinkType.PRODUCT_TAG];
var InteractiveLinkElements = [LinkType.PREVIOUS_PAGE, LinkType.NEXT_PAGE, LinkType.FIRST_PAGE, LinkType.LAST_PAGE, LinkType.PAGE, LinkType.LINK_ELEMENT, LinkType.CART_HYPERLINK, LinkType.CHARTS_LINE, LinkType.CHARTS_BAR, LinkType.CHARTS_PIE, LinkType.OUTLINE, LinkType.QUESTION, LinkType.CONTACT_FORM, LinkType.QUIZ];
var InteractiveButtonElements = [LinkType.CAPTION, LinkType.FLICKR, LinkType.GOOGLE, LinkType.FACEBOOK, LinkType.TWITTER, LinkType.CART_WITH_LABEL, LinkType.CREDIT_CARD_WITH_LABEL, LinkType.PINTEREST, LinkType.SOUNDCLOUD, LinkType.CREDIT_CARD, LinkType.CART_BUTTON, LinkType.SPOTIFY, LinkType.BEHANCE, LinkType.PHONE_NUMBER, LinkType.PAYPAL_WITH_TOOLTIP, LinkType.PAYPAL, LinkType.PHONE_NUMBER, LinkType.TIKTOK, LinkType.CART, LinkType.REDDIT, LinkType.SNAPCHAT, LinkType.MESSENGER, LinkType.CREDIT_CARD_ITEM_WITH_LABEL, LinkType.CART_ITEM_WITH_LABEL, LinkType.LINKEDIN, LinkType.INSTAGRAM, LinkType.YOUTUBE, LinkType.AUDIO, LinkType.VIDEO, LinkType.WHATSAPP];
var ActionType = {
  GO_TO_URL: 0,
  GO_TO_PREV_PAGE: 1,
  GO_TO_NEXT_PAGE: 2,
  GO_TO_FIRST_PAGE: 3,
  GO_TO_LAST_PAGE: 4,
  GO_TO_PAGE: 5,
  DOWNLOAD_PDF: 6,
  GO_TO_FLIPSNACK_PROFILE: 7,
  SEND_EMAIL: 8,
  TEXT: 9,
  VIDEO: 10,
  AUDIO: 11,
  CAPTION: 12,
  IMAGE: 16,
  OUTLINE: 21,
  VIDEO_WIDGET: 23,
  TAG: 24,
  SHAPE_ELEMENT: 25,
  IMAGE_MASK: 26,
  FORM: 27,
  TEXT_BOX: 28,
  // new text element
  PRODUCT_TAG: 29,
  SPOTLIGHT: 30,
  // Hyperlink action
  POPUP_FRAME: 31,
  CHARTS_LINE: 32,
  CHARTS_BAR: 33,
  CHARTS_PIE: 34,
  CART_BUTTON: 35,
  CART_HYPERLINK: 36,
  PHOTO_SLIDESHOW: 37,
  // Hyperlink action - slideshow in spotlight,
  POLL: 38,
  QUIZ: 39,
  PHONE_NUMBER: 40,
  QUESTION: 41,
  CONTACT_FORM: 42,
  OPEN_OVERLAY: 45,
  EMBED: 101,
  TABLE: 102,
  SLIDESHOW: 103
};
var elementsWithoutTooltip = (_elementsWithoutToolt = {}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_elementsWithoutToolt, ActionType.GO_TO_URL, [LinkType.CART_WITH_LABEL, LinkType.CREDIT_CARD_WITH_LABEL, LinkType.CART_ITEM_WITH_LABEL, LinkType.CREDIT_CARD_ITEM_WITH_LABEL, LinkType.OUTLINE]), ActionType.GO_TO_NEXT_PAGE, [LinkType.OUTLINE]), ActionType.GO_TO_PREV_PAGE, [LinkType.OUTLINE]), ActionType.GO_TO_FIRST_PAGE, [LinkType.OUTLINE]), ActionType.GO_TO_LAST_PAGE, [LinkType.OUTLINE]), ActionType.GO_TO_PAGE, [LinkType.OUTLINE]), ActionType.DOWNLOAD_PDF, [LinkType.OUTLINE]), ActionType.SEND_EMAIL, [LinkType.OUTLINE]), ActionType.PHONE_NUMBER, [LinkType.OUTLINE]), ActionType.TABLE, [LinkType.TABLE]), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_elementsWithoutToolt, ActionType.EMBED, [LinkType.EMBED]), ActionType.FORM, [LinkType.FORM]), ActionType.PRODUCT_TAG, [LinkType.PRODUCT_TAG]), ActionType.TAG, [LinkType.TAG]), ActionType.CAPTION, [LinkType.CAPTION]), ActionType.VIDEO_WIDGET, [LinkType.VIDEO_WIDGET, LinkType.VIMEO, LinkType.YOUTUBE]));
var ElementDefaults = (_ElementDefaults = {}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_ElementDefaults, LinkType.OUTLINE, {
  component: 'IconElement',
  category: 'LINK'
}), LinkType.LINK_ELEMENT, {
  component: 'IconElement',
  category: 'LINK',
  icon: 'LinkIcon'
}), LinkType.PREVIOUS_PAGE, {
  component: 'IconElement',
  category: 'LINK',
  icon: 'PrevPageIcon'
}), LinkType.NEXT_PAGE, {
  component: 'IconElement',
  category: 'LINK',
  icon: 'NextPageIcon'
}), LinkType.FIRST_PAGE, {
  component: 'IconElement',
  category: 'LINK',
  icon: 'FirstPageIcon'
}), LinkType.LAST_PAGE, {
  component: 'IconElement',
  category: 'LINK',
  icon: 'LastPageIcon'
}), LinkType.PAGE, {
  component: 'IconElement',
  category: 'LINK',
  icon: 'GoToPageIcon'
}), LinkType.TEXT_BOX, {
  component: 'TextBoxElement',
  category: 'TEXT_BOX'
}), LinkType.CONVERT_TEXT, {
  component: 'TextBoxElement',
  category: 'TEXT_BOX'
}), LinkType.IMAGE, {
  component: 'ImageElement',
  category: 'IMAGE'
}), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_ElementDefaults, LinkType.VIDEO, {
  component: 'VideoElement',
  category: 'VIDEO',
  icon: 'VideoIcon'
}), LinkType.VIDEO_WIDGET, {
  component: 'VideoWidgetElement',
  category: 'VIDEO'
}), LinkType.CAPTION, {
  component: 'IconElement',
  category: 'CAPTION',
  icon: 'PlusIcon'
}), LinkType.SHAPE_ELEMENT, {
  component: 'ShapeElement',
  category: 'SHAPE'
}), LinkType.FACEBOOK, {
  component: 'IconElement',
  category: 'FACEBOOK',
  icon: 'FacebookIcon'
}), LinkType.TWITTER, {
  component: 'IconElement',
  category: 'TWITTER',
  icon: 'TwitterIcon'
}), LinkType.LINKEDIN, {
  component: 'IconElement',
  category: 'LINKEDIN',
  icon: 'LinkedinIcon'
}), LinkType.YOUTUBE, {
  component: 'IconElement',
  category: 'YOUTUBE',
  icon: 'YoutubeIcon'
}), LinkType.FLICKR, {
  component: '',
  category: 'FLICKR'
}), LinkType.GOOGLE, {
  component: '',
  category: 'GOOGLE'
}), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_ElementDefaults, LinkType.BEHANCE, {
  component: 'IconElement',
  category: 'BEHANCE',
  icon: 'BehanceIcon'
}), LinkType.WHATSAPP, {
  component: 'IconElement',
  category: 'WHATSAPP',
  icon: 'WhatsAppIcon'
}), LinkType.SPOTIFY, {
  component: 'IconElement',
  category: 'SPOTIFY',
  icon: 'SpotifyIcon'
}), LinkType.PINTEREST, {
  component: 'IconElement',
  category: 'PINTEREST',
  icon: 'PinterestIcon'
}), LinkType.SOUNDCLOUD, {
  component: '',
  category: 'SOUNDCLOUD'
}), LinkType.VIMEO, {
  component: '',
  category: 'VIMEO'
}), LinkType.INSTAGRAM, {
  component: 'IconElement',
  category: 'INSTAGRAM',
  icon: 'InstagramIcon'
}), LinkType.CART, {
  component: 'IconElement',
  category: 'CART',
  icon: 'CartIcon'
}), LinkType.CREDIT_CARD, {
  component: 'IconElement',
  category: 'CREDIT_CARD',
  icon: 'CreditCardIcon'
}), LinkType.IMAGE_MASK, {
  component: 'ImageMaskElement',
  exportComponent: 'ImageMaskExportElement',
  category: 'MASK'
}), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_ElementDefaults, LinkType.CART_WITH_LABEL, {
  component: 'IconElementWithLabel',
  category: 'CART_WITH_LABEL',
  icon: 'CartIcon'
}), LinkType.CREDIT_CARD_WITH_LABEL, {
  component: 'IconElementWithLabel',
  category: 'CREDIT_CARD_WITH_LABEL',
  icon: 'CreditCardIcon'
}), LinkType.AUDIO, {
  component: 'IconElement',
  category: 'AUDIO',
  icon: 'NoAudioIcon'
}), LinkType.TAG, {
  component: 'TagElement',
  category: 'TAG',
  icon: 'TagViewIcon'
}), LinkType.BLOCK_FORM, {
  component: '',
  category: 'FORM'
}), LinkType.EMBED, {
  component: 'EmbedElement',
  category: 'EMBED'
}), LinkType.PRODUCT_TAG, {
  component: 'TagElement',
  category: 'TAG',
  icon: 'ProductTagViewIcon'
}), LinkType.CART_ITEM_WITH_LABEL, {
  component: 'IconElementWithLabel',
  category: 'CART_ITEM_WITH_LABEL',
  icon: 'CartIcon'
}), LinkType.CREDIT_CARD_ITEM_WITH_LABEL, {
  component: 'IconElementWithLabel',
  category: 'CREDIT_CARD_ITEM_WITH_LABEL',
  icon: 'CreditCardIcon'
}), LinkType.MESSENGER, {
  component: 'IconElement',
  category: 'MESSENGER',
  icon: 'MessengerIcon'
}), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_ElementDefaults, LinkType.SNAPCHAT, {
  component: 'IconElement',
  category: 'SNAPCHAT',
  icon: 'SnapchatIcon'
}), LinkType.TIKTOK, {
  component: 'IconElement',
  category: 'TIKTOK',
  icon: 'TiktokIcon'
}), LinkType.REDDIT, {
  component: 'IconElement',
  category: 'REDDIT',
  icon: 'RedditIcon'
}), LinkType.TABLE, {
  component: 'TableElement',
  category: 'TABLE'
}), LinkType.SLIDESHOW, {
  component: 'SlideshowElement',
  category: 'SLIDESHOW'
}), LinkType.PHOTO_SLIDESHOW, {
  component: 'SlideshowElement',
  category: 'SLIDESHOW'
}), LinkType.CHARTS_LINE, {
  component: 'ChartElement',
  category: 'CHART'
}), LinkType.CHARTS_BAR, {
  component: 'ChartElement',
  category: 'CHART'
}), LinkType.CHARTS_PIE, {
  component: 'ChartElement',
  category: 'CHART'
}), LinkType.CART_BUTTON, {
  component: 'CartElement',
  category: 'CART',
  icon: 'CartIcon'
}), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_ElementDefaults, LinkType.CART_HYPERLINK, {
  component: 'CartElement',
  category: 'CART',
  icon: 'CartIcon'
}), LinkType.POLL, {
  component: 'PollElement',
  category: 'POLL'
}), LinkType.QUIZ, {
  component: 'QuizElement',
  category: 'Quiz'
}), LinkType.QUESTION, {
  component: 'QuestionElement',
  category: 'Question'
}), LinkType.CONTACT_FORM, {
  component: 'ContactFormElement',
  category: 'ContactForm'
}));
var AudioIcon = {
  PLAY: 'AudioIcon',
  PAUSE: 'NoAudioIcon'
};
var CaptionIcon = {
  OPENED: 'MinusIcon',
  CLOSED: 'PlusIcon'
};
var CaptionShape = {
  ROUNDED: 'rounded'
};

// Elements features
var FEATURES = {
  WIDGET_MEDIA: 'WIDGET_MEDIA',
  DOWNLOAD_PDF: 'DOWNLOAD_PDF',
  WIDGET_FORMS: 'WIDGET_FORMS',
  WIDGET_TAGS: 'WIDGET_TAGS',
  EMBED: 'EMBED',
  PRODUCT_TAG: 'PRODUCT_TAG',
  CHARTS: 'CHARTS',
  POPUP_FRAME: 'POPUP_FRAME',
  SLIDESHOW: 'SLIDESHOW',
  ADD_TO_CART: 'ADD_TO_CART',
  POLL: 'POLL',
  QUIZ: 'QUIZ',
  CONTACT_FORM: 'CONTACT_FORM',
  SPOTLIGHT: 'SPOTLIGHT',
  PHOTO_SLIDESHOW: 'PHOTO_SLIDESHOW',
  // for Photo Slideshow Hyperlink
  QUESTION: 'QUESTION'
};

// We have to know which feature is assigned to which action, to check if users have access to element
var ElementActionToFeature = (_ElementActionToFeatu = {}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_ElementActionToFeatu, ActionType.DOWNLOAD_PDF, FEATURES.DOWNLOAD_PDF), ActionType.VIDEO, FEATURES.WIDGET_MEDIA), ActionType.AUDIO, FEATURES.WIDGET_MEDIA), ActionType.VIDEO_WIDGET, FEATURES.WIDGET_MEDIA), ActionType.TAG, FEATURES.WIDGET_TAGS), ActionType.CAPTION, FEATURES.WIDGET_TAGS), ActionType.PRODUCT_TAG, FEATURES.PRODUCT_TAG), ActionType.EMBED, FEATURES.EMBED), ActionType.POPUP_FRAME, FEATURES.POPUP_FRAME), ActionType.CHARTS_LINE, FEATURES.CHARTS), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_ElementActionToFeatu, ActionType.CHARTS_BAR, FEATURES.CHARTS), ActionType.CHARTS_PIE, FEATURES.CHARTS), ActionType.SLIDESHOW, FEATURES.SLIDESHOW), ActionType.CART_BUTTON, FEATURES.ADD_TO_CART), ActionType.CART_HYPERLINK, FEATURES.ADD_TO_CART), ActionType.POLL, FEATURES.POLL), ActionType.QUIZ, FEATURES.QUIZ), ActionType.CONTACT_FORM, FEATURES.CONTACT_FORM), ActionType.SPOTLIGHT, FEATURES.SPOTLIGHT), ActionType.PHOTO_SLIDESHOW, FEATURES.PHOTO_SLIDESHOW), defineProperty_defineProperty(_ElementActionToFeatu, ActionType.QUESTION, FEATURES.QUESTION));
var elements_FontSource = /*#__PURE__*/function (FontSource) {
  FontSource["USER"] = "user";
  FontSource["ADMIN"] = "admin";
  return FontSource;
}({});
var FontLocation = /*#__PURE__*/function (FontLocation) {
  FontLocation["PUBLIC"] = "public";
  FontLocation["WORKSPACE"] = "workspace";
  return FontLocation;
}({});
var VIDEO_PROVIDERS = ['pexels', 'pixabay'];
var elements_ELEMENT_LINKS_REL_DEFAULT_REL = 'nofollow noopener';
var ELEMENT_MIN_SIZE_VALUE = 1;
var ActionTypeName = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, ActionType.IMAGE, 'Image'), ActionType.TEXT_BOX, 'Text-box'), ActionType.SHAPE_ELEMENT, 'Shape'), ActionType.GO_TO_PREV_PAGE, 'Go to previous page'), ActionType.GO_TO_NEXT_PAGE, 'Go to next page'), ActionType.GO_TO_FIRST_PAGE, 'Go to first page'), ActionType.GO_TO_LAST_PAGE, 'Go to last page'), ActionType.GO_TO_PAGE, 'Go to page '), ActionType.GO_TO_FLIPSNACK_PROFILE, 'Go to my profile');
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/PlayerContext.ts


function PlayerContext_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function PlayerContext_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? PlayerContext_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : PlayerContext_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var PlayerContext_defaultValue = PlayerContext_objectSpread(PlayerContext_objectSpread({}, defaultNewJson), {}, {
  pages: {
    data: PlayerContext_objectSpread({}, defaultNewJson.pages.data),
    order: [toConsumableArray_toConsumableArray(defaultNewJson.pages.order)]
  },
  flipbookConverted: false
});
var PlayerContext = /*#__PURE__*/react.createContext(PlayerContext_defaultValue);
/* harmony default export */ var contexts_PlayerContext = (PlayerContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/ui/zoom.ts



var zoomForComponentsAtom = vanilla_atom(ZOOM_MIN_VALUE);
zoomForComponentsAtom.debugLabel = "zoomForComponentsAtom";
var zoomEnabledAtom = vanilla_atom(true);

/**
 * Sets zoom zoomForComponents
 */
zoomEnabledAtom.debugLabel = "zoomEnabledAtom";
var setZoomForComponentsAtom = vanilla_atom(null, function (get, set, newZoomValue) {
  if (get(zoomForComponentsAtom) !== newZoomValue && get(zoomEnabledAtom) && newZoomValue >= ZOOM_MIN_VALUE && newZoomValue <= ZOOM_MAX_VALUE) {
    set(zoomForComponentsAtom, newZoomValue);
  }
});

/**
 * Toggle zoom double click/tap
 */
setZoomForComponentsAtom.debugLabel = "setZoomForComponentsAtom";
var toggleZoomForGestureEventAtom = vanilla_atom(null, function (get, set) {
  var currentZoom = get(zoomForComponentsAtom);
  if (get(zoomEnabledAtom)) {
    if (currentZoom !== ZOOM_MIN_VALUE) {
      set(zoomForComponentsAtom, ZOOM_MIN_VALUE);
    } else {
      set(zoomForComponentsAtom, DoubleClickZoomValue);
    }
  }
});
toggleZoomForGestureEventAtom.debugLabel = "toggleZoomForGestureEventAtom";
var setZoomEnabledAtom = vanilla_atom(null, function (get, set, enabled) {
  if (get(zoomEnabledAtom) !== enabled) {
    set(zoomEnabledAtom, enabled);
  }
});
setZoomEnabledAtom.debugLabel = "setZoomEnabledAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/mandatoryActions/mandatoryActions.ts



var mandatoryActionsAtom = vanilla_atom({});
mandatoryActionsAtom.debugLabel = "mandatoryActionsAtom";
var setMandatoryActionsAtom = vanilla_atom(null, function (get, set, value) {
  var oldArrayOfMandatoryData = Object.entries(get(mandatoryActionsAtom)).flat(2);
  var newArrayOfMandatoryData = Object.entries(value).flat(2);

  // For optimization, we set the mandatory data only if it changed. In rtl, the order of the pages is reversed
  // so we have to iterate through mandatory data.
  if (oldArrayOfMandatoryData.length !== newArrayOfMandatoryData.length || newArrayOfMandatoryData.some(function (data) {
    return !oldArrayOfMandatoryData.includes(data);
  })) {
    set(mandatoryActionsAtom, value);
  }
});
setMandatoryActionsAtom.debugLabel = "setMandatoryActionsAtom";
var isActiveMandatoryModalAtom = vanilla_atom(false);
isActiveMandatoryModalAtom.debugLabel = "isActiveMandatoryModalAtom";
var setActiveMandatoryModalAtom = vanilla_atom(null, function (get, set, value) {
  if (get(isActiveMandatoryModalAtom) !== value) {
    // Reset the zoom in order to see all mandatory elements on the active stage
    set(setZoomForComponentsAtom, ZOOM_MIN_VALUE);
    set(isActiveMandatoryModalAtom, value);
  }
});
setActiveMandatoryModalAtom.debugLabel = "setActiveMandatoryModalAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/modal/step.ts

var modalStepAtom = vanilla_atom('');
modalStepAtom.debugLabel = "modalStepAtom";
var setModalStepAtom = vanilla_atom(null, function (_get, set, nextModalStep) {
  return set(modalStepAtom, nextModalStep);
});
setModalStepAtom.debugLabel = "setModalStepAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useMandatoryActions.ts









/* harmony default export */ var useMandatoryActions = (function () {
  var _getLocalStorage;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$pages = _useContext.pages,
    data = _useContext$pages.data,
    order = _useContext$pages.order,
    rtl = _useContext.options.content.rtl;
  var _useAtom = react_useAtom(featuresAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    features = _useAtom2[0];
  var _staticStore$config$g = getConfig(),
    trackingData = _staticStore$config$g.trackingData;
  var modalStep = react_useAtomValue(modalStepAtom);
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    hash = _useAtom4[0].hash;
  var setMandatoryActions = react_useSetAtom(setMandatoryActionsAtom);
  var trackingDataString = trackingData ? "_".concat(trackingData) : '';
  var quizKeyName = "interactivity_quiz_".concat(hash).concat(trackingDataString);
  var quizDataLocalStorage = (_getLocalStorage = localStorage_getLocalStorage(quizKeyName)) !== null && _getLocalStorage !== void 0 ? _getLocalStorage : '';

  // The following actions affect the mandatory actions:
  // opening a flipbook in bookshelf (trackingData changes)
  // modal opening/ closing
  // rtl change
  // page layout change
  var mandatoryActionsByStage = (0,react.useMemo)(function () {
    return getMandatoryActionsByStage(data, order, LinkType.QUIZ, quizDataLocalStorage);
  }, [trackingData, order.length, modalStep, rtl]);
  if (features.MANDATORY_ACTIONS && modalStep === '') {
    setMandatoryActions(mandatoryActionsByStage);
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/disableRightClick.ts
/**
 * Disallow user right click
 */
/* harmony default export */ var disableRightClick = (function (e) {
  e.preventDefault();
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/ui/backgroundAudio.ts


/**
 * Atom which indicates that the background sound is on/off
 */
var backgroundAudioOn = vanilla_atom(false);
backgroundAudioOn.debugLabel = "backgroundAudioOn";
var setBackgroundAudioOn = vanilla_atom(null, function (get, set, isAudioOn) {
  if (get(backgroundAudioOn) !== isAudioOn) {
    set(backgroundAudioOn, isAudioOn);
  }
});
setBackgroundAudioOn.debugLabel = "setBackgroundAudioOn";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/NativeActionsContainer/NativeActionsContainer.tsx











var NativeActionsContainerDiv = styled_components_browser_esm.div.withConfig({
  displayName: "NativeActionsContainer__NativeActionsContainerDiv",
  componentId: "sc-1jf710u-0"
})(["width:100%;height:100%;touch-action:", ";"], function (props) {
  return props.zoom > ZOOM_MIN_VALUE ? 'none' : 'pan-y';
});
var NativeActionsContainer = function NativeActionsContainer(props) {
  var isDoubleTap = (0,react.useRef)(false);
  var _useContext = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext.zoom;
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    autoplay = _useContext2.options.backgroundAudio.autoplay;
  var setBackgroundSoundOn = react_useSetAtom(setBackgroundAudioOn);
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    isFirstInteraction = _useState2[0],
    setIsFirstInteraction = _useState2[1];
  useMandatoryActions();
  (0,react.useEffect)(function () {
    if (props.nativeActionContainerRef.current) {
      // Disable IOS safari native pinch to zoom event
      props.nativeActionContainerRef.current.addEventListener('gesturestart', function (e) {
        e.preventDefault();
      }, {
        passive: true
      });

      // Prevent IOS safari double tap to zoom event
      props.nativeActionContainerRef.current.addEventListener('touchstart', function (e) {
        setIsFirstInteraction(true);
        var isSingleFingerTouch = isTouchEvent(e) && 'touches' in e && e.touches.length === 1;
        if (!isDoubleTap.current) {
          isDoubleTap.current = true;
          setTimeout(function () {
            // Reset double tap
            isDoubleTap.current = false;
          }, 500);
        } else if (isSingleFingerTouch) {
          e.preventDefault();
        }
      }, {
        passive: true
      });
      props.nativeActionContainerRef.current.addEventListener('contextmenu', disableRightClick);
    }
    return function () {
      if (props.nativeActionContainerRef.current) {
        props.nativeActionContainerRef.current.removeEventListener('contextmenu', disableRightClick);
      }
    };
  }, []);
  (0,react.useEffect)(function () {
    if (isFirstInteraction && autoplay) {
      setBackgroundSoundOn(true);
    }
  }, [isFirstInteraction]);
  return /*#__PURE__*/react.createElement(NativeActionsContainerDiv, {
    ref: props.nativeActionContainerRef,
    zoom: zoom
  }, props.children);
};
/* harmony default export */ var NativeActionsContainer_NativeActionsContainer = (NativeActionsContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/NativeActionsContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/activeStage/index.ts

var activeStageAtomDefaults = {
  layout: '',
  activeStageIndex: 0,
  settledActiveStageIndex: 0,
  isUserAction: false
};

// activeStageIndexAtom - index is set to trigger navigation verification
var getActiveStageIndexAtom = vanilla_atom(activeStageAtomDefaults.activeStageIndex);
getActiveStageIndexAtom.debugLabel = "getActiveStageIndexAtom";
var setNextActiveStageIndexAtom = vanilla_atom(null, function (get, set) {
  set(getActiveStageIndexAtom, get(getActiveStageIndexAtom) + 1);
});
setNextActiveStageIndexAtom.debugLabel = "setNextActiveStageIndexAtom";
var setPreviousActiveStageIndexAtom = vanilla_atom(null, function (get, set) {
  set(getActiveStageIndexAtom, get(getActiveStageIndexAtom) - 1);
});
setPreviousActiveStageIndexAtom.debugLabel = "setPreviousActiveStageIndexAtom";
var setFirstActiveStageIndexAtom = vanilla_atom(null, function (get, set) {
  if (get(getActiveStageIndexAtom) !== 0) {
    set(getActiveStageIndexAtom, 0);
  }
});
setFirstActiveStageIndexAtom.debugLabel = "setFirstActiveStageIndexAtom";
var setLastActiveStageIndexAtom = vanilla_atom(null, function (get, set) {
  set(getActiveStageIndexAtom, -1);
});
setLastActiveStageIndexAtom.debugLabel = "setLastActiveStageIndexAtom";
var getLayoutAtom = vanilla_atom(activeStageAtomDefaults.layout);
getLayoutAtom.debugLabel = "getLayoutAtom";
var layoutAtom = vanilla_atom(function (get) {
  return get(getLayoutAtom);
}, function (get, set, newLayout) {
  if (get(getLayoutAtom) !== newLayout) {
    set(getLayoutAtom, newLayout);
  }
});
layoutAtom.debugLabel = "layoutAtom";
var getUserActionAtom = vanilla_atom(activeStageAtomDefaults.isUserAction);

// settledActiveStageIndex - the index is set after all verifications are done
getUserActionAtom.debugLabel = "getUserActionAtom";
var getSettledActiveStageIndexAtom = vanilla_atom(activeStageAtomDefaults.settledActiveStageIndex);
getSettledActiveStageIndexAtom.debugLabel = "getSettledActiveStageIndexAtom";
var activeStageIndexAndUserActionAtom = vanilla_atom(function (get) {
  return {
    settledActiveStageIndex: get(getActiveStageIndexAtom),
    isUserAction: get(getUserActionAtom)
  };
}, function (get, set, payload) {
  var settledStageIndex = payload.settledStageIndex,
    isUserAction = payload.isUserAction;
  if (typeof isUserAction === 'boolean' && get(getUserActionAtom) !== isUserAction) {
    set(getUserActionAtom, isUserAction);
  }
  if (typeof settledStageIndex === 'number' && get(getSettledActiveStageIndexAtom) !== settledStageIndex) {
    set(getSettledActiveStageIndexAtom, settledStageIndex);
  }
});
activeStageIndexAndUserActionAtom.debugLabel = "activeStageIndexAndUserActionAtom";
var generalStageIndexAtom = vanilla_atom(function (get) {
  return {
    activeStageIndex: get(getActiveStageIndexAtom),
    settledActiveStageIndex: get(getActiveStageIndexAtom),
    isUserAction: get(getUserActionAtom),
    layout: get(getLayoutAtom)
  };
}, function (get, set, payload) {
  var activeStageIndex = payload.activeStageIndex,
    isUserAction = payload.isUserAction,
    layout = payload.layout;
  if (typeof activeStageIndex === 'number' && get(getActiveStageIndexAtom) !== activeStageIndex) {
    set(getActiveStageIndexAtom, activeStageIndex);
  }
  if (typeof isUserAction === 'boolean' && get(getUserActionAtom) !== isUserAction) {
    set(getUserActionAtom, isUserAction);
  }
  if (layout && get(getLayoutAtom) !== layout) {
    set(getLayoutAtom, layout);
  }
});
generalStageIndexAtom.debugLabel = "generalStageIndexAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getNextPageIndexes.ts



/**
 * Return the index/indexes of next page/pages
 *
 * @param layout
 * @param activeStageIndex
 * @param nrOfPages
 * @return array<number>
 */
/* harmony default export */ var getNextPageIndexes = (function (layout, activeStageIndex, nrOfPages) {
  var nextActivePageIndexes = activeStageIndex;
  var _activeStageIndex = slicedToArray_slicedToArray(activeStageIndex, 1),
    index = _activeStageIndex[0];

  // If is single page and not the last page
  if (layout === constants_WidgetLayoutTypes.SINGLE && index + activeStageIndex.length < nrOfPages) {
    nextActivePageIndexes = [index + activeStageIndex.length];
    // For double page
  } else if (layout !== constants_WidgetLayoutTypes.SINGLE) {
    // If there are even nr of pages and the next page is the last one we have only one page to display
    if (nrOfPages % 2 === 0 && index + activeStageIndex.length + 1 === nrOfPages) {
      nextActivePageIndexes = [index + activeStageIndex.length];
    } else if (index + 2 < nrOfPages) {
      nextActivePageIndexes = [index + activeStageIndex.length, index + activeStageIndex.length + 1];
    }
  }
  return nextActivePageIndexes;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/generateStagePageIds.ts


var ValidArrayMethods = /*#__PURE__*/function (ValidArrayMethods) {
  ValidArrayMethods["unshift"] = "unshift";
  ValidArrayMethods["push"] = "push";
  return ValidArrayMethods;
}(ValidArrayMethods || {});
/**
 * Generates all stage page ids
 *
 * @param pageOrder
 * @param layout
 * @return array
 */
/* harmony default export */ var generateStagePageIds = (function (pageOrder, layout) {
  var nextStagePageIds = [pageOrder[0]];
  var nextStagePageIndexes = [0];
  var stagePageIds = [nextStagePageIds];
  var pageIds = pageOrder.slice();
  var arrayMethodToCall = layout.isRtl ? ValidArrayMethods.unshift : ValidArrayMethods.push;

  // Remove first pageId, because we already used it
  pageIds.splice(0, 1);
  while (pageIds.length > 0) {
    if (pageIds.length === 1) {
      // If last page
      nextStagePageIndexes = [pageOrder.length - 1];
    } else {
      // Get next stage page ids
      nextStagePageIndexes = getNextPageIndexes(layout.playerLayout, nextStagePageIndexes, pageOrder.length);
    }
    nextStagePageIds = nextStagePageIndexes.map(function (pageIndex) {
      return pageOrder[pageIndex];
    });
    if (layout.isRtl && (layout.widgetLayout === constants_WidgetLayoutTypes.DOUBLE || layout.widgetLayout === constants_WidgetLayoutTypes.SMART)) {
      nextStagePageIds = nextStagePageIds.reverse();
    }

    // Remove used pageIds from list
    pageIds.splice(0, nextStagePageIndexes.length);

    // Add next stage pageIds
    typeof stagePageIds[arrayMethodToCall] === 'function' && stagePageIds[arrayMethodToCall](nextStagePageIds);
  }
  return stagePageIds;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getLayoutType.ts



/**
 * @param {string} widgetLayout
 * @param {string} orientation
 * @return string
 */
/* harmony default export */ var getLayoutType = (function (widgetLayout, orientation) {
  // Keep the current widgetLayout
  if (widgetLayout === constants_WidgetLayoutTypes.SINGLE || widgetLayout === constants_WidgetLayoutTypes.DOUBLE) {
    return widgetLayout;
  }

  // TODO: SmartView - Make it based on orientation only that is based on width/height
  if (main/* isMobile */.Fr && orientation === constants_Orientation.PORTRAIT) {
    return constants_WidgetLayoutTypes.SINGLE;
  }
  return constants_WidgetLayoutTypes.DOUBLE;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/PlayerProvider/PlayerProvider.tsx


function PlayerProvider_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function PlayerProvider_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? PlayerProvider_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : PlayerProvider_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }










var PlayerProvider = function PlayerProvider(props) {
  // The layout atom initial value is an empty string. There is a task in backlog to refactor this behavior.
  var setLayout = react_useSetAtom(layoutAtom);
  var nextLayout = getLayoutType(props.widgetLayout, props.orientation);
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    hash = _useAtom2$.hash,
    accountId = _useAtom2$.link.accountId;
  var playerToken = getPlayerToken(accountId, hash);
  var _useAtom3 = react_useAtom(deleteAllItemsFromCartAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 2),
    deleteAllItemsFromCart = _useAtom4[1];
  var leadFormData = props.leadForm;
  setLayout(nextLayout);

  // We need to clear the cart whenever we're replacing a product feed using Product Detection from Customize
  (0,react.useEffect)(function () {
    deleteAllItemsFromCart(playerToken);
  }, [props.playerDataHashCode]);
  var playerProviderValue = (0,react.useMemo)(function () {
    var order = generateStagePageIds(props.order, {
      playerLayout: nextLayout,
      widgetLayout: props.widgetLayout,
      isRtl: props.options.content.rtl
    });

    // Add data necessary for leadForm validation
    // Add validation field to each lead form field
    // Default valid = true if the field is not required
    // Add userInput field which contains the text entered by the user
    if (leadFormData) {
      var _leadFormData;
      leadFormData = PlayerProvider_objectSpread(PlayerProvider_objectSpread({}, defaultLeadForm), leadFormData);
      (_leadFormData = leadFormData) === null || _leadFormData === void 0 || (_leadFormData = _leadFormData.fields) === null || _leadFormData === void 0 || _leadFormData.forEach(function (field, index) {
        var _leadFormData2;
        if ((_leadFormData2 = leadFormData) !== null && _leadFormData2 !== void 0 && _leadFormData2.fields) {
          leadFormData.fields[index].valid = !field.required;
          leadFormData.fields[index].userInput = '';
        }
      });
    }
    return {
      pages: PlayerProvider_objectSpread(PlayerProvider_objectSpread({}, props.pages), {}, {
        order: order
      }),
      options: props.options,
      toc: props.toc,
      leadForm: props.leadForm,
      flipbookConverted: props.flipbookConverted,
      leadFormData: leadFormData,
      downloadMode: props.downloadMode,
      exportName: props.exportName,
      cart: props.cart || {}
    };
  }, [nextLayout, props.playerDataHashCode, props.options.content.isMobilePreview]);
  return /*#__PURE__*/react.createElement(contexts_PlayerContext.Provider, {
    value: playerProviderValue
  }, props.children);
};
/* harmony default export */ var PlayerProvider_PlayerProvider = (PlayerProvider);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/PlayerProvider/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getOrientation.ts


/**
 * @param {boolean | null} isLandscape
 * @param {boolean | null} isPortrait
 * @return {string}
 */
/* harmony default export */ var getOrientation = (function (isLandscape, isPortrait) {
  if (isLandscape) {
    return constants_Orientation.LANDSCAPE;
  }
  if (isPortrait) {
    return constants_Orientation.PORTRAIT;
  }
  return window.innerWidth > window.innerHeight ? constants_Orientation.LANDSCAPE : constants_Orientation.PORTRAIT;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getPagesDataAndOrder.ts


/* harmony default export */ var getPagesDataAndOrder = (function (pages, limitPages) {
  if (pages.order.length > limitPages) {
    var order = toConsumableArray_toConsumableArray(pages.order);
    order.splice(limitPages);
    return {
      order: order,
      data: order.reduce(function (accumulator, pageId) {
        return Object.assign(accumulator, defineProperty_defineProperty({}, pageId, pages.data[pageId]));
      }, {})
    };
  }
  return pages;
});
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
function classCallCheck_classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js


function possibleConstructorReturn_possibleConstructorReturn(self, call) {
  if (call && (typeof_typeof(call) === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }

  return _assertThisInitialized(self);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
function getPrototypeOf_getPrototypeOf(o) {
  getPrototypeOf_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
    return o.__proto__ || Object.getPrototypeOf(o);
  };
  return getPrototypeOf_getPrototypeOf(o);
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js

function inherits_inherits(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }

  subClass.prototype = Object.create(superClass && superClass.prototype, {
    constructor: {
      value: subClass,
      writable: true,
      configurable: true
    }
  });
  Object.defineProperty(subClass, "prototype", {
    writable: false
  });
  if (superClass) _setPrototypeOf(subClass, superClass);
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/errorHandler.ts
/**
 * Error handler (console.error)
 *
 * @param errorObject: Error
 * @param errorInfo: string
 */
/* harmony default export */ var errorHandler = (function (errorObject, errorInfo) {
  var error = "ERROR: ".concat(errorObject.message || errorObject);
  if (errorInfo) {
    error += " [".concat(errorInfo, "]");
  }
  console.error(error);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ErrorBoundary/ErrorBoundary.tsx






function _callSuper(t, o, e) { return o = getPrototypeOf_getPrototypeOf(o), possibleConstructorReturn_possibleConstructorReturn(t, ErrorBoundary_isNativeReflectConstruct() ? Reflect.construct(o, e || [], getPrototypeOf_getPrototypeOf(t).constructor) : o.apply(t, e)); }
function ErrorBoundary_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (ErrorBoundary_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }



var ErrorBoundary = /*#__PURE__*/function (_Component) {
  function ErrorBoundary(props) {
    var _this;
    classCallCheck_classCallCheck(this, ErrorBoundary);
    _this = _callSuper(this, ErrorBoundary, [props]);
    _this.state = {
      hasError: false
    };
    return _this;
  }
  inherits_inherits(ErrorBoundary, _Component);
  return createClass_createClass(ErrorBoundary, [{
    key: "componentDidCatch",
    value: function componentDidCatch(error, errorInfo) {
      errorHandler(error, JSON.stringify(errorInfo));
    }
  }, {
    key: "render",
    value: function render() {
      if (this.state.hasError) {
        return /*#__PURE__*/react.createElement("h3", null, "Something went wrong");
      }
      return this.props.children;
    }
  }], [{
    key: "getDerivedStateFromError",
    value: function getDerivedStateFromError() {
      // Update state so the next render will show the fallback UI
      return {
        hasError: true
      };
    }
  }]);
}(react.Component);
// eslint-disable-next-line react/static-property-placement
defineProperty_defineProperty(ErrorBoundary, "propTypes", {});
ErrorBoundary.propTypes = {
  children: (prop_types_default()).node.isRequired
};
/* harmony default export */ var ErrorBoundary_ErrorBoundary = (ErrorBoundary);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ErrorBoundary/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/WatermarkBarContainer/WatermarkBarStyledComponents.styles.tsx


var WatermarkBarContainer = styled_components_browser_esm.div.withConfig({
  displayName: "WatermarkBarStyledComponentsstyles__WatermarkBarContainer",
  componentId: "sc-352dbb-0"
})(["background-color:", ";height:", "px;display:flex;justify-content:space-between;min-width:360px;"], function (_ref) {
  var theme = _ref.theme;
  return "".concat(theme.colors.black);
}, WATERMARK_BAR_HEIGHT);
var WatermarkBarParagraph = styled_components_browser_esm.p.withConfig({
  displayName: "WatermarkBarStyledComponentsstyles__WatermarkBarParagraph",
  componentId: "sc-352dbb-1"
})(["font-size:14px;margin:0 0;padding-right:", "px;"], function (_ref2) {
  var $padding = _ref2.$padding;
  return $padding;
});
var WatermarkBarLeft = styled_components_browser_esm.div.withConfig({
  displayName: "WatermarkBarStyledComponentsstyles__WatermarkBarLeft",
  componentId: "sc-352dbb-2"
})(["text-align:left;color:", ";padding:8px;align-items:center;display:flex;"], function (_ref3) {
  var theme = _ref3.theme;
  return "".concat(theme.colors.white);
});
var WatermarkBarRight = styled_components_browser_esm.div.withConfig({
  displayName: "WatermarkBarStyledComponentsstyles__WatermarkBarRight",
  componentId: "sc-352dbb-3"
})(["text-align:right;color:", ";padding:8px 0;align-items:center;display:flex;"], function (_ref4) {
  var theme = _ref4.theme;
  return "".concat(theme.colors.white);
});
var WatermarkBarLogoLink = styled_components_browser_esm.a.withConfig({
  displayName: "WatermarkBarStyledComponentsstyles__WatermarkBarLogoLink",
  componentId: "sc-352dbb-4"
})(["text-decoration:none;height:20px;align-items:center;display:flex;"]);
var WatermarkBarLink = styled_components_browser_esm.a.withConfig({
  displayName: "WatermarkBarStyledComponentsstyles__WatermarkBarLink",
  componentId: "sc-352dbb-5"
})(["color:", ";text-decoration:none;padding-right:8px;"], function (_ref5) {
  var theme = _ref5.theme;
  return theme.colors.primary;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/WatermarkBarContainer/WatermarkBar.tsx






var WatermarkBar = function WatermarkBar(props) {
  var theme = Ze();
  return props.showWatermark ? /*#__PURE__*/react.createElement(ErrorBoundary_ErrorBoundary, null, /*#__PURE__*/react.createElement(WatermarkBarContainer, null, /*#__PURE__*/react.createElement(WatermarkBarLeft, null, /*#__PURE__*/react.createElement(WatermarkBarParagraph, {
    $padding: 8
  }, "Powered by"), /*#__PURE__*/react.createElement(WatermarkBarLogoLink, {
    href: props.logoUrl,
    target: "_blank"
  }, /*#__PURE__*/react.createElement(src.FlipbookLogo, {
    fill: theme.colors.white
  }))), /*#__PURE__*/react.createElement(WatermarkBarRight, null, /*#__PURE__*/react.createElement(WatermarkBarParagraph, {
    $padding: 3
  }, "Try this"), /*#__PURE__*/react.createElement(WatermarkBarLink, {
    href: props.url,
    target: "_blank"
  }, "flipbook maker")))) : null;
};
WatermarkBar.propTypes = {
  showWatermark: (prop_types_default()).bool.isRequired,
  logoUrl: (prop_types_default()).string.isRequired,
  url: (prop_types_default()).string.isRequired
};
/* harmony default export */ var WatermarkBarContainer_WatermarkBar = (WatermarkBar);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/WatermarkBarContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/screenfull/index.js
/* eslint-disable promise/prefer-await-to-then */

const methodMap = [
	[
		'requestFullscreen',
		'exitFullscreen',
		'fullscreenElement',
		'fullscreenEnabled',
		'fullscreenchange',
		'fullscreenerror',
	],
	// New WebKit
	[
		'webkitRequestFullscreen',
		'webkitExitFullscreen',
		'webkitFullscreenElement',
		'webkitFullscreenEnabled',
		'webkitfullscreenchange',
		'webkitfullscreenerror',

	],
	// Old WebKit
	[
		'webkitRequestFullScreen',
		'webkitCancelFullScreen',
		'webkitCurrentFullScreenElement',
		'webkitCancelFullScreen',
		'webkitfullscreenchange',
		'webkitfullscreenerror',

	],
	[
		'mozRequestFullScreen',
		'mozCancelFullScreen',
		'mozFullScreenElement',
		'mozFullScreenEnabled',
		'mozfullscreenchange',
		'mozfullscreenerror',
	],
	[
		'msRequestFullscreen',
		'msExitFullscreen',
		'msFullscreenElement',
		'msFullscreenEnabled',
		'MSFullscreenChange',
		'MSFullscreenError',
	],
];

const nativeAPI = (() => {
	if (typeof document === 'undefined') {
		return false;
	}

	const unprefixedMethods = methodMap[0];
	const returnValue = {};

	for (const methodList of methodMap) {
		const exitFullscreenMethod = methodList?.[1];
		if (exitFullscreenMethod in document) {
			for (const [index, method] of methodList.entries()) {
				returnValue[unprefixedMethods[index]] = method;
			}

			return returnValue;
		}
	}

	return false;
})();

const eventNameMap = {
	change: nativeAPI.fullscreenchange,
	error: nativeAPI.fullscreenerror,
};

// eslint-disable-next-line import/no-mutable-exports
let screenfull = {
	// eslint-disable-next-line default-param-last
	request(element = document.documentElement, options) {
		return new Promise((resolve, reject) => {
			const onFullScreenEntered = () => {
				screenfull.off('change', onFullScreenEntered);
				resolve();
			};

			screenfull.on('change', onFullScreenEntered);

			const returnPromise = element[nativeAPI.requestFullscreen](options);

			if (returnPromise instanceof Promise) {
				returnPromise.then(onFullScreenEntered).catch(reject);
			}
		});
	},
	exit() {
		return new Promise((resolve, reject) => {
			if (!screenfull.isFullscreen) {
				resolve();
				return;
			}

			const onFullScreenExit = () => {
				screenfull.off('change', onFullScreenExit);
				resolve();
			};

			screenfull.on('change', onFullScreenExit);

			const returnPromise = document[nativeAPI.exitFullscreen]();

			if (returnPromise instanceof Promise) {
				returnPromise.then(onFullScreenExit).catch(reject);
			}
		});
	},
	toggle(element, options) {
		return screenfull.isFullscreen ? screenfull.exit() : screenfull.request(element, options);
	},
	onchange(callback) {
		screenfull.on('change', callback);
	},
	onerror(callback) {
		screenfull.on('error', callback);
	},
	on(event, callback) {
		const eventName = eventNameMap[event];
		if (eventName) {
			document.addEventListener(eventName, callback, false);
		}
	},
	off(event, callback) {
		const eventName = eventNameMap[event];
		if (eventName) {
			document.removeEventListener(eventName, callback, false);
		}
	},
	raw: nativeAPI,
};

Object.defineProperties(screenfull, {
	isFullscreen: {
		get: () => Boolean(document[nativeAPI.fullscreenElement]),
	},
	element: {
		enumerable: true,
		get: () => document[nativeAPI.fullscreenElement] ?? undefined,
	},
	isEnabled: {
		enumerable: true,
		// Coerce to boolean in case of old WebKit.
		get: () => Boolean(document[nativeAPI.fullscreenEnabled]),
	},
});

if (!nativeAPI) {
	screenfull = {isEnabled: false};
}

/* harmony default export */ var node_modules_screenfull = (screenfull);

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/isInIframe.ts
/**
 * Verifies if the flipbook is embedded in an iframe
 * @returns {boolean} the boolean that decides if the flipbook is embedded in an iframe
 */
/* harmony default export */ var utils_isInIframe = (function () {
  try {
    return window.self !== window.top;
  } catch (e) {
    return true;
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/googleAnalytics.ts
var GAEvents = {
  DOWNLOAD: 'Download PDF',
  PRINT: 'Print PDF',
  SHARE_WITH_EMAIL: 'Share with email',
  SHARE_WITH_LINK: 'Share with link',
  CLICK: 'Click',
  ZOOM: 'Zoom',
  EXIT_FULLSCREEN: 'Exit fullscreen',
  ENTER_FULLSCREEN: 'Enter fullscreen',
  NEXT: 'Next',
  PREVIOUS: 'Previous',
  SEARCH: 'Search',
  PAGES_OVERVIEW: 'Pages overview',
  SOUND_ON: 'Sound on',
  SOUND_OFF: 'Sound off'
};
var getGAClickEventLabel = function getGAClickEventLabel(elementPageIndex, url) {
  return "Page ".concat(elementPageIndex, ": ").concat(url);
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/FullscreenContext.ts

var FullscreenContext = /*#__PURE__*/(0,react.createContext)({
  isFullscreen: false,
  toggleFullscreen: function toggleFullscreen() {}
});
var FullscreenProvider = FullscreenContext.Provider;
/* harmony default export */ var contexts_FullscreenContext = (FullscreenContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/StatisticsContext.ts

var StatisticsContext_defaultValue = {
  registerEvents: function registerEvents() {},
  sendGAEvent: function sendGAEvent() {}
};
/* harmony default export */ var StatisticsContext = (/*#__PURE__*/(0,react.createContext)(StatisticsContext_defaultValue));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/FullscreenRefContext.ts

var FullscreenRefContextDefault = {
  fullscreenRef: null,
  setFullscreenRef: function setFullscreenRef() {}
};
var FullscreenRefContext = /*#__PURE__*/react.createContext(FullscreenRefContextDefault);
var FullscreenRefProvider = FullscreenRefContext.Provider;
/* harmony default export */ var contexts_FullscreenRefContext = (FullscreenRefContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Fullscreen/Fullscreen.tsx



function Fullscreen_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ Fullscreen_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }










var FullscreenDiv = styled_components_browser_esm.div.withConfig({
  displayName: "Fullscreen__FullscreenDiv",
  componentId: "sc-1ke9m5y-0"
})(["width:100%;height:100%;"]);
var Fullscreen = function Fullscreen(props) {
  var ref = (0,react.useRef)(null);
  var _useState = (0,react.useState)(!!props.isInFullscreen),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    isFullscreen = _useState2[0],
    setIsFullscreen = _useState2[1];
  var _useAtom = react_useAtom(closePanelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    closePanel = _useAtom2[1];
  var _useContext = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext.sendGAEvent;
  var _useContext2 = (0,react.useContext)(contexts_FullscreenRefContext),
    setFullscreenRef = _useContext2.setFullscreenRef;
  (0,react.useEffect)(function () {
    setFullscreenRef(ref.current);
  }, [ref.current]);
  var toggleFullscreen = /*#__PURE__*/function () {
    var _ref = asyncToGenerator_asyncToGenerator(/*#__PURE__*/Fullscreen_regeneratorRuntime().mark(function _callee() {
      return Fullscreen_regeneratorRuntime().wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            if (node_modules_screenfull.isEnabled) {
              if (ref && ref.current && !isFullscreen && !utils_isInIframe()) {
                // Ex: on the DETAILS page we want to toggle fullscreen on the specific element,
                // instead of the whole page
                node_modules_screenfull.toggle(ref.current);
              } else {
                node_modules_screenfull.toggle();
              }
              window.dispatchEvent(new Event('resize'));
            }
          case 1:
          case "end":
            return _context.stop();
        }
      }, _callee);
    }));
    return function toggleFullscreen() {
      return _ref.apply(this, arguments);
    };
  }();
  (0,react.useEffect)(function () {
    var handler = function handler() {
      closePanel();
      setIsFullscreen(node_modules_screenfull.isFullscreen);
      // Send GA events on button action, F and ESC keys
      if (node_modules_screenfull.isFullscreen) {
        sendGAEvent(GAEvents.ENTER_FULLSCREEN);
      } else {
        sendGAEvent(GAEvents.EXIT_FULLSCREEN);
      }
    };
    if (node_modules_screenfull.isEnabled) {
      node_modules_screenfull.on('change', handler);
      return function () {
        node_modules_screenfull.off('change', handler);
      };
    }
    return undefined;
  }, [sendGAEvent]);
  return /*#__PURE__*/react.createElement(FullscreenProvider, {
    value: {
      isFullscreen: isFullscreen,
      toggleFullscreen: toggleFullscreen
    }
  }, /*#__PURE__*/react.createElement(FullscreenDiv, {
    ref: ref
  }, props.children));
};
/* harmony default export */ var Fullscreen_Fullscreen = (Fullscreen);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Fullscreen/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/getZoomScale.ts


/**
 * Returns the new value to which the zoom refers
 * @param currentValue
 * @param limitValue
 * @return number
 */
var getZoomScale = function getZoomScale(currentValue, limitValue) {
  var newValue;
  if (limitValue === ZOOM_MIN_VALUE) {
    newValue = currentValue - 1 >= limitValue ? currentValue - 1 : limitValue;
  } else {
    newValue = currentValue + 1 <= limitValue ? currentValue + 1 : limitValue;
  }
  return Math.floor(newValue);
};
/* harmony default export */ var helpers_getZoomScale = (getZoomScale);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/getPrintEvents.ts



/**
 * Return an object that contains data about which GA event and type of the stats is handled
 * @param status
 * return object
 */

var getPrintEvents = function getPrintEvents(status) {
  var published = status === FlipbookStatus.PUBLISHED.toLowerCase();
  if (published) {
    return {
      gaEvent: GAEvents.PRINT,
      statsType: StatsType.PRINT
    };
  }
  return null;
};
/* harmony default export */ var helpers_getPrintEvents = (getPrintEvents);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/isEditableHtmlElement.ts
/**
 * Return a boolean that specifies if there is any HTML element with an editable content active
 * @returns boolean
 */
/* harmony default export */ var isEditableHtmlElement = (function () {
  return !!(document.activeElement && (document.activeElement instanceof HTMLInputElement || document.activeElement instanceof HTMLTextAreaElement || document.activeElement.getAttribute('contenteditable')));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/togglePanel.ts
/**
 * Return a string that specifies if any panel will open or close
 * @param isPanelActive
 * @param panelName
 * @return string
 */
/* harmony default export */ var togglePanel = (function (isPanelActive, panelName) {
  return isPanelActive ? '' : panelName;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/url/getProfileUrl.ts

/**
 * Returns profile url
 * @param {ProfileType} { domain, profile }
 * @returns {string}
 */
/* harmony default export */ var getProfileUrl = (function (_ref) {
  var domain = _ref.domain,
    profile = _ref.profile;
  if (domain.length > 0) {
    if (profile.length > 0) {
      return "".concat(domain, "/").concat(profile);
    }

    // White label account does not contain profile in url
    return domain;
  }

  // Preview in design studio for unpublished flipbooks
  return "".concat(getSiteBase(), "/").concat(profile);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useDownloadLink.ts










/* harmony default export */ var useDownloadLink = (function () {
  var print = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  var action = print ? PRINT_PDF_SUFFIX : DOWNLOAD_PDF_SUFFIX;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    status = _useAtom2$.status,
    visibility = _useAtom2$.visibility,
    _useAtom2$$link = _useAtom2$.link,
    document = _useAtom2$$link.document,
    domain = _useAtom2$$link.domain,
    profile = _useAtom2$$link.profile,
    accountId = _useAtom2$$link.accountId;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    exportName = _useContext.exportName;
  var isPrivate = isSharedWithUsers(visibility);
  var profileUrl = getProfileUrl({
    domain: domain,
    profile: profile
  });
  if (status !== FlipbookStatus.PUBLISHED.toLowerCase()) {
    return '';
  }

  // Path to pdf if downloaded locally
  if (exportName !== null && exportName !== void 0 && exportName.length) {
    return exportName;
  }
  if (isPrivate) {
    var jsonProfile = profile || accountId;
    return "".concat(getSiteAppUrl()).concat(PrivateFlipbooks, "/").concat(jsonProfile, "/").concat(document, "/").concat(action);
  }
  return "".concat(profileUrl, "/").concat(document, "/").concat(action, ".html");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/isInputFocused.ts
/**
 * Checks if an input or content editable is focused
 */

/* harmony default export */ var isInputFocused = (function () {
  return !!(document.activeElement instanceof HTMLInputElement || document.activeElement instanceof HTMLTextAreaElement || document.activeElement && (document.activeElement.getAttribute('contenteditable') || document.activeElement.classList.contains('content-editable')));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShortcutKeys/ShortcutKeys.tsx





















var ShortcutKeys = function ShortcutKeys() {
  var _useAtom = react_useAtom(panelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    panel = _useAtom2[0],
    setPanel = _useAtom2[1];
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    status = _useAtom4[0].status;
  var fullscreen = (0,react.useContext)(contexts_FullscreenContext);
  var _useAtom5 = react_useAtom(zoomForComponentsAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    zoomForComponents = _useAtom6[0];
  var _useAtom7 = react_useAtom(setZoomForComponentsAtom),
    _useAtom8 = slicedToArray_slicedToArray(_useAtom7, 2),
    setZoomForComponents = _useAtom8[1];
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options = _useContext.options,
    _useContext$options$c = _useContext$options.controls,
    print = _useContext$options$c.print,
    search = _useContext$options$c.search,
    _useContext$options$b = _useContext$options.backgroundAudio,
    autoplay = _useContext$options$b.autoplay,
    src = _useContext$options$b.src;
  var setBackgroundSoundOn = react_useSetAtom(setBackgroundAudioOn);
  var _useContext2 = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext2.sendGAEvent,
    registerEvents = _useContext2.registerEvents;
  var _useContext3 = (0,react.useContext)(contexts_ModalContext),
    active = _useContext3.active;
  var allowShortcutKeys = (0,react.useRef)(true);
  var downloadLink = useDownloadLink(true);
  // This state manages background audio behavior.
  // When autoplay is enabled, music starts on the first interraction with the player.
  // A user interaction is considered a click or a key press that modifies the player's state.
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    isFirstInterraction = _useState2[0],
    setIsFirstInterraction = _useState2[1];
  var _useContext4 = (0,react.useContext)(contexts_FullscreenRefContext),
    fullscreenRef = _useContext4.fullscreenRef;
  var handlePrint = function handlePrint(event) {
    var disabled = status !== FlipbookStatus.PUBLISHED.toLowerCase();
    if (print && !disabled) {
      var printEvents = helpers_getPrintEvents(status);
      event.preventDefault();
      window.open(downloadLink, '_blank');
      sendGAEvent(printEvents.gaEvent);
      registerEvents([{
        eid: printEvents.statsType
      }]);
    }
  };
  var handleSearch = function handleSearch(event) {
    var isSearchPanelActive = panel === Panel.SEARCH;
    var searchPanelState = togglePanel(isSearchPanelActive, Panel.SEARCH);
    if (search) {
      event.preventDefault();
      setPanel(searchPanelState);
    }
  };
  (0,react.useEffect)(function () {
    var isValidKeyPressed = function isValidKeyPressed(event, key) {
      return key === event.key;
    };
    var executeKeyPress = function executeKeyPress(event) {
      var ctrlKey = event.ctrlKey || event.metaKey;
      if ((event.key === ESC || event.key === ESCAPE) && panel !== '') {
        setPanel('');
      }
      if (ctrlKey) {
        switch (event.key) {
          case F_KEY:
            handleSearch(event);
            break;
          case P_KEY:
            handlePrint(event);
            break;
          default:
            break;
        }
      } else if (!isEditableHtmlElement()) {
        switch (event.key) {
          case F_KEY:
            fullscreen.toggleFullscreen();
            break;
          case SUBTRACT_KEY:
            setZoomForComponents(helpers_getZoomScale(zoomForComponents, ZOOM_MIN_VALUE));
            break;
          case ADD_KEY:
            setZoomForComponents(helpers_getZoomScale(zoomForComponents, ZOOM_MAX_VALUE));
            break;
          default:
            break;
        }
      }
    };
    var handleKeyPress = function handleKeyPress(event) {
      // The first interaction is checked only after modals are closed and when there are no focused inputs
      active === '' && !isInputFocused() && setIsFirstInterraction(true);
      allowShortcutKeys.current && active === '' && validKeysForPlayerInteraction.some(function (key) {
        return isValidKeyPressed(event, key);
      }) && executeKeyPress(event);
    };
    window.addEventListener('keydown', handleKeyPress, false);
    return function () {
      window.removeEventListener('keydown', handleKeyPress, false);
    };
  }, [fullscreen, zoomForComponents, panel, active]);
  (0,react.useEffect)(function () {
    var enableAllowShortcutKeys = function enableAllowShortcutKeys() {
      allowShortcutKeys.current = true;
    };
    var disableAllowShortcutKeys = function disableAllowShortcutKeys() {
      allowShortcutKeys.current = false;
      setIsFirstInterraction(true);
    };
    fullscreenRef === null || fullscreenRef === void 0 || fullscreenRef.addEventListener('mousedown', disableAllowShortcutKeys);
    fullscreenRef === null || fullscreenRef === void 0 || fullscreenRef.addEventListener('mouseup', enableAllowShortcutKeys);
    return function () {
      fullscreenRef === null || fullscreenRef === void 0 || fullscreenRef.removeEventListener('mousedown', disableAllowShortcutKeys);
      fullscreenRef === null || fullscreenRef === void 0 || fullscreenRef.removeEventListener('mouseup', enableAllowShortcutKeys);
    };
  }, [fullscreenRef]);
  (0,react.useEffect)(function () {
    if (isFirstInterraction && autoplay) {
      setBackgroundSoundOn(true);
    }
  }, [isFirstInterraction]);
  (0,react.useEffect)(function () {
    if (autoplay) {
      // Reset the tracker of the first interraction
      setIsFirstInterraction(false);
    }
  }, [autoplay, src]);
  return null;
};
/* harmony default export */ var ShortcutKeys_ShortcutKeys = (ShortcutKeys);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShortcutKeys/index.tsx

// EXTERNAL MODULE: ../../modules/widget-player/code/node_modules/react-gtm-module/dist/index.js
var react_gtm_module_dist = __webpack_require__(2201);
var react_gtm_module_dist_default = /*#__PURE__*/__webpack_require__.n(react_gtm_module_dist);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Statistics/utils/initializeGtm.ts


/**
 * Initialize Google Tag Manager, if the user set a GTM ID
 * @param gtmId
 */
/* harmony default export */ var initializeGtm = (function (gtmId) {
  var tagManagerArgs = {
    gtmId: gtmId
  };
  react_gtm_module_dist_default().initialize(tagManagerArgs);
});
// EXTERNAL MODULE: ../../modules/widget-player/code/node_modules/react-ga4/dist/index.js
var react_ga4_dist = __webpack_require__(7088);
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/utils/console/warn.js
function warn_warn(s) {
  console.warn('[react-ga]', s);
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/components/OutboundLink.js
function OutboundLink_typeof(obj) { "@babel/helpers - typeof"; return OutboundLink_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; }, OutboundLink_typeof(obj); }

var OutboundLink_excluded = ["to", "target"];

function OutboundLink_ownKeys(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 OutboundLink_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? OutboundLink_ownKeys(Object(source), !0).forEach(function (key) { OutboundLink_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : OutboundLink_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function OutboundLink_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = OutboundLink_objectWithoutPropertiesLoose(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 OutboundLink_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; }

function OutboundLink_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function OutboundLink_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 OutboundLink_createClass(Constructor, protoProps, staticProps) { if (protoProps) OutboundLink_defineProperties(Constructor.prototype, protoProps); if (staticProps) OutboundLink_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function OutboundLink_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) OutboundLink_setPrototypeOf(subClass, superClass); }

function OutboundLink_setPrototypeOf(o, p) { OutboundLink_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OutboundLink_setPrototypeOf(o, p); }

function OutboundLink_createSuper(Derived) { var hasNativeReflectConstruct = OutboundLink_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = OutboundLink_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = OutboundLink_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return OutboundLink_possibleConstructorReturn(this, result); }; }

function OutboundLink_possibleConstructorReturn(self, call) { if (call && (OutboundLink_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return OutboundLink_assertThisInitialized(self); }

function OutboundLink_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function OutboundLink_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function OutboundLink_getPrototypeOf(o) { OutboundLink_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OutboundLink_getPrototypeOf(o); }

function OutboundLink_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; }




var NEWTAB = '_blank';
var MIDDLECLICK = 1;

var OutboundLink = /*#__PURE__*/function (_Component) {
  OutboundLink_inherits(OutboundLink, _Component);

  var _super = OutboundLink_createSuper(OutboundLink);

  function OutboundLink() {
    var _this;

    OutboundLink_classCallCheck(this, OutboundLink);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));

    OutboundLink_defineProperty(OutboundLink_assertThisInitialized(_this), "handleClick", function (event) {
      var _this$props = _this.props,
          target = _this$props.target,
          eventLabel = _this$props.eventLabel,
          to = _this$props.to,
          onClick = _this$props.onClick,
          trackerNames = _this$props.trackerNames;
      var eventMeta = {
        label: eventLabel
      };
      var sameTarget = target !== NEWTAB;
      var normalClick = !(event.ctrlKey || event.shiftKey || event.metaKey || event.button === MIDDLECLICK);

      if (sameTarget && normalClick) {
        event.preventDefault();
        OutboundLink.trackLink(eventMeta, function () {
          window.location.href = to;
        }, trackerNames);
      } else {
        OutboundLink.trackLink(eventMeta, function () {}, trackerNames);
      }

      if (onClick) {
        onClick(event);
      }
    });

    return _this;
  }

  OutboundLink_createClass(OutboundLink, [{
    key: "render",
    value: function render() {
      var _this$props2 = this.props,
          href = _this$props2.to,
          target = _this$props2.target,
          oldProps = OutboundLink_objectWithoutProperties(_this$props2, OutboundLink_excluded);

      var props = OutboundLink_objectSpread(OutboundLink_objectSpread({}, oldProps), {}, {
        target: target,
        href: href,
        onClick: this.handleClick
      });

      if (target === NEWTAB) {
        props.rel = "".concat(props.rel ? props.rel : '', " noopener noreferrer").trim();
      }

      delete props.eventLabel;
      delete props.trackerNames;
      return /*#__PURE__*/react.createElement('a', props);
    }
  }]);

  return OutboundLink;
}(react.Component);

OutboundLink_defineProperty(OutboundLink, "trackLink", function () {
  warn_warn('ga tracking not enabled');
});


OutboundLink.propTypes = {
  eventLabel: (prop_types_default()).string.isRequired,
  target: (prop_types_default()).string,
  to: (prop_types_default()).string,
  onClick: (prop_types_default()).func,
  trackerNames: prop_types_default().arrayOf((prop_types_default()).string)
};
OutboundLink.defaultProps = {
  target: null,
  to: null,
  onClick: null,
  trackerNames: null
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/utils/mightBeEmail.js
// See if s could be an email address. We don't want to send personal data like email.
// https://support.google.com/analytics/answer/2795983?hl=en
function mightBeEmail(s) {
  // There's no point trying to validate rfc822 fully, just look for ...@...
  return typeof s === 'string' && s.indexOf('@') !== -1;
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/utils/redactEmail.js


var redacted = 'REDACTED (Potential Email Address)';
function redactEmail(string) {
  if (mightBeEmail(string)) {
    warn_warn('This arg looks like an email address, redacting.');
    return redacted;
  }

  return string;
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/utils/trim.js
// GA strings need to have leading/trailing whitespace trimmed, and not all
// browsers have String.prototoype.trim().
function trim(s) {
  return s && s.toString().replace(/^\s+|\s+$/g, '');
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/utils/toTitleCase.js
/**
 * To Title Case 2.1 - http://individed.com/code/to-title-case/
 * Copyright 2008-2013 David Gouch. Licensed under the MIT License.
 * https://github.com/gouch/to-title-case
 */

var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i; // test

function toTitleCase(string) {
  return trim(string).replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
    if (index > 0 && index + match.length !== title.length && match.search(smallWords) > -1 && title.charAt(index - 2) !== ':' && (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') && title.charAt(index - 1).search(/[^\s-]/) < 0) {
      return match.toLowerCase();
    }

    if (match.substr(1).search(/[A-Z]|\../) > -1) {
      return match;
    }

    return match.charAt(0).toUpperCase() + match.substr(1);
  });
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/utils/format.js


function format_format() {
  var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;

  var _str = s || '';

  if (titleCase) {
    _str = toTitleCase(s);
  }

  if (redactingEmail) {
    _str = redactEmail(_str);
  }

  return _str;
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/utils/removeLeadingSlash.js
function removeLeadingSlash(string) {
  if (string.substring(0, 1) === '/') {
    return string.substring(1);
  }

  return string;
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/utils/loadGA.js
var isLoaded = false;
/* harmony default export */ function loadGA(options) {
  if (isLoaded) return;
  isLoaded = true;
  var gaAddress = 'https://www.google-analytics.com/analytics.js';

  if (options && options.gaAddress) {
    gaAddress = options.gaAddress;
  } else if (options && options.debug) {
    gaAddress = 'https://www.google-analytics.com/analytics_debug.js';
  }

  var onerror = options && options.onerror; // https://developers.google.com/analytics/devguides/collection/analyticsjs/

  /* eslint-disable */

  (function (i, s, o, g, r, a, m) {
    i['GoogleAnalyticsObject'] = r;
    i[r] = i[r] || function () {
      (i[r].q = i[r].q || []).push(arguments);
    }, i[r].l = 1 * new Date();
    a = s.createElement(o), m = s.getElementsByTagName(o)[0];
    a.async = 1;
    a.src = g;
    a.onerror = onerror;
    m.parentNode.insertBefore(a, m);
  })(window, document, 'script', gaAddress, 'ga');
  /* eslint-enable */

}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/utils/console/log.js
function console_log_log(s) {
  console.info('[react-ga]', s);
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/utils/testModeAPI.js
var gaCalls = [];
/* harmony default export */ var testModeAPI = ({
  calls: gaCalls,
  ga: function ga() {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    gaCalls.push([].concat(args));
  },
  resetCalls: function resetCalls() {
    gaCalls.length = 0;
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/core.js
var core_excluded = ["category", "action", "label", "value", "nonInteraction", "transport"];

function core_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = core_objectWithoutPropertiesLoose(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 core_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; }

function core_ownKeys(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 core_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? core_ownKeys(Object(source), !0).forEach(function (key) { core_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : core_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function core_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; }

function core_typeof(obj) { "@babel/helpers - typeof"; return core_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; }, core_typeof(obj); }

function core_toConsumableArray(arr) { return core_arrayWithoutHoles(arr) || core_iterableToArray(arr) || core_unsupportedIterableToArray(arr) || core_nonIterableSpread(); }

function core_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."); }

function core_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return core_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 core_arrayLikeToArray(o, minLen); }

function core_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }

function core_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return core_arrayLikeToArray(arr); }

function core_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; }

/**
 * React Google Analytics Module
 *
 * @package react-ga
 * @author  Adam Lofting <adam@mozillafoundation.org>
 *          Atul Varma <atul@mozillafoundation.org>
 */

/**
 * Utilities
 */








var _isNotBrowser = typeof window === 'undefined' || typeof document === 'undefined';

var _debug = false;
var _titleCase = true;
var _testMode = false;
var _alwaysSendToDefaultTracker = true;
var _redactEmail = true;

var internalGa = function internalGa() {
  var _window;

  if (_testMode) return testModeAPI.ga.apply(testModeAPI, arguments);
  if (_isNotBrowser) return false;
  if (!window.ga) return warn_warn('ReactGA.initialize must be called first or GoogleAnalytics should be loaded manually');
  return (_window = window).ga.apply(_window, arguments);
};

function _format(s) {
  return format_format(s, _titleCase, _redactEmail);
}

function _gaCommand(trackerNames) {
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    args[_key - 1] = arguments[_key];
  }

  var command = args[0];

  if (typeof internalGa === 'function') {
    if (typeof command !== 'string') {
      warn_warn('ga command must be a string');
      return;
    }

    if (_alwaysSendToDefaultTracker || !Array.isArray(trackerNames)) internalGa.apply(void 0, args);

    if (Array.isArray(trackerNames)) {
      trackerNames.forEach(function (name) {
        internalGa.apply(void 0, core_toConsumableArray(["".concat(name, ".").concat(command)].concat(args.slice(1))));
      });
    }
  }
}

function _initialize(gaTrackingID, options) {
  if (!gaTrackingID) {
    warn_warn('gaTrackingID is required in initialize()');
    return;
  }

  if (options) {
    if (options.debug && options.debug === true) {
      _debug = true;
    }

    if (options.titleCase === false) {
      _titleCase = false;
    }

    if (options.redactEmail === false) {
      _redactEmail = false;
    }

    if (options.useExistingGa) {
      return;
    }
  }

  if (options && options.gaOptions) {
    internalGa('create', gaTrackingID, options.gaOptions);
  } else {
    internalGa('create', gaTrackingID, 'auto');
  }
}

function addTrackers(configsOrTrackingId, options) {
  if (Array.isArray(configsOrTrackingId)) {
    configsOrTrackingId.forEach(function (config) {
      if (core_typeof(config) !== 'object') {
        warn_warn('All configs must be an object');
        return;
      }

      _initialize(config.trackingId, config);
    });
  } else {
    _initialize(configsOrTrackingId, options);
  }

  return true;
}
function initialize(configsOrTrackingId, options) {
  if (options && options.testMode === true) {
    _testMode = true;
  } else {
    if (_isNotBrowser) {
      return;
    }

    if (!options || options.standardImplementation !== true) loadGA(options);
  }

  _alwaysSendToDefaultTracker = options && typeof options.alwaysSendToDefaultTracker === 'boolean' ? options.alwaysSendToDefaultTracker : true;
  addTrackers(configsOrTrackingId, options);
}
/**
 * ga:
 * Returns the original GA object.
 */

function ga() {
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
    args[_key2] = arguments[_key2];
  }

  if (args.length > 0) {
    internalGa.apply(void 0, args);

    if (_debug) {
      console_log_log("called ga('arguments');");
      console_log_log("with arguments: ".concat(JSON.stringify(args)));
    }
  }

  return window.ga;
}
/**
 * set:
 * GA tracker set method
 * @param {Object} fieldsObject - a field/value pair or a group of field/value pairs on the tracker
 * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
 */

function set(fieldsObject, trackerNames) {
  if (!fieldsObject) {
    warn_warn('`fieldsObject` is required in .set()');
    return;
  }

  if (core_typeof(fieldsObject) !== 'object') {
    warn_warn('Expected `fieldsObject` arg to be an Object');
    return;
  }

  if (Object.keys(fieldsObject).length === 0) {
    warn_warn('empty `fieldsObject` given to .set()');
  }

  _gaCommand(trackerNames, 'set', fieldsObject);

  if (_debug) {
    console_log_log("called ga('set', fieldsObject);");
    console_log_log("with fieldsObject: ".concat(JSON.stringify(fieldsObject)));
  }
}
/**
 * send:
 * Clone of the low level `ga.send` method
 * WARNING: No validations will be applied to this
 * @param  {Object} fieldObject - field object for tracking different analytics
 * @param  {Array} trackerNames - trackers to send the command to
 * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
 */

function send(fieldObject, trackerNames) {
  _gaCommand(trackerNames, 'send', fieldObject);

  if (_debug) {
    console_log_log("called ga('send', fieldObject);");
    console_log_log("with fieldObject: ".concat(JSON.stringify(fieldObject)));
    console_log_log("with trackers: ".concat(JSON.stringify(trackerNames)));
  }
}
/**
 * pageview:
 * Basic GA pageview tracking
 * @param  {String} path - the current page page e.g. '/about'
 * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
 * @param {String} title - (optional) the page title e. g. 'My Website'
 */

function pageview(rawPath, trackerNames, title) {
  if (!rawPath) {
    warn_warn('path is required in .pageview()');
    return;
  }

  var path = trim(rawPath);

  if (path === '') {
    warn_warn('path cannot be an empty string in .pageview()');
    return;
  }

  var extraFields = {};

  if (title) {
    extraFields.title = title;
  }

  if (typeof ga === 'function') {
    _gaCommand(trackerNames, 'send', core_objectSpread({
      hitType: 'pageview',
      page: path
    }, extraFields));

    if (_debug) {
      console_log_log("called ga('send', 'pageview', path);");
      var extraLog = '';

      if (title) {
        extraLog = " and title: ".concat(title);
      }

      console_log_log("with path: ".concat(path).concat(extraLog));
    }
  }
}
/**
 * modalview:
 * a proxy to basic GA pageview tracking to consistently track
 * modal views that are an equivalent UX to a traditional pageview
 * @param  {String} modalName e.g. 'add-or-edit-club'
 * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
 */

function modalview(rawModalName, trackerNames) {
  if (!rawModalName) {
    warn_warn('modalName is required in .modalview(modalName)');
    return;
  }

  var modalName = removeLeadingSlash(trim(rawModalName));

  if (modalName === '') {
    warn_warn('modalName cannot be an empty string or a single / in .modalview()');
    return;
  }

  if (typeof ga === 'function') {
    var path = "/modal/".concat(modalName);

    _gaCommand(trackerNames, 'send', 'pageview', path);

    if (_debug) {
      console_log_log("called ga('send', 'pageview', path);");
      console_log_log("with path: ".concat(path));
    }
  }
}
/**
 * timing:
 * GA timing
 * @param args.category {String} required
 * @param args.variable {String} required
 * @param args.value  {Int}  required
 * @param args.label  {String} required
 * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
 */

function timing() {
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
      category = _ref.category,
      variable = _ref.variable,
      value = _ref.value,
      label = _ref.label;

  var trackerNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;

  if (typeof ga === 'function') {
    if (!category || !variable || typeof value !== 'number') {
      warn_warn('args.category, args.variable ' + 'AND args.value are required in timing() ' + 'AND args.value has to be a number');
      return;
    } // Required Fields


    var fieldObject = {
      hitType: 'timing',
      timingCategory: _format(category),
      timingVar: _format(variable),
      timingValue: value
    };

    if (label) {
      fieldObject.timingLabel = _format(label);
    }

    send(fieldObject, trackerNames);
  }
}
/**
 * event:
 * GA event tracking
 * @param args.category {String} required
 * @param args.action {String} required
 * @param args.label {String} optional
 * @param args.value {Int} optional
 * @param args.nonInteraction {boolean} optional
 * @param args.transport {string} optional
 * @param {{action: string, category: string}} trackerNames - (optional) a list of extra trackers to run the command on
 */

function core_event() {
  var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
      category = _ref2.category,
      action = _ref2.action,
      label = _ref2.label,
      value = _ref2.value,
      nonInteraction = _ref2.nonInteraction,
      transport = _ref2.transport,
      args = core_objectWithoutProperties(_ref2, core_excluded);

  var trackerNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;

  if (typeof ga === 'function') {
    // Simple Validation
    if (!category || !action) {
      warn_warn('args.category AND args.action are required in event()');
      return;
    } // Required Fields


    var fieldObject = {
      hitType: 'event',
      eventCategory: _format(category),
      eventAction: _format(action)
    }; // Optional Fields

    if (label) {
      fieldObject.eventLabel = _format(label);
    }

    if (typeof value !== 'undefined') {
      if (typeof value !== 'number') {
        warn_warn('Expected `args.value` arg to be a Number.');
      } else {
        fieldObject.eventValue = value;
      }
    }

    if (typeof nonInteraction !== 'undefined') {
      if (typeof nonInteraction !== 'boolean') {
        warn_warn('`args.nonInteraction` must be a boolean.');
      } else {
        fieldObject.nonInteraction = nonInteraction;
      }
    }

    if (typeof transport !== 'undefined') {
      if (typeof transport !== 'string') {
        warn_warn('`args.transport` must be a string.');
      } else {
        if (['beacon', 'xhr', 'image'].indexOf(transport) === -1) {
          warn_warn('`args.transport` must be either one of these values: `beacon`, `xhr` or `image`');
        }

        fieldObject.transport = transport;
      }
    }

    Object.keys(args).filter(function (key) {
      return key.substr(0, 'dimension'.length) === 'dimension';
    }).forEach(function (key) {
      fieldObject[key] = args[key];
    });
    Object.keys(args).filter(function (key) {
      return key.substr(0, 'metric'.length) === 'metric';
    }).forEach(function (key) {
      fieldObject[key] = args[key];
    }); // Send to GA

    send(fieldObject, trackerNames);
  }
}
/**
 * exception:
 * GA exception tracking
 * @param args.description {String} optional
 * @param args.fatal {boolean} optional
 * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on
 */

function exception(_ref3, trackerNames) {
  var description = _ref3.description,
      fatal = _ref3.fatal;

  if (typeof ga === 'function') {
    // Required Fields
    var fieldObject = {
      hitType: 'exception'
    }; // Optional Fields

    if (description) {
      fieldObject.exDescription = _format(description);
    }

    if (typeof fatal !== 'undefined') {
      if (typeof fatal !== 'boolean') {
        warn_warn('`args.fatal` must be a boolean.');
      } else {
        fieldObject.exFatal = fatal;
      }
    } // Send to GA


    send(fieldObject, trackerNames);
  }
}
var core_plugin = {
  /**
   * require:
   * GA requires a plugin
   * @param name {String} e.g. 'ecommerce' or 'myplugin'
   * @param options {Object} optional e.g {path: '/log', debug: true}
   * @param trackerName {String} optional e.g 'trackerName'
   */
  require: function require(rawName, options, trackerName) {
    if (typeof ga === 'function') {
      // Required Fields
      if (!rawName) {
        warn_warn('`name` is required in .require()');
        return;
      }

      var name = trim(rawName);

      if (name === '') {
        warn_warn('`name` cannot be an empty string in .require()');
        return;
      }

      var requireString = trackerName ? "".concat(trackerName, ".require") : 'require'; // Optional Fields

      if (options) {
        if (core_typeof(options) !== 'object') {
          warn_warn('Expected `options` arg to be an Object');
          return;
        }

        if (Object.keys(options).length === 0) {
          warn_warn('Empty `options` given to .require()');
        }

        ga(requireString, name, options);

        if (_debug) {
          console_log_log("called ga('require', '".concat(name, "', ").concat(JSON.stringify(options)));
        }
      } else {
        ga(requireString, name);

        if (_debug) {
          console_log_log("called ga('require', '".concat(name, "');"));
        }
      }
    }
  },

  /**
   * execute:
   * GA execute action for plugin
   * Takes variable number of arguments
   * @param pluginName {String} e.g. 'ecommerce' or 'myplugin'
   * @param action {String} e.g. 'addItem' or 'myCustomAction'
   * @param actionType {String} optional e.g. 'detail'
   * @param payload {Object} optional e.g { id: '1x5e', name : 'My product to track' }
   */
  execute: function execute(pluginName, action) {
    var payload;
    var actionType;

    for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
      args[_key3 - 2] = arguments[_key3];
    }

    if (args.length === 1) {
      payload = args[0];
    } else {
      actionType = args[0];
      payload = args[1];
    }

    if (typeof ga === 'function') {
      if (typeof pluginName !== 'string') {
        warn_warn('Expected `pluginName` arg to be a String.');
      } else if (typeof action !== 'string') {
        warn_warn('Expected `action` arg to be a String.');
      } else {
        var command = "".concat(pluginName, ":").concat(action);
        payload = payload || null;

        if (actionType && payload) {
          ga(command, actionType, payload);

          if (_debug) {
            console_log_log("called ga('".concat(command, "');"));
            console_log_log("actionType: \"".concat(actionType, "\" with payload: ").concat(JSON.stringify(payload)));
          }
        } else if (payload) {
          ga(command, payload);

          if (_debug) {
            console_log_log("called ga('".concat(command, "');"));
            console_log_log("with payload: ".concat(JSON.stringify(payload)));
          }
        } else {
          ga(command);

          if (_debug) {
            console_log_log("called ga('".concat(command, "');"));
          }
        }
      }
    }
  }
};
/**
 * outboundLink:
 * GA outboundLink tracking
 * @param args.label {String} e.g. url, or 'Create an Account'
 * @param {function} hitCallback - Called after processing a hit.
 */

function outboundLink(args, hitCallback, trackerNames) {
  if (typeof hitCallback !== 'function') {
    warn_warn('hitCallback function is required');
    return;
  }

  if (typeof ga === 'function') {
    // Simple Validation
    if (!args || !args.label) {
      warn_warn('args.label is required in outboundLink()');
      return;
    } // Required Fields


    var fieldObject = {
      hitType: 'event',
      eventCategory: 'Outbound',
      eventAction: 'Click',
      eventLabel: _format(args.label)
    };
    var safetyCallbackCalled = false;

    var safetyCallback = function safetyCallback() {
      // This prevents a delayed response from GA
      // causing hitCallback from being fired twice
      safetyCallbackCalled = true;
      hitCallback();
    }; // Using a timeout to ensure the execution of critical application code
    // in the case when the GA server might be down
    // or an ad blocker prevents sending the data
    // register safety net timeout:


    var t = setTimeout(safetyCallback, 250);

    var clearableCallbackForGA = function clearableCallbackForGA() {
      clearTimeout(t);

      if (!safetyCallbackCalled) {
        hitCallback();
      }
    };

    fieldObject.hitCallback = clearableCallbackForGA; // Send to GA

    send(fieldObject, trackerNames);
  } else {
    // if ga is not defined, return the callback so the application
    // continues to work as expected
    setTimeout(hitCallback, 0);
  }
}
var core_testModeAPI = testModeAPI;
/* harmony default export */ var core = ({
  initialize: initialize,
  ga: ga,
  set: set,
  send: send,
  pageview: pageview,
  modalview: modalview,
  timing: timing,
  event: core_event,
  exception: exception,
  plugin: core_plugin,
  outboundLink: outboundLink,
  testModeAPI: testModeAPI
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-ga/dist/esm/index.js
function esm_ownKeys(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 esm_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? esm_ownKeys(Object(source), !0).forEach(function (key) { esm_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : esm_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function esm_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; }



var esm_initialize = initialize;

var esm_addTrackers = addTrackers;

var esm_ga = ga;

var esm_set = set;

var esm_send = send;

var esm_pageview = pageview;

var esm_modalview = modalview;

var esm_timing = timing;

var esm_event = core_event;

var esm_exception = exception;

var esm_plugin = core_plugin;

var esm_outboundLink = outboundLink;

var esm_testModeAPI = core_testModeAPI;

OutboundLink.origTrackLink = OutboundLink.trackLink;
OutboundLink.trackLink = outboundLink;
var esm_OutboundLink = OutboundLink;
/* harmony default export */ var esm = (esm_objectSpread(esm_objectSpread({}, core_namespaceObject), {}, {
  OutboundLink: esm_OutboundLink
}));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Statistics/utils/sendGoogleAnalyticsEvent.ts



/**
 * Send specific event to google analytics tracker
 * @param category
 * @param action
 * @param label
 */
/* harmony default export */ var sendGoogleAnalyticsEvent = (function (category, action, label) {
  try {
    if (react_ga4_dist/* default */.Ay.isInitialized) {
      var customLabelParam = label ? {
        label: label
      } : {};
      react_ga4_dist/* default */.Ay.gtag('event', action, customLabelParam);
    } else {
      esm.event({
        category: category,
        action: action,
        label: label
      });
    }
  } catch (error) {
    // Prevent crashing the player
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/isGA4.ts
/**
 * Verifies if the Google Analytics tracking code is for Universal Analytics,
 * or Google Analytics 4
 * GA4 tracking codes start with 'G-'
 * Universal Analytics codes start with 'UA-'
 *
 * @param {string}
 * @returns {boolean} the boolean that decides if the flipbook is embedded in an iframe
 */
/* harmony default export */ var isGA4 = (function (gaCode) {
  return gaCode.substring(0, 2) === 'G-';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Statistics/utils/initializeGoogleAnalytics.ts




/**
 * Initialize GA module for flipsnack tracker and then configures the user tracker if necessary
 * @param clientGaCode
 * @param ipAnonymization
 */
/* harmony default export */ var initializeGoogleAnalytics = (function (clientGaCode, ipAnonymization) {
  if (isGA4(clientGaCode)) {
    react_ga4_dist/* default */.Ay.initialize(clientGaCode, {
      gaOptions: {
        cookieFlags: 'Secure;SameSite=None',
        anonymizeIp: ipAnonymization
      }
    });
    react_ga4_dist/* default */.Ay.gtag('config', clientGaCode, {
      groups: 'clientTracker',
      anonymize_ip: ipAnonymization,
      // New versions of chrome does not allow cross site cookies without "samesite" and "secure" flags
      cookie_flags: 'max-age=7200;Secure;SameSite=None'
    });
  } else {
    esm.initialize(clientGaCode, {
      debug: false,
      titleCase: false,
      gaOptions: {
        cookieFlags: 'Secure;SameSite=None'
      }
    });
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Statistics/PageStatisticsLayer/PageStatisticsLayer.tsx







var PageStatisticsLayer = function PageStatisticsLayer() {
  var _pages$order$settledS;
  var _useContext = (0,react.useContext)(StatisticsContext),
    registerEvents = _useContext.registerEvents;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    pages = _useContext2.pages;
  var _staticStore$config$g = getConfig(),
    _staticStore$config$g2 = _staticStore$config$g.enableCollectStats,
    enableCollectStats = _staticStore$config$g2 === void 0 ? false : _staticStore$config$g2;
  var isDoublePage = ((_pages$order$settledS = pages.order[settledStageIndex]) === null || _pages$order$settledS === void 0 ? void 0 : _pages$order$settledS.length) > 1;
  var memoizedCallbacks = (0,react.useMemo)(function () {
    return [function (timeSpent) {
      return getPingEvents(pages.order[settledStageIndex], timeSpent);
    }];
  }, [settledStageIndex, isDoublePage]);
  var _useViewEvents = useViewEvents(registerEvents, enableCollectStats, memoizedCallbacks),
    firstImpressionEventSent = _useViewEvents.firstImpressionEventSent;
  (0,react.useEffect)(function () {
    // Send page view events and send time spent on page periodically
    if (firstImpressionEventSent && enableCollectStats) {
      // Do not send any events until first view event is not sent.
      var events = [getPageViewEvent(pages.order[settledStageIndex][0])];
      if (pages.order[settledStageIndex][1] !== undefined) {
        events = events.concat([getPageViewEvent(pages.order[settledStageIndex][1])]);
      }
      registerEvents(events);
    }
  }, [settledStageIndex, firstImpressionEventSent, enableCollectStats]);

  // Empty component - do not add to virtual dom - send statistics from useEffects
  return null;
};
/* harmony default export */ var PageStatisticsLayer_PageStatisticsLayer = (PageStatisticsLayer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Statistics/PageStatisticsLayer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Statistics/Statistics.tsx















var EventTrackingDiv = styled_components_browser_esm.div.withConfig({
  displayName: "Statistics__EventTrackingDiv",
  componentId: "sc-1fv5sjr-0"
})(["width:100%;height:100%;"]);
var Statistics = function Statistics(props) {
  var _useAtom = react_useAtom(featuresAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    features = _useAtom2[0];
  var _useAtom3 = react_useAtom(mouseOverPlayerAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    isMouseOverPlayer = _useAtom4[0];
  var _useAtom5 = react_useAtom(propertiesAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    _useAtom6$ = _useAtom6[0],
    _useAtom6$$tracking = _useAtom6$.tracking,
    clientCode = _useAtom6$$tracking.id,
    ipAnonymization = _useAtom6$$tracking.ipAnonymization,
    gtmId = _useAtom6$.gtmId,
    title = _useAtom6$.title;
  var ref = (0,react.useRef)(null);
  var firstViewEventSent = (0,react.useRef)(false);
  var isMouseOverPlayerRef = (0,react.useRef)(isMouseOverPlayer);
  isMouseOverPlayerRef.current = isMouseOverPlayer;
  var skipTrackingAndStats = isOnFlipsnackAdminDomain();
  var staticConfig = getConfig();
  var _staticConfig$enableC = staticConfig.enableCollectStats,
    enableCollectStats = _staticConfig$enableC === void 0 ? false : _staticConfig$enableC;
  var _staticConfig$statist = staticConfig.statisticsEndpoint,
    statisticsEndpoint = _staticConfig$statist === void 0 ? '' : _staticConfig$statist,
    enableGATracking = staticConfig.enableGATracking,
    trackingData = staticConfig.trackingData;
  if (skipTrackingAndStats) {
    enableCollectStats = false;
  }
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    pages = _useContext.pages;
  var collectionItemHash = (0,react.useMemo)(function () {
    var _pages$data;
    var firstPageId = pages.order[0][0];
    return ((_pages$data = pages.data["".concat(firstPageId)]) === null || _pages$data === void 0 || (_pages$data = _pages$data.source) === null || _pages$data === void 0 ? void 0 : _pages$data.hash) || '';
  }, []);
  var impressionHash = (0,react.useMemo)(function () {
    return esm_browser_v4().replace(/-/g, '');
  }, []);
  var _useStatistics = useStatistics(enableCollectStats, statisticsEndpoint, props.flipbookHash, impressionHash, collectionItemHash, trackingData, props.allowedEvents),
    registerEvents = _useStatistics.registerEvents;
  var clientGaCode = features.WIDGET_ANALYTICS && !skipTrackingAndStats ? clientCode : '';
  var clientGtmCode = features.WIDGET_GTM && !skipTrackingAndStats ? gtmId : '';
  var sendGAEvent = function sendGAEvent(action, label) {
    if (clientGaCode) {
      sendGoogleAnalyticsEvent(title, action, label);
    }
  };
  (0,react.useEffect)(function () {
    // If ga tracking is enabled initialize Google Analytics module
    if (enableGATracking) {
      if (clientGaCode !== '') {
        initializeGoogleAnalytics(clientGaCode, ipAnonymization);
      }

      // If ga tracking is enabled initialize GTM module
      if (clientGtmCode !== '') {
        initializeGtm(gtmId);
      }
    }
  }, [enableGATracking, clientGaCode, ipAnonymization, clientGtmCode, gtmId]);
  (0,react.useEffect)(function () {
    var tempRef = ref.current;
    var _handler = function handler() {
      if (!firstViewEventSent.current) {
        setTimeout(function () {
          if (isMouseOverPlayerRef.current && !firstViewEventSent.current) {
            registerEvents([{
              eid: StatsType.VIEW,
              d: getDeviceType(),
              s: getReferrerType()
            }, {
              eid: StatsType.VIEW_ITEM,
              pageIndex: 0
            }]);
            firstViewEventSent.current = true;
            tempRef === null || tempRef === void 0 || tempRef.removeEventListener('keydown', _handler);
            tempRef === null || tempRef === void 0 || tempRef.removeEventListener('mouseenter', _handler);
          }
        }, StatsTimeToSendViews);
      }
    };
    tempRef === null || tempRef === void 0 || tempRef.addEventListener('keydown', _handler);
    tempRef === null || tempRef === void 0 || tempRef.addEventListener('mouseenter', _handler);
    return function () {
      tempRef === null || tempRef === void 0 || tempRef.removeEventListener('keydown', _handler);
      tempRef === null || tempRef === void 0 || tempRef.removeEventListener('mouseenter', _handler);
    };
  }, []);
  return (
    /*#__PURE__*/
    // eslint-disable-next-line react/jsx-no-constructed-context-values
    react.createElement(StatisticsContext.Provider, {
      value: {
        registerEvents: registerEvents,
        sendGAEvent: sendGAEvent
      }
    }, /*#__PURE__*/react.createElement(EventTrackingDiv, {
      ref: ref
    }, enableCollectStats && /*#__PURE__*/react.createElement(PageStatisticsLayer_PageStatisticsLayer, null), props.children))
  );
};
/* harmony default export */ var Statistics_Statistics = (Statistics);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Statistics/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/ControllerContext.ts

var controllerContextDefault = {
  scale: 0,
  setScale: function setScale() {}
};
var ControllerContext = /*#__PURE__*/react.createContext(controllerContextDefault);
var ControllerProvider = ControllerContext.Provider;
/* harmony default export */ var contexts_ControllerContext = (ControllerContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ControllerProviderContainer/ControllerProviderContainer.tsx

/* eslint-disable @typescript-eslint/no-unused-vars */



var ControllerProviderContainer = function ControllerProviderContainer(props) {
  var _useState = (0,react.useState)(DEFAULT_SCALE_CONTENT),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    scale = _useState2[0],
    setScale = _useState2[1];
  return /*#__PURE__*/react.createElement(ControllerProvider, {
    value: {
      scale: scale,
      setScale: setScale
    }
  }, props.children);
};
/* harmony default export */ var ControllerProviderContainer_ControllerProviderContainer = (ControllerProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ControllerProviderContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PlayerContainer/dispatchResizeEvent.ts



/**
 * Used for dispatching the resize event
 */
/* harmony default export */ var dispatchResizeEvent = ((0,lodash.debounce)(function () {
  window.dispatchEvent(new Event('resize'));
}, constants_WAIT_USER_INTERACTION_MS, {
  leading: true
}));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/ActiveStageIndexContext.ts

var ActiveStageIndexContextDefaults = {
  setActiveStageIndex: function setActiveStageIndex() {
    return null;
  }
};
var ActiveStageIndexContext = /*#__PURE__*/react.createContext(ActiveStageIndexContextDefaults);
/* harmony default export */ var contexts_ActiveStageIndexContext = (ActiveStageIndexContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useFirstMandatoryStageIndex.ts





/**
 * Get stage index of the first mandatory action in list
 */
/* harmony default export */ var useFirstMandatoryStageIndex = (function () {
  var mandatoryActions = react_useAtomValue(mandatoryActionsAtom);
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    order = _useContext.pages.order,
    rtl = _useContext.options.content.rtl;
  var getFirstMandatoryStageIndex = function getFirstMandatoryStageIndex() {
    if (Object.keys(mandatoryActions).length) {
      if (rtl) {
        return order.findLastIndex(function (stage) {
          return stage.join(' ') in mandatoryActions;
        });
      }
      return order.findIndex(function (stage) {
        return stage.join(' ') in mandatoryActions;
      });
    }
    return null;
  };
  return (0,react.useMemo)(function () {
    return getFirstMandatoryStageIndex();
  }, [mandatoryActions, order.length, rtl]);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getActiveStageIndex.ts


/**
 * @param {number} stageIndex
 * @param {number} totalPages
 * @param {string} layoutType
 * @param {string} previousLayoutType
 * @param {boolean} isRtl
 * @return {number}
 */
/* harmony default export */ var getActiveStageIndex = (function (stageIndex, totalPages, layoutType) {
  var previousLayoutType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : constants_WidgetLayoutTypes.SINGLE;
  var isRtl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  var newStageIndex = Math.min(stageIndex || 0, totalPages);

  // When switching from 'double page' to 'single page' layout with a RTL orientation and odd number of pages the
  // last stage index will have for example [5, 4] pages, this condition will prevent choosing the page 5
  // (which would be an incorrect choice, because we need the page 4)
  var hasToResetFirstStage = isRtl && previousLayoutType === constants_WidgetLayoutTypes.DOUBLE && layoutType === constants_WidgetLayoutTypes.SINGLE && totalPages % 2 !== 0;
  if (!newStageIndex && !hasToResetFirstStage || typeof newStageIndex !== 'number') {
    return 0;
  }
  if (stageIndex === -1 || newStageIndex >= totalPages) {
    newStageIndex = layoutType === constants_WidgetLayoutTypes.DOUBLE ? Math.floor(totalPages / 2) : totalPages - 1;
  }
  if (newStageIndex < 0) {
    return 0;
  }

  // Switching from 'double page' to 'single page' layout
  if (previousLayoutType === constants_WidgetLayoutTypes.DOUBLE && layoutType === constants_WidgetLayoutTypes.SINGLE) {
    // If the orientation is RTL and the number of pages is an odd number
    if (isRtl && totalPages % 2 !== 0) {
      // Prevent newStageIndex to be bigger than the number of pages (when the number of pages is an odd number)
      if (newStageIndex * 2 + 1 < totalPages) {
        return newStageIndex * 2 + 1;
      }
      return newStageIndex * 2;
    }

    // Prevent newStageIndex to be bigger than the number of pages (when the number of pages is an even number)
    if (isRtl && newStageIndex * 2 < totalPages) {
      return newStageIndex * 2;
    }
    if (newStageIndex * 2 - 1 <= totalPages) {
      return newStageIndex * 2 - 1;
    }
  }

  // Switching from 'single page' to 'double page' layout
  if (previousLayoutType === constants_WidgetLayoutTypes.SINGLE && layoutType === constants_WidgetLayoutTypes.DOUBLE) {
    // If the orientation is RTL and the number of pages is an odd number
    if (isRtl && totalPages % 2 !== 0) {
      return Math.floor(newStageIndex / 2);
    }
    return Math.floor((newStageIndex + 1) / 2);
  }

  // If the result of switching between single and double get us a wrong newStageIndex we need to make sure it doesn't
  // jump above the page limit
  if (layoutType === constants_WidgetLayoutTypes.DOUBLE && newStageIndex > Math.floor(totalPages / 2)) {
    newStageIndex = Math.floor(totalPages / 2);
  }
  return newStageIndex;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/directions/getPageNumber.ts
/**
 * Calculates the page index depending on the orientation (LTR or RTL) of the flipbook
 * @param isRtl
 * @param nrOfPages
 * @param pageIndex
 */
/* harmony default export */ var getPageNumber = (function (isRtl, nrOfPages, pageIndex) {
  return isRtl ? nrOfPages + 1 - pageIndex : pageIndex;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getLeadFormStageIndex.ts



var getLeadFormStageIndex = function getLeadFormStageIndex(_ref) {
  var isRtl = _ref.isRtl,
    orderLength = _ref.orderLength,
    pageIndex = _ref.pageIndex,
    hasAccessToLeadForm = _ref.hasAccessToLeadForm,
    playerLayout = _ref.playerLayout,
    isLeadFormActive = _ref.isLeadFormActive,
    isLeadFormCompleted = _ref.isLeadFormCompleted;
  if (hasAccessToLeadForm && isLeadFormActive && !isLeadFormCompleted) {
    var pageIndexWithOrientation = getPageNumber(isRtl, orderLength, pageIndex);
    return getActiveStageIndex(isRtl ? pageIndexWithOrientation - 2 : pageIndexWithOrientation, orderLength, playerLayout, constants_WidgetLayoutTypes.SINGLE, isRtl);
  }
  return -1;
};
/* harmony default export */ var utils_getLeadFormStageIndex = (getLeadFormStageIndex);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getStageIndexForRtl.ts


/**
 * Calculates the stages length for double page layout
 * @param nrOfPages
 */
var getStagesLengthForDoublePage = function getStagesLengthForDoublePage(nrOfPages) {
  return nrOfPages % 2 === 0 ? nrOfPages / 2 : (nrOfPages - 1) / 2;
};

/**
 * Calculates the stages length for every layout
 * @param playerLayout
 * @param nrOfPages
 */
var getStagesLength = function getStagesLength(playerLayout, nrOfPages) {
  if (playerLayout === constants_WidgetLayoutTypes.SINGLE) {
    return nrOfPages;
  }
  return getStagesLengthForDoublePage(nrOfPages);
};

/**
 * Calculates the stage index for RTL orientation
 * @param currentActiveStageIndex
 * @param playerLayout
 * @param nrOfPages
 */
/* harmony default export */ var getStageIndexForRtl = (function (currentActiveStageIndex, playerLayout, nrOfPages) {
  if (playerLayout === constants_WidgetLayoutTypes.SINGLE) {
    return nrOfPages - 1 - currentActiveStageIndex;
  }
  return getStagesLengthForDoublePage(nrOfPages) - currentActiveStageIndex;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/saveLastPageVisited.ts


/**
 * Saves on local storage the last page visited
 * @param {string} layout
 * @param {number} newStageIndex
 * @param {boolean} isRtl
 * @param {number} lastStageIndex
 * @param {string} flipbookHash
 */

/* harmony default export */ var saveLastPageVisited = (function (layout, newStageIndex, isRtl, lastStageIndex, flipbookHash) {
  try {
    var queryString = window.location.search;
    var urlParams = new URLSearchParams(queryString);

    // For rtl the pages are reversed, so each stage has to be normalized (in Left to right direction)
    var stageIndexWithRightDirection = isRtl ? lastStageIndex - newStageIndex : newStageIndex;
    var newPage = layout === constants_WidgetLayoutTypes.SINGLE ? stageIndexWithRightDirection + 1 : stageIndexWithRightDirection * 2;
    sessionStorage.setItem("".concat(urlParams.get('hash') || flipbookHash, "page"), "".concat(newPage));
  } catch (e) {
    // Nothing
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/isStageBlocked.ts
/**
 * Checks whether lead form or sell are blocking the stages
 * @param {number} stageIndex
 * @param {number} formStageIndex
 * @param {boolean} isFeatureActive
 * @param {boolean} isRtl
 * @return {boolean}
 */

/* harmony default export */ var isStageBlocked = (function (stageIndex, formStageIndex, isFeatureActive, isRtl) {
  if (isFeatureActive && formStageIndex !== -1) {
    return isRtl ? formStageIndex >= stageIndex : formStageIndex <= stageIndex;
  }
  return false;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/ui/leadFormStageIndex.ts



/**
 * Retrieves leadFormStageIndex
 */
var leadFormStageIndexAtom = vanilla_atom(constants_defaultUI.leadFormStageIndex);

/**
 * Sets leadFormStageIndex
 */
leadFormStageIndexAtom.debugLabel = "leadFormStageIndexAtom";
var setLeadFormStageIndexAtom = vanilla_atom(null, function (get, set, newLeadFormStageIndex) {
  if (get(leadFormStageIndexAtom) !== newLeadFormStageIndex) {
    set(leadFormStageIndexAtom, newLeadFormStageIndex);
  }
});
setLeadFormStageIndexAtom.debugLabel = "setLeadFormStageIndexAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ModalProviderContainer/ModalProviderContainer.tsx







var ModalProviderContainer = function ModalProviderContainer(props) {
  var previousActiveStage = (0,react.useRef)(0);
  var previousLeadFormStage = (0,react.useRef)(0);
  var previousIdentifier = (0,react.useRef)('');
  var _useAtom = react_useAtom(leadFormStageIndexAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    leadFormStageIndex = _useAtom2[0];
  // TODO refactor active as atom state
  var _useState = (0,react.useState)(previousIdentifier.current),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    active = _useState2[0],
    setActive = _useState2[1];
  var _useState3 = (0,react.useState)(false),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    disabled = _useState4[0],
    setDisabled = _useState4[1];
  var isActiveMandatoryModal = react_useAtomValue(isActiveMandatoryModalAtom);
  var setActiveMandatoryModal = react_useSetAtom(setActiveMandatoryModalAtom);

  /**
   * Middleware - handle lead form exceptions
   * @param {string} formId
   */
  var _setOpen = function setOpen(formId) {
    switch (formId) {
      // TODO: move logic to its provider
      case LEAD_FORM_COMPLETED:
        {
          setActive('');
          props.completeLeadForm();
          break;
        }
      case LEAD_FORM_ID:
        {
          props.goToPreviousStage();
          break;
        }
      case '':
        {
          if (props.activeStageIndex === leadFormStageIndex) {
            _setOpen(LEAD_FORM_ID);
          } else if (isActiveMandatoryModal) {
            setActiveMandatoryModal(false);
          } else {
            setActive('');
          }
          break;
        }
      default:
        setActive(formId);
    }
    props.setModalOpen(formId !== '');
  };
  (0,react.useEffect)(function () {
    previousIdentifier.current = active;
    var onClose = function onClose() {
      _setOpen(previousIdentifier.current);
      props.setModalOpen(false);
    };
    if (active) {
      var _props$playerRef;
      // TODO do not add this event listener directly on the player ref. Move this logic in the modal component.
      (_props$playerRef = props.playerRef) === null || _props$playerRef === void 0 || _props$playerRef.addEventListener('mousedown', onClose);
    }
    return function () {
      var _props$playerRef2;
      (_props$playerRef2 = props.playerRef) === null || _props$playerRef2 === void 0 || _props$playerRef2.removeEventListener('mousedown', onClose);
    };
  }, [active, props.activeStageIndex]);
  (0,react.useEffect)(function () {
    previousActiveStage.current = props.activeStageIndex;
    previousLeadFormStage.current = leadFormStageIndex;
    if (props.activeStageIndex === leadFormStageIndex) {
      setActive(LEAD_FORM_ID);
    } else if (isActiveMandatoryModal) {
      setActive(MANDATORY_MODAL_ID);
    } else {
      setActive('');
    }
  }, [props.activeStageIndex, leadFormStageIndex, isActiveMandatoryModal]);
  return /*#__PURE__*/react.createElement(ModalProvider, {
    value: {
      setOpen: _setOpen,
      active: active,
      setDisabled: setDisabled,
      disabled: disabled
    }
  }, props.children);
};
/* harmony default export */ var ModalProviderContainer_ModalProviderContainer = (ModalProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ModalProviderContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ActiveStageIndexProvider/hooks/useChanges.ts




/**
 * Handles some changes of the active stage or page
 * Some of these changes are triggered only from customize for example: RTL, sell
 *
 * @param {number} settledStageIndex
 * @param {string} playerLayout
 * @param {number} orderLength
 * @param {boolean} isRtl
 * @param {number} requestedIndex
 * @param {number} startPage
 * @param {number} currentSellPreviewStage
 * @return {any}
 */
var useChanges = function useChanges(_ref) {
  var settledStageIndex = _ref.settledStageIndex,
    playerLayout = _ref.playerLayout,
    orderLength = _ref.orderLength,
    isRtl = _ref.isRtl,
    requestedIndex = _ref.requestedIndex,
    startPage = _ref.startPage;
  // It is recommended by react to use prevStates like this to avoid using useEffect for state updates
  var _useState = (0,react.useState)(0),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    prevRequestedIndex = _useState2[0],
    setPrevRequestedIndex = _useState2[1];
  var _useState3 = (0,react.useState)(false),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    prevIsRtl = _useState4[0],
    setPrevIsRtl = _useState4[1];
  var _useState5 = (0,react.useState)(0),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    prevStartPage = _useState6[0],
    setPrevStartPage = _useState6[1];
  var hasChanges = false;
  var activeStageAfterChanges = {
    stageIndex: 0,
    pageIndex: 0,
    wasUserAction: false
  };

  // The requestedIndex represents a trigger property that once changed, initiate the evaluation of the next page,
  // then the settled property is changed and will affect the player page flip effect
  if (requestedIndex !== prevRequestedIndex) {
    activeStageAfterChanges = {
      stageIndex: requestedIndex,
      pageIndex: 0,
      wasUserAction: true
    };
    hasChanges = true;
  }
  if (isRtl !== prevIsRtl) {
    activeStageAfterChanges = {
      stageIndex: getStageIndexForRtl(settledStageIndex, playerLayout, orderLength),
      pageIndex: 0,
      wasUserAction: false
    };
    hasChanges = true;
  }
  if (startPage && startPage !== prevStartPage) {
    activeStageAfterChanges = {
      stageIndex: 0,
      pageIndex: getPageNumber(isRtl, orderLength, startPage),
      wasUserAction: false
    };
    hasChanges = true;
  }
  if (hasChanges) {
    setPrevRequestedIndex(requestedIndex);
    setPrevIsRtl(isRtl);
    setPrevStartPage(startPage);
  }
  return (0,react.useMemo)(function () {
    return activeStageAfterChanges;
  }, [startPage, requestedIndex, isRtl]);
};
/* harmony default export */ var hooks_useChanges = (useChanges);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useLayout.ts


/* harmony default export */ var useLayout = (function () {
  return react_useAtomValue(getLayoutAtom);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ActiveStageIndexProvider/ActiveStageIndexProvider.tsx

/* eslint-disable no-param-reassign */
























var ActiveStageIndexProvider = function ActiveStageIndexProvider(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    effect = _useContext.options.content.effect;
  var previousActiveStageIndex = (0,react.useRef)(0);
  var playerLayout = useLayout();
  var previousPlayerLayout = (0,react.useRef)(playerLayout);
  var setIndexAndUserAction = react_useSetAtom(activeStageIndexAndUserActionAtom);
  var setLeadFormStageIndex = react_useSetAtom(setLeadFormStageIndexAtom);
  var setZoomForComponents = react_useSetAtom(setZoomForComponentsAtom);
  var _useAtom = react_useAtom(generalStageIndexAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    requestedIndex = _useAtom2[0].activeStageIndex,
    setNavigation = _useAtom2[1];
  var _useAtom3 = react_useAtom(getSettledActiveStageIndexAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    settledStageIndex = _useAtom4[0];
  var _useAtom5 = react_useAtom(panelAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    panel = _useAtom6[0];
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    modalOpen = _useState2[0],
    setModalOpen = _useState2[1];
  var _useState3 = (0,react.useState)(js_cookie_default().get("".concat(LEAD_FORM_ID, "-").concat(props.hash)) === 'true'),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    isLeadFormCompleted = _useState4[0],
    setIsLeadFormCompleted = _useState4[1];
  var leadFormStageIndex = utils_getLeadFormStageIndex({
    isRtl: props.isRtl,
    orderLength: props.orderLength,
    pageIndex: props.leadForm.pageIndex,
    hasAccessToLeadForm: props.hasAccessToForm,
    playerLayout: playerLayout,
    isLeadFormActive: props.leadForm.active,
    isLeadFormCompleted: isLeadFormCompleted
  });
  var leadFormPageIndex = props.leadForm.pageIndex;
  var indexOfFirstMandatoryAction = useFirstMandatoryStageIndex();
  var setActiveMandatoryModal = react_useSetAtom(setActiveMandatoryModalAtom);
  var changeActiveStageIndex = function changeActiveStageIndex(_ref) {
    var _ref$stageIndex = _ref.stageIndex,
      stageIndex = _ref$stageIndex === void 0 ? null : _ref$stageIndex,
      _ref$pageIndex = _ref.pageIndex,
      pageIndex = _ref$pageIndex === void 0 ? null : _ref$pageIndex,
      _ref$callback = _ref.callback,
      callback = _ref$callback === void 0 ? null : _ref$callback,
      _ref$wasUserAction = _ref.wasUserAction,
      wasUserAction = _ref$wasUserAction === void 0 ? true : _ref$wasUserAction;
    var newStageIndex = pageIndex ? getActiveStageIndex(pageIndex - 1, props.orderLength, playerLayout, constants_WidgetLayoutTypes.SINGLE, props.isRtl) : getActiveStageIndex(stageIndex, props.orderLength, playerLayout, previousPlayerLayout.current, props.isRtl);

    // Lead form middleware
    if (!isLeadFormCompleted && isStageBlocked(newStageIndex, leadFormStageIndex, props.hasAccessToForm, props.isRtl) && !(props.isRtl && playerLayout === constants_WidgetLayoutTypes.DOUBLE && previousPlayerLayout.current === constants_WidgetLayoutTypes.SINGLE) && (!props.isRtl && leadFormStageIndex < newStageIndex || props.isRtl && leadFormStageIndex > newStageIndex)) {
      newStageIndex = leadFormStageIndex;
    }

    // If there is a stage for mandatory action in the way, set that as the new stage
    if (indexOfFirstMandatoryAction !== null && (!props.isRtl && indexOfFirstMandatoryAction < newStageIndex || props.isRtl && indexOfFirstMandatoryAction > newStageIndex)) {
      newStageIndex = indexOfFirstMandatoryAction;
      setActiveMandatoryModal(true);
    }
    if (previousActiveStageIndex.current !== newStageIndex || previousPlayerLayout.current !== playerLayout) {
      previousPlayerLayout.current = playerLayout;
      previousActiveStageIndex.current = newStageIndex;
      setIndexAndUserAction({
        settledStageIndex: newStageIndex,
        isUserAction: wasUserAction
      });

      // Make sure that the trigger property is synced
      if (requestedIndex !== newStageIndex) {
        setNavigation({
          activeStageIndex: newStageIndex
        });
      }
      var lastStageIndex = playerLayout === constants_WidgetLayoutTypes.DOUBLE ? Math.floor(props.orderLength / 2) : props.orderLength - 1;
      saveLastPageVisited(playerLayout, newStageIndex, props.isRtl, lastStageIndex, props.hash);
      // When flipbook has scroll effect set, we will not reset zoom when activeStageIndex change
      if (effect !== playerTypes_PlayerEffect.SCROLL) {
        setZoomForComponents(ZOOM_MIN_VALUE);
      }
    }
    if (typeof callback === 'function') {
      callback();
    }
  };
  var goToPreviousStage = function goToPreviousStage() {
    if (props.isRtl) {
      var stagesLength = getStagesLength(playerLayout, props.orderLength);
      setNavigation({
        activeStageIndex: Math.min(previousActiveStageIndex.current + 1, stagesLength),
        isUserAction: true
      });
    } else {
      setNavigation({
        activeStageIndex: Math.max(0, previousActiveStageIndex.current - 1),
        isUserAction: true
      });
    }
  };
  var completeLeadForm = function completeLeadForm() {
    setLeadFormStageIndex(-1);
    setIsLeadFormCompleted(true);
  };
  var _useChanges = hooks_useChanges({
      settledStageIndex: settledStageIndex,
      playerLayout: playerLayout,
      requestedIndex: requestedIndex,
      orderLength: props.orderLength,
      isRtl: props.isRtl,
      startPage: props.startPage
    }),
    stageIndexChanged = _useChanges.stageIndex,
    pageIndexChanged = _useChanges.pageIndex,
    wasUserActionChanged = _useChanges.wasUserAction;
  (0,react.useEffect)(function () {
    setLeadFormStageIndex(leadFormStageIndex);
  }, [leadFormStageIndex, props.leadForm.active, leadFormPageIndex]);
  (0,react.useEffect)(function () {
    changeActiveStageIndex({
      stageIndex: stageIndexChanged,
      pageIndex: pageIndexChanged,
      wasUserAction: wasUserActionChanged
    });
  }, [stageIndexChanged, pageIndexChanged, wasUserActionChanged]);

  // On playerLayout change
  (0,react.useEffect)(function () {
    // Prevent setLayout on mobile, when keyboard is open (input is focused)
    if (main/* isMobile */.Fr && isEditableHtmlElement()) {
      return;
    }
    if (previousPlayerLayout.current !== playerLayout) {
      changeActiveStageIndex({
        stageIndex: settledStageIndex,
        wasUserAction: false
      });
    }
    dispatchResizeEvent();
  }, [playerLayout, modalOpen, panel]);
  var setActiveIndex = function setActiveIndex(activeIndexStage, pageIndex, callback) {
    changeActiveStageIndex({
      stageIndex: activeIndexStage,
      pageIndex: pageIndex,
      callback: callback
    });
  };
  var contextValue = (0,react.useMemo)(function () {
    return {
      setActiveStageIndex: setActiveIndex
    };
  }, [setActiveIndex]);
  return /*#__PURE__*/react.createElement(contexts_ActiveStageIndexContext.Provider, {
    value: contextValue
  }, /*#__PURE__*/react.createElement(ModalProviderContainer_ModalProviderContainer, {
    activeStageIndex: settledStageIndex,
    goToPreviousStage: goToPreviousStage,
    completeLeadForm: completeLeadForm,
    playerRef: props.playerRef,
    setModalOpen: setModalOpen
  }, props.children));
};
/* harmony default export */ var ActiveStageIndexProvider_ActiveStageIndexProvider = (ActiveStageIndexProvider);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ActiveStageIndexProvider/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ZoomProviderContainer/ZoomProviderContainer.tsx







var ZoomProviderContainer = function ZoomProviderContainer(props) {
  var _useState = (0,react.useState)(ZOOM_MIN_VALUE),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    zoom = _useState2[0],
    setZoom = _useState2[1];
  var previousZoom = (0,react.useRef)(ZOOM_MIN_VALUE);
  var _useContext = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext.sendGAEvent;
  (0,react.useEffect)(function () {
    // Send GA event when zoom changes value, by button actions, +/-, slider
    if (zoom !== previousZoom.current) {
      sendGAEvent(GAEvents.ZOOM);
    }
    previousZoom.current = zoom;
  }, [zoom]);
  return /*#__PURE__*/react.createElement(ZoomProvider, {
    value: {
      zoom: zoom,
      setZoom: setZoom,
      previousZoom: previousZoom.current
    }
  }, props.children);
};
ZoomProviderContainer.propTypes = {
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var ZoomProviderContainer_ZoomProviderContainer = (ZoomProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ZoomProviderContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/MouseOverPlayerProvider/MouseOverPlayerProvider.styles.ts

var MouseOverPlayerListener = styled_components_browser_esm.div.withConfig({
  displayName: "MouseOverPlayerProviderstyles__MouseOverPlayerListener",
  componentId: "sc-b5b4dm-0"
})(["width:100%;height:100%;position:relative;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/MouseOverPlayerProvider/MouseOverPlayerProvider.tsx





var MouseOverPlayerProvider = function MouseOverPlayerProvider(props) {
  var ref = (0,react.useRef)(null);
  var _useAtom = react_useAtom(setMouseOverPlayerAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    isMouseOverPlayer = _useAtom2[0],
    setIsMouseOverPlayer = _useAtom2[1];
  var isMouseOver = (0,react.useRef)(false);
  var onMouseEnter = function onMouseEnter() {
    setIsMouseOverPlayer(true);
    isMouseOver.current = true;
  };
  var onMouseLeave = function onMouseLeave() {
    setIsMouseOverPlayer(false);
    isMouseOver.current = false;
  };

  /**
   * The useEffect hook is used here to reset the isMouseOverPlayer atom variable when the component loses focus.
   * This is relevant in app customize. When the user interacts
   * with modals or dropdowns, the component may lose focus, necessitating a reset of the isMouseOver atom to
   * ensure consistent behavior.
   */
  (0,react.useEffect)(function () {
    var mouseOverPlayer = ref.current;
    var onMouseDown = function onMouseDown() {
      setIsMouseOverPlayer(true);
      isMouseOver.current = true;
    };
    if (mouseOverPlayer) {
      mouseOverPlayer.addEventListener('mousedown', onMouseDown, {
        once: true
      });
    }
    return function () {
      if (mouseOverPlayer) {
        mouseOverPlayer.removeEventListener('mousedown', onMouseDown);
      }
    };
  }, [isMouseOverPlayer]);
  return /*#__PURE__*/react.createElement(MouseOverPlayerListener, {
    ref: ref,
    onMouseLeave: onMouseLeave,
    onMouseEnter: onMouseEnter
  }, props.children);
};
/* harmony default export */ var MouseOverPlayerProvider_MouseOverPlayerProvider = (MouseOverPlayerProvider);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/MouseOverPlayerProvider/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useResize.ts




/**
 * Custom hook for resize event
 * @param elementRef
 * @return Object
 */
/* harmony default export */ var hooks_useResize = (function (elementRef) {
  var _useState = (0,react.useState)({
      width: 0,
      height: 0
    }),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    size = _useState2[0],
    setSize = _useState2[1];
  var handleResize = function handleResize() {
    if (elementRef !== null && elementRef !== void 0 && elementRef.current) {
      var _elementRef$current, _elementRef$current2;
      setSize({
        width: ((_elementRef$current = elementRef.current) === null || _elementRef$current === void 0 ? void 0 : _elementRef$current.offsetWidth) || 0,
        height: ((_elementRef$current2 = elementRef.current) === null || _elementRef$current2 === void 0 ? void 0 : _elementRef$current2.offsetHeight) || 0
      });
    }
  };
  var debounceResizeRef = (0,react.useRef)((0,lodash.debounce)(handleResize, constants_WAIT_USER_INTERACTION_MS, {
    leading: true
  }));
  (0,react.useEffect)(function () {
    window.addEventListener('resize', debounceResizeRef.current);
    return function () {
      window.removeEventListener('resize', debounceResizeRef.current);
    };
  }, []);
  return size;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useCookiePolicyAcceptance.ts






/**
 * Custom hook that checks if the cookie policy has been accepted.
 * It listens for messages from the parent window (when inside an iframe) and updates the state accordingly.
 *
 * @returns {boolean} - `true` if the cookie policy is accepted.
 */
var useCookiePolicyAcceptance = function useCookiePolicyAcceptance() {
  var hasCookiePolicy = document.cookie ? !!js_cookie_default().get('agree_cookie_policy_v') : true;
  var _useState = (0,react.useState)(hasCookiePolicy),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    isCookiePolicyAccepted = _useState2[0],
    setIsCookiePolicyAccepted = _useState2[1];
  (0,react.useEffect)(function () {
    // Handles messages from the parent window, updating the cookie policy state if valid.
    if (utils_isInIframe() && !isCookiePolicyAccepted) {
      var handleMessage = function handleMessage(event) {
        var _event$data;
        if (isOnFlipsnackDomain(event.origin) && ((_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.type) === 'agreeCookiePolicy') {
          setIsCookiePolicyAccepted(true);
        }
      };
      window.addEventListener('message', handleMessage);
      return function () {
        window.removeEventListener('message', handleMessage);
      };
    }
    return function () {};
  }, []);
  return isCookiePolicyAccepted;
};
/* harmony default export */ var hooks_useCookiePolicyAcceptance = (useCookiePolicyAcceptance);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useTrapFocus.ts



var TabDirection = /*#__PURE__*/function (TabDirection) {
  TabDirection[TabDirection["Left"] = -1] = "Left";
  TabDirection[TabDirection["None"] = 0] = "None";
  TabDirection[TabDirection["Right"] = 1] = "Right";
  return TabDirection;
}(TabDirection || {});
var focusableElements = ['[tabindex]:not([tabindex="-1"])',
// Focusable elements
'.image-gallery-bullet' // Slideshow element
];

/**
 * Calculates and returns the appropriate element to be focused based on a direction. ex: 'TAB', 'TAB+SHIFT'
 */
var _getAvailableElement = function getAvailableElement(model, activeElement) {
  var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : TabDirection.Right;
  if (model.elements.length === 0) {
    return document.activeElement;
  }
  var index = model.elements.indexOf(activeElement);
  var nextElement = model.elements[index + direction];
  if (direction === TabDirection.Right) {
    if (nextElement) {
      if (!nextElement.disabled) {
        return nextElement;
      }
      return _getAvailableElement(model, nextElement, TabDirection.Right);
    }
    if (model.firstElement && !model.firstElement.disabled) {
      return model.firstElement;
    }
    return _getAvailableElement(model, model.firstElement, TabDirection.Right);
  }
  if (nextElement) {
    if (!nextElement.disabled) {
      return nextElement;
    }
    return _getAvailableElement(model, nextElement, TabDirection.Left);
  }
  if (model.lastElement && !model.lastElement.disabled) {
    return model.lastElement;
  }
  return _getAvailableElement(model, model.lastElement, TabDirection.Left);
};

/**
 * A custom hook that prevents tab navigation outside the provided element.
 */
/* harmony default export */ var useTrapFocus = (function (containerRef) {
  var dependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  var elementAlwaysOnFocusId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  var isCookiePolicyAccepted = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
  var activeElement = (0,react.useMemo)(function () {
    return document.activeElement;
  }, []);
  (0,react.useEffect)(function () {
    var tempRef = containerRef.current;
    var elements = tempRef ? Array.from(tempRef.querySelectorAll(focusableElements.join(', '))) : [];

    // In case useTrapFocus hase been used multiple times,
    // We need to make sure to focus the last active element after unmounting.
    // Ex: The accessibility panel was opened then the leadForm Modal was opened. After closing the leadForm the
    // accessibility panel should get in focus on the last element before opening leadForm

    var model = {
      elements: elements,
      firstElement: elements[0],
      lastElement: elements[elements.length - 1]
    };

    // I need this verification to prevent the player modal from stealing focus from the cookie modal.
    if (isCookiePolicyAccepted) {
      if (elementAlwaysOnFocusId) {
        var elementOnFocus = elements.find(function (element) {
          return element.id === elementAlwaysOnFocusId;
        });
        if (elementOnFocus) {
          elementOnFocus.focus();
        }
      } else if (!isEditableHtmlElement()) {
        _getAvailableElement(model, model.firstElement, TabDirection.None).focus();
      }
    }
    var trapFocus = function trapFocus(event) {
      var direction = TabDirection.Right;
      if (event.code === TAB_KEY) {
        event.preventDefault();
        if (event.shiftKey) {
          direction = TabDirection.Left;
        }
        _getAvailableElement(model, document.activeElement, direction).focus();
      }
    };
    tempRef === null || tempRef === void 0 || tempRef.addEventListener('keydown', trapFocus);
    return function () {
      tempRef === null || tempRef === void 0 || tempRef.removeEventListener('keydown', trapFocus);
    };
  }, dependencies);

  // Cleanup function
  // Focus the last active element before unmounting - ex: close a modal and focus the button that opened it
  (0,react.useEffect)(function () {
    return function () {
      activeElement === null || activeElement === void 0 || activeElement.focus();
    };
  }, [activeElement]);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/Modal/ModalStyles.ts

var ModalContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ModalStyles__ModalContainer",
  componentId: "sc-1z1ah7-0"
})(["display:flex;justify-content:center;align-items:center;width:100%;height:100%;position:absolute;z-index:1000;top:0;left:0;cursor:auto;", " box-sizing:border-box;background-color:", ";animation-name:blurEffect;animation-duration:.6s;animation-fill-mode:forwards;@keyframes blurEffect{0%{backdrop-filter:blur(0px);}100%{backdrop-filter:blur( ", "px);}};", ";"], function (_ref) {
  var theme = _ref.theme,
    $stageWidth = _ref.$stageWidth,
    isPasswordProtected = _ref.isPasswordProtected;
  if (!isPasswordProtected) {
    if ($stageWidth <= theme.deviceSize.mobileM) {
      return "padding: ".concat(theme.modal.marginTop, "px 0 0 0;");
    }
    return "\n            padding-top: ".concat(theme.modal.marginTop, "px;\n            padding-right: ").concat(theme.modal.marginRight, "px;\n            padding-bottom: ").concat(theme.modal.marginBottom, "px;\n            padding-left: ").concat(theme.modal.marginLeft, "px;\n        ");
  }
  return '';
}, function (_ref2) {
  var theme = _ref2.theme,
    hasBlackBackground = _ref2.hasBlackBackground;
  return hasBlackBackground ? theme.modal.blackBackground : theme.modal.backgroundColor;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.modal.backdropFilter;
}, function (props) {
  return props.$closed && "\n        animation-name: clearEffect;\n        animation-duration: .6s;\n        animation-fill-mode: forwards;\n\n        @keyframes clearEffect {\n            from {opacity:1; backdrop-filter: blur( ".concat(function (_ref4) {
    var theme = _ref4.theme;
    return theme.modal.backdropFilter;
  }, "px);}\n            to {opacity:0; backdrop-filter: blur( 0px);}\n        };\n    ");
});
var ModalStyles_Modal = styled_components_browser_esm.div.withConfig({
  displayName: "ModalStyles__Modal",
  componentId: "sc-1z1ah7-1"
})(["width:", ";height:", ";max-height:100%;max-width:100%;position:relative;border-radius:", "px;background-color:", ";pointer-events:all;", " animation-name:slideDownEffect;animation-duration:.3s;animation-timing-function:linear;@keyframes slideDownEffect{from{opacity:0;transform:translateY(-5%);}to{opacity:1;transform:translateY(0);}};", ""], function (props) {
  return props.$width;
}, function (props) {
  return props.$height ? props.$height : 'auto';
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.modal.radius;
}, function (_ref6) {
  var theme = _ref6.theme,
    $opacity = _ref6.$opacity;
  return $opacity === 1 ? theme.colors.white : "rgba(0, 0, 0, ".concat($opacity, ")");
}, function (_ref7) {
  var $loading = _ref7.$loading,
    $width = _ref7.$width,
    $defaultWidth = _ref7.$defaultWidth,
    $defaultHeight = _ref7.$defaultHeight,
    $height = _ref7.$height;
  return !$loading ? "\n        animation: transformer .3s linear;\n\n        @keyframes transformer {\n            from {\n                transform: scale(".concat($defaultWidth / Number($width.split('px')[0]), ",\n                ").concat($defaultHeight / Number(($height || '0px').split('px')[0]), ");\n                opacity: 0;\n            }\n            to {\n                transform: scale(1);\n                opacity: 1;\n            }\n        }\n    ") : '';
}, function (props) {
  return props.$closed ? "\n        animation-name: slideUpEffect;\n        animation-duration: .3s;\n        animation-timing-function: linear;\n\n        @keyframes slideUpEffect {\n            0% {opacity:1; transform: translateY(0);}\n            100% {opacity:0; transform: translateY(-5%);}\n        }\n    " : '';
});
var LoaderContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ModalStyles__LoaderContainer",
  componentId: "sc-1z1ah7-2"
})(["display:flex;height:100%;"]);
var CloseButton = styled_components_browser_esm.button.attrs({
  'aria-label': 'Close'
}).withConfig({
  displayName: "ModalStyles__CloseButton",
  componentId: "sc-1z1ah7-3"
})(["border:none;position:absolute;top:-", "px;right:0;z-index:1;background-color:", ";width:", "px;height:", "px;cursor:pointer;border-radius:50%;display:flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent;"], function (_ref8) {
  var theme = _ref8.theme;
  return theme.button.close.height + theme.button.close.spacing;
}, function (_ref9) {
  var theme = _ref9.theme;
  return theme.colors.white;
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.button.close.width;
}, function (_ref11) {
  var theme = _ref11.theme;
  return theme.button.close.height;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Typography/TypographyStyles.tsx


/*
TODO: check if ok to use this style as default
`
    white-space: pre-wrap;
    word-break: break-word;
`
 */

var H1 = styled_components_browser_esm.h1.withConfig({
  displayName: "TypographyStyles__H1",
  componentId: "sc-1ezh3bw-0"
})(["font-family:", ";font-size:", "px;font-weight:", ";line-height:", "px;margin:0;"], function (_ref) {
  var theme = _ref.theme;
  return theme.typography.family.sans;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.typography.size.h1;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.typography.weight.bold;
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.typography.lineHeight.h1;
});
var H2 = styled_components_browser_esm.h2.withConfig({
  displayName: "TypographyStyles__H2",
  componentId: "sc-1ezh3bw-1"
})(["font-family:", ";font-size:", "px;font-weight:", ";line-height:", "px;margin:0;"], function (_ref5) {
  var theme = _ref5.theme;
  return theme.typography.family.sans;
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.typography.size.h2;
}, function (_ref7) {
  var theme = _ref7.theme;
  return theme.typography.weight.bold;
}, function (_ref8) {
  var theme = _ref8.theme;
  return theme.typography.lineHeight.h2;
});
var H3 = styled_components_browser_esm.h3.withConfig({
  displayName: "TypographyStyles__H3",
  componentId: "sc-1ezh3bw-2"
})(["font-family:", ";font-size:", "px;font-weight:", ";line-height:", "px;margin:0;"], function (_ref9) {
  var theme = _ref9.theme;
  return theme.typography.family.sans;
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.typography.size.h3;
}, function (_ref11) {
  var theme = _ref11.theme;
  return theme.typography.weight.bold;
}, function (_ref12) {
  var theme = _ref12.theme;
  return theme.typography.lineHeight.h3;
});
var H4 = styled_components_browser_esm.h4.withConfig({
  displayName: "TypographyStyles__H4",
  componentId: "sc-1ezh3bw-3"
})(["font-family:", ";font-size:", "px;font-weight:", ";line-height:", "px;margin:0;"], function (_ref13) {
  var theme = _ref13.theme;
  return theme.typography.family.sans;
}, function (_ref14) {
  var theme = _ref14.theme;
  return theme.typography.size.h4;
}, function (_ref15) {
  var theme = _ref15.theme;
  return theme.typography.weight.bold;
}, function (_ref16) {
  var theme = _ref16.theme;
  return theme.typography.lineHeight.h4;
});
var H5 = styled_components_browser_esm.h5.withConfig({
  displayName: "TypographyStyles__H5",
  componentId: "sc-1ezh3bw-4"
})(["font-family:", ";font-size:", "px;font-weight:", ";line-height:", "px;margin:0;"], function (_ref17) {
  var theme = _ref17.theme;
  return theme.typography.family.sans;
}, function (_ref18) {
  var theme = _ref18.theme;
  return theme.typography.size.h5;
}, function (_ref19) {
  var theme = _ref19.theme;
  return theme.typography.weight.bold;
}, function (_ref20) {
  var theme = _ref20.theme;
  return theme.typography.lineHeight.h5;
});
var Paragraph = styled_components_browser_esm.p.withConfig({
  displayName: "TypographyStyles__Paragraph",
  componentId: "sc-1ezh3bw-5"
})(["font-family:", ";font-size:", "px;line-height:", "px;margin:0;word-break:break-word;white-space:pre-wrap;"], function (_ref21) {
  var theme = _ref21.theme;
  return theme.typography.family.sans;
}, function (_ref22) {
  var theme = _ref22.theme;
  return theme.typography.size.paragraph;
}, function (_ref23) {
  var theme = _ref23.theme;
  return theme.typography.lineHeight.paragraph;
});
var SmallerParagraph = styled_components_browser_esm.p.withConfig({
  displayName: "TypographyStyles__SmallerParagraph",
  componentId: "sc-1ezh3bw-6"
})(["font-family:", ";font-size:", "px;line-height:", "px;margin:0;"], function (_ref24) {
  var theme = _ref24.theme;
  return theme.typography.family.sans;
}, function (_ref25) {
  var theme = _ref25.theme;
  return theme.typography.size.smallerParagraph;
}, function (_ref26) {
  var theme = _ref26.theme;
  return theme.typography.lineHeight.smallerParagraph;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/Modal/ModalContent/ModalContentStyles.ts



var ModalContentStyles_ModalContent = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__ModalContent",
  componentId: "sc-xnb235-0"
})(["display:block;width:", ";height:", ";z-index:1001;cursor:auto;max-height:100%;max-width:100%;overflow-y:hidden;text-align:initial;position:relative;"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
});
var ModalContentContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__ModalContentContainer",
  componentId: "sc-xnb235-1"
})(["width:", ";height:", ";max-height:", "px;overflow-y:auto;", ";-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (props) {
  return props.$stageHeight - props.theme.modal.marginTop - props.theme.modal.marginBottom;
}, function (_ref) {
  var theme = _ref.theme,
    $stageWidth = _ref.$stageWidth,
    $stageHeight = _ref.$stageHeight,
    $modalWithoutPadding = _ref.$modalWithoutPadding;
  if ($modalWithoutPadding) {
    return '';
  }
  if ($stageWidth < theme.deviceSize.tabletS || $stageHeight < theme.deviceSize.tabletS) {
    return "padding: ".concat(theme.modal.mobilePadding, "px");
  }
  return "padding: ".concat(theme.modal.padding, "px");
});
var InputContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__InputContainer",
  componentId: "sc-xnb235-2"
})(["display:flex;flex-direction:column;position:relative;"]);
var FormContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__FormContainer",
  componentId: "sc-xnb235-3"
})(["display:flex;flex-direction:column;gap:8px;"]);
var InputContent = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__InputContent",
  componentId: "sc-xnb235-4"
})(["align-items:center;"]);
var SpanErrorMessage = styled_components_browser_esm.span.withConfig({
  displayName: "ModalContentStyles__SpanErrorMessage",
  componentId: "sc-xnb235-5"
})(["display:block;color:", ";float:right;padding-top:8px;"], function (_ref2) {
  var theme = _ref2.theme;
  return theme.colors.danger;
});
var ModalContentStyles_Input = styled_components_browser_esm.input.withConfig({
  displayName: "ModalContentStyles__Input",
  componentId: "sc-xnb235-6"
})(["border:", ";color:", ";width:100%;margin-right:10px;border-radius:", "px;height:", "px;padding:", ";margin-top:4px;font-size:", "px;flex-basis:65%;:focus{border:", ";outline:0;}::placeholder{color:", ";}:disabled{background-color:", ";color:", ";}"], function (_ref3) {
  var theme = _ref3.theme,
    isContentValid = _ref3.isContentValid;
  return "\n        1px solid ".concat(isContentValid ? theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.2) : theme.colors.danger, "\n    ");
}, function (_ref4) {
  var theme = _ref4.theme,
    isContentValid = _ref4.isContentValid;
  return "".concat(isContentValid ? 'inherit' : theme.colors.danger);
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.defaults.borderRadius;
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.input.height;
}, function (_ref7) {
  var theme = _ref7.theme;
  return "".concat(theme.leadForm.paddingX, "px ").concat(theme.leadForm.paddingY, "px");
}, function (_ref8) {
  var theme = _ref8.theme;
  return theme.typography.size.smallerParagraph;
}, function (_ref9) {
  var theme = _ref9.theme,
    isContentValid = _ref9.isContentValid;
  return "\n            1px solid ".concat(isContentValid ? theme.defaultColors.primary : theme.colors.danger, "\n        ");
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.40);
}, function (_ref11) {
  var theme = _ref11.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.04);
}, function (_ref12) {
  var theme = _ref12.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.4);
});
var Textarea = styled_components_browser_esm.textarea.withConfig({
  displayName: "ModalContentStyles__Textarea",
  componentId: "sc-xnb235-7"
})(["border:", ";color:", ";width:100%;margin-right:10px;border-radius:", "px;height:", "px;padding:", ";margin-top:4px;font-size:", "px;flex-basis:65%;rows:4;resize:vertical;font-family:", ";:focus{border:", ";outline:0;}"], function (_ref13) {
  var theme = _ref13.theme,
    isContentValid = _ref13.isContentValid;
  return "\n        1px solid ".concat(isContentValid ? theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.2) : theme.colors.danger, "\n    ");
}, function (_ref14) {
  var theme = _ref14.theme,
    isContentValid = _ref14.isContentValid;
  return "".concat(isContentValid ? 'inherit' : theme.colors.danger);
}, function (_ref15) {
  var theme = _ref15.theme;
  return theme.defaults.borderRadius;
}, function (_ref16) {
  var theme = _ref16.theme;
  return theme.input.height * 2;
}, function (_ref17) {
  var theme = _ref17.theme;
  return "".concat(theme.leadForm.paddingX, "px ").concat(theme.leadForm.paddingY, "px");
}, function (_ref18) {
  var theme = _ref18.theme;
  return theme.typography.size.smallerParagraph;
}, function (_ref19) {
  var theme = _ref19.theme;
  return theme.button.default.fontFamily;
}, function (_ref20) {
  var theme = _ref20.theme;
  return "1px solid ".concat(theme.defaultColors.primary);
});
var ModalContentStyles_Label = styled_components_browser_esm.label.withConfig({
  displayName: "ModalContentStyles__Label",
  componentId: "sc-xnb235-8"
})(["font-weight:500;white-space:normal;", ";", ";float:left;", ";"], function (_ref21) {
  var withoutMarginTop = _ref21.withoutMarginTop;
  return withoutMarginTop ? '' : 'margin-top: 8px';
}, function (_ref22) {
  var withMarginBottom = _ref22.withMarginBottom;
  return withMarginBottom ? 'margin-bottom: 5px' : '';
}, function (_ref23) {
  var required = _ref23.required;
  return required ? "\n        &:after {\n            content: \" *\";\n            color:  ".concat(function (_ref24) {
    var theme = _ref24.theme;
    return theme.colors.danger;
  }, ";\n    }") : '';
});
var HelperTextInput = styled_components_browser_esm(SmallerParagraph).withConfig({
  displayName: "ModalContentStyles__HelperTextInput",
  componentId: "sc-xnb235-9"
})(["margin-top:4px;display:flex;justify-content:space-between;"]);
var TextError = styled_components_browser_esm.span.withConfig({
  displayName: "ModalContentStyles__TextError",
  componentId: "sc-xnb235-10"
})(["color:", ";"], function (_ref25) {
  var theme = _ref25.theme;
  return theme.colors.danger;
});
var TextCharacterLimit = styled_components_browser_esm.span.withConfig({
  displayName: "ModalContentStyles__TextCharacterLimit",
  componentId: "sc-xnb235-11"
})(["color:", ";"], function (_ref26) {
  var theme = _ref26.theme;
  return theme.colors.disabled;
});
var Required = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__Required",
  componentId: "sc-xnb235-12"
})(["font-weight:500;margin-top:8px;"]);
var CollectDataContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__CollectDataContainer",
  componentId: "sc-xnb235-13"
})(["display:flex;flex-direction:column;gap:16px;margin:24px 0 0 0;", ";"], function (_ref27) {
  var hasLateralMarings = _ref27.hasLateralMarings;
  return hasLateralMarings ? 'margin: 24px 24px 0 24px;' : 'margin-top: 24px';
});
var ModalContentStyles_GDPRAgreement = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__GDPRAgreement",
  componentId: "sc-xnb235-14"
})(["font-size:12px;align-items:center;display:flex;>input{margin:0 4px 3px 3px;accent-color:", ";}"], function (_ref28) {
  var theme = _ref28.theme;
  return theme.colors.primary;
});
var AgreementContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__AgreementContainer",
  componentId: "sc-xnb235-15"
})(["display:flex;flex-direction:column;gap:16px;padding:0 8px;"]);
var PrivacyPolicy = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__PrivacyPolicy",
  componentId: "sc-xnb235-16"
})(["font-size:12px;align-items:center;display:flex;>input{margin:0 4px 3px 3px;accent-color:", ";}"], function (_ref29) {
  var theme = _ref29.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
});
var PrivacyPolicyInput = styled_components_browser_esm.input.withConfig({
  displayName: "ModalContentStyles__PrivacyPolicyInput",
  componentId: "sc-xnb235-17"
})(["accent-color:", ";"], function (_ref30) {
  var theme = _ref30.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
});
var GDPRInput = styled_components_browser_esm.input.withConfig({
  displayName: "ModalContentStyles__GDPRInput",
  componentId: "sc-xnb235-18"
})(["accent-color:", ";"], function (_ref31) {
  var theme = _ref31.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
});
var PrivacyPolicyLink = styled_components_browser_esm.a.withConfig({
  displayName: "ModalContentStyles__PrivacyPolicyLink",
  componentId: "sc-xnb235-19"
})(["color:", ";text-decoration:none;&:hover{opacity:", ";}"], function (_ref32) {
  var theme = _ref32.theme;
  return theme.colors.getLinkColor(theme.colors.primary);
}, function (_ref33) {
  var theme = _ref33.theme;
  return theme.link.hoverOpacity;
});
var ModalContentStyles_Divider = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__Divider",
  componentId: "sc-xnb235-20"
})(["border-top:1px solid ", ";"], function (_ref34) {
  var theme = _ref34.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.12);
});
var ModalContentStyles_Button = styled_components_browser_esm.button.withConfig({
  displayName: "ModalContentStyles__Button",
  componentId: "sc-xnb235-21"
})(["border:none;margin-top:16px;cursor:pointer;text-align:center;font-family:", ";padding:", "px;font-size:", "px;font-weight:", ";border-radius:", "px;background-color:", ";min-width:", "px;overflow:hidden;text-overflow:ellipsis;"], function (_ref35) {
  var theme = _ref35.theme;
  return theme.button.default.fontFamily;
}, function (_ref36) {
  var theme = _ref36.theme;
  return theme.button.default.padding;
}, function (_ref37) {
  var theme = _ref37.theme;
  return theme.button.default.fontSize;
}, function (_ref38) {
  var theme = _ref38.theme;
  return theme.button.default.fontWeight;
}, function (_ref39) {
  var theme = _ref39.theme;
  return theme.button.default.borderRadius;
}, function (_ref40) {
  var theme = _ref40.theme;
  return theme.colors.black;
}, function (_ref41) {
  var theme = _ref41.theme;
  return "".concat(theme.modal.submitButton.minWidth);
});
var ModalContentStyles_SubmitButton = styled_components_browser_esm(ModalContentStyles_Button).attrs({
  type: 'submit'
}).withConfig({
  displayName: "ModalContentStyles__SubmitButton",
  componentId: "sc-xnb235-22"
})(["border:none;background-color:", ";color:", ";", ""], function (_ref42) {
  var theme = _ref42.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref43) {
  var theme = _ref43.theme;
  return theme.colors.getTextColor(theme.colors.primary);
}, function (_ref44) {
  var disabled = _ref44.disabled,
    theme = _ref44.theme;
  return disabled ? "\n        pointer-events: none;\n        cursor: default;\n        color: ".concat(theme.modal.submitButton.disabledTextColor, ";\n        background: ").concat(theme.modal.submitButton.disabledBackgroundColor, ";\n    ") : '';
});
var SkipButton = styled_components_browser_esm(ModalContentStyles_Button).attrs({
  type: 'button'
}).withConfig({
  displayName: "ModalContentStyles__SkipButton",
  componentId: "sc-xnb235-23"
})(["border:1px solid ", ";background-color:", ";color:", ";height:32px;"], function (_ref45) {
  var theme = _ref45.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref46) {
  var theme = _ref46.theme;
  return theme.colors.white;
}, function (_ref47) {
  var theme = _ref47.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
});
var LeadFormDataContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__LeadFormDataContainer",
  componentId: "sc-xnb235-24"
})(["display:flex;flex-direction:column;"]);
var ButtonsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ModalContentStyles__ButtonsContainer",
  componentId: "sc-xnb235-25"
})(["display:flex;justify-content:flex-end;gap:10px;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/ui/stageSize.ts



/**
 * Retrieves stage size width
 */
var stageSizeWidthAtom = vanilla_atom(constants_defaultUI.stageSize.width);

/**
 * Sets stage size width
 */
stageSizeWidthAtom.debugLabel = "stageSizeWidthAtom";
var setStageSizeWidthAtom = vanilla_atom(null, function (get, set, newStageSizeWidth) {
  if (get(stageSizeWidthAtom) !== newStageSizeWidth) {
    set(stageSizeWidthAtom, newStageSizeWidth);
  }
});

/**
 * Retrieves stage size height
 */
setStageSizeWidthAtom.debugLabel = "setStageSizeWidthAtom";
var stageSizeHeightAtom = vanilla_atom(constants_defaultUI.stageSize.height);

/**
 * Sets stage size height
 */
stageSizeHeightAtom.debugLabel = "stageSizeHeightAtom";
var setStageSizeHeightAtom = vanilla_atom(null, function (get, set, newStageSizeHeight) {
  if (get(stageSizeHeightAtom) !== newStageSizeHeight) {
    set(stageSizeHeightAtom, newStageSizeHeight);
  }
});

/**
 * Retrieves stage size(width & height)
 */
setStageSizeHeightAtom.debugLabel = "setStageSizeHeightAtom";
var stageSizeAtom = vanilla_atom(function (get) {
  return {
    width: get(stageSizeWidthAtom),
    height: get(stageSizeHeightAtom)
  };
});
stageSizeAtom.debugLabel = "stageSizeAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/Modal/ModalContent/ModalContent.tsx





var ModalContent = function ModalContent(props) {
  var modalRef = (0,react.useRef)(null);
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var handleClick = function handleClick(e) {
    e.stopPropagation();
    e.nativeEvent.stopImmediatePropagation();
  };
  return /*#__PURE__*/react.createElement(ModalContentStyles_ModalContent, {
    ref: modalRef,
    onClick: handleClick,
    $width: props.width,
    $height: props.height
  }, /*#__PURE__*/react.createElement(ModalContentContainer, {
    $width: props.width,
    $height: props.height,
    $stageWidth: stageSize.width ? stageSize.width : window.innerWidth,
    $stageHeight: stageSize.height ? stageSize.height : window.innerWidth,
    $modalWithoutPadding: !!props.modalWithoutPadding
  }, props.children));
};
/* harmony default export */ var ModalContent_ModalContent = (ModalContent);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/Modal/ModalContent/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/modal.ts

function modal_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function modal_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? modal_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : modal_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var ANIMATION_EXECUTION_TIME = 300;
var backgroundOpacity = {
  transparent: 0,
  opaque: 1
};
var InteractivityModalStep = {
  DEFAULT: 'default',
  SUCCESSFUL_SEND_RESPONSE: 'successfulSendResponse'
};
var QuizModalStep = modal_objectSpread(modal_objectSpread({}, InteractivityModalStep), {}, {
  START_SCREEN: 'startScreen',
  QUESTION: 'question',
  LOADING: 'loading',
  VIEW_RESULTS: 'viewResults',
  LOADING_RETAKE: 'loadingRetake'
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/setLeadFormCookies.ts



/**
 * This helper makes sure that the cookie for the lead form of a specific flipbook is set to true.
 * @param hash
 */
/* harmony default export */ var setLeadFormCookies = (function (hash) {
  js_cookie_default().set("".concat(LEAD_FORM_ID, "-").concat(hash), 'true', {
    sameSite: 'none',
    secure: true,
    expires: 30 // 30 days
  });
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/Modal/Modal.tsx





















var Modals_Modal_Modal_Modal = function Modal(props) {
  var _useContext = (0,react.useContext)(contexts_ModalContext),
    setOpen = _useContext.setOpen,
    setDisabled = _useContext.setDisabled,
    disabled = _useContext.disabled,
    active = _useContext.active;
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    order = _useContext2.pages.order,
    rtl = _useContext2.options.content.rtl,
    leadFormData = _useContext2.leadForm;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    hash = _useAtom2[0].hash;
  var isOnFirstPage = rtl ? settledStageIndex === order.length - 1 : settledStageIndex === 0;
  // The user has to be able to skip lead form with ESC + close Modal button, when the skip option is enabled
  var _useState = (0,react.useState)(active === LEAD_FORM_ID && (leadFormData === null || leadFormData === void 0 ? void 0 : leadFormData.allowUsersToSkip) || active !== LEAD_FORM_ID || !isOnFirstPage),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    isClickEnabled = _useState2[0],
    setIsClickEnabled = _useState2[1];
  var dialogRef = (0,react.useRef)(null);
  var modalStep = react_useAtomValue(modalStepAtom);
  var setModalStep = react_useSetAtom(setModalStepAtom);
  var isCookiePolicyAccepted = hooks_useCookiePolicyAcceptance();
  (0,react.useEffect)(function () {
    var closeModal = function closeModal(event) {
      if (isClickEnabled && (event.key === ESC || event.key === ESCAPE) && !props.isPasswordProtected) {
        if (leadFormData !== null && leadFormData !== void 0 && leadFormData.allowUsersToSkip && active === LEAD_FORM_ID) {
          setLeadFormCookies(hash);
          setOpen(LEAD_FORM_COMPLETED);
        } else {
          setDisabled(true);
          var closeAnimationTimeout = setTimeout(function () {
            clearTimeout(closeAnimationTimeout);
            setOpen('');
          }, ANIMATION_EXECUTION_TIME);
        }
      }
    };

    // TODO: add event listeners on playerRef instead of window...
    window.addEventListener('keydown', closeModal, true);
    return function () {
      setDisabled(false);
      setModalStep('');
      window.removeEventListener('keydown', closeModal, true);
    };
  }, [leadFormData === null || leadFormData === void 0 ? void 0 : leadFormData.allowUsersToSkip, hash, isClickEnabled, props.isPasswordProtected]);

  // Disable lead form modal's overlay functionality that goes to previous page, until the flip is done
  (0,react.useEffect)(function () {
    var handleFlipEffectDone = function handleFlipEffectDone() {
      setIsClickEnabled(!isOnFirstPage || active !== LEAD_FORM_ID);
    };
    var handleFLipEffectStart = function handleFLipEffectStart() {
      setIsClickEnabled(false);
    };
    if (active === LEAD_FORM_ID) {
      // Exclude first stage
      document.addEventListener(TRANSITION_EFFECT_DONE, handleFlipEffectDone);
      document.addEventListener(TRANSITION_EFFECT_START, handleFLipEffectStart);
    }
    return function () {
      document.removeEventListener(TRANSITION_EFFECT_DONE, handleFlipEffectDone);
      document.removeEventListener(TRANSITION_EFFECT_START, handleFLipEffectStart);
    };
  }, [active, isOnFirstPage]);
  useTrapFocus(dialogRef, [props.identifier === LEAD_FORM_ID, modalStep, isCookiePolicyAccepted], '', isCookiePolicyAccepted);

  // Password modal must be outside the player for not being rendered when the flipbook is password protected
  var containerId = props.isPasswordProtected ? 'passwordPlayerModal' : 'regularPlayerModal';
  var _useAtom3 = react_useAtom(stageSizeWidthAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    width = _useAtom4[0];
  var parent = document.getElementById(containerId);
  var preloaderDefaults = (0,react.useRef)({
    width: props.width,
    height: props.modalHeight
  });
  var preloaderWidth = Number(preloaderDefaults.current.width.split('px')[0]);
  var preloaderHeight = preloaderDefaults.current && preloaderDefaults.current.height ? Number(preloaderDefaults.current.height.split('px')[0]) : 0;

  /**
   * Prevents the event propagation if the click is not enabled
   * This is used to prevent the modal to be closed on the first page or to let the user interact with the content
   * besides the modal.
   */
  var preventEvent = function preventEvent(e) {
    if (!isClickEnabled) {
      e.stopPropagation();
    }
  };
  var content = props.loading ? /*#__PURE__*/react.createElement(LoaderContainer, null, /*#__PURE__*/react.createElement(Preloader_Preloader, {
    width: preloaderWidth,
    height: preloaderHeight
  })) : props.children;
  return parent ? /*#__PURE__*/react_dom.createPortal(/*#__PURE__*/react.createElement(ModalContainer, {
    ref: dialogRef,
    $stageWidth: width,
    onMouseDown: preventEvent,
    onClick: preventEvent,
    hasBlackBackground: !!props.hasBlackBackground,
    isPasswordProtected: props.isPasswordProtected,
    $closed: disabled
  }, /*#__PURE__*/react.createElement(ModalStyles_Modal, {
    $height: props.modalHeight,
    $width: props.width,
    $loading: !!props.loading,
    $defaultWidth: preloaderWidth,
    $defaultHeight: preloaderHeight,
    $closed: disabled,
    $opacity: props.opacity === undefined ? 1 : props.opacity
  }, props.displayCloseIcon && /*#__PURE__*/react.createElement(CloseButton, {
    tabIndex: TabIndex.DEFAULT,
    disabled: !isClickEnabled
  }, /*#__PURE__*/react.createElement(src.CloseIcon, null)), /*#__PURE__*/react.createElement(ModalContent_ModalContent, {
    width: props.width,
    height: props.height,
    modalWithoutPadding: !!props.modalWithoutPadding
  }, content))), parent) : null;
};
/* harmony default export */ var Modals_Modal_Modal = (Modals_Modal_Modal_Modal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/Modal/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PasswordModal/PasswordModalStyles.tsx



var PasswordModalContent = styled_components_browser_esm.div.withConfig({
  displayName: "PasswordModalStyles__PasswordModalContent",
  componentId: "sc-f7v6xt-0"
})(["display:flex;flex-direction:column;justify-content:space-between;height:100%;"]);
var PasswordHeader = styled_components_browser_esm.div.withConfig({
  displayName: "PasswordModalStyles__PasswordHeader",
  componentId: "sc-f7v6xt-1"
})(["text-align:center;"]);
var PasswordTitle = styled_components_browser_esm(H2).withConfig({
  displayName: "PasswordModalStyles__PasswordTitle",
  componentId: "sc-f7v6xt-2"
})([""]);
var PasswordSubTitle = styled_components_browser_esm.p.withConfig({
  displayName: "PasswordModalStyles__PasswordSubTitle",
  componentId: "sc-f7v6xt-3"
})(["font-size:", "px;"], function (_ref) {
  var theme = _ref.theme;
  return theme.typography.size.paragraph;
});
var PasswordInputContainer = styled_components_browser_esm(InputContainer).withConfig({
  displayName: "PasswordModalStyles__PasswordInputContainer",
  componentId: "sc-f7v6xt-4"
})([""]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/identifier.ts
var Identifier = {
  l_toc: 'l_toc',
  l_copy_link: 'l_copy_link',
  l_copied: 'l_copied',
  l_from_current_pg: 'l_from_current_pg',
  l_search: 'l_search',
  l_search_result: 'l_search_result',
  l_search_results: 'l_search_results',
  l_my_list: 'l_my_list',
  l_list_no_items: 'l_list_no_items',
  l_clear_list: 'l_clear_list',
  l_total: 'l_total',
  l_download_list_pdf: 'l_download_list_pdf',
  l_my_product_list: 'l_my_product_list',
  l_previous_page: 'l_previous_page',
  l_next_page: 'l_next_page',
  l_accessibility: 'l_accessibility',
  l_page: 'l_page',
  l_unlock_full_version: 'l_unlock_full_version',
  l_published_by: 'l_published_by',
  l_buy: 'l_buy',
  l_buy_subscription: 'l_buy_subscription',
  l_subscribe: 'l_subscribe',
  l_password_protected: 'l_password_protected',
  l_enter_password_to_view: 'l_enter_password_to_view',
  l_enter_password: 'l_enter_password',
  l_invalid_password: 'l_invalid_password',
  l_unlock: 'l_unlock',
  l_zoom: 'l_zoom',
  l_zoom_in: 'l_zoom_in',
  l_zoom_out: 'l_zoom_out',
  l_pages: 'l_pages',
  l_print: 'l_print',
  l_download: 'l_download',
  l_share: 'l_share',
  l_enter_fs: 'l_enter_fs',
  l_exit_fs: 'l_exit_fs',
  l_download_pdf_order: 'l_download_pdf_order',
  l_contact_details: 'l_contact_details',
  l_send_order_modal_text: 'l_send_order_modal_text',
  l_send_order_button: 'l_send_order_button',
  l_send_order_select: 'l_send_order_select',
  l_order_confirmation_header: 'l_order_confirmation_header',
  l_order_successful_text: 'l_order_successful_text',
  l_lead_form_error_email: 'l_lead_form_error_email',
  l_lead_form_error_tel: 'l_lead_form_error_tel',
  l_lead_form_error_url: 'l_lead_form_error_url',
  l_agree_to_privacy_policy: 'l_agree_to_privacy_policy',
  l_download_list: 'l_download_list',
  l_background_sound_on: 'l_background_sound_on',
  l_background_sound_off: 'l_background_sound_off',
  accessibility_toc: 'accessibility_toc',
  accessibility_search: 'accessibility_search',
  accessibility_my_list: 'accessibility_my_list',
  accessibility_previous_page: 'accessibility_previous_page',
  accessibility_next_page: 'accessibility_next_page',
  accessibility_accessibility: 'accessibility_accessibility',
  accessibility_zoom_in: 'accessibility_zoom_in',
  accessibility_zoom_out: 'accessibility_zoom_out',
  accessibility_pages: 'accessibility_pages',
  accessibility_print: 'accessibility_print',
  accessibility_download: 'accessibility_download',
  accessibility_share: 'accessibility_share',
  accessibility_enter_fs: 'accessibility_enter_fs',
  accessibility_exit_fs: 'accessibility_exit_fs',
  accessibility_logo_image: 'accessibility_logo_image',
  accessibility_unlock_flipbook_input: 'accessibility_unlock_flipbook_input',
  accessibility_share_on_facebook: 'accessibility_share_on_facebook',
  accessibility_share_on_x: 'accessibility_share_on_x',
  accessibility_share_on_pinterest: 'accessibility_share_on_pinterest',
  accessibility_share_on_linkedin: 'accessibility_share_on_linkedin',
  accessibility_share_on_email: 'accessibility_share_on_email',
  accessibility_share_from_current_page: 'accessibility_share_from_current_page',
  accessibility_share_copy_link: 'accessibility_share_copy_link',
  accessibility_share_on_whatsapp: 'accessibility_share_on_whatsapp',
  accessibility_toc_header: 'accessibility_toc_header',
  accessibility_clear_search_bar: 'accessibility_clear_search_bar',
  accessibility_background_sound_on: 'accessibility_background_sound_on',
  accessibility_background_sound_off: 'accessibility_background_sound_off',
  l_response_submitted_message: 'l_response_submitted_message',
  orderPdfHeader: 'orderPdfHeader',
  orderPdfProduct: 'orderPdfProduct',
  orderPdfID: 'orderPdfID',
  orderPdfPrice: 'orderPdfPrice',
  orderPdfAmount: 'orderPdfAmount',
  orderPdfTotal: 'orderPdfTotal',
  orderPdfFooter: 'orderPdfFooter',
  l_retake_quiz: 'l_retake_quiz',
  l_view_results: 'l_view_results',
  l_lead_dropdown_select: 'l_lead_dropdown_select',
  l_product_required_personalization: 'l_product_required_personalization',
  l_order_not_sent: 'l_order_not_sent',
  l_try_again: 'l_try_again',
  l_connection_issue: 'l_connection_issue',
  l_personalization: 'l_personalization',
  l_character: 'l_character',
  l_clear_list_confirmation: 'l_clear_list_confirmation',
  l_cancel: 'l_cancel',
  l_delete_list_message: 'l_delete_list_message',
  l_minimum_order_value: 'l_minimum_order_value',
  l_please_add_more_items: 'l_please_add_more_items',
  l_submit_button: 'l_submit_button',
  l_previous_button: 'l_previous_button',
  l_next_button: 'l_next_button',
  l_complete_button: 'l_complete_button',
  l_refresh_page_button: 'l_refresh_page_button',
  l_refresh_page_text: 'l_refresh_page_text',
  l_quiz_was_updated: 'l_quiz_was_updated',
  l_question: 'l_question',
  l_answered: 'l_answered',
  l_correct_answers: 'l_correct_answers',
  l_number_of_questions: 'l_number_of_questions',
  l_explanation: 'l_explanation'
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/accessibilityDefaults.ts

var _accessibilityDefault;
/* eslint-disable max-len */

var accessibilityDefaults = (_accessibilityDefault = {}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_accessibilityDefault, Identifier.accessibility_toc, 'Table of contents'), Identifier.accessibility_search, 'Search'), Identifier.accessibility_my_list, 'My list'), Identifier.accessibility_previous_page, 'Previous page'), Identifier.accessibility_next_page, 'Next page'), Identifier.accessibility_accessibility, 'Accessibility options - open for screen reader functions'), Identifier.accessibility_zoom_in, 'Zoom in'), Identifier.accessibility_zoom_out, 'Zoom out'), Identifier.accessibility_pages, 'Pages'), Identifier.accessibility_print, 'Print'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_accessibilityDefault, Identifier.accessibility_download, 'Download'), Identifier.accessibility_share, 'Share'), Identifier.accessibility_enter_fs, 'Full screen'), Identifier.accessibility_exit_fs, 'Exit full screen'), Identifier.accessibility_logo_image, 'Logo image'), Identifier.accessibility_unlock_flipbook_input, 'The flipbook is password protected. Enter the password then press enter in order to unlock flipbook'), Identifier.accessibility_share_on_facebook, 'Share on Facebook'), Identifier.accessibility_share_on_x, 'Share on X'), Identifier.accessibility_share_on_pinterest, 'Share on Pinterest'), Identifier.accessibility_share_on_linkedin, 'Share on Linkedin'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_accessibilityDefault, Identifier.accessibility_share_on_email, 'Share on Email'), Identifier.accessibility_share_from_current_page, 'Checkbox for sharing from current page. Check if you want your flipbook to be shared from current page'), Identifier.accessibility_share_copy_link, 'Copy link button: Click to copy the link of your flipbook and easily share it with others'), Identifier.accessibility_toc_header, 'Table of contents header'), Identifier.accessibility_clear_search_bar, 'Clear search bar button, press if you want to clear the search bar'), Identifier.accessibility_background_sound_on, 'Play audio background'), Identifier.accessibility_background_sound_off, 'Pause audio background'), Identifier.accessibility_share_on_whatsapp, 'Share on Whatsapp'));
/* harmony default export */ var translations_accessibilityDefaults = (accessibilityDefaults);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/basque/index.ts

var _objectSpread2;
function basque_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function basque_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? basque_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : basque_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Basque = basque_objectSpread((_objectSpread2 = {
  code: 'eu-ES'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_objectSpread2, Identifier.l_toc, 'Aurkibidea'), Identifier.l_copy_link, 'Esteka kopiatu'), Identifier.l_copied, 'Kopiatua'), Identifier.l_from_current_pg, 'Uneko orritik'), Identifier.l_search, 'Bilatu'), Identifier.l_search_result, 'Aurkitutako emaitza'), Identifier.l_search_results, 'Aurkitutako emaitzak'), Identifier.l_my_list, 'Nire zerrenda'), Identifier.l_list_no_items, 'Ez dago artikulurik zerrendan'), Identifier.l_clear_list, 'Garbitu zerrenda'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_objectSpread2, Identifier.l_total, 'Totala'), Identifier.l_download_list_pdf, 'Zerrenda deskargatu PDF gisa'), Identifier.l_my_product_list, 'Nire artikulu zerrenda'), Identifier.l_previous_page, 'Aurreko orria'), Identifier.l_next_page, 'Hurrengo orria'), Identifier.l_accessibility, 'Irisgarritasuna'), Identifier.l_page, 'Orria'), Identifier.l_unlock_full_version, 'Desblokeatu bertsio osoa'), Identifier.l_published_by, 'Nork argitaratua: '), Identifier.l_buy, 'Erosi'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_objectSpread2, Identifier.l_buy_subscription, 'Erosi harpidetza'), Identifier.l_subscribe, 'Harpidetu'), Identifier.l_password_protected, 'Argazki-liburua pasahitz babestua da'), Identifier.l_enter_password_to_view, 'Sartu pasahitza argazki-liburua ikusteko'), Identifier.l_enter_password, 'Sartu pasahitza'), Identifier.l_invalid_password, 'Pasahitz baliogabea'), Identifier.l_unlock, 'Desblokeatu'), Identifier.l_zoom, 'Zooma'), Identifier.l_zoom_in, 'Zooma hurbildu'), Identifier.l_zoom_out, 'Zooma urrundu'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_objectSpread2, Identifier.l_pages, 'Orriak'), Identifier.l_print, 'Inprimatu'), Identifier.l_download, 'Deskargatu'), Identifier.l_share, 'Partekatu'), Identifier.l_enter_fs, 'Pantaila osoa'), Identifier.l_exit_fs, 'Pantaila osoatik atera'), Identifier.l_download_pdf_order, 'Agindu PDFa deskargatu'), Identifier.l_contact_details, 'Harremanetarako datuak'), Identifier.l_send_order_modal_text, 'Agindua bidaltzeko, harremanetarako datuak sartu behar dituzu. Zure eskaera jaso ondoren, lehenbailehen harremanetan jarriko gara.'), Identifier.l_send_order_button, 'Agindua bidali'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_objectSpread2, Identifier.l_send_order_select, 'Hautatu...'), Identifier.l_order_successful_text, 'Eskerrik asko erosteagatik. Laster harremanetan jarriko gara!'), Identifier.l_lead_form_error_email, 'Sarrera helbide elektroniko bat izan behar da'), Identifier.l_lead_form_error_tel, 'Sarrera telefono bat izan behar da'), Identifier.l_lead_form_error_url, 'Sarrera web orri bat izan behar da'), Identifier.l_order_confirmation_header, 'Agindua bidali da'), Identifier.l_agree_to_privacy_policy, 'Ados nago konpainiaren pribatutasun-politika honekin:'), Identifier.l_download_list, 'Zerrenda deskargatu'), Identifier.l_background_sound_on, 'Audio piztuta'), Identifier.l_background_sound_off, 'Audio itzalita'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_objectSpread2, Identifier.l_response_submitted_message, 'Eskerrik asko! Zure erantzuna bidali da.'), Identifier.orderPdfHeader, 'Zerrenda sortuta {flipbook_name}-tik {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produktua'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Prezioa'), Identifier.orderPdfAmount, 'Kopurua'), Identifier.orderPdfTotal, 'Guztira'), Identifier.orderPdfFooter, 'Guztira guztira'), Identifier.l_retake_quiz, 'Berriro egin galdera-sortak'), Identifier.l_view_results, 'Ikusi emaitzak'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_objectSpread2, Identifier.l_lead_dropdown_select, 'Hautatu...'), Identifier.l_product_required_personalization, 'Produktu honek pertsonalizazioa behar du.'), Identifier.l_order_not_sent, 'Eskaera bidali gabe'), Identifier.l_try_again, 'Saiatu berriro'), Identifier.l_connection_issue, 'Baliteko konexio-arazoa. Saiatu berriro.'), Identifier.l_personalization, 'Pertsonalizazioa'), Identifier.l_character, 'karakterea'), Identifier.l_cancel, 'Utzi'), Identifier.l_clear_list_confirmation, 'Zerrenda garbitu?'), Identifier.l_delete_list_message, 'Ekintza honek zerrendako elementu guztiak betirako ezabatuko ditu. Ziur zaude jarraitu nahi duzula?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_objectSpread2, Identifier.l_minimum_order_value, 'Gutxieneko eskaera balioa:'), Identifier.l_please_add_more_items, 'Mesedez, gehitu elementu gehiago ordaintzeko.'), Identifier.l_submit_button, 'Bidali'), Identifier.l_previous_button, 'Aurrekoa'), Identifier.l_next_button, 'Hurrengoa'), Identifier.l_complete_button, 'Osatu'), Identifier.l_quiz_was_updated, 'Galdetegia berriki eguneratu da.'), Identifier.l_refresh_page_button, 'Berritu orri hau.'), Identifier.l_question, 'Galdera'), Identifier.l_answered, 'Erantzunda'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(_objectSpread2, Identifier.l_explanation, 'Azalpena'), Identifier.l_refresh_page_text, 'Mesedez, jarraitzeko berritu orria.'), Identifier.l_number_of_questions, 'Galdera kopurua'), Identifier.l_correct_answers, 'Erantzun zuzenak')), translations_accessibilityDefaults);
/* harmony default export */ var basque = (Basque);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/bosnian/index.ts

var bosnian_objectSpread2;
function bosnian_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function bosnian_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? bosnian_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : bosnian_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Bosanski = bosnian_objectSpread((bosnian_objectSpread2 = {
  code: 'bs-Latn-BA'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(bosnian_objectSpread2, Identifier.l_toc, 'Tablica sadržaja'), Identifier.l_copy_link, 'Kopirati link'), Identifier.l_copied, 'Kopirano'), Identifier.l_from_current_pg, 'Od trenutne stranice'), Identifier.l_search, 'Pretraga'), Identifier.l_search_result, 'Pronađeni rezultat'), Identifier.l_search_results, 'Pronađeni rezultati'), Identifier.l_my_list, 'Moja lista'), Identifier.l_list_no_items, 'Još nema artikala na vašoj listi'), Identifier.l_clear_list, 'Očistiti listu'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(bosnian_objectSpread2, Identifier.l_total, 'Ukupno'), Identifier.l_download_list_pdf, 'Preuzmi listu kao PDF'), Identifier.l_my_product_list, 'Moja lista proizvoda'), Identifier.l_previous_page, 'Prethodna stranica'), Identifier.l_next_page, 'Sljedeća stranica'), Identifier.l_accessibility, 'Pristupačnost'), Identifier.l_page, 'Stranica'), Identifier.l_unlock_full_version, 'Otključati cijelu verziju'), Identifier.l_published_by, 'Objavio je '), Identifier.l_buy, 'Kupiti'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(bosnian_objectSpread2, Identifier.l_buy_subscription, 'Kupiti pretplatu'), Identifier.l_subscribe, 'Pretplatiti se'), Identifier.l_password_protected, 'Flipbook je zaštićen šifrom'), Identifier.l_enter_password_to_view, 'Unos šifre za pregled flipbook-a'), Identifier.l_enter_password, 'Unos šifre'), Identifier.l_invalid_password, 'Pogrešna šifra'), Identifier.l_unlock, 'Otključati'), Identifier.l_zoom, 'Zumiranje'), Identifier.l_zoom_in, 'Povećajte'), Identifier.l_zoom_out, 'Smanjite'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(bosnian_objectSpread2, Identifier.l_pages, 'Stranice'), Identifier.l_print, 'Isprintajte'), Identifier.l_download, 'Preuzmite'), Identifier.l_share, 'Podijelite'), Identifier.l_enter_fs, 'Cijeli ekran'), Identifier.l_exit_fs, 'Izađite iz cijelog ekrana'), Identifier.l_download_pdf_order, 'Preuzmite PDF narudžbe'), Identifier.l_contact_details, 'Kontakt podaci'), Identifier.l_send_order_modal_text, 'Da biste poslali narudžbu morate unijeti Vaše kontakt podatke. Jednom kada zaprimimo Vašu narudžbu, javit ćemo Vam se što je prije moguće.'), Identifier.l_send_order_button, 'Pošaljite narudžbu'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(bosnian_objectSpread2, Identifier.l_send_order_select, 'Odaberite...'), Identifier.l_order_successful_text, 'Hvala Vam za narudžbu. Kontaktirat ćemo Vas uskoro!'), Identifier.l_lead_form_error_email, 'Unos mora biti email adresa.'), Identifier.l_lead_form_error_tel, 'Unos mora biti broj telefona.'), Identifier.l_lead_form_error_url, 'Unos mora biti web stranica.'), Identifier.l_order_confirmation_header, 'Narudžba je poslana.'), Identifier.l_agree_to_privacy_policy, 'Slažem se s Politikom privatnosti:'), Identifier.l_download_list, 'Preuzmi listu'), Identifier.l_background_sound_on, 'Zvuk uključen'), Identifier.l_background_sound_off, 'Zvuk isključen'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(bosnian_objectSpread2, Identifier.l_response_submitted_message, 'Hvala! Vaš odgovor je poslan.'), Identifier.orderPdfHeader, 'Lista generisana iz {flipbook_name} na {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Proizvod'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Cijena'), Identifier.orderPdfAmount, 'Količina'), Identifier.orderPdfTotal, 'Ukupno'), Identifier.orderPdfFooter, 'Ukupni zbroj'), Identifier.l_retake_quiz, 'Ponovo uraditi kviz'), Identifier.l_view_results, 'Pogledaj rezultate'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(bosnian_objectSpread2, Identifier.l_lead_dropdown_select, 'Odaberite...'), Identifier.l_product_required_personalization, 'Ovaj proizvod zahtijeva personalizaciju.'), Identifier.l_order_not_sent, 'Porudžbina nije poslata'), Identifier.l_try_again, 'Pokušaj ponovo'), Identifier.l_connection_issue, 'Mogući problem s vezom. Molimo pokušajte ponovo.'), Identifier.l_personalization, 'Personalizacija'), Identifier.l_character, 'karakter'), Identifier.l_cancel, 'Otkaži'), Identifier.l_clear_list_confirmation, 'Obrisati listu?'), Identifier.l_delete_list_message, 'Ova radnja trajno će izbrisati sve stavke sa vaše liste. Da li ste sigurni da želite nastaviti?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(bosnian_objectSpread2, Identifier.l_minimum_order_value, 'Minimalna vrednost porudžbine:'), Identifier.l_please_add_more_items, 'Molimo dodajte još artikala za završetak kupovine.'), Identifier.l_submit_button, 'Pošalji'), Identifier.l_previous_button, 'Prethodni'), Identifier.l_next_button, 'Sljedeći'), Identifier.l_complete_button, 'Dovrši'), Identifier.l_quiz_was_updated, 'Kviz je nedavno ažuriran.'), Identifier.l_refresh_page_button, 'Osvježi ovu stranicu.'), Identifier.l_question, 'Pitanje'), Identifier.l_answered, 'Odgovoreno'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(bosnian_objectSpread2, Identifier.l_explanation, 'Objašnjenje'), Identifier.l_refresh_page_text, 'Osvježi stranicu da bi nastavio.'), Identifier.l_number_of_questions, 'Broj pitanja'), Identifier.l_correct_answers, 'Tačni odgovori')), translations_accessibilityDefaults);
/* harmony default export */ var bosnian = (Bosanski);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/brazilian_portuguese/index.ts

var brazilian_portuguese_objectSpread2;
function brazilian_portuguese_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function brazilian_portuguese_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? brazilian_portuguese_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : brazilian_portuguese_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var BrazilianPortugues = brazilian_portuguese_objectSpread((brazilian_portuguese_objectSpread2 = {
  code: 'pt-BR'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(brazilian_portuguese_objectSpread2, Identifier.l_toc, 'Índice'), Identifier.l_copy_link, 'Copiar link'), Identifier.l_copied, 'Copiado'), Identifier.l_from_current_pg, 'A partir da página atual'), Identifier.l_search, 'Pesquisar'), Identifier.l_search_result, 'resultado encontrado'), Identifier.l_search_results, 'resultados encontrados'), Identifier.l_my_list, 'Minha lista'), Identifier.l_list_no_items, 'Ainda são existem itens na sua lista'), Identifier.l_clear_list, 'Limpar lista'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(brazilian_portuguese_objectSpread2, Identifier.l_total, 'Total'), Identifier.l_download_list_pdf, 'Baixar a lista em PDF'), Identifier.l_my_product_list, 'Minha lista de produtos'), Identifier.l_previous_page, 'Página anterior'), Identifier.l_next_page, 'Próxima página'), Identifier.l_accessibility, 'Acessibilidade'), Identifier.l_page, 'Página'), Identifier.l_unlock_full_version, 'Desbloquear a versão completa'), Identifier.l_published_by, 'Publicado por '), Identifier.l_buy, 'Comprar'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(brazilian_portuguese_objectSpread2, Identifier.l_buy_subscription, 'Comprar assinatura'), Identifier.l_subscribe, 'Assine'), Identifier.l_password_protected, 'O flipbook está protegido por senha'), Identifier.l_enter_password_to_view, 'Insira a senha para visualizar o flipbook'), Identifier.l_enter_password, 'Inserir senha'), Identifier.l_invalid_password, 'Senha inválida'), Identifier.l_unlock, 'Desbloquear'), Identifier.l_zoom, 'Zoom'), Identifier.l_zoom_in, 'Mais zoom'), Identifier.l_zoom_out, 'Menos zoom'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(brazilian_portuguese_objectSpread2, Identifier.l_pages, 'Páginas'), Identifier.l_print, 'Imprimir'), Identifier.l_download, 'Baixar'), Identifier.l_share, 'Compartilhar'), Identifier.l_enter_fs, 'Tela cheia'), Identifier.l_exit_fs, 'Sair da tela cheia'), Identifier.l_download_pdf_order, 'Baixar pedido em PDF'), Identifier.l_contact_details, 'Dados de contato'), Identifier.l_send_order_modal_text, 'Para enviar o pedido, você deve inserir os seus dados de contato. Assim que recebermos o seu pedido, entraremos em contato o mais rápido possível.'), Identifier.l_send_order_button, 'Enviar pedido'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(brazilian_portuguese_objectSpread2, Identifier.l_send_order_select, 'Selecione...'), Identifier.l_order_successful_text, 'Obrigado pelo seu pedido. Entraremos em contato em breve!'), Identifier.l_lead_form_error_email, 'Os dados digitados devem ser um endereço de e-mail.'), Identifier.l_lead_form_error_tel, 'Os dados digitados devem ser um número de telefone.'), Identifier.l_lead_form_error_url, 'Os dados digitados devem ser um site.'), Identifier.l_order_confirmation_header, 'O pedido foi enviado'), Identifier.l_agree_to_privacy_policy, 'Eu concordo com a seguinte Política de Privacidade da empresa:'), Identifier.l_download_list, 'Baixar lista'), Identifier.l_background_sound_on, 'Som ligado'), Identifier.l_background_sound_off, 'Som desligado'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(brazilian_portuguese_objectSpread2, Identifier.l_response_submitted_message, 'Obrigado! Sua resposta foi enviada.'), Identifier.orderPdfHeader, 'Lista gerada a partir de {flipbook_name} em {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produto'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Preço'), Identifier.orderPdfAmount, 'Quantidade'), Identifier.orderPdfTotal, 'Total'), Identifier.orderPdfFooter, 'Total geral'), Identifier.l_retake_quiz, 'Refazer teste'), Identifier.l_view_results, 'Ver resultados'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(brazilian_portuguese_objectSpread2, Identifier.l_lead_dropdown_select, 'Selecione...'), Identifier.l_product_required_personalization, 'Este produto requer personalização.'), Identifier.l_order_not_sent, 'Pedido não enviado'), Identifier.l_try_again, 'Tente novamente'), Identifier.l_connection_issue, 'Possível problema de conexão. Por favor, tente novamente.'), Identifier.l_personalization, 'Personalização'), Identifier.l_character, 'caráter'), Identifier.l_cancel, 'Cancelar'), Identifier.l_clear_list_confirmation, 'Limpar lista?'), Identifier.l_delete_list_message, 'Esta ação excluirá permanentemente todos os itens da sua lista. Tem certeza de que deseja continuar?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(brazilian_portuguese_objectSpread2, Identifier.l_minimum_order_value, 'Valor mínimo do pedido:'), Identifier.l_please_add_more_items, 'Por favor, adicione mais itens para finalizar a compra.'), Identifier.l_submit_button, 'Enviar'), Identifier.l_previous_button, 'Anterior'), Identifier.l_next_button, 'Próximo'), Identifier.l_complete_button, 'Concluir'), Identifier.l_quiz_was_updated, 'O quiz foi atualizado recentemente.'), Identifier.l_refresh_page_button, 'Atualize esta página.'), Identifier.l_question, 'Pergunta'), Identifier.l_answered, 'Respondido'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(brazilian_portuguese_objectSpread2, Identifier.l_explanation, 'Explicação'), Identifier.l_refresh_page_text, 'Atualize a página para continuar.'), Identifier.l_number_of_questions, 'Número de perguntas'), Identifier.l_correct_answers, 'Respostas corretas')), translations_accessibilityDefaults);
/* harmony default export */ var brazilian_portuguese = (BrazilianPortugues);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/catalan/index.ts

var catalan_objectSpread2;
function catalan_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function catalan_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? catalan_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : catalan_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Català = catalan_objectSpread((catalan_objectSpread2 = {
  code: 'ca-ES'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(catalan_objectSpread2, Identifier.l_toc, 'Índex'), Identifier.l_copy_link, 'Copiar enllaç'), Identifier.l_copied, 'Copiat'), Identifier.l_from_current_pg, 'Des d\'aquesta pàgina'), Identifier.l_search, 'Cerca'), Identifier.l_search_result, 'resultat trobat'), Identifier.l_search_results, 'resultats trobats'), Identifier.l_my_list, 'La meva llista'), Identifier.l_list_no_items, 'Encara no hi ha cap resultat a la teva llista'), Identifier.l_clear_list, 'Esborrar la llista'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(catalan_objectSpread2, Identifier.l_total, 'Total'), Identifier.l_download_list_pdf, 'Descarregar llista com PDF'), Identifier.l_my_product_list, 'La meva llista de productes'), Identifier.l_previous_page, 'Pàgina anterior'), Identifier.l_next_page, 'Pàgina següent'), Identifier.l_accessibility, 'Accessibilitat'), Identifier.l_page, 'Pàgina'), Identifier.l_unlock_full_version, 'Desbloquejar versió completa'), Identifier.l_published_by, 'Publicat per '), Identifier.l_buy, 'Comprar'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(catalan_objectSpread2, Identifier.l_buy_subscription, 'Comprar subscripció'), Identifier.l_subscribe, 'Subscriure\'s'), Identifier.l_password_protected, 'El Flipbook està protegit per contrasenya'), Identifier.l_enter_password_to_view, 'Introdueix la teva contrasenya per veure el Flipbook'), Identifier.l_enter_password, 'Introduir contrasenya'), Identifier.l_invalid_password, 'Contrasenya incorrecta'), Identifier.l_unlock, 'Desbloquejar'), Identifier.l_zoom, 'Zoom'), Identifier.l_zoom_in, 'Ampliar'), Identifier.l_zoom_out, 'Allunyar'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(catalan_objectSpread2, Identifier.l_pages, 'Pàgines'), Identifier.l_print, 'Imprimir'), Identifier.l_download, 'Descarregar'), Identifier.l_share, 'Compartir'), Identifier.l_enter_fs, 'Pantalla completa'), Identifier.l_exit_fs, 'Sortir de pantalla completa'), Identifier.l_download_pdf_order, 'Descarregar PDF de la comanda'), Identifier.l_contact_details, 'Dades de contacte'), Identifier.l_send_order_modal_text, 'Per enviar la comanda, has de posar les teves dates de contacte, ens comunicarem amb tu al més aviat possible.'), Identifier.l_send_order_button, 'Enviar comanda'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(catalan_objectSpread2, Identifier.l_send_order_select, 'Selecciona...'), Identifier.l_order_successful_text, 'Gràcies per la teva comanda. Aviat ens comunicarem amb tu!'), Identifier.l_lead_form_error_email, 'La dada ha de ser una adreça de correu electrònic.'), Identifier.l_lead_form_error_tel, 'La dada ha de ser un número de telèfon.'), Identifier.l_lead_form_error_url, 'La dada ha de ser una pàgina web.'), Identifier.l_order_confirmation_header, 'S\'ha enviat la comanda'), Identifier.l_agree_to_privacy_policy, 'Estic d\'acord amb la següent política de privacitat'), Identifier.l_download_list, 'Descarregar llista'), Identifier.l_background_sound_on, 'So activat'), Identifier.l_background_sound_off, 'So desactivat'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(catalan_objectSpread2, Identifier.l_response_submitted_message, 'Gràcies! La teva resposta ha estat enviada.'), Identifier.orderPdfHeader, 'Llista generada des de {flipbook_name} el {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Producte'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Preu'), Identifier.orderPdfAmount, 'Quantitat'), Identifier.orderPdfTotal, 'Total'), Identifier.orderPdfFooter, 'Total general'), Identifier.l_retake_quiz, 'Tornar a fer el qüestionari'), Identifier.l_view_results, 'Veure els resultats'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(catalan_objectSpread2, Identifier.l_lead_dropdown_select, 'Selecciona...'), Identifier.l_product_required_personalization, 'Aquest producte requereix personalització.'), Identifier.l_order_not_sent, 'Comanda no enviada'), Identifier.l_try_again, 'Torna-ho a provar'), Identifier.l_connection_issue, 'Possible problema de connexió. Torna-ho a provar.'), Identifier.l_personalization, 'Personalització'), Identifier.l_character, 'caràcter'), Identifier.l_cancel, 'Cancel·lar'), Identifier.l_clear_list_confirmation, 'Esborrar la llista?'), Identifier.l_delete_list_message, 'Aquesta acció eliminarà permanentment tots els elements de la teva llista. Segur que vols continuar?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(catalan_objectSpread2, Identifier.l_minimum_order_value, 'Valor mínim de comanda:'), Identifier.l_please_add_more_items, 'Si us plau, afegiu més articles per completar la compra.'), Identifier.l_submit_button, 'Envia'), Identifier.l_previous_button, 'Anterior'), Identifier.l_next_button, 'Següent'), Identifier.l_complete_button, 'Completa'), Identifier.l_quiz_was_updated, 'El qüestionari s\'ha actualitzat recentment.'), Identifier.l_refresh_page_button, 'Actualitza aquesta pàgina.'), Identifier.l_question, 'Pregunta'), Identifier.l_answered, 'Respost'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(catalan_objectSpread2, Identifier.l_explanation, 'Explicació'), Identifier.l_refresh_page_text, 'Actualitza la pàgina per continuar.'), Identifier.l_number_of_questions, 'Nombre de preguntes'), Identifier.l_correct_answers, 'Respostes correctes')), translations_accessibilityDefaults);
/* harmony default export */ var catalan = (Català);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/croatian/index.ts

var croatian_objectSpread2;
function croatian_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function croatian_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? croatian_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : croatian_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Hrvatski = croatian_objectSpread((croatian_objectSpread2 = {
  code: 'hr-HR'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(croatian_objectSpread2, Identifier.l_toc, 'Tablica sadržaja'), Identifier.l_copy_link, 'Kopiraj link'), Identifier.l_copied, 'Kopirano'), Identifier.l_from_current_pg, 'S trenutne stranice'), Identifier.l_search, 'Traži'), Identifier.l_search_result, 'rezultat pronađen'), Identifier.l_search_results, 'rezultata pronađeno'), Identifier.l_my_list, 'Moja lista'), Identifier.l_list_no_items, 'Još nema artikala na vašoj listi'), Identifier.l_clear_list, 'Očisti listu'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(croatian_objectSpread2, Identifier.l_total, 'Ukupno'), Identifier.l_download_list_pdf, 'Preuzmi listu kao PDF'), Identifier.l_my_product_list, 'Moja lista proizvoda'), Identifier.l_previous_page, 'Prethodna stranica'), Identifier.l_next_page, 'Sljedeća stranica'), Identifier.l_accessibility, 'Pristupačnost'), Identifier.l_page, 'Stranica'), Identifier.l_unlock_full_version, 'Otključaj potpunu verziju'), Identifier.l_published_by, 'Objavio je '), Identifier.l_buy, 'Kupi'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(croatian_objectSpread2, Identifier.l_buy_subscription, 'Kupi pretplatu'), Identifier.l_subscribe, 'Pretplati se'), Identifier.l_password_protected, 'Flipbook je zaštićen lozinkom'), Identifier.l_enter_password_to_view, 'Unesite lozinku da bistevidjeli flipbook'), Identifier.l_enter_password, 'Unesi lozinku'), Identifier.l_invalid_password, 'Netočna lozinka'), Identifier.l_unlock, 'Otključaj'), Identifier.l_zoom, 'Zumiranje'), Identifier.l_zoom_in, 'Povećaj'), Identifier.l_zoom_out, 'Smanji'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(croatian_objectSpread2, Identifier.l_pages, 'Stranice'), Identifier.l_print, 'Print'), Identifier.l_download, 'Preuzmi'), Identifier.l_share, 'Dijeli'), Identifier.l_enter_fs, 'Puni zaslon'), Identifier.l_exit_fs, 'Izađite iz punog zaslona'), Identifier.l_download_pdf_order, 'Preuzmite PDF narudžbe'), Identifier.l_contact_details, 'Kontakt podaci'), Identifier.l_send_order_modal_text, 'Da biste izvršili narudžbu morate unijeti kontakt podatke. Kad zaprimimo vašu narudžbu, javit ćemo vam se povratno u što kraćem roku.'), Identifier.l_send_order_button, 'Pošalji narudžbu'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(croatian_objectSpread2, Identifier.l_send_order_select, 'Izaberi...'), Identifier.l_order_successful_text, 'Hvala vam za narudžbu. Kontaktirat ćemo vas uskoro!'), Identifier.l_lead_form_error_email, 'Unos mora biti email adresa.'), Identifier.l_lead_form_error_tel, 'Unos mora biti telefonski broj.'), Identifier.l_lead_form_error_url, 'Unos mora biti web stranica.'), Identifier.l_order_confirmation_header, 'Nardužba je poslana'), Identifier.l_agree_to_privacy_policy, 'Slažem se s Politikom privatnosti:'), Identifier.l_download_list, 'Preuzmi popis'), Identifier.l_background_sound_on, 'Zvuk uključen'), Identifier.l_background_sound_off, 'Zvuk isključen'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(croatian_objectSpread2, Identifier.l_response_submitted_message, 'Hvala! Vaš odgovor je poslan.'), Identifier.orderPdfHeader, 'Popis generiran iz {flipbook_name} na {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Proizvod'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Cijena'), Identifier.orderPdfAmount, 'Količina'), Identifier.orderPdfTotal, 'Ukupno'), Identifier.orderPdfFooter, 'Ukupni iznos'), Identifier.l_retake_quiz, 'Ponovi kviz'), Identifier.l_view_results, 'Pogledaj rezultate'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(croatian_objectSpread2, Identifier.l_lead_dropdown_select, 'Izaberi...'), Identifier.l_product_required_personalization, 'Ovaj proizvod zahtijeva personalizaciju.'), Identifier.l_order_not_sent, 'Narudžba nije poslana'), Identifier.l_try_again, 'Pokušaj ponovno'), Identifier.l_connection_issue, 'Mogući problem s vezom. Molimo pokušajte ponovno.'), Identifier.l_personalization, 'Personalizacija'), Identifier.l_character, 'karakter'), Identifier.l_cancel, 'Odustani'), Identifier.l_clear_list_confirmation, 'Obrisati popis?'), Identifier.l_delete_list_message, 'Ova radnja trajno će obrisati sve stavke s vaše liste. Jeste li sigurni da želite nastaviti?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(croatian_objectSpread2, Identifier.l_minimum_order_value, 'Minimalna vrijednost narudžbe:'), Identifier.l_please_add_more_items, 'Molimo dodajte još artikala kako biste dovršili kupovinu.'), Identifier.l_submit_button, 'Pošalji'), Identifier.l_previous_button, 'Prethodni'), Identifier.l_next_button, 'Sljedeći'), Identifier.l_complete_button, 'Dovrši'), Identifier.l_quiz_was_updated, 'Kviz je nedavno ažuriran.'), Identifier.l_refresh_page_button, 'Osvježi ovu stranicu.'), Identifier.l_question, 'Pitanje'), Identifier.l_answered, 'Odgovoreno'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(croatian_objectSpread2, Identifier.l_explanation, 'Objašnjenje'), Identifier.l_refresh_page_text, 'Osvježi stranicu za nastavak.'), Identifier.l_number_of_questions, 'Broj pitanja'), Identifier.l_correct_answers, 'Točni odgovori')), translations_accessibilityDefaults);
/* harmony default export */ var croatian = (Hrvatski);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/czech/index.ts

var czech_objectSpread2;
function czech_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function czech_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? czech_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : czech_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Czech = czech_objectSpread((czech_objectSpread2 = {
  code: 'cs-CZ'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(czech_objectSpread2, Identifier.l_toc, 'Obsah'), Identifier.l_copy_link, 'Zkopírovat odkaz'), Identifier.l_copied, 'Zkopírováno'), Identifier.l_from_current_pg, 'Od aktuální strany'), Identifier.l_search, 'Hledat'), Identifier.l_search_result, 'Nalezený výsledek'), Identifier.l_search_results, 'Nalezené výsledky'), Identifier.l_my_list, 'Můj seznam'), Identifier.l_list_no_items, 'Ve vašem seznamu zatím nejsou žádné položky'), Identifier.l_clear_list, 'Vymazat seznam'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(czech_objectSpread2, Identifier.l_total, 'Celkem'), Identifier.l_download_list_pdf, 'Stáhnout seznam jako pdf'), Identifier.l_my_product_list, 'Můj seznam produktů'), Identifier.l_previous_page, 'Předchozí strana'), Identifier.l_next_page, 'Další strana'), Identifier.l_accessibility, 'Dostupnost'), Identifier.l_page, 'Strana'), Identifier.l_unlock_full_version, 'Odemknout plnou verzi'), Identifier.l_published_by, 'Vydal'), Identifier.l_buy, 'Koupit'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(czech_objectSpread2, Identifier.l_buy_subscription, 'Koupit předplatné'), Identifier.l_subscribe, 'Přihlásit se k odběru'), Identifier.l_password_protected, 'Flipbook je chráněn heslem'), Identifier.l_enter_password_to_view, 'Zadejte heslo pro zobrazení flipbooku'), Identifier.l_enter_password, 'Vložit heslo'), Identifier.l_invalid_password, 'Nesprávné heslo'), Identifier.l_unlock, 'Odemknout'), Identifier.l_zoom, 'Zvětšit'), Identifier.l_zoom_in, 'Přiblížit'), Identifier.l_zoom_out, 'Oddálit'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(czech_objectSpread2, Identifier.l_pages, 'Strany'), Identifier.l_print, 'Tisk'), Identifier.l_download, 'Stáhnout'), Identifier.l_share, 'Sdílet'), Identifier.l_enter_fs, 'Celá obrazovka'), Identifier.l_exit_fs, 'Ukončení celé obrazovky '), Identifier.l_download_pdf_order, 'Stáhnout PDF objednávky'), Identifier.l_contact_details, 'Kontaktní údaje '), Identifier.l_send_order_modal_text, 'Pro zaslání objednávky musíte vyplnit své kontaktní údaje. Až obdržíme Vaši objednávku, budeme Vás kontaktovat co nejdříve.'), Identifier.l_send_order_button, 'Poslat objednávku'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(czech_objectSpread2, Identifier.l_send_order_select, 'Vybrat...'), Identifier.l_order_successful_text, 'Děkujeme za Vaši objednávku. Brzy Vás budeme kontaktovat.'), Identifier.l_lead_form_error_email, 'Zde vložte emailovou adresu'), Identifier.l_lead_form_error_tel, 'Zde vložte telefonní číslo '), Identifier.l_lead_form_error_url, 'Zde vložte webové stranky'), Identifier.l_order_confirmation_header, 'Objednávka byla odeslána'), Identifier.l_agree_to_privacy_policy, 'Souhlasím s následujícími zásadami ochrany osobních údajů společnosti:'), Identifier.l_download_list, 'Stáhnout seznam'), Identifier.l_background_sound_on, 'Zvuk zapnutý'), Identifier.l_background_sound_off, 'Zvuk vypnutý'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(czech_objectSpread2, Identifier.l_response_submitted_message, 'Díky! Vaše odpověď byla odeslána.'), Identifier.orderPdfHeader, 'Seznam vytvořen z {flipbook_name} dne {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produkt'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Cena'), Identifier.orderPdfAmount, 'Množství'), Identifier.orderPdfTotal, 'Celkový'), Identifier.orderPdfFooter, 'Celkový součet'), Identifier.l_retake_quiz, 'Znovu spustit kvíz'), Identifier.l_view_results, 'Zobrazit výsledky'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(czech_objectSpread2, Identifier.l_lead_dropdown_select, 'Vybrat...'), Identifier.l_product_required_personalization, 'Tento produkt vyžaduje personalizaci.'), Identifier.l_order_not_sent, 'Objednávka nebyla odeslána'), Identifier.l_try_again, 'Zkuste to znovu'), Identifier.l_connection_issue, 'Možný problém s připojením. Zkuste to znovu.'), Identifier.l_personalization, 'Personalizace'), Identifier.l_character, 'charakter'), Identifier.l_cancel, 'Zrušit'), Identifier.l_clear_list_confirmation, 'Vymazat seznam?'), Identifier.l_delete_list_message, 'Tato akce trvale odstraní všechny položky z vašeho seznamu. Jste si jisti, že chcete pokračovat?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(czech_objectSpread2, Identifier.l_minimum_order_value, 'Minimální hodnota objednávky:'), Identifier.l_please_add_more_items, 'Přidejte prosím více položek pro dokončení objednávky.'), Identifier.l_submit_button, 'Odeslat'), Identifier.l_previous_button, 'Předchozí'), Identifier.l_next_button, 'Další'), Identifier.l_complete_button, 'Dokončit'), Identifier.l_quiz_was_updated, 'Kvíz byl nedávno aktualizován.'), Identifier.l_refresh_page_button, 'Obnovte tuto stránku.'), Identifier.l_question, 'Otázka'), Identifier.l_answered, 'Zodpovězeno'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(czech_objectSpread2, Identifier.l_explanation, 'Vysvětlení'), Identifier.l_refresh_page_text, 'Obnovte stránku pro pokračování.'), Identifier.l_number_of_questions, 'Počet otázek'), Identifier.l_correct_answers, 'Správné odpovědi')), translations_accessibilityDefaults);
/* harmony default export */ var czech = (Czech);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/danish/index.ts

var danish_objectSpread2;
function danish_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function danish_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? danish_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : danish_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Dansk = danish_objectSpread((danish_objectSpread2 = {
  code: 'da-DK'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(danish_objectSpread2, Identifier.l_toc, 'Indholdsfortegnelse'), Identifier.l_copy_link, 'Kopier link'), Identifier.l_copied, 'Kopieret'), Identifier.l_from_current_pg, 'Fra aktuelle side'), Identifier.l_search, 'Søg'), Identifier.l_search_result, 'resultat fundet'), Identifier.l_search_results, 'resultater fundet'), Identifier.l_my_list, 'Min liste'), Identifier.l_list_no_items, 'Der er endnu ingen varer på din liste'), Identifier.l_clear_list, 'Ryd liste'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(danish_objectSpread2, Identifier.l_total, 'I alt'), Identifier.l_download_list_pdf, 'Download liste som PDF'), Identifier.l_my_product_list, 'Min produktliste'), Identifier.l_previous_page, 'Forrige side'), Identifier.l_next_page, 'Næste side'), Identifier.l_accessibility, 'Tilgængelighed'), Identifier.l_page, 'Side'), Identifier.l_unlock_full_version, 'Lås den fulde version op'), Identifier.l_published_by, 'Udgivet af'), Identifier.l_buy, 'Køb'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(danish_objectSpread2, Identifier.l_buy_subscription, 'Køb abonnement'), Identifier.l_subscribe, 'Abonner'), Identifier.l_password_protected, 'Flipbogen er beskyttet med en adgangskode'), Identifier.l_enter_password_to_view, 'Indtast adgangskoden for at se flipbogen'), Identifier.l_enter_password, 'Indtast adgangskoden'), Identifier.l_invalid_password, 'Ugyldig adgangskode'), Identifier.l_unlock, 'Lås op'), Identifier.l_zoom, 'Zoom'), Identifier.l_zoom_in, 'Zoom ind'), Identifier.l_zoom_out, 'Zoom ud'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(danish_objectSpread2, Identifier.l_pages, 'Sider'), Identifier.l_print, 'Udskriv'), Identifier.l_download, 'Download'), Identifier.l_share, 'Del'), Identifier.l_enter_fs, 'Fuld skærm'), Identifier.l_exit_fs, 'Afslut fuld skærm'), Identifier.l_download_pdf_order, 'Download bestilling i PDF'), Identifier.l_contact_details, 'Kontaktoplysninger'), Identifier.l_send_order_modal_text, 'For at vi kan sende bestillingen, skal du indtaste dine kontaktoplysninger. Når vi har modtaget din bestilling, vender vi tilbage til dig hurtigst muligt.'), Identifier.l_send_order_button, 'Send bestilling'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(danish_objectSpread2, Identifier.l_send_order_select, 'Vælg...'), Identifier.l_order_successful_text, 'Tak for din bestilling. Vi kontakter dig snart!'), Identifier.l_lead_form_error_email, 'Input skal være en e-mailadresse.'), Identifier.l_lead_form_error_tel, 'Input skal være et telefonnummer.'), Identifier.l_lead_form_error_url, 'Input skal være en hjemmeside.'), Identifier.l_order_confirmation_header, 'Ordren blev sendt'), Identifier.l_agree_to_privacy_policy, 'Jeg accepterer følgende virksomheds privatlivspolitik:'), Identifier.l_download_list, 'Download liste'), Identifier.l_background_sound_on, 'Lyd til'), Identifier.l_background_sound_off, 'Lyd fra'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(danish_objectSpread2, Identifier.l_response_submitted_message, 'Tak! Dit svar er blevet indsendt.'), Identifier.orderPdfHeader, 'Liste genereret fra {flipbook_name} den {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produkt'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Pris'), Identifier.orderPdfAmount, 'Beløb'), Identifier.orderPdfTotal, 'Total'), Identifier.orderPdfFooter, 'Samlet beløb'), Identifier.l_retake_quiz, 'Tage quizzen igen'), Identifier.l_view_results, 'Se resultater'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(danish_objectSpread2, Identifier.l_lead_dropdown_select, 'Vælg...'), Identifier.l_product_required_personalization, 'Dette produkt kræver tilpasning.'), Identifier.l_order_not_sent, 'Ordre ikke sendt'), Identifier.l_try_again, 'Prøv igen'), Identifier.l_connection_issue, 'Mulig forbindelsesproblem. Prøv igen.'), Identifier.l_personalization, 'Personalisering'), Identifier.l_character, 'karakter'), Identifier.l_cancel, 'Annuller'), Identifier.l_clear_list_confirmation, 'Ryd liste?'), Identifier.l_delete_list_message, 'Denne handling vil permanent slette alle elementer fra din liste. Er du sikker på, at du vil fortsætte?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(danish_objectSpread2, Identifier.l_minimum_order_value, 'Minimum ordrebeløb:'), Identifier.l_please_add_more_items, 'Tilføj venligst flere varer for at gennemføre betalingen.'), Identifier.l_submit_button, 'Indsend'), Identifier.l_previous_button, 'Forrige'), Identifier.l_next_button, 'Næste'), Identifier.l_complete_button, 'Fuldfør'), Identifier.l_quiz_was_updated, 'Quizzen blev for nylig opdateret.'), Identifier.l_refresh_page_button, 'Opdater denne side.'), Identifier.l_question, 'Spørgsmål'), Identifier.l_answered, 'Besvaret'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(danish_objectSpread2, Identifier.l_explanation, 'Forklaring'), Identifier.l_refresh_page_text, 'Opdater siden for at fortsætte.'), Identifier.l_number_of_questions, 'Antal spørgsmål'), Identifier.l_correct_answers, 'Korrekte svar')), translations_accessibilityDefaults);
/* harmony default export */ var danish = (Dansk);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/dutch/index.ts

var dutch_objectSpread2;
function dutch_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function dutch_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? dutch_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : dutch_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Nederlands = dutch_objectSpread((dutch_objectSpread2 = {
  code: 'nl-NL'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(dutch_objectSpread2, Identifier.l_toc, 'Inhoudsopgave'), Identifier.l_copy_link, 'Link kopiëren'), Identifier.l_copied, 'Gekopieerd'), Identifier.l_from_current_pg, 'Van huidige pagina'), Identifier.l_search, 'Zoeken'), Identifier.l_search_result, 'resultaat gevonden'), Identifier.l_search_results, 'resultaten gevonden'), Identifier.l_my_list, 'Mijn lijst'), Identifier.l_list_no_items, 'Er staan nog geen items in uw lijst'), Identifier.l_clear_list, 'Lijst wissen'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(dutch_objectSpread2, Identifier.l_total, 'Totaal'), Identifier.l_download_list_pdf, 'Lijst als PDF downloaden'), Identifier.l_my_product_list, 'Mijn productenlijst'), Identifier.l_previous_page, 'Vorige pagina'), Identifier.l_next_page, 'Volgende pagina'), Identifier.l_accessibility, 'Toegankelijkheid'), Identifier.l_page, 'Pagina'), Identifier.l_unlock_full_version, 'Volledige versie ontgrendelen'), Identifier.l_published_by, 'Gepubliceerd door'), Identifier.l_buy, 'Koop'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(dutch_objectSpread2, Identifier.l_buy_subscription, 'Abonnement kopen'), Identifier.l_subscribe, 'Abonneer u op'), Identifier.l_password_protected, 'Het flipbook is beveiligd met een wachtwoord'), Identifier.l_enter_password_to_view, 'Voer het wachtwoord in om de flipbook te bekijken'), Identifier.l_enter_password, 'Wachtwoord invoeren'), Identifier.l_invalid_password, 'Ongeldig wachtwoord'), Identifier.l_unlock, 'Ontgrendelen'), Identifier.l_zoom, 'Zoom'), Identifier.l_zoom_in, 'Inzoomen'), Identifier.l_zoom_out, 'Uitzoomen'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(dutch_objectSpread2, Identifier.l_pages, "Pagina's"), Identifier.l_print, 'Afdrukken'), Identifier.l_download, 'Downloaden'), Identifier.l_share, 'Deel'), Identifier.l_enter_fs, 'Volledig scherm'), Identifier.l_exit_fs, 'Volledig scherm verlaten'), Identifier.l_download_pdf_order, 'PDF-bestelling downloaden'), Identifier.l_contact_details, 'Contactgegevens'), Identifier.l_send_order_modal_text, 'Om de bestelling te versturen, moet u uw contactgegevens invoeren. Zodra wij uw bestelling hebben ontvangen, nemen wij zo snel mogelijk contact met u op.'), Identifier.l_send_order_button, 'Bestelling versturen'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(dutch_objectSpread2, Identifier.l_send_order_select, 'Selecteer...'), Identifier.l_order_successful_text, 'Bedankt voor uw bestelling. Wij nemen spoedig contact met u op!'), Identifier.l_lead_form_error_email, 'De invoer moet een e-mailadres zijn.'), Identifier.l_lead_form_error_tel, 'De invoer moet een telefoonnummer zijn.'), Identifier.l_lead_form_error_url, 'De invoer moet een website zijn.'), Identifier.l_order_confirmation_header, 'Bestelling is verzonden'), Identifier.l_agree_to_privacy_policy, 'Ik ga akkoord met het privacybeleid van het volgende bedrijf:'), Identifier.l_download_list, 'Lijst downloaden'), Identifier.l_background_sound_on, 'Geluid aan'), Identifier.l_background_sound_off, 'Geluid uit'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(dutch_objectSpread2, Identifier.l_response_submitted_message, 'Bedankt! Je reactie is ingediend.'), Identifier.orderPdfHeader, 'Lijst gegenereerd vanuit {flipbook_name} op {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Product'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Prijs'), Identifier.orderPdfAmount, 'Hoeveelheid'), Identifier.orderPdfTotal, 'Totaal'), Identifier.orderPdfFooter, 'Eindtotaal'), Identifier.l_retake_quiz, 'Quiz opnieuw doen'), Identifier.l_view_results, 'Resultaten bekijken'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(dutch_objectSpread2, Identifier.l_lead_dropdown_select, 'Selecteer...'), Identifier.l_product_required_personalization, 'Dit product vereist personalisatie.'), Identifier.l_order_not_sent, 'Bestelling niet verzonden'), Identifier.l_try_again, 'Probeer opnieuw'), Identifier.l_connection_issue, 'Mogelijk verbindingsprobleem. Probeer het opnieuw.'), Identifier.l_personalization, 'Personalisatie'), Identifier.l_character, 'karakter'), Identifier.l_cancel, 'Annuleren'), Identifier.l_clear_list_confirmation, 'Lijst wissen?'), Identifier.l_delete_list_message, 'Deze actie zal alle items uit je lijst permanent verwijderen. Weet je zeker dat je wilt doorgaan?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(dutch_objectSpread2, Identifier.l_minimum_order_value, 'Minimale bestelwaarde:'), Identifier.l_please_add_more_items, 'Voeg meer artikelen toe om af te rekenen.'), Identifier.l_submit_button, 'Verzenden'), Identifier.l_previous_button, 'Vorige'), Identifier.l_next_button, 'Volgende'), Identifier.l_complete_button, 'Voltooien'), Identifier.l_quiz_was_updated, 'De quiz is recent bijgewerkt.'), Identifier.l_refresh_page_button, 'Ververs deze pagina.'), Identifier.l_question, 'Vraag'), Identifier.l_answered, 'Beantwoord'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(dutch_objectSpread2, Identifier.l_explanation, 'Uitleg'), Identifier.l_refresh_page_text, 'Ververs de pagina om verder te gaan.'), Identifier.l_number_of_questions, 'Aantal vragen'), Identifier.l_correct_answers, 'Juiste antwoorden')), translations_accessibilityDefaults);
/* harmony default export */ var dutch = (Nederlands);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/english/index.ts

var english_objectSpread2;
function english_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function english_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? english_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : english_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var English = english_objectSpread((english_objectSpread2 = {
  code: 'en-US'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(english_objectSpread2, Identifier.l_toc, 'Table of contents'), Identifier.l_copy_link, 'Copy link'), Identifier.l_copied, 'Copied'), Identifier.l_from_current_pg, 'From current page'), Identifier.l_search, 'Search'), Identifier.l_search_result, 'result found'), Identifier.l_search_results, 'results found'), Identifier.l_my_list, 'My list'), Identifier.l_list_no_items, 'There are no items in your list yet'), Identifier.l_clear_list, 'Clear list'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(english_objectSpread2, Identifier.l_total, 'Total'), Identifier.l_download_list_pdf, 'Download list as PDF'), Identifier.l_my_product_list, 'My product list'), Identifier.l_previous_page, 'Previous page'), Identifier.l_next_page, 'Next page'), Identifier.l_accessibility, 'Accessibility'), Identifier.l_page, 'Page'), Identifier.l_unlock_full_version, 'Unlock full version'), Identifier.l_published_by, 'Published by'), Identifier.l_buy, 'Buy'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(english_objectSpread2, Identifier.l_buy_subscription, 'Buy subscription'), Identifier.l_subscribe, 'Subscribe'), Identifier.l_password_protected, 'The flipbook is password protected'), Identifier.l_enter_password_to_view, 'Enter the password to view the flipbook'), Identifier.l_enter_password, 'Enter password'), Identifier.l_invalid_password, 'Invalid password'), Identifier.l_unlock, 'Unlock'), Identifier.l_zoom, 'Zoom'), Identifier.l_zoom_in, 'Zoom in'), Identifier.l_zoom_out, 'Zoom out'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(english_objectSpread2, Identifier.l_pages, 'Pages'), Identifier.l_print, 'Print'), Identifier.l_download, 'Download'), Identifier.l_share, 'Share'), Identifier.l_enter_fs, 'Full screen'), Identifier.l_exit_fs, 'Exit full screen'), Identifier.l_download_pdf_order, 'Download order PDF'), Identifier.l_contact_details, 'Contact details'), Identifier.l_send_order_modal_text, 'To send the order you must enter your contact details. Once we receive your order, we will get back to you as soon as possible.'), Identifier.l_send_order_button, 'Send order'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(english_objectSpread2, Identifier.l_send_order_select, 'Select...'), Identifier.l_order_successful_text, 'Thank you for ordering. We will contact you soon!'), Identifier.l_lead_form_error_email, 'Input must be an email address.'), Identifier.l_lead_form_error_tel, 'Input must be a phone number.'), Identifier.l_lead_form_error_url, 'Input must be a website.'), Identifier.l_order_confirmation_header, 'Order was sent'), Identifier.l_agree_to_privacy_policy, 'I agree to the following company\'s Privacy Policy:'), Identifier.l_download_list, 'Download list'), Identifier.l_background_sound_on, 'Sound on'), Identifier.l_background_sound_off, 'Sound off'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(english_objectSpread2, Identifier.l_response_submitted_message, 'Thanks! Your response has been submitted.'), Identifier.orderPdfHeader, 'List generated from {flipbook_name} at {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Product'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Price'), Identifier.orderPdfAmount, 'Amount'), Identifier.orderPdfTotal, 'Total'), Identifier.orderPdfFooter, 'Grand total'), Identifier.l_retake_quiz, 'Retake quiz'), Identifier.l_view_results, 'View results'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(english_objectSpread2, Identifier.l_lead_dropdown_select, 'Select...'), Identifier.l_product_required_personalization, 'This product requires personalization.'), Identifier.l_order_not_sent, 'Order not sent'), Identifier.l_try_again, 'Try again'), Identifier.l_connection_issue, 'Possible connection issue. Please try again.'), Identifier.l_personalization, 'Personalization'), Identifier.l_character, 'character'), Identifier.l_cancel, 'Cancel'), Identifier.l_clear_list_confirmation, 'Clear list?'), Identifier.l_delete_list_message, 'This action will permanently delete all items from your list. Are you sure you want to continue?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(english_objectSpread2, Identifier.l_minimum_order_value, 'Minimum order value:'), Identifier.l_please_add_more_items, 'Please add more items to check out.'), Identifier.l_submit_button, 'Submit'), Identifier.l_previous_button, 'Previous'), Identifier.l_next_button, 'Next'), Identifier.l_complete_button, 'Complete'), Identifier.l_quiz_was_updated, 'The quiz was recently updated.'), Identifier.l_refresh_page_button, 'Refresh this page.'), Identifier.l_question, 'Question'), Identifier.l_answered, 'Answered'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(english_objectSpread2, Identifier.l_explanation, 'Explanation'), Identifier.l_refresh_page_text, 'Please refresh the page to continue.'), Identifier.l_number_of_questions, 'Number of questions'), Identifier.l_correct_answers, 'Correct answers')), translations_accessibilityDefaults);
/* harmony default export */ var english = (English);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/finnish/index.ts

var finnish_objectSpread2;
function finnish_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function finnish_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? finnish_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : finnish_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Suomi = finnish_objectSpread((finnish_objectSpread2 = {
  code: 'fi-FI'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(finnish_objectSpread2, Identifier.l_toc, 'Sisällysluettelo'), Identifier.l_copy_link, 'Kopioi linkki'), Identifier.l_copied, 'Kopioitu'), Identifier.l_from_current_pg, 'Nykyiseltä sivulta'), Identifier.l_search, 'Hae'), Identifier.l_search_result, 'Hakutulos'), Identifier.l_search_results, 'Hakutulokset'), Identifier.l_my_list, 'Oma lista'), Identifier.l_list_no_items, 'Listalle ei ole kohteita'), Identifier.l_clear_list, 'Tyhjennä lista'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(finnish_objectSpread2, Identifier.l_total, 'Loppusumma'), Identifier.l_download_list_pdf, 'Lataa lista PDF-tiedostona'), Identifier.l_my_product_list, 'Tuoteluettelo'), Identifier.l_previous_page, 'Edellinen sivu'), Identifier.l_next_page, 'Seuraava sivu'), Identifier.l_accessibility, 'Saavutettava'), Identifier.l_page, 'Sivu'), Identifier.l_unlock_full_version, 'Avaa täysi versio'), Identifier.l_published_by, 'Sivuston on julkaissut '), Identifier.l_buy, 'Osta'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(finnish_objectSpread2, Identifier.l_buy_subscription, 'Osta tilaus'), Identifier.l_subscribe, 'Tilaa'), Identifier.l_password_protected, 'Flipbook on suojattu salasanalla'), Identifier.l_enter_password_to_view, 'Kirjaa salasana nähdäksesi flipbookin'), Identifier.l_enter_password, 'Kirjaa salasana'), Identifier.l_invalid_password, 'Väärä salasana'), Identifier.l_unlock, 'Lukitus avattu'), Identifier.l_zoom, 'Suurenna'), Identifier.l_zoom_in, 'Lähennä'), Identifier.l_zoom_out, 'Loitonna'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(finnish_objectSpread2, Identifier.l_pages, 'Sivut'), Identifier.l_print, 'Tulosta'), Identifier.l_download, 'Lataa'), Identifier.l_share, 'Jaa'), Identifier.l_enter_fs, 'Koko näyttö'), Identifier.l_exit_fs, 'Poistu koko näytön tilasta'), Identifier.l_download_pdf_order, 'Lataa tilaus PDF-tiedostona'), Identifier.l_contact_details, 'Yhteystiedot'), Identifier.l_send_order_modal_text, 'Tilauksen lähettämistä varten sinun tulee antaa yhteystiedot. Kun olemme ottaneet tilauksesi vastaan, olemme sinuun yhteydessä mahdollisimman pian.'), Identifier.l_send_order_button, 'Lähetä tilaus'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(finnish_objectSpread2, Identifier.l_send_order_select, 'Valitse...'), Identifier.l_order_successful_text, 'Kiitos tilauksestasi. Otamme sinuun pian yhteyttä!'), Identifier.l_lead_form_error_email, 'Tiedoissa on oltava sähköpostiosoite.'), Identifier.l_lead_form_error_tel, 'Tiedoissa on oltava puhelinnumero.'), Identifier.l_lead_form_error_url, 'Tiedoissa on oltava verkkosivusto.'), Identifier.l_order_confirmation_header, 'Tilaus lähetettiin'), Identifier.l_agree_to_privacy_policy, 'Hyväksyn yrityksen tietosuojakäytännön:'), Identifier.l_download_list, 'Lataa lista'), Identifier.l_background_sound_on, 'Ääni päällä'), Identifier.l_background_sound_off, 'Ääni pois päältä'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(finnish_objectSpread2, Identifier.l_response_submitted_message, 'Kiitos! Vastauksesi on lähetetty.'), Identifier.orderPdfHeader, 'Lista luotu {flipbook_name}-sovelluksesta {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Tuote'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Hinta'), Identifier.orderPdfAmount, 'Määrä'), Identifier.orderPdfTotal, 'Yhteensä'), Identifier.orderPdfFooter, 'Lopullinen summa'), Identifier.l_retake_quiz, 'Suorita testi uudelleen'), Identifier.l_view_results, 'Näytä tulokset'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(finnish_objectSpread2, Identifier.l_lead_dropdown_select, 'Valitse...'), Identifier.l_product_required_personalization, 'Tämä tuote vaatii personointia.'), Identifier.l_order_not_sent, 'Tilausta ei lähetetty'), Identifier.l_try_again, 'Yritä uudelleen'), Identifier.l_connection_issue, 'Mahdollinen yhteysongelma. Yritä uudelleen.'), Identifier.l_personalization, 'Personointi'), Identifier.l_character, 'hahmo'), Identifier.l_cancel, 'Peruuta'), Identifier.l_clear_list_confirmation, 'Tyhjennä lista?'), Identifier.l_delete_list_message, 'Tämä toiminto poistaa kaikki kohteet pysyvästi listaltasi. Oletko varma, että haluat jatkaa?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(finnish_objectSpread2, Identifier.l_minimum_order_value, 'Vähimmäistilausarvo:'), Identifier.l_please_add_more_items, 'Lisää tuotteita tilauksen viimeistelemiseksi.'), Identifier.l_submit_button, 'Lähetä'), Identifier.l_previous_button, 'Edellinen'), Identifier.l_next_button, 'Seuraava'), Identifier.l_complete_button, 'Valmis'), Identifier.l_quiz_was_updated, 'Tietovisa päivitettiin hiljattain.'), Identifier.l_refresh_page_button, 'Päivitä tämä sivu.'), Identifier.l_question, 'Kysymys'), Identifier.l_answered, 'Vastattu'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(finnish_objectSpread2, Identifier.l_explanation, 'Selitys'), Identifier.l_refresh_page_text, 'Päivitä sivu jatkaaksesi.'), Identifier.l_number_of_questions, 'Kysymysten määrä'), Identifier.l_correct_answers, 'Oikeat vastaukset')), translations_accessibilityDefaults);
/* harmony default export */ var finnish = (Suomi);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/french/index.ts

var french_objectSpread2;
function french_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function french_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? french_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : french_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Française = french_objectSpread((french_objectSpread2 = {
  code: 'fr-FR'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(french_objectSpread2, Identifier.l_toc, 'Table des matières'), Identifier.l_copy_link, 'Copier le lien'), Identifier.l_copied, 'Copié'), Identifier.l_from_current_pg, 'Depuis la page actuelle'), Identifier.l_search, 'Recherche'), Identifier.l_search_result, 'résultat trouvé'), Identifier.l_search_results, 'résultats trouvés'), Identifier.l_my_list, 'Ma liste'), Identifier.l_list_no_items, 'Il n\'y a pas encore d\'articles dans votre liste'), Identifier.l_clear_list, 'Vider la liste'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(french_objectSpread2, Identifier.l_total, 'Total'), Identifier.l_download_list_pdf, 'Télécharger la liste en PDF'), Identifier.l_my_product_list, 'Ma liste de produits'), Identifier.l_previous_page, 'Page précédente'), Identifier.l_next_page, 'Page suivante'), Identifier.l_accessibility, 'Accessibilité'), Identifier.l_page, 'Page'), Identifier.l_unlock_full_version, 'Déverrouiller la version complète'), Identifier.l_published_by, 'Publié par'), Identifier.l_buy, 'Acheter'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(french_objectSpread2, Identifier.l_buy_subscription, 'Acheter un abonnement'), Identifier.l_subscribe, 'S\'abonner'), Identifier.l_password_protected, 'Le flipbook est protégé par un mot de passe'), Identifier.l_enter_password_to_view, 'Entrez le mot de passe pour visualiser le flipbook'), Identifier.l_enter_password, 'Entrez le mot de passe'), Identifier.l_invalid_password, 'Mot de passe invalide'), Identifier.l_unlock, 'Déverrouiller'), Identifier.l_zoom, 'Zoom'), Identifier.l_zoom_in, 'Zoom avant'), Identifier.l_zoom_out, 'Zoom arrière'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(french_objectSpread2, Identifier.l_pages, 'Pages'), Identifier.l_print, 'Imprimer'), Identifier.l_download, 'Télécharger'), Identifier.l_share, 'Partager'), Identifier.l_enter_fs, 'Plein écran'), Identifier.l_exit_fs, 'Quitter le mode plein écran'), Identifier.l_download_pdf_order, 'Télécharger le PDF de la commande'), Identifier.l_contact_details, 'Coordonnées'), Identifier.l_send_order_modal_text, 'Pour envoyer la commande, vous devez entrer vos coordonnées. Dès que nous recevrons votre commande, nous vous contacterons dès que possible.'), Identifier.l_send_order_button, 'Envoyer la commande'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(french_objectSpread2, Identifier.l_send_order_select, 'Sélectionner...'), Identifier.l_order_successful_text, 'Merci pour votre commande. Nous vous contacterons bientôt!'), Identifier.l_lead_form_error_email, 'L\'entrée doit être une adresse e-mail.'), Identifier.l_lead_form_error_tel, 'L\'entrée doit être un numéro de téléphone.'), Identifier.l_lead_form_error_url, 'L\'entrée doit être un site web.'), Identifier.l_order_confirmation_header, 'La commande a été envoyée'), Identifier.l_agree_to_privacy_policy, 'J\'accepte la politique de confidentialité de l\'entreprise suivante:'), Identifier.l_download_list, 'Télécharger la liste'), Identifier.l_background_sound_on, 'Son activé'), Identifier.l_background_sound_off, 'Son désactivé'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(french_objectSpread2, Identifier.l_response_submitted_message, 'Merci! Votre réponse a été soumise.'), Identifier.orderPdfHeader, 'Liste générée à partir de {flipbook_name} le {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produit'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Prix'), Identifier.orderPdfAmount, 'Quantité'), Identifier.orderPdfTotal, 'Total'), Identifier.orderPdfFooter, 'Total général'), Identifier.l_retake_quiz, 'Refaire le quiz'), Identifier.l_view_results, 'Voir les résultats'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(french_objectSpread2, Identifier.l_lead_dropdown_select, 'Sélectionner...'), Identifier.l_product_required_personalization, 'Ce produit nécessite une personnalisation.'), Identifier.l_order_not_sent, 'Commande non envoyée'), Identifier.l_try_again, 'Essayez à nouveau'), Identifier.l_connection_issue, 'Problème de connexion possible. Veuillez réessayer.'), Identifier.l_personalization, 'Personnalisation'), Identifier.l_character, 'caractère'), Identifier.l_cancel, 'Annuler'), Identifier.l_clear_list_confirmation, 'Effacer la liste?'), Identifier.l_delete_list_message, 'Cette action supprimera définitivement tous les éléments de votre liste. Êtes-vous sûr de vouloir continuer ?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(french_objectSpread2, Identifier.l_minimum_order_value, 'Valeur minimale de commande:'), Identifier.l_please_add_more_items, 'Veuillez ajouter plus d\'articles pour finaliser la commande.'), Identifier.l_submit_button, 'Soumettre'), Identifier.l_previous_button, 'Précédent'), Identifier.l_next_button, 'Suivant'), Identifier.l_complete_button, 'Terminer'), Identifier.l_quiz_was_updated, 'Le quiz a été récemment mis à jour.'), Identifier.l_refresh_page_button, 'Rafraîchissez cette page.'), Identifier.l_question, 'Question'), Identifier.l_answered, 'Répondu'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(french_objectSpread2, Identifier.l_explanation, 'Explication'), Identifier.l_refresh_page_text, 'Veuillez actualiser la page pour continuer.'), Identifier.l_number_of_questions, 'Nombre de questions'), Identifier.l_correct_answers, 'Bonnes réponses')), translations_accessibilityDefaults);
/* harmony default export */ var french = (Française);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/german/index.ts

var german_objectSpread2;
function german_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function german_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? german_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : german_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Deutsch = german_objectSpread((german_objectSpread2 = {
  code: 'de-DE'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(german_objectSpread2, Identifier.l_toc, 'Inhaltsverzeichnis'), Identifier.l_copy_link, 'Link kopieren'), Identifier.l_copied, 'Kopiert'), Identifier.l_from_current_pg, 'Von der aktuellen Seite'), Identifier.l_search, 'Suche'), Identifier.l_search_result, 'Ergebnis gefunden'), Identifier.l_search_results, 'Ergebnisse gefunden'), Identifier.l_my_list, 'Meine Liste'), Identifier.l_list_no_items, 'Es sind noch keine Einträge in Ihrer Liste vorhanden'), Identifier.l_clear_list, 'Liste leeren'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(german_objectSpread2, Identifier.l_total, 'Gesamt'), Identifier.l_download_list_pdf, 'Liste als PDF herunterladen'), Identifier.l_my_product_list, 'Meine Produktliste'), Identifier.l_previous_page, 'Vorherige Seite'), Identifier.l_next_page, 'Nächste Seite'), Identifier.l_accessibility, 'Zugänglichkeit'), Identifier.l_page, 'Seite'), Identifier.l_unlock_full_version, 'Vollversion freischalten'), Identifier.l_published_by, 'Herausgegeben von'), Identifier.l_buy, 'Kaufen'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(german_objectSpread2, Identifier.l_buy_subscription, 'Abonnement kaufen'), Identifier.l_subscribe, 'Abonnieren'), Identifier.l_password_protected, 'Das Flipbook ist passwortgeschützt'), Identifier.l_enter_password_to_view, 'Geben Sie das Passwort ein, um das Flipbook anzuzeigen'), Identifier.l_enter_password, 'Passwort eingeben'), Identifier.l_invalid_password, 'Ungültiges Passwort'), Identifier.l_unlock, 'Freischalten'), Identifier.l_zoom, 'Zoomen'), Identifier.l_zoom_in, 'Hineinzoomen'), Identifier.l_zoom_out, 'Herauszoomen'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(german_objectSpread2, Identifier.l_pages, 'Seiten'), Identifier.l_print, 'Drucken'), Identifier.l_download, 'Download'), Identifier.l_share, 'Teilen'), Identifier.l_enter_fs, 'Vollbild'), Identifier.l_exit_fs, 'Vollbildmodus verlassen'), Identifier.l_download_pdf_order, 'Bestell-PDF herunterladen'), Identifier.l_contact_details, 'Kontaktdetails'), Identifier.l_send_order_modal_text, 'Um die Bestellung abzusenden, müssen Sie Ihre Kontaktdaten eingeben. Sobald wir Ihre Bestellung erhalten haben, werden wir uns schnellstmöglich bei Ihnen melden.'), Identifier.l_send_order_button, 'Bestellung absenden'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(german_objectSpread2, Identifier.l_send_order_select, 'Wählen...'), Identifier.l_order_successful_text, 'Vielen Dank für Ihre Bestellung. Wir werden uns in Kürze bei Ihnen melden!'), Identifier.l_lead_form_error_email, 'Die Eingabe muss eine E-Mail-Adresse sein.'), Identifier.l_lead_form_error_tel, 'Die Eingabe muss eine Telefonnummer sein.'), Identifier.l_lead_form_error_url, 'Die Eingabe muss eine Website sein.'), Identifier.l_order_confirmation_header, 'Bestellung wurde abgeschickt'), Identifier.l_agree_to_privacy_policy, 'Ich stimme der Datenschutzrichtlinie des folgenden Unternehmens zu:'), Identifier.l_download_list, 'Liste herunterladen'), Identifier.l_background_sound_on, 'Ton an'), Identifier.l_background_sound_off, 'Ton aus'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(german_objectSpread2, Identifier.l_response_submitted_message, 'Danke! Ihre Antwort wurde übermittelt.'), Identifier.orderPdfHeader, 'Liste generiert von {flipbook_name} am {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produkt'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Preis'), Identifier.orderPdfAmount, 'Menge'), Identifier.orderPdfTotal, 'Gesamt'), Identifier.orderPdfFooter, 'Gesamtsumme'), Identifier.l_retake_quiz, 'Quiz erneut machen'), Identifier.l_view_results, 'Ergebnisse anzeigen'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(german_objectSpread2, Identifier.l_lead_dropdown_select, 'Wählen...'), Identifier.l_product_required_personalization, 'Dieses Produkt erfordert Personalisierung.'), Identifier.l_order_not_sent, 'Bestellung nicht gesendet'), Identifier.l_try_again, 'Erneut versuchen'), Identifier.l_connection_issue, 'Mögliches Verbindungsproblem. Bitte versuchen Sie es erneut.'), Identifier.l_personalization, 'Personalisierung'), Identifier.l_character, 'Charakter'), Identifier.l_cancel, 'Abbrechen'), Identifier.l_clear_list_confirmation, 'Liste löschen?'), Identifier.l_delete_list_message, 'Diese Aktion wird alle Elemente in Ihrer Liste dauerhaft löschen. Sind Sie sicher, dass Sie fortfahren möchten?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(german_objectSpread2, Identifier.l_minimum_order_value, 'Mindestbestellwert:'), Identifier.l_please_add_more_items, 'Bitte fügen Sie weitere Artikel hinzu, um den Kauf abzuschließen.'), Identifier.l_submit_button, 'Absenden'), Identifier.l_previous_button, 'Zurück'), Identifier.l_next_button, 'Weiter'), Identifier.l_complete_button, 'Abschließen'), Identifier.l_quiz_was_updated, 'Das Quiz wurde kürzlich aktualisiert.'), Identifier.l_refresh_page_button, 'Aktualisieren Sie diese Seite.'), Identifier.l_question, 'Frage'), Identifier.l_answered, 'Beantwortet'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(german_objectSpread2, Identifier.l_explanation, 'Erklärung'), Identifier.l_refresh_page_text, 'Bitte aktualisieren Sie die Seite, um fortzufahren.'), Identifier.l_number_of_questions, 'Anzahl der Fragen'), Identifier.l_correct_answers, 'Richtige Antworten')), translations_accessibilityDefaults);
/* harmony default export */ var german = (Deutsch);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/greek/index.ts

var greek_objectSpread2;
function greek_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function greek_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? greek_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : greek_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var ελληνικά = greek_objectSpread((greek_objectSpread2 = {
  code: 'el-GR'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(greek_objectSpread2, Identifier.l_toc, 'Πίνακας περιεχομένων'), Identifier.l_copy_link, 'Αντιγραφή συνδέσμου'), Identifier.l_copied, 'Αντιγράφηκε'), Identifier.l_from_current_pg, 'Από την τρέχουσα σελίδα'), Identifier.l_search, 'Αναζήτηση'), Identifier.l_search_result, 'βρέθηκε αποτέλεσμα'), Identifier.l_search_results, 'βρέθηκαν αποτελέσματα'), Identifier.l_my_list, 'Κατάλογος μου'), Identifier.l_list_no_items, 'Δεν υπάρχουν ακόμα στοιχεία στη λίστα σας'), Identifier.l_clear_list, 'Εκκαθάριση λίστας'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(greek_objectSpread2, Identifier.l_total, 'Σύνολο'), Identifier.l_download_list_pdf, 'Λήψη λίστας ως PDF'), Identifier.l_my_product_list, 'Η λίστα των προϊόντων μου'), Identifier.l_previous_page, 'Προηγούμενη σελίδα'), Identifier.l_next_page, 'Επόμενη σελίδα'), Identifier.l_accessibility, 'Προσβασιμότητα'), Identifier.l_page, 'Σελίδα'), Identifier.l_unlock_full_version, 'Ξεκλειδώστε την πλήρη έκδοση'), Identifier.l_published_by, 'Δημοσιεύθηκε από '), Identifier.l_buy, 'Αγοράστε'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(greek_objectSpread2, Identifier.l_buy_subscription, 'Αγοράστε συνδρομή'), Identifier.l_subscribe, 'Εγγραφή'), Identifier.l_password_protected, 'Το φλιπ- μπουκ προστατεύεται με κωδικό πρόσβασης'), Identifier.l_enter_password_to_view, 'Εισάγετε τον κωδικό πρόσβασης για να δείτε το φλιπ-μπουκ'), Identifier.l_enter_password, 'Πληκτρολογήστε τον κωδικό πρόσβασης'), Identifier.l_invalid_password, 'Μη έγκυρος κωδικός πρόσβασης'), Identifier.l_unlock, 'Ξεκλείδωμα'), Identifier.l_zoom, 'Μεγέθυνση'), Identifier.l_zoom_in, 'Μεγέθυνση'), Identifier.l_zoom_out, 'Σμίκρυνση'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(greek_objectSpread2, Identifier.l_pages, 'Σελίδες'), Identifier.l_print, 'Εκτύπωση'), Identifier.l_download, 'Λήψη'), Identifier.l_share, 'Κοινοποίηση'), Identifier.l_enter_fs, 'Πλήρης οθόνη'), Identifier.l_exit_fs, 'Έξοδος από την πλήρη οθόνη'), Identifier.l_download_pdf_order, 'Λήψη παραγγελίας PDF'), Identifier.l_contact_details, 'Στοιχεία επικοινωνίας'), Identifier.l_send_order_modal_text, 'Για να στείλετε την παραγγελία πρέπει να εισάγετε τα στοιχεία επαφής σας. Μόλις λάβουμε την παραγγελία σας, θα επικοινωνήσουμε μαζί σας το συντομότερο δυνατό.'), Identifier.l_send_order_button, 'Αποστολή παραγγελίας'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(greek_objectSpread2, Identifier.l_send_order_select, 'Επιλέγω...'), Identifier.l_order_successful_text, 'Σας ευχαριστούμε για την παραγγελία. Θα επικοινωνήσουμε μαζί σας σύντομα!'), Identifier.l_lead_form_error_email, 'Τα δεδομένα πρέπει να περιλαμβάνουν μια διεύθυνση ηλεκτρονικού ταχυδρομείου.'), Identifier.l_lead_form_error_tel, 'Τα δεδομένα πρέπει να περιλαμβάνουν έναν αριθμό τηλεφώνου.'), Identifier.l_lead_form_error_url, 'Τα δεδομένα πρέπει να περιλαμβάνει έναν ιστότοπο.'), Identifier.l_order_confirmation_header, 'Η παραγγελία εστάλη'), Identifier.l_agree_to_privacy_policy, 'Συμφωνώ με την πολιτική απορρήτου της ακόλουθης εταιρείας:'), Identifier.l_download_list, 'Λήψη λίστας'), Identifier.l_background_sound_on, 'Ήχος ενεργοποιημένος'), Identifier.l_background_sound_off, 'Ήχος απενεργοποιημένος'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(greek_objectSpread2, Identifier.l_response_submitted_message, 'Ευχαριστούμε! Η απάντησή σας υποβλήθηκε.'), Identifier.orderPdfHeader, 'Λίστα δημιουργήθηκε από το {flipbook_name} στις {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Προϊόν'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Τιμή'), Identifier.orderPdfAmount, 'Ποσότητα'), Identifier.orderPdfTotal, 'Σύνολο'), Identifier.orderPdfFooter, 'Γενικό σύνολο'), Identifier.l_retake_quiz, 'Ξανακάνε το κουίζ'), Identifier.l_view_results, 'Δες τα αποτελέσματα'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(greek_objectSpread2, Identifier.l_lead_dropdown_select, 'Επιλέγω...'), Identifier.l_product_required_personalization, 'Αυτό το προϊόν απαιτεί εξατομίκευση.'), Identifier.l_order_not_sent, 'Η παραγγελία δεν εστάλη'), Identifier.l_try_again, 'Δοκιμάστε ξανά'), Identifier.l_connection_issue, 'Πιθανό πρόβλημα σύνδεσης. Παρακαλώ προσπαθήστε ξανά.'), Identifier.l_personalization, 'Εξατομίκευση'), Identifier.l_character, 'χαρακτήρας'), Identifier.l_cancel, 'Ακύρωση'), Identifier.l_clear_list_confirmation, 'Εκκαθάριση λίστας;'), Identifier.l_delete_list_message, 'Αυτή η ενέργεια θα διαγράψει οριστικά όλα τα στοιχεία από τη λίστα σας. Είστε σίγουροι ότι θέλετε να συνεχίσετε;'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(greek_objectSpread2, Identifier.l_minimum_order_value, 'Ελάχιστη αξία παραγγελίας:'), Identifier.l_please_add_more_items, 'Παρακαλώ προσθέστε περισσότερα προϊόντα για να ολοκληρώσετε την αγορά.'), Identifier.l_submit_button, 'Υποβολή'), Identifier.l_previous_button, 'Προηγούμενο'), Identifier.l_next_button, 'Επόμενο'), Identifier.l_complete_button, 'Ολοκλήρωση'), Identifier.l_quiz_was_updated, 'Το κουίζ ενημερώθηκε πρόσφατα.'), Identifier.l_refresh_page_button, 'Ανανεώστε αυτή τη σελίδα.'), Identifier.l_question, 'Ερώτηση'), Identifier.l_answered, 'Απαντήθηκε'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(greek_objectSpread2, Identifier.l_explanation, 'Επεξήγηση'), Identifier.l_refresh_page_text, 'Ανανεώστε τη σελίδα για να συνεχίσετε.'), Identifier.l_number_of_questions, 'Αριθμός ερωτήσεων'), Identifier.l_correct_answers, 'Σωστές απαντήσεις')), translations_accessibilityDefaults);
/* harmony default export */ var greek = (ελληνικά);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/hebrew/index.ts

var hebrew_objectSpread2;
function hebrew_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function hebrew_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? hebrew_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : hebrew_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Hebrew = hebrew_objectSpread((hebrew_objectSpread2 = {
  code: 'he-IL'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hebrew_objectSpread2, Identifier.l_toc, 'תוכן העניינים'), Identifier.l_copy_link, 'העתק קישור'), Identifier.l_copied, 'הועתק'), Identifier.l_from_current_pg, 'מהדף הנוכחי'), Identifier.l_search, 'חיפוש'), Identifier.l_search_result, 'תוצאה נמצאה'), Identifier.l_search_results, 'תוצאות נמצאו'), Identifier.l_my_list, 'הרשימה שלי'), Identifier.l_list_no_items, 'אין עדין חפצים ברשימה שלך'), Identifier.l_clear_list, 'נקה רשימה'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hebrew_objectSpread2, Identifier.l_total, 'סך הכל'), Identifier.l_download_list_pdf, 'הורד רשימה כקובץ PDF'), Identifier.l_my_product_list, 'רשימת המוצרים שלי'), Identifier.l_previous_page, 'דף הקודם'), Identifier.l_next_page, 'דף הבא'), Identifier.l_accessibility, 'נגישות'), Identifier.l_page, 'דף'), Identifier.l_unlock_full_version, 'פתח את הגרסה המלאה'), Identifier.l_published_by, 'פורסם על ידי '), Identifier.l_buy, 'קנה'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hebrew_objectSpread2, Identifier.l_buy_subscription, 'קנה מנוי'), Identifier.l_subscribe, 'הירשם'), Identifier.l_password_protected, 'ה-Flipbook מוגן באמצעות סיסמא'), Identifier.l_enter_password_to_view, 'הכנס את הסיסמא כדי לצפות בFlipbook'), Identifier.l_enter_password, 'הכנס סיסמא'), Identifier.l_invalid_password, 'סיסמא שגויה'), Identifier.l_unlock, 'פתח'), Identifier.l_zoom, 'זום'), Identifier.l_zoom_in, 'זום אין'), Identifier.l_zoom_out, 'זום אאוט'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hebrew_objectSpread2, Identifier.l_pages, 'דפים'), Identifier.l_print, 'הדפס'), Identifier.l_download, 'הורד'), Identifier.l_share, 'שתף'), Identifier.l_enter_fs, 'מסך מלא'), Identifier.l_exit_fs, 'צא ממסך מלא'), Identifier.l_download_pdf_order, 'הורד הזמנה בPDF'), Identifier.l_contact_details, 'פרטי איש קשר'), Identifier.l_send_order_modal_text, 'על מנת לשלוח את ההזמנה עליכם להכניס פרטי איש קשר. ברגע שנקבל את הזמנתכם, אנחנו נחזור אליכם בהקדם האפשרי.'), Identifier.l_send_order_button, 'שלח הזמנה'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hebrew_objectSpread2, Identifier.l_send_order_select, 'בחר...'), Identifier.l_order_successful_text, 'תודה על הזמנתך. אנחנו ניצור איתך קשר בקרוב!'), Identifier.l_lead_form_error_email, 'הקלט חייב להיות כתובת אימייל.'), Identifier.l_lead_form_error_tel, 'הקלט חייב להיות מספר פלאפון.'), Identifier.l_lead_form_error_url, 'הקלט חייב להיות אתר.'), Identifier.l_order_confirmation_header, 'הזמנה נשלחה'), Identifier.l_agree_to_privacy_policy, 'אני מסכים למדיניות הפרט של החברה הבאה:'), Identifier.l_download_list, 'הורד רשימה'), Identifier.l_background_sound_on, 'צליל מופעל'), Identifier.l_background_sound_off, 'צליל מכובה'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hebrew_objectSpread2, Identifier.l_response_submitted_message, 'תודה! התשובה שלך נשלחה.'), Identifier.orderPdfHeader, '{flipbook_name} - {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'מוצר'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'מחיר'), Identifier.orderPdfAmount, 'כמות'), Identifier.orderPdfTotal, 'סהכ'), Identifier.orderPdfFooter, 'סהכ סופי'), Identifier.l_retake_quiz, 'לעבור את החידון שוב'), Identifier.l_view_results, 'הצג תוצאות'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hebrew_objectSpread2, Identifier.l_lead_dropdown_select, 'בחר...'), Identifier.l_product_required_personalization, 'מוצר זה דורש התאמה אישית.'), Identifier.l_order_not_sent, 'הזמנה לא נשלחה'), Identifier.l_try_again, 'נסה שוב'), Identifier.l_connection_issue, 'ייתכן שיש בעיית חיבור. אנא נסה שוב.'), Identifier.l_personalization, 'התאמה אישית'), Identifier.l_character, 'דמות'), Identifier.l_cancel, 'בטל'), Identifier.l_clear_list_confirmation, 'נקה רשימה?'), Identifier.l_delete_list_message, 'פעולה זו תמחק לצמיתות את כל הפריטים מהרשימה שלך. האם אתה בטוח שברצונך להמשיך?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hebrew_objectSpread2, Identifier.l_minimum_order_value, 'ערך הזמנה מינימלי:'), Identifier.l_please_add_more_items, 'אנא הוסף פריטים נוספים לתשלום.'), Identifier.l_submit_button, 'שלח'), Identifier.l_previous_button, 'הקודם'), Identifier.l_next_button, 'הבא'), Identifier.l_complete_button, 'השלם'), Identifier.l_quiz_was_updated, 'החידון עודכן לאחרונה.'), Identifier.l_refresh_page_button, 'רענן דף זה.'), Identifier.l_question, 'שאלה'), Identifier.l_answered, 'נענה'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hebrew_objectSpread2, Identifier.l_explanation, 'הסבר'), Identifier.l_refresh_page_text, 'אנא רענן את הדף כדי להמשיך.'), Identifier.l_number_of_questions, 'מספר שאלות'), Identifier.l_correct_answers, 'תשובות נכונות')), translations_accessibilityDefaults);
/* harmony default export */ var hebrew = (Hebrew);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/hungarian/index.ts

var hungarian_objectSpread2;
function hungarian_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function hungarian_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? hungarian_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : hungarian_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Magyar = hungarian_objectSpread((hungarian_objectSpread2 = {
  code: 'hu-HU'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hungarian_objectSpread2, Identifier.l_toc, 'Tartalomjegyzék'), Identifier.l_copy_link, 'Link másolása'), Identifier.l_copied, 'Másolva'), Identifier.l_from_current_pg, 'A jelenlegi oldalról'), Identifier.l_search, 'Keresés'), Identifier.l_search_result, 'találat'), Identifier.l_search_results, 'találat'), Identifier.l_my_list, 'Bevásárlólistám'), Identifier.l_list_no_items, 'Még nincsenek elemek a listámban'), Identifier.l_clear_list, 'Lista törlése'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hungarian_objectSpread2, Identifier.l_total, 'Összesen'), Identifier.l_download_list_pdf, 'Bevásárlólista letöltése PDF formátumban'), Identifier.l_my_product_list, 'Bevásárlólistám'), Identifier.l_previous_page, 'Előző oldal'), Identifier.l_next_page, 'Következő oldal'), Identifier.l_accessibility, 'Hozzáférhetőség'), Identifier.l_page, 'oldal'), Identifier.l_unlock_full_version, 'Vásárolja meg a teljes verziót'), Identifier.l_published_by, 'Kiadta'), Identifier.l_buy, 'Vásárlás'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hungarian_objectSpread2, Identifier.l_buy_subscription, 'Vásároljon előfizetést'), Identifier.l_subscribe, 'Feliratkozás'), Identifier.l_password_protected, 'A flipbook jelszóval védett'), Identifier.l_enter_password_to_view, 'Írja be a jelszót a flipbook megtekintéséhez'), Identifier.l_enter_password, 'Írja be a jelszót'), Identifier.l_invalid_password, 'Érvénytelen jelszó'), Identifier.l_unlock, 'Megtekint'), Identifier.l_zoom, 'Nagyítás'), Identifier.l_zoom_in, 'Ráközelítés'), Identifier.l_zoom_out, 'Kicsinyítés'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hungarian_objectSpread2, Identifier.l_pages, 'Oldalak'), Identifier.l_print, 'Nyomtatás'), Identifier.l_download, 'Letöltés'), Identifier.l_share, 'Megosztás'), Identifier.l_enter_fs, 'Teljes képernyő'), Identifier.l_exit_fs, 'Kilépés a teljes képernyőből'), Identifier.l_download_pdf_order, 'Letöltés'), Identifier.l_contact_details, 'Elérhetőségek'), Identifier.l_send_order_modal_text, 'A rendelés elküldéséhez kérjük adja meg az elérhetőségeit. Amint megkaptuk a rendelését, a lehető leghamarabb felvesszük Önnel a kapcsolatot.'), Identifier.l_send_order_button, 'Rendelés küldése'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hungarian_objectSpread2, Identifier.l_send_order_select, 'Válassza ki...'), Identifier.l_order_successful_text, 'Köszönjük a rendelést. Hamarosan felvesszük Önnel a kapcsolatot!'), Identifier.l_lead_form_error_email, 'Érvénytelen e-mail cím.'), Identifier.l_lead_form_error_tel, 'Érvénytelen telefonszám.'), Identifier.l_lead_form_error_url, 'Érvénytelen weboldal.'), Identifier.l_order_confirmation_header, 'Rendelés elküldve'), Identifier.l_agree_to_privacy_policy, 'Elfogadom az alábbi cég adatvédelmi szabályzatát:'), Identifier.l_download_list, 'Lista letöltése'), Identifier.l_background_sound_on, 'Hang bekapcsolva'), Identifier.l_background_sound_off, 'Hang kikapcsolva'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hungarian_objectSpread2, Identifier.l_response_submitted_message, 'Köszönjük! Válasza be lett nyújtva.'), Identifier.orderPdfHeader, 'Lista generálva a {flipbook_name} alapján {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Termék'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Ár'), Identifier.orderPdfAmount, 'Mennyiség'), Identifier.orderPdfTotal, 'Összesen'), Identifier.orderPdfFooter, 'Végösszeg'), Identifier.l_retake_quiz, 'Teszt újraindítása'), Identifier.l_view_results, 'Eredmények megtekintése'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hungarian_objectSpread2, Identifier.l_lead_dropdown_select, 'Válassza ki...'), Identifier.l_product_required_personalization, 'Ez a termék személyre szabást igényel.'), Identifier.l_order_not_sent, 'Rendelés nem lett elküldve'), Identifier.l_try_again, 'Próbálja újra'), Identifier.l_connection_issue, 'Lehetséges kapcsolatprobléma. Kérjük, próbálja újra.'), Identifier.l_personalization, 'Személyre szabás'), Identifier.l_character, 'karakter'), Identifier.l_cancel, 'Mégse'), Identifier.l_clear_list_confirmation, 'Törölni a listát?'), Identifier.l_delete_list_message, 'Ez a művelet véglegesen törli az összes elemet a listájáról. Biztosan folytatni szeretné?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hungarian_objectSpread2, Identifier.l_minimum_order_value, 'Minimális rendelési érték:'), Identifier.l_please_add_more_items, 'Kérjük, adjon hozzá további tételeket a fizetéshez.'), Identifier.l_submit_button, 'Beküldés'), Identifier.l_previous_button, 'Előző'), Identifier.l_next_button, 'Következő'), Identifier.l_complete_button, 'Befejezés'), Identifier.l_quiz_was_updated, 'A kvízt nemrég frissítették.'), Identifier.l_refresh_page_button, 'Frissítse ezt az oldalt.'), Identifier.l_question, 'Kérdés'), Identifier.l_answered, 'Megválaszolva'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(hungarian_objectSpread2, Identifier.l_explanation, 'Magyarázat'), Identifier.l_refresh_page_text, 'Kérjük, frissítse az oldalt a folytatáshoz.'), Identifier.l_number_of_questions, 'Kérdések száma'), Identifier.l_correct_answers, 'Helyes válaszok')), translations_accessibilityDefaults);
/* harmony default export */ var hungarian = (Magyar);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/indonesian/index.ts

var indonesian_objectSpread2;
function indonesian_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function indonesian_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? indonesian_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : indonesian_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Indonesian = indonesian_objectSpread((indonesian_objectSpread2 = {
  code: 'id-ID'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(indonesian_objectSpread2, Identifier.l_toc, 'Daftar isi'), Identifier.l_copy_link, 'Salin tautan'), Identifier.l_copied, 'Disalin'), Identifier.l_from_current_pg, 'Dari halaman saat ini'), Identifier.l_search, 'Cari'), Identifier.l_search_result, 'Hasil ditemukan'), Identifier.l_search_results, 'Hasil ditemukan'), Identifier.l_my_list, 'Daftarku'), Identifier.l_list_no_items, 'Belum ada item di daftar Anda'), Identifier.l_clear_list, 'Hapus daftar'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(indonesian_objectSpread2, Identifier.l_total, 'Total'), Identifier.l_download_list_pdf, 'Unduh daftar sebagai PDF'), Identifier.l_my_product_list, 'Daftar produkku'), Identifier.l_previous_page, 'Halaman sebelumnya'), Identifier.l_next_page, 'Halaman berikutnya'), Identifier.l_accessibility, 'Aksesibilitas'), Identifier.l_page, 'Halaman'), Identifier.l_unlock_full_version, 'Buka versi lengkap'), Identifier.l_published_by, 'Dipublikasikan oleh '), Identifier.l_buy, 'Beli'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(indonesian_objectSpread2, Identifier.l_buy_subscription, 'Beli langganan'), Identifier.l_subscribe, 'Langganan'), Identifier.l_password_protected, 'Flipbook dilindungi kata sandi'), Identifier.l_enter_password_to_view, 'Masukkan kata sandi untuk melihat flipbook'), Identifier.l_enter_password, 'Masukkan kata sandi'), Identifier.l_invalid_password, 'Kata sandi tidak valid'), Identifier.l_unlock, 'Buka versi lengkap'), Identifier.l_zoom, 'Perbesar'), Identifier.l_zoom_in, 'Perbesar'), Identifier.l_zoom_out, 'Perkecil'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(indonesian_objectSpread2, Identifier.l_pages, 'Halaman'), Identifier.l_print, 'Cetak'), Identifier.l_download, 'Unduh'), Identifier.l_share, 'Bagikan'), Identifier.l_enter_fs, 'Layar penuh'), Identifier.l_exit_fs, 'Keluar layar penuh'), Identifier.l_download_pdf_order, 'Unduh PDF order'), Identifier.l_contact_details, 'Detail kontak'), Identifier.l_send_order_modal_text, 'Untuk mengirim order, Anda harus memasukkan detail kontak. Setelah menerima order tersebut, kami akan segera menghubungi Anda.'), Identifier.l_send_order_button, 'Kirim order'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(indonesian_objectSpread2, Identifier.l_send_order_select, 'Pilih...'), Identifier.l_order_successful_text, 'Terima kasih atas ordernya. Kami akan segera menghubungi Anda.'), Identifier.l_lead_form_error_email, 'Input harus berupa alamat email.'), Identifier.l_lead_form_error_tel, 'Input harus berupa nomor telepon.'), Identifier.l_lead_form_error_url, 'Input harus berupa situs web.'), Identifier.l_order_confirmation_header, 'Order telah dikirim'), Identifier.l_agree_to_privacy_policy, 'Saya setuju untuk mematuhi Kebijakan Privasi perusahaan:'), Identifier.l_download_list, 'Unduh daftar'), Identifier.l_background_sound_on, 'Suara aktif'), Identifier.l_background_sound_off, 'Suara nonaktif'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(indonesian_objectSpread2, Identifier.l_response_submitted_message, 'Terima kasih! Tanggapan Anda telah dikirim.'), Identifier.orderPdfHeader, 'Daftar yang dihasilkan dari {flipbook_name} pada {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produk'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Harga'), Identifier.orderPdfAmount, 'Jumlah'), Identifier.orderPdfTotal, 'Total'), Identifier.orderPdfFooter, 'Total keseluruhan'), Identifier.l_retake_quiz, 'Mengulang kuis'), Identifier.l_view_results, 'Lihat hasil'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(indonesian_objectSpread2, Identifier.l_lead_dropdown_select, 'Pilih...'), Identifier.l_product_required_personalization, 'Produk ini memerlukan personalisasi.'), Identifier.l_order_not_sent, 'Pesanan tidak dikirim'), Identifier.l_try_again, 'Coba lagi'), Identifier.l_connection_issue, 'Kemungkinan masalah koneksi. Silakan coba lagi.'), Identifier.l_personalization, 'Personalisasi'), Identifier.l_character, 'karakter'), Identifier.l_cancel, 'Batalkan'), Identifier.l_clear_list_confirmation, 'Hapus daftar?'), Identifier.l_delete_list_message, 'Tindakan ini akan menghapus semua item dari daftar Anda secara permanen. Apakah Anda yakin ingin melanjutkan?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(indonesian_objectSpread2, Identifier.l_minimum_order_value, 'Nilai pesanan minimum:'), Identifier.l_please_add_more_items, 'Silakan tambahkan lebih banyak item untuk melanjutkan pembayaran.'), Identifier.l_submit_button, 'Kirim'), Identifier.l_previous_button, 'Sebelumnya'), Identifier.l_next_button, 'Berikutnya'), Identifier.l_complete_button, 'Selesaikan'), Identifier.l_quiz_was_updated, 'Kuis baru saja diperbarui.'), Identifier.l_refresh_page_button, 'Segarkan halaman ini.'), Identifier.l_question, 'Pertanyaan'), Identifier.l_answered, 'Dijawab'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(indonesian_objectSpread2, Identifier.l_explanation, 'Penjelasan'), Identifier.l_refresh_page_text, 'Segarkan halaman untuk melanjutkan.'), Identifier.l_number_of_questions, 'Jumlah pertanyaan'), Identifier.l_correct_answers, 'Jawaban benar')), translations_accessibilityDefaults);
/* harmony default export */ var indonesian = (Indonesian);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/italian/index.ts

var italian_objectSpread2;
function italian_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function italian_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? italian_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : italian_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Italiano = italian_objectSpread((italian_objectSpread2 = {
  code: 'it-IT'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(italian_objectSpread2, Identifier.l_toc, 'Sommario'), Identifier.l_copy_link, 'Copia link'), Identifier.l_copied, 'Copiato'), Identifier.l_from_current_pg, 'A partire da questa pagina'), Identifier.l_search, 'Cerca'), Identifier.l_search_result, 'risultato trovato con successo'), Identifier.l_search_results, 'risultati trovati con successo'), Identifier.l_my_list, 'Il mio elenco'), Identifier.l_list_no_items, 'Non ci sono ancora elementi nel tuo elenco'), Identifier.l_clear_list, 'Elimina elenco'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(italian_objectSpread2, Identifier.l_total, 'Totale'), Identifier.l_download_list_pdf, 'Scarica l\'elenco in PDF'), Identifier.l_my_product_list, 'La mia lista prodotti'), Identifier.l_previous_page, 'Pagina precedente'), Identifier.l_next_page, 'Pagina successiva'), Identifier.l_accessibility, 'Accessibilità'), Identifier.l_page, 'Pagina'), Identifier.l_unlock_full_version, 'Sblocca la versione completa'), Identifier.l_published_by, 'Pubblicato da'), Identifier.l_buy, 'Acquista'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(italian_objectSpread2, Identifier.l_buy_subscription, 'Acquista abbonamento'), Identifier.l_subscribe, 'Abbonati'), Identifier.l_password_protected, 'Il flipbook è protetto da password'), Identifier.l_enter_password_to_view, 'Inserisci la password per visualizzare il flipbook'), Identifier.l_enter_password, 'Inserisci password'), Identifier.l_invalid_password, 'Password non valida'), Identifier.l_unlock, 'Sblocca'), Identifier.l_zoom, 'Zoom'), Identifier.l_zoom_in, 'Zoom avanti'), Identifier.l_zoom_out, 'Zoom indietro'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(italian_objectSpread2, Identifier.l_pages, 'Pagine'), Identifier.l_print, 'Stampa'), Identifier.l_download, 'Scarica'), Identifier.l_share, 'Condividi'), Identifier.l_enter_fs, 'A schermo intero'), Identifier.l_exit_fs, 'Esci dal modalità a schermo intero'), Identifier.l_download_pdf_order, 'Scarica il PDF dell\'ordine'), Identifier.l_contact_details, 'Informazioni di contatto'), Identifier.l_send_order_modal_text, 'Per inviare l\'ordine è necessario inserire le proprie informazioni di contatto. Ti risponderemo il prima possibile dopo aver ricevuto l\'ordine.'), Identifier.l_send_order_button, 'Invia ordine'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(italian_objectSpread2, Identifier.l_send_order_select, 'Selezionare...'), Identifier.l_order_successful_text, 'Grazie per il tuo ordine! Ci metteremo al più presto in contatto con te!'), Identifier.l_lead_form_error_email, 'L\'elemento inserito dev\'essere un\'email.'), Identifier.l_lead_form_error_tel, 'L\'elemento inserito dev\'essere un numero di telefono.'), Identifier.l_lead_form_error_url, 'L\'elemento inserito dev\'essere un sito web.'), Identifier.l_order_confirmation_header, 'L\'ordine è stato inviato'), Identifier.l_agree_to_privacy_policy, 'Accetto l\'informativa sulla privacy della seguente azienda:'), Identifier.l_download_list, 'Scarica elenco'), Identifier.l_background_sound_on, 'Audio attivo'), Identifier.l_background_sound_off, 'Audio disattivato'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(italian_objectSpread2, Identifier.l_response_submitted_message, 'Grazie! La tua risposta è stata inviata.'), Identifier.orderPdfHeader, 'lenco generato da {flipbook_name} il {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Prodotto'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Prezzo'), Identifier.orderPdfAmount, 'Quantità'), Identifier.orderPdfTotal, 'Totale'), Identifier.orderPdfFooter, 'Totale complessivo'), Identifier.l_retake_quiz, 'Rifare il quiz'), Identifier.l_view_results, 'Visualizzare i risultati'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(italian_objectSpread2, Identifier.l_lead_dropdown_select, 'Selezionare...'), Identifier.l_product_required_personalization, 'Questo prodotto richiede personalizzazione.'), Identifier.l_order_not_sent, 'Ordine non inviato'), Identifier.l_try_again, 'Prova di nuovo'), Identifier.l_connection_issue, 'Possibile problema di connessione. Riprova.'), Identifier.l_personalization, 'Personalizzazione'), Identifier.l_character, 'carattere'), Identifier.l_cancel, 'Annulla'), Identifier.l_clear_list_confirmation, 'Cancellare la lista?'), Identifier.l_delete_list_message, 'Questa azione eliminerà definitivamente tutti gli elementi dalla tua lista. Sei sicuro di voler continuare?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(italian_objectSpread2, Identifier.l_minimum_order_value, 'Valore minimo dell\'ordine:'), Identifier.l_please_add_more_items, 'Si prega di aggiungere altri articoli per completare l\'acquisto.'), Identifier.l_submit_button, 'Invia'), Identifier.l_previous_button, 'Precedente'), Identifier.l_next_button, 'Successivo'), Identifier.l_complete_button, 'Completa'), Identifier.l_quiz_was_updated, 'Il quiz è stato aggiornato di recente.'), Identifier.l_refresh_page_button, 'Aggiorna questa pagina.'), Identifier.l_question, 'Domanda'), Identifier.l_answered, 'Risposto'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(italian_objectSpread2, Identifier.l_explanation, 'Spiegazione'), Identifier.l_refresh_page_text, 'Aggiorna la pagina per continuare.'), Identifier.l_number_of_questions, 'Numero di domande'), Identifier.l_correct_answers, 'Risposte corrette')), translations_accessibilityDefaults);
/* harmony default export */ var italian = (Italiano);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/norwegian/index.ts

var norwegian_objectSpread2;
function norwegian_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function norwegian_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? norwegian_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : norwegian_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Norsk = norwegian_objectSpread((norwegian_objectSpread2 = {
  code: 'no-NO'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(norwegian_objectSpread2, Identifier.l_toc, 'Innholdsfortegnelse'), Identifier.l_copy_link, 'Kopier lenke'), Identifier.l_copied, 'Kopiert'), Identifier.l_from_current_pg, 'Fra denne siden'), Identifier.l_search, 'Søk'), Identifier.l_search_result, 'resultatet funnet'), Identifier.l_search_results, 'resultatene funnet'), Identifier.l_my_list, 'Min liste'), Identifier.l_list_no_items, 'Listen din er for øyeblikket tom'), Identifier.l_clear_list, 'Tøm listen'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(norwegian_objectSpread2, Identifier.l_total, 'Totalt'), Identifier.l_download_list_pdf, 'Last ned listen som PDF'), Identifier.l_my_product_list, 'Min produktliste'), Identifier.l_previous_page, 'Forrige side'), Identifier.l_next_page, 'Neste side'), Identifier.l_accessibility, 'Tilgjengelighet'), Identifier.l_page, 'Side'), Identifier.l_unlock_full_version, 'Lås opp fullversjonen'), Identifier.l_published_by, 'Publisert av '), Identifier.l_buy, 'Kjøp'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(norwegian_objectSpread2, Identifier.l_buy_subscription, 'Kjøp medlemskap'), Identifier.l_subscribe, 'Bli medlem'), Identifier.l_password_protected, 'Flipboken er passordbeskyttet'), Identifier.l_enter_password_to_view, 'Skriv inn passordet for å se flipboken'), Identifier.l_enter_password, 'Skriv inn passord'), Identifier.l_invalid_password, 'Ugyldig passord'), Identifier.l_unlock, 'Lås opp'), Identifier.l_zoom, 'Zoom'), Identifier.l_zoom_in, 'Zoom inn'), Identifier.l_zoom_out, 'Zoom ut'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(norwegian_objectSpread2, Identifier.l_pages, 'Sider'), Identifier.l_print, 'Skriv ut'), Identifier.l_download, 'Last ned'), Identifier.l_share, 'Del'), Identifier.l_enter_fs, 'Fullskjerm'), Identifier.l_exit_fs, 'Avslutt fullskjerm'), Identifier.l_download_pdf_order, 'Last ned ordren som PDF'), Identifier.l_contact_details, 'Kontaktinformasjon'), Identifier.l_send_order_modal_text, 'For å sende bestillingen må du oppgi kontaktinformasjonen din. Når vi har mottatt ordren, kontakter vi deg så snart som mulig.'), Identifier.l_send_order_button, 'Send ordre'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(norwegian_objectSpread2, Identifier.l_send_order_select, 'Plukke ut...'), Identifier.l_order_successful_text, 'Takk for din bestilling. Vi tar kontakt med deg snart!'), Identifier.l_lead_form_error_email, 'Inndata må være en epostadresse.'), Identifier.l_lead_form_error_tel, 'Inndata må være et telefonnummer.'), Identifier.l_lead_form_error_url, 'Inndata må være en nettside.'), Identifier.l_order_confirmation_header, 'Bestillingen ble sendt'), Identifier.l_agree_to_privacy_policy, 'Jeg godtar følgende selskaps personvernerklæring:'), Identifier.l_download_list, 'Last ned liste'), Identifier.l_background_sound_on, 'Lyd på'), Identifier.l_background_sound_off, 'Lyd av'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(norwegian_objectSpread2, Identifier.l_response_submitted_message, 'Takk! Svaret ditt har blitt sendt inn.'), Identifier.orderPdfHeader, 'Liste generert fra {flipbook_name} den {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produkt'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Pris'), Identifier.orderPdfAmount, 'Beløp'), Identifier.orderPdfTotal, 'Totalt'), Identifier.orderPdfFooter, 'Totalt beløp'), Identifier.l_retake_quiz, 'Ta testen på nytt'), Identifier.l_view_results, 'Se resultatene'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(norwegian_objectSpread2, Identifier.l_lead_dropdown_select, 'Plukke ut...'), Identifier.l_product_required_personalization, 'Dette produktet krever tilpasning.'), Identifier.l_order_not_sent, 'Bestilling ikke sendt'), Identifier.l_try_again, 'Prøv igjen'), Identifier.l_connection_issue, 'Mulig tilkoblingsproblem. Vennligst prøv igjen.'), Identifier.l_personalization, 'Personalisering'), Identifier.l_character, 'karakter'), Identifier.l_cancel, 'Avbryt'), Identifier.l_clear_list_confirmation, 'Tømme listen?'), Identifier.l_delete_list_message, 'Denne handlingen vil permanent slette alle elementer fra listen din. Er du sikker på at du vil fortsette?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(norwegian_objectSpread2, Identifier.l_minimum_order_value, 'Minimum bestillingsverdi:'), Identifier.l_please_add_more_items, 'Vennligst legg til flere varer for å fullføre bestillingen.'), Identifier.l_submit_button, 'Send inn'), Identifier.l_previous_button, 'Forrige'), Identifier.l_next_button, 'Neste'), Identifier.l_complete_button, 'Fullfør'), Identifier.l_quiz_was_updated, 'Quizzen ble nylig oppdatert.'), Identifier.l_refresh_page_button, 'Last inn siden på nytt.'), Identifier.l_question, 'Spørsmål'), Identifier.l_answered, 'Besvart'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(norwegian_objectSpread2, Identifier.l_explanation, 'Forklaring'), Identifier.l_refresh_page_text, 'Oppdater siden for å fortsette.'), Identifier.l_number_of_questions, 'Antall spørsmål'), Identifier.l_correct_answers, 'Riktige svar')), translations_accessibilityDefaults);
/* harmony default export */ var norwegian = (Norsk);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/polish/index.ts

var polish_objectSpread2;
function polish_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function polish_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? polish_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : polish_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Polski = polish_objectSpread((polish_objectSpread2 = {
  code: 'pl-PL'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(polish_objectSpread2, Identifier.l_toc, 'Spis treści'), Identifier.l_copy_link, 'Skopiuj link'), Identifier.l_copied, 'Skopiowane'), Identifier.l_from_current_pg, 'Z bieżącej strony'), Identifier.l_search, 'Szukaj'), Identifier.l_search_result, 'znaleziony wynik'), Identifier.l_search_results, 'znalezione wyniki'), Identifier.l_my_list, 'Moja lista'), Identifier.l_list_no_items, 'Twoja lista nie ma jeszcze żadnych elementów'), Identifier.l_clear_list, 'Wyczyść listę'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(polish_objectSpread2, Identifier.l_total, 'Łącznie'), Identifier.l_download_list_pdf, 'Pobierz listę w formacie PDF'), Identifier.l_my_product_list, 'Moja lista produktów'), Identifier.l_previous_page, 'Poprzednia strona'), Identifier.l_next_page, 'Następna strona'), Identifier.l_accessibility, 'Dostępność'), Identifier.l_page, 'Strona'), Identifier.l_unlock_full_version, 'Odblokuj pełną wersję'), Identifier.l_published_by, 'Opublikowane przez '), Identifier.l_buy, 'Kup'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(polish_objectSpread2, Identifier.l_buy_subscription, 'Kup subskrypcję'), Identifier.l_subscribe, 'Subskrybuj'), Identifier.l_password_protected, 'Flipbook jest zabezpieczony hasłem'), Identifier.l_enter_password_to_view, 'Wpisz hasło aby wyświetlić flipbook'), Identifier.l_enter_password, 'Wpisz hasło'), Identifier.l_invalid_password, 'Nieprawidłowe hasło'), Identifier.l_unlock, 'Odblokuj'), Identifier.l_zoom, 'Powiększ'), Identifier.l_zoom_in, 'Powiększ bardziej'), Identifier.l_zoom_out, 'Pomniejsz'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(polish_objectSpread2, Identifier.l_pages, 'Strony'), Identifier.l_print, 'Drukuj'), Identifier.l_download, 'Pobierz'), Identifier.l_share, 'Udostępnij'), Identifier.l_enter_fs, 'Pełny ekran'), Identifier.l_exit_fs, 'Zamknij pełny ekran'), Identifier.l_download_pdf_order, 'Pobierz zamówienie w formacie PDF'), Identifier.l_contact_details, 'Dane kontaktowe'), Identifier.l_send_order_modal_text, 'Aby wysłać zamówienie należy podać swoje dane kontaktowe. Po otrzymaniu twojego zamówienia skontaktujemy się z tobą tak szybko jak to możliwe.'), Identifier.l_send_order_button, 'Wyślij zamówienie'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(polish_objectSpread2, Identifier.l_send_order_select, 'Wybierać...'), Identifier.l_order_successful_text, 'Dziękujemy za zamówienie. Skontaktujemy się z tobą wkrótce!'), Identifier.l_lead_form_error_email, 'Należy wprowadzić adres e-mailowy.'), Identifier.l_lead_form_error_tel, 'Należy wprowadzić numer telefonu.'), Identifier.l_lead_form_error_url, 'Należy wprowadzić stroną internetową.'), Identifier.l_order_confirmation_header, 'Zamówienie zostało wysłane'), Identifier.l_agree_to_privacy_policy, 'Zgadzam się z polityką prywatności następującej firmy:'), Identifier.l_download_list, 'Pobierz listę'), Identifier.l_background_sound_on, 'Dźwięk włączony'), Identifier.l_background_sound_off, 'Dźwięk wyłączony'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(polish_objectSpread2, Identifier.l_response_submitted_message, 'Dziękujemy! Twoja odpowiedź została przesłana.'), Identifier.orderPdfHeader, 'Lista wygenerowana z {flipbook_name} w dniu {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produkt'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Cena'), Identifier.orderPdfAmount, 'Ilość'), Identifier.orderPdfTotal, 'Suma'), Identifier.orderPdfFooter, 'Suma całkowita'), Identifier.l_retake_quiz, 'Ponownie rozwiąż quiz'), Identifier.l_view_results, 'Zobacz wyniki'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(polish_objectSpread2, Identifier.l_lead_dropdown_select, 'Wybierać...'), Identifier.l_product_required_personalization, 'Ten produkt wymaga personalizacji.'), Identifier.l_order_not_sent, 'Zamówienie nie zostało wysłane'), Identifier.l_try_again, 'Spróbuj ponownie'), Identifier.l_connection_issue, 'Możliwy problem z połączeniem. Spróbuj ponownie.'), Identifier.l_personalization, 'Personalizacja'), Identifier.l_character, 'charakter'), Identifier.l_cancel, 'Anuluj'), Identifier.l_clear_list_confirmation, 'Wyczyścić listę?'), Identifier.l_delete_list_message, 'Ta operacja trwale usunie wszystkie elementy z twojej listy. Czy na pewno chcesz kontynuować?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(polish_objectSpread2, Identifier.l_minimum_order_value, 'Minimalna wartość zamówienia:'), Identifier.l_please_add_more_items, 'Proszę dodać więcej produktów, aby dokończyć zamówienie.'), Identifier.l_submit_button, 'Wyślij'), Identifier.l_previous_button, 'Poprzedni'), Identifier.l_next_button, 'Następny'), Identifier.l_complete_button, 'Zakończ'), Identifier.l_quiz_was_updated, 'Quiz został niedawno zaktualizowany.'), Identifier.l_refresh_page_button, 'Odśwież tę stronę.'), Identifier.l_question, 'Pytanie'), Identifier.l_answered, 'Odpowiedziano'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(polish_objectSpread2, Identifier.l_explanation, 'Wyjaśnienie'), Identifier.l_refresh_page_text, 'Odśwież stronę, aby kontynuować.'), Identifier.l_number_of_questions, 'Liczba pytań'), Identifier.l_correct_answers, 'Poprawne odpowiedzi')), translations_accessibilityDefaults);
/* harmony default export */ var polish = (Polski);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/portuguese/index.ts

var portuguese_objectSpread2;
function portuguese_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function portuguese_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? portuguese_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : portuguese_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Português = portuguese_objectSpread((portuguese_objectSpread2 = {
  code: 'pt-PT'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(portuguese_objectSpread2, Identifier.l_toc, 'Índice'), Identifier.l_copy_link, 'Copiar link'), Identifier.l_copied, 'Copiado'), Identifier.l_from_current_pg, 'A partir da página atual'), Identifier.l_search, 'Pesquisar'), Identifier.l_search_result, 'resultado encontrado'), Identifier.l_search_results, 'resultados encontrados'), Identifier.l_my_list, 'Minha lista'), Identifier.l_list_no_items, 'Ainda são existem itens na sua lista'), Identifier.l_clear_list, 'Limpar lista'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(portuguese_objectSpread2, Identifier.l_total, 'Total'), Identifier.l_download_list_pdf, 'Baixar a lista em PDF'), Identifier.l_my_product_list, 'Minha lista de produtos'), Identifier.l_previous_page, 'Página anterior'), Identifier.l_next_page, 'Próxima página'), Identifier.l_accessibility, 'Acessibilidade'), Identifier.l_page, 'Página'), Identifier.l_unlock_full_version, 'Desbloquear a versão completa'), Identifier.l_published_by, 'Publicado por'), Identifier.l_buy, 'Comprar'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(portuguese_objectSpread2, Identifier.l_buy_subscription, 'Comprar assinatura'), Identifier.l_subscribe, 'Assine'), Identifier.l_password_protected, 'O flipbook está protegido por senha'), Identifier.l_enter_password_to_view, 'Insira a senha para visualizar o flipbook'), Identifier.l_enter_password, 'Inserir senha'), Identifier.l_invalid_password, 'Senha inválida'), Identifier.l_unlock, 'Desbloquear'), Identifier.l_zoom, 'Zoom'), Identifier.l_zoom_in, 'Mais zoom'), Identifier.l_zoom_out, 'Menos zoom'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(portuguese_objectSpread2, Identifier.l_pages, 'Páginas'), Identifier.l_print, 'Imprimir'), Identifier.l_download, 'Baixar'), Identifier.l_share, 'Compartilhar'), Identifier.l_enter_fs, 'Tela cheia'), Identifier.l_exit_fs, 'Sair da tela cheia'), Identifier.l_download_pdf_order, 'Baixar pedido em PDF'), Identifier.l_contact_details, 'Dados de contato'), Identifier.l_send_order_modal_text, 'Para enviar o pedido, você deve inserir os seus dados de contato. Assim que recebermos o seu pedido, entraremos em contato o mais rápido possível.'), Identifier.l_send_order_button, 'Enviar pedido'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(portuguese_objectSpread2, Identifier.l_send_order_select, 'Selecione...'), Identifier.l_order_successful_text, 'Obrigado pelo seu pedido. Entraremos em contato em breve!'), Identifier.l_lead_form_error_email, 'Os dados digitados devem ser um endereço de e-mail.'), Identifier.l_lead_form_error_tel, 'Os dados digitados devem ser um número de telefone.'), Identifier.l_lead_form_error_url, 'Os dados digitados devem ser um site.'), Identifier.l_order_confirmation_header, 'O pedido foi enviado'), Identifier.l_agree_to_privacy_policy, 'Eu concordo com a seguinte Política de Privacidade da empresa:'), Identifier.l_download_list, 'Baixar lista'), Identifier.l_background_sound_on, 'Som ligado'), Identifier.l_background_sound_off, 'Som desligado'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(portuguese_objectSpread2, Identifier.l_response_submitted_message, 'Obrigado! Sua resposta foi enviada.'), Identifier.orderPdfHeader, 'Lista gerada a partir de {flipbook_name} em {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produto'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Preço'), Identifier.orderPdfAmount, 'Quantidade'), Identifier.orderPdfTotal, 'Total'), Identifier.orderPdfFooter, 'Total geral'), Identifier.l_retake_quiz, 'Refazer o teste'), Identifier.l_view_results, 'Ver resultados'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(portuguese_objectSpread2, Identifier.l_lead_dropdown_select, 'Selecione...'), Identifier.l_product_required_personalization, 'Este produto requer personalização.'), Identifier.l_order_not_sent, 'Pedido não enviado.'), Identifier.l_try_again, 'Tente novamente'), Identifier.l_connection_issue, 'Possível problema de conexão. Por favor, tente novamente.'), Identifier.l_personalization, 'Personalização'), Identifier.l_character, 'carácter'), Identifier.l_cancel, 'Cancelar'), Identifier.l_clear_list_confirmation, 'Limpar lista?'), Identifier.l_delete_list_message, 'Esta ação excluirá permanentemente todos os itens da sua lista. Tem certeza de que deseja continuar?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(portuguese_objectSpread2, Identifier.l_minimum_order_value, 'Valor mínimo do pedido:'), Identifier.l_please_add_more_items, 'Por favor, adicione mais itens para concluir a compra.'), Identifier.l_submit_button, 'Submeter'), Identifier.l_previous_button, 'Anterior'), Identifier.l_next_button, 'Seguinte'), Identifier.l_complete_button, 'Concluir'), Identifier.l_quiz_was_updated, 'O quiz foi atualizado recentemente.'), Identifier.l_refresh_page_button, 'Atualize esta página.'), Identifier.l_question, 'Pergunta'), Identifier.l_answered, 'Respondido'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(portuguese_objectSpread2, Identifier.l_explanation, 'Explicação'), Identifier.l_refresh_page_text, 'Atualize a página para continuar.'), Identifier.l_number_of_questions, 'Número de perguntas'), Identifier.l_correct_answers, 'Respostas corretas')), translations_accessibilityDefaults);
/* harmony default export */ var portuguese = (Português);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/romanian/index.ts

var romanian_objectSpread2;
function romanian_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function romanian_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? romanian_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : romanian_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Română = romanian_objectSpread((romanian_objectSpread2 = {
  code: 'ro-RO'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(romanian_objectSpread2, Identifier.l_toc, 'Cuprins'), Identifier.l_copy_link, 'Copiază link-ul'), Identifier.l_copied, 'Copiat'), Identifier.l_from_current_pg, 'De la pagina curentă'), Identifier.l_search, 'Caută'), Identifier.l_search_result, 'rezultat găsit'), Identifier.l_search_results, 'rezultate găsite'), Identifier.l_my_list, 'Lista mea'), Identifier.l_list_no_items, 'Încă nu aveți niciun produs în listă'), Identifier.l_clear_list, 'Ștergeți lista'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(romanian_objectSpread2, Identifier.l_total, 'Total'), Identifier.l_download_list_pdf, 'Descărcați lista în format PDF'), Identifier.l_my_product_list, 'Lista mea de produse'), Identifier.l_previous_page, 'Pagina anterioară'), Identifier.l_next_page, 'Pagina următoare'), Identifier.l_accessibility, 'Accesibilitate'), Identifier.l_page, 'Pagina'), Identifier.l_unlock_full_version, 'Deblochează/Accesează versiunea completă'), Identifier.l_published_by, 'Publicat de'), Identifier.l_buy, 'Cumpără'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(romanian_objectSpread2, Identifier.l_buy_subscription, 'Cumpără o subscripție'), Identifier.l_subscribe, 'Abonează-te'), Identifier.l_password_protected, 'Flipbook-ul este blocat cu parolă'), Identifier.l_enter_password_to_view, 'Introduceți parola pentru a vizualiza flipbook-ul'), Identifier.l_enter_password, 'Introduceți parola'), Identifier.l_invalid_password, 'Parolă invalidă'), Identifier.l_unlock, 'Deblochează'), Identifier.l_zoom, 'Mărește'), Identifier.l_zoom_in, 'Mărește'), Identifier.l_zoom_out, 'Micșorează'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(romanian_objectSpread2, Identifier.l_pages, 'Pagini'), Identifier.l_print, 'Imprimare'), Identifier.l_download, 'Descarcă'), Identifier.l_share, 'Distribuie'), Identifier.l_enter_fs, 'Ecran complet'), Identifier.l_exit_fs, 'Ieşiți din ecranul complet'), Identifier.l_download_pdf_order, 'Descărcați comanda în format PDF'), Identifier.l_contact_details, 'Detalii de contact'), Identifier.l_send_order_modal_text, 'Pentru a trimite comanda trebuie să introduceți datele dvs. de contact. Odată ce primim comanda dumneavoastră, vă vom contacta cât mai curând posibil.'), Identifier.l_send_order_button, 'Trimite comanda'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(romanian_objectSpread2, Identifier.l_send_order_select, 'Selectează...'), Identifier.l_order_successful_text, 'Vă mulțumim pentru comandă. Vă vom contacta în curând!'), Identifier.l_lead_form_error_email, 'Câmpul trebuie să conțină o adresă de e-mail.'), Identifier.l_lead_form_error_tel, 'Câmpul trebuie să conțină un număr de telefon.'), Identifier.l_lead_form_error_url, 'Câmpul trebuie să conțină un site web.'), Identifier.l_order_confirmation_header, 'Comanda a fost trimisă'), Identifier.l_agree_to_privacy_policy, 'Sunt de acord cu următoarea politică de confidențialitate a companiei:'), Identifier.l_download_list, 'Descărcați lista'), Identifier.l_background_sound_on, 'Sunet pornit'), Identifier.l_background_sound_off, 'Sunet oprit'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(romanian_objectSpread2, Identifier.l_response_submitted_message, 'Mulțumim! Răspunsul dvs. a fost trimis.'), Identifier.orderPdfHeader, 'Listă generată din {flipbook_name} la {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produs'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Preț'), Identifier.orderPdfAmount, 'Cantitate'), Identifier.orderPdfTotal, 'Total'), Identifier.orderPdfFooter, 'Total general'), Identifier.l_retake_quiz, 'Refă testul'), Identifier.l_view_results, 'Vezi rezultatele'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(romanian_objectSpread2, Identifier.l_lead_dropdown_select, 'Selectează...'), Identifier.l_product_required_personalization, 'Acest produs necesită personalizare.'), Identifier.l_order_not_sent, 'Comanda nu a fost trimisă'), Identifier.l_try_again, 'Încercați din nou'), Identifier.l_connection_issue, 'Posibilă problemă de conexiune. Vă rugăm să încercați din nou.'), Identifier.l_personalization, 'Personalizare'), Identifier.l_character, 'caracter'), Identifier.l_cancel, 'Anulați'), Identifier.l_clear_list_confirmation, 'Șterge lista?'), Identifier.l_delete_list_message, 'Această acțiune va șterge permanent toate elementele din lista dvs. Sunteți sigur că doriți să continuați?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(romanian_objectSpread2, Identifier.l_minimum_order_value, 'Valoare minimă a comenzii:'), Identifier.l_please_add_more_items, 'Vă rugăm să adăugați mai multe articole pentru a finaliza comanda.'), Identifier.l_submit_button, 'Trimite'), Identifier.l_previous_button, 'Anterior'), Identifier.l_next_button, 'Următor'), Identifier.l_complete_button, 'Finalizează'), Identifier.l_quiz_was_updated, 'Chestionarul a fost actualizat recent.'), Identifier.l_refresh_page_button, 'Actualizează această pagină.'), Identifier.l_question, 'Întrebare'), Identifier.l_answered, 'Răspuns'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(romanian_objectSpread2, Identifier.l_explanation, 'Explicație'), Identifier.l_refresh_page_text, 'Actualizați pagina pentru a continua.'), Identifier.l_number_of_questions, 'Număr de întrebări'), Identifier.l_correct_answers, 'Răspunsuri corecte')), translations_accessibilityDefaults);
/* harmony default export */ var romanian = (Română);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/russian/index.ts

var russian_objectSpread2;
function russian_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function russian_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? russian_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : russian_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Pусский = russian_objectSpread((russian_objectSpread2 = {
  code: 'ru-RU'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(russian_objectSpread2, Identifier.l_toc, 'Содержание'), Identifier.l_copy_link, 'Копируемая ссылка'), Identifier.l_copied, 'Скопировано'), Identifier.l_from_current_pg, 'С текущей страницы'), Identifier.l_search, 'Поиск'), Identifier.l_search_result, 'результат найденный'), Identifier.l_search_results, 'результаты найдены'), Identifier.l_my_list, 'Мой список'), Identifier.l_list_no_items, 'В Вашем списке пока нет предметов'), Identifier.l_clear_list, 'Очистить список'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(russian_objectSpread2, Identifier.l_total, 'Всего'), Identifier.l_download_list_pdf, 'Скачать список в формате PDF'), Identifier.l_my_product_list, 'Мой список товаров'), Identifier.l_previous_page, 'Предыдущая страница'), Identifier.l_next_page, 'Следующая страница'), Identifier.l_accessibility, 'Доступность'), Identifier.l_page, 'Страница'), Identifier.l_unlock_full_version, 'Открыть полную версию'), Identifier.l_published_by, 'Опубликовано '), Identifier.l_buy, 'Купить'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(russian_objectSpread2, Identifier.l_buy_subscription, 'Купить подписку'), Identifier.l_subscribe, 'Подписка'), Identifier.l_password_protected, 'Флипбук защищен паролем'), Identifier.l_enter_password_to_view, 'Введите пароль для просмотра флипбука'), Identifier.l_enter_password, 'Введите пароль'), Identifier.l_invalid_password, 'Неверный пароль'), Identifier.l_unlock, 'Разблокировать'), Identifier.l_zoom, 'Увеличить'), Identifier.l_zoom_in, 'Увеличить'), Identifier.l_zoom_out, 'Уменьшить'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(russian_objectSpread2, Identifier.l_pages, 'Страницы'), Identifier.l_print, 'Печать'), Identifier.l_download, 'Скачать'), Identifier.l_share, 'Поделиться'), Identifier.l_enter_fs, 'Полный экран'), Identifier.l_exit_fs, 'Выход из полноэкранного режима'), Identifier.l_download_pdf_order, 'Скачать заказ в формате PDF'), Identifier.l_contact_details, 'Контактная информация'), Identifier.l_send_order_modal_text, 'Для отправки заказа необходимо ввести свои контактные данные. Как только мы получим ваш заказ, мы свяжемся с вами в кратчайшие сроки.'), Identifier.l_send_order_button, 'Отправить заказ'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(russian_objectSpread2, Identifier.l_send_order_select, 'Выбирать...'), Identifier.l_order_successful_text, 'Спасибо за заказ. Мы свяжемся с Вами в ближайшее время!'), Identifier.l_lead_form_error_email, 'Введите адрес электронной почты.'), Identifier.l_lead_form_error_tel, 'Введите номер телефона.'), Identifier.l_lead_form_error_url, 'Введите веб-сайт.'), Identifier.l_order_confirmation_header, 'Заказ отправлен'), Identifier.l_agree_to_privacy_policy, 'Я согласен с политикой конфиденциальности следующей компании:'), Identifier.l_download_list, 'Скачать список'), Identifier.l_background_sound_on, 'Звук включен'), Identifier.l_background_sound_off, 'Звук выключен'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(russian_objectSpread2, Identifier.l_response_submitted_message, 'Спасибо! Ваш ответ отправлен.'), Identifier.orderPdfHeader, 'Список сгенерирован из {flipbook_name} {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Продукт'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Цена'), Identifier.orderPdfAmount, 'Количество'), Identifier.orderPdfTotal, 'Итого'), Identifier.orderPdfFooter, 'Общая сумма'), Identifier.l_retake_quiz, 'Пересдать тест'), Identifier.l_view_results, 'Посмотреть результаты'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(russian_objectSpread2, Identifier.l_lead_dropdown_select, 'Выбирать...'), Identifier.l_product_required_personalization, 'Этот продукт требует персонализации.'), Identifier.l_order_not_sent, 'Заказ не отправлен'), Identifier.l_try_again, 'Попробуйте снова'), Identifier.l_connection_issue, 'Возможная проблема с подключением. Пожалуйста, попробуйте снова.'), Identifier.l_personalization, 'Персонализация'), Identifier.l_character, 'характер'), Identifier.l_cancel, 'Отмена'), Identifier.l_clear_list_confirmation, 'Очистить список?'), Identifier.l_delete_list_message, 'Это действие безвозвратно удалит все элементы из вашего списка. Вы уверены, что хотите продолжить?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(russian_objectSpread2, Identifier.l_minimum_order_value, 'Минимальная сумма заказа:'), Identifier.l_please_add_more_items, 'Пожалуйста, добавьте больше товаров для оформления заказа.'), Identifier.l_submit_button, 'Отправить'), Identifier.l_previous_button, 'Предыдущий'), Identifier.l_next_button, 'Следующий'), Identifier.l_complete_button, 'Завершить'), Identifier.l_quiz_was_updated, 'Викторина была недавно обновлена.'), Identifier.l_refresh_page_button, 'Обновите эту страницу.'), Identifier.l_question, 'Вопрос'), Identifier.l_answered, 'Отвечено'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(russian_objectSpread2, Identifier.l_explanation, 'Объяснение'), Identifier.l_refresh_page_text, 'Пожалуйста, обновите страницу, чтобы продолжить.'), Identifier.l_number_of_questions, 'Количество вопросов'), Identifier.l_correct_answers, 'Правильные ответы')), translations_accessibilityDefaults);
/* harmony default export */ var russian = (Pусский);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/serbian/index.ts

var serbian_objectSpread2;
function serbian_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function serbian_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? serbian_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : serbian_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Cрпски = serbian_objectSpread((serbian_objectSpread2 = {
  code: 'sr-RS'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(serbian_objectSpread2, Identifier.l_toc, 'Sadržaj'), Identifier.l_copy_link, 'Kopiraj link'), Identifier.l_copied, 'Kopirano'), Identifier.l_from_current_pg, 'Od trenutne stranice'), Identifier.l_search, 'Pretraga'), Identifier.l_search_result, 'Pronađeni rezultat'), Identifier.l_search_results, 'Pronađeni rezultati'), Identifier.l_my_list, 'Moja lista'), Identifier.l_list_no_items, 'Još nema pronađenih rezultata u Vašoj listi'), Identifier.l_clear_list, 'Očisti listu'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(serbian_objectSpread2, Identifier.l_total, 'Ukupno'), Identifier.l_download_list_pdf, 'Sačuvaj listu kao pdf'), Identifier.l_my_product_list, 'Moja lista proizvoda'), Identifier.l_previous_page, 'Prethodna stranica'), Identifier.l_next_page, 'Sledeća stranica'), Identifier.l_accessibility, 'Pristupačnost'), Identifier.l_page, 'Stranica'), Identifier.l_unlock_full_version, 'Otključaj celu stranicu'), Identifier.l_published_by, 'Objavio '), Identifier.l_buy, 'Kupi'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(serbian_objectSpread2, Identifier.l_buy_subscription, 'Kupi pretplatu'), Identifier.l_subscribe, 'Pretplati se'), Identifier.l_password_protected, 'Flipbook je zaštićen šifrom'), Identifier.l_enter_password_to_view, 'Unesi šifru za pregled flipbook-a'), Identifier.l_enter_password, 'Unesi šifru'), Identifier.l_invalid_password, 'Netačna šifra'), Identifier.l_unlock, 'Otključaj'), Identifier.l_zoom, 'Zumiranje'), Identifier.l_zoom_in, 'Povećati'), Identifier.l_zoom_out, 'Smanjiti'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(serbian_objectSpread2, Identifier.l_pages, 'Stranice'), Identifier.l_print, 'Printati'), Identifier.l_download, 'Sačuvati'), Identifier.l_share, 'Podeliti'), Identifier.l_enter_fs, 'Celi ekran'), Identifier.l_exit_fs, 'Izlaz iz celog ekrana'), Identifier.l_download_pdf_order, 'Sačuvati PDF narudžbu'), Identifier.l_contact_details, 'Kontakt detalji'), Identifier.l_send_order_modal_text, 'Morate uneti Vaše kontakt detalje da biste poslali narudžbu. Kada zaprimimo Vašu narudžbu, javit ćemo se što je pre moguće.'), Identifier.l_send_order_button, 'Poslati narudžbu'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(serbian_objectSpread2, Identifier.l_send_order_select, 'Изаберите...'), Identifier.l_order_successful_text, 'Hvala za naručivanje. Kontaktirat ćemo Vas uskoro!'), Identifier.l_lead_form_error_email, 'Unos mora biti email adresa.'), Identifier.l_lead_form_error_tel, 'Unos mora biti telefonski broj.'), Identifier.l_lead_form_error_url, 'Unos mora biti websajt.'), Identifier.l_order_confirmation_header, 'Narudžba je poslana.'), Identifier.l_agree_to_privacy_policy, 'Slažem se s Politikom privatnosti:'), Identifier.l_download_list, 'Preuzmi listu'), Identifier.l_background_sound_on, 'Звук укључен'), Identifier.l_background_sound_off, 'Звук искључен'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(serbian_objectSpread2, Identifier.l_response_submitted_message, 'Hvala! Vaš odgovor je poslat.'), Identifier.orderPdfHeader, 'Списак генерисан из {flipbook_name} на {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Производ'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Цена'), Identifier.orderPdfAmount, 'Količina'), Identifier.orderPdfTotal, 'Ukupno'), Identifier.orderPdfFooter, 'Ukupni zbroj'), Identifier.l_retake_quiz, 'Поновити квиз'), Identifier.l_view_results, 'Погледај резултате'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(serbian_objectSpread2, Identifier.l_lead_dropdown_select, 'Изаберите...'), Identifier.l_product_required_personalization, 'Овај производ захтева персонализацију.'), Identifier.l_order_not_sent, 'Porudžbina nije poslata'), Identifier.l_try_again, 'Pokušaj ponovo'), Identifier.l_connection_issue, 'Mogući problem s vezom. Molimo pokušajte ponovo.'), Identifier.l_personalization, 'Персонализација'), Identifier.l_character, 'карактер'), Identifier.l_cancel, 'Otkaži'), Identifier.l_clear_list_confirmation, 'Obrisati listu?'), Identifier.l_delete_list_message, 'Ova radnja će trajno obrisati sve stavke sa vaše liste. Da li ste sigurni da želite da nastavite?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(serbian_objectSpread2, Identifier.l_minimum_order_value, 'Minimalna vrednost porudžbine:'), Identifier.l_please_add_more_items, 'Molimo dodajte još artikala za završetak kupovine.'), Identifier.l_submit_button, 'Pošalji'), Identifier.l_previous_button, 'Prethodno'), Identifier.l_next_button, 'Sledeće'), Identifier.l_complete_button, 'Završi'), Identifier.l_quiz_was_updated, 'Kviz je nedavno ažuriran.'), Identifier.l_refresh_page_button, 'Osveži ovu stranicu.'), Identifier.l_question, 'Pitanje'), Identifier.l_answered, 'Odgovoreno'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(serbian_objectSpread2, Identifier.l_explanation, 'Objašnjenje'), Identifier.l_refresh_page_text, 'Osveži stranicu da nastaviš.'), Identifier.l_number_of_questions, 'Broj pitanja'), Identifier.l_correct_answers, 'Tačni odgovori')), translations_accessibilityDefaults);
/* harmony default export */ var serbian = (Cрпски);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/slovak/index.ts

var slovak_objectSpread2;
function slovak_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function slovak_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? slovak_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : slovak_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Slovak = slovak_objectSpread((slovak_objectSpread2 = {
  code: 'sk-SK'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovak_objectSpread2, Identifier.l_toc, 'Obsah'), Identifier.l_copy_link, 'Skopírovať obsah'), Identifier.l_copied, 'Skopírované'), Identifier.l_from_current_pg, 'Z aktuálnej stránky'), Identifier.l_search, 'Vyhľadať'), Identifier.l_search_result, 'nájdený výsledok'), Identifier.l_search_results, 'nájdené výsledky'), Identifier.l_my_list, 'Môj zoznam'), Identifier.l_list_no_items, 'V zozname nemáte zatiaľ žiadne položky'), Identifier.l_clear_list, 'Vymazať zoznam'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovak_objectSpread2, Identifier.l_total, 'Celkom'), Identifier.l_download_list_pdf, 'Stiahnuť zoznam ako PDF'), Identifier.l_my_product_list, 'Môj zoznam produktov'), Identifier.l_previous_page, 'Predchádzajúca stránka'), Identifier.l_next_page, 'Ďalšia stránka'), Identifier.l_accessibility, 'Prístupnosť'), Identifier.l_page, 'Stránka'), Identifier.l_unlock_full_version, 'Odomknúť plnú verziu'), Identifier.l_published_by, 'Zverejnené '), Identifier.l_buy, 'Kúpiť'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovak_objectSpread2, Identifier.l_buy_subscription, 'Kúpiť predplatné'), Identifier.l_subscribe, 'Prihlásiť sa na odber'), Identifier.l_password_protected, 'Flipbook je chránená heslom'), Identifier.l_enter_password_to_view, 'Na zobrazenie flipbook zadajte heslo'), Identifier.l_enter_password, 'Zadajte heslo'), Identifier.l_invalid_password, 'Neplatné heslo'), Identifier.l_unlock, 'Odomknúť'), Identifier.l_zoom, 'Priblíženie'), Identifier.l_zoom_in, 'Priblížiť'), Identifier.l_zoom_out, 'Oddialiť'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovak_objectSpread2, Identifier.l_pages, 'Stránky'), Identifier.l_print, 'Tlačiť'), Identifier.l_download, 'Stiahnuť'), Identifier.l_share, 'Zdieľať'), Identifier.l_enter_fs, 'Celá obrazovka'), Identifier.l_exit_fs, 'Zrušiť zobrazenie na celú obrazovku'), Identifier.l_download_pdf_order, 'Stiahnuť objednávku ako PDF'), Identifier.l_contact_details, 'Kontaktné údaje'), Identifier.l_send_order_modal_text, 'Na poslanie objednávky musíte zadať svoje kontaktné údaje. Akonáhle obdržíme Vašu objednávku, čo najskôr Vás kontaktujeme.'), Identifier.l_send_order_button, 'Poslať objednávku'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovak_objectSpread2, Identifier.l_send_order_select, 'Vybrať...'), Identifier.l_order_successful_text, 'Ďakujeme za Vašu objednávku. Čoskoro Vás kontaktujeme!'), Identifier.l_lead_form_error_email, 'Vstup musí byť e-mailová adresa.'), Identifier.l_lead_form_error_tel, 'Vstup musí byť telefónne číslo.'), Identifier.l_lead_form_error_url, 'Vstup musí byť webová stránka.'), Identifier.l_order_confirmation_header, 'Objednávka bola odoslaná'), Identifier.l_agree_to_privacy_policy, 'Súhlasím s nasledujúcimi zásadami o ochrane súkromia:'), Identifier.l_download_list, 'Stiahnuť zoznam'), Identifier.l_background_sound_on, 'Zvuk zapnutý'), Identifier.l_background_sound_off, 'Zvuk vypnutý'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovak_objectSpread2, Identifier.l_response_submitted_message, 'Ďakujem! Vaša odpoveď bola odoslaná.'), Identifier.orderPdfHeader, 'Zoznam vytvorený z {flipbook_name} dňa {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produkt'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Cena'), Identifier.orderPdfAmount, 'Množstvo'), Identifier.orderPdfTotal, 'Celkom'), Identifier.orderPdfFooter, 'Celkový súčet'), Identifier.l_retake_quiz, 'Zopakovať kvíz'), Identifier.l_view_results, 'Zobraziť výsledky'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovak_objectSpread2, Identifier.l_lead_dropdown_select, 'Vybrať...'), Identifier.l_product_required_personalization, 'Tento produkt vyžaduje personalizáciu.'), Identifier.l_order_not_sent, 'Objednávka neodoslaná'), Identifier.l_try_again, 'Skúsiť znova'), Identifier.l_connection_issue, 'Možný problém s pripojením. Skúste to znova.'), Identifier.l_personalization, 'Personalizácia'), Identifier.l_character, 'charakter'), Identifier.l_cancel, 'Zrušiť'), Identifier.l_clear_list_confirmation, 'Vyčistiť zoznam?'), Identifier.l_delete_list_message, 'Táto akcia natrvalo odstráni všetky položky z vášho zoznamu. Ste si istí, že chcete pokračovať?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovak_objectSpread2, Identifier.l_minimum_order_value, 'Minimálna hodnota objednávky:'), Identifier.l_please_add_more_items, 'Prosím, pridajte ďalšie položky na dokončenie objednávky.'), Identifier.l_submit_button, 'Odoslať'), Identifier.l_previous_button, 'Predchádzajúci'), Identifier.l_next_button, 'Ďalší'), Identifier.l_complete_button, 'Dokončiť'), Identifier.l_quiz_was_updated, 'Kvíz bol nedávno aktualizovaný.'), Identifier.l_refresh_page_button, 'Obnovte túto stránku.'), Identifier.l_question, 'Otázka'), Identifier.l_answered, 'Zodpovedané'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovak_objectSpread2, Identifier.l_explanation, 'Vysvetlenie'), Identifier.l_refresh_page_text, 'Obnovte stránku, aby ste pokračovali.'), Identifier.l_number_of_questions, 'Počet otázok'), Identifier.l_correct_answers, 'Správne odpovede')), translations_accessibilityDefaults);
/* harmony default export */ var slovak = (Slovak);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/slovene/index.ts

var slovene_objectSpread2;
function slovene_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function slovene_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? slovene_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : slovene_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Slovene = slovene_objectSpread((slovene_objectSpread2 = {
  code: 'sl-SI'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovene_objectSpread2, Identifier.l_toc, 'Vsebina'), Identifier.l_copy_link, 'Kopiraj povezavo'), Identifier.l_copied, 'Kopirano'), Identifier.l_from_current_pg, 'Od trenutne strani'), Identifier.l_search, 'Iskanje'), Identifier.l_search_result, 'Rezultat iskanja'), Identifier.l_search_results, 'Rezultati iskanja'), Identifier.l_my_list, 'Moj seznam'), Identifier.l_list_no_items, 'Na vašem seznamu še ni elementov'), Identifier.l_clear_list, 'Počisti seznam'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovene_objectSpread2, Identifier.l_total, 'Skupaj'), Identifier.l_download_list_pdf, 'Prenesite seznam kot PDF'), Identifier.l_my_product_list, 'Moj seznam izdelkov'), Identifier.l_previous_page, 'Prejšnja stran'), Identifier.l_next_page, 'Naslednja stran'), Identifier.l_accessibility, 'Dostopnost'), Identifier.l_page, 'Stran'), Identifier.l_unlock_full_version, 'Odkleni celotno verzijo'), Identifier.l_published_by, 'Izdal je '), Identifier.l_buy, 'Kupi'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovene_objectSpread2, Identifier.l_buy_subscription, 'Kupi naročnino'), Identifier.l_subscribe, 'Naročite se na'), Identifier.l_password_protected, 'Flipbook je zaščiten z geslom'), Identifier.l_enter_password_to_view, 'Za ogled flipbooka vnesite geslo'), Identifier.l_enter_password, 'Vnesite geslo'), Identifier.l_invalid_password, 'Neveljavno geslo'), Identifier.l_unlock, 'Odklepanje'), Identifier.l_zoom, 'Povečanje'), Identifier.l_zoom_in, 'Povečanje'), Identifier.l_zoom_out, 'Povečanje ali pomanjšanje'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovene_objectSpread2, Identifier.l_pages, 'Strani'), Identifier.l_print, 'Natisni'), Identifier.l_download, 'Prenesi'), Identifier.l_share, 'Delite'), Identifier.l_enter_fs, 'Celoten zaslon'), Identifier.l_exit_fs, 'Izhod iz celozaslonskega programa'), Identifier.l_download_pdf_order, 'Prenos naročila PDF'), Identifier.l_contact_details, 'Kontaktni podatki'), Identifier.l_send_order_modal_text, 'Za pošiljanje naročila morate vnesti svoje kontaktne podatke. Ko bomo prejeli vaše naročilo, vas bomo čim prej kontaktirali.'), Identifier.l_send_order_button, 'Pošljite naročilo'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovene_objectSpread2, Identifier.l_send_order_select, 'Izberite ...'), Identifier.l_order_successful_text, 'Zahvaljujemo se vam za naročilo. Kmalu vas bomo kontaktirali!'), Identifier.l_lead_form_error_email, 'Vnesti morate e-poštni naslov.'), Identifier.l_lead_form_error_tel, 'Vnesti morate telefonsko številko.'), Identifier.l_lead_form_error_url, 'Vnesti morate spletno mesto.'), Identifier.l_order_confirmation_header, 'Naročilo je bilo poslano'), Identifier.l_agree_to_privacy_policy, 'Strinjam se s politiko zasebnosti naslednjega podjetja:'), Identifier.l_download_list, 'Prenesi seznam'), Identifier.l_background_sound_on, 'Zvok vklopljen'), Identifier.l_background_sound_off, 'Zvok izklopljen'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovene_objectSpread2, Identifier.l_response_submitted_message, 'Hvala! Vaš odgovor je bil poslan.'), Identifier.orderPdfHeader, 'Seznam ustvarjen iz {flipbook_name} dne {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Izdelek'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Cena'), Identifier.orderPdfAmount, 'Znesek'), Identifier.orderPdfTotal, 'Skupno'), Identifier.orderPdfFooter, 'Skupni znesek'), Identifier.l_retake_quiz, 'Ponovi kviz'), Identifier.l_view_results, 'Poglej rezultate'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovene_objectSpread2, Identifier.l_lead_dropdown_select, 'Izberite ...'), Identifier.l_product_required_personalization, 'Ta izdelek zahteva prilagoditev.'), Identifier.l_order_not_sent, 'Naročilo ni poslano'), Identifier.l_try_again, 'Poskusi znova'), Identifier.l_connection_issue, 'Možna težava s povezavo. Poskusite znova.'), Identifier.l_personalization, 'Personalizacija'), Identifier.l_character, 'značaj'), Identifier.l_cancel, 'Prekliči'), Identifier.l_clear_list_confirmation, 'Počistiti seznam?'), Identifier.l_delete_list_message, 'To dejanje bo trajno izbrisalo vse elemente s seznama. Ste prepričani, da želite nadaljevati?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovene_objectSpread2, Identifier.l_minimum_order_value, 'Minimalna vrednost naročila:'), Identifier.l_please_add_more_items, 'Prosimo, dodajte več izdelkov za zaključek nakupa.'), Identifier.l_submit_button, 'Pošlji'), Identifier.l_previous_button, 'Prejšnji'), Identifier.l_next_button, 'Naslednji'), Identifier.l_complete_button, 'Dokončaj'), Identifier.l_quiz_was_updated, 'Kviz je bil nedavno posodobljen.'), Identifier.l_refresh_page_button, 'Osvežite to stran.'), Identifier.l_question, 'Vprašanje'), Identifier.l_answered, 'Odgovorjeno'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(slovene_objectSpread2, Identifier.l_explanation, 'Pojasnilo'), Identifier.l_refresh_page_text, 'Osvežite stran, da nadaljujete.'), Identifier.l_number_of_questions, 'Število vprašanj'), Identifier.l_correct_answers, 'Pravilni odgovori')), translations_accessibilityDefaults);
/* harmony default export */ var slovene = (Slovene);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/spanish/index.ts

var spanish_objectSpread2;
function spanish_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function spanish_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? spanish_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : spanish_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Español = spanish_objectSpread((spanish_objectSpread2 = {
  code: 'es-ES'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(spanish_objectSpread2, Identifier.l_toc, 'Índice'), Identifier.l_copy_link, 'Copiar enlace'), Identifier.l_copied, 'Copiado'), Identifier.l_from_current_pg, 'Desde esta página'), Identifier.l_search, 'Búsqueda'), Identifier.l_search_result, 'resultado encontrado'), Identifier.l_search_results, 'resultados encontrados'), Identifier.l_my_list, 'Mi lista'), Identifier.l_list_no_items, 'No hay aun ningún resultado en tu lista'), Identifier.l_clear_list, 'Borrar la lista'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(spanish_objectSpread2, Identifier.l_total, 'Total'), Identifier.l_download_list_pdf, 'Descargar lista como PDF'), Identifier.l_my_product_list, 'Mi lista de productos'), Identifier.l_previous_page, 'Página anterior'), Identifier.l_next_page, 'Página siguiente'), Identifier.l_accessibility, 'Accesibilidad'), Identifier.l_page, 'Página'), Identifier.l_unlock_full_version, 'Liberar versión completa'), Identifier.l_published_by, 'Publicado por'), Identifier.l_buy, 'Comprar'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(spanish_objectSpread2, Identifier.l_buy_subscription, 'Comprar subscripción'), Identifier.l_subscribe, 'Subscribirse'), Identifier.l_password_protected, 'El flipbook está protegido por contraseña'), Identifier.l_enter_password_to_view, 'Ingresa la contraseña para ver el flipbook'), Identifier.l_enter_password, 'Ingresar contraseña'), Identifier.l_invalid_password, 'Contraseña incorrecta'), Identifier.l_unlock, 'Liberar'), Identifier.l_zoom, 'Acercamiento'), Identifier.l_zoom_in, 'Acercar'), Identifier.l_zoom_out, 'Alejar'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(spanish_objectSpread2, Identifier.l_pages, 'Páginas'), Identifier.l_print, 'Imprimir'), Identifier.l_download, 'Descargar'), Identifier.l_share, 'Compartir'), Identifier.l_enter_fs, 'Pantalla completa'), Identifier.l_exit_fs, 'Quitar pantalla completa'), Identifier.l_download_pdf_order, 'Descargar PDF del pedido'), Identifier.l_contact_details, 'Datos de contacto'), Identifier.l_send_order_modal_text, 'Para enviar el pedido, debes poner tus datos de contacto. Luego de que recibamos tu pedido, nos comunicaremos contigo lo más pronto posible.'), Identifier.l_send_order_button, 'Enviar pedido'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(spanish_objectSpread2, Identifier.l_send_order_select, 'Seleccionar...'), Identifier.l_order_successful_text, 'Gracias por tu pedido. ¡Pronto nos comunicaremos contigo!'), Identifier.l_lead_form_error_email, 'El dato debe ser una dirección de correo electrónico.'), Identifier.l_lead_form_error_tel, 'El dato debe ser un número de teléfono.'), Identifier.l_lead_form_error_url, 'El dato debe ser un sitio web.'), Identifier.l_order_confirmation_header, 'El pedido fue enviado'), Identifier.l_agree_to_privacy_policy, 'Acepto la Política de privacidad de la siguiente empresa:'), Identifier.l_download_list, 'Descargar lista'), Identifier.l_background_sound_on, 'Sonido activado'), Identifier.l_background_sound_off, 'Sonido desactivado'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(spanish_objectSpread2, Identifier.l_response_submitted_message, '¡Gracias! Tu respuesta ha sido enviada.'), Identifier.orderPdfHeader, 'Lista generada desde {flipbook_name} el {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Producto'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Precio'), Identifier.orderPdfAmount, 'Cantidad'), Identifier.orderPdfTotal, 'Total'), Identifier.orderPdfFooter, 'Gran total'), Identifier.l_retake_quiz, 'Rehacer el cuestionario'), Identifier.l_view_results, 'Ver resultados'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(spanish_objectSpread2, Identifier.l_lead_dropdown_select, 'Seleccionar...'), Identifier.l_product_required_personalization, 'Este producto requiere personalización.'), Identifier.l_order_not_sent, 'Pedido no enviado'), Identifier.l_try_again, 'Inténtalo de nuevo'), Identifier.l_connection_issue, 'Posible problema de conexión. Inténtalo de nuevo.'), Identifier.l_personalization, 'Personalización'), Identifier.l_character, 'carácter'), Identifier.l_cancel, 'Cancelar'), Identifier.l_clear_list_confirmation, '¿Borrar lista?'), Identifier.l_delete_list_message, 'Esta acción eliminará permanentemente todos los elementos de su lista. ¿Está seguro de que desea continuar?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(spanish_objectSpread2, Identifier.l_minimum_order_value, 'Valor mínimo de pedido:'), Identifier.l_please_add_more_items, 'Por favor, agregue más artículos para completar la compra.'), Identifier.l_submit_button, 'Enviar'), Identifier.l_previous_button, 'Anterior'), Identifier.l_next_button, 'Siguiente'), Identifier.l_complete_button, 'Completar'), Identifier.l_quiz_was_updated, 'El cuestionario se actualizó recientemente.'), Identifier.l_refresh_page_button, 'Actualiza esta página.'), Identifier.l_question, 'Pregunta'), Identifier.l_answered, 'Respondido'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(spanish_objectSpread2, Identifier.l_explanation, 'Explicación'), Identifier.l_refresh_page_text, 'Por favor, actualiza la página para continuar.'), Identifier.l_number_of_questions, 'Número de preguntas'), Identifier.l_correct_answers, 'Respuestas correctas')), translations_accessibilityDefaults);
/* harmony default export */ var spanish = (Español);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/swedish/index.ts

var swedish_objectSpread2;
function swedish_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function swedish_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? swedish_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : swedish_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Swedish = swedish_objectSpread((swedish_objectSpread2 = {
  code: 'sv-SE'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(swedish_objectSpread2, Identifier.l_toc, 'Innehållsförteckning'), Identifier.l_copy_link, 'Kopiera länk'), Identifier.l_copied, 'Kopierad'), Identifier.l_from_current_pg, 'Från nuvarande sida'), Identifier.l_search, 'Sök'), Identifier.l_search_result, 'Resultat hittades'), Identifier.l_search_results, 'Resultat hittades'), Identifier.l_my_list, 'Min lista'), Identifier.l_list_no_items, 'Det finns inga artiklar i din lista än'), Identifier.l_clear_list, 'Rensa lista'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(swedish_objectSpread2, Identifier.l_total, 'Totalt'), Identifier.l_download_list_pdf, 'Ladda ner lista som PDF'), Identifier.l_my_product_list, 'Min produkt lista'), Identifier.l_previous_page, 'Föregående sida'), Identifier.l_next_page, 'Nästa sida'), Identifier.l_accessibility, 'Tillgänglighet'), Identifier.l_page, 'Sida'), Identifier.l_unlock_full_version, 'Lås upp fullversion'), Identifier.l_published_by, 'Publicerad av '), Identifier.l_buy, 'Köp'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(swedish_objectSpread2, Identifier.l_buy_subscription, 'Köp Prenumeration'), Identifier.l_subscribe, 'Prenumerera'), Identifier.l_password_protected, 'Flipbook är lösenordsskyddad'), Identifier.l_enter_password_to_view, 'Ange lösenordet för att visa flipbook'), Identifier.l_enter_password, 'Ange lösenord'), Identifier.l_invalid_password, 'Ogiltigt lösenord'), Identifier.l_unlock, 'Lås upp'), Identifier.l_zoom, 'Zooma'), Identifier.l_zoom_in, 'Zooma in'), Identifier.l_zoom_out, 'Zooma ut'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(swedish_objectSpread2, Identifier.l_pages, 'Sidor'), Identifier.l_print, 'Skriv ut'), Identifier.l_download, 'Ladda ner'), Identifier.l_share, 'Dela'), Identifier.l_enter_fs, 'Helskärm'), Identifier.l_exit_fs, 'Stäng helskärm'), Identifier.l_download_pdf_order, 'Ladda ner order PDF'), Identifier.l_contact_details, 'Kontaktinformation'), Identifier.l_send_order_modal_text, 'För att skicka beställningen måste du ange dina kontaktuppgifter. När vi har mottagit din beställning återkommer vi till dig så snart som möjligt.'), Identifier.l_send_order_button, 'Skicka order'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(swedish_objectSpread2, Identifier.l_send_order_select, 'Välj...'), Identifier.l_order_successful_text, 'Tack för din order. Vi kommer att kontakta dig snart!'), Identifier.l_lead_form_error_email, 'Inmatningen måste vara en e-postadress.'), Identifier.l_lead_form_error_tel, 'Inmatningen måste vara ett telefonnummer.'), Identifier.l_lead_form_error_url, 'Inmatningen måste vara en hemsida.'), Identifier.l_order_confirmation_header, 'Ordern har skickats'), Identifier.l_agree_to_privacy_policy, 'Jag godkänner följande företags integritetspolicy:'), Identifier.l_download_list, 'Ladda ner lista'), Identifier.l_background_sound_on, 'Ljud på'), Identifier.l_background_sound_off, 'Ljud av'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(swedish_objectSpread2, Identifier.l_response_submitted_message, 'Tack! Ditt svar har skickats in.'), Identifier.orderPdfHeader, 'Lista genererad från {flipbook_name} den {current_date} / {current_hour}'), Identifier.orderPdfProduct, 'Produkt'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Pris'), Identifier.orderPdfAmount, 'Belopp'), Identifier.orderPdfTotal, 'Totalt'), Identifier.orderPdfFooter, 'Totalt belopp'), Identifier.l_retake_quiz, 'Ta om testet'), Identifier.l_view_results, 'Visa resultat'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(swedish_objectSpread2, Identifier.l_lead_dropdown_select, 'Välj...'), Identifier.l_product_required_personalization, 'Den här produkten kräver anpassning.'), Identifier.l_order_not_sent, 'Beställning inte skickad'), Identifier.l_try_again, 'Försök igen'), Identifier.l_connection_issue, 'Möjligt anslutningsproblem. Försök igen.'), Identifier.l_personalization, 'Personalisering'), Identifier.l_character, 'karaktär'), Identifier.l_cancel, 'Avbryt'), Identifier.l_clear_list_confirmation, 'Rensa listan?'), Identifier.l_delete_list_message, 'Denna åtgärd kommer permanent att ta bort alla objekt från din lista. Är du säker på att du vill fortsätta?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(swedish_objectSpread2, Identifier.l_minimum_order_value, 'Minimivärde för beställning:'), Identifier.l_please_add_more_items, 'Vänligen lägg till fler artiklar för att checka ut.'), Identifier.l_submit_button, 'Skicka'), Identifier.l_previous_button, 'Föregående'), Identifier.l_next_button, 'Nästa'), Identifier.l_complete_button, 'Slutför'), Identifier.l_quiz_was_updated, 'Quiz uppdaterades nyligen.'), Identifier.l_refresh_page_button, 'Uppdatera den här sidan.'), Identifier.l_question, 'Fråga'), Identifier.l_answered, 'Besvarad'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(swedish_objectSpread2, Identifier.l_explanation, 'Förklaring'), Identifier.l_refresh_page_text, 'Uppdatera sidan för att fortsätta.'), Identifier.l_number_of_questions, 'Antal frågor'), Identifier.l_correct_answers, 'Rätta svar')), translations_accessibilityDefaults);
/* harmony default export */ var swedish = (Swedish);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/turkish/index.ts

var turkish_objectSpread2;
function turkish_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function turkish_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? turkish_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : turkish_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* eslint-disable max-len */


var Turkish = turkish_objectSpread((turkish_objectSpread2 = {
  code: 'tr-TR'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(turkish_objectSpread2, Identifier.l_toc, 'İçindekiler'), Identifier.l_copy_link, 'Linki kopyala'), Identifier.l_copied, 'Kopyalandı'), Identifier.l_from_current_pg, 'Şuanki sayfadan'), Identifier.l_search, 'Ara'), Identifier.l_search_result, 'Sonuç bulundu'), Identifier.l_search_results, 'Sonuçlar bulundu'), Identifier.l_my_list, 'Listem'), Identifier.l_list_no_items, 'Henüz listenizde birşey yok'), Identifier.l_clear_list, 'Listeyi temizle'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(turkish_objectSpread2, Identifier.l_total, 'Total'), Identifier.l_download_list_pdf, 'Listeyi PDF olarak indir'), Identifier.l_my_product_list, 'Ürün listem'), Identifier.l_previous_page, 'Önceki sayfa'), Identifier.l_next_page, 'Sonraki sayfa'), Identifier.l_accessibility, 'Erişilebilirlik'), Identifier.l_page, 'Sayfa'), Identifier.l_unlock_full_version, 'Full versiyonu aç'), Identifier.l_published_by, 'Yayınlayan '), Identifier.l_buy, 'Satın al'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(turkish_objectSpread2, Identifier.l_buy_subscription, 'Abonelik satın al'), Identifier.l_subscribe, 'Abone ol'), Identifier.l_password_protected, 'Not defteri parolalıdır.'), Identifier.l_enter_password_to_view, 'Not deferini görmek için parolayı giriniz.'), Identifier.l_enter_password, 'Parolayı giriniz'), Identifier.l_invalid_password, 'Geçersiz parola'), Identifier.l_unlock, 'Kilitle'), Identifier.l_zoom, 'Yakışlatırma'), Identifier.l_zoom_in, 'Yakınlaştır'), Identifier.l_zoom_out, 'Uzaklaştır'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(turkish_objectSpread2, Identifier.l_pages, 'Sayalar'), Identifier.l_print, 'Yazdır'), Identifier.l_download, 'İndir'), Identifier.l_share, 'Paylaş'), Identifier.l_enter_fs, 'Tam ekran'), Identifier.l_exit_fs, 'Tam ekrandan çık'), Identifier.l_download_pdf_order, 'Siparişi PDF olarak indir'), Identifier.l_contact_details, 'İletişim detayları'), Identifier.l_send_order_modal_text, 'Siparişi göndermek için iletişim detaylarını girmelisiniz. Siparişinizi aldığımızda en kısa zamanda size dönüş yapacağız.'), Identifier.l_send_order_button, 'Siparişi gönder'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(turkish_objectSpread2, Identifier.l_send_order_select, 'Seçme...'), Identifier.l_order_successful_text, 'Siparişiniz için teşekkürler. Sizinle iletişime geçeceğiz!'), Identifier.l_lead_form_error_email, 'E-mail adresi girmelisiniz.'), Identifier.l_lead_form_error_tel, 'Telefon numarası girmelisiniz.'), Identifier.l_lead_form_error_url, 'Website girmelisiniz.'), Identifier.l_order_confirmation_header, 'Sipariş gönderild.'), Identifier.l_agree_to_privacy_policy, 'Şirketin Gizllik Politikası\'nı kabul ediyorum'), Identifier.l_download_list, 'Listeyi indir'), Identifier.l_background_sound_on, 'Ses açık'), Identifier.l_background_sound_off, 'Ses kapalı'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(turkish_objectSpread2, Identifier.l_response_submitted_message, 'Teşekkürler! Yanıtınız gönderildi.'), Identifier.orderPdfHeader, '{flipbook_name} kaynağından {current_date} / {current_hour} tarihinde oluşturulan liste'), Identifier.orderPdfProduct, 'Ürün'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, 'Fiyat'), Identifier.orderPdfAmount, 'Miktar'), Identifier.orderPdfTotal, 'Toplam'), Identifier.orderPdfFooter, 'Genel toplam'), Identifier.l_retake_quiz, 'Testi yeniden yap'), Identifier.l_view_results, 'Sonuçları görüntüle'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(turkish_objectSpread2, Identifier.l_lead_dropdown_select, 'Seçme...'), Identifier.l_product_required_personalization, 'Bu ürün kişiselleştirme gerektirir.'), Identifier.l_order_not_sent, 'Sipariş gönderilmedi'), Identifier.l_try_again, 'Tekrar dene'), Identifier.l_connection_issue, 'Muhtemel bağlantı sorunu. Lütfen tekrar deneyin.'), Identifier.l_personalization, 'Kişiselleştirme'), Identifier.l_character, 'karakter'), Identifier.l_cancel, 'İptal'), Identifier.l_clear_list_confirmation, 'Listeyi temizle?'), Identifier.l_delete_list_message, 'Bu işlem, listenizdeki tüm öğeleri kalıcı olarak silecektir. Devam etmek istediğinizden emin misiniz?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(turkish_objectSpread2, Identifier.l_minimum_order_value, 'Minimum sipariş değeri:'), Identifier.l_please_add_more_items, 'Lütfen ödeme yapmak için daha fazla ürün ekleyin.'), Identifier.l_submit_button, 'Gönder'), Identifier.l_previous_button, 'Önceki'), Identifier.l_next_button, 'Sonraki'), Identifier.l_complete_button, 'Tamamla'), Identifier.l_quiz_was_updated, 'Test yakın zamanda güncellendi.'), Identifier.l_refresh_page_button, 'Bu sayfayı yenileyin.'), Identifier.l_question, 'Soru'), Identifier.l_answered, 'Cevaplandı'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(turkish_objectSpread2, Identifier.l_explanation, 'Açıklama'), Identifier.l_refresh_page_text, 'Lütfen devam etmek için sayfayı yenileyin.'), Identifier.l_number_of_questions, 'Soru sayısı'), Identifier.l_correct_answers, 'Doğru cevaplar')), translations_accessibilityDefaults);
/* harmony default export */ var turkish = (Turkish);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/korean/index.ts

var korean_objectSpread2;
function korean_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function korean_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? korean_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : korean_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var Korean = korean_objectSpread((korean_objectSpread2 = {
  code: 'ko-KR'
}, defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(korean_objectSpread2, Identifier.l_toc, '콘텐츠 표'), Identifier.l_copy_link, '복사 링크'), Identifier.l_copied, '복사됨'), Identifier.l_from_current_pg, '최근 페이지로 부터'), Identifier.l_search, '검색'), Identifier.l_search_result, '찾은 결과'), Identifier.l_search_results, '찾은 결과들'), Identifier.l_my_list, '나의 목록'), Identifier.l_list_no_items, '당신의 목록에 아직 아이템이 없습니다.'), Identifier.l_clear_list, '목록 지우기'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(korean_objectSpread2, Identifier.l_total, '전체'), Identifier.l_download_list_pdf, 'PDF로 목록 다운받기'), Identifier.l_my_product_list, '내 상품 목록'), Identifier.l_previous_page, '이전 페이지'), Identifier.l_next_page, '다음 페이지'), Identifier.l_accessibility, '접근성'), Identifier.l_page, '페이지'), Identifier.l_unlock_full_version, '전체 버전 잠금해제'), Identifier.l_published_by, '출판자'), Identifier.l_buy, '구매'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(korean_objectSpread2, Identifier.l_buy_subscription, '구독 신청'), Identifier.l_subscribe, '구독'), Identifier.l_password_protected, '플립북은 암호로 보호됩니다.'), Identifier.l_enter_password_to_view, '플립북을 보려면 암호를 입력하세요.'), Identifier.l_enter_password, '암호를 입력하세요'), Identifier.l_invalid_password, '잘못된 암호'), Identifier.l_unlock, '해제'), Identifier.l_zoom, '줌'), Identifier.l_zoom_in, '줌 인(확대)'), Identifier.l_zoom_out, '줌 아웃(축소)'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(korean_objectSpread2, Identifier.l_pages, '페이지'), Identifier.l_print, '프린트'), Identifier.l_download, '다운로드'), Identifier.l_share, '공유'), Identifier.l_enter_fs, '전체 화면'), Identifier.l_exit_fs, '전체화면 나가기'), Identifier.l_download_pdf_order, 'PDF 다운로드'), Identifier.l_contact_details, '연락처 정보'), Identifier.l_send_order_modal_text, '주문을 보내려면 당신의 연락처 정보를 입력하세요. 당신이 주문을 받는대로 당신에게 연락을 드리겠습니다.'), Identifier.l_send_order_button, '주문 보내기'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(korean_objectSpread2, Identifier.l_send_order_select, '선택하다'), Identifier.l_order_successful_text, '주문해주셔서 감사합니다. 곧 연락하겠습니다.'), Identifier.l_lead_form_error_email, '이메일 주소를 입력하세요.'), Identifier.l_lead_form_error_tel, '휴대폰 번호를 입력하세요.'), Identifier.l_lead_form_error_url, '웹사이트 주소를 입력하세요.'), Identifier.l_order_confirmation_header, '주문이 전송되었습니다'), Identifier.l_agree_to_privacy_policy, '다음 회사의 개인정보 보호정책에 동의합니다.'), Identifier.l_download_list, '목록 다운로드'), Identifier.l_background_sound_on, '소리 켜기'), Identifier.l_background_sound_off, '소리 끄기'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(korean_objectSpread2, Identifier.l_response_submitted_message, '감사합니다! 응답이 제출되었습니다.'), Identifier.orderPdfHeader, '{flipbook_name}에서 {current_date} / {current_hour}에 생성된 목록'), Identifier.orderPdfProduct, '제품'), Identifier.orderPdfID, 'ID'), Identifier.orderPdfPrice, '가격'), Identifier.orderPdfAmount, '수량'), Identifier.orderPdfTotal, '합계'), Identifier.orderPdfFooter, '총계'), Identifier.l_retake_quiz, '퀴즈 다시 풀기'), Identifier.l_view_results, '결과 보기'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(korean_objectSpread2, Identifier.l_lead_dropdown_select, '선택하다'), Identifier.l_product_required_personalization, '이 제품은 개인 설정이 필요합니다.'), Identifier.l_order_not_sent, '주문이 전송되지 않았습니다'), Identifier.l_try_again, '다시 시도하세요'), Identifier.l_connection_issue, '연결 문제일 수 있습니다. 다시 시도하세요.'), Identifier.l_personalization, '개인화'), Identifier.l_character, '캐릭터'), Identifier.l_cancel, '취소'), Identifier.l_clear_list_confirmation, '목록을 삭제하시겠습니까?'), Identifier.l_delete_list_message, '이 작업을 수행하면 목록의 모든 항목이 영구적으로 삭제됩니다. 계속하시겠습니까?'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(korean_objectSpread2, Identifier.l_minimum_order_value, '최소 주문 금액:'), Identifier.l_please_add_more_items, '결제하려면 더 많은 항목을 추가하세요.'), Identifier.l_submit_button, '제출'), Identifier.l_previous_button, '이전'), Identifier.l_next_button, '다음'), Identifier.l_complete_button, '완료'), Identifier.l_quiz_was_updated, '퀴즈가 최근에 업데이트되었습니다.'), Identifier.l_refresh_page_button, '이 페이지를 새로 고치세요.'), Identifier.l_question, '질문'), Identifier.l_answered, '응답됨'), defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(korean_objectSpread2, Identifier.l_explanation, '설명'), Identifier.l_refresh_page_text, '계속하려면 페이지를 새로 고치세요.'), Identifier.l_number_of_questions, '질문 수'), Identifier.l_correct_answers, '정답')), translations_accessibilityDefaults);
/* harmony default export */ var korean = (Korean);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/translations/index.ts






























var languages = {
  Basque: basque,
  Bosanski: bosnian,
  'Português do Brasil': brazilian_portuguese,
  Català: catalan,
  Hrvatski: croatian,
  Czech: czech,
  Dansk: danish,
  Nederlands: dutch,
  Dutch: dutch,
  English: english,
  Suomi: finnish,
  Française: french,
  Deutsch: german,
  ελληνικά: greek,
  'עברית‏': hebrew,
  Magyar: hungarian,
  Indonesian: indonesian,
  Italiano: italian,
  Norsk: norwegian,
  Polski: polish,
  Português: portuguese,
  Română: romanian,
  Pусский: russian,
  Cрпски: serbian,
  Slovak: slovak,
  Slovene: slovene,
  Español: spanish,
  Swedish: swedish,
  Turkish: turkish,
  Korean: korean
};
/* harmony default export */ var translations = (languages);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useTranslate.ts



/**
 * Return text string in translated languages
 * @param textIdentifier
 * @return string
 */
/* harmony default export */ var useTranslate = (function (textIdentifier) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    language = _useContext.options.controls.language;
  return textIdentifier in Identifier ? translations[language][textIdentifier] : textIdentifier;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Translate/Translate.tsx



var Translate = function Translate(props) {
  var translation = useTranslate(props.children);
  return /*#__PURE__*/react.createElement(react.Fragment, null, translation);
};
Translate.propTypes = {
  children: (prop_types_default()).string.isRequired
};
/* harmony default export */ var Translate_Translate = (Translate);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Translate/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PasswordModal/PasswordModal.tsx












var PasswordModal = function PasswordModal(props) {
  var theme = Ze();
  var _useResize = hooks_useResize(props.nativeActionContainerRef),
    width = _useResize.width;
  var modalWidth = width !== undefined && width <= theme.deviceSize.tabletS ? 'auto' : "".concat(theme.passwordModal.width, "px");
  var modalHeight = 'auto';
  var inputRef = (0,react.useRef)(null);
  var isPasswordValid = !props.password;
  var unlockPlayer = function unlockPlayer() {
    var _inputRef$current;
    if ((_inputRef$current = inputRef.current) !== null && _inputRef$current !== void 0 && _inputRef$current.value) {
      props.unlockFlipbook(inputRef.current.value);
    }
  };
  (0,react.useEffect)(function () {
    var onKeyDown = function onKeyDown(event) {
      if (event.key === ENTER) {
        unlockPlayer();
      }
    };
    window.addEventListener('keydown', onKeyDown);
    return function () {
      window.removeEventListener('keydown', onKeyDown);
    };
  }, []);
  return /*#__PURE__*/react.createElement(Modals_Modal_Modal, {
    width: modalWidth,
    height: modalHeight,
    modalHeight: modalHeight,
    displayCloseIcon: false,
    hasBlackBackground: true,
    isPasswordProtected: true,
    identifier: PASSWORD_MODAL_ID
  }, /*#__PURE__*/react.createElement(PasswordModalContent, null, /*#__PURE__*/react.createElement(PasswordHeader, null, /*#__PURE__*/react.createElement(PasswordTitle, null, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_password_protected)), /*#__PURE__*/react.createElement(PasswordSubTitle, null, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_enter_password_to_view))), /*#__PURE__*/react.createElement(PasswordInputContainer, null, !isPasswordValid && /*#__PURE__*/react.createElement(SpanErrorMessage, {
    role: "region",
    "aria-live": "polite"
  }, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_invalid_password)), /*#__PURE__*/react.createElement(InputContent, null, /*#__PURE__*/react.createElement(ModalContentStyles_Input, {
    defaultValue: props.password || '',
    key: "password-type-key",
    ref: inputRef,
    placeholder: useTranslate(Identifier.l_enter_password),
    type: "password",
    isContentValid: isPasswordValid,
    "aria-label": useTranslate(Identifier.accessibility_unlock_flipbook_input),
    tabIndex: TabIndex.DEFAULT,
    "aria-invalid": !isPasswordValid,
    required: true
  }), /*#__PURE__*/react.createElement(ButtonsContainer, null, /*#__PURE__*/react.createElement(ModalContentStyles_SubmitButton, {
    onClick: unlockPlayer,
    "aria-label": "unlock button",
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_unlock)))))));
};
/* harmony default export */ var PasswordModal_PasswordModal = (PasswordModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PasswordModal/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PasswordProtectedContainer/PasswordProtectedContainer.tsx



var PasswordProtectedContainer = function PasswordProtectedContainer(props) {
  if (props.isFlipbookLocked && props.hasAccessToPassword && props.collectionStatus === FlipbookStatus.PUBLISHED.toLowerCase()) {
    return /*#__PURE__*/react.createElement(PasswordModal_PasswordModal, {
      password: props.password,
      unlockFlipbook: props.unlockFlipbook,
      nativeActionContainerRef: props.nativeActionContainerRef
    });
  }
  return props.children;
};
/* harmony default export */ var PasswordProtectedContainer_PasswordProtectedContainer = (PasswordProtectedContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PasswordProtectedContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/tracking.ts
/* harmony default export */ var tracking = ({
  watermark: '?utm_source=watermark&utm_medium=embed&utm_campaign=UGC'
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/ui/orientation.ts



/**
 * Retrieves orientation
 */
var orientationAtom = vanilla_atom(constants_defaultUI.orientation);

/**
 * Sets orientation
 */
orientationAtom.debugLabel = "orientationAtom";
var setOrientationAtom = vanilla_atom(null, function (get, set, newOrientation) {
  if (get(orientationAtom) !== newOrientation) {
    set(orientationAtom, newOrientation);
  }
});
setOrientationAtom.debugLabel = "setOrientationAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/FullscreenRefProviderContainer/index.tsx


var FullscreenRefProviderContainer = function FullscreenRefProviderContainer(props) {
  return /*#__PURE__*/react.createElement(FullscreenRefProvider, {
    value: {
      fullscreenRef: props.fullscreenRef,
      setFullscreenRef: props.setFullscreenRef
    }
  }, props.children);
};
/* harmony default export */ var providers_FullscreenRefProviderContainer = (FullscreenRefProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useTabIndex.ts



/* harmony default export */ var useTabIndex = (function (tabIndex) {
  var modalNavigableButton = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var _useContext = (0,react.useContext)(contexts_ModalContext),
    active = _useContext.active;
  var newTabIndex = (0,react.useRef)(tabIndex);
  (0,react.useMemo)(function () {
    if (active !== '' && modalNavigableButton) {
      newTabIndex.current = TabIndex.DEFAULT;
    } else if (active !== '' && !modalNavigableButton) {
      newTabIndex.current = TabIndex.UNREACHABLE;
    } else {
      newTabIndex.current = tabIndex;
    }
  }, [active, tabIndex]);
  return newTabIndex.current;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/IconButton/IconButtonStyles.ts



var getIconButtonContainedStyled = function getIconButtonContainedStyled(themeButtonIconContained, $active) {
  return "\n    border: ".concat(themeButtonIconContained.border, ";\n    background-color: ").concat(!$active ? themeButtonIconContained.backgroundColor : '', ";\n\n    &:hover {\n       background-color: ").concat(!main/* isMobile */.Fr && !$active ? "".concat(themeButtonIconContained.hoverBackgroundColor) : '', ";\n    }\n");
};
var IconButtonContent = styled_components_browser_esm.span.withConfig({
  displayName: "IconButtonStyles__IconButtonContent",
  componentId: "sc-1w5hdle-0"
})(["transition:.1s linear;display:flex;align-items:center;justify-content:center;width:", "px;height:", "px;border-radius:", "px;", " ", ";", " ", ""], function (props) {
  return props.theme.button.icon.size[props.$size].width;
}, function (props) {
  return props.theme.button.icon.size[props.$size].height;
}, function (_ref) {
  var theme = _ref.theme;
  return theme.button.icon.borderRadius;
}, function (props) {
  return props.$disabled ? "opacity: ".concat(props.theme.button.icon.disabledOpacity, ";") : '';
}, function (props) {
  return props.$isCloseButton ? "\n            &:hover {\n                background: ".concat(props.theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.2), ";\n            }\n\n            &:active {\n                background: ").concat(props.theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.4), ";\n            }\n        ") : '';
}, function (props) {
  return "\n        background-color: ".concat(props.$active ? props.theme.button.icon.activeBackgroundColor : '', ";\n\n        &:hover {\n           background-color: ").concat(!main/* isMobile */.Fr && !props.$active ? "".concat(props.theme.button.icon.hoverBackgroundColor) : '', ";\n        }\n    ");
}, function (props) {
  return props.$variant === 'contained' ? getIconButtonContainedStyled(props.theme.button.icon.contained, props.$active) : "border: ".concat(props.theme.button.icon.border, ";");
});
var IconElementStyle = Ce(["background:transparent;border:", ";padding:", "px;", ""], function (_ref2) {
  var theme = _ref2.theme;
  return theme.button.icon.border;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.button.icon.padding;
}, function (props) {
  return !props.disabled ? 'cursor: pointer;' : 'pointer-events: none;';
});
var IconButtonStyles_IconButton = styled_components_browser_esm.button.withConfig({
  displayName: "IconButtonStyles__IconButton",
  componentId: "sc-1w5hdle-1"
})(["", ""], IconElementStyle);
var IconButtonStyles_IconContainer = styled_components_browser_esm.span.withConfig({
  displayName: "IconButtonStyles__IconContainer",
  componentId: "sc-1w5hdle-2"
})(["display:inline-block;", ""], IconElementStyle);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/IconButton/IconButton.tsx






var GeneralComponents_IconButton_IconButton_IconButton = function IconButton(props) {
  var _props$tabIndex = props.tabIndex,
    tabIndex = _props$tabIndex === void 0 ? TabIndex.DEFAULT : _props$tabIndex;
  var attributes = {
    autoFocus: props.autoFocus,
    disabled: props.disabled,
    hover: props.hover,
    role: props.role,
    'aria-label': useTranslate(props.ariaLabel),
    tabIndex: useTabIndex(tabIndex)
  };
  var active = props.isActive || false;
  var container = props.semantic === 'container';
  if (typeof props.onClick === 'function' && !props.disabled) {
    attributes.onClick = props.onClick;
  }
  if (typeof props.type === 'string') {
    attributes.type = props.type;
  }
  if (props.id !== '') {
    attributes.id = props.id;
  }
  if (typeof props.isActive === 'boolean') {
    attributes['aria-expanded'] = props.isActive;
  }
  var buttonContent = /*#__PURE__*/react.createElement(IconButtonContent, {
    $size: props.size,
    $active: active,
    $disabled: props.disabled,
    $isCloseButton: props.isCloseButton,
    $variant: props.variant,
    "aria-hidden": true
  }, props.children);
  return container ? /*#__PURE__*/react.createElement(IconButtonStyles_IconContainer, (0,esm_extends/* default */.A)({}, attributes, {
    $active: active
  }), buttonContent) : /*#__PURE__*/react.createElement(IconButtonStyles_IconButton, (0,esm_extends/* default */.A)({}, attributes, {
    $active: active
  }), buttonContent);
};
/* harmony default export */ var GeneralComponents_IconButton_IconButton = (GeneralComponents_IconButton_IconButton_IconButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/IconButton/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/directions/getHtmlAttrOrCssProp.ts


/**
 * Get the 'flex-direction' CSS property with it's value
 * @param isRtl
 */
var getFlexDirection = function getFlexDirection(isRtl) {
  return "flex-direction: ".concat(isRtl ? 'row-reverse' : 'row', ";");
};

/**
 * Get the spacing CSS property with it's value (examples: 'margin-left: 10px' or 'padding-right: 16px')
 * @param putSpacingOnRightSide
 * @param spaceSizeInPx
 * @param typeOfSpacing - the type of spacing can be one of the following ones: 'padding', 'border' or 'margin'
 */
var getSpacing = function getSpacing(putSpacingOnRightSide, spaceSizeInPx, typeOfSpacing) {
  return "".concat(typeOfSpacing, "-").concat(putSpacingOnRightSide ? 'right' : 'left', ": ").concat(spaceSizeInPx, "px;");
};

/**
 * Get the correct direction ('rtl' or 'ltr') for the 'dir' HTML attribute or for the 'direction' CSS property
 * @param isRtl
 */
var getDirection = function getDirection(isRtl) {
  return isRtl ? Directions.RIGHT_TO_LEFT : Directions.LEFT_TO_RIGHT;
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/PanelScrollableList/PanelScrollableListStyles.tsx




var TocPanelContainer = styled_components_browser_esm.div.withConfig({
  displayName: "PanelScrollableListStyles__TocPanelContainer",
  componentId: "sc-1qce3u5-0"
})(["max-height:calc(100% - 8px);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow-y:auto;overflow-x:hidden;"]);
var PanelHeader = styled_components_browser_esm.div.withConfig({
  displayName: "PanelScrollableListStyles__PanelHeader",
  componentId: "sc-1qce3u5-1"
})(["display:flex;", " background:", ";backdrop-filter:blur(20px);border-radius:", "px;align-items:center;justify-content:space-between;position:absolute;width:100%;top:0;", ""], function (_ref) {
  var $isRtl = _ref.$isRtl;
  return getFlexDirection($isRtl);
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.panel.background;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.defaults.borderRadius;
}, function (_ref4) {
  var $emptyList = _ref4.$emptyList,
    theme = _ref4.theme;
  return $emptyList && "border-radius: ".concat(theme.defaults.borderRadius, "px;");
});
var PanelTitle = styled_components_browser_esm.div.withConfig({
  displayName: "PanelScrollableListStyles__PanelTitle",
  componentId: "sc-1qce3u5-2"
})(["", ""], function (_ref5) {
  var $isRtl = _ref5.$isRtl;
  return getSpacing($isRtl, 16, TypesOfSpacing.PADDING);
});
var PanelTitleItems = styled_components_browser_esm.div.withConfig({
  displayName: "PanelScrollableListStyles__PanelTitleItems",
  componentId: "sc-1qce3u5-3"
})(["", " display:flex;align-items:center;gap:8px;"], function (_ref6) {
  var $isRtl = _ref6.$isRtl;
  return getFlexDirection($isRtl);
});
var PanelTitleInfo = styled_components_browser_esm.div.withConfig({
  displayName: "PanelScrollableListStyles__PanelTitleInfo",
  componentId: "sc-1qce3u5-4"
})(["display:flex;gap:8px;"]);
var PanelContainerButtons = styled_components_browser_esm.div.withConfig({
  displayName: "PanelScrollableListStyles__PanelContainerButtons",
  componentId: "sc-1qce3u5-5"
})(["display:flex;align-items:center;"]);

// TODO scroll bar from theme
var PanelList = styled_components_browser_esm.div.withConfig({
  displayName: "PanelScrollableListStyles__PanelList",
  componentId: "sc-1qce3u5-6"
})(["font-size:", "px;font-style:", ";max-height:", ";height:100%;overflow-y:auto;margin-top:", ";", ";letter-spacing:0.45px;width:100%;scrollbar-color:", ";::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-thumb{background:", ";border-radius:6.5px;}::-webkit-scrollbar-thumb:hover{background:", ";}::-webkit-scrollbar-track{background:", ";}user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);"], function (_ref7) {
  var theme = _ref7.theme;
  return theme.typography.size.paragraph;
}, function (_ref8) {
  var theme = _ref8.theme;
  return theme.typography.style.normal;
}, function (_ref9) {
  var theme = _ref9.theme;
  return "calc(100% - ".concat(theme.panel.padding, "px)");
}, function (_ref10) {
  var theme = _ref10.theme;
  return "".concat(52 + theme.panel.padding, "px");
}, function (_ref11) {
  var $isRtl = _ref11.$isRtl;
  return $isRtl && 'margin-left: 8px';
}, function (_ref12) {
  var theme = _ref12.theme;
  return "".concat(theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.4), " ").concat(theme.colors.transparent);
}, function (_ref13) {
  var theme = _ref13.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.4);
}, function (_ref14) {
  var theme = _ref14.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.6);
}, function (_ref15) {
  var theme = _ref15.theme;
  return theme.colors.transparent;
});
var PanelListContent = styled_components_browser_esm.div.withConfig({
  displayName: "PanelScrollableListStyles__PanelListContent",
  componentId: "sc-1qce3u5-7"
})(["font-weight:400;line-height:", "px;padding:", ";"], function (_ref16) {
  var theme = _ref16.theme;
  return theme.typography.lineHeight.paragraph;
}, function (_ref17) {
  var $customPadding = _ref17.$customPadding;
  return $customPadding || '';
});
var PanelItemViewText = styled_components_browser_esm.span.withConfig({
  displayName: "PanelScrollableListStyles__PanelItemViewText",
  componentId: "sc-1qce3u5-8"
})(["color:#fff;overflow:hidden;max-width:320px;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Accessibility/AccessibilityStyles.tsx




var AccessibilityStyles_Icon = styled_components_browser_esm.div.withConfig({
  displayName: "AccessibilityStyles__Icon",
  componentId: "sc-iq38cl-0"
})(["display:flex;background:#000;padding:6px;border-radius:8px;"]);
var AccessibilityStyles_AccessibilityButton = styled_components_browser_esm.div.withConfig({
  displayName: "AccessibilityStyles__AccessibilityButton",
  componentId: "sc-iq38cl-1"
})(["position:relative;z-index:2;"]);
var AccessibilityContainer = styled_components_browser_esm.div.withConfig({
  displayName: "AccessibilityStyles__AccessibilityContainer",
  componentId: "sc-iq38cl-2"
})(["display:flex;flex-direction:column;width:100%;height:100%;max-height:100%;"]);
var AccessibilityHeader = styled_components_browser_esm.div.withConfig({
  displayName: "AccessibilityStyles__AccessibilityHeader",
  componentId: "sc-iq38cl-3"
})(["display:inline-flex;border-top-left-radius:", "px;border-top-right-radius:", "px;background:", ";", " justify-content:space-between;width:100%;flex-wrap:wrap;@media (max-width:420px){flex-direction:column;align-items:normal;}"], function (_ref) {
  var theme = _ref.theme;
  return theme.defaults.borderRadius;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.defaults.borderRadius;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.accessibility.panel.backgroundColor;
}, function (_ref4) {
  var $isRtl = _ref4.$isRtl;
  return getFlexDirection($isRtl);
});
var AccessibilityTitle = styled_components_browser_esm.div.withConfig({
  displayName: "AccessibilityStyles__AccessibilityTitle",
  componentId: "sc-iq38cl-4"
})(["padding:24px 0;", ""], function (_ref5) {
  var $isRtl = _ref5.$isRtl;
  return getSpacing($isRtl, 16, TypesOfSpacing.PADDING);
});
var AccessibilityActions = styled_components_browser_esm.div.withConfig({
  displayName: "AccessibilityStyles__AccessibilityActions",
  componentId: "sc-iq38cl-5"
})(["display:flex;margin:4px;", ""], function (_ref6) {
  var $isRtl = _ref6.$isRtl;
  return getFlexDirection($isRtl);
});
var AccessibilityFont = styled_components_browser_esm.div.withConfig({
  displayName: "AccessibilityStyles__AccessibilityFont",
  componentId: "sc-iq38cl-6"
})(["", " display:flex;", ""], function (_ref7) {
  var $isRtl = _ref7.$isRtl;
  return getSpacing(!$isRtl, 8, TypesOfSpacing.MARGIN);
}, function (_ref8) {
  var $isRtl = _ref8.$isRtl;
  return getFlexDirection($isRtl);
});
var AccessibilityContentContainer = styled_components_browser_esm(PanelList).withConfig({
  displayName: "AccessibilityStyles__AccessibilityContentContainer",
  componentId: "sc-iq38cl-7"
})(["margin-top:0;margin-bottom:76px;", " padding-left:16px;padding-right:8px;height:auto;width:", ";word-break:break-all;@media (max-width:420px){margin-bottom:99px;}"], function (_ref9) {
  var $isRtl = _ref9.$isRtl;
  return $isRtl && getSpacing(!$isRtl, 8, TypesOfSpacing.MARGIN);
}, function (_ref10) {
  var theme = _ref10.theme;
  return "calc(100% - ".concat(theme.panel.padding, "px)");
});
var AccessibilityContent = styled_components_browser_esm.p.withConfig({
  displayName: "AccessibilityStyles__AccessibilityContent",
  componentId: "sc-iq38cl-8"
})(["font-size:", "px;line-height:", "px;letter-spacing:", "px;font-weight:", ";margin-top:0;user-select:text;white-space:pre-line;word-break:keep-all;"], function (_ref11) {
  var $fontSize = _ref11.$fontSize;
  return $fontSize;
}, function (_ref12) {
  var $lineHeight = _ref12.$lineHeight;
  return $lineHeight;
}, function (_ref13) {
  var $letterSpacing = _ref13.$letterSpacing;
  return $letterSpacing;
}, function (_ref14) {
  var $fontWeight = _ref14.$fontWeight;
  return $fontWeight;
});
var AccessibilityFooter = styled_components_browser_esm.div.withConfig({
  displayName: "AccessibilityStyles__AccessibilityFooter",
  componentId: "sc-iq38cl-9"
})(["position:absolute;bottom:0;padding:4px;width:100%;height:99px;display:flex;justify-content:space-between;align-items:flex-end;@media (max-width:420px){bottom:0;}"]);
var AccessibilityButtonLabel = styled_components_browser_esm.div.withConfig({
  displayName: "AccessibilityStyles__AccessibilityButtonLabel",
  componentId: "sc-iq38cl-10"
})(["width:100%;height:100%;border-radius:", "px;background:", ";display:flex;justify-content:center;align-items:center;"], function (_ref15) {
  var theme = _ref15.theme;
  return theme.button.default.borderRadius;
}, function (_ref16) {
  var theme = _ref16.theme;
  return theme.accessibility.panel.buttonLabel.backgroundColor;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Accessibility/AccessibilityButton.tsx












var AccessibilityButton = function AccessibilityButton() {
  var theme = Ze();
  var _useAtom = react_useAtom(panelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    panel = _useAtom2[0],
    setPanel = _useAtom2[1];
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    accessibility = _useAtom4[0].accessibility;
  var ariaLabel = useTranslate(Identifier.accessibility_accessibility);
  if (!accessibility.enable) {
    return null;
  }
  var handleClick = function handleClick() {
    setPanel(panel === Panel.ACCESSIBILITY ? '' : Panel.ACCESSIBILITY);
  };
  return /*#__PURE__*/react.createElement(AccessibilityStyles_AccessibilityButton, null, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    size: IconSize.medium,
    ariaLabel: ariaLabel,
    onClick: handleClick,
    type: HtmlButtonTypes.BUTTON,
    role: "button"
  }, /*#__PURE__*/react.createElement(AccessibilityStyles_Icon, null, /*#__PURE__*/react.createElement(src.AccessabilityIcon, {
    fill: theme.colors.white
  }))));
};
/* harmony default export */ var Accessibility_AccessibilityButton = (AccessibilityButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/cart.ts
// Animation durations (in seconds)
var IMAGE_MOVE_TO_CART_BUTTON_DURATION = 0.4;
var IMAGE_STAY_IN_ONE_POSITION_DURATION = 0.4;
var CartSendOrderModalSteps = {
  DEFAULT: '',
  SUCCESSFUL_ORDER: 'successfulOrder',
  TRY_AGAIN_FAILED_ORDER: 'tryAgainFailedOrder',
  FAILED_ORDER: 'failedOrder'
};
var CSV_FILENAME = 'My product list.csv';
var QuantityOperation = {
  DECREASE: 'decrease',
  INCREASE: 'increase'
};
var SourcesType = /*#__PURE__*/function (SourcesType) {
  SourcesType["EMAIL"] = "Email";
  SourcesType["SLACK"] = "Slack";
  SourcesType["WHATSAPP"] = "WhatsApp";
  return SourcesType;
}({});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/tooltipPosition.ts
/* harmony default export */ var tooltipPosition = ({
  TOP: 'top',
  LEFT: 'left',
  RIGHT: 'right',
  BOTTOM: 'bottom',
  TOP_LEFT: 'top-left',
  TOP_RIGHT: 'top-right',
  BOTTOM_LEFT: 'bottom-left',
  BOTTOM_RIGHT: 'bottom-right',
  AUTO: 'auto' // delete after testing
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/getTotalNrOfItems.ts
/**
 * Get the total number of items in the cart (depending on the quantity too)
 * @param {Array<CartItemType>} cartItems
 * @returns {number}
 */
/* harmony default export */ var getTotalNrOfItems = (function (cartItems) {
  return cartItems.reduce(function (partialSum, cartItem) {
    return cartItem.quantity + partialSum;
  }, 0);
});
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/PhotoPlaceHolder.tsx
/* eslint-disable max-len */

var PhotoPlaceHolder = function PhotoPlaceHolder(_ref) {
  var fill = _ref.fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "20",
    height: "18",
    fill: fill
  }, /*#__PURE__*/react.createElement("path", {
    d: "M18 2h-3.17L13 0H7L5.17 2H2C.9 2 0 2.9 0 4v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2Zm0 14H2V4h4.05l1.83-2h4.24l1.83 2H18v12ZM10 5c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5Zm0 8c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3Z",
    fillOpacity: ".2"
  }));
};
/* harmony default export */ var src_PhotoPlaceHolder = (PhotoPlaceHolder);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartList/CartItemImage/CartItemImage.style.ts



var getCommonCssProperties = function getCommonCssProperties(borderRadius, addingToCartAnimations, position) {
  var commonCssProperties = "\n        border-radius: ".concat(borderRadius, "px;\n        object-fit: cover;\n        width: 60px;\n        height: 60px;\n        display: flex;\n        flex-direction: row;\n        flex-shrink: 0;\n        align-items: center;\n    ");
  if (addingToCartAnimations) {
    commonCssProperties += "\n            box-shadow: 0 0 4px rgba(0, 0, 0, .25);\n            position: absolute;\n            ".concat(position, ": 63px;\n            left: -4px;\n            transform-origin: ").concat(position, ";\n            animation-name: add-item-to-cart;\n            animation-delay: ").concat(IMAGE_STAY_IN_ONE_POSITION_DURATION, "s;\n            animation-duration: ").concat(IMAGE_MOVE_TO_CART_BUTTON_DURATION, "s;\n            animation-fill-mode: forwards;\n\n            @keyframes add-item-to-cart {\n                100% {\n                    ").concat(position === tooltipPosition.TOP ? 'top: 5px;' : 'bottom: 33px;', "\n                    transform: scale(0);\n                    opacity: 0%;\n                }\n            }\n         ");
  }
  return commonCssProperties;
};
var CartItemImage_style_CartItemImage = styled_components_browser_esm.img.withConfig({
  displayName: "CartItemImagestyle__CartItemImage",
  componentId: "sc-1eb3mbq-0"
})(["", ""], function (_ref) {
  var theme = _ref.theme,
    $addingToCartAnimation = _ref.$addingToCartAnimation,
    $position = _ref.$position;
  return getCommonCssProperties(theme.defaults.borderRadius, $addingToCartAnimation, $position);
});
var CartListPhotoPlaceHolder = styled_components_browser_esm.div.withConfig({
  displayName: "CartItemImagestyle__CartListPhotoPlaceHolder",
  componentId: "sc-1eb3mbq-1"
})(["", " justify-content:center;background:", ";"], function (_ref2) {
  var theme = _ref2.theme,
    $addingToCartAnimation = _ref2.$addingToCartAnimation,
    $position = _ref2.$position;
  return getCommonCssProperties(theme.defaults.borderRadius, $addingToCartAnimation, $position);
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.colors.white;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartList/CartItemImage/CartItemImage.tsx



var CartItemImage = function CartItemImage(_ref) {
  var imgSrc = _ref.imgSrc,
    _ref$addingToCartAnim = _ref.addingToCartAnimation,
    addingToCartAnimation = _ref$addingToCartAnim === void 0 ? false : _ref$addingToCartAnim,
    _ref$position = _ref.position,
    position = _ref$position === void 0 ? 'bottom' : _ref$position,
    downloadMode = _ref.downloadMode;
  if (imgSrc) {
    var src = downloadMode ? "".concat(imgSrc, ".jpg") : "".concat(imgSrc, "_t");
    return /*#__PURE__*/react.createElement(CartItemImage_style_CartItemImage, {
      src: src,
      $addingToCartAnimation: addingToCartAnimation,
      $position: position,
      "aria-label": "product description image"
    });
  }
  return /*#__PURE__*/react.createElement(CartListPhotoPlaceHolder, {
    $addingToCartAnimation: addingToCartAnimation,
    $position: position
  }, /*#__PURE__*/react.createElement(src_PhotoPlaceHolder, null));
};
/* harmony default export */ var CartItemImage_CartItemImage = (CartItemImage);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartList/CartItemImage/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControlsTooltipContainer/ControlsTooltipContainer.styles.ts


var StaticTooltipContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ControlsTooltipContainerstyles__StaticTooltipContainer",
  componentId: "sc-116izd2-0"
})(["position:relative;display:flex;justify-content:center;"]);
var ViewContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ControlsTooltipContainerstyles__ViewContainer",
  componentId: "sc-116izd2-1"
})(["position:absolute;&::before{content:\"\";position:absolute;pointer-events:none;}", ""], function (_ref) {
  var position = _ref.position;
  switch (position) {
    case tooltipPosition.TOP_LEFT:
      return "\n                    top: -25px;\n                    right: 0;\n                ";
    case tooltipPosition.TOP_RIGHT:
      return "\n                    top: -25px;\n                    left: 0;\n                ";
    case tooltipPosition.TOP:
      return 'top: -25px;';
    case tooltipPosition.BOTTOM:
      return 'bottom: -25px;';
    case tooltipPosition.BOTTOM_RIGHT:
      return "\n                    bottom: -25px;\n                    right: 0;\n                ";
    default:
      return 'top: -25px;';
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/TooltipContainer/TooltipView.tsx


var TooltipStyles = Ce(["", ""], function (_ref) {
  var theme = _ref.theme;
  return theme.tooltip;
});
var TooltipViewContent = styled_components_browser_esm.div.withConfig({
  displayName: "TooltipView__TooltipViewContent",
  componentId: "sc-1fmc1qr-0"
})(["", " ", ""], TooltipStyles, function (_ref2) {
  var customStyles = _ref2.customStyles;
  return customStyles && Ce(["", ""], customStyles);
});
var TooltipView_TooltipView = function TooltipView(props) {
  return /*#__PURE__*/react.createElement(TooltipViewContent, {
    customStyles: props.customStyles
  }, props.children);
};
/* harmony default export */ var TooltipContainer_TooltipView = (TooltipView_TooltipView);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControlsTooltipContainer/ControlsTooltipContainer.tsx






var ControlsTooltipContainer = function ControlsTooltipContainer(props) {
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    showTooltip = _useState2[0],
    setShowTooltip = _useState2[1];
  var tooltip = useTranslate(props.label);
  var onMouseEnter = function onMouseEnter() {
    setShowTooltip(true);
  };
  var onMouseLeave = function onMouseLeave() {
    setShowTooltip(false);
  };
  return /*#__PURE__*/react.createElement(StaticTooltipContainer, {
    onMouseEnter: onMouseEnter,
    onMouseLeave: onMouseLeave
  }, showTooltip && tooltip && !main/* isMobile */.Fr && /*#__PURE__*/react.createElement(ViewContainer, {
    position: props.position
  }, /*#__PURE__*/react.createElement(TooltipContainer_TooltipView, null, /*#__PURE__*/react.createElement("span", null, tooltip))), props.children);
};
/* harmony default export */ var ControlsTooltipContainer_ControlsTooltipContainer = (ControlsTooltipContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControlsTooltipContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarStyles.tsx

var ControllerBar = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarStyles__ControllerBar",
  componentId: "sc-nq42hz-0"
})(["width:100%;height:", "px;color:", ";display:flex;align-items:center;justify-content:space-between;user-select:none;", ""], function (_ref) {
  var theme = _ref.theme;
  return theme.controllerBar.height;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.controllerBar.color;
}, function (_ref3) {
  var $isTabletS = _ref3.$isTabletS;
  return $isTabletS ? "\n       justify-content: center;\n   " : 'justify-content: space-between;';
});
var ControlsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarStyles__ControlsContainer",
  componentId: "sc-nq42hz-1"
})(["display:flex;align-items:center;", ""], function (_ref4) {
  var $isTabletS = _ref4.$isTabletS;
  return $isTabletS ? "\n        justify-content: space-between;\n        width: 100%;\n       " : '';
});
var ControllerBarStyles_NavigationBar = styled_components_browser_esm.nav.withConfig({
  displayName: "ControllerBarStyles__NavigationBar",
  componentId: "sc-nq42hz-2"
})(["width:100%;position:absolute;bottom:0;backdrop-filter:blur(10px);background-color:rgba(0,0,0,.8);transition:opacity 200ms ease-in-out;z-index:3;opacity:", ";pointer-events:", ";padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);&:hover{opacity:1;pointer-events:all;}"], function (props) {
  return props.$visible ? '1' : '0';
}, function (props) {
  return props.$visible ? 'all' : 'none';
});
var ThumbSliderContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarStyles__ThumbSliderContainer",
  componentId: "sc-nq42hz-3"
})(["z-index:2;width:100%;bottom:", "px;"], function (_ref5) {
  var theme = _ref5.theme;
  return theme.controllerBar.height;
});
var ThumbSlider = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarStyles__ThumbSlider",
  componentId: "sc-nq42hz-4"
})(["", " margin:0 ", "px;"], function (_ref6) {
  var $height = _ref6.$height;
  return $height ? "height: ".concat($height, "px;") : '';
}, function (_ref7) {
  var theme = _ref7.theme;
  return Math.floor(theme.slider.thumbWidth / 2);
});
var PageNumberingAndBackgroundAudio = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarStyles__PageNumberingAndBackgroundAudio",
  componentId: "sc-nq42hz-5"
})(["display:flex;"]);
var Wrapper = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarStyles__Wrapper",
  componentId: "sc-nq42hz-6"
})(["display:flex;align-items:center;margin-top:", "px;", " margin-bottom:", "px;margin-left:", "px;padding-top:", "px;padding-right:", "px;padding-bottom:", "px;padding-left:", "px;", ""], function (_ref8) {
  var theme = _ref8.theme;
  return theme.controllerBar.container.marginTop;
}, function (_ref9) {
  var $isClassicSkin = _ref9.$isClassicSkin,
    theme = _ref9.theme;
  return $isClassicSkin ? "margin-right: ".concat(theme.controllerBar.container.marginRight, "px;") : '';
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.controllerBar.container.marginBottom;
}, function (_ref11) {
  var theme = _ref11.theme;
  return theme.controllerBar.container.marginLeft;
}, function (_ref12) {
  var theme = _ref12.theme;
  return theme.controllerBar.container.paddingTop;
}, function (_ref13) {
  var theme = _ref13.theme;
  return theme.controllerBar.container.paddingRight;
}, function (_ref14) {
  var theme = _ref14.theme;
  return theme.controllerBar.container.paddingBottom;
}, function (_ref15) {
  var theme = _ref15.theme;
  return theme.controllerBar.container.paddingLeft;
}, function (_ref16) {
  var flex = _ref16.flex;
  return flex && "flex: ".concat(flex, ";");
});
var SliderWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarStyles__SliderWrapper",
  componentId: "sc-nq42hz-7"
})(["align-items:center;margin:0 5px 0 12px;"]);
var PageNumberWrapper = styled_components_browser_esm(Wrapper).withConfig({
  displayName: "ControllerBarStyles__PageNumberWrapper",
  componentId: "sc-nq42hz-8"
})(["z-index:1;", ""], function (_ref17) {
  var $isTabletS = _ref17.$isTabletS;
  return $isTabletS ? "\n        display: none;\n       " : '';
});
var ControllerBarStyles_Icon = styled_components_browser_esm.span.withConfig({
  displayName: "ControllerBarStyles__Icon",
  componentId: "sc-nq42hz-9"
})(["width:", "px;height:", "px;position:relative;"], function (_ref18) {
  var theme = _ref18.theme,
    size = _ref18.size;
  return theme.icons.size[size].width;
}, function (_ref19) {
  var theme = _ref19.theme,
    size = _ref19.size;
  return theme.icons.size[size].height;
});
var ButtonLayer = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarStyles__ButtonLayer",
  componentId: "sc-nq42hz-10"
})(["position:absolute;bottom:", ";width:", "px;height:", "px;cursor:", ";z-index:", ";"], function (_ref20) {
  var theme = _ref20.theme;
  return theme.controllerBar.container.marginBottom;
}, function (_ref21) {
  var theme = _ref21.theme;
  return theme.controllerBar.iconsContainer.width;
}, function (_ref22) {
  var theme = _ref22.theme;
  return theme.controllerBar.iconsContainer.height;
}, function (_ref23) {
  var theme = _ref23.theme;
  return theme.controllerBar.iconsContainer.hover.cursor;
}, function (_ref24) {
  var theme = _ref24.theme;
  return theme.controllerBar.iconsContainer.zIndex;
});
var ControllerBarStyles_ShallowDiv = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarStyles__ShallowDiv",
  componentId: "sc-nq42hz-11"
})(["", " height:100%;cursor:default;"], function (_ref25) {
  var minWidth = _ref25.minWidth;
  return minWidth ? "min-width: ".concat(minWidth, "px;") : 'width: 100%;';
});
var CartItemsCounterPosition = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarStyles__CartItemsCounterPosition",
  componentId: "sc-nq42hz-12"
})(["top:0;right:0;position:absolute;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/CartButton/CartButtonStyles.tsx


var CartItemsCounterContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartButtonStyles__CartItemsCounterContainer",
  componentId: "sc-1uzke9f-0"
})(["font-size:12px;font-weight:", ";color:", ";line-height:18px;font-weight:", ";"], function (_ref) {
  var theme = _ref.theme;
  return theme.typography.weight.bold;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.colors.getTextColor(theme.colors.primary);
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.button.default.fontWeight;
});
var CartItemsCounterBackground = styled_components_browser_esm.div.withConfig({
  displayName: "CartButtonStyles__CartItemsCounterBackground",
  componentId: "sc-1uzke9f-1"
})(["background-color:", ";border-radius:12px;max-height:20px;padding:0 6px;", ""], function (_ref4) {
  var theme = _ref4.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref5) {
  var addItemToCartAnimationActive = _ref5.addItemToCartAnimationActive;
  return addItemToCartAnimationActive && "\n        transform-origin: center center;\n        animation-name: add-item-to-cart-counter;\n        animation-delay: ".concat(IMAGE_STAY_IN_ONE_POSITION_DURATION, "s;\n        animation-duration: ").concat(IMAGE_MOVE_TO_CART_BUTTON_DURATION, "s;\n\n        @keyframes add-item-to-cart-counter {\n            50% {\n                transform: scale(1.5);\n            }\n\n            100% {\n                transform: scale(1);\n            }\n        }\n    ");
});
var CartButtonStyles_CartItemsCounter = styled_components_browser_esm.span.withConfig({
  displayName: "CartButtonStyles__CartItemsCounter",
  componentId: "sc-1uzke9f-2"
})([""]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/CartButton/CartItemsCounter.tsx


var CartItemsCounter = function CartItemsCounter(_ref) {
  var cartItemsCount = _ref.cartItemsCount,
    _ref$addItemToCartAni = _ref.addItemToCartAnimationActive,
    addItemToCartAnimationActive = _ref$addItemToCartAni === void 0 ? false : _ref$addItemToCartAni;
  return /*#__PURE__*/react.createElement(CartItemsCounterContainer, null, /*#__PURE__*/react.createElement(CartItemsCounterBackground, {
    addItemToCartAnimationActive: addItemToCartAnimationActive
  }, /*#__PURE__*/react.createElement(CartButtonStyles_CartItemsCounter, null, cartItemsCount)));
};
/* harmony default export */ var CartButton_CartItemsCounter = (CartItemsCounter);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/CartButton/CartButton.tsx






















var maxCountView = 9999;
var CartButton_CartIcons = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, src.CartIconTypes.CART_ICON, src.CartElementIcons.CartIcon), src.CartIconTypes.FAVORITE_ICON, src.CartElementIcons.CartFavoriteIcon), src.CartIconTypes.STAR_ICON, src.CartElementIcons.CartStarIcon), src.CartIconTypes.BAG_ICON, src.CartElementIcons.CartBagIcon);
var CartButton = function CartButton() {
  var theme = Ze();
  var _useAtom = react_useAtom(panelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    panel = _useAtom2[0],
    setPanel = _useAtom2[1];
  var _useAtom3 = react_useAtom(cartAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    cart = _useAtom4[0];
  var _useAtom5 = react_useAtom(rootPrimitivesAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    downloadMode = _useAtom6[0].downloadMode;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    cartSettings = _useContext.cart;
  var _useAtom7 = react_useAtom(addedCartItemAtom),
    _useAtom8 = slicedToArray_slicedToArray(_useAtom7, 2),
    addedCartItem = _useAtom8[0],
    setAddedCartItem = _useAtom8[1];
  var isCartPanelActive = panel === Panel.CART;
  var onClickHandler = function onClickHandler() {
    return setPanel(!isCartPanelActive ? Panel.CART : '');
  };
  var cartItems = Object.values((cart === null || cart === void 0 ? void 0 : cart.products) || {});
  var totalNrOfItems = getTotalNrOfItems(cartItems);
  var ShopIcon = CartButton_CartIcons[(cartSettings === null || cartSettings === void 0 ? void 0 : cartSettings.shopIcon) || src.CartIconTypes.BAG_ICON];
  var cartItemsCount = totalNrOfItems > maxCountView ? "".concat(maxCountView, "+") : "".concat(totalNrOfItems);
  var cartColor = isCartPanelActive ? theme.colors.getTextColor(theme.colors.primary) : theme.colors.black;
  (0,react.useEffect)(function () {
    var timeout;
    if (addedCartItem.show) {
      timeout = setTimeout(function () {
        if (addedCartItem.isFirstItemAdded) {
          onClickHandler();
        }
        setAddedCartItem(addedCartItemAtomDefault);
      }, (IMAGE_STAY_IN_ONE_POSITION_DURATION + IMAGE_MOVE_TO_CART_BUTTON_DURATION) * 1000);
    }
    return function () {
      return clearTimeout(timeout);
    };
  }, [addedCartItem.show, addedCartItem.isFirstItemAdded, setAddedCartItem]);
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: Identifier.l_my_list,
    position: tooltipPosition.BOTTOM
  }, /*#__PURE__*/react.createElement(react.Fragment, null, addedCartItem.show && /*#__PURE__*/react.createElement(CartItemImage_CartItemImage, {
    imgSrc: addedCartItem.imgSrc,
    addingToCartAnimation: true,
    position: tooltipPosition.TOP,
    downloadMode: downloadMode
  }), /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    size: "medium",
    ariaLabel: Identifier.accessibility_my_list,
    type: HtmlButtonTypes.BUTTON,
    isActive: isCartPanelActive,
    tabIndex: useTabIndex(TabIndex.DEFAULT),
    onClick: onClickHandler,
    variant: "contained"
  }, /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(ShopIcon, {
    fill: cartColor
  })), !isCartPanelActive && /*#__PURE__*/react.createElement(CartItemsCounterPosition, null, /*#__PURE__*/react.createElement(CartButton_CartItemsCounter, {
    addItemToCartAnimationActive: addedCartItem.show,
    cartItemsCount: cartItemsCount
  }))))));
};
/* harmony default export */ var CartButton_CartButton = (CartButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/FullscreenButtonContainer/constants.ts
var FullscreenButtonTypes = /*#__PURE__*/function (FullscreenButtonTypes) {
  FullscreenButtonTypes["CENTERED_BUTTON"] = "centered_button";
  FullscreenButtonTypes["CONTROLLER_BAR_BUTTON"] = "controller_bar_button";
  return FullscreenButtonTypes;
}({});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/FullscreenButtonContainer/CenteredFullscreenStyles.tsx


var CenteredButton = styled_components_browser_esm.div.withConfig({
  displayName: "CenteredFullscreenStyles__CenteredButton",
  componentId: "sc-1lgg0ii-0"
})(["display:flex;align-items:center;width:100%;height:100%;justify-content:center;color:#fff;text-decoration:none;"]);
var CenteredFullscreenContainer = styled_components_browser_esm.button.withConfig({
  displayName: "CenteredFullscreenStyles__CenteredFullscreenContainer",
  componentId: "sc-1lgg0ii-1"
})(["top:50%;left:50%;z-index:1;color:#fff;max-width:300px;min-width:121px;height:40px;display:flex;padding:0 12px;cursor:pointer;position:absolute;align-items:center;backdrop-filter:blur(10px);border:none;transform:translate(-50%,-50%);background:", ";border-radius:", "px;opacity:", ";pointer-events:", ";transition:opacity 200ms ease-in-out;&:hover{background:", ";transition:.1s linear;opacity:1;pointer-events:all;}"], function (_ref) {
  var theme = _ref.theme;
  return "".concat(theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.8));
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.defaults.borderRadius;
}, function (props) {
  return props.$visible ? '1' : '0';
}, function (props) {
  return props.$visible ? 'all' : 'none';
}, function (_ref3) {
  var theme = _ref3.theme;
  return "".concat(theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.6));
});
var FullscreenIcon = styled_components_browser_esm.div.withConfig({
  displayName: "CenteredFullscreenStyles__FullscreenIcon",
  componentId: "sc-1lgg0ii-2"
})(["margin-right:10px;width:", "px;height:", "px;"], function (_ref4) {
  var theme = _ref4.theme,
    size = _ref4.size;
  return theme.icons.size[size].width;
}, function (_ref5) {
  var theme = _ref5.theme,
    size = _ref5.size;
  return theme.icons.size[size].height;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/FullscreenButtonContainer/FullscreenButton.tsx





















var FullscreenButton = function FullscreenButton(_ref) {
  var buttonType = _ref.buttonType;
  var theme = Ze();
  var fullscreen = (0,react.useContext)(contexts_FullscreenContext);
  var _useAtom = react_useAtom(closePanelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    closePanel = _useAtom2[1];
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    skinType = _useContext.options.content.skinType;
  var tooltipPositions = skinType === playerTypes_SkinTypes.CLASSIC ? tooltipPosition.BOTTOM : tooltipPosition.TOP_LEFT;
  var fullScreenTooltipLabel = fullscreen.isFullscreen ? Identifier.l_exit_fs : Identifier.l_enter_fs;
  var fullScreenAriaLabel = fullscreen.isFullscreen ? Identifier.accessibility_exit_fs : Identifier.accessibility_enter_fs;
  var label = useTranslate(fullScreenTooltipLabel);
  var _useAtom3 = react_useAtom(controllerBarVisibleAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    isVisible = _useAtom4[0];
  var ariaLabel = useTranslate(fullScreenTooltipLabel);
  var handleFullscreen = function handleFullscreen() {
    closePanel();
    return fullscreen.toggleFullscreen();
  };
  if (buttonType === FullscreenButtonTypes.CENTERED_BUTTON && !fullscreen.isFullscreen) {
    return /*#__PURE__*/react.createElement(CenteredFullscreenContainer, {
      $visible: isVisible,
      onClick: handleFullscreen,
      tabIndex: TabIndex.DEFAULT,
      "aria-label": ariaLabel
    }, /*#__PURE__*/react.createElement(FullscreenIcon, {
      size: IconSize.small
    }, /*#__PURE__*/react.createElement(src.EnterFullScreenIcon, {
      fill: theme.colors.white
    })), label);
  }
  if (buttonType === FullscreenButtonTypes.CONTROLLER_BAR_BUTTON) {
    return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
      position: tooltipPositions,
      label: fullScreenTooltipLabel
    }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
      ariaLabel: fullScreenAriaLabel,
      type: HtmlButtonTypes.BUTTON,
      size: "medium",
      onClick: handleFullscreen,
      tabIndex: TabIndex.DEFAULT
    }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
      size: IconSize.medium
    }, fullscreen.isFullscreen ? /*#__PURE__*/react.createElement(src.ExitFullScreenIcon, {
      fill: theme.colors.white
    }) : /*#__PURE__*/react.createElement(src.EnterFullScreenIcon, {
      fill: theme.colors.white
    }))));
  }
  return null;
};
FullscreenButton.propTypes = {
  buttonType: prop_types_default().oneOf([FullscreenButtonTypes.CONTROLLER_BAR_BUTTON, FullscreenButtonTypes.CENTERED_BUTTON]).isRequired
};
/* harmony default export */ var FullscreenButtonContainer_FullscreenButton = (FullscreenButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getActivePageNumberByStageIndex.ts
/**
 * Return the active page number depending on layout and rtl
 * @param stageIndex
 * @param isDoublePage
 * @param totalNumberOfStages
 * @param isRtl
 * @return number
 */
/* harmony default export */ var getActivePageNumberByStageIndex = (function (stageIndex, isDoublePage, totalNumberOfStages, isRtl) {
  var activeStage = stageIndex + 1;
  if (isRtl) {
    if (!isDoublePage) {
      if (activeStage === 1) {
        return totalNumberOfStages;
      }
      return totalNumberOfStages - activeStage + 1;
    }
    return (totalNumberOfStages - activeStage) * 2;
  }
  if (!isDoublePage || activeStage === 1) {
    return activeStage;
  }
  return (activeStage - 1) * 2;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useFullscreenUrl.ts










/**
 * Return iframe url for devices with no fullscreen option
 * @return {FullscreenUrl}
 */

/* harmony default export */ var useFullscreenUrl = (function () {
  try {
    var _useContext = (0,react.useContext)(contexts_PlayerContext),
      order = _useContext.pages.order,
      rtl = _useContext.options.content.rtl;
    var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
    var layout = useLayout();
    var pageNumber = getActivePageNumberByStageIndex(settledStageIndex, layout === constants_WidgetLayoutTypes.DOUBLE, order.length, rtl);
    if (getFullScreenUrl()) {
      // Open fullscreen url on current page
      var paramsObj = {
        p: "".concat(pageNumber)
      };
      var urlInterface = getFullViewUrl(getFullScreenUrl(), paramsObj);
      return {
        fullscreenUrlInterface: urlInterface,
        fullscreenUrl: "".concat(urlInterface.origin).concat(urlInterface.pathname, "?").concat(urlInterface.searchParams.toString())
      };
    }
  } catch (e) {
    // No action needed
  }
  return {
    fullscreenUrlInterface: {},
    fullscreenUrl: ''
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/FullscreenButtonContainer/FullscreenUrlButton.tsx
























var FullscreenUrlButton = function FullscreenUrlButton(_ref) {
  var buttonType = _ref.buttonType;
  var theme = Ze();
  var _useFullscreenUrl = useFullscreenUrl(),
    fullscreenUrl = _useFullscreenUrl.fullscreenUrl,
    fullscreenUrlInterface = _useFullscreenUrl.fullscreenUrlInterface;
  var tabIndex = useTabIndex(TabIndex.DEFAULT);
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    skinType = _useContext.options.content.skinType;
  var tooltipPositions = skinType === playerTypes_SkinTypes.CLASSIC ? tooltipPosition.BOTTOM : tooltipPosition.TOP_LEFT;
  var label = useTranslate(Identifier.l_enter_fs);
  var _useAtom = react_useAtom(controllerBarVisibleAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    isVisible = _useAtom2[0];
  var isFullscreenUrl = function isFullscreenUrl() {
    var iframeUrl = new URL(window.top.location.href);
    return iframeUrl.origin === (fullscreenUrlInterface === null || fullscreenUrlInterface === void 0 ? void 0 : fullscreenUrlInterface.origin);
  };

  // If device does not have fullscreen and we are in fullscreen url, hide fullscreen button
  if (!utils_isInIframe() && isFullscreenUrl()) {
    return null;
  }
  var setFullscreenCookie = function setFullscreenCookie() {
    var cookieExpire = new Date(new Date().getTime() + 0.25 * 60 * 1000); // 15 sec.

    js_cookie_default().set('isFullscreenUrl', 'true', {
      expires: cookieExpire,
      domain: fullscreenUrlInterface === null || fullscreenUrlInterface === void 0 ? void 0 : fullscreenUrlInterface.hostname
    });
  };
  if (buttonType === FullscreenButtonTypes.CENTERED_BUTTON) {
    return /*#__PURE__*/react.createElement(CenteredFullscreenContainer, {
      $visible: isVisible,
      tabIndex: TabIndex.DEFAULT
    }, /*#__PURE__*/react.createElement(Anchor_Anchor, {
      target: "_blank",
      href: fullscreenUrl,
      onClick: setFullscreenCookie
    }, /*#__PURE__*/react.createElement(CenteredButton, null, /*#__PURE__*/react.createElement(FullscreenIcon, {
      size: IconSize.small
    }, /*#__PURE__*/react.createElement(src.EnterFullScreenIcon, {
      fill: theme.colors.white
    })), label)));
  }
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    position: tooltipPositions,
    label: Identifier.l_enter_fs
  }, /*#__PURE__*/react.createElement(Anchor_Anchor, {
    target: "_blank",
    href: fullscreenUrl,
    tabIndex: tabIndex,
    onClick: setFullscreenCookie
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    size: "medium",
    ariaLabel: Identifier.accessibility_enter_fs,
    type: HtmlButtonTypes.BUTTON,
    tabIndex: TabIndex.UNREACHABLE,
    semantic: "container"
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.EnterFullScreenIcon, {
    fill: theme.colors.white
  })))));
};
FullscreenUrlButton.propTypes = {
  buttonType: prop_types_default().oneOf([FullscreenButtonTypes.CONTROLLER_BAR_BUTTON, FullscreenButtonTypes.CENTERED_BUTTON]).isRequired
};
/* harmony default export */ var FullscreenButtonContainer_FullscreenUrlButton = (FullscreenUrlButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/FullscreenButtonContainer/FullscreenButtonContainer.tsx






var FullscreenButtonContainer = function FullscreenButtonContainer(_ref) {
  var privateFlipbook = _ref.privateFlipbook,
    buttonType = _ref.buttonType;
  if (!fscreen_lib/* default */.A.fullscreenEnabled) {
    if (privateFlipbook) {
      return null;
    }
    return /*#__PURE__*/react.createElement(FullscreenButtonContainer_FullscreenUrlButton, {
      buttonType: buttonType
    });
  }
  return /*#__PURE__*/react.createElement(FullscreenButtonContainer_FullscreenButton, {
    buttonType: buttonType
  });
};
FullscreenButtonContainer.propTypes = {
  privateFlipbook: (prop_types_default()).bool.isRequired,
  buttonType: prop_types_default().oneOf([FullscreenButtonTypes.CONTROLLER_BAR_BUTTON, FullscreenButtonTypes.CENTERED_BUTTON]).isRequired
};
/* harmony default export */ var FullscreenButtonContainer_FullscreenButtonContainer = (FullscreenButtonContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/FullscreenButtonContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/PagesOverviewButton/PagesOverviewButton.tsx

















var PagesOverviewButton = function PagesOverviewButton() {
  var overviewLabel = Identifier.l_pages;
  var _useAtom = react_useAtom(closePanelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    closePanel = _useAtom2[1];
  var _useContext = (0,react.useContext)(contexts_ModalContext),
    setOpen = _useContext.setOpen,
    active = _useContext.active;
  var _useContext2 = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext2.sendGAEvent;
  var _useContext3 = (0,react.useContext)(contexts_PlayerContext),
    skinType = _useContext3.options.content.skinType;
  var tooltipPositions = skinType === playerTypes_SkinTypes.CLASSIC ? tooltipPosition.BOTTOM : tooltipPosition.TOP;
  var handleOnClick = (0,react.useCallback)(function () {
    sendGAEvent(GAEvents.PAGES_OVERVIEW);
    closePanel();
    setOpen(PAGES_MODAL_ID);
  }, [active]);
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: overviewLabel,
    position: tooltipPositions
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: Identifier.accessibility_pages,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    tabIndex: TabIndex.DEFAULT,
    onClick: handleOnClick
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.PagesOverviewIcon, {
    fill: "#fff"
  }))));
};
/* harmony default export */ var PagesOverviewButton_PagesOverviewButton = (PagesOverviewButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/PagesOverviewButton/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/SearchButton/SearchButton.tsx


















var SearchButton = function SearchButton() {
  var theme = Ze();
  var _useAtom = react_useAtom(panelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    panel = _useAtom2[0],
    setPanel = _useAtom2[1];
  var isSearchPanelActive = panel === Panel.SEARCH;
  var searchPanelState = togglePanel(isSearchPanelActive, Panel.SEARCH);
  var _useContext = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext.sendGAEvent;
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    skinType = _useContext2.options.content.skinType;
  var tooltipPositions = skinType === playerTypes_SkinTypes.CLASSIC ? tooltipPosition.BOTTOM : tooltipPosition.TOP;
  var handleClick = function handleClick() {
    sendGAEvent(GAEvents.SEARCH);
    setPanel(searchPanelState);
  };
  var iconColor = isSearchPanelActive ? theme.colors.getTextColor(theme.colors.primary) : theme.colors.white;
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: Identifier.l_search,
    position: tooltipPositions
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: Identifier.accessibility_search,
    type: HtmlButtonTypes.BUTTON,
    onClick: handleClick,
    isActive: isSearchPanelActive,
    size: "medium",
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.SearchIcon, {
    fill: iconColor
  }))));
};
/* harmony default export */ var SearchButton_SearchButton = (SearchButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/SearchButton/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ShareButton/ShareButton.tsx

















var ShareButton = function ShareButton() {
  var theme = Ze();
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    status = _useAtom2[0].status;
  var _useAtom3 = react_useAtom(panelAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 2),
    panel = _useAtom4[0],
    setPanel = _useAtom4[1];
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    skinType = _useContext.options.content.skinType;
  var disabled = status !== FlipbookStatus.PUBLISHED.toLowerCase();
  var isSharePanelActive = panel === Panel.SHARE;
  var sharePanelState = togglePanel(isSharePanelActive, Panel.SHARE);
  var tooltipPositions = skinType === playerTypes_SkinTypes.CLASSIC ? tooltipPosition.BOTTOM : tooltipPosition.TOP;
  var handleClick = function handleClick() {
    setPanel(sharePanelState);
  };
  var iconColor = isSharePanelActive ? theme.colors.getTextColor(theme.colors.primary) : theme.colors.white;
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: Identifier.l_share,
    position: tooltipPositions
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: Identifier.accessibility_share,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    isActive: isSharePanelActive,
    onClick: handleClick,
    disabled: disabled,
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.ShareIcon, {
    fill: iconColor
  }))));
};
/* harmony default export */ var ShareButton_ShareButton = (ShareButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ShareButton/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/TocButton/TocButton.tsx















var TocButton = function TocButton() {
  var theme = Ze();
  var _useAtom = react_useAtom(fixedPanelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    panel = _useAtom2[0],
    setPanel = _useAtom2[1];
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    skinType = _useContext.options.content.skinType;
  var tooltipPositions = skinType === playerTypes_SkinTypes.CLASSIC ? tooltipPosition.BOTTOM : tooltipPosition.TOP;
  var isActive = panel === Panel.TOC;
  var handleClick = function handleClick() {
    if (!isActive) {
      setPanel(Panel.TOC);
    } else {
      setPanel('');
    }
  };
  var iconColor = isActive ? theme.colors.getTextColor(theme.colors.primary) : theme.colors.white;
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: Identifier.l_toc,
    position: tooltipPositions
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: Identifier.accessibility_toc,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    onClick: handleClick,
    isActive: isActive,
    tabIndex: TabIndex.DEFAULT,
    id: "toc-button"
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.TocIcon, {
    fill: iconColor
  }))));
};
/* harmony default export */ var TocButton_TocButton = (TocButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/TocButton/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/DownloadButton/DownloadButton.tsx





















var DownloadButton = function DownloadButton() {
  var theme = Ze();
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    status = _useAtom2[0].status;
  var _useContext = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext.sendGAEvent,
    registerEvents = _useContext.registerEvents;
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    skinType = _useContext2.options.content.skinType;
  var tooltipPositions = skinType === playerTypes_SkinTypes.CLASSIC ? tooltipPosition.BOTTOM : tooltipPosition.TOP;
  var downloadLink = useDownloadLink(false);
  var disabled = status !== FlipbookStatus.PUBLISHED.toLowerCase();
  var attributes = {
    target: '_blank',
    $inline: true
  };
  if (!disabled) {
    attributes.href = downloadLink;
  }
  var onClick = function onClick() {
    if (!disabled) {
      sendGAEvent(GAEvents.DOWNLOAD);
      registerEvents([{
        eid: StatsType.DOWNLOAD_COLLECTION
      }]);
    }
  };
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: Identifier.l_download,
    position: tooltipPositions
  }, /*#__PURE__*/react.createElement(Anchor_Anchor, (0,esm_extends/* default */.A)({}, attributes, {
    onClick: onClick,
    tabIndex: useTabIndex(TabIndex.DEFAULT)
  }), /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: Identifier.accessibility_download,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    disabled: disabled,
    semantic: "container",
    tabIndex: TabIndex.UNREACHABLE,
    role: "button"
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.DownloadIcon, {
    fill: theme.colors.white
  })))));
};
/* harmony default export */ var DownloadButton_DownloadButton = (DownloadButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/DownloadButton/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/PrintButton/PrintButton.tsx





















var PrintButton = function PrintButton() {
  var theme = Ze();
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    status = _useAtom2[0].status;
  var _useContext = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext.sendGAEvent,
    registerEvents = _useContext.registerEvents;
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    skinType = _useContext2.options.content.skinType;
  var disabled = status !== FlipbookStatus.PUBLISHED.toLowerCase();
  var attributes = {
    target: '_blank',
    $inline: true
  };
  var downloadLink = useDownloadLink(true);
  var printEvents = helpers_getPrintEvents(status);
  var positionOfTooltip = skinType === playerTypes_SkinTypes.CLASSIC ? tooltipPosition.BOTTOM : tooltipPosition.TOP;
  if (!disabled) {
    attributes.href = downloadLink;
  }
  var onClick = function onClick() {
    sendGAEvent(printEvents.gaEvent);
    registerEvents([{
      eid: printEvents.statsType
    }]);
  };
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: Identifier.l_print,
    position: positionOfTooltip
  }, /*#__PURE__*/react.createElement(Anchor_Anchor, (0,esm_extends/* default */.A)({}, attributes, {
    onClick: onClick,
    tabIndex: useTabIndex(TabIndex.DEFAULT)
  }), /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: Identifier.accessibility_print,
    size: "medium",
    disabled: disabled,
    semantic: "container",
    tabIndex: TabIndex.UNREACHABLE,
    role: "button"
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.PrintIcon, {
    fill: theme.colors.white
  })))));
};
/* harmony default export */ var PrintButton_PrintButton = (PrintButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ZoomButton/ZoomButoon.tsx















var ZoomButton = function ZoomButton() {
  var theme = Ze();
  var _useAtom = react_useAtom(panelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    panel = _useAtom2[0],
    setPanel = _useAtom2[1];
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    skinType = _useContext.options.content.skinType;
  var tooltipPositions = skinType === playerTypes_SkinTypes.CLASSIC ? tooltipPosition.BOTTOM : tooltipPosition.TOP_LEFT;
  var isActive = panel === Panel.ZOOM;
  var handleClick = function handleClick() {
    if (!isActive) {
      setPanel(Panel.ZOOM);
    } else {
      setPanel('');
    }
  };
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: Identifier.l_zoom,
    position: tooltipPositions
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: Identifier.l_zoom,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    onClick: handleClick,
    isActive: isActive,
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.ZoomIcon, {
    fill: theme.colors.white
  }))));
};
/* harmony default export */ var ZoomButoon = (ZoomButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ZoomButton/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarButtons/ControllerBarButtons.styles.ts

/**
 * Container for the controller bar buttons
 * Use overflow-x: scroll for mobile devices that have a small screen
 */
var ControllerBarButtonsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarButtonsstyles__ControllerBarButtonsContainer",
  componentId: "sc-aoagyf-0"
})(["z-index:2;display:flex;padding-top:2px;@media (max-width:320px){overflow-x:scroll;}", ";"], function (_ref) {
  var isClassicSkin = _ref.isClassicSkin,
    theme = _ref.theme;
  return !isClassicSkin ? "\n        width: 100%;\n        justify-content: ".concat(theme.controllerBar.modernSkinWrapper.justifyContent, ";\n    ") : '';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/BackgroundAudioButton/index.tsx
















var BackgroundAudioButton = function BackgroundAudioButton() {
  var theme = Ze();
  var backgroundSoundOn = react_useAtomValue(backgroundAudioOn);
  var setBackgroundSoundOn = react_useSetAtom(setBackgroundAudioOn);
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    skinType = _useContext.options.content.skinType;
  var _useContext2 = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext2.sendGAEvent;
  var positionOfTooltip = skinType === playerTypes_SkinTypes.CLASSIC ? tooltipPosition.BOTTOM : tooltipPosition.TOP;
  var backgroundSoundTooltipLabel = backgroundSoundOn ? Identifier.l_background_sound_off : Identifier.l_background_sound_on;
  var backgroundSoundAriaLabel = backgroundSoundOn ? Identifier.accessibility_background_sound_off : Identifier.accessibility_background_sound_on;
  var handleBackgroundSoundClick = function handleBackgroundSoundClick() {
    setBackgroundSoundOn(!backgroundSoundOn);

    // The event must be the one that succeeds the actual state
    if (backgroundSoundOn) {
      sendGAEvent(GAEvents.SOUND_OFF);
    } else {
      sendGAEvent(GAEvents.SOUND_ON);
    }
  };
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: backgroundSoundTooltipLabel,
    position: positionOfTooltip
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: backgroundSoundAriaLabel,
    size: "medium",
    onClick: handleBackgroundSoundClick,
    type: HtmlButtonTypes.BUTTON,
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, backgroundSoundOn ? /*#__PURE__*/react.createElement(src.BackgroundSoundOnIcon, {
    fill: theme.colors.white
  }) : /*#__PURE__*/react.createElement(src.BackgroundSoundOffIcon, {
    fill: theme.colors.white
  }))));
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarButtons/ControllerBarButtons.tsx




















var ControllerBarCommonButtons = function ControllerBarCommonButtons() {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options = _useContext.options,
    _useContext$options$c = _useContext$options.controls,
    print = _useContext$options$c.print,
    download = _useContext$options$c.download,
    search = _useContext$options$c.search,
    share = _useContext$options$c.share,
    toc = _useContext$options$c.toc,
    pagesOverview = _useContext$options$c.pagesOverview,
    fullScreen = _useContext$options$c.fullScreen,
    skinType = _useContext$options.content.skinType,
    _useContext$options$b = _useContext$options.backgroundAudio,
    isBackgroundAudioEnabled = _useContext$options$b.enabled,
    src = _useContext$options$b.src,
    downloadMode = _useContext.downloadMode,
    tocData = _useContext.toc;
  var _useAtom = react_useAtom(featuresAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    features = _useAtom2[0];
  var _useAtom3 = react_useAtom(stageSizeWidthAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    stageWidth = _useAtom4[0];
  var _useAtom5 = react_useAtom(propertiesAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    visibility = _useAtom6[0].visibility;
  var theme = Ze();
  var isMobileTheme = stageWidth <= theme.deviceSize.tabletS;
  return /*#__PURE__*/react.createElement(ControllerBarButtonsContainer, {
    isClassicSkin: skinType === playerTypes_SkinTypes.CLASSIC
  }, isBackgroundAudioEnabled && features.AUDIO_BACKGROUND && src && (skinType === playerTypes_SkinTypes.CLASSIC || isMobileTheme) && /*#__PURE__*/react.createElement(BackgroundAudioButton, null), pagesOverview && /*#__PURE__*/react.createElement(PagesOverviewButton_PagesOverviewButton, null), print && features.WIDGET_PRINT && !isMobileTheme && /*#__PURE__*/react.createElement(PrintButton_PrintButton, null), download && features.DOWNLOAD_PDF && /*#__PURE__*/react.createElement(DownloadButton_DownloadButton, null), search && features.WIDGET_SEARCH && /*#__PURE__*/react.createElement(SearchButton_SearchButton, null), share && !downloadMode && /*#__PURE__*/react.createElement(ShareButton_ShareButton, null), !!(toc && tocData !== null && tocData !== void 0 && tocData.length && features.TABLE_OF_CONTENT) && /*#__PURE__*/react.createElement(TocButton_TocButton, null), fullScreen && skinType === playerTypes_SkinTypes.MODERN && /*#__PURE__*/react.createElement(FullscreenButtonContainer_FullscreenButtonContainer, {
    privateFlipbook: isSharedWithUsers(visibility),
    buttonType: FullscreenButtonTypes.CONTROLLER_BAR_BUTTON
  }), skinType === playerTypes_SkinTypes.CLASSIC && !isMobileTheme && /*#__PURE__*/react.createElement(ZoomButoon, null));
};
/* harmony default export */ var ControllerBarButtons = (ControllerBarCommonButtons);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarWrapper/ControllerBarWrapper.styles.ts

var ControllerBarWrapperContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarWrapperstyles__ControllerBarWrapperContainer",
  componentId: "sc-1l0bri3-0"
})(["z-index:1;width:100%;position:absolute;height:", "px;"], function (_ref) {
  var theme = _ref.theme;
  return theme.controllerBar.top.height;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarWrapper/ControllerBarWrapper.tsx





var ControllerBarWrapper = function ControllerBarWrapper() {
  var _useAtom = react_useAtom(closePanelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    closePanel = _useAtom2[1];
  return /*#__PURE__*/react.createElement(ControllerBarWrapperContainer, {
    onClick: closePanel
  });
};
/* harmony default export */ var ControllerBarWrapper_ControllerBarWrapper = (ControllerBarWrapper);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarWrapper/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/FullscreenButtonContainer/ExitFullScreenButton.tsx











var ExitFullScreenButton = function ExitFullScreenButton() {
  var theme = Ze();
  var fullscreen = (0,react.useContext)(contexts_FullscreenContext);
  var handleFullscreen = function handleFullscreen() {
    fullscreen.toggleFullscreen();
  };
  return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    position: tooltipPosition.BOTTOM_RIGHT,
    label: Identifier.l_exit_fs
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: Identifier.accessibility_exit_fs,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    onClick: handleFullscreen,
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.CloseIcon, {
    fill: theme.colors.white,
    size: src.IconSizes.AUTO
  }))));
};
/* harmony default export */ var FullscreenButtonContainer_ExitFullScreenButton = (ExitFullScreenButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getUserExternalLibraryURL.ts
/**
 * Returns external path with account id
 * @param accountId
 * @param externalPath
 * @return string
 */
/* harmony default export */ var getUserExternalLibraryURL = (function (accountId, externalPath) {
  return externalPath.replace('{accountId}', accountId);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getBackgroundAudioPath.ts

/* harmony default export */ var getBackgroundAudioPath = (function (resourcePaths, backgroundAudioResourceProps) {
  var audioSrc = backgroundAudioResourceProps.src,
    accountId = backgroundAudioResourceProps.accountId;
  var rootPath = getUserExternalLibraryURL(accountId, resourcePaths.audioContentBucketPath);
  return "".concat(rootPath, "/").concat(audioSrc);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/resourceFolders.ts
var collections = 'collections';
var resources = 'resources';
var sourceImage = 'images';
var sourceVideo = 'videos';
var sourceLogo = 'logos';
var library = 'uploads';
var providers = 'saved';
var stockPhoto = 'high';
var customize = 'customize';
var texture = 'templates/images/2b516661f6ffa86fae35adb150585t23';
var external = '{accountId}/library/external';
var audio = '{accountId}/library/audio';
var covers = 'covers';
var items = 'items';
var widgetAssets = 'widget/assets';
var collectionsAssets = "".concat(collections, "/assets");
var ResourcesFolder = {
  collections: collections,
  resources: resources,
  sourceImage: sourceImage,
  sourceVideo: sourceVideo,
  sourceLogo: sourceLogo,
  library: library,
  providers: providers,
  stockPhoto: stockPhoto,
  customize: customize,
  texture: texture,
  external: external,
  covers: covers,
  items: items,
  widgetAssets: widgetAssets,
  collectionsAssets: collectionsAssets,
  audio: audio
};
var resourceFolders_ResourceType = {
  IMAGE: 'image',
  VIDEO: 'video',
  AUDIO: 'audio',
  FONT: 'font',
  SVG: 'svg',
  SHAPE: 'shape',
  ICON: 'icon',
  LOGO: 'logo',
  FALLBACK_LOGO: 'fallbackLogo',
  BACKGROUND: 'background',
  FLIP_SOUND: 'flipSound',
  STOCK_VIDEO: 'stockVideo',
  STOCK_VIDEO_COVER: 'stockVideoCover',
  BACKGROUND_AUDIO: 'backgroundAudio'
};
var MediaSubtypes = {
  LIBRARY: 'upload',
  STOCK: 'stock',
  TEXTURE: 'texture',
  // Deprecated
  COLOR: 'color',
  // Deprecated
  CONVERT_BACKGROUND: 'convertBackground'
};
var PhotoProviders = {
  UNSPLASH: 'unsplash',
  PEXELS: 'pexels',
  PIXABAY: 'pixabay',
  GIPHY: 'giphy',
  EXTERNAL: 'external'
};
var oneSizeProviders = new Set([PhotoProviders.UNSPLASH, PhotoProviders.PEXELS, PhotoProviders.PIXABAY, PhotoProviders.GIPHY]);
var oneSizeImageFormats = new Set(['gif']);
var CoverType = {
  ORIGINAL: 'original',
  MEDIUM: 'medium',
  THUMB: 'thumb',
  SMALL: 'small'
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getResourceConfig.ts



/**
 * Return folders path
 * @param config
 * @param downloadMode
 * @return object
 */
/* harmony default export */ var getResourceConfig = (function () {
  var downloadMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  var _staticStore$config$g = getConfig(),
    cdnBase = _staticStore$config$g.cdnBase,
    cdnContent = _staticStore$config$g.cdnContent,
    cdnStatic = _staticStore$config$g.cdnStatic,
    privateContentCdn = _staticStore$config$g.privateContentCdn;
  var contentPath = cdnContent;
  var staticPath = cdnStatic;
  var baseFilePath = cdnBase;
  var collectionPath = "".concat(baseFilePath, "/").concat(ResourcesFolder.collections);
  var resourcePath = "".concat(baseFilePath, "/").concat(ResourcesFolder.resources);
  var collectionResourcePath = "".concat(collectionPath, "/").concat(ResourcesFolder.resources);
  var sourceImagePath = "".concat(collectionResourcePath, "/").concat(ResourcesFolder.sourceImage);
  var sourceVideoPath = "".concat(collectionResourcePath, "/").concat(ResourcesFolder.sourceVideo);
  var widgetAssetsPath = "".concat(baseFilePath, "/").concat(ResourcesFolder.widgetAssets);
  var libraryPath = "".concat(collectionPath, "/").concat(ResourcesFolder.library);
  var providersPhoto = "".concat(sourceImagePath, "/").concat(ResourcesFolder.providers);
  var providersVideo = "".concat(sourceVideoPath, "/").concat(ResourcesFolder.providers);
  var stockPhoto = "".concat(sourceImagePath, "/").concat(ResourcesFolder.stockPhoto);
  var customizePath = "".concat(collectionPath, "/").concat(ResourcesFolder.customize);
  var texturePath = "".concat(baseFilePath, "/").concat(ResourcesFolder.texture);
  var external = "".concat(contentPath, "/").concat(ResourcesFolder.external);
  var collectionItemPath = "".concat(collectionPath, "/").concat(ResourcesFolder.items);
  var audioContentBucketPath = "".concat(contentPath, "/").concat(ResourcesFolder.audio);

  // When is downloadMode we need different path
  // TODO: Handle audio path for downloadMode
  if (downloadMode) {
    widgetAssetsPath = "".concat(baseFilePath, "/").concat(ResourcesFolder.collectionsAssets);
    external = baseFilePath;
  }
  return {
    contentPath: contentPath,
    privateContentCdn: privateContentCdn,
    staticPath: staticPath,
    baseFilePath: baseFilePath,
    collectionPath: collectionPath,
    resourcePath: resourcePath,
    collectionResourcePath: collectionResourcePath,
    sourceImagePath: sourceImagePath,
    sourceVideoPath: sourceVideoPath,
    widgetAssetsPath: widgetAssetsPath,
    libraryPath: libraryPath,
    providersPhoto: providersPhoto,
    providersVideo: providersVideo,
    stockPhoto: stockPhoto,
    customizePath: customizePath,
    texturePath: texturePath,
    external: external,
    collectionItemPath: collectionItemPath,
    audioContentBucketPath: audioContentBucketPath
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getBackgroundPath.ts
/**
 * Returns background image or texture resource url
 * @param resourcePaths
 * @param backgroundProps
 * @return string
 */
/* harmony default export */ var getBackgroundPath = (function (resourcePaths, backgroundProps) {
  var urlPath = '';
  if (backgroundProps.bgPattern) {
    urlPath = "".concat(resourcePaths.texturePath, "/").concat(backgroundProps.bgPattern);
  } else {
    urlPath = "".concat(resourcePaths.customizePath, "/").concat(backgroundProps.backgroundImage);
  }
  return urlPath;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/url/isValidURL.ts
/**
 * Check if provided string is a valid URL
 * @param input
 * @returns {boolean}
 */
/* harmony default export */ var isValidURL = (function (input) {
  var url;
  try {
    url = new URL(input);
  } catch (_) {
    return false;
  }
  return url.protocol === 'http:' || url.protocol === 'https:';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getMediaPath.ts




/**
 * Return Video or Image or Audio resource url
 * @param resourcePaths
 * @param mediaResources
 * @param type
 * @return string
 */
/* harmony default export */ var getMediaPath = (function (resourcePaths, mediaResources, type) {
  var rootPath = resourcePaths.libraryPath;
  var src = mediaResources.src,
    subType = mediaResources.subType,
    provider = mediaResources.provider,
    accountId = mediaResources.accountId,
    pageItemHash = mediaResources.pageItemHash;
  if (!src) {
    return '';
  }

  // In case the user enters a link to a video, just return it
  if (isValidURL(src) && provider === MediaSubtypes.LIBRARY) {
    return src;
  }
  if (provider) {
    if (provider === PhotoProviders.EXTERNAL && accountId) {
      rootPath = getUserExternalLibraryURL(accountId, resourcePaths.external);
    } else if (provider !== MediaSubtypes.LIBRARY) {
      rootPath = type === resourceFolders_ResourceType.VIDEO ? resourcePaths.providersVideo : resourcePaths.providersPhoto;
    }
  } else if (subType) {
    if (subType === MediaSubtypes.CONVERT_BACKGROUND) {
      rootPath = "".concat(resourcePaths.collectionItemPath, "/").concat(pageItemHash, "/backgrounds");
    } else if (subType !== MediaSubtypes.LIBRARY) {
      rootPath = resourcePaths.stockPhoto;
    }
  }
  return "".concat(rootPath, "/").concat(src);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getLogoPath.ts


/**
 * Returns logo image resource url
 */
/* harmony default export */ var getLogoPath = (function (resourcePaths, jsonProperties, logoProps, signature) {
  var hash = jsonProperties.hash,
    status = jsonProperties.status,
    accountId = jsonProperties.link.accountId;
  if ('location' in logoProps && logoProps.location !== '' && logoProps.location !== 'public') {
    var resourceCdn = logoProps.isPublic ? resourcePaths.contentPath : resourcePaths.privateContentCdn;
    var rootPath = "".concat(resourceCdn, "/").concat(accountId);
    var logoUrl = "".concat(rootPath, "/library/").concat(sourceImage, "/").concat(logoProps.resourceName);
    if (status === FlipbookStatus.PUBLISHED.toLowerCase()) {
      logoUrl = "".concat(rootPath, "/").concat(collections, "/").concat(hash, "/library/").concat(sourceImage, "/").concat(logoProps.resourceName);
      if (signature && !logoProps.isPublic) {
        logoUrl += "?".concat(signature);
      }
    }
    return logoUrl;
  }
  if ((logoProps === null || logoProps === void 0 ? void 0 : logoProps.resourceLocation) === ResourcesFolder.library) {
    return "".concat(resourcePaths.libraryPath, "/").concat(logoProps.resourceName);
  }
  return "".concat(resourcePaths.customizePath, "/").concat(logoProps.resourceName);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getFallbackLogoPath.ts


/**
 * Returns logo image resource url
 */
/* harmony default export */ var getFallbackLogoPath = (function (resourcePaths, jsonProperties, logoProps, signature) {
  var hash = jsonProperties.hash,
    status = jsonProperties.status,
    accountId = jsonProperties.link.accountId;
  if ('location' in logoProps && logoProps.location !== '' && logoProps.location !== 'public') {
    var resourceCdn = logoProps.isPublic ? resourcePaths.contentPath : resourcePaths.privateContentCdn;
    var logoUrl = "".concat(resourceCdn, "/").concat(accountId, "/library/").concat(sourceLogo, "/").concat(logoProps.resourceName);
    if (status === FlipbookStatus.PUBLISHED.toLowerCase()) {
      logoUrl = "".concat(resourceCdn, "/").concat(accountId, "/").concat(collections, "/").concat(hash, "/").concat(sourceLogo, "/").concat(logoProps.resourceName);
      if (signature && !logoProps.isPublic) {
        logoUrl += "?".concat(signature);
      }
    }
    return logoUrl;
  }
  if ((logoProps === null || logoProps === void 0 ? void 0 : logoProps.resourceLocation) === ResourcesFolder.library) {
    return "".concat(resourcePaths.libraryPath, "/").concat(logoProps.resourceName);
  }
  return "".concat(resourcePaths.customizePath, "/").concat(logoProps.resourceName);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getFlipSoundPath.ts
/**
 * Returns flip sound resource url
 * @param resourcePaths
 * @param flipSoundProps
 * @return string
 */
/* harmony default export */ var getFlipSoundPath = (function (resourcePaths, flipSoundProps) {
  return "".concat(resourcePaths.widgetAssetsPath, "/").concat(flipSoundProps.resourceName);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getShapePath.ts
/**
 * Returns shape resource url
 * @param resourcePaths
 * @param props
 * @return string
 */
/* harmony default export */ var getShapePath = (function (resourcePaths, props) {
  return "".concat(resourcePaths.resourcePath, "/svg2/").concat(props.resourceName, ".svg");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getIconPath.ts
/**
 * Returns icon resource url
 * @param resourcePaths
 * @param resourceName
 * @return string
 */
/* harmony default export */ var getIconPath = (function (resourcePaths, resourceName) {
  return "".concat(resourcePaths.collectionResourcePath, "/icon/icon_").concat(resourceName.resourceName, ".svg");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/types/typeguards/isFontV2UserType.ts


/**
 * Check if font source is user
 *
 * @returns {boolean}
 * @param fontSource
 */
/* harmony default export */ var isFontV2UserType = (function (fontSource) {
  return fontSource === elements_FontSource.USER;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/types/typeguards/isFontV3WorkspaceType.ts


/**
 * Check if font location is workspace
 *
 * @returns {boolean}
 * @param fontLocation
 */
/* harmony default export */ var isFontV3WorkspaceType = (function (fontLocation) {
  return fontLocation === FontLocation.WORKSPACE;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getFontPath.ts


/**
 * Returns font resource url
 * @param resourcePaths
 * @param fontProps
 * @param flipbookData
 * @return string
 */
/* harmony default export */ var getFontPath = (function (resourcePaths, fontProps, flipbookData) {
  // Admin fonts
  var resourceUrl = "".concat(resourcePaths.staticPath, "/library/fonts/").concat(fontProps.family);
  var isFontV3AndLocationWorkspace = isFontV3WorkspaceType(fontProps.location);
  var isFontV2AndSourceUser = isFontV2UserType(fontProps.source);
  var resourceCdn = isFontV3AndLocationWorkspace ? resourcePaths.privateContentCdn : resourcePaths.contentPath;
  if ((isFontV2AndSourceUser || isFontV3AndLocationWorkspace) && fontProps.accountId) {
    var fontPathBase = isFontV3AndLocationWorkspace && flipbookData.isPublished ? "/collections/".concat(flipbookData.hash) : '';
    var fontPath = "".concat(fontPathBase, "/library/fonts/").concat(fontProps.family);
    var fontSignature = isFontV3AndLocationWorkspace && flipbookData.signature ? "?".concat(flipbookData.signature) : '';
    var accountId = fontProps.accountId;

    // Fonts uploaded by user
    if (fontProps.locationHash && (isFontV2AndSourceUser || isFontV3AndLocationWorkspace && !flipbookData.isPublished)) {
      accountId = fontProps.locationHash || accountId;
    }
    resourceUrl = "".concat(resourceCdn, "/").concat(accountId).concat(fontPath).concat(fontSignature);
  }
  return resourceUrl;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getStockVideoPath.ts
/**
 * Returns shape resource url
 * @param resourcePaths
 * @param path
 * @param props
 * @return string
 */
/* harmony default export */ var getStockVideoPath = (function (resourcePaths, path, props) {
  return "".concat(resourcePaths.baseFilePath, "/collections/resources/videos/").concat(path, "/").concat(props.provider, "-").concat(props.providerId);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useResourcePath.ts


function useResourcePath_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function useResourcePath_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? useResourcePath_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : useResourcePath_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

















/**
 * Return resource url
 * @param type
 * @param props
 * @return string
 */
/* harmony default export */ var useResourcePath = (function (type, props) {
  var urlPath = '';
  var _useAtom = react_useAtom(rootPrimitivesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    downloadMode = _useAtom2[0].downloadMode;
  var signature = react_useAtomValue(signatureAtom);
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    jsonProperties = _useAtom4[0];
  var hash = jsonProperties.hash,
    status = jsonProperties.status,
    _jsonProperties$link = jsonProperties.link,
    accountId = _jsonProperties$link.accountId,
    sirAccountId = _jsonProperties$link.sirAccountId;
  var resourcePaths = getResourceConfig(downloadMode);
  var isPublished = status === FlipbookStatus.PUBLISHED.toLowerCase();
  switch (type) {
    case resourceFolders_ResourceType.IMAGE:
    case resourceFolders_ResourceType.VIDEO:
    case resourceFolders_ResourceType.AUDIO:
      {
        var mediaProps = useResourcePath_objectSpread(useResourcePath_objectSpread({}, props), {}, {
          accountId: accountId
        });
        urlPath = getMediaPath(resourcePaths, mediaProps, type);
        break;
      }
    case resourceFolders_ResourceType.STOCK_VIDEO_COVER:
    case resourceFolders_ResourceType.STOCK_VIDEO:
      {
        var _mediaProps = useResourcePath_objectSpread({}, props);
        var stockVideoPath = type === resourceFolders_ResourceType.STOCK_VIDEO ? 'saved' : 'covers';
        if (_mediaProps.providerId) {
          urlPath = getStockVideoPath(resourcePaths, stockVideoPath, _mediaProps);
        }
        break;
      }
    case resourceFolders_ResourceType.FONT:
      {
        var fontProps = props;
        var locationHash = '';
        if (fontProps.isOrganizationFont && sirAccountId) {
          locationHash = sirAccountId;
        }
        var fontData = {
          family: fontProps.family,
          location: fontProps.location,
          source: fontProps.source,
          accountId: accountId,
          locationHash: locationHash
        };
        urlPath = getFontPath(resourcePaths, fontData, {
          signature: signature,
          isPublished: isPublished,
          hash: hash
        });
        break;
      }
    case resourceFolders_ResourceType.SHAPE:
      {
        urlPath = getShapePath(resourcePaths, props);
        break;
      }
    case resourceFolders_ResourceType.ICON:
      {
        urlPath = getIconPath(resourcePaths, props);
        break;
      }
    case resourceFolders_ResourceType.LOGO:
      {
        urlPath = getLogoPath(resourcePaths, jsonProperties, props, signature);
        break;
      }
    case resourceFolders_ResourceType.FALLBACK_LOGO:
      {
        urlPath = getFallbackLogoPath(resourcePaths, jsonProperties, props, signature);
        break;
      }
    case resourceFolders_ResourceType.BACKGROUND:
      {
        urlPath = getBackgroundPath(resourcePaths, props);
        break;
      }
    case resourceFolders_ResourceType.FLIP_SOUND:
      {
        urlPath = getFlipSoundPath(resourcePaths, props);
        break;
      }
    case resourceFolders_ResourceType.BACKGROUND_AUDIO:
      {
        var backgroundAudioResourceProps = useResourcePath_objectSpread(useResourcePath_objectSpread({}, props), {}, {
          accountId: accountId
        });
        urlPath = getBackgroundAudioPath(resourcePaths, backgroundAudioResourceProps);
        break;
      }
    default:
      break;
  }
  return urlPath;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PlayerLogoContainer/PlayerLogoContainer.tsx







var PlayerLogoContainer = function PlayerLogoContainer(_ref) {
  var src = _ref.src,
    href = _ref.href,
    location = _ref.location;
  var url = useResourcePath(resourceFolders_ResourceType.LOGO, {
    resourceName: src,
    location: location
  });
  var ariaLabel = useTranslate(Identifier.accessibility_logo_image);
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    effect = _useContext.options.content.effect;
  if (!src || !url) {
    return null;
  }
  return /*#__PURE__*/react.createElement(PlayerLogo_PlayerLogo, {
    src: url,
    href: href,
    ariaLabel: ariaLabel,
    effect: effect
  });
};
/* harmony default export */ var PlayerLogoContainer_PlayerLogoContainer = (PlayerLogoContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/HeaderContainer/helpers/getRightPositionControllerBar.ts
/**
 * Calculates the top spacing for the controller bar based on whether
 * the cart is shown in the player and if the player is in fullscreen mode.
 *
 * @param {boolean} showCartInPlayer - Indicates if the cart is shown in the player.
 * @param {boolean} isFullscreen - Indicates if the player is in fullscreen mode.
 * @returns {number} - The calculated top spacing for the controller bar.
 */
/* harmony default export */ var getRightPositionControllerBar = (function (showCartInPlayer, isFullscreen) {
  var defaultSpacing = 56;
  var right = 0;
  if (showCartInPlayer) {
    right += defaultSpacing;
  }
  if (isFullscreen) {
    right += defaultSpacing;
  }
  return right;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/WatermarkContainer/WatermarkStyledComponents.styles.tsx


var WatermarkContainer = styled_components_browser_esm.a.withConfig({
  displayName: "WatermarkStyledComponentsstyles__WatermarkContainer",
  componentId: "sc-sc96bn-0"
})(["display:flex;justify-content:center;align-items:center;padding:8px;position:relative;z-index:1;height:36px;left:8px;top:8px;text-decoration:none;background:", ";border-radius:", "px;backdrop-filter:blur(2px);&:after{content:\"\";padding:8px;position:absolute;width:110%;height:150%;}"], function (_ref) {
  var theme = _ref.theme;
  return "".concat(theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.6));
}, function (_ref2) {
  var theme = _ref2.theme;
  return "".concat(theme.defaults.borderRadius);
});
var WatermarkParagraph = styled_components_browser_esm.p.withConfig({
  displayName: "WatermarkStyledComponentsstyles__WatermarkParagraph",
  componentId: "sc-sc96bn-1"
})(["font-weight:", ";font-size:10px;"], function (_ref3) {
  var theme = _ref3.theme;
  return "".concat(theme.typography.weight.semiBold);
});
var WatermarkText = styled_components_browser_esm.span.withConfig({
  displayName: "WatermarkStyledComponentsstyles__WatermarkText",
  componentId: "sc-sc96bn-2"
})(["text-align:left;color:", ";margin:0 ", "px 0 0;"], function (_ref4) {
  var theme = _ref4.theme;
  return "".concat(theme.colors.white);
}, function (_ref5) {
  var theme = _ref5.theme;
  return "".concat(theme.controllerBar.container.marginRight);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/WatermarkContainer/Watermark.tsx






var Watermark = function Watermark(props) {
  var theme = Ze();
  return props.showWatermark ? /*#__PURE__*/react.createElement(ErrorBoundary_ErrorBoundary, null, /*#__PURE__*/react.createElement(WatermarkContainer, {
    href: props.url,
    target: "_parent"
  }, /*#__PURE__*/react.createElement(WatermarkText, null, /*#__PURE__*/react.createElement(WatermarkParagraph, null, "Created using")), /*#__PURE__*/react.createElement(src.FlipbookLogo, {
    fill: theme.colors.white
  }))) : null;
};
Watermark.propTypes = {
  showWatermark: (prop_types_default()).bool.isRequired,
  url: (prop_types_default()).string.isRequired
};
/* harmony default export */ var WatermarkContainer_Watermark = (Watermark);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/WatermarkContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/HeaderContainer/HeaderContainerStyles.tsx

var PlayerHeaderContainer = styled_components_browser_esm.div.withConfig({
  displayName: "HeaderContainerStyles__PlayerHeaderContainer",
  componentId: "sc-1yovtdi-0"
})(["position:absolute;top:0;left:0;display:flex;flex-wrap:wrap;padding:8px;width:100%;justify-content:space-between;align-items:center;height:", "px;pointer-events:none;", ""], function (_ref) {
  var theme = _ref.theme;
  return theme.controllerBar.top.height;
}, function (_ref2) {
  var isMobile = _ref2.isMobile;
  if (isMobile) {
    return "\n                padding-left: env(safe-area-inset-left);\n                padding-right: env(safe-area-inset-right);\n            ";
  }
  return '';
});
var LogoAndWatermarkContainer = styled_components_browser_esm.div.withConfig({
  displayName: "HeaderContainerStyles__LogoAndWatermarkContainer",
  componentId: "sc-1yovtdi-1"
})(["display:flex;pointer-events:all;", ";"], function (_ref3) {
  var showClassicSkinControlBar = _ref3.showClassicSkinControlBar;
  return showClassicSkinControlBar && 'z-index: 2;';
});
var ControllerBarTop = styled_components_browser_esm.div.withConfig({
  displayName: "HeaderContainerStyles__ControllerBarTop",
  componentId: "sc-1yovtdi-2"
})(["position:absolute;left:9px;right:9px;height:", "px;display:flex;justify-content:center;align-item:center;transition:opacity 200ms ease-in-out;opacity:", ";pointer-events:", ";&:hover{opacity:1;pointer-events:all;}"], function (_ref4) {
  var theme = _ref4.theme;
  return theme.controllerBar.height;
}, function (props) {
  return props.$visible ? '1' : '0';
}, function (props) {
  return props.$visible ? 'all' : 'none';
});
var ExitFullscreenContainer = styled_components_browser_esm.div.withConfig({
  displayName: "HeaderContainerStyles__ExitFullscreenContainer",
  componentId: "sc-1yovtdi-3"
})(["z-index:2;pointer-events:all;"]);
var CartButtonContainer = styled_components_browser_esm.div.withConfig({
  displayName: "HeaderContainerStyles__CartButtonContainer",
  componentId: "sc-1yovtdi-4"
})(["display:flex;align-self:flex-start;pointer-events:all;z-index:2;margin-right:4px;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/HeaderContainer/HeaderContainer.tsx





















var HeaderContainer = function HeaderContainer(props) {
  var theme = Ze();
  var _useContext = (0,react.useContext)(contexts_FullscreenContext),
    isFullscreen = _useContext.isFullscreen;
  var _useAtom = react_useAtom(featuresAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    features = _useAtom2[0];
  var _useAtom3 = react_useAtom(controllerBarVisibleAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    isControlBarVisible = _useAtom4[0];
  var _useAtom5 = react_useAtom(stageSizeAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    stageSize = _useAtom6[0];
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    _useContext2$options = _useContext2.options,
    skinType = _useContext2$options.content.skinType,
    showControls = _useContext2$options.controls.showControls,
    logo = _useContext2$options.logo,
    cart = _useContext2.cart;
  var showClassicSkinControlBar = skinType === playerTypes_SkinTypes.CLASSIC && (showControls || !showControls && isFullscreen) && stageSize.width >= theme.deviceSize.tabletS;
  var showCartInPlayer = cart && !!cart.showCartInPlayer && features.ADD_TO_CART;
  var right = getRightPositionControllerBar(showCartInPlayer, isFullscreen);
  var cartButtonInPlayer = showCartInPlayer && /*#__PURE__*/react.createElement(CartButton_CartButton, null);
  return /*#__PURE__*/react.createElement(PlayerHeaderContainer, {
    $visible: isControlBarVisible,
    showClassicSkinControlBar: showClassicSkinControlBar,
    isMobile: main/* isMobile */.Fr
  }, /*#__PURE__*/react.createElement(LogoAndWatermarkContainer, {
    showClassicSkinControlBar: showClassicSkinControlBar
  }, /*#__PURE__*/react.createElement(Accessibility_AccessibilityButton, null), /*#__PURE__*/react.createElement(WatermarkContainer_Watermark, {
    url: props.watermarkUrl,
    showWatermark: props.showWatermark
  }), props.hasLogo && /*#__PURE__*/react.createElement(PlayerLogoContainer_PlayerLogoContainer, {
    src: (logo === null || logo === void 0 ? void 0 : logo.src) || '',
    href: (logo === null || logo === void 0 ? void 0 : logo.href) || '',
    location: (logo === null || logo === void 0 ? void 0 : logo.location) || flipbookElements_ResourceLocation.PUBLIC
  })), showClassicSkinControlBar ? /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ControllerBarTop, {
    $visible: isControlBarVisible,
    $right: right
  }, /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ControllerBarWrapper_ControllerBarWrapper, null), /*#__PURE__*/react.createElement(ControllerBarButtons, null))), /*#__PURE__*/react.createElement(CartButtonContainer, null, cartButtonInPlayer, isFullscreen && /*#__PURE__*/react.createElement(FullscreenButtonContainer_ExitFullScreenButton, null))) : /*#__PURE__*/react.createElement(CartButtonContainer, null, cartButtonInPlayer));
};
/* harmony default export */ var HeaderContainer_HeaderContainer = (HeaderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/HeaderContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/QuizContext.ts


var feedbackProperties = src_QuizView.feedbackProperties;
var quizDefault = {
  agreedToPrivacyPolicy: false,
  agreedToGDPR: false,
  readerEmail: '',
  correctAnswers: {},
  selectedOptions: {},
  isQuizPassed: false,
  elementClickedTime: Math.floor(Date.now() / 1000),
  activeQuestionIndex: 0,
  feedbacks: {},
  setAgreedToPrivacyPolicy: function setAgreedToPrivacyPolicy() {},
  setAgreedToGDPR: function setAgreedToGDPR() {},
  setReaderEmail: function setReaderEmail() {},
  setCorrectAnswers: function setCorrectAnswers() {},
  setSelectedOptions: function setSelectedOptions() {},
  setIsQuizPassed: function setIsQuizPassed() {},
  setElementClickedTime: function setElementClickedTime() {},
  nextQuestionIndex: function nextQuestionIndex() {},
  previousQuestionIndex: function previousQuestionIndex() {},
  resetQuiz: function resetQuiz() {},
  setFeedbacks: function setFeedbacks() {}
};
var QuizContext = /*#__PURE__*/react.createContext(quizDefault);
var QuizProvider = QuizContext.Provider;
/* harmony default export */ var contexts_QuizContext = (QuizContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/QuizProviderContainer/index.tsx






var QuizProviderContainer = function QuizProviderContainer(props) {
  var setModalStep = react_useSetAtom(setModalStepAtom);
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    agreedToPrivacyPolicy = _useState2[0],
    setAgreedToPrivacyPolicy = _useState2[1];
  var _useState3 = (0,react.useState)(false),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    agreedToGDPR = _useState4[0],
    setAgreedToGDPR = _useState4[1];
  var _useState5 = (0,react.useState)(''),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    readerEmail = _useState6[0],
    setReaderEmail = _useState6[1];
  var _useState7 = (0,react.useState)({}),
    _useState8 = slicedToArray_slicedToArray(_useState7, 2),
    correctAnswers = _useState8[0],
    setCorrectAnswers = _useState8[1];
  var _useState9 = (0,react.useState)({}),
    _useState10 = slicedToArray_slicedToArray(_useState9, 2),
    selectedOptions = _useState10[0],
    setSelectedOptions = _useState10[1];
  var _useState11 = (0,react.useState)(false),
    _useState12 = slicedToArray_slicedToArray(_useState11, 2),
    isQuizPassed = _useState12[0],
    setIsQuizPassed = _useState12[1];
  var _useState13 = (0,react.useState)(0),
    _useState14 = slicedToArray_slicedToArray(_useState13, 2),
    elementClickedTime = _useState14[0],
    setElementClickedTime = _useState14[1];
  var _useState15 = (0,react.useState)(0),
    _useState16 = slicedToArray_slicedToArray(_useState15, 2),
    activeQuestionIndex = _useState16[0],
    setActiveQuestionIndex = _useState16[1];
  var _useState17 = (0,react.useState)({}),
    _useState18 = slicedToArray_slicedToArray(_useState17, 2),
    feedbacks = _useState18[0],
    setFeedbacks = _useState18[1];
  var nextQuestionIndex = function nextQuestionIndex() {
    setActiveQuestionIndex(function (prevState) {
      return prevState + 1;
    });
  };
  var previousQuestionIndex = function previousQuestionIndex() {
    setActiveQuestionIndex(function (prevState) {
      return prevState - 1;
    });
  };
  var resetQuiz = function resetQuiz(multipleQuestionsPerPage) {
    setModalStep(QuizModalStep.LOADING_RETAKE);
    setAgreedToPrivacyPolicy(false);
    setAgreedToGDPR(false);
    setSelectedOptions({});
    setElementClickedTime(0);
    !multipleQuestionsPerPage && setActiveQuestionIndex(0);
  };
  return /*#__PURE__*/react.createElement(QuizProvider, {
    value: {
      agreedToPrivacyPolicy: agreedToPrivacyPolicy,
      agreedToGDPR: agreedToGDPR,
      readerEmail: readerEmail,
      correctAnswers: correctAnswers,
      selectedOptions: selectedOptions,
      isQuizPassed: isQuizPassed,
      elementClickedTime: elementClickedTime,
      activeQuestionIndex: activeQuestionIndex,
      feedbacks: feedbacks,
      setAgreedToPrivacyPolicy: setAgreedToPrivacyPolicy,
      setAgreedToGDPR: setAgreedToGDPR,
      setReaderEmail: setReaderEmail,
      setCorrectAnswers: setCorrectAnswers,
      setSelectedOptions: setSelectedOptions,
      setIsQuizPassed: setIsQuizPassed,
      setElementClickedTime: setElementClickedTime,
      nextQuestionIndex: nextQuestionIndex,
      previousQuestionIndex: previousQuestionIndex,
      resetQuiz: resetQuiz,
      setFeedbacks: setFeedbacks
    }
  }, props.children);
};
/* harmony default export */ var providers_QuizProviderContainer = (QuizProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useElement.ts


/* harmony default export */ var useElement = (function (props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    pages = _useContext.pages;
  return pages.data[props.pageId].elements[props.elementIndex];
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/helpers.ts





function InteractivityModal_helpers_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function InteractivityModal_helpers_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? InteractivityModal_helpers_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : InteractivityModal_helpers_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function helpers_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ helpers_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
var getSecuredDataFromDynamo = /*#__PURE__*/function () {
  var _ref2 = asyncToGenerator_asyncToGenerator(/*#__PURE__*/helpers_regeneratorRuntime().mark(function _callee(_ref) {
    var parameters, url, queryString, interactivityResultUrl, response;
    return helpers_regeneratorRuntime().wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          parameters = _ref.parameters, url = _ref.url;
          _context.prev = 1;
          queryString = new URLSearchParams(parameters).toString();
          interactivityResultUrl = "".concat(url, "?").concat(queryString);
          _context.next = 6;
          return fetch(interactivityResultUrl, {
            headers: {
              'Content-Type': 'application/json'
            }
          });
        case 6:
          response = _context.sent;
          if (response.ok) {
            _context.next = 9;
            break;
          }
          throw new Error('Network response error');
        case 9:
          _context.next = 11;
          return response.json();
        case 11:
          _context.t0 = _context.sent;
          return _context.abrupt("return", {
            error: false,
            data: _context.t0
          });
        case 15:
          _context.prev = 15;
          _context.t1 = _context["catch"](1);
          return _context.abrupt("return", {
            error: _context.t1.message,
            data: undefined
          });
        case 18:
        case "end":
          return _context.stop();
      }
    }, _callee, null, [[1, 15]]);
  }));
  return function getSecuredDataFromDynamo(_x) {
    return _ref2.apply(this, arguments);
  };
}();
var getCorrectGivenAnswersCount = function getCorrectGivenAnswersCount(answersToCount, givenAnswers) {
  return Object.entries(answersToCount).reduce(function (count, _ref3) {
    var _ref4 = slicedToArray_slicedToArray(_ref3, 2),
      key = _ref4[0],
      expectedAnswers = _ref4[1];
    var submitted = givenAnswers[key];
    if (submitted.length === expectedAnswers.length && expectedAnswers.every(function (answer) {
      return submitted.includes(answer);
    })) {
      return count + 1;
    }
    return count;
  }, 0);
};
var parseUserGivenAnswer = function parseUserGivenAnswer(event, givenAnswers) {
  var _event$target = event.target,
    questionId = _event$target.name,
    optionId = _event$target.value,
    type = _event$target.type,
    checked = _event$target.checked;
  var newOptions = InteractivityModal_helpers_objectSpread({}, givenAnswers);
  if (type === 'radio') {
    newOptions = InteractivityModal_helpers_objectSpread(InteractivityModal_helpers_objectSpread({}, givenAnswers), {}, defineProperty_defineProperty({}, questionId, [optionId]));
  }
  if (type === 'checkbox') {
    var updatedOptions = checked ? [].concat(toConsumableArray_toConsumableArray(givenAnswers[questionId] || []), [optionId]) : (givenAnswers[questionId] || []).filter(function (opt) {
      return opt !== optionId;
    });
    newOptions = updatedOptions.length ? InteractivityModal_helpers_objectSpread(InteractivityModal_helpers_objectSpread({}, givenAnswers), {}, defineProperty_defineProperty({}, questionId, updatedOptions)) : Object.fromEntries(Object.entries(givenAnswers).filter(function (_ref5) {
      var _ref6 = slicedToArray_slicedToArray(_ref5, 1),
        key = _ref6[0];
      return key !== questionId;
    }));
  }
  return newOptions;
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/Quiz.styles.tsx





// TODO: Restructure quiz wrappers

var QuizModalWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__QuizModalWrapper",
  componentId: "sc-tgnx8t-0"
})(["display:flex;flex-direction:column;"]);
var QuizModal = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__QuizModal",
  componentId: "sc-tgnx8t-1"
})(["display:flex;flex-direction:column;max-height:", "px;margin:24px 0;min-width:250px;"], function (_ref) {
  var $stageSizeHeight = _ref.$stageSizeHeight;
  return $stageSizeHeight - $stageSizeHeight * 0.30;
});
var QuizModalHeader = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__QuizModalHeader",
  componentId: "sc-tgnx8t-2"
})(["display:flex;flex-direction:row;justify-content:space-between;padding:0 24px 16px 24px;"]);
var QuizModalForm = styled_components_browser_esm.form.withConfig({
  displayName: "Quizstyles__QuizModalForm",
  componentId: "sc-tgnx8t-3"
})(["display:flex;flex-direction:column;max-height:", "px;flex:1;flex-basis:450px;overflow-y:auto;"], function (_ref2) {
  var $stageSizeHeight = _ref2.$stageSizeHeight;
  return $stageSizeHeight - 72 - $stageSizeHeight * 0.30;
});
var ScrollableSection = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__ScrollableSection",
  componentId: "sc-tgnx8t-4"
})(["flex:1;overflow-x:hidden;padding:0 13px 0 24px;scrollbar-gutter:stable;scrollbar-color:", " ", ";", " ", ""], function (_ref3) {
  var theme = _ref3.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.26);
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.colors.white;
}, main/* isSafari */.nr && "\n        overflow-y: scroll;\n    ", main/* isMobile */.Fr && "\n        padding-right: 24px;\n    ");
var QuizTitle = styled_components_browser_esm(H2).withConfig({
  displayName: "Quizstyles__QuizTitle",
  componentId: "sc-tgnx8t-5"
})(["margin:0 24px 0 24px;overflow:hidden;text-overflow:ellipsis;"]);
var QuizDescription = styled_components_browser_esm(H5).withConfig({
  displayName: "Quizstyles__QuizDescription",
  componentId: "sc-tgnx8t-6"
})(["color:", ";font-weight:", ";margin:8px 24px 0 24px;overflow:hidden;text-overflow:ellipsis;"], function (_ref5) {
  var theme = _ref5.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.6);
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.typography.weight.regular;
});

// Quiz questions
var QuizQuestionWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__QuizQuestionWrapper",
  componentId: "sc-tgnx8t-7"
})(["border:none;padding:0;margin:0 0 24px 0;&:last-child{margin-bottom:0;}"]);
var AnswerStatus = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__AnswerStatus",
  componentId: "sc-tgnx8t-8"
})(["display:flex;align-items:center;gap:8px;margin-bottom:16px;font-size:", "px;font-weight:", ";color:", ";"], function (_ref7) {
  var theme = _ref7.theme;
  return theme.typography.size.h4;
}, function (_ref8) {
  var theme = _ref8.theme;
  return theme.typography.weight.medium;
}, function (_ref9) {
  var $isAnsweredCorrect = _ref9.$isAnsweredCorrect;
  return $isAnsweredCorrect ? '#00AD11' : '#DB2B3A';
});
var Quiz_styles_QuizQuestion = styled_components_browser_esm(H3).withConfig({
  displayName: "Quizstyles__QuizQuestion",
  componentId: "sc-tgnx8t-9"
})(["margin:0 0 14px 0;"]);
var Quiz_styles_QuizOption = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__QuizOption",
  componentId: "sc-tgnx8t-10"
})(["position:relative;display:flex;align-items:center;margin:0 0 8px 0;"]);
var QuestionExplanation = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__QuestionExplanation",
  componentId: "sc-tgnx8t-11"
})(["margin-bottom:16px;background-color:#F7F7F7;border-radius:8px;padding:8px 3px 8px 16px;"]);
var Explanation = styled_components_browser_esm(H3).withConfig({
  displayName: "Quizstyles__Explanation",
  componentId: "sc-tgnx8t-12"
})(["margin:8px 0 8px 0;"]);
var UnsubmittedQuizOptionInput = styled_components_browser_esm.input.withConfig({
  displayName: "Quizstyles__UnsubmittedQuizOptionInput",
  componentId: "sc-tgnx8t-13"
})(["color:", ";margin:0 0 0 14px;width:16px;height:16px;opacity:1;background-color:", ";border:1px solid ", ";"], function (_ref10) {
  var theme = _ref10.theme;
  return theme.colors.primary;
}, function (_ref11) {
  var theme = _ref11.theme;
  return theme.defaultColors.withOpacity(ColorsWithOpacity.PRIMARY, 0.12);
}, function (_ref12) {
  var theme = _ref12.theme;
  return theme.defaultColors.primary;
});
var QuizOptionLabelWrapper = styled_components_browser_esm.label.withConfig({
  displayName: "Quizstyles__QuizOptionLabelWrapper",
  componentId: "sc-tgnx8t-14"
})(["display:flex;align-items:center;justify-content:space-between;width:100%;border:1px solid ", ";border-radius:4px;font-size:", "px;font-style:", ";line-height:", "px;padding:8px 16px;overflow-x:auto;white-space:nowrap;margin-left:-30px;", ""], function (_ref13) {
  var theme = _ref13.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.2);
}, function (_ref14) {
  var theme = _ref14.theme;
  return theme.typography.size.button;
}, function (_ref15) {
  var theme = _ref15.theme;
  return theme.typography.style.normal;
}, function (_ref16) {
  var theme = _ref16.theme;
  return theme.typography.lineHeight.paragraph;
}, function (_ref17) {
  var theme = _ref17.theme,
    $activeFeedbackState = _ref17.$activeFeedbackState;
  return !$activeFeedbackState && "\n            cursor: pointer;\n\n            :hover {\n                background-color: ".concat(theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.04), ";\n            } ");
});
var UnsubmittedQuizLabel = styled_components_browser_esm.p.withConfig({
  displayName: "Quizstyles__UnsubmittedQuizLabel",
  componentId: "sc-tgnx8t-15"
})(["margin:0;padding-left:30px;"]);
var QuizOptionText = styled_components_browser_esm.span.withConfig({
  displayName: "Quizstyles__QuizOptionText",
  componentId: "sc-tgnx8t-16"
})(["white-space:normal;"]);
var QuestionNumber = styled_components_browser_esm(H5).withConfig({
  displayName: "Quizstyles__QuestionNumber",
  componentId: "sc-tgnx8t-17"
})(["color:#1314168F;font-weight:", ";"], function (_ref18) {
  var theme = _ref18.theme;
  return theme.typography.weight.regular;
});
var QuestionsAnswered = styled_components_browser_esm(H5).withConfig({
  displayName: "Quizstyles__QuestionsAnswered",
  componentId: "sc-tgnx8t-18"
})(["color:", ";font-weight:", ";"], function (_ref19) {
  var $hasError = _ref19.$hasError;
  return $hasError ? '#DB2B3A' : '#1314168F';
}, function (_ref20) {
  var theme = _ref20.theme;
  return theme.typography.weight.regular;
});
var NavigationButtonsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__NavigationButtonsContainer",
  componentId: "sc-tgnx8t-19"
})(["display:flex;justify-content:space-between;padding:24px 24px 0 24px;"]);
var BaseButton = styled_components_browser_esm.button.withConfig({
  displayName: "Quizstyles__BaseButton",
  componentId: "sc-tgnx8t-20"
})(["font-family:", ";border:none;border-radius:8px;height:40px;padding:8px 22px;font-weight:", ";font-size:", "px;letter-spacing:0.1px;overflow:hidden;cursor:pointer;:disabled{background-color:", ";cursor:not-allowed;color:", ";}"], function (_ref21) {
  var theme = _ref21.theme;
  return theme.typography.family.sans;
}, function (_ref22) {
  var theme = _ref22.theme;
  return theme.typography.weight.medium;
}, function (_ref23) {
  var theme = _ref23.theme;
  return theme.typography.size.button;
}, function (_ref24) {
  var theme = _ref24.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.12);
}, function (_ref25) {
  var theme = _ref25.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.38);
});
var PreviousButton = styled_components_browser_esm(BaseButton).withConfig({
  displayName: "Quizstyles__PreviousButton",
  componentId: "sc-tgnx8t-21"
})(["background-color:", ";border:1px solid ", ";color:", ";:not(:disabled):hover{background-color:rgba(6,16,26,0.04)};}"], function (_ref26) {
  var theme = _ref26.theme;
  return theme.colors.white;
}, function (_ref27) {
  var theme = _ref27.theme;
  return theme.colors.black;
}, function (_ref28) {
  var theme = _ref28.theme;
  return theme.colors.black;
});
var NextButton = styled_components_browser_esm(BaseButton).withConfig({
  displayName: "Quizstyles__NextButton",
  componentId: "sc-tgnx8t-22"
})(["background-color:", ";color:", ";margin-left:auto;:not(:disabled):hover{background-color:#464E59;}"], function (_ref29) {
  var theme = _ref29.theme;
  return theme.colors.getButtonColor(theme.colors.black);
}, function (_ref30) {
  var theme = _ref30.theme;
  return theme.colors.white;
});
var CompleteButton = styled_components_browser_esm(BaseButton).withConfig({
  displayName: "Quizstyles__CompleteButton",
  componentId: "sc-tgnx8t-23"
})(["", " background-color:", ";color:", ";:not(:disabled):hover{background-image:linear-gradient(rgba(0,0,0,0.30),rgba(0,0,0,0.30));}"], function (_ref31) {
  var $fullWidth = _ref31.$fullWidth;
  return $fullWidth ? Ce(["width:100%;margin-left:initial;"]) : Ce(["margin-left:auto;width:fit-content;"]);
}, function (_ref32) {
  var theme = _ref32.theme,
    $isSubmit = _ref32.$isSubmit;
  return $isSubmit ? theme.colors.getButtonColor(theme.colors.black) : theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref33) {
  var theme = _ref33.theme;
  return theme.colors.getTextColor(theme.colors.primary);
});

// Loading step
var LoadingStateModal = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__LoadingStateModal",
  componentId: "sc-tgnx8t-24"
})(["background:", ";text-align:center;align-items:center;height:195px;display:flex;gap:24px;margin:0 24px;"], function (_ref34) {
  var theme = _ref34.theme;
  return theme.colors.white;
});
var Quiz_styles_PreloaderIcon = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__PreloaderIcon",
  componentId: "sc-tgnx8t-25"
})(["background:", ";animation:PreloaderIconAnimation 1s infinite ease-in-out;width:1em;height:4em;:before,:after{background:", ";animation:PreloaderIconAnimation 1s infinite ease-in-out;width:1em;height:4em;position:absolute;top:0;content:'';}align-self:center;margin:0 auto;position:relative;font-size:6px;transform:translateZ(0);animation-delay:-0.16s;:before{left:-2em;animation-delay:-0.32s;}:after{left:2em;}@keyframes PreloaderIconAnimation{0%,80%,100%{transform:scaleY(0.8);}40%{transform:scaleY(1.2);}}"], function (_ref35) {
  var theme = _ref35.theme;
  return theme.colors.black;
}, function (_ref36) {
  var theme = _ref36.theme;
  return theme.colors.black;
});

// Vew results step
var CorrectAnswersCountContainer = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__CorrectAnswersCountContainer",
  componentId: "sc-tgnx8t-26"
})(["color:", ";font-size:", "px;font-weight:", ";"], function (_ref37) {
  var theme = _ref37.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.55);
}, function (_ref38) {
  var theme = _ref38.theme;
  return theme.typography.size.h5;
}, function (_ref39) {
  var theme = _ref39.theme;
  return theme.typography.weight.medium;
});
var SubmittedQuizOptionInput = styled_components_browser_esm.input.withConfig({
  displayName: "Quizstyles__SubmittedQuizOptionInput",
  componentId: "sc-tgnx8t-27"
})(["color:", ";margin:0 0 0 14px;width:16px;height:16px;opacity:0;pointer-events:none;&:checked + label{", "}"], function (_ref40) {
  var theme = _ref40.theme;
  return theme.colors.primary;
}, function (_ref41) {
  var $isCorrect = _ref41.$isCorrect;
  return $isCorrect ? Ce(["background-color:", ";border:1px solid ", ";color:", ";"], function (_ref42) {
    var theme = _ref42.theme;
    return theme.colors.withOpacity(ColorsWithOpacity.SUCCESS, 0.12);
  }, function (_ref43) {
    var theme = _ref43.theme;
    return theme.colors.withOpacity(ColorsWithOpacity.SUCCESS, 0.50);
  }, function (_ref44) {
    var theme = _ref44.theme;
    return theme.colors.successText;
  }) : Ce(["background-color:", ";border:1px solid ", ";color:", ";"], function (_ref45) {
    var theme = _ref45.theme;
    return theme.colors.withOpacity(ColorsWithOpacity.DANGER, 0.12);
  }, function (_ref46) {
    var theme = _ref46.theme;
    return theme.colors.withOpacity(ColorsWithOpacity.DANGER, 0.50);
  }, function (_ref47) {
    var theme = _ref47.theme;
    return theme.colors.dangerText;
  });
});
var SubmittedQuizLabel = styled_components_browser_esm.p.withConfig({
  displayName: "Quizstyles__SubmittedQuizLabel",
  componentId: "sc-tgnx8t-28"
})(["margin:0;"]);
var QuizOptionLabelCheckMark = styled_components_browser_esm.span.withConfig({
  displayName: "Quizstyles__QuizOptionLabelCheckMark",
  componentId: "sc-tgnx8t-29"
})(["height:24px;"]);
var RetakeButton = styled_components_browser_esm(BaseButton).withConfig({
  displayName: "Quizstyles__RetakeButton",
  componentId: "sc-tgnx8t-30"
})(["width:100%;background-color:", ";border:1px solid ", ";color:", ";&:hover{background-image:linear-gradient( ", ",", " );}"], function (_ref48) {
  var theme = _ref48.theme;
  return theme.colors.white;
}, function (_ref49) {
  var theme = _ref49.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref50) {
  var theme = _ref50.theme;
  return theme.colors.getTextButtonColor(theme.colors.primary);
}, function (_ref51) {
  var theme = _ref51.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.PRIMARY, 0.08);
}, function (_ref52) {
  var theme = _ref52.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.PRIMARY, 0.08);
});
var ViewResultsButton = styled_components_browser_esm.button.withConfig({
  displayName: "Quizstyles__ViewResultsButton",
  componentId: "sc-tgnx8t-31"
})(["font-family:", ";color:", ";transition:background 0.2s;cursor:pointer;padding:8px 24px;text-align:center;line-height:", "px;border-radius:8px;background-color:", ";letter-spacing:0.1px;border:1px solid ", ";font-size:", "px;font-weight:", ";&:hover{background-image:linear-gradient(rgba(0,0,0,0.30),rgba(0,0,0,0.30));}"], function (_ref53) {
  var theme = _ref53.theme;
  return theme.typography.family.sans;
}, function (_ref54) {
  var theme = _ref54.theme;
  return theme.colors.getTextColor(theme.colors.primary);
}, function (_ref55) {
  var theme = _ref55.theme;
  return theme.typography.lineHeight.paragraph;
}, function (_ref56) {
  var theme = _ref56.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref57) {
  var theme = _ref57.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref58) {
  var theme = _ref58.theme;
  return theme.typography.size.button;
}, function (_ref59) {
  var theme = _ref59.theme;
  return theme.typography.weight.medium;
});
var Quiz_styles_ButtonsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "Quizstyles__ButtonsContainer",
  componentId: "sc-tgnx8t-32"
})(["display:flex;flex-direction:column;gap:16px;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/SuccessfulSendResponse/SuccessfulSendResponse.styles.ts


var InformationContainer = styled_components_browser_esm.div.withConfig({
  displayName: "SuccessfulSendResponsestyles__InformationContainer",
  componentId: "sc-chbkuf-0"
})(["display:flex;flex-direction:column;gap:24px;background:", ";text-align:center;align-items:center;margin:0 24px;"], function (_ref) {
  var theme = _ref.theme;
  return theme.colors.white;
});
var SuccessfulSendResponse_styles_ViewResultsButton = styled_components_browser_esm.button.withConfig({
  displayName: "SuccessfulSendResponsestyles__ViewResultsButton",
  componentId: "sc-chbkuf-1"
})(["font-family:", ";color:", ";transition:background 0.2s;cursor:pointer;padding:8px 24px;text-align:center;line-height:", "px;border-radius:8px;background-color:", ";letter-spacing:0.1px;border:1px solid ", ";font-size:", "px;font-weight:", ";&:hover{background-image:linear-gradient(rgba(0,0,0,0.30),rgba(0,0,0,0.30));}"], function (_ref2) {
  var theme = _ref2.theme;
  return theme.typography.family.sans;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.colors.getTextColor(theme.colors.primary);
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.typography.lineHeight.paragraph;
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref7) {
  var theme = _ref7.theme;
  return theme.typography.size.button;
}, function (_ref8) {
  var theme = _ref8.theme;
  return theme.typography.weight.medium;
});
var SuccessfulSendResponse_styles_RetakeButton = styled_components_browser_esm.button.withConfig({
  displayName: "SuccessfulSendResponsestyles__RetakeButton",
  componentId: "sc-chbkuf-2"
})(["font-family:", ";color:", ";transition:background 0.2s;cursor:pointer;padding:8px 24px;text-align:center;line-height:", "px;height:40px;border-radius:8px;background-color:", ";letter-spacing:0.1px;border:1px solid ", ";font-size:", "px;font-weight:", ";&:hover{background-image:linear-gradient( ", ",", " );}"], function (_ref9) {
  var theme = _ref9.theme;
  return theme.typography.family.sans;
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.colors.getTextButtonColor(theme.colors.primary);
}, function (_ref11) {
  var theme = _ref11.theme;
  return theme.typography.lineHeight.paragraph;
}, function (_ref12) {
  var theme = _ref12.theme;
  return theme.colors.white;
}, function (_ref13) {
  var theme = _ref13.theme;
  return theme.colors.white;
}, function (_ref14) {
  var theme = _ref14.theme;
  return theme.typography.size.button;
}, function (_ref15) {
  var theme = _ref15.theme;
  return theme.typography.weight.medium;
}, function (_ref16) {
  var theme = _ref16.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.PRIMARY, 0.08);
}, function (_ref17) {
  var theme = _ref17.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.PRIMARY, 0.08);
});
var SuccessfulSendResponse_styles_ButtonsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "SuccessfulSendResponsestyles__ButtonsContainer",
  componentId: "sc-chbkuf-3"
})(["display:flex;flex-direction:column;gap:8px;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/QuizSteps/LoadingStep.tsx





function LoadingStep_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ LoadingStep_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function LoadingStep_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function LoadingStep_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? LoadingStep_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : LoadingStep_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


















var Suffix = /*#__PURE__*/function (Suffix) {
  Suffix["PASSED"] = "p";
  // Passed
  Suffix["FAILED"] = "f";
  // Failed
  Suffix["UNKNOWN"] = "u"; // Unknown
  return Suffix;
}({});
var formatItemForLocalStorage = function formatItemForLocalStorage(submittedQuizzes, quizId, suffix) {
  var index = submittedQuizzes.findIndex(function (item) {
    return parseInt(item.toString().split('_')[0], 10) === quizId;
  });
  var localStorageId = "".concat(quizId, "_").concat(suffix);
  var copyOfSubmittedQuizzes = toConsumableArray_toConsumableArray(submittedQuizzes);
  if (index !== -1) {
    copyOfSubmittedQuizzes[index] = localStorageId;
  } else {
    copyOfSubmittedQuizzes = [].concat(toConsumableArray_toConsumableArray(copyOfSubmittedQuizzes), [localStorageId]);
  }
  return copyOfSubmittedQuizzes;
};
var LoadingStep = function LoadingStep(props) {
  var theme = Ze();
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    showWarning = _useState2[0],
    setShowWarning = _useState2[1];
  var refreshButtonText = useTranslate(Identifier.l_refresh_page_button);
  var refreshText = useTranslate(Identifier.l_refresh_page_text);
  var quizWasUpdatedText = useTranslate(Identifier.l_quiz_was_updated);
  var attributes = LoadingStep_objectSpread(LoadingStep_objectSpread({}, defaultQuiz), element.attributes);
  var splitThankYouMessage = attributes.splitThankYouMessage,
    multipleQuestionsPerPage = attributes.multipleQuestionsPerPage,
    questions = attributes.questions,
    answers = attributes.answers,
    feedbacks = attributes.feedbacks;
  var _staticStore$config$g = getConfig(),
    trackingData = _staticStore$config$g.trackingData,
    renderedFrom = _staticStore$config$g.renderedFrom;
  var url = getInteractivityResultsEndpoint();
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    status = _useAtom2$.status,
    hash = _useAtom2$.hash;
  var setModalStep = react_useSetAtom(setModalStepAtom);
  var _useContext = (0,react.useContext)(contexts_QuizContext),
    selectedOptions = _useContext.selectedOptions,
    setIsQuizPassed = _useContext.setIsQuizPassed,
    correctAnswers = _useContext.correctAnswers,
    setCorrectAnswers = _useContext.setCorrectAnswers,
    activeQuestionIndex = _useContext.activeQuestionIndex,
    setFeedbacks = _useContext.setFeedbacks;
  var isPublished = status === FlipbookStatus.PUBLISHED.toLowerCase();
  var questionsCount = questions.length;
  // Each question has an answer from the user
  var submittedQuiz = questions.every(function (question) {
    return selectedOptions[question.questionId];
  });
  var trackingDataString = trackingData ? "_".concat(trackingData) : '';
  var quizKeyName = "interactivity_quiz_".concat(hash).concat(trackingDataString);
  var answersAndQuestionsMismatch = function answersAndQuestionsMismatch(answersToTest) {
    if (questions.length !== Object.keys(answersToTest).length) {
      return true;
    }
    return !questions.every(function (question) {
      return answersToTest[question.questionId];
    });
  };
  var evaluateCorrectAnswers = function evaluateCorrectAnswers(correctAnswersNumber) {
    var quizPassed = correctAnswersNumber === questionsCount;
    var existingLocalStorageData = localStorage_getLocalStorage(quizKeyName);
    var completedQuizzes = [];
    var quizSuffix = Suffix.UNKNOWN;
    if (splitThankYouMessage) {
      quizSuffix = quizPassed ? Suffix.PASSED : Suffix.FAILED;
    }
    if (existingLocalStorageData) {
      completedQuizzes = getParsedJson(existingLocalStorageData, []);
    }
    var newQuizData = JSON.stringify(formatItemForLocalStorage(completedQuizzes, props.elementId, quizSuffix));
    setIsQuizPassed(quizPassed);
    localStorage_setLocalStorage(quizKeyName, newQuizData);
  };
  (0,react.useEffect)(function () {
    var nextStep = multipleQuestionsPerPage ? QuizModalStep.DEFAULT : "".concat(QuizModalStep.QUESTION, "_").concat(activeQuestionIndex);
    var postData = /*#__PURE__*/function () {
      var _ref = asyncToGenerator_asyncToGenerator(/*#__PURE__*/LoadingStep_regeneratorRuntime().mark(function _callee() {
        var parameters, response;
        return LoadingStep_regeneratorRuntime().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              parameters = {
                interactivityType: 'quiz',
                flipbookHash: hash,
                elementId: props.elementId.toString()
              };
              _context.next = 3;
              return getSecuredDataFromDynamo({
                parameters: parameters,
                url: url
              });
            case 3:
              response = _context.sent;
              if (!(response.error || !response.data)) {
                _context.next = 6;
                break;
              }
              return _context.abrupt("return");
            case 6:
              if (!answersAndQuestionsMismatch(response.data.correctAnswers)) {
                _context.next = 9;
                break;
              }
              setShowWarning(true);
              return _context.abrupt("return");
            case 9:
              setCorrectAnswers(response.data.correctAnswers);
              setFeedbacks(response.data.feedbacks);
              setModalStep(nextStep);
            case 12:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }));
      return function postData() {
        return _ref.apply(this, arguments);
      };
    }();
    if (isPublished) {
      // All following actions are made on a published dataJson, in player
      if (!Object.keys(correctAnswers).length) {
        // Loading step is triggered at the beginning of the quiz, and we don't have the secured data
        postData().catch();
        return;
      }
      if (submittedQuiz) {
        // Loading step is triggered when completing the quiz, and assume the correct answers are present
        evaluateCorrectAnswers(getCorrectGivenAnswersCount(correctAnswers, selectedOptions));
        setModalStep(QuizModalStep.SUCCESSFUL_SEND_RESPONSE);
        return;
      }

      // On retake the quiz, the correct answers are not reset in the context so we will begin the new test
      //  with correct answers from the previous fetch
      setModalStep(nextStep);
      return;
    }
    if (answers) {
      // All following actions are made in editor preview, or in customize
      if (!Object.keys(correctAnswers).length) {
        setCorrectAnswers(answers);
        setFeedbacks(feedbacks);
        setModalStep(nextStep);
        return;
      }
      if (submittedQuiz) {
        var correctGivenAnswersCount = getCorrectGivenAnswersCount(correctAnswers, selectedOptions);

        // Get results from JSON if flipbook is not published
        // Do not save to local storage in editor. The user will restart the quiz in editor (Request from PM)
        if (renderedFrom !== RenderAreas.EDITOR) {
          evaluateCorrectAnswers(correctGivenAnswersCount);
        } else {
          setIsQuizPassed(correctGivenAnswersCount === questionsCount);
        }
        setModalStep(QuizModalStep.SUCCESSFUL_SEND_RESPONSE);
        return;
      }
      setModalStep(nextStep);
    }
  }, []);
  if (showWarning) {
    setModalStep("".concat(QuizModalStep.LOADING, "_error"));
  }
  return showWarning ? /*#__PURE__*/react.createElement(InformationContainer, null, /*#__PURE__*/react.createElement(src.ErrorIcon, {
    fill: theme.colors.danger
  }), /*#__PURE__*/react.createElement("div", {
    tabIndex: TabIndex.DEFAULT,
    "aria-label": "The quiz was recently updated. Please refresh the page to continue."
  }, /*#__PURE__*/react.createElement(Paragraph, null, quizWasUpdatedText), /*#__PURE__*/react.createElement(Paragraph, null, refreshText)), /*#__PURE__*/react.createElement(SuccessfulSendResponse_styles_ButtonsContainer, null, /*#__PURE__*/react.createElement(SuccessfulSendResponse_styles_ViewResultsButton, {
    type: "button",
    onClick: function onClick() {
      return window.location.reload();
    },
    value: refreshButtonText,
    tabIndex: TabIndex.DEFAULT
  }, refreshButtonText))) : /*#__PURE__*/react.createElement(LoadingStateModal, null, /*#__PURE__*/react.createElement(Quiz_styles_PreloaderIcon, null));
};
/* harmony default export */ var QuizSteps_LoadingStep = (LoadingStep);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/fetchApi.ts
/**
 * Make a request and return the result
 *
 * @param url
 * @param options
 * @return Promise<Object>
 */
/* harmony default export */ var utils_fetchApi = (function (url) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  return new Promise(function (resolve, reject) {
    fetch(url, options).then(function (response) {
      resolve(response);
    }).catch(function (e) {
      reject(e);
    });
  });
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/interactivity/sendDataToSqs.ts

function sendDataToSqs_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function sendDataToSqs_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? sendDataToSqs_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : sendDataToSqs_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }



/**
 * Send interactivity data to sqs
 *
 * @param {MessageBodyType} message
 * @typedef {Object} MessageBodyType
 * @property {InteractivityType} it - The type of interactivity element.
 * @property {string} ch - A unique identifier, typically referring to a channel or context in which
 * the interactivity occurred.
 * @property {number} eid - The element id.
 * @property {Object.<string, [string] | string> | ContactFormDataToSqsType[]} responses - A map of user responses or
 * a structured list of form data.
 * @property {number} ts - A timestamp (in milliseconds) representing when the interactivity event occurred.
 * @property {Object} [md] - Optional metadata related to GDPR compliance and other details.
 * @property {boolean} [md.gdpr] - Indicates whether the event adheres to GDPR regulations.
 * @property {boolean} [md.pp] - Indicates if the privacy policy was accepted by the user (optional).
 * @property {number} [md.timeSpent] - The total time (in seconds) spent by the user during the interactivity (optional)
 * @property {string} [md.email] - The email address provided by the user during the interaction (optional).
 * @param {string} endpoint
 */
/* harmony default export */ var sendDataToSqs = (function (message, endpoint) {
  return new Promise(function (resolve, reject) {
    if (!endpoint) {
      resolve(false);
    } else {
      var trackingData = getTrackingData();
      var extraParams = {};
      if (trackingData) {
        extraParams.td = trackingData;
      }
      var payload = {
        Action: 'SendMessage',
        MessageBody: JSON.stringify(sendDataToSqs_objectSpread(sendDataToSqs_objectSpread({}, message), extraParams))
      };
      utils_fetchApi("".concat(endpoint, "?").concat(objectToURLParams(payload))).then(function (response) {
        resolve(!!response);
      }).catch(function (e) {
        reject(e);
      });
    }
  });
});
;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/CheckIcon.tsx

var CheckIcon = function CheckIcon(_ref) {
  var _ref$fill = _ref.fill,
    fill = _ref$fill === void 0 ? '#000000' : _ref$fill;
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "24",
    height: "24",
    fill: "none"
  }, /*#__PURE__*/react.createElement("path", {
    fill: fill,
    d: "m8.795 15.875-4.17-4.17-1.42 1.41 5.59 5.59 12-12-1.41-1.41-10.59 10.58Z"
  }));
};
/* harmony default export */ var src_CheckIcon = (CheckIcon);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/components/QuizOption.tsx








var optionLabels = ['A', 'B', 'C', 'D', 'E', 'F'];
var QuizOption = function QuizOption(_ref) {
  var _correctAnswers$quest, _selectedOptions$ques, _selectedOptions$ques2;
  var option = _ref.option,
    optionIndex = _ref.optionIndex,
    questionId = _ref.questionId,
    type = _ref.type,
    onSelect = _ref.onSelect,
    selectedOptions = _ref.selectedOptions,
    activeFeedbackState = _ref.activeFeedbackState;
  var _useContext = (0,react.useContext)(contexts_QuizContext),
    submittedAnswers = _useContext.selectedOptions,
    correctAnswers = _useContext.correctAnswers;
  var theme = Ze();
  var isQuestionSubmitted = !!submittedAnswers[questionId];
  var isCorrect = correctAnswers && ((_correctAnswers$quest = correctAnswers[questionId]) === null || _correctAnswers$quest === void 0 ? void 0 : _correctAnswers$quest.includes(option.hash));
  var atLeastOneSelected = !!Object.keys(selectedOptions)[0];
  var isChecked = isQuestionSubmitted ? (_selectedOptions$ques = selectedOptions[questionId]) === null || _selectedOptions$ques === void 0 ? void 0 : _selectedOptions$ques.includes(option.hash) : !!(atLeastOneSelected && (_selectedOptions$ques2 = selectedOptions[questionId]) !== null && _selectedOptions$ques2 !== void 0 && _selectedOptions$ques2.includes(option.hash));
  var InputComponent = activeFeedbackState ? SubmittedQuizOptionInput : UnsubmittedQuizOptionInput;
  var LabelComponent = activeFeedbackState ? SubmittedQuizLabel : UnsubmittedQuizLabel;
  var getIcon = function getIcon() {
    var _submittedAnswers$que;
    var isSelected = (_submittedAnswers$que = submittedAnswers[questionId]) === null || _submittedAnswers$que === void 0 ? void 0 : _submittedAnswers$que.includes(option.hash);
    if (isSelected || isCorrect) {
      return isCorrect ? /*#__PURE__*/react.createElement(src_CheckIcon, {
        fill: theme.colors.successText
      }) : /*#__PURE__*/react.createElement(src.CloseIcon, {
        fill: theme.colors.dangerText,
        size: src.IconSizes.MEDIUM
      });
    }
    return null;
  };
  return /*#__PURE__*/react.createElement(Quiz_styles_QuizOption, {
    key: option.hash
  }, /*#__PURE__*/react.createElement(InputComponent, (0,esm_extends/* default */.A)({}, activeFeedbackState && {
    $isCorrect: isCorrect
  }, {
    id: option.hash,
    type: type,
    name: questionId,
    value: option.hash,
    disabled: activeFeedbackState,
    checked: isChecked,
    onChange: activeFeedbackState ? undefined : onSelect,
    tabIndex: TabIndex.DEFAULT
  })), /*#__PURE__*/react.createElement(QuizOptionLabelWrapper, {
    htmlFor: option.hash,
    $activeFeedbackState: activeFeedbackState
  }, /*#__PURE__*/react.createElement(LabelComponent, null, /*#__PURE__*/react.createElement(QuizOptionText, null, "".concat(optionLabels[optionIndex], ". ").concat(option.text))), activeFeedbackState && /*#__PURE__*/react.createElement(QuizOptionLabelCheckMark, null, getIcon())));
};
/* harmony default export */ var components_QuizOption = (QuizOption);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/components/QuizQuestion.tsx








var QuizQuestion = function QuizQuestion(_ref) {
  var _feedback, _feedback2;
  var _ref$question = _ref.question,
    questionId = _ref$question.questionId,
    question = _ref$question.question,
    options = _ref$question.options,
    type = _ref$question.type,
    questionIndex = _ref.questionIndex,
    _ref$onSelect = _ref.onSelect,
    onSelect = _ref$onSelect === void 0 ? function () {} : _ref$onSelect,
    _ref$correctAnswers = _ref.correctAnswers,
    correctAnswers = _ref$correctAnswers === void 0 ? {} : _ref$correctAnswers,
    _ref$ariaLabel = _ref.ariaLabel,
    ariaLabel = _ref$ariaLabel === void 0 ? '' : _ref$ariaLabel,
    _ref$selectedOptions = _ref.selectedOptions,
    selectedOptions = _ref$selectedOptions === void 0 ? {} : _ref$selectedOptions,
    _ref$activeFeedbackSt = _ref.activeFeedbackState,
    activeFeedbackState = _ref$activeFeedbackSt === void 0 ? false : _ref$activeFeedbackSt,
    _ref$feedbacks = _ref.feedbacks,
    feedbacks = _ref$feedbacks === void 0 ? {} : _ref$feedbacks;
  var explanationText = useTranslate(Identifier.l_explanation);
  var feedback;
  var isAnsweredCorrect = false;
  if (activeFeedbackState) {
    var questionAnswers = correctAnswers[questionId];
    var givenAnswers = selectedOptions[questionId];
    feedback = feedbacks[questionId];
    if (questionAnswers.length === givenAnswers.length) {
      isAnsweredCorrect = questionAnswers.every(function (item) {
        return givenAnswers.includes(item);
      });
    }
  }
  return /*#__PURE__*/react.createElement(QuizQuestionWrapper, {
    key: questionId
  }, activeFeedbackState && /*#__PURE__*/react.createElement(AnswerStatus, {
    $isAnsweredCorrect: isAnsweredCorrect
  }, isAnsweredCorrect ? /*#__PURE__*/react.createElement(src_CheckIcon, {
    fill: "#00AD11"
  }) : /*#__PURE__*/react.createElement(src.CloseIcon, {
    fill: "#DB2B3A",
    size: src.IconSizes.MEDIUM
  }), isAnsweredCorrect ? 'Correct' : 'Incorrect'), /*#__PURE__*/react.createElement(Quiz_styles_QuizQuestion, {
    tabIndex: TabIndex.DEFAULT,
    "aria-label": ariaLabel || "".concat(questionIndex + 1, ". ").concat(question)
  }, "".concat(questionIndex + 1, ". ").concat(question)), options.map(function (option, optionIndex) {
    return /*#__PURE__*/react.createElement(components_QuizOption, {
      key: option.hash,
      option: option,
      optionIndex: optionIndex,
      questionId: questionId,
      type: type,
      onSelect: onSelect,
      selectedOptions: selectedOptions,
      correctAnswers: correctAnswers,
      activeFeedbackState: activeFeedbackState
    });
  }), activeFeedbackState && (((_feedback = feedback) === null || _feedback === void 0 ? void 0 : _feedback.ca) || ((_feedback2 = feedback) === null || _feedback2 === void 0 ? void 0 : _feedback2.ia)) && /*#__PURE__*/react.createElement(QuestionExplanation, null, /*#__PURE__*/react.createElement(Explanation, {
    tabIndex: TabIndex.DEFAULT
  }, explanationText), /*#__PURE__*/react.createElement("span", {
    tabIndex: TabIndex.DEFAULT
  }, isAnsweredCorrect ? feedback.ca : feedback.ia)));
};
/* harmony default export */ var components_QuizQuestion = (QuizQuestion);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/QuizSteps/QuestionStep.tsx


function QuestionStep_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function QuestionStep_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? QuestionStep_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : QuestionStep_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
















var QuestionStep = function QuestionStep(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var labelQuestionText = useTranslate(Identifier.l_question);
  var labelAnsweredText = useTranslate(Identifier.l_answered);
  var previousText = useTranslate(Identifier.l_previous_button);
  var nextText = useTranslate(Identifier.l_next_button);
  var submitText = useTranslate(Identifier.l_submit_button);
  var completeText = useTranslate(Identifier.l_complete_button);
  var attributes = QuestionStep_objectSpread({}, element.attributes);
  var questions = attributes.questions,
    buttonLabel = attributes.buttonLabel,
    collectData = attributes.collectData;
  var _staticStore$config$g = getConfig(),
    _staticStore$config$g2 = _staticStore$config$g.enableCollectStats,
    enableCollectStats = _staticStore$config$g2 === void 0 ? false : _staticStore$config$g2;
  var _useAtom = react_useAtom(stageSizeHeightAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    height = _useAtom2[0];
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    hash = _useAtom4[0].hash;
  var _useAtom5 = react_useAtom(rootPrimitivesAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    downloadMode = _useAtom6[0].downloadMode;
  var _useContext = (0,react.useContext)(contexts_QuizContext),
    activeQuestionIndex = _useContext.activeQuestionIndex,
    selectedOptions = _useContext.selectedOptions,
    elementClickedTime = _useContext.elementClickedTime,
    agreedToGDPR = _useContext.agreedToGDPR,
    agreedToPrivacyPolicy = _useContext.agreedToPrivacyPolicy,
    readerEmail = _useContext.readerEmail,
    setSelectedOptions = _useContext.setSelectedOptions,
    nextQuestionIndex = _useContext.nextQuestionIndex,
    previousQuestionIndex = _useContext.previousQuestionIndex,
    correctAnswers = _useContext.correctAnswers,
    feedbacks = _useContext.feedbacks;
  var modalStep = react_useAtomValue(modalStepAtom);
  var setModalStep = react_useSetAtom(setModalStepAtom);
  var questionRendered = QuestionStep_objectSpread(QuestionStep_objectSpread({}, defaultQuiz.question), questions[activeQuestionIndex]);

  // The local state for answers, facilitates saving on Submit button and having a feedback state controlled
  //  by the answers from the quiz context.
  var _useState = (0,react.useState)({}),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    temporaryQuestionAnswers = _useState2[0],
    setTemporaryQuestionAnswers = _useState2[1];
  var questionId = questionRendered.questionId,
    question = questionRendered.question;
  var currentQuestionAnswer = temporaryQuestionAnswers[questionId];
  var allQuestionsAnswered = questions.every(function (currentQuestion) {
    return temporaryQuestionAnswers[currentQuestion.questionId];
  });
  var answeredQuestionsCount = Object.keys(selectedOptions).length;
  var currentQuestionHasAnswer = !!selectedOptions[questionId];
  var activeFeedbackState = props.showCorrectAnswer && currentQuestionHasAnswer;
  var isLastQuestion = activeQuestionIndex === questions.length - 1;
  var saveAnswerOnChange = function saveAnswerOnChange(event) {
    var givenAnswer = parseUserGivenAnswer(event, temporaryQuestionAnswers);
    setTemporaryQuestionAnswers(givenAnswer);
    if (!props.showCorrectAnswer) {
      setSelectedOptions(QuestionStep_objectSpread({}, givenAnswer));
    }
  };
  var onSubmitData = function onSubmitData(event) {
    if (!downloadMode) {
      event.preventDefault();
      var timeSpent = Math.floor(new Date().getTime() / 1000) - elementClickedTime;
      if (enableCollectStats) {
        sendDataToSqs({
          it: InteractivityType.QUIZ,
          ch: hash,
          eid: props.elementId,
          responses: selectedOptions,
          ts: Math.floor(new Date().getTime() / 1000),
          md: QuestionStep_objectSpread({
            gdpr: agreedToGDPR,
            pp: agreedToPrivacyPolicy,
            timeSpent: timeSpent
          }, collectData && {
            email: readerEmail
          })
        }, getInteractivityElementsEndpoint()).catch();
      }
      setModalStep(QuizModalStep.LOADING);
    }
  };
  var getFeedback = function getFeedback() {
    return "You selected ".concat(selectedOptions[questionId].filter(function (option) {
      return correctAnswers[questionId].includes(option);
    }).length, " out of ").concat(correctAnswers[questionId].length, " correct answers for the question: ").concat(question, ".");
  };
  var showNextButton = !props.showCorrectAnswer || !temporaryQuestionAnswers[questionId] || activeFeedbackState;
  var clickNextButtonHandler = function clickNextButtonHandler() {
    if (showNextButton) {
      // Next
      nextQuestionIndex();
      setModalStep("".concat(QuizModalStep.QUESTION, "_").concat(activeQuestionIndex + 1));
    } else {
      // Submit
      setModalStep("".concat(modalStep, "_feedback"));
      setSelectedOptions(QuestionStep_objectSpread({}, temporaryQuestionAnswers));
    }
  };
  var showCompleteButton = !props.showCorrectAnswer || activeFeedbackState;
  var hasError = isLastQuestion && showCompleteButton && !allQuestionsAnswered;
  var onClickSubmitHandler = function onClickSubmitHandler(event) {
    if (showCompleteButton) {
      // Complete
      onSubmitData(event);
    } else {
      // Submit
      setModalStep("".concat(modalStep, "_feedback"));
      setSelectedOptions(QuestionStep_objectSpread({}, temporaryQuestionAnswers));
    }
  };
  var renderQuestion = function renderQuestion() {
    return /*#__PURE__*/react.createElement(components_QuizQuestion, {
      question: questionRendered,
      questionIndex: activeQuestionIndex,
      onSelect: saveAnswerOnChange,
      ariaLabel: activeFeedbackState ? getFeedback() : undefined,
      correctAnswers: correctAnswers,
      selectedOptions: activeFeedbackState ? selectedOptions : temporaryQuestionAnswers,
      activeFeedbackState: activeFeedbackState,
      feedbacks: feedbacks
    });
  };
  (0,react.useEffect)(function () {
    setTemporaryQuestionAnswers(selectedOptions);
  }, []);
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(QuizModalHeader, null, /*#__PURE__*/react.createElement(QuestionNumber, {
    tabIndex: TabIndex.DEFAULT
  }, "".concat(labelQuestionText, ": ").concat(activeQuestionIndex + 1, "/").concat(questions.length)), /*#__PURE__*/react.createElement(QuestionsAnswered, {
    $hasError: hasError,
    tabIndex: TabIndex.DEFAULT
  }, "".concat(labelAnsweredText, ": ").concat(answeredQuestionsCount, "/").concat(questions.length))), /*#__PURE__*/react.createElement(QuizModalForm, {
    // This is needed to stop the form submission when pressing the Enter key
    onSubmit: function onSubmit(event) {
      event.preventDefault();
    },
    name: "interactivity-".concat(questionId),
    $stageSizeHeight: height
  }, /*#__PURE__*/react.createElement(ScrollableSection, null, renderQuestion())), /*#__PURE__*/react.createElement(NavigationButtonsContainer, null, activeQuestionIndex > 0 && /*#__PURE__*/react.createElement(PreviousButton, {
    type: "button",
    onClick: function onClick() {
      previousQuestionIndex();
      setModalStep("".concat(QuizModalStep.QUESTION, "_").concat(activeQuestionIndex - 1));
    },
    tabIndex: TabIndex.DEFAULT
  }, previousText), isLastQuestion ? /*#__PURE__*/react.createElement(CompleteButton, {
    type: "button",
    value: buttonLabel,
    disabled: showCompleteButton && !allQuestionsAnswered || props.showCorrectAnswer && !currentQuestionAnswer,
    onClick: onClickSubmitHandler,
    tabIndex: TabIndex.DEFAULT,
    $isSubmit: !showCompleteButton
  }, showCompleteButton ? buttonLabel || completeText : submitText) : /*#__PURE__*/react.createElement(NextButton, {
    type: "button",
    onClick: clickNextButtonHandler,
    tabIndex: TabIndex.DEFAULT
  }, showNextButton ? nextText : submitText)));
};
/* harmony default export */ var QuizSteps_QuestionStep = (QuestionStep);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/QuizSteps/ViewResultsStep.tsx


function ViewResultsStep_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function ViewResultsStep_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ViewResultsStep_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ViewResultsStep_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }











var ViewResultsStep = function ViewResultsStep(props) {
  var retakeQuizButtonText = useTranslate(Identifier.l_retake_quiz);
  var labelCorrectAnswersText = useTranslate(Identifier.l_correct_answers);
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = ViewResultsStep_objectSpread(ViewResultsStep_objectSpread({}, defaultQuiz), element.attributes);
  var questions = attributes.questions,
    allowRetake = attributes.allowRetake,
    multipleQuestionsPerPage = attributes.multipleQuestionsPerPage;
  var _useAtom = react_useAtom(stageSizeHeightAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    height = _useAtom2[0];
  var _useContext = (0,react.useContext)(contexts_QuizContext),
    selectedOptions = _useContext.selectedOptions,
    correctAnswers = _useContext.correctAnswers,
    resetQuiz = _useContext.resetQuiz,
    feedbacks = _useContext.feedbacks;
  var questionsCount = questions.length;
  var correctGivenAnswersCount = getCorrectGivenAnswersCount(correctAnswers, selectedOptions);
  var getFeedback = function getFeedback(_ref) {
    var questionId = _ref.questionId,
      question = _ref.question;
    return "You selected ".concat(selectedOptions[questionId].filter(function (option) {
      return correctAnswers[questionId].includes(option);
    }).length, " out of ").concat(correctAnswers[questionId].length, " correct answers for the question: ").concat(question, ".");
  };
  var getCorrectAnswersSection = function getCorrectAnswersSection() {
    return /*#__PURE__*/react.createElement(CorrectAnswersCountContainer, {
      tabIndex: TabIndex.DEFAULT,
      "aria-label": "You answered ".concat(correctGivenAnswersCount, "\n            out of ").concat(questionsCount, " questions correctly")
    }, "".concat(labelCorrectAnswersText, ": ").concat(correctGivenAnswersCount, "/").concat(questionsCount));
  };
  var renderQuestion = function renderQuestion(question, questionIndex) {
    return /*#__PURE__*/react.createElement(components_QuizQuestion, {
      question: ViewResultsStep_objectSpread(ViewResultsStep_objectSpread({}, defaultQuiz.question), question),
      questionIndex: questionIndex,
      ariaLabel: getFeedback(question),
      correctAnswers: correctAnswers,
      selectedOptions: selectedOptions,
      activeFeedbackState: true,
      feedbacks: feedbacks
    });
  };
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(QuizModalHeader, null, getCorrectAnswersSection()), /*#__PURE__*/react.createElement(QuizModalForm, {
    // This is needed to stop the form submission when pressing the Enter key
    onSubmit: function onSubmit(event) {
      event.preventDefault();
    },
    name: "interactivity-".concat(questions[0].questionId),
    $stageSizeHeight: height
  }, /*#__PURE__*/react.createElement(ScrollableSection, null, questions.map(renderQuestion))), /*#__PURE__*/react.createElement(NavigationButtonsContainer, null, allowRetake && /*#__PURE__*/react.createElement(RetakeButton, {
    type: "button",
    onClick: function onClick() {
      return resetQuiz(multipleQuestionsPerPage);
    },
    tabIndex: TabIndex.DEFAULT
  }, retakeQuizButtonText)));
};
/* harmony default export */ var QuizSteps_ViewResultsStep = (ViewResultsStep);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/QuizSteps/QuizFormStep.tsx


function QuizFormStep_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function QuizFormStep_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? QuizFormStep_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : QuizFormStep_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

















var QuizFormStep = function QuizFormStep(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var completeText = useTranslate(Identifier.l_complete_button);
  var attributes = QuizFormStep_objectSpread({}, element.attributes);
  var collectData = attributes.collectData,
    buttonLabel = attributes.buttonLabel,
    questions = attributes.questions;
  var _staticStore$config$g = getConfig(),
    _staticStore$config$g2 = _staticStore$config$g.enableCollectStats,
    enableCollectStats = _staticStore$config$g2 === void 0 ? false : _staticStore$config$g2;
  var _useAtom = react_useAtom(stageSizeHeightAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    height = _useAtom2[0];
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    hash = _useAtom4[0].hash;
  var _useAtom5 = react_useAtom(rootPrimitivesAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    downloadMode = _useAtom6[0].downloadMode;
  var setModalStep = react_useSetAtom(setModalStepAtom);
  var _useContext = (0,react.useContext)(contexts_QuizContext),
    agreedToPrivacyPolicy = _useContext.agreedToPrivacyPolicy,
    agreedToGDPR = _useContext.agreedToGDPR,
    readerEmail = _useContext.readerEmail,
    elementClickedTime = _useContext.elementClickedTime,
    selectedOptions = _useContext.selectedOptions,
    setSelectedOptions = _useContext.setSelectedOptions;
  var allQuestionsAnswered = questions.every(function (question) {
    return selectedOptions[question.questionId];
  });
  var onSubmitData = function onSubmitData(event) {
    if (!downloadMode) {
      event.preventDefault();
      var timeSpent = Math.floor(new Date().getTime() / 1000) - elementClickedTime;
      if (enableCollectStats) {
        sendDataToSqs({
          it: InteractivityType.QUIZ,
          ch: hash,
          eid: props.elementId,
          responses: selectedOptions,
          ts: Math.floor(new Date().getTime() / 1000),
          md: QuizFormStep_objectSpread({
            gdpr: agreedToGDPR,
            pp: agreedToPrivacyPolicy,
            timeSpent: timeSpent
          }, collectData && {
            email: readerEmail
          })
        }, getInteractivityElementsEndpoint()).catch(function () {});
      }
      setModalStep(QuizModalStep.LOADING);
    }
  };
  var onSelect = function onSelect(event) {
    var givenAnswer = parseUserGivenAnswer(event, selectedOptions);
    setSelectedOptions(givenAnswer);
  };
  (0,react.useEffect)(function () {
    var onKeyDown = function onKeyDown(event) {
      if (event.key === ENTER && allQuestionsAnswered) {
        onSubmitData(event);
      }
    };
    window.addEventListener('keydown', onKeyDown);
    return function () {
      window.removeEventListener('keydown', onKeyDown);
    };
  }, [allQuestionsAnswered]);
  var renderQuestion = function renderQuestion(question, questionIndex) {
    return /*#__PURE__*/react.createElement(components_QuizQuestion, {
      question: QuizFormStep_objectSpread(QuizFormStep_objectSpread({}, defaultQuiz.question), question),
      questionIndex: questionIndex,
      onSelect: onSelect,
      selectedOptions: selectedOptions
    });
  };
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(QuizModalForm, {
    // This is needed to stop the form from submitting when pressing the Enter key
    onSubmit: function onSubmit(event) {
      event.preventDefault();
    },
    name: "interactivity-".concat(questions[0].questionId),
    $stageSizeHeight: height
  }, /*#__PURE__*/react.createElement(ScrollableSection, null, questions.map(renderQuestion))), /*#__PURE__*/react.createElement(NavigationButtonsContainer, null, /*#__PURE__*/react.createElement(CompleteButton, {
    type: "button",
    value: "Submit",
    disabled: !allQuestionsAnswered,
    onClick: onSubmitData,
    tabIndex: TabIndex.DEFAULT
  }, buttonLabel || completeText)));
};
/* harmony default export */ var QuizSteps_QuizFormStep = (QuizFormStep);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Badge/Badge.styles.tsx

var Badge_styles_Badge = styled_components_browser_esm.div.withConfig({
  displayName: "Badgestyles__Badge",
  componentId: "sc-a1hrz-0"
})(["display:flex;align-items:center;justify-content:center;border-radius:4px;background-color:", ";color:", ";width:", ";height:", ";font-size:", ";font-weight:", ";position:", ";z-index:1;padding:6px 8px;", ""], function (_ref) {
  var theme = _ref.theme;
  return theme.colors.black;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.colors.white;
}, function (_ref3) {
  var $width = _ref3.$width;
  return $width;
}, function (_ref4) {
  var $height = _ref4.$height;
  return $height;
}, function (_ref5) {
  var $fontSize = _ref5.$fontSize;
  return $fontSize;
}, function (_ref6) {
  var $fontWeight = _ref6.$fontWeight;
  return $fontWeight;
}, function (_ref7) {
  var $position = _ref7.$position;
  return $position;
}, function (_ref8) {
  var $position = _ref8.$position,
    $stickToLeft = _ref8.$stickToLeft,
    $bottom = _ref8.$bottom;
  if ($position === 'absolute') {
    return "\n            ".concat($stickToLeft ? 'left: 5px;' : 'right: 5px;', "\n            ").concat($bottom ? "bottom: ".concat($bottom, ";") : '', "\n        ");
  }
  return '';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Badge/Badge.tsx



var Badge_Badge_Badge = function Badge(_ref) {
  var label = _ref.label,
    width = _ref.width,
    height = _ref.height,
    _ref$fontSize = _ref.fontSize,
    fontSize = _ref$fontSize === void 0 ? '14px' : _ref$fontSize,
    _ref$fontWeight = _ref.fontWeight,
    fontWeight = _ref$fontWeight === void 0 ? 'normal' : _ref$fontWeight,
    _ref$position = _ref.position,
    position = _ref$position === void 0 ? 'relative' : _ref$position,
    _ref$stickToLeft = _ref.stickToLeft,
    stickToLeft = _ref$stickToLeft === void 0 ? false : _ref$stickToLeft,
    _ref$tabIndex = _ref.tabIndex,
    tabIndex = _ref$tabIndex === void 0 ? TabIndex.UNREACHABLE : _ref$tabIndex,
    _ref$bottom = _ref.bottom,
    bottom = _ref$bottom === void 0 ? '' : _ref$bottom;
  return /*#__PURE__*/react.createElement(Badge_styles_Badge, {
    $width: width,
    $height: height,
    $fontSize: fontSize,
    $fontWeight: fontWeight,
    $position: position,
    $stickToLeft: stickToLeft,
    $bottom: bottom,
    tabIndex: tabIndex
  }, label);
};
/* harmony default export */ var GeneralComponents_Badge_Badge = (Badge_Badge_Badge);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/GDPRAgreement/GDPRAgreement.tsx



var GDPRAgreement = function GDPRAgreement(props) {
  return /*#__PURE__*/react.createElement(ModalContentStyles_GDPRAgreement, null, /*#__PURE__*/react.createElement(GDPRInput, {
    id: "gdpr-agreement-input",
    type: "checkbox",
    onChange: props.onChangeGDPRAgreement,
    title: props.gdprMessage || defaultLeadForm.gdprMessage,
    tabIndex: TabIndex.DEFAULT
  }), /*#__PURE__*/react.createElement("label", {
    htmlFor: "gdpr-agreement-input"
  }, props.gdprMessage || defaultLeadForm.gdprMessage));
};
/* harmony default export */ var GDPRAgreement_GDPRAgreement = (GDPRAgreement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getLeadFormErrorMessage.ts
/**
 * Get the error message for a leadform field based on validation type
 * @param validation
 * @return string
 */

/* harmony default export */ var getLeadFormErrorMessage = (function (validation) {
  switch (validation) {
    case 'email':
      {
        return Identifier.l_lead_form_error_email;
      }
    case 'phone':
      {
        return Identifier.l_lead_form_error_tel;
      }
    case 'website':
      {
        return Identifier.l_lead_form_error_url;
      }
    default:
      return '';
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/isFieldValid.ts
/**
 * Checks the leadform's field data is valid
 * @param inputText
 * @param validation
 * @param required
 * @return boolean
 */
/* harmony default export */ var utils_isFieldValid = (function (inputText, validation, required) {
  var valid = false;
  switch (validation) {
    case 'email':
      {
        var regMail = /^([a-z0-9_+\-.']+)+@([a-z0-9_\-.]+)\.([a-z]{2,30})$/i;
        valid = regMail.test(inputText);
        break;
      }
    case 'phone':
      {
        var regPhone = /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s./0-9]*$/g;
        valid = regPhone.test(inputText);
        break;
      }
    case 'website':
      {
        var regWebsite = /(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g;
        valid = regWebsite.test(inputText);
        break;
      }
    default:
      valid = inputText !== '';
  }
  if (required) {
    // In case a text field is required and has no validation, we don't validate text beginning with spaces or tabs
    var regEmptyText = /\S(.*\S)?/g;
    return regEmptyText.test(inputText) && valid;
  }
  return valid;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Input/ModalFormInputContainer.tsx












var ModalFormInputContainer = function ModalFormInputContainer(_ref) {
  var _field$children;
  var field = _ref.field,
    index = _ref.index,
    setFieldValid = _ref.setFieldValid,
    setFieldUserInput = _ref.setFieldUserInput,
    _ref$withoutMarginTop = _ref.withoutMarginTop,
    withoutMarginTop = _ref$withoutMarginTop === void 0 ? false : _ref$withoutMarginTop;
  var _useState = (0,react.useState)(field.userInput || ''),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    inputText = _useState2[0],
    setInputText = _useState2[1];
  var _useState3 = (0,react.useState)(!!field.valid),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    isFieldValid = _useState4[0],
    setIsFieldValid = _useState4[1];
  var inputRef = (0,react.useRef)(null);
  var textAreaRef = (0,react.useRef)(null);
  var errorMessageIdentifier = inputText.length ? getLeadFormErrorMessage(field.validation) : '';
  var disabled = !!field.disabled;
  var selectPlaceholder = useTranslate(Identifier.l_lead_dropdown_select);
  var dropdownOptions = (_field$children = field.children) === null || _field$children === void 0 ? void 0 : _field$children.map(function (option) {
    return {
      key: "".concat(option.id),
      value: option.fieldName,
      label: option.fieldName
    };
  });
  var requiredOrEmptyString = field.required ? 'required' : '';
  var autocomplete = '';

  // For accessibility testing with PlayWright, the autocomplete must hold a valid value, depending on the input
  if (field.validation !== 'none') {
    if (field.validation === 'website') {
      autocomplete = 'url';
    } else if (field.validation === 'phone') {
      autocomplete = 'tel';
    } else {
      autocomplete = field.validation;
    }
  }
  var debounceFunction = (0,react.useCallback)((0,lodash.debounce)(function (value) {
    var validationResult;
    if (!field.required && value === '') {
      validationResult = true;
    } else {
      validationResult = utils_isFieldValid(value, field.validation, field.required);
    }
    setIsFieldValid(validationResult);
    setFieldUserInput(index, value);
    setFieldValid(index, validationResult);
  }, 250), [field.validation, field.required]);
  (0,react.useEffect)(function () {
    if (field.userInput !== '') {
      setIsFieldValid(true);
      debounceFunction(field.userInput);
    }
  }, []);
  var setFieldValue = function setFieldValue(e) {
    var _e$target$value = e.target.value,
      value = _e$target$value === void 0 ? inputText : _e$target$value;
    setIsFieldValid(true);
    setInputText(value);
    debounceFunction(value);
  };
  var getFieldType = function getFieldType(fieldValidation) {
    switch (fieldValidation) {
      case 'email':
        {
          return 'email';
        }
      case 'phone':
        {
          return 'tel';
        }
      case 'website':
        {
          return 'url';
        }
      default:
        return 'text';
    }
  };
  var onChangeHandler = function onChangeHandler(value) {
    setIsFieldValid(true);
    setInputText(value);
    debounceFunction(value);
  };
  var renderField = function renderField() {
    if (field.validation === 'dropdown') {
      return /*#__PURE__*/react.createElement(src_Select_Select, {
        value: field.userInput || '',
        placeholder: selectPlaceholder,
        options: dropdownOptions,
        onChange: onChangeHandler
      });
    }
    if (field.noOfRows && field.noOfRows > 1) {
      return /*#__PURE__*/react.createElement(Textarea, {
        id: "".concat(index + 1, " ").concat(field.fieldName),
        key: "input-".concat(index),
        ref: textAreaRef,
        value: inputText,
        onChange: setFieldValue,
        isContentValid: !inputText.length || isFieldValid,
        maxLength: 350,
        title: "".concat(requiredOrEmptyString, " input for ").concat(field.fieldName),
        tabIndex: TabIndex.DEFAULT,
        disabled: disabled
      });
    }
    return /*#__PURE__*/react.createElement(ModalContentStyles_Input, (0,esm_extends/* default */.A)({
      id: "".concat(index + 1, " ").concat(field.fieldName),
      key: "input-".concat(index),
      name: "field-".concat(index),
      type: getFieldType(field.validation),
      ref: inputRef,
      value: inputText,
      onChange: setFieldValue,
      isContentValid: !inputText.length || isFieldValid
    }, autocomplete ? {
      autoComplete: autocomplete
    } : {}, {
      maxLength: 100,
      title: "".concat(requiredOrEmptyString, " input for ").concat(field.fieldName),
      tabIndex: TabIndex.DEFAULT,
      disabled: disabled,
      placeholder: field.placeholder || ''
    }));
  };
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ModalContentStyles_Label, {
    required: field.required,
    htmlFor: "".concat(index + 1, " ").concat(field.fieldName),
    withoutMarginTop: withoutMarginTop,
    tabIndex: TabIndex.DEFAULT
  }, field.fieldName), !isFieldValid && Identifier[errorMessageIdentifier] && /*#__PURE__*/react.createElement(SpanErrorMessage, {
    role: "region",
    "aria-live": "polite"
  }, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier[errorMessageIdentifier])), renderField());
};
/* harmony default export */ var Input_ModalFormInputContainer = (ModalFormInputContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/PrivacyPolicyAgreement/PrivacyPolicyAgreement.tsx






var PrivacyPolicyAgreement = function PrivacyPolicyAgreement(props) {
  var privacyPolicyText = useTranslate(Identifier.l_agree_to_privacy_policy);
  return /*#__PURE__*/react.createElement(PrivacyPolicy, null, /*#__PURE__*/react.createElement(PrivacyPolicyInput, {
    id: "privacy-policy-agreement-input",
    type: "checkbox",
    onChange: props.onChangePrivacyPolicy,
    title: "".concat(privacyPolicyText, " ").concat(props.companyName || 'Flipsnack'),
    tabIndex: TabIndex.DEFAULT
  }), /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement("label", {
    htmlFor: "privacy-policy-agreement-input"
  }, privacyPolicyText, "\xA0"), /*#__PURE__*/react.createElement(PrivacyPolicyLink, {
    target: "_blank",
    rel: "noopener noreferrer",
    href: props.privacyPolicyURL || FlipsnackPrivacyPolicy,
    tabIndex: TabIndex.DEFAULT
  }, props.companyName || 'Flipsnack'), /*#__PURE__*/react.createElement("span", null, "\xA0*")));
};
/* harmony default export */ var PrivacyPolicyAgreement_PrivacyPolicyAgreement = (PrivacyPolicyAgreement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/QuestionModal/CollectData/CollectData.tsx





var CollectData = function CollectData(_ref) {
  var showEmailSection = _ref.showEmailSection,
    privacyPolicy = _ref.privacyPolicy,
    gdprCompliance = _ref.gdprCompliance,
    setAgreedToPrivacyPolicy = _ref.setAgreedToPrivacyPolicy,
    setAgreedToGDPR = _ref.setAgreedToGDPR,
    setIsEmailValid = _ref.setIsEmailValid,
    setReaderEmail = _ref.setReaderEmail,
    readerEmail = _ref.readerEmail,
    _ref$isInputDisabled = _ref.isInputDisabled,
    isInputDisabled = _ref$isInputDisabled === void 0 ? false : _ref$isInputDisabled,
    _ref$hasLateralMargin = _ref.hasLateralMargins,
    hasLateralMargins = _ref$hasLateralMargin === void 0 ? false : _ref$hasLateralMargin;
  var enablePrivacyPolicy = !!(privacyPolicy !== null && privacyPolicy !== void 0 && privacyPolicy.active);
  var enableGDPRCompliance = !!(gdprCompliance !== null && gdprCompliance !== void 0 && gdprCompliance.active);
  var nanoId = 'eSPqNc';
  return /*#__PURE__*/react.createElement(CollectDataContainer, {
    hasLateralMarings: hasLateralMargins
  }, showEmailSection && /*#__PURE__*/react.createElement(LeadFormDataContainer, null, /*#__PURE__*/react.createElement(Input_ModalFormInputContainer, {
    field: {
      id: nanoId,
      fieldName: 'Email address',
      required: true,
      validation: 'email',
      noOfRows: 1,
      placeholder: 'Your email',
      userInput: readerEmail,
      disabled: isInputDisabled,
      children: []
    },
    index: 0,
    withoutMarginTop: true,
    setFieldValid: function setFieldValid(index, valid) {
      return setIsEmailValid(valid);
    },
    setFieldUserInput: function setFieldUserInput(index, value) {
      return setReaderEmail(value);
    }
  })), (enablePrivacyPolicy || enableGDPRCompliance) && /*#__PURE__*/react.createElement(AgreementContainer, null, enablePrivacyPolicy && /*#__PURE__*/react.createElement(PrivacyPolicyAgreement_PrivacyPolicyAgreement, {
    companyName: privacyPolicy === null || privacyPolicy === void 0 ? void 0 : privacyPolicy.companyName,
    privacyPolicyURL: privacyPolicy === null || privacyPolicy === void 0 ? void 0 : privacyPolicy.policyLink,
    onChangePrivacyPolicy: function onChangePrivacyPolicy(e) {
      return setAgreedToPrivacyPolicy(e.target.checked);
    }
  }), enableGDPRCompliance && /*#__PURE__*/react.createElement(GDPRAgreement_GDPRAgreement, {
    gdprMessage: gdprCompliance === null || gdprCompliance === void 0 ? void 0 : gdprCompliance.message,
    onChangeGDPRAgreement: function onChangeGDPRAgreement(e) {
      return setAgreedToGDPR(e.target.checked);
    }
  })));
};
/* harmony default export */ var CollectData_CollectData = (CollectData);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/QuestionModal/CollectData/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/canStartQuiz.ts
/* harmony default export */ var canStartQuiz = (function (collectEmail, isEmailValid, collectPrivacyPolicy, agreedToPrivacyPolicy) {
  var canStartQuiz = false;
  if (!collectEmail && !collectPrivacyPolicy) {
    canStartQuiz = true;
  }
  if (collectEmail && isEmailValid && (!collectPrivacyPolicy || agreedToPrivacyPolicy)) {
    canStartQuiz = true;
  }
  if (!collectEmail && collectPrivacyPolicy && agreedToPrivacyPolicy) {
    canStartQuiz = true;
  }
  return canStartQuiz;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/QuizSteps/StartScreenStep.tsx




function StartScreenStep_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ StartScreenStep_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function StartScreenStep_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function StartScreenStep_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? StartScreenStep_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : StartScreenStep_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }















var StartScreenStep = function StartScreenStep(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = StartScreenStep_objectSpread(StartScreenStep_objectSpread({}, defaultQuiz), element.attributes);
  var questions = attributes.questions,
    formName = attributes.formName,
    formDescription = attributes.formDescription,
    startButtonLabel = attributes.startButtonLabel,
    gdprCompliance = attributes.gdprCompliance,
    privacyPolicy = attributes.privacyPolicy,
    collectData = attributes.collectData;
  var setModalStep = react_useSetAtom(setModalStepAtom);
  var _useContext = (0,react.useContext)(StatisticsContext),
    registerEvents = _useContext.registerEvents;
  var _useContext2 = (0,react.useContext)(contexts_QuizContext),
    agreedToPrivacyPolicy = _useContext2.agreedToPrivacyPolicy,
    readerEmail = _useContext2.readerEmail,
    setReaderEmail = _useContext2.setReaderEmail,
    setAgreedToPrivacyPolicy = _useContext2.setAgreedToPrivacyPolicy,
    setAgreedToGDPR = _useContext2.setAgreedToGDPR,
    setElementClickedTime = _useContext2.setElementClickedTime;
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    isEmailValid = _useState2[0],
    setIsEmailValid = _useState2[1];
  var numberOfQuestions = useTranslate(Identifier.l_number_of_questions);
  var questionsCount = questions.length;
  var showCollectDataSection = collectData || (privacyPolicy === null || privacyPolicy === void 0 ? void 0 : privacyPolicy.active) || (gdprCompliance === null || gdprCompliance === void 0 ? void 0 : gdprCompliance.active);
  var isStartButtonDisabled = !canStartQuiz(collectData, isEmailValid, privacyPolicy === null || privacyPolicy === void 0 ? void 0 : privacyPolicy.active, agreedToPrivacyPolicy);
  (0,react.useEffect)(function () {
    registerEvents([{
      eid: StatsType.OPEN_FORM,
      elid: props.elementId,
      pid: props.pageId
    }]);
  }, []);
  var startButtonAction = /*#__PURE__*/function () {
    var _ref = asyncToGenerator_asyncToGenerator(/*#__PURE__*/StartScreenStep_regeneratorRuntime().mark(function _callee() {
      return StartScreenStep_regeneratorRuntime().wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            setElementClickedTime(Math.floor(new Date().getTime() / 1000));
            setModalStep(QuizModalStep.LOADING);
          case 2:
          case "end":
            return _context.stop();
        }
      }, _callee);
    }));
    return function startButtonAction() {
      return _ref.apply(this, arguments);
    };
  }();
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(QuizModalHeader, null, /*#__PURE__*/react.createElement(GeneralComponents_Badge_Badge, {
    tabIndex: TabIndex.DEFAULT,
    label: "".concat(numberOfQuestions, ": ").concat(questionsCount),
    width: "auto",
    height: "20px",
    fontSize: "10px",
    fontWeight: "500"
  })), /*#__PURE__*/react.createElement(QuizTitle, {
    tabIndex: TabIndex.DEFAULT
  }, formName), formDescription && /*#__PURE__*/react.createElement(QuizDescription, {
    tabIndex: TabIndex.DEFAULT
  }, formDescription), showCollectDataSection && /*#__PURE__*/react.createElement(CollectData_CollectData, {
    showEmailSection: collectData,
    privacyPolicy: privacyPolicy,
    gdprCompliance: gdprCompliance,
    setAgreedToPrivacyPolicy: setAgreedToPrivacyPolicy,
    setAgreedToGDPR: setAgreedToGDPR,
    setIsEmailValid: setIsEmailValid,
    setReaderEmail: setReaderEmail,
    readerEmail: readerEmail,
    hasLateralMargins: true
  }), /*#__PURE__*/react.createElement(NavigationButtonsContainer, null, /*#__PURE__*/react.createElement(CompleteButton, {
    type: "submit",
    $fullWidth: true,
    disabled: isStartButtonDisabled,
    onClick: startButtonAction,
    tabIndex: TabIndex.DEFAULT,
    value: startButtonLabel
  }, startButtonLabel)));
};
/* harmony default export */ var QuizSteps_StartScreenStep = (StartScreenStep);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/QuizSteps/SuccessfulSubmittedQuiz.tsx










var SuccessfulSubmittedQuiz = function SuccessfulSubmittedQuiz(_ref) {
  var thankYouMessage = _ref.thankYouMessage,
    splitThankYouMessage = _ref.splitThankYouMessage,
    quizPassed = _ref.quizPassed,
    showCorrectAnswer = _ref.showCorrectAnswer,
    allowRetake = _ref.allowRetake,
    multipleQuestionsPerPage = _ref.multipleQuestionsPerPage,
    action = _ref.action;
  var theme = Ze();
  var retakeQuizButtonText = useTranslate(Identifier.l_retake_quiz);
  var viewResultsButtonText = useTranslate(Identifier.l_view_results);
  var _useContext = (0,react.useContext)(contexts_QuizContext),
    resetQuiz = _useContext.resetQuiz,
    selectedOptions = _useContext.selectedOptions;
  var buttonAction = function buttonAction(e) {
    e.stopPropagation();
    action();
  };
  var thankYouMessageText = function thankYouMessageText() {
    // In order to make it work for old quizzes
    if (typeof thankYouMessage === 'string') {
      return thankYouMessage;
    }
    if (splitThankYouMessage) {
      return quizPassed ? thankYouMessage.passed : thankYouMessage.failed;
    }
    return thankYouMessage.default;
  };
  var thankYouMessageIcon = function thankYouMessageIcon() {
    if (splitThankYouMessage) {
      return quizPassed ? /*#__PURE__*/react.createElement(src.SuccessfulIcon, {
        fill: theme.colors.success,
        ariaLabel: thankYouMessageText()
      }) : /*#__PURE__*/react.createElement(src.FailedIcon, {
        fill: theme.colors.danger,
        ariaLabel: thankYouMessageText()
      });
    }
    return /*#__PURE__*/react.createElement(src.SuccessfulIcon, {
      fill: theme.colors.success,
      ariaLabel: thankYouMessageText()
    });
  };
  return /*#__PURE__*/react.createElement(InformationContainer, null, thankYouMessageIcon(), /*#__PURE__*/react.createElement(Paragraph, {
    tabIndex: TabIndex.DEFAULT
  }, thankYouMessageText()), /*#__PURE__*/react.createElement(Quiz_styles_ButtonsContainer, null, showCorrectAnswer && !!Object.keys(selectedOptions).length && /*#__PURE__*/react.createElement(ViewResultsButton, {
    onClick: function onClick(e) {
      return buttonAction(e);
    },
    tabIndex: TabIndex.DEFAULT
  }, viewResultsButtonText), allowRetake && /*#__PURE__*/react.createElement(RetakeButton, {
    onClick: function onClick() {
      return resetQuiz(multipleQuestionsPerPage);
    },
    tabIndex: TabIndex.DEFAULT,
    disabled: !allowRetake
  }, retakeQuizButtonText)));
};
/* harmony default export */ var QuizSteps_SuccessfulSubmittedQuiz = (SuccessfulSubmittedQuiz);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/InteractivityModal/QuizManager.tsx


function QuizManager_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function QuizManager_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? QuizManager_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : QuizManager_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


















var QuizManager = function QuizManager(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = QuizManager_objectSpread(QuizManager_objectSpread({}, defaultQuiz), element.attributes);
  var thankYouMessage = attributes.thankYouMessage,
    showCorrectAnswer = attributes.showCorrectAnswer,
    splitThankYouMessage = attributes.splitThankYouMessage,
    allowRetake = attributes.allowRetake,
    multipleQuestionsPerPage = attributes.multipleQuestionsPerPage;
  var _staticStore$config$g = getConfig(),
    trackingData = _staticStore$config$g.trackingData,
    renderedFrom = _staticStore$config$g.renderedFrom;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    hash = _useAtom2[0].hash;
  var _useAtom3 = react_useAtom(stageSizeHeightAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    height = _useAtom4[0];
  var setModalStep = react_useSetAtom(setModalStepAtom);
  var quizContext = (0,react.useContext)(contexts_QuizContext);
  var activeQuestionIndex = quizContext.activeQuestionIndex,
    isQuizPassed = quizContext.isQuizPassed,
    setIsQuizPassed = quizContext.setIsQuizPassed;
  var retakeLoadingTimeId = (0,react.useRef)(null);
  var trackingDataString = trackingData ? "_".concat(trackingData) : '';
  var quizKeyName = "interactivity_quiz_".concat(hash).concat(trackingDataString);
  var START_SCREEN = QuizModalStep.START_SCREEN,
    SUCCESSFUL_SEND_RESPONSE = QuizModalStep.SUCCESSFUL_SEND_RESPONSE,
    DEFAULT = QuizModalStep.DEFAULT,
    LOADING = QuizModalStep.LOADING,
    LOADING_RETAKE = QuizModalStep.LOADING_RETAKE,
    VIEW_RESULTS = QuizModalStep.VIEW_RESULTS,
    QUESTION = QuizModalStep.QUESTION;
  (0,react.useEffect)(function () {
    var _getLocalStorage;
    // On other pages, we display the successful state on modal opening, if the quiz was already taken
    if (renderedFrom === RenderAreas.EDITOR) {
      // In editor, we display the questions every time on quiz modal open (Request from PM)
      setModalStep(START_SCREEN);
      return;
    }
    var quizRecord = getParsedJson((_getLocalStorage = localStorage_getLocalStorage(quizKeyName)) !== null && _getLocalStorage !== void 0 ? _getLocalStorage : '', []).find(function (itm) {
      return parseInt(itm.toString().split('_')[0], 10) === props.elementId;
    });
    if (quizRecord) {
      // First quiz implementation would save the quiz id as number in local storage. For backward compatibility,
      //  always cast to string the data from local storage
      var quizRecordResult = quizRecord.toString().split('_')[1];
      if (quizRecordResult === Suffix.PASSED) {
        setIsQuizPassed(true);
      }
      if (quizRecordResult === Suffix.FAILED) {
        setIsQuizPassed(false);
      }
      setModalStep(SUCCESSFUL_SEND_RESPONSE);
    } else {
      setModalStep(START_SCREEN);
    }
  }, []);
  var getModalContent = function getModalContent() {
    switch (props.modalStep) {
      case DEFAULT:
        return /*#__PURE__*/react.createElement(QuizSteps_QuizFormStep, {
          elementIndex: props.elementIndex,
          elementId: element.id,
          pageId: props.pageId
        });
      case "".concat(QUESTION, "_").concat(activeQuestionIndex):
      case "".concat(QUESTION, "_").concat(activeQuestionIndex, "_feedback"):
        return /*#__PURE__*/react.createElement(QuizSteps_QuestionStep, {
          elementIndex: props.elementIndex,
          elementId: element.id,
          pageId: props.pageId,
          showCorrectAnswer: showCorrectAnswer
        });
      case LOADING:
      case "".concat(QuizModalStep.LOADING, "_error"):
        return /*#__PURE__*/react.createElement(QuizSteps_LoadingStep, {
          elementIndex: props.elementIndex,
          elementId: element.id,
          pageId: props.pageId
        });
      case SUCCESSFUL_SEND_RESPONSE:
        return /*#__PURE__*/react.createElement(QuizSteps_SuccessfulSubmittedQuiz, {
          showCorrectAnswer: showCorrectAnswer,
          action: function action() {
            setModalStep(VIEW_RESULTS);
          },
          thankYouMessage: thankYouMessage,
          splitThankYouMessage: splitThankYouMessage,
          allowRetake: allowRetake,
          multipleQuestionsPerPage: multipleQuestionsPerPage,
          quizPassed: isQuizPassed
        });
      case VIEW_RESULTS:
        return /*#__PURE__*/react.createElement(QuizSteps_ViewResultsStep, {
          pageId: props.pageId,
          elementIndex: props.elementIndex
        });
      case LOADING_RETAKE:
        if (!retakeLoadingTimeId.current) {
          retakeLoadingTimeId.current = setTimeout(function () {
            return setModalStep(START_SCREEN);
          }, 500);
        }
        return /*#__PURE__*/react.createElement(LoadingStateModal, null, /*#__PURE__*/react.createElement(Quiz_styles_PreloaderIcon, null));
      case START_SCREEN:
      default:
        if (retakeLoadingTimeId.current) {
          retakeLoadingTimeId.current = null;
        }
        return /*#__PURE__*/react.createElement(QuizSteps_StartScreenStep, {
          elementIndex: props.elementIndex,
          elementId: element.id,
          pageId: props.pageId
        });
    }
  };
  return /*#__PURE__*/react.createElement(QuizModalWrapper, null, /*#__PURE__*/react.createElement(QuizModal, {
    $stageSizeHeight: height
  }, getModalContent()));
};
/* harmony default export */ var InteractivityModal_QuizManager = (QuizManager);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/interaction.ts
var InteractionTypes = {
  POPOVER: 'popin',
  LINK: 'link',
  PAGE: 'page',
  SPOTLIGHT: 'spotlight',
  POPUP_FRAME: 'popup-frame'
};
var PageNavigationActionType = {
  CUSTOM: 'custom',
  NEXT: 'next',
  PREVIOUS: 'previous',
  FIRST: 'first',
  LAST: 'last'
};
var DEFAULT_SPACE = 25;
var TITLE_MARGIN = 10;
var OPEN_ACTION = {
  CLICK: 'click',
  HOVER: 'hover'
};
var TagActionTypes = {
  VIDEO: 0,
  IMAGE: 1,
  LINK: 2,
  TEXT: 3
};
var TransformOrigins = {
  TOP: 'top',
  RIGHT: 'right',
  BOTTOM: 'bottom',
  LEFT: 'left'
};
var OpenPopoverValues = {
  CLICK: 'click',
  HOVER: 'hover'
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ModalOpenManager/MouseEventTrigger.styles.ts

var MouseEventTrigger_styles_Layer = styled_components_browser_esm.button.withConfig({
  displayName: "MouseEventTriggerstyles__Layer",
  componentId: "sc-1pfvf3x-0"
})(["background:transparent;cursor:pointer;border:0;width:100%;height:100%;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ModalOpenManager/MouseEventTrigger.tsx














var MouseEventTrigger = function MouseEventTrigger(props) {
  var context = (0,react.useContext)(contexts_ModalContext);
  var elemRef = (0,react.useRef)(null);
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    leadForm = _useContext.leadForm;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    hash = _useAtom2[0].hash;
  var modalRef = (0,react.useRef)({
    isMouseDown: false,
    canBeOpened: true
  });
  var opened = context.active && context.active === props.identifier;
  var tabIndex = props.identifier === LEAD_FORM_ID ? TabIndex.UNREACHABLE : TabIndex.DEFAULT;
  (0,react.useEffect)(function () {
    if (context.disabled) {
      modalRef.current.canBeOpened = true;
    }
  }, [context.disabled]);
  var onClick = function onClick(event) {
    if (modalRef.current.canBeOpened && props.openType !== OPEN_ACTION.HOVER) {
      event.nativeEvent.stopImmediatePropagation();
      context.setDisabled(opened);

      // Prevent statistics events to be sent when the modal is closing onClick
      if (opened) {
        event.stopPropagation();
      }
      setTimeout(function () {
        if (opened && leadForm !== null && leadForm !== void 0 && leadForm.allowUsersToSkip && props.identifier === LEAD_FORM_ID) {
          setLeadFormCookies(hash);
          context.setOpen(LEAD_FORM_COMPLETED);
        } else {
          context.setOpen(opened ? '' : props.identifier);
        }
      }, opened ? ANIMATION_EXECUTION_TIME : 0);
    } else if (props.openType === OPEN_ACTION.HOVER) {
      event.nativeEvent.stopImmediatePropagation();
    }
    modalRef.current.canBeOpened = true;
    modalRef.current.isMouseDown = false;
  };
  var onMouseDown = function onMouseDown(e) {
    if (isTouchEvent(e) && 'touches' in e && e.touches.length === 1 || e instanceof MouseEvent) {
      e.stopPropagation();
    }
    if (opened) {
      modalRef.current.isMouseDown = true;
    }
  };
  var onMouseMove = function onMouseMove() {
    var disableOpening = modalRef.current.isMouseDown && !opened;
    if (disableOpening) {
      modalRef.current.canBeOpened = false;
    }
  };
  var onMouseOver = function onMouseOver() {
    if (props.openType === OPEN_ACTION.HOVER) {
      context.setOpen(props.identifier);
    }
  };
  var onMouseLeave = function onMouseLeave() {
    if (props.openType === OPEN_ACTION.HOVER) {
      context.setOpen('');
    }
  };
  var onKeydownHandler = function onKeydownHandler(event) {
    if (event.code === KeyboardCodes.TAB) {
      context.setOpen('');
    }
  };
  (0,react.useEffect)(function () {
    if (main/* isMobile */.Fr) {
      var _elemRef$current;
      elemRef === null || elemRef === void 0 || (_elemRef$current = elemRef.current) === null || _elemRef$current === void 0 || _elemRef$current.addEventListener('touchstart', onMouseDown);
    } else {
      var _elemRef$current2, _elemRef$current3;
      elemRef === null || elemRef === void 0 || (_elemRef$current2 = elemRef.current) === null || _elemRef$current2 === void 0 || _elemRef$current2.addEventListener('mousedown', onMouseDown);
      elemRef === null || elemRef === void 0 || (_elemRef$current3 = elemRef.current) === null || _elemRef$current3 === void 0 || _elemRef$current3.addEventListener('keydown', onKeydownHandler);
    }
    return function () {
      if (main/* isMobile */.Fr) {
        var _elemRef$current4;
        elemRef === null || elemRef === void 0 || (_elemRef$current4 = elemRef.current) === null || _elemRef$current4 === void 0 || _elemRef$current4.removeEventListener('touchstart', onMouseDown);
      } else {
        var _elemRef$current5, _elemRef$current6;
        elemRef === null || elemRef === void 0 || (_elemRef$current5 = elemRef.current) === null || _elemRef$current5 === void 0 || _elemRef$current5.removeEventListener('mousedown', onMouseDown);
        elemRef === null || elemRef === void 0 || (_elemRef$current6 = elemRef.current) === null || _elemRef$current6 === void 0 || _elemRef$current6.removeEventListener('keydown', onKeydownHandler);
      }
    };
  }, [opened]);
  return /*#__PURE__*/react.createElement(MouseEventTrigger_styles_Layer, {
    ref: elemRef,
    tabIndex: tabIndex,
    "aria-label": props.ariaLabel || '',
    "aria-hidden": !props.ariaLabel,
    onClick: onClick,
    onMouseMove: onMouseMove,
    onMouseOver: onMouseOver,
    onMouseLeave: onMouseLeave,
    onFocus: onMouseOver
  }, opened ? props.children : null);
};
/* harmony default export */ var ModalOpenManager_MouseEventTrigger = (/*#__PURE__*/react.memo(MouseEventTrigger));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ModalActionContainer/ModalActionContainer.tsx





var ModalActionContainer = function ModalActionContainer(_ref) {
  var _ref$modalHeight = _ref.modalHeight,
    modalHeight = _ref$modalHeight === void 0 ? 'auto' : _ref$modalHeight,
    _ref$loading = _ref.loading,
    loading = _ref$loading === void 0 ? false : _ref$loading,
    _ref$openType = _ref.openType,
    openType = _ref$openType === void 0 ? OPEN_ACTION.CLICK : _ref$openType,
    _ref$opacity = _ref.opacity,
    opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
    _ref$modalWithoutPadd = _ref.modalWithoutPadding,
    modalWithoutPadding = _ref$modalWithoutPadd === void 0 ? false : _ref$modalWithoutPadd,
    _ref$ariaLabel = _ref.ariaLabel,
    ariaLabel = _ref$ariaLabel === void 0 ? '' : _ref$ariaLabel,
    _ref$displayCloseIcon = _ref.displayCloseIcon,
    displayCloseIcon = _ref$displayCloseIcon === void 0 ? true : _ref$displayCloseIcon,
    width = _ref.width,
    height = _ref.height,
    identifier = _ref.identifier,
    children = _ref.children;
  return /*#__PURE__*/react.createElement(ModalOpenManager_MouseEventTrigger, {
    identifier: identifier,
    openType: openType,
    width: width,
    height: height,
    ariaLabel: ariaLabel
  }, /*#__PURE__*/react.createElement(Modals_Modal_Modal, {
    identifier: identifier,
    width: width,
    height: height,
    modalHeight: modalHeight,
    loading: loading,
    opacity: opacity,
    modalWithoutPadding: modalWithoutPadding,
    displayCloseIcon: displayCloseIcon
  }, children));
};
ModalActionContainer.propTypes = {
  width: (prop_types_default()).string.isRequired,
  height: (prop_types_default()).string.isRequired,
  identifier: (prop_types_default()).string.isRequired,
  modalHeight: (prop_types_default()).string,
  openType: (prop_types_default()).string,
  loading: (prop_types_default()).bool,
  opacity: (prop_types_default()).number,
  modalWithoutPadding: (prop_types_default()).bool,
  ariaLabel: (prop_types_default()).string,
  displayCloseIcon: (prop_types_default()).bool
};
/* harmony default export */ var ModalActionContainer_ModalActionContainer = (ModalActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ModalActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/MandatoryActionsModal/MandatoryActionsModalStyles.tsx




var MandatoryAction = styled_components_browser_esm.div.withConfig({
  displayName: "MandatoryActionsModalStyles__MandatoryAction",
  componentId: "sc-177lefq-0"
})(["display:flex;flex-direction:column;max-height:", "px;"], function (_ref) {
  var $height = _ref.$height;
  return $height - 72 - $height * 0.30;
});
var MandatoryActionsTitle = styled_components_browser_esm(H2).withConfig({
  displayName: "MandatoryActionsModalStyles__MandatoryActionsTitle",
  componentId: "sc-177lefq-1"
})(["padding:24px;"]);
var MandatoryActionsModalStyles_ScrollableSection = styled_components_browser_esm.div.withConfig({
  displayName: "MandatoryActionsModalStyles__ScrollableSection",
  componentId: "sc-177lefq-2"
})(["display:flex;flex-direction:column;gap:16px;scrollbar-gutter:stable;padding:8px 13px 8px 24px;overflow-x:hidden;scrollbar-color:", " ", ";", " ", ""], function (_ref2) {
  var theme = _ref2.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.26);
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.colors.white;
}, main/* isSafari */.nr && "\n        overflow-y: scroll;\n    ", main/* isMobile */.Fr && "\n        padding-right: 24px;\n    ");
var MandatoryInstructionContainer = styled_components_browser_esm.div.withConfig({
  displayName: "MandatoryActionsModalStyles__MandatoryInstructionContainer",
  componentId: "sc-177lefq-3"
})(["display:flex;flex-direction:row;align-items:center;border:1px solid ", ";border-radius:8px;padding:16px 10px 16px 24px;justify-content:space-between;font-size:14px;line-height:24px;cursor:pointer;background-color:", ";:hover{background-image:linear-gradient(rgba(0,0,0,0.04),rgba(0,0,0,0.04));border:1px solid ", ";}"], function (_ref4) {
  var theme = _ref4.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.2);
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.colors.white;
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.23);
});
var SubmitButtonContainer = styled_components_browser_esm.div.withConfig({
  displayName: "MandatoryActionsModalStyles__SubmitButtonContainer",
  componentId: "sc-177lefq-4"
})(["padding:16px 24px 24px 24px;align-self:end;"]);
var MandatoryActionsModalStyles_SubmitButton = styled_components_browser_esm.button.withConfig({
  displayName: "MandatoryActionsModalStyles__SubmitButton",
  componentId: "sc-177lefq-5"
})(["width:82px;height:40px;padding:8px 24px;border-radius:4px;cursor:pointer;font-family:", ";font-weight:", ";color:", ";background-color:", ";border:none;:hover{background-image:linear-gradient(rgba(0,0,0,0.30),rgba(0,0,0,0.30));}"], function (_ref7) {
  var theme = _ref7.theme;
  return theme.typography.family.sans;
}, function (_ref8) {
  var theme = _ref8.theme;
  return theme.typography.weight.medium;
}, function (_ref9) {
  var theme = _ref9.theme;
  return theme.colors.white;
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.colors.primary;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/MandatoryActionsModal/MandatoryActionsModal.tsx
















var MandatoryActionsModal = function MandatoryActionsModal(_ref) {
  var stageSize = _ref.stageSize;
  var theme = Ze();
  var _useState = (0,react.useState)(null),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    selectedQuizId = _useState2[0],
    setSelectedQuizId = _useState2[1];
  var stageWidth = stageSize.width,
    stageHeight = stageSize.height;
  var width = stageWidth <= theme.deviceSize.tabletS ? 'auto' : "".concat(theme.leadForm.popoverSizes.width, "px");
  var setActiveMandatoryModal = react_useSetAtom(setActiveMandatoryModalAtom);
  var mandatoryActions = react_useAtomValue(mandatoryActionsAtom);
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$pages = _useContext.pages,
    order = _useContext$pages.order,
    data = _useContext$pages.data;
  var activeStageMandatoryElements = [];
  var indexOfFirstMandatoryAction = useFirstMandatoryStageIndex();
  var listOfMandatoryStages = Object.keys(mandatoryActions);
  var stageKey = order[indexOfFirstMandatoryAction].join(' ');
  var mandatoryActionsByStage = mandatoryActions[stageKey];
  var modalStep = react_useAtomValue(modalStepAtom);

  // Get mandatory element data for the active stage
  order[indexOfFirstMandatoryAction].forEach(function (pageId) {
    if (listOfMandatoryStages.includes(stageKey)) {
      var elements = data[pageId].elements;
      mandatoryActionsByStage.forEach(function (elementId) {
        var elementIndex = elements.findIndex(function (element) {
          return element.id === elementId;
        });
        var mandatoryElementData = elements[elementIndex];
        if (mandatoryElementData) {
          var mandatoryInstruction = 'Please complete the highlighted quiz before proceeding.';
          if ('mandatoryInstruction' in mandatoryElementData.attributes && mandatoryElementData.attributes.mandatoryInstruction) {
            mandatoryInstruction = mandatoryElementData.attributes.mandatoryInstruction;
          }
          activeStageMandatoryElements.push({
            pageId: pageId,
            elementIndex: elementIndex,
            elementId: mandatoryElementData.id,
            mandatoryInstruction: mandatoryInstruction
          });
        }
      });
    }
  });
  var onKeyDownHandler = function onKeyDownHandler(event, index) {
    event.preventDefault();
    if (event.code === KeyboardCodes.ENTER || event.code === KeyboardCodes.SPACE) {
      setSelectedQuizId(index);
    }
  };
  var getMandatoryInstruction = function getMandatoryInstruction() {
    return activeStageMandatoryElements.map(function (_ref2, index) {
      var mandatoryInstruction = _ref2.mandatoryInstruction;
      if (mandatoryInstruction) {
        return /*#__PURE__*/react.createElement(MandatoryInstructionContainer, {
          key: "instruction-".concat(index, "-").concat(mandatoryInstruction),
          onClick: function onClick() {
            return setSelectedQuizId(index);
          },
          onKeyDown: function onKeyDown(event) {
            return onKeyDownHandler(event, index);
          },
          tabIndex: TabIndex.DEFAULT,
          "aria-label": mandatoryInstruction
        }, /*#__PURE__*/react.createElement("div", null, mandatoryInstruction), /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
          id: "next-page-".concat(index),
          type: HtmlButtonTypes.BUTTON,
          size: IconSize.small,
          hover: true,
          tabIndex: TabIndex.DEFAULT,
          ariaLabel: mandatoryInstruction
        }, /*#__PURE__*/react.createElement(src.WidgetNextPage, {
          color: theme.colors.primary,
          borderColor: theme.colors.white
        })));
      }
      return null;
    });
  };
  var getMandatoryModalContent = function getMandatoryModalContent() {
    return /*#__PURE__*/react.createElement(MandatoryAction, {
      $height: stageHeight
    }, /*#__PURE__*/react.createElement(MandatoryActionsTitle, {
      tabIndex: TabIndex.DEFAULT
    }, "Mandatory actions"), /*#__PURE__*/react.createElement(MandatoryActionsModalStyles_ScrollableSection, null, getMandatoryInstruction()), /*#__PURE__*/react.createElement(SubmitButtonContainer, null, /*#__PURE__*/react.createElement(MandatoryActionsModalStyles_SubmitButton, {
      type: "submit",
      value: "Submit",
      onClick: function onClick() {
        return setActiveMandatoryModal(false);
      },
      tabIndex: TabIndex.DEFAULT
    }, "Got it")));
  };
  var getInteractivityModalContent = function getInteractivityModalContent() {
    var _ref3 = activeStageMandatoryElements[selectedQuizId] || {},
      pageId = _ref3.pageId,
      elementId = _ref3.elementId,
      elementIndex = _ref3.elementIndex;
    return /*#__PURE__*/react.createElement(providers_QuizProviderContainer, null, /*#__PURE__*/react.createElement(InteractivityModal_QuizManager, {
      pageId: pageId,
      elementId: elementId,
      elementIndex: elementIndex,
      modalStep: modalStep
    }));
  };
  return /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: width,
    height: "auto",
    identifier: MANDATORY_MODAL_ID,
    modalWithoutPadding: true
  }, selectedQuizId !== null ? getInteractivityModalContent() : getMandatoryModalContent());
};
/* harmony default export */ var MandatoryActionsModal_MandatoryActionsModal = (MandatoryActionsModal);
// EXTERNAL MODULE: ../../modules/widget-player/code/node_modules/memoize-one/dist/memoize-one.esm.js
var memoize_one_esm = __webpack_require__(3097);
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-window/dist/index.esm.js







// Animation frame based implementation of setTimeout.
// Inspired by Joe Lambert, https://gist.github.com/joelambert/1002116#file-requesttimeout-js
var hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
var index_esm_now = hasNativePerformanceNow ? function () {
  return performance.now();
} : function () {
  return Date.now();
};
function cancelTimeout(timeoutID) {
  cancelAnimationFrame(timeoutID.id);
}
function index_esm_requestTimeout(callback, delay) {
  var start = index_esm_now();

  function tick() {
    if (index_esm_now() - start >= delay) {
      callback.call(null);
    } else {
      timeoutID.id = requestAnimationFrame(tick);
    }
  }

  var timeoutID = {
    id: requestAnimationFrame(tick)
  };
  return timeoutID;
}

var size = -1; // This utility copied from "dom-helpers" package.

function index_esm_getScrollbarSize(recalculate) {
  if (recalculate === void 0) {
    recalculate = false;
  }

  if (size === -1 || recalculate) {
    var div = document.createElement('div');
    var style = div.style;
    style.width = '50px';
    style.height = '50px';
    style.overflow = 'scroll';
    document.body.appendChild(div);
    size = div.offsetWidth - div.clientWidth;
    document.body.removeChild(div);
  }

  return size;
}
var cachedRTLResult = null; // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
// Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).
// Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.
// The safest way to check this is to intentionally set a negative offset,
// and then verify that the subsequent "scroll" event matches the negative offset.
// If it does not match, then we can assume a non-standard RTL scroll implementation.

function getRTLOffsetType(recalculate) {
  if (recalculate === void 0) {
    recalculate = false;
  }

  if (cachedRTLResult === null || recalculate) {
    var outerDiv = document.createElement('div');
    var outerStyle = outerDiv.style;
    outerStyle.width = '50px';
    outerStyle.height = '50px';
    outerStyle.overflow = 'scroll';
    outerStyle.direction = 'rtl';
    var innerDiv = document.createElement('div');
    var innerStyle = innerDiv.style;
    innerStyle.width = '100px';
    innerStyle.height = '100px';
    outerDiv.appendChild(innerDiv);
    document.body.appendChild(outerDiv);

    if (outerDiv.scrollLeft > 0) {
      cachedRTLResult = 'positive-descending';
    } else {
      outerDiv.scrollLeft = 1;

      if (outerDiv.scrollLeft === 0) {
        cachedRTLResult = 'negative';
      } else {
        cachedRTLResult = 'positive-ascending';
      }
    }

    document.body.removeChild(outerDiv);
    return cachedRTLResult;
  }

  return cachedRTLResult;
}

var IS_SCROLLING_DEBOUNCE_INTERVAL = 150;

var defaultItemKey = function defaultItemKey(_ref) {
  var columnIndex = _ref.columnIndex,
      data = _ref.data,
      rowIndex = _ref.rowIndex;
  return rowIndex + ":" + columnIndex;
}; // In DEV mode, this Set helps us only log a warning once per component instance.
// This avoids spamming the console every time a render happens.


var devWarningsOverscanCount = null;
var devWarningsOverscanRowsColumnsCount = null;
var devWarningsTagName = null;

if (false) {}

function createGridComponent(_ref2) {
  var _class;

  var getColumnOffset = _ref2.getColumnOffset,
      getColumnStartIndexForOffset = _ref2.getColumnStartIndexForOffset,
      getColumnStopIndexForStartIndex = _ref2.getColumnStopIndexForStartIndex,
      getColumnWidth = _ref2.getColumnWidth,
      getEstimatedTotalHeight = _ref2.getEstimatedTotalHeight,
      getEstimatedTotalWidth = _ref2.getEstimatedTotalWidth,
      getOffsetForColumnAndAlignment = _ref2.getOffsetForColumnAndAlignment,
      getOffsetForRowAndAlignment = _ref2.getOffsetForRowAndAlignment,
      getRowHeight = _ref2.getRowHeight,
      getRowOffset = _ref2.getRowOffset,
      getRowStartIndexForOffset = _ref2.getRowStartIndexForOffset,
      getRowStopIndexForStartIndex = _ref2.getRowStopIndexForStartIndex,
      initInstanceProps = _ref2.initInstanceProps,
      shouldResetStyleCacheOnItemSizeChange = _ref2.shouldResetStyleCacheOnItemSizeChange,
      validateProps = _ref2.validateProps;
  return _class = /*#__PURE__*/function (_PureComponent) {
    _inheritsLoose(Grid, _PureComponent);

    // Always use explicit constructor for React components.
    // It produces less code after transpilation. (#26)
    // eslint-disable-next-line no-useless-constructor
    function Grid(props) {
      var _this;

      _this = _PureComponent.call(this, props) || this;
      _this._instanceProps = initInstanceProps(_this.props, _assertThisInitialized(_this));
      _this._resetIsScrollingTimeoutId = null;
      _this._outerRef = void 0;
      _this.state = {
        instance: _assertThisInitialized(_this),
        isScrolling: false,
        horizontalScrollDirection: 'forward',
        scrollLeft: typeof _this.props.initialScrollLeft === 'number' ? _this.props.initialScrollLeft : 0,
        scrollTop: typeof _this.props.initialScrollTop === 'number' ? _this.props.initialScrollTop : 0,
        scrollUpdateWasRequested: false,
        verticalScrollDirection: 'forward'
      };
      _this._callOnItemsRendered = void 0;
      _this._callOnItemsRendered = (0,memoize_one_esm["default"])(function (overscanColumnStartIndex, overscanColumnStopIndex, overscanRowStartIndex, overscanRowStopIndex, visibleColumnStartIndex, visibleColumnStopIndex, visibleRowStartIndex, visibleRowStopIndex) {
        return _this.props.onItemsRendered({
          overscanColumnStartIndex: overscanColumnStartIndex,
          overscanColumnStopIndex: overscanColumnStopIndex,
          overscanRowStartIndex: overscanRowStartIndex,
          overscanRowStopIndex: overscanRowStopIndex,
          visibleColumnStartIndex: visibleColumnStartIndex,
          visibleColumnStopIndex: visibleColumnStopIndex,
          visibleRowStartIndex: visibleRowStartIndex,
          visibleRowStopIndex: visibleRowStopIndex
        });
      });
      _this._callOnScroll = void 0;
      _this._callOnScroll = (0,memoize_one_esm["default"])(function (scrollLeft, scrollTop, horizontalScrollDirection, verticalScrollDirection, scrollUpdateWasRequested) {
        return _this.props.onScroll({
          horizontalScrollDirection: horizontalScrollDirection,
          scrollLeft: scrollLeft,
          scrollTop: scrollTop,
          verticalScrollDirection: verticalScrollDirection,
          scrollUpdateWasRequested: scrollUpdateWasRequested
        });
      });
      _this._getItemStyle = void 0;

      _this._getItemStyle = function (rowIndex, columnIndex) {
        var _this$props = _this.props,
            columnWidth = _this$props.columnWidth,
            direction = _this$props.direction,
            rowHeight = _this$props.rowHeight;

        var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && columnWidth, shouldResetStyleCacheOnItemSizeChange && direction, shouldResetStyleCacheOnItemSizeChange && rowHeight);

        var key = rowIndex + ":" + columnIndex;
        var style;

        if (itemStyleCache.hasOwnProperty(key)) {
          style = itemStyleCache[key];
        } else {
          var _offset = getColumnOffset(_this.props, columnIndex, _this._instanceProps);

          var isRtl = direction === 'rtl';
          itemStyleCache[key] = style = {
            position: 'absolute',
            left: isRtl ? undefined : _offset,
            right: isRtl ? _offset : undefined,
            top: getRowOffset(_this.props, rowIndex, _this._instanceProps),
            height: getRowHeight(_this.props, rowIndex, _this._instanceProps),
            width: getColumnWidth(_this.props, columnIndex, _this._instanceProps)
          };
        }

        return style;
      };

      _this._getItemStyleCache = void 0;
      _this._getItemStyleCache = (0,memoize_one_esm["default"])(function (_, __, ___) {
        return {};
      });

      _this._onScroll = function (event) {
        var _event$currentTarget = event.currentTarget,
            clientHeight = _event$currentTarget.clientHeight,
            clientWidth = _event$currentTarget.clientWidth,
            scrollLeft = _event$currentTarget.scrollLeft,
            scrollTop = _event$currentTarget.scrollTop,
            scrollHeight = _event$currentTarget.scrollHeight,
            scrollWidth = _event$currentTarget.scrollWidth;

        _this.setState(function (prevState) {
          if (prevState.scrollLeft === scrollLeft && prevState.scrollTop === scrollTop) {
            // Scroll position may have been updated by cDM/cDU,
            // In which case we don't need to trigger another render,
            // And we don't want to update state.isScrolling.
            return null;
          }

          var direction = _this.props.direction; // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
          // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
          // It's also easier for this component if we convert offsets to the same format as they would be in for ltr.
          // So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.

          var calculatedScrollLeft = scrollLeft;

          if (direction === 'rtl') {
            switch (getRTLOffsetType()) {
              case 'negative':
                calculatedScrollLeft = -scrollLeft;
                break;

              case 'positive-descending':
                calculatedScrollLeft = scrollWidth - clientWidth - scrollLeft;
                break;
            }
          } // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.


          calculatedScrollLeft = Math.max(0, Math.min(calculatedScrollLeft, scrollWidth - clientWidth));
          var calculatedScrollTop = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
          return {
            isScrolling: true,
            horizontalScrollDirection: prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
            scrollLeft: calculatedScrollLeft,
            scrollTop: calculatedScrollTop,
            verticalScrollDirection: prevState.scrollTop < scrollTop ? 'forward' : 'backward',
            scrollUpdateWasRequested: false
          };
        }, _this._resetIsScrollingDebounced);
      };

      _this._outerRefSetter = function (ref) {
        var outerRef = _this.props.outerRef;
        _this._outerRef = ref;

        if (typeof outerRef === 'function') {
          outerRef(ref);
        } else if (outerRef != null && typeof outerRef === 'object' && outerRef.hasOwnProperty('current')) {
          outerRef.current = ref;
        }
      };

      _this._resetIsScrollingDebounced = function () {
        if (_this._resetIsScrollingTimeoutId !== null) {
          cancelTimeout(_this._resetIsScrollingTimeoutId);
        }

        _this._resetIsScrollingTimeoutId = index_esm_requestTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL);
      };

      _this._resetIsScrolling = function () {
        _this._resetIsScrollingTimeoutId = null;

        _this.setState({
          isScrolling: false
        }, function () {
          // Clear style cache after state update has been committed.
          // This way we don't break pure sCU for items that don't use isScrolling param.
          _this._getItemStyleCache(-1);
        });
      };

      return _this;
    }

    Grid.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      validateSharedProps(nextProps, prevState);
      validateProps(nextProps);
      return null;
    };

    var _proto = Grid.prototype;

    _proto.scrollTo = function scrollTo(_ref3) {
      var scrollLeft = _ref3.scrollLeft,
          scrollTop = _ref3.scrollTop;

      if (scrollLeft !== undefined) {
        scrollLeft = Math.max(0, scrollLeft);
      }

      if (scrollTop !== undefined) {
        scrollTop = Math.max(0, scrollTop);
      }

      this.setState(function (prevState) {
        if (scrollLeft === undefined) {
          scrollLeft = prevState.scrollLeft;
        }

        if (scrollTop === undefined) {
          scrollTop = prevState.scrollTop;
        }

        if (prevState.scrollLeft === scrollLeft && prevState.scrollTop === scrollTop) {
          return null;
        }

        return {
          horizontalScrollDirection: prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
          scrollLeft: scrollLeft,
          scrollTop: scrollTop,
          scrollUpdateWasRequested: true,
          verticalScrollDirection: prevState.scrollTop < scrollTop ? 'forward' : 'backward'
        };
      }, this._resetIsScrollingDebounced);
    };

    _proto.scrollToItem = function scrollToItem(_ref4) {
      var _ref4$align = _ref4.align,
          align = _ref4$align === void 0 ? 'auto' : _ref4$align,
          columnIndex = _ref4.columnIndex,
          rowIndex = _ref4.rowIndex;
      var _this$props2 = this.props,
          columnCount = _this$props2.columnCount,
          height = _this$props2.height,
          rowCount = _this$props2.rowCount,
          width = _this$props2.width;
      var _this$state = this.state,
          scrollLeft = _this$state.scrollLeft,
          scrollTop = _this$state.scrollTop;
      var scrollbarSize = index_esm_getScrollbarSize();

      if (columnIndex !== undefined) {
        columnIndex = Math.max(0, Math.min(columnIndex, columnCount - 1));
      }

      if (rowIndex !== undefined) {
        rowIndex = Math.max(0, Math.min(rowIndex, rowCount - 1));
      }

      var estimatedTotalHeight = getEstimatedTotalHeight(this.props, this._instanceProps);
      var estimatedTotalWidth = getEstimatedTotalWidth(this.props, this._instanceProps); // The scrollbar size should be considered when scrolling an item into view,
      // to ensure it's fully visible.
      // But we only need to account for its size when it's actually visible.

      var horizontalScrollbarSize = estimatedTotalWidth > width ? scrollbarSize : 0;
      var verticalScrollbarSize = estimatedTotalHeight > height ? scrollbarSize : 0;
      this.scrollTo({
        scrollLeft: columnIndex !== undefined ? getOffsetForColumnAndAlignment(this.props, columnIndex, align, scrollLeft, this._instanceProps, verticalScrollbarSize) : scrollLeft,
        scrollTop: rowIndex !== undefined ? getOffsetForRowAndAlignment(this.props, rowIndex, align, scrollTop, this._instanceProps, horizontalScrollbarSize) : scrollTop
      });
    };

    _proto.componentDidMount = function componentDidMount() {
      var _this$props3 = this.props,
          initialScrollLeft = _this$props3.initialScrollLeft,
          initialScrollTop = _this$props3.initialScrollTop;

      if (this._outerRef != null) {
        var outerRef = this._outerRef;

        if (typeof initialScrollLeft === 'number') {
          outerRef.scrollLeft = initialScrollLeft;
        }

        if (typeof initialScrollTop === 'number') {
          outerRef.scrollTop = initialScrollTop;
        }
      }

      this._callPropsCallbacks();
    };

    _proto.componentDidUpdate = function componentDidUpdate() {
      var direction = this.props.direction;
      var _this$state2 = this.state,
          scrollLeft = _this$state2.scrollLeft,
          scrollTop = _this$state2.scrollTop,
          scrollUpdateWasRequested = _this$state2.scrollUpdateWasRequested;

      if (scrollUpdateWasRequested && this._outerRef != null) {
        // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
        // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
        // So we need to determine which browser behavior we're dealing with, and mimic it.
        var outerRef = this._outerRef;

        if (direction === 'rtl') {
          switch (getRTLOffsetType()) {
            case 'negative':
              outerRef.scrollLeft = -scrollLeft;
              break;

            case 'positive-ascending':
              outerRef.scrollLeft = scrollLeft;
              break;

            default:
              var clientWidth = outerRef.clientWidth,
                  scrollWidth = outerRef.scrollWidth;
              outerRef.scrollLeft = scrollWidth - clientWidth - scrollLeft;
              break;
          }
        } else {
          outerRef.scrollLeft = Math.max(0, scrollLeft);
        }

        outerRef.scrollTop = Math.max(0, scrollTop);
      }

      this._callPropsCallbacks();
    };

    _proto.componentWillUnmount = function componentWillUnmount() {
      if (this._resetIsScrollingTimeoutId !== null) {
        cancelTimeout(this._resetIsScrollingTimeoutId);
      }
    };

    _proto.render = function render() {
      var _this$props4 = this.props,
          children = _this$props4.children,
          className = _this$props4.className,
          columnCount = _this$props4.columnCount,
          direction = _this$props4.direction,
          height = _this$props4.height,
          innerRef = _this$props4.innerRef,
          innerElementType = _this$props4.innerElementType,
          innerTagName = _this$props4.innerTagName,
          itemData = _this$props4.itemData,
          _this$props4$itemKey = _this$props4.itemKey,
          itemKey = _this$props4$itemKey === void 0 ? defaultItemKey : _this$props4$itemKey,
          outerElementType = _this$props4.outerElementType,
          outerTagName = _this$props4.outerTagName,
          rowCount = _this$props4.rowCount,
          style = _this$props4.style,
          useIsScrolling = _this$props4.useIsScrolling,
          width = _this$props4.width;
      var isScrolling = this.state.isScrolling;

      var _this$_getHorizontalR = this._getHorizontalRangeToRender(),
          columnStartIndex = _this$_getHorizontalR[0],
          columnStopIndex = _this$_getHorizontalR[1];

      var _this$_getVerticalRan = this._getVerticalRangeToRender(),
          rowStartIndex = _this$_getVerticalRan[0],
          rowStopIndex = _this$_getVerticalRan[1];

      var items = [];

      if (columnCount > 0 && rowCount) {
        for (var _rowIndex = rowStartIndex; _rowIndex <= rowStopIndex; _rowIndex++) {
          for (var _columnIndex = columnStartIndex; _columnIndex <= columnStopIndex; _columnIndex++) {
            items.push((0,react.createElement)(children, {
              columnIndex: _columnIndex,
              data: itemData,
              isScrolling: useIsScrolling ? isScrolling : undefined,
              key: itemKey({
                columnIndex: _columnIndex,
                data: itemData,
                rowIndex: _rowIndex
              }),
              rowIndex: _rowIndex,
              style: this._getItemStyle(_rowIndex, _columnIndex)
            }));
          }
        }
      } // Read this value AFTER items have been created,
      // So their actual sizes (if variable) are taken into consideration.


      var estimatedTotalHeight = getEstimatedTotalHeight(this.props, this._instanceProps);
      var estimatedTotalWidth = getEstimatedTotalWidth(this.props, this._instanceProps);
      return (0,react.createElement)(outerElementType || outerTagName || 'div', {
        className: className,
        onScroll: this._onScroll,
        ref: this._outerRefSetter,
        style: (0,esm_extends/* default */.A)({
          position: 'relative',
          height: height,
          width: width,
          overflow: 'auto',
          WebkitOverflowScrolling: 'touch',
          willChange: 'transform',
          direction: direction
        }, style)
      }, (0,react.createElement)(innerElementType || innerTagName || 'div', {
        children: items,
        ref: innerRef,
        style: {
          height: estimatedTotalHeight,
          pointerEvents: isScrolling ? 'none' : undefined,
          width: estimatedTotalWidth
        }
      }));
    };

    _proto._callPropsCallbacks = function _callPropsCallbacks() {
      var _this$props5 = this.props,
          columnCount = _this$props5.columnCount,
          onItemsRendered = _this$props5.onItemsRendered,
          onScroll = _this$props5.onScroll,
          rowCount = _this$props5.rowCount;

      if (typeof onItemsRendered === 'function') {
        if (columnCount > 0 && rowCount > 0) {
          var _this$_getHorizontalR2 = this._getHorizontalRangeToRender(),
              _overscanColumnStartIndex = _this$_getHorizontalR2[0],
              _overscanColumnStopIndex = _this$_getHorizontalR2[1],
              _visibleColumnStartIndex = _this$_getHorizontalR2[2],
              _visibleColumnStopIndex = _this$_getHorizontalR2[3];

          var _this$_getVerticalRan2 = this._getVerticalRangeToRender(),
              _overscanRowStartIndex = _this$_getVerticalRan2[0],
              _overscanRowStopIndex = _this$_getVerticalRan2[1],
              _visibleRowStartIndex = _this$_getVerticalRan2[2],
              _visibleRowStopIndex = _this$_getVerticalRan2[3];

          this._callOnItemsRendered(_overscanColumnStartIndex, _overscanColumnStopIndex, _overscanRowStartIndex, _overscanRowStopIndex, _visibleColumnStartIndex, _visibleColumnStopIndex, _visibleRowStartIndex, _visibleRowStopIndex);
        }
      }

      if (typeof onScroll === 'function') {
        var _this$state3 = this.state,
            _horizontalScrollDirection = _this$state3.horizontalScrollDirection,
            _scrollLeft = _this$state3.scrollLeft,
            _scrollTop = _this$state3.scrollTop,
            _scrollUpdateWasRequested = _this$state3.scrollUpdateWasRequested,
            _verticalScrollDirection = _this$state3.verticalScrollDirection;

        this._callOnScroll(_scrollLeft, _scrollTop, _horizontalScrollDirection, _verticalScrollDirection, _scrollUpdateWasRequested);
      }
    } // Lazily create and cache item styles while scrolling,
    // So that pure component sCU will prevent re-renders.
    // We maintain this cache, and pass a style prop rather than index,
    // So that List can clear cached styles and force item re-render if necessary.
    ;

    _proto._getHorizontalRangeToRender = function _getHorizontalRangeToRender() {
      var _this$props6 = this.props,
          columnCount = _this$props6.columnCount,
          overscanColumnCount = _this$props6.overscanColumnCount,
          overscanColumnsCount = _this$props6.overscanColumnsCount,
          overscanCount = _this$props6.overscanCount,
          rowCount = _this$props6.rowCount;
      var _this$state4 = this.state,
          horizontalScrollDirection = _this$state4.horizontalScrollDirection,
          isScrolling = _this$state4.isScrolling,
          scrollLeft = _this$state4.scrollLeft;
      var overscanCountResolved = overscanColumnCount || overscanColumnsCount || overscanCount || 1;

      if (columnCount === 0 || rowCount === 0) {
        return [0, 0, 0, 0];
      }

      var startIndex = getColumnStartIndexForOffset(this.props, scrollLeft, this._instanceProps);
      var stopIndex = getColumnStopIndexForStartIndex(this.props, startIndex, scrollLeft, this._instanceProps); // Overscan by one item in each direction so that tab/focus works.
      // If there isn't at least one extra item, tab loops back around.

      var overscanBackward = !isScrolling || horizontalScrollDirection === 'backward' ? Math.max(1, overscanCountResolved) : 1;
      var overscanForward = !isScrolling || horizontalScrollDirection === 'forward' ? Math.max(1, overscanCountResolved) : 1;
      return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(columnCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
    };

    _proto._getVerticalRangeToRender = function _getVerticalRangeToRender() {
      var _this$props7 = this.props,
          columnCount = _this$props7.columnCount,
          overscanCount = _this$props7.overscanCount,
          overscanRowCount = _this$props7.overscanRowCount,
          overscanRowsCount = _this$props7.overscanRowsCount,
          rowCount = _this$props7.rowCount;
      var _this$state5 = this.state,
          isScrolling = _this$state5.isScrolling,
          verticalScrollDirection = _this$state5.verticalScrollDirection,
          scrollTop = _this$state5.scrollTop;
      var overscanCountResolved = overscanRowCount || overscanRowsCount || overscanCount || 1;

      if (columnCount === 0 || rowCount === 0) {
        return [0, 0, 0, 0];
      }

      var startIndex = getRowStartIndexForOffset(this.props, scrollTop, this._instanceProps);
      var stopIndex = getRowStopIndexForStartIndex(this.props, startIndex, scrollTop, this._instanceProps); // Overscan by one item in each direction so that tab/focus works.
      // If there isn't at least one extra item, tab loops back around.

      var overscanBackward = !isScrolling || verticalScrollDirection === 'backward' ? Math.max(1, overscanCountResolved) : 1;
      var overscanForward = !isScrolling || verticalScrollDirection === 'forward' ? Math.max(1, overscanCountResolved) : 1;
      return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(rowCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
    };

    return Grid;
  }(react.PureComponent), _class.defaultProps = {
    direction: 'ltr',
    itemData: undefined,
    useIsScrolling: false
  }, _class;
}

var validateSharedProps = function validateSharedProps(_ref5, _ref6) {
  var children = _ref5.children,
      direction = _ref5.direction,
      height = _ref5.height,
      innerTagName = _ref5.innerTagName,
      outerTagName = _ref5.outerTagName,
      overscanColumnsCount = _ref5.overscanColumnsCount,
      overscanCount = _ref5.overscanCount,
      overscanRowsCount = _ref5.overscanRowsCount,
      width = _ref5.width;
  var instance = _ref6.instance;

  if (false) {}
};

var DEFAULT_ESTIMATED_ITEM_SIZE = 50;

var getEstimatedTotalHeight = function getEstimatedTotalHeight(_ref, _ref2) {
  var rowCount = _ref.rowCount;
  var rowMetadataMap = _ref2.rowMetadataMap,
      estimatedRowHeight = _ref2.estimatedRowHeight,
      lastMeasuredRowIndex = _ref2.lastMeasuredRowIndex;
  var totalSizeOfMeasuredRows = 0; // Edge case check for when the number of items decreases while a scroll is in progress.
  // https://github.com/bvaughn/react-window/pull/138

  if (lastMeasuredRowIndex >= rowCount) {
    lastMeasuredRowIndex = rowCount - 1;
  }

  if (lastMeasuredRowIndex >= 0) {
    var itemMetadata = rowMetadataMap[lastMeasuredRowIndex];
    totalSizeOfMeasuredRows = itemMetadata.offset + itemMetadata.size;
  }

  var numUnmeasuredItems = rowCount - lastMeasuredRowIndex - 1;
  var totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedRowHeight;
  return totalSizeOfMeasuredRows + totalSizeOfUnmeasuredItems;
};

var getEstimatedTotalWidth = function getEstimatedTotalWidth(_ref3, _ref4) {
  var columnCount = _ref3.columnCount;
  var columnMetadataMap = _ref4.columnMetadataMap,
      estimatedColumnWidth = _ref4.estimatedColumnWidth,
      lastMeasuredColumnIndex = _ref4.lastMeasuredColumnIndex;
  var totalSizeOfMeasuredRows = 0; // Edge case check for when the number of items decreases while a scroll is in progress.
  // https://github.com/bvaughn/react-window/pull/138

  if (lastMeasuredColumnIndex >= columnCount) {
    lastMeasuredColumnIndex = columnCount - 1;
  }

  if (lastMeasuredColumnIndex >= 0) {
    var itemMetadata = columnMetadataMap[lastMeasuredColumnIndex];
    totalSizeOfMeasuredRows = itemMetadata.offset + itemMetadata.size;
  }

  var numUnmeasuredItems = columnCount - lastMeasuredColumnIndex - 1;
  var totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedColumnWidth;
  return totalSizeOfMeasuredRows + totalSizeOfUnmeasuredItems;
};

var getItemMetadata = function getItemMetadata(itemType, props, index, instanceProps) {
  var itemMetadataMap, itemSize, lastMeasuredIndex;

  if (itemType === 'column') {
    itemMetadataMap = instanceProps.columnMetadataMap;
    itemSize = props.columnWidth;
    lastMeasuredIndex = instanceProps.lastMeasuredColumnIndex;
  } else {
    itemMetadataMap = instanceProps.rowMetadataMap;
    itemSize = props.rowHeight;
    lastMeasuredIndex = instanceProps.lastMeasuredRowIndex;
  }

  if (index > lastMeasuredIndex) {
    var offset = 0;

    if (lastMeasuredIndex >= 0) {
      var itemMetadata = itemMetadataMap[lastMeasuredIndex];
      offset = itemMetadata.offset + itemMetadata.size;
    }

    for (var i = lastMeasuredIndex + 1; i <= index; i++) {
      var size = itemSize(i);
      itemMetadataMap[i] = {
        offset: offset,
        size: size
      };
      offset += size;
    }

    if (itemType === 'column') {
      instanceProps.lastMeasuredColumnIndex = index;
    } else {
      instanceProps.lastMeasuredRowIndex = index;
    }
  }

  return itemMetadataMap[index];
};

var findNearestItem = function findNearestItem(itemType, props, instanceProps, offset) {
  var itemMetadataMap, lastMeasuredIndex;

  if (itemType === 'column') {
    itemMetadataMap = instanceProps.columnMetadataMap;
    lastMeasuredIndex = instanceProps.lastMeasuredColumnIndex;
  } else {
    itemMetadataMap = instanceProps.rowMetadataMap;
    lastMeasuredIndex = instanceProps.lastMeasuredRowIndex;
  }

  var lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0;

  if (lastMeasuredItemOffset >= offset) {
    // If we've already measured items within this range just use a binary search as it's faster.
    return findNearestItemBinarySearch(itemType, props, instanceProps, lastMeasuredIndex, 0, offset);
  } else {
    // If we haven't yet measured this high, fallback to an exponential search with an inner binary search.
    // The exponential search avoids pre-computing sizes for the full set of items as a binary search would.
    // The overall complexity for this approach is O(log n).
    return findNearestItemExponentialSearch(itemType, props, instanceProps, Math.max(0, lastMeasuredIndex), offset);
  }
};

var findNearestItemBinarySearch = function findNearestItemBinarySearch(itemType, props, instanceProps, high, low, offset) {
  while (low <= high) {
    var middle = low + Math.floor((high - low) / 2);
    var currentOffset = getItemMetadata(itemType, props, middle, instanceProps).offset;

    if (currentOffset === offset) {
      return middle;
    } else if (currentOffset < offset) {
      low = middle + 1;
    } else if (currentOffset > offset) {
      high = middle - 1;
    }
  }

  if (low > 0) {
    return low - 1;
  } else {
    return 0;
  }
};

var findNearestItemExponentialSearch = function findNearestItemExponentialSearch(itemType, props, instanceProps, index, offset) {
  var itemCount = itemType === 'column' ? props.columnCount : props.rowCount;
  var interval = 1;

  while (index < itemCount && getItemMetadata(itemType, props, index, instanceProps).offset < offset) {
    index += interval;
    interval *= 2;
  }

  return findNearestItemBinarySearch(itemType, props, instanceProps, Math.min(index, itemCount - 1), Math.floor(index / 2), offset);
};

var getOffsetForIndexAndAlignment = function getOffsetForIndexAndAlignment(itemType, props, index, align, scrollOffset, instanceProps, scrollbarSize) {
  var size = itemType === 'column' ? props.width : props.height;
  var itemMetadata = getItemMetadata(itemType, props, index, instanceProps); // Get estimated total size after ItemMetadata is computed,
  // To ensure it reflects actual measurements instead of just estimates.

  var estimatedTotalSize = itemType === 'column' ? getEstimatedTotalWidth(props, instanceProps) : getEstimatedTotalHeight(props, instanceProps);
  var maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, itemMetadata.offset));
  var minOffset = Math.max(0, itemMetadata.offset - size + scrollbarSize + itemMetadata.size);

  if (align === 'smart') {
    if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
      align = 'auto';
    } else {
      align = 'center';
    }
  }

  switch (align) {
    case 'start':
      return maxOffset;

    case 'end':
      return minOffset;

    case 'center':
      return Math.round(minOffset + (maxOffset - minOffset) / 2);

    case 'auto':
    default:
      if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
        return scrollOffset;
      } else if (minOffset > maxOffset) {
        // Because we only take into account the scrollbar size when calculating minOffset
        // this value can be larger than maxOffset when at the end of the list
        return minOffset;
      } else if (scrollOffset < minOffset) {
        return minOffset;
      } else {
        return maxOffset;
      }

  }
};

var VariableSizeGrid = /*#__PURE__*/createGridComponent({
  getColumnOffset: function getColumnOffset(props, index, instanceProps) {
    return getItemMetadata('column', props, index, instanceProps).offset;
  },
  getColumnStartIndexForOffset: function getColumnStartIndexForOffset(props, scrollLeft, instanceProps) {
    return findNearestItem('column', props, instanceProps, scrollLeft);
  },
  getColumnStopIndexForStartIndex: function getColumnStopIndexForStartIndex(props, startIndex, scrollLeft, instanceProps) {
    var columnCount = props.columnCount,
        width = props.width;
    var itemMetadata = getItemMetadata('column', props, startIndex, instanceProps);
    var maxOffset = scrollLeft + width;
    var offset = itemMetadata.offset + itemMetadata.size;
    var stopIndex = startIndex;

    while (stopIndex < columnCount - 1 && offset < maxOffset) {
      stopIndex++;
      offset += getItemMetadata('column', props, stopIndex, instanceProps).size;
    }

    return stopIndex;
  },
  getColumnWidth: function getColumnWidth(props, index, instanceProps) {
    return instanceProps.columnMetadataMap[index].size;
  },
  getEstimatedTotalHeight: getEstimatedTotalHeight,
  getEstimatedTotalWidth: getEstimatedTotalWidth,
  getOffsetForColumnAndAlignment: function getOffsetForColumnAndAlignment(props, index, align, scrollOffset, instanceProps, scrollbarSize) {
    return getOffsetForIndexAndAlignment('column', props, index, align, scrollOffset, instanceProps, scrollbarSize);
  },
  getOffsetForRowAndAlignment: function getOffsetForRowAndAlignment(props, index, align, scrollOffset, instanceProps, scrollbarSize) {
    return getOffsetForIndexAndAlignment('row', props, index, align, scrollOffset, instanceProps, scrollbarSize);
  },
  getRowOffset: function getRowOffset(props, index, instanceProps) {
    return getItemMetadata('row', props, index, instanceProps).offset;
  },
  getRowHeight: function getRowHeight(props, index, instanceProps) {
    return instanceProps.rowMetadataMap[index].size;
  },
  getRowStartIndexForOffset: function getRowStartIndexForOffset(props, scrollTop, instanceProps) {
    return findNearestItem('row', props, instanceProps, scrollTop);
  },
  getRowStopIndexForStartIndex: function getRowStopIndexForStartIndex(props, startIndex, scrollTop, instanceProps) {
    var rowCount = props.rowCount,
        height = props.height;
    var itemMetadata = getItemMetadata('row', props, startIndex, instanceProps);
    var maxOffset = scrollTop + height;
    var offset = itemMetadata.offset + itemMetadata.size;
    var stopIndex = startIndex;

    while (stopIndex < rowCount - 1 && offset < maxOffset) {
      stopIndex++;
      offset += getItemMetadata('row', props, stopIndex, instanceProps).size;
    }

    return stopIndex;
  },
  initInstanceProps: function initInstanceProps(props, instance) {
    var _ref5 = props,
        estimatedColumnWidth = _ref5.estimatedColumnWidth,
        estimatedRowHeight = _ref5.estimatedRowHeight;
    var instanceProps = {
      columnMetadataMap: {},
      estimatedColumnWidth: estimatedColumnWidth || DEFAULT_ESTIMATED_ITEM_SIZE,
      estimatedRowHeight: estimatedRowHeight || DEFAULT_ESTIMATED_ITEM_SIZE,
      lastMeasuredColumnIndex: -1,
      lastMeasuredRowIndex: -1,
      rowMetadataMap: {}
    };

    instance.resetAfterColumnIndex = function (columnIndex, shouldForceUpdate) {
      if (shouldForceUpdate === void 0) {
        shouldForceUpdate = true;
      }

      instance.resetAfterIndices({
        columnIndex: columnIndex,
        shouldForceUpdate: shouldForceUpdate
      });
    };

    instance.resetAfterRowIndex = function (rowIndex, shouldForceUpdate) {
      if (shouldForceUpdate === void 0) {
        shouldForceUpdate = true;
      }

      instance.resetAfterIndices({
        rowIndex: rowIndex,
        shouldForceUpdate: shouldForceUpdate
      });
    };

    instance.resetAfterIndices = function (_ref6) {
      var columnIndex = _ref6.columnIndex,
          rowIndex = _ref6.rowIndex,
          _ref6$shouldForceUpda = _ref6.shouldForceUpdate,
          shouldForceUpdate = _ref6$shouldForceUpda === void 0 ? true : _ref6$shouldForceUpda;

      if (typeof columnIndex === 'number') {
        instanceProps.lastMeasuredColumnIndex = Math.min(instanceProps.lastMeasuredColumnIndex, columnIndex - 1);
      }

      if (typeof rowIndex === 'number') {
        instanceProps.lastMeasuredRowIndex = Math.min(instanceProps.lastMeasuredRowIndex, rowIndex - 1);
      } // We could potentially optimize further by only evicting styles after this index,
      // But since styles are only cached while scrolling is in progress-
      // It seems an unnecessary optimization.
      // It's unlikely that resetAfterIndex() will be called while a user is scrolling.


      instance._getItemStyleCache(-1);

      if (shouldForceUpdate) {
        instance.forceUpdate();
      }
    };

    return instanceProps;
  },
  shouldResetStyleCacheOnItemSizeChange: false,
  validateProps: function validateProps(_ref7) {
    var columnWidth = _ref7.columnWidth,
        rowHeight = _ref7.rowHeight;

    if (false) {}
  }
});

var IS_SCROLLING_DEBOUNCE_INTERVAL$1 = 150;

var defaultItemKey$1 = function defaultItemKey(index, data) {
  return index;
}; // In DEV mode, this Set helps us only log a warning once per component instance.
// This avoids spamming the console every time a render happens.


var devWarningsDirection = null;
var devWarningsTagName$1 = null;

if (false) {}

function createListComponent(_ref) {
  var _class;

  var getItemOffset = _ref.getItemOffset,
      getEstimatedTotalSize = _ref.getEstimatedTotalSize,
      getItemSize = _ref.getItemSize,
      getOffsetForIndexAndAlignment = _ref.getOffsetForIndexAndAlignment,
      getStartIndexForOffset = _ref.getStartIndexForOffset,
      getStopIndexForStartIndex = _ref.getStopIndexForStartIndex,
      initInstanceProps = _ref.initInstanceProps,
      shouldResetStyleCacheOnItemSizeChange = _ref.shouldResetStyleCacheOnItemSizeChange,
      validateProps = _ref.validateProps;
  return _class = /*#__PURE__*/function (_PureComponent) {
    _inheritsLoose(List, _PureComponent);

    // Always use explicit constructor for React components.
    // It produces less code after transpilation. (#26)
    // eslint-disable-next-line no-useless-constructor
    function List(props) {
      var _this;

      _this = _PureComponent.call(this, props) || this;
      _this._instanceProps = initInstanceProps(_this.props, _assertThisInitialized(_this));
      _this._outerRef = void 0;
      _this._resetIsScrollingTimeoutId = null;
      _this.state = {
        instance: _assertThisInitialized(_this),
        isScrolling: false,
        scrollDirection: 'forward',
        scrollOffset: typeof _this.props.initialScrollOffset === 'number' ? _this.props.initialScrollOffset : 0,
        scrollUpdateWasRequested: false
      };
      _this._callOnItemsRendered = void 0;
      _this._callOnItemsRendered = (0,memoize_one_esm["default"])(function (overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) {
        return _this.props.onItemsRendered({
          overscanStartIndex: overscanStartIndex,
          overscanStopIndex: overscanStopIndex,
          visibleStartIndex: visibleStartIndex,
          visibleStopIndex: visibleStopIndex
        });
      });
      _this._callOnScroll = void 0;
      _this._callOnScroll = (0,memoize_one_esm["default"])(function (scrollDirection, scrollOffset, scrollUpdateWasRequested) {
        return _this.props.onScroll({
          scrollDirection: scrollDirection,
          scrollOffset: scrollOffset,
          scrollUpdateWasRequested: scrollUpdateWasRequested
        });
      });
      _this._getItemStyle = void 0;

      _this._getItemStyle = function (index) {
        var _this$props = _this.props,
            direction = _this$props.direction,
            itemSize = _this$props.itemSize,
            layout = _this$props.layout;

        var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && itemSize, shouldResetStyleCacheOnItemSizeChange && layout, shouldResetStyleCacheOnItemSizeChange && direction);

        var style;

        if (itemStyleCache.hasOwnProperty(index)) {
          style = itemStyleCache[index];
        } else {
          var _offset = getItemOffset(_this.props, index, _this._instanceProps);

          var size = getItemSize(_this.props, index, _this._instanceProps); // TODO Deprecate direction "horizontal"

          var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
          var isRtl = direction === 'rtl';
          var offsetHorizontal = isHorizontal ? _offset : 0;
          itemStyleCache[index] = style = {
            position: 'absolute',
            left: isRtl ? undefined : offsetHorizontal,
            right: isRtl ? offsetHorizontal : undefined,
            top: !isHorizontal ? _offset : 0,
            height: !isHorizontal ? size : '100%',
            width: isHorizontal ? size : '100%'
          };
        }

        return style;
      };

      _this._getItemStyleCache = void 0;
      _this._getItemStyleCache = (0,memoize_one_esm["default"])(function (_, __, ___) {
        return {};
      });

      _this._onScrollHorizontal = function (event) {
        var _event$currentTarget = event.currentTarget,
            clientWidth = _event$currentTarget.clientWidth,
            scrollLeft = _event$currentTarget.scrollLeft,
            scrollWidth = _event$currentTarget.scrollWidth;

        _this.setState(function (prevState) {
          if (prevState.scrollOffset === scrollLeft) {
            // Scroll position may have been updated by cDM/cDU,
            // In which case we don't need to trigger another render,
            // And we don't want to update state.isScrolling.
            return null;
          }

          var direction = _this.props.direction;
          var scrollOffset = scrollLeft;

          if (direction === 'rtl') {
            // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
            // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
            // It's also easier for this component if we convert offsets to the same format as they would be in for ltr.
            // So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.
            switch (getRTLOffsetType()) {
              case 'negative':
                scrollOffset = -scrollLeft;
                break;

              case 'positive-descending':
                scrollOffset = scrollWidth - clientWidth - scrollLeft;
                break;
            }
          } // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.


          scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
          return {
            isScrolling: true,
            scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',
            scrollOffset: scrollOffset,
            scrollUpdateWasRequested: false
          };
        }, _this._resetIsScrollingDebounced);
      };

      _this._onScrollVertical = function (event) {
        var _event$currentTarget2 = event.currentTarget,
            clientHeight = _event$currentTarget2.clientHeight,
            scrollHeight = _event$currentTarget2.scrollHeight,
            scrollTop = _event$currentTarget2.scrollTop;

        _this.setState(function (prevState) {
          if (prevState.scrollOffset === scrollTop) {
            // Scroll position may have been updated by cDM/cDU,
            // In which case we don't need to trigger another render,
            // And we don't want to update state.isScrolling.
            return null;
          } // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.


          var scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
          return {
            isScrolling: true,
            scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',
            scrollOffset: scrollOffset,
            scrollUpdateWasRequested: false
          };
        }, _this._resetIsScrollingDebounced);
      };

      _this._outerRefSetter = function (ref) {
        var outerRef = _this.props.outerRef;
        _this._outerRef = ref;

        if (typeof outerRef === 'function') {
          outerRef(ref);
        } else if (outerRef != null && typeof outerRef === 'object' && outerRef.hasOwnProperty('current')) {
          outerRef.current = ref;
        }
      };

      _this._resetIsScrollingDebounced = function () {
        if (_this._resetIsScrollingTimeoutId !== null) {
          cancelTimeout(_this._resetIsScrollingTimeoutId);
        }

        _this._resetIsScrollingTimeoutId = index_esm_requestTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL$1);
      };

      _this._resetIsScrolling = function () {
        _this._resetIsScrollingTimeoutId = null;

        _this.setState({
          isScrolling: false
        }, function () {
          // Clear style cache after state update has been committed.
          // This way we don't break pure sCU for items that don't use isScrolling param.
          _this._getItemStyleCache(-1, null);
        });
      };

      return _this;
    }

    List.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
      validateSharedProps$1(nextProps, prevState);
      validateProps(nextProps);
      return null;
    };

    var _proto = List.prototype;

    _proto.scrollTo = function scrollTo(scrollOffset) {
      scrollOffset = Math.max(0, scrollOffset);
      this.setState(function (prevState) {
        if (prevState.scrollOffset === scrollOffset) {
          return null;
        }

        return {
          scrollDirection: prevState.scrollOffset < scrollOffset ? 'forward' : 'backward',
          scrollOffset: scrollOffset,
          scrollUpdateWasRequested: true
        };
      }, this._resetIsScrollingDebounced);
    };

    _proto.scrollToItem = function scrollToItem(index, align) {
      if (align === void 0) {
        align = 'auto';
      }

      var _this$props2 = this.props,
          itemCount = _this$props2.itemCount,
          layout = _this$props2.layout;
      var scrollOffset = this.state.scrollOffset;
      index = Math.max(0, Math.min(index, itemCount - 1)); // The scrollbar size should be considered when scrolling an item into view, to ensure it's fully visible.
      // But we only need to account for its size when it's actually visible.
      // This is an edge case for lists; normally they only scroll in the dominant direction.

      var scrollbarSize = 0;

      if (this._outerRef) {
        var outerRef = this._outerRef;

        if (layout === 'vertical') {
          scrollbarSize = outerRef.scrollWidth > outerRef.clientWidth ? index_esm_getScrollbarSize() : 0;
        } else {
          scrollbarSize = outerRef.scrollHeight > outerRef.clientHeight ? index_esm_getScrollbarSize() : 0;
        }
      }

      this.scrollTo(getOffsetForIndexAndAlignment(this.props, index, align, scrollOffset, this._instanceProps, scrollbarSize));
    };

    _proto.componentDidMount = function componentDidMount() {
      var _this$props3 = this.props,
          direction = _this$props3.direction,
          initialScrollOffset = _this$props3.initialScrollOffset,
          layout = _this$props3.layout;

      if (typeof initialScrollOffset === 'number' && this._outerRef != null) {
        var outerRef = this._outerRef; // TODO Deprecate direction "horizontal"

        if (direction === 'horizontal' || layout === 'horizontal') {
          outerRef.scrollLeft = initialScrollOffset;
        } else {
          outerRef.scrollTop = initialScrollOffset;
        }
      }

      this._callPropsCallbacks();
    };

    _proto.componentDidUpdate = function componentDidUpdate() {
      var _this$props4 = this.props,
          direction = _this$props4.direction,
          layout = _this$props4.layout;
      var _this$state = this.state,
          scrollOffset = _this$state.scrollOffset,
          scrollUpdateWasRequested = _this$state.scrollUpdateWasRequested;

      if (scrollUpdateWasRequested && this._outerRef != null) {
        var outerRef = this._outerRef; // TODO Deprecate direction "horizontal"

        if (direction === 'horizontal' || layout === 'horizontal') {
          if (direction === 'rtl') {
            // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
            // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
            // So we need to determine which browser behavior we're dealing with, and mimic it.
            switch (getRTLOffsetType()) {
              case 'negative':
                outerRef.scrollLeft = -scrollOffset;
                break;

              case 'positive-ascending':
                outerRef.scrollLeft = scrollOffset;
                break;

              default:
                var clientWidth = outerRef.clientWidth,
                    scrollWidth = outerRef.scrollWidth;
                outerRef.scrollLeft = scrollWidth - clientWidth - scrollOffset;
                break;
            }
          } else {
            outerRef.scrollLeft = scrollOffset;
          }
        } else {
          outerRef.scrollTop = scrollOffset;
        }
      }

      this._callPropsCallbacks();
    };

    _proto.componentWillUnmount = function componentWillUnmount() {
      if (this._resetIsScrollingTimeoutId !== null) {
        cancelTimeout(this._resetIsScrollingTimeoutId);
      }
    };

    _proto.render = function render() {
      var _this$props5 = this.props,
          children = _this$props5.children,
          className = _this$props5.className,
          direction = _this$props5.direction,
          height = _this$props5.height,
          innerRef = _this$props5.innerRef,
          innerElementType = _this$props5.innerElementType,
          innerTagName = _this$props5.innerTagName,
          itemCount = _this$props5.itemCount,
          itemData = _this$props5.itemData,
          _this$props5$itemKey = _this$props5.itemKey,
          itemKey = _this$props5$itemKey === void 0 ? defaultItemKey$1 : _this$props5$itemKey,
          layout = _this$props5.layout,
          outerElementType = _this$props5.outerElementType,
          outerTagName = _this$props5.outerTagName,
          style = _this$props5.style,
          useIsScrolling = _this$props5.useIsScrolling,
          width = _this$props5.width;
      var isScrolling = this.state.isScrolling; // TODO Deprecate direction "horizontal"

      var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
      var onScroll = isHorizontal ? this._onScrollHorizontal : this._onScrollVertical;

      var _this$_getRangeToRend = this._getRangeToRender(),
          startIndex = _this$_getRangeToRend[0],
          stopIndex = _this$_getRangeToRend[1];

      var items = [];

      if (itemCount > 0) {
        for (var _index = startIndex; _index <= stopIndex; _index++) {
          items.push((0,react.createElement)(children, {
            data: itemData,
            key: itemKey(_index, itemData),
            index: _index,
            isScrolling: useIsScrolling ? isScrolling : undefined,
            style: this._getItemStyle(_index)
          }));
        }
      } // Read this value AFTER items have been created,
      // So their actual sizes (if variable) are taken into consideration.


      var estimatedTotalSize = getEstimatedTotalSize(this.props, this._instanceProps);
      return (0,react.createElement)(outerElementType || outerTagName || 'div', {
        className: className,
        onScroll: onScroll,
        ref: this._outerRefSetter,
        style: (0,esm_extends/* default */.A)({
          position: 'relative',
          height: height,
          width: width,
          overflow: 'auto',
          WebkitOverflowScrolling: 'touch',
          willChange: 'transform',
          direction: direction
        }, style)
      }, (0,react.createElement)(innerElementType || innerTagName || 'div', {
        children: items,
        ref: innerRef,
        style: {
          height: isHorizontal ? '100%' : estimatedTotalSize,
          pointerEvents: isScrolling ? 'none' : undefined,
          width: isHorizontal ? estimatedTotalSize : '100%'
        }
      }));
    };

    _proto._callPropsCallbacks = function _callPropsCallbacks() {
      if (typeof this.props.onItemsRendered === 'function') {
        var itemCount = this.props.itemCount;

        if (itemCount > 0) {
          var _this$_getRangeToRend2 = this._getRangeToRender(),
              _overscanStartIndex = _this$_getRangeToRend2[0],
              _overscanStopIndex = _this$_getRangeToRend2[1],
              _visibleStartIndex = _this$_getRangeToRend2[2],
              _visibleStopIndex = _this$_getRangeToRend2[3];

          this._callOnItemsRendered(_overscanStartIndex, _overscanStopIndex, _visibleStartIndex, _visibleStopIndex);
        }
      }

      if (typeof this.props.onScroll === 'function') {
        var _this$state2 = this.state,
            _scrollDirection = _this$state2.scrollDirection,
            _scrollOffset = _this$state2.scrollOffset,
            _scrollUpdateWasRequested = _this$state2.scrollUpdateWasRequested;

        this._callOnScroll(_scrollDirection, _scrollOffset, _scrollUpdateWasRequested);
      }
    } // Lazily create and cache item styles while scrolling,
    // So that pure component sCU will prevent re-renders.
    // We maintain this cache, and pass a style prop rather than index,
    // So that List can clear cached styles and force item re-render if necessary.
    ;

    _proto._getRangeToRender = function _getRangeToRender() {
      var _this$props6 = this.props,
          itemCount = _this$props6.itemCount,
          overscanCount = _this$props6.overscanCount;
      var _this$state3 = this.state,
          isScrolling = _this$state3.isScrolling,
          scrollDirection = _this$state3.scrollDirection,
          scrollOffset = _this$state3.scrollOffset;

      if (itemCount === 0) {
        return [0, 0, 0, 0];
      }

      var startIndex = getStartIndexForOffset(this.props, scrollOffset, this._instanceProps);
      var stopIndex = getStopIndexForStartIndex(this.props, startIndex, scrollOffset, this._instanceProps); // Overscan by one item in each direction so that tab/focus works.
      // If there isn't at least one extra item, tab loops back around.

      var overscanBackward = !isScrolling || scrollDirection === 'backward' ? Math.max(1, overscanCount) : 1;
      var overscanForward = !isScrolling || scrollDirection === 'forward' ? Math.max(1, overscanCount) : 1;
      return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(itemCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
    };

    return List;
  }(react.PureComponent), _class.defaultProps = {
    direction: 'ltr',
    itemData: undefined,
    layout: 'vertical',
    overscanCount: 2,
    useIsScrolling: false
  }, _class;
} // NOTE: I considered further wrapping individual items with a pure ListItem component.
// This would avoid ever calling the render function for the same index more than once,
// But it would also add the overhead of a lot of components/fibers.
// I assume people already do this (render function returning a class component),
// So my doing it would just unnecessarily double the wrappers.

var validateSharedProps$1 = function validateSharedProps(_ref2, _ref3) {
  var children = _ref2.children,
      direction = _ref2.direction,
      height = _ref2.height,
      layout = _ref2.layout,
      innerTagName = _ref2.innerTagName,
      outerTagName = _ref2.outerTagName,
      width = _ref2.width;
  var instance = _ref3.instance;

  if (false) { var isHorizontal; }
};

var DEFAULT_ESTIMATED_ITEM_SIZE$1 = 50;

var getItemMetadata$1 = function getItemMetadata(props, index, instanceProps) {
  var _ref = props,
      itemSize = _ref.itemSize;
  var itemMetadataMap = instanceProps.itemMetadataMap,
      lastMeasuredIndex = instanceProps.lastMeasuredIndex;

  if (index > lastMeasuredIndex) {
    var offset = 0;

    if (lastMeasuredIndex >= 0) {
      var itemMetadata = itemMetadataMap[lastMeasuredIndex];
      offset = itemMetadata.offset + itemMetadata.size;
    }

    for (var i = lastMeasuredIndex + 1; i <= index; i++) {
      var size = itemSize(i);
      itemMetadataMap[i] = {
        offset: offset,
        size: size
      };
      offset += size;
    }

    instanceProps.lastMeasuredIndex = index;
  }

  return itemMetadataMap[index];
};

var findNearestItem$1 = function findNearestItem(props, instanceProps, offset) {
  var itemMetadataMap = instanceProps.itemMetadataMap,
      lastMeasuredIndex = instanceProps.lastMeasuredIndex;
  var lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0;

  if (lastMeasuredItemOffset >= offset) {
    // If we've already measured items within this range just use a binary search as it's faster.
    return findNearestItemBinarySearch$1(props, instanceProps, lastMeasuredIndex, 0, offset);
  } else {
    // If we haven't yet measured this high, fallback to an exponential search with an inner binary search.
    // The exponential search avoids pre-computing sizes for the full set of items as a binary search would.
    // The overall complexity for this approach is O(log n).
    return findNearestItemExponentialSearch$1(props, instanceProps, Math.max(0, lastMeasuredIndex), offset);
  }
};

var findNearestItemBinarySearch$1 = function findNearestItemBinarySearch(props, instanceProps, high, low, offset) {
  while (low <= high) {
    var middle = low + Math.floor((high - low) / 2);
    var currentOffset = getItemMetadata$1(props, middle, instanceProps).offset;

    if (currentOffset === offset) {
      return middle;
    } else if (currentOffset < offset) {
      low = middle + 1;
    } else if (currentOffset > offset) {
      high = middle - 1;
    }
  }

  if (low > 0) {
    return low - 1;
  } else {
    return 0;
  }
};

var findNearestItemExponentialSearch$1 = function findNearestItemExponentialSearch(props, instanceProps, index, offset) {
  var itemCount = props.itemCount;
  var interval = 1;

  while (index < itemCount && getItemMetadata$1(props, index, instanceProps).offset < offset) {
    index += interval;
    interval *= 2;
  }

  return findNearestItemBinarySearch$1(props, instanceProps, Math.min(index, itemCount - 1), Math.floor(index / 2), offset);
};

var getEstimatedTotalSize = function getEstimatedTotalSize(_ref2, _ref3) {
  var itemCount = _ref2.itemCount;
  var itemMetadataMap = _ref3.itemMetadataMap,
      estimatedItemSize = _ref3.estimatedItemSize,
      lastMeasuredIndex = _ref3.lastMeasuredIndex;
  var totalSizeOfMeasuredItems = 0; // Edge case check for when the number of items decreases while a scroll is in progress.
  // https://github.com/bvaughn/react-window/pull/138

  if (lastMeasuredIndex >= itemCount) {
    lastMeasuredIndex = itemCount - 1;
  }

  if (lastMeasuredIndex >= 0) {
    var itemMetadata = itemMetadataMap[lastMeasuredIndex];
    totalSizeOfMeasuredItems = itemMetadata.offset + itemMetadata.size;
  }

  var numUnmeasuredItems = itemCount - lastMeasuredIndex - 1;
  var totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize;
  return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
};

var VariableSizeList = /*#__PURE__*/createListComponent({
  getItemOffset: function getItemOffset(props, index, instanceProps) {
    return getItemMetadata$1(props, index, instanceProps).offset;
  },
  getItemSize: function getItemSize(props, index, instanceProps) {
    return instanceProps.itemMetadataMap[index].size;
  },
  getEstimatedTotalSize: getEstimatedTotalSize,
  getOffsetForIndexAndAlignment: function getOffsetForIndexAndAlignment(props, index, align, scrollOffset, instanceProps, scrollbarSize) {
    var direction = props.direction,
        height = props.height,
        layout = props.layout,
        width = props.width; // TODO Deprecate direction "horizontal"

    var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
    var size = isHorizontal ? width : height;
    var itemMetadata = getItemMetadata$1(props, index, instanceProps); // Get estimated total size after ItemMetadata is computed,
    // To ensure it reflects actual measurements instead of just estimates.

    var estimatedTotalSize = getEstimatedTotalSize(props, instanceProps);
    var maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, itemMetadata.offset));
    var minOffset = Math.max(0, itemMetadata.offset - size + itemMetadata.size + scrollbarSize);

    if (align === 'smart') {
      if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
        align = 'auto';
      } else {
        align = 'center';
      }
    }

    switch (align) {
      case 'start':
        return maxOffset;

      case 'end':
        return minOffset;

      case 'center':
        return Math.round(minOffset + (maxOffset - minOffset) / 2);

      case 'auto':
      default:
        if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
          return scrollOffset;
        } else if (scrollOffset < minOffset) {
          return minOffset;
        } else {
          return maxOffset;
        }

    }
  },
  getStartIndexForOffset: function getStartIndexForOffset(props, offset, instanceProps) {
    return findNearestItem$1(props, instanceProps, offset);
  },
  getStopIndexForStartIndex: function getStopIndexForStartIndex(props, startIndex, scrollOffset, instanceProps) {
    var direction = props.direction,
        height = props.height,
        itemCount = props.itemCount,
        layout = props.layout,
        width = props.width; // TODO Deprecate direction "horizontal"

    var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
    var size = isHorizontal ? width : height;
    var itemMetadata = getItemMetadata$1(props, startIndex, instanceProps);
    var maxOffset = scrollOffset + size;
    var offset = itemMetadata.offset + itemMetadata.size;
    var stopIndex = startIndex;

    while (stopIndex < itemCount - 1 && offset < maxOffset) {
      stopIndex++;
      offset += getItemMetadata$1(props, stopIndex, instanceProps).size;
    }

    return stopIndex;
  },
  initInstanceProps: function initInstanceProps(props, instance) {
    var _ref4 = props,
        estimatedItemSize = _ref4.estimatedItemSize;
    var instanceProps = {
      itemMetadataMap: {},
      estimatedItemSize: estimatedItemSize || DEFAULT_ESTIMATED_ITEM_SIZE$1,
      lastMeasuredIndex: -1
    };

    instance.resetAfterIndex = function (index, shouldForceUpdate) {
      if (shouldForceUpdate === void 0) {
        shouldForceUpdate = true;
      }

      instanceProps.lastMeasuredIndex = Math.min(instanceProps.lastMeasuredIndex, index - 1); // We could potentially optimize further by only evicting styles after this index,
      // But since styles are only cached while scrolling is in progress-
      // It seems an unnecessary optimization.
      // It's unlikely that resetAfterIndex() will be called while a user is scrolling.

      instance._getItemStyleCache(-1);

      if (shouldForceUpdate) {
        instance.forceUpdate();
      }
    };

    return instanceProps;
  },
  shouldResetStyleCacheOnItemSizeChange: false,
  validateProps: function validateProps(_ref5) {
    var itemSize = _ref5.itemSize;

    if (false) {}
  }
});

var FixedSizeGrid = /*#__PURE__*/createGridComponent({
  getColumnOffset: function getColumnOffset(_ref, index) {
    var columnWidth = _ref.columnWidth;
    return index * columnWidth;
  },
  getColumnWidth: function getColumnWidth(_ref2, index) {
    var columnWidth = _ref2.columnWidth;
    return columnWidth;
  },
  getRowOffset: function getRowOffset(_ref3, index) {
    var rowHeight = _ref3.rowHeight;
    return index * rowHeight;
  },
  getRowHeight: function getRowHeight(_ref4, index) {
    var rowHeight = _ref4.rowHeight;
    return rowHeight;
  },
  getEstimatedTotalHeight: function getEstimatedTotalHeight(_ref5) {
    var rowCount = _ref5.rowCount,
        rowHeight = _ref5.rowHeight;
    return rowHeight * rowCount;
  },
  getEstimatedTotalWidth: function getEstimatedTotalWidth(_ref6) {
    var columnCount = _ref6.columnCount,
        columnWidth = _ref6.columnWidth;
    return columnWidth * columnCount;
  },
  getOffsetForColumnAndAlignment: function getOffsetForColumnAndAlignment(_ref7, columnIndex, align, scrollLeft, instanceProps, scrollbarSize) {
    var columnCount = _ref7.columnCount,
        columnWidth = _ref7.columnWidth,
        width = _ref7.width;
    var lastColumnOffset = Math.max(0, columnCount * columnWidth - width);
    var maxOffset = Math.min(lastColumnOffset, columnIndex * columnWidth);
    var minOffset = Math.max(0, columnIndex * columnWidth - width + scrollbarSize + columnWidth);

    if (align === 'smart') {
      if (scrollLeft >= minOffset - width && scrollLeft <= maxOffset + width) {
        align = 'auto';
      } else {
        align = 'center';
      }
    }

    switch (align) {
      case 'start':
        return maxOffset;

      case 'end':
        return minOffset;

      case 'center':
        // "Centered" offset is usually the average of the min and max.
        // But near the edges of the list, this doesn't hold true.
        var middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);

        if (middleOffset < Math.ceil(width / 2)) {
          return 0; // near the beginning
        } else if (middleOffset > lastColumnOffset + Math.floor(width / 2)) {
          return lastColumnOffset; // near the end
        } else {
          return middleOffset;
        }

      case 'auto':
      default:
        if (scrollLeft >= minOffset && scrollLeft <= maxOffset) {
          return scrollLeft;
        } else if (minOffset > maxOffset) {
          // Because we only take into account the scrollbar size when calculating minOffset
          // this value can be larger than maxOffset when at the end of the list
          return minOffset;
        } else if (scrollLeft < minOffset) {
          return minOffset;
        } else {
          return maxOffset;
        }

    }
  },
  getOffsetForRowAndAlignment: function getOffsetForRowAndAlignment(_ref8, rowIndex, align, scrollTop, instanceProps, scrollbarSize) {
    var rowHeight = _ref8.rowHeight,
        height = _ref8.height,
        rowCount = _ref8.rowCount;
    var lastRowOffset = Math.max(0, rowCount * rowHeight - height);
    var maxOffset = Math.min(lastRowOffset, rowIndex * rowHeight);
    var minOffset = Math.max(0, rowIndex * rowHeight - height + scrollbarSize + rowHeight);

    if (align === 'smart') {
      if (scrollTop >= minOffset - height && scrollTop <= maxOffset + height) {
        align = 'auto';
      } else {
        align = 'center';
      }
    }

    switch (align) {
      case 'start':
        return maxOffset;

      case 'end':
        return minOffset;

      case 'center':
        // "Centered" offset is usually the average of the min and max.
        // But near the edges of the list, this doesn't hold true.
        var middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);

        if (middleOffset < Math.ceil(height / 2)) {
          return 0; // near the beginning
        } else if (middleOffset > lastRowOffset + Math.floor(height / 2)) {
          return lastRowOffset; // near the end
        } else {
          return middleOffset;
        }

      case 'auto':
      default:
        if (scrollTop >= minOffset && scrollTop <= maxOffset) {
          return scrollTop;
        } else if (minOffset > maxOffset) {
          // Because we only take into account the scrollbar size when calculating minOffset
          // this value can be larger than maxOffset when at the end of the list
          return minOffset;
        } else if (scrollTop < minOffset) {
          return minOffset;
        } else {
          return maxOffset;
        }

    }
  },
  getColumnStartIndexForOffset: function getColumnStartIndexForOffset(_ref9, scrollLeft) {
    var columnWidth = _ref9.columnWidth,
        columnCount = _ref9.columnCount;
    return Math.max(0, Math.min(columnCount - 1, Math.floor(scrollLeft / columnWidth)));
  },
  getColumnStopIndexForStartIndex: function getColumnStopIndexForStartIndex(_ref10, startIndex, scrollLeft) {
    var columnWidth = _ref10.columnWidth,
        columnCount = _ref10.columnCount,
        width = _ref10.width;
    var left = startIndex * columnWidth;
    var numVisibleColumns = Math.ceil((width + scrollLeft - left) / columnWidth);
    return Math.max(0, Math.min(columnCount - 1, startIndex + numVisibleColumns - 1 // -1 is because stop index is inclusive
    ));
  },
  getRowStartIndexForOffset: function getRowStartIndexForOffset(_ref11, scrollTop) {
    var rowHeight = _ref11.rowHeight,
        rowCount = _ref11.rowCount;
    return Math.max(0, Math.min(rowCount - 1, Math.floor(scrollTop / rowHeight)));
  },
  getRowStopIndexForStartIndex: function getRowStopIndexForStartIndex(_ref12, startIndex, scrollTop) {
    var rowHeight = _ref12.rowHeight,
        rowCount = _ref12.rowCount,
        height = _ref12.height;
    var top = startIndex * rowHeight;
    var numVisibleRows = Math.ceil((height + scrollTop - top) / rowHeight);
    return Math.max(0, Math.min(rowCount - 1, startIndex + numVisibleRows - 1 // -1 is because stop index is inclusive
    ));
  },
  initInstanceProps: function initInstanceProps(props) {// Noop
  },
  shouldResetStyleCacheOnItemSizeChange: true,
  validateProps: function validateProps(_ref13) {
    var columnWidth = _ref13.columnWidth,
        rowHeight = _ref13.rowHeight;

    if (false) {}
  }
});

var FixedSizeList = /*#__PURE__*/createListComponent({
  getItemOffset: function getItemOffset(_ref, index) {
    var itemSize = _ref.itemSize;
    return index * itemSize;
  },
  getItemSize: function getItemSize(_ref2, index) {
    var itemSize = _ref2.itemSize;
    return itemSize;
  },
  getEstimatedTotalSize: function getEstimatedTotalSize(_ref3) {
    var itemCount = _ref3.itemCount,
        itemSize = _ref3.itemSize;
    return itemSize * itemCount;
  },
  getOffsetForIndexAndAlignment: function getOffsetForIndexAndAlignment(_ref4, index, align, scrollOffset, instanceProps, scrollbarSize) {
    var direction = _ref4.direction,
        height = _ref4.height,
        itemCount = _ref4.itemCount,
        itemSize = _ref4.itemSize,
        layout = _ref4.layout,
        width = _ref4.width;
    // TODO Deprecate direction "horizontal"
    var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
    var size = isHorizontal ? width : height;
    var lastItemOffset = Math.max(0, itemCount * itemSize - size);
    var maxOffset = Math.min(lastItemOffset, index * itemSize);
    var minOffset = Math.max(0, index * itemSize - size + itemSize + scrollbarSize);

    if (align === 'smart') {
      if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
        align = 'auto';
      } else {
        align = 'center';
      }
    }

    switch (align) {
      case 'start':
        return maxOffset;

      case 'end':
        return minOffset;

      case 'center':
        {
          // "Centered" offset is usually the average of the min and max.
          // But near the edges of the list, this doesn't hold true.
          var middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);

          if (middleOffset < Math.ceil(size / 2)) {
            return 0; // near the beginning
          } else if (middleOffset > lastItemOffset + Math.floor(size / 2)) {
            return lastItemOffset; // near the end
          } else {
            return middleOffset;
          }
        }

      case 'auto':
      default:
        if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
          return scrollOffset;
        } else if (scrollOffset < minOffset) {
          return minOffset;
        } else {
          return maxOffset;
        }

    }
  },
  getStartIndexForOffset: function getStartIndexForOffset(_ref5, offset) {
    var itemCount = _ref5.itemCount,
        itemSize = _ref5.itemSize;
    return Math.max(0, Math.min(itemCount - 1, Math.floor(offset / itemSize)));
  },
  getStopIndexForStartIndex: function getStopIndexForStartIndex(_ref6, startIndex, scrollOffset) {
    var direction = _ref6.direction,
        height = _ref6.height,
        itemCount = _ref6.itemCount,
        itemSize = _ref6.itemSize,
        layout = _ref6.layout,
        width = _ref6.width;
    // TODO Deprecate direction "horizontal"
    var isHorizontal = direction === 'horizontal' || layout === 'horizontal';
    var offset = startIndex * itemSize;
    var size = isHorizontal ? width : height;
    var numVisibleItems = Math.ceil((size + scrollOffset - offset) / itemSize);
    return Math.max(0, Math.min(itemCount - 1, startIndex + numVisibleItems - 1 // -1 is because stop index is inclusive
    ));
  },
  initInstanceProps: function initInstanceProps(props) {// Noop
  },
  shouldResetStyleCacheOnItemSizeChange: true,
  validateProps: function validateProps(_ref7) {
    var itemSize = _ref7.itemSize;

    if (false) {}
  }
});

// Pulled from react-compat
// https://github.com/developit/preact-compat/blob/7c5de00e7c85e2ffd011bf3af02899b63f699d3a/src/index.js#L349
function shallowDiffers(prev, next) {
  for (var attribute in prev) {
    if (!(attribute in next)) {
      return true;
    }
  }

  for (var _attribute in next) {
    if (prev[_attribute] !== next[_attribute]) {
      return true;
    }
  }

  return false;
}

var index_esm_excluded = ["style"],
    index_esm_excluded2 = ["style"];
// It knows to compare individual style props and ignore the wrapper object.
// See https://reactjs.org/docs/react-api.html#reactmemo

function areEqual(prevProps, nextProps) {
  var prevStyle = prevProps.style,
      prevRest = (0,objectWithoutPropertiesLoose/* default */.A)(prevProps, index_esm_excluded);

  var nextStyle = nextProps.style,
      nextRest = (0,objectWithoutPropertiesLoose/* default */.A)(nextProps, index_esm_excluded2);

  return !shallowDiffers(prevStyle, nextStyle) && !shallowDiffers(prevRest, nextRest);
}

// It knows to compare individual style props and ignore the wrapper object.
// See https://reactjs.org/docs/react-component.html#shouldcomponentupdate

function shouldComponentUpdate(nextProps, nextState) {
  return !areEqual(this.props, nextProps) || shallowDiffers(this.state, nextState);
}


//# sourceMappingURL=index.esm.js.map

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/ui/scaleContent.ts



// This value is used to scale the flipbook in the viewport on mobile devices
// this is different from ControllerContext scale -> maybe we should refactor and unite these two values
var scaleContentAtom = vanilla_atom(DEFAULT_SCALE_CONTENT);
scaleContentAtom.debugLabel = "scaleContentAtom";
var setScaleContentAtom = vanilla_atom(null, function (get, set, newScaleData) {
  var layout = newScaleData.layout,
    flipbookWidth = newScaleData.flipbookWidth;
  var nrOfPagesOnStage = layout === constants_WidgetLayoutTypes.SINGLE ? 1 : 2;
  var maxSize = Math.min(window.screen.width, window.screen.height) * 2;
  if (main/* isMobile */.Fr && maxSize < flipbookWidth * nrOfPagesOnStage) {
    var newScale = maxSize / (flipbookWidth * nrOfPagesOnStage);
    if (get(scaleContentAtom) !== newScale) {
      set(scaleContentAtom, newScale);
    }
  }
});
setScaleContentAtom.debugLabel = "setScaleContentAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useFirstPage.ts


function useFirstPage_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function useFirstPage_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? useFirstPage_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : useFirstPage_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





/**
 * Returns the first page of the flipbook
 * @return {PageType}
 */
/* harmony default export */ var useFirstPage = (function () {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$pages = _useContext.pages,
    data = _useContext$pages.data,
    order = _useContext$pages.order,
    isRtl = _useContext.options.content.rtl;
  var _ref = isRtl ? order.slice(-1)[0] : order[0],
    _ref2 = slicedToArray_slicedToArray(_ref, 1),
    firstPageId = _ref2[0];
  var firstPage = data[firstPageId];

  // Used to scale the page and its content - optimization for mobile devices
  var _useAtom = react_useAtom(scaleContentAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    scale = _useAtom2[0];
  return useFirstPage_objectSpread(useFirstPage_objectSpread({}, firstPage), {}, {
    width: firstPage.width * scale,
    height: firstPage.height * scale
  });
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useFlipbookDimensions.ts







/**
 * Returns the sizes of the flipbook
 * @return {PageType}
 */
/* harmony default export */ var useFlipbookDimensions = (function () {
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    width = _useAtom2$.width,
    height = _useAtom2$.height,
    _useAtom2$$version = _useAtom2$.version,
    schema = _useAtom2$$version.schema,
    revision = _useAtom2$$version.revision;
  // Used to scale the page and its content - optimization for mobile devices
  var _useAtom3 = react_useAtom(scaleContentAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    scale = _useAtom4[0];
  var firstPage = useFirstPage();

  // Flipbooks with version greater or equal with 3.1 have the correct size in properties node, at the same if we
  // did not get the answer from convert we should take the sizes from the first page (and not set them to 0)
  if (parseFloat("".concat(schema, ".").concat(revision)) < flipbookVersion_JsonVersions['3.1'] || width === 0 || height === 0) {
    return {
      width: firstPage.width,
      height: firstPage.height
    };
  }
  return {
    width: width * scale,
    height: height * scale
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getNumberOfPages.ts
/**
 * Returns the total number of pages in a flipbook
 * @param {Array<Array<number>>} order
 * @returns {number}
 */

/* harmony default export */ var getNumberOfPages = (function (order) {
  var arrayOfStages = order.flat();
  return arrayOfStages.length;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/page.ts
var PageTypes = {
  PDF: 'pdf',
  PNG: 'png',
  JPG: 'jpg',
  JPEG: 'jpeg',
  CUSTOM: 'custom'
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getUploadThumbPath.ts




/**
 * Return thumb for uploaded resource
 *
 * @param flipbookData
 * @param pathData
 * @return {string}
 */

// TODO rename to generic getThumbPath and use it all over instead of old function
/* harmony default export */ var getUploadThumbPath = (function (flipbookData, pathData) {
  var page = pathData.page,
    type = pathData.type,
    _pathData$signature = pathData.signature,
    signature = _pathData$signature === void 0 ? '' : _pathData$signature,
    _pathData$resourceBuc = pathData.resourceBucket,
    resourceBucket = _pathData$resourceBuc === void 0 ? flipbook_ItemResourceBucket.DEFAULT : _pathData$resourceBuc,
    _pathData$coverType = pathData.coverType,
    coverType = _pathData$coverType === void 0 ? CoverType.THUMB : _pathData$coverType;
  var itemHash = flipbookData.itemHash,
    _flipbookData$flipboo = flipbookData.flipbookHash,
    flipbookHash = _flipbookData$flipboo === void 0 ? '' : _flipbookData$flipboo,
    _flipbookData$account = flipbookData.accountId,
    accountId = _flipbookData$account === void 0 ? '' : _flipbookData$account,
    _flipbookData$thumbHa = flipbookData.thumbHash,
    thumbHash = _flipbookData$thumbHa === void 0 ? '' : _flipbookData$thumbHa;
  // We need this in order to display thumbs for custom page. Only custom pages have page hash.
  var pageHash = type === PageTypes.CUSTOM ? thumbHash : "page_".concat(page + 1);
  var coverPath = "".concat(itemHash, "/covers/").concat(pageHash, "/").concat(coverType);
  if (resourceBucket === flipbook_ItemResourceBucket.CONTENT) {
    var itemsPath = "".concat(getPrivateContent(), "/").concat(accountId, "/collections/").concat(flipbookHash, "/items/");
    if (signature) {
      coverPath += "?".concat(signature);
    }
    return itemsPath + coverPath;
  }
  return "".concat(getCdnBase(), "/collections/items/").concat(coverPath);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ImageWithFallback/ImageWithFallback.styles.tsx

var ImageWithFallbackContainer = styled_components_browser_esm.img.withConfig({
  displayName: "ImageWithFallbackstyles__ImageWithFallbackContainer",
  componentId: "sc-1dlb0z5-0"
})(["max-width:100%;max-height:100%;user-drag:none;pointer-events:none;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ImageWithFallback/ImageWithFallback.tsx




var STATUS = {
  INITIAL: 'initial',
  SUCCESS: 'success',
  ERROR: 'error'
};
var ImageWithFallback = function ImageWithFallback(_ref) {
  var cover = _ref.cover,
    alt = _ref.alt,
    fallbackCover = _ref.fallbackCover;
  var _useState = (0,react.useState)(STATUS.INITIAL),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    coverLoadingStatus = _useState2[0],
    setCoverLoadingStatus = _useState2[1];
  (0,react.useEffect)(function () {
    var currentCoverImage = new Image();
    var setCoverSuccess = function setCoverSuccess() {
      setCoverLoadingStatus(STATUS.SUCCESS);
    };
    var setCoverError = function setCoverError() {
      setCoverLoadingStatus(STATUS.ERROR);
    };
    if (cover) {
      currentCoverImage.addEventListener('load', setCoverSuccess);
      currentCoverImage.addEventListener('error', setCoverError);
      currentCoverImage.src = cover;
    }
    return function () {
      currentCoverImage.removeEventListener('load', setCoverSuccess);
      currentCoverImage.removeEventListener('error', setCoverError);
    };
  }, []);
  return /*#__PURE__*/react.createElement(react.Fragment, null, coverLoadingStatus === STATUS.INITIAL && /*#__PURE__*/react.createElement("div", null), coverLoadingStatus === STATUS.SUCCESS && /*#__PURE__*/react.createElement(ImageWithFallbackContainer, {
    src: cover,
    alt: alt
  }), coverLoadingStatus === STATUS.ERROR && fallbackCover);
};
ImageWithFallback.propTypes = {
  cover: (prop_types_default()).string.isRequired,
  alt: (prop_types_default()).string.isRequired,
  fallbackCover: (prop_types_default()).element.isRequired
};
/* harmony default export */ var ImageWithFallback_ImageWithFallback = (ImageWithFallback);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ImageWithFallback/index.ts

;// CONCATENATED MODULE: ../../modules/ui/code/content-icons/src/FlipbookCoverFallback.tsx

var FlipbookCoverFallback = function FlipbookCoverFallback() {
  return /*#__PURE__*/react.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "54",
    height: "39"
  }, /*#__PURE__*/react.createElement("path", {
    fillOpacity: ".076",
    d: "M1.042.599C-.899 10.17.193 22.913 1.71 32.667c.667 4.878 1.031 5.548 4.611 4.451 13.773-3.78 25.969 3.78 39.681.427 4.611-1.037 6.37-3.414 6.553-7.682l.667-28.106c-6.917.244-22.813-2.439-27.425 2.012C19.063.416 8.081-.865 1.042.599zm25.18 11.035C25.797-1.17 42.301 5.049 50.977 4.196v.183c-4.611 8.535-13.955 19.387-19.658 24.02 6.735 4.878 6.917 7.866 4.247 7.866h-.182c-3.034-.183-6.007-.427-8.737-1.037.182-4.877-.182-17.254-.425-23.594zm12.681 24.63c2.306-3.78 8.859-18.716 11.832-28.105v20.85c0 2.622-.668 5.122-3.58 5.975-2.306.67-5.097 1.098-8.252 1.28z"
  }));
};
FlipbookCoverFallback.propTypes = {};
/* harmony default export */ var src_FlipbookCoverFallback = (FlipbookCoverFallback);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/Page/Page.styles.tsx

var PageContainer = styled_components_browser_esm.div.withConfig({
  displayName: "Pagestyles__PageContainer",
  componentId: "sc-138v1k2-0"
})(["position:relative;display:flex;justify-content:center;align-items:center;width:", ";height:", ";background-color:", ";", ";"], function (_ref) {
  var scaledWidth = _ref.scaledWidth;
  return "".concat(scaledWidth, "px");
}, function (_ref2) {
  var scaledHeight = _ref2.scaledHeight;
  return "".concat(scaledHeight, "px");
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.colors.white;
}, function (_ref4) {
  var isPlaceholderNeeded = _ref4.isPlaceholderNeeded;
  if (isPlaceholderNeeded) {
    return "\n                border-radius: 4px;\n                overflow: hidden;\n            ";
  }
  return '';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/Page/Page.tsx






var Page = function Page(_ref) {
  var thumbnailSource = _ref.thumbnailSource,
    pageNumber = _ref.pageNumber,
    stickToLeft = _ref.stickToLeft,
    isPlaceholderNeeded = _ref.isPlaceholderNeeded,
    scaledWidth = _ref.scaledWidth,
    scaledHeight = _ref.scaledHeight;
  return /*#__PURE__*/react.createElement(PageContainer, {
    scaledWidth: scaledWidth,
    scaledHeight: scaledHeight,
    isPlaceholderNeeded: isPlaceholderNeeded,
    "aria-hidden": true
  }, /*#__PURE__*/react.createElement(ImageWithFallback_ImageWithFallback, {
    cover: thumbnailSource,
    alt: "Thumbnail",
    fallbackCover: /*#__PURE__*/react.createElement(src_FlipbookCoverFallback, null)
  }), /*#__PURE__*/react.createElement(GeneralComponents_Badge_Badge, {
    label: String(pageNumber),
    width: "32px",
    height: "22px",
    position: "absolute",
    stickToLeft: stickToLeft,
    bottom: "5px"
  }));
};
Page.propTypes = {
  thumbnailSource: (prop_types_default()).string.isRequired,
  pageNumber: (prop_types_default()).number.isRequired,
  stickToLeft: (prop_types_default()).bool.isRequired,
  scaledWidth: (prop_types_default()).number.isRequired,
  scaledHeight: (prop_types_default()).number.isRequired,
  isPlaceholderNeeded: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var Page_Page = (Page);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/Page/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/PagesContainer.styles.tsx



var GridContainer = styled_components_browser_esm.div.attrs(function () {
  return {
    style: {
      overflow: 'hidden auto'
    }
  };
}).withConfig({
  displayName: "PagesContainerstyles__GridContainer",
  componentId: "sc-1n197v8-0"
})(["&::-webkit-scrollbar{width:", ";}&::-webkit-scrollbar-thumb{background-color:", ";}&::-webkit-scrollbar-thumb:hover{background-color:", ";}"], function (_ref) {
  var theme = _ref.theme;
  return "".concat(theme.pageOverview.scrollbarWidth, "px");
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.6);
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.8);
});
var StageContainer = styled_components_browser_esm.div.withConfig({
  displayName: "PagesContainerstyles__StageContainer",
  componentId: "sc-1n197v8-1"
})(["display:flex;position:relative;", ";border-radius:4px;overflow:hidden;transition:.1s linear;", ";&::after{content:'';position:absolute;top:0;background:", ";transition:.1s linear;height:100%;width:100%;visibility:hidden;};", ";", ";"], function (_ref4) {
  var isBlockedStage = _ref4.isBlockedStage;
  if (isBlockedStage) {
    return 'height: 100%';
  }
  return 'width: fit-content';
}, function (_ref5) {
  var placeholderToLeft = _ref5.placeholderToLeft;
  return placeholderToLeft && 'margin-left: auto';
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.PRIMARY, 0.35);
}, function (_ref7) {
  var isOverviewStageActive = _ref7.isOverviewStageActive,
    theme = _ref7.theme;
  return isOverviewStageActive && "\n        box-shadow: 0 0  0 ".concat(theme.pageOverview.outlineWidth, "px ").concat(theme.colors.primary, ";\n        &::after {\n            visibility: visible;\n        }\n    ");
}, function (_ref8) {
  var theme = _ref8.theme;
  return main/* isMobile */.Fr ? '' : "\n            &:focus-visible {\n                box-shadow: 0 0  0 ".concat(theme.pageOverview.outlineWidth, "px ").concat(theme.colors.primary, ";\n                 &::after {\n                    visibility: visible;\n                }\n            }\n\n            &:hover {\n                cursor: pointer;\n                box-shadow: 0 0  0 ").concat(theme.pageOverview.outlineWidth, "px ").concat(theme.colors.primary, ";\n                transition: .1s linear;\n                &::after {\n                    visibility: visible;\n                }\n            }\n        ");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/utils/checkDoublePageLayout.ts


/**
 * Return a boolean value that specifies is the flipbook is double page layout
 * @param {number} numberOfPages
 * @param {string} layout
 * @returns {boolean}
 */

/* harmony default export */ var checkDoublePageLayout = (function (numberOfPages, layout) {
  var multiplePages = numberOfPages > 2;
  return multiplePages && layout === constants_WidgetLayoutTypes.DOUBLE;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/utils/checkPlaceholderUsage.ts
/**
 * Return a boolean value that specifies whether a stage in double page layout needs a placeholder
 * @param {Array<Array<number>>} order
 * @param {number} stageIndex
 * @param {boolean} isDoublePageLayout
 * @returns {boolean}
 */

/* harmony default export */ var checkPlaceholderUsage = (function (order, stageIndex, isDoublePageLayout) {
  var lastStage = order.length - 1;
  // The placeholder applies only for the first and last stage
  // and only if those stages hold one page
  var isSingleFirstCover = order[0].length < 2 && stageIndex === 0;
  var isSingleLastCover = order[lastStage].length < 2 && stageIndex === lastStage;

  // The placeholder is used only for double page layout
  return isDoublePageLayout && (isSingleFirstCover || isSingleLastCover);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/utils/getFittedColumns.ts


/**
 * Returns the number of columns the modal can hold depending on its size
 * @param stageWidth
 * @param overviewStageWidth
 * @return number
 * @param {Array<Array<number>>} order
 */

/* harmony default export */ var getFittedColumns = (function (stageWidth, overviewStageWidth, order) {
  var theme = Ze();
  var modalWidth = stageWidth - 2 * theme.modal.marginLeft;
  // theme.pageOverview.gridGap is the gap between every item
  var itemWidth = overviewStageWidth + theme.pageOverview.gridGap;
  // we compute the maximum number of columns that can be allocated for the overview width
  var maxNumberOfColumns = Math.max(Math.floor(modalWidth / itemWidth), 1);
  // if the overview width fits all items then the number of stages defines the number of columns

  return itemWidth * order.length >= modalWidth ? maxNumberOfColumns : order.length;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/utils/getGridProperties.ts



/**
 * Returns all the specifications required for a virtualized grid
 * @param {StageSizeType} stageSize
 * @param {number} overviewStageWidth
 * @param {number} scaledHeight
 * @param {Array<Array<number>>} order
 */

/* harmony default export */ var getGridProperties = (function (stageSize, overviewStageWidth, scaledHeight, order) {
  var theme = Ze();
  var stageWidth = stageSize.width,
    stageHeight = stageSize.height;
  var numberOfColumns = getFittedColumns(stageWidth, overviewStageWidth, order);
  var numberOfRows = Math.ceil(order.length / numberOfColumns);
  var gridWidth = (overviewStageWidth + theme.pageOverview.gridGap) * numberOfColumns + theme.pageOverview.horizontalOutline;
  // The overview will have a maximum height allocated, so that the scroll area has a limitation
  var overviewMaxHeight = stageHeight - (theme.modal.marginBottom + theme.modal.marginTop);
  var overviewHeight = numberOfRows * (scaledHeight + theme.pageOverview.gridGap);
  var gridHeight = overviewHeight > overviewMaxHeight ? overviewMaxHeight : overviewHeight;
  return {
    numberOfColumns: numberOfColumns,
    numberOfRows: numberOfRows,
    gridWidth: gridWidth,
    gridHeight: gridHeight
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/utils/getPageOverviewScale.ts


/**
 * Returns the scaled values of the first page's original dimensions
 * @param firstPageWidth
 * @param firstPageHeight
 * @return {PageOverviewType}
 */

/* harmony default export */ var getPageOverviewScale = (function (firstPageWidth, firstPageHeight) {
  var theme = Ze();
  var fixedWidth = theme.pageOverview.width;
  var fixedHeight = theme.pageOverview.height;
  var scaledWidth = firstPageWidth / firstPageHeight * fixedHeight;
  var scaledHeight = firstPageHeight / firstPageWidth * fixedWidth;

  // In case the first page is portrait, the width of the page is responsive to a fixed height
  // In case the first page is landscape, the height of the page is responsive to a fixed width
  if (scaledHeight > fixedHeight) {
    scaledHeight = fixedHeight;
  } else {
    scaledWidth = fixedWidth;
  }
  return {
    scaledWidth: scaledWidth,
    scaledHeight: scaledHeight
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/utils/getPagesOverviewAriaLabel.ts
/* harmony default export */ var getPagesOverviewAriaLabel = (function (pageNumber, hasTwoPages, isRtl, isDoublePageLayout, isBlockedStage) {
  var ariaLabel = '';
  if (isRtl) {
    ariaLabel = "Page ".concat(pageNumber - 1);
  } else {
    ariaLabel = "Page ".concat(pageNumber + 1);
  }
  if (isDoublePageLayout && hasTwoPages) {
    if (isRtl) {
      ariaLabel = "Pages ".concat(pageNumber - 2, " and ").concat(pageNumber - 1);
    } else {
      ariaLabel = "Pages ".concat(pageNumber + 1, " and ").concat(pageNumber + 2);
    }
  }
  if (isBlockedStage) {
    ariaLabel += ', locked. To unlock, fill out the form.';
  }
  return ariaLabel;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/BlockedStages/BlockedStages.styles.tsx

var BlockedStageContainer = styled_components_browser_esm.div.withConfig({
  displayName: "BlockedStagesstyles__BlockedStageContainer",
  componentId: "sc-1gdw1ks-0"
})(["width:100%;height:100%;position:absolute;display:flex;justify-content:space-around;align-items:center;top:0;background-color:", ";"], function (_ref) {
  var backgroundColor = _ref.backgroundColor;
  return backgroundColor;
});
var BlockedStagePage = styled_components_browser_esm.div.withConfig({
  displayName: "BlockedStagesstyles__BlockedStagePage",
  componentId: "sc-1gdw1ks-1"
})(["display:flex;justify-content:center;align-items:center;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/BlockedStages/BlockedStages.tsx



/* harmony default export */ var BlockedStages = (function (_ref) {
  var hasOnlyOnePage = _ref.hasOnlyOnePage,
    _ref$backgroundColor = _ref.backgroundColor,
    backgroundColor = _ref$backgroundColor === void 0 ? 'transparent' : _ref$backgroundColor,
    _ref$iconSize = _ref.iconSize,
    iconSize = _ref$iconSize === void 0 ? '100%' : _ref$iconSize;
  return /*#__PURE__*/react.createElement(BlockedStageContainer, {
    backgroundColor: backgroundColor
  }, hasOnlyOnePage ? /*#__PURE__*/react.createElement(BlockedStagePage, null, /*#__PURE__*/react.createElement(src.LockIcon, {
    width: iconSize,
    height: iconSize
  })) : /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(BlockedStagePage, null, /*#__PURE__*/react.createElement(src.LockIcon, {
    width: iconSize,
    height: iconSize
  })), /*#__PURE__*/react.createElement(BlockedStagePage, null, /*#__PURE__*/react.createElement(src.LockIcon, {
    width: iconSize,
    height: iconSize
  }))));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/GridItem.tsx


function GridItem_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function GridItem_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? GridItem_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : GridItem_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }




























var GridItem = /*#__PURE__*/(0,react.memo)(function (_ref) {
  var rowIndex = _ref.rowIndex,
    columnIndex = _ref.columnIndex,
    style = _ref.style;
  var _useContext = (0,react.useContext)(contexts_ModalContext),
    setDisabled = _useContext.setDisabled,
    setOpen = _useContext.setOpen;
  var theme = Ze();
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    _useContext2$pages = _useContext2.pages,
    data = _useContext2$pages.data,
    order = _useContext2$pages.order,
    isRtl = _useContext2.options.content.rtl;
  var numberOfPages = getNumberOfPages(order);
  var _useContext3 = (0,react.useContext)(contexts_ActiveStageIndexContext),
    setActiveStageIndex = _useContext3.setActiveStageIndex;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var layout = useLayout();
  var _useAtom = react_useAtom(featuresAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    WIDGET_FORMS = _useAtom2[0].WIDGET_FORMS;
  var _useAtom3 = react_useAtom(stageSizeAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    stageSize = _useAtom4[0];
  var _useAtom5 = react_useAtom(leadFormStageIndexAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    leadFormStageIndex = _useAtom6[0];
  var _useAtom7 = react_useAtom(propertiesAtom),
    _useAtom8 = slicedToArray_slicedToArray(_useAtom7, 1),
    _useAtom8$ = _useAtom8[0],
    hash = _useAtom8$.hash,
    accountId = _useAtom8$.link.accountId,
    _useAtom8$$version = _useAtom8$.version,
    schema = _useAtom8$$version.schema,
    revision = _useAtom8$$version.revision;
  var _useAtom9 = react_useAtom(rootPrimitivesAtom),
    _useAtom10 = slicedToArray_slicedToArray(_useAtom9, 1),
    downloadMode = _useAtom10[0].downloadMode;
  var _useFlipbookDimension = useFlipbookDimensions(),
    firstPageWidth = _useFlipbookDimension.width,
    firstPageHeight = _useFlipbookDimension.height;
  var _getPageOverviewScale = getPageOverviewScale(firstPageWidth, firstPageHeight),
    scaledWidth = _getPageOverviewScale.scaledWidth,
    scaledHeight = _getPageOverviewScale.scaledHeight;
  var isDoublePageLayout = checkDoublePageLayout(numberOfPages, layout);
  var overviewStageWidth = isDoublePageLayout ? 2 * scaledWidth : scaledWidth;
  var _getGridProperties = getGridProperties(stageSize, overviewStageWidth, scaledHeight, order),
    numberOfColumns = _getGridProperties.numberOfColumns;
  var pageNumber = isRtl ? numberOfPages + 1 : 0;
  var signature = react_useAtomValue(signatureAtom);
  var isOnContentBucket = parseFloat("".concat(schema, ".").concat(revision)) >= flipbookVersion_JsonVersions['3.2'];
  var itemResourceBucket = isOnContentBucket ? flipbook_ItemResourceBucket.CONTENT : flipbook_ItemResourceBucket.DEFAULT;
  var mainContainer = order.map(function (stagesContainer, stageIndex) {
    var isPlaceholderNeeded = checkPlaceholderUsage(order, stageIndex, isDoublePageLayout);
    var isBlockedByLeadForm = isStageBlocked(stageIndex, leadFormStageIndex, WIDGET_FORMS, isRtl);
    var isOverviewStageActive = stageIndex === settledStageIndex;
    var ariaLabel = getPagesOverviewAriaLabel(pageNumber, stagesContainer.length === 2, isRtl, isDoublePageLayout, isBlockedByLeadForm);
    var handleStageClick = function handleStageClick() {
      setDisabled(true);
      setTimeout(function () {
        setOpen('');
        setActiveStageIndex(stageIndex);
      }, ANIMATION_EXECUTION_TIME);
    };
    var handleKeyUp = function handleKeyUp(event) {
      if (event.code === KeyboardCodes.ENTER || event.code === KeyboardCodes.SPACE) {
        handleStageClick();
      }
    };
    var stage = stagesContainer.map(function (pageId) {
      var _data$pageId = data[pageId],
        _data$pageId$source = _data$pageId.source,
        itemHash = _data$pageId$source.hash,
        page = _data$pageId$source.page,
        thumbHash = _data$pageId.hash,
        type = _data$pageId.type;
      var thumbnailSource = getUploadThumbPath({
        itemHash: itemHash,
        flipbookHash: hash,
        accountId: accountId,
        thumbHash: thumbHash
      }, {
        signature: signature,
        page: Number(page),
        type: type,
        resourceBucket: itemResourceBucket
      });
      thumbnailSource = downloadMode ? "".concat(thumbnailSource, ".jpg") : thumbnailSource;
      pageNumber += isRtl ? -1 : 1;

      // By default, page number will be placed to the left hand side(for single page)
      var stickToLeft = function stickToLeft() {
        if (isDoublePageLayout) {
          // In rtl case, page number will be placed to the left hand side for odd pages
          // In rtl case, page number will be placed to the right hand side for even pages
          if (isRtl) {
            return pageNumber % 2 !== 0;
          }

          // In double page case, page number will be placed to the left hand side for even pages
          // In double page case, page number will be placed to the right hand side for odd pages
          return pageNumber % 2 === 0;
        }
        return true;
      };
      return /*#__PURE__*/react.createElement(Page_Page, {
        key: "page-".concat(pageId),
        thumbnailSource: thumbnailSource,
        pageNumber: pageNumber,
        stickToLeft: stickToLeft(),
        scaledWidth: scaledWidth,
        scaledHeight: scaledHeight,
        isPlaceholderNeeded: isPlaceholderNeeded
      });
    });
    return /*#__PURE__*/react.createElement(StageContainer, {
      key: "stage-".concat(stagesContainer.join('-')),
      isPlaceholderNeeded: isPlaceholderNeeded,
      placeholderToLeft: isPlaceholderNeeded && stageIndex === 0,
      isOverviewStageActive: isOverviewStageActive,
      onClick: handleStageClick,
      isBlockedStage: isBlockedByLeadForm,
      tabIndex: TabIndex.UNREACHABLE,
      onKeyUp: handleKeyUp,
      "aria-label": ariaLabel,
      "aria-selected": isOverviewStageActive
    }, isBlockedByLeadForm ? /*#__PURE__*/react.createElement(BlockedStages, {
      hasOnlyOnePage: true,
      backgroundColor: "#fff",
      iconSize: "29px"
    }) : stage);
  });
  var index = columnIndex + rowIndex * numberOfColumns;
  var newStyle = GridItem_objectSpread(GridItem_objectSpread({}, style), {}, {
    top: typeof style.top === 'number' ? style.top + theme.pageOverview.outlineWidth : style.top,
    left: typeof style.left === 'number' ? style.left + theme.pageOverview.outlineWidth : style.left,
    width: overviewStageWidth,
    height: scaledHeight
  });
  return /*#__PURE__*/react.createElement("div", {
    style: newStyle
  }, mainContainer[index]);
}, areEqual);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/PagesContainer.tsx

















var PagesContainer = function PagesContainer() {
  var theme = Ze();
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    order = _useContext.pages.order;
  var numberOfPages = getNumberOfPages(order);
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var layout = useLayout();
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var _useFlipbookDimension = useFlipbookDimensions(),
    firstPageWidth = _useFlipbookDimension.width,
    firstPageHeight = _useFlipbookDimension.height;
  var _getPageOverviewScale = getPageOverviewScale(firstPageWidth, firstPageHeight),
    scaledWidth = _getPageOverviewScale.scaledWidth,
    scaledHeight = _getPageOverviewScale.scaledHeight;
  var isDoublePageLayout = checkDoublePageLayout(numberOfPages, layout);
  var overviewStageWidth = isDoublePageLayout ? 2 * scaledWidth : scaledWidth;
  var _getGridProperties = getGridProperties(stageSize, overviewStageWidth, scaledHeight, order),
    numberOfColumns = _getGridProperties.numberOfColumns,
    numberOfRows = _getGridProperties.numberOfRows,
    gridWidth = _getGridProperties.gridWidth,
    gridHeight = _getGridProperties.gridHeight;
  var gridRef = (0,react.useRef)(null);
  var innerRef = (0,react.useRef)(null);
  (0,react.useEffect)(function () {
    var _gridRef$current;
    var activeItemRow = Math.ceil((settledStageIndex + 1) / numberOfColumns);
    gridRef === null || gridRef === void 0 || (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 || _gridRef$current.scrollToItem({
      align: 'start',
      rowIndex: activeItemRow - 1
    });
    if (innerRef.current) {
      innerRef.current.setAttribute('role', 'row');
      innerRef.current.setAttribute('aria-rowindex', '1');
      innerRef.current.childNodes.forEach(function (node) {
        return node.setAttribute('role', 'gridcell');
      });
    }
  }, [stageSize]);
  var containerRef = (0,react.useRef)(null);
  (0,react.useEffect)(function () {
    var container = containerRef.current;
    var lastElementInFocus;
    var onFocus = function onFocus() {
      var _container$firstChild;
      var selectedNode = container === null || container === void 0 ? void 0 : container.querySelector('[aria-selected="true"]');
      if (selectedNode && !lastElementInFocus) {
        selectedNode.focus();
        lastElementInFocus = selectedNode;
      } else if (lastElementInFocus && document.body.contains(lastElementInFocus)) {
        lastElementInFocus.focus();
      } else if ((container === null || container === void 0 || (_container$firstChild = container.firstChild) === null || _container$firstChild === void 0 || (_container$firstChild = _container$firstChild.firstChild) === null || _container$firstChild === void 0 || (_container$firstChild = _container$firstChild.firstChild) === null || _container$firstChild === void 0 ? void 0 : _container$firstChild.firstChild) instanceof HTMLElement) {
        container.firstChild.firstChild.firstChild.firstChild.focus();
        lastElementInFocus = container.firstChild.firstChild.firstChild.firstChild;
      }
    };
    var onKeyDown = function onKeyDown(e) {
      if (e.code === KeyboardCodes.ARROW_DOWN || e.code === KeyboardCodes.ARROW_UP || e.code === KeyboardCodes.SPACE) {
        e.preventDefault();
      }
      if (e.code === KeyboardCodes.ARROW_RIGHT || e.code === KeyboardCodes.ARROW_DOWN) {
        var _document$activeEleme;
        if (((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 || (_document$activeEleme = _document$activeEleme.parentNode) === null || _document$activeEleme === void 0 || (_document$activeEleme = _document$activeEleme.nextSibling) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.firstChild) instanceof HTMLElement) {
          lastElementInFocus = document.activeElement.parentNode.nextSibling.firstChild;
          lastElementInFocus.focus();
        }
      } else if (e.code === KeyboardCodes.ARROW_LEFT || e.code === KeyboardCodes.ARROW_UP) {
        var _document$activeEleme2;
        if (((_document$activeEleme2 = document.activeElement) === null || _document$activeEleme2 === void 0 || (_document$activeEleme2 = _document$activeEleme2.parentNode) === null || _document$activeEleme2 === void 0 || (_document$activeEleme2 = _document$activeEleme2.previousSibling) === null || _document$activeEleme2 === void 0 ? void 0 : _document$activeEleme2.firstChild) instanceof HTMLElement) {
          lastElementInFocus = document.activeElement.parentNode.previousSibling.firstChild;
          lastElementInFocus.focus();
        }
      }
    };
    container.addEventListener('keydown', onKeyDown);
    container.addEventListener('focus', onFocus);
    return function () {
      container === null || container === void 0 || container.removeEventListener('keydown', onKeyDown);
      container === null || container === void 0 || container.removeEventListener('focus', onFocus);
    };
  }, [containerRef, gridRef]);
  return /*#__PURE__*/react.createElement("div", {
    ref: containerRef,
    tabIndex: TabIndex.DEFAULT,
    "aria-rowcount": numberOfRows,
    "aria-colcount": numberOfColumns,
    role: "grid"
  }, /*#__PURE__*/react.createElement(FixedSizeGrid, {
    ref: gridRef,
    innerRef: innerRef,
    width: gridWidth,
    height: gridHeight,
    columnWidth: overviewStageWidth + theme.pageOverview.gridGap,
    rowHeight: scaledHeight + theme.pageOverview.gridGap,
    columnCount: numberOfColumns,
    rowCount: numberOfRows,
    outerElementType: GridContainer
  }, GridItem));
};
/* harmony default export */ var PagesOverviewModal_PagesContainer = (PagesContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/PagesOverviewModal.tsx





var PagesOverviewModal = function PagesOverviewModal() {
  return /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: "auto",
    height: "auto",
    modalHeight: "auto",
    identifier: PAGES_MODAL_ID,
    opacity: backgroundOpacity.transparent,
    modalWithoutPadding: true
  }, /*#__PURE__*/react.createElement(PagesOverviewModal_PagesContainer, null));
};
/* harmony default export */ var PagesOverviewModal_PagesOverviewModal = (PagesOverviewModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/PagesOverviewModal/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/propTypes.ts

function propTypes_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function propTypes_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? propTypes_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : propTypes_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var ElementAttributes = {
  attributes: prop_types_default().shape({
    interaction: prop_types_default().oneOfType([prop_types_default().shape({
      color: (prop_types_default()).string.isRequired,
      width: (prop_types_default()).number.isRequired,
      height: (prop_types_default()).number.isRequired,
      interactionType: (prop_types_default()).string.isRequired,
      popinTooltip: (prop_types_default()).string.isRequired,
      title: (prop_types_default()).string.isRequired,
      positionActionType: (prop_types_default()).string.isRequired,
      openActionType: (prop_types_default()).string.isRequired,
      description: (prop_types_default()).string.isRequired,
      alpha: (prop_types_default()).number.isRequired
    }).isRequired, prop_types_default().shape({
      interactionType: (prop_types_default()).string.isRequired,
      actionType: (prop_types_default()).string.isRequired,
      pageNumber: (prop_types_default()).number.isRequired,
      actionTooltip: (prop_types_default()).string.isRequired
    }).isRequired, prop_types_default().shape({
      interactionType: (prop_types_default()).string.isRequired,
      url: (prop_types_default()).string.isRequired,
      tooltip: (prop_types_default()).string.isRequired
    }).isRequired, prop_types_default().shape({})]),
    size: (prop_types_default()).string,
    tooltip: (prop_types_default()).string,
    page: (prop_types_default()).number
  }).isRequired
};

/* ------ Player props -------- */

var propTypes_configProps = {
  config: prop_types_default().shape({
    privateContentCdn: (prop_types_default()).string.isRequired,
    cdnBase: (prop_types_default()).string.isRequired,
    cdnStatic: (prop_types_default()).string.isRequired,
    cdnContent: (prop_types_default()).string.isRequired,
    siteBase: (prop_types_default()).string.isRequired,
    siteAppUrl: (prop_types_default()).string.isRequired,
    enableGATracking: (prop_types_default()).bool.isRequired,
    enableCollectStats: (prop_types_default()).bool.isRequired,
    statisticsEndpoint: (prop_types_default()).string.isRequired,
    leadFormEndpoint: (prop_types_default()).string.isRequired,
    trackingData: (prop_types_default()).string,
    fullscreenUrl: (prop_types_default()).string.isRequired,
    enableWatermark: (prop_types_default()).bool.isRequired,
    orderEmailEndpoint: (prop_types_default()).string.isRequired,
    recaptchaListKey: (prop_types_default()).string.isRequired,
    renderedFrom: (prop_types_default()).string
  }).isRequired
};
var propTypes_propertiesProps = {
  properties: prop_types_default().shape({
    hash: (prop_types_default()).string.isRequired,
    status: (prop_types_default()).string.isRequired,
    title: (prop_types_default()).string.isRequired,
    visibility: (prop_types_default()).string.isRequired,
    link: prop_types_default().shape({
      accountId: (prop_types_default()).string.isRequired,
      document: (prop_types_default()).string.isRequired,
      domain: (prop_types_default()).string.isRequired,
      profile: (prop_types_default()).string.isRequired,
      sirAccountId: (prop_types_default()).string.isRequired
    }).isRequired,
    tracking: prop_types_default().shape({
      id: (prop_types_default()).string.isRequired,
      ipAnonymization: (prop_types_default()).bool.isRequired
    }).isRequired,
    gtmId: (prop_types_default()).string.isRequired,
    dateLastUpdate: (prop_types_default()).number.isRequired,
    accessibility: prop_types_default().shape({
      enable: (prop_types_default()).bool.isRequired,
      pages: prop_types_default().shape({}).isRequired
    }).isRequired,
    security: prop_types_default().shape({
      password: (prop_types_default()).string.isRequired
    }).isRequired,
    author: (prop_types_default()).string.isRequired
  }).isRequired
};
var propTypes_optionsProps = {
  options: prop_types_default().shape({
    content: prop_types_default().shape({
      layout: (prop_types_default()).string.isRequired,
      effect: (prop_types_default()).string.isRequired,
      rtl: (prop_types_default()).bool.isRequired,
      sounds: (prop_types_default()).bool.isRequired,
      shadows: (prop_types_default()).bool.isRequired,
      widgetLayout: prop_types_default().oneOf([playerTypes_PlayerLayoutTypes.SINGLE, playerTypes_PlayerLayoutTypes.DOUBLE, playerTypes_PlayerLayoutTypes.SMART]).isRequired,
      skinType: prop_types_default().oneOf([playerTypes_SkinTypes.CLASSIC, playerTypes_SkinTypes.MODERN, playerTypes_SkinTypes.WIDGET_MODERN]).isRequired,
      colors: prop_types_default().shape({
        primary: (prop_types_default()).string.isRequired
      }).isRequired
    }).isRequired,
    background: prop_types_default().shape({
      type: (prop_types_default()).string.isRequired,
      color: (prop_types_default()).string.isRequired,
      opacity: (prop_types_default()).number.isRequired,
      scale: (prop_types_default()).string.isRequired,
      src: (prop_types_default()).string.isRequired
    }).isRequired,
    backgroundAudio: prop_types_default().shape({
      enabled: (prop_types_default()).bool.isRequired,
      label: (prop_types_default()).string.isRequired,
      src: (prop_types_default()).string.isRequired,
      loop: (prop_types_default()).bool.isRequired,
      autoplay: (prop_types_default()).bool.isRequired
    }).isRequired,
    controls: prop_types_default().shape({
      autoNavigationDelay: (prop_types_default()).number.isRequired,
      download: (prop_types_default()).bool.isRequired,
      print: (prop_types_default()).bool.isRequired,
      language: (prop_types_default()).string.isRequired,
      share: (prop_types_default()).bool.isRequired,
      search: (prop_types_default()).bool.isRequired,
      toc: (prop_types_default()).bool.isRequired,
      showControls: (prop_types_default()).bool.isRequired,
      slider: (prop_types_default()).bool.isRequired,
      navigationArrows: (prop_types_default()).bool.isRequired,
      fullScreen: (prop_types_default()).bool.isRequired,
      highlights: (prop_types_default()).bool.isRequired,
      pagesOverview: (prop_types_default()).bool.isRequired,
      animatedInteractions: (prop_types_default()).bool.isRequired
    }).isRequired,
    logo: prop_types_default().shape({
      src: (prop_types_default()).string.isRequired,
      href: (prop_types_default()).string
    })
  }).isRequired
};
var propTypes_featuresProps = {
  features: prop_types_default().shape({
    FLIP_PAGES: (prop_types_default()).number.isRequired,
    FLIP_FILES: (prop_types_default()).number.isRequired,
    WIDGET_NO_WATERMARK: (prop_types_default()).bool.isRequired,
    WIDGET_RTL_ORIENTATION: (prop_types_default()).bool.isRequired,
    WIDGET_SINGLE_PAGE_VIEW: (prop_types_default()).bool.isRequired,
    WIDGET_SEARCH: (prop_types_default()).bool.isRequired,
    CUSTOM_FONTS: (prop_types_default()).bool.isRequired,
    WIDGET_SHELF: (prop_types_default()).bool.isRequired,
    WIDGET_LOGO: (prop_types_default()).bool.isRequired,
    WIDGET_PASSWORD: (prop_types_default()).bool.isRequired,
    WIDGET_ANALYTICS: (prop_types_default()).bool.isRequired,
    WIDGET_GTM: (prop_types_default()).bool.isRequired,
    WIDGET_PRINT: (prop_types_default()).bool.isRequired,
    WIDGET_MEDIA: (prop_types_default()).bool.isRequired,
    WIDGET_TAGS: (prop_types_default()).bool.isRequired,
    WIDGET_FORMS: (prop_types_default()).bool.isRequired,
    WIDGET_SHOPPING: (prop_types_default()).bool.isRequired,
    WIDGET_DOMAIN_RESTRICTIONS: (prop_types_default()).bool.isRequired,
    DOWNLOAD_PDF: (prop_types_default()).bool.isRequired,
    LAYOUTS: (prop_types_default()).bool.isRequired,
    TABLE_OF_CONTENT: (prop_types_default()).bool.isRequired,
    LINKS_FROM_TEXT: (prop_types_default()).bool.isRequired,
    EMBED: (prop_types_default()).bool.isRequired,
    UPLOAD_VIDEO: (prop_types_default()).bool.isRequired,
    PRODUCT_TAG: (prop_types_default()).bool.isRequired,
    POPUP_FRAME: (prop_types_default()).bool.isRequired,
    SLIDESHOW: (prop_types_default()).bool.isRequired,
    CHARTS: (prop_types_default()).bool.isRequired,
    ADD_TO_CART: (prop_types_default()).bool.isRequired,
    PHOTO_SLIDESHOW: (prop_types_default()).bool.isRequired,
    SPOTLIGHT: (prop_types_default()).bool.isRequired
  }).isRequired
};
var leadFormProps = {
  leadForm: prop_types_default().shape({
    header: (prop_types_default()).string.isRequired,
    placeholder: (prop_types_default()).string.isRequired,
    label: (prop_types_default()).string.isRequired,
    pageIndex: (prop_types_default()).number.isRequired,
    active: (prop_types_default()).bool.isRequired,
    formVersion: (prop_types_default()).number.isRequired,
    limit: (prop_types_default()).string.isRequired,
    fields: prop_types_default().oneOfType([(prop_types_default()).object, (prop_types_default()).any]),
    privacyPolicyActive: (prop_types_default()).bool,
    privacyPolicyCompany: (prop_types_default()).string,
    privacyPolicyWebsite: (prop_types_default()).string
  })
};
var cartProps = {
  cart: prop_types_default().shape({
    customerContactFields: prop_types_default().arrayOf(prop_types_default().shape({
      id: (prop_types_default()).number.isRequired,
      fieldName: (prop_types_default()).string.isRequired,
      validation: (prop_types_default()).string.isRequired,
      required: (prop_types_default()).bool.isRequired,
      noOfRows: (prop_types_default()).number.isRequired,
      valid: (prop_types_default()).bool.isRequired,
      userInput: (prop_types_default()).string
    })),
    privacyPolicy: prop_types_default().shape({
      enabled: (prop_types_default()).bool.isRequired,
      company: (prop_types_default()).string.isRequired,
      website: (prop_types_default()).string.isRequired
    }),
    showCartInPlayer: (prop_types_default()).bool,
    currency: (prop_types_default()).string,
    showOrderNumber: (prop_types_default()).bool,
    confirmationMessage: (prop_types_default()).string,
    orderPersonalization: prop_types_default().shape({
      header: (prop_types_default()).string.isRequired,
      footer: (prop_types_default()).string.isRequired,
      logo: prop_types_default().shape({
        data: (prop_types_default()).string,
        extension: (prop_types_default()).string,
        location: (prop_types_default()).string
      }),
      emailLogo: prop_types_default().shape({
        data: (prop_types_default()).string,
        extension: (prop_types_default()).string,
        location: (prop_types_default()).string
      }),
      pdfDownload: (prop_types_default()).bool,
      csvDownload: (prop_types_default()).bool,
      sendOrderButtonText: (prop_types_default()).string,
      sendOrderButton: (prop_types_default()).bool,
      slack: prop_types_default().shape({
        enabled: (prop_types_default()).bool,
        webhook: (prop_types_default()).string
      }),
      emailSubject: prop_types_default().shape({
        seller: (prop_types_default()).string,
        buyer: (prop_types_default()).string
      }),
      emailFooter: (prop_types_default()).string
    }),
    buyerContactSectionTitle: (prop_types_default()).string,
    buyerContactDescription: (prop_types_default()).string,
    inboxType: (prop_types_default()).string,
    emailOptions: prop_types_default().objectOf((prop_types_default()).string.isRequired),
    emailOptionsOrder: prop_types_default().arrayOf((prop_types_default()).string.isRequired),
    emailOptionsLabel: (prop_types_default()).string,
    shopIcon: (prop_types_default()).string
  })
};

/* ------- Element props ------- */

var propTypes_Element = prop_types_default().shape(propTypes_objectSpread(propTypes_objectSpread({
  id: (prop_types_default()).number.isRequired,
  type: (prop_types_default()).number.isRequired,
  action: (prop_types_default()).number.isRequired,
  bounds: prop_types_default().shape({
    x: (prop_types_default()).number.isRequired,
    y: (prop_types_default()).number.isRequired,
    width: (prop_types_default()).number.isRequired,
    height: (prop_types_default()).number.isRequired
  }).isRequired
}, ElementAttributes), {}, {
  alpha: (prop_types_default()).number,
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  zIndex: (prop_types_default()).number.isRequired
})).isRequired;
var Elements = {
  elements: prop_types_default().arrayOf(prop_types_default().arrayOf(propTypes_Element).isRequired).isRequired
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/getUniqueOrderId.ts


/**
 * Returns an unique order id created from uuid and dateNow()
 * @return {string}
 */
/* harmony default export */ var getUniqueOrderId = (function () {
  var uuid = "".concat(esm_browser_v4()).split('-')[0];
  var dateNow = "".concat(Date.now());
  var date = dateNow.substring(dateNow.length - 5, dateNow.length);
  return "".concat(uuid.substring(0, 2)).concat(date);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-google-recaptcha/lib/esm/recaptcha.js
function recaptcha_extends() { recaptcha_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 recaptcha_extends.apply(this, arguments); }

function recaptcha_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; }

function recaptcha_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function recaptcha_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }




var ReCAPTCHA =
/*#__PURE__*/
function (_React$Component) {
  recaptcha_inheritsLoose(ReCAPTCHA, _React$Component);

  function ReCAPTCHA() {
    var _this;

    _this = _React$Component.call(this) || this;
    _this.handleExpired = _this.handleExpired.bind(recaptcha_assertThisInitialized(_this));
    _this.handleErrored = _this.handleErrored.bind(recaptcha_assertThisInitialized(_this));
    _this.handleChange = _this.handleChange.bind(recaptcha_assertThisInitialized(_this));
    _this.handleRecaptchaRef = _this.handleRecaptchaRef.bind(recaptcha_assertThisInitialized(_this));
    return _this;
  }

  var _proto = ReCAPTCHA.prototype;

  _proto.getValue = function getValue() {
    if (this.props.grecaptcha && this._widgetId !== undefined) {
      return this.props.grecaptcha.getResponse(this._widgetId);
    }

    return null;
  };

  _proto.getWidgetId = function getWidgetId() {
    if (this.props.grecaptcha && this._widgetId !== undefined) {
      return this._widgetId;
    }

    return null;
  };

  _proto.execute = function execute() {
    var grecaptcha = this.props.grecaptcha;

    if (grecaptcha && this._widgetId !== undefined) {
      return grecaptcha.execute(this._widgetId);
    } else {
      this._executeRequested = true;
    }
  };

  _proto.executeAsync = function executeAsync() {
    var _this2 = this;

    return new Promise(function (resolve, reject) {
      _this2.executionResolve = resolve;
      _this2.executionReject = reject;

      _this2.execute();
    });
  };

  _proto.reset = function reset() {
    if (this.props.grecaptcha && this._widgetId !== undefined) {
      this.props.grecaptcha.reset(this._widgetId);
    }
  };

  _proto.handleExpired = function handleExpired() {
    if (this.props.onExpired) {
      this.props.onExpired();
    } else {
      this.handleChange(null);
    }
  };

  _proto.handleErrored = function handleErrored() {
    if (this.props.onErrored) {
      this.props.onErrored();
    }

    if (this.executionReject) {
      this.executionReject();
      delete this.executionResolve;
      delete this.executionReject;
    }
  };

  _proto.handleChange = function handleChange(token) {
    if (this.props.onChange) {
      this.props.onChange(token);
    }

    if (this.executionResolve) {
      this.executionResolve(token);
      delete this.executionReject;
      delete this.executionResolve;
    }
  };

  _proto.explicitRender = function explicitRender() {
    if (this.props.grecaptcha && this.props.grecaptcha.render && this._widgetId === undefined) {
      var wrapper = document.createElement("div");
      this._widgetId = this.props.grecaptcha.render(wrapper, {
        sitekey: this.props.sitekey,
        callback: this.handleChange,
        theme: this.props.theme,
        type: this.props.type,
        tabindex: this.props.tabindex,
        "expired-callback": this.handleExpired,
        "error-callback": this.handleErrored,
        size: this.props.size,
        stoken: this.props.stoken,
        hl: this.props.hl,
        badge: this.props.badge
      });
      this.captcha.appendChild(wrapper);
    }

    if (this._executeRequested && this.props.grecaptcha && this._widgetId !== undefined) {
      this._executeRequested = false;
      this.execute();
    }
  };

  _proto.componentDidMount = function componentDidMount() {
    this.explicitRender();
  };

  _proto.componentDidUpdate = function componentDidUpdate() {
    this.explicitRender();
  };

  _proto.componentWillUnmount = function componentWillUnmount() {
    if (this._widgetId !== undefined) {
      this.delayOfCaptchaIframeRemoving();
      this.reset();
    }
  };

  _proto.delayOfCaptchaIframeRemoving = function delayOfCaptchaIframeRemoving() {
    var temporaryNode = document.createElement("div");
    document.body.appendChild(temporaryNode);
    temporaryNode.style.display = "none"; // move of the recaptcha to a temporary node

    while (this.captcha.firstChild) {
      temporaryNode.appendChild(this.captcha.firstChild);
    } // delete the temporary node after reset will be done


    setTimeout(function () {
      document.body.removeChild(temporaryNode);
    }, 5000);
  };

  _proto.handleRecaptchaRef = function handleRecaptchaRef(elem) {
    this.captcha = elem;
  };

  _proto.render = function render() {
    // consume properties owned by the reCATPCHA, pass the rest to the div so the user can style it.

    /* eslint-disable no-unused-vars */
    var _this$props = this.props,
        sitekey = _this$props.sitekey,
        onChange = _this$props.onChange,
        theme = _this$props.theme,
        type = _this$props.type,
        tabindex = _this$props.tabindex,
        onExpired = _this$props.onExpired,
        onErrored = _this$props.onErrored,
        size = _this$props.size,
        stoken = _this$props.stoken,
        grecaptcha = _this$props.grecaptcha,
        badge = _this$props.badge,
        hl = _this$props.hl,
        childProps = recaptcha_objectWithoutPropertiesLoose(_this$props, ["sitekey", "onChange", "theme", "type", "tabindex", "onExpired", "onErrored", "size", "stoken", "grecaptcha", "badge", "hl"]);
    /* eslint-enable no-unused-vars */


    return react.createElement("div", recaptcha_extends({}, childProps, {
      ref: this.handleRecaptchaRef
    }));
  };

  return ReCAPTCHA;
}(react.Component);


ReCAPTCHA.displayName = "ReCAPTCHA";
ReCAPTCHA.propTypes = {
  sitekey: (prop_types_default()).string.isRequired,
  onChange: (prop_types_default()).func,
  grecaptcha: (prop_types_default()).object,
  theme: prop_types_default().oneOf(["dark", "light"]),
  type: prop_types_default().oneOf(["image", "audio"]),
  tabindex: (prop_types_default()).number,
  onExpired: (prop_types_default()).func,
  onErrored: (prop_types_default()).func,
  size: prop_types_default().oneOf(["compact", "normal", "invisible"]),
  stoken: (prop_types_default()).string,
  hl: (prop_types_default()).string,
  badge: prop_types_default().oneOf(["bottomright", "bottomleft", "inline"])
};
ReCAPTCHA.defaultProps = {
  onChange: function onChange() {},
  theme: "light",
  type: "image",
  tabindex: 0,
  size: "normal",
  badge: "bottomright"
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-async-script/lib/esm/async-script-loader.js
function async_script_loader_extends() { async_script_loader_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 async_script_loader_extends.apply(this, arguments); }

function async_script_loader_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; }

function async_script_loader_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }




var SCRIPT_MAP = {}; // A counter used to generate a unique id for each component that uses the function

var idCount = 0;
function makeAsyncScript(getScriptURL, options) {
  options = options || {};
  return function wrapWithAsyncScript(WrappedComponent) {
    var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || "Component";

    var AsyncScriptLoader =
    /*#__PURE__*/
    function (_Component) {
      async_script_loader_inheritsLoose(AsyncScriptLoader, _Component);

      function AsyncScriptLoader(props, context) {
        var _this;

        _this = _Component.call(this, props, context) || this;
        _this.state = {};
        _this.__scriptURL = "";
        return _this;
      }

      var _proto = AsyncScriptLoader.prototype;

      _proto.asyncScriptLoaderGetScriptLoaderID = function asyncScriptLoaderGetScriptLoaderID() {
        if (!this.__scriptLoaderID) {
          this.__scriptLoaderID = "async-script-loader-" + idCount++;
        }

        return this.__scriptLoaderID;
      };

      _proto.setupScriptURL = function setupScriptURL() {
        this.__scriptURL = typeof getScriptURL === "function" ? getScriptURL() : getScriptURL;
        return this.__scriptURL;
      };

      _proto.asyncScriptLoaderHandleLoad = function asyncScriptLoaderHandleLoad(state) {
        var _this2 = this;

        // use reacts setState callback to fire props.asyncScriptOnLoad with new state/entry
        this.setState(state, function () {
          return _this2.props.asyncScriptOnLoad && _this2.props.asyncScriptOnLoad(_this2.state);
        });
      };

      _proto.asyncScriptLoaderTriggerOnScriptLoaded = function asyncScriptLoaderTriggerOnScriptLoaded() {
        var mapEntry = SCRIPT_MAP[this.__scriptURL];

        if (!mapEntry || !mapEntry.loaded) {
          throw new Error("Script is not loaded.");
        }

        for (var obsKey in mapEntry.observers) {
          mapEntry.observers[obsKey](mapEntry);
        }

        delete window[options.callbackName];
      };

      _proto.componentDidMount = function componentDidMount() {
        var _this3 = this;

        var scriptURL = this.setupScriptURL();
        var key = this.asyncScriptLoaderGetScriptLoaderID();
        var _options = options,
            globalName = _options.globalName,
            callbackName = _options.callbackName,
            scriptId = _options.scriptId; // check if global object already attached to window

        if (globalName && typeof window[globalName] !== "undefined") {
          SCRIPT_MAP[scriptURL] = {
            loaded: true,
            observers: {}
          };
        } // check if script loading already


        if (SCRIPT_MAP[scriptURL]) {
          var entry = SCRIPT_MAP[scriptURL]; // if loaded or errored then "finish"

          if (entry && (entry.loaded || entry.errored)) {
            this.asyncScriptLoaderHandleLoad(entry);
            return;
          } // if still loading then callback to observer queue


          entry.observers[key] = function (entry) {
            return _this3.asyncScriptLoaderHandleLoad(entry);
          };

          return;
        }
        /*
         * hasn't started loading
         * start the "magic"
         * setup script to load and observers
         */


        var observers = {};

        observers[key] = function (entry) {
          return _this3.asyncScriptLoaderHandleLoad(entry);
        };

        SCRIPT_MAP[scriptURL] = {
          loaded: false,
          observers: observers
        };
        var script = document.createElement("script");
        script.src = scriptURL;
        script.async = true;

        for (var attribute in options.attributes) {
          script.setAttribute(attribute, options.attributes[attribute]);
        }

        if (scriptId) {
          script.id = scriptId;
        }

        var callObserverFuncAndRemoveObserver = function callObserverFuncAndRemoveObserver(func) {
          if (SCRIPT_MAP[scriptURL]) {
            var mapEntry = SCRIPT_MAP[scriptURL];
            var observersMap = mapEntry.observers;

            for (var obsKey in observersMap) {
              if (func(observersMap[obsKey])) {
                delete observersMap[obsKey];
              }
            }
          }
        };

        if (callbackName && typeof window !== "undefined") {
          window[callbackName] = function () {
            return _this3.asyncScriptLoaderTriggerOnScriptLoaded();
          };
        }

        script.onload = function () {
          var mapEntry = SCRIPT_MAP[scriptURL];

          if (mapEntry) {
            mapEntry.loaded = true;
            callObserverFuncAndRemoveObserver(function (observer) {
              if (callbackName) {
                return false;
              }

              observer(mapEntry);
              return true;
            });
          }
        };

        script.onerror = function () {
          var mapEntry = SCRIPT_MAP[scriptURL];

          if (mapEntry) {
            mapEntry.errored = true;
            callObserverFuncAndRemoveObserver(function (observer) {
              observer(mapEntry);
              return true;
            });
          }
        };

        document.body.appendChild(script);
      };

      _proto.componentWillUnmount = function componentWillUnmount() {
        // Remove tag script
        var scriptURL = this.__scriptURL;

        if (options.removeOnUnmount === true) {
          var allScripts = document.getElementsByTagName("script");

          for (var i = 0; i < allScripts.length; i += 1) {
            if (allScripts[i].src.indexOf(scriptURL) > -1) {
              if (allScripts[i].parentNode) {
                allScripts[i].parentNode.removeChild(allScripts[i]);
              }
            }
          }
        } // Clean the observer entry


        var mapEntry = SCRIPT_MAP[scriptURL];

        if (mapEntry) {
          delete mapEntry.observers[this.asyncScriptLoaderGetScriptLoaderID()];

          if (options.removeOnUnmount === true) {
            delete SCRIPT_MAP[scriptURL];
          }
        }
      };

      _proto.render = function render() {
        var globalName = options.globalName; // remove asyncScriptOnLoad from childProps

        var _this$props = this.props,
            asyncScriptOnLoad = _this$props.asyncScriptOnLoad,
            forwardedRef = _this$props.forwardedRef,
            childProps = async_script_loader_objectWithoutPropertiesLoose(_this$props, ["asyncScriptOnLoad", "forwardedRef"]); // eslint-disable-line no-unused-vars


        if (globalName && typeof window !== "undefined") {
          childProps[globalName] = typeof window[globalName] !== "undefined" ? window[globalName] : undefined;
        }

        childProps.ref = forwardedRef;
        return (0,react.createElement)(WrappedComponent, childProps);
      };

      return AsyncScriptLoader;
    }(react.Component); // Note the second param "ref" provided by React.forwardRef.
    // We can pass it along to AsyncScriptLoader as a regular prop, e.g. "forwardedRef"
    // And it can then be attached to the Component.


    var ForwardedComponent = (0,react.forwardRef)(function (props, ref) {
      return (0,react.createElement)(AsyncScriptLoader, async_script_loader_extends({}, props, {
        forwardedRef: ref
      }));
    });
    ForwardedComponent.displayName = "AsyncScriptLoader(" + wrappedComponentName + ")";
    ForwardedComponent.propTypes = {
      asyncScriptOnLoad: (prop_types_default()).func
    };
    return hoist_non_react_statics_cjs_default()(ForwardedComponent, WrappedComponent);
  };
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-google-recaptcha/lib/esm/recaptcha-wrapper.js


var callbackName = "onloadcallback";
var globalName = "grecaptcha";

function getOptions() {
  return typeof window !== "undefined" && window.recaptchaOptions || {};
}

function getURL() {
  var dynamicOptions = getOptions();
  var hostname = dynamicOptions.useRecaptchaNet ? "recaptcha.net" : "www.google.com";
  return "https://" + hostname + "/recaptcha/api.js?onload=" + callbackName + "&render=explicit";
}

/* harmony default export */ var recaptcha_wrapper = (makeAsyncScript(getURL, {
  callbackName: callbackName,
  globalName: globalName
})(ReCAPTCHA));
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-google-recaptcha/lib/esm/index.js


/* harmony default export */ var lib_esm = (recaptcha_wrapper);

;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js


function objectSpread2_ownKeys(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_objectSpread2(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = null != arguments[i] ? arguments[i] : {};
    i % 2 ? objectSpread2_ownKeys(Object(source), !0).forEach(function (key) {
      defineProperty_defineProperty(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : objectSpread2_ownKeys(Object(source)).forEach(function (key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }

  return target;
}
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-select/dist/useStateManager-7e1e8489.esm.js





var useStateManager_7e1e8489_esm_excluded = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
function useStateManager(_ref) {
  var _ref$defaultInputValu = _ref.defaultInputValue,
    defaultInputValue = _ref$defaultInputValu === void 0 ? '' : _ref$defaultInputValu,
    _ref$defaultMenuIsOpe = _ref.defaultMenuIsOpen,
    defaultMenuIsOpen = _ref$defaultMenuIsOpe === void 0 ? false : _ref$defaultMenuIsOpe,
    _ref$defaultValue = _ref.defaultValue,
    defaultValue = _ref$defaultValue === void 0 ? null : _ref$defaultValue,
    propsInputValue = _ref.inputValue,
    propsMenuIsOpen = _ref.menuIsOpen,
    propsOnChange = _ref.onChange,
    propsOnInputChange = _ref.onInputChange,
    propsOnMenuClose = _ref.onMenuClose,
    propsOnMenuOpen = _ref.onMenuOpen,
    propsValue = _ref.value,
    restSelectProps = objectWithoutProperties_objectWithoutProperties(_ref, useStateManager_7e1e8489_esm_excluded);
  var _useState = (0,react.useState)(propsInputValue !== undefined ? propsInputValue : defaultInputValue),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    stateInputValue = _useState2[0],
    setStateInputValue = _useState2[1];
  var _useState3 = (0,react.useState)(propsMenuIsOpen !== undefined ? propsMenuIsOpen : defaultMenuIsOpen),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    stateMenuIsOpen = _useState4[0],
    setStateMenuIsOpen = _useState4[1];
  var _useState5 = (0,react.useState)(propsValue !== undefined ? propsValue : defaultValue),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    stateValue = _useState6[0],
    setStateValue = _useState6[1];
  var onChange = (0,react.useCallback)(function (value, actionMeta) {
    if (typeof propsOnChange === 'function') {
      propsOnChange(value, actionMeta);
    }
    setStateValue(value);
  }, [propsOnChange]);
  var onInputChange = (0,react.useCallback)(function (value, actionMeta) {
    var newValue;
    if (typeof propsOnInputChange === 'function') {
      newValue = propsOnInputChange(value, actionMeta);
    }
    setStateInputValue(newValue !== undefined ? newValue : value);
  }, [propsOnInputChange]);
  var onMenuOpen = (0,react.useCallback)(function () {
    if (typeof propsOnMenuOpen === 'function') {
      propsOnMenuOpen();
    }
    setStateMenuIsOpen(true);
  }, [propsOnMenuOpen]);
  var onMenuClose = (0,react.useCallback)(function () {
    if (typeof propsOnMenuClose === 'function') {
      propsOnMenuClose();
    }
    setStateMenuIsOpen(false);
  }, [propsOnMenuClose]);
  var inputValue = propsInputValue !== undefined ? propsInputValue : stateInputValue;
  var menuIsOpen = propsMenuIsOpen !== undefined ? propsMenuIsOpen : stateMenuIsOpen;
  var value = propsValue !== undefined ? propsValue : stateValue;
  return objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, restSelectProps), {}, {
    inputValue: inputValue,
    menuIsOpen: menuIsOpen,
    onChange: onChange,
    onInputChange: onInputChange,
    onMenuClose: onMenuClose,
    onMenuOpen: onMenuOpen,
    value: value
  });
}



;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
function isNativeReflectConstruct_isNativeReflectConstruct() {
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  if (Reflect.construct.sham) return false;
  if (typeof Proxy === "function") return true;

  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
    return true;
  } catch (e) {
    return false;
  }
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js



function createSuper_createSuper(Derived) {
  var hasNativeReflectConstruct = isNativeReflectConstruct_isNativeReflectConstruct();
  return function _createSuperInternal() {
    var Super = getPrototypeOf_getPrototypeOf(Derived),
        result;

    if (hasNativeReflectConstruct) {
      var NewTarget = getPrototypeOf_getPrototypeOf(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }

    return possibleConstructorReturn_possibleConstructorReturn(this, result);
  };
}
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js
function _taggedTemplateLiteral(strings, raw) {
  if (!raw) {
    raw = strings.slice(0);
  }

  return Object.freeze(Object.defineProperties(strings, {
    raw: {
      value: Object.freeze(raw)
    }
  }));
}
;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
/**
 * Custom positioning reference element.
 * @see https://floating-ui.com/docs/virtual-elements
 */

const sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left']));
const alignments = (/* unused pure expression or super */ null && (['start', 'end']));
const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), [])));
const floating_ui_utils_min = Math.min;
const floating_ui_utils_max = Math.max;
const floating_ui_utils_round = Math.round;
const floor = Math.floor;
const createCoords = v => ({
  x: v,
  y: v
});
const oppositeSideMap = {
  left: 'right',
  right: 'left',
  bottom: 'top',
  top: 'bottom'
};
const oppositeAlignmentMap = {
  start: 'end',
  end: 'start'
};
function floating_ui_utils_clamp(start, value, end) {
  return floating_ui_utils_max(start, floating_ui_utils_min(value, end));
}
function evaluate(value, param) {
  return typeof value === 'function' ? value(param) : value;
}
function getSide(placement) {
  return placement.split('-')[0];
}
function getAlignment(placement) {
  return placement.split('-')[1];
}
function getOppositeAxis(axis) {
  return axis === 'x' ? 'y' : 'x';
}
function getAxisLength(axis) {
  return axis === 'y' ? 'height' : 'width';
}
function getSideAxis(placement) {
  return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
}
function getAlignmentAxis(placement) {
  return getOppositeAxis(getSideAxis(placement));
}
function getAlignmentSides(placement, rects, rtl) {
  if (rtl === void 0) {
    rtl = false;
  }
  const alignment = getAlignment(placement);
  const alignmentAxis = getAlignmentAxis(placement);
  const length = getAxisLength(alignmentAxis);
  let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
  if (rects.reference[length] > rects.floating[length]) {
    mainAlignmentSide = floating_ui_utils_getOppositePlacement(mainAlignmentSide);
  }
  return [mainAlignmentSide, floating_ui_utils_getOppositePlacement(mainAlignmentSide)];
}
function getExpandedPlacements(placement) {
  const oppositePlacement = floating_ui_utils_getOppositePlacement(placement);
  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
}
function getOppositeAlignmentPlacement(placement) {
  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
}
function getSideList(side, isStart, rtl) {
  const lr = ['left', 'right'];
  const rl = ['right', 'left'];
  const tb = ['top', 'bottom'];
  const bt = ['bottom', 'top'];
  switch (side) {
    case 'top':
    case 'bottom':
      if (rtl) return isStart ? rl : lr;
      return isStart ? lr : rl;
    case 'left':
    case 'right':
      return isStart ? tb : bt;
    default:
      return [];
  }
}
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
  const alignment = getAlignment(placement);
  let list = getSideList(getSide(placement), direction === 'start', rtl);
  if (alignment) {
    list = list.map(side => side + "-" + alignment);
    if (flipAlignment) {
      list = list.concat(list.map(getOppositeAlignmentPlacement));
    }
  }
  return list;
}
function floating_ui_utils_getOppositePlacement(placement) {
  return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
}
function expandPaddingObject(padding) {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0,
    ...padding
  };
}
function getPaddingObject(padding) {
  return typeof padding !== 'number' ? expandPaddingObject(padding) : {
    top: padding,
    right: padding,
    bottom: padding,
    left: padding
  };
}
function rectToClientRect(rect) {
  const {
    x,
    y,
    width,
    height
  } = rect;
  return {
    width,
    height,
    top: y,
    left: x,
    right: x + width,
    bottom: y + height,
    x,
    y
  };
}



;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
function hasWindow() {
  return typeof window !== 'undefined';
}
function getNodeName(node) {
  if (isNode(node)) {
    return (node.nodeName || '').toLowerCase();
  }
  // Mocked nodes in testing environments may not be instances of Node. By
  // returning `#document` an infinite loop won't occur.
  // https://github.com/floating-ui/floating-ui/issues/2317
  return '#document';
}
function floating_ui_utils_dom_getWindow(node) {
  var _node$ownerDocument;
  return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}
function getDocumentElement(node) {
  var _ref;
  return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
}
function isNode(value) {
  if (!hasWindow()) {
    return false;
  }
  return value instanceof Node || value instanceof floating_ui_utils_dom_getWindow(value).Node;
}
function isElement(value) {
  if (!hasWindow()) {
    return false;
  }
  return value instanceof Element || value instanceof floating_ui_utils_dom_getWindow(value).Element;
}
function isHTMLElement(value) {
  if (!hasWindow()) {
    return false;
  }
  return value instanceof HTMLElement || value instanceof floating_ui_utils_dom_getWindow(value).HTMLElement;
}
function isShadowRoot(value) {
  if (!hasWindow() || typeof ShadowRoot === 'undefined') {
    return false;
  }
  return value instanceof ShadowRoot || value instanceof floating_ui_utils_dom_getWindow(value).ShadowRoot;
}
function isOverflowElement(element) {
  const {
    overflow,
    overflowX,
    overflowY,
    display
  } = floating_ui_utils_dom_getComputedStyle(element);
  return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
}
function isTableElement(element) {
  return ['table', 'td', 'th'].includes(getNodeName(element));
}
function isTopLayer(element) {
  return [':popover-open', ':modal'].some(selector => {
    try {
      return element.matches(selector);
    } catch (e) {
      return false;
    }
  });
}
function isContainingBlock(elementOrCss) {
  const webkit = isWebKit();
  const css = isElement(elementOrCss) ? floating_ui_utils_dom_getComputedStyle(elementOrCss) : elementOrCss;

  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
  // https://drafts.csswg.org/css-transforms-2/#individual-transforms
  return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
}
function getContainingBlock(element) {
  let currentNode = floating_ui_utils_dom_getParentNode(element);
  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
    if (isContainingBlock(currentNode)) {
      return currentNode;
    } else if (isTopLayer(currentNode)) {
      return null;
    }
    currentNode = floating_ui_utils_dom_getParentNode(currentNode);
  }
  return null;
}
function isWebKit() {
  if (typeof CSS === 'undefined' || !CSS.supports) return false;
  return CSS.supports('-webkit-backdrop-filter', 'none');
}
function isLastTraversableNode(node) {
  return ['html', 'body', '#document'].includes(getNodeName(node));
}
function floating_ui_utils_dom_getComputedStyle(element) {
  return floating_ui_utils_dom_getWindow(element).getComputedStyle(element);
}
function getNodeScroll(element) {
  if (isElement(element)) {
    return {
      scrollLeft: element.scrollLeft,
      scrollTop: element.scrollTop
    };
  }
  return {
    scrollLeft: element.scrollX,
    scrollTop: element.scrollY
  };
}
function floating_ui_utils_dom_getParentNode(node) {
  if (getNodeName(node) === 'html') {
    return node;
  }
  const result =
  // Step into the shadow DOM of the parent of a slotted node.
  node.assignedSlot ||
  // DOM Element detected.
  node.parentNode ||
  // ShadowRoot detected.
  isShadowRoot(node) && node.host ||
  // Fallback.
  getDocumentElement(node);
  return isShadowRoot(result) ? result.host : result;
}
function getNearestOverflowAncestor(node) {
  const parentNode = floating_ui_utils_dom_getParentNode(node);
  if (isLastTraversableNode(parentNode)) {
    return node.ownerDocument ? node.ownerDocument.body : node.body;
  }
  if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
    return parentNode;
  }
  return getNearestOverflowAncestor(parentNode);
}
function getOverflowAncestors(node, list, traverseIframes) {
  var _node$ownerDocument2;
  if (list === void 0) {
    list = [];
  }
  if (traverseIframes === void 0) {
    traverseIframes = true;
  }
  const scrollableAncestor = getNearestOverflowAncestor(node);
  const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
  const win = floating_ui_utils_dom_getWindow(scrollableAncestor);
  if (isBody) {
    const frameElement = getFrameElement(win);
    return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
  }
  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
function getFrameElement(win) {
  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}



;// CONCATENATED MODULE: ../../modules/ui/code/mui/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs





function getCssDimensions(element) {
  const css = floating_ui_utils_dom_getComputedStyle(element);
  // In testing environments, the `width` and `height` properties are empty
  // strings for SVG elements, returning NaN. Fallback to `0` in this case.
  let width = parseFloat(css.width) || 0;
  let height = parseFloat(css.height) || 0;
  const hasOffset = isHTMLElement(element);
  const offsetWidth = hasOffset ? element.offsetWidth : width;
  const offsetHeight = hasOffset ? element.offsetHeight : height;
  const shouldFallback = floating_ui_utils_round(width) !== offsetWidth || floating_ui_utils_round(height) !== offsetHeight;
  if (shouldFallback) {
    width = offsetWidth;
    height = offsetHeight;
  }
  return {
    width,
    height,
    $: shouldFallback
  };
}

function unwrapElement(element) {
  return !isElement(element) ? element.contextElement : element;
}

function floating_ui_dom_getScale(element) {
  const domElement = unwrapElement(element);
  if (!isHTMLElement(domElement)) {
    return createCoords(1);
  }
  const rect = domElement.getBoundingClientRect();
  const {
    width,
    height,
    $
  } = getCssDimensions(domElement);
  let x = ($ ? floating_ui_utils_round(rect.width) : rect.width) / width;
  let y = ($ ? floating_ui_utils_round(rect.height) : rect.height) / height;

  // 0, NaN, or Infinity should always fallback to 1.

  if (!x || !Number.isFinite(x)) {
    x = 1;
  }
  if (!y || !Number.isFinite(y)) {
    y = 1;
  }
  return {
    x,
    y
  };
}

const noOffsets = /*#__PURE__*/createCoords(0);
function getVisualOffsets(element) {
  const win = floating_ui_utils_dom_getWindow(element);
  if (!isWebKit() || !win.visualViewport) {
    return noOffsets;
  }
  return {
    x: win.visualViewport.offsetLeft,
    y: win.visualViewport.offsetTop
  };
}
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
  if (isFixed === void 0) {
    isFixed = false;
  }
  if (!floatingOffsetParent || isFixed && floatingOffsetParent !== floating_ui_utils_dom_getWindow(element)) {
    return false;
  }
  return isFixed;
}

function floating_ui_dom_getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
  if (includeScale === void 0) {
    includeScale = false;
  }
  if (isFixedStrategy === void 0) {
    isFixedStrategy = false;
  }
  const clientRect = element.getBoundingClientRect();
  const domElement = unwrapElement(element);
  let scale = createCoords(1);
  if (includeScale) {
    if (offsetParent) {
      if (isElement(offsetParent)) {
        scale = floating_ui_dom_getScale(offsetParent);
      }
    } else {
      scale = floating_ui_dom_getScale(element);
    }
  }
  const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
  let x = (clientRect.left + visualOffsets.x) / scale.x;
  let y = (clientRect.top + visualOffsets.y) / scale.y;
  let width = clientRect.width / scale.x;
  let height = clientRect.height / scale.y;
  if (domElement) {
    const win = floating_ui_utils_dom_getWindow(domElement);
    const offsetWin = offsetParent && isElement(offsetParent) ? floating_ui_utils_dom_getWindow(offsetParent) : offsetParent;
    let currentWin = win;
    let currentIFrame = getFrameElement(currentWin);
    while (currentIFrame && offsetParent && offsetWin !== currentWin) {
      const iframeScale = floating_ui_dom_getScale(currentIFrame);
      const iframeRect = currentIFrame.getBoundingClientRect();
      const css = floating_ui_utils_dom_getComputedStyle(currentIFrame);
      const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
      const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
      x *= iframeScale.x;
      y *= iframeScale.y;
      width *= iframeScale.x;
      height *= iframeScale.y;
      x += left;
      y += top;
      currentWin = floating_ui_utils_dom_getWindow(currentIFrame);
      currentIFrame = getFrameElement(currentWin);
    }
  }
  return rectToClientRect({
    width,
    height,
    x,
    y
  });
}

// If <html> has a CSS width greater than the viewport, then this will be
// incorrect for RTL.
function getWindowScrollBarX(element, rect) {
  const leftScroll = getNodeScroll(element).scrollLeft;
  if (!rect) {
    return floating_ui_dom_getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
  }
  return rect.left + leftScroll;
}

function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
  if (ignoreScrollbarX === void 0) {
    ignoreScrollbarX = false;
  }
  const htmlRect = documentElement.getBoundingClientRect();
  const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
  // RTL <body> scrollbar.
  getWindowScrollBarX(documentElement, htmlRect));
  const y = htmlRect.top + scroll.scrollTop;
  return {
    x,
    y
  };
}

function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
  let {
    elements,
    rect,
    offsetParent,
    strategy
  } = _ref;
  const isFixed = strategy === 'fixed';
  const documentElement = getDocumentElement(offsetParent);
  const topLayer = elements ? isTopLayer(elements.floating) : false;
  if (offsetParent === documentElement || topLayer && isFixed) {
    return rect;
  }
  let scroll = {
    scrollLeft: 0,
    scrollTop: 0
  };
  let scale = createCoords(1);
  const offsets = createCoords(0);
  const isOffsetParentAnElement = isHTMLElement(offsetParent);
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
    if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
      scroll = getNodeScroll(offsetParent);
    }
    if (isHTMLElement(offsetParent)) {
      const offsetRect = floating_ui_dom_getBoundingClientRect(offsetParent);
      scale = floating_ui_dom_getScale(offsetParent);
      offsets.x = offsetRect.x + offsetParent.clientLeft;
      offsets.y = offsetRect.y + offsetParent.clientTop;
    }
  }
  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
  return {
    width: rect.width * scale.x,
    height: rect.height * scale.y,
    x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
    y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
  };
}

function getClientRects(element) {
  return Array.from(element.getClientRects());
}

// Gets the entire size of the scrollable document area, even extending outside
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
function getDocumentRect(element) {
  const html = getDocumentElement(element);
  const scroll = getNodeScroll(element);
  const body = element.ownerDocument.body;
  const width = floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
  const height = floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
  let x = -scroll.scrollLeft + getWindowScrollBarX(element);
  const y = -scroll.scrollTop;
  if (floating_ui_utils_dom_getComputedStyle(body).direction === 'rtl') {
    x += floating_ui_utils_max(html.clientWidth, body.clientWidth) - width;
  }
  return {
    width,
    height,
    x,
    y
  };
}

function getViewportRect(element, strategy) {
  const win = floating_ui_utils_dom_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;
    const visualViewportBased = isWebKit();
    if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
      x = visualViewport.offsetLeft;
      y = visualViewport.offsetTop;
    }
  }
  return {
    width,
    height,
    x,
    y
  };
}

// Returns the inner client rect, subtracting scrollbars if present.
function getInnerBoundingClientRect(element, strategy) {
  const clientRect = floating_ui_dom_getBoundingClientRect(element, true, strategy === 'fixed');
  const top = clientRect.top + element.clientTop;
  const left = clientRect.left + element.clientLeft;
  const scale = isHTMLElement(element) ? floating_ui_dom_getScale(element) : createCoords(1);
  const width = element.clientWidth * scale.x;
  const height = element.clientHeight * scale.y;
  const x = left * scale.x;
  const y = top * scale.y;
  return {
    width,
    height,
    x,
    y
  };
}
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
  let rect;
  if (clippingAncestor === 'viewport') {
    rect = getViewportRect(element, strategy);
  } else if (clippingAncestor === 'document') {
    rect = getDocumentRect(getDocumentElement(element));
  } else if (isElement(clippingAncestor)) {
    rect = getInnerBoundingClientRect(clippingAncestor, strategy);
  } else {
    const visualOffsets = getVisualOffsets(element);
    rect = {
      x: clippingAncestor.x - visualOffsets.x,
      y: clippingAncestor.y - visualOffsets.y,
      width: clippingAncestor.width,
      height: clippingAncestor.height
    };
  }
  return rectToClientRect(rect);
}
function hasFixedPositionAncestor(element, stopNode) {
  const parentNode = floating_ui_utils_dom_getParentNode(element);
  if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
    return false;
  }
  return floating_ui_utils_dom_getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
}

// A "clipping ancestor" is an `overflow` element with the characteristic of
// clipping (or hiding) child elements. This returns all clipping ancestors
// of the given element up the tree.
function getClippingElementAncestors(element, cache) {
  const cachedResult = cache.get(element);
  if (cachedResult) {
    return cachedResult;
  }
  let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
  let currentContainingBlockComputedStyle = null;
  const elementIsFixed = floating_ui_utils_dom_getComputedStyle(element).position === 'fixed';
  let currentNode = elementIsFixed ? floating_ui_utils_dom_getParentNode(element) : element;

  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
    const computedStyle = floating_ui_utils_dom_getComputedStyle(currentNode);
    const currentNodeIsContaining = isContainingBlock(currentNode);
    if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
      currentContainingBlockComputedStyle = null;
    }
    const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
    if (shouldDropCurrentNode) {
      // Drop non-containing blocks.
      result = result.filter(ancestor => ancestor !== currentNode);
    } else {
      // Record last containing block for next iteration.
      currentContainingBlockComputedStyle = computedStyle;
    }
    currentNode = floating_ui_utils_dom_getParentNode(currentNode);
  }
  cache.set(element, result);
  return result;
}

// Gets the maximum area that the element is visible in due to any number of
// clipping ancestors.
function getClippingRect(_ref) {
  let {
    element,
    boundary,
    rootBoundary,
    strategy
  } = _ref;
  const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
  const firstClippingAncestor = clippingAncestors[0];
  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
    const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
    accRect.top = floating_ui_utils_max(rect.top, accRect.top);
    accRect.right = floating_ui_utils_min(rect.right, accRect.right);
    accRect.bottom = floating_ui_utils_min(rect.bottom, accRect.bottom);
    accRect.left = floating_ui_utils_max(rect.left, accRect.left);
    return accRect;
  }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
  return {
    width: clippingRect.right - clippingRect.left,
    height: clippingRect.bottom - clippingRect.top,
    x: clippingRect.left,
    y: clippingRect.top
  };
}

function getDimensions(element) {
  const {
    width,
    height
  } = getCssDimensions(element);
  return {
    width,
    height
  };
}

function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
  const isOffsetParentAnElement = isHTMLElement(offsetParent);
  const documentElement = getDocumentElement(offsetParent);
  const isFixed = strategy === 'fixed';
  const rect = floating_ui_dom_getBoundingClientRect(element, true, isFixed, offsetParent);
  let scroll = {
    scrollLeft: 0,
    scrollTop: 0
  };
  const offsets = createCoords(0);
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
    if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
      scroll = getNodeScroll(offsetParent);
    }
    if (isOffsetParentAnElement) {
      const offsetRect = floating_ui_dom_getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
      offsets.x = offsetRect.x + offsetParent.clientLeft;
      offsets.y = offsetRect.y + offsetParent.clientTop;
    } else if (documentElement) {
      // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
      // Firefox with layout.scrollbar.side = 3 in about:config to test this.
      offsets.x = getWindowScrollBarX(documentElement);
    }
  }
  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
  const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
  const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
  return {
    x,
    y,
    width: rect.width,
    height: rect.height
  };
}

function isStaticPositioned(element) {
  return floating_ui_utils_dom_getComputedStyle(element).position === 'static';
}

function getTrueOffsetParent(element, polyfill) {
  if (!isHTMLElement(element) || floating_ui_utils_dom_getComputedStyle(element).position === 'fixed') {
    return null;
  }
  if (polyfill) {
    return polyfill(element);
  }
  let rawOffsetParent = element.offsetParent;

  // Firefox returns the <html> element as the offsetParent if it's non-static,
  // while Chrome and Safari return the <body> element. The <body> element must
  // be used to perform the correct calculations even if the <html> element is
  // non-static.
  if (getDocumentElement(element) === rawOffsetParent) {
    rawOffsetParent = rawOffsetParent.ownerDocument.body;
  }
  return rawOffsetParent;
}

// Gets the closest ancestor positioned element. Handles some edge cases,
// such as table ancestors and cross browser bugs.
function floating_ui_dom_getOffsetParent(element, polyfill) {
  const win = floating_ui_utils_dom_getWindow(element);
  if (isTopLayer(element)) {
    return win;
  }
  if (!isHTMLElement(element)) {
    let svgOffsetParent = floating_ui_utils_dom_getParentNode(element);
    while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
      if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
        return svgOffsetParent;
      }
      svgOffsetParent = floating_ui_utils_dom_getParentNode(svgOffsetParent);
    }
    return win;
  }
  let offsetParent = getTrueOffsetParent(element, polyfill);
  while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
    offsetParent = getTrueOffsetParent(offsetParent, polyfill);
  }
  if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
    return win;
  }
  return offsetParent || getContainingBlock(element) || win;
}

const getElementRects = async function (data) {
  const getOffsetParentFn = this.getOffsetParent || floating_ui_dom_getOffsetParent;
  const getDimensionsFn = this.getDimensions;
  const floatingDimensions = await getDimensionsFn(data.floating);
  return {
    reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
    floating: {
      x: 0,
      y: 0,
      width: floatingDimensions.width,
      height: floatingDimensions.height
    }
  };
};

function isRTL(element) {
  return floating_ui_utils_dom_getComputedStyle(element).direction === 'rtl';
}

const platform = {
  convertOffsetParentRelativeRectToViewportRelativeRect,
  getDocumentElement: getDocumentElement,
  getClippingRect,
  getOffsetParent: floating_ui_dom_getOffsetParent,
  getElementRects,
  getClientRects,
  getDimensions,
  getScale: floating_ui_dom_getScale,
  isElement: isElement,
  isRTL
};

function rectsAreEqual(a, b) {
  return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
}

// https://samthor.au/2021/observing-dom/
function observeMove(element, onMove) {
  let io = null;
  let timeoutId;
  const root = getDocumentElement(element);
  function cleanup() {
    var _io;
    clearTimeout(timeoutId);
    (_io = io) == null || _io.disconnect();
    io = null;
  }
  function refresh(skip, threshold) {
    if (skip === void 0) {
      skip = false;
    }
    if (threshold === void 0) {
      threshold = 1;
    }
    cleanup();
    const elementRectForRootMargin = element.getBoundingClientRect();
    const {
      left,
      top,
      width,
      height
    } = elementRectForRootMargin;
    if (!skip) {
      onMove();
    }
    if (!width || !height) {
      return;
    }
    const insetTop = floor(top);
    const insetRight = floor(root.clientWidth - (left + width));
    const insetBottom = floor(root.clientHeight - (top + height));
    const insetLeft = floor(left);
    const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
    const options = {
      rootMargin,
      threshold: floating_ui_utils_max(0, floating_ui_utils_min(1, threshold)) || 1
    };
    let isFirstUpdate = true;
    function handleObserve(entries) {
      const ratio = entries[0].intersectionRatio;
      if (ratio !== threshold) {
        if (!isFirstUpdate) {
          return refresh();
        }
        if (!ratio) {
          // If the reference is clipped, the ratio is 0. Throttle the refresh
          // to prevent an infinite loop of updates.
          timeoutId = setTimeout(() => {
            refresh(false, 1e-7);
          }, 1000);
        } else {
          refresh(false, ratio);
        }
      }
      if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
        // It's possible that even though the ratio is reported as 1, the
        // element is not actually fully within the IntersectionObserver's root
        // area anymore. This can happen under performance constraints. This may
        // be a bug in the browser's IntersectionObserver implementation. To
        // work around this, we compare the element's bounding rect now with
        // what it was at the time we created the IntersectionObserver. If they
        // are not equal then the element moved, so we refresh.
        refresh();
      }
      isFirstUpdate = false;
    }

    // Older browsers don't support a `document` as the root and will throw an
    // error.
    try {
      io = new IntersectionObserver(handleObserve, {
        ...options,
        // Handle <iframe>s
        root: root.ownerDocument
      });
    } catch (e) {
      io = new IntersectionObserver(handleObserve, options);
    }
    io.observe(element);
  }
  refresh(true);
  return cleanup;
}

/**
 * Automatically updates the position of the floating element when necessary.
 * Should only be called when the floating element is mounted on the DOM or
 * visible on the screen.
 * @returns cleanup function that should be invoked when the floating element is
 * removed from the DOM or hidden from the screen.
 * @see https://floating-ui.com/docs/autoUpdate
 */
function autoUpdate(reference, floating, update, options) {
  if (options === void 0) {
    options = {};
  }
  const {
    ancestorScroll = true,
    ancestorResize = true,
    elementResize = typeof ResizeObserver === 'function',
    layoutShift = typeof IntersectionObserver === 'function',
    animationFrame = false
  } = options;
  const referenceEl = unwrapElement(reference);
  const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
  ancestors.forEach(ancestor => {
    ancestorScroll && ancestor.addEventListener('scroll', update, {
      passive: true
    });
    ancestorResize && ancestor.addEventListener('resize', update);
  });
  const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
  let reobserveFrame = -1;
  let resizeObserver = null;
  if (elementResize) {
    resizeObserver = new ResizeObserver(_ref => {
      let [firstEntry] = _ref;
      if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
        // Prevent update loops when using the `size` middleware.
        // https://github.com/floating-ui/floating-ui/issues/1740
        resizeObserver.unobserve(floating);
        cancelAnimationFrame(reobserveFrame);
        reobserveFrame = requestAnimationFrame(() => {
          var _resizeObserver;
          (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
        });
      }
      update();
    });
    if (referenceEl && !animationFrame) {
      resizeObserver.observe(referenceEl);
    }
    resizeObserver.observe(floating);
  }
  let frameId;
  let prevRefRect = animationFrame ? floating_ui_dom_getBoundingClientRect(reference) : null;
  if (animationFrame) {
    frameLoop();
  }
  function frameLoop() {
    const nextRefRect = floating_ui_dom_getBoundingClientRect(reference);
    if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
      update();
    }
    prevRefRect = nextRefRect;
    frameId = requestAnimationFrame(frameLoop);
  }
  update();
  return () => {
    var _resizeObserver2;
    ancestors.forEach(ancestor => {
      ancestorScroll && ancestor.removeEventListener('scroll', update);
      ancestorResize && ancestor.removeEventListener('resize', update);
    });
    cleanupIo == null || cleanupIo();
    (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
    resizeObserver = null;
    if (animationFrame) {
      cancelAnimationFrame(frameId);
    }
  };
}

/**
 * Resolves with an object of overflow side offsets that determine how much the
 * element is overflowing a given clipping boundary on each side.
 * - positive = overflowing the boundary by that number of pixels
 * - negative = how many pixels left before it will overflow
 * - 0 = lies flush with the boundary
 * @see https://floating-ui.com/docs/detectOverflow
 */
const detectOverflow = (/* unused pure expression or super */ null && (detectOverflow$1));

/**
 * Modifies the placement by translating the floating element along the
 * specified axes.
 * A number (shorthand for `mainAxis` or distance), or an axes configuration
 * object may be passed.
 * @see https://floating-ui.com/docs/offset
 */
const floating_ui_dom_offset = (/* unused pure expression or super */ null && (offset$1));

/**
 * Optimizes the visibility of the floating element by choosing the placement
 * that has the most space available automatically, without needing to specify a
 * preferred placement. Alternative to `flip`.
 * @see https://floating-ui.com/docs/autoPlacement
 */
const autoPlacement = (/* unused pure expression or super */ null && (autoPlacement$1));

/**
 * Optimizes the visibility of the floating element by shifting it in order to
 * keep it in view when it will overflow the clipping boundary.
 * @see https://floating-ui.com/docs/shift
 */
const floating_ui_dom_shift = (/* unused pure expression or super */ null && (shift$1));

/**
 * Optimizes the visibility of the floating element by flipping the `placement`
 * in order to keep it in view when the preferred placement(s) will overflow the
 * clipping boundary. Alternative to `autoPlacement`.
 * @see https://floating-ui.com/docs/flip
 */
const floating_ui_dom_flip = (/* unused pure expression or super */ null && (flip$1));

/**
 * Provides data that allows you to change the size of the floating element —
 * for instance, prevent it from overflowing the clipping boundary or match the
 * width of the reference element.
 * @see https://floating-ui.com/docs/size
 */
const floating_ui_dom_size = (/* unused pure expression or super */ null && (size$1));

/**
 * Provides data to hide the floating element in applicable situations, such as
 * when it is not in the same clipping context as the reference element.
 * @see https://floating-ui.com/docs/hide
 */
const floating_ui_dom_hide = (/* unused pure expression or super */ null && (hide$1));

/**
 * Provides data to position an inner element of the floating element so that it
 * appears centered to the reference element.
 * @see https://floating-ui.com/docs/arrow
 */
const floating_ui_dom_arrow = (/* unused pure expression or super */ null && (arrow$1));

/**
 * Provides improved positioning for inline reference elements that can span
 * over multiple lines, such as hyperlinks or range selections.
 * @see https://floating-ui.com/docs/inline
 */
const inline = (/* unused pure expression or super */ null && (inline$1));

/**
 * Built-in `limiter` that will stop `shift()` at a certain point.
 */
const limitShift = (/* unused pure expression or super */ null && (limitShift$1));

/**
 * Computes the `x` and `y` coordinates that will place the floating element
 * next to a given reference element.
 */
const computePosition = (reference, floating, options) => {
  // This caches the expensive `getClippingElementAncestors` function so that
  // multiple lifecycle resets re-use the same result. It only lives for a
  // single call. If other functions become expensive, we can add them as well.
  const cache = new Map();
  const mergedOptions = {
    platform,
    ...options
  };
  const platformWithCache = {
    ...mergedOptions.platform,
    _c: cache
  };
  return computePosition$1(reference, floating, {
    ...mergedOptions,
    platform: platformWithCache
  });
};



;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js


var use_isomorphic_layout_effect_browser_esm_index = react.useLayoutEffect ;



;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-select/dist/index-641ee5b8.esm.js













var _excluded$4 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
// ==============================
// NO OP
// ==============================

var index_641ee5b8_esm_noop = function noop() {};

// ==============================
// Class Name Prefixer
// ==============================

/**
 String representation of component state for styling with class names.

 Expects an array of strings OR a string/object pair:
 - className(['comp', 'comp-arg', 'comp-arg-2'])
   @returns 'react-select__comp react-select__comp-arg react-select__comp-arg-2'
 - className('comp', { some: true, state: false })
   @returns 'react-select__comp react-select__comp--some'
*/
function applyPrefixToName(prefix, name) {
  if (!name) {
    return prefix;
  } else if (name[0] === '-') {
    return prefix + name;
  } else {
    return prefix + '__' + name;
  }
}
function classNames(prefix, state) {
  for (var _len = arguments.length, classNameList = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    classNameList[_key - 2] = arguments[_key];
  }
  var arr = [].concat(classNameList);
  if (state && prefix) {
    for (var key in state) {
      if (state.hasOwnProperty(key) && state[key]) {
        arr.push("".concat(applyPrefixToName(prefix, key)));
      }
    }
  }
  return arr.filter(function (i) {
    return i;
  }).map(function (i) {
    return String(i).trim();
  }).join(' ');
}
// ==============================
// Clean Value
// ==============================

var cleanValue = function cleanValue(value) {
  if (index_641ee5b8_esm_isArray(value)) return value.filter(Boolean);
  if (typeof_typeof(value) === 'object' && value !== null) return [value];
  return [];
};

// ==============================
// Clean Common Props
// ==============================

var cleanCommonProps = function cleanCommonProps(props) {
  //className
  props.className;
    props.clearValue;
    props.cx;
    props.getStyles;
    props.getClassNames;
    props.getValue;
    props.hasValue;
    props.isMulti;
    props.isRtl;
    props.options;
    props.selectOption;
    props.selectProps;
    props.setValue;
    props.theme;
    var innerProps = objectWithoutProperties_objectWithoutProperties(props, _excluded$4);
  return objectSpread2_objectSpread2({}, innerProps);
};

// ==============================
// Get Style Props
// ==============================

var getStyleProps = function getStyleProps(props, name, classNamesState) {
  var cx = props.cx,
    getStyles = props.getStyles,
    getClassNames = props.getClassNames,
    className = props.className;
  return {
    css: getStyles(name, props),
    className: cx(classNamesState !== null && classNamesState !== void 0 ? classNamesState : {}, getClassNames(name, props), className)
  };
};

// ==============================
// Handle Input Change
// ==============================

function handleInputChange(inputValue, actionMeta, onInputChange) {
  if (onInputChange) {
    var _newValue = onInputChange(inputValue, actionMeta);
    if (typeof _newValue === 'string') return _newValue;
  }
  return inputValue;
}

// ==============================
// Scroll Helpers
// ==============================

function isDocumentElement(el) {
  return [document.documentElement, document.body, window].indexOf(el) > -1;
}

// Normalized Scroll Top
// ------------------------------

function normalizedHeight(el) {
  if (isDocumentElement(el)) {
    return window.innerHeight;
  }
  return el.clientHeight;
}

// Normalized scrollTo & scrollTop
// ------------------------------

function getScrollTop(el) {
  if (isDocumentElement(el)) {
    return window.pageYOffset;
  }
  return el.scrollTop;
}
function scrollTo(el, top) {
  // with a scroll distance, we perform scroll on the element
  if (isDocumentElement(el)) {
    window.scrollTo(0, top);
    return;
  }
  el.scrollTop = top;
}

// Get Scroll Parent
// ------------------------------

function index_641ee5b8_esm_getScrollParent(element) {
  var style = getComputedStyle(element);
  var excludeStaticParent = style.position === 'absolute';
  var overflowRx = /(auto|scroll)/;
  if (style.position === 'fixed') return document.documentElement;
  for (var parent = element; parent = parent.parentElement;) {
    style = getComputedStyle(parent);
    if (excludeStaticParent && style.position === 'static') {
      continue;
    }
    if (overflowRx.test(style.overflow + style.overflowY + style.overflowX)) {
      return parent;
    }
  }
  return document.documentElement;
}

// Animated Scroll To
// ------------------------------

/**
  @param t: time (elapsed)
  @param b: initial value
  @param c: amount of change
  @param d: duration
*/
function easeOutCubic(t, b, c, d) {
  return c * ((t = t / d - 1) * t * t + 1) + b;
}
function animatedScrollTo(element, to) {
  var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 200;
  var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : index_641ee5b8_esm_noop;
  var start = getScrollTop(element);
  var change = to - start;
  var increment = 10;
  var currentTime = 0;
  function animateScroll() {
    currentTime += increment;
    var val = easeOutCubic(currentTime, start, change, duration);
    scrollTo(element, val);
    if (currentTime < duration) {
      window.requestAnimationFrame(animateScroll);
    } else {
      callback(element);
    }
  }
  animateScroll();
}

// Scroll Into View
// ------------------------------

function scrollIntoView(menuEl, focusedEl) {
  var menuRect = menuEl.getBoundingClientRect();
  var focusedRect = focusedEl.getBoundingClientRect();
  var overScroll = focusedEl.offsetHeight / 3;
  if (focusedRect.bottom + overScroll > menuRect.bottom) {
    scrollTo(menuEl, Math.min(focusedEl.offsetTop + focusedEl.clientHeight - menuEl.offsetHeight + overScroll, menuEl.scrollHeight));
  } else if (focusedRect.top - overScroll < menuRect.top) {
    scrollTo(menuEl, Math.max(focusedEl.offsetTop - overScroll, 0));
  }
}

// ==============================
// Get bounding client object
// ==============================

// cannot get keys using array notation with DOMRect
function getBoundingClientObj(element) {
  var rect = element.getBoundingClientRect();
  return {
    bottom: rect.bottom,
    height: rect.height,
    left: rect.left,
    right: rect.right,
    top: rect.top,
    width: rect.width
  };
}

// ==============================
// Touch Capability Detector
// ==============================

function isTouchCapable() {
  try {
    document.createEvent('TouchEvent');
    return true;
  } catch (e) {
    return false;
  }
}

// ==============================
// Mobile Device Detector
// ==============================

function isMobileDevice() {
  try {
    return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
  } catch (e) {
    return false;
  }
}

// ==============================
// Passive Event Detector
// ==============================

// https://github.com/rafgraph/detect-it/blob/main/src/index.ts#L19-L36
var passiveOptionAccessed = false;
var index_641ee5b8_esm_options = {
  get passive() {
    return passiveOptionAccessed = true;
  }
};
// check for SSR
var index_641ee5b8_esm_w = typeof window !== 'undefined' ? window : {};
if (index_641ee5b8_esm_w.addEventListener && index_641ee5b8_esm_w.removeEventListener) {
  index_641ee5b8_esm_w.addEventListener('p', index_641ee5b8_esm_noop, index_641ee5b8_esm_options);
  index_641ee5b8_esm_w.removeEventListener('p', index_641ee5b8_esm_noop, false);
}
var supportsPassiveEvents = passiveOptionAccessed;
function notNullish(item) {
  return item != null;
}
function index_641ee5b8_esm_isArray(arg) {
  return Array.isArray(arg);
}
function valueTernary(isMulti, multiValue, singleValue) {
  return isMulti ? multiValue : singleValue;
}
function singleValueAsValue(singleValue) {
  return singleValue;
}
function multiValueAsValue(multiValue) {
  return multiValue;
}
var removeProps = function removeProps(propsObj) {
  for (var _len2 = arguments.length, properties = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
    properties[_key2 - 1] = arguments[_key2];
  }
  var propsMap = Object.entries(propsObj).filter(function (_ref) {
    var _ref2 = slicedToArray_slicedToArray(_ref, 1),
      key = _ref2[0];
    return !properties.includes(key);
  });
  return propsMap.reduce(function (newProps, _ref3) {
    var _ref4 = slicedToArray_slicedToArray(_ref3, 2),
      key = _ref4[0],
      val = _ref4[1];
    newProps[key] = val;
    return newProps;
  }, {});
};

var _excluded$3 = ["children", "innerProps"],
  _excluded2$1 = ["children", "innerProps"];
function getMenuPlacement(_ref) {
  var preferredMaxHeight = _ref.maxHeight,
    menuEl = _ref.menuEl,
    minHeight = _ref.minHeight,
    preferredPlacement = _ref.placement,
    shouldScroll = _ref.shouldScroll,
    isFixedPosition = _ref.isFixedPosition,
    controlHeight = _ref.controlHeight;
  var scrollParent = index_641ee5b8_esm_getScrollParent(menuEl);
  var defaultState = {
    placement: 'bottom',
    maxHeight: preferredMaxHeight
  };

  // something went wrong, return default state
  if (!menuEl || !menuEl.offsetParent) return defaultState;

  // we can't trust `scrollParent.scrollHeight` --> it may increase when
  // the menu is rendered
  var _scrollParent$getBoun = scrollParent.getBoundingClientRect(),
    scrollHeight = _scrollParent$getBoun.height;
  var _menuEl$getBoundingCl = menuEl.getBoundingClientRect(),
    menuBottom = _menuEl$getBoundingCl.bottom,
    menuHeight = _menuEl$getBoundingCl.height,
    menuTop = _menuEl$getBoundingCl.top;
  var _menuEl$offsetParent$ = menuEl.offsetParent.getBoundingClientRect(),
    containerTop = _menuEl$offsetParent$.top;
  var viewHeight = isFixedPosition ? window.innerHeight : normalizedHeight(scrollParent);
  var scrollTop = getScrollTop(scrollParent);
  var marginBottom = parseInt(getComputedStyle(menuEl).marginBottom, 10);
  var marginTop = parseInt(getComputedStyle(menuEl).marginTop, 10);
  var viewSpaceAbove = containerTop - marginTop;
  var viewSpaceBelow = viewHeight - menuTop;
  var scrollSpaceAbove = viewSpaceAbove + scrollTop;
  var scrollSpaceBelow = scrollHeight - scrollTop - menuTop;
  var scrollDown = menuBottom - viewHeight + scrollTop + marginBottom;
  var scrollUp = scrollTop + menuTop - marginTop;
  var scrollDuration = 160;
  switch (preferredPlacement) {
    case 'auto':
    case 'bottom':
      // 1: the menu will fit, do nothing
      if (viewSpaceBelow >= menuHeight) {
        return {
          placement: 'bottom',
          maxHeight: preferredMaxHeight
        };
      }

      // 2: the menu will fit, if scrolled
      if (scrollSpaceBelow >= menuHeight && !isFixedPosition) {
        if (shouldScroll) {
          animatedScrollTo(scrollParent, scrollDown, scrollDuration);
        }
        return {
          placement: 'bottom',
          maxHeight: preferredMaxHeight
        };
      }

      // 3: the menu will fit, if constrained
      if (!isFixedPosition && scrollSpaceBelow >= minHeight || isFixedPosition && viewSpaceBelow >= minHeight) {
        if (shouldScroll) {
          animatedScrollTo(scrollParent, scrollDown, scrollDuration);
        }

        // we want to provide as much of the menu as possible to the user,
        // so give them whatever is available below rather than the minHeight.
        var constrainedHeight = isFixedPosition ? viewSpaceBelow - marginBottom : scrollSpaceBelow - marginBottom;
        return {
          placement: 'bottom',
          maxHeight: constrainedHeight
        };
      }

      // 4. Forked beviour when there isn't enough space below

      // AUTO: flip the menu, render above
      if (preferredPlacement === 'auto' || isFixedPosition) {
        // may need to be constrained after flipping
        var _constrainedHeight = preferredMaxHeight;
        var spaceAbove = isFixedPosition ? viewSpaceAbove : scrollSpaceAbove;
        if (spaceAbove >= minHeight) {
          _constrainedHeight = Math.min(spaceAbove - marginBottom - controlHeight, preferredMaxHeight);
        }
        return {
          placement: 'top',
          maxHeight: _constrainedHeight
        };
      }

      // BOTTOM: allow browser to increase scrollable area and immediately set scroll
      if (preferredPlacement === 'bottom') {
        if (shouldScroll) {
          scrollTo(scrollParent, scrollDown);
        }
        return {
          placement: 'bottom',
          maxHeight: preferredMaxHeight
        };
      }
      break;
    case 'top':
      // 1: the menu will fit, do nothing
      if (viewSpaceAbove >= menuHeight) {
        return {
          placement: 'top',
          maxHeight: preferredMaxHeight
        };
      }

      // 2: the menu will fit, if scrolled
      if (scrollSpaceAbove >= menuHeight && !isFixedPosition) {
        if (shouldScroll) {
          animatedScrollTo(scrollParent, scrollUp, scrollDuration);
        }
        return {
          placement: 'top',
          maxHeight: preferredMaxHeight
        };
      }

      // 3: the menu will fit, if constrained
      if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {
        var _constrainedHeight2 = preferredMaxHeight;

        // we want to provide as much of the menu as possible to the user,
        // so give them whatever is available below rather than the minHeight.
        if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {
          _constrainedHeight2 = isFixedPosition ? viewSpaceAbove - marginTop : scrollSpaceAbove - marginTop;
        }
        if (shouldScroll) {
          animatedScrollTo(scrollParent, scrollUp, scrollDuration);
        }
        return {
          placement: 'top',
          maxHeight: _constrainedHeight2
        };
      }

      // 4. not enough space, the browser WILL NOT increase scrollable area when
      // absolutely positioned element rendered above the viewport (only below).
      // Flip the menu, render below
      return {
        placement: 'bottom',
        maxHeight: preferredMaxHeight
      };
    default:
      throw new Error("Invalid placement provided \"".concat(preferredPlacement, "\"."));
  }
  return defaultState;
}

// Menu Component
// ------------------------------

function alignToControl(placement) {
  var placementToCSSProp = {
    bottom: 'top',
    top: 'bottom'
  };
  return placement ? placementToCSSProp[placement] : 'bottom';
}
var coercePlacement = function coercePlacement(p) {
  return p === 'auto' ? 'bottom' : p;
};
var menuCSS = function menuCSS(_ref2, unstyled) {
  var _objectSpread2;
  var placement = _ref2.placement,
    _ref2$theme = _ref2.theme,
    borderRadius = _ref2$theme.borderRadius,
    spacing = _ref2$theme.spacing,
    colors = _ref2$theme.colors;
  return objectSpread2_objectSpread2((_objectSpread2 = {
    label: 'menu'
  }, defineProperty_defineProperty(_objectSpread2, alignToControl(placement), '100%'), defineProperty_defineProperty(_objectSpread2, "position", 'absolute'), defineProperty_defineProperty(_objectSpread2, "width", '100%'), defineProperty_defineProperty(_objectSpread2, "zIndex", 1), _objectSpread2), unstyled ? {} : {
    backgroundColor: colors.neutral0,
    borderRadius: borderRadius,
    boxShadow: '0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)',
    marginBottom: spacing.menuGutter,
    marginTop: spacing.menuGutter
  });
};
var PortalPlacementContext = /*#__PURE__*/(0,react.createContext)(null);

// NOTE: internal only
var MenuPlacer = function MenuPlacer(props) {
  var children = props.children,
    minMenuHeight = props.minMenuHeight,
    maxMenuHeight = props.maxMenuHeight,
    menuPlacement = props.menuPlacement,
    menuPosition = props.menuPosition,
    menuShouldScrollIntoView = props.menuShouldScrollIntoView,
    theme = props.theme;
  var _ref3 = (0,react.useContext)(PortalPlacementContext) || {},
    setPortalPlacement = _ref3.setPortalPlacement;
  var ref = (0,react.useRef)(null);
  var _useState = (0,react.useState)(maxMenuHeight),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    maxHeight = _useState2[0],
    setMaxHeight = _useState2[1];
  var _useState3 = (0,react.useState)(null),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    placement = _useState4[0],
    setPlacement = _useState4[1];
  var controlHeight = theme.spacing.controlHeight;
  use_isomorphic_layout_effect_browser_esm_index(function () {
    var menuEl = ref.current;
    if (!menuEl) return;

    // DO NOT scroll if position is fixed
    var isFixedPosition = menuPosition === 'fixed';
    var shouldScroll = menuShouldScrollIntoView && !isFixedPosition;
    var state = getMenuPlacement({
      maxHeight: maxMenuHeight,
      menuEl: menuEl,
      minHeight: minMenuHeight,
      placement: menuPlacement,
      shouldScroll: shouldScroll,
      isFixedPosition: isFixedPosition,
      controlHeight: controlHeight
    });
    setMaxHeight(state.maxHeight);
    setPlacement(state.placement);
    setPortalPlacement === null || setPortalPlacement === void 0 ? void 0 : setPortalPlacement(state.placement);
  }, [maxMenuHeight, menuPlacement, menuPosition, menuShouldScrollIntoView, minMenuHeight, setPortalPlacement, controlHeight]);
  return children({
    ref: ref,
    placerProps: objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, props), {}, {
      placement: placement || coercePlacement(menuPlacement),
      maxHeight: maxHeight
    })
  });
};
var index_641ee5b8_esm_Menu = function Menu(props) {
  var children = props.children,
    innerRef = props.innerRef,
    innerProps = props.innerProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'menu', {
    menu: true
  }), {
    ref: innerRef
  }, innerProps), children);
};
var Menu$1 = index_641ee5b8_esm_Menu;

// ==============================
// Menu List
// ==============================

var menuListCSS = function menuListCSS(_ref4, unstyled) {
  var maxHeight = _ref4.maxHeight,
    baseUnit = _ref4.theme.spacing.baseUnit;
  return objectSpread2_objectSpread2({
    maxHeight: maxHeight,
    overflowY: 'auto',
    position: 'relative',
    // required for offset[Height, Top] > keyboard scroll
    WebkitOverflowScrolling: 'touch'
  }, unstyled ? {} : {
    paddingBottom: baseUnit,
    paddingTop: baseUnit
  });
};
var index_641ee5b8_esm_MenuList = function MenuList(props) {
  var children = props.children,
    innerProps = props.innerProps,
    innerRef = props.innerRef,
    isMulti = props.isMulti;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'menuList', {
    'menu-list': true,
    'menu-list--is-multi': isMulti
  }), {
    ref: innerRef
  }, innerProps), children);
};

// ==============================
// Menu Notices
// ==============================

var noticeCSS = function noticeCSS(_ref5, unstyled) {
  var _ref5$theme = _ref5.theme,
    baseUnit = _ref5$theme.spacing.baseUnit,
    colors = _ref5$theme.colors;
  return objectSpread2_objectSpread2({
    textAlign: 'center'
  }, unstyled ? {} : {
    color: colors.neutral40,
    padding: "".concat(baseUnit * 2, "px ").concat(baseUnit * 3, "px")
  });
};
var noOptionsMessageCSS = noticeCSS;
var loadingMessageCSS = noticeCSS;
var NoOptionsMessage = function NoOptionsMessage(_ref6) {
  var _ref6$children = _ref6.children,
    children = _ref6$children === void 0 ? 'No options' : _ref6$children,
    innerProps = _ref6.innerProps,
    restProps = objectWithoutProperties_objectWithoutProperties(_ref6, _excluded$3);
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, restProps), {}, {
    children: children,
    innerProps: innerProps
  }), 'noOptionsMessage', {
    'menu-notice': true,
    'menu-notice--no-options': true
  }), innerProps), children);
};
var LoadingMessage = function LoadingMessage(_ref7) {
  var _ref7$children = _ref7.children,
    children = _ref7$children === void 0 ? 'Loading...' : _ref7$children,
    innerProps = _ref7.innerProps,
    restProps = objectWithoutProperties_objectWithoutProperties(_ref7, _excluded2$1);
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, restProps), {}, {
    children: children,
    innerProps: innerProps
  }), 'loadingMessage', {
    'menu-notice': true,
    'menu-notice--loading': true
  }), innerProps), children);
};

// ==============================
// Menu Portal
// ==============================

var menuPortalCSS = function menuPortalCSS(_ref8) {
  var rect = _ref8.rect,
    offset = _ref8.offset,
    position = _ref8.position;
  return {
    left: rect.left,
    position: position,
    top: offset,
    width: rect.width,
    zIndex: 1
  };
};
var MenuPortal = function MenuPortal(props) {
  var appendTo = props.appendTo,
    children = props.children,
    controlElement = props.controlElement,
    innerProps = props.innerProps,
    menuPlacement = props.menuPlacement,
    menuPosition = props.menuPosition;
  var menuPortalRef = (0,react.useRef)(null);
  var cleanupRef = (0,react.useRef)(null);
  var _useState5 = (0,react.useState)(coercePlacement(menuPlacement)),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    placement = _useState6[0],
    setPortalPlacement = _useState6[1];
  var portalPlacementContext = (0,react.useMemo)(function () {
    return {
      setPortalPlacement: setPortalPlacement
    };
  }, []);
  var _useState7 = (0,react.useState)(null),
    _useState8 = slicedToArray_slicedToArray(_useState7, 2),
    computedPosition = _useState8[0],
    setComputedPosition = _useState8[1];
  var updateComputedPosition = (0,react.useCallback)(function () {
    if (!controlElement) return;
    var rect = getBoundingClientObj(controlElement);
    var scrollDistance = menuPosition === 'fixed' ? 0 : window.pageYOffset;
    var offset = rect[placement] + scrollDistance;
    if (offset !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset) || rect.left !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left) || rect.width !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width)) {
      setComputedPosition({
        offset: offset,
        rect: rect
      });
    }
  }, [controlElement, menuPosition, placement, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width]);
  use_isomorphic_layout_effect_browser_esm_index(function () {
    updateComputedPosition();
  }, [updateComputedPosition]);
  var runAutoUpdate = (0,react.useCallback)(function () {
    if (typeof cleanupRef.current === 'function') {
      cleanupRef.current();
      cleanupRef.current = null;
    }
    if (controlElement && menuPortalRef.current) {
      cleanupRef.current = autoUpdate(controlElement, menuPortalRef.current, updateComputedPosition, {
        elementResize: 'ResizeObserver' in window
      });
    }
  }, [controlElement, updateComputedPosition]);
  use_isomorphic_layout_effect_browser_esm_index(function () {
    runAutoUpdate();
  }, [runAutoUpdate]);
  var setMenuPortalElement = (0,react.useCallback)(function (menuPortalElement) {
    menuPortalRef.current = menuPortalElement;
    runAutoUpdate();
  }, [runAutoUpdate]);

  // bail early if required elements aren't present
  if (!appendTo && menuPosition !== 'fixed' || !computedPosition) return null;

  // same wrapper element whether fixed or portalled
  var menuWrapper = (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({
    ref: setMenuPortalElement
  }, getStyleProps(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, props), {}, {
    offset: computedPosition.offset,
    position: menuPosition,
    rect: computedPosition.rect
  }), 'menuPortal', {
    'menu-portal': true
  }), innerProps), children);
  return (0,emotion_react_browser_esm/* jsx */.Y)(PortalPlacementContext.Provider, {
    value: portalPlacementContext
  }, appendTo ? /*#__PURE__*/(0,react_dom.createPortal)(menuWrapper, appendTo) : menuWrapper);
};

// ==============================
// Root Container
// ==============================

var containerCSS = function containerCSS(_ref) {
  var isDisabled = _ref.isDisabled,
    isRtl = _ref.isRtl;
  return {
    label: 'container',
    direction: isRtl ? 'rtl' : undefined,
    pointerEvents: isDisabled ? 'none' : undefined,
    // cancel mouse events when disabled
    position: 'relative'
  };
};
var index_641ee5b8_esm_SelectContainer = function SelectContainer(props) {
  var children = props.children,
    innerProps = props.innerProps,
    isDisabled = props.isDisabled,
    isRtl = props.isRtl;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'container', {
    '--is-disabled': isDisabled,
    '--is-rtl': isRtl
  }), innerProps), children);
};

// ==============================
// Value Container
// ==============================

var valueContainerCSS = function valueContainerCSS(_ref2, unstyled) {
  var spacing = _ref2.theme.spacing,
    isMulti = _ref2.isMulti,
    hasValue = _ref2.hasValue,
    controlShouldRenderValue = _ref2.selectProps.controlShouldRenderValue;
  return objectSpread2_objectSpread2({
    alignItems: 'center',
    display: isMulti && hasValue && controlShouldRenderValue ? 'flex' : 'grid',
    flex: 1,
    flexWrap: 'wrap',
    WebkitOverflowScrolling: 'touch',
    position: 'relative',
    overflow: 'hidden'
  }, unstyled ? {} : {
    padding: "".concat(spacing.baseUnit / 2, "px ").concat(spacing.baseUnit * 2, "px")
  });
};
var ValueContainer = function ValueContainer(props) {
  var children = props.children,
    innerProps = props.innerProps,
    isMulti = props.isMulti,
    hasValue = props.hasValue;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'valueContainer', {
    'value-container': true,
    'value-container--is-multi': isMulti,
    'value-container--has-value': hasValue
  }), innerProps), children);
};

// ==============================
// Indicator Container
// ==============================

var indicatorsContainerCSS = function indicatorsContainerCSS() {
  return {
    alignItems: 'center',
    alignSelf: 'stretch',
    display: 'flex',
    flexShrink: 0
  };
};
var IndicatorsContainer = function IndicatorsContainer(props) {
  var children = props.children,
    innerProps = props.innerProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'indicatorsContainer', {
    indicators: true
  }), innerProps), children);
};

var _templateObject;
var _excluded$2 = ["size"],
  index_641ee5b8_esm_excluded2 = ["innerProps", "isRtl", "size"];
function _EMOTION_STRINGIFIED_CSS_ERROR__() { 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)."; }

// ==============================
// Dropdown & Clear Icons
// ==============================
var _ref2 =  true ? {
  name: "8mmkcg",
  styles: "display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"
} : 0;
var index_641ee5b8_esm_Svg = function Svg(_ref) {
  var size = _ref.size,
    props = objectWithoutProperties_objectWithoutProperties(_ref, _excluded$2);
  return (0,emotion_react_browser_esm/* jsx */.Y)("svg", (0,esm_extends/* default */.A)({
    height: size,
    width: size,
    viewBox: "0 0 20 20",
    "aria-hidden": "true",
    focusable: "false",
    css: _ref2
  }, props));
};
var CrossIcon = function CrossIcon(props) {
  return (0,emotion_react_browser_esm/* jsx */.Y)(index_641ee5b8_esm_Svg, (0,esm_extends/* default */.A)({
    size: 20
  }, props), (0,emotion_react_browser_esm/* jsx */.Y)("path", {
    d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"
  }));
};
var DownChevron = function DownChevron(props) {
  return (0,emotion_react_browser_esm/* jsx */.Y)(index_641ee5b8_esm_Svg, (0,esm_extends/* default */.A)({
    size: 20
  }, props), (0,emotion_react_browser_esm/* jsx */.Y)("path", {
    d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
  }));
};

// ==============================
// Dropdown & Clear Buttons
// ==============================

var baseCSS = function baseCSS(_ref3, unstyled) {
  var isFocused = _ref3.isFocused,
    _ref3$theme = _ref3.theme,
    baseUnit = _ref3$theme.spacing.baseUnit,
    colors = _ref3$theme.colors;
  return objectSpread2_objectSpread2({
    label: 'indicatorContainer',
    display: 'flex',
    transition: 'color 150ms'
  }, unstyled ? {} : {
    color: isFocused ? colors.neutral60 : colors.neutral20,
    padding: baseUnit * 2,
    ':hover': {
      color: isFocused ? colors.neutral80 : colors.neutral40
    }
  });
};
var dropdownIndicatorCSS = baseCSS;
var DropdownIndicator = function DropdownIndicator(props) {
  var children = props.children,
    innerProps = props.innerProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'dropdownIndicator', {
    indicator: true,
    'dropdown-indicator': true
  }), innerProps), children || (0,emotion_react_browser_esm/* jsx */.Y)(DownChevron, null));
};
var clearIndicatorCSS = baseCSS;
var ClearIndicator = function ClearIndicator(props) {
  var children = props.children,
    innerProps = props.innerProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'clearIndicator', {
    indicator: true,
    'clear-indicator': true
  }), innerProps), children || (0,emotion_react_browser_esm/* jsx */.Y)(CrossIcon, null));
};

// ==============================
// Separator
// ==============================

var indicatorSeparatorCSS = function indicatorSeparatorCSS(_ref4, unstyled) {
  var isDisabled = _ref4.isDisabled,
    _ref4$theme = _ref4.theme,
    baseUnit = _ref4$theme.spacing.baseUnit,
    colors = _ref4$theme.colors;
  return objectSpread2_objectSpread2({
    label: 'indicatorSeparator',
    alignSelf: 'stretch',
    width: 1
  }, unstyled ? {} : {
    backgroundColor: isDisabled ? colors.neutral10 : colors.neutral20,
    marginBottom: baseUnit * 2,
    marginTop: baseUnit * 2
  });
};
var IndicatorSeparator = function IndicatorSeparator(props) {
  var innerProps = props.innerProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("span", (0,esm_extends/* default */.A)({}, innerProps, getStyleProps(props, 'indicatorSeparator', {
    'indicator-separator': true
  })));
};

// ==============================
// Loading
// ==============================

var loadingDotAnimations = (0,emotion_react_browser_esm/* keyframes */.i7)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n  0%, 80%, 100% { opacity: 0; }\n  40% { opacity: 1; }\n"])));
var loadingIndicatorCSS = function loadingIndicatorCSS(_ref5, unstyled) {
  var isFocused = _ref5.isFocused,
    size = _ref5.size,
    _ref5$theme = _ref5.theme,
    colors = _ref5$theme.colors,
    baseUnit = _ref5$theme.spacing.baseUnit;
  return objectSpread2_objectSpread2({
    label: 'loadingIndicator',
    display: 'flex',
    transition: 'color 150ms',
    alignSelf: 'center',
    fontSize: size,
    lineHeight: 1,
    marginRight: size,
    textAlign: 'center',
    verticalAlign: 'middle'
  }, unstyled ? {} : {
    color: isFocused ? colors.neutral60 : colors.neutral20,
    padding: baseUnit * 2
  });
};
var LoadingDot = function LoadingDot(_ref6) {
  var delay = _ref6.delay,
    offset = _ref6.offset;
  return (0,emotion_react_browser_esm/* jsx */.Y)("span", {
    css: /*#__PURE__*/(0,emotion_react_browser_esm/* css */.AH)({
      animation: "".concat(loadingDotAnimations, " 1s ease-in-out ").concat(delay, "ms infinite;"),
      backgroundColor: 'currentColor',
      borderRadius: '1em',
      display: 'inline-block',
      marginLeft: offset ? '1em' : undefined,
      height: '1em',
      verticalAlign: 'top',
      width: '1em'
    },  true ? "" : 0,  true ? "" : 0)
  });
};
var LoadingIndicator = function LoadingIndicator(_ref7) {
  var innerProps = _ref7.innerProps,
    isRtl = _ref7.isRtl,
    _ref7$size = _ref7.size,
    size = _ref7$size === void 0 ? 4 : _ref7$size,
    restProps = objectWithoutProperties_objectWithoutProperties(_ref7, index_641ee5b8_esm_excluded2);
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, restProps), {}, {
    innerProps: innerProps,
    isRtl: isRtl,
    size: size
  }), 'loadingIndicator', {
    indicator: true,
    'loading-indicator': true
  }), innerProps), (0,emotion_react_browser_esm/* jsx */.Y)(LoadingDot, {
    delay: 0,
    offset: isRtl
  }), (0,emotion_react_browser_esm/* jsx */.Y)(LoadingDot, {
    delay: 160,
    offset: true
  }), (0,emotion_react_browser_esm/* jsx */.Y)(LoadingDot, {
    delay: 320,
    offset: !isRtl
  }));
};

var css$1 = function css(_ref, unstyled) {
  var isDisabled = _ref.isDisabled,
    isFocused = _ref.isFocused,
    _ref$theme = _ref.theme,
    colors = _ref$theme.colors,
    borderRadius = _ref$theme.borderRadius,
    spacing = _ref$theme.spacing;
  return objectSpread2_objectSpread2({
    label: 'control',
    alignItems: 'center',
    cursor: 'default',
    display: 'flex',
    flexWrap: 'wrap',
    justifyContent: 'space-between',
    minHeight: spacing.controlHeight,
    outline: '0 !important',
    position: 'relative',
    transition: 'all 100ms'
  }, unstyled ? {} : {
    backgroundColor: isDisabled ? colors.neutral5 : colors.neutral0,
    borderColor: isDisabled ? colors.neutral10 : isFocused ? colors.primary : colors.neutral20,
    borderRadius: borderRadius,
    borderStyle: 'solid',
    borderWidth: 1,
    boxShadow: isFocused ? "0 0 0 1px ".concat(colors.primary) : undefined,
    '&:hover': {
      borderColor: isFocused ? colors.primary : colors.neutral30
    }
  });
};
var Control = function Control(props) {
  var children = props.children,
    isDisabled = props.isDisabled,
    isFocused = props.isFocused,
    innerRef = props.innerRef,
    innerProps = props.innerProps,
    menuIsOpen = props.menuIsOpen;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({
    ref: innerRef
  }, getStyleProps(props, 'control', {
    control: true,
    'control--is-disabled': isDisabled,
    'control--is-focused': isFocused,
    'control--menu-is-open': menuIsOpen
  }), innerProps, {
    "aria-disabled": isDisabled || undefined
  }), children);
};
var Control$1 = Control;

var _excluded$1 = ["data"];
var groupCSS = function groupCSS(_ref, unstyled) {
  var spacing = _ref.theme.spacing;
  return unstyled ? {} : {
    paddingBottom: spacing.baseUnit * 2,
    paddingTop: spacing.baseUnit * 2
  };
};
var Group = function Group(props) {
  var children = props.children,
    cx = props.cx,
    getStyles = props.getStyles,
    getClassNames = props.getClassNames,
    Heading = props.Heading,
    headingProps = props.headingProps,
    innerProps = props.innerProps,
    label = props.label,
    theme = props.theme,
    selectProps = props.selectProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'group', {
    group: true
  }), innerProps), (0,emotion_react_browser_esm/* jsx */.Y)(Heading, (0,esm_extends/* default */.A)({}, headingProps, {
    selectProps: selectProps,
    theme: theme,
    getStyles: getStyles,
    getClassNames: getClassNames,
    cx: cx
  }), label), (0,emotion_react_browser_esm/* jsx */.Y)("div", null, children));
};
var groupHeadingCSS = function groupHeadingCSS(_ref2, unstyled) {
  var _ref2$theme = _ref2.theme,
    colors = _ref2$theme.colors,
    spacing = _ref2$theme.spacing;
  return objectSpread2_objectSpread2({
    label: 'group',
    cursor: 'default',
    display: 'block'
  }, unstyled ? {} : {
    color: colors.neutral40,
    fontSize: '75%',
    fontWeight: 500,
    marginBottom: '0.25em',
    paddingLeft: spacing.baseUnit * 3,
    paddingRight: spacing.baseUnit * 3,
    textTransform: 'uppercase'
  });
};
var GroupHeading = function GroupHeading(props) {
  var _cleanCommonProps = cleanCommonProps(props);
    _cleanCommonProps.data;
    var innerProps = objectWithoutProperties_objectWithoutProperties(_cleanCommonProps, _excluded$1);
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'groupHeading', {
    'group-heading': true
  }), innerProps));
};
var Group$1 = Group;

var index_641ee5b8_esm_excluded = ["innerRef", "isDisabled", "isHidden", "inputClassName"];
var inputCSS = function inputCSS(_ref, unstyled) {
  var isDisabled = _ref.isDisabled,
    value = _ref.value,
    _ref$theme = _ref.theme,
    spacing = _ref$theme.spacing,
    colors = _ref$theme.colors;
  return objectSpread2_objectSpread2(objectSpread2_objectSpread2({
    visibility: isDisabled ? 'hidden' : 'visible',
    // force css to recompute when value change due to @emotion bug.
    // We can remove it whenever the bug is fixed.
    transform: value ? 'translateZ(0)' : ''
  }, containerStyle), unstyled ? {} : {
    margin: spacing.baseUnit / 2,
    paddingBottom: spacing.baseUnit / 2,
    paddingTop: spacing.baseUnit / 2,
    color: colors.neutral80
  });
};
var spacingStyle = {
  gridArea: '1 / 2',
  font: 'inherit',
  minWidth: '2px',
  border: 0,
  margin: 0,
  outline: 0,
  padding: 0
};
var containerStyle = {
  flex: '1 1 auto',
  display: 'inline-grid',
  gridArea: '1 / 1 / 2 / 3',
  gridTemplateColumns: '0 min-content',
  '&:after': objectSpread2_objectSpread2({
    content: 'attr(data-value) " "',
    visibility: 'hidden',
    whiteSpace: 'pre'
  }, spacingStyle)
};
var inputStyle = function inputStyle(isHidden) {
  return objectSpread2_objectSpread2({
    label: 'input',
    color: 'inherit',
    background: 0,
    opacity: isHidden ? 0 : 1,
    width: '100%'
  }, spacingStyle);
};
var index_641ee5b8_esm_Input = function Input(props) {
  var cx = props.cx,
    value = props.value;
  var _cleanCommonProps = cleanCommonProps(props),
    innerRef = _cleanCommonProps.innerRef,
    isDisabled = _cleanCommonProps.isDisabled,
    isHidden = _cleanCommonProps.isHidden,
    inputClassName = _cleanCommonProps.inputClassName,
    innerProps = objectWithoutProperties_objectWithoutProperties(_cleanCommonProps, index_641ee5b8_esm_excluded);
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'input', {
    'input-container': true
  }), {
    "data-value": value || ''
  }), (0,emotion_react_browser_esm/* jsx */.Y)("input", (0,esm_extends/* default */.A)({
    className: cx({
      input: true
    }, inputClassName),
    ref: innerRef,
    style: inputStyle(isHidden),
    disabled: isDisabled
  }, innerProps)));
};
var Input$1 = index_641ee5b8_esm_Input;

var multiValueCSS = function multiValueCSS(_ref, unstyled) {
  var _ref$theme = _ref.theme,
    spacing = _ref$theme.spacing,
    borderRadius = _ref$theme.borderRadius,
    colors = _ref$theme.colors;
  return objectSpread2_objectSpread2({
    label: 'multiValue',
    display: 'flex',
    minWidth: 0
  }, unstyled ? {} : {
    backgroundColor: colors.neutral10,
    borderRadius: borderRadius / 2,
    margin: spacing.baseUnit / 2
  });
};
var multiValueLabelCSS = function multiValueLabelCSS(_ref2, unstyled) {
  var _ref2$theme = _ref2.theme,
    borderRadius = _ref2$theme.borderRadius,
    colors = _ref2$theme.colors,
    cropWithEllipsis = _ref2.cropWithEllipsis;
  return objectSpread2_objectSpread2({
    overflow: 'hidden',
    textOverflow: cropWithEllipsis || cropWithEllipsis === undefined ? 'ellipsis' : undefined,
    whiteSpace: 'nowrap'
  }, unstyled ? {} : {
    borderRadius: borderRadius / 2,
    color: colors.neutral80,
    fontSize: '85%',
    padding: 3,
    paddingLeft: 6
  });
};
var multiValueRemoveCSS = function multiValueRemoveCSS(_ref3, unstyled) {
  var _ref3$theme = _ref3.theme,
    spacing = _ref3$theme.spacing,
    borderRadius = _ref3$theme.borderRadius,
    colors = _ref3$theme.colors,
    isFocused = _ref3.isFocused;
  return objectSpread2_objectSpread2({
    alignItems: 'center',
    display: 'flex'
  }, unstyled ? {} : {
    borderRadius: borderRadius / 2,
    backgroundColor: isFocused ? colors.dangerLight : undefined,
    paddingLeft: spacing.baseUnit,
    paddingRight: spacing.baseUnit,
    ':hover': {
      backgroundColor: colors.dangerLight,
      color: colors.danger
    }
  });
};
var MultiValueGeneric = function MultiValueGeneric(_ref4) {
  var children = _ref4.children,
    innerProps = _ref4.innerProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", innerProps, children);
};
var MultiValueContainer = MultiValueGeneric;
var MultiValueLabel = MultiValueGeneric;
function MultiValueRemove(_ref5) {
  var children = _ref5.children,
    innerProps = _ref5.innerProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({
    role: "button"
  }, innerProps), children || (0,emotion_react_browser_esm/* jsx */.Y)(CrossIcon, {
    size: 14
  }));
}
var MultiValue = function MultiValue(props) {
  var children = props.children,
    components = props.components,
    data = props.data,
    innerProps = props.innerProps,
    isDisabled = props.isDisabled,
    removeProps = props.removeProps,
    selectProps = props.selectProps;
  var Container = components.Container,
    Label = components.Label,
    Remove = components.Remove;
  return (0,emotion_react_browser_esm/* jsx */.Y)(Container, {
    data: data,
    innerProps: objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, getStyleProps(props, 'multiValue', {
      'multi-value': true,
      'multi-value--is-disabled': isDisabled
    })), innerProps),
    selectProps: selectProps
  }, (0,emotion_react_browser_esm/* jsx */.Y)(Label, {
    data: data,
    innerProps: objectSpread2_objectSpread2({}, getStyleProps(props, 'multiValueLabel', {
      'multi-value__label': true
    })),
    selectProps: selectProps
  }, children), (0,emotion_react_browser_esm/* jsx */.Y)(Remove, {
    data: data,
    innerProps: objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, getStyleProps(props, 'multiValueRemove', {
      'multi-value__remove': true
    })), {}, {
      'aria-label': "Remove ".concat(children || 'option')
    }, removeProps),
    selectProps: selectProps
  }));
};
var MultiValue$1 = MultiValue;

var optionCSS = function optionCSS(_ref, unstyled) {
  var isDisabled = _ref.isDisabled,
    isFocused = _ref.isFocused,
    isSelected = _ref.isSelected,
    _ref$theme = _ref.theme,
    spacing = _ref$theme.spacing,
    colors = _ref$theme.colors;
  return objectSpread2_objectSpread2({
    label: 'option',
    cursor: 'default',
    display: 'block',
    fontSize: 'inherit',
    width: '100%',
    userSelect: 'none',
    WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)'
  }, unstyled ? {} : {
    backgroundColor: isSelected ? colors.primary : isFocused ? colors.primary25 : 'transparent',
    color: isDisabled ? colors.neutral20 : isSelected ? colors.neutral0 : 'inherit',
    padding: "".concat(spacing.baseUnit * 2, "px ").concat(spacing.baseUnit * 3, "px"),
    // provide some affordance on touch devices
    ':active': {
      backgroundColor: !isDisabled ? isSelected ? colors.primary : colors.primary50 : undefined
    }
  });
};
var Option = function Option(props) {
  var children = props.children,
    isDisabled = props.isDisabled,
    isFocused = props.isFocused,
    isSelected = props.isSelected,
    innerRef = props.innerRef,
    innerProps = props.innerProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'option', {
    option: true,
    'option--is-disabled': isDisabled,
    'option--is-focused': isFocused,
    'option--is-selected': isSelected
  }), {
    ref: innerRef,
    "aria-disabled": isDisabled
  }, innerProps), children);
};
var Option$1 = Option;

var placeholderCSS = function placeholderCSS(_ref, unstyled) {
  var _ref$theme = _ref.theme,
    spacing = _ref$theme.spacing,
    colors = _ref$theme.colors;
  return objectSpread2_objectSpread2({
    label: 'placeholder',
    gridArea: '1 / 1 / 2 / 3'
  }, unstyled ? {} : {
    color: colors.neutral50,
    marginLeft: spacing.baseUnit / 2,
    marginRight: spacing.baseUnit / 2
  });
};
var Placeholder = function Placeholder(props) {
  var children = props.children,
    innerProps = props.innerProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'placeholder', {
    placeholder: true
  }), innerProps), children);
};
var Placeholder$1 = Placeholder;

var index_641ee5b8_esm_css = function css(_ref, unstyled) {
  var isDisabled = _ref.isDisabled,
    _ref$theme = _ref.theme,
    spacing = _ref$theme.spacing,
    colors = _ref$theme.colors;
  return objectSpread2_objectSpread2({
    label: 'singleValue',
    gridArea: '1 / 1 / 2 / 3',
    maxWidth: '100%',
    overflow: 'hidden',
    textOverflow: 'ellipsis',
    whiteSpace: 'nowrap'
  }, unstyled ? {} : {
    color: isDisabled ? colors.neutral40 : colors.neutral80,
    marginLeft: spacing.baseUnit / 2,
    marginRight: spacing.baseUnit / 2
  });
};
var SingleValue = function SingleValue(props) {
  var children = props.children,
    isDisabled = props.isDisabled,
    innerProps = props.innerProps;
  return (0,emotion_react_browser_esm/* jsx */.Y)("div", (0,esm_extends/* default */.A)({}, getStyleProps(props, 'singleValue', {
    'single-value': true,
    'single-value--is-disabled': isDisabled
  }), innerProps), children);
};
var SingleValue$1 = SingleValue;

var components = {
  ClearIndicator: ClearIndicator,
  Control: Control$1,
  DropdownIndicator: DropdownIndicator,
  DownChevron: DownChevron,
  CrossIcon: CrossIcon,
  Group: Group$1,
  GroupHeading: GroupHeading,
  IndicatorsContainer: IndicatorsContainer,
  IndicatorSeparator: IndicatorSeparator,
  Input: Input$1,
  LoadingIndicator: LoadingIndicator,
  Menu: Menu$1,
  MenuList: index_641ee5b8_esm_MenuList,
  MenuPortal: MenuPortal,
  LoadingMessage: LoadingMessage,
  NoOptionsMessage: NoOptionsMessage,
  MultiValue: MultiValue$1,
  MultiValueContainer: MultiValueContainer,
  MultiValueLabel: MultiValueLabel,
  MultiValueRemove: MultiValueRemove,
  Option: Option$1,
  Placeholder: Placeholder$1,
  SelectContainer: index_641ee5b8_esm_SelectContainer,
  SingleValue: SingleValue$1,
  ValueContainer: ValueContainer
};
var defaultComponents = function defaultComponents(props) {
  return objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, components), props.components);
};



;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-select/dist/Select-aab027f3.esm.js














function _EMOTION_STRINGIFIED_CSS_ERROR__$2() { 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)."; }

// Assistive text to describe visual elements. Hidden for sighted users.
var _ref =  true ? {
  name: "7pg0cj-a11yText",
  styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"
} : 0;
var A11yText = function A11yText(props) {
  return (0,emotion_react_browser_esm/* jsx */.Y)("span", (0,esm_extends/* default */.A)({
    css: _ref
  }, props));
};
var A11yText$1 = A11yText;

var defaultAriaLiveMessages = {
  guidance: function guidance(props) {
    var isSearchable = props.isSearchable,
      isMulti = props.isMulti,
      tabSelectsValue = props.tabSelectsValue,
      context = props.context,
      isInitialFocus = props.isInitialFocus;
    switch (context) {
      case 'menu':
        return "Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(tabSelectsValue ? ', press Tab to select the option and exit the menu' : '', ".");
      case 'input':
        return isInitialFocus ? "".concat(props['aria-label'] || 'Select', " is focused ").concat(isSearchable ? ',type to refine list' : '', ", press Down to open the menu, ").concat(isMulti ? ' press left to focus selected values' : '') : '';
      case 'value':
        return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';
      default:
        return '';
    }
  },
  onChange: function onChange(props) {
    var action = props.action,
      _props$label = props.label,
      label = _props$label === void 0 ? '' : _props$label,
      labels = props.labels,
      isDisabled = props.isDisabled;
    switch (action) {
      case 'deselect-option':
      case 'pop-value':
      case 'remove-value':
        return "option ".concat(label, ", deselected.");
      case 'clear':
        return 'All selected options have been cleared.';
      case 'initial-input-focus':
        return "option".concat(labels.length > 1 ? 's' : '', " ").concat(labels.join(','), ", selected.");
      case 'select-option':
        return isDisabled ? "option ".concat(label, " is disabled. Select another option.") : "option ".concat(label, ", selected.");
      default:
        return '';
    }
  },
  onFocus: function onFocus(props) {
    var context = props.context,
      focused = props.focused,
      options = props.options,
      _props$label2 = props.label,
      label = _props$label2 === void 0 ? '' : _props$label2,
      selectValue = props.selectValue,
      isDisabled = props.isDisabled,
      isSelected = props.isSelected,
      isAppleDevice = props.isAppleDevice;
    var getArrayIndex = function getArrayIndex(arr, item) {
      return arr && arr.length ? "".concat(arr.indexOf(item) + 1, " of ").concat(arr.length) : '';
    };
    if (context === 'value' && selectValue) {
      return "value ".concat(label, " focused, ").concat(getArrayIndex(selectValue, focused), ".");
    }
    if (context === 'menu' && isAppleDevice) {
      var disabled = isDisabled ? ' disabled' : '';
      var status = "".concat(isSelected ? ' selected' : '').concat(disabled);
      return "".concat(label).concat(status, ", ").concat(getArrayIndex(options, focused), ".");
    }
    return '';
  },
  onFilter: function onFilter(props) {
    var inputValue = props.inputValue,
      resultsMessage = props.resultsMessage;
    return "".concat(resultsMessage).concat(inputValue ? ' for search term ' + inputValue : '', ".");
  }
};

var LiveRegion = function LiveRegion(props) {
  var ariaSelection = props.ariaSelection,
    focusedOption = props.focusedOption,
    focusedValue = props.focusedValue,
    focusableOptions = props.focusableOptions,
    isFocused = props.isFocused,
    selectValue = props.selectValue,
    selectProps = props.selectProps,
    id = props.id,
    isAppleDevice = props.isAppleDevice;
  var ariaLiveMessages = selectProps.ariaLiveMessages,
    getOptionLabel = selectProps.getOptionLabel,
    inputValue = selectProps.inputValue,
    isMulti = selectProps.isMulti,
    isOptionDisabled = selectProps.isOptionDisabled,
    isSearchable = selectProps.isSearchable,
    menuIsOpen = selectProps.menuIsOpen,
    options = selectProps.options,
    screenReaderStatus = selectProps.screenReaderStatus,
    tabSelectsValue = selectProps.tabSelectsValue,
    isLoading = selectProps.isLoading;
  var ariaLabel = selectProps['aria-label'];
  var ariaLive = selectProps['aria-live'];

  // Update aria live message configuration when prop changes
  var messages = (0,react.useMemo)(function () {
    return objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, defaultAriaLiveMessages), ariaLiveMessages || {});
  }, [ariaLiveMessages]);

  // Update aria live selected option when prop changes
  var ariaSelected = (0,react.useMemo)(function () {
    var message = '';
    if (ariaSelection && messages.onChange) {
      var option = ariaSelection.option,
        selectedOptions = ariaSelection.options,
        removedValue = ariaSelection.removedValue,
        removedValues = ariaSelection.removedValues,
        value = ariaSelection.value;
      // select-option when !isMulti does not return option so we assume selected option is value
      var asOption = function asOption(val) {
        return !Array.isArray(val) ? val : null;
      };

      // If there is just one item from the action then get its label
      var selected = removedValue || option || asOption(value);
      var label = selected ? getOptionLabel(selected) : '';

      // If there are multiple items from the action then return an array of labels
      var multiSelected = selectedOptions || removedValues || undefined;
      var labels = multiSelected ? multiSelected.map(getOptionLabel) : [];
      var onChangeProps = objectSpread2_objectSpread2({
        // multiSelected items are usually items that have already been selected
        // or set by the user as a default value so we assume they are not disabled
        isDisabled: selected && isOptionDisabled(selected, selectValue),
        label: label,
        labels: labels
      }, ariaSelection);
      message = messages.onChange(onChangeProps);
    }
    return message;
  }, [ariaSelection, messages, isOptionDisabled, selectValue, getOptionLabel]);
  var ariaFocused = (0,react.useMemo)(function () {
    var focusMsg = '';
    var focused = focusedOption || focusedValue;
    var isSelected = !!(focusedOption && selectValue && selectValue.includes(focusedOption));
    if (focused && messages.onFocus) {
      var onFocusProps = {
        focused: focused,
        label: getOptionLabel(focused),
        isDisabled: isOptionDisabled(focused, selectValue),
        isSelected: isSelected,
        options: focusableOptions,
        context: focused === focusedOption ? 'menu' : 'value',
        selectValue: selectValue,
        isAppleDevice: isAppleDevice
      };
      focusMsg = messages.onFocus(onFocusProps);
    }
    return focusMsg;
  }, [focusedOption, focusedValue, getOptionLabel, isOptionDisabled, messages, focusableOptions, selectValue, isAppleDevice]);
  var ariaResults = (0,react.useMemo)(function () {
    var resultsMsg = '';
    if (menuIsOpen && options.length && !isLoading && messages.onFilter) {
      var resultsMessage = screenReaderStatus({
        count: focusableOptions.length
      });
      resultsMsg = messages.onFilter({
        inputValue: inputValue,
        resultsMessage: resultsMessage
      });
    }
    return resultsMsg;
  }, [focusableOptions, inputValue, menuIsOpen, messages, options, screenReaderStatus, isLoading]);
  var isInitialFocus = (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus';
  var ariaGuidance = (0,react.useMemo)(function () {
    var guidanceMsg = '';
    if (messages.guidance) {
      var context = focusedValue ? 'value' : menuIsOpen ? 'menu' : 'input';
      guidanceMsg = messages.guidance({
        'aria-label': ariaLabel,
        context: context,
        isDisabled: focusedOption && isOptionDisabled(focusedOption, selectValue),
        isMulti: isMulti,
        isSearchable: isSearchable,
        tabSelectsValue: tabSelectsValue,
        isInitialFocus: isInitialFocus
      });
    }
    return guidanceMsg;
  }, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
  var ScreenReaderText = (0,emotion_react_browser_esm/* jsx */.Y)(react.Fragment, null, (0,emotion_react_browser_esm/* jsx */.Y)("span", {
    id: "aria-selection"
  }, ariaSelected), (0,emotion_react_browser_esm/* jsx */.Y)("span", {
    id: "aria-focused"
  }, ariaFocused), (0,emotion_react_browser_esm/* jsx */.Y)("span", {
    id: "aria-results"
  }, ariaResults), (0,emotion_react_browser_esm/* jsx */.Y)("span", {
    id: "aria-guidance"
  }, ariaGuidance));
  return (0,emotion_react_browser_esm/* jsx */.Y)(react.Fragment, null, (0,emotion_react_browser_esm/* jsx */.Y)(A11yText$1, {
    id: id
  }, isInitialFocus && ScreenReaderText), (0,emotion_react_browser_esm/* jsx */.Y)(A11yText$1, {
    "aria-live": ariaLive,
    "aria-atomic": "false",
    "aria-relevant": "additions text",
    role: "log"
  }, isFocused && !isInitialFocus && ScreenReaderText));
};
var LiveRegion$1 = LiveRegion;

var diacritics = [{
  base: 'A',
  letters: "A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"
}, {
  base: 'AA',
  letters: "\uA732"
}, {
  base: 'AE',
  letters: "\xC6\u01FC\u01E2"
}, {
  base: 'AO',
  letters: "\uA734"
}, {
  base: 'AU',
  letters: "\uA736"
}, {
  base: 'AV',
  letters: "\uA738\uA73A"
}, {
  base: 'AY',
  letters: "\uA73C"
}, {
  base: 'B',
  letters: "B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"
}, {
  base: 'C',
  letters: "C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"
}, {
  base: 'D',
  letters: "D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"
}, {
  base: 'DZ',
  letters: "\u01F1\u01C4"
}, {
  base: 'Dz',
  letters: "\u01F2\u01C5"
}, {
  base: 'E',
  letters: "E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"
}, {
  base: 'F',
  letters: "F\u24BB\uFF26\u1E1E\u0191\uA77B"
}, {
  base: 'G',
  letters: "G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"
}, {
  base: 'H',
  letters: "H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"
}, {
  base: 'I',
  letters: "I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"
}, {
  base: 'J',
  letters: "J\u24BF\uFF2A\u0134\u0248"
}, {
  base: 'K',
  letters: "K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"
}, {
  base: 'L',
  letters: "L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"
}, {
  base: 'LJ',
  letters: "\u01C7"
}, {
  base: 'Lj',
  letters: "\u01C8"
}, {
  base: 'M',
  letters: "M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"
}, {
  base: 'N',
  letters: "N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"
}, {
  base: 'NJ',
  letters: "\u01CA"
}, {
  base: 'Nj',
  letters: "\u01CB"
}, {
  base: 'O',
  letters: "O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"
}, {
  base: 'OI',
  letters: "\u01A2"
}, {
  base: 'OO',
  letters: "\uA74E"
}, {
  base: 'OU',
  letters: "\u0222"
}, {
  base: 'P',
  letters: "P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"
}, {
  base: 'Q',
  letters: "Q\u24C6\uFF31\uA756\uA758\u024A"
}, {
  base: 'R',
  letters: "R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"
}, {
  base: 'S',
  letters: "S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"
}, {
  base: 'T',
  letters: "T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"
}, {
  base: 'TZ',
  letters: "\uA728"
}, {
  base: 'U',
  letters: "U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"
}, {
  base: 'V',
  letters: "V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"
}, {
  base: 'VY',
  letters: "\uA760"
}, {
  base: 'W',
  letters: "W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"
}, {
  base: 'X',
  letters: "X\u24CD\uFF38\u1E8A\u1E8C"
}, {
  base: 'Y',
  letters: "Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"
}, {
  base: 'Z',
  letters: "Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"
}, {
  base: 'a',
  letters: "a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"
}, {
  base: 'aa',
  letters: "\uA733"
}, {
  base: 'ae',
  letters: "\xE6\u01FD\u01E3"
}, {
  base: 'ao',
  letters: "\uA735"
}, {
  base: 'au',
  letters: "\uA737"
}, {
  base: 'av',
  letters: "\uA739\uA73B"
}, {
  base: 'ay',
  letters: "\uA73D"
}, {
  base: 'b',
  letters: "b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"
}, {
  base: 'c',
  letters: "c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"
}, {
  base: 'd',
  letters: "d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"
}, {
  base: 'dz',
  letters: "\u01F3\u01C6"
}, {
  base: 'e',
  letters: "e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"
}, {
  base: 'f',
  letters: "f\u24D5\uFF46\u1E1F\u0192\uA77C"
}, {
  base: 'g',
  letters: "g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"
}, {
  base: 'h',
  letters: "h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"
}, {
  base: 'hv',
  letters: "\u0195"
}, {
  base: 'i',
  letters: "i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"
}, {
  base: 'j',
  letters: "j\u24D9\uFF4A\u0135\u01F0\u0249"
}, {
  base: 'k',
  letters: "k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"
}, {
  base: 'l',
  letters: "l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"
}, {
  base: 'lj',
  letters: "\u01C9"
}, {
  base: 'm',
  letters: "m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"
}, {
  base: 'n',
  letters: "n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"
}, {
  base: 'nj',
  letters: "\u01CC"
}, {
  base: 'o',
  letters: "o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"
}, {
  base: 'oi',
  letters: "\u01A3"
}, {
  base: 'ou',
  letters: "\u0223"
}, {
  base: 'oo',
  letters: "\uA74F"
}, {
  base: 'p',
  letters: "p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"
}, {
  base: 'q',
  letters: "q\u24E0\uFF51\u024B\uA757\uA759"
}, {
  base: 'r',
  letters: "r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"
}, {
  base: 's',
  letters: "s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"
}, {
  base: 't',
  letters: "t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"
}, {
  base: 'tz',
  letters: "\uA729"
}, {
  base: 'u',
  letters: "u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"
}, {
  base: 'v',
  letters: "v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"
}, {
  base: 'vy',
  letters: "\uA761"
}, {
  base: 'w',
  letters: "w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"
}, {
  base: 'x',
  letters: "x\u24E7\uFF58\u1E8B\u1E8D"
}, {
  base: 'y',
  letters: "y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"
}, {
  base: 'z',
  letters: "z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"
}];
var anyDiacritic = new RegExp('[' + diacritics.map(function (d) {
  return d.letters;
}).join('') + ']', 'g');
var diacriticToBase = {};
for (var Select_aab027f3_esm_i = 0; Select_aab027f3_esm_i < diacritics.length; Select_aab027f3_esm_i++) {
  var diacritic = diacritics[Select_aab027f3_esm_i];
  for (var Select_aab027f3_esm_j = 0; Select_aab027f3_esm_j < diacritic.letters.length; Select_aab027f3_esm_j++) {
    diacriticToBase[diacritic.letters[Select_aab027f3_esm_j]] = diacritic.base;
  }
}
var Select_aab027f3_esm_stripDiacritics = function stripDiacritics(str) {
  return str.replace(anyDiacritic, function (match) {
    return diacriticToBase[match];
  });
};

var memoizedStripDiacriticsForInput = (0,memoize_one_esm["default"])(Select_aab027f3_esm_stripDiacritics);
var trimString = function trimString(str) {
  return str.replace(/^\s+|\s+$/g, '');
};
var defaultStringify = function defaultStringify(option) {
  return "".concat(option.label, " ").concat(option.value);
};
var createFilter = function createFilter(config) {
  return function (option, rawInput) {
    // eslint-disable-next-line no-underscore-dangle
    if (option.data.__isNew__) return true;
    var _ignoreCase$ignoreAcc = objectSpread2_objectSpread2({
        ignoreCase: true,
        ignoreAccents: true,
        stringify: defaultStringify,
        trim: true,
        matchFrom: 'any'
      }, config),
      ignoreCase = _ignoreCase$ignoreAcc.ignoreCase,
      ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents,
      stringify = _ignoreCase$ignoreAcc.stringify,
      trim = _ignoreCase$ignoreAcc.trim,
      matchFrom = _ignoreCase$ignoreAcc.matchFrom;
    var input = trim ? trimString(rawInput) : rawInput;
    var candidate = trim ? trimString(stringify(option)) : stringify(option);
    if (ignoreCase) {
      input = input.toLowerCase();
      candidate = candidate.toLowerCase();
    }
    if (ignoreAccents) {
      input = memoizedStripDiacriticsForInput(input);
      candidate = Select_aab027f3_esm_stripDiacritics(candidate);
    }
    return matchFrom === 'start' ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1;
  };
};

var Select_aab027f3_esm_excluded = ["innerRef"];
function DummyInput(_ref) {
  var innerRef = _ref.innerRef,
    props = objectWithoutProperties_objectWithoutProperties(_ref, Select_aab027f3_esm_excluded);
  // Remove animation props not meant for HTML elements
  var filteredProps = removeProps(props, 'onExited', 'in', 'enter', 'exit', 'appear');
  return (0,emotion_react_browser_esm/* jsx */.Y)("input", (0,esm_extends/* default */.A)({
    ref: innerRef
  }, filteredProps, {
    css: /*#__PURE__*/(0,emotion_react_browser_esm/* css */.AH)({
      label: 'dummyInput',
      // get rid of any default styles
      background: 0,
      border: 0,
      // important! this hides the flashing cursor
      caretColor: 'transparent',
      fontSize: 'inherit',
      gridArea: '1 / 1 / 2 / 3',
      outline: 0,
      padding: 0,
      // important! without `width` browsers won't allow focus
      width: 1,
      // remove cursor on desktop
      color: 'transparent',
      // remove cursor on mobile whilst maintaining "scroll into view" behaviour
      left: -100,
      opacity: 0,
      position: 'relative',
      transform: 'scale(.01)'
    },  true ? "" : 0,  true ? "" : 0)
  }));
}

var cancelScroll = function cancelScroll(event) {
  if (event.cancelable) event.preventDefault();
  event.stopPropagation();
};
function useScrollCapture(_ref) {
  var isEnabled = _ref.isEnabled,
    onBottomArrive = _ref.onBottomArrive,
    onBottomLeave = _ref.onBottomLeave,
    onTopArrive = _ref.onTopArrive,
    onTopLeave = _ref.onTopLeave;
  var isBottom = (0,react.useRef)(false);
  var isTop = (0,react.useRef)(false);
  var touchStart = (0,react.useRef)(0);
  var scrollTarget = (0,react.useRef)(null);
  var handleEventDelta = (0,react.useCallback)(function (event, delta) {
    if (scrollTarget.current === null) return;
    var _scrollTarget$current = scrollTarget.current,
      scrollTop = _scrollTarget$current.scrollTop,
      scrollHeight = _scrollTarget$current.scrollHeight,
      clientHeight = _scrollTarget$current.clientHeight;
    var target = scrollTarget.current;
    var isDeltaPositive = delta > 0;
    var availableScroll = scrollHeight - clientHeight - scrollTop;
    var shouldCancelScroll = false;

    // reset bottom/top flags
    if (availableScroll > delta && isBottom.current) {
      if (onBottomLeave) onBottomLeave(event);
      isBottom.current = false;
    }
    if (isDeltaPositive && isTop.current) {
      if (onTopLeave) onTopLeave(event);
      isTop.current = false;
    }

    // bottom limit
    if (isDeltaPositive && delta > availableScroll) {
      if (onBottomArrive && !isBottom.current) {
        onBottomArrive(event);
      }
      target.scrollTop = scrollHeight;
      shouldCancelScroll = true;
      isBottom.current = true;

      // top limit
    } else if (!isDeltaPositive && -delta > scrollTop) {
      if (onTopArrive && !isTop.current) {
        onTopArrive(event);
      }
      target.scrollTop = 0;
      shouldCancelScroll = true;
      isTop.current = true;
    }

    // cancel scroll
    if (shouldCancelScroll) {
      cancelScroll(event);
    }
  }, [onBottomArrive, onBottomLeave, onTopArrive, onTopLeave]);
  var onWheel = (0,react.useCallback)(function (event) {
    handleEventDelta(event, event.deltaY);
  }, [handleEventDelta]);
  var onTouchStart = (0,react.useCallback)(function (event) {
    // set touch start so we can calculate touchmove delta
    touchStart.current = event.changedTouches[0].clientY;
  }, []);
  var onTouchMove = (0,react.useCallback)(function (event) {
    var deltaY = touchStart.current - event.changedTouches[0].clientY;
    handleEventDelta(event, deltaY);
  }, [handleEventDelta]);
  var startListening = (0,react.useCallback)(function (el) {
    // bail early if no element is available to attach to
    if (!el) return;
    var notPassive = supportsPassiveEvents ? {
      passive: false
    } : false;
    el.addEventListener('wheel', onWheel, notPassive);
    el.addEventListener('touchstart', onTouchStart, notPassive);
    el.addEventListener('touchmove', onTouchMove, notPassive);
  }, [onTouchMove, onTouchStart, onWheel]);
  var stopListening = (0,react.useCallback)(function (el) {
    // bail early if no element is available to detach from
    if (!el) return;
    el.removeEventListener('wheel', onWheel, false);
    el.removeEventListener('touchstart', onTouchStart, false);
    el.removeEventListener('touchmove', onTouchMove, false);
  }, [onTouchMove, onTouchStart, onWheel]);
  (0,react.useEffect)(function () {
    if (!isEnabled) return;
    var element = scrollTarget.current;
    startListening(element);
    return function () {
      stopListening(element);
    };
  }, [isEnabled, startListening, stopListening]);
  return function (element) {
    scrollTarget.current = element;
  };
}

var STYLE_KEYS = ['boxSizing', 'height', 'overflow', 'paddingRight', 'position'];
var LOCK_STYLES = {
  boxSizing: 'border-box',
  // account for possible declaration `width: 100%;` on body
  overflow: 'hidden',
  position: 'relative',
  height: '100%'
};
function preventTouchMove(e) {
  if (e.cancelable) e.preventDefault();
}
function allowTouchMove(e) {
  e.stopPropagation();
}
function preventInertiaScroll() {
  var top = this.scrollTop;
  var totalScroll = this.scrollHeight;
  var currentScroll = top + this.offsetHeight;
  if (top === 0) {
    this.scrollTop = 1;
  } else if (currentScroll === totalScroll) {
    this.scrollTop = top - 1;
  }
}

// `ontouchstart` check works on most browsers
// `maxTouchPoints` works on IE10/11 and Surface
function isTouchDevice() {
  return 'ontouchstart' in window || navigator.maxTouchPoints;
}
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
var activeScrollLocks = 0;
var listenerOptions = {
  capture: false,
  passive: false
};
function useScrollLock(_ref) {
  var isEnabled = _ref.isEnabled,
    _ref$accountForScroll = _ref.accountForScrollbars,
    accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll;
  var originalStyles = (0,react.useRef)({});
  var scrollTarget = (0,react.useRef)(null);
  var addScrollLock = (0,react.useCallback)(function (touchScrollTarget) {
    if (!canUseDOM) return;
    var target = document.body;
    var targetStyle = target && target.style;
    if (accountForScrollbars) {
      // store any styles already applied to the body
      STYLE_KEYS.forEach(function (key) {
        var val = targetStyle && targetStyle[key];
        originalStyles.current[key] = val;
      });
    }

    // apply the lock styles and padding if this is the first scroll lock
    if (accountForScrollbars && activeScrollLocks < 1) {
      var currentPadding = parseInt(originalStyles.current.paddingRight, 10) || 0;
      var clientWidth = document.body ? document.body.clientWidth : 0;
      var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0;
      Object.keys(LOCK_STYLES).forEach(function (key) {
        var val = LOCK_STYLES[key];
        if (targetStyle) {
          targetStyle[key] = val;
        }
      });
      if (targetStyle) {
        targetStyle.paddingRight = "".concat(adjustedPadding, "px");
      }
    }

    // account for touch devices
    if (target && isTouchDevice()) {
      // Mobile Safari ignores { overflow: hidden } declaration on the body.
      target.addEventListener('touchmove', preventTouchMove, listenerOptions);

      // Allow scroll on provided target
      if (touchScrollTarget) {
        touchScrollTarget.addEventListener('touchstart', preventInertiaScroll, listenerOptions);
        touchScrollTarget.addEventListener('touchmove', allowTouchMove, listenerOptions);
      }
    }

    // increment active scroll locks
    activeScrollLocks += 1;
  }, [accountForScrollbars]);
  var removeScrollLock = (0,react.useCallback)(function (touchScrollTarget) {
    if (!canUseDOM) return;
    var target = document.body;
    var targetStyle = target && target.style;

    // safely decrement active scroll locks
    activeScrollLocks = Math.max(activeScrollLocks - 1, 0);

    // reapply original body styles, if any
    if (accountForScrollbars && activeScrollLocks < 1) {
      STYLE_KEYS.forEach(function (key) {
        var val = originalStyles.current[key];
        if (targetStyle) {
          targetStyle[key] = val;
        }
      });
    }

    // remove touch listeners
    if (target && isTouchDevice()) {
      target.removeEventListener('touchmove', preventTouchMove, listenerOptions);
      if (touchScrollTarget) {
        touchScrollTarget.removeEventListener('touchstart', preventInertiaScroll, listenerOptions);
        touchScrollTarget.removeEventListener('touchmove', allowTouchMove, listenerOptions);
      }
    }
  }, [accountForScrollbars]);
  (0,react.useEffect)(function () {
    if (!isEnabled) return;
    var element = scrollTarget.current;
    addScrollLock(element);
    return function () {
      removeScrollLock(element);
    };
  }, [isEnabled, addScrollLock, removeScrollLock]);
  return function (element) {
    scrollTarget.current = element;
  };
}

function _EMOTION_STRINGIFIED_CSS_ERROR__$1() { 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)."; }
var blurSelectInput = function blurSelectInput(event) {
  var element = event.target;
  return element.ownerDocument.activeElement && element.ownerDocument.activeElement.blur();
};
var _ref2$1 =  true ? {
  name: "1kfdb0e",
  styles: "position:fixed;left:0;bottom:0;right:0;top:0"
} : 0;
function ScrollManager(_ref) {
  var children = _ref.children,
    lockEnabled = _ref.lockEnabled,
    _ref$captureEnabled = _ref.captureEnabled,
    captureEnabled = _ref$captureEnabled === void 0 ? true : _ref$captureEnabled,
    onBottomArrive = _ref.onBottomArrive,
    onBottomLeave = _ref.onBottomLeave,
    onTopArrive = _ref.onTopArrive,
    onTopLeave = _ref.onTopLeave;
  var setScrollCaptureTarget = useScrollCapture({
    isEnabled: captureEnabled,
    onBottomArrive: onBottomArrive,
    onBottomLeave: onBottomLeave,
    onTopArrive: onTopArrive,
    onTopLeave: onTopLeave
  });
  var setScrollLockTarget = useScrollLock({
    isEnabled: lockEnabled
  });
  var targetRef = function targetRef(element) {
    setScrollCaptureTarget(element);
    setScrollLockTarget(element);
  };
  return (0,emotion_react_browser_esm/* jsx */.Y)(react.Fragment, null, lockEnabled && (0,emotion_react_browser_esm/* jsx */.Y)("div", {
    onClick: blurSelectInput,
    css: _ref2$1
  }), children(targetRef));
}

function Select_aab027f3_esm_EMOTION_STRINGIFIED_CSS_ERROR_() { 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)."; }
var Select_aab027f3_esm_ref2 =  true ? {
  name: "1a0ro4n-requiredInput",
  styles: "label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"
} : 0;
var RequiredInput = function RequiredInput(_ref) {
  var name = _ref.name,
    onFocus = _ref.onFocus;
  return (0,emotion_react_browser_esm/* jsx */.Y)("input", {
    required: true,
    name: name,
    tabIndex: -1,
    "aria-hidden": "true",
    onFocus: onFocus,
    css: Select_aab027f3_esm_ref2
    // Prevent `Switching from uncontrolled to controlled` error
    ,
    value: "",
    onChange: function onChange() {}
  });
};
var RequiredInput$1 = RequiredInput;

/// <reference types="user-agent-data-types" />

function testPlatform(re) {
  var _window$navigator$use;
  return typeof window !== 'undefined' && window.navigator != null ? re.test(((_window$navigator$use = window.navigator['userAgentData']) === null || _window$navigator$use === void 0 ? void 0 : _window$navigator$use.platform) || window.navigator.platform) : false;
}
function isIPhone() {
  return testPlatform(/^iPhone/i);
}
function isMac() {
  return testPlatform(/^Mac/i);
}
function isIPad() {
  return testPlatform(/^iPad/i) ||
  // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
  isMac() && navigator.maxTouchPoints > 1;
}
function isIOS() {
  return isIPhone() || isIPad();
}
function isAppleDevice() {
  return isMac() || isIOS();
}

var formatGroupLabel = function formatGroupLabel(group) {
  return group.label;
};
var getOptionLabel$1 = function getOptionLabel(option) {
  return option.label;
};
var getOptionValue$1 = function getOptionValue(option) {
  return option.value;
};
var isOptionDisabled = function isOptionDisabled(option) {
  return !!option.isDisabled;
};

var defaultStyles = {
  clearIndicator: clearIndicatorCSS,
  container: containerCSS,
  control: css$1,
  dropdownIndicator: dropdownIndicatorCSS,
  group: groupCSS,
  groupHeading: groupHeadingCSS,
  indicatorsContainer: indicatorsContainerCSS,
  indicatorSeparator: indicatorSeparatorCSS,
  input: inputCSS,
  loadingIndicator: loadingIndicatorCSS,
  loadingMessage: loadingMessageCSS,
  menu: menuCSS,
  menuList: menuListCSS,
  menuPortal: menuPortalCSS,
  multiValue: multiValueCSS,
  multiValueLabel: multiValueLabelCSS,
  multiValueRemove: multiValueRemoveCSS,
  noOptionsMessage: noOptionsMessageCSS,
  option: optionCSS,
  placeholder: placeholderCSS,
  singleValue: index_641ee5b8_esm_css,
  valueContainer: valueContainerCSS
};
// Merge Utility
// Allows consumers to extend a base Select with additional styles

function mergeStyles(source) {
  var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  // initialize with source styles
  var styles = _objectSpread({}, source);

  // massage in target styles
  Object.keys(target).forEach(function (keyAsString) {
    var key = keyAsString;
    if (source[key]) {
      styles[key] = function (rsCss, props) {
        return target[key](source[key](rsCss, props), props);
      };
    } else {
      styles[key] = target[key];
    }
  });
  return styles;
}

var Select_aab027f3_esm_colors = {
  primary: '#2684FF',
  primary75: '#4C9AFF',
  primary50: '#B2D4FF',
  primary25: '#DEEBFF',
  danger: '#DE350B',
  dangerLight: '#FFBDAD',
  neutral0: 'hsl(0, 0%, 100%)',
  neutral5: 'hsl(0, 0%, 95%)',
  neutral10: 'hsl(0, 0%, 90%)',
  neutral20: 'hsl(0, 0%, 80%)',
  neutral30: 'hsl(0, 0%, 70%)',
  neutral40: 'hsl(0, 0%, 60%)',
  neutral50: 'hsl(0, 0%, 50%)',
  neutral60: 'hsl(0, 0%, 40%)',
  neutral70: 'hsl(0, 0%, 30%)',
  neutral80: 'hsl(0, 0%, 20%)',
  neutral90: 'hsl(0, 0%, 10%)'
};
var borderRadius = 4;
// Used to calculate consistent margin/padding on elements
var baseUnit = 4;
// The minimum height of the control
var controlHeight = 38;
// The amount of space between the control and menu */
var menuGutter = baseUnit * 2;
var Select_aab027f3_esm_spacing = {
  baseUnit: baseUnit,
  controlHeight: controlHeight,
  menuGutter: menuGutter
};
var Select_aab027f3_esm_defaultTheme = {
  borderRadius: borderRadius,
  colors: Select_aab027f3_esm_colors,
  spacing: Select_aab027f3_esm_spacing
};

var Select_aab027f3_esm_defaultProps = {
  'aria-live': 'polite',
  backspaceRemovesValue: true,
  blurInputOnSelect: isTouchCapable(),
  captureMenuScroll: !isTouchCapable(),
  classNames: {},
  closeMenuOnSelect: true,
  closeMenuOnScroll: false,
  components: {},
  controlShouldRenderValue: true,
  escapeClearsValue: false,
  filterOption: createFilter(),
  formatGroupLabel: formatGroupLabel,
  getOptionLabel: getOptionLabel$1,
  getOptionValue: getOptionValue$1,
  isDisabled: false,
  isLoading: false,
  isMulti: false,
  isRtl: false,
  isSearchable: true,
  isOptionDisabled: isOptionDisabled,
  loadingMessage: function loadingMessage() {
    return 'Loading...';
  },
  maxMenuHeight: 300,
  minMenuHeight: 140,
  menuIsOpen: false,
  menuPlacement: 'bottom',
  menuPosition: 'absolute',
  menuShouldBlockScroll: false,
  menuShouldScrollIntoView: !isMobileDevice(),
  noOptionsMessage: function noOptionsMessage() {
    return 'No options';
  },
  openMenuOnFocus: false,
  openMenuOnClick: true,
  options: [],
  pageSize: 5,
  placeholder: 'Select...',
  screenReaderStatus: function screenReaderStatus(_ref) {
    var count = _ref.count;
    return "".concat(count, " result").concat(count !== 1 ? 's' : '', " available");
  },
  styles: {},
  tabIndex: 0,
  tabSelectsValue: true,
  unstyled: false
};
function toCategorizedOption(props, option, selectValue, index) {
  var isDisabled = _isOptionDisabled(props, option, selectValue);
  var isSelected = _isOptionSelected(props, option, selectValue);
  var label = getOptionLabel(props, option);
  var value = getOptionValue(props, option);
  return {
    type: 'option',
    data: option,
    isDisabled: isDisabled,
    isSelected: isSelected,
    label: label,
    value: value,
    index: index
  };
}
function buildCategorizedOptions(props, selectValue) {
  return props.options.map(function (groupOrOption, groupOrOptionIndex) {
    if ('options' in groupOrOption) {
      var categorizedOptions = groupOrOption.options.map(function (option, optionIndex) {
        return toCategorizedOption(props, option, selectValue, optionIndex);
      }).filter(function (categorizedOption) {
        return isFocusable(props, categorizedOption);
      });
      return categorizedOptions.length > 0 ? {
        type: 'group',
        data: groupOrOption,
        options: categorizedOptions,
        index: groupOrOptionIndex
      } : undefined;
    }
    var categorizedOption = toCategorizedOption(props, groupOrOption, selectValue, groupOrOptionIndex);
    return isFocusable(props, categorizedOption) ? categorizedOption : undefined;
  }).filter(notNullish);
}
function buildFocusableOptionsFromCategorizedOptions(categorizedOptions) {
  return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
    if (categorizedOption.type === 'group') {
      optionsAccumulator.push.apply(optionsAccumulator, toConsumableArray_toConsumableArray(categorizedOption.options.map(function (option) {
        return option.data;
      })));
    } else {
      optionsAccumulator.push(categorizedOption.data);
    }
    return optionsAccumulator;
  }, []);
}
function buildFocusableOptionsWithIds(categorizedOptions, optionId) {
  return categorizedOptions.reduce(function (optionsAccumulator, categorizedOption) {
    if (categorizedOption.type === 'group') {
      optionsAccumulator.push.apply(optionsAccumulator, toConsumableArray_toConsumableArray(categorizedOption.options.map(function (option) {
        return {
          data: option.data,
          id: "".concat(optionId, "-").concat(categorizedOption.index, "-").concat(option.index)
        };
      })));
    } else {
      optionsAccumulator.push({
        data: categorizedOption.data,
        id: "".concat(optionId, "-").concat(categorizedOption.index)
      });
    }
    return optionsAccumulator;
  }, []);
}
function buildFocusableOptions(props, selectValue) {
  return buildFocusableOptionsFromCategorizedOptions(buildCategorizedOptions(props, selectValue));
}
function isFocusable(props, categorizedOption) {
  var _props$inputValue = props.inputValue,
    inputValue = _props$inputValue === void 0 ? '' : _props$inputValue;
  var data = categorizedOption.data,
    isSelected = categorizedOption.isSelected,
    label = categorizedOption.label,
    value = categorizedOption.value;
  return (!shouldHideSelectedOptions(props) || !isSelected) && _filterOption(props, {
    label: label,
    value: value,
    data: data
  }, inputValue);
}
function getNextFocusedValue(state, nextSelectValue) {
  var focusedValue = state.focusedValue,
    lastSelectValue = state.selectValue;
  var lastFocusedIndex = lastSelectValue.indexOf(focusedValue);
  if (lastFocusedIndex > -1) {
    var nextFocusedIndex = nextSelectValue.indexOf(focusedValue);
    if (nextFocusedIndex > -1) {
      // the focused value is still in the selectValue, return it
      return focusedValue;
    } else if (lastFocusedIndex < nextSelectValue.length) {
      // the focusedValue is not present in the next selectValue array by
      // reference, so return the new value at the same index
      return nextSelectValue[lastFocusedIndex];
    }
  }
  return null;
}
function getNextFocusedOption(state, options) {
  var lastFocusedOption = state.focusedOption;
  return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];
}
var getFocusedOptionId = function getFocusedOptionId(focusableOptionsWithIds, focusedOption) {
  var _focusableOptionsWith;
  var focusedOptionId = (_focusableOptionsWith = focusableOptionsWithIds.find(function (option) {
    return option.data === focusedOption;
  })) === null || _focusableOptionsWith === void 0 ? void 0 : _focusableOptionsWith.id;
  return focusedOptionId || null;
};
var getOptionLabel = function getOptionLabel(props, data) {
  return props.getOptionLabel(data);
};
var getOptionValue = function getOptionValue(props, data) {
  return props.getOptionValue(data);
};
function _isOptionDisabled(props, option, selectValue) {
  return typeof props.isOptionDisabled === 'function' ? props.isOptionDisabled(option, selectValue) : false;
}
function _isOptionSelected(props, option, selectValue) {
  if (selectValue.indexOf(option) > -1) return true;
  if (typeof props.isOptionSelected === 'function') {
    return props.isOptionSelected(option, selectValue);
  }
  var candidate = getOptionValue(props, option);
  return selectValue.some(function (i) {
    return getOptionValue(props, i) === candidate;
  });
}
function _filterOption(props, option, inputValue) {
  return props.filterOption ? props.filterOption(option, inputValue) : true;
}
var shouldHideSelectedOptions = function shouldHideSelectedOptions(props) {
  var hideSelectedOptions = props.hideSelectedOptions,
    isMulti = props.isMulti;
  if (hideSelectedOptions === undefined) return isMulti;
  return hideSelectedOptions;
};
var instanceId = 1;
var Select_aab027f3_esm_Select = /*#__PURE__*/function (_Component) {
  inherits_inherits(Select, _Component);
  var _super = createSuper_createSuper(Select);
  // Misc. Instance Properties
  // ------------------------------

  // TODO

  // Refs
  // ------------------------------

  // Lifecycle
  // ------------------------------

  function Select(_props) {
    var _this;
    classCallCheck_classCallCheck(this, Select);
    _this = _super.call(this, _props);
    _this.state = {
      ariaSelection: null,
      focusedOption: null,
      focusedOptionId: null,
      focusableOptionsWithIds: [],
      focusedValue: null,
      inputIsHidden: false,
      isFocused: false,
      selectValue: [],
      clearFocusValueOnUpdate: false,
      prevWasFocused: false,
      inputIsHiddenAfterUpdate: undefined,
      prevProps: undefined,
      instancePrefix: ''
    };
    _this.blockOptionHover = false;
    _this.isComposing = false;
    _this.commonProps = void 0;
    _this.initialTouchX = 0;
    _this.initialTouchY = 0;
    _this.openAfterFocus = false;
    _this.scrollToFocusedOptionOnUpdate = false;
    _this.userIsDragging = void 0;
    _this.isAppleDevice = isAppleDevice();
    _this.controlRef = null;
    _this.getControlRef = function (ref) {
      _this.controlRef = ref;
    };
    _this.focusedOptionRef = null;
    _this.getFocusedOptionRef = function (ref) {
      _this.focusedOptionRef = ref;
    };
    _this.menuListRef = null;
    _this.getMenuListRef = function (ref) {
      _this.menuListRef = ref;
    };
    _this.inputRef = null;
    _this.getInputRef = function (ref) {
      _this.inputRef = ref;
    };
    _this.focus = _this.focusInput;
    _this.blur = _this.blurInput;
    _this.onChange = function (newValue, actionMeta) {
      var _this$props = _this.props,
        onChange = _this$props.onChange,
        name = _this$props.name;
      actionMeta.name = name;
      _this.ariaOnChange(newValue, actionMeta);
      onChange(newValue, actionMeta);
    };
    _this.setValue = function (newValue, action, option) {
      var _this$props2 = _this.props,
        closeMenuOnSelect = _this$props2.closeMenuOnSelect,
        isMulti = _this$props2.isMulti,
        inputValue = _this$props2.inputValue;
      _this.onInputChange('', {
        action: 'set-value',
        prevInputValue: inputValue
      });
      if (closeMenuOnSelect) {
        _this.setState({
          inputIsHiddenAfterUpdate: !isMulti
        });
        _this.onMenuClose();
      }
      // when the select value should change, we should reset focusedValue
      _this.setState({
        clearFocusValueOnUpdate: true
      });
      _this.onChange(newValue, {
        action: action,
        option: option
      });
    };
    _this.selectOption = function (newValue) {
      var _this$props3 = _this.props,
        blurInputOnSelect = _this$props3.blurInputOnSelect,
        isMulti = _this$props3.isMulti,
        name = _this$props3.name;
      var selectValue = _this.state.selectValue;
      var deselected = isMulti && _this.isOptionSelected(newValue, selectValue);
      var isDisabled = _this.isOptionDisabled(newValue, selectValue);
      if (deselected) {
        var candidate = _this.getOptionValue(newValue);
        _this.setValue(multiValueAsValue(selectValue.filter(function (i) {
          return _this.getOptionValue(i) !== candidate;
        })), 'deselect-option', newValue);
      } else if (!isDisabled) {
        // Select option if option is not disabled
        if (isMulti) {
          _this.setValue(multiValueAsValue([].concat(toConsumableArray_toConsumableArray(selectValue), [newValue])), 'select-option', newValue);
        } else {
          _this.setValue(singleValueAsValue(newValue), 'select-option');
        }
      } else {
        _this.ariaOnChange(singleValueAsValue(newValue), {
          action: 'select-option',
          option: newValue,
          name: name
        });
        return;
      }
      if (blurInputOnSelect) {
        _this.blurInput();
      }
    };
    _this.removeValue = function (removedValue) {
      var isMulti = _this.props.isMulti;
      var selectValue = _this.state.selectValue;
      var candidate = _this.getOptionValue(removedValue);
      var newValueArray = selectValue.filter(function (i) {
        return _this.getOptionValue(i) !== candidate;
      });
      var newValue = valueTernary(isMulti, newValueArray, newValueArray[0] || null);
      _this.onChange(newValue, {
        action: 'remove-value',
        removedValue: removedValue
      });
      _this.focusInput();
    };
    _this.clearValue = function () {
      var selectValue = _this.state.selectValue;
      _this.onChange(valueTernary(_this.props.isMulti, [], null), {
        action: 'clear',
        removedValues: selectValue
      });
    };
    _this.popValue = function () {
      var isMulti = _this.props.isMulti;
      var selectValue = _this.state.selectValue;
      var lastSelectedValue = selectValue[selectValue.length - 1];
      var newValueArray = selectValue.slice(0, selectValue.length - 1);
      var newValue = valueTernary(isMulti, newValueArray, newValueArray[0] || null);
      if (lastSelectedValue) {
        _this.onChange(newValue, {
          action: 'pop-value',
          removedValue: lastSelectedValue
        });
      }
    };
    _this.getFocusedOptionId = function (focusedOption) {
      return getFocusedOptionId(_this.state.focusableOptionsWithIds, focusedOption);
    };
    _this.getFocusableOptionsWithIds = function () {
      return buildFocusableOptionsWithIds(buildCategorizedOptions(_this.props, _this.state.selectValue), _this.getElementId('option'));
    };
    _this.getValue = function () {
      return _this.state.selectValue;
    };
    _this.cx = function () {
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return classNames.apply(void 0, [_this.props.classNamePrefix].concat(args));
    };
    _this.getOptionLabel = function (data) {
      return getOptionLabel(_this.props, data);
    };
    _this.getOptionValue = function (data) {
      return getOptionValue(_this.props, data);
    };
    _this.getStyles = function (key, props) {
      var unstyled = _this.props.unstyled;
      var base = defaultStyles[key](props, unstyled);
      base.boxSizing = 'border-box';
      var custom = _this.props.styles[key];
      return custom ? custom(base, props) : base;
    };
    _this.getClassNames = function (key, props) {
      var _this$props$className, _this$props$className2;
      return (_this$props$className = (_this$props$className2 = _this.props.classNames)[key]) === null || _this$props$className === void 0 ? void 0 : _this$props$className.call(_this$props$className2, props);
    };
    _this.getElementId = function (element) {
      return "".concat(_this.state.instancePrefix, "-").concat(element);
    };
    _this.getComponents = function () {
      return defaultComponents(_this.props);
    };
    _this.buildCategorizedOptions = function () {
      return buildCategorizedOptions(_this.props, _this.state.selectValue);
    };
    _this.getCategorizedOptions = function () {
      return _this.props.menuIsOpen ? _this.buildCategorizedOptions() : [];
    };
    _this.buildFocusableOptions = function () {
      return buildFocusableOptionsFromCategorizedOptions(_this.buildCategorizedOptions());
    };
    _this.getFocusableOptions = function () {
      return _this.props.menuIsOpen ? _this.buildFocusableOptions() : [];
    };
    _this.ariaOnChange = function (value, actionMeta) {
      _this.setState({
        ariaSelection: objectSpread2_objectSpread2({
          value: value
        }, actionMeta)
      });
    };
    _this.onMenuMouseDown = function (event) {
      if (event.button !== 0) {
        return;
      }
      event.stopPropagation();
      event.preventDefault();
      _this.focusInput();
    };
    _this.onMenuMouseMove = function (event) {
      _this.blockOptionHover = false;
    };
    _this.onControlMouseDown = function (event) {
      // Event captured by dropdown indicator
      if (event.defaultPrevented) {
        return;
      }
      var openMenuOnClick = _this.props.openMenuOnClick;
      if (!_this.state.isFocused) {
        if (openMenuOnClick) {
          _this.openAfterFocus = true;
        }
        _this.focusInput();
      } else if (!_this.props.menuIsOpen) {
        if (openMenuOnClick) {
          _this.openMenu('first');
        }
      } else {
        if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') {
          _this.onMenuClose();
        }
      }
      if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') {
        event.preventDefault();
      }
    };
    _this.onDropdownIndicatorMouseDown = function (event) {
      // ignore mouse events that weren't triggered by the primary button
      if (event && event.type === 'mousedown' && event.button !== 0) {
        return;
      }
      if (_this.props.isDisabled) return;
      var _this$props4 = _this.props,
        isMulti = _this$props4.isMulti,
        menuIsOpen = _this$props4.menuIsOpen;
      _this.focusInput();
      if (menuIsOpen) {
        _this.setState({
          inputIsHiddenAfterUpdate: !isMulti
        });
        _this.onMenuClose();
      } else {
        _this.openMenu('first');
      }
      event.preventDefault();
    };
    _this.onClearIndicatorMouseDown = function (event) {
      // ignore mouse events that weren't triggered by the primary button
      if (event && event.type === 'mousedown' && event.button !== 0) {
        return;
      }
      _this.clearValue();
      event.preventDefault();
      _this.openAfterFocus = false;
      if (event.type === 'touchend') {
        _this.focusInput();
      } else {
        setTimeout(function () {
          return _this.focusInput();
        });
      }
    };
    _this.onScroll = function (event) {
      if (typeof _this.props.closeMenuOnScroll === 'boolean') {
        if (event.target instanceof HTMLElement && isDocumentElement(event.target)) {
          _this.props.onMenuClose();
        }
      } else if (typeof _this.props.closeMenuOnScroll === 'function') {
        if (_this.props.closeMenuOnScroll(event)) {
          _this.props.onMenuClose();
        }
      }
    };
    _this.onCompositionStart = function () {
      _this.isComposing = true;
    };
    _this.onCompositionEnd = function () {
      _this.isComposing = false;
    };
    _this.onTouchStart = function (_ref2) {
      var touches = _ref2.touches;
      var touch = touches && touches.item(0);
      if (!touch) {
        return;
      }
      _this.initialTouchX = touch.clientX;
      _this.initialTouchY = touch.clientY;
      _this.userIsDragging = false;
    };
    _this.onTouchMove = function (_ref3) {
      var touches = _ref3.touches;
      var touch = touches && touches.item(0);
      if (!touch) {
        return;
      }
      var deltaX = Math.abs(touch.clientX - _this.initialTouchX);
      var deltaY = Math.abs(touch.clientY - _this.initialTouchY);
      var moveThreshold = 5;
      _this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold;
    };
    _this.onTouchEnd = function (event) {
      if (_this.userIsDragging) return;

      // close the menu if the user taps outside
      // we're checking on event.target here instead of event.currentTarget, because we want to assert information
      // on events on child elements, not the document (which we've attached this handler to).
      if (_this.controlRef && !_this.controlRef.contains(event.target) && _this.menuListRef && !_this.menuListRef.contains(event.target)) {
        _this.blurInput();
      }

      // reset move vars
      _this.initialTouchX = 0;
      _this.initialTouchY = 0;
    };
    _this.onControlTouchEnd = function (event) {
      if (_this.userIsDragging) return;
      _this.onControlMouseDown(event);
    };
    _this.onClearIndicatorTouchEnd = function (event) {
      if (_this.userIsDragging) return;
      _this.onClearIndicatorMouseDown(event);
    };
    _this.onDropdownIndicatorTouchEnd = function (event) {
      if (_this.userIsDragging) return;
      _this.onDropdownIndicatorMouseDown(event);
    };
    _this.handleInputChange = function (event) {
      var prevInputValue = _this.props.inputValue;
      var inputValue = event.currentTarget.value;
      _this.setState({
        inputIsHiddenAfterUpdate: false
      });
      _this.onInputChange(inputValue, {
        action: 'input-change',
        prevInputValue: prevInputValue
      });
      if (!_this.props.menuIsOpen) {
        _this.onMenuOpen();
      }
    };
    _this.onInputFocus = function (event) {
      if (_this.props.onFocus) {
        _this.props.onFocus(event);
      }
      _this.setState({
        inputIsHiddenAfterUpdate: false,
        isFocused: true
      });
      if (_this.openAfterFocus || _this.props.openMenuOnFocus) {
        _this.openMenu('first');
      }
      _this.openAfterFocus = false;
    };
    _this.onInputBlur = function (event) {
      var prevInputValue = _this.props.inputValue;
      if (_this.menuListRef && _this.menuListRef.contains(document.activeElement)) {
        _this.inputRef.focus();
        return;
      }
      if (_this.props.onBlur) {
        _this.props.onBlur(event);
      }
      _this.onInputChange('', {
        action: 'input-blur',
        prevInputValue: prevInputValue
      });
      _this.onMenuClose();
      _this.setState({
        focusedValue: null,
        isFocused: false
      });
    };
    _this.onOptionHover = function (focusedOption) {
      if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {
        return;
      }
      var options = _this.getFocusableOptions();
      var focusedOptionIndex = options.indexOf(focusedOption);
      _this.setState({
        focusedOption: focusedOption,
        focusedOptionId: focusedOptionIndex > -1 ? _this.getFocusedOptionId(focusedOption) : null
      });
    };
    _this.shouldHideSelectedOptions = function () {
      return shouldHideSelectedOptions(_this.props);
    };
    _this.onValueInputFocus = function (e) {
      e.preventDefault();
      e.stopPropagation();
      _this.focus();
    };
    _this.onKeyDown = function (event) {
      var _this$props5 = _this.props,
        isMulti = _this$props5.isMulti,
        backspaceRemovesValue = _this$props5.backspaceRemovesValue,
        escapeClearsValue = _this$props5.escapeClearsValue,
        inputValue = _this$props5.inputValue,
        isClearable = _this$props5.isClearable,
        isDisabled = _this$props5.isDisabled,
        menuIsOpen = _this$props5.menuIsOpen,
        onKeyDown = _this$props5.onKeyDown,
        tabSelectsValue = _this$props5.tabSelectsValue,
        openMenuOnFocus = _this$props5.openMenuOnFocus;
      var _this$state = _this.state,
        focusedOption = _this$state.focusedOption,
        focusedValue = _this$state.focusedValue,
        selectValue = _this$state.selectValue;
      if (isDisabled) return;
      if (typeof onKeyDown === 'function') {
        onKeyDown(event);
        if (event.defaultPrevented) {
          return;
        }
      }

      // Block option hover events when the user has just pressed a key
      _this.blockOptionHover = true;
      switch (event.key) {
        case 'ArrowLeft':
          if (!isMulti || inputValue) return;
          _this.focusValue('previous');
          break;
        case 'ArrowRight':
          if (!isMulti || inputValue) return;
          _this.focusValue('next');
          break;
        case 'Delete':
        case 'Backspace':
          if (inputValue) return;
          if (focusedValue) {
            _this.removeValue(focusedValue);
          } else {
            if (!backspaceRemovesValue) return;
            if (isMulti) {
              _this.popValue();
            } else if (isClearable) {
              _this.clearValue();
            }
          }
          break;
        case 'Tab':
          if (_this.isComposing) return;
          if (event.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption ||
          // don't capture the event if the menu opens on focus and the focused
          // option is already selected; it breaks the flow of navigation
          openMenuOnFocus && _this.isOptionSelected(focusedOption, selectValue)) {
            return;
          }
          _this.selectOption(focusedOption);
          break;
        case 'Enter':
          if (event.keyCode === 229) {
            // ignore the keydown event from an Input Method Editor(IME)
            // ref. https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode
            break;
          }
          if (menuIsOpen) {
            if (!focusedOption) return;
            if (_this.isComposing) return;
            _this.selectOption(focusedOption);
            break;
          }
          return;
        case 'Escape':
          if (menuIsOpen) {
            _this.setState({
              inputIsHiddenAfterUpdate: false
            });
            _this.onInputChange('', {
              action: 'menu-close',
              prevInputValue: inputValue
            });
            _this.onMenuClose();
          } else if (isClearable && escapeClearsValue) {
            _this.clearValue();
          }
          break;
        case ' ':
          // space
          if (inputValue) {
            return;
          }
          if (!menuIsOpen) {
            _this.openMenu('first');
            break;
          }
          if (!focusedOption) return;
          _this.selectOption(focusedOption);
          break;
        case 'ArrowUp':
          if (menuIsOpen) {
            _this.focusOption('up');
          } else {
            _this.openMenu('last');
          }
          break;
        case 'ArrowDown':
          if (menuIsOpen) {
            _this.focusOption('down');
          } else {
            _this.openMenu('first');
          }
          break;
        case 'PageUp':
          if (!menuIsOpen) return;
          _this.focusOption('pageup');
          break;
        case 'PageDown':
          if (!menuIsOpen) return;
          _this.focusOption('pagedown');
          break;
        case 'Home':
          if (!menuIsOpen) return;
          _this.focusOption('first');
          break;
        case 'End':
          if (!menuIsOpen) return;
          _this.focusOption('last');
          break;
        default:
          return;
      }
      event.preventDefault();
    };
    _this.state.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);
    _this.state.selectValue = cleanValue(_props.value);
    // Set focusedOption if menuIsOpen is set on init (e.g. defaultMenuIsOpen)
    if (_props.menuIsOpen && _this.state.selectValue.length) {
      var focusableOptionsWithIds = _this.getFocusableOptionsWithIds();
      var focusableOptions = _this.buildFocusableOptions();
      var optionIndex = focusableOptions.indexOf(_this.state.selectValue[0]);
      _this.state.focusableOptionsWithIds = focusableOptionsWithIds;
      _this.state.focusedOption = focusableOptions[optionIndex];
      _this.state.focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusableOptions[optionIndex]);
    }
    return _this;
  }
  createClass_createClass(Select, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.startListeningComposition();
      this.startListeningToTouch();
      if (this.props.closeMenuOnScroll && document && document.addEventListener) {
        // Listen to all scroll events, and filter them out inside of 'onScroll'
        document.addEventListener('scroll', this.onScroll, true);
      }
      if (this.props.autoFocus) {
        this.focusInput();
      }

      // Scroll focusedOption into view if menuIsOpen is set on mount (e.g. defaultMenuIsOpen)
      if (this.props.menuIsOpen && this.state.focusedOption && this.menuListRef && this.focusedOptionRef) {
        scrollIntoView(this.menuListRef, this.focusedOptionRef);
      }
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate(prevProps) {
      var _this$props6 = this.props,
        isDisabled = _this$props6.isDisabled,
        menuIsOpen = _this$props6.menuIsOpen;
      var isFocused = this.state.isFocused;
      if (
      // ensure focus is restored correctly when the control becomes enabled
      isFocused && !isDisabled && prevProps.isDisabled ||
      // ensure focus is on the Input when the menu opens
      isFocused && menuIsOpen && !prevProps.menuIsOpen) {
        this.focusInput();
      }
      if (isFocused && isDisabled && !prevProps.isDisabled) {
        // ensure select state gets blurred in case Select is programmatically disabled while focused
        // eslint-disable-next-line react/no-did-update-set-state
        this.setState({
          isFocused: false
        }, this.onMenuClose);
      } else if (!isFocused && !isDisabled && prevProps.isDisabled && this.inputRef === document.activeElement) {
        // ensure select state gets focused in case Select is programatically re-enabled while focused (Firefox)
        // eslint-disable-next-line react/no-did-update-set-state
        this.setState({
          isFocused: true
        });
      }

      // scroll the focused option into view if necessary
      if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) {
        scrollIntoView(this.menuListRef, this.focusedOptionRef);
        this.scrollToFocusedOptionOnUpdate = false;
      }
    }
  }, {
    key: "componentWillUnmount",
    value: function componentWillUnmount() {
      this.stopListeningComposition();
      this.stopListeningToTouch();
      document.removeEventListener('scroll', this.onScroll, true);
    }

    // ==============================
    // Consumer Handlers
    // ==============================
  }, {
    key: "onMenuOpen",
    value: function onMenuOpen() {
      this.props.onMenuOpen();
    }
  }, {
    key: "onMenuClose",
    value: function onMenuClose() {
      this.onInputChange('', {
        action: 'menu-close',
        prevInputValue: this.props.inputValue
      });
      this.props.onMenuClose();
    }
  }, {
    key: "onInputChange",
    value: function onInputChange(newValue, actionMeta) {
      this.props.onInputChange(newValue, actionMeta);
    }

    // ==============================
    // Methods
    // ==============================
  }, {
    key: "focusInput",
    value: function focusInput() {
      if (!this.inputRef) return;
      this.inputRef.focus();
    }
  }, {
    key: "blurInput",
    value: function blurInput() {
      if (!this.inputRef) return;
      this.inputRef.blur();
    }

    // aliased for consumers
  }, {
    key: "openMenu",
    value: function openMenu(focusOption) {
      var _this2 = this;
      var _this$state2 = this.state,
        selectValue = _this$state2.selectValue,
        isFocused = _this$state2.isFocused;
      var focusableOptions = this.buildFocusableOptions();
      var openAtIndex = focusOption === 'first' ? 0 : focusableOptions.length - 1;
      if (!this.props.isMulti) {
        var selectedIndex = focusableOptions.indexOf(selectValue[0]);
        if (selectedIndex > -1) {
          openAtIndex = selectedIndex;
        }
      }

      // only scroll if the menu isn't already open
      this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef);
      this.setState({
        inputIsHiddenAfterUpdate: false,
        focusedValue: null,
        focusedOption: focusableOptions[openAtIndex],
        focusedOptionId: this.getFocusedOptionId(focusableOptions[openAtIndex])
      }, function () {
        return _this2.onMenuOpen();
      });
    }
  }, {
    key: "focusValue",
    value: function focusValue(direction) {
      var _this$state3 = this.state,
        selectValue = _this$state3.selectValue,
        focusedValue = _this$state3.focusedValue;

      // Only multiselects support value focusing
      if (!this.props.isMulti) return;
      this.setState({
        focusedOption: null
      });
      var focusedIndex = selectValue.indexOf(focusedValue);
      if (!focusedValue) {
        focusedIndex = -1;
      }
      var lastIndex = selectValue.length - 1;
      var nextFocus = -1;
      if (!selectValue.length) return;
      switch (direction) {
        case 'previous':
          if (focusedIndex === 0) {
            // don't cycle from the start to the end
            nextFocus = 0;
          } else if (focusedIndex === -1) {
            // if nothing is focused, focus the last value first
            nextFocus = lastIndex;
          } else {
            nextFocus = focusedIndex - 1;
          }
          break;
        case 'next':
          if (focusedIndex > -1 && focusedIndex < lastIndex) {
            nextFocus = focusedIndex + 1;
          }
          break;
      }
      this.setState({
        inputIsHidden: nextFocus !== -1,
        focusedValue: selectValue[nextFocus]
      });
    }
  }, {
    key: "focusOption",
    value: function focusOption() {
      var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'first';
      var pageSize = this.props.pageSize;
      var focusedOption = this.state.focusedOption;
      var options = this.getFocusableOptions();
      if (!options.length) return;
      var nextFocus = 0; // handles 'first'
      var focusedIndex = options.indexOf(focusedOption);
      if (!focusedOption) {
        focusedIndex = -1;
      }
      if (direction === 'up') {
        nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1;
      } else if (direction === 'down') {
        nextFocus = (focusedIndex + 1) % options.length;
      } else if (direction === 'pageup') {
        nextFocus = focusedIndex - pageSize;
        if (nextFocus < 0) nextFocus = 0;
      } else if (direction === 'pagedown') {
        nextFocus = focusedIndex + pageSize;
        if (nextFocus > options.length - 1) nextFocus = options.length - 1;
      } else if (direction === 'last') {
        nextFocus = options.length - 1;
      }
      this.scrollToFocusedOptionOnUpdate = true;
      this.setState({
        focusedOption: options[nextFocus],
        focusedValue: null,
        focusedOptionId: this.getFocusedOptionId(options[nextFocus])
      });
    }
  }, {
    key: "getTheme",
    value:
    // ==============================
    // Getters
    // ==============================

    function getTheme() {
      // Use the default theme if there are no customisations.
      if (!this.props.theme) {
        return Select_aab027f3_esm_defaultTheme;
      }
      // If the theme prop is a function, assume the function
      // knows how to merge the passed-in default theme with
      // its own modifications.
      if (typeof this.props.theme === 'function') {
        return this.props.theme(Select_aab027f3_esm_defaultTheme);
      }
      // Otherwise, if a plain theme object was passed in,
      // overlay it with the default theme.
      return objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, Select_aab027f3_esm_defaultTheme), this.props.theme);
    }
  }, {
    key: "getCommonProps",
    value: function getCommonProps() {
      var clearValue = this.clearValue,
        cx = this.cx,
        getStyles = this.getStyles,
        getClassNames = this.getClassNames,
        getValue = this.getValue,
        selectOption = this.selectOption,
        setValue = this.setValue,
        props = this.props;
      var isMulti = props.isMulti,
        isRtl = props.isRtl,
        options = props.options;
      var hasValue = this.hasValue();
      return {
        clearValue: clearValue,
        cx: cx,
        getStyles: getStyles,
        getClassNames: getClassNames,
        getValue: getValue,
        hasValue: hasValue,
        isMulti: isMulti,
        isRtl: isRtl,
        options: options,
        selectOption: selectOption,
        selectProps: props,
        setValue: setValue,
        theme: this.getTheme()
      };
    }
  }, {
    key: "hasValue",
    value: function hasValue() {
      var selectValue = this.state.selectValue;
      return selectValue.length > 0;
    }
  }, {
    key: "hasOptions",
    value: function hasOptions() {
      return !!this.getFocusableOptions().length;
    }
  }, {
    key: "isClearable",
    value: function isClearable() {
      var _this$props7 = this.props,
        isClearable = _this$props7.isClearable,
        isMulti = _this$props7.isMulti;

      // single select, by default, IS NOT clearable
      // multi select, by default, IS clearable
      if (isClearable === undefined) return isMulti;
      return isClearable;
    }
  }, {
    key: "isOptionDisabled",
    value: function isOptionDisabled(option, selectValue) {
      return _isOptionDisabled(this.props, option, selectValue);
    }
  }, {
    key: "isOptionSelected",
    value: function isOptionSelected(option, selectValue) {
      return _isOptionSelected(this.props, option, selectValue);
    }
  }, {
    key: "filterOption",
    value: function filterOption(option, inputValue) {
      return _filterOption(this.props, option, inputValue);
    }
  }, {
    key: "formatOptionLabel",
    value: function formatOptionLabel(data, context) {
      if (typeof this.props.formatOptionLabel === 'function') {
        var _inputValue = this.props.inputValue;
        var _selectValue = this.state.selectValue;
        return this.props.formatOptionLabel(data, {
          context: context,
          inputValue: _inputValue,
          selectValue: _selectValue
        });
      } else {
        return this.getOptionLabel(data);
      }
    }
  }, {
    key: "formatGroupLabel",
    value: function formatGroupLabel(data) {
      return this.props.formatGroupLabel(data);
    }

    // ==============================
    // Mouse Handlers
    // ==============================
  }, {
    key: "startListeningComposition",
    value:
    // ==============================
    // Composition Handlers
    // ==============================

    function startListeningComposition() {
      if (document && document.addEventListener) {
        document.addEventListener('compositionstart', this.onCompositionStart, false);
        document.addEventListener('compositionend', this.onCompositionEnd, false);
      }
    }
  }, {
    key: "stopListeningComposition",
    value: function stopListeningComposition() {
      if (document && document.removeEventListener) {
        document.removeEventListener('compositionstart', this.onCompositionStart);
        document.removeEventListener('compositionend', this.onCompositionEnd);
      }
    }
  }, {
    key: "startListeningToTouch",
    value:
    // ==============================
    // Touch Handlers
    // ==============================

    function startListeningToTouch() {
      if (document && document.addEventListener) {
        document.addEventListener('touchstart', this.onTouchStart, false);
        document.addEventListener('touchmove', this.onTouchMove, false);
        document.addEventListener('touchend', this.onTouchEnd, false);
      }
    }
  }, {
    key: "stopListeningToTouch",
    value: function stopListeningToTouch() {
      if (document && document.removeEventListener) {
        document.removeEventListener('touchstart', this.onTouchStart);
        document.removeEventListener('touchmove', this.onTouchMove);
        document.removeEventListener('touchend', this.onTouchEnd);
      }
    }
  }, {
    key: "renderInput",
    value:
    // ==============================
    // Renderers
    // ==============================
    function renderInput() {
      var _this$props8 = this.props,
        isDisabled = _this$props8.isDisabled,
        isSearchable = _this$props8.isSearchable,
        inputId = _this$props8.inputId,
        inputValue = _this$props8.inputValue,
        tabIndex = _this$props8.tabIndex,
        form = _this$props8.form,
        menuIsOpen = _this$props8.menuIsOpen,
        required = _this$props8.required;
      var _this$getComponents = this.getComponents(),
        Input = _this$getComponents.Input;
      var _this$state4 = this.state,
        inputIsHidden = _this$state4.inputIsHidden,
        ariaSelection = _this$state4.ariaSelection;
      var commonProps = this.commonProps;
      var id = inputId || this.getElementId('input');

      // aria attributes makes the JSX "noisy", separated for clarity
      var ariaAttributes = objectSpread2_objectSpread2(objectSpread2_objectSpread2(objectSpread2_objectSpread2({
        'aria-autocomplete': 'list',
        'aria-expanded': menuIsOpen,
        'aria-haspopup': true,
        'aria-errormessage': this.props['aria-errormessage'],
        'aria-invalid': this.props['aria-invalid'],
        'aria-label': this.props['aria-label'],
        'aria-labelledby': this.props['aria-labelledby'],
        'aria-required': required,
        role: 'combobox',
        'aria-activedescendant': this.isAppleDevice ? undefined : this.state.focusedOptionId || ''
      }, menuIsOpen && {
        'aria-controls': this.getElementId('listbox')
      }), !isSearchable && {
        'aria-readonly': true
      }), this.hasValue() ? (ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus' && {
        'aria-describedby': this.getElementId('live-region')
      } : {
        'aria-describedby': this.getElementId('placeholder')
      });
      if (!isSearchable) {
        // use a dummy input to maintain focus/blur functionality
        return /*#__PURE__*/react.createElement(DummyInput, (0,esm_extends/* default */.A)({
          id: id,
          innerRef: this.getInputRef,
          onBlur: this.onInputBlur,
          onChange: index_641ee5b8_esm_noop,
          onFocus: this.onInputFocus,
          disabled: isDisabled,
          tabIndex: tabIndex,
          inputMode: "none",
          form: form,
          value: ""
        }, ariaAttributes));
      }
      return /*#__PURE__*/react.createElement(Input, (0,esm_extends/* default */.A)({}, commonProps, {
        autoCapitalize: "none",
        autoComplete: "off",
        autoCorrect: "off",
        id: id,
        innerRef: this.getInputRef,
        isDisabled: isDisabled,
        isHidden: inputIsHidden,
        onBlur: this.onInputBlur,
        onChange: this.handleInputChange,
        onFocus: this.onInputFocus,
        spellCheck: "false",
        tabIndex: tabIndex,
        form: form,
        type: "text",
        value: inputValue
      }, ariaAttributes));
    }
  }, {
    key: "renderPlaceholderOrValue",
    value: function renderPlaceholderOrValue() {
      var _this3 = this;
      var _this$getComponents2 = this.getComponents(),
        MultiValue = _this$getComponents2.MultiValue,
        MultiValueContainer = _this$getComponents2.MultiValueContainer,
        MultiValueLabel = _this$getComponents2.MultiValueLabel,
        MultiValueRemove = _this$getComponents2.MultiValueRemove,
        SingleValue = _this$getComponents2.SingleValue,
        Placeholder = _this$getComponents2.Placeholder;
      var commonProps = this.commonProps;
      var _this$props9 = this.props,
        controlShouldRenderValue = _this$props9.controlShouldRenderValue,
        isDisabled = _this$props9.isDisabled,
        isMulti = _this$props9.isMulti,
        inputValue = _this$props9.inputValue,
        placeholder = _this$props9.placeholder;
      var _this$state5 = this.state,
        selectValue = _this$state5.selectValue,
        focusedValue = _this$state5.focusedValue,
        isFocused = _this$state5.isFocused;
      if (!this.hasValue() || !controlShouldRenderValue) {
        return inputValue ? null : /*#__PURE__*/react.createElement(Placeholder, (0,esm_extends/* default */.A)({}, commonProps, {
          key: "placeholder",
          isDisabled: isDisabled,
          isFocused: isFocused,
          innerProps: {
            id: this.getElementId('placeholder')
          }
        }), placeholder);
      }
      if (isMulti) {
        return selectValue.map(function (opt, index) {
          var isOptionFocused = opt === focusedValue;
          var key = "".concat(_this3.getOptionLabel(opt), "-").concat(_this3.getOptionValue(opt));
          return /*#__PURE__*/react.createElement(MultiValue, (0,esm_extends/* default */.A)({}, commonProps, {
            components: {
              Container: MultiValueContainer,
              Label: MultiValueLabel,
              Remove: MultiValueRemove
            },
            isFocused: isOptionFocused,
            isDisabled: isDisabled,
            key: key,
            index: index,
            removeProps: {
              onClick: function onClick() {
                return _this3.removeValue(opt);
              },
              onTouchEnd: function onTouchEnd() {
                return _this3.removeValue(opt);
              },
              onMouseDown: function onMouseDown(e) {
                e.preventDefault();
              }
            },
            data: opt
          }), _this3.formatOptionLabel(opt, 'value'));
        });
      }
      if (inputValue) {
        return null;
      }
      var singleValue = selectValue[0];
      return /*#__PURE__*/react.createElement(SingleValue, (0,esm_extends/* default */.A)({}, commonProps, {
        data: singleValue,
        isDisabled: isDisabled
      }), this.formatOptionLabel(singleValue, 'value'));
    }
  }, {
    key: "renderClearIndicator",
    value: function renderClearIndicator() {
      var _this$getComponents3 = this.getComponents(),
        ClearIndicator = _this$getComponents3.ClearIndicator;
      var commonProps = this.commonProps;
      var _this$props10 = this.props,
        isDisabled = _this$props10.isDisabled,
        isLoading = _this$props10.isLoading;
      var isFocused = this.state.isFocused;
      if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {
        return null;
      }
      var innerProps = {
        onMouseDown: this.onClearIndicatorMouseDown,
        onTouchEnd: this.onClearIndicatorTouchEnd,
        'aria-hidden': 'true'
      };
      return /*#__PURE__*/react.createElement(ClearIndicator, (0,esm_extends/* default */.A)({}, commonProps, {
        innerProps: innerProps,
        isFocused: isFocused
      }));
    }
  }, {
    key: "renderLoadingIndicator",
    value: function renderLoadingIndicator() {
      var _this$getComponents4 = this.getComponents(),
        LoadingIndicator = _this$getComponents4.LoadingIndicator;
      var commonProps = this.commonProps;
      var _this$props11 = this.props,
        isDisabled = _this$props11.isDisabled,
        isLoading = _this$props11.isLoading;
      var isFocused = this.state.isFocused;
      if (!LoadingIndicator || !isLoading) return null;
      var innerProps = {
        'aria-hidden': 'true'
      };
      return /*#__PURE__*/react.createElement(LoadingIndicator, (0,esm_extends/* default */.A)({}, commonProps, {
        innerProps: innerProps,
        isDisabled: isDisabled,
        isFocused: isFocused
      }));
    }
  }, {
    key: "renderIndicatorSeparator",
    value: function renderIndicatorSeparator() {
      var _this$getComponents5 = this.getComponents(),
        DropdownIndicator = _this$getComponents5.DropdownIndicator,
        IndicatorSeparator = _this$getComponents5.IndicatorSeparator;

      // separator doesn't make sense without the dropdown indicator
      if (!DropdownIndicator || !IndicatorSeparator) return null;
      var commonProps = this.commonProps;
      var isDisabled = this.props.isDisabled;
      var isFocused = this.state.isFocused;
      return /*#__PURE__*/react.createElement(IndicatorSeparator, (0,esm_extends/* default */.A)({}, commonProps, {
        isDisabled: isDisabled,
        isFocused: isFocused
      }));
    }
  }, {
    key: "renderDropdownIndicator",
    value: function renderDropdownIndicator() {
      var _this$getComponents6 = this.getComponents(),
        DropdownIndicator = _this$getComponents6.DropdownIndicator;
      if (!DropdownIndicator) return null;
      var commonProps = this.commonProps;
      var isDisabled = this.props.isDisabled;
      var isFocused = this.state.isFocused;
      var innerProps = {
        onMouseDown: this.onDropdownIndicatorMouseDown,
        onTouchEnd: this.onDropdownIndicatorTouchEnd,
        'aria-hidden': 'true'
      };
      return /*#__PURE__*/react.createElement(DropdownIndicator, (0,esm_extends/* default */.A)({}, commonProps, {
        innerProps: innerProps,
        isDisabled: isDisabled,
        isFocused: isFocused
      }));
    }
  }, {
    key: "renderMenu",
    value: function renderMenu() {
      var _this4 = this;
      var _this$getComponents7 = this.getComponents(),
        Group = _this$getComponents7.Group,
        GroupHeading = _this$getComponents7.GroupHeading,
        Menu = _this$getComponents7.Menu,
        MenuList = _this$getComponents7.MenuList,
        MenuPortal = _this$getComponents7.MenuPortal,
        LoadingMessage = _this$getComponents7.LoadingMessage,
        NoOptionsMessage = _this$getComponents7.NoOptionsMessage,
        Option = _this$getComponents7.Option;
      var commonProps = this.commonProps;
      var focusedOption = this.state.focusedOption;
      var _this$props12 = this.props,
        captureMenuScroll = _this$props12.captureMenuScroll,
        inputValue = _this$props12.inputValue,
        isLoading = _this$props12.isLoading,
        loadingMessage = _this$props12.loadingMessage,
        minMenuHeight = _this$props12.minMenuHeight,
        maxMenuHeight = _this$props12.maxMenuHeight,
        menuIsOpen = _this$props12.menuIsOpen,
        menuPlacement = _this$props12.menuPlacement,
        menuPosition = _this$props12.menuPosition,
        menuPortalTarget = _this$props12.menuPortalTarget,
        menuShouldBlockScroll = _this$props12.menuShouldBlockScroll,
        menuShouldScrollIntoView = _this$props12.menuShouldScrollIntoView,
        noOptionsMessage = _this$props12.noOptionsMessage,
        onMenuScrollToTop = _this$props12.onMenuScrollToTop,
        onMenuScrollToBottom = _this$props12.onMenuScrollToBottom;
      if (!menuIsOpen) return null;

      // TODO: Internal Option Type here
      var render = function render(props, id) {
        var type = props.type,
          data = props.data,
          isDisabled = props.isDisabled,
          isSelected = props.isSelected,
          label = props.label,
          value = props.value;
        var isFocused = focusedOption === data;
        var onHover = isDisabled ? undefined : function () {
          return _this4.onOptionHover(data);
        };
        var onSelect = isDisabled ? undefined : function () {
          return _this4.selectOption(data);
        };
        var optionId = "".concat(_this4.getElementId('option'), "-").concat(id);
        var innerProps = {
          id: optionId,
          onClick: onSelect,
          onMouseMove: onHover,
          onMouseOver: onHover,
          tabIndex: -1,
          role: 'option',
          'aria-selected': _this4.isAppleDevice ? undefined : isSelected // is not supported on Apple devices
        };

        return /*#__PURE__*/react.createElement(Option, (0,esm_extends/* default */.A)({}, commonProps, {
          innerProps: innerProps,
          data: data,
          isDisabled: isDisabled,
          isSelected: isSelected,
          key: optionId,
          label: label,
          type: type,
          value: value,
          isFocused: isFocused,
          innerRef: isFocused ? _this4.getFocusedOptionRef : undefined
        }), _this4.formatOptionLabel(props.data, 'menu'));
      };
      var menuUI;
      if (this.hasOptions()) {
        menuUI = this.getCategorizedOptions().map(function (item) {
          if (item.type === 'group') {
            var _data = item.data,
              options = item.options,
              groupIndex = item.index;
            var groupId = "".concat(_this4.getElementId('group'), "-").concat(groupIndex);
            var headingId = "".concat(groupId, "-heading");
            return /*#__PURE__*/react.createElement(Group, (0,esm_extends/* default */.A)({}, commonProps, {
              key: groupId,
              data: _data,
              options: options,
              Heading: GroupHeading,
              headingProps: {
                id: headingId,
                data: item.data
              },
              label: _this4.formatGroupLabel(item.data)
            }), item.options.map(function (option) {
              return render(option, "".concat(groupIndex, "-").concat(option.index));
            }));
          } else if (item.type === 'option') {
            return render(item, "".concat(item.index));
          }
        });
      } else if (isLoading) {
        var message = loadingMessage({
          inputValue: inputValue
        });
        if (message === null) return null;
        menuUI = /*#__PURE__*/react.createElement(LoadingMessage, commonProps, message);
      } else {
        var _message = noOptionsMessage({
          inputValue: inputValue
        });
        if (_message === null) return null;
        menuUI = /*#__PURE__*/react.createElement(NoOptionsMessage, commonProps, _message);
      }
      var menuPlacementProps = {
        minMenuHeight: minMenuHeight,
        maxMenuHeight: maxMenuHeight,
        menuPlacement: menuPlacement,
        menuPosition: menuPosition,
        menuShouldScrollIntoView: menuShouldScrollIntoView
      };
      var menuElement = /*#__PURE__*/react.createElement(MenuPlacer, (0,esm_extends/* default */.A)({}, commonProps, menuPlacementProps), function (_ref4) {
        var ref = _ref4.ref,
          _ref4$placerProps = _ref4.placerProps,
          placement = _ref4$placerProps.placement,
          maxHeight = _ref4$placerProps.maxHeight;
        return /*#__PURE__*/react.createElement(Menu, (0,esm_extends/* default */.A)({}, commonProps, menuPlacementProps, {
          innerRef: ref,
          innerProps: {
            onMouseDown: _this4.onMenuMouseDown,
            onMouseMove: _this4.onMenuMouseMove
          },
          isLoading: isLoading,
          placement: placement
        }), /*#__PURE__*/react.createElement(ScrollManager, {
          captureEnabled: captureMenuScroll,
          onTopArrive: onMenuScrollToTop,
          onBottomArrive: onMenuScrollToBottom,
          lockEnabled: menuShouldBlockScroll
        }, function (scrollTargetRef) {
          return /*#__PURE__*/react.createElement(MenuList, (0,esm_extends/* default */.A)({}, commonProps, {
            innerRef: function innerRef(instance) {
              _this4.getMenuListRef(instance);
              scrollTargetRef(instance);
            },
            innerProps: {
              role: 'listbox',
              'aria-multiselectable': commonProps.isMulti,
              id: _this4.getElementId('listbox')
            },
            isLoading: isLoading,
            maxHeight: maxHeight,
            focusedOption: focusedOption
          }), menuUI);
        }));
      });

      // positioning behaviour is almost identical for portalled and fixed,
      // so we use the same component. the actual portalling logic is forked
      // within the component based on `menuPosition`
      return menuPortalTarget || menuPosition === 'fixed' ? /*#__PURE__*/react.createElement(MenuPortal, (0,esm_extends/* default */.A)({}, commonProps, {
        appendTo: menuPortalTarget,
        controlElement: this.controlRef,
        menuPlacement: menuPlacement,
        menuPosition: menuPosition
      }), menuElement) : menuElement;
    }
  }, {
    key: "renderFormField",
    value: function renderFormField() {
      var _this5 = this;
      var _this$props13 = this.props,
        delimiter = _this$props13.delimiter,
        isDisabled = _this$props13.isDisabled,
        isMulti = _this$props13.isMulti,
        name = _this$props13.name,
        required = _this$props13.required;
      var selectValue = this.state.selectValue;
      if (required && !this.hasValue() && !isDisabled) {
        return /*#__PURE__*/react.createElement(RequiredInput$1, {
          name: name,
          onFocus: this.onValueInputFocus
        });
      }
      if (!name || isDisabled) return;
      if (isMulti) {
        if (delimiter) {
          var value = selectValue.map(function (opt) {
            return _this5.getOptionValue(opt);
          }).join(delimiter);
          return /*#__PURE__*/react.createElement("input", {
            name: name,
            type: "hidden",
            value: value
          });
        } else {
          var input = selectValue.length > 0 ? selectValue.map(function (opt, i) {
            return /*#__PURE__*/react.createElement("input", {
              key: "i-".concat(i),
              name: name,
              type: "hidden",
              value: _this5.getOptionValue(opt)
            });
          }) : /*#__PURE__*/react.createElement("input", {
            name: name,
            type: "hidden",
            value: ""
          });
          return /*#__PURE__*/react.createElement("div", null, input);
        }
      } else {
        var _value = selectValue[0] ? this.getOptionValue(selectValue[0]) : '';
        return /*#__PURE__*/react.createElement("input", {
          name: name,
          type: "hidden",
          value: _value
        });
      }
    }
  }, {
    key: "renderLiveRegion",
    value: function renderLiveRegion() {
      var commonProps = this.commonProps;
      var _this$state6 = this.state,
        ariaSelection = _this$state6.ariaSelection,
        focusedOption = _this$state6.focusedOption,
        focusedValue = _this$state6.focusedValue,
        isFocused = _this$state6.isFocused,
        selectValue = _this$state6.selectValue;
      var focusableOptions = this.getFocusableOptions();
      return /*#__PURE__*/react.createElement(LiveRegion$1, (0,esm_extends/* default */.A)({}, commonProps, {
        id: this.getElementId('live-region'),
        ariaSelection: ariaSelection,
        focusedOption: focusedOption,
        focusedValue: focusedValue,
        isFocused: isFocused,
        selectValue: selectValue,
        focusableOptions: focusableOptions,
        isAppleDevice: this.isAppleDevice
      }));
    }
  }, {
    key: "render",
    value: function render() {
      var _this$getComponents8 = this.getComponents(),
        Control = _this$getComponents8.Control,
        IndicatorsContainer = _this$getComponents8.IndicatorsContainer,
        SelectContainer = _this$getComponents8.SelectContainer,
        ValueContainer = _this$getComponents8.ValueContainer;
      var _this$props14 = this.props,
        className = _this$props14.className,
        id = _this$props14.id,
        isDisabled = _this$props14.isDisabled,
        menuIsOpen = _this$props14.menuIsOpen;
      var isFocused = this.state.isFocused;
      var commonProps = this.commonProps = this.getCommonProps();
      return /*#__PURE__*/react.createElement(SelectContainer, (0,esm_extends/* default */.A)({}, commonProps, {
        className: className,
        innerProps: {
          id: id,
          onKeyDown: this.onKeyDown
        },
        isDisabled: isDisabled,
        isFocused: isFocused
      }), this.renderLiveRegion(), /*#__PURE__*/react.createElement(Control, (0,esm_extends/* default */.A)({}, commonProps, {
        innerRef: this.getControlRef,
        innerProps: {
          onMouseDown: this.onControlMouseDown,
          onTouchEnd: this.onControlTouchEnd
        },
        isDisabled: isDisabled,
        isFocused: isFocused,
        menuIsOpen: menuIsOpen
      }), /*#__PURE__*/react.createElement(ValueContainer, (0,esm_extends/* default */.A)({}, commonProps, {
        isDisabled: isDisabled
      }), this.renderPlaceholderOrValue(), this.renderInput()), /*#__PURE__*/react.createElement(IndicatorsContainer, (0,esm_extends/* default */.A)({}, commonProps, {
        isDisabled: isDisabled
      }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function getDerivedStateFromProps(props, state) {
      var prevProps = state.prevProps,
        clearFocusValueOnUpdate = state.clearFocusValueOnUpdate,
        inputIsHiddenAfterUpdate = state.inputIsHiddenAfterUpdate,
        ariaSelection = state.ariaSelection,
        isFocused = state.isFocused,
        prevWasFocused = state.prevWasFocused,
        instancePrefix = state.instancePrefix;
      var options = props.options,
        value = props.value,
        menuIsOpen = props.menuIsOpen,
        inputValue = props.inputValue,
        isMulti = props.isMulti;
      var selectValue = cleanValue(value);
      var newMenuOptionsState = {};
      if (prevProps && (value !== prevProps.value || options !== prevProps.options || menuIsOpen !== prevProps.menuIsOpen || inputValue !== prevProps.inputValue)) {
        var focusableOptions = menuIsOpen ? buildFocusableOptions(props, selectValue) : [];
        var focusableOptionsWithIds = menuIsOpen ? buildFocusableOptionsWithIds(buildCategorizedOptions(props, selectValue), "".concat(instancePrefix, "-option")) : [];
        var focusedValue = clearFocusValueOnUpdate ? getNextFocusedValue(state, selectValue) : null;
        var focusedOption = getNextFocusedOption(state, focusableOptions);
        var focusedOptionId = getFocusedOptionId(focusableOptionsWithIds, focusedOption);
        newMenuOptionsState = {
          selectValue: selectValue,
          focusedOption: focusedOption,
          focusedOptionId: focusedOptionId,
          focusableOptionsWithIds: focusableOptionsWithIds,
          focusedValue: focusedValue,
          clearFocusValueOnUpdate: false
        };
      }
      // some updates should toggle the state of the input visibility
      var newInputIsHiddenState = inputIsHiddenAfterUpdate != null && props !== prevProps ? {
        inputIsHidden: inputIsHiddenAfterUpdate,
        inputIsHiddenAfterUpdate: undefined
      } : {};
      var newAriaSelection = ariaSelection;
      var hasKeptFocus = isFocused && prevWasFocused;
      if (isFocused && !hasKeptFocus) {
        // If `value` or `defaultValue` props are not empty then announce them
        // when the Select is initially focused
        newAriaSelection = {
          value: valueTernary(isMulti, selectValue, selectValue[0] || null),
          options: selectValue,
          action: 'initial-input-focus'
        };
        hasKeptFocus = !prevWasFocused;
      }

      // If the 'initial-input-focus' action has been set already
      // then reset the ariaSelection to null
      if ((ariaSelection === null || ariaSelection === void 0 ? void 0 : ariaSelection.action) === 'initial-input-focus') {
        newAriaSelection = null;
      }
      return objectSpread2_objectSpread2(objectSpread2_objectSpread2(objectSpread2_objectSpread2({}, newMenuOptionsState), newInputIsHiddenState), {}, {
        prevProps: props,
        ariaSelection: newAriaSelection,
        prevWasFocused: hasKeptFocus
      });
    }
  }]);
  return Select;
}(react.Component);
Select_aab027f3_esm_Select.defaultProps = Select_aab027f3_esm_defaultProps;



// EXTERNAL MODULE: ../../modules/ui/code/core/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js + 7 modules
var emotion_cache_browser_esm = __webpack_require__(6112);
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-select/dist/react-select.esm.js


























var StateManagedSelect = /*#__PURE__*/(0,react.forwardRef)(function (props, ref) {
  var baseSelectProps = useStateManager(props);
  return /*#__PURE__*/react.createElement(Select_aab027f3_esm_Select, (0,esm_extends/* default */.A)({
    ref: ref
  }, baseSelectProps));
});
var StateManagedSelect$1 = StateManagedSelect;

var NonceProvider = (function (_ref) {
  var nonce = _ref.nonce,
    children = _ref.children,
    cacheKey = _ref.cacheKey;
  var emotionCache = useMemo(function () {
    return createCache({
      key: cacheKey,
      nonce: nonce
    });
  }, [cacheKey, nonce]);
  return /*#__PURE__*/React.createElement(CacheProvider, {
    value: emotionCache
  }, children);
});



;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/CartSendOrderModal/ReactSelect.tsx

function ReactSelect_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function ReactSelect_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ReactSelect_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ReactSelect_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }






var ReactSelect = function ReactSelect(_ref) {
  var onSelect = _ref.onSelect,
    setValidEmailOption = _ref.setValidEmailOption,
    emailOptions = _ref.emailOptions;
  var selectPlaceholder = useTranslate(Identifier.l_send_order_select);
  var theme = Ze();
  var backgroundColor = theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.04);
  var handleEmailOptionChange = function handleEmailOptionChange(newValue) {
    if (newValue) {
      onSelect(newValue.value);
    } else {
      setValidEmailOption(false);
    }
  };
  return /*#__PURE__*/react.createElement("button", {
    type: "button",
    tabIndex: -1,
    "aria-haspopup": "listbox",
    style: {
      all: 'unset'
    }
  }, /*#__PURE__*/react.createElement(StateManagedSelect$1, {
    options: emailOptions,
    placeholder: selectPlaceholder,
    onChange: handleEmailOptionChange,
    components: {
      IndicatorSeparator: function IndicatorSeparator() {
        return null;
      }
    },
    filterOption: createFilter({
      stringify: function stringify(option) {
        return option.label;
      }
    }),
    styles: {
      control: function control(base) {
        return ReactSelect_objectSpread(ReactSelect_objectSpread({}, base), {}, {
          border: "1px solid ".concat(theme.colors.grey[100]),
          boxShadow: 'none'
        });
      },
      menu: function menu(base) {
        return ReactSelect_objectSpread(ReactSelect_objectSpread({}, base), {}, {
          maxHeight: 100,
          top: '32px',
          overflowY: 'auto'
        });
      },
      menuList: function menuList(base) {
        return ReactSelect_objectSpread(ReactSelect_objectSpread({}, base), {}, {
          maxHeight: 100,
          overflowY: 'auto'
        });
      },
      option: function option(base, state) {
        var isActive = state.isSelected || state.isFocused;
        return ReactSelect_objectSpread(ReactSelect_objectSpread({}, base), {}, {
          backgroundColor: isActive ? backgroundColor : base.backgroundColor,
          ':active': ReactSelect_objectSpread(ReactSelect_objectSpread({}, base[':active']), {}, {
            backgroundColor: backgroundColor
          }),
          color: isActive ? theme.colors.black : base.color
        });
      }
    }
  }));
};
/* harmony default export */ var CartSendOrderModal_ReactSelect = (ReactSelect);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/types/urlType.ts
// TODO Move these types to @flipsnack-utils/types because all these types have to be common for the whole project.
//  After the cleanup, this file must be removed

var urlType_UrlType = {
  PROFILE: 'profile',
  SHARE: 'share'
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/url/getShareUrl.ts




/**
 * Returns profile url
 * @param shareProps
 * @returns {string}
 */
/* harmony default export */ var getShareUrl = (function (shareProps) {
  var isPrivate = shareProps.isPrivate,
    document = shareProps.document,
    domain = shareProps.domain,
    profile = shareProps.profile,
    accountId = shareProps.accountId;
  var url = '';
  if (isPrivate) {
    var jsonProfile = profile || accountId;
    url = "".concat(getSiteAppUrl()).concat(PrivateFlipbooks, "/").concat(jsonProfile, "/").concat(document);
  } else {
    var profileUrl = getProfileUrl({
      domain: domain,
      profile: profile
    });
    var isDefaultProfileHash = profile === accountId;
    var shareProfile = isDefaultProfileHash ? profileUrl : profileUrl.toLowerCase();
    url = domain ? "".concat(shareProfile, "/").concat(document, "/full-view.html") : '';
  }
  return url;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useUrl.ts


function useUrl_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function useUrl_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? useUrl_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : useUrl_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }






/**
 * Return generated url
 * @param type
 * @param props
 * @return string
 */
/* harmony default export */ var useUrl = (function (type, props) {
  var url = '';
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    link = _useAtom2[0].link;
  switch (type) {
    case urlType_UrlType.PROFILE:
      {
        url = getProfileUrl(useUrl_objectSpread(useUrl_objectSpread({}, props), link));
        break;
      }
    case urlType_UrlType.SHARE:
      {
        url = getShareUrl(useUrl_objectSpread(useUrl_objectSpread({}, props), link));
        break;
      }
    default:
      break;
  }
  return url;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/buildUserFingerprint.ts
/**
 * Returns a string built from user's device identity
 * @return {string}
 */
/* harmony default export */ var buildUserFingerprint = (function () {
  var parameters = {
    userAgent: navigator.userAgent,
    width: window.screen.availWidth,
    height: window.screen.availHeight,
    processors: navigator.hardwareConcurrency,
    timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
    navigator: Object.keys(Object.getPrototypeOf(navigator)).length,
    languages: navigator.languages.toString()
  };
  return JSON.stringify(parameters);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/sendMessageHelper.ts



/**
 * Sends a message to the specified API endpoint by building a URL with query parameters.
 */
/* harmony default export */ var sendMessageHelper = (function (data, endpoint) {
  return new Promise(function (resolve, reject) {
    if (!endpoint) {
      resolve(false);
    } else {
      var payload = {
        Action: 'SendMessage',
        MessageBody: JSON.stringify(data)
      };
      utils_fetchApi("".concat(endpoint, "?").concat(objectToURLParams(payload))).then(function (response) {
        resolve(!!response);
      }).catch(function (e) {
        reject(e);
      });
    }
  });
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/getTotalSumPrice.ts
/**
 * Format a number to have maximum 2 decimals
 * @param {number} numberToFormat
 * @returns {number}
 */
var formatToMaximTwoDecimals = function formatToMaximTwoDecimals(numberToFormat) {
  return parseFloat(numberToFormat.toFixed(2));
};

/**
 * Get the total (sum) amount of price the client has to pay
 * @param {Array<CartItemType>} cartItems
 * @returns {string}
 */
/* harmony default export */ var getTotalSumPrice = (function (cartItems) {
  var validPrice = cartItems.filter(function (item) {
    return !!item.price;
  });
  var sum = validPrice.reduce(function (partialSum, cartItem) {
    return formatToMaximTwoDecimals(formatToMaximTwoDecimals(parseFloat(cartItem.price)) * cartItem.quantity + partialSum);
  }, 0);
  return sum ? sum.toString() : '';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/formatOrderList.ts
var keysToKeep = ['title', 'code', 'price', 'quantity', 'customizableProductProperties', 'media', 'quantityProperties', 'variantSku'];
/**
 * Format order list to contain only the fields we need to save
 * @param orderListIds - An array of product IDs in the order they were added
 * @param products - A map of product IDs to their full CartItemType objects
 * @returns A list of CartItemType objects with only the necessary fields preserved
 */

/* harmony default export */ var formatOrderList = (function (orderListIds, products) {
  return orderListIds.map(function (productId) {
    return keysToKeep.reduce(function (acc, curr) {
      var product = products[productId];
      if (product) {
        acc[curr] = product[curr];
      }
      return acc;
    }, {});
  });
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/dateFormat.ts
/**
 * Returns formatted date yyyy-mm-dd
 * @param {number} date
 * @return {string}
 */

/* harmony default export */ var dateFormat = (function (date) {
  return new Date(date).toLocaleDateString('fr-CA');
});

/**
 * Return formatted hour with pm / am
 * @param date
 * @return {string}
 */
var formatAMPM = function formatAMPM(date) {
  var d = new Date(date);
  return d.toLocaleString('en-US', {
    hour: 'numeric',
    minute: 'numeric',
    hour12: true
  });
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/getOrderFlipbookData.ts


/* harmony default export */ var getOrderFlipbookData = (function (flipbookDataBase) {
  var currency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DefaultCartConfig.currency;
  var emailData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  var showOrderNumber = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
  return {
    directLink: flipbookDataBase.directLink,
    flipbookAuthor: flipbookDataBase.author,
    flipbookTitle: flipbookDataBase.title,
    flipbookLanguage: flipbookDataBase.language,
    orderTimestamp: "".concat(dateFormat(Date.now()), " / ").concat(formatAMPM(Date.now())),
    emailLogo: emailData.emailLogo || {},
    emailSubject: emailData.emailSubject || {},
    emailBuyerSubtitle: emailData.emailBuyerSubtitle || '',
    emailFooter: emailData.emailFooter || '',
    currency: currency,
    showOrderNumber: showOrderNumber
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/url/getWellFormedUrl.ts
/**
 * Formats url with the correct protocol
 * @param {string} url
 * @param {boolean} forceAdd
 * @returns {string}
 */
/* harmony default export */ var getWellFormedUrl = (function () {
  var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  var forceAdd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var wellFormedUrl = url.trim();
  if (!forceAdd && (wellFormedUrl.length < 3 || wellFormedUrl.indexOf('.') === -1 || wellFormedUrl.lastIndexOf('.') === wellFormedUrl.length - 1)) {
    return wellFormedUrl;
  }
  if (wellFormedUrl.length > 0 && wellFormedUrl.toLowerCase().indexOf('http://') === -1 && wellFormedUrl.toLowerCase().indexOf('https://') === -1 && wellFormedUrl.toLowerCase().indexOf('ftp://') === -1) {
    wellFormedUrl = "https://".concat(wellFormedUrl);
  } else {
    var protocol = wellFormedUrl.split('://')[0].toLowerCase();
    wellFormedUrl = "".concat(protocol, "://").concat(wellFormedUrl.split('://')[1]);
  }
  return wellFormedUrl;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/TextWithLinks.tsx

function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = TextWithLinks_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
function TextWithLinks_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return TextWithLinks_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? TextWithLinks_arrayLikeToArray(r, a) : void 0; } }
function TextWithLinks_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }



// Regular expression to match URLs and email addresses in the text
var linkRegex = /https?:\/\/\S+|www\.\S+|\S+@\S+\.\S+/g;
var TextWithLinks = function TextWithLinks(_ref) {
  var text = _ref.text;
  // Find all matches in the text
  var matches = text.matchAll(linkRegex);
  var parts = [];

  // Initialize the index to keep track of the position in the text
  var lastIndex = 0;
  var _iterator = _createForOfIteratorHelper(matches),
    _step;
  try {
    for (_iterator.s(); !(_step = _iterator.n()).done;) {
      var match = _step.value;
      var _match = slicedToArray_slicedToArray(match, 1),
        url = _match[0];
      // Extract the text before the current match
      var beforeText = text.substring(lastIndex, match.index);

      // If there is text before the match, add it as plain text
      if (beforeText) {
        parts.push(/*#__PURE__*/react.createElement("span", {
          key: "text-part-".concat(lastIndex)
        }, beforeText));
      }
      var key = "link-part-".concat(match.index);

      // Determine the href based on whether it's a URL or email
      var href = url.startsWith('http') || url.startsWith('www.') ? getWellFormedUrl(url) : "mailto:".concat(url);

      // Add the link as an <a> tag
      parts.push(/*#__PURE__*/react.createElement("a", {
        key: key,
        href: href,
        target: "_blank",
        rel: "noopener noreferrer",
        style: {
          textDecoration: 'none'
        },
        tabIndex: TabIndex.DEFAULT
      }, url));

      // Update the lastIndex to the end of the current match
      lastIndex = (match.index || 0) + url.length;
    }

    // Add any remaining text after the last match
  } catch (err) {
    _iterator.e(err);
  } finally {
    _iterator.f();
  }
  var remainingText = text.substring(lastIndex);
  if (remainingText) {
    parts.push(/*#__PURE__*/react.createElement("span", {
      key: "text-part-".concat(lastIndex)
    }, remainingText));
  }
  return /*#__PURE__*/react.createElement("span", null, parts);
};
/* harmony default export */ var cart_TextWithLinks = (TextWithLinks);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/CheckBox/CheckBox.styles.ts


var CheckboxContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CheckBoxstyles__CheckboxContainer",
  componentId: "sc-7122rd-0"
})(["margin-right:8px;position:relative;display:flex;"]);
var CheckBox_styles_Icon = styled_components_browser_esm.svg.withConfig({
  displayName: "CheckBoxstyles__Icon",
  componentId: "sc-7122rd-1"
})(["fill:none;stroke-width:2px;vertical-align:top;"]);
var HiddenCheckbox = styled_components_browser_esm.input.attrs({
  type: 'checkbox'
}).withConfig({
  displayName: "CheckBoxstyles__HiddenCheckbox",
  componentId: "sc-7122rd-2"
})(["position:absolute;left:0;top:0;margin:0;outline:none;opacity:0;"]);
var StyledCheckbox = styled_components_browser_esm.div.withConfig({
  displayName: "CheckBoxstyles__StyledCheckbox",
  componentId: "sc-7122rd-3"
})(["&.checked{background-color:", ";border:2px solid transparent;}display:inline-block;outline:none;width:15px;height:15px;background-color:", ";border:", ";border-radius:2px;transition:background-color 150ms cubic-bezier(0.4,0,0.2,1) 0ms;", ":focus + &{box-shadow:0 0 0 1px white;}", "{visibility:", ";stroke:", "}"], function (_ref) {
  var theme = _ref.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.colors.transparent;
}, function (_ref3) {
  var inverted = _ref3.inverted,
    theme = _ref3.theme;
  return inverted ? "2px solid ".concat(theme.colors.black) : "2px solid ".concat(theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.4));
}, HiddenCheckbox, CheckBox_styles_Icon, function (_ref4) {
  var $checked = _ref4.$checked;
  return $checked ? 'visible' : 'hidden';
}, function (_ref5) {
  var inverted = _ref5.inverted;
  return inverted ? 'white' : 'black';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/CheckBox/CheckBox.tsx




var CheckBox_CheckBox_CheckBox = function CheckBox(_ref) {
  var checked = _ref.checked,
    onChange = _ref.onChange,
    _ref$inverted = _ref.inverted,
    inverted = _ref$inverted === void 0 ? false : _ref$inverted,
    ariaLabelIdentifier = _ref.ariaLabelIdentifier,
    _ref$id = _ref.id,
    id = _ref$id === void 0 ? 'check-box' : _ref$id;
  return /*#__PURE__*/react.createElement(CheckboxContainer, null, /*#__PURE__*/react.createElement(HiddenCheckbox, {
    tabIndex: TabIndex.CONTENT,
    checked: checked,
    onChange: onChange,
    "aria-label": useTranslate(ariaLabelIdentifier),
    id: id
  }), /*#__PURE__*/react.createElement(StyledCheckbox, {
    className: checked ? 'checked' : '',
    $checked: checked,
    inverted: inverted
  }, /*#__PURE__*/react.createElement(CheckBox_styles_Icon, {
    viewBox: "0 0 24 24"
  }, /*#__PURE__*/react.createElement("polyline", {
    points: "20 6 9 17 4 12"
  }))));
};
/* harmony default export */ var components_CheckBox_CheckBox = (CheckBox_CheckBox_CheckBox);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Button/ButtonStyles.ts

function ButtonStyles_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function ButtonStyles_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ButtonStyles_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ButtonStyles_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var getButtonStyles = function getButtonStyles(theme, customStyles) {
  return ButtonStyles_objectSpread(ButtonStyles_objectSpread({}, theme), customStyles);
};
var EndIcon = styled_components_browser_esm.span.withConfig({
  displayName: "ButtonStyles__EndIcon",
  componentId: "sc-kf0pyy-0"
})(["margin-left:10px;"]);
var StartIcon = styled_components_browser_esm.span.withConfig({
  displayName: "ButtonStyles__StartIcon",
  componentId: "sc-kf0pyy-1"
})(["margin-left:10px;"]);
var ButtonContent = styled_components_browser_esm.div.withConfig({
  displayName: "ButtonStyles__ButtonContent",
  componentId: "sc-kf0pyy-2"
})(["display:flex;align-items:center;justify-content:center;", ""], function (props) {
  var styles = getButtonStyles(props.theme.button.default, props.$style || {});
  return "\n            background: ".concat(styles.background, ";\n            border-radius: ").concat(styles.borderRadius, "px;\n            width: ").concat(styles.width, "px;\n            height: ").concat(styles.height, "px;\n        ");
});
var ButtonStyles_Button = styled_components_browser_esm.button.withConfig({
  displayName: "ButtonStyles__Button",
  componentId: "sc-kf0pyy-3"
})(["transition:.2s linear;background:transparent;font-family:inherit;", ""], function (props) {
  var styles = getButtonStyles(props.theme.button.default, props.$style || {});
  var base = "\n            font-size: ".concat(styles.fontSize, "px;\n            font-weight: ").concat(styles.fontWeight, ";\n            color:").concat(styles.color, ";\n            padding: ").concat(styles.padding, "px;\n            border: ").concat(styles.border, ";\n            white-space: ").concat(styles.whiteSpace || 'normal', ";\n        ");
  var extend = '';
  if (props.disabled) {
    extend += "\n                cursor: default;\n                pointer-events: none;\n                opacity: ".concat(props.theme.button.default.disabledOpacity, ";\n            ");
  } else {
    extend += "cursor: ".concat(styles.cursor, ";");
  }
  var hoverBackgroundColor = props.$active ? props.theme.button.default.hoverActiveBackgroundColor : props.theme.button.default.hoverBackgroundColor;
  var activeBackgroundColor = props.$active ? props.theme.button.default.activeFocusBackgroundColor : props.theme.button.default.focusBackgroundColor;
  if (!main/* isMobile */.Fr) {
    extend += "\n                &:hover > div {\n                    background-color: ".concat(styles.hoverBackgroundColor ? styles.hoverBackgroundColor : hoverBackgroundColor, ";\n                }\n\n                &:active > div {\n                    background-color: ").concat(activeBackgroundColor, ";\n                }\n            ");
  }
  return "".concat(base).concat(extend);
});
var NativeButton = styled_components_browser_esm.button.withConfig({
  displayName: "ButtonStyles__NativeButton",
  componentId: "sc-kf0pyy-4"
})(["display:inline-block;font-family:", ";padding:", "px;font-size:", "px;font-weight:", ";background-color:", ";color:", ";border-radius:", "px;border:", ";text-decoration:none;cursor:pointer;"], function (_ref) {
  var theme = _ref.theme;
  return theme.button.default.fontFamily;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.button.default.padding;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.button.default.fontSize;
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.button.default.fontWeight;
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.colors.black;
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.colors.white;
}, function (_ref7) {
  var theme = _ref7.theme;
  return theme.button.default.borderRadius;
}, function (_ref8) {
  var theme = _ref8.theme;
  return theme.button.default.border;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Button/Button.tsx





var GeneralComponents_Button_Button_Button = function Button(props) {
  var _props$tabIndex = props.tabIndex,
    tabIndex = _props$tabIndex === void 0 ? TabIndex.DEFAULT : _props$tabIndex;
  var active = props.isActive || false;
  var attributes = {};
  if (typeof props.onClick === 'function' && !props.disabled) {
    attributes.onClick = props.onClick;
  }
  attributes.tabIndex = useTabIndex(tabIndex, true);
  return /*#__PURE__*/react.createElement(ButtonStyles_Button, (0,esm_extends/* default */.A)({}, attributes, {
    type: "button",
    disabled: props.disabled,
    $active: active,
    $style: props.style,
    "aria-label": props.ariaLabel
  }), /*#__PURE__*/react.createElement(ButtonContent, {
    $active: active,
    $style: props.style
  }, props.startIcon && /*#__PURE__*/react.createElement(StartIcon, null, props.startIcon), props.children, props.endIcon && /*#__PURE__*/react.createElement(EndIcon, null, props.endIcon)));
};
/* harmony default export */ var GeneralComponents_Button_Button = (GeneralComponents_Button_Button_Button);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Button/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/CartSendOrderModal/CartSendOrder.styles.tsx



var SendOrderContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartSendOrderstyles__SendOrderContainer",
  componentId: "sc-18921aa-0"
})(["max-width:500px;"]);
var CartSendOrderTextStatus = styled_components_browser_esm.div.withConfig({
  displayName: "CartSendOrderstyles__CartSendOrderTextStatus",
  componentId: "sc-18921aa-1"
})(["display:flex;flex-direction:column;gap:8px;"]);
var CartSendOrderHeader = styled_components_browser_esm(H2).withConfig({
  displayName: "CartSendOrderstyles__CartSendOrderHeader",
  componentId: "sc-18921aa-2"
})(["margin-bottom:8px;"]);
var CartSendOrderParagraph = styled_components_browser_esm(Paragraph).withConfig({
  displayName: "CartSendOrderstyles__CartSendOrderParagraph",
  componentId: "sc-18921aa-3"
})(["margin-bottom:8px;"]);
var CartSendOrderFields = styled_components_browser_esm.div.withConfig({
  displayName: "CartSendOrderstyles__CartSendOrderFields",
  componentId: "sc-18921aa-4"
})(["margin-top:8px;display:flex;flex-direction:column;"]);
var PrivacyPolicyLabel = styled_components_browser_esm.div.withConfig({
  displayName: "CartSendOrderstyles__PrivacyPolicyLabel",
  componentId: "sc-18921aa-5"
})(["padding-right:8px;overflow:hidden;display:flex;align-items:center;text-overflow:ellipsis;"]);
var PrivacyPolicyLabelLink = styled_components_browser_esm.a.withConfig({
  displayName: "CartSendOrderstyles__PrivacyPolicyLabelLink",
  componentId: "sc-18921aa-6"
})(["color:", ";text-decoration:none;padding:0 3px;&:hover{opacity:", ";}"], function (_ref) {
  var theme = _ref.theme;
  return theme.colors.getLinkColor(theme.colors.primary);
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.link.hoverOpacity;
});
var SendOrderButtonContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartSendOrderstyles__SendOrderButtonContainer",
  componentId: "sc-18921aa-7"
})(["margin-left:auto;"]);
var SendOrderButtonLabel = styled_components_browser_esm.span.withConfig({
  displayName: "CartSendOrderstyles__SendOrderButtonLabel",
  componentId: "sc-18921aa-8"
})(["padding:", ";"], function (_ref3) {
  var $paddingX = _ref3.$paddingX,
    $paddingY = _ref3.$paddingY;
  return "".concat($paddingX, "px ").concat($paddingY, "px");
});
var CartSendOrderFooter = styled_components_browser_esm.div.withConfig({
  displayName: "CartSendOrderstyles__CartSendOrderFooter",
  componentId: "sc-18921aa-9"
})(["margin-top:24px;display:flex;justify-content:space-between;align-items:center;"]);
var CartSuccessfulOrderContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartSendOrderstyles__CartSuccessfulOrderContainer",
  componentId: "sc-18921aa-10"
})(["background:", ";text-align:center;width:", ";display:flex;flex-direction:column;align-items:center;gap:24px;"], function (_ref4) {
  var theme = _ref4.theme;
  return theme.colors.white;
}, main/* isMobile */.Fr ? '100%' : '452px');
var Recaptcha = styled_components_browser_esm.div.withConfig({
  displayName: "CartSendOrderstyles__Recaptcha",
  componentId: "sc-18921aa-11"
})(["display:none;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/generateProductListText.ts
/**
 * Returns the order formatted in text for WhatsApp and Slack order
 */
/* harmony default export */ var generateProductListText = (function (item) {
  var _item$customizablePro, _item$customizablePro2, _item$customizablePro3;
  var currency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  var pricePart = item.price ? " | ".concat(item.price, " ").concat(currency) : '';
  var customizableProductPart = item !== null && item !== void 0 && (_item$customizablePro = item.customizableProductProperties) !== null && _item$customizablePro !== void 0 && _item$customizablePro.value ? "".concat(item === null || item === void 0 || (_item$customizablePro2 = item.customizableProductProperties) === null || _item$customizablePro2 === void 0 ? void 0 : _item$customizablePro2.label, ": ").concat(item === null || item === void 0 || (_item$customizablePro3 = item.customizableProductProperties) === null || _item$customizablePro3 === void 0 ? void 0 : _item$customizablePro3.value, " | ") : '';
  return "".concat(item.quantity, "x | ").concat(item.title, " | ").concat(customizableProductPart).concat(item.code).concat(pricePart, "\n");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/CartSendOrderModal/helpers/generateOrderMessage.tsx

var sectionSeparator = '------------------';
var generateOrderMessage = function generateOrderMessage(_ref) {
  var orderFields = _ref.orderFields,
    orderList = _ref.orderList,
    orderId = _ref.orderId,
    totalSum = _ref.totalSum,
    currency = _ref.currency,
    showOrderNumber = _ref.showOrderNumber;
  var slackMessage = sectionSeparator + sectionSeparator;
  slackMessage += showOrderNumber ? "\nOrder ID: ".concat(orderId, "\n") : '\n';
  orderFields.forEach(function (field) {
    slackMessage += "".concat(field.fieldName, ": ").concat(field.value, "\n");
  });
  slackMessage += sectionSeparator;
  slackMessage += '\nOrder List:\n';
  orderList.forEach(function (item) {
    slackMessage += generateProductListText(item, currency);
  });
  if (totalSum) {
    slackMessage += sectionSeparator;
    slackMessage += "\nTotal: ".concat(totalSum, " ").concat(currency, "\n");
  }
  slackMessage += sectionSeparator + sectionSeparator;
  return slackMessage;
};
/* harmony default export */ var helpers_generateOrderMessage = (generateOrderMessage);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/CartSendOrderModal/CartSendOrder.tsx




function CartSendOrder_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ CartSendOrder_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function CartSendOrder_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function CartSendOrder_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? CartSendOrder_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : CartSendOrder_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }



































var CartItemPropTypes = prop_types_default().shape({
  title: (prop_types_default()).string.isRequired,
  price: (prop_types_default()).string.isRequired,
  code: (prop_types_default()).string.isRequired,
  quantityProperties: prop_types_default().shape({
    enabled: (prop_types_default()).bool.isRequired,
    hasRange: (prop_types_default()).bool.isRequired,
    min: (prop_types_default()).number.isRequired,
    max: (prop_types_default()).number.isRequired,
    hasMOQ: (prop_types_default()).bool.isRequired
  }).isRequired,
  customizableProductProperties: prop_types_default().shape({
    label: (prop_types_default()).string.isRequired,
    value: (prop_types_default()).string.isRequired
  }).isRequired,
  quantity: (prop_types_default()).number.isRequired,
  media: prop_types_default().arrayOf(prop_types_default().shape({
    name: (prop_types_default()).string.isRequired,
    hash: (prop_types_default()).string.isRequired,
    provider: (prop_types_default()).string
  }).isRequired).isRequired
}).isRequired;
var CartSendOrderPropTypes = CartSendOrder_objectSpread(CartSendOrder_objectSpread({}, cartProps), {}, {
  clearCart: (prop_types_default()).func.isRequired,
  cartProducts: prop_types_default().arrayOf(CartItemPropTypes).isRequired,
  cartOrder: prop_types_default().arrayOf((prop_types_default()).string.isRequired).isRequired,
  orderId: (prop_types_default()).string.isRequired,
  currency: (prop_types_default()).string.isRequired,
  showOrderNumber: (prop_types_default()).bool.isRequired
});
var escapeQuotes = function escapeQuotes(text) {
  return text.toString().replaceAll('"', '');
};
var CartSendOrder = function CartSendOrder(_ref) {
  var _cart$privacyPolicy, _cart$orderPersonaliz, _cart$orderPersonaliz2, _cart$orderPersonaliz3, _cart$orderPersonaliz4, _cart$emailOptionsOrd, _cart$privacyPolicy2;
  var clearCart = _ref.clearCart,
    cartProducts = _ref.cartProducts,
    cartOrder = _ref.cartOrder,
    cart = _ref.cart,
    orderId = _ref.orderId,
    currency = _ref.currency,
    showOrderNumber = _ref.showOrderNumber;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    hash = _useAtom2$.hash,
    accountId = _useAtom2$.link.accountId,
    title = _useAtom2$.title,
    author = _useAtom2$.author,
    visibility = _useAtom2$.visibility;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    language = _useContext.options.controls.language;
  var _staticStore$config$g = getConfig(),
    orderEmailEndpoint = _staticStore$config$g.orderEmailEndpoint,
    recaptchaListKey = _staticStore$config$g.recaptchaListKey;
  var directLink = useUrl(urlType_UrlType.SHARE, {
    isPrivate: isSharedWithUsers(visibility)
  });
  var theme = Ze();
  var customerFields = (cart === null || cart === void 0 ? void 0 : cart.customerContactFields) || [];
  var isConditionalInboxType = (cart === null || cart === void 0 ? void 0 : cart.inboxType) === EmailInboxType.CONDITIONAL;
  var _useState = (0,react.useState)(customerFields === null || customerFields === void 0 ? void 0 : customerFields.some(function (field) {
      return !field.valid;
    })),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    invalidFields = _useState2[0],
    setInvalidFields = _useState2[1];
  var _useState3 = (0,react.useState)(!isConditionalInboxType),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    validEmailOption = _useState4[0],
    setValidEmailOption = _useState4[1];
  var _useState5 = (0,react.useState)(false),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    checkbox = _useState6[0],
    setCheckbox = _useState6[1];
  var _useState7 = (0,react.useState)({}),
    _useState8 = slicedToArray_slicedToArray(_useState7, 2),
    emailOption = _useState8[0],
    setEmailOption = _useState8[1];
  var recaptchaRef = (0,react.useRef)(null);
  var _useAtom3 = react_useAtom(stageSizeAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    stageSize = _useAtom4[0];
  var privacyPolicyText = useTranslate(Identifier.l_agree_to_privacy_policy);
  var submitDisabled = cart !== null && cart !== void 0 && (_cart$privacyPolicy = cart.privacyPolicy) !== null && _cart$privacyPolicy !== void 0 && _cart$privacyPolicy.enabled ? invalidFields || !validEmailOption || !checkbox : invalidFields || !validEmailOption;
  var sendOrderButtonText = (cart === null || cart === void 0 || (_cart$orderPersonaliz = cart.orderPersonalization) === null || _cart$orderPersonaliz === void 0 ? void 0 : _cart$orderPersonaliz.sendOrderButtonText) || /*#__PURE__*/react.createElement(Translate_Translate, {
    "aria-hidden": true
  }, Identifier.l_send_order_button);
  var emailOptions = (0,react.useMemo)(function () {
    return (cart === null || cart === void 0 ? void 0 : cart.emailOptions) || {};
  }, [cart === null || cart === void 0 ? void 0 : cart.emailOptions]);
  var slackWebhook = cart !== null && cart !== void 0 && (_cart$orderPersonaliz2 = cart.orderPersonalization) !== null && _cart$orderPersonaliz2 !== void 0 && (_cart$orderPersonaliz2 = _cart$orderPersonaliz2.slack) !== null && _cart$orderPersonaliz2 !== void 0 && _cart$orderPersonaliz2.enabled ? cart === null || cart === void 0 || (_cart$orderPersonaliz3 = cart.orderPersonalization) === null || _cart$orderPersonaliz3 === void 0 || (_cart$orderPersonaliz3 = _cart$orderPersonaliz3.slack) === null || _cart$orderPersonaliz3 === void 0 ? void 0 : _cart$orderPersonaliz3.webhook : '';
  var sendOrderViaEmail = cart === null || cart === void 0 || (_cart$orderPersonaliz4 = cart.orderPersonalization) === null || _cart$orderPersonaliz4 === void 0 ? void 0 : _cart$orderPersonaliz4.sendOrderButton;
  var privacyPolicyId = 'privacy-policy-agreement-input';
  var allowOrderSend = sendOrderViaEmail || !!slackWebhook;
  var orderedEmailOptions = (0,react.useMemo)(function () {
    var emailOrder = cart === null || cart === void 0 ? void 0 : cart.emailOptionsOrder;
    return (emailOrder === null || emailOrder === void 0 ? void 0 : emailOrder.map(function (key) {
      return {
        label: emailOptions[key],
        value: key
      };
    })) || [];
  }, [emailOptions, cart === null || cart === void 0 ? void 0 : cart.emailOptionsOrder]);
  var setFieldValid = function setFieldValid(index, isValid) {
    if (customerFields) {
      customerFields[index].valid = isValid;
    }
    setInvalidFields(customerFields === null || customerFields === void 0 ? void 0 : customerFields.some(function (field) {
      return !(field !== null && field !== void 0 && field.valid);
    }));
  };
  var setFieldUserInput = function setFieldUserInput(index, userInput) {
    if (customerFields) {
      customerFields[index].userInput = userInput;
    }
  };
  var toggleCheckBox = function toggleCheckBox() {
    setCheckbox(!checkbox);
  };
  var sendOrder = /*#__PURE__*/function () {
    var _ref2 = asyncToGenerator_asyncToGenerator(/*#__PURE__*/CartSendOrder_regeneratorRuntime().mark(function _callee() {
      var _recaptchaRef$current;
      var token, orderFields, emailHash, sourcesCheckoutOrder, isSlackApiSuccessful, orderList, totalSum, slackMessage, _cart$orderPersonaliz5, _cart$orderPersonaliz6, _cart$orderPersonaliz7, emailData, flipbookData;
      return CartSendOrder_regeneratorRuntime().wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            _context.next = 2;
            return recaptchaRef === null || recaptchaRef === void 0 || (_recaptchaRef$current = recaptchaRef.current) === null || _recaptchaRef$current === void 0 ? void 0 : _recaptchaRef$current.executeAsync();
          case 2:
            token = _context.sent;
            orderFields = customerFields === null || customerFields === void 0 ? void 0 : customerFields.map(function (field) {
              // The id 0 is for the email field that cannot be omitted from the customer field settings
              var requiredField = field.id === 0 ? {
                required: true
              } : {};
              return CartSendOrder_objectSpread({
                fieldName: (field === null || field === void 0 ? void 0 : field.fieldName) || '',
                value: escapeQuotes((field === null || field === void 0 ? void 0 : field.userInput) || ''),
                validation: (field === null || field === void 0 ? void 0 : field.validation) || ''
              }, requiredField);
            });
            emailHash = emailOption[CONDITIONAL_EMAIL_HASH];
            if (cart !== null && cart !== void 0 && cart.emailOptionsLabel && emailHash) {
              orderFields.unshift(CartSendOrder_objectSpread({
                fieldName: 'Inbox',
                value: emailOptions[emailHash],
                validation: 'none'
              }, emailOption));
            }
            if (!token) {
              _context.next = 28;
              break;
            }
            sourcesCheckoutOrder = [];
            isSlackApiSuccessful = true;
            orderList = formatOrderList(cartOrder, cartProducts);
            totalSum = getTotalSumPrice(orderList);
            if (!slackWebhook) {
              _context.next = 16;
              break;
            }
            slackMessage = helpers_generateOrderMessage({
              orderFields: orderFields,
              orderList: orderList,
              orderId: orderId,
              totalSum: totalSum,
              currency: currency,
              showOrderNumber: showOrderNumber
            });
            _context.next = 15;
            return utils_fetchApi(slackWebhook, {
              method: 'POST',
              body: JSON.stringify({
                text: slackMessage
              })
            }).then(function (resolve) {
              isSlackApiSuccessful = !!(resolve !== null && resolve !== void 0 && resolve.ok);
            }).catch(function () {
              isSlackApiSuccessful = false;
            });
          case 15:
            sourcesCheckoutOrder.push(SourcesType.SLACK);
          case 16:
            if (isSlackApiSuccessful) {
              _context.next = 20;
              break;
            }
            clearCart(false);
            _context.next = 28;
            break;
          case 20:
            if (!allowOrderSend) {
              _context.next = 28;
              break;
            }
            // Push email source in array sources if you have sendOrderViaEmail
            if (sendOrderViaEmail) {
              sourcesCheckoutOrder.push(SourcesType.EMAIL);
            }
            emailData = {
              emailLogo: (cart === null || cart === void 0 || (_cart$orderPersonaliz5 = cart.orderPersonalization) === null || _cart$orderPersonaliz5 === void 0 ? void 0 : _cart$orderPersonaliz5.emailLogo) || {},
              emailSubject: (cart === null || cart === void 0 || (_cart$orderPersonaliz6 = cart.orderPersonalization) === null || _cart$orderPersonaliz6 === void 0 ? void 0 : _cart$orderPersonaliz6.emailSubject) || {},
              emailBuyerSubtitle: (cart === null || cart === void 0 ? void 0 : cart.confirmationMessage) || '',
              emailFooter: (cart === null || cart === void 0 || (_cart$orderPersonaliz7 = cart.orderPersonalization) === null || _cart$orderPersonaliz7 === void 0 ? void 0 : _cart$orderPersonaliz7.emailFooter) || ''
            };
            flipbookData = getOrderFlipbookData({
              directLink: directLink,
              title: title,
              author: author,
              language: language
            }, currency, emailData, showOrderNumber);
            _context.next = 26;
            return sendMessageHelper({
              hash: hash,
              accountId: accountId,
              orderId: orderId,
              orderList: orderList,
              flipbookData: flipbookData,
              recaptchaToken: token,
              customerFields: orderFields,
              userDetails: buildUserFingerprint(),
              sources: sourcesCheckoutOrder
            }, orderEmailEndpoint);
          case 26:
            clearCart(true);
            customerFields.forEach(function (field, index) {
              setFieldUserInput(index, '');
              setFieldValid(index, !field.required);
              setValidEmailOption(!isConditionalInboxType);
              setEmailOption({});
            });
          case 28:
          case "end":
            return _context.stop();
        }
      }, _callee);
    }));
    return function sendOrder() {
      return _ref2.apply(this, arguments);
    };
  }();
  (0,react.useEffect)(function () {
    // Recaptcha modal is not responsive and on mobile devices the puzzle can't be completed
    if (main/* isMobile */.Fr && (stageSize.width <= theme.deviceSize.tabletM || stageSize.height <= theme.deviceSize.tabletM)) {
      var recaptchaIframeModal =
      // Recaptcha modal is a simple iframe that has no id or class, we target the iframe this way
      document.querySelectorAll('[title="recaptcha challenge expires in two minutes"]');
      if (recaptchaIframeModal && recaptchaIframeModal.length) {
        for (var i = 0; i <= recaptchaIframeModal.length; i++) {
          if (recaptchaIframeModal[i]) {
            var parentNode = recaptchaIframeModal[i].parentNode;
            if (parentNode) {
              parentNode.style.scale = '0.5';
              parentNode.style.marginTop = '-125px';
            }
          }
        }
      }
    }
  });
  var onSelect = function onSelect(key) {
    setEmailOption(defineProperty_defineProperty({}, CONDITIONAL_EMAIL_HASH, key));
    setValidEmailOption(true);
  };
  return /*#__PURE__*/react.createElement(SendOrderContainer, null, (cart === null || cart === void 0 ? void 0 : cart.buyerContactSectionTitle) && /*#__PURE__*/react.createElement(CartSendOrderHeader, {
    tabIndex: TabIndex.DEFAULT
  }, cart.buyerContactSectionTitle), (cart === null || cart === void 0 ? void 0 : cart.buyerContactDescription) && /*#__PURE__*/react.createElement(CartSendOrderParagraph, {
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(cart_TextWithLinks, {
    text: cart.buyerContactDescription
  })), /*#__PURE__*/react.createElement(CartSendOrderFields, null, isConditionalInboxType && !!(cart !== null && cart !== void 0 && (_cart$emailOptionsOrd = cart.emailOptionsOrder) !== null && _cart$emailOptionsOrd !== void 0 && _cart$emailOptionsOrd.length) && /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ModalContentStyles_Label, {
    required: true,
    withMarginBottom: true
  }, cart.emailOptionsLabel), /*#__PURE__*/react.createElement(CartSendOrderModal_ReactSelect, {
    onSelect: onSelect,
    setValidEmailOption: setValidEmailOption,
    emailOptions: orderedEmailOptions
  })), customerFields === null || customerFields === void 0 ? void 0 : customerFields.map(function (field, index) {
    return /*#__PURE__*/react.createElement(Input_ModalFormInputContainer, {
      key: "lead-form-input-".concat(index + 1),
      field: field,
      index: index,
      setFieldValid: setFieldValid,
      setFieldUserInput: setFieldUserInput
    });
  })), /*#__PURE__*/react.createElement(CartSendOrderFooter, null, (cart === null || cart === void 0 || (_cart$privacyPolicy2 = cart.privacyPolicy) === null || _cart$privacyPolicy2 === void 0 ? void 0 : _cart$privacyPolicy2.enabled) && /*#__PURE__*/react.createElement(PrivacyPolicyLabel, null, /*#__PURE__*/react.createElement(components_CheckBox_CheckBox, {
    checked: checkbox,
    onChange: toggleCheckBox,
    inverted: true,
    ariaLabelIdentifier: Identifier.l_agree_to_privacy_policy,
    id: privacyPolicyId
  }), /*#__PURE__*/react.createElement("label", {
    htmlFor: privacyPolicyId
  }, privacyPolicyText, /*#__PURE__*/react.createElement(PrivacyPolicyLabelLink, {
    target: "_blank",
    rel: "noopener noreferrer",
    href: (cart === null || cart === void 0 ? void 0 : cart.privacyPolicy.website) || FlipsnackPrivacyPolicy,
    tabIndex: TabIndex.DEFAULT
  }, (cart === null || cart === void 0 ? void 0 : cart.privacyPolicy.company) || 'Flipsnack'))), allowOrderSend && /*#__PURE__*/react.createElement(SendOrderButtonContainer, null, /*#__PURE__*/react.createElement(GeneralComponents_Button_Button, {
    disabled: submitDisabled,
    style: {
      background: theme.colors.getButtonColor(theme.colors.primary),
      hoverBackgroundColor: theme.colors.withOpacity(ColorsWithOpacity.PRIMARY, 0.8),
      activeBackgroundColor: theme.colors.primary,
      padding: '0',
      whiteSpace: 'nowrap'
    },
    tabIndex: TabIndex.DEFAULT,
    "aria-label": sendOrderButtonText,
    onClick: sendOrder
  }, /*#__PURE__*/react.createElement(SendOrderButtonLabel, {
    $paddingX: theme.input.paddingX,
    $paddingY: theme.input.paddingY
  }, sendOrderButtonText, /*#__PURE__*/react.createElement(Recaptcha, null, /*#__PURE__*/react.createElement(lib_esm, {
    ref: recaptchaRef,
    size: "invisible",
    sitekey: recaptchaListKey
  })))))));
};
CartSendOrder.propTypes = CartSendOrderPropTypes;
/* harmony default export */ var CartSendOrderModal_CartSendOrder = (CartSendOrder);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/CartSendOrderModal/CartSuccessfulOrder.tsx










var CartSuccessfulOrder = function CartSuccessfulOrder(_ref) {
  var orderNumber = _ref.orderNumber,
    confirmationMessage = _ref.confirmationMessage,
    showOrderNumber = _ref.showOrderNumber;
  var theme = Ze();
  var orderConfirmationHeader = useTranslate(Identifier.l_order_confirmation_header);
  return /*#__PURE__*/react.createElement(CartSuccessfulOrderContainer, null, /*#__PURE__*/react.createElement(src.SuccessfulIcon, {
    fill: theme.colors.success,
    ariaLabel: "order processed successfully"
  }), /*#__PURE__*/react.createElement(CartSendOrderTextStatus, null, showOrderNumber && /*#__PURE__*/react.createElement(H2, {
    tabIndex: TabIndex.DEFAULT
  }, "No. ".concat(orderNumber, " - ").concat(orderConfirmationHeader)), /*#__PURE__*/react.createElement(Paragraph, {
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(cart_TextWithLinks, {
    text: confirmationMessage
  }))));
};
CartSuccessfulOrder.propTypes = {
  orderNumber: (prop_types_default()).string.isRequired,
  confirmationMessage: (prop_types_default()).string.isRequired
};
/* harmony default export */ var CartSendOrderModal_CartSuccessfulOrder = (CartSuccessfulOrder);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/CartSendOrderModal/CartFailedOrder.tsx









var CartFailedOrder = function CartFailedOrder(_ref) {
  var tryAgainAction = _ref.tryAgainAction;
  var theme = Ze();
  return /*#__PURE__*/react.createElement(CartSuccessfulOrderContainer, null, /*#__PURE__*/react.createElement(src.FailedIcon, {
    fill: theme.colors.danger,
    ariaLabel: "order process failed"
  }), /*#__PURE__*/react.createElement(CartSendOrderTextStatus, null, /*#__PURE__*/react.createElement(H2, {
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_order_not_sent)), /*#__PURE__*/react.createElement(Paragraph, {
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_connection_issue))), tryAgainAction && /*#__PURE__*/react.createElement(SuccessfulSendResponse_styles_ViewResultsButton, {
    tabIndex: TabIndex.DEFAULT,
    onClick: tryAgainAction
  }, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_try_again)));
};
/* harmony default export */ var CartSendOrderModal_CartFailedOrder = (CartFailedOrder);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/CartSendOrderModal/CartSendOrderModal.tsx


function CartSendOrderModal_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function CartSendOrderModal_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? CartSendOrderModal_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : CartSendOrderModal_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

















var CartSendOrderModalPropTypes = CartSendOrderModal_objectSpread(CartSendOrderModal_objectSpread({}, cartProps), {}, {
  playerToken: (prop_types_default()).string.isRequired
});
var CartSendOrderModal = function CartSendOrderModal(_ref) {
  var _cartConfig$showOrder;
  var playerToken = _ref.playerToken,
    _ref$cart = _ref.cart,
    cartConfig = _ref$cart === void 0 ? DefaultCartConfig : _ref$cart;
  var _useAtom = react_useAtom(modalStepAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    modalStep = _useAtom2[0];
  var _useAtom3 = react_useAtom(setModalStepAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 2),
    setModalStep = _useAtom4[1];
  var _useAtom5 = react_useAtom(cartAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    cart = _useAtom6[0];
  var _useAtom7 = react_useAtom(deleteAllItemsFromCartAtom),
    _useAtom8 = slicedToArray_slicedToArray(_useAtom7, 2),
    deleteAllItemsFromCart = _useAtom8[1];
  var _useContext = (0,react.useContext)(contexts_ModalContext),
    active = _useContext.active;
  var successMessage = useTranslate(Identifier.l_order_successful_text);
  var cartProducts = (cart === null || cart === void 0 ? void 0 : cart.products) || {};
  var cartOrder = (cart === null || cart === void 0 ? void 0 : cart.order) || [];
  var currency = cartConfig && cartConfig.currency || DefaultCartConfig.currency;
  var showOrderNumber = (_cartConfig$showOrder = cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.showOrderNumber) !== null && _cartConfig$showOrder !== void 0 ? _cartConfig$showOrder : true;
  var _useAtom9 = react_useAtom(panelAtom),
    _useAtom10 = slicedToArray_slicedToArray(_useAtom9, 2),
    setPanel = _useAtom10[1];
  var _useState = (0,react.useState)(''),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    orderId = _useState2[0],
    setOrderId = _useState2[1];
  var clearCart = function clearCart(successful) {
    if (successful) {
      setPanel('');
      deleteAllItemsFromCart(playerToken);
      setModalStep(CartSendOrderModalSteps.SUCCESSFUL_ORDER);
    } else {
      setModalStep(CartSendOrderModalSteps.TRY_AGAIN_FAILED_ORDER);
    }
  };
  var tryAgainAction = function tryAgainAction() {
    setModalStep(CartSendOrderModalSteps.DEFAULT);
  };
  (0,react.useEffect)(function () {
    if (!active) {
      setModalStep(CartSendOrderModalSteps.DEFAULT);
    }
  }, [active]);
  (0,react.useEffect)(function () {
    if (cartOrder.length) {
      setOrderId(getUniqueOrderId());
    }
  }, [cartOrder.length]);
  var sendOrderContent = function sendOrderContent() {
    switch (modalStep) {
      case CartSendOrderModalSteps.SUCCESSFUL_ORDER:
        return /*#__PURE__*/react.createElement(CartSendOrderModal_CartSuccessfulOrder, {
          orderNumber: orderId,
          confirmationMessage: (cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.confirmationMessage) || successMessage,
          showOrderNumber: showOrderNumber
        });
      case CartSendOrderModalSteps.TRY_AGAIN_FAILED_ORDER:
        return /*#__PURE__*/react.createElement(CartSendOrderModal_CartFailedOrder, {
          tryAgainAction: tryAgainAction
        });
      case CartSendOrderModalSteps.FAILED_ORDER:
        return /*#__PURE__*/react.createElement(CartSendOrderModal_CartFailedOrder, null);
      default:
        return /*#__PURE__*/react.createElement(CartSendOrderModal_CartSendOrder, {
          cartProducts: cartProducts,
          cartOrder: cartOrder,
          clearCart: clearCart,
          cart: {
            customerContactFields: cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.customerContactFields,
            privacyPolicy: cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.privacyPolicy,
            buyerContactSectionTitle: cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.buyerContactSectionTitle,
            buyerContactDescription: cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.buyerContactDescription,
            orderPersonalization: cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.orderPersonalization,
            inboxType: cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.inboxType,
            emailOptions: cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.emailOptions,
            emailOptionsOrder: cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.emailOptionsOrder,
            emailOptionsLabel: cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.emailOptionsLabel,
            confirmationMessage: cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.confirmationMessage
          },
          orderId: orderId,
          currency: currency,
          showOrderNumber: showOrderNumber
        });
    }
  };
  var sendOrderModal = /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: "auto",
    height: "auto",
    modalHeight: "auto",
    identifier: CART_SEND_ORDER_MODAL_ID
  }, sendOrderContent());
  return active === CART_SEND_ORDER_MODAL_ID ? sendOrderModal : null;
};
CartSendOrderModal.propTypes = CartSendOrderModalPropTypes;
/* harmony default export */ var CartSendOrderModal_CartSendOrderModal = (CartSendOrderModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/CartSendOrderModal/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/CartClearListModal/CartClearListModalStyles.ts

var ClearListModalContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartClearListModalStyles__ClearListModalContainer",
  componentId: "sc-4lizwv-0"
})(["display:flex;flex-direction:column;gap:16px;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/CartClearListModal/CartClearListModal.tsx













var CartClearListModal = function CartClearListModal(_ref) {
  var playerToken = _ref.playerToken;
  var _useContext = (0,react.useContext)(contexts_ModalContext),
    setOpen = _useContext.setOpen;
  var _useAtom = react_useAtom(deleteAllItemsFromCartAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    deleteAllItemsFromCart = _useAtom2[1];
  var clearListText = useTranslate(Identifier.l_clear_list);
  var clearListConfirmation = useTranslate(Identifier.l_clear_list_confirmation);
  var cancelText = useTranslate(Identifier.l_cancel);
  var deleteListMessage = useTranslate(Identifier.l_delete_list_message);
  var onClickCancelModal = function onClickCancelModal() {
    setOpen('');
  };
  var onClickClearList = function onClickClearList() {
    deleteAllItemsFromCart(playerToken);
    onClickCancelModal();
  };
  return /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: "auto",
    height: "auto",
    modalHeight: "auto",
    identifier: CART_CLEAR_LIST_MODAL_ID
  }, /*#__PURE__*/react.createElement(ClearListModalContainer, null, /*#__PURE__*/react.createElement(H2, {
    tabIndex: TabIndex.DEFAULT
  }, clearListConfirmation), /*#__PURE__*/react.createElement(Paragraph, {
    tabIndex: TabIndex.DEFAULT
  }, deleteListMessage), /*#__PURE__*/react.createElement(ButtonsContainer, null, /*#__PURE__*/react.createElement(SkipButton, {
    tabIndex: TabIndex.DEFAULT,
    onClick: onClickCancelModal
  }, cancelText), /*#__PURE__*/react.createElement(ModalContentStyles_SubmitButton, {
    tabIndex: TabIndex.DEFAULT,
    onClick: onClickClearList
  }, clearListText))));
};
/* harmony default export */ var CartClearListModal_CartClearListModal = (CartClearListModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/setElementInlineStyle.ts

/**
 * @param element
 * @param style
 */
/* harmony default export */ var setElementInlineStyle = (function (element, style) {
  var elementRef = element;
  if (element) {
    Object.entries(style).forEach(function (_ref) {
      var _ref2 = slicedToArray_slicedToArray(_ref, 2),
        key = _ref2[0],
        value = _ref2[1];
      elementRef.style[key] = value;
    });
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getDistance2D.ts
/**
 * Returns the distance between two points
 * @param pointA
 * @param pointB
 * @return {number}
 */
/* harmony default export */ var getDistance2D = (function (pointA, pointB) {
  return Math.hypot(pointA.x - pointB.x, pointA.y - pointB.y);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/helpers/detectDoubleTapClosure.ts


/**
 * Handles double tap
 * @param {(e: TouchEvent) => void} callback
 * @return {(e: TouchEvent) => void}
 */
/* harmony default export */ var detectDoubleTapClosure = (function (callback) {
  var lastTap = 0;
  var timeout;
  return function (event) {
    var currentTime = new Date().getTime();
    var timeBetween = currentTime - lastTap;
    if (timeBetween < DoubleTapTimeout && timeBetween > 0) {
      callback(event);
    } else {
      timeout = setTimeout(function () {
        clearTimeout(timeout);
      }, DoubleTapTimeout);
    }
    lastTap = currentTime;
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/helpers/getTransformOriginZoomInLimit.ts
/**
 * Check if the given transformOrigin is between the min and max values
 * @param {number} currentTransformOrigin
 * @param minValidTransformOrigin
 * @param maxValidTransformOrigin
 * @return {number}
 */
/* harmony default export */ var getTransformOriginZoomInLimit = (function (currentTransformOrigin, minValidTransformOrigin, maxValidTransformOrigin) {
  return Math.max(minValidTransformOrigin, Math.min(currentTransformOrigin, maxValidTransformOrigin));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/helpers/getTransformOriginZoomOutLimit.ts
/**
 *
 * @param {number} currentTransformOrigin
 * @param {number} transformWith
 * @param {number} containerSize
 * @param {number} margin
 * @param {number} scaleZoomContainer
 * @param {number} playerWidth
 * @param {number} currentPosition
 * @return {any}
 */
/* harmony default export */ var getTransformOriginZoomOutLimit = (function (currentTransformOrigin, transformWith, containerSize, margin, scaleZoomContainer, playerWidth, currentPosition) {
  // This value represents where should be the container with the current transform origin
  // Check if this value can be applied without visual bugs, like empty space to big on one side
  var nextTransformWith = +(currentTransformOrigin - currentTransformOrigin * scaleZoomContainer + currentPosition).toFixed(2);
  var transformOrigin = currentTransformOrigin;

  // Empty space on right side
  if (nextTransformWith >= margin) {
    transformOrigin = Math.abs(transformWith - margin) / (1 - scaleZoomContainer);
  }
  if (playerWidth - (containerSize + nextTransformWith) > margin) {
    // Empty space on left side
    transformOrigin = (Math.abs(transformWith) - (containerSize - (playerWidth - margin))) / (1 - scaleZoomContainer);
  }
  return transformOrigin;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/helpers/getAnimationValues.ts

function getAnimationValues_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function getAnimationValues_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? getAnimationValues_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : getAnimationValues_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


/* harmony default export */ var getAnimationValues = (function (zoomForComponents, zoomBefore, scaleZoomContainer, currentPosition, spacing, zoomInPosition, _ref, containerRect, transformWith) {
  var playerWidth = _ref.playerWidth,
    playerHeight = _ref.playerHeight;
  // Set transformOrigin values: zoomInPosition The position where the user double-clicked/taped
  // If zoomInPosition is not set then the transformOrigin will be set to the center of the container
  // After the transformOrigin is set we must check if the values are between ranges
  var transformOrigin = {
    x: zoomInPosition.x ? zoomInPosition.x : playerWidth / 2 - currentPosition.x,
    y: zoomInPosition.y ? zoomInPosition.y : playerHeight / 2 - currentPosition.y
  };
  var marginX = containerRect.width * zoomForComponents < playerWidth ? containerRect.x : spacing.left;
  var marginY = containerRect.height * zoomForComponents < playerHeight ? containerRect.y : spacing.top;

  // Check zoom in limits
  if (zoomForComponents > zoomBefore) {
    if (containerRect.width * zoomForComponents < playerWidth) {
      transformOrigin.x = containerRect.width * zoomBefore / 2;
    } else {
      transformOrigin.x = getTransformOriginZoomInLimit(transformOrigin.x, spacing.left, containerRect.width * zoomBefore - spacing.left);
    }
    if (containerRect.height * zoomForComponents < playerHeight) {
      transformOrigin.y = containerRect.height * zoomBefore / 2;
    } else {
      transformOrigin.y = getTransformOriginZoomInLimit(transformOrigin.y, spacing.top, containerRect.height * zoomBefore - spacing.top);
    }
  } else if (zoomForComponents < zoomBefore) {
    // Check zoom out limits
    if (containerRect.width * zoomBefore < playerWidth) {
      transformOrigin.x = containerRect.width * zoomBefore / 2;
    } else {
      transformOrigin.x = getTransformOriginZoomOutLimit(transformOrigin.x, transformWith.x, containerRect.width * zoomForComponents, marginX, scaleZoomContainer, playerWidth, currentPosition.x);
    }
    if (containerRect.height * zoomBefore < playerHeight) {
      transformOrigin.y = containerRect.height * zoomBefore / 2;
    } else {
      transformOrigin.y = getTransformOriginZoomOutLimit(transformOrigin.y, transformWith.y, containerRect.height * zoomForComponents, marginY, scaleZoomContainer, playerHeight, currentPosition.y);
    }
  }
  return getAnimationValues_objectSpread({}, transformOrigin);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/helpers/getContainerPosition.ts

/**
 * Returns the container position
 * @param {CoordinatesType} containerPosition
 * @param {BoundingRectSize} containerSize
 * @param {BoundingRectSize} visibleAreaSize
 * @param {any} theme
 * @return {{x: number, y: number}}
 */
/* harmony default export */ var getContainerPosition = (function (containerPosition, containerSize, visibleAreaSize, theme) {
  var spacing = !main/* isMobile */.Fr && visibleAreaSize.width > theme.deviceSize.tabletS ? theme.spacing.large : theme.spacing.small;

  // Keep container in visible area by limiting the empty space between ZoomContainer and StageManagerContainer
  var marginRight = visibleAreaSize.width > containerSize.width ? Math.abs(containerSize.width - visibleAreaSize.width) / 2 : spacing.right;
  var marginLeft = visibleAreaSize.width - marginRight - containerSize.width;
  var marginTop = visibleAreaSize.height > containerSize.height ? Math.abs(containerSize.height - visibleAreaSize.height) / 2 : spacing.top;
  var marginBottom = visibleAreaSize.height - marginTop - containerSize.height;
  return {
    x: Math.max(Math.min(containerPosition.x, marginRight), marginLeft),
    y: Math.max(Math.min(containerPosition.y, marginTop), marginBottom)
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/helpers/getGesturePosition.ts
/**
 * Get mouse position or single touch position
 * @param {MouseEvent | TouchEvent} event
 * @return {{x: number, y: number}}
 */
/* harmony default export */ var getGesturePosition = (function (event) {
  if ('touches' in event) {
    var _event$touches$, _event$touches$2;
    return {
      x: (_event$touches$ = event.touches[0]) === null || _event$touches$ === void 0 ? void 0 : _event$touches$.clientX,
      y: (_event$touches$2 = event.touches[0]) === null || _event$touches$2 === void 0 ? void 0 : _event$touches$2.clientY
    };
  }
  return {
    x: event.clientX,
    y: event.clientY
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/helpers/getPinchPosition.ts
/**
 * @param {touchEventPosition} firstPosition
 * @param {touchEventPosition} secondPosition
 * @return {{x: number, y: number}}
 */
/* harmony default export */ var getPinchPosition = (function (firstPosition, secondPosition) {
  return {
    x: (firstPosition.pageX + secondPosition.pageX) / 2,
    y: (firstPosition.pageY + secondPosition.pageY) / 2
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/helpers/getScaleForZoomContainer.ts
/**
 * The scale must be a float number with a lot of decimals to be more accurate
 * @param {number} newZoomValue
 * @param {number} oldZoomValue
 * @return {number}
 */
/* harmony default export */ var getScaleForZoomContainer = (function (newZoomValue, oldZoomValue) {
  return newZoomValue / oldZoomValue;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/ZoomContainer.styles.ts

var ZoomContainer_styles_ZoomContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ZoomContainerstyles__ZoomContainer",
  componentId: "sc-14kkq52-0"
})(["will-change:transform;position:absolute;", ""], function (_ref) {
  var $isZoomed = _ref.$isZoomed;
  return $isZoomed ? "\n    cursor: grab;\n\n    &:active {\n        cursor: grabbing;\n    }\n    " : '';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/ZoomContainer.tsx




















/**
 * Zoom container - handles user interactions
 * The zoom value can be changed from the zoom bar, double click/tap and pinch to zoom
 * An atom is used to hold zoomForComponents value which is updated from the ZoomBar component. After the animation is
 * done the ZoomContext is updated and every component will re-render with the new value.
 * This re-renders only happens once, when the animation is complete. Animation can be fired sequentially for example
 * hitting the plus button 3 times in the ZoomBar components
 * @param {ZoomContainerPropTypes} props
 * @return {React.ReactElement}
 * @constructor
 */
var ZoomContainer = function ZoomContainer(props) {
  var theme = Ze();
  /**
   * The zoom container translate(x,y) values
   */
  var transformWith = (0,react.useRef)({
    x: 0,
    y: 0
  });

  /**
   * The zoom container translate(x,y) values
   */
  var transformOrigin = (0,react.useRef)({
    x: 0,
    y: 0
  });

  /**
   * The position where the user double-clicked/taped
   */
  var zoomInPosition = (0,react.useRef)({
    x: 0,
    y: 0
  });

  /**
   * Initial position and size of the zoom container relative to the parent component
   */
  var containerRect = (0,react.useRef)({
    x: 0,
    y: 0,
    width: 0,
    height: 0
  });
  var containerRef = (0,react.useRef)(null);

  /**
   * [Web animation api reference](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API)
   */
  var animationRef = (0,react.useRef)();
  var _useContext = (0,react.useContext)(contexts_ZoomContext),
    setZoomAction = _useContext.setZoom;
  var zoomForComponents = react_useAtomValue(zoomForComponentsAtom);
  var setZoomForComponents = react_useSetAtom(setZoomForComponentsAtom);
  var toggleZoomForGestureEvent = react_useSetAtom(toggleZoomForGestureEventAtom);
  var zoomBefore = (0,react.useRef)(zoomForComponents);
  var zoomCurrent = (0,react.useRef)(zoomForComponents);

  /**
   * This function is called when the zoom animation is finished
   * The user changed the zoom value using the zoom bar, double click/tap or pinch to zoom
   * @type {() => void}
   */
  var onAnimationDone = (0,react.useCallback)(function () {
    if (containerRef.current) {
      var _animationRef$current;
      (_animationRef$current = animationRef.current) === null || _animationRef$current === void 0 || _animationRef$current.cancel();
      var scaleZoomContainer = getScaleForZoomContainer(zoomCurrent.current, zoomBefore.current);
      var left = containerRect.current.x;
      var top = containerRect.current.y;
      if (zoomCurrent.current > ZOOM_MIN_VALUE) {
        left = 0;
        top = 0;
      }
      var currentPosition = {
        x: transformWith.current.x || containerRect.current.x,
        y: transformWith.current.y || containerRect.current.y
      };
      var transformWithX = transformOrigin.current.x - transformOrigin.current.x * scaleZoomContainer + currentPosition.x;
      var transformWithY = transformOrigin.current.y - transformOrigin.current.y * scaleZoomContainer + currentPosition.y;
      transformWith.current.x = 0;
      transformWith.current.y = 0;
      if (zoomCurrent.current > ZOOM_MIN_VALUE) {
        var limit = getContainerPosition({
          x: transformWithX,
          y: transformWithY
        }, {
          width: containerRect.current.width * zoomCurrent.current,
          height: containerRect.current.height * zoomCurrent.current
        }, {
          width: props.playerWidth,
          height: props.playerHeight
        }, theme);
        transformWith.current.x = limit.x;
        transformWith.current.y = limit.y;
      }
      setElementInlineStyle(containerRef.current, {
        top: "".concat(top, "px"),
        left: "".concat(left, "px"),
        width: "".concat(containerRect.current.width * zoomCurrent.current, "px"),
        height: "".concat(containerRect.current.height * zoomCurrent.current, "px"),
        transform: "translate(".concat(transformWith.current.x, "px, ").concat(transformWith.current.y, "px)\n                    scale3d(1,1,1)"),
        'transform-origin': '0 0'
      });
      zoomBefore.current = zoomCurrent.current;
      zoomInPosition.current.x = 0;
      zoomInPosition.current.y = 0;
      (0,react_dom.flushSync)(function () {
        setZoomAction(zoomCurrent.current);
      });
    }
  }, [props.playerWidth, props.playerHeight]);

  /**
   * Used on double click and double tap
   * Toggle the zoom value using an atom setter
   * @type {DebouncedFunc<(update?: unknown) => void>}
   */
  var handleZoomForGestureEvent = (0,react.useCallback)((0,lodash.debounce)(toggleZoomForGestureEvent, DoubleTapTimeout), []);

  /**
   *  Initialize container ref - redo  on resize or layout change (props.width, props.height)
   */
  (0,react.useLayoutEffect)(function () {
    var zoomContainerRef = containerRef.current;

    // Reset zoom value to ZOOM_MIN_VALUE on resize
    if (zoomForComponents !== ZOOM_MIN_VALUE) {
      setZoomForComponents(ZOOM_MIN_VALUE);
    }
    if (zoomContainerRef) {
      var x = +((props.playerWidth - props.width) / 2).toFixed(2);
      var y = +((props.playerHeight - props.height) / 2).toFixed(2);

      // Save container position relative to its parent
      containerRect.current = {
        x: x,
        y: y,
        width: props.width,
        height: props.height
      };
      setElementInlineStyle(zoomContainerRef, {
        left: "".concat(containerRect.current.x, "px"),
        top: "".concat(containerRect.current.y, "px"),
        width: "".concat(containerRect.current.width, "px"),
        height: "".concat(containerRect.current.height, "px")
      });
    }
  }, [props.playerWidth, props.playerHeight, props.width, props.height]);

  /**
   * Handles zoom animation when zoomForComponents change
    */
  (0,react.useLayoutEffect)(function () {
    var zoomContainerRef = containerRef.current;
    if (zoomContainerRef) {
      zoomCurrent.current = zoomForComponents;
      var spacing = !main/* isMobile */.Fr && props.playerWidth > theme.deviceSize.tabletS ? theme.spacing.large : theme.spacing.small;
      var currentPosition = {
        x: transformWith.current.x || containerRect.current.x,
        y: transformWith.current.y || containerRect.current.y
      };
      var scaleZoomContainer = getScaleForZoomContainer(zoomCurrent.current, zoomBefore.current);
      var _getAnimationValues = getAnimationValues(zoomCurrent.current, zoomBefore.current, scaleZoomContainer, currentPosition, spacing, zoomInPosition.current, {
          playerWidth: props.playerWidth,
          playerHeight: props.playerHeight
        }, containerRect.current, transformWith.current),
        x = _getAnimationValues.x,
        y = _getAnimationValues.y;
      transformOrigin.current.x = x;
      transformOrigin.current.y = y;
      var translateBefore = "translate(".concat(transformWith.current.x, "px, ").concat(transformWith.current.y, "px)");
      setElementInlineStyle(zoomContainerRef, {
        'transform-origin': "".concat(transformOrigin.current.x, "px ").concat(transformOrigin.current.y, "px")
      });

      // Web animation api to scale the content from the given transform-origin
      animationRef.current = zoomContainerRef.animate([{
        transform: "".concat(translateBefore) + " scale3d(".concat(scaleZoomContainer, ", ").concat(scaleZoomContainer, " ,").concat(scaleZoomContainer, ")")
      }], KeyframeOptions);

      // This event fires when the animation is complete
      animationRef.current.addEventListener('finish', onAnimationDone);
    }
    return function () {
      var _animationRef$current2;
      (_animationRef$current2 = animationRef.current) === null || _animationRef$current2 === void 0 || _animationRef$current2.removeEventListener('finish', onAnimationDone);
    };
  }, [zoomForComponents, props.playerWidth, props.playerHeight]);

  /**
   * UseLayoutEffect that handles drag events if zoomForComponents > 1
   */
  (0,react.useLayoutEffect)(function () {
    var zoomContainerRef = containerRef.current;
    var mouseXOnElement = 0;
    var mouseYOnElement = 0;
    var moveHandler = function moveHandler(moveEvent) {
      // If the property `touches` does not exist on moveEvent then the event type is MouseEvent (desktop)
      // If the property `touches` exists on moveEvent then the event type is TouchEvent (mobile/tablet)
      // in this case we need to be sure that the event was fired with only one touches point active
      // two active points means pinch to zoom, and it will be handled different
      if (containerRef.current && (!('touches' in moveEvent) || 'touches' in moveEvent && moveEvent.touches.length === 1)) {
        moveEvent.preventDefault();
        moveEvent.stopImmediatePropagation();
        var _getGesturePosition = getGesturePosition(moveEvent),
          x = _getGesturePosition.x,
          y = _getGesturePosition.y;
        var _getContainerPosition = getContainerPosition({
            x: x - mouseXOnElement,
            y: y - mouseYOnElement
          }, {
            width: containerRect.current.width * zoomForComponents,
            height: containerRect.current.height * zoomForComponents
          }, {
            width: props.playerWidth,
            height: props.playerHeight
          }, theme),
          transformWithX = _getContainerPosition.x,
          transformWithY = _getContainerPosition.y;
        transformWith.current.x = transformWithX;
        transformWith.current.y = transformWithY;
        setElementInlineStyle(containerRef.current, {
          transform: "translate(".concat(transformWith.current.x, "px, ").concat(transformWith.current.y, "px)")
        });
      }
    };

    // Remove event listeners
    var _upHandler = function upHandler() {
      document.removeEventListener('mousemove', moveHandler, true);
      document.removeEventListener('mouseup', _upHandler, true);
      document.removeEventListener('touchmove', moveHandler, true);
      document.removeEventListener('touchend', _upHandler, true);
    };
    var downHandler = function downHandler(downEvent) {
      var currentPosition = {
        x: transformWith.current.x || containerRect.current.x,
        y: transformWith.current.y || containerRect.current.y
      };
      var _getGesturePosition2 = getGesturePosition(downEvent),
        clientX = _getGesturePosition2.x,
        clientY = _getGesturePosition2.y;
      mouseXOnElement = clientX - currentPosition.x;
      mouseYOnElement = clientY - currentPosition.y;
      if ('touches' in downEvent) {
        document.addEventListener('touchmove', moveHandler, true);
        document.addEventListener('touchend', _upHandler, true);
      } else {
        document.addEventListener('mousemove', moveHandler, true);
        document.addEventListener('mouseup', _upHandler, true);
      }
    };
    if (zoomForComponents > ZOOM_MIN_VALUE) {
      zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.addEventListener('mousedown', downHandler, true);
      zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.addEventListener('touchstart', downHandler, {
        passive: true,
        capture: true
      });
    }
    return function () {
      zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.removeEventListener('touchstart', downHandler, {
        capture: true
      });
      zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.removeEventListener('mousedown', downHandler, true);
      document.removeEventListener('mousemove', moveHandler, true);
      document.removeEventListener('mouseup', _upHandler, true);
      document.removeEventListener('touchmove', moveHandler, true);
      document.removeEventListener('touchend', _upHandler, true);
    };
  }, [zoomForComponents]);

  /**
   * UseEffect that handles double click and double tap events
   */
  (0,react.useEffect)(function () {
    var zoomContainerRef = containerRef.current;
    var onDoubleTapOrClick = function onDoubleTapOrClick(event) {
      if (zoomContainerRef && (event.detail === 2 || 'touches' in event && event.touches.length === 1)) {
        var _getGesturePosition3 = getGesturePosition(event),
          x = _getGesturePosition3.x,
          y = _getGesturePosition3.y;
        var _zoomContainerRef$get = zoomContainerRef.getBoundingClientRect(),
          left = _zoomContainerRef$get.left,
          top = _zoomContainerRef$get.top;
        zoomInPosition.current = {
          x: x - left,
          y: y - top
        };
        handleZoomForGestureEvent();
      }
    };
    var doubleTapClosure = detectDoubleTapClosure(onDoubleTapOrClick);
    zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.addEventListener('click', onDoubleTapOrClick);
    zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.addEventListener('touchstart', doubleTapClosure, {
      passive: true
    });
    return function () {
      zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.removeEventListener('click', onDoubleTapOrClick);
      zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.removeEventListener('touchstart', doubleTapClosure);
    };
  }, []);

  /**
   * UseEffect that handles mouse scroll + cmd and touchpad events
   */
  (0,react.useLayoutEffect)(function () {
    var zoomContainerRef = containerRef.current;
    var scale = 1;
    var nextZoomValue = zoomForComponents;
    // There is a major difference between mouse wheel and touchpad zoom events
    // JavaScript does not have a way to differentiate between the two, but
    // the touchpad event is fired at a faster rate than the mouse wheel event.
    // It is important to diferentiate between the two to set the correct zoom speed
    var zoomStep = 0;
    var spacing = !main/* isMobile */.Fr && props.playerWidth > theme.deviceSize.tabletS ? theme.spacing.large : theme.spacing.small;
    var setMouseZoom = function setMouseZoom() {
      zoomCurrent.current = Math.max(ZOOM_MIN_VALUE, Math.min(nextZoomValue, ZOOM_MAX_VALUE));
      zoomStep = 0;
      onAnimationDone();
      setZoomForComponents(nextZoomValue);
    };
    var wheelMoveHandler = function wheelMoveHandler(event) {
      event.preventDefault();
      var _ref = (zoomContainerRef === null || zoomContainerRef === void 0 ? void 0 : zoomContainerRef.getBoundingClientRect()) || {},
        _ref$left = _ref.left,
        left = _ref$left === void 0 ? 0 : _ref$left,
        _ref$top = _ref.top,
        top = _ref$top === void 0 ? 0 : _ref$top;

      // If the ctrl key is pressed, zoom in/out - crtl key is pressed by default on touchpad zoom.
      // Also check for metaKey for mac users + mouse wheel
      if ((event.ctrlKey || event.metaKey) && zoomContainerRef) {
        if (!zoomStep) {
          zoomStep = Math.abs(event.deltaY) > 4 ? 0.5 : 0.1;
        }
        var zoomValue = Math.round((nextZoomValue + zoomStep) * 100) / 100;
        if (event.deltaY > 0) {
          zoomValue = Math.round((nextZoomValue - zoomStep) * 100) / 100;
        }
        if (zoomValue >= ZOOM_MIN_VALUE && zoomValue <= ZOOM_MAX_VALUE) {
          scale = zoomValue / zoomCurrent.current;
          nextZoomValue = zoomValue;
          var gesturePosition = getGesturePosition(event);
          var currentPosition = {
            x: transformWith.current.x || containerRect.current.x,
            y: transformWith.current.y || containerRect.current.y
          };
          zoomInPosition.current = {
            x: gesturePosition.x - left,
            y: gesturePosition.y - top
          };
          var _getAnimationValues2 = getAnimationValues(nextZoomValue, zoomCurrent.current, scale, currentPosition, spacing, zoomInPosition.current, {
              playerWidth: props.playerWidth,
              playerHeight: props.playerHeight
            }, containerRect.current, transformWith.current),
            x = _getAnimationValues2.x,
            y = _getAnimationValues2.y;
          transformOrigin.current.x = x;
          transformOrigin.current.y = y;
          var translateBefore = "translate(".concat(transformWith.current.x, "px, ").concat(transformWith.current.y, "px)");
          var transformOriginCss = "".concat(transformOrigin.current.x, "px ").concat(transformOrigin.current.y, "px");
          setElementInlineStyle(zoomContainerRef, {
            'transform-origin': "".concat(transformOriginCss),
            transform: "".concat(translateBefore, " scale3d(").concat(scale, ", ").concat(scale, " ,").concat(scale, ")")
          });
        }
        setMouseZoom();
      }
    };
    zoomContainerRef.addEventListener('wheel', wheelMoveHandler, {
      passive: true
    });
    return function () {
      zoomContainerRef.removeEventListener('wheel', wheelMoveHandler);
    };
  }, [props.playerWidth, props.playerHeight, props.width, props.height, zoomForComponents]);

  /**
   * UseLayoutEffect that handles pinch to zoom on touch screen
   */
  (0,react.useLayoutEffect)(function () {
    var zoomContainerRef = containerRef.current;
    var touchStart = function touchStart(event) {
      if (event.touches.length === 2) {
        event.preventDefault();

        // Calculate where the fingers have started on the X and Y axis
        var startDistance = getDistance2D({
          x: event.touches[0].pageX,
          y: event.touches[0].pageY
        }, {
          x: event.touches[1].pageX,
          y: event.touches[1].pageY
        });
        var scale = InitialScaleValue;
        var touchmove = function touchmove(e) {
          if (e.touches.length === 2 && zoomContainerRef) {
            var distance = getDistance2D({
              x: e.touches[0].pageX,
              y: e.touches[0].pageY
            }, {
              x: e.touches[1].pageX,
              y: e.touches[1].pageY
            });
            scale = +(distance / startDistance).toFixed(2);
            var nextZoomValue = +(zoomForComponents * scale).toFixed(2);
            if (nextZoomValue >= ZOOM_MIN_VALUE && nextZoomValue <= ZOOM_MAX_VALUE) {
              var currentPosition = {
                x: transformWith.current.x || containerRect.current.x,
                y: transformWith.current.y || containerRect.current.y
              };
              var _getPinchPosition = getPinchPosition(event.touches[0], event.touches[1]),
                x = _getPinchPosition.x,
                y = _getPinchPosition.y;
              transformOrigin.current.x = x - currentPosition.x;
              transformOrigin.current.y = y - currentPosition.y;
              var translateBefore = "translate(".concat(transformWith.current.x, "px, ").concat(transformWith.current.y, "px)");
              var transformOriginCss = "".concat(transformOrigin.current.x, "px ").concat(transformOrigin.current.y, "px");
              setElementInlineStyle(zoomContainerRef, {
                'transform-origin': "".concat(transformOriginCss),
                transform: "".concat(translateBefore, " scale3d(").concat(scale, ", ").concat(scale, " ,").concat(scale, ")")
              });
            }
          }
        };
        var _touchEnd = function touchEnd() {
          zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.removeEventListener('touchmove', touchmove);
          zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.removeEventListener('touchend', _touchEnd);
          var nextZoomValue = +(zoomForComponents * scale).toFixed(2);
          zoomCurrent.current = Math.max(ZOOM_MIN_VALUE, Math.min(nextZoomValue, ZOOM_MAX_VALUE));
          onAnimationDone();
          setZoomForComponents(zoomCurrent.current);
        };
        zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.addEventListener('touchmove', touchmove);
        zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.addEventListener('touchend', _touchEnd);
      }
    };
    zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.addEventListener('touchstart', touchStart, {
      passive: true,
      capture: true
    });
    return function () {
      zoomContainerRef === null || zoomContainerRef === void 0 || zoomContainerRef.removeEventListener('touchstart', touchStart, {
        capture: true
      });
    };
  }, [zoomForComponents, props.playerWidth, props.playerHeight]);
  return /*#__PURE__*/react.createElement(ZoomContainer_styles_ZoomContainer, {
    ref: containerRef,
    $isZoomed: zoomForComponents > ZOOM_MIN_VALUE
  }, props.children);
};
ZoomContainer.propTypes = {
  playerWidth: (prop_types_default()).number.isRequired,
  playerHeight: (prop_types_default()).number.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired
};
/* harmony default export */ var ZoomContainer_ZoomContainer = (ZoomContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainerForScroll/ZoomContainerForScroll.styles.ts

var ZoomContainerForScroll_styles_ZoomContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ZoomContainerForScrollstyles__ZoomContainer",
  componentId: "sc-1tlwlzq-0"
})(["will-change:transform;position:absolute;width:", ";height:", ";animation:loadContainer .3s;transition:opacity .3s ease-in-out;@keyframes loadContainer{from{opacity:0;}to{opacity:1;}};"], function (_ref) {
  var width = _ref.width;
  return "".concat(width, "px");
}, function (_ref2) {
  var height = _ref2.height;
  return "".concat(height, "px");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainerForScroll/ZoomContainerForScroll.tsx


var ZoomContainerForScroll = function ZoomContainerForScroll(props) {
  return /*#__PURE__*/react.createElement(ZoomContainerForScroll_styles_ZoomContainer, {
    width: props.width,
    height: props.height
  }, props.children);
};
/* harmony default export */ var ZoomContainerForScroll_ZoomContainerForScroll = (ZoomContainerForScroll);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ZoomContainerWrapper/ZoomContainerWrapper.tsx





var ZoomContainerWrapper = function ZoomContainerWrapper(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    effect = _useContext.options.content.effect;
  if (effect === playerTypes_PlayerEffect.SCROLL) {
    return /*#__PURE__*/react.createElement(ZoomContainerForScroll_ZoomContainerForScroll, {
      width: props.playerWidth,
      height: props.playerHeight
    }, props.children);
  }
  return /*#__PURE__*/react.createElement(ZoomContainer_ZoomContainer, {
    playerWidth: props.playerWidth,
    playerHeight: props.playerHeight,
    width: props.width,
    height: props.height
  }, props.children);
};
/* harmony default export */ var ZoomContainerWrapper_ZoomContainerWrapper = (ZoomContainerWrapper);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Stage/Stage.styles.ts



// Add line-height 0 to prevent elements to be pushed with 1.28px - it is is a bug on small devices
var StageManagerContainer = styled_components_browser_esm.div.withConfig({
  displayName: "Stagestyles__StageManagerContainer",
  componentId: "sc-llx6uf-0"
})(["width:", ";height:", ";overflow:", ";line-height:0;position:relative;"], function (_ref) {
  var $width = _ref.$width;
  return $width;
}, function (_ref2) {
  var $height = _ref2.$height;
  return $height;
}, function (props) {
  return props.$effect === Effect.SCROLL ? 'auto' : 'hidden';
});
var StageWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "Stagestyles__StageWrapper",
  componentId: "sc-llx6uf-1"
})(["filter:", ""], function (_ref3) {
  var theme = _ref3.theme;
  return "drop-shadow(0px 2px 5px ".concat(theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.2), ");");
});
var StagePagesContainer = styled_components_browser_esm.div.withConfig({
  displayName: "Stagestyles__StagePagesContainer",
  componentId: "sc-llx6uf-2"
})(["width:", ";height:", ";display:flex;position:relative;justify-content:center;overflow-x:", ""], function (_ref4) {
  var $width = _ref4.$width;
  return $width;
}, function (_ref5) {
  var $height = _ref5.$height;
  return $height;
}, function (_ref6) {
  var $overflowX = _ref6.$overflowX;
  return $overflowX;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/SettledStageIndexContext.ts

var SettledStageIndexContextDefaults = {
  settledStageIndex: 0,
  setSettledStageIndex: function setSettledStageIndex() {
    return null;
  }
};
var SettledStageIndexContext = /*#__PURE__*/react.createContext(SettledStageIndexContextDefaults);
/* harmony default export */ var contexts_SettledStageIndexContext = (SettledStageIndexContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/SettledStageIndexProvider/SettledStageIndexProvider.tsx



var SettledStageIndexProvider = function SettledStageIndexProvider(props) {
  var _useState = (0,react.useState)(0),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    index = _useState2[0],
    setIndex = _useState2[1];
  var value = (0,react.useMemo)(function () {
    return {
      settledStageIndex: index,
      setSettledStageIndex: setIndex
    };
  }, [index]);
  return /*#__PURE__*/react.createElement(contexts_SettledStageIndexContext.Provider, {
    value: value
  }, props.children);
};
/* harmony default export */ var SettledStageIndexProvider_SettledStageIndexProvider = (SettledStageIndexProvider);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/SettledStageIndexProvider/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/stagePage.ts
var RenderStagePages = 2;
var StageProximityDifference = function () {
  var result = [];
  for (var i = RenderStagePages; i >= 1; i--) {
    result.push(i);
  }
  return result;
}();

/**
 * Generate an array with indexes for the current stage and its proximity stages to be rendered
 */
var generateRenderedStages = function generateRenderedStages(currentIndex, maxIndex) {
  var left = StageProximityDifference.map(function (i) {
    return currentIndex - i;
  }).filter(function (i) {
    return i >= 0;
  });
  var right = StageProximityDifference.map(function (i) {
    return currentIndex + i;
  }).reverse().filter(function (i) {
    return i <= maxIndex;
  });
  var target = [currentIndex];
  return left.concat(target, right);
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/usePreventSwipeOnZoom.ts




/**
 * Checks if the swipe action on mobile can be done
 * @param checkForMobile boolean
 */

/* harmony default export */ var usePreventSwipeOnZoom = (function () {
  var checkForMobile = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  var _useContext = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext.zoom;
  if (checkForMobile) {
    return zoom > 1 && main/* isMobile */.Fr;
  }
  return zoom > 1;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/constants/index.ts
// Used to scale the VisibleStageLayer and NextStageLayer to fit their stages when they are rotated
var FLIP_LAYER_SCALE = 2;
var FlipOriginTypes = /*#__PURE__*/function (FlipOriginTypes) {
  FlipOriginTypes["BOTTOM_LEFT"] = "bottom_left";
  FlipOriginTypes["TOP_LEFT"] = "top_left";
  FlipOriginTypes["BOTTOM_RIGHT"] = "bottom_right";
  FlipOriginTypes["TOP_RIGHT"] = "top_right";
  FlipOriginTypes["RIGHT"] = "right";
  FlipOriginTypes["LEFT"] = "left";
  FlipOriginTypes["EMPTY"] = "";
  return FlipOriginTypes;
}({});
var FLIP_EFFECT_DEGREE = 2;
var FLIP_EFFECT_ANIMATION_FRAME_TIME = 16; // ms - execution time of requestAnimationFrame
/**
 * It must be divisible by FLIP_EFFECT_ANIMATION_FRAME_TIME, otherwise the animation will not be smooth/correct
 */
var constants_EFFECT_CHANGE_PAGE_DURATION = 560; // ms

var FLIP_EFFECT_START_POSITION = 50;
var DEFAULT_TOP_SHADE = 0.24;
var DEFAULT_BOTTOM_SHADE = 0.4;
var SINGLE_PAGE_TRANSFORM_X = 0.25;
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/generateNextVisibleStage.ts


/**
 * Generate content for the next visible stage when targeting distant stage (slider or annotation click)
 * @param {number} width
 * @param {number} height
 * @param {number} nextIndex
 * @param {<HTMLDivElement>} ref
 */
/* harmony default export */ var generateNextVisibleStage = (function (width, height, nextIndex, ref) {
  var _ref$current, _ref$current2, _ref$current3;
  var layer1 = document.createElement('div');
  var layer2 = document.createElement('div');
  var layer3 = document.createElement('div');
  var layer4 = document.createElement('div');
  setElementInlineStyle(layer1, {
    width: "".concat(width, "px"),
    height: "".concat(height, "px"),
    position: 'absolute',
    top: '0px',
    left: '0px',
    overflow: 'hidden'
  });
  setElementInlineStyle(layer2, {
    width: "".concat(width, "px"),
    height: "".concat(height, "px"),
    position: 'absolute',
    top: '0px',
    left: '0px',
    overflow: 'hidden'
  });
  setElementInlineStyle(layer3, {
    width: "".concat(width, "px"),
    height: "".concat(height, "px"),
    position: 'relative',
    background: '#fff',
    zIndex: '1'
  });
  setElementInlineStyle(layer4, {
    width: "".concat(width, "px"),
    height: "".concat(height, "px"),
    position: 'absolute',
    top: '0px',
    left: '0px'
  });
  layer4.setAttribute('data-id', 'gradient');
  layer1.appendChild(layer2);
  layer2.appendChild(layer3);
  layer3.appendChild(layer4);

  // Add temporary class to enforce dom element update
  (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.children[nextIndex].classList.add('temporary');
  var parent = (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.children[nextIndex];
  var sibling = (_ref$current3 = ref.current) === null || _ref$current3 === void 0 || (_ref$current3 = _ref$current3.children[nextIndex]) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.firstChild;
  if (parent && sibling) {
    parent === null || parent === void 0 || parent.insertBefore(layer1, sibling);
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getHitArea.ts


var flipEffectHitArea = function flipEffectHitArea(mousePositionOnPage, visibleStageRect, hitAreaX, percentage) {
  if (mousePositionOnPage.x >= visibleStageRect.width - hitAreaX && mousePositionOnPage.y <= visibleStageRect.height * percentage) {
    return FlipOriginTypes.TOP_RIGHT;
  }
  if (mousePositionOnPage.x >= visibleStageRect.width - hitAreaX && mousePositionOnPage.y > visibleStageRect.height - visibleStageRect.height * percentage) {
    return FlipOriginTypes.BOTTOM_RIGHT;
  }
  if (mousePositionOnPage.x < hitAreaX && mousePositionOnPage.y >= visibleStageRect.height - visibleStageRect.height * percentage) {
    return FlipOriginTypes.BOTTOM_LEFT;
  }
  if (mousePositionOnPage.x < hitAreaX && mousePositionOnPage.y < visibleStageRect.height * percentage) {
    return FlipOriginTypes.TOP_LEFT;
  }
  return FlipOriginTypes.EMPTY;
};
var slideEffectHitArea = function slideEffectHitArea(mousePositionOnPage, visibleStageRect, hitAreaX) {
  if (mousePositionOnPage.x >= visibleStageRect.width - hitAreaX) {
    return FlipOriginTypes.RIGHT;
  }
  if (mousePositionOnPage.x < hitAreaX) {
    return FlipOriginTypes.LEFT;
  }
  return FlipOriginTypes.EMPTY;
};

/**
 * Calculates if the click is in one of the hit area and returns the position of hit area
 * @param clientX
 * @param clientY
 * @param visibleStageRect
 * @param hasTwoPage
 * @param effect
 * @return FlipOriginTypes
 */

/* harmony default export */ var getHitArea = (function (_ref, visibleStageRect, hasTwoPage, effect) {
  var clientX = _ref.clientX,
    clientY = _ref.clientY;
  var hitArea = FlipOriginTypes.EMPTY;
  var PERCENTAGE = 25 / 100;
  var TWO_PAGE_DIVIDE = PERCENTAGE * 2;

  // This may change if we want a smaller hit area
  var hitAreaX = hasTwoPage ? visibleStageRect.width * TWO_PAGE_DIVIDE : visibleStageRect.width * PERCENTAGE;
  var mousePositionOnPage = {
    x: clientX - visibleStageRect.left,
    y: clientY - visibleStageRect.top
  };
  if (effect === src_playerTypes_PlayerEffect.FLIP) {
    hitArea = flipEffectHitArea(mousePositionOnPage, visibleStageRect, hitAreaX, PERCENTAGE);
  }
  if (effect === src_playerTypes_PlayerEffect.SLIDE) {
    hitArea = slideEffectHitArea(mousePositionOnPage, visibleStageRect, hitAreaX);
  }
  return hitArea;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getNextPageIndex.ts


/**
 * Receives the current stage index and the hit area and returns if the next page index is index + 1 or index - 1
 * @param currentStageIndex
 * @param hitArea
 * @return number
 */
/* harmony default export */ var getNextPageIndex = (function (currentStageIndex, hitArea) {
  if (hitArea === FlipOriginTypes.TOP_RIGHT || hitArea === FlipOriginTypes.BOTTOM_RIGHT) {
    return currentStageIndex + 1;
  }
  if (hitArea === FlipOriginTypes.TOP_LEFT || hitArea === FlipOriginTypes.BOTTOM_LEFT) {
    return currentStageIndex - 1;
  }
  return 0;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/removeAnimationStyle.ts
/**
 * @param visibleStageRef
 * @param auxStageRef
 * @param nextVisibleStageRef
 */
/* harmony default export */ var removeAnimationStyle = (function (visibleStageRef, nextVisibleStageRef, auxStageRef) {
  var _visibleStageRef$firs;
  visibleStageRef.removeAttribute('style');
  (_visibleStageRef$firs = visibleStageRef.firstElementChild) === null || _visibleStageRef$firs === void 0 || _visibleStageRef$firs.removeAttribute('style');
  nextVisibleStageRef.removeAttribute('style');

  // Required for Flip effect
  if (auxStageRef) {
    auxStageRef.removeAttribute('style');
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getTimingFunction.ts
var easeInOutQuad = function easeInOutQuad(initialTime, changeInValue, duration) {
  var beginningValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  var time = initialTime / (duration / 2);
  if (time < 1) {
    return changeInValue / 2 * Math.pow(time, 2) + beginningValue;
  }
  return -changeInValue / 2 * ((time - 1) * (time - 3) - 1) + beginningValue;
};

/**
 * Currently, our application utilizes a single timing function. In the future, we plan to expand this functionality,
 * allowing users to choose from a variety of timing functions.
 * For examples and reference of various timing functions, visit:
 * [Timing functions reference](https://spicyyoghurt.com/tools/easing-functions)
 */
/* harmony default export */ var utils_getTimingFunction = (function () {
  return easeInOutQuad;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/requestAnimationControlled.ts





/**
 * This function is used to animate the effect for export video worker.
 * For a better video quality, the effect must be controlled frame by frame in order to make screenshots.
 * @param params
 * @param draw
 * @param hasToStopAnimation
 * @return Promise<boolean>
 */
var requestAnimationControlled = function requestAnimationControlled(params, draw, hasToStopAnimation) {
  return new Promise(function (resolve) {
    var initialDistance = params.initialDistance,
      _params$hasTwoPage = params.hasTwoPage,
      hasTwoPage = _params$hasTwoPage === void 0 ? false : _params$hasTwoPage,
      _params$layout = params.layout,
      layout = _params$layout === void 0 ? WidgetLayoutTypes.DOUBLE : _params$layout,
      _params$isRtl = params.isRtl,
      isRtl = _params$isRtl === void 0 ? false : _params$isRtl,
      effect = params.effect;
    var timingFunction = getTimingFunction();
    var effectContainer = document.getElementById(EFFECT_CONTAINER_ID);
    var distance = initialDistance;
    var stopAnimation = false;
    // Use linear incrementation for elapsedTime for smooth animation.
    // The requestAnimationFrame function has a parameter called timestamp (something like performance.now()).
    // But if the main thread is blocked then this time parameter is not accurate and the animation is not smooth
    var elapsedTime = 0;
    var hasToMovePage = layout !== WidgetLayoutTypes.SINGLE && !hasTwoPage;
    var movePageFromRight = isRtl ? 1 : -1;

    // The first page can be slightly moved to the left because of the flip effect
    if (effect === PlayerEffect.FLIP && layout !== WidgetLayoutTypes.SINGLE && hasTwoPage && effectContainer) {
      var _effectContainer$getB = effectContainer.getBoundingClientRect(),
        left = _effectContainer$getB.left,
        width = _effectContainer$getB.width;
      effectContainer.style.transition = 'none';
      // Check if the page is outside the screen
      hasToMovePage = left < 0 || left + width > window.innerWidth;
      movePageFromRight = left + width > window.innerWidth ? 1 : -1;
    }
    var goToNextFrame = function goToNextFrame() {
      window.requestAnimationFrame(function () {
        if (stopAnimation) {
          resolve(true);
          return;
        }
        var nextDistance = timingFunction(elapsedTime, initialDistance, EFFECT_CHANGE_PAGE_DURATION, 0);
        distance = initialDistance - nextDistance;

        // Move the page to center of the screen , step by step. First page opened. Last page closed.
        if (effect === PlayerEffect.FLIP && hasToMovePage) {
          var translateFrom = hasTwoPage ? 25 : 0;
          var flipEffectPercentage = (initialDistance - distance) / initialDistance * 100;
          var pageTransitionPercentage = 25 * flipEffectPercentage / 100;
          if (effectContainer) {
            var translateX = movePageFromRight * (translateFrom - pageTransitionPercentage);
            effectContainer.style.transform = "translate(".concat(translateX, "%, 0px)");
          }
        }
        if (!hasToStopAnimation(distance)) {
          elapsedTime += 16;
          draw(effect === PlayerEffect.SLIDE ? nextDistance : distance);
          stopAnimation = distance === 0;
        } else {
          draw(effect === PlayerEffect.SLIDE ? initialDistance : 0);
          stopAnimation = true;
        }
      });
    };
    window.addEventListener('goToNextFrame', goToNextFrame);
  });
};
/* harmony default export */ var utils_requestAnimationControlled = ((/* unused pure expression or super */ null && (requestAnimationControlled)));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/requestAnimation.ts




/**
 * @param params
 * @param draw
 * @param hasToStopAnimation
 * @return Promise<boolean>
 */
var requestAnimation = function requestAnimation(params, draw, hasToStopAnimation) {
  return new Promise(function (resolve) {
    var initialDistance = params.initialDistance,
      effect = params.effect;
    var timingFunction = utils_getTimingFunction();
    var distance = initialDistance;
    var stopAnimation = false;
    // Use linear incrementation for elapsedTime for smooth animation.
    // The requestAnimationFrame function has a parameter called timestamp (something like performance.now()).
    // But if the main thread is blocked then this time parameter is not accurate and the animation is not smooth
    var elapsedTime = 0;
    window.requestAnimationFrame(function animate() {
      if (stopAnimation) {
        resolve(true);
        return;
      }
      var nextDistance = timingFunction(elapsedTime, initialDistance, constants_EFFECT_CHANGE_PAGE_DURATION, 0);
      distance = initialDistance - nextDistance;
      if (!hasToStopAnimation(distance)) {
        elapsedTime += 16;
        draw(effect === src_playerTypes_PlayerEffect.SLIDE ? nextDistance : distance);
        stopAnimation = distance === 0;
        window.requestAnimationFrame(animate);
      } else {
        draw(effect === src_playerTypes_PlayerEffect.SLIDE ? initialDistance : 0);
        stopAnimation = true;
        window.requestAnimationFrame(animate);
      }
    });
  });
};
var fnToExport =  false ? 0 : requestAnimation;
/* harmony default export */ var utils_requestAnimation = (fnToExport);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectSlide/EffectSlide.styles.ts

var SlideEffectContainer = styled_components_browser_esm.div.withConfig({
  displayName: "EffectSlidestyles__SlideEffectContainer",
  componentId: "sc-hai01t-0"
})(["position:relative;"]);
var SlideContainer = styled_components_browser_esm.div.withConfig({
  displayName: "EffectSlidestyles__SlideContainer",
  componentId: "sc-hai01t-1"
})(["display:flex;flex-direction:column;width:", "px;height:", "px;align-items:center;position:relative;"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectSlide/utils/slideEffectUtils.ts

var isLeftAction = function isLeftAction(type) {
  return type === FlipOriginTypes.LEFT;
};
var isRightAction = function isRightAction(type) {
  return type === FlipOriginTypes.RIGHT;
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectSlide/components/SlideEffectContainer/SlideEffectContainer.tsx


























var BLOCKED_THRESHOLD = 10;
var SlideEffectContainer_SlideEffectContainer = function SlideEffectContainer(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options$c = _useContext.options.content,
    rtl = _useContext$options$c.rtl,
    effect = _useContext$options$c.effect,
    pages = _useContext.pages;
  var _useContext2 = (0,react.useContext)(contexts_SettledStageIndexContext),
    settledStageIndex = _useContext2.settledStageIndex,
    setSettledStageIndex = _useContext2.setSettledStageIndex;
  var modalContext = (0,react.useContext)(contexts_ModalContext);
  var layout = useLayout();
  var isEffectDisabled = usePreventSwipeOnZoom(false);
  var activeStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var isUserAction = react_useAtomValue(getUserActionAtom);
  var setNavigation = react_useSetAtom(generalStageIndexAtom);
  var _useAtom = react_useAtom(mouseOverPlayerAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    isMouseOverPlayer = _useAtom2[0];
  var setActiveMandatoryModal = react_useSetAtom(setActiveMandatoryModalAtom);
  var indexOfFirstMandatoryAction = useFirstMandatoryStageIndex();
  var blockedByMandatoryActions = activeStageIndex === indexOfFirstMandatoryAction;
  var _useState = (0,react.useState)(0),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    remainingWidthDiff = _useState2[0],
    setRemainingWidthDiff = _useState2[1];
  var _useState3 = (0,react.useState)(false),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    isDragging = _useState4[0],
    setIsDragging = _useState4[1];
  var _useState5 = (0,react.useState)(0),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    mouseDragLimitBorder = _useState6[0],
    setMouseDragLimitBorder = _useState6[1];
  (0,react.useEffect)(function () {
    setSettledStageIndex(activeStageIndex);
  }, []);
  var containerRef = (0,react.useRef)(null);
  var pageRef = (0,react.useRef)();
  var nextPageRef = (0,react.useRef)();
  var pageStyleRef = (0,react.useRef)();
  var nextPageStyleRef = (0,react.useRef)();
  var activeStageIndexRef = (0,react.useRef)(activeStageIndex);
  var centerStageIndex = (0,react.useRef)(activeStageIndexRef.current);
  var hitArea = (0,react.useRef)(FlipOriginTypes.EMPTY);
  var remainingDiff = (0,react.useRef)(0);
  var shouldChangePage = (0,react.useRef)(false);
  var processing = (0,react.useRef)(false);
  var visibleStageRect = (0,react.useRef)({
    width: 0,
    height: 0,
    left: 0,
    right: 0,
    bottom: 0,
    top: 0
  });
  var nrOfPagesOnStage = pages.order[activeStageIndex] && pages.order[activeStageIndex].length ? pages.order[activeStageIndex].length : 1;
  var nrOfPages = Object.keys(pages.data).length;
  var isDoublePages = layout === constants_WidgetLayoutTypes.DOUBLE && nrOfPages > 2;
  var isSinglePages = layout === constants_WidgetLayoutTypes.SINGLE;
  var maxPagesIndex = pages.order.length - 1;
  var hasTwoPages = isDoublePages && nrOfPagesOnStage === 2;
  var syncRenderedStageIndex = (0,react.useCallback)(function (requestedIndex) {
    var stagesToRender = generateRenderedStages(centerStageIndex.current, maxPagesIndex);
    var index = stagesToRender.findIndex(function (i) {
      return i === requestedIndex;
    });
    if (index === -1) {
      var center = stagesToRender.findIndex(function (i) {
        return i === centerStageIndex.current;
      });
      return requestedIndex > centerStageIndex.current ? center + 1 : center - 1;
    }
    return index;
  }, [centerStageIndex.current]);
  var checkStageToBeRemoved = function checkStageToBeRemoved(pageIndex) {
    if (Math.abs(settledStageIndex - pageIndex) > RenderStagePages) {
      var _containerRef$current;
      var stageToRemove = settledStageIndex > pageIndex ? syncRenderedStageIndex(settledStageIndex) - 1 : syncRenderedStageIndex(settledStageIndex) + 1;
      (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 || (_containerRef$current = _containerRef$current.children[stageToRemove]) === null || _containerRef$current === void 0 || (_containerRef$current = _containerRef$current.firstChild) === null || _containerRef$current === void 0 || _containerRef$current.remove();
    }
  };
  var resetSlideEffect = function resetSlideEffect(nextIndex) {
    var _pageRef$current, _nextPageRef$current, _pageRef$current3, _nextPageRef$current3;
    if ((_pageRef$current = pageRef.current) !== null && _pageRef$current !== void 0 && _pageRef$current.firstChild && (_nextPageRef$current = nextPageRef.current) !== null && _nextPageRef$current !== void 0 && _nextPageRef$current.firstChild) {
      var _pageRef$current2, _nextPageRef$current2;
      removeAnimationStyle((_pageRef$current2 = pageRef.current) === null || _pageRef$current2 === void 0 ? void 0 : _pageRef$current2.firstChild, (_nextPageRef$current2 = nextPageRef.current) === null || _nextPageRef$current2 === void 0 ? void 0 : _nextPageRef$current2.firstChild);
    }
    if (isSinglePages || nrOfPages <= 2) {
      setElementInlineStyle(pageRef.current, {
        left: "".concat(parseInt(nextPageStyleRef.current.left, 10), "px")
      });
    }
    (_pageRef$current3 = pageRef.current) === null || _pageRef$current3 === void 0 || _pageRef$current3.removeAttribute('style');
    (_nextPageRef$current3 = nextPageRef.current) === null || _nextPageRef$current3 === void 0 || _nextPageRef$current3.removeAttribute('style');
    checkStageToBeRemoved(nextIndex);
    activeStageIndexRef.current = nextIndex;
    setNavigation({
      activeStageIndex: nextIndex
    });
    (0,react_dom.flushSync)(function () {
      setSettledStageIndex(nextIndex);
    });
    setRemainingWidthDiff(0);
    setIsDragging(false);
    remainingDiff.current = 0;
    shouldChangePage.current = false;
    processing.current = false;
    hitArea.current = FlipOriginTypes.EMPTY;
    document.dispatchEvent(new Event(TRANSITION_EFFECT_DONE));
  };
  function isFirstPage(index) {
    return index - 1 === 0;
  }
  function isLastPage(index) {
    return nrOfPages > 2 && pages.order[index].length === 1 && index === maxPagesIndex;
  }
  var setNextPageStyle = function setNextPageStyle(nextIndex) {
    var nextPage = nextPageRef.current;
    var nextPageStyle = nextPageStyleRef.current;
    setElementInlineStyle(nextPage === null || nextPage === void 0 ? void 0 : nextPage.firstChild, {
      zIndex: 1,
      visibility: 'visible',
      display: 'block',
      transform: 'translateZ(0)'
    });
    var left = Math.abs(parseInt(nextPageStyle.left, 10));
    var width = Math.abs(parseInt(nextPageStyle.width, 10));
    if (isLeftAction(hitArea.current)) {
      if (isSinglePages) {
        setElementInlineStyle(nextPage, {
          left: "".concat(-left, "px")
        });
      } else {
        setElementInlineStyle(nextPage, {
          left: "".concat(left - width, "px")
        });
      }
    }
    if (isRightAction(hitArea.current)) {
      if (isDoublePages && isLastPage(nextIndex)) {
        setElementInlineStyle(nextPage, {
          left: "".concat(left + width * 2, "px")
        });
      } else {
        setElementInlineStyle(nextPage, {
          left: "".concat(left + width, "px")
        });
      }
    }
  };
  function canChangePage(nextIndex, isActiveStageSet) {
    return (isUserAction || !isActiveStageSet) && nextIndex !== activeStageIndexRef.current && !isEffectDisabled;
  }
  var changePage = function changePage(nextIndex) {
    var isActiveStageSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
    if (canChangePage(nextIndex, isActiveStageSet)) {
      var _containerRef$current2, _containerRef$current7;
      if (isDragging) {
        resetSlideEffect(settledStageIndex);
      }
      document.dispatchEvent(new MessageEvent(TRANSITION_EFFECT_START, {
        data: nextIndex
      }));
      if (hitArea.current === FlipOriginTypes.EMPTY) {
        hitArea.current = nextIndex > activeStageIndexRef.current ? FlipOriginTypes.RIGHT : FlipOriginTypes.LEFT;
      }
      var _ref = ((_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 || (_containerRef$current2 = _containerRef$current2.children[syncRenderedStageIndex(settledStageIndex)]) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.getBoundingClientRect()) || {},
        _ref$height = _ref.height,
        height = _ref$height === void 0 ? 0 : _ref$height;
      if (Math.abs(settledStageIndex - nextIndex) > RenderStagePages) {
        var _containerRef$current3, _containerRef$current4;
        var noOfPagesOnStage = pages.order[nextIndex].length;
        var nextWidth = props.width;

        // The page to which we navigate to, has only one-page split the width in half
        if (noOfPagesOnStage === 1) {
          nextWidth = props.width / 2;
        }
        var stageToAdded = settledStageIndex > nextIndex ? syncRenderedStageIndex(settledStageIndex) - 1 : syncRenderedStageIndex(settledStageIndex) + 1;
        generateNextVisibleStage(nextWidth, height, stageToAdded, containerRef);
        pageRef.current = (_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children[syncRenderedStageIndex(activeStageIndexRef.current)];
        nextPageRef.current = (_containerRef$current4 = containerRef.current) === null || _containerRef$current4 === void 0 ? void 0 : _containerRef$current4.children[syncRenderedStageIndex(nextIndex)];
        nextPageRef.current.style.width = "".concat(nextWidth, "px");
        pageStyleRef.current = getComputedStyle(pageRef.current);
        nextPageStyleRef.current = getComputedStyle(nextPageRef.current);
        setNextPageStyle(nextIndex);
      } else {
        var _containerRef$current5, _containerRef$current6;
        pageRef.current = (_containerRef$current5 = containerRef.current) === null || _containerRef$current5 === void 0 ? void 0 : _containerRef$current5.children[syncRenderedStageIndex(activeStageIndexRef.current)];
        nextPageRef.current = (_containerRef$current6 = containerRef.current) === null || _containerRef$current6 === void 0 ? void 0 : _containerRef$current6.children[syncRenderedStageIndex(nextIndex)];
        pageStyleRef.current = getComputedStyle(pageRef.current);
        nextPageStyleRef.current = getComputedStyle(nextPageRef.current);
        setNextPageStyle(nextIndex);
        if (isDoublePages) {
          setElementInlineStyle(nextPageRef.current, {
            width: "".concat(props.width, "px")
          });
        }
      }
      if (hitArea.current && (_containerRef$current7 = containerRef.current) !== null && _containerRef$current7 !== void 0 && _containerRef$current7.children[syncRenderedStageIndex(nextIndex)]) {
        var _containerRef$current8;
        var stageRect = (_containerRef$current8 = containerRef.current) === null || _containerRef$current8 === void 0 ? void 0 : _containerRef$current8.getBoundingClientRect();
        var draw = function draw(distance) {
          var currentPage = pageRef.current;
          var nextPage = nextPageRef.current;
          if (isLeftAction(hitArea.current)) {
            currentPage.style.transform = "translateX(".concat(distance, "px)");
            nextPage.style.transform = "translateX(".concat(distance, "px)");
          } else {
            currentPage.style.transform = "translateX(-".concat(distance, "px)");
            nextPage.style.transform = "translateX(-".concat(distance, "px)");
          }
        };
        var hasToStopAnimation = function hasToStopAnimation(distance) {
          return distance < 1 || distance > Math.round(stageRect.width);
        };
        var initialDistance = 0;
        if (isSinglePages || nrOfPages <= 2) {
          initialDistance = Math.round(parseInt(pageStyleRef.current.width, 10));
        } else if (isDoublePages) {
          initialDistance = Math.round(props.width);
        }
        utils_requestAnimation({
          initialDistance: initialDistance,
          hasTwoPage: hasTwoPages,
          layout: layout,
          isRtl: rtl,
          effect: effect
        }, draw, hasToStopAnimation).then(function () {
          resetSlideEffect(nextIndex);
        });
      }
    } else if (!isUserAction) {
      activeStageIndexRef.current = activeStageIndex;
      document.dispatchEvent(new Event(TRANSITION_EFFECT_DONE));
      setSettledStageIndex(activeStageIndex);
    }
  };
  var onMouseDownHandler = function onMouseDownHandler(event) {
    if (!isEffectDisabled && !isDragging && event.button === 0 && !main/* isMobile */.Fr && containerRef.current && activeStageIndex === activeStageIndexRef.current && !modalContext.active) {
      var _containerRef$current9;
      centerStageIndex.current = activeStageIndexRef.current;
      var _ref2 = ((_containerRef$current9 = containerRef.current.children[syncRenderedStageIndex(activeStageIndex)]) === null || _containerRef$current9 === void 0 ? void 0 : _containerRef$current9.getBoundingClientRect()) || {},
        _ref2$left = _ref2.left,
        left = _ref2$left === void 0 ? 0 : _ref2$left,
        _ref2$bottom = _ref2.bottom,
        bottom = _ref2$bottom === void 0 ? 0 : _ref2$bottom,
        _ref2$right = _ref2.right,
        right = _ref2$right === void 0 ? 0 : _ref2$right,
        _ref2$top = _ref2.top,
        top = _ref2$top === void 0 ? 0 : _ref2$top,
        _ref2$width = _ref2.width,
        width = _ref2$width === void 0 ? 0 : _ref2$width,
        _ref2$height = _ref2.height,
        height = _ref2$height === void 0 ? 0 : _ref2$height;
      visibleStageRect.current = {
        width: width,
        height: height,
        left: left,
        right: right,
        bottom: bottom,
        top: top
      };
      hitArea.current = getHitArea({
        clientX: event.clientX,
        clientY: event.clientY
      }, visibleStageRect.current, hasTwoPages, effect);
      if (hitArea.current !== FlipOriginTypes.EMPTY) {
        var _containerRef$current10;
        var nextPageIndex = getNextPageIndex(activeStageIndexRef.current, hitArea.current);
        if (hitArea.current && (_containerRef$current10 = containerRef.current) !== null && _containerRef$current10 !== void 0 && (_containerRef$current10 = _containerRef$current10.children[syncRenderedStageIndex(nextPageIndex)]) !== null && _containerRef$current10 !== void 0 && _containerRef$current10.firstChild) {
          var _containerRef$current11, _containerRef$current12, _pageRef$current4;
          if (isRightAction(hitArea.current) && maxPagesIndex === activeStageIndexRef.current || isLeftAction(hitArea.current) && activeStageIndex === 0) {
            hitArea.current = FlipOriginTypes.EMPTY;
            return;
          }
          var nextIndex = activeStageIndex + (isRightAction(hitArea.current) ? 1 : -1);
          pageRef.current = (_containerRef$current11 = containerRef.current) === null || _containerRef$current11 === void 0 ? void 0 : _containerRef$current11.children[syncRenderedStageIndex(activeStageIndexRef.current)];
          nextPageRef.current = (_containerRef$current12 = containerRef.current) === null || _containerRef$current12 === void 0 ? void 0 : _containerRef$current12.children[syncRenderedStageIndex(nextIndex)];
          var pageRefRect = (_pageRef$current4 = pageRef.current) === null || _pageRef$current4 === void 0 ? void 0 : _pageRef$current4.getBoundingClientRect();
          pageStyleRef.current = getComputedStyle(pageRef.current);
          nextPageStyleRef.current = getComputedStyle(nextPageRef.current);
          setNextPageStyle(activeStageIndex + 1);
          setMouseDragLimitBorder(Math.abs(parseInt(nextPageStyleRef.current.left, 10)));
          setRemainingWidthDiff(isRightAction(hitArea.current) ? pageRefRect.right : pageRefRect.left);
          setIsDragging(true);
        } else {
          hitArea.current = FlipOriginTypes.EMPTY;
        }
      }
    }
  };
  function checkIfShouldChangePage(pageLeft, width) {
    if (isDoublePages) {
      if (pages.order[activeStageIndex].length === 2) {
        var pageWidth = parseInt(pageStyleRef.current.width, 10);
        shouldChangePage.current = pageLeft + pageWidth / 2 < 0 || pageLeft > pageWidth / 2;
      } else {
        shouldChangePage.current = pageLeft < 0 || isLeftAction(hitArea.current) && pageLeft > width;
      }
    } else {
      shouldChangePage.current = pageLeft < 0 || pageLeft >= width;
    }
  }
  var _onMouseMove = function onMouseMove(event) {
    var _containerRef$current13;
    if (processing.current) {
      return;
    }
    var _ref3 = ((_containerRef$current13 = containerRef.current) === null || _containerRef$current13 === void 0 || (_containerRef$current13 = _containerRef$current13.children[syncRenderedStageIndex(activeStageIndex)]) === null || _containerRef$current13 === void 0 ? void 0 : _containerRef$current13.getBoundingClientRect()) || {},
      _ref3$left = _ref3.left,
      left = _ref3$left === void 0 ? 0 : _ref3$left,
      _ref3$width = _ref3.width,
      width = _ref3$width === void 0 ? 0 : _ref3$width;
    var page = pageRef.current;
    var nextPage = nextPageRef.current;
    var pageLeft = parseInt(pageStyleRef.current.left, 10);
    var nextPageLeft = parseInt(nextPageStyleRef.current.left, 10);
    setElementInlineStyle(page.firstChild, {
      pointerEvents: 'none',
      transform: 'translateZ(0)'
    });
    if (remainingDiff.current === 0) {
      remainingDiff.current = width - (event.clientX - left);
    }
    checkIfShouldChangePage(pageLeft, width);
    if (isRightAction(hitArea.current)) {
      var distanceFromLeftSide = nextPageLeft + remainingDiff.current - (width - (event.clientX - left));
      var pageViewDistance = mouseDragLimitBorder - distanceFromLeftSide;
      if (distanceFromLeftSide < (isDoublePages ? 0 : mouseDragLimitBorder - width)) {
        page.style.left = "".concat(isDoublePages ? -width : mouseDragLimitBorder - width * 2, "px");
        nextPage.style.left = "".concat(isDoublePages ? 0 : mouseDragLimitBorder - width, "px");
      } else if (distanceFromLeftSide > mouseDragLimitBorder) {
        page.style.left = "".concat(mouseDragLimitBorder - width, "px");
        nextPage.style.left = "".concat(mouseDragLimitBorder, "px");
      } else {
        page.style.left = "".concat(pageLeft + remainingDiff.current - (width - (event.clientX - left)), "px");
        nextPage.style.left = "".concat(distanceFromLeftSide, "px");
      }

      // Block slide effect to next page when on page with mandatory actions
      if (blockedByMandatoryActions && !rtl && pageViewDistance > BLOCKED_THRESHOLD) {
        document.removeEventListener('mousemove', _onMouseMove);
        setActiveMandatoryModal(true);
        resetSlideEffect(settledStageIndex);
      }
    }
    if (isLeftAction(hitArea.current)) {
      var pageWidth = nrOfPagesOnStage === 2 ? width : width * 2;
      var _distanceFromLeftSide = pageLeft + remainingDiff.current - (width - (event.clientX - left));
      var _pageViewDistance = isDoublePages ? -_distanceFromLeftSide : mouseDragLimitBorder - _distanceFromLeftSide;
      if (_distanceFromLeftSide < (isDoublePages ? 0 : mouseDragLimitBorder)) {
        page.style.left = "".concat(isDoublePages ? 0 : Math.abs(mouseDragLimitBorder - width), "px");
        if (isDoublePages) {
          if (isFirstPage(activeStageIndex)) {
            nextPage.style.left = "-".concat(Math.abs(width / 2), "px");
          } else if (isLastPage(activeStageIndex)) {
            nextPage.style.left = "-".concat(Math.abs(width * 2), "px");
          } else {
            nextPage.style.left = "-".concat(width, "px");
          }
        } else {
          nextPage.style.left = "-".concat(Math.abs(mouseDragLimitBorder - width), "px");
        }
      } else if (_distanceFromLeftSide > (isDoublePages ? pageWidth : mouseDragLimitBorder + width)) {
        if (isDoublePages) {
          if (isLastPage(activeStageIndex)) {
            page.style.left = "".concat(Math.abs(mouseDragLimitBorder - width) + width, "px");
          } else {
            page.style.left = "".concat(Math.abs(width), "px");
          }
        } else {
          page.style.left = "".concat(Math.abs(mouseDragLimitBorder + width), "px");
        }
        if (isDoublePages) {
          if (isFirstPage(activeStageIndex)) {
            nextPage.style.left = "".concat(Math.abs(width / 2), "px");
          } else {
            nextPage.style.left = "".concat(Math.abs(0), "px");
          }
        } else {
          nextPage.style.left = "".concat(Math.abs(mouseDragLimitBorder), "px");
        }
      } else {
        page.style.left = "".concat(_distanceFromLeftSide, "px");
        nextPage.style.left = "".concat(nextPageLeft + remainingDiff.current - (width - (event.clientX - left)), "px");
      }
      if (blockedByMandatoryActions && rtl && _pageViewDistance < -BLOCKED_THRESHOLD) {
        document.removeEventListener('mousemove', _onMouseMove);
        setActiveMandatoryModal(true);
        resetSlideEffect(settledStageIndex);
      }
    }
  };
  var finishSlideEffect = function finishSlideEffect() {
    var _containerRef$current14, _pageRef$current5, _nextPageRef$current4;
    processing.current = true;
    var pageLeft = parseInt(pageStyleRef.current.left, 10);
    var nextPageLeft = parseInt(nextPageStyleRef.current.left, 10);
    var stageRect = (_containerRef$current14 = containerRef.current) === null || _containerRef$current14 === void 0 ? void 0 : _containerRef$current14.getBoundingClientRect();
    var pageRect = (_pageRef$current5 = pageRef.current) === null || _pageRef$current5 === void 0 ? void 0 : _pageRef$current5.getBoundingClientRect();
    var nextPageRect = (_nextPageRef$current4 = nextPageRef.current) === null || _nextPageRef$current4 === void 0 ? void 0 : _nextPageRef$current4.getBoundingClientRect();
    var draw = function draw(distance) {
      if (shouldChangePage.current) {
        var currentPage = pageRef.current;
        var nextPage = nextPageRef.current;
        if (isLeftAction(hitArea.current)) {
          currentPage.style.transform = "translateX(".concat(distance, "px)");
          nextPage.style.transform = "translateX(".concat(distance, "px)");
        } else {
          currentPage.style.transform = "translateX(-".concat(distance, "px)");
          nextPage.style.transform = "translateX(-".concat(distance, "px)");
        }
      }
      if (!shouldChangePage.current) {
        if (isLeftAction(hitArea.current)) {
          pageRef.current.style.left = "".concat(pageLeft - distance, "px");
          nextPageRef.current.style.left = "".concat(nextPageLeft - distance, "px");
        } else {
          pageRef.current.style.left = "".concat(pageLeft + distance, "px");
          nextPageRef.current.style.left = "".concat(nextPageLeft + distance, "px");
        }
      }
    };
    var hasToStopAnimation = function hasToStopAnimation(distance) {
      return distance < 1 || distance > Math.round(stageRect.width);
    };
    var getInitialDistance = function getInitialDistance() {
      if (shouldChangePage.current && isLeftAction(hitArea.current)) {
        var nextIndex = activeStageIndex + (isRightAction(hitArea.current) ? 1 : -1);
        var nrOfPagesOnNextStage = pages.order[nextIndex].length;
        if (isDoublePages && isFirstPage(activeStageIndex) && nrOfPagesOnNextStage === 1) {
          return Math.abs(remainingWidthDiff - (nextPageRect.left - nextPageRect.width));
        }
        return Math.abs(remainingWidthDiff - nextPageRect.left);
      }
      if (shouldChangePage.current && isRightAction(hitArea.current)) {
        if (isDoublePages && isLastPage(activeStageIndex + 1)) {
          return Math.abs(remainingWidthDiff - (nextPageRect.right + nextPageRect.width));
        }
        return Math.abs(remainingWidthDiff - nextPageRect.right);
      }
      if (!shouldChangePage.current && isLeftAction(hitArea.current)) {
        return Math.abs(remainingWidthDiff - pageRect.left);
      }
      if (!shouldChangePage.current && isRightAction(hitArea.current)) {
        return Math.abs(remainingWidthDiff - nextPageRect.left);
      }
      return 0;
    };
    var resetStageIndex = activeStageIndex + (isRightAction(hitArea.current) ? 1 : -1);
    utils_requestAnimation({
      initialDistance: getInitialDistance(),
      hasTwoPage: hasTwoPages,
      layout: layout,
      isRtl: rtl,
      effect: effect
    }, draw, hasToStopAnimation).then(function () {
      resetSlideEffect(shouldChangePage.current ? resetStageIndex : activeStageIndex);
    });
  };
  (0,react.useEffect)(function () {
    var _onMouseUp = function onMouseUp() {
      document.removeEventListener('mousemove', _onMouseMove);
      document.removeEventListener('mouseup', _onMouseUp);
      finishSlideEffect();
    };
    if (isDragging && isMouseOverPlayer) {
      document.addEventListener('mousemove', _onMouseMove);
      document.addEventListener('mouseup', _onMouseUp);
    }
    return function () {
      if (isDragging && isMouseOverPlayer) {
        document.removeEventListener('mousemove', _onMouseMove);
        document.removeEventListener('mouseup', _onMouseUp);
      }
    };
  }, [isDragging, isMouseOverPlayer]);
  (0,react.useLayoutEffect)(function () {
    if (!isMouseOverPlayer && isDragging && !processing.current && activeStageIndex === activeStageIndexRef.current) {
      finishSlideEffect();
    }
  }, [isMouseOverPlayer, processing.current]);
  (0,react.useLayoutEffect)(function () {
    centerStageIndex.current = activeStageIndexRef.current;
    changePage(activeStageIndex);
  }, [activeStageIndex, isEffectDisabled, layout]);
  return /*#__PURE__*/react.createElement(SlideContainer, {
    ref: containerRef,
    $width: props.width,
    $height: props.height,
    onMouseDown: onMouseDownHandler
  }, props.children);
};
SlideEffectContainer_SlideEffectContainer.propTypes = {
  children: (prop_types_default()).element.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired
};
/* harmony default export */ var components_SlideEffectContainer_SlideEffectContainer = (SlideEffectContainer_SlideEffectContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/automation.ts
/**
 * The following ids are used to identify the elements in the export-video worker
 * Add here any ids that are/will be used for automation
 */
var automation_EFFECT_CONTAINER_ID = 'effect-container';
var BTN_NEXT_ID = 'btn-next';
var BTN_PREV_ID = 'btn-previous';
var AUX_STAGE_LAYER_ID = 'aux-stage-layer';
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/isStageInRange.ts


/**
 * Check if the given index is in range - this will decide if a stage is visible or not
 * @param currentIndex {number}
 * @param targetIndex {number}
 * @return boolean
 */
/* harmony default export */ var isStageInRange = (function (currentIndex, targetIndex) {
  return currentIndex <= targetIndex + RenderStagePages && currentIndex >= targetIndex - RenderStagePages;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/isPortrait.ts
/**
 * @param {number} width
 * @param {number} height
 * @return {boolean}
 */
/* harmony default export */ var isPortrait = (function (width, height) {
  return width < height;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/EffectFlip.styles.ts

var EffectFlip_styles_StageLayer = styled_components_browser_esm.div.withConfig({
  displayName: "EffectFlipstyles__StageLayer",
  componentId: "sc-kylv8a-0"
})(["width:", ";height:", ";top:0;left:0;position:absolute;overflow:hidden;visibility:", ";display:", ";pointer-events:", ";"], function (props) {
  return props.$size;
}, function (props) {
  return props.$size;
}, function (props) {
  return props.isVisibleStage ? 'visible' : 'hidden';
}, function (props) {
  return props.isVisibleStage ? 'block' : 'none';
}, function (props) {
  return props.isVisibleStage ? 'all' : 'none';
});
var StageDiv = styled_components_browser_esm.div.withConfig({
  displayName: "EffectFlipstyles__StageDiv",
  componentId: "sc-kylv8a-1"
})(["width:", "px;height:", "px;top:0;left:", "px;position:absolute;overflow:", ";pointer-events:", ";"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (props) {
  return props.$left;
}, function (props) {
  return props.$overflow;
}, function (props) {
  return props.isVisibleStage ? 'all' : 'none';
});
var NextStageLayer = styled_components_browser_esm.div.withConfig({
  displayName: "EffectFlipstyles__NextStageLayer",
  componentId: "sc-kylv8a-2"
})(["position:absolute;width:", "px;height:", "px;z-index:0;top:0;left:0;overflow:hidden;visibility:hidden;display:none;will-change:transform;"], function (props) {
  return props.$size;
}, function (props) {
  return props.$size;
});
var FlipContainer = styled_components_browser_esm.div.withConfig({
  displayName: "EffectFlipstyles__FlipContainer",
  componentId: "sc-kylv8a-3"
})(["display:flex;flex-direction:column;width:", "px;height:", "px;align-items:center;position:relative;overflow:hidden;"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
});
var EffectFlip_styles_PageContainer = styled_components_browser_esm.div.withConfig({
  displayName: "EffectFlipstyles__PageContainer",
  componentId: "sc-kylv8a-4"
})(["position:absolute;top:0;left:0;"]);
var FlipEffectContainer = styled_components_browser_esm.div.withConfig({
  displayName: "EffectFlipstyles__FlipEffectContainer",
  componentId: "sc-kylv8a-5"
})(["position:relative;transition:", ";transform:translate(", ",0px);will-change:transform;"], function (props) {
  return props.$animation;
}, function (props) {
  return props.$left;
});
var AuxSinglePage = styled_components_browser_esm.div.withConfig({
  displayName: "EffectFlipstyles__AuxSinglePage",
  componentId: "sc-kylv8a-6"
})(["width:", "px;height:", "px;background-color:#fff;"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
});
var PageGradient = styled_components_browser_esm.div.withConfig({
  displayName: "EffectFlipstyles__PageGradient",
  componentId: "sc-kylv8a-7"
})(["position:absolute;width:100%;height:100%;top:0;z-index:2;transform:translateZ(0);pointer-events:none;"]);
var LeftPageShadow = styled_components_browser_esm.div.withConfig({
  displayName: "EffectFlipstyles__LeftPageShadow",
  componentId: "sc-kylv8a-8"
})(["width:50%;height:100%;position:absolute;left:0;top:0;z-index:2;background-image:-webkit-linear-gradient(right,rgba(0,0,0,0.25) 0,rgba(0,0,0,0.12) 2%,rgba(0,0,0,0.075) 4%,rgba(255,255,255,0.05) 9%,rgba(255,255,255,0) 100%);pointer-events:none;"]);
var RightPageShadow = styled_components_browser_esm.div.withConfig({
  displayName: "EffectFlipstyles__RightPageShadow",
  componentId: "sc-kylv8a-9"
})(["position:absolute;width:50%;height:100%;top:0;right:0;z-index:2;background-image:-webkit-linear-gradient(left,rgba(0,0,0,0.3) 0,rgba(0,0,0,0.15) 3%,rgba(0,0,0,0.075) 6%,rgba(255,255,255,.05) 16%,rgba(255,255,255,0) 100%);pointer-events:none;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/StageLayer/StageLayer.tsx



var StageLayer = function StageLayer(props) {
  return /*#__PURE__*/react.createElement(EffectFlip_styles_StageLayer, {
    $size: props.width,
    isVisibleStage: props.isVisibleStage
  }, /*#__PURE__*/react.createElement(EffectFlip_styles_PageContainer, null, /*#__PURE__*/react.createElement(react.Fragment, null, props.children, /*#__PURE__*/react.createElement(PageGradient, {
    "data-id": "gradient"
  }))));
};
StageLayer.propTypes = {
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var StageLayer_StageLayer = (StageLayer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/StageListItem/StageListItemContainer.tsx



















var StageListItemContainer = function StageListItemContainer(props) {
  var _pages$order$settledS, _pages$order$props$in;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options$c = _useContext.options.content,
    rtl = _useContext$options$c.rtl,
    effect = _useContext$options$c.effect,
    pages = _useContext.pages;
  var _useAtom = react_useAtom(featuresAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    WIDGET_FORMS = _useAtom2[0].WIDGET_FORMS;
  var _useAtom3 = react_useAtom(leadFormStageIndexAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    leadFormStageIndex = _useAtom4[0];
  var _useContext2 = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext2.zoom;
  var _useFlipbookDimension = useFlipbookDimensions(),
    pageWidth = _useFlipbookDimension.width,
    pageHeight = _useFlipbookDimension.height;
  var _useContext3 = (0,react.useContext)(contexts_SettledStageIndexContext),
    settledStageIndex = _useContext3.settledStageIndex;
  var nrOfPagesOnStage = ((_pages$order$settledS = pages.order[settledStageIndex]) === null || _pages$order$settledS === void 0 ? void 0 : _pages$order$settledS.length) || 1;
  var layout = useLayout();
  var leftPosition = 0;
  var _useContext4 = (0,react.useContext)(contexts_ControllerContext),
    scale = _useContext4.scale;
  var stageWidth = Math.round(pageWidth * nrOfPagesOnStage * scale * zoom);
  if (effect === Effect.SLIDE) {
    // When Slide Effect is in place, "stageWidth" should be calculated based on page index
    stageWidth = Math.round(pageWidth * (pages.order[props.index].length || 1) * scale * zoom);
  }
  var stageHeight = Math.round(pageHeight * scale * zoom);
  var containerSize = isPortrait(stageWidth, stageHeight) ? stageHeight : stageWidth;
  if (nrOfPagesOnStage === 1 && settledStageIndex !== props.nrOfPages - 1 || layout === constants_WidgetLayoutTypes.SINGLE) {
    leftPosition = pageWidth;
  }
  var stageLayerWidth = "".concat(Math.round(containerSize * FLIP_LAYER_SCALE), "px");
  var left = Math.round(leftPosition * scale * zoom);
  if (effect === Effect.SLIDE) {
    stageLayerWidth = '100%';
    left = 0;
    if (layout === constants_WidgetLayoutTypes.SINGLE || Object.keys(pages.data).length <= 2) {
      leftPosition = pageWidth / 2;
    }
    if (props.index === 0) {
      left = Math.round(leftPosition * scale * zoom);
    }
    if (props.index > 0 && pages.order[props.index].length === 1) {
      left = Math.round(leftPosition * scale * zoom);
    }
  }
  var shouldRenderEmptyStage = isStageInRange(props.index, settledStageIndex) && leadFormStageIndex === props.index;

  // Verify if stage should be rendered with its structure and content
  var isCurrentStageVisible = props.index === settledStageIndex;
  var item = (0,react.useMemo)(function () {
    return props.renderStage(props.index, !shouldRenderEmptyStage, isCurrentStageVisible, pages.order[props.index], isStageBlocked(props.index, leadFormStageIndex, WIDGET_FORMS, rtl));
  }, [isCurrentStageVisible, props.index, shouldRenderEmptyStage, pageWidth, pageHeight]);

  // Render stage content only for visible stage and for those in the proximity
  return /*#__PURE__*/react.createElement(StageDiv, {
    $width: stageWidth,
    $height: stageHeight,
    $left: left,
    isVisibleStage: isCurrentStageVisible,
    id: "id-".concat(props.index),
    "data-pages": ((_pages$order$props$in = pages.order[props.index]) === null || _pages$order$props$in === void 0 ? void 0 : _pages$order$props$in.length) || 1,
    $overflow: effect === Effect.FLIP ? 'hidden' : 'visible'
  }, /*#__PURE__*/react.createElement(StageLayer_StageLayer, {
    width: stageLayerWidth,
    isVisibleStage: isCurrentStageVisible
  }, item));
};
StageListItemContainer.propTypes = {
  renderStage: (prop_types_default()).func.isRequired,
  index: (prop_types_default()).number.isRequired,
  nrOfPages: (prop_types_default()).number.isRequired
};
/* harmony default export */ var StageListItem_StageListItemContainer = (/*#__PURE__*/react.memo(StageListItemContainer));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/StageList/StageList.tsx






var StageList = function StageList(_ref) {
  var renderStage = _ref.renderStage;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    pages = _useContext.pages;
  var _useContext2 = (0,react.useContext)(contexts_SettledStageIndexContext),
    settledStageIndex = _useContext2.settledStageIndex;
  var maxIndex = pages.order.length - 1;
  // Prevent settledStageIndex to be out of bounds of the order array
  var allowedIndex = Math.min(settledStageIndex, maxIndex);
  var stagesToRender = generateRenderedStages(allowedIndex, maxIndex);
  var stageIds = stagesToRender.map(function (i) {
    return pages.order[i];
  });
  return /*#__PURE__*/react.createElement(react.Fragment, null, stageIds.map(function (pageIds, stageIndex) {
    return /*#__PURE__*/react.createElement(StageListItem_StageListItemContainer, {
      key: "stage-".concat(pageIds.join('-')),
      index: stagesToRender[stageIndex],
      renderStage: renderStage,
      nrOfPages: pages.order.length
    });
  }));
};
StageList.propTypes = {
  renderStage: (prop_types_default()).func.isRequired
};
/* harmony default export */ var StageList_StageList = (/*#__PURE__*/react.memo(StageList));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectSlide/EffectSlide.tsx









var EffectSlide = function EffectSlide(props) {
  var _useContext = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext.zoom;
  var _useContext2 = (0,react.useContext)(contexts_ControllerContext),
    scale = _useContext2.scale;
  var _useFlipbookDimension = useFlipbookDimensions(),
    width = _useFlipbookDimension.width,
    height = _useFlipbookDimension.height;
  var pageWidth = width * 2 * scale * zoom;
  var pageHeight = height * scale * zoom;
  return /*#__PURE__*/react.createElement(SlideEffectContainer, {
    id: automation_EFFECT_CONTAINER_ID
  }, /*#__PURE__*/react.createElement(components_SlideEffectContainer_SlideEffectContainer, {
    width: pageWidth,
    height: pageHeight
  }, /*#__PURE__*/react.createElement(StageList_StageList, {
    renderStage: props.renderStage
  })));
};
EffectSlide.propTypes = {
  renderStage: (prop_types_default()).func.isRequired
};
/* harmony default export */ var EffectSlide_EffectSlide = (EffectSlide);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/types/index.ts
var Coordinates = {
  x: 0,
  y: 0
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectScroll/EffectScroll.styles.ts


var ScrollEffectContainer = styled_components_browser_esm.div.withConfig({
  displayName: "EffectScrollstyles__ScrollEffectContainer",
  componentId: "sc-15hft3-0"
})(["pointer-events:all;overflow-y:scroll;scrollbar-color:rgba(0,0,0,0.6) rgba(255,255,255,0.2);width:", "px;height:", "px;scrollbar-width:", ";"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (props) {
  return props.isMobile ? 'none' : 'thin';
});
var ScrollEffectInnerContainer = styled_components_browser_esm.div.withConfig({
  displayName: "EffectScrollstyles__ScrollEffectInnerContainer",
  componentId: "sc-15hft3-1"
})(["position:relative;width:", ";height:", ";margin-top:", "px;margin-bottom:", "px;"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, FLIPBOOK_MIN_MARGIN, FLIPBOOK_MIN_MARGIN);
var PageRow = styled_components_browser_esm.div.withConfig({
  displayName: "EffectScrollstyles__PageRow",
  componentId: "sc-15hft3-2"
})(["position:absolute;width:100%;top:", "px;height:", "px;"], function (props) {
  return props.$top;
}, function (props) {
  return props.$height;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectScroll/PagesRow.tsx








var PagesRow = function PagesRow(props) {
  var leadFormStageIndex = react_useAtomValue(leadFormStageIndexAtom);
  var _useAtom = react_useAtom(featuresAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    WIDGET_FORMS = _useAtom2[0].WIDGET_FORMS;
  var indexOfFirstMandatoryAction = useFirstMandatoryStageIndex();
  return /*#__PURE__*/react.createElement(react.Fragment, null, props.items.map(function (item, index) {
    var pageRowIndex = props.startIndex + index;
    var hasLeadForm = isStageBlocked(pageRowIndex, leadFormStageIndex, WIDGET_FORMS, props.rtl);
    var isAfterMandatoryAction = typeof indexOfFirstMandatoryAction === 'number' && (props.rtl ? pageRowIndex < indexOfFirstMandatoryAction : pageRowIndex > indexOfFirstMandatoryAction);
    var shouldRenderStage = !hasLeadForm && !isAfterMandatoryAction;
    var shouldBlockStage = hasLeadForm || isAfterMandatoryAction;
    return /*#__PURE__*/react.createElement(PageRow, {
      key: item.join('-'),
      $top: pageRowIndex * props.pageHeight,
      $height: props.pageHeight
    }, props.renderStage(pageRowIndex, shouldRenderStage, true, item, shouldBlockStage));
  }));
};
/* harmony default export */ var EffectScroll_PagesRow = (PagesRow);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectScroll/utils/getFlipbookPageWidth.ts

var getFlipbookPageWidth = function getFlipbookPageWidth(width, scale, zoomFactor, noOfPages, layout) {
  var flipbookWidth = width * scale * zoomFactor;
  var multiplyFactor = 1;
  if (layout !== PlayerLayoutTypes.SINGLE && noOfPages > 2) {
    multiplyFactor = 2;
  }
  return Math.round(flipbookWidth * multiplyFactor);
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectScroll/utils/getTransformOriginLeft.ts

var getTransformOriginLeft = function getTransformOriginLeft(container, innerContainer, zoom, zoomForComponents) {
  var zoomFactor = zoomForComponents / zoom;

  // Calculate the difference in width between the visible container (viewport)
  // and the inner container (which holds the flipbook pages).
  var containerDiff = innerContainer.clientWidth - container.clientWidth;

  // Get half the width of the visible container (viewport).
  var containerHalfWidth = Math.round(container.clientWidth / 2);

  // `originX` represents the default transformation origin used for animations.
  // It is calculated as the current `scrollLeft` position plus half of the visible container's width.
  // This ensures that zooming and transformations occur relative to the center of the visible container.
  var originX = container.scrollLeft + containerHalfWidth;

  // Scale various properties based on the `zoomFactor`:
  //   - `innerWidthScaled`: The total scaled width of the container holding the flipbook pages.
  //   - `leftScaled`: The portion of the flipbook that is hidden on the left side of the viewport.
  //   - `halfVisibleScaled`: The scaled half-width of the visible container (used for centering calculations).
  //   - `rightScaled`: The portion of the flipbook that is hidden on the right side of the viewport.
  var innerWidthScaled = innerContainer.clientWidth * zoomFactor;
  var leftScaled = container.scrollLeft * zoomFactor;
  var halfVisibleScaled = containerHalfWidth * zoomFactor;
  var rightScaled = innerWidthScaled - container.clientWidth * zoomFactor + leftScaled;

  // `originXLeft` & `originXRight` represent the number of pixels that remain outside
  // the visible container on the left and right after applying the zoom factor.
  //   - If the value is **negative**, it means that part of the content will move **inside** the visible
  //   container after zooming.
  //   - If the value is **positive**, it means that portion of content will remain **outside** the visible container.
  var originXLeft = container.offsetWidth / 2 - (leftScaled + halfVisibleScaled);
  var originXRight = container.offsetWidth / 2 - (rightScaled + halfVisibleScaled);
  if (zoomForComponents < zoom) {
    if (leftScaled === rightScaled || isWithinThreshold(leftScaled, rightScaled)) {
      return originX;
    }
    if (container.scrollLeft > 0 && originXLeft > 0 && zoomForComponents > 1) {
      return container.scrollLeft / (1 - zoomFactor);
    }
    if (container.scrollLeft === 0 && innerWidthScaled > container.offsetWidth) {
      return 0;
    }
    if ((container.scrollLeft === containerDiff || isWithinThreshold(container.scrollLeft, containerDiff)) && innerWidthScaled > container.offsetWidth) {
      return innerContainer.clientWidth;
    }
    if (container.scrollLeft < containerDiff && rightScaled > 0 && originXRight > 0 && zoomForComponents > 1) {
      return innerContainer.clientWidth - rightScaled / (1 - zoomFactor);
    }
  }
  return originX;
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectScroll/utils/getTransformOriginTop.ts

var getTransformOriginTop = function getTransformOriginTop(container, innerContainer, zoom, zoomForComponents) {
  var zoomFactor = zoomForComponents / zoom;

  // Get half the height of the visible container (viewport).
  var containerHalfHeight = Math.round(container.clientHeight / 2);

  // `originY` represents the default transformation origin used for animations.
  // It is calculated as the current `scrollTop` position plus half of the visible container's height.
  // This ensures that zooming and transformations occur relative to the center of the visible container.
  var originY = container.scrollTop + containerHalfHeight;

  // Scale various properties based on the `zoomFactor`:
  //   - `innerHeightScaled`: The total scaled height of the container holding the flipbook pages.
  //   - `topScaled`: The portion of the flipbook that is hidden on the top side of the viewport.
  //   - `visibleTopScaled`: The scaled half-height of the visible container (used for centering calculations).
  //   - `bottomScaled`: The portion of the flipbook that is hidden on the bottom side of the viewport.
  var innerHeightScaled = innerContainer.clientHeight * zoomFactor;
  var topScaled = container.scrollTop * zoomFactor;
  var visibleTopScaled = containerHalfHeight * zoomFactor;
  var bottomScaled = innerHeightScaled - (container.clientHeight * zoomFactor + topScaled);

  // `originYTop` & `originYBottom` represent the number of pixels that remain outside
  // the visible container on the top and bottom after applying the zoom factor.
  //   - If the value is **negative**, it means that part of the content will move **inside** the visible
  //   container after zooming.
  //   - If the value is **positive**, it means that portion of content will remain **outside** the visible container.
  var originYTop = container.offsetHeight / 2 - (topScaled + visibleTopScaled);
  var originYBottom = container.offsetHeight / 2 - (bottomScaled + visibleTopScaled);
  if (zoomForComponents < zoom) {
    if (container.scrollTop > 0 && originYTop > 0) {
      return container.scrollTop / (1 - zoomFactor);
    }
    if (container.scrollTop === container.scrollHeight - container.clientHeight && isWithinThreshold(container.scrollTop, container.scrollHeight - container.clientHeight) && container.scrollHeight * zoomFactor > container.clientHeight) {
      return innerContainer.clientHeight;
    }
    if (container.scrollTop === 0 && innerHeightScaled > container.clientHeight) {
      return 0;
    }
    var scrollBottom = (container.scrollTop - containerHalfHeight) * zoomFactor + container.clientHeight - 128;
    if (scrollBottom === innerHeightScaled || isWithinThreshold(scrollBottom, innerHeightScaled) || container.scrollTop + containerHalfHeight === originY || isWithinThreshold(container.scrollTop + containerHalfHeight, originY)) {
      return originY;
    }
    if (container.scrollTop < innerContainer.clientHeight - container.clientHeight && bottomScaled > 0 && originYBottom > 0) {
      return innerContainer.clientHeight - bottomScaled / (1 - zoomFactor);
    }
  }
  return originY;
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectScroll/EffectScroll.tsx


function EffectScroll_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function EffectScroll_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? EffectScroll_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : EffectScroll_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


























var EffectScroll = function EffectScroll(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    pages = _useContext.pages,
    _useContext$options$c = _useContext.options.content,
    rtl = _useContext$options$c.rtl,
    isMobilePreview = _useContext$options$c.isMobilePreview;
  var _useContext2 = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext2.zoom,
    setZoomAction = _useContext2.setZoom;
  var _useContext3 = (0,react.useContext)(contexts_ControllerContext),
    scale = _useContext3.scale;
  var _useContext4 = (0,react.useContext)(contexts_SettledStageIndexContext),
    setSettledStageIndex = _useContext4.setSettledStageIndex;
  var layout = useLayout();
  var activeStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var setNavigation = react_useSetAtom(generalStageIndexAtom);
  var _useAtom = react_useAtom(stageSizeWidthAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageWidth = _useAtom2[0];
  var _useAtom3 = react_useAtom(stageSizeHeightAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    stageHeight = _useAtom4[0];
  var _useAtom5 = react_useAtom(zoomForComponentsAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    zoomForComponents = _useAtom6[0];
  var _useAtom7 = react_useAtom(setZoomForComponentsAtom),
    _useAtom8 = slicedToArray_slicedToArray(_useAtom7, 2),
    setZoomForComponents = _useAtom8[1];
  var _useAtom9 = react_useAtom(toggleZoomForGestureEventAtom),
    _useAtom10 = slicedToArray_slicedToArray(_useAtom9, 2),
    toggleZoomForGestureEvent = _useAtom10[1];
  var isActiveMandatoryModal = react_useAtomValue(isActiveMandatoryModalAtom);
  var containerRef = (0,react.useRef)(null);
  var innerContainerRef = (0,react.useRef)(null);
  var animationRef = (0,react.useRef)();
  var activeStageIndexRef = (0,react.useRef)(0);
  var prevZoom = (0,react.useRef)(zoomForComponents);
  var isDragging = (0,react.useRef)(false);
  var dragPositionStart = (0,react.useRef)(Coordinates);
  var scrollStartPosition = (0,react.useRef)(Coordinates);
  var transformOriginRef = (0,react.useRef)(EffectScroll_objectSpread(EffectScroll_objectSpread({}, Coordinates), {}, {
    width: 0,
    height: 0
  }));
  var hasInitialized = (0,react.useRef)(false);
  var isAnimationInProgress = (0,react.useRef)(false);
  var doubleTapTriggered = (0,react.useRef)(false);
  var _useTransition = (0,react.useTransition)(),
    _useTransition2 = slicedToArray_slicedToArray(_useTransition, 2),
    isTransitioning = _useTransition2[0],
    startTransition = _useTransition2[1];
  var flipbookDimensions = useFlipbookDimensions();
  var pageHeight = Math.round(flipbookDimensions.height * scale * zoom);
  var noOfPages = Object.keys(pages.data).length;
  var visibleItemCount = Math.ceil(stageHeight / (flipbookDimensions.height * scale));
  var startIndex = Math.max(0, activeStageIndex - LOAD_FLIPBOOK_PAGES_BUFFER);
  var endIndex = Math.min(pages.order.length, activeStageIndex + visibleItemCount + LOAD_FLIPBOOK_PAGES_BUFFER);
  var visibleItems = pages.order.slice(startIndex, endIndex);
  var totalHeight = "".concat(pages.order.length * pageHeight, "px");
  var innerWidth = getFlipbookPageWidth(flipbookDimensions.width, scale, zoom, noOfPages, layout);
  if (innerWidth > stageWidth && !(main/* isMobile */.Fr || isMobilePreview)) {
    innerWidth = "".concat(innerWidth + FLIPBOOK_MIN_MARGIN * 2, "px");
  } else {
    innerWidth = '100%';
  }

  /**
   * Position scroll top based on active stage index
   */
  (0,react.useEffect)(function () {
    var container = containerRef.current;
    if (!hasInitialized.current && container) {
      hasInitialized.current = true;
      return;
    }
    if (!isTransitioning && container && activeStageIndexRef.current !== activeStageIndex) {
      container.scrollTop = activeStageIndex === 0 ? 0 : activeStageIndex * pageHeight;
      activeStageIndexRef.current = activeStageIndex;
    }
  }, [activeStageIndex, isActiveMandatoryModal, hasInitialized.current, isTransitioning]);

  /**
   * Handle double click and double tap
   */
  (0,react.useEffect)(function () {
    var container = containerRef.current;
    var onDoubleClickOrTap = function onDoubleClickOrTap(event) {
      if (container && event.detail === 2) {
        doubleTapTriggered.current = true;
        toggleZoomForGestureEvent();
      }
    };
    container === null || container === void 0 || container.addEventListener('click', onDoubleClickOrTap);
    return function () {
      container === null || container === void 0 || container.removeEventListener('click', onDoubleClickOrTap);
    };
  }, []);

  /**
   * Handle pinch to zoom
   */
  (0,react.useEffect)(function () {
    var container = containerRef.current;
    var innerContainer = innerContainerRef.current;
    if (!container || !innerContainer) {
      return function () {};
    }
    var startDistance = null;
    var currentScale = zoomForComponents;
    var pinchToZoomValue = 0;
    var tempZoom = zoom;
    var touchStart = function touchStart(event) {
      if (event.touches.length === 2) {
        event.preventDefault();
        if (zoomForComponents === ZOOM_MIN_VALUE) {
          tempZoom = ZOOM_MIN_VALUE;
        }

        // Calculate where the fingers have started on the X and Y axis
        startDistance = getDistance2D({
          x: event.touches[0].pageX,
          y: event.touches[0].pageY
        }, {
          x: event.touches[1].pageX,
          y: event.touches[1].pageY
        });
        var touchMove = function touchMove(e) {
          if (e.touches.length < 2) {
            return;
          }
          var currentDistance = getDistance2D({
            x: e.touches[0].pageX,
            y: e.touches[0].pageY
          }, {
            x: e.touches[1].pageX,
            y: e.touches[1].pageY
          });
          if (startDistance) {
            var newScale = (currentDistance - startDistance) / startDistance; // Linear proportion
            var newZoom = Math.min(ZOOM_MAX_VALUE, Math.max(ZOOM_MIN_VALUE, currentScale + newScale));
            transformOriginRef.current = {
              x: getTransformOriginLeft(container, innerContainer, tempZoom, newZoom),
              y: getTransformOriginTop(container, innerContainer, tempZoom, newZoom),
              width: innerContainer.scrollWidth,
              height: innerContainer.clientHeight
            };
            setElementInlineStyle(innerContainer, {
              'transform-origin': "".concat(transformOriginRef.current.x, "px\n                                            ").concat(transformOriginRef.current.y, "px"),
              transform: "scale(".concat(newZoom / tempZoom, ")"),
              transition: ''
            });
            currentScale = newZoom;
            startDistance = currentDistance;
            pinchToZoomValue = newZoom;
          }
        };
        var _touchEnd = function touchEnd() {
          innerContainer.style.transform = '';
          prevZoom.current = tempZoom;
          setZoomAction(pinchToZoomValue);
          setZoomForComponents(pinchToZoomValue);
          doubleTapTriggered.current = false;
          container.removeEventListener('touchmove', touchMove);
          container.removeEventListener('touchend', _touchEnd);
        };
        container.addEventListener('touchmove', touchMove, {
          passive: false
        });
        container.addEventListener('touchend', _touchEnd);
      }
    };
    container.addEventListener('touchstart', touchStart, {
      passive: false,
      capture: true
    });
    return function () {
      container.removeEventListener('touchstart', touchStart, {
        capture: true
      });
    };
  }, [zoomForComponents, stageWidth, stageHeight]);

  /**
   * Handle mouse drag
   */
  (0,react.useEffect)(function () {
    var container = containerRef.current;
    var innerContainer = innerContainerRef.current;
    if (!container || !innerContainer) {
      return function () {};
    }
    var onMouseMove = function onMouseMove(event) {
      if (!isDragging.current || isAnimationInProgress.current) {
        return;
      }
      var position = getGesturePosition(event);
      var positionTop = position.y - dragPositionStart.current.y;
      var positionLeft = position.x - dragPositionStart.current.x;
      container.scrollTop = scrollStartPosition.current.y + -positionTop;
      container.scrollLeft = scrollStartPosition.current.x + -positionLeft;
    };
    var onMouseDown = function onMouseDown(event) {
      if (isAnimationInProgress.current || event instanceof MouseEvent && isWithinThreshold(event.clientX, 0, [container.clientWidth, container.offsetWidth], THRESHOLD_TYPE.BETWEEN)) {
        return;
      }
      isDragging.current = true;
      dragPositionStart.current = getGesturePosition(event);
      scrollStartPosition.current = {
        x: container.scrollLeft || 0,
        y: container.scrollTop || 0
      };
    };
    var onMouseUp = function onMouseUp() {
      isDragging.current = false;
      if (zoomForComponents === ZOOM_MIN_VALUE) {
        dragPositionStart.current = Coordinates;
      }
    };
    container.addEventListener('mousemove', onMouseMove);
    container.addEventListener('mousedown', onMouseDown, true);
    document.addEventListener('mouseup', onMouseUp, true);
    return function () {
      container.removeEventListener('mousemove', onMouseMove, true);
      container.removeEventListener('mousedown', onMouseDown, true);
      document.removeEventListener('mouseup', onMouseUp, true);
    };
  }, [zoomForComponents]);

  /**
   * Handle animation
   */
  (0,react.useLayoutEffect)(function () {
    var container = containerRef.current;
    var innerContainer = innerContainerRef.current;
    if (!container || !innerContainer || (main/* isMobile */.Fr || isMobilePreview) && !doubleTapTriggered.current) {
      return function () {};
    }
    isAnimationInProgress.current = true;
    var zoomFactor = zoomForComponents / zoom;
    var onFinishAnimation = function onFinishAnimation() {
      var _animationRef$current;
      (_animationRef$current = animationRef.current) === null || _animationRef$current === void 0 || _animationRef$current.cancel();
      innerContainer.style.transform = '';
      if (zoomForComponents === ZOOM_MIN_VALUE) {
        dragPositionStart.current = Coordinates;
      }
      prevZoom.current = zoom;
      isAnimationInProgress.current = false;
      doubleTapTriggered.current = false;
      (0,react_dom.flushSync)(function () {
        setZoomAction(zoomForComponents);
      });
    };
    transformOriginRef.current = {
      x: getTransformOriginLeft(container, innerContainer, zoom, zoomForComponents),
      y: getTransformOriginTop(container, innerContainer, zoom, zoomForComponents),
      width: innerContainer.clientWidth,
      height: innerContainer.clientHeight
    };
    setElementInlineStyle(innerContainer, {
      'transform-origin': "".concat(transformOriginRef.current.x, "px ").concat(transformOriginRef.current.y, "px")
    });
    animationRef.current = innerContainer.animate([{
      transform: "scale(".concat(zoomFactor, ")")
    }], KeyframeOptions);
    animationRef.current.addEventListener('finish', onFinishAnimation, {
      passive: false
    });
    return function () {
      var _animationRef$current2;
      (_animationRef$current2 = animationRef.current) === null || _animationRef$current2 === void 0 || _animationRef$current2.removeEventListener('finish', onFinishAnimation);
    };
  }, [zoomForComponents, stageWidth, stageHeight]);

  /**
   * Handle Page Alignment on Zoom Change
   */
  (0,react.useLayoutEffect)(function () {
    var container = containerRef.current;
    var innerContainer = innerContainerRef.current;
    var origins = transformOriginRef.current;
    if (!container || !innerContainer) {
      return;
    }

    /** Calculate scrollTop position  */
    if (innerContainer.clientHeight > container.clientHeight) {
      var originY = origins.y * (innerContainer.clientHeight / origins.height);
      var halfInnerHeight = innerContainer.clientHeight / 2;
      var heightDiff = (innerContainer.clientHeight - container.clientHeight) / 2;
      var offset = Math.abs(halfInnerHeight - originY);
      if (originY === halfInnerHeight || offset <= 2) {
        container.scrollTop = heightDiff;
      } else if (originY > halfInnerHeight) {
        container.scrollTop = heightDiff + offset;
      } else {
        container.scrollTop = heightDiff - offset;
      }
    }

    /** Calculate scrollLeft position  */
    if (innerContainer.scrollWidth > container.clientWidth) {
      var originX = origins.x * (innerContainer.scrollWidth / origins.width);
      var halfInnerWidth = innerContainer.scrollWidth / 2;
      var widthDiff = (innerContainer.scrollWidth - container.clientWidth) / 2;
      var offsetDiff = Math.abs(halfInnerWidth - originX);
      if (originX === halfInnerWidth || offsetDiff <= 2) {
        container.scrollLeft = widthDiff;
      } else if (originX > halfInnerWidth) {
        container.scrollLeft = widthDiff + offsetDiff;
      } else {
        container.scrollLeft = widthDiff - offsetDiff;
      }
    }
  }, [zoom]);

  /**
   * Handle scroll
   */
  (0,react.useLayoutEffect)(function () {
    var container = containerRef.current;
    if (!container) {
      return function () {};
    }
    var onScroll = function onScroll(params) {
      if (isAnimationInProgress.current) {
        return;
      }
      var target = params.target;
      var activePageIndex = Math.round(target.scrollTop / pageHeight);
      if (zoom > ZOOM_MIN_VALUE) {
        var middleHeight = container.clientHeight / 2 * (zoom - 1);
        activePageIndex = Math.round((target.scrollTop - middleHeight) / pageHeight);
      }
      if (activePageIndex >= 0 && activeStageIndexRef.current !== activePageIndex) {
        activeStageIndexRef.current = activePageIndex;
        setNavigation({
          activeStageIndex: activePageIndex
        });
        startTransition(function () {
          setSettledStageIndex(activePageIndex);
        });
      }
    };
    container.addEventListener('scroll', onScroll, {
      passive: true
    });
    return function () {
      container.removeEventListener('scroll', onScroll);
    };
  }, [pageHeight]);
  return /*#__PURE__*/react.createElement(ScrollEffectContainer, {
    ref: containerRef,
    $width: stageWidth,
    $height: stageHeight,
    isMobile: main/* isMobile */.Fr || isMobilePreview
  }, /*#__PURE__*/react.createElement(ScrollEffectInnerContainer, {
    ref: innerContainerRef,
    $width: innerWidth,
    $height: totalHeight
  }, /*#__PURE__*/react.createElement(EffectScroll_PagesRow, {
    items: visibleItems,
    renderStage: props.renderStage,
    pageHeight: pageHeight,
    startIndex: startIndex,
    rtl: rtl
  })));
};
/* harmony default export */ var EffectScroll_EffectScroll = (EffectScroll);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/FlipEffectContext.ts

var defaultValues = {
  setAuxStageContainerRef: function setAuxStageContainerRef() {},
  setAuxStageContentRef: function setAuxStageContentRef() {},
  auxStageContainerRef: null,
  auxStageContentRef: null
};
/* harmony default export */ var FlipEffectContext = (/*#__PURE__*/(0,react.createContext)(defaultValues));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/FlipContainer/FlipContainer.tsx




var FlipContainer_FlipContainer = function FlipContainer(props) {
  var _useState = (0,react.useState)(null),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    auxStageContainerRef = _useState2[0],
    setAuxStageContainerRef = _useState2[1];
  var _useState3 = (0,react.useState)(null),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    auxStageContentRef = _useState4[0],
    setAuxStageContentRef = _useState4[1];
  return /*#__PURE__*/react.createElement(FlipEffectContext.Provider, {
    value: {
      auxStageContainerRef: auxStageContainerRef,
      setAuxStageContainerRef: setAuxStageContainerRef,
      auxStageContentRef: auxStageContentRef,
      setAuxStageContentRef: setAuxStageContentRef
    }
  }, props.children);
};
FlipContainer_FlipContainer.propTypes = {
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var components_FlipContainer_FlipContainer = (FlipContainer_FlipContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getAttribute.ts
/**
 * @param {HTMLElement} element
 * @param {string} attributeName
 * @param {any} defaultValue
 * @return {any}
 */
/* harmony default export */ var getAttribute = (function (element, attributeName) {
  var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  if (!element) {
    return defaultValue;
  }
  return element.getAttribute(attributeName) || defaultValue;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getDistance.ts
/**
 * Returns the distance between 2 value
 * @param x
 * @param y
 * @return {number}
 */
var getDistance = function getDistance(x, y) {
  return Math.abs(x - y);
};
/* harmony default export */ var utils_getDistance = (getDistance);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getPageLayerRotation.ts
/**
 * @param {number} a
 * @param {number} b
 * @returns {number}
 */
var getPageLayerRotation = function getPageLayerRotation(a, b) {
  return Math.atan(a / b) * 180 / Math.PI;
};
/* harmony default export */ var utils_getPageLayerRotation = (getPageLayerRotation);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/convertDegToRad.ts
/**
 * Converts degree to radian
 * @param degree
 * @return {number}
 */
var convertDegToRad = function convertDegToRad(degree) {
  return degree * Math.PI / 180;
};
/* harmony default export */ var utils_convertDegToRad = (convertDegToRad);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getLayerAndPageIntersectionDistance.ts


/**
 * Returns the distance between the opposite visible page corner of the flip effect
 * and the intersection point of the next page and the visible page
 * https://gitlab.flipsnack.com/flipsnack.com/repo/-/wikis/uploads/2392ebe1d065bad39b6579d9832c54d0/flip3.jpg - x + dx2
 * @param {number} omega
 * @param {number} mouseCoordinateX
 * @param {number} mouseCoordinateY
 * @return {number}
 */
/* harmony default export */ var getLayerAndPageIntersectionDistance = (function (omega, mouseCoordinateX, mouseCoordinateY) {
  var dx2 = Math.tan(utils_convertDegToRad(omega)) * mouseCoordinateY;
  var result = mouseCoordinateX - dx2;
  return parseInt(result.toFixed(2), 10);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getLayerPosition.ts


/**
 * (translate(x y))
 * @param alpha
 * @param distance
 * @return {{x: number, y: number}}
 */
var getLayerPosition = function getLayerPosition(alpha, distance) {
  var alphaRadian = utils_convertDegToRad(alpha);
  var xh = Math.cos(alphaRadian) * distance;
  var xv = Math.sin(alphaRadian) * distance;
  var y = Math.sin(alphaRadian) * xh;
  // Epsilon
  var E = 90 - alpha;
  var x = Math.cos(E * Math.PI / 180) * xv;
  return {
    x: x,
    y: y
  };
};
/* harmony default export */ var utils_getLayerPosition = (getLayerPosition);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getFlipValues.ts




/**
 * See wiki https://gitlab.flipsnack.com/flipsnack.com/repo/-/wikis/Effect-de-flip
 * @param containerWidth
 * @param mousePositionOnPage
 * @param nrOfPages
 * @return {{ layerPosition: number, layerRotationDegree: number }}
 */
/* harmony default export */ var getFlipValues = (function (containerWidth, mousePositionOnPage, nrOfPages) {
  // It Represents the distance between the mouse position on X and the page margin
  var distanceFromClientXToCorner = utils_getDistance(containerWidth, mousePositionOnPage.x);
  var layerRotationDegree = utils_getPageLayerRotation(distanceFromClientXToCorner, mousePositionOnPage.y);

  // When the page is settling down (last animation step) and y value is 0, layerAndPageIntersectionDistance value
  // must be translated with the value of a page width
  var auxPageOverlayCorrection = mousePositionOnPage.y === 0 ? containerWidth / nrOfPages : 0;
  var degreeBetweenNextPageAndYAxis = 90 - 2 * layerRotationDegree;
  var layerAndPageIntersectionDistance = getLayerAndPageIntersectionDistance(degreeBetweenNextPageAndYAxis, mousePositionOnPage.x, mousePositionOnPage.y);
  var layerPosition = utils_getLayerPosition(layerRotationDegree, layerAndPageIntersectionDistance + auxPageOverlayCorrection);
  return {
    layerPosition: layerPosition,
    layerRotationDegree: layerRotationDegree
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getMousePositionOnPage.ts


/**
 * Returns the mouse position on the page and the page corner
 * @param mainPage
 * @param mousePosition
 * @param axisSign
 * @return {nextPageCorner: { x: number, y: number }, mousePositionOnPage: { x: number, y: number }}
 */

/* harmony default export */ var getMousePositionOnPage = (function (mainPage, mousePosition, axisSign) {
  var pageCornerX = -1 * axisSign.x * (mainPage.positionX - mousePosition.x);
  var pageCornerY = utils_getDistance(mousePosition.y, mainPage.positionY);
  var distanceFromOrigin = getDistance2D({
    x: pageCornerX,
    y: pageCornerY
  }, {
    x: mainPage.originX,
    y: 0
  });
  if (distanceFromOrigin > mainPage.width) {
    var auxPageCornerX = Math.abs(pageCornerX - mainPage.originX) * mainPage.width / distanceFromOrigin;
    var auxPageCornerY = pageCornerY * mainPage.width / distanceFromOrigin;
    pageCornerX = pageCornerX > mainPage.originX ? auxPageCornerX + mainPage.originX : mainPage.originX - auxPageCornerX;
    pageCornerY = auxPageCornerY;
  }
  var clientX = Math.abs(axisSign.x * pageCornerX + mainPage.positionX);
  var clientY = Math.abs(axisSign.y * -pageCornerY + mainPage.positionY);
  return {
    nextPageCorner: {
      x: pageCornerX,
      y: pageCornerY
    },
    mousePositionOnPage: {
      x: clientX,
      y: clientY
    }
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getDefaultLayerStyles.ts

/**
 * The left corner top of the page is considered the 0, 0 point of the axis coordinates, right corner top is 1, -1
 * and left corner bottom is -1, 1
 * Knowing this we can calculate the axis sign of each corner
 * Styles for flip effect
 * @param hitArea
 * @return FlipOptions
 */
var getDefaultLayerStyles = function getDefaultLayerStyles(hitArea) {
  if (hitArea === FlipOriginTypes.BOTTOM_LEFT) {
    return {
      commonLayerStyle: {
        top: 'auto',
        bottom: '0',
        left: 'auto',
        right: '0',
        transformOrigin: '100% 100%'
      },
      axisSign: {
        x: -1,
        y: 1
      }
    };
  }
  if (hitArea === FlipOriginTypes.TOP_RIGHT) {
    return {
      commonLayerStyle: {
        top: '0',
        bottom: 'auto',
        left: '0',
        right: 'auto',
        transformOrigin: '0% 0%'
      },
      axisSign: {
        x: 1,
        y: -1
      }
    };
  }
  if (hitArea === FlipOriginTypes.TOP_LEFT) {
    return {
      commonLayerStyle: {
        top: '0',
        bottom: 'auto',
        left: 'auto',
        right: '0',
        transformOrigin: '100% 0%'
      },
      axisSign: {
        x: -1,
        y: -1
      }
    };
  }

  // Default corner Bottom Right
  return {
    commonLayerStyle: {
      top: 'auto',
      bottom: '0',
      left: '0',
      right: 'auto',
      transformOrigin: '0% 100%'
    },
    axisSign: {
      x: 1,
      y: 1
    }
  };
};
/* harmony default export */ var utils_getDefaultLayerStyles = (getDefaultLayerStyles);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/hasToChangePage.ts


/**
 * Checks if the mouse is on the next page
 * @param mousePositionX
 * @param pageCornerX
 * @param pageWidth
 * @param axisSignX
 * @return boolean
 */

/* harmony default export */ var hasToChangePage = (function (mousePositionX, pageCornerX, pageWidth, axisSignX) {
  if (axisSignX > 0 && mousePositionX < pageCornerX) {
    var dragDistance = utils_getDistance(mousePositionX, pageCornerX);
    return dragDistance > pageWidth;
  }
  if (axisSignX < 0 && mousePositionX > pageCornerX) {
    var _dragDistance = utils_getDistance(mousePositionX, pageCornerX);
    return _dragDistance > pageWidth;
  }
  return false;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getCornerCoordinates.ts

/**
 * PositionX and positionY differs depending the dragged corner
 * @param layerCoordinates
 * @param flipOrigin
 * @return {
 *     positionX: number,
 *     positionY: number,
 * }
 */
/* harmony default export */ var getCornerCoordinates = (function (layerCoordinates, flipOrigin) {
  if (flipOrigin === FlipOriginTypes.BOTTOM_RIGHT) {
    return {
      positionX: layerCoordinates.right,
      positionY: layerCoordinates.bottom
    };
  }
  if (flipOrigin === FlipOriginTypes.TOP_RIGHT) {
    return {
      positionX: layerCoordinates.right,
      positionY: layerCoordinates.top
    };
  }
  if (flipOrigin === FlipOriginTypes.BOTTOM_LEFT) {
    return {
      positionX: layerCoordinates.left,
      positionY: layerCoordinates.bottom
    };
  }
  if (flipOrigin === FlipOriginTypes.TOP_LEFT) {
    return {
      positionX: layerCoordinates.left,
      positionY: layerCoordinates.top
    };
  }
  return {
    positionX: layerCoordinates.left,
    positionY: layerCoordinates.bottom
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getTransitionsStyle.ts
/** Returns the container Style and the visible page style
 * @param layerPosition
 * @param layerRotationDegree
 * @return TransitionsStyleType
 */

/* harmony default export */ var getTransitionsStyle = (function (layerPosition, layerRotationDegree) {
  return {
    containerStyleObj: {
      transform: "translate3d(".concat(layerPosition.x, "px, ").concat(layerPosition.y, "px, 0px)") + "rotate(".concat(layerRotationDegree, "deg)"),
      zIndex: 3
    },
    visiblePageStyle: {
      transform: "rotate(".concat(-layerRotationDegree, "deg)") + "translate3d(".concat(-layerPosition.x, "px, ").concat(-layerPosition.y, "px, 0px)")
    }
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getAuxLayerTransitionStyle.ts
/**
 * @param layerPosition
 * @param layerRotationDegree
 * @return { transform: string }
 */
/* harmony default export */ var getAuxLayerTransitionStyle = (function (layerPosition, layerRotationDegree) {
  return {
    transform: "rotate(".concat(layerRotationDegree, "deg)") + "translate3d(".concat(layerPosition.x, "px, ").concat(-layerPosition.y, "px, 0px)") + "rotate(".concat(180 - 2 * layerRotationDegree, "deg)")
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getOppositeCorner.ts


/**
 * Returns the corner which is used as the origin point of the flip effect
 * @param corner
 * @return FlipOriginTypes
 */
/* harmony default export */ var getOppositeCorner = (function (corner) {
  if (corner === FlipOriginTypes.BOTTOM_LEFT) {
    return FlipOriginTypes.BOTTOM_RIGHT;
  }
  if (corner === FlipOriginTypes.BOTTOM_RIGHT) {
    return FlipOriginTypes.BOTTOM_LEFT;
  }
  if (corner === FlipOriginTypes.TOP_LEFT) {
    return FlipOriginTypes.TOP_RIGHT;
  }
  if (corner === FlipOriginTypes.TOP_RIGHT) {
    return FlipOriginTypes.TOP_LEFT;
  }
  return FlipOriginTypes.EMPTY;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getRotatedPositionX.ts
/**
 * Returns the coordinates of the rotated point on axis X
 * @param originX
 * @param layerRotationRadian
 * @param layerWidth
 * @param axisSignX
 * @return number
 */
/* harmony default export */ var getRotatedPositionX = (function (originX, layerRotationRadian, layerWidth, axisSignX) {
  if (axisSignX > 0) {
    return originX - Math.sin(layerRotationRadian) * layerWidth;
  }
  return originX - Math.cos(layerRotationRadian) * layerWidth;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getLayerNewPositionOnX.ts


/**
 * @param alpha
 * @param auxLayerSizeBeforeTransition
 * @param axisSignX
 * @return number
 */
var getLayerNewPositionOnX = function getLayerNewPositionOnX(alpha, auxLayerSizeBeforeTransition) {
  var axisSignX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
  if (axisSignX === -1) {
    return Math.cos(utils_convertDegToRad(alpha)) * auxLayerSizeBeforeTransition.width;
  }
  return Math.sin(utils_convertDegToRad(alpha)) * auxLayerSizeBeforeTransition.height;
};
/* harmony default export */ var utils_getLayerNewPositionOnX = (getLayerNewPositionOnX);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getAuxPageCorners.ts


/**
 * @param mousePosition
 * @param layerNewPositionOnX
 * @param rotatedLayer
 * @return {{ x: number, y: number }}
 */
var getAuxPageCorners = function getAuxPageCorners(mousePosition, layerNewPositionOnX, rotatedLayer) {
  var clickDistanceInNewLayerX = utils_getDistance(rotatedLayer.positionX, mousePosition.x);
  var x = clickDistanceInNewLayerX - layerNewPositionOnX;
  var y = rotatedLayer.positionY - mousePosition.y;
  return {
    x: x,
    y: y
  };
};
/* harmony default export */ var utils_getAuxPageCorners = (getAuxPageCorners);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getAuxPagePosition.ts




/**
 * @param nextPageLayerSize
 * @param mousePositionOnPage
 * @param flipValue
 * @return PositionType
 */
/* harmony default export */ var getAuxPagePosition = (function (nextPageLayerSize, mousePositionOnPage, flipValue) {
  var layerPositionXAfterRotate = getRotatedPositionX(flipValue.axisSign.x * flipValue.layerPosition.x + flipValue.origin.x, flipValue.axisSign.x * utils_convertDegToRad(flipValue.rotation), nextPageLayerSize.width, flipValue.axisSign.x);
  var layerNewPositionOnX = utils_getLayerNewPositionOnX(flipValue.rotation, {
    width: nextPageLayerSize.width,
    height: nextPageLayerSize.height
  }, flipValue.axisSign.x);

  // If we drag from top right or left corner we need the top coordinates else the bottom ones
  var layerPositionY = flipValue.axisSign.y > 0 ? flipValue.origin.y + flipValue.layerPosition.y : flipValue.origin.y - flipValue.layerPosition.y;
  return utils_getAuxPageCorners({
    x: mousePositionOnPage.x,
    y: mousePositionOnPage.y
  }, layerNewPositionOnX, {
    positionX: layerPositionXAfterRotate,
    positionY: layerPositionY
  });
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/applyFlipEffectAnimation.ts

function applyFlipEffectAnimation_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function applyFlipEffectAnimation_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? applyFlipEffectAnimation_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : applyFlipEffectAnimation_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

/**
 * @param containerStyleObj
 * @param commonLayerStyle
 * @param nextPageStyle
 * @param visiblePageStyle
 * @param nextStageLayerStyle
 * @param visibleStageRef
 * @param auxStageRef
 */
/* harmony default export */ var applyFlipEffectAnimation = (function (_ref, visibleStageRef, auxStageRef) {
  var containerStyleObj = _ref.containerStyleObj,
    commonLayerStyle = _ref.commonLayerStyle,
    nextPageStyle = _ref.nextPageStyle,
    visiblePageStyle = _ref.visiblePageStyle,
    nextStageLayerStyle = _ref.nextStageLayerStyle;
  setElementInlineStyle(visibleStageRef, applyFlipEffectAnimation_objectSpread(applyFlipEffectAnimation_objectSpread(applyFlipEffectAnimation_objectSpread({}, containerStyleObj), commonLayerStyle), {}, {
    zIndex: 2
  }));
  setElementInlineStyle(visibleStageRef.firstChild, applyFlipEffectAnimation_objectSpread(applyFlipEffectAnimation_objectSpread({}, visiblePageStyle), commonLayerStyle));
  setElementInlineStyle(auxStageRef, applyFlipEffectAnimation_objectSpread(applyFlipEffectAnimation_objectSpread(applyFlipEffectAnimation_objectSpread(applyFlipEffectAnimation_objectSpread({}, containerStyleObj), commonLayerStyle), nextStageLayerStyle), {}, {
    visibility: 'visible',
    display: 'block'
  }));
  setElementInlineStyle(auxStageRef === null || auxStageRef === void 0 ? void 0 : auxStageRef.firstChild, applyFlipEffectAnimation_objectSpread(applyFlipEffectAnimation_objectSpread({}, nextPageStyle), commonLayerStyle));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getAuxPageGradientStyle.ts

/**
 * @param axisSign
 * @param layerRotationDegree
 * @param distanceFromCorner
 * @param percent
 * @return { background: string }
 */
/* harmony default export */ var getAuxPageGradientStyle = (function (axisSign, layerRotationDegree, distanceFromCorner, percent) {
  // TODO this is ugly af
  // Aux page gradient when dragging from top corners
  if (axisSign.y === -1) {
    var _secondStartPosition = distanceFromCorner * 0.8;
    var _thirdStartPosition = distanceFromCorner * 0.9;
    var _fourthStartPosition = distanceFromCorner * 0.98;
    var _gradientDeg = axisSign.x * (180 - layerRotationDegree);
    var _shade = DEFAULT_TOP_SHADE * ((100 - percent) / 100);
    return {
      background: "linear-gradient(".concat(_gradientDeg, "deg,") + 'rgba(0, 0, 0, 0) 0px,' + "rgba(0, 0, 0, ".concat(_shade, ") ").concat(_secondStartPosition, "px,") + "rgba(0, 0, 0, ".concat(_shade - 0.30, ") ").concat(_thirdStartPosition, "px,") + "rgba(0, 0, 0, 0) ".concat(_fourthStartPosition, "px)")
    };
  }
  var secondStartPosition = distanceFromCorner * 0.40;
  var thirdStartPosition = distanceFromCorner * 0.85;
  var fourthStartPosition = distanceFromCorner * 0.98;
  var gradientDeg = axisSign.x * layerRotationDegree;
  var shade = DEFAULT_BOTTOM_SHADE * ((100 - percent) / 100);

  // Aux page gradient when dragging from bottom corners
  return {
    background: "linear-gradient(".concat(gradientDeg, "deg,") + 'rgba(0, 0, 0, 0) 0px,' + "rgba(0, 0, 0, ".concat(shade - 0.31, ") ").concat(secondStartPosition, "px,") + "rgba(0, 0, 0, ".concat(shade - 0.1, ") ").concat(thirdStartPosition, "px,") + "rgba(0, 0, 0, ".concat(shade, ") ").concat(fourthStartPosition, "px)")
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/FlipEffectContainer/FlipEffectContainer.tsx









































var FLIPBOOK_SMALL_SIZE = 1000;
var FlipEffectContainer_BLOCKED_THRESHOLD = 50;
var FlipEffectContainer_FlipEffectContainer = function FlipEffectContainer(props) {
  var _useContext = (0,react.useContext)(FlipEffectContext),
    auxStageContainerRef = _useContext.auxStageContainerRef,
    setAuxStageContentRef = _useContext.setAuxStageContentRef;
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    _useContext2$options$ = _useContext2.options.content,
    rtl = _useContext2$options$.rtl,
    effect = _useContext2$options$.effect,
    _useContext2$pages$or = slicedToArray_slicedToArray(_useContext2.pages.order, 1),
    firstStage = _useContext2$pages$or[0],
    pages = _useContext2.pages,
    flipbookConverted = _useContext2.flipbookConverted;
  var activeStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var isUserAction = react_useAtomValue(getUserActionAtom);
  var setNavigation = react_useSetAtom(generalStageIndexAtom);
  var _useAtom = react_useAtom(mouseOverPlayerAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    isMouseOverPlayer = _useAtom2[0];
  var setActiveMandatoryModal = react_useSetAtom(setActiveMandatoryModalAtom);
  var indexOfFirstMandatoryAction = useFirstMandatoryStageIndex();
  var blockedByMandatoryActions = activeStageIndex === indexOfFirstMandatoryAction;

  // TODO remove scale when we have the final version of scaling for elements also
  var scale = 1;
  var _useContext3 = (0,react.useContext)(contexts_FullscreenContext),
    isFullscreen = _useContext3.isFullscreen;
  var isUploading = (0,react.useRef)(flipbookConverted); // prev state
  var _useContext4 = (0,react.useContext)(contexts_SettledStageIndexContext),
    settledStageIndex = _useContext4.settledStageIndex,
    setSettledStageIndex = _useContext4.setSettledStageIndex;
  (0,react.useEffect)(function () {
    setSettledStageIndex(activeStageIndex);
  }, []);
  var isEffectDisabled = usePreventSwipeOnZoom(false);
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    isDragging = _useState2[0],
    setIsDragging = _useState2[1];
  var modalContext = (0,react.useContext)(contexts_ModalContext);
  var modalRef = (0,react.useRef)({
    isDisabled: false,
    isActive: false
  });
  var ref = (0,react.useRef)(null);
  var visibleStageRect = (0,react.useRef)({
    width: 0,
    height: 0,
    left: 0,
    right: 0,
    bottom: 0,
    top: 0
  });
  var nextStageRect = (0,react.useRef)({
    width: 0,
    height: 0
  });
  var activeStageIndexRef = (0,react.useRef)(activeStageIndex);
  var hasToChangePageRef = (0,react.useRef)(false);
  var hitArea = (0,react.useRef)(FlipOriginTypes.BOTTOM_RIGHT);
  var layerRotationDegreeRef = (0,react.useRef)(0);
  var mouseUpPosition = (0,react.useRef)({
    x: 0,
    y: 0
  });
  var mousePositionOnMove = (0,react.useRef)({
    x: 0,
    y: 0
  });
  var isFlipping = (0,react.useRef)(false);

  // Keep the index for the center stage before the flip effect initialization
  var centerStageIndex = (0,react.useRef)(activeStageIndexRef.current);
  var syncRenderedStageIndex = (0,react.useCallback)(function (requestedIndex) {
    var maxIndex = pages.order.length - 1;
    var stagesToRender = generateRenderedStages(centerStageIndex.current, maxIndex);
    var index = stagesToRender.findIndex(function (i) {
      return i === requestedIndex;
    });

    // If the new selected page is not in the current proximity batch and is not yet rendered
    // return the previous or the next to the center (depending on the change sens)
    if (index === -1) {
      var center = stagesToRender.findIndex(function (i) {
        return i === centerStageIndex.current;
      });
      return requestedIndex > centerStageIndex.current ? center + 1 : center - 1;
    }
    return index;
  }, [centerStageIndex.current]);
  var enableModal = function enableModal() {
    if (modalRef.current.isDisabled) {
      modalRef.current.isDisabled = false;
      modalContext.setDisabled(false);
    }
  };
  var reset = function reset(pageIndex) {
    var _ref$current, _ref$current2;
    var visibleStageRef = (_ref$current = ref.current) === null || _ref$current === void 0 || (_ref$current = _ref$current.children[syncRenderedStageIndex(activeStageIndexRef.current)]) === null || _ref$current === void 0 ? void 0 : _ref$current.firstChild;
    var nextPageIndex = typeof pageIndex === 'number' ? pageIndex : getNextPageIndex(activeStageIndexRef.current, hitArea.current);
    var nextVisibleStageRef = (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || (_ref$current2 = _ref$current2.children[syncRenderedStageIndex(nextPageIndex)]) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.firstChild;
    var auxStageRef = auxStageContainerRef === null || auxStageContainerRef === void 0 ? void 0 : auxStageContainerRef.current;

    // If the new selected page is not in the current proximity batch
    if (typeof pageIndex === 'number' && Math.abs(settledStageIndex - pageIndex) > RenderStagePages) {
      var _ref$current3;
      var stageToRemove = settledStageIndex > pageIndex ? syncRenderedStageIndex(settledStageIndex) - 1 : syncRenderedStageIndex(settledStageIndex) + 1;
      (_ref$current3 = ref.current) === null || _ref$current3 === void 0 || (_ref$current3 = _ref$current3.children[stageToRemove]) === null || _ref$current3 === void 0 || (_ref$current3 = _ref$current3.firstChild) === null || _ref$current3 === void 0 || _ref$current3.remove();
    }
    if (visibleStageRef && nextVisibleStageRef && auxStageRef) {
      removeAnimationStyle(visibleStageRef, nextVisibleStageRef, auxStageRef);
      setAuxStageContentRef(null);
    }

    // Reset to default
    layerRotationDegreeRef.current = 0;
    mouseUpPosition.current = {
      x: 0,
      y: 0
    };
    mousePositionOnMove.current = {
      x: 0,
      y: 0
    };
    hitArea.current = FlipOriginTypes.EMPTY;
    isFlipping.current = false;
    if (isDragging) {
      setIsDragging(false);
    }
  };
  var animate = function animate(_ref) {
    var _ref$current4, _auxStageContainerRef, _auxStageContainerRef2;
    var nextPageCorner = _ref.nextPageCorner,
      mousePositionOnPage = _ref.mousePositionOnPage;
    var visibleStageRef = ref === null || ref === void 0 || (_ref$current4 = ref.current) === null || _ref$current4 === void 0 || (_ref$current4 = _ref$current4.children[syncRenderedStageIndex(activeStageIndexRef.current)]) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.firstChild;
    var _getDefaultLayerStyle = utils_getDefaultLayerStyles(hitArea.current),
      commonLayerStyle = _getDefaultLayerStyle.commonLayerStyle,
      axisSign = _getDefaultLayerStyle.axisSign;
    var _getCornerCoordinates = getCornerCoordinates(visibleStageRect.current, getOppositeCorner(hitArea.current)),
      positionX = _getCornerCoordinates.positionX,
      positionY = _getCornerCoordinates.positionY;
    var auxPageGradient = auxStageContainerRef === null || auxStageContainerRef === void 0 || (_auxStageContainerRef = auxStageContainerRef.current) === null || _auxStageContainerRef === void 0 ? void 0 : _auxStageContainerRef.querySelector('[data-id="gradient"]');
    if (visibleStageRef !== null && visibleStageRef !== void 0 && visibleStageRef.firstChild && auxStageContainerRef !== null && auxStageContainerRef !== void 0 && (_auxStageContainerRef2 = auxStageContainerRef.current) !== null && _auxStageContainerRef2 !== void 0 && _auxStageContainerRef2.firstChild) {
      var _ref$current5, _ref$current6;
      var noPages = getAttribute(ref === null || ref === void 0 || (_ref$current5 = ref.current) === null || _ref$current5 === void 0 ? void 0 : _ref$current5.children[syncRenderedStageIndex(activeStageIndexRef.current)], 'data-pages', '1');
      var _getFlipValues = getFlipValues(visibleStageRect.current.width, {
          x: nextPageCorner.x,
          y: nextPageCorner.y
        }, parseInt(noPages, 10)),
        layerPosition = _getFlipValues.layerPosition,
        layerRotationDegree = _getFlipValues.layerRotationDegree;
      layerRotationDegreeRef.current = layerRotationDegree;

      // Because we need to change the sign by axis x and y we need to multiply the layoutPosition
      // The layerRotationDegree value changes because of both axis
      var _getTransitionsStyle = getTransitionsStyle({
          x: axisSign.x * layerPosition.x / scale,
          y: axisSign.y * layerPosition.y / scale
        }, -1 * axisSign.x * axisSign.y * layerRotationDegree),
        containerStyleObj = _getTransitionsStyle.containerStyleObj,
        visiblePageStyle = _getTransitionsStyle.visiblePageStyle;
      var auxPageCorners = getAuxPagePosition({
        width: nextStageRect.current.width,
        height: nextStageRect.current.height
      }, mousePositionOnPage, {
        layerPosition: layerPosition,
        axisSign: axisSign,
        rotation: layerRotationDegree,
        origin: {
          x: positionX,
          y: positionY
        }
      });
      var nextPageStyle = getAuxLayerTransitionStyle({
        x: auxPageCorners.x / scale,
        y: auxPageCorners.y / scale
      }, axisSign.x * axisSign.y * layerRotationDegree);
      var hasToPushLeft = activeStageIndexRef.current === 0 && firstStage.length === 1 || props.layout === constants_WidgetLayoutTypes.SINGLE;

      // Change left position for the next stage layer if single page layout or the active page is the first page
      var nextStageLayerStyle = {
        left: hasToPushLeft && (hitArea.current === FlipOriginTypes.TOP_RIGHT || hitArea.current === FlipOriginTypes.BOTTOM_RIGHT) ? "".concat(Math.ceil(props.width / 2), "px") : 'auto'
      };

      // The last page is single then it must be pushed to the left
      if (activeStageIndexRef.current === props.nrOfStages - 1 && parseInt(noPages, 10) !== 2 && props.layout !== constants_WidgetLayoutTypes.SINGLE) {
        nextStageLayerStyle = {
          left: "".concat(-Math.ceil(auxStageContainerRef.current.offsetWidth - props.width / 2), "px")
        };
      }
      var pageCornerOriginFromStart = getCornerCoordinates(visibleStageRect.current, hitArea.current);
      var distanceFromCorner = getDistance2D({
        x: pageCornerOriginFromStart.positionX,
        y: pageCornerOriginFromStart.positionY
      }, mousePositionOnPage);

      // The half of the distance from the corner represents the visible part of the aux page
      // This value must be scaled because it will be used in css
      distanceFromCorner = distanceFromCorner / 2 / scale;
      var distanceOnX = Math.abs(pageCornerOriginFromStart.positionX - mousePositionOnPage.x);
      var offsetWidth = Math.min(props.scaledWidth, (ref === null || ref === void 0 || (_ref$current6 = ref.current) === null || _ref$current6 === void 0 ? void 0 : _ref$current6.offsetWidth) || 1);

      // For very small flipbooks
      if (offsetWidth < FLIPBOOK_SMALL_SIZE) {
        offsetWidth = props.scaledWidth;
      }
      setElementInlineStyle(auxPageGradient, getAuxPageGradientStyle(axisSign, layerRotationDegree, distanceFromCorner, distanceOnX * 100 / offsetWidth));
      applyFlipEffectAnimation({
        containerStyleObj: containerStyleObj,
        commonLayerStyle: commonLayerStyle,
        visiblePageStyle: visiblePageStyle,
        nextPageStyle: nextPageStyle,
        nextStageLayerStyle: nextStageLayerStyle
      }, visibleStageRef, auxStageContainerRef === null || auxStageContainerRef === void 0 ? void 0 : auxStageContainerRef.current);
    }
  };
  var getValues = function getValues(mousePosition, hasTwoPage) {
    var _ref$current7, _ref$current8;
    var x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
    var y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
    var _getCornerCoordinates2 = getCornerCoordinates(visibleStageRect.current, getOppositeCorner(hitArea.current)),
      positionX = _getCornerCoordinates2.positionX,
      positionY = _getCornerCoordinates2.positionY;
    positionX = x !== 0 ? x : positionX;
    positionY = y !== 0 ? y : positionY;
    var _getDefaultLayerStyle2 = utils_getDefaultLayerStyles(hitArea.current),
      axisSign = _getDefaultLayerStyle2.axisSign;
    var _getMousePositionOnPa = getMousePositionOnPage({
        positionX: positionX,
        positionY: positionY,
        width: (((_ref$current7 = ref.current) === null || _ref$current7 === void 0 ? void 0 : _ref$current7.offsetWidth) || 0) * scale / 2,
        originX: hasTwoPage ? (((_ref$current8 = ref.current) === null || _ref$current8 === void 0 ? void 0 : _ref$current8.offsetWidth) || 0) * scale / 2 : 0
      }, mousePosition, axisSign),
      nextPageCorner = _getMousePositionOnPa.nextPageCorner,
      mousePositionOnPage = _getMousePositionOnPa.mousePositionOnPage;
    return {
      nextPageCorner: nextPageCorner,
      mousePositionOnPage: mousePositionOnPage,
      axisSign: axisSign,
      origin: {
        x: positionX,
        y: positionY
      }
    };
  };
  var onMouseMove = (0,react.useCallback)(function (event) {
    var _getValues = getValues({
        x: event.clientX,
        y: event.clientY + 0.1
      }, props.hasTwoPage),
      nextPageCorner = _getValues.nextPageCorner,
      mousePositionOnPage = _getValues.mousePositionOnPage,
      axisSign = _getValues.axisSign;
    mousePositionOnMove.current = {
      x: event.clientX,
      y: event.clientY
    };
    var visibleDimensionX = visibleStageRect.current.width - nextPageCorner.x;
    var visibleDimensionY = nextPageCorner.y;
    var blockedHitAreas = rtl ? [FlipOriginTypes.BOTTOM_LEFT, FlipOriginTypes.TOP_LEFT] : [FlipOriginTypes.BOTTOM_RIGHT, FlipOriginTypes.TOP_RIGHT];

    // Block flip effect to next page when on page with mandatory actions
    if (blockedByMandatoryActions && (visibleDimensionX > FlipEffectContainer_BLOCKED_THRESHOLD || visibleDimensionY > FlipEffectContainer_BLOCKED_THRESHOLD) && blockedHitAreas.includes(hitArea.current)) {
      document.removeEventListener('mousemove', onMouseMove);
      setActiveMandatoryModal(true);
      reset();
    } else {
      animate({
        nextPageCorner: nextPageCorner,
        mousePositionOnPage: mousePositionOnPage
      });

      // We need to know if the dragged corner is on the other page so we can move to the next page
      hasToChangePageRef.current = hasToChangePage(event.clientX, axisSign.x < 0 ? visibleStageRect.current.left : visibleStageRect.current.right, props.hasTwoPage ? visibleStageRect.current.width / 2 : visibleStageRect.current.width, axisSign.x);
    }
  }, [auxStageContainerRef === null || auxStageContainerRef === void 0 ? void 0 : auxStageContainerRef.current, props.hasTwoPage, props.width, blockedByMandatoryActions, rtl]);
  var initializeEffect = function initializeEffect(nextPageIndex) {
    var _ref$current9, _ref$current10, _ref$current11;
    // Landscape and portrait size
    var size = isPortrait(visibleStageRect.current.width, visibleStageRect.current.height) ? visibleStageRect.current.height : visibleStageRect.current.width;
    nextStageRect.current = {
      width: size,
      height: size
    };

    // Aux stage ref is used with dangerouslySetInnerHtml
    setAuxStageContentRef((_ref$current9 = ref.current) === null || _ref$current9 === void 0 || (_ref$current9 = _ref$current9.children[syncRenderedStageIndex(nextPageIndex)]) === null || _ref$current9 === void 0 || (_ref$current9 = _ref$current9.firstChild) === null || _ref$current9 === void 0 ? void 0 : _ref$current9.firstChild);
    var _getDefaultLayerStyle3 = utils_getDefaultLayerStyles(hitArea.current),
      axisSign = _getDefaultLayerStyle3.axisSign;
    // If we have double page layout and we want to navigate from the first page to second one or
    // We are on the second page and we navigate to first page we need to move the next page from the view
    var leftPosition = props.layout === constants_WidgetLayoutTypes.DOUBLE && (axisSign.x > 0 && activeStageIndexRef.current === 0 || axisSign.x < 0 && activeStageIndexRef.current === 1 || axisSign.x < 0 && activeStageIndex === 0) ? "".concat(axisSign.x * -Math.ceil(props.width / 2), "px") : 0;

    // For rtl first page is the last one and can be double
    if (rtl && firstStage.length === 2) {
      leftPosition = 0;
    }

    // Set default styles on next page to be visible and set the corresponding zIndex on it;
    setElementInlineStyle((_ref$current10 = ref.current) === null || _ref$current10 === void 0 || (_ref$current10 = _ref$current10.children[syncRenderedStageIndex(nextPageIndex)]) === null || _ref$current10 === void 0 ? void 0 : _ref$current10.firstChild, {
      zIndex: 1,
      visibility: 'visible',
      display: 'block',
      left: leftPosition
    });

    // Set default styles on current page to be visible and set the corresponding zIndex on it
    setElementInlineStyle((_ref$current11 = ref.current) === null || _ref$current11 === void 0 || (_ref$current11 = _ref$current11.children[syncRenderedStageIndex(activeStageIndexRef.current)]) === null || _ref$current11 === void 0 ? void 0 : _ref$current11.firstChild, {
      zIndex: 2
    });
  };
  var changePage = function changePage(nextIndex) {
    var isActiveStageSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
    // TODO! refactor isUserAction from ActiveStageIndexContext
    // isUserAction is being changed in ActiveStageIndexProvider when setting active stage index,
    // setActiveStageIndex is being set on end of this function, means isUserAction is not set yet and change the
    // context is not a solution for performance reasons, isUserAction should be set on start flip effect
    // isActiveStageSet is false only when you turn the page manually so it is a user action
    // The stage was changed
    if ((isUserAction || !isActiveStageSet) && nextIndex !== activeStageIndexRef.current && !isEffectDisabled) {
      var _ref$current12, _ref$current13, _ref$current14;
      isFlipping.current = true;
      document.dispatchEvent(new MessageEvent(TRANSITION_EFFECT_START, {
        data: nextIndex
      }));
      if (!mouseUpPosition.current.x && !mouseUpPosition.current.y) {
        reset();
      }
      hasToChangePageRef.current = false;
      if (hitArea.current === FlipOriginTypes.EMPTY) {
        hitArea.current = nextIndex > activeStageIndexRef.current ? FlipOriginTypes.BOTTOM_RIGHT : FlipOriginTypes.BOTTOM_LEFT;
      }
      var _ref2 = ((_ref$current12 = ref.current) === null || _ref$current12 === void 0 || (_ref$current12 = _ref$current12.children[syncRenderedStageIndex(settledStageIndex)]) === null || _ref$current12 === void 0 ? void 0 : _ref$current12.getBoundingClientRect()) || {},
        _ref2$left = _ref2.left,
        left = _ref2$left === void 0 ? 0 : _ref2$left,
        _ref2$bottom = _ref2.bottom,
        bottom = _ref2$bottom === void 0 ? 0 : _ref2$bottom,
        _ref2$right = _ref2.right,
        right = _ref2$right === void 0 ? 0 : _ref2$right,
        _ref2$top = _ref2.top,
        top = _ref2$top === void 0 ? 0 : _ref2$top,
        _ref2$width = _ref2.width,
        width = _ref2$width === void 0 ? 0 : _ref2$width,
        _ref2$height = _ref2.height,
        height = _ref2$height === void 0 ? 0 : _ref2$height;
      var noPages = getAttribute((_ref$current13 = ref.current) === null || _ref$current13 === void 0 ? void 0 : _ref$current13.children[syncRenderedStageIndex(settledStageIndex)], 'data-pages', 1);
      visibleStageRect.current = {
        width: width,
        height: height,
        left: left,
        right: right,
        bottom: bottom,
        top: top
      };

      // When you navigate more than one stage
      if (Math.abs(settledStageIndex - nextIndex) > RenderStagePages) {
        var isDouble = props.layout === constants_WidgetLayoutTypes.DOUBLE;
        var nextWidth = (nextIndex === 0 || nextIndex === props.nrOfStages - 1) && isDouble ? props.width / 2 : props.width;
        var stageToAdded = settledStageIndex > nextIndex ? syncRenderedStageIndex(settledStageIndex) - 1 : syncRenderedStageIndex(settledStageIndex) + 1;
        generateNextVisibleStage(nextWidth, height, stageToAdded, ref);
      }
      if (hitArea.current && (_ref$current14 = ref.current) !== null && _ref$current14 !== void 0 && _ref$current14.children[syncRenderedStageIndex(nextIndex)]) {
        initializeEffect(nextIndex);
        var _getDefaultLayerStyle4 = utils_getDefaultLayerStyles(hitArea.current),
          axisSign = _getDefaultLayerStyle4.axisSign;
        var _getCornerCoordinates3 = getCornerCoordinates(visibleStageRect.current, getOppositeCorner(hitArea.current)),
          positionX = _getCornerCoordinates3.positionX,
          positionY = _getCornerCoordinates3.positionY;
        var animationRadian = utils_convertDegToRad(FLIP_EFFECT_DEGREE);
        var stageRect = ref.current.getBoundingClientRect();

        // The flip effect must be animated on the full width of the stage
        var animationDistance = stageRect.width;
        // The current visible pages has two page?
        var twoPage = parseInt(noPages, 10) === 2;
        var subtractSinglePageWidth = twoPage ? 0 : stageRect.width / 2;
        var initialX = stageRect.width - FLIP_EFFECT_START_POSITION;

        // The stage was changed by dragging the page
        if (mouseUpPosition.current.x && mouseUpPosition.current.y) {
          var origin = getCornerCoordinates(stageRect, getOppositeCorner(hitArea.current));

          // In single page mode, the aux page doesn't have enough space on the right side to flip
          if (props.layout === constants_WidgetLayoutTypes.SINGLE && axisSign.x === -1) {
            // Temporary solution TODO - find the right formula for this
            if (scale <= 0.5) {
              if (scale <= 0.3) {
                origin.positionX += origin.positionX / 6;
              } else {
                origin.positionX += origin.positionX / 4;
              }
            } else {
              origin.positionX += origin.positionX / 2;
            }
          }
          var _getValues2 = getValues({
              x: mouseUpPosition.current.x,
              y: mouseUpPosition.current.y
            }, true, origin.positionX, origin.positionY),
            nextPageCorner = _getValues2.nextPageCorner,
            mousePositionOnPage = _getValues2.mousePositionOnPage;
          var distance = getDistance2D({
            x: origin.positionX,
            y: origin.positionY
          }, mousePositionOnPage);
          initialX = Math.abs(nextPageCorner.x);
          // The flip effect must be animated on the distance from the page corner
          animationDistance = initialX;
          animationRadian = Math.PI / 2 - Math.asin(initialX / distance);
        }
        var draw = function draw(distanceOnX) {
          var x = Math.floor(distanceOnX - subtractSinglePageWidth);
          var y = Math.floor(Math.tan(animationRadian) * distanceOnX);
          if (Number.isInteger(x) && Number.isInteger(y)) {
            animate({
              nextPageCorner: {
                x: x,
                y: y
              },
              mousePositionOnPage: {
                x: axisSign.x * x + positionX,
                y: axisSign.y * -y + positionY
              }
            });
          }
        };

        // Stop animation if the distance is not between step distance (min) and container width (max)
        // If the activeStageIndex plus/minus one (next stage index) is not equal with the current stage index
        // In this case the animation is not done yet
        var hasToStopAnimation = function hasToStopAnimation(distance) {
          return distance < 1 || distance > animationDistance;
        };
        utils_requestAnimation({
          initialDistance: initialX,
          hasTwoPage: props.hasTwoPage,
          layout: props.layout,
          isRtl: rtl,
          effect: effect
        }, draw, hasToStopAnimation).then(function () {
          reset(nextIndex);
          activeStageIndexRef.current = nextIndex;
          document.dispatchEvent(new Event(TRANSITION_EFFECT_DONE));
          isFlipping.current = false;
          setNavigation({
            activeStageIndex: nextIndex
          });
          (0,react_dom.flushSync)(function () {
            setSettledStageIndex(nextIndex);
          });
        });
      }
    } else if (!isUserAction) {
      // Change page without effect - customize options
      activeStageIndexRef.current = activeStageIndex;
      document.dispatchEvent(new Event(TRANSITION_EFFECT_DONE));
      isFlipping.current = false;
      setSettledStageIndex(activeStageIndex);
    }
  };
  var completeFlipEffect = function completeFlipEffect() {
    if (!hasToChangePageRef.current) {
      var _getValues3 = getValues({
          x: mousePositionOnMove.current.x,
          y: mousePositionOnMove.current.y
        }, props.hasTwoPage),
        nextPageCorner = _getValues3.nextPageCorner,
        axisSign = _getValues3.axisSign,
        origin = _getValues3.origin;
      var animationRadian = utils_convertDegToRad(90 - layerRotationDegreeRef.current);
      var initialX = visibleStageRect.current.width - nextPageCorner.x;
      var distanceLimit = 1;
      var draw = function draw(distance) {
        var x = visibleStageRect.current.width - distance;
        var y = Math.tan(animationRadian) * distance;
        animate({
          nextPageCorner: {
            x: x,
            y: y
          },
          mousePositionOnPage: {
            x: Math.abs(axisSign.x * x + origin.x),
            y: Math.abs(axisSign.y * -y + origin.y)
          }
        });
      };
      var hasToStopAnimation = function hasToStopAnimation(distance) {
        return distance < distanceLimit || activeStageIndexRef.current !== settledStageIndex;
      };
      utils_requestAnimation({
        initialDistance: initialX,
        hasTwoPage: props.hasTwoPage,
        layout: props.layout,
        isRtl: rtl,
        effect: effect
      }, draw, hasToStopAnimation).then(function () {
        isFlipping.current = false;
        reset();
      });
    } else {
      // Change the current page and let the useEffect to execute the animation
      mouseUpPosition.current = {
        x: mousePositionOnMove.current.x || 1,
        y: mousePositionOnMove.current.y || 1
      };
      var nextPageIndex = getNextPageIndex(activeStageIndexRef.current, hitArea.current);
      changePage(nextPageIndex, false);
    }
  };
  (0,react.useEffect)(function () {
    var _onMouseUp = function onMouseUp() {
      document.removeEventListener('mousemove', onMouseMove);
      document.removeEventListener('mouseup', _onMouseUp);
      setIsDragging(false);
      // The layerRotationDegreeRef.current is not 0 if the mouse was moved - on simple click it will be 0
      if (layerRotationDegreeRef.current !== 0) {
        completeFlipEffect();
      } else {
        reset();
      }
      enableModal();
    };
    if (isDragging && isMouseOverPlayer) {
      document.addEventListener('mousemove', onMouseMove);
      document.addEventListener('mouseup', _onMouseUp);
    }
    return function () {
      enableModal();
      document.removeEventListener('mousemove', onMouseMove);
      document.removeEventListener('mouseup', _onMouseUp);
    };
  }, [isDragging, isMouseOverPlayer]);
  var onMouseDown = function onMouseDown(event) {
    if (!isEffectDisabled && !isDragging && event.button === 0 && !main/* isMobile */.Fr && ref.current && activeStageIndex === activeStageIndexRef.current && !isFlipping.current && !modalRef.current.isActive) {
      var _ref$current$children;
      centerStageIndex.current = activeStageIndexRef.current;
      var _ref3 = ((_ref$current$children = ref.current.children[syncRenderedStageIndex(activeStageIndex)]) === null || _ref$current$children === void 0 ? void 0 : _ref$current$children.getBoundingClientRect()) || {},
        _ref3$left = _ref3.left,
        left = _ref3$left === void 0 ? 0 : _ref3$left,
        _ref3$bottom = _ref3.bottom,
        bottom = _ref3$bottom === void 0 ? 0 : _ref3$bottom,
        _ref3$right = _ref3.right,
        right = _ref3$right === void 0 ? 0 : _ref3$right,
        _ref3$top = _ref3.top,
        top = _ref3$top === void 0 ? 0 : _ref3$top,
        _ref3$width = _ref3.width,
        width = _ref3$width === void 0 ? 0 : _ref3$width,
        _ref3$height = _ref3.height,
        height = _ref3$height === void 0 ? 0 : _ref3$height;
      visibleStageRect.current = {
        width: width,
        height: height,
        left: left,
        right: right,
        bottom: bottom,
        top: top
      };

      // We need the hit area to know in which direction to flip the page;
      hitArea.current = getHitArea({
        clientX: event.clientX,
        clientY: event.clientY
      }, visibleStageRect.current, props.hasTwoPage, effect);
      if (hitArea.current !== FlipOriginTypes.EMPTY) {
        var _ref$current15;
        var nextPageIndex = getNextPageIndex(activeStageIndexRef.current, hitArea.current);
        if (hitArea.current && (_ref$current15 = ref.current) !== null && _ref$current15 !== void 0 && (_ref$current15 = _ref$current15.children[syncRenderedStageIndex(nextPageIndex)]) !== null && _ref$current15 !== void 0 && _ref$current15.firstChild) {
          initializeEffect(nextPageIndex);
          isFlipping.current = true;
          setIsDragging(true);
        } else {
          hitArea.current = FlipOriginTypes.EMPTY;
        }
      }
    }
  };
  (0,react.useLayoutEffect)(function () {
    // If we move the mouse out of player we need to stop the flip effect and reset the styles
    if (!isMouseOverPlayer && activeStageIndex === activeStageIndexRef.current && isDragging) {
      completeFlipEffect();
    }
  }, [isMouseOverPlayer]);
  (0,react.useLayoutEffect)(function () {
    centerStageIndex.current = activeStageIndexRef.current;
    changePage(activeStageIndex);
  }, [activeStageIndex, isEffectDisabled, props.layout]);
  (0,react.useEffect)(function () {
    // If we enter/leave full screen we need to reset styles
    reset();
  }, [isFullscreen]);
  (0,react.useEffect)(function () {
    // If isEffectDisabled we need to reset styles
    // Use case start to drag the page then zoom in ( hotkey + )
    isEffectDisabled && reset();
  }, [isEffectDisabled]);
  (0,react.useEffect)(function () {
    // Reset player only after flipbook was converted
    if (!isUploading.current && flipbookConverted) {
      reset();
    }
  }, [flipbookConverted]);
  (0,react.useEffect)(function () {
    modalRef.current.isActive = !!modalContext.active;
  }, [modalContext.active]);
  return /*#__PURE__*/react.createElement(FlipContainer, {
    ref: ref,
    onMouseDown: onMouseDown,
    $width: props.width,
    $height: props.height
  }, props.children);
};
FlipEffectContainer_FlipEffectContainer.propTypes = {
  children: (prop_types_default()).element.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  hasTwoPage: (prop_types_default()).bool.isRequired,
  layout: (prop_types_default()).string.isRequired,
  nrOfStages: (prop_types_default()).number.isRequired
};
/* harmony default export */ var components_FlipEffectContainer_FlipEffectContainer = (FlipEffectContainer_FlipEffectContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/FlipEffectContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/NextStageLayer/components/DoublePageLayer.tsx





var DoublePageLayer = function DoublePageLayer(props) {
  var context = (0,react.useContext)(FlipEffectContext);
  var ref = (0,react.useRef)(null);
  (0,react.useEffect)(function () {
    if (ref) {
      context.setAuxStageContainerRef(ref);
    }
  }, [ref]);
  var html = (0,react.useMemo)(function () {
    return context.auxStageContentRef ? context.auxStageContentRef.outerHTML : '';
  }, [context.auxStageContentRef]);
  return /*#__PURE__*/react.createElement(NextStageLayer, {
    id: AUX_STAGE_LAYER_ID,
    ref: ref,
    $size: props.layerSize,
    dangerouslySetInnerHTML: {
      __html: html
    }
  });
};
DoublePageLayer.propTypes = {
  layerSize: (prop_types_default()).number.isRequired
};
/* harmony default export */ var components_DoublePageLayer = (DoublePageLayer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/NextStageLayer/components/SinglePageLayer.tsx





var SinglePageLayer = function SinglePageLayer(props) {
  var context = (0,react.useContext)(FlipEffectContext);
  var ref = (0,react.useRef)(null);
  (0,react.useEffect)(function () {
    context.setAuxStageContainerRef(ref);
  }, []);
  return /*#__PURE__*/react.createElement(EffectFlip_styles_StageLayer, {
    id: AUX_STAGE_LAYER_ID,
    ref: ref,
    $size: "".concat(props.layerSize, "px"),
    isVisibleStage: false
  }, /*#__PURE__*/react.createElement(EffectFlip_styles_PageContainer, null, /*#__PURE__*/react.createElement(AuxSinglePage, {
    $width: props.pageWidth,
    $height: props.pageHeight
  }), /*#__PURE__*/react.createElement(PageGradient, {
    "data-id": "gradient"
  })));
};
SinglePageLayer.propTypes = {
  layerSize: (prop_types_default()).number.isRequired,
  pageWidth: (prop_types_default()).number.isRequired,
  pageHeight: (prop_types_default()).number.isRequired
};
/* harmony default export */ var components_SinglePageLayer = (SinglePageLayer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/NextStageLayer/NextStageLayer.tsx





var NextStageLayer_NextStageLayer = function NextStageLayer(props) {
  if (props.layout === constants_WidgetLayoutTypes.DOUBLE) {
    return /*#__PURE__*/react.createElement(components_DoublePageLayer, {
      layerSize: props.layerSize
    });
  }
  return /*#__PURE__*/react.createElement(components_SinglePageLayer, {
    layerSize: props.layerSize,
    pageWidth: props.pageWidth,
    pageHeight: props.pageHeight
  });
};
NextStageLayer_NextStageLayer.propTypes = {
  layerSize: (prop_types_default()).number.isRequired,
  pageWidth: (prop_types_default()).number.isRequired,
  pageHeight: (prop_types_default()).number.isRequired,
  layout: (prop_types_default()).string.isRequired
};
/* harmony default export */ var components_NextStageLayer_NextStageLayer = (NextStageLayer_NextStageLayer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/NextStageLayer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/StageList/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/utils/getContainerLeftPosition.ts



/**
 * Returns the left position for the container which contains the list of the stages and the aux stage
 * @param isLastStage
 * @param hasOnePage
 * @param layout
 *
 * @return number
 */
/* harmony default export */ var getContainerLeftPosition = (function (isLastStage, hasOnePage, layout) {
  // Double page layout or last page
  if (isLastStage && hasOnePage && layout !== constants_WidgetLayoutTypes.SINGLE) {
    return SINGLE_PAGE_TRANSFORM_X;
  }

  // Single page layout or first page in double page layout
  if (hasOnePage) {
    return -SINGLE_PAGE_TRANSFORM_X;
  }

  // Double page layout; between first page  and last page
  return 0;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/EffectFlip.tsx

















var EffectFlip = function EffectFlip(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    pages = _useContext.pages;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var layout = useLayout();
  var _useFlipbookDimension = useFlipbookDimensions(),
    pageWidth = _useFlipbookDimension.width,
    pageHeight = _useFlipbookDimension.height;
  var _useContext2 = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext2.zoom;
  var prevSettledStageIndex = (0,react.useRef)(settledStageIndex);
  var nrOfPagesOnStage = pages.order[settledStageIndex] && pages.order[settledStageIndex].length ? pages.order[settledStageIndex].length : 1;
  var layoutSize = isPortrait(pageWidth, pageHeight) ? pageHeight * nrOfPagesOnStage : pageWidth * nrOfPagesOnStage;
  var _useContext3 = (0,react.useContext)(contexts_ControllerContext),
    scale = _useContext3.scale;
  var left = getContainerLeftPosition(settledStageIndex === pages.order.length - 1, nrOfPagesOnStage === 1, layout);
  left = Math.floor(left * pageWidth * 2 * scale * zoom);
  var animation = 'none';
  if (prevSettledStageIndex.current !== settledStageIndex) {
    prevSettledStageIndex.current = settledStageIndex;
    animation = 'transform 250ms linear';
  }
  return /*#__PURE__*/react.createElement(components_FlipContainer_FlipContainer, null, /*#__PURE__*/react.createElement(FlipEffectContainer, {
    id: automation_EFFECT_CONTAINER_ID,
    $animation: animation,
    $left: "".concat(left, "px")
  }, /*#__PURE__*/react.createElement(components_FlipEffectContainer_FlipEffectContainer, {
    width: pageWidth * 2 * scale * zoom,
    height: pageHeight * scale * zoom,
    hasTwoPage: nrOfPagesOnStage === 2,
    layout: layout,
    nrOfStages: pages.order.length,
    scaledWidth: props.scaledWidth
  }, /*#__PURE__*/react.createElement(StageList_StageList, {
    renderStage: props.renderStage
  })), /*#__PURE__*/react.createElement(components_NextStageLayer_NextStageLayer, {
    layerSize: layoutSize * FLIP_LAYER_SCALE * scale * zoom,
    pageWidth: pageWidth * scale * zoom,
    pageHeight: pageHeight * scale * zoom,
    layout: layout
  })));
};
/* harmony default export */ var EffectFlip_EffectFlip = (EffectFlip);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectManager/EffectManager.tsx






var EffectManager = function EffectManager(props) {
  switch (props.effect) {
    case Effect.FLIP:
      return /*#__PURE__*/react.createElement(EffectFlip_EffectFlip, {
        renderStage: props.renderStage,
        scaledWidth: props.scaledWidth
      });
    case Effect.SCROLL:
      return /*#__PURE__*/react.createElement(EffectScroll_EffectScroll, {
        renderStage: props.renderStage
      });
    case Effect.SLIDE:
    default:
      return /*#__PURE__*/react.createElement(EffectSlide_EffectSlide, {
        renderStage: props.renderStage
      });
  }
};
EffectManager.propTypes = {
  effect: (prop_types_default()).string.isRequired
};
/* harmony default export */ var EffectManager_EffectManager = (EffectManager);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectManager/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/EffectFlip/components/StageLayer/StageLayerGradient.tsx


var StageLayerGradient = function StageLayerGradient() {
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(LeftPageShadow, null), /*#__PURE__*/react.createElement(RightPageShadow, null));
};
/* harmony default export */ var StageLayer_StageLayerGradient = (StageLayerGradient);
;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/optics-ts/dist/mjs/internals.js
var internals_rest = (undefined && undefined.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
/* eslint-disable @typescript-eslint/no-non-null-assertion */
const id = (x) => x;
const Left = (value) => ({
    _tag: 'Left',
    value,
});
const Right = (value) => ({
    _tag: 'Right',
    value,
});
const either = (mapLeft, mapRight, e) => (e._tag === 'Left' ? mapLeft(e.value) : mapRight(e.value));
const profunctorFn = {
    dimap: (f, g, fn) => (x) => g(fn(f(x))),
    first: (f) => ([x, y]) => [f(x), y],
    right: (f) => (e) => e._tag === 'Left' ? e : Right(f(e.value)),
    wander: (f) => (xs) => xs.map(f),
};
const monoidFirst = {
    empty: () => undefined,
    foldMap: (f, xs) => {
        for (let i = 0; i < xs.length; i++) {
            const x = f(xs[i]);
            if (x != undefined)
                return x;
        }
        return undefined;
    },
};
const monoidArray = {
    empty: () => [],
    foldMap: (f, xs) => {
        let acc = [];
        xs.forEach((x) => {
            acc = acc.concat(f(x));
        });
        return acc;
    },
};
const profunctorConst = (monoid) => ({
    dimap: (f, _g, toF) => (x) => toF(f(x)),
    first: (toF) => ([x, _y]) => toF(x),
    right: (toF) => (e) => e._tag === 'Left' ? monoid.empty() : toF(e.value),
    wander: (toF) => (xs) => monoid.foldMap(toF, xs),
});
const compositionType = {
    Equivalence: {
        Equivalence: 'Equivalence',
        Iso: 'Iso',
        Lens: 'Lens',
        Prism: 'Prism',
        Traversal: 'Traversal',
        Getter: 'Getter',
        AffineFold: 'AffineFold',
        Fold: 'Fold',
        Setter: 'Setter',
    },
    Iso: {
        Equivalence: 'Iso',
        Iso: 'Iso',
        Lens: 'Lens',
        Prism: 'Prism',
        Traversal: 'Traversal',
        Getter: 'Getter',
        AffineFold: 'AffineFold',
        Fold: 'Fold',
        Setter: 'Setter',
    },
    Lens: {
        Equivalence: 'Lens',
        Iso: 'Lens',
        Lens: 'Lens',
        Prism: 'Prism',
        Traversal: 'Traversal',
        Getter: 'Getter',
        AffineFold: 'AffineFold',
        Fold: 'Fold',
        Setter: 'Setter',
    },
    Prism: {
        Equivalence: 'Prism',
        Iso: 'Prism',
        Lens: 'Prism',
        Prism: 'Prism',
        Traversal: 'Traversal',
        Getter: 'AffineFold',
        AffineFold: 'AffineFold',
        Fold: 'Fold',
        Setter: 'Setter',
    },
    Traversal: {
        Equivalence: 'Traversal',
        Iso: 'Traversal',
        Lens: 'Traversal',
        Prism: 'Traversal',
        Traversal: 'Traversal',
        Getter: 'Fold',
        AffineFold: 'Fold',
        Fold: 'Fold',
        Setter: 'Setter',
    },
    Getter: {
        Equivalence: 'Getter',
        Iso: 'Getter',
        Lens: 'Getter',
        Prism: 'AffineFold',
        Traversal: 'Fold',
        Getter: 'Getter',
        AffineFold: 'AffineFold',
        Fold: 'Fold',
        Setter: undefined,
    },
    AffineFold: {
        Equivalence: 'AffineFold',
        Iso: 'AffineFold',
        Lens: 'AffineFold',
        Prism: 'AffineFold',
        Traversal: 'Fold',
        Getter: 'AffineFold',
        AffineFold: 'AffineFold',
        Fold: 'Fold',
        Setter: undefined,
    },
    Fold: {
        Equivalence: 'Fold',
        Iso: 'Fold',
        Lens: 'Fold',
        Prism: 'Fold',
        Traversal: 'Fold',
        Getter: 'Fold',
        AffineFold: 'Fold',
        Fold: 'Fold',
        Setter: undefined,
    },
    Setter: {
        Equivalence: undefined,
        Iso: undefined,
        Lens: undefined,
        Prism: undefined,
        Traversal: undefined,
        Getter: undefined,
        AffineFold: undefined,
        Fold: undefined,
        Setter: undefined,
    },
};
const withTag = (tag, optic) => {
    const result = optic;
    result._tag = tag;
    return result;
};
const removable = (optic) => {
    optic._removable = true;
    return optic;
};
function internals_compose(optic1, optic2, optic3) {
    switch (arguments.length) {
        case 2: {
            const next = (P, optic) => optic1(P, optic2(P, optic));
            next._tag = compositionType[optic1._tag][optic2._tag];
            next._removable = optic2._removable || false;
            return next;
        }
        default: {
            const tag1 = compositionType[optic1._tag][optic2._tag];
            const next = (P, optic) => optic1(P, optic2(P, optic3(P, optic)));
            next._tag = compositionType[tag1][optic3._tag];
            next._removable = optic3._removable || false;
            return next;
        }
    }
}
const eq = /* @__PURE__ */ withTag('Equivalence', (_P, optic) => optic);
const iso = (there, back) => withTag('Iso', (P, optic) => P.dimap(there, back, optic));
const lens = (view, update) => withTag('Lens', (P, optic) => P.dimap((x) => [view(x), x], update, P.first(optic)));
const prism = (match, build) => withTag('Prism', (P, optic) => P.dimap(match, (x) => either(id, build, x), P.right(optic)));
const elems = /* @__PURE__ */ withTag('Traversal', (P, optic) => P.dimap(id, id, P.wander(optic)));
const to = (fn) => withTag('Getter', (P, optic) => P.dimap(fn, id, optic));
/////////////////////////////////////////////////////////////////////////////
const modify = (optic, fn, source) => optic(profunctorFn, fn)(source);
const internals_set = (optic, value, source) => optic(profunctorFn, () => value)(source);
const remove = (optic, source) => internals_set(optic, removeMe, source);
const internals_get = (optic, source) => optic(profunctorConst({}), id)(source);
const preview = (optic, source) => optic(profunctorConst(monoidFirst), id)(source);
const collect = (optic, source) => optic(profunctorConst(monoidArray), (x) => [x])(source);
/////////////////////////////////////////////////////////////////////////////
const indexed = /* @__PURE__ */ iso((value) => value.map((v, k) => [k, v]), (value) => {
    const sorted = [...value].sort((a, b) => a[0] - b[0]);
    const result = [];
    for (let i = 0; i < sorted.length; ++i) {
        if (i === sorted.length - 1 || sorted[i][0] !== sorted[i + 1][0]) {
            result.push(sorted[i][1]);
        }
    }
    return result;
});
const prop = (key) => lens((source) => source[key], ([value, source]) => (Object.assign(Object.assign({}, source), { [key]: value })));
const pick = (keys) => lens((source) => {
    const value = {};
    for (const key of keys) {
        value[key] = source[key];
    }
    return value;
}, ([value, source]) => {
    const result = Object.assign({}, source);
    for (const key of keys) {
        delete result[key];
    }
    return Object.assign(result, value);
});
const nth = (n) => lens((value) => value[n], ([value, source]) => {
    const result = source.slice();
    result[n] = value;
    return result;
});
const fst = /* @__PURE__ */ nth(0);
const when = (pred) => prism((x) => (pred(x) ? Right(x) : Left(x)), id);
const noMatch = /* @__PURE__ */ Symbol('__no_match__');
const mustMatch = /* @__PURE__ */ when((source) => source !== noMatch);
const removeMe = /* @__PURE__ */ Symbol('__remove_me__');
const internals_at = (i) => removable(internals_compose(lens((source) => (0 <= i && i < source.length ? source[i] : noMatch), ([value, source]) => {
    if (value === noMatch) {
        return source;
    }
    if (value === removeMe) {
        if (typeof source === 'string') {
            return source.substring(0, i) + source.substring(i + 1);
        }
        else {
            return [...source.slice(0, i), ...source.slice(i + 1)];
        }
    }
    if (typeof source === 'string') {
        if (i === 0) {
            return value + source.substring(1);
        }
        if (i === source.length) {
            return source.substring(0, i - 1) + value;
        }
        return source.substring(0, i) + value + source.substring(i + 1);
    }
    else {
        const result = source.slice();
        result[i] = value;
        return result;
    }
}), mustMatch));
const atKey = (key) => removable(internals_compose(lens((source) => {
    const value = source[key];
    return value !== undefined ? value : noMatch;
}, ([value, source]) => {
    if (value === noMatch) {
        return source;
    }
    if (value === removeMe) {
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        const _a = source, _b = key, _ = _a[_b], rest = internals_rest(_a, [typeof _b === "symbol" ? _b : _b + ""]);
        return rest;
    }
    return Object.assign(Object.assign({}, source), { [key]: value });
}), mustMatch));
const optional = /* @__PURE__ */ prism((source) => (source === undefined ? Left(undefined) : Right(source)), id);
const guard = (fn) => prism((source) => (fn(source) ? Right(source) : Left(source)), id);
const internals_find = (predicate) => removable(internals_compose(lens((source) => {
    const index = source.findIndex(predicate);
    if (index === -1) {
        return [noMatch, -1];
    }
    return [source[index], index];
}, ([[value, index], source]) => {
    if (value === noMatch) {
        return source;
    }
    if (value === removeMe) {
        return [...source.slice(0, index), ...source.slice(index + 1)];
    }
    const result = source.slice();
    result[index] = value;
    return result;
}), fst, mustMatch));
const internals_filter = (predicate) => internals_compose(lens((source) => {
    const indexes = source
        .map((item, index) => (predicate(item) ? index : null))
        .filter((index) => index != null);
    return [indexes.map((index) => source[index]), indexes];
}, ([[values, indexes], source]) => {
    const sn = source.length, vn = values.length;
    let si = 0, ii = 0, vi = 0;
    const result = [];
    while (si < sn) {
        if (indexes[ii] === si) {
            ++ii;
            if (vi < vn) {
                result.push(values[vi]);
                ++vi;
            }
        }
        else {
            result.push(source[si]);
        }
        ++si;
    }
    while (vi < vn) {
        result.push(values[vi++]);
    }
    return result;
}), fst);
const valueOr = (defaultValue) => lens((source) => (source === undefined ? defaultValue : source), ([value, _source]) => value);
const partsOf = (traversal) => internals_compose(lens((source) => {
    const value = collect(traversal, source);
    return [value, value.length];
}, ([[value, originalLength], source]) => {
    if (value.length !== originalLength) {
        throw new Error('cannot add/remove elements through partsOf');
    }
    let i = 0;
    return modify(traversal, () => value[i++], source);
}), fst);
const reread = (fn) => lens((source) => fn(source), ([value, _]) => value);
const rewrite = (fn) => lens((source) => source, ([value, _]) => fn(value));
const prependTo = /* @__PURE__ */ lens((_source) => undefined, ([value, source]) => {
    if (value === undefined)
        return source;
    return [value, ...source];
});
const appendTo = /* @__PURE__ */ lens((_source) => undefined, ([value, source]) => {
    if (value === undefined)
        return source;
    return [...source, value];
});
const chars = /* @__PURE__ */ internals_compose(iso((s) => s.split(''), (a) => a.join('')), elems);
const words = /* @__PURE__ */ internals_compose(iso((s) => s.split(/\b/), (a) => a.join('')), elems, when((s) => !/\s+/.test(s)));
/////////////////////////////////////////////////////////////////////////////
class Optic {
    constructor(_ref) {
        this._ref = _ref;
    }
    get _tag() {
        return this._ref._tag;
    }
    get _removable() {
        return this._ref._removable;
    }
    compose(other) {
        return new Optic(internals_compose(this._ref, other._ref));
    }
    iso(there, back) {
        return new Optic(internals_compose(this._ref, iso(there, back)));
    }
    indexed() {
        return new Optic(internals_compose(this._ref, indexed));
    }
    prop(key) {
        return new Optic(internals_compose(this._ref, prop(key)));
    }
    path(...keys) {
        if (keys.length === 1) {
            keys = keys[0].split('.');
        }
        return new Optic(keys.reduce((ref, key) => internals_compose(ref, prop(key)), this._ref));
    }
    pick(keys) {
        return new Optic(internals_compose(this._ref, pick(keys)));
    }
    nth(n) {
        return new Optic(internals_compose(this._ref, nth(n)));
    }
    filter(predicate) {
        return new Optic(internals_compose(this._ref, internals_filter(predicate)));
    }
    valueOr(defaultValue) {
        return new Optic(internals_compose(this._ref, valueOr(defaultValue)));
    }
    partsOf(traversalOrFn) {
        const traversal = typeof traversalOrFn === 'function' ? traversalOrFn(optic) : traversalOrFn;
        return new Optic(internals_compose(this._ref, partsOf(traversal._ref)));
    }
    reread(fn) {
        return new Optic(internals_compose(this._ref, reread(fn)));
    }
    rewrite(fn) {
        return new Optic(internals_compose(this._ref, rewrite(fn)));
    }
    optional() {
        return new Optic(internals_compose(this._ref, optional));
    }
    guard_() {
        return (fn) => this.guard(fn);
    }
    guard(fn) {
        return new Optic(internals_compose(this._ref, guard(fn)));
    }
    at(i) {
        return new Optic(internals_compose(this._ref, internals_at(i)));
    }
    head() {
        return new Optic(internals_compose(this._ref, internals_at(0)));
    }
    index(i) {
        return new Optic(internals_compose(this._ref, internals_at(i)));
    }
    find(predicate) {
        return new Optic(internals_compose(this._ref, internals_find(predicate)));
    }
    elems() {
        return new Optic(internals_compose(this._ref, elems));
    }
    to(fn) {
        return new Optic(internals_compose(this._ref, to(fn)));
    }
    when(predicate) {
        return new Optic(internals_compose(this._ref, when(predicate)));
    }
    chars() {
        return new Optic(internals_compose(this._ref, chars));
    }
    words() {
        return new Optic(internals_compose(this._ref, words));
    }
    prependTo() {
        return new Optic(internals_compose(this._ref, prependTo));
    }
    appendTo() {
        return new Optic(internals_compose(this._ref, appendTo));
    }
}
const optic = /* @__PURE__ */ new Optic(eq);

;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/optics-ts/dist/mjs/index.js
/* eslint-disable @typescript-eslint/adjacent-overload-signatures, @typescript-eslint/no-unused-vars */
// This file is generated, do not edit! See ../scripts/generate-index.ts

function mjs_compose(optic1, optic2) {
    return optic1.compose(optic2);
}
function mjs_optic() {
    return optic;
}
function optic_() {
    return I.optic;
}
function mjs_get(optic) {
    return (source) => internals_get(optic._ref, source);
}
function mjs_preview(optic) {
    return (source) => preview(optic._ref, source);
}
function mjs_collect(optic) {
    return (source) => collect(optic._ref, source);
}
function mjs_modify(optic) {
    return (f) => (source) => modify(optic._ref, f, source);
}
function mjs_set(optic) {
    return (value) => (source) => internals_set(optic._ref, value, source);
}
function mjs_remove(optic) {
    return (source) => I.remove(optic._ref, source);
}


;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/jotai-optics/dist/index.modern.mjs
const index_modern_n=(t,e,n)=>(e.has(n)?e:e.set(n,t())).get(n),index_modern_o=new WeakMap;function index_modern_r(r,a){return((i,c,p)=>{const f=index_modern_n(()=>new WeakMap,index_modern_o,c);return index_modern_n(()=>{const n=a(mjs_optic());return vanilla_atom(t=>{const e=t(r);return e instanceof Promise?e.then(t=>index_modern_s(n,t)):index_modern_s(n,e)},(t,o,s)=>{const a="function"==typeof s?mjs_modify(n)(s):mjs_set(n)(s),i=t(r);return o(r,i instanceof Promise?i.then(a):a(i))})},f,p)})(0,r,a)}const index_modern_s=(t,n)=>"Traversal"===t._tag?mjs_collect(t)(n):"Prism"===t._tag?mjs_preview(t)(n):mjs_get(t)(n);
//# sourceMappingURL=index.modern.mjs.map

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/preloader/constants.ts
var ElementsTypeEnum = /*#__PURE__*/function (ElementsTypeEnum) {
  ElementsTypeEnum["IMAGES"] = "images";
  ElementsTypeEnum["FONTS"] = "fonts";
  ElementsTypeEnum["IMAGES_MASK"] = "imagesMask";
  ElementsTypeEnum["BACKGROUND_COVER"] = "backgroundCover";
  ElementsTypeEnum["VIDEOS"] = "videos";
  ElementsTypeEnum["AUDIOS"] = "audios";
  ElementsTypeEnum["IMAGES_SLIDESHOW"] = "imagesSlideshow";
  return ElementsTypeEnum;
}({});
var KeyEnum = /*#__PURE__*/function (KeyEnum) {
  KeyEnum["NUMBER_OF_ELEMENTS"] = "numberOfElements";
  KeyEnum["NUMBER_OF_LOADED_ELEMENTS"] = "numberOfLoadedElements";
  return KeyEnum;
}({});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/preloader/pageLoadingTask.ts



var loadElements = defineProperty_defineProperty(defineProperty_defineProperty({}, KeyEnum.NUMBER_OF_ELEMENTS, 0), KeyEnum.NUMBER_OF_LOADED_ELEMENTS, 0);
var pageLoadingTaskDefaults = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, ElementsTypeEnum.IMAGES, loadElements), ElementsTypeEnum.FONTS, loadElements), ElementsTypeEnum.IMAGES_MASK, loadElements), ElementsTypeEnum.BACKGROUND_COVER, loadElements), ElementsTypeEnum.VIDEOS, loadElements), ElementsTypeEnum.AUDIOS, loadElements), ElementsTypeEnum.IMAGES_SLIDESHOW, loadElements);
var pageLoadingTaskAtom = vanilla_atom({});
pageLoadingTaskAtom.debugLabel = "pageLoadingTaskAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PagePreloader/hooks/useHidePreloader.ts






/**
 * Check if the page is loaded
 * @param pageId
 * @return boolean
 */
/* harmony default export */ var useHidePreloader = (function (pageId) {
  var pageLoadingTaskValues = react_useAtomValue(index_modern_r(pageLoadingTaskAtom, (0,react.useCallback)(function (optic) {
    return optic.path("".concat(pageId));
  }, [pageId])));
  if (!pageLoadingTaskValues) {
    return false;
  }
  var resources = Object.values(ElementsTypeEnum);
  return resources.every(function (resource) {
    return pageLoadingTaskValues[resource][KeyEnum.NUMBER_OF_ELEMENTS] === pageLoadingTaskValues[resource][KeyEnum.NUMBER_OF_LOADED_ELEMENTS];
  });
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PagePreloader/StagePagesPreloader.styles.ts

var StagePagesPreloader = styled_components_browser_esm.div.withConfig({
  displayName: "StagePagesPreloaderstyles__StagePagesPreloader",
  componentId: "sc-eioowp-0"
})(["display:flex;height:100%;width:100%;position:absolute;top:0;pointer-events:none;"]);
var StagePagesPreloader_styles_PagePreloader = styled_components_browser_esm.div.withConfig({
  displayName: "StagePagesPreloaderstyles__PagePreloader",
  componentId: "sc-eioowp-1"
})(["position:absolute;width:", "px;height:", "px;", ":0;"], function (_ref) {
  var $width = _ref.$width;
  return $width;
}, function (_ref2) {
  var $height = _ref2.$height;
  return $height;
}, function (_ref3) {
  var pageIndex = _ref3.pageIndex;
  return pageIndex ? 'right' : 'left';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PagePreloader/PagePreloader.tsx






var PagePreloader = function PagePreloader(_ref) {
  var pageId = _ref.pageId,
    pageWidth = _ref.pageWidth,
    pageHeight = _ref.pageHeight,
    pageIndex = _ref.pageIndex;
  var hidePreloader = useHidePreloader(pageId);
  var animationRef = (0,react.useRef)();
  var pagePreloaderRef = (0,react.useRef)(null);
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    finishAnimation = _useState2[0],
    setFinishAnimation = _useState2[1];
  (0,react.useEffect)(function () {
    var pagePreloader = pagePreloaderRef.current;
    var onAnimationDone = function onAnimationDone() {
      setFinishAnimation(true);
    };
    if (pagePreloader) {
      var _animationRef$current;
      animationRef === null || animationRef === void 0 || (_animationRef$current = animationRef.current) === null || _animationRef$current === void 0 || _animationRef$current.cancel();
      var delay = hidePreloader ? 50 : 8000;
      animationRef.current = pagePreloader.animate({
        opacity: [1, 0]
      }, {
        duration: 300,
        easing: 'ease',
        delay: delay,
        fill: 'forwards'
      });
      animationRef.current.addEventListener('finish', onAnimationDone);
    }
    return function () {
      var _animationRef$current2, _animationRef$current3;
      animationRef === null || animationRef === void 0 || (_animationRef$current2 = animationRef.current) === null || _animationRef$current2 === void 0 || _animationRef$current2.cancel();
      animationRef === null || animationRef === void 0 || (_animationRef$current3 = animationRef.current) === null || _animationRef$current3 === void 0 || _animationRef$current3.removeEventListener('finish', onAnimationDone);
    };
  }, [hidePreloader]);
  return !finishAnimation ? /*#__PURE__*/react.createElement(ErrorBoundary_ErrorBoundary, null, /*#__PURE__*/react.createElement(StagePagesPreloader_styles_PagePreloader, {
    $width: pageWidth,
    $height: pageHeight,
    pageIndex: pageIndex,
    ref: pagePreloaderRef
  }, /*#__PURE__*/react.createElement(Preloader_Preloader, {
    width: pageWidth,
    height: pageHeight
  }))) : null;
};
/* harmony default export */ var PagePreloader_PagePreloader = (PagePreloader);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PagePreloader/StagePreloader.tsx



var StagePreloader = function StagePreloader(_ref) {
  var stagePages = _ref.stagePages,
    pageWidth = _ref.pageWidth,
    pageHeight = _ref.pageHeight;
  return /*#__PURE__*/react.createElement(StagePagesPreloader, null, stagePages.map(function (pageId, pageIndex) {
    return /*#__PURE__*/react.createElement(PagePreloader_PagePreloader, {
      pageId: pageId,
      pageWidth: pageWidth,
      pageHeight: pageHeight,
      key: "".concat(pageId, "-preloader"),
      pageIndex: pageIndex
    });
  }));
};
/* harmony default export */ var PagePreloader_StagePreloader = (StagePreloader);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getPageNumberByPageId.ts

/**
 * Retrieves the adjusted page number based on the provided parameters.
 *
 * @param {FlipbookJsonPagesOrderType[]} pagesOrder - The formatted order of pages in the flipbook.
 * @param {number|string} pageId - The ID of the target page.
 * @param {boolean} isRtl - Flag indicating whether the layout is right-to-left.
 * @returns {number} - Number of page
 */
/* harmony default export */ var getPageNumberByPageId = (function (pagesOrder, pageId, isRtl) {
  var _ref;
  var arrayPageOrder = (_ref = []).concat.apply(_ref, toConsumableArray_toConsumableArray(pagesOrder));
  var adjustedPageOrder = isRtl ? toConsumableArray_toConsumableArray(arrayPageOrder).reverse() : arrayPageOrder;
  return adjustedPageOrder.indexOf(pageId) + 1;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/hasAccessToElement.ts

/**
 * Check if the element can be displayed on stage
 */
/* harmony default export */ var hasAccessToElement = (function (_ref, currentFeatures) {
  var elementType = _ref.elementType,
    elementAction = _ref.elementAction,
    _ref$elementProvider = _ref.elementProvider,
    elementProvider = _ref$elementProvider === void 0 ? '' : _ref$elementProvider;
  if (!ElementDefaults[elementType] || ElementDefaults[elementType] && !ElementDefaults[elementType].component) {
    // This element is not supported in player
    return false;
  }
  if (elementType === LinkType.VIDEO_WIDGET && VIDEO_PROVIDERS.includes(elementProvider)) {
    // VIDEO_WIDGET can be displayed if its provider is supported
    return true;
  }
  if (typeof ElementActionToFeature[elementAction] === 'string' && currentFeatures[ElementActionToFeature[elementAction]] === false) {
    // The current element needs a specific feature
    return false;
  }

  // The element is supported and has the correct feature - it can be displayed in the player
  return true;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/GeneralStyles.ts


var GeneralStyles_Link = styled_components_browser_esm.a.attrs(function (props) {
  return {
    href: props.href ? props.href : undefined,
    draggable: false,
    $inline: props.$inline,
    rel: props.rel
  };
}).withConfig({
  displayName: "GeneralStyles__Link",
  componentId: "sc-1h46dh9-0"
})(["", ""], function (props) {
  return !props.$inline ? '' + "width: 100%;\n         height: 100%;\n         display: block;\n         text-decoration: none;" : '';
});
var GeneralStyles_ElementLayer = styled_components_browser_esm.div.withConfig({
  displayName: "GeneralStyles__ElementLayer",
  componentId: "sc-1h46dh9-1"
})(["cursor:pointer;position:absolute;height:100%;width:100%;top:0;"]);
var HyperlinkElementLayer = styled_components_browser_esm(GeneralStyles_ElementLayer).withConfig({
  displayName: "GeneralStyles__HyperlinkElementLayer",
  componentId: "sc-1h46dh9-2"
})(["", ""], function (props) {
  if (!main/* isMobile */.Fr) {
    if (!props.$highlights) {
      return " &:hover {\n                    opacity: 0;\n                }";
    }
    return " &:hover {\n                opacity: 0.5;\n                background: rgb(255, 255, 255);\n                transition: all .2s;\n            }";
  }
  return '';
});
var RotationContainer = styled_components_browser_esm.div.withConfig({
  displayName: "GeneralStyles__RotationContainer",
  componentId: "sc-1h46dh9-3"
})(["width:100%;height:100%;", ""], function (props) {
  if (props.$rotation) {
    var rotation = props.reverse ? -props.$rotation : props.$rotation;
    return "transform: rotate(".concat(rotation, "deg);");
  }
  return '';
});
var PollElementLayer = styled_components_browser_esm(GeneralStyles_ElementLayer).withConfig({
  displayName: "GeneralStyles__PollElementLayer",
  componentId: "sc-1h46dh9-4"
})(["opacity:0;cursor:initial;"]);
var ButtonElementLayer = styled_components_browser_esm.button.withConfig({
  displayName: "GeneralStyles__ButtonElementLayer",
  componentId: "sc-1h46dh9-5"
})(["cursor:pointer;position:absolute;height:100%;width:100%;top:0;border:0;background:transparent;"]);

/**
 * Use inheritance to prevent child elements from increasing the size of the parent element.
 * This issue was observed when the TextBoxElement scaled down its child elements,
 * but the parent element's size remained unchanged.
 * Example: The TextBoxElement has a width of 100px, while the parent element has a width of 200px.
 * If another element overflows the 200px width, that element will not be clickable.
 */
var ParentSizeWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "GeneralStyles__ParentSizeWrapper",
  componentId: "sc-1h46dh9-6"
})(["width:inherit;height:inherit;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements.styles.ts




var ElementPositioning = styled_components_browser_esm.div.attrs(function (props) {
  return {
    style: {
      top: props.$top,
      left: props.$left,
      zIndex: props.$zIndex,
      width: "".concat(props.$width, "px"),
      height: "".concat(props.$height, "px")
    }
  };
}).withConfig({
  displayName: "Elementsstyles__ElementPositioning",
  componentId: "sc-tjlpzr-0"
})(["position:absolute;", ";"], function (props) {
  return props.$rotation ? "transform: rotate(".concat(props.$rotation, "deg);") : '';
});

/**
 * Use translateZ(0) to correctly render Image mask element (svg + image)
 */
var ElementsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "Elementsstyles__ElementsContainer",
  componentId: "sc-tjlpzr-1"
})(["position:absolute;top:0;display:flex;justify-content:center;transform:translateZ(0);"]);
var ElementsList = styled_components_browser_esm.div.withConfig({
  displayName: "Elementsstyles__ElementsList",
  componentId: "sc-tjlpzr-2"
})(["width:", "px;height:", "px;overflow:", ";position:relative;", ";"], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (props) {
  return props.$overflow;
}, function (props) {
  return props.$left !== undefined ? "left: ".concat(props.$left) : '';
});
var Elements_styles_Elements = styled_components_browser_esm.div.withConfig({
  displayName: "Elementsstyles__Elements",
  componentId: "sc-tjlpzr-3"
})(["display:flex;overflow:hidden;"]);
var pulsate = Ue(["0%,100%{outline-color:transparent;}50%{outline-color:", ";}"], defaultPlayer_DefaultColors.warning);
var MandatoryElementWrapper = styled_components_browser_esm(ParentSizeWrapper).withConfig({
  displayName: "Elementsstyles__MandatoryElementWrapper",
  componentId: "sc-tjlpzr-4"
})(["", ""], function (_ref) {
  var showMandatoryStyle = _ref.showMandatoryStyle;
  return showMandatoryStyle ? Ce(["animation:", " 2.4s ease-in-out infinite;animation-delay:1s;outline:2px solid transparent;"], pulsate) : '';
});
var ElementWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "Elementsstyles__ElementWrapper",
  componentId: "sc-tjlpzr-5"
})(["", ";", ";"], function (_ref2) {
  var animationStyle = _ref2.animationStyle;
  return animationStyle;
}, function (_ref3) {
  var hover = _ref3.hover;
  return hover ? "\n        ".concat(main/* isSafari */.nr ? '' : 'transition: .25s ease-in;', ";\n        opacity: .35;\n        cursor: pointer;\n    ") : '';
});
var IframeContainer = styled_components_browser_esm.div.withConfig({
  displayName: "Elementsstyles__IframeContainer",
  componentId: "sc-tjlpzr-6"
})(["width:", ";height:", ";", ""], function (props) {
  return props.$width;
}, function (props) {
  return props.$height;
}, function (_ref4) {
  var $isEmpty = _ref4.$isEmpty;
  return !$isEmpty ? 'background-color: #000000' : '';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/ShapesContext.ts

var shapeContextDefault = {
  loadedShapes: {
    current: {}
  },
  setLoadedShapes: function setLoadedShapes() {},
  resetLoadedShapes: function resetLoadedShapes() {},
  setShapeDefinitionsRef: function setShapeDefinitionsRef() {},
  shapeDefinitionsRef: null
};
var ShapesContext = /*#__PURE__*/react.createContext(shapeContextDefault);
var ShapesProvider = ShapesContext.Provider;
/* harmony default export */ var contexts_ShapesContext = (ShapesContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShapesLoader/ShapesLoader.tsx


var ShapesLoader = function ShapesLoader() {
  var _useContext = (0,react.useContext)(contexts_ShapesContext),
    resetLoadedShapes = _useContext.resetLoadedShapes,
    setShapeDefinitionsRef = _useContext.setShapeDefinitionsRef;
  var defsRef = (0,react.useRef)(null);
  (0,react.useEffect)(function () {
    // On mount - set the defs ref into the context
    setShapeDefinitionsRef(defsRef);

    // On unmount - the loaded shapes values from context must be reset
    return function () {
      resetLoadedShapes();
    };
  }, []);
  return /*#__PURE__*/react.createElement("div", {
    style: {
      width: 0,
      height: 0
    }
  }, /*#__PURE__*/react.createElement("svg", {
    style: {
      width: 0,
      height: 0
    },
    xmlns: "http://www.w3.org/2000/svg",
    xmlnsXlink: "http://www.w3.org/1999/xlink"
  }, /*#__PURE__*/react.createElement("defs", {
    ref: defsRef
  })));
};
/* harmony default export */ var ShapesLoader_ShapesLoader = (ShapesLoader);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShapesLoader/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/PopoverContext.ts

var popoverContextDefault = {
  elementRef: null,
  opened: false,
  setOpened: function setOpened() {}
};
var PopoverContext = /*#__PURE__*/react.createContext(popoverContextDefault);
var PopoverProvider = PopoverContext.Provider;
/* harmony default export */ var contexts_PopoverContext = (PopoverContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getElementOpacity.ts
/**
 * Returns the element opacity
 * @param {boolean} isAutoLink
 * @param {boolean} isAnnotation
 * @param {boolean} highlightOnLinks
 * @param {number} alpha
 * @returns {number}
 */
/* harmony default export */ var getElementOpacity = (function (isAutoLink, isAnnotation, highlightOnLinks, alpha) {
  if (isAutoLink || isAnnotation) {
    return highlightOnLinks ? alpha : 0;
  }
  return typeof alpha === 'number' ? alpha : 1;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElementTooltipContainer/utils/getTooltip.ts



/**
 * @param element
 * @return string
 */
var getTooltip = function getTooltip(element) {
  // Element with interaction (img, shape etc)
  if (element.attributes && 'interaction' in element.attributes && element.attributes.interaction) {
    if ('tooltip' in element.attributes.interaction && element.attributes.interaction.tooltip !== '') {
      return element.attributes.interaction.tooltip;
    }
    if ('popinTooltip' in element.attributes.interaction && element.attributes.interaction.popinTooltip !== '' && element.attributes.interaction.openActionType !== OpenPopoverValues.HOVER) {
      return element.attributes.interaction.popinTooltip;
    }
    if ('actionTooltip' in element.attributes.interaction && element.attributes.interaction.actionTooltip !== '') {
      return element.attributes.interaction.actionTooltip;
    }
  }
  if (element.action === ActionType.OPEN_OVERLAY && element.attributes.openActionType === OpenPopoverValues.HOVER) {
    return '';
  }

  // Simple element with tooltip
  if (element.attributes.tooltip) {
    return element.attributes.tooltip;
  }
  return '';
};
/* harmony default export */ var utils_getTooltip = (getTooltip);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElementTooltipContainer/utils/hasTooltip.ts



/**
 * Check if the given element has tooltip
 * @param elementType
 * @param elementActionType
 * @return boolean
 */
/* harmony default export */ var hasTooltip = (function (elementType, elementActionType) {
  var _elementsWithoutToolt;
  return !main/* isMobile */.Fr && !((_elementsWithoutToolt = elementsWithoutTooltip[elementActionType]) !== null && _elementsWithoutToolt !== void 0 && _elementsWithoutToolt.includes(elementType));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Tooltip/Tooltip.styles.tsx

var Tooltip_styles_Tooltip = styled_components_browser_esm.div.withConfig({
  displayName: "Tooltipstyles__Tooltip",
  componentId: "sc-tqse3u-0"
})(["top:", "px;left:", "px;position:fixed;"], function (props) {
  return props.$top;
}, function (props) {
  return props.$left;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Tooltip/Tooltip.tsx






// TODO: Fix tooltip positioning
// TODO: Mutare tooltip in ActionHandler-ul general independent de element
var GeneralComponents_Tooltip_Tooltip_Tooltip = function Tooltip(props) {
  var ref = (0,react.useRef)(null);
  var _useState = (0,react.useState)({
      x: props.left,
      y: props.top
    }),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    tooltipCoordinates = _useState2[0],
    setTooltipCoordinates = _useState2[1];
  var parent = document.getElementById('playerTooltip');
  (0,react.useEffect)(function () {
    if (ref.current) {
      var left = props.left,
        top = props.top;
      if (top < ref.current.clientHeight + TOOLTIP_CURSOR_PADDING) {
        left += TOOLTIP_CURSOR_PADDING * 3;
        top += TOOLTIP_CURSOR_PADDING;
      } else {
        left += TOOLTIP_CURSOR_PADDING;
        top -= ref.current.clientHeight + TOOLTIP_CURSOR_PADDING;
      }
      setTooltipCoordinates({
        x: left,
        y: top
      });
    }
  }, [props.left, props.top]);
  return /*#__PURE__*/react_dom.createPortal(/*#__PURE__*/react.createElement(Tooltip_styles_Tooltip, {
    $left: tooltipCoordinates.x,
    $top: tooltipCoordinates.y,
    ref: ref
  }, props.children), parent);
};
GeneralComponents_Tooltip_Tooltip_Tooltip.propTypes = {
  children: (prop_types_default()).element.isRequired,
  left: (prop_types_default()).number.isRequired,
  top: (prop_types_default()).number.isRequired
};
/* harmony default export */ var GeneralComponents_Tooltip_Tooltip = (GeneralComponents_Tooltip_Tooltip_Tooltip);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Tooltip/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/TooltipContainer/TooltipContainer.tsx








var TooltipContainer = function TooltipContainer(props) {
  var ref = (0,react.useRef)(null);
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    isTooltipVisible = _useState2[0],
    setIsTooltipVisible = _useState2[1];
  var _useState3 = (0,react.useState)({
      x: 0,
      y: 0
    }),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    tooltipMouseMove = _useState4[0],
    setTooltipMouseMove = _useState4[1];
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var onMouseLeave = (0,react.useCallback)(function () {
    setIsTooltipVisible(false);
  }, [props.hide]);
  var onMouseMove = (0,react.useCallback)(function (e) {
    if (!props.hide) {
      setIsTooltipVisible(true);
      setTooltipMouseMove({
        x: e.clientX,
        y: e.clientY
      });
    }
  }, [props.hide]);
  (0,react.useEffect)(function () {
    if (props.hide && isTooltipVisible) {
      setIsTooltipVisible(false);
    }
    if (ref.current && props.isAvailable && props.tooltipValue) {
      ref.current.addEventListener('mouseleave', onMouseLeave);
      ref.current.addEventListener('mousemove', onMouseMove);
    }
    return function () {
      if (ref.current && props.isAvailable && props.tooltipValue) {
        ref.current.removeEventListener('mouseleave', onMouseLeave);
        ref.current.removeEventListener('mousemove', onMouseMove);
      }
    };
  }, [props.hide]);
  (0,react.useEffect)(function () {
    onMouseLeave();
  }, [settledStageIndex]);
  return /*#__PURE__*/react.createElement(ParentSizeWrapper, {
    ref: ref
  }, isTooltipVisible && tooltipMouseMove.x !== 0 && tooltipMouseMove.y !== 0 && /*#__PURE__*/react.createElement(GeneralComponents_Tooltip_Tooltip, {
    left: tooltipMouseMove.x,
    top: tooltipMouseMove.y
  }, /*#__PURE__*/react.createElement(TooltipContainer_TooltipView, {
    customStyles: {
      whiteSpace: 'normal'
    }
  }, /*#__PURE__*/react.createElement("span", null, props.tooltipValue))), props.children);
};
TooltipContainer.propTypes = {
  hide: (prop_types_default()).bool.isRequired,
  isAvailable: (prop_types_default()).bool.isRequired,
  tooltipValue: (prop_types_default()).string.isRequired,
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var TooltipContainer_TooltipContainer = (TooltipContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/TooltipContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElementTooltipContainer/StageElementTooltipContainer.tsx







var StageElementTooltipContainer = function StageElementTooltipContainer(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var showTooltip = hasTooltip(element.type, element.action);
  var tooltipValue = (0,react.useMemo)(function () {
    return showTooltip ? utils_getTooltip(element) : '';
  }, []);

  // While an element popover is opened, the tooltip will be hidden for that specific element
  var popoverContext = (0,react.useContext)(contexts_PopoverContext);
  return /*#__PURE__*/react.createElement(TooltipContainer_TooltipContainer, {
    hide: popoverContext.opened,
    tooltipValue: tooltipValue,
    isAvailable: showTooltip
  }, props.children);
};
StageElementTooltipContainer.propTypes = {
  elementIndex: (prop_types_default()).number.isRequired,
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var StageElementTooltipContainer_StageElementTooltipContainer = (StageElementTooltipContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Statistics/ElementStatisticsLayer/ElementStatisticsLayer.tsx





var ElementStatisticsLayer = function ElementStatisticsLayer(props) {
  var _useContext = (0,react.useContext)(StatisticsContext),
    registerEvents = _useContext.registerEvents;
  var sendClickEvent = (0,react.useCallback)(function () {
    registerEvents([{
      eid: StatsType.CLICK_ELEMENT,
      elid: props.elementId,
      pid: props.pageId
    }]);
  }, []);
  return /*#__PURE__*/react.createElement(ParentSizeWrapper, {
    role: "presentation",
    onClick: sendClickEvent
  }, props.children);
};
ElementStatisticsLayer.propTypes = {
  children: (prop_types_default()).element.isRequired,
  elementId: (prop_types_default()).number.isRequired,
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired
};
/* harmony default export */ var ElementStatisticsLayer_ElementStatisticsLayer = (ElementStatisticsLayer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Statistics/ElementStatisticsLayer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/elements/generateInteractiveAnimation.ts




var createInteractiveAnimation = function createInteractiveAnimation(alpha) {
  return Ue(["0%{opacity:0;}50%{opacity:0.35;}100%{opacity:", ";}"], alpha);
};
var createPulseAnimation = function createPulseAnimation() {
  return Ue(["0%,100%{opacity:0}50%{opacity:1}"]);
};
var formatBorderRadius = function formatBorderRadius() {
  var radius = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;
  if (typeof radius === 'number') {
    return "".concat(radius, "px");
  }
  return radius;
};
/**
 * Generate transition style for the selected interactive elements
 * @param {{ type: number, alpha: number, id: number, color: number, radius: number | string }} elementProps
 * @param {boolean} isStageActive
 * @param {boolean} isAnimated
 * @param {string} effect
 * @param {boolean} isDownloadPDF
 * @returns {string}
 */
/* harmony default export */ var generateInteractiveAnimation = (function (elementProps, isStageActive, isAnimated, effect) {
  var isDownloadPDF = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  var styles = '';
  var link = InteractiveLinkElements.includes(elementProps.type);
  var button = InteractiveButtonElements.includes(elementProps.type);
  var transitionTime = link ? 1 : 0.5;
  var transition = main/* isSafari */.nr ? '' : 'transition: opacity 0.2s ease;';
  var borderRadius = formatBorderRadius(elementProps.radius);
  if ((link || button) && !isDownloadPDF) {
    if (isAnimated) {
      if (isStageActive || effect === playerTypes_PlayerEffect.SCROLL) {
        styles = Ce(["position:relative;border-radius:", ";opacity:", ";animation:", " ", "s ease-in;", " &::before{content:\"\";position:absolute;height:100%;width:100%;background:", ";filter:blur(10px);animation:", " 2.4s ease-in-out infinite;border-radius:", ";pointer-events:none;z-index:-1;}"], borderRadius, elementProps.alpha, createInteractiveAnimation(elementProps.alpha), transitionTime, transition, elementProps.color, createPulseAnimation(), borderRadius);
      } else {
        styles = 'opacity: 0;';
      }
    } else {
      styles = "opacity: ".concat(elementProps.alpha, ";");
    }
  }
  return styles;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/elements/getRoundedInteractiveElementBorder.ts


/**
 * Returns the border for the rounded elements
 * @param {number} elementType
 * @param {string} shape
 * @param radius
 * @returns {{borderRadius: number} | {borderRadius: string} | {}}
 */
/* harmony default export */ var getRoundedInteractiveElementBorder = (function (elementType) {
  var shape = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  var radius = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  if (shape === CaptionShape.ROUNDED || RoundedInteractiveElements.includes(elementType)) {
    return {
      borderRadius: '50%'
    };
  }
  return {
    borderRadius: "".concat(radius, "px")
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/elements/isInteractiveElement.ts

/* harmony default export */ var isInteractiveElement = (function (type) {
  var isDownloadPDF = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var interactiveElement = InteractiveButtonElements.concat(InteractiveLinkElements).includes(type);
  return interactiveElement && !isDownloadPDF;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/IconElement.tsx

function IconElement_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function IconElement_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? IconElement_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : IconElement_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }








// Use this is instead of: import * as Icon from '@flipsnack-ui/content-icons'
var IconElement_Icon = __webpack_require__(9854);
var IconElement = function IconElement(props) {
  var elementProps = (props === null || props === void 0 ? void 0 : props.icon) || ElementDefaults[props.type].icon;
  var IconComponent = elementProps && IconElement_Icon[elementProps] ? IconElement_Icon[elementProps] : null;
  var elementBorderRadius = (props === null || props === void 0 ? void 0 : props.shape) === CaptionShape.ROUNDED ? '50%' : "".concat((props === null || props === void 0 ? void 0 : props.radius) || 0, "px");
  var interactiveElement = isInteractiveElement(props.type, props.isDownloadPDF);
  var animationStyle = generateInteractiveAnimation({
    type: props.type,
    alpha: props.alpha,
    id: props.id,
    color: props.color,
    radius: elementBorderRadius
  }, props.isStageActive, props.animatedInteractions, props.effect);
  var roundedElements = getRoundedInteractiveElementBorder(props.type, props.shape, props.radius);
  return /*#__PURE__*/react.createElement(ElementWrapper, {
    animationStyle: animationStyle,
    hover: props.mouseOver,
    style: IconElement_objectSpread({}, roundedElements)
  }, /*#__PURE__*/react.createElement(src_IconButton, {
    shape: props.shape || '',
    bgColor: props.color,
    alpha: interactiveElement ? null : props.alpha,
    width: props.width,
    height: props.height,
    radius: elementBorderRadius,
    icon: IconComponent && /*#__PURE__*/react.createElement(IconComponent, null)
  }));
};
/* harmony default export */ var Elements_IconElement = (/*#__PURE__*/react.memo(IconElement));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/IconElementWithLabel.tsx







// Use this is instead of: import * as Icon from '@flipsnack-ui/content-icons'
var IconElementWithLabel_Icon = __webpack_require__(9854);
var IconElementWithLabel = function IconElementWithLabel(props) {
  var elementProps = ElementDefaults[props.type].icon;
  var IconComponent = IconElementWithLabel_Icon[elementProps];
  var interactiveElement = isInteractiveElement(props.type, props.isDownloadPDF);
  var animationStyle = generateInteractiveAnimation({
    type: props.type,
    alpha: props.alpha,
    id: props.id,
    color: props.color,
    radius: props.radius
  }, props.isStageActive, props.animatedInteractions, props.effect);
  return /*#__PURE__*/react.createElement(ElementWrapper, {
    animationStyle: animationStyle,
    hover: props.mouseOver
  }, /*#__PURE__*/react.createElement(src_IconButton, {
    bgColor: props.color,
    width: props.width,
    height: props.height,
    radius: "".concat(props.radius, "px"),
    icon: /*#__PURE__*/react.createElement(IconComponent, {
      fill: "#fff"
    }),
    label: props.tooltip,
    alpha: interactiveElement ? undefined : props.alpha
  }));
};
/* harmony default export */ var Elements_IconElementWithLabel = (/*#__PURE__*/react.memo(IconElementWithLabel));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/images.ts

function images_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function images_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? images_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : images_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/* Image size types */

var SMALL = 'small';
var MEDIUM = 'medium';
var LARGE = 'large';
var ORIGINAL = 'original';
var ImageSizeTypes = [SMALL, MEDIUM, ORIGINAL];
// We do not load thumbs anymore because GIFs do not have animated thumbs and we want to be able to load
// the original GIF images (they don't have small and medium sizes).
var ImageBreakpointSizes = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, SMALL, {
  width: 400,
  height: 400,
  appendedText: '_s',
  backgroundName: '/small',
  type: 'small'
}), MEDIUM, {
  width: 900,
  height: 900,
  appendedText: '_m',
  backgroundName: '/medium',
  type: 'medium'
}), ORIGINAL, {
  width: Infinity,
  height: Infinity,
  appendedText: '',
  backgroundName: '/original',
  type: 'original'
});
var ImageFillBreakpointSizes = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, SMALL, images_objectSpread(images_objectSpread({}, ImageBreakpointSizes[SMALL]), {}, {
  width: 200,
  height: 200
})), MEDIUM, images_objectSpread(images_objectSpread({}, ImageBreakpointSizes[MEDIUM]), {}, {
  width: 400,
  height: 400
})), ORIGINAL, ImageBreakpointSizes[ORIGINAL]);
var DEFAULTS_PERCENTAGE_SIZE = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, SMALL, 0.5), MEDIUM, 0.7), LARGE, 0.9);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getImageAppendedSrc.ts

// TODO: rename appended -> get Preferred Size Image Src / get Image Source By Breakpoints
/**
 * Returns the correct image src (with '_t', '_s', '_m' or '' appended to the image source)
 * Returns the correct background src for new-convert
 * @param {number} width
 * @param {number} height
 * @param {string} imgSrc
 * @param {bool} isBackgroundImage - used for new-convert background
 * @param isImageFilled
 * @return string
 */
/* harmony default export */ var getImageAppendedSrc = (function (_ref) {
  var width = _ref.width,
    height = _ref.height,
    imgSrc = _ref.imgSrc,
    _ref$isBackgroundImag = _ref.isBackgroundImage,
    isBackgroundImage = _ref$isBackgroundImag === void 0 ? false : _ref$isBackgroundImag,
    _ref$isImageFilled = _ref.isImageFilled,
    isImageFilled = _ref$isImageFilled === void 0 ? false : _ref$isImageFilled;
  var appendKey = isBackgroundImage ? 'backgroundName' : 'appendedText';
  var imageBreakpointSize = isImageFilled ? ImageFillBreakpointSizes : ImageBreakpointSizes;
  var imageSizeType = ImageSizeTypes.find(function (imgSizeType) {
    return imageBreakpointSize[imgSizeType].width >= width || imageBreakpointSize[imgSizeType].height >= height;
  }) || ORIGINAL;
  return "".concat(imgSrc).concat(imageBreakpointSize[imageSizeType][appendKey]);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/elements/image/generateImageElementFilters.ts
/**
 * Returns formatted filter properties for image element
 *
 * @param filterProps
 * @param zoom
 * @return object
 */
/* harmony default export */ var generateImageElementFilters = (function (filterProps, zoom) {
  return {
    vignette: filterProps.vignette,
    blur: filterProps.blur * zoom,
    hueRotate: filterProps['hue-rotate'],
    contrast: filterProps.contrast,
    saturate: filterProps.saturate,
    sepia: filterProps.sepia,
    brightness: filterProps.brightness
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/elements/image/generateImageElementShadow.ts
/**
 * Returns formatted shadow properties for image element
 *
 * @param shadowProps
 * @param zoom
 * @return object
 */
/* harmony default export */ var generateImageElementShadow = (function (shadowProps) {
  var zoom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  return {
    shadow: !!shadowProps,
    shadowR: shadowProps.r,
    shadowG: shadowProps.g,
    shadowB: shadowProps.b,
    shadowA: shadowProps.a,
    offsetX: Math.round(shadowProps.x * zoom),
    offsetY: Math.round(shadowProps.y * zoom),
    shadowBlur: Math.round(shadowProps.blur * zoom)
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/elements/image/generateImageElementBorder.ts
/**
 * Returns formatted border properties for image element
 *
 * @param borderProps
 * @param zoom
 * @return object
 */
/* harmony default export */ var generateImageElementBorder = (function (borderProps, zoom) {
  return {
    borderWidth: borderProps.width ? Math.max(Math.round(borderProps.width * zoom), 1) : 0,
    borderColor: borderProps.color
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/elements/image/generateImageElementCrop.ts
/**
 * Returns formatted crop properties for image element
 *
 * @param cropProps
 * @param width
 * @param height
 * @return object
 */
/* harmony default export */ var generateImageElementCrop = (function (cropProps, width, height) {
  // We calculate the original image width and height (currently width and height have the cropped sizes)
  var originalImageWidth = width / cropProps.proportions.width;
  var originalImageHeight = height / cropProps.proportions.height;
  return {
    cropData: {
      cropWidth: width,
      cropHeight: height,
      cropTop: -(cropProps.proportions.top * originalImageHeight),
      cropLeft: -(cropProps.proportions.left * originalImageWidth)
    },
    width: originalImageWidth,
    height: originalImageHeight
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/resources/getImageResourcePath.ts

function getImageResourcePath_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function getImageResourcePath_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? getImageResourcePath_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : getImageResourcePath_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }




/**
 * Return resource url
 * @param accountId
 * @param imageProps
 * @return string
 */

/* harmony default export */ var getImageResourcePath = (function (accountId, imageProps) {
  var resourcePaths = getResourceConfig();
  var mediaProps = getImageResourcePath_objectSpread({
    accountId: accountId
  }, imageProps);
  return getMediaPath(resourcePaths, mediaProps, resourceFolders_ResourceType.IMAGE);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PagePreloader/hooks/useSetPageLoader.ts





/**
 * Return read atom for page loader
 * @param pageId
 * @param elementType
 * @param key
 * @return function
 */
/* harmony default export */ var useSetPageLoader = (function (pageId, elementType, key) {
  return react_useSetAtom(index_modern_r(pageLoadingTaskAtom, (0,react.useCallback)(function (optic) {
    return optic.path("".concat(pageId, ".").concat(elementType, ".").concat(key));
  }, [])));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/ImageElement.tsx


function ImageElement_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function ImageElement_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ImageElement_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ImageElement_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }













var ImageElement = function ImageElement(_ref) {
  var src = _ref.src,
    subType = _ref.subType,
    provider = _ref.provider,
    alpha = _ref.alpha,
    borderRadius = _ref.radius,
    border = _ref.border,
    filters = _ref.filter,
    cropDataProportions = _ref.cropData,
    pageItemHash = _ref.pageItemHash,
    zoom = _ref.zoom,
    imageScale = _ref.imageScale,
    pageId = _ref.pageId,
    format = _ref.format,
    width = _ref.width,
    height = _ref.height,
    productFeedProperty = _ref.productFeedProperty;
  var _useAtom = react_useAtom(rootPrimitivesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    downloadMode = _useAtom2[0].downloadMode;
  var cropData = {};
  var imageWidth = width;
  var imageHeight = height;
  var _ref2 = filters || {},
    shadowProps = _ref2.shadow;
  var filtersData = filters ? generateImageElementFilters(filters, zoom) : {};
  var shadowData = shadowProps ? generateImageElementShadow(shadowProps, zoom) : {};
  var roundedBorderData = border ? generateImageElementBorder(border, zoom) : {};
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    accountId = _useAtom4[0].link.accountId;
  var setCountImages = useSetPageLoader(pageId, ElementsTypeEnum.IMAGES, KeyEnum.NUMBER_OF_ELEMENTS);
  var setCountImagesLoaded = useSetPageLoader(pageId, ElementsTypeEnum.IMAGES, KeyEnum.NUMBER_OF_LOADED_ELEMENTS);

  // For automation image there will not be a crop container
  if (!productFeedProperty && cropDataProportions !== null && cropDataProportions !== void 0 && cropDataProportions.proportions) {
    var cropDataAndSizes = generateImageElementCrop(cropDataProportions, width, height);
    cropData = cropDataAndSizes.cropData;
    imageWidth = cropDataAndSizes.width;
    imageHeight = cropDataAndSizes.height;
  }
  var originalSrc = getImageResourcePath(accountId, {
    src: src,
    provider: provider,
    subType: subType,
    pageItemHash: pageItemHash
  });
  var getImageSrc = function getImageSrc() {
    // If is downloadMode we use the original image
    if (downloadMode && originalSrc) {
      return format ? "".concat(originalSrc, ".").concat(format) : "".concat(originalSrc, ".jpg");
    }
    if (subType !== MediaSubtypes.STOCK && !oneSizeProviders.has(provider) && !oneSizeImageFormats.has(format)) {
      return getImageAppendedSrc({
        width: imageWidth,
        height: imageHeight,
        imgSrc: originalSrc,
        isBackgroundImage: !!(subType && subType === MediaSubtypes.CONVERT_BACKGROUND)
      });
    }
    return originalSrc;
  };
  var imgSrc = getImageSrc();
  var countImages = function countImages() {
    setCountImages(function (prevCount) {
      return prevCount + 1;
    });
  };
  var countImagesLoaded = function countImagesLoaded() {
    setCountImagesLoaded(function (prevCount) {
      return prevCount + 1;
    });
  };
  return (0,react.useMemo)(function () {
    return src ? /*#__PURE__*/react.createElement(src_Image, {
      width: imageWidth,
      height: imageHeight,
      opacity: alpha,
      src: imgSrc,
      fallbackSrc: originalSrc,
      filtersData: filtersData,
      cropData: cropData,
      shadowData: shadowData,
      roundedBorderData: ImageElement_objectSpread(ImageElement_objectSpread({}, roundedBorderData), {}, {
        borderRadius: borderRadius
      }),
      imageScale: imageScale,
      countImages: countImages,
      countImagesLoaded: countImagesLoaded,
      hideCropContainer: !!productFeedProperty
    }) : null;
  }, [imageWidth, imageHeight, imgSrc, originalSrc, downloadMode, alpha]);
};
/* harmony default export */ var Elements_ImageElement = (ImageElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/getMaskData.ts
/**
 * Returns the inner svg and viewBox for a maskElement
 *
 * @param {string} svgString
 *
 * @return {string, string}
 */
/* harmony default export */ var getMaskData = (function (svgString) {
  var svg = document.createElement('svg');
  svg.innerHTML = svgString;
  if (svg.firstChild) {
    var _svg$firstChild, _svg$firstChild2;
    var viewBox = (_svg$firstChild = svg.firstChild) === null || _svg$firstChild === void 0 ? void 0 : _svg$firstChild.getAttribute('viewBox');
    var svgPath = (_svg$firstChild2 = svg.firstChild) === null || _svg$firstChild2 === void 0 ? void 0 : _svg$firstChild2.innerHTML;
    return {
      viewBox: viewBox,
      svgPath: svgPath
    };
  }
  return {
    svgPath: '',
    viewBox: ''
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/ImageMaskExportElement.tsx















var ImageMaskExportElement = function ImageMaskExportElement(_ref) {
  var src = _ref.src,
    subType = _ref.subType,
    provider = _ref.provider,
    width = _ref.width,
    height = _ref.height,
    shape = _ref.shape,
    stageIndex = _ref.stageIndex,
    alpha = _ref.alpha,
    id = _ref.id,
    _ref$imageBounds = _ref.imageBounds,
    imageHeight = _ref$imageBounds.imageHeight,
    imageWidth = _ref$imageBounds.imageWidth,
    zoom = _ref.zoom,
    _ref$scale = _ref.scale,
    scale = _ref$scale === void 0 ? FILL : _ref$scale;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    accountId = _useAtom2[0].link.accountId;
  var _useAtom3 = react_useAtom(rootPrimitivesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    downloadMode = _useAtom4[0].downloadMode;
  var path = useResourcePath(resourceFolders_ResourceType.SHAPE, {
    resourceName: "".concat(shape)
  });
  var _useState = (0,react.useState)({
      viewBox: '',
      svgPath: ''
    }),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    maskData = _useState2[0],
    setMaskData = _useState2[1];
  var _useState3 = (0,react.useState)(0),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    renderCount = _useState4[0],
    setRenderCount = _useState4[1];
  var url = getImageResourcePath(accountId, {
    src: src,
    provider: provider,
    subType: subType
  });
  if (downloadMode) {
    url += '.jpg';
  }
  var formatAndSetMaskData = function formatAndSetMaskData(response) {
    var svgString = response.trim();
    if (svgString) {
      setMaskData(getMaskData(svgString));
    }
  };
  (0,react.useEffect)(function () {
    utils_fetchApi(path).then(function (response) {
      return response.text();
    }).then(function (response) {
      return formatAndSetMaskData(response);
    });
  }, [path, zoom]);

  // Generate shapes props object
  var shapeProps = {
    shapeId: "".concat(stageIndex, "-").concat(shape, "-").concat(id),
    patternWidth: imageWidth * zoom,
    patternHeight: imageHeight * zoom,
    patternId: id
  };
  (0,react.useEffect)(function () {
    var handleFlipEffectDone = function handleFlipEffectDone() {
      setRenderCount(function (previousValue) {
        return previousValue + 1;
      });
    };
    if (main/* isIOS */.un || main/* isSafari */.nr) {
      // Need to re-render svg elements on safari
      document.addEventListener(TRANSITION_EFFECT_DONE, handleFlipEffectDone);
    }
    return function () {
      if (main/* isIOS */.un || main/* isSafari */.nr) {
        document.removeEventListener(TRANSITION_EFFECT_DONE, handleFlipEffectDone);
      }
    };
  }, []);
  var getImageSrc = function getImageSrc() {
    if (subType !== MediaSubtypes.STOCK && !oneSizeProviders.has(provider) && !downloadMode) {
      return getImageAppendedSrc({
        width: width,
        height: height,
        imgSrc: url,
        isBackgroundImage: false
      });
    }
    return url;
  };
  var imageSrc = getImageSrc();
  if (maskData && maskData.viewBox && maskData.svgPath) {
    return /*#__PURE__*/react.createElement(exportImageMask, {
      url: imageSrc,
      alpha: alpha,
      containerWidth: width,
      containerHeight: height,
      shapeProps: shapeProps,
      renderCount: renderCount,
      viewBox: maskData.viewBox,
      svgPath: maskData.svgPath,
      fallbackSrc: url,
      objectFit: OBJECT_FIT[scale]
    });
  }
  return null;
};
ImageMaskExportElement.propTypes = {
  src: (prop_types_default()).string.isRequired,
  provider: (prop_types_default()).string.isRequired,
  subType: (prop_types_default()).string.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  shape: (prop_types_default()).number.isRequired,
  stageIndex: (prop_types_default()).number.isRequired,
  zoom: (prop_types_default()).number.isRequired
};
/* harmony default export */ var Elements_ImageMaskExportElement = (ImageMaskExportElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/TagElement.tsx

function TagElement_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function TagElement_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? TagElement_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : TagElement_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }








// Use this is instead of: import * as Icon from '@flipsnack-ui/content-icons'
var TagElement_Icon = __webpack_require__(9854);
var TagElement = function TagElement(props) {
  var elementProps = ElementDefaults[props.type].icon;
  var IconComponent = TagElement_Icon[elementProps];
  var interactiveElement = isInteractiveElement(props.type, props.isDownloadPDF);
  var animationStyle = generateInteractiveAnimation({
    type: props.type,
    alpha: props.alpha,
    id: props.id,
    color: props.color
  }, props.isStageActive, props.animatedInteractions, props.effect);
  var roundedElements = getRoundedInteractiveElementBorder(props.type);
  var isPulsating = typeof props.pulsating === 'boolean' ? props.pulsating : true;
  return /*#__PURE__*/react.createElement(ElementWrapper, {
    animationStyle: animationStyle,
    hover: props.mouseOver,
    style: TagElement_objectSpread({}, roundedElements)
  }, /*#__PURE__*/react.createElement(src_PulsatingIcon, {
    isPulsating: isPulsating,
    width: props.width,
    height: props.height,
    alpha: interactiveElement ? undefined : props.alpha
  }, /*#__PURE__*/react.createElement(IconComponent, {
    fill: props.color
  })));
};
/* harmony default export */ var Elements_TagElement = (/*#__PURE__*/react.memo(TagElement));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/EmbedElement.tsx









var EmbedElement = function EmbedElement(props) {
  var content = props.content,
    width = props.width,
    height = props.height,
    stageIndex = props.stageIndex,
    media = props.media;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var isOnActiveStage = settledStageIndex === stageIndex;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    accountId = _useAtom2[0].link.accountId;
  var _useAtom3 = react_useAtom(rootPrimitivesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    downloadMode = _useAtom4[0].downloadMode;
  var getEmbed = function getEmbed() {
    var src = '';
    if (media !== undefined && media.length > 0) {
      src = getImageResourcePath(accountId, {
        src: media[0].hash
      });
      if (downloadMode) {
        src += '.jpg';
      }
    }
    if (false) {}
    return /*#__PURE__*/react.createElement(src_Embed, {
      embedWidth: width,
      embedHeight: height,
      embedCode: isOnActiveStage ? content : '',
      embedCover: src
    });
  };
  return /*#__PURE__*/react.createElement(IframeContainer, {
    $width: "".concat(width, "px"),
    $height: "".concat(height, "px"),
    $isEmpty: true
  }, getEmbed());
};
EmbedElement.propTypes = {
  content: (prop_types_default()).string.isRequired,
  height: (prop_types_default()).number.isRequired,
  width: (prop_types_default()).number.isRequired
};
/* harmony default export */ var Elements_EmbedElement = (EmbedElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/svgToSymbol.ts
/**
 * Returns svg symbol
 *
 * @param {string} svg
 * @param {number} shapeId
 * @param {number} stageIndex
 * @returns {string}
 */
/* harmony default export */ var svgToSymbol = (function (svg, shapeId, stageIndex) {
  var svgString = svg.trim();
  return "<symbol".concat(svgString.substr(svgString.indexOf('svg') + 3, svgString.lastIndexOf('svg') - 4), "symbol>").replace("icon-".concat(shapeId), "icon-".concat(stageIndex, "-").concat(shapeId));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getAttributeValue.ts
/**
 * Returns the attribute value from html string
 *
 * @param string
 * @param attribute
 * @return string
 */
/* harmony default export */ var getAttributeValue = (function (string, attribute) {
  var expression = new RegExp("".concat(attribute, "=\"([A-Za-z0-9 _.-]*)\""));
  var match = string.match(expression);
  return match && match[1] || '';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useShapesLoader.ts











/**
 * Custom hook that loads the requested shape and inject it into the page if it is not already loaded. The return is
 * not relevant.
 *
 * @param shapeId
 * @param stageIndex
 * @param setPattern
 * @param setWidth
 * @param setHeight
 * @returns null
 */
var useShapesLoader = function useShapesLoader(shapeId, stageIndex) {
  var _shapesData$shapeDefi2;
  var setPattern = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
  var setWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {};
  var setHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function () {};
  var shapesData = (0,react.useContext)(contexts_ShapesContext);
  var _useAtom = react_useAtom(rootPrimitivesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    downloadMode = _useAtom2[0].downloadMode;
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    hash = _useAtom4[0].hash;
  var path = useResourcePath(resourceFolders_ResourceType.SHAPE, {
    resourceName: "".concat(shapeId)
  });

  // Inject svg into the dom
  var loadSvg = function loadSvg(svgSymbol) {
    var _shapesData$shapeDefi;
    var dataPatternValue = parseInt(getAttributeValue(svgSymbol, 'data-pattern'), 10);

    // Get pattern shape sizes from viewBox and set the values on the shape state
    if (dataPatternValue) {
      var viewBox = getAttributeValue(svgSymbol, 'viewBox').split(' ');
      setPattern(true);
      setWidth(viewBox ? parseInt(viewBox[2], 10) || 0 : 0);
      setHeight(viewBox ? parseInt(viewBox[3], 10) || 0 : 0);
    }

    // Add the svg to the defs
    (shapesData === null || shapesData === void 0 || (_shapesData$shapeDefi = shapesData.shapeDefinitionsRef) === null || _shapesData$shapeDefi === void 0 ? void 0 : _shapesData$shapeDefi.current) && (shapesData.shapeDefinitionsRef.current.innerHTML += svgSymbol);
  };
  if (shapesData !== null && shapesData !== void 0 && (_shapesData$shapeDefi2 = shapesData.shapeDefinitionsRef) !== null && _shapesData$shapeDefi2 !== void 0 && _shapesData$shapeDefi2.current) {
    var _shapesData$loadedSha;
    if (shapesData !== null && shapesData !== void 0 && (_shapesData$loadedSha = shapesData.loadedShapes) !== null && _shapesData$loadedSha !== void 0 && _shapesData$loadedSha.current && !(shapesData !== null && shapesData !== void 0 && shapesData.loadedShapes.current["".concat(stageIndex, "-").concat(shapeId)])) {
      // Set the shape id into the loaded shape object so it will not be unnecessary loaded again
      shapesData.setLoadedShapes("".concat(stageIndex, "-").concat(shapeId));
      var svgSymbol = '';
      if (downloadMode) {
        // TODO: Try to read shapes without flipbook hash reference
        var shapes = typeof window["shapes_".concat(hash)] === 'function' && window["shapes_".concat(hash)]();
        svgSymbol = svgToSymbol(shapes[shapeId], shapeId, stageIndex);
        loadSvg(svgSymbol);
      } else {
        utils_fetchApi(path).then(function (response) {
          return response.text();
        }).then(function (response) {
          svgSymbol = svgToSymbol(response, shapeId, stageIndex);
          loadSvg(svgSymbol);
        });
      }
    }
  }
  return null;
};
/* harmony default export */ var hooks_useShapesLoader = (useShapesLoader);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/ShapeElement.tsx





var ShapeElement = function ShapeElement(props) {
  var _ref = props.filter || {},
    shadowProps = _ref.shadow;
  var shadowData = shadowProps ? generateImageElementShadow(shadowProps) : {};
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    pattern = _useState2[0],
    setPattern = _useState2[1];
  var _useState3 = (0,react.useState)(0),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    width = _useState4[0],
    setWidth = _useState4[1];
  var _useState5 = (0,react.useState)(0),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    height = _useState6[0],
    setHeight = _useState6[1];
  hooks_useShapesLoader(props.shape, props.stageIndex, setPattern, setWidth, setHeight);
  var shapeProps = {
    shapeId: "".concat(props.stageIndex, "-").concat(props.shape),
    shapeColor: props.color,
    shapeOpacity: props.alpha,
    shapeBorderRadius: props.radius,
    shapeWidth: width,
    shapeHeight: height
  };
  return /*#__PURE__*/react.createElement(ShapesAndPatterns, {
    hasLinePattern: pattern,
    containerWidth: props.width,
    containerHeight: props.height,
    shapeProps: shapeProps,
    shadowProps: shadowData,
    id: props.id
  });
};
/* harmony default export */ var Elements_ShapeElement = (ShapeElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/FontsContext.ts

var fontContextDefault = {
  addFonts: function addFonts() {},
  fontList: []
};
var FontsContext = /*#__PURE__*/react.createContext(fontContextDefault);
var FontsProvider = FontsContext.Provider;
/* harmony default export */ var contexts_FontsContext = (FontsContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/fonts/loadFont.ts
/**
 * Load specified font in DOM
 * @param fontFamily
 * @param fontUrl
 * @param onLoading
 * @param onLoadingDone
 * @return {void}
 */
/* harmony default export */ var loadFont = (function (fontFamily, fontUrl, onLoadingDone) {
  var font = new FontFace(fontFamily, "url(".concat(fontUrl, ")"));
  font.load().then(function (loadedFont) {
    document.fonts.add(loadedFont);
    onLoadingDone();
  }).catch(function () {
    onLoadingDone();
    // Nothing to do - show default browser font
  });
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useFontsLoader.ts







/**
 * Handle and load fonts
 * @param fontsList
 * @param onLoading
 * @param onLoadingDone
 */
var useFontsLoader = function useFontsLoader(fontsList, onLoading, onLoadingDone) {
  var fontsData = (0,react.useContext)(contexts_FontsContext);
  var fontsToLoad = new Map();
  for (var i = 0; i < fontsList.length; i++) {
    var font = fontsList[i];
    var fontResourceData = {
      family: font.family,
      isOrganizationFont: false
    };
    if ('location' in font) {
      fontResourceData.location = font.location;
      fontResourceData.isOrganizationFont = !!font.locationHash;
    } else {
      fontResourceData.source = font.source;
      fontResourceData.isOrganizationFont = font.isSuperUser || false;
    }

    // TODO find a better solution for this
    // eslint-disable-next-line react-hooks/rules-of-hooks
    var fontUrl = useResourcePath(resourceFolders_ResourceType.FONT, fontResourceData);
    if (!fontsToLoad.has(font.family) && fontsData.fontList.indexOf(font.family) === -1) {
      fontsToLoad.set(font.family, {
        fontFamily: font.family,
        fontUrl: fontUrl
      });
    }
  }
  (0,react.useEffect)(function () {
    fontsToLoad.forEach(function (font) {
      onLoading();
      loadFont(font.fontFamily, font.fontUrl, onLoadingDone);
    });
    fontsToLoad.size && fontsData.addFonts(toConsumableArray_toConsumableArray(fontsToLoad.keys()));
  }, []);
};
/* harmony default export */ var hooks_useFontsLoader = (useFontsLoader);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/TableElement.tsx

function TableElement_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function TableElement_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? TableElement_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : TableElement_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }







var TableContainer = styled_components_browser_esm.div.withConfig({
  displayName: "TableElement__TableContainer",
  componentId: "sc-15c8fu2-0"
})(["width:", "px;height:", "px;"], function (props) {
  return props.width;
}, function (props) {
  return props.height;
});
var TableElement = function TableElement(props) {
  var setCountFonts = useSetPageLoader(props.pageId, ElementsTypeEnum.FONTS, KeyEnum.NUMBER_OF_ELEMENTS);
  var setCountFontsLoaded = useSetPageLoader(props.pageId, ElementsTypeEnum.FONTS, KeyEnum.NUMBER_OF_LOADED_ELEMENTS);

  // fontsToLoad must run only once when component mounts
  var fontsToLoad = (0,react.useMemo)(function () {
    return Object.keys(props.fontsList || {}).reduce(function (acc, fontHash) {
      if ('location' in props.fontsList[fontHash]) {
        acc.push(TableElement_objectSpread({
          family: fontHash,
          location: props.fontsList[fontHash].location,
          pageItemHash: props.pageItemHash
        }, 'locationHash' in props.fontsList[fontHash] ? {
          locationHash: props.fontsList[fontHash].locationHash
        } : {}));
      } else {
        acc.push({
          family: fontHash,
          isSuperUser: props.fontsList[fontHash].isSuperUser,
          source: props.fontsList[fontHash].source,
          pageItemHash: props.pageItemHash
        });
      }
      return acc;
    }, []);
  }, []);
  var onLoading = function onLoading() {
    return setCountFonts(function (prev) {
      return prev + 1;
    });
  };
  var onLoadingDone = function onLoadingDone() {
    return setCountFontsLoaded(function (prev) {
      return prev + 1;
    });
  };
  hooks_useFontsLoader(fontsToLoad, onLoading, onLoadingDone);
  return /*#__PURE__*/react.createElement(TableContainer, {
    width: props.width,
    height: props.height
  }, /*#__PURE__*/react.createElement(Table_TableView, {
    id: props.id,
    zoom: props.zoom,
    tableRows: JSON.stringify(props.rows),
    scale: props.zoom,
    alpha: props.alpha
  }));
};
TableElement.propTypes = {
  rows: prop_types_default().arrayOf(prop_types_default().arrayOf(prop_types_default().shape({
    background: (prop_types_default()).string.isRequired,
    border: prop_types_default().shape({}).isRequired,
    colspan: (prop_types_default()).number.isRequired,
    elements: prop_types_default().arrayOf(prop_types_default().shape({
      textStyle: prop_types_default().shape({
        width: (prop_types_default()).number.isRequired,
        height: (prop_types_default()).number.isRequired,
        textAlign: (prop_types_default()).string.isRequired
      }).isRequired,
      nodes: prop_types_default().arrayOf(prop_types_default().shape({
        text: (prop_types_default()).string.isRequired,
        tag: (prop_types_default()).string.isRequired,
        style: prop_types_default().shape({}).isRequired
      }).isRequired).isRequired
    }).isRequired).isRequired,
    height: (prop_types_default()).number.isRequired,
    width: (prop_types_default()).number.isRequired
  }).isRequired).isRequired).isRequired,
  id: (prop_types_default()).number.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  zoom: (prop_types_default()).number.isRequired,
  pageItemHash: (prop_types_default()).string.isRequired
};
/* harmony default export */ var Elements_TableElement = (TableElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/TextBoxElement.tsx

function TextBoxElement_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function TextBoxElement_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? TextBoxElement_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : TextBoxElement_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





var TextBoxElement = function TextBoxElement(props) {
  var fontsToLoad = [];
  var setCountFonts = useSetPageLoader(props.pageId, ElementsTypeEnum.FONTS, KeyEnum.NUMBER_OF_ELEMENTS);
  var setCountFontsLoaded = useSetPageLoader(props.pageId, ElementsTypeEnum.FONTS, KeyEnum.NUMBER_OF_LOADED_ELEMENTS);
  props.nodes.forEach(function (node) {
    var _node$style;
    if (node !== null && node !== void 0 && (_node$style = node.style) !== null && _node$style !== void 0 && _node$style.font) {
      fontsToLoad.push(TextBoxElement_objectSpread({}, node.style.font));
    }
  });
  var onLoading = function onLoading() {
    return setCountFonts(function (prev) {
      return prev + 1;
    });
  };
  var onLoadingDone = function onLoadingDone() {
    return setCountFontsLoaded(function (prev) {
      return prev + 1;
    });
  };
  hooks_useFontsLoader(fontsToLoad, onLoading, onLoadingDone);

  // Prevent zoom to be 0
  var zoom = props.zoom || 1;
  var nodes = props.isPagination ? [{
    text: props.pageNumber,
    tag: props.nodes[0].tag,
    style: props.nodes[0].style
  }] : props.nodes;
  return (0,react.useMemo)(function () {
    return /*#__PURE__*/react.createElement(src_TextBoxView, {
      disabled: true,
      editable: false,
      nodes: JSON.stringify(nodes),
      textStyle: {
        textAlign: props.textAlign,
        textWrap: props.textWrap,
        width: "".concat(props.width / zoom),
        height: "".concat(props.height / zoom),
        lineHeight: props.lineHeight,
        letterSpacing: props.letterSpacing
      },
      direction: props.direction,
      zoom: zoom
    });
  }, [props.textAlign, props.textWrap, props.width, props.height, props.lineHeight, props.letterSpacing, zoom, props.pageNumber]);
};
/* harmony default export */ var Elements_TextBoxElement = (TextBoxElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/VideoElement.tsx







// Use this is instead of: import * as Icon from '@flipsnack-ui/content-icons'
var VideoElement_Icon = __webpack_require__(9854);
var VideoElement = function VideoElement(props) {
  // @ts-ignore
  var IconComponent = VideoElement_Icon[ElementDefaults[props.type].icon];
  var interactiveElement = isInteractiveElement(props.type, props.isDownloadPDF);
  var animationStyle = generateInteractiveAnimation({
    type: props.type,
    alpha: props.alpha,
    id: props.id,
    color: props.color
  }, props.isStageActive, props.animatedInteractions, props.effect);
  return /*#__PURE__*/react.createElement(ElementWrapper, {
    animationStyle: animationStyle,
    hover: props.mouseOver
  }, /*#__PURE__*/react.createElement(src_IconButton, {
    bgColor: props.color,
    alpha: interactiveElement ? undefined : props.alpha,
    width: props.width,
    height: props.height,
    icon: /*#__PURE__*/react.createElement(IconComponent, {
      fill: "#fff"
    })
  }));
};
/* harmony default export */ var Elements_VideoElement = (/*#__PURE__*/react.memo(VideoElement));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/video.ts
var VideoProvider = {
  YOUTUBE: 'youtube',
  VIMEO: 'vimeo',
  PIXABAY: 'pixabay',
  PEXELS: 'pexels',
  LIBRARY: 'upload',
  OTHER: 'other'
};
var DefaultVideoOptions = {
  controls: true,
  autoplay: false,
  muted: false,
  loop: false
};
var VimeoIframe = {
  URL: 'https://player.vimeo.com/video/',
  PARAMS: '?api=1&player_id=fs_videoPlayerIframe_'
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/parseVideoParams.ts


function parseVideoParams_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function parseVideoParams_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? parseVideoParams_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : parseVideoParams_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

/* harmony default export */ var parseVideoParams = (function (src) {
  var _src$split = src.split('?'),
    _src$split2 = slicedToArray_slicedToArray(_src$split, 2),
    url = _src$split2[0],
    params = _src$split2[1];
  var videoOptions = parseVideoParams_objectSpread({}, DefaultVideoOptions);
  if (params && params.length) {
    params.split('&').forEach(function (param) {
      var query = param.split('=');
      videoOptions[query[0]] = !!+query[1];
    });
  }
  return {
    url: url,
    videoOptions: videoOptions
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getUrlParam.ts
/* harmony default export */ var getUrlParam = (function (param) {
  if (param && parseInt(param, 10) === 1) {
    return 1;
  }
  return 0;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/parseYoutubeLink.ts



function getYoutubeHash(url) {
  var regex = /(youtu.*be.*)\/(watch\?v=|embed\/|v|shorts|)(.*?((?=[&#?])|$))/gm;
  var match = regex.exec(url);
  if (match != null && match[3].length) {
    return match[3];
  }
  return '';
}
/* harmony default export */ var parseYoutubeLink = (function (youtubeLink) {
  var _youtubeLink$split = youtubeLink.split('?'),
    _youtubeLink$split2 = slicedToArray_slicedToArray(_youtubeLink$split, 2),
    params = _youtubeLink$split2[1];
  if (params) {
    var urlParams = new URLSearchParams(params);
    var videoId = getYoutubeHash(youtubeLink);
    return {
      videoUrl: videoId,
      videoPoster: '',
      options: {
        controls: getUrlParam(urlParams.get('controls')),
        autoplay: getUrlParam(urlParams.get('autoplay')),
        mute: getUrlParam(urlParams.get('mute')),
        loop: getUrlParam(urlParams.get('loop')),
        rel: getUrlParam(urlParams.get('rel')),
        start: urlParams.get('start') || '0'
      }
    };
  }

  // TODO: Refactor TagVideoModal for youtube, too many if's === spaghetti code
  if (typeof params === 'undefined' && youtubeLink.length) {
    var shortUrl = new URL(youtubeLink);
    var _videoId = shortUrl.pathname.substr(1, shortUrl.pathname.length);
    return {
      videoUrl: _videoId || '',
      videoPoster: '',
      options: {
        controls: optionValues.true,
        autoplay: optionValues.false,
        mute: optionValues.false,
        loop: optionValues.false,
        rel: optionValues.false,
        start: '0'
      }
    };
  }
  return {
    videoUrl: '',
    videoPoster: '',
    options: {
      controls: optionValues.true,
      autoplay: optionValues.false,
      mute: optionValues.false,
      loop: optionValues.false,
      rel: optionValues.false,
      start: '0'
    }
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/parseVimeoUrl.ts

function parseVimeoUrl_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = parseVimeoUrl_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
function parseVimeoUrl_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return parseVimeoUrl_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? parseVimeoUrl_arrayLikeToArray(r, a) : void 0; } }
function parseVimeoUrl_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }


/**
 * Parses Vimeo URL and retrieves the ID
 * (copy-paste from editor, and yes, it works)
 * @param {string} link
 * @returns {object} Vimeo video ID + private Hash
 */
var getVimeoHash = function getVimeoHash(link) {
  var matches = link.matchAll(/\/([0-9]+?)(?:\/|\?|#|$)(?:([a-z0-9]+?)(?:\?|\/|#|$)|)/gi);
  var hash = '';
  var privateHash = '';
  var _iterator = parseVimeoUrl_createForOfIteratorHelper(matches),
    _step;
  try {
    for (_iterator.s(); !(_step = _iterator.n()).done;) {
      var match = _step.value;
      if (match[1]) {
        // eslint-disable-next-line prefer-destructuring
        hash = match[1];
      }
      if (match[2]) {
        // eslint-disable-next-line prefer-destructuring
        privateHash = match[2];
      }
    }
  } catch (err) {
    _iterator.e(err);
  } finally {
    _iterator.f();
  }
  return {
    hash: hash,
    privateHash: privateHash
  };
};

/**
 * Returns the vimeo video ID and its parameters
 * @param {string} vimeoLink
 * @returns {object}
 */
/* harmony default export */ var parseVimeoUrl = (function (vimeoLink) {
  var _getVimeoHash = getVimeoHash(vimeoLink),
    _getVimeoHash$hash = _getVimeoHash.hash,
    hash = _getVimeoHash$hash === void 0 ? '' : _getVimeoHash$hash,
    _getVimeoHash$private = _getVimeoHash.privateHash,
    privateHash = _getVimeoHash$private === void 0 ? '' : _getVimeoHash$private;
  var _vimeoLink$split = vimeoLink.split('?'),
    _vimeoLink$split2 = slicedToArray_slicedToArray(_vimeoLink$split, 2),
    params = _vimeoLink$split2[1];
  if (params) {
    var shortUrl = new URL(vimeoLink);
    var searchParams = shortUrl.searchParams;
    return {
      videoUrl: hash,
      privateHash: privateHash,
      videoPoster: '',
      options: {
        autoplay: getUrlParam(searchParams.get('autoplay')),
        muted: getUrlParam(searchParams.get('muted')),
        loop: getUrlParam(searchParams.get('loop')),
        controls: searchParams.has('controls') ? getUrlParam(searchParams.get('controls')) : 1
      }
    };
  }
  return {
    videoUrl: hash,
    privateHash: privateHash,
    videoPoster: '',
    options: {
      autoplay: optionValues.false,
      muted: optionValues.false,
      loop: optionValues.false,
      controls: optionValues.true
    }
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/generateVideoInfo.ts

function generateVideoInfo_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function generateVideoInfo_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? generateVideoInfo_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : generateVideoInfo_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }




var optionValues = /*#__PURE__*/function (optionValues) {
  optionValues[optionValues["false"] = 0] = "false";
  optionValues[optionValues["true"] = 1] = "true";
  return optionValues;
}({});
/* harmony default export */ var generateVideoInfo = (function (_ref) {
  var _ref$provider = _ref.provider,
    provider = _ref$provider === void 0 ? '' : _ref$provider,
    _ref$ytlink = _ref.ytlink,
    ytlink = _ref$ytlink === void 0 ? '' : _ref$ytlink,
    _ref$src = _ref.src,
    src = _ref$src === void 0 ? '' : _ref$src,
    _ref$cover = _ref.cover,
    cover = _ref$cover === void 0 ? '' : _ref$cover,
    _ref$downloadMode = _ref.downloadMode,
    downloadMode = _ref$downloadMode === void 0 ? false : _ref$downloadMode;
  if ((provider === VideoProvider.PEXELS || provider === VideoProvider.PIXABAY) && src.length) {
    var _parseVideoParams = parseVideoParams(src),
      url = _parseVideoParams.url,
      videoOptions = _parseVideoParams.videoOptions;
    return {
      videoUrl: downloadMode ? "".concat(url, ".mp4") : url,
      videoPoster: downloadMode ? "".concat(cover, ".jpg") : cover,
      options: generateVideoInfo_objectSpread({}, videoOptions)
    };
  }
  if (provider === VideoProvider.YOUTUBE) {
    return parseYoutubeLink(ytlink);
  }
  if (provider === VideoProvider.VIMEO) {
    return parseVimeoUrl(ytlink);
  }
  if (provider === VideoProvider.LIBRARY) {
    if (ytlink.length) {
      var _parseVideoParams2 = parseVideoParams(ytlink),
        _url = _parseVideoParams2.url,
        _videoOptions = _parseVideoParams2.videoOptions;
      return {
        videoUrl: _url,
        videoPoster: '',
        options: generateVideoInfo_objectSpread({}, _videoOptions)
      };
    }
    var _parseVideoParams3 = parseVideoParams(src),
      _url2 = _parseVideoParams3.url,
      _videoOptions2 = _parseVideoParams3.videoOptions;
    return {
      videoUrl: _url2,
      videoPoster: '',
      options: generateVideoInfo_objectSpread({}, _videoOptions2)
    };
  }
  return {
    videoUrl: '',
    videoPoster: '',
    options: generateVideoInfo_objectSpread({}, DefaultVideoOptions)
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getVideoProvider.ts

/* harmony default export */ var getVideoProvider = (function (url, provider) {
  switch (provider) {
    case VideoProvider.PEXELS:
      return VideoProvider.PEXELS;
    case VideoProvider.PIXABAY:
      return VideoProvider.PIXABAY;
    case '':
      // TODO: remove redundant 'typeof' check
      if (url.indexOf('youtube.com/') > -1 || url.indexOf('youtu.be/') > -1) {
        return VideoProvider.YOUTUBE;
      }
      if (typeof url === 'string' && url.indexOf('vimeo.com/') > -1) {
        return VideoProvider.VIMEO;
      }
      return VideoProvider.LIBRARY;
    // TODO: check if necessary otherwise use '' case as default
    default:
      return VideoProvider.OTHER;
  }
});
// EXTERNAL MODULE: ../../modules/widget-player/code/node_modules/react-player/lib/index.js
var react_player_lib = __webpack_require__(6880);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useVideoCoverLoader.ts




/**
 * Custom hook for counting the video covers
 * @param refReactPlayer
 * @param pageId
 */
/* harmony default export */ var useVideoCoverLoader = (function (refReactPlayer, pageId) {
  var setCountVideos = useSetPageLoader(pageId, ElementsTypeEnum.VIDEOS, KeyEnum.NUMBER_OF_ELEMENTS);
  var setCountVideosLoaded = useSetPageLoader(pageId, ElementsTypeEnum.VIDEOS, KeyEnum.NUMBER_OF_LOADED_ELEMENTS);
  (0,react.useEffect)(function () {
    var _refReactPlayer$curre;
    var thumbnail = refReactPlayer === null || refReactPlayer === void 0 || (_refReactPlayer$curre = refReactPlayer.current) === null || _refReactPlayer$curre === void 0 ? void 0 : _refReactPlayer$curre.props.light;
    if (typeof thumbnail === 'string' && thumbnail) {
      setCountVideos(function (prevCount) {
        return prevCount + 1;
      });
      var onLoad = function onLoad() {
        setCountVideosLoaded(function (prevCount) {
          return prevCount + 1;
        });
      };
      var img = new Image();
      img.onload = onLoad;
      img.onerror = onLoad;
      img.src = thumbnail;
    }
  }, []);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/elements/video/getStockAndLibraryVideoParams.ts


/* harmony default export */ var getStockAndLibraryVideoParams = (function (_ref) {
  var provider = _ref.provider,
    providerId = _ref.providerId,
    url = _ref.url,
    src = _ref.src,
    version = _ref.version,
    imageExtension = _ref.imageExtension,
    cover = _ref.cover;
  var isLibraryVideo = provider === VideoProvider.LIBRARY && src !== '';
  var isStockVideo = (provider === VideoProvider.PEXELS || provider === VideoProvider.PIXABAY) && !!providerId;
  var resourceType = '';
  var posterType = '';
  var suffix = '';
  var payload = {};
  if (isLibraryVideo) {
    resourceType = resourceFolders_ResourceType.VIDEO;
    posterType = resourceFolders_ResourceType.IMAGE;
    suffix = cover ? "_".concat(cover).concat(imageExtension, "?v=").concat(version) : "_cover".concat(imageExtension, "?v=").concat(version);
    payload = {
      src: url,
      provider: provider
    };
  }
  if (isStockVideo) {
    resourceType = resourceFolders_ResourceType.STOCK_VIDEO;
    posterType = resourceFolders_ResourceType.STOCK_VIDEO_COVER;
    payload = {
      provider: provider,
      providerId: providerId,
      src: src
    };
    suffix = imageExtension;
  }
  return {
    resourceType: resourceType,
    posterType: posterType,
    suffix: suffix,
    payload: payload
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/VideoWidgetContainer/preview/PreviewDiv.tsx



var PreviewDiv = function PreviewDiv(_ref) {
  var cover = _ref.cover,
    _ref$tooltip = _ref.tooltip,
    tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip,
    _ref$scale = _ref.scale,
    scale = _ref$scale === void 0 ? 'fit' : _ref$scale;
  var backgroundSize = scale === 'fit' ? 'contain' : 'cover';
  return /*#__PURE__*/react.createElement("div", {
    style: {
      width: '100%',
      height: '100%',
      backgroundRepeat: 'no-repeat',
      backgroundPosition: 'center center',
      backgroundSize: backgroundSize,
      cursor: 'pointer',
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'center',
      backgroundImage: "url(\"".concat(cover, "\")")
    },
    tabIndex: TabIndex.DEFAULT,
    "aria-label": tooltip,
    role: "img"
  });
};
PreviewDiv.propTypes = {
  cover: prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).string]).isRequired,
  tooltip: (prop_types_default()).string
};
/* harmony default export */ var preview_PreviewDiv = (PreviewDiv);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/VideoWidgetContainer/CustomPlayIcon.tsx
/* eslint-disable max-len */

var CustomPlayIcon = function CustomPlayIcon() {
  return /*#__PURE__*/react.createElement("div", {
    className: "react-player-custom-play-icon"
  }, /*#__PURE__*/react.createElement("svg", {
    height: "71",
    viewBox: "0 0 72 71",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, /*#__PURE__*/react.createElement("path", {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M.405 35.81C.405 16.537 16.345.914 36.007.914S71.608 16.538 71.608 35.81c0 19.273-15.94 34.896-35.601 34.896C16.345 70.706.405 55.083.405 35.81Zm65.507 0c0-16.189-13.389-29.313-29.905-29.313-16.516 0-29.905 13.124-29.905 29.313 0 16.19 13.389 29.313 29.905 29.313 16.516 0 29.905-13.124 29.905-29.313ZM28.009 49.568l21.554-12.58c.193-.113.356-.269.474-.453.412-.644.2-1.485-.473-1.879L28.01 22.052a1.479 1.479 0 0 0-.746-.2c-.79 0-1.429.611-1.429 1.366v25.184c0 .251.072.498.21.712.41.644 1.29.847 1.964.454Z",
    fill: "#fff"
  }), /*#__PURE__*/react.createElement("path", {
    d: "m49.563 36.988.126.216-.126-.216Zm-21.554 12.58.126.216-.126-.216Zm22.028-13.033.21.134-.21-.134Zm-.473-1.879.126-.216-.126.216ZM28.01 22.052l.126-.215-.126.215Zm-1.966 27.062.211-.134-.21.134ZM36.007.664C16.21.664.155 16.394.155 35.81h.5c0-19.13 15.823-34.646 35.352-34.646v-.5ZM71.858 35.81C71.858 16.395 55.802.664 36.007.664v.5c19.529 0 35.351 15.516 35.351 34.646h.5ZM36.007 70.956c19.795 0 35.851-15.73 35.851-35.146h-.5c0 19.13-15.822 34.646-35.351 34.646v.5ZM.155 35.81c0 19.415 16.056 35.146 35.852 35.146v-.5C16.478 70.456.655 54.94.655 35.81h-.5ZM36.007 6.747c16.383 0 29.655 13.017 29.655 29.063h.5c0-16.332-13.506-29.563-30.155-29.563v.5ZM6.352 35.81c0-16.046 13.272-29.063 29.655-29.063v-.5c-16.65 0-30.155 13.231-30.155 29.563h.5Zm29.655 29.063c-16.383 0-29.655-13.017-29.655-29.063h-.5c0 16.332 13.505 29.563 30.155 29.563v-.5ZM65.662 35.81c0 16.046-13.272 29.063-29.655 29.063v.5c16.65 0 30.155-13.231 30.155-29.563h-.5Zm-16.225.962-21.554 12.58.252.432 21.554-12.58-.252-.432Zm.39-.372a1.15 1.15 0 0 1-.39.372l.252.432a1.65 1.65 0 0 0 .559-.535l-.421-.27Zm-.39-1.528c.556.325.722 1.008.39 1.528l.42.27c.492-.768.234-1.767-.557-2.23l-.252.432ZM27.885 22.268l21.554 12.604.252-.432-21.554-12.603-.252.431Zm-.62-.166c.22 0 .434.058.62.166l.252-.431a1.728 1.728 0 0 0-.872-.235v.5Zm-1.179 1.116c0-.606.517-1.116 1.18-1.116v-.5c-.917 0-1.68.713-1.68 1.616h.5Zm0 25.184V23.218h-.5v25.184h.5Zm.17.578a1.071 1.071 0 0 1-.17-.578h-.5c0 .3.087.593.249.847l.421-.27Zm1.628.372c-.562.328-1.291.155-1.628-.372l-.421.269c.486.76 1.515.994 2.3.535l-.251-.432Z",
    fill: "#000",
    fillOpacity: ".268"
  })));
};
/* harmony default export */ var VideoWidgetContainer_CustomPlayIcon = (CustomPlayIcon);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/VideoWidgetContainer/VideoElementPlayerContainer.styles.ts

var VideoElementPlayerContainer_styles_VideoPlayerElementContainer = styled_components_browser_esm.div.withConfig({
  displayName: "VideoElementPlayerContainerstyles__VideoPlayerElementContainer",
  componentId: "sc-1e1iuxu-0"
})(["width:100%;height:100%;.react-player__preview{background-repeat:no-repeat !important;background-position:center center !important;background-size:contain !important;}.react-player-custom-play-icon{width:16%;position:absolute;display:flex;align-items:center;justify-content:center;}"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/VideoWidgetContainer/VideoElementPlayerContainer.tsx













var VideoPlayerElementContainer = function VideoPlayerElementContainer(_ref) {
  var controls = _ref.controls,
    loop = _ref.loop,
    muted = _ref.muted,
    autoplay = _ref.autoplay,
    src = _ref.src,
    provider = _ref.provider,
    providerId = _ref.providerId,
    url = _ref.url,
    _ref$version = _ref.version,
    version = _ref$version === void 0 ? 0 : _ref$version,
    isOnActiveStage = _ref.isOnActiveStage,
    pageId = _ref.pageId,
    tooltip = _ref.tooltip,
    cover = _ref.cover;
  var _useAtom = react_useAtom(rootPrimitivesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    downloadMode = _useAtom2[0].downloadMode;
  var extension = downloadMode ? '.mp4' : '';
  var imageExtension = downloadMode ? '.jpg' : '';
  var videoRef = (0,react.useRef)();
  var refReactPlayer = (0,react.useRef)(null);
  var _getStockAndLibraryVi = getStockAndLibraryVideoParams({
      provider: provider,
      providerId: providerId,
      url: url,
      src: src,
      version: version,
      imageExtension: imageExtension,
      cover: cover
    }),
    resourceType = _getStockAndLibraryVi.resourceType,
    posterType = _getStockAndLibraryVi.posterType,
    suffix = _getStockAndLibraryVi.suffix,
    payload = _getStockAndLibraryVi.payload;
  var stockVideo = useResourcePath(resourceType, payload);
  var stockPoster = useResourcePath(posterType, payload);

  // For video links in video widget, payload object is empty, hence stockVideo comes as empty string
  // except when is downloaded as HTML5.
  var videoSource = isValidURL(stockVideo) ? "".concat(stockVideo) : "".concat(stockVideo).concat(extension);
  var coverSrc = "".concat(stockPoster).concat(suffix);
  useVideoCoverLoader(refReactPlayer, pageId);
  (0,react.useEffect)(function () {
    if (refReactPlayer !== null && refReactPlayer !== void 0 && refReactPlayer.current && !isOnActiveStage) {
      refReactPlayer.current.showPreview();
    }
  }, [isOnActiveStage]);
  var onReady = function onReady(e) {
    videoRef.current = e.getInternalPlayer();
    if (videoRef !== null && videoRef !== void 0 && videoRef.current && isOnActiveStage) {
      videoRef.current.play();
    }
  };

  // In export mode, we don't want to show the play icon (Pdf, jpg, png)
  var playIcon =  true ? /*#__PURE__*/react.createElement(VideoWidgetContainer_CustomPlayIcon, null) : /*#__PURE__*/0;
  return /*#__PURE__*/react.createElement(VideoElementPlayerContainer_styles_VideoPlayerElementContainer, null, /*#__PURE__*/react.createElement(react_player_lib/* default */.A, {
    width: "100%",
    height: "100%",
    light: autoplay && isOnActiveStage ? false : /*#__PURE__*/react.createElement(preview_PreviewDiv, {
      cover: coverSrc,
      tooltip: tooltip
    }),
    playing: isOnActiveStage ? autoplay : false,
    url: !stockVideo ? url : videoSource,
    muted: muted,
    controls: controls,
    loop: loop,
    playsinline: true,
    onReady: onReady,
    config: {
      file: {
        attributes: {
          controlsList: 'nodownload noremoteplayback'
        }
      }
    },
    previewTabIndex: TabIndex.UNREACHABLE // PreviewDiv has tabindex
    ,
    ref: refReactPlayer,
    playIcon: playIcon
  }));
};
/* harmony default export */ var VideoElementPlayerContainer = (VideoPlayerElementContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/VideoWidgetContainer/VimeoPlayerElement.tsx



function VimeoPlayerElement_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ VimeoPlayerElement_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }







var VimeoPlayerElement = function VimeoPlayerElement(_ref) {
  var videoId = _ref.videoId,
    params = _ref.params,
    title = _ref.title,
    isOnActiveStage = _ref.isOnActiveStage,
    privateHash = _ref.privateHash,
    pageId = _ref.pageId,
    tooltip = _ref.tooltip;
  var videoRef = (0,react.useRef)();
  var refReactPlayer = (0,react.useRef)(null);
  var autoplay = params.autoplay,
    muted = params.muted,
    loop = params.loop,
    controls = params.controls;
  var _useState = (0,react.useState)(''),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    thumbnailUrl = _useState2[0],
    setThumbnailUrl = _useState2[1];
  var vimeoVideoUrl = 'https://vimeo.com/api/v2/video';
  var getVimeoUrl = /*#__PURE__*/function () {
    var _ref2 = asyncToGenerator_asyncToGenerator(/*#__PURE__*/VimeoPlayerElement_regeneratorRuntime().mark(function _callee() {
      var url;
      return VimeoPlayerElement_regeneratorRuntime().wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            url = "".concat(vimeoVideoUrl, "/").concat(videoId, ".json");
            fetch(url).then(function (response) {
              return response.json();
            }).then(function (data) {
              if (data && data.length > 0 && data[0].thumbnail_large) {
                setThumbnailUrl(!autoplay ? data[0].thumbnail_large : false);
              }
            });
          case 2:
          case "end":
            return _context.stop();
        }
      }, _callee);
    }));
    return function getVimeoUrl() {
      return _ref2.apply(this, arguments);
    };
  }();
  useVideoCoverLoader(refReactPlayer, pageId);
  (0,react.useEffect)(function () {
    if (!isOnActiveStage && refReactPlayer !== null && refReactPlayer !== void 0 && refReactPlayer.current) {
      refReactPlayer.current.showPreview();
    }
    getVimeoUrl().catch(null);
  }, [isOnActiveStage]);
  var onReady = function onReady(event) {
    videoRef.current = event.getInternalPlayer();
    if (videoRef !== null && videoRef !== void 0 && videoRef.current && isOnActiveStage) {
      videoRef.current.play();
    }
  };
  return /*#__PURE__*/react.createElement(react_player_lib/* default */.A, {
    width: "100%",
    height: "100%",
    url: "".concat(VimeoIframe.URL).concat(videoId, "/").concat(privateHash),
    light: isOnActiveStage && autoplay ? thumbnailUrl : /*#__PURE__*/react.createElement(preview_PreviewDiv, {
      cover: thumbnailUrl,
      tooltip: tooltip
    }),
    playing: isOnActiveStage ? !!autoplay : false,
    muted: !!muted,
    loop: !!loop,
    playsinline: true,
    controls: !!controls,
    onReady: onReady,
    config: {
      vimeo: {
        title: title
      }
    },
    previewTabIndex: TabIndex.UNREACHABLE // PreviewDiv has tabindex
    ,
    ref: refReactPlayer
  });
};
VimeoPlayerElement.propTypes = {
  videoId: (prop_types_default()).string.isRequired,
  privateHash: (prop_types_default()).string.isRequired,
  params: prop_types_default().shape({
    autoplay: prop_types_default().oneOf([0, 1]).isRequired,
    muted: prop_types_default().oneOf([0, 1]).isRequired,
    loop: prop_types_default().oneOf([0, 1]).isRequired,
    controls: prop_types_default().oneOf([0, 1]).isRequired
  }).isRequired,
  title: (prop_types_default()).string.isRequired,
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  isOnActiveStage: (prop_types_default()).bool,
  tooltip: (prop_types_default()).string
};
/* harmony default export */ var VideoWidgetContainer_VimeoPlayerElement = (VimeoPlayerElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/VideoWidgetContainer/YoutubePlayerElement.tsx


function YoutubePlayerElement_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function YoutubePlayerElement_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? YoutubePlayerElement_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : YoutubePlayerElement_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }




var YoutubePlayerElement = function YoutubePlayerElement(_ref) {
  var videoId = _ref.videoId,
    playerVars = _ref.playerVars,
    isOnActiveStage = _ref.isOnActiveStage,
    pageId = _ref.pageId;
  var rel = playerVars.rel,
    controls = playerVars.controls,
    autoplay = playerVars.autoplay,
    loop = playerVars.loop,
    start = playerVars.start,
    mute = playerVars.mute;
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    isPlaying = _useState2[0],
    setIsPlaying = _useState2[1];
  var _useState3 = (0,react.useState)("https://img.youtube.com/vi_webp/".concat(videoId, "/maxresdefault.webp")),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    videoCoverImgSrc = _useState4[0],
    setVideoCoverImgSrc = _useState4[1];
  var refReactPlayer = (0,react.useRef)(null);
  var src = "https://www.youtube.com/embed/".concat(videoId);
  var playlist = loop ? {
    playlist: videoId
  } : {};
  var autoPlay = isOnActiveStage && autoplay ? {
    autoplay: 1
  } : {};

  // The request always succeeds, so we check if the image is the fallback (120x90) to detect HQ availability
  (0,react.useEffect)(function () {
    var checkImage = function checkImage() {
      var img = new Image();
      img.onload = function () {
        if (img.naturalWidth === 120 && img.naturalHeight === 90) {
          setVideoCoverImgSrc("https://img.youtube.com/vi_webp/".concat(videoId, "/hqdefault.webp"));
        }
      };
      img.src = videoCoverImgSrc;
    };
    checkImage();
  }, [videoId]);
  useVideoCoverLoader(refReactPlayer, pageId);
  (0,react.useEffect)(function () {
    if (refReactPlayer !== null && refReactPlayer !== void 0 && refReactPlayer.current && !isOnActiveStage) {
      refReactPlayer.current.showPreview();
      setIsPlaying(false);
    }
  }, [isOnActiveStage]);
  var onClickPreview = function onClickPreview() {
    if (isOnActiveStage) {
      setIsPlaying(true);
    }
  };
  var light;
  if (autoplay && isOnActiveStage) {
    light = false;
  } else {
    light = /*#__PURE__*/react.createElement(preview_PreviewDiv, {
      cover: videoCoverImgSrc,
      scale: "fill"
    });
  }
  return /*#__PURE__*/react.createElement(react_player_lib/* default */.A, {
    width: "100%",
    height: "100%",
    light: light,
    playing: isPlaying,
    url: src,
    playsinline: true,
    config: {
      youtube: {
        playerVars: YoutubePlayerElement_objectSpread(YoutubePlayerElement_objectSpread({
          videoId: videoId,
          rel: rel,
          controls: controls,
          mute: mute,
          loop: loop,
          start: start
        }, playlist), autoPlay)
      }
    },
    onClickPreview: onClickPreview,
    ref: refReactPlayer
  });
};
/* harmony default export */ var VideoWidgetContainer_YoutubePlayerElement = (YoutubePlayerElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/VideoWidgetElement.tsx

// eslint-disable-next-line import/no-extraneous-dependencies











var hasTransparentBackground = function hasTransparentBackground(src) {
  var regex = /[?&]transparentBackground=1/g;
  return regex.test(src);
};

// TO DO: split in smaller components
var VideoWidgetElement = function VideoWidgetElement(_ref) {
  var height = _ref.height,
    width = _ref.width,
    _ref$provider = _ref.provider,
    provider = _ref$provider === void 0 ? '' : _ref$provider,
    _ref$ytlink = _ref.ytlink,
    ytlink = _ref$ytlink === void 0 ? '' : _ref$ytlink,
    _ref$src = _ref.src,
    src = _ref$src === void 0 ? '' : _ref$src,
    _ref$cover = _ref.cover,
    cover = _ref$cover === void 0 ? '' : _ref$cover,
    stageIndex = _ref.stageIndex,
    _ref$version = _ref.version,
    version = _ref$version === void 0 ? 0 : _ref$version,
    providerId = _ref.providerId,
    _ref$pageId = _ref.pageId,
    pageId = _ref$pageId === void 0 ? 0 : _ref$pageId,
    _ref$tooltip = _ref.tooltip,
    tooltip = _ref$tooltip === void 0 ? '' : _ref$tooltip;
  var newProvider = getVideoProvider(ytlink, provider);
  var _useAtom = react_useAtom(rootPrimitivesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    downloadMode = _useAtom2[0].downloadMode;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var isOnActiveStage = settledStageIndex === stageIndex;
  var imgSrc = downloadMode && src ? "".concat(src, ".jpg") : src;
  var _useMemo = (0,react.useMemo)(function () {
      return generateVideoInfo({
        provider: newProvider,
        ytlink: ytlink,
        src: src,
        cover: cover,
        downloadMode: downloadMode
      });
    }, [src, ytlink, provider, cover]),
    videoUrl = _useMemo.videoUrl,
    videoOptions = _useMemo.options,
    _useMemo$privateHash = _useMemo.privateHash,
    privateHash = _useMemo$privateHash === void 0 ? '' : _useMemo$privateHash;
  var videoWidgetContent = (0,react.useMemo)(function () {
    switch (newProvider) {
      case VideoProvider.YOUTUBE:
        {
          var youtubeOptions = videoOptions;
          return /*#__PURE__*/react.createElement(VideoWidgetContainer_YoutubePlayerElement, {
            videoId: videoUrl,
            playerVars: youtubeOptions,
            isOnActiveStage: isOnActiveStage,
            pageId: pageId
          });
        }
      case VideoProvider.VIMEO:
        {
          var vimeoOptions = videoOptions;
          return /*#__PURE__*/react.createElement(VideoWidgetContainer_VimeoPlayerElement, {
            videoId: videoUrl,
            privateHash: privateHash,
            params: vimeoOptions,
            title: videoUrl,
            isOnActiveStage: isOnActiveStage,
            pageId: pageId,
            tooltip: tooltip
          });
        }
      default:
        {
          var options = videoOptions;

          // Library or stock videos
          return /*#__PURE__*/react.createElement(VideoElementPlayerContainer, {
            controls: options.controls,
            loop: options.loop,
            muted: options.muted,
            autoplay: options.autoplay,
            isOnActiveStage: isOnActiveStage,
            url: videoUrl,
            src: imgSrc,
            version: version,
            providerId: providerId,
            provider: newProvider,
            pageId: pageId,
            tooltip: tooltip,
            cover: cover
          });
        }
    }
  }, [isOnActiveStage]);
  return /*#__PURE__*/react.createElement(IframeContainer, {
    $width: "".concat(width, "px"),
    $height: "".concat(height, "px"),
    $isEmpty: hasTransparentBackground(src)
  }, videoWidgetContent);
};
/* harmony default export */ var Elements_VideoWidgetElement = (VideoWidgetElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/ImageMaskElement.tsx















var ImageMaskElement = function ImageMaskElement(_ref) {
  var src = _ref.src,
    subType = _ref.subType,
    provider = _ref.provider,
    width = _ref.width,
    height = _ref.height,
    shape = _ref.shape,
    stageIndex = _ref.stageIndex,
    alpha = _ref.alpha,
    id = _ref.id,
    _ref$imageBounds = _ref.imageBounds,
    imageHeight = _ref$imageBounds.imageHeight,
    imageWidth = _ref$imageBounds.imageWidth,
    zoom = _ref.zoom,
    pageId = _ref.pageId,
    _ref$scale = _ref.scale,
    scale = _ref$scale === void 0 ? FILL : _ref$scale;
  // Generate mask image url
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    accountId = _useAtom2[0].link.accountId;
  var _useAtom3 = react_useAtom(rootPrimitivesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    downloadMode = _useAtom4[0].downloadMode;
  var setCountImagesMask = useSetPageLoader(pageId, ElementsTypeEnum.IMAGES_MASK, KeyEnum.NUMBER_OF_ELEMENTS);
  var setCountImagesMaskLoaded = useSetPageLoader(pageId, ElementsTypeEnum.IMAGES_MASK, KeyEnum.NUMBER_OF_LOADED_ELEMENTS);
  var url = getImageResourcePath(accountId, {
    src: src,
    provider: provider,
    subType: subType
  });
  if (downloadMode && url) {
    url += '.jpg';
  }
  var _useState = (0,react.useState)(0),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    renderCount = _useState2[0],
    setRenderCount = _useState2[1];

  // Load shape res
  hooks_useShapesLoader(shape, stageIndex);

  // Generate shapes props object
  var shapeProps = {
    shapeId: "".concat(stageIndex, "-").concat(shape),
    patternWidth: imageWidth * zoom,
    patternHeight: imageHeight * zoom,
    patternId: id
  };
  (0,react.useEffect)(function () {
    if (url) {
      setCountImagesMask(function (prevCount) {
        return prevCount + 1;
      });
    }
    var handleFLipEffectDone = function handleFLipEffectDone() {
      setRenderCount(function (previousValue) {
        return previousValue + 1;
      });
    };
    if (main/* isIOS */.un || main/* isSafari */.nr) {
      // Need to re-render svg elements on safari
      document.addEventListener(TRANSITION_EFFECT_DONE, handleFLipEffectDone);
    }
    return function () {
      if (main/* isIOS */.un || main/* isSafari */.nr) {
        document.removeEventListener(TRANSITION_EFFECT_DONE, handleFLipEffectDone);
      }
    };
  }, []);
  var onLoad = function onLoad() {
    setCountImagesMaskLoaded(function (prevCount) {
      return prevCount + 1;
    });
  };
  var getImageSrc = function getImageSrc() {
    if (subType !== MediaSubtypes.STOCK && !oneSizeProviders.has(provider) && !downloadMode) {
      return getImageAppendedSrc({
        width: width,
        height: height,
        imgSrc: url,
        isBackgroundImage: false
      });
    }
    return url;
  };
  var imageSrc = getImageSrc();
  return /*#__PURE__*/react.createElement(src_ImageMask, {
    url: imageSrc,
    alpha: alpha,
    containerWidth: width,
    containerHeight: height,
    shapeProps: shapeProps,
    renderCount: renderCount,
    onLoad: onLoad,
    fallbackSrc: url,
    objectFit: OBJECT_FIT[scale]
  });
};
ImageMaskElement.propTypes = {
  src: (prop_types_default()).string.isRequired,
  provider: (prop_types_default()).string.isRequired,
  subType: (prop_types_default()).string.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  shape: (prop_types_default()).number.isRequired,
  stageIndex: (prop_types_default()).number.isRequired,
  zoom: (prop_types_default()).number.isRequired,
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired
};
/* harmony default export */ var Elements_ImageMaskElement = (ImageMaskElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/SlideshowElement.tsx













var SlideshowElementDefaultProps = {
  alpha: 1,
  loop: false,
  slideInterval: 5,
  hideBullets: false,
  hideArrows: false,
  autoplay: false,
  scale: FILL
};
var SlideshowElement = function SlideshowElement(_ref) {
  var pageId = _ref.pageId,
    stageIndex = _ref.stageIndex,
    media = _ref.media,
    width = _ref.width,
    height = _ref.height,
    _ref$alpha = _ref.alpha,
    alpha = _ref$alpha === void 0 ? SlideshowElementDefaultProps.alpha : _ref$alpha,
    _ref$loop = _ref.loop,
    loop = _ref$loop === void 0 ? SlideshowElementDefaultProps.loop : _ref$loop,
    _ref$slideInterval = _ref.slideInterval,
    slideInterval = _ref$slideInterval === void 0 ? SlideshowElementDefaultProps.slideInterval : _ref$slideInterval,
    _ref$hideBullets = _ref.hideBullets,
    hideBullets = _ref$hideBullets === void 0 ? SlideshowElementDefaultProps.hideBullets : _ref$hideBullets,
    _ref$hideArrows = _ref.hideArrows,
    hideArrows = _ref$hideArrows === void 0 ? SlideshowElementDefaultProps.hideArrows : _ref$hideArrows,
    _ref$autoplay = _ref.autoplay,
    autoplay = _ref$autoplay === void 0 ? SlideshowElementDefaultProps.autoplay : _ref$autoplay,
    _ref$scale = _ref.scale,
    scale = _ref$scale === void 0 ? SlideshowElementDefaultProps.scale : _ref$scale;
  var elementRef = (0,react.useRef)(null);
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    accountId = _useAtom2[0].link.accountId;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var _useContext = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext.zoom;
  var _useAtom3 = react_useAtom(rootPrimitivesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    downloadMode = _useAtom4[0].downloadMode;
  var isOnActiveStage = settledStageIndex === stageIndex;
  var slideIntervalMilliseconds = slideInterval * 1000;
  var setCountImagesSlideshows = useSetPageLoader(pageId, ElementsTypeEnum.IMAGES_SLIDESHOW, KeyEnum.NUMBER_OF_ELEMENTS);
  var setCountImagesSlideshowsLoaded = useSetPageLoader(pageId, ElementsTypeEnum.IMAGES_SLIDESHOW, KeyEnum.NUMBER_OF_LOADED_ELEMENTS);
  var getImageSrc = function getImageSrc(src, provider) {
    var imgSrc = getImageResourcePath(accountId, {
      src: src,
      provider: provider
    });

    // If is downloadMode we use the original image
    if (downloadMode) {
      return "".concat(imgSrc, ".jpg");
    }
    return getImageAppendedSrc({
      width: width,
      height: height,
      imgSrc: imgSrc
    });
  };
  (0,react.useEffect)(function () {
    if (autoplay && elementRef !== null && elementRef !== void 0 && elementRef.current) {
      if (isOnActiveStage) {
        elementRef.current.play();
      } else {
        elementRef.current.pause();
      }
    }
  }, [isOnActiveStage]);
  var countImages = function countImages() {
    setCountImagesSlideshows(function (prevCount) {
      return prevCount + 1;
    });
  };
  var countImagesLoaded = function countImagesLoaded() {
    setCountImagesSlideshowsLoaded(function (prevCount) {
      return prevCount + 1;
    });
  };
  return /*#__PURE__*/react.createElement(src_Slideshow, {
    ref: elementRef,
    getImageSrc: getImageSrc,
    scale: zoom,
    items: media,
    width: width,
    height: height,
    alpha: alpha,
    infinite: loop,
    slideInterval: slideIntervalMilliseconds,
    showBullets: !hideBullets,
    showArrows: !hideArrows,
    autoplay: autoplay,
    stopRendering: !isOnActiveStage,
    isIOS: main/* isIOS */.un,
    objectFit: OBJECT_FIT[scale],
    stopArrowPropagation: true,
    countImages: countImages,
    countImagesLoaded: countImagesLoaded
  });
};
/* harmony default export */ var Elements_SlideshowElement = (/*#__PURE__*/react.memo(SlideshowElement));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/ChartElement.tsx





// @ts-ignore:next-line
var ChartElement = function ChartElement(props) {
  var Component = src_ChartView.component;
  var animationStyle = generateInteractiveAnimation({
    type: props.type,
    alpha: props.alpha,
    id: props.id,
    color: props.color
  }, props.isStageActive, props.animatedInteractions, props.effect);
  return /*#__PURE__*/react.createElement(ElementWrapper, {
    animationStyle: animationStyle,
    hover: props.mouseOver
  }, /*#__PURE__*/react.createElement(Component, {
    pageId: props.id,
    elementId: props.pageId,
    variant: props.variant,
    values: props.values,
    width: props.width,
    height: props.height,
    options: props.options,
    styles: props.styles,
    order: props.order,
    isAnimationActive: false,
    isMobileTheme: false
  }));
};
/* harmony default export */ var Elements_ChartElement = (/*#__PURE__*/react.memo(ChartElement));
// EXTERNAL MODULE: ../../modules/ui/code/constants/CartIconTypes.ts
var CartIconTypes = __webpack_require__(9682);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/CartElement.tsx








// @ts-ignore:next-line
var CartElement = function CartElement(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    cartSettings = _useContext.cart;
  var Component = src_CartView.view;
  var interactiveElement = isInteractiveElement(props.type, props.isDownloadPDF);
  var animationStyle = generateInteractiveAnimation({
    type: props.type,
    alpha: props.alpha,
    id: props.id,
    color: props.color,
    radius: src_CartView.constants.CartRadius * props.zoom
  }, props.isStageActive, props.animatedInteractions, props.effect);
  return /*#__PURE__*/react.createElement(ElementWrapper, {
    animationStyle: animationStyle,
    hover: props.mouseOver
  }, /*#__PURE__*/react.createElement(Component, {
    cartIcon: props.displayIcon,
    color: props.color,
    labelColor: props.labelColor,
    height: props.height,
    width: props.width,
    label: props.buttonLabel,
    radius: src_CartView.constants.CartRadius * props.zoom,
    alpha: interactiveElement ? undefined : props.alpha,
    shopIcon: (cartSettings === null || cartSettings === void 0 ? void 0 : cartSettings.shopIcon) || CartIconTypes/* CartIconTypes */.n.BAG_ICON
  }));
};
/* harmony default export */ var Elements_CartElement = (CartElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/poll/poll.ts

function poll_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function poll_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? poll_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : poll_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var optionStateAtom = vanilla_atom(poll_objectSpread(poll_objectSpread({}, src_PollView.defaults.optionState), {}, {
  elementId: -1
}));
optionStateAtom.debugLabel = "optionStateAtom";
var setOptionStateAtom = vanilla_atom(null, function (_get, set, _ref) {
  var optionIndex = _ref.optionIndex,
    currentState = _ref.currentState,
    elementId = _ref.elementId;
  return set(optionStateAtom, {
    optionIndex: optionIndex,
    currentState: currentState,
    elementId: elementId
  });
});
setOptionStateAtom.debugLabel = "setOptionStateAtom";
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/poll/isPollInLocalStorage.ts
/**
 * Look for poll showResults flag in localStorage
 * @param {string} playerToken
 * @param {number} elementId
 * @returns {object}
 */
/* harmony default export */ var isPollInLocalStorage = (function (playerToken, elementId) {
  try {
    var present = localStorage && localStorage.getItem("".concat(playerToken, "-poll-").concat(elementId));
    if (!present) {
      return {
        showResults: false,
        optionIndex: -1,
        // not an option id, but needs to be present
        dateLastUpdate: 1 // 01 Jan 1970
      };
    }
    return JSON.parse(present);
  } catch (e) {
    return {
      showResults: false,
      optionIndex: -1,
      // not an option id, but needs to be present
      dateLastUpdate: 1 // 01 Jan 1970
    };
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/poll/processPollProps.ts

/**
 * Props processing for Poll element
 */
/* harmony default export */ var processPollProps = (function (_ref) {
  var width = _ref.width,
    elementId = _ref.elementId,
    zoom = _ref.zoom,
    showResults = _ref.showResults,
    dateLastUpdate = _ref.dateLastUpdate,
    lastUpdatedFromLocalStorage = _ref.lastUpdatedFromLocalStorage,
    optionIndex = _ref.optionIndex,
    optionState = _ref.optionState;
  return {
    width: Math.ceil(width / zoom),
    displayResults: showResults && dateLastUpdate === lastUpdatedFromLocalStorage,
    selectedOption: dateLastUpdate === lastUpdatedFromLocalStorage ? optionIndex : -1,
    processedOptionState: optionState.elementId !== elementId ? src_PollView.defaults.optionState : optionState
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/PollElement.tsx


function PollElement_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function PollElement_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? PollElement_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : PollElement_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }









var PollElementPropTypes = PollElement_objectSpread(PollElement_objectSpread({}, src_PollView.types.PollViewPropTypes), {}, {
  id: (prop_types_default()).number.isRequired
});
var PollElement = function PollElement(props) {
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    hash = _useAtom2$.hash,
    accountId = _useAtom2$.link.accountId,
    dateLastUpdate = _useAtom2$.dateLastUpdate;
  var playerToken = getPlayerToken(accountId, hash);
  var Component = src_PollView.component;
  var _useAtom3 = react_useAtom(optionStateAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    optionState = _useAtom4[0];
  var zoom = props.zoom || 1;
  var _isPollInLocalStorage = isPollInLocalStorage(playerToken, props.id),
    showResults = _isPollInLocalStorage.showResults,
    optionIndex = _isPollInLocalStorage.optionIndex,
    lastUpdatedFromLocalStorage = _isPollInLocalStorage.dateLastUpdate;
  var _processPollProps = processPollProps({
      width: props.width,
      elementId: props.id,
      zoom: zoom,
      showResults: showResults,
      dateLastUpdate: dateLastUpdate,
      lastUpdatedFromLocalStorage: lastUpdatedFromLocalStorage,
      optionIndex: optionIndex,
      optionState: optionState
    }),
    width = _processPollProps.width,
    displayResults = _processPollProps.displayResults,
    processedOptionState = _processPollProps.processedOptionState,
    selectedOption = _processPollProps.selectedOption;
  return /*#__PURE__*/react.createElement(Component, {
    width: width,
    question: props.question,
    options: props.options,
    showResults: displayResults,
    zoom: zoom,
    optionState: processedOptionState,
    selectedOption: selectedOption
  });
};
/* harmony default export */ var Elements_PollElement = (/*#__PURE__*/react.memo(PollElement));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/QuizElement.tsx





var QuizElement = function QuizElement(_ref) {
  var alpha = _ref.alpha,
    width = _ref.width,
    height = _ref.height,
    color = _ref.color,
    mouseOver = _ref.mouseOver,
    type = _ref.type,
    isStageActive = _ref.isStageActive,
    animatedInteractions = _ref.animatedInteractions,
    id = _ref.id,
    questions = _ref.questions,
    effect = _ref.effect;
  // Return null if no questions are set (OLD QUIZ)
  if (!questions || !questions.length) {
    return null;
  }
  var Component = src_QuizView.component;
  var interactiveElement = isInteractiveElement(type);
  var animationStyle = generateInteractiveAnimation({
    type: type,
    alpha: alpha,
    id: id,
    color: color
  }, isStageActive, animatedInteractions, effect);
  return /*#__PURE__*/react.createElement(ElementWrapper, {
    animationStyle: animationStyle,
    hover: mouseOver
  }, /*#__PURE__*/react.createElement(Component, {
    height: height,
    width: width,
    alpha: interactiveElement ? undefined : alpha,
    color: color
  }));
};
/* harmony default export */ var Elements_QuizElement = (QuizElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/ContactFormElement.tsx

function ContactFormElement_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function ContactFormElement_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ContactFormElement_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ContactFormElement_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }







var ContactFormElement_Icon = __webpack_require__(9854);
var ContactFormElement = function ContactFormElement(props) {
  var roundedElements = getRoundedInteractiveElementBorder(props.type, props.shape, props.radius);
  var interactiveElement = isInteractiveElement(props.type, props.isDownloadPDF);
  var elementBorderRadius = (props === null || props === void 0 ? void 0 : props.shape) === CaptionShape.ROUNDED ? '50%' : "".concat((props === null || props === void 0 ? void 0 : props.radius) || 0, "px");
  var elementProps = (props === null || props === void 0 ? void 0 : props.icon) || ElementDefaults[props.type].icon;
  var IconComponent = elementProps && ContactFormElement_Icon[elementProps] ? ContactFormElement_Icon[elementProps] : null;
  var animationStyle = generateInteractiveAnimation({
    type: props.type,
    alpha: props.alpha,
    id: props.id,
    color: props.color
  }, props.isStageActive, props.animatedInteractions, props.effect);
  return /*#__PURE__*/react.createElement(ElementWrapper, {
    animationStyle: animationStyle,
    hover: props.mouseOver,
    style: ContactFormElement_objectSpread({}, roundedElements)
  }, /*#__PURE__*/react.createElement(src_IconButton, {
    shape: props.shape || '',
    bgColor: props.color,
    alpha: interactiveElement ? null : props.alpha,
    width: props.width,
    height: props.height,
    radius: elementBorderRadius,
    icon: IconComponent && /*#__PURE__*/react.createElement(IconComponent, null)
  }));
};
/* harmony default export */ var Elements_ContactFormElement = (/*#__PURE__*/react.memo(ContactFormElement));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/QuestionElement.tsx





var QuestionElement = function QuestionElement(props) {
  var Component = src_QuestionView.component;
  var interactiveElement = isInteractiveElement(props.type);
  var animationStyle = generateInteractiveAnimation({
    type: props.type,
    alpha: props.alpha,
    id: props.id,
    color: props.color
  }, props.isStageActive, props.animatedInteractions, props.effect);
  return /*#__PURE__*/react.createElement(ElementWrapper, {
    animationStyle: animationStyle,
    hover: props.mouseOver
  }, /*#__PURE__*/react.createElement(Component, {
    width: props.width,
    height: props.height,
    alpha: interactiveElement ? undefined : props.alpha,
    color: props.color
  }));
};
/* harmony default export */ var Elements_QuestionElement = (QuestionElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Elements/Elements.ts



















var Elements_Elements = function Elements() {
  return {
    IconElement: Elements_IconElement,
    IconElementWithLabel: Elements_IconElementWithLabel,
    ImageElement: Elements_ImageElement,
    ShapeElement: Elements_ShapeElement,
    TagElement: Elements_TagElement,
    EmbedElement: Elements_EmbedElement,
    TableElement: Elements_TableElement,
    TextBoxElement: Elements_TextBoxElement,
    VideoElement: Elements_VideoElement,
    VideoWidgetElement: Elements_VideoWidgetElement,
    ImageMaskElement: Elements_ImageMaskElement,
    ImageMaskExportElement: Elements_ImageMaskExportElement,
    SlideshowElement: Elements_SlideshowElement,
    ChartElement: Elements_ChartElement,
    CartElement: Elements_CartElement,
    PollElement: Elements_PollElement,
    QuizElement: Elements_QuizElement,
    ContactFormElement: Elements_ContactFormElement,
    QuestionElement: Elements_QuestionElement
  };
};
/* harmony default export */ var StageElements_Elements_Elements = (Elements_Elements);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/CartContext.ts

var quantityContext = {
  value: 1,
  activeOption: {},
  editedVariant: {},
  variantMedia: undefined,
  setValue: function setValue() {},
  setActiveOption: function setActiveOption() {},
  setEditedVariant: function setEditedVariant() {},
  setVariantMedia: function setVariantMedia() {}
};
var CartContext = /*#__PURE__*/(0,react.createContext)(quantityContext);
var CartProvider = CartContext.Provider;
/* harmony default export */ var contexts_CartContext = (CartContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/CartProviderContainer/CartProviderContainer.tsx


function CartProviderContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function CartProviderContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? CartProviderContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : CartProviderContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var CartProviderContainer = function CartProviderContainer(props) {
  var _useState = (0,react.useState)(1),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    value = _useState2[0],
    setValue = _useState2[1];
  var _useState3 = (0,react.useState)({}),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    activeOption = _useState4[0],
    setActiveOption = _useState4[1];
  var _useState5 = (0,react.useState)({}),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    editedVariant = _useState6[0],
    setEditedVariant = _useState6[1];
  var _useState7 = (0,react.useState)([]),
    _useState8 = slicedToArray_slicedToArray(_useState7, 2),
    customMedia = _useState8[0],
    setCustomMedia = _useState8[1];
  var setNumericInput = function setNumericInput(input) {
    setValue(input);
  };
  var setActiveOptionFunc = function setActiveOptionFunc(attribute, key) {
    setActiveOption(function (prevState) {
      return CartProviderContainer_objectSpread(CartProviderContainer_objectSpread({}, prevState), {}, defineProperty_defineProperty({}, attribute, key));
    });
  };
  var setVariant = function setVariant(variant) {
    setEditedVariant(variant);
  };
  var setMedia = function setMedia(images) {
    setCustomMedia(images);
  };
  return /*#__PURE__*/react.createElement(CartProvider, {
    value: {
      value: value,
      activeOption: activeOption,
      editedVariant: editedVariant,
      variantMedia: customMedia,
      setValue: setNumericInput,
      setActiveOption: setActiveOptionFunc,
      setEditedVariant: setVariant,
      setVariantMedia: setMedia
    }
  }, props.children);
};
/* harmony default export */ var CartProviderContainer_CartProviderContainer = (CartProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/CartProviderContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/getValidHref.ts

/* harmony default export */ var getValidHref = (function (url) {
  return isValidURL(url) ? url : '';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/PopupFrameActionContainer/PopupFrameActionContainer.tsx


function PopupFrameActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function PopupFrameActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? PopupFrameActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : PopupFrameActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }









var PopupFrameActionContainer = function PopupFrameActionContainer(_ref) {
  var pageId = _ref.pageId,
    elementIndex = _ref.elementIndex;
  var theme = Ze();
  var element = useElement({
    elementIndex: elementIndex,
    pageId: pageId
  });
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var attributes = PopupFrameActionContainer_objectSpread({}, element.attributes);
  var isMobileTheme = stageSize.width <= theme.deviceSize.tabletS;
  var modalPadding = isMobileTheme ? theme.modal.mobilePadding : theme.modal.padding;
  var innerAndOuterPadding = modalPadding * 2;
  var modalHeight = stageSize.height - innerAndOuterPadding - theme.modal.marginTop - theme.modal.marginBottom;
  var modalWidth = stageSize.width - innerAndOuterPadding - theme.modal.marginRight - theme.modal.marginLeft;
  return /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, null, /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: "".concat(modalWidth, "px"),
    height: "".concat(modalHeight, "px"),
    modalHeight: "".concat(modalHeight, "px"),
    identifier: "".concat(pageId, "-").concat(elementIndex),
    ariaLabel: attributes.tooltip
  }, /*#__PURE__*/react.createElement(src_IFrame, {
    encodedHtml: attributes.popupFrameCode,
    title: attributes.tooltip
  })));
};
PopupFrameActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var PopupFrameActionContainer_PopupFrameActionContainer = (PopupFrameActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/PopupFrameActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useModalPadding.ts

/**
 * Return the inner padding of the modal depending on the stage size
 * @return number
 */




/* harmony default export */ var useModalPadding = (function () {
  var theme = Ze();
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var isMobileTheme = stageSize.width < theme.deviceSize.tabletS || stageSize.height < theme.deviceSize.tabletS;
  return isMobileTheme ? theme.modal.mobilePadding : theme.modal.padding;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/Modal/utils/getContentWithoutPadding.ts


/**
 * Return the size of the content without the inner padding of the modal
 * @param {{responsiveWidth: number, responsiveHeight: number}} modalSize
 * @returns {ContentWithoutPaddingType}
 */

/* harmony default export */ var getContentWithoutPadding = (function (modalSize) {
  var modalInnerPadding = useModalPadding();
  var totalInnerPadding = 2 * modalInnerPadding;
  // The size of the content is computed by subtracting the padding inside the modal from its size
  var contentWidth = modalSize.responsiveWidth - totalInnerPadding;
  var contentHeight = modalSize.responsiveHeight - totalInnerPadding;
  return {
    contentWidth: contentWidth,
    contentHeight: contentHeight
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/Modal/utils/getModalSizeForStage.ts


/**
 * Return the size of the modal such thai it fits the whole stage
 * @param {StageSizeType} stageSize
 * @returns {ModalSizeForStage}
 */

/* harmony default export */ var getModalSizeForStage = (function (stageSize) {
  var theme = Ze();
  var stageWidth = stageSize.width,
    stageHeight = stageSize.height;
  // Modal height is computed by subtracting the padding around the modal from stage size
  var verticalModalOuterPadding = theme.modal.marginTop + theme.modal.marginBottom;
  var horizontalModalOuterPadding = 2 * theme.modal.marginLeft;
  var modalHeight = stageHeight - verticalModalOuterPadding;
  var modalWidth = stageWidth - horizontalModalOuterPadding;
  return {
    modalWidth: modalWidth,
    modalHeight: modalHeight
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/Modal/utils/getModalResponsiveness.ts




/**
 * Return the responsive dimensions of the modal
 * @param {StageSizeType} stageSize
 * @param {string} desiredSize
 * @returns {widthAndHeightTypes}
 */

/* harmony default export */ var getModalResponsiveness = (function (stageSize, desiredSize) {
  var _getModalSizeForStage = getModalSizeForStage(stageSize),
    modalWidth = _getModalSizeForStage.modalWidth,
    modalHeight = _getModalSizeForStage.modalHeight;
  var percentage = main/* isMobile */.Fr ? DEFAULTS_PERCENTAGE_SIZE[LARGE] : DEFAULTS_PERCENTAGE_SIZE[desiredSize];
  return {
    responsiveWidth: modalWidth * percentage,
    responsiveHeight: modalHeight * percentage
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/SpotlightActionContainer/Spotlight.styles.tsx

var EmptySpotlightContainer = styled_components_browser_esm.div.withConfig({
  displayName: "Spotlightstyles__EmptySpotlightContainer",
  componentId: "sc-1796lpr-0"
})(["max-width:440px;max-height:440px;display:flex;align-items:center;justify-content:center;", ""], function (_ref) {
  var theme = _ref.theme,
    $isSmall = _ref.$isSmall,
    $width = _ref.$width,
    $height = _ref.$height;
  return $isSmall ? "\n        height: (calc(".concat(theme.modal.minWidth, "px - (2 * ").concat(theme.modal.padding, "px)))};\n        width: (calc(").concat(theme.modal.minWidth, "px - (2 * ").concat(theme.modal.padding, "px)))};\n        ") : "\n        width: calc(".concat($width, "px - (2 * ").concat(theme.modal.padding, "px));\n        height: calc(").concat($height, "px - (2 * ").concat(theme.modal.padding, "px));\n    ");
});
var EmptySpotlightImageWithText = styled_components_browser_esm.div.withConfig({
  displayName: "Spotlightstyles__EmptySpotlightImageWithText",
  componentId: "sc-1796lpr-1"
})(["align-items:center;display:flex;flex-direction:column;text-align:center;"]);
var SpotlightImage = styled_components_browser_esm.img.withConfig({
  displayName: "Spotlightstyles__SpotlightImage",
  componentId: "sc-1796lpr-2"
})(["width:", "px;height:", "px;object-fit:", ";"], function (_ref2) {
  var $width = _ref2.$width;
  return $width;
}, function (_ref3) {
  var $height = _ref3.$height;
  return $height;
}, function (_ref4) {
  var objectFit = _ref4.objectFit;
  return objectFit;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/SpotlightActionContainer/SpotlightEmptyState.tsx





var SpotlightEmptyState = function SpotlightEmptyState(props) {
  var theme = Ze();
  var contentSize = Math.max(Math.min(props.stageWidth, props.stageHeight), theme.modal.minWidth);
  var isMobile = Math.min(props.stageWidth, props.stageHeight) <= theme.deviceSize.tabletS;
  return /*#__PURE__*/react.createElement(EmptySpotlightContainer, {
    $height: contentSize,
    $width: contentSize,
    $isSmall: isMobile
  }, /*#__PURE__*/react.createElement(EmptySpotlightImageWithText, null, /*#__PURE__*/react.createElement(src.UnavailableImage, null), /*#__PURE__*/react.createElement("p", null, "Your spotlight has ", /*#__PURE__*/react.createElement("br", null), "no image set.")));
};
SpotlightEmptyState.propTypes = {
  stageWidth: (prop_types_default()).number.isRequired,
  stageHeight: (prop_types_default()).number.isRequired
};
/* harmony default export */ var SpotlightActionContainer_SpotlightEmptyState = (SpotlightEmptyState);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/SpotlightActionContainer/SpotlightContent.tsx





var SpotlightContent = function SpotlightContent(props) {
  var imgSrc = useResourcePath(resourceFolders_ResourceType.IMAGE, {
    src: props.spotlightImageUrl,
    subType: 'upload'
  });
  var src = props.downloadMode ? "".concat(imgSrc, ".jpg") : imgSrc;
  return /*#__PURE__*/react.createElement(SpotlightImage, {
    src: src,
    alt: "spotlight",
    $width: props.spotlightImageWidth,
    $height: props.spotlightImageHeight,
    objectFit: OBJECT_FIT[props.scale] || OBJECT_FIT[FIT]
  });
};
/* harmony default export */ var SpotlightActionContainer_SpotlightContent = (SpotlightContent);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/SpotlightActionContainer/SpotlightImage.tsx


function SpotlightImage_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function SpotlightImage_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? SpotlightImage_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : SpotlightImage_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }








var SpotlightImage_SpotlightImage = function SpotlightImage(props) {
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = SpotlightImage_objectSpread({}, element.attributes);
  var _useAtom3 = react_useAtom(rootPrimitivesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    downloadMode = _useAtom4[0].downloadMode;
  if (!attributes.spotlightImageUrl) {
    return /*#__PURE__*/react.createElement(SpotlightActionContainer_SpotlightEmptyState, {
      stageWidth: stageSize.width,
      stageHeight: stageSize.height
    });
  }
  return /*#__PURE__*/react.createElement(SpotlightActionContainer_SpotlightContent, {
    spotlightImageUrl: attributes.spotlightImageUrl,
    spotlightImageWidth: props.width,
    spotlightImageHeight: props.height,
    downloadMode: downloadMode,
    scale: (attributes === null || attributes === void 0 ? void 0 : attributes.scale) || ''
  });
};
SpotlightImage_SpotlightImage.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var SpotlightActionContainer_SpotlightImage = (SpotlightImage_SpotlightImage);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/SpotlightActionContainer/SpotlightActionContainer.tsx


function SpotlightActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function SpotlightActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? SpotlightActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : SpotlightActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }











var SpotlightActionContainer = function SpotlightActionContainer(_ref) {
  var pageId = _ref.pageId,
    elementIndex = _ref.elementIndex;
  var element = useElement({
    elementIndex: elementIndex,
    pageId: pageId
  });
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var attributes = SpotlightActionContainer_objectSpread({}, element.attributes);
  var showBackground = attributes !== null && attributes !== void 0 && attributes.spotlightImageUrl ? attributes === null || attributes === void 0 ? void 0 : attributes.showBackground : true;
  var _getModalResponsivene = getModalResponsiveness(stageSize, attributes.size || LARGE),
    responsiveWidth = _getModalResponsivene.responsiveWidth,
    responsiveHeight = _getModalResponsivene.responsiveHeight;
  var _getContentWithoutPad = getContentWithoutPadding({
      responsiveWidth: responsiveWidth,
      responsiveHeight: responsiveHeight
    }),
    contentWidth = _getContentWithoutPad.contentWidth,
    contentHeight = _getContentWithoutPad.contentHeight;
  return /*#__PURE__*/react.createElement(HyperlinkElementLayer, null, /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: attributes.spotlightImageUrl ? "".concat(responsiveWidth, "px") : 'auto',
    height: attributes.spotlightImageUrl ? "".concat(responsiveHeight, "px") : 'auto',
    identifier: "".concat(pageId, "-").concat(elementIndex),
    ariaLabel: attributes !== null && attributes !== void 0 && attributes.tooltip ? attributes.tooltip : '',
    modalWithoutPadding: !showBackground,
    opacity: showBackground ? backgroundOpacity.opaque : backgroundOpacity.transparent
  }, /*#__PURE__*/react.createElement(SpotlightActionContainer_SpotlightImage, {
    pageId: pageId,
    elementIndex: elementIndex,
    width: showBackground ? contentWidth : responsiveWidth,
    height: showBackground ? contentHeight : responsiveHeight
  })));
};
/* harmony default export */ var SpotlightActionContainer_SpotlightActionContainer = (SpotlightActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/SpotlightActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/InteractionActionContainer/InteractionLayerStyles.ts





var InteractionLayer = styled_components_browser_esm(GeneralStyles_ElementLayer).withConfig({
  displayName: "InteractionLayerStyles__InteractionLayer",
  componentId: "sc-1gtl303-0"
})(["transition:background-color 100ms linear;", ""], function (_ref) {
  var $highlightColor = _ref.$highlightColor;
  var css = $highlightColor && $highlightColor.start ? "background-color: ".concat($highlightColor.start, ";") : '';
  if (!main/* isMobile */.Fr) {
    css += "\n                &:hover {\n                    ".concat($highlightColor && $highlightColor.hover ? "background-color: ".concat($highlightColor.hover, ";") : '', ";\n                }\n            ");
  }
  return css;
});
var InteractionLayerStyles_Text = styled_components_browser_esm.div.withConfig({
  displayName: "InteractionLayerStyles__Text",
  componentId: "sc-1gtl303-1"
})(["text-align:left;"]);
var InteractionLayerStyles_Title = styled_components_browser_esm(H2).withConfig({
  displayName: "InteractionLayerStyles__Title",
  componentId: "sc-1gtl303-2"
})(["text-align:left;white-space:pre-wrap;word-break:break-word;margin-bottom:8px;"]);
var Description = styled_components_browser_esm(Paragraph).withConfig({
  displayName: "InteractionLayerStyles__Description",
  componentId: "sc-1gtl303-3"
})(["word-break:break-word;white-space:pre-line;"]);
var PopoverScrollableContainer = styled_components_browser_esm.div.withConfig({
  displayName: "InteractionLayerStyles__PopoverScrollableContainer",
  componentId: "sc-1gtl303-4"
})(["max-height:", "px;overflow-y:auto;display:block;width:100%;"], SCROLLABLE_POPOVER_MAX_HEIGHT);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/hexToRgba.ts
/**
 * Get RGBA from HEX colors
 * @param hexColor - string
 * @param alpha - number
 * @returns {{r: Number, g: Number, b: Number}}
 */
/* harmony default export */ var hexToRgba = (function (hexColor) {
  var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  var hex = hexColor.replace(/[^0-9a-f]+/i, '');
  if (Number.isNaN(parseInt(hex, 16))) {
    return '';
  }
  var r = parseInt(hex.substring(0, 1) + hex.substring(0, 1), 16);
  var g = parseInt(hex.substring(1, 2) + hex.substring(1, 2), 16);
  var b = parseInt(hex.substring(2, 3) + hex.substring(2, 3), 16);
  if (hex.length >= 6) {
    r = parseInt(hex.substring(0, 2), 16);
    g = parseInt(hex.substring(2, 4), 16);
    b = parseInt(hex.substring(4, 6), 16);
  }
  return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PageNavigationActions/PageNavigationActions.tsx










var PageNavigationActions = function PageNavigationActions(props) {
  var _useContext = (0,react.useContext)(contexts_ActiveStageIndexContext),
    setActiveStageIndex = _useContext.setActiveStageIndex;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    _useContext2$pages = _useContext2.pages,
    data = _useContext2$pages.data,
    order = _useContext2$pages.order,
    isRtl = _useContext2.options.content.rtl;
  var setFirstStage = react_useSetAtom(setFirstActiveStageIndexAtom);
  var setLastStage = react_useSetAtom(setLastActiveStageIndexAtom);
  var setPreviousStage = react_useSetAtom(setPreviousActiveStageIndexAtom);
  var setNextStage = react_useSetAtom(setNextActiveStageIndexAtom);
  var activeStageIndex = react_useAtomValue(getActiveStageIndexAtom);
  var setActiveMandatoryModal = react_useSetAtom(setActiveMandatoryModalAtom);
  var indexOfFirstMandatoryAction = useFirstMandatoryStageIndex();
  var blockedByMandatoryActions = activeStageIndex === indexOfFirstMandatoryAction;
  var nrOfStages = order.length;
  var isOnFirstStage = activeStageIndex === 0;
  var isOnLastStage = activeStageIndex === nrOfStages - 1;
  var processEventHandler = function processEventHandler() {
    switch (props.action) {
      case PageNavigationActionType.FIRST:
        {
          // If we are already on the first page, do not change the stage
          if (isRtl && !isOnLastStage) {
            setLastStage();
          } else if (!isRtl && !isOnFirstStage) {
            setFirstStage();
          }
          break;
        }
      case PageNavigationActionType.LAST:
        {
          // If we are already on the last page, do not change the stage
          if (isRtl && !isOnFirstStage || !isRtl && !isOnLastStage) {
            if (blockedByMandatoryActions) {
              setActiveMandatoryModal(true);
            } else if (isRtl) {
              setFirstStage();
            } else if (!isRtl) {
              setLastStage();
            }
          }
          break;
        }
      case PageNavigationActionType.NEXT:
        {
          // If we are already on the last page, do not change the stage
          if (isRtl && !isOnFirstStage || !isRtl && !isOnLastStage) {
            if (blockedByMandatoryActions) {
              setActiveMandatoryModal(true);
            } else {
              setNextStage();
            }
          }
          break;
        }
      case PageNavigationActionType.PREVIOUS:
        {
          // If we are already on the first page, do not change the stage
          if (isRtl && !isOnLastStage || !isRtl && !isOnFirstStage) {
            setPreviousStage();
          }
          break;
        }
      case PageNavigationActionType.CUSTOM:
        {
          if (isRtl) {
            var nrOfPages = Object.keys(data).length;
            setActiveStageIndex(settledStageIndex, nrOfPages - props.pageNumber + 1);
          } else {
            setActiveStageIndex(settledStageIndex, props.pageNumber);
          }
          break;
        }
      default:
        break;
    }
  };
  var onClick = function onClick() {
    processEventHandler();
  };
  var onKeyDown = function onKeyDown(event) {
    if (event.code === KeyboardCodes.ENTER || event.code === KeyboardCodes.SPACE) {
      processEventHandler();
    }
  };
  return /*#__PURE__*/react.createElement(Anchor_Anchor, {
    tabIndex: TabIndex.DEFAULT,
    ariaLabel: props.ariaLabel,
    onClick: onClick,
    onKeyDown: onKeyDown
  });
};
/* harmony default export */ var PageNavigationActions_PageNavigationActions = (PageNavigationActions);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PageNavigationActions/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/PopoverActionContainer/Popover/Popover.styles.ts

var Popover_styles_Popover = styled_components_browser_esm.div.withConfig({
  displayName: "Popoverstyles__Popover",
  componentId: "sc-1jl1yoz-0"
})(["width:", ";height:", ";left:", "px;top:", "px;padding:", "px;box-shadow:", ";position:absolute;background-color:", ";visibility:", ";border-radius:", "px;"], function (_ref) {
  var $width = _ref.$width;
  return $width;
}, function (_ref2) {
  var $height = _ref2.$height;
  return $height;
}, function (_ref3) {
  var $left = _ref3.$left;
  return $left;
}, function (_ref4) {
  var $top = _ref4.$top;
  return $top;
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.popover.padding;
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.popover.boxShadow;
}, function (_ref7) {
  var theme = _ref7.theme;
  return theme.popover.backgroundColor;
}, function (_ref8) {
  var $visibility = _ref8.$visibility;
  return $visibility;
}, function (_ref9) {
  var theme = _ref9.theme;
  return theme.popover.radius;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/elementIsContained.ts
/**
 * Check if an rectangle element (element) is fully overlapped on another (frame)
 * @param element
 * @param frame
 * @return boolean
 */
/* harmony default export */ var elementIsContained = (function (element, frame) {
  return element.x >= frame.x && element.x + element.width < frame.x + frame.width && element.y >= frame.y && element.y + element.height < frame.y + frame.height;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getPopoverPosition.ts




/**
 * Returns popover coordinates for a given position
 * @param elementPosition
 * @param popoverSize
 * @param positionActionType
 * @param stagePosition
 * @return { x: number, y: number }
 */
/* harmony default export */ var getPopoverPosition = (function (elementPosition, popoverSize, positionActionType, stagePosition) {
  var popoverPositions = [tooltipPosition.RIGHT, tooltipPosition.LEFT, tooltipPosition.TOP, tooltipPosition.BOTTOM, tooltipPosition.BOTTOM_RIGHT, tooltipPosition.BOTTOM_LEFT, tooltipPosition.TOP_LEFT, tooltipPosition.TOP_RIGHT];

  // Define positioning functions for each position type
  var positioning = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, tooltipPosition.BOTTOM, function () {
    return {
      x: elementPosition.x + elementPosition.width / 2 - popoverSize.clientWidth / 2 - stagePosition.x,
      y: elementPosition.y + elementPosition.height + TITLE_MARGIN - stagePosition.y
    };
  }), tooltipPosition.BOTTOM_LEFT, function () {
    return {
      x: elementPosition.x - popoverSize.clientWidth / 2 - stagePosition.x,
      y: elementPosition.y + elementPosition.height + TITLE_MARGIN - stagePosition.y
    };
  }), tooltipPosition.BOTTOM_RIGHT, function () {
    return {
      x: elementPosition.x + elementPosition.width - popoverSize.clientWidth / 2 - stagePosition.x,
      y: elementPosition.y + elementPosition.height + TITLE_MARGIN - stagePosition.y
    };
  }), tooltipPosition.LEFT, function () {
    return {
      x: elementPosition.x - (popoverSize.clientWidth + TITLE_MARGIN) - stagePosition.x,
      y: elementPosition.y + elementPosition.height / 2 - popoverSize.clientHeight / 2 - stagePosition.y
    };
  }), tooltipPosition.RIGHT, function () {
    return {
      x: elementPosition.x + elementPosition.width + TITLE_MARGIN - stagePosition.x,
      y: elementPosition.y + elementPosition.height / 2 - popoverSize.clientHeight / 2 - stagePosition.y
    };
  }), tooltipPosition.TOP, function () {
    return {
      x: elementPosition.x + elementPosition.width / 2 - popoverSize.clientWidth / 2 - stagePosition.x,
      y: elementPosition.y - (popoverSize.clientHeight + TITLE_MARGIN) - stagePosition.y
    };
  }), tooltipPosition.TOP_RIGHT, function () {
    return {
      x: elementPosition.x + elementPosition.width - popoverSize.clientWidth / 2 - stagePosition.x,
      y: elementPosition.y - (popoverSize.clientHeight + TITLE_MARGIN) - stagePosition.y
    };
  }), tooltipPosition.TOP_LEFT, function () {
    return {
      x: elementPosition.x - popoverSize.clientWidth / 2 - stagePosition.x,
      y: elementPosition.y - (popoverSize.clientHeight + TITLE_MARGIN) - stagePosition.y
    };
  });

  // Execute and return requested position if it is not auto
  if (positionActionType !== tooltipPosition.AUTO) {
    return positioning[positionActionType]();
  }

  // Default position is right
  var position = positioning[popoverPositions[0]]();

  // Check position by priority and find the first that fits the stage
  var auto = popoverPositions.find(function (ps) {
    var _positioning$ps = positioning[ps](),
      x = _positioning$ps.x,
      y = _positioning$ps.y;
    var elem = {
      x: x + stagePosition.x,
      y: y + stagePosition.y,
      width: popoverSize.clientWidth,
      height: popoverSize.clientHeight
    };
    return elementIsContained(elem, stagePosition);
  });
  if (auto) {
    return positioning[auto]();
  }
  return position;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/PopoverActionContainer/Popover/Popover.tsx










var PopoverActionContainer_Popover_Popover_Popover = function Popover(props) {
  var _useState = (0,react.useState)({
      x: 0,
      y: 0,
      visibility: 'hidden'
    }),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    tooltipCoordinates = _useState2[0],
    setTooltipCoordinates = _useState2[1];
  var context = (0,react.useContext)(contexts_PopoverContext);
  var _useContext = (0,react.useContext)(contexts_PlayerRefContext),
    playerRef = _useContext.playerRef;
  var _useContext2 = (0,react.useContext)(contexts_ControllerContext),
    scale = _useContext2.scale;
  var _useContext3 = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext3.zoom;
  var modalContext = (0,react.useContext)(contexts_ModalContext);
  var popoverRef = (0,react.useRef)(null);
  var mounted = (0,react.useRef)(false);
  var parent = document.getElementById('playerPopover');

  // TODO - when the scroll and stage movement functions are definitive those should also trigger popover close
  (0,react.useEffect)(function () {
    // Prevent closing the popover when the effect is running for the first time
    if (!mounted.current) {
      mounted.current = true;
    } else {
      // Call setIsOpen when zoom and scale change excepting the first run of the effect
      modalContext.setOpen('');
    }
  }, [zoom, scale]);
  (0,react.useEffect)(function () {
    context.setOpened(true);
    if (popoverRef.current) {
      var _context$elementRef;
      var elementPosition = context === null || context === void 0 || (_context$elementRef = context.elementRef) === null || _context$elementRef === void 0 || (_context$elementRef = _context$elementRef.current) === null || _context$elementRef === void 0 ? void 0 : _context$elementRef.getBoundingClientRect();
      var playerPosition = playerRef === null || playerRef === void 0 ? void 0 : playerRef.getBoundingClientRect();
      if (elementPosition && playerPosition) {
        var _getPopoverPosition = getPopoverPosition(elementPosition, popoverRef.current, props.position || 'auto', playerPosition),
          x = _getPopoverPosition.x,
          y = _getPopoverPosition.y;
        setTooltipCoordinates({
          x: x,
          y: y,
          visibility: 'visible'
        });
      }
    }
    return function () {
      context.setOpened(false);
    };
  }, [playerRef, context, props.position]);
  (0,react.useEffect)(function () {
    var handleOutsideClick = function handleOutsideClick(e) {
      var _popoverRef$current;
      if (!((_popoverRef$current = popoverRef.current) !== null && _popoverRef$current !== void 0 && _popoverRef$current.contains(e.target))) {
        context.setOpened(false);
        modalContext.setOpen('');
      }
    };
    document.addEventListener('click', handleOutsideClick);
    return function () {
      document.removeEventListener('click', handleOutsideClick);
    };
  }, []);

  /**
   * Stop propagation when clicking inside the popover
   * ModalProviderContainer closes every modal/popover on mouseDown
   * @param {MouseEvent} e
   */
  var stopPropagation = function stopPropagation(e) {
    e.stopPropagation();
  };
  return /*#__PURE__*/react_dom.createPortal(/*#__PURE__*/react.createElement(Popover_styles_Popover, {
    $width: props.popoverWidth,
    $height: props.popoverHeight,
    $left: tooltipCoordinates.x,
    $top: tooltipCoordinates.y,
    ref: popoverRef,
    $visibility: tooltipCoordinates.visibility,
    onClick: stopPropagation
  }, props.children), parent);
};
/* harmony default export */ var PopoverActionContainer_Popover_Popover = (PopoverActionContainer_Popover_Popover_Popover);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/PopoverActionContainer/Popover/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/PopoverActionContainer/PopoverActionContainer.tsx










var PopoverActionContainer = function PopoverActionContainer(props) {
  var theme = Ze();
  var _useAtom = react_useAtom(stageSizeWidthAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    width = _useAtom2[0];
  if (main/* isMobile */.Fr || width < theme.deviceSize.tabletS) {
    return /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
      width: "auto",
      height: "auto",
      openType: OPEN_ACTION.CLICK,
      identifier: props.identifier
    }, props.children);
  }
  return /*#__PURE__*/react.createElement(ModalOpenManager_MouseEventTrigger, {
    identifier: props.identifier,
    openType: props.openType || OPEN_ACTION.CLICK,
    ariaLabel: props.ariaLabel
  }, /*#__PURE__*/react.createElement(PopoverActionContainer_Popover_Popover, {
    popoverWidth: props.popoverWidth,
    popoverHeight: props.popoverHeight,
    elementY: props.elementY,
    elementX: props.elementX,
    elementWidth: props.elementWidth,
    elementHeight: props.elementHeight,
    position: props.position,
    offsetX: props.offsetX,
    isFirstPage: props.isFirstPage
  }, props.children));
};
/* harmony default export */ var PopoverActionContainer_PopoverActionContainer = (PopoverActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/PopoverActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/InteractionActionContainer/InteractionPopover.tsx








var InteractionPopoverContainer = function InteractionPopoverContainer(props) {
  var theme = Ze();
  var interaction = props.interaction,
    rotation = props.rotation;
  var title = interaction && 'title' in interaction ? interaction.title : '';
  var description = interaction && 'description' in interaction ? interaction.description : '';
  var popoverWidth = interaction && 'width' in interaction ? interaction.width : 0;
  var popoverHeight = interaction && 'height' in interaction ? interaction.height : 0;
  var positionActionType = interaction && 'positionActionType' in interaction ? interaction.positionActionType : '';
  var ariaLabel = "".concat(ActionTypeName[props.elementAction], ", ").concat(title, ", ").concat(description);
  var getContent = function getContent() {
    switch (props.openType) {
      case OPEN_ACTION.CLICK:
        return /*#__PURE__*/react.createElement(PopoverActionContainer_PopoverActionContainer, {
          popoverWidth: "".concat(theme.popoverSizes.default.width, "px"),
          popoverHeight: "auto",
          elementY: props.elementY,
          elementX: props.elementX,
          elementWidth: props.elementWidth,
          elementHeight: props.elementHeight,
          position: positionActionType,
          offsetX: props.offsetX,
          isFirstPage: props.isFirstPage,
          identifier: props.identifier,
          openType: props.openType,
          ariaLabel: ariaLabel
        }, /*#__PURE__*/react.createElement(PopoverScrollableContainer, null, /*#__PURE__*/react.createElement(InteractionLayerStyles_Title, null, title), /*#__PURE__*/react.createElement(InteractionLayerStyles_Text, null, /*#__PURE__*/react.createElement(Description, null, description))));
      case OPEN_ACTION.HOVER:
        return /*#__PURE__*/react.createElement(PopoverActionContainer_PopoverActionContainer, {
          popoverWidth: "".concat(theme.popoverSizes.default.width, "px"),
          popoverHeight: "auto",
          elementY: props.elementY,
          elementX: props.elementX,
          elementWidth: props.elementWidth,
          elementHeight: props.elementHeight,
          position: positionActionType,
          offsetX: props.offsetX,
          isFirstPage: props.isFirstPage,
          identifier: props.identifier,
          openType: props.openType,
          ariaLabel: ariaLabel
        }, /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(InteractionLayerStyles_Title, null, title), /*#__PURE__*/react.createElement(InteractionLayerStyles_Text, null, /*#__PURE__*/react.createElement(Description, null, description))));
      default:
        return /*#__PURE__*/react.createElement(PopoverActionContainer_PopoverActionContainer, {
          popoverWidth: "".concat(popoverWidth, "px"),
          popoverHeight: "".concat(popoverHeight, "px"),
          elementY: props.elementY,
          elementX: props.elementX,
          elementWidth: props.elementWidth,
          elementHeight: props.elementHeight,
          position: positionActionType,
          offsetX: props.offsetX,
          isFirstPage: props.isFirstPage,
          identifier: props.identifier,
          openType: props.openType
        }, /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(InteractionLayerStyles_Title, null, title), /*#__PURE__*/react.createElement(InteractionLayerStyles_Text, null, /*#__PURE__*/react.createElement(Description, null, description))));
    }
  };
  return /*#__PURE__*/react.createElement(RotationContainer, {
    $rotation: rotation,
    reverse: true
  }, /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, null, getContent()));
};
InteractionPopoverContainer.propTypes = {
  interaction: prop_types_default().oneOfType([prop_types_default().shape({
    color: (prop_types_default()).string.isRequired,
    width: (prop_types_default()).number.isRequired,
    height: (prop_types_default()).number.isRequired,
    interactionType: (prop_types_default()).string.isRequired,
    popinTooltip: (prop_types_default()).string.isRequired,
    title: (prop_types_default()).string.isRequired,
    positionActionType: (prop_types_default()).string.isRequired,
    openActionType: (prop_types_default()).string.isRequired,
    description: (prop_types_default()).string.isRequired,
    alpha: (prop_types_default()).number.isRequired
  }).isRequired, prop_types_default().shape({
    interactionType: (prop_types_default()).string.isRequired,
    actionType: (prop_types_default()).string.isRequired,
    pageNumber: (prop_types_default()).number.isRequired,
    actionTooltip: (prop_types_default()).string.isRequired
  }).isRequired, prop_types_default().shape({
    interactionType: (prop_types_default()).string.isRequired,
    url: (prop_types_default()).string.isRequired,
    tooltip: (prop_types_default()).string.isRequired
  }).isRequired]).isRequired,
  elementX: (prop_types_default()).number.isRequired,
  elementY: (prop_types_default()).number.isRequired,
  elementWidth: (prop_types_default()).number.isRequired,
  elementHeight: (prop_types_default()).number.isRequired,
  offsetX: (prop_types_default()).number.isRequired,
  identifier: (prop_types_default()).string.isRequired,
  openType: (prop_types_default()).string.isRequired,
  elementAction: (prop_types_default()).number.isRequired
};
/* harmony default export */ var InteractionPopover = (InteractionPopoverContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/InteractionActionContainer/InteractionActionContainer.tsx














var InteractionActionContainer = function InteractionActionContainer(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = element.attributes,
    _element$bounds = element.bounds,
    width = _element$bounds.width,
    height = _element$bounds.height,
    x = _element$bounds.x,
    y = _element$bounds.y,
    rotation = element.rotation;
  var _ref = attributes,
    interaction = _ref.interaction;
  var color = interaction && 'color' in interaction ? interaction.color : '';
  var alpha = interaction && 'alpha' in interaction ? interaction.alpha : 1;
  var openActionType = interaction && 'openActionType' in interaction ? interaction.openActionType : '';
  if (interaction && interaction.interactionType) {
    var getContent = function getContent() {
      switch (interaction.interactionType) {
        case InteractionTypes.POPOVER:
          return /*#__PURE__*/react.createElement(InteractionPopover, {
            interaction: interaction,
            elementWidth: width,
            elementHeight: height,
            elementX: x,
            elementY: y,
            offsetX: props.offsetX,
            isFirstPage: props.isFirstPage,
            rotation: rotation,
            identifier: "".concat(props.pageId, "-").concat(props.elementIndex),
            openType: openActionType,
            elementAction: props.elementAction
          });
        case InteractionTypes.PAGE:
          {
            if ('actionType' in interaction) {
              var tooltip = 'actionTooltip' in interaction ? interaction.actionTooltip : '';
              var ariaLabel = "".concat(ActionTypeName[props.elementAction], ",").concat(tooltip, " ").concat(interaction.pageNumber);
              return /*#__PURE__*/react.createElement(PageNavigationActions_PageNavigationActions, {
                action: interaction.actionType,
                pageNumber: interaction.pageNumber,
                ariaLabel: ariaLabel
              });
            }
            return null;
          }
        case InteractionTypes.LINK:
          {
            var url = 'url' in interaction ? interaction.url : '';
            var _tooltip = 'tooltip' in interaction ? interaction.tooltip : '';
            var _ariaLabel = "".concat(ActionTypeName[props.elementAction], ", ").concat(_tooltip);
            return /*#__PURE__*/react.createElement(Anchor_Anchor, {
              target: "_blank",
              href: getValidHref(url),
              tabIndex: TabIndex.DEFAULT,
              ariaLabel: _ariaLabel
            });
          }
        case InteractionTypes.SPOTLIGHT:
          return /*#__PURE__*/react.createElement(SpotlightActionContainer_SpotlightActionContainer, {
            pageId: props.pageId,
            elementIndex: props.elementIndex
          });
        case InteractionTypes.POPUP_FRAME:
          return /*#__PURE__*/react.createElement(PopupFrameActionContainer_PopupFrameActionContainer, {
            pageId: props.pageId,
            elementIndex: props.elementIndex
          });
        default:
          return null;
      }
    };
    var highlightColor = (interaction === null || interaction === void 0 ? void 0 : interaction.interactionType) === InteractionTypes.POPOVER ? {
      start: hexToRgba(color, 0),
      hover: hexToRgba(color, alpha)
    } : {};
    return /*#__PURE__*/react.createElement(InteractionLayer, {
      $width: width,
      $height: height,
      $highlightColor: highlightColor
    }, getContent());
  }
  return null;
};
InteractionActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  offsetX: (prop_types_default()).number.isRequired,
  isFirstPage: (prop_types_default()).bool.isRequired,
  elementAction: (prop_types_default()).number.isRequired
};
/* harmony default export */ var InteractionActionContainer_InteractionActionContainer = (InteractionActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/InteractionActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/ChartActionContainer/ChartActionContainer.tsx














var ChartActionContainer = function ChartActionContainer(_ref) {
  var elementIndex = _ref.elementIndex,
    pageId = _ref.pageId;
  var theme = Ze();
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var element = useElement({
    elementIndex: elementIndex,
    pageId: pageId
  });
  var attributes = element.attributes;
  var variant = attributes.variant,
    options = attributes.options,
    sourceId = attributes.source.id,
    styles = attributes.styles,
    values = attributes.values,
    order = attributes.order,
    _attributes$size = attributes.size,
    desiredSize = _attributes$size === void 0 ? LARGE : _attributes$size;
  var elementId = element.id;
  var _getModalResponsivene = getModalResponsiveness(stageSize, desiredSize),
    responsiveWidth = _getModalResponsivene.responsiveWidth,
    responsiveHeight = _getModalResponsivene.responsiveHeight;
  var _getContentWithoutPad = getContentWithoutPadding({
      responsiveWidth: responsiveWidth,
      responsiveHeight: responsiveHeight
    }),
    contentWidth = _getContentWithoutPad.contentWidth,
    contentHeight = _getContentWithoutPad.contentHeight;
  var chartWidth = contentWidth;
  var isMobileTheme = stageSize.width < theme.deviceSize.tabletL || stageSize.height < theme.deviceSize.tabletL;
  // For small screens, in landscape mode we want a higher content with a vertical scroll
  var isMobileLandscape = stageSize.height < theme.deviceSize.mobileL;
  var chartHeight = isMobileLandscape ? 2 * contentHeight : contentHeight;
  var getContent = function getContent() {
    if (!sourceId) {
      return /*#__PURE__*/react.createElement(SpotlightActionContainer_SpotlightEmptyState, {
        stageWidth: stageSize.width,
        stageHeight: stageSize.height
      });
    }
    var Component = src_ChartView.component;
    return /*#__PURE__*/react.createElement(Component, {
      pageId: pageId,
      elementId: elementId,
      width: chartWidth,
      height: chartHeight,
      variant: variant,
      values: values,
      order: order,
      options: options,
      styles: styles,
      isAnimationActive: true,
      isMobileTheme: isMobileTheme
    });
  };
  return /*#__PURE__*/react.createElement(HyperlinkElementLayer, null, /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: sourceId ? "".concat(responsiveWidth, "px") : 'auto',
    height: sourceId ? "".concat(responsiveHeight, "px") : 'auto',
    identifier: "".concat(pageId, "-").concat(elementIndex),
    ariaLabel: attributes !== null && attributes !== void 0 && attributes.tooltip ? attributes.tooltip : ''
  }, getContent()));
};
ChartActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var ChartActionContainer_ChartActionContainer = (ChartActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/ChartActionContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/SuccessfulSendResponse/SuccessfulSendResponse.tsx








var SuccessfulSendResponse = function SuccessfulSendResponse(_ref) {
  var thankYouMessage = _ref.thankYouMessage;
  var theme = Ze();
  var responseSubmittedMessage = useTranslate(Identifier.l_response_submitted_message);
  var thankYouMessageIcon = function thankYouMessageIcon() {
    return /*#__PURE__*/react.createElement(src.SuccessfulIcon, {
      fill: theme.colors.success,
      ariaLabel: thankYouMessage
    });
  };
  return /*#__PURE__*/react.createElement(InformationContainer, null, thankYouMessageIcon(), /*#__PURE__*/react.createElement(Paragraph, {
    tabIndex: TabIndex.DEFAULT
  }, thankYouMessage || responseSubmittedMessage));
};
/* harmony default export */ var SuccessfulSendResponse_SuccessfulSendResponse = (SuccessfulSendResponse);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ContactFormModal/ContactFormDetailsStyles.ts



var FormTitle = styled_components_browser_esm(H2).withConfig({
  displayName: "ContactFormDetailsStyles__FormTitle",
  componentId: "sc-1lwojfj-0"
})(["max-width:", ";"], function (_ref) {
  var modalWidth = _ref.modalWidth,
    theme = _ref.theme;
  return modalWidth <= theme.deviceSize.tabletS ? "".concat(LEAD_FORM_TITLE_WIDTH, "px") : '';
});
var FormDescription = styled_components_browser_esm(SmallerParagraph).withConfig({
  displayName: "ContactFormDetailsStyles__FormDescription",
  componentId: "sc-1lwojfj-1"
})(["margin:16px 0;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ContactFormModal/ContactFormDetails.tsx














var ContactFormDetails = function ContactFormDetails(props) {
  var attributes = props.attributes;
  var contactFieldsRef = (0,react.useRef)(structuredClone(attributes.customerContactFields));
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    hash = _useAtom2[0].hash;
  var setModalStep = react_useSetAtom(setModalStepAtom);
  var _useState = (0,react.useState)(contactFieldsRef.current.some(function (field) {
      return !field.valid;
    })),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    submitDisabled = _useState2[0],
    setSubmitDisabled = _useState2[1];
  var _useState3 = (0,react.useState)(false),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    agreedToPrivacyPolicy = _useState4[0],
    setAgreedToPrivacyPolicy = _useState4[1];
  var _useState5 = (0,react.useState)(false),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    agreedToGDPR = _useState6[0],
    setAgreedToGDPR = _useState6[1];
  var setFieldValid = function setFieldValid(index, isValid) {
    contactFieldsRef.current[index].valid = isValid;
    setSubmitDisabled(contactFieldsRef.current.some(function (field) {
      return !field.valid;
    }));
  };
  var setFieldUserInput = function setFieldUserInput(index, userInput) {
    contactFieldsRef.current[index].userInput = userInput;
  };
  var setPrivacyPolicy = function setPrivacyPolicy(e) {
    setAgreedToPrivacyPolicy(e.target.checked);
  };
  var setGDPR = function setGDPR(e) {
    setAgreedToGDPR(e.target.checked);
  };
  var submitForm = function submitForm() {
    var responses = contactFieldsRef.current.map(function (_ref) {
      var fieldName = _ref.fieldName,
        userInput = _ref.userInput;
      return {
        name: fieldName,
        value: userInput !== null && userInput !== void 0 ? userInput : ''
      };
    });
    if (attributes.gdprCompliance.active) {
      responses.push({
        name: 'GDPR',
        value: agreedToGDPR ? 'Yes' : 'No'
      });
    }
    var email = contactFieldsRef.current.find(function (_ref2) {
      var validation = _ref2.validation;
      return validation === 'email';
    });
    sendDataToSqs({
      it: InteractivityType.CONTACT_FORM,
      ch: hash,
      eid: props.elementId,
      responses: responses,
      ts: Math.floor(new Date().getTime() / 1000),
      md: {
        gdpr: agreedToGDPR,
        pp: agreedToPrivacyPolicy,
        email: (email === null || email === void 0 ? void 0 : email.userInput) || ''
      }
    }, getInteractivityElementsEndpoint()).then(function () {
      setModalStep(InteractivityModalStep.SUCCESSFUL_SEND_RESPONSE);
    });
  };
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(FormTitle, {
    tabIndex: TabIndex.DEFAULT,
    modalWidth: props.modalWidth
  }, attributes.formName), attributes.description && /*#__PURE__*/react.createElement(FormDescription, {
    tabIndex: TabIndex.DEFAULT
  }, attributes.description), /*#__PURE__*/react.createElement(CollectDataContainer, null, /*#__PURE__*/react.createElement(LeadFormDataContainer, null, contactFieldsRef.current.map(function (field, index) {
    return /*#__PURE__*/react.createElement(Input_ModalFormInputContainer, {
      key: field.id,
      field: field,
      index: index,
      setFieldValid: setFieldValid,
      setFieldUserInput: setFieldUserInput
    });
  })), (attributes.privacyPolicy.active || attributes.gdprCompliance.active) && /*#__PURE__*/react.createElement(AgreementContainer, null, attributes.privacyPolicy.active && /*#__PURE__*/react.createElement(PrivacyPolicyAgreement_PrivacyPolicyAgreement, {
    companyName: attributes.privacyPolicy.companyName,
    privacyPolicyURL: attributes.privacyPolicy.policyLink,
    onChangePrivacyPolicy: setPrivacyPolicy
  }), attributes.gdprCompliance.active && /*#__PURE__*/react.createElement(GDPRAgreement_GDPRAgreement, {
    gdprMessage: attributes.gdprCompliance.message,
    onChangeGDPRAgreement: setGDPR
  }))), /*#__PURE__*/react.createElement(ButtonsContainer, null, /*#__PURE__*/react.createElement(ModalContentStyles_SubmitButton, {
    disabled: submitDisabled || attributes.privacyPolicy.active && !agreedToPrivacyPolicy,
    onClick: submitForm,
    "aria-label": attributes.buttonLabel,
    tabIndex: TabIndex.DEFAULT
  }, attributes.buttonLabel)));
};
/* harmony default export */ var ContactFormModal_ContactFormDetails = (ContactFormDetails);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ContactFormModal/ContactFormModal.tsx






var ContactFormModal = function ContactFormModal(props) {
  var modalStep = react_useAtomValue(modalStepAtom);
  var setModalStep = react_useSetAtom(setModalStepAtom);
  (0,react.useEffect)(function () {
    setModalStep(InteractivityModalStep.DEFAULT);
  }, [setModalStep]);
  if (modalStep && modalStep === InteractivityModalStep.SUCCESSFUL_SEND_RESPONSE) {
    return /*#__PURE__*/react.createElement(SuccessfulSendResponse_SuccessfulSendResponse, {
      thankYouMessage: props.attributes.thankYouMessage
    });
  }
  return /*#__PURE__*/react.createElement(ContactFormModal_ContactFormDetails, {
    attributes: props.attributes,
    modalWidth: props.modalWidth,
    elementId: props.elementId
  });
};
/* harmony default export */ var ContactFormModal_ContactFormModal = (ContactFormModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/ContactFormActionContainer/ContactFormActionContainer.tsx


function ContactFormActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function ContactFormActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ContactFormActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ContactFormActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }









var ContactFormActionContainer = function ContactFormActionContainer(props) {
  var theme = Ze();
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var modalWidth = stageSize.width <= theme.deviceSize.tabletS ? 'auto' : "".concat(theme.leadForm.popoverSizes.width, "px");
  var pageId = props.pageId,
    elementIndex = props.elementIndex;
  var element = useElement({
    pageId: pageId,
    elementIndex: elementIndex
  });
  var attributes = ContactFormActionContainer_objectSpread(ContactFormActionContainer_objectSpread({}, defaultContactForm), element.attributes);
  return /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, null, /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    identifier: "".concat(pageId, "-").concat(elementIndex),
    height: "auto",
    width: modalWidth,
    ariaLabel: attributes !== null && attributes !== void 0 && attributes.tooltip ? attributes === null || attributes === void 0 ? void 0 : attributes.tooltip : ''
  }, /*#__PURE__*/react.createElement(ContactFormModal_ContactFormModal, {
    elementId: element.id,
    attributes: attributes,
    modalWidth: modalWidth
  })));
};
/* harmony default export */ var ContactFormActionContainer_ContactFormActionContainer = (ContactFormActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/PhotoSlideshowActionContainer/PhotoSlideshow.tsx









var PhotoSlideshowDefaultProps = {
  slideInterval: 5,
  hideBullets: false,
  hideArrows: false,
  autoplay: false,
  scale: FIT
};
var PhotoSlideshow = function PhotoSlideshow(_ref) {
  var width = _ref.width,
    height = _ref.height,
    media = _ref.media,
    _ref$hideBullets = _ref.hideBullets,
    hideBullets = _ref$hideBullets === void 0 ? PhotoSlideshowDefaultProps.hideBullets : _ref$hideBullets,
    _ref$hideArrows = _ref.hideArrows,
    hideArrows = _ref$hideArrows === void 0 ? PhotoSlideshowDefaultProps.hideArrows : _ref$hideArrows,
    _ref$autoplay = _ref.autoplay,
    autoplay = _ref$autoplay === void 0 ? PhotoSlideshowDefaultProps.autoplay : _ref$autoplay,
    _ref$slideInterval = _ref.slideInterval,
    slideInterval = _ref$slideInterval === void 0 ? PhotoSlideshowDefaultProps.slideInterval : _ref$slideInterval,
    _ref$scale = _ref.scale,
    scale = _ref$scale === void 0 ? PhotoSlideshowDefaultProps.scale : _ref$scale;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    accountId = _useAtom2[0].link.accountId;
  var _useAtom3 = react_useAtom(rootPrimitivesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    downloadMode = _useAtom4[0].downloadMode;
  var slideIntervalMilliseconds = slideInterval * 1000;
  var getImageSrc = function getImageSrc(src, provider) {
    var imgSrc = getImageResourcePath(accountId, {
      src: src,
      provider: provider
    });

    // If is downloadMode we use the original image
    if (downloadMode) {
      return "".concat(imgSrc, ".jpg");
    }
    return getImageAppendedSrc({
      width: width,
      height: height,
      imgSrc: imgSrc,
      isImageFilled: OBJECT_FIT[scale] === OBJECT_FIT.fill
    });
  };
  return /*#__PURE__*/react.createElement(src_Slideshow, {
    getImageSrc: getImageSrc,
    width: width,
    height: height,
    items: media,
    slideInterval: slideIntervalMilliseconds,
    showBullets: !hideBullets,
    showArrows: !hideArrows,
    autoplay: autoplay,
    isIOS: main/* isIOS */.un,
    objectFit: OBJECT_FIT[scale],
    disableKeyDown: false
  });
};
/* harmony default export */ var PhotoSlideshowActionContainer_PhotoSlideshow = (PhotoSlideshow);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/PhotoSlideshowActionContainer/PhotoSlideshowActionContainer.tsx


function PhotoSlideshowActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function PhotoSlideshowActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? PhotoSlideshowActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : PhotoSlideshowActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }














var PhotoSlideshowActionContainer = function PhotoSlideshowActionContainer(_ref) {
  var _attributes$media, _attributes$media3, _attributes$media4;
  var elementIndex = _ref.elementIndex,
    pageId = _ref.pageId;
  var element = useElement({
    elementIndex: elementIndex,
    pageId: pageId
  });
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var attributes = PhotoSlideshowActionContainer_objectSpread({}, element.attributes);
  var _useAtom3 = react_useAtom(featuresAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    PHOTO_SLIDESHOW = _useAtom4[0].PHOTO_SLIDESHOW;
  var _attributes$size = attributes.size,
    desiredSize = _attributes$size === void 0 ? LARGE : _attributes$size,
    _attributes$showPhoto = attributes.showPhotoSlideshowBackground,
    showPhotoSlideshowBackground = _attributes$showPhoto === void 0 ? false : _attributes$showPhoto;
  var showBackground = attributes !== null && attributes !== void 0 && (_attributes$media = attributes.media) !== null && _attributes$media !== void 0 && _attributes$media.length ? showPhotoSlideshowBackground : true;
  var _getModalResponsivene = getModalResponsiveness(stageSize, desiredSize),
    responsiveWidth = _getModalResponsivene.responsiveWidth,
    responsiveHeight = _getModalResponsivene.responsiveHeight;
  var _getContentWithoutPad = getContentWithoutPadding({
      responsiveWidth: responsiveWidth,
      responsiveHeight: responsiveHeight
    }),
    contentWidth = _getContentWithoutPad.contentWidth,
    contentHeight = _getContentWithoutPad.contentHeight;
  var getContent = function getContent() {
    var _attributes$media2;
    if (!(attributes !== null && attributes !== void 0 && (_attributes$media2 = attributes.media) !== null && _attributes$media2 !== void 0 && _attributes$media2.length)) {
      return /*#__PURE__*/react.createElement(SpotlightActionContainer_SpotlightEmptyState, {
        stageWidth: stageSize.width,
        stageHeight: stageSize.height
      });
    }
    return /*#__PURE__*/react.createElement(PhotoSlideshowActionContainer_PhotoSlideshow, {
      width: showBackground ? contentWidth : responsiveWidth,
      height: showBackground ? contentHeight : responsiveHeight,
      slideInterval: attributes.slideInterval,
      media: attributes.media,
      hideBullets: attributes.hideBullets,
      hideArrows: attributes.hideArrows,
      autoplay: attributes.autoplay,
      scale: attributes.scale
    });
  };
  if (!PHOTO_SLIDESHOW) {
    return null;
  }
  return /*#__PURE__*/react.createElement(HyperlinkElementLayer, null, /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: attributes !== null && attributes !== void 0 && (_attributes$media3 = attributes.media) !== null && _attributes$media3 !== void 0 && _attributes$media3.length ? "".concat(responsiveWidth, "px") : 'auto',
    height: attributes !== null && attributes !== void 0 && (_attributes$media4 = attributes.media) !== null && _attributes$media4 !== void 0 && _attributes$media4.length ? "".concat(responsiveHeight, "px") : 'auto',
    identifier: "".concat(pageId, "-").concat(elementIndex),
    modalWithoutPadding: !showBackground,
    opacity: showBackground ? backgroundOpacity.opaque : backgroundOpacity.transparent,
    ariaLabel: attributes !== null && attributes !== void 0 && attributes.tooltip ? attributes === null || attributes === void 0 ? void 0 : attributes.tooltip : ''
  }, getContent()));
};
PhotoSlideshowActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var PhotoSlideshowActionContainer_PhotoSlideshowActionContainer = (PhotoSlideshowActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/PhotoSlideshowActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/QuizActionContainer/QuizActionContainer.tsx


function QuizActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function QuizActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? QuizActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : QuizActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }











var QuizActionContainer = function QuizActionContainer(props) {
  var theme = Ze();
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var _useAtom = react_useAtom(stageSizeWidthAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    width = _useAtom2[0];
  var modalStep = react_useAtomValue(modalStepAtom);
  var attributes = QuizActionContainer_objectSpread(QuizActionContainer_objectSpread({}, defaultQuiz), element.attributes);
  var ariaLabel = attributes.tooltip || attributes.formName;
  var modalWidth = width <= theme.deviceSize.tabletS ? 'auto' : "".concat(theme.leadForm.popoverSizes.width, "px");

  // Return null if no questions are set (OLD QUIZ)
  if (!attributes || !attributes.questions || !attributes.questions.length) {
    return null;
  }
  return /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, null, /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: modalWidth,
    height: "auto",
    identifier: "".concat(props.pageId, "-").concat(props.elementIndex),
    ariaLabel: attributes.mandatory ? "Mandatory: ".concat(ariaLabel) : ariaLabel,
    modalWithoutPadding: true
  }, /*#__PURE__*/react.createElement(providers_QuizProviderContainer, null, /*#__PURE__*/react.createElement(InteractivityModal_QuizManager, {
    pageId: props.pageId,
    elementId: props.elementId,
    elementIndex: props.elementIndex,
    modalStep: modalStep
  }))));
};
/* harmony default export */ var QuizActionContainer_QuizActionContainer = (QuizActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/QuizActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useModalCloseButtonHeight.ts
/* harmony default export */ var useModalCloseButtonHeight = (function (theme) {
  return theme.button.close.height + theme.button.close.spacing;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getModalDynamicContent.tsx

/**
 * Calculate the value of the content from modal when we have dynamic size media and text in modal
 * @param mediaSize
 * @param stageSize
 * @param hasText
 * return object
 */

var BOTTOM_TEXT_MAX_HEIGHT = 64;
var LOADING_MODAL_SIZE = 240;
/* harmony default export */ var getModalDynamicContent = (function (mediaSize, stageSize, hasText, theme) {
  var MODAL_CLOSE_BUTTON_HEIGHT = useModalCloseButtonHeight(theme);
  var size = {
    width: LOADING_MODAL_SIZE,
    height: LOADING_MODAL_SIZE
  };
  var modalContentMaxHeight = stageSize.height - 4 * theme.modal.padding - MODAL_CLOSE_BUTTON_HEIGHT;
  var modalContentMaxWidth = stageSize.width - 4 * theme.modal.padding;

  // Breakpoint on mobile
  if (stageSize.width <= theme.deviceSize.tabletS) {
    modalContentMaxWidth = stageSize.width - 2 * theme.modal.padding - 2 * theme.modal.mobilePadding;
    modalContentMaxHeight = stageSize.height - 2 * theme.modal.padding - 2 * theme.modal.mobilePadding - MODAL_CLOSE_BUTTON_HEIGHT;
  }
  // If we have text we remove the size of it to get the media height
  if (hasText) {
    modalContentMaxHeight -= BOTTOM_TEXT_MAX_HEIGHT;
  }

  // If it is larger then the Modal content available space we get the scale so we can fit the image in
  // and at the end we need to sum the height with the texts height value
  if (mediaSize.height >= modalContentMaxHeight || mediaSize.width >= modalContentMaxWidth) {
    var scale = Math.min(modalContentMaxWidth / mediaSize.width, modalContentMaxHeight / mediaSize.height);
    var newWidth = mediaSize.width * scale;
    var newHeight = mediaSize.height * scale;
    size = {
      width: newWidth,
      height: hasText ? newHeight + BOTTOM_TEXT_MAX_HEIGHT : newHeight
    };
  } else {
    size = {
      width: mediaSize.width,
      height: hasText ? mediaSize.height + BOTTOM_TEXT_MAX_HEIGHT : mediaSize.height
    };
  }
  return {
    width: size.width,
    height: size.height
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/VideoActionContainer/VideoActionContainer.tsx


function VideoActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function VideoActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? VideoActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : VideoActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }











var VideoActionContainer = function VideoActionContainer(props) {
  var theme = Ze();
  var MODAL_CLOSE_BUTTON_HEIGHT = useModalCloseButtonHeight(theme);
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var attributes = VideoActionContainer_objectSpread({}, element.attributes);
  var size = attributes.size;
  var _useState = (0,react.useState)(true),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    loading = _useState2[0],
    setLoading = _useState2[1];
  var elementWidth = parseInt(size.split(',')[0], 10);
  var elementHeight = parseInt(size.split(',')[1], 10);
  var modalPadding = stageSize.width <= theme.deviceSize.tabletS ? theme.modal.mobilePadding : theme.modal.padding;
  if (size === 'fullscreen') {
    elementHeight = stageSize.height - 4 * modalPadding - MODAL_CLOSE_BUTTON_HEIGHT;
    elementWidth = stageSize.width - 4 * modalPadding;
  }
  var _useState3 = (0,react.useState)({
      width: elementWidth,
      height: elementHeight
    }),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    newSize = _useState4[0],
    setNewSize = _useState4[1];
  (0,react.useEffect)(function () {
    var isStageInitialized = !!(stageSize.width && stageSize.height);
    if (isStageInitialized) {
      setNewSize(getModalDynamicContent({
        width: elementWidth,
        height: elementHeight
      }, stageSize, false, theme));
      setLoading(false);
    }
  }, [stageSize.width, stageSize.height]);
  return /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, null, /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: "".concat(newSize.width + 2 * modalPadding, "px"),
    height: "".concat(newSize.height + 2 * modalPadding, "px"),
    modalHeight: "".concat(newSize.height + 2 * modalPadding, "px"),
    loading: loading,
    identifier: "".concat(props.pageId, "-").concat(props.elementIndex),
    ariaLabel: attributes.tooltip
  }, /*#__PURE__*/react.createElement(Elements_VideoWidgetElement, {
    height: newSize.height,
    width: newSize.width,
    ytlink: attributes.ytlink,
    stageIndex: props.stageIndex,
    tooltip: attributes.tooltip
  })));
};
VideoActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  stageIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var VideoActionContainer_VideoActionContainer = (VideoActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/VideoActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/TagImageModal/TagImageModalStyles.ts


var ScrollableContainer = styled_components_browser_esm.div.withConfig({
  displayName: "TagImageModalStyles__ScrollableContainer",
  componentId: "sc-1v3cxp7-0"
})(["overflow-y:auto;max-height:48px;margin-top:", "px;overflow-x:hidden;"], function (_ref) {
  var margin = _ref.margin;
  return margin;
});
var TagImageModalStyles_Image = styled_components_browser_esm.div.withConfig({
  displayName: "TagImageModalStyles__Image",
  componentId: "sc-1v3cxp7-1"
})(["width:100%;flex:1;background-image:url(", ");background-size:contain;background-repeat:no-repeat;background-position:center;"], function (_ref2) {
  var url = _ref2.url;
  return url;
});
var TagModalContent = styled_components_browser_esm.div.attrs(function (props) {
  return {
    style: {
      height: "".concat(props.$height, "px"),
      width: "".concat(props.$width, "px")
    }
  };
}).withConfig({
  displayName: "TagImageModalStyles__TagModalContent",
  componentId: "sc-1v3cxp7-2"
})(["display:flex;flex-direction:column;margin:auto;"]);
var PopoverContentContainer = styled_components_browser_esm.div.withConfig({
  displayName: "TagImageModalStyles__PopoverContentContainer",
  componentId: "sc-1v3cxp7-3"
})(["display:flex;justify-content:space-between;"]);
var TagImageModalStyles_PopoverScrollableContainer = styled_components_browser_esm.div.withConfig({
  displayName: "TagImageModalStyles__PopoverScrollableContainer",
  componentId: "sc-1v3cxp7-4"
})(["overflow-y:auto;max-height:", "px;display:block;width:100%;"], SCROLLABLE_POPOVER_MAX_HEIGHT);
var ButtonContainer = styled_components_browser_esm.div.withConfig({
  displayName: "TagImageModalStyles__ButtonContainer",
  componentId: "sc-1v3cxp7-5"
})(["margin-top:16px;"]);
var TagImageModalStyles_Close = styled_components_browser_esm.button.withConfig({
  displayName: "TagImageModalStyles__Close",
  componentId: "sc-1v3cxp7-6"
})(["display:flex;order:2;border:0;margin-top:4px;background:transparent;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/TagImageModal/TagImageModal.tsx









var INITIAL_MODAL_SIZE = 240;
var TagImageModal = function TagImageModal(props) {
  var theme = Ze();
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var _useState = (0,react.useState)(true),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    loading = _useState2[0],
    setLoading = _useState2[1];
  var _useState3 = (0,react.useState)({
      width: INITIAL_MODAL_SIZE,
      height: INITIAL_MODAL_SIZE
    }),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    size = _useState4[0],
    setSize = _useState4[1];
  var imgSizeRef = (0,react.useRef)({
    width: INITIAL_MODAL_SIZE,
    height: INITIAL_MODAL_SIZE
  });
  var modalPadding = stageSize.width <= theme.deviceSize.tabletS ? theme.modal.mobilePadding : theme.modal.padding;
  (0,react.useEffect)(function () {
    var img = new Image();
    img.src = props.url;
    img.onload = function () {
      imgSizeRef.current = {
        width: img.width,
        height: img.height
      };
      setLoading(false);
    };
  }, []);
  (0,react.useEffect)(function () {
    var isInitialModalSize = imgSizeRef.current.width !== INITIAL_MODAL_SIZE && imgSizeRef.current.height !== INITIAL_MODAL_SIZE;
    var isStageInitialized = stageSize.width && stageSize.height;
    if (isStageInitialized && isInitialModalSize) {
      setSize(getModalDynamicContent({
        width: imgSizeRef.current.width,
        height: imgSizeRef.current.height
      }, stageSize, !!props.text, theme));
    }
  }, [stageSize.width, stageSize.height, imgSizeRef.current.width, imgSizeRef.current.height]);
  return /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: "".concat(size.width + 2 * modalPadding, "px"),
    height: "".concat(size.height + 2 * modalPadding, "px"),
    loading: loading,
    modalHeight: "".concat(size.height + 2 * modalPadding, "px"),
    identifier: "".concat(props.pageId, "-").concat(props.elementIndex)
  }, /*#__PURE__*/react.createElement(TagModalContent, {
    $height: size.height,
    $width: size.width
  }, /*#__PURE__*/react.createElement(TagImageModalStyles_Image, {
    url: props.url
  }), /*#__PURE__*/react.createElement(ScrollableContainer, {
    margin: props.text ? 16 : 0
  }, /*#__PURE__*/react.createElement(Paragraph, null, props.text))));
};
/* harmony default export */ var TagImageModal_TagImageModal = (TagImageModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/TagImageModal/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/TagVideoModal/TagVideoModal.tsx










var TagVideoModal_LOADING_MODAL_SIZE = 240;
var TagVideoModal_BOTTOM_TEXT_MAX_HEIGHT = 64;
var YOUTUBE_VIDEO_RATIO = 1.77;
var TagVideoModal = function TagVideoModal(props) {
  var theme = Ze();
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var _useState = (0,react.useState)(true),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    loading = _useState2[0],
    setLoading = _useState2[1];
  var _useState3 = (0,react.useState)({
      width: TagVideoModal_LOADING_MODAL_SIZE,
      height: TagVideoModal_LOADING_MODAL_SIZE
    }),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    size = _useState4[0],
    setSize = _useState4[1];
  var modalPadding = stageSize.width <= theme.deviceSize.tabletS ? theme.modal.mobilePadding : theme.modal.padding;
  (0,react.useEffect)(function () {
    var isStageInitialized = stageSize.width && stageSize.height;
    if (isStageInitialized) {
      setSize(getModalDynamicContent({
        width: stageSize.width,
        height: stageSize.width / YOUTUBE_VIDEO_RATIO
      }, stageSize, !!props.text, theme));
      setLoading(false);
    }
  }, [stageSize.width, stageSize.height]);
  return /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: "".concat(size.width + 2 * modalPadding, "px"),
    height: "".concat(size.height + 2 * modalPadding, "px"),
    modalHeight: "".concat(size.height + 2 * modalPadding, "px"),
    loading: loading,
    identifier: "".concat(props.pageId, "-").concat(props.elementIndex)
  }, /*#__PURE__*/react.createElement(TagModalContent, {
    $height: size.height,
    $width: size.width
  }, /*#__PURE__*/react.createElement(Elements_VideoWidgetElement, {
    height: !props.text ? size.height : size.height - TagVideoModal_BOTTOM_TEXT_MAX_HEIGHT,
    width: size.width,
    ytlink: props.url,
    stageIndex: props.stageIndex
  }), /*#__PURE__*/react.createElement(ScrollableContainer, {
    margin: props.text ? 16 : 0
  }, /*#__PURE__*/react.createElement(Paragraph, null, props.text))));
};
/* harmony default export */ var TagVideoModal_TagVideoModal = (TagVideoModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/TagVideoModal/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/TagActionContainer/components/DefaultPopoverContent.tsx











var DefaultPopoverContent = function DefaultPopoverContent(_ref) {
  var text = _ref.text,
    url = _ref.url,
    _ref$label = _ref.label,
    label = _ref$label === void 0 ? 'Open link' : _ref$label;
  var context = (0,react.useContext)(contexts_ModalContext);
  var refContainer = react.useRef(null);
  var onCloseHandler = function onCloseHandler() {
    return context.setOpen('');
  };
  var onKeyDownHandler = function onKeyDownHandler(event) {
    if (event.code === KeyboardCodes.SPACE || event.code === KeyboardCodes.ENTER) {
      context.setOpen('');
    }
  };
  useTrapFocus(refContainer, [context]);
  return /*#__PURE__*/react.createElement(PopoverContentContainer, {
    ref: refContainer
  }, /*#__PURE__*/react.createElement(TagImageModalStyles_Close, {
    "aria-label": "Close",
    tabIndex: TabIndex.DEFAULT,
    onClick: onCloseHandler,
    onKeyDown: onKeyDownHandler
  }, /*#__PURE__*/react.createElement(src.CloseIcon, null)), /*#__PURE__*/react.createElement("div", null, text && /*#__PURE__*/react.createElement(TagImageModalStyles_PopoverScrollableContainer, null, /*#__PURE__*/react.createElement(Paragraph, {
    tabIndex: TabIndex.DEFAULT
  }, text)), !!url && !!label && /*#__PURE__*/react.createElement(ButtonContainer, null, /*#__PURE__*/react.createElement(Anchor_Anchor, {
    href: getValidHref(url),
    target: "_blank",
    rel: elements_ELEMENT_LINKS_REL_DEFAULT_REL,
    tabIndex: TabIndex.DEFAULT,
    ariaLabel: label
  }, /*#__PURE__*/react.createElement(NativeButton, {
    "aria-hidden": true
  }, label)))));
};
/* harmony default export */ var components_DefaultPopoverContent = (DefaultPopoverContent);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/TagActionContainer/TagActionContainer.tsx

function TagActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function TagActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? TagActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : TagActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }













var TagActionContainer = function TagActionContainer(props) {
  var theme = Ze();
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var _element$bounds = element.bounds,
    width = _element$bounds.width,
    height = _element$bounds.height,
    x = _element$bounds.x,
    y = _element$bounds.y;
  var attributes = TagActionContainer_objectSpread({}, element.attributes);
  var getContent = function getContent() {
    if (Number.isInteger(attributes.tagType)) {
      switch (attributes.tagType) {
        case TagActionTypes.VIDEO:
          {
            if (typeof attributes.tagUrl === 'string' && attributes.tagUrl.length) {
              return /*#__PURE__*/react.createElement(TagVideoModal_TagVideoModal, {
                text: attributes.text,
                url: attributes.tagUrl,
                pageId: props.pageId,
                elementIndex: props.elementIndex,
                stageIndex: props.stageIndex
              });
            }
            break;
          }
        case TagActionTypes.IMAGE:
          {
            if (typeof attributes.tagUrl === 'string' && attributes.tagUrl.length) {
              return /*#__PURE__*/react.createElement(TagImageModal_TagImageModal, {
                text: attributes.text,
                url: attributes.tagUrl,
                pageId: props.pageId,
                elementIndex: props.elementIndex
              });
            }
            break;
          }
        case TagActionTypes.TEXT:
          {
            if (typeof attributes.text === 'string' && attributes.text.length) {
              return /*#__PURE__*/react.createElement(PopoverActionContainer_PopoverActionContainer, {
                popoverWidth: "".concat(theme.popoverSizes.default.width, "px"),
                popoverHeight: "auto",
                elementY: y,
                elementX: x,
                elementWidth: width,
                elementHeight: height,
                offsetX: props.offsetX,
                isFirstPage: props.isFirstPage,
                identifier: "".concat(props.pageId, "-").concat(props.elementIndex)
              }, /*#__PURE__*/react.createElement(components_DefaultPopoverContent, {
                text: attributes.text,
                url: attributes.tagUrl
              }));
            }
            break;
          }
        case TagActionTypes.LINK:
          {
            if (typeof attributes.text === 'string' && attributes.text.length) {
              return /*#__PURE__*/react.createElement(PopoverActionContainer_PopoverActionContainer, {
                popoverWidth: "".concat(theme.popoverSizes.widthText.width, "px"),
                popoverHeight: "auto",
                elementY: y,
                elementX: x,
                elementWidth: width,
                elementHeight: height,
                offsetX: props.offsetX,
                isFirstPage: props.isFirstPage,
                identifier: "".concat(props.pageId, "-").concat(props.elementIndex)
              }, /*#__PURE__*/react.createElement(components_DefaultPopoverContent, {
                text: attributes.text,
                url: attributes.tagUrl,
                label: attributes.label
              }));
            }
            if (typeof attributes.tagUrl === 'string' && attributes.tagUrl.length) {
              return /*#__PURE__*/react.createElement(Anchor_Anchor, {
                target: "_blank",
                href: getValidHref(attributes.tagUrl),
                tabIndex: TabIndex.DEFAULT
              });
            }
            return null;
          }
        default:
          break;
      }
    }
    return null;
  };
  return /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, null, getContent());
};
TagActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  offsetX: (prop_types_default()).number.isRequired,
  isFirstPage: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var TagActionContainer_TagActionContainer = (TagActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/TagActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/ProductModal.styles.tsx




var ProductContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__ProductContainer",
  componentId: "sc-f2ul3z-0"
})(["display:flex;max-width:900px;flex-direction:", ";"], function (_ref) {
  var theme = _ref.theme,
    $stageWidth = _ref.$stageWidth;
  return $stageWidth <= theme.deviceSize.tabletS ? 'column' : 'row';
});
var ProductModal_styles_ProductInfoContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__ProductInfoContainer",
  componentId: "sc-f2ul3z-1"
})(["text-align:left;max-width:580px;display:flex;flex-direction:column;justify-content:flex-start;overflow:hidden;white-space:nowrap;"]);
var ProductModal_styles_ScrollableContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__ScrollableContainer",
  componentId: "sc-f2ul3z-2"
})(["overflow-y:auto;overflow-x:hidden;max-height:276px;padding-right:20px;margin-bottom:24px;", ""], function (props) {
  if (props.stageWidth <= props.theme.deviceSize.tabletS) {
    return "\n             max-height: 100%;\n             margin-top: 24px;\n            ";
  }
  return '';
});
var ProductModal_styles_Title = styled_components_browser_esm(H2).withConfig({
  displayName: "ProductModalstyles__Title",
  componentId: "sc-f2ul3z-3"
})(["margin-bottom:8px;word-break:break-word;white-space:pre-line;"]);
var ProductId = styled_components_browser_esm(Paragraph).withConfig({
  displayName: "ProductModalstyles__ProductId",
  componentId: "sc-f2ul3z-4"
})(["opacity:0.6;"]);
var ProductModal_styles_Description = styled_components_browser_esm(Paragraph).withConfig({
  displayName: "ProductModalstyles__Description",
  componentId: "sc-f2ul3z-5"
})(["word-break:break-word;white-space:pre-line;"]);
var HrInProductTag = styled_components_browser_esm.hr.withConfig({
  displayName: "ProductModalstyles__HrInProductTag",
  componentId: "sc-f2ul3z-6"
})(["margin:16px 0;opacity:0.3;"]);
var PriceSection = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__PriceSection",
  componentId: "sc-f2ul3z-7"
})(["display:flex;justify-content:start;align-items:end;gap:32px;"]);
var Price = styled_components_browser_esm(H2).withConfig({
  displayName: "ProductModalstyles__Price",
  componentId: "sc-f2ul3z-8"
})(["word-break:break-word;white-space:pre-line;display:flex;"]);
var FullPrice = styled_components_browser_esm.h3.withConfig({
  displayName: "ProductModalstyles__FullPrice",
  componentId: "sc-f2ul3z-9"
})(["font-family:", ";font-size:", "px;line-height:", "px;font-weight:unset;text-decoration:line-through;display:inline-block;opacity:0.4;margin:0;"], function (_ref2) {
  var theme = _ref2.theme;
  return theme.typography.family.sans;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.typography.size.smallerParagraph;
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.typography.lineHeight.smallerParagraph;
});
var AdjacentButtons = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__AdjacentButtons",
  componentId: "sc-f2ul3z-10"
})(["margin-top:24px;display:flex;", " gap:8px;align-items:center;"], function (props) {
  return props.$stageWidth < props.theme.deviceSize.tabletS && 'flex-direction: column-reverse;';
});
var ViewWebsite = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__ViewWebsite",
  componentId: "sc-f2ul3z-11"
})(["min-width:", "px;", ""], function (props) {
  return props.theme.modal.shoppingList.minWidthButton;
}, function (props) {
  return props.$stageWidth && props.$stageWidth < props.theme.deviceSize.tabletS && 'width: 100%;';
});
var StyledNativeButton = styled_components_browser_esm(NativeButton).withConfig({
  displayName: "ProductModalstyles__StyledNativeButton",
  componentId: "sc-f2ul3z-12"
})(["", " padding:8px 16px;color:", ";display:inline-block;min-width:", "px;", " white-space:nowrap;overflow:hidden;text-overflow:ellipsis;", " &:hover{filter:saturate(70%);}"], function (props) {
  return props.$backgroundColor && "background-color: ".concat(props.$backgroundColor, ";");
}, function (props) {
  return props.$labelColor || '';
}, function (props) {
  return props.theme.modal.shoppingList.minWidthButton;
}, function (props) {
  return props.$stageWidth && props.$stageWidth < props.theme.deviceSize.tabletS && 'width: 100%;';
}, function (props) {
  return props.$disabled ? "\n        pointer-events: none;\n        background: ".concat(props.theme.colors.withOpacity(ColorsWithOpacity.DISABLED, 0.12), ";\n        color: ").concat(props.theme.colors.withOpacity(ColorsWithOpacity.DISABLED, 0.40), ";\n        ") : '';
});
var ProductModal_styles_ProductPhotosContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__ProductPhotosContainer",
  componentId: "sc-f2ul3z-13"
})(["margin:", ";"], function (props) {
  return props.stageWidth <= props.theme.deviceSize.tabletS ? '0 auto;' : "0 ".concat(props.marginRight, "px 0 0;");
});
var ProductMainImage = styled_components_browser_esm.img.withConfig({
  displayName: "ProductModalstyles__ProductMainImage",
  componentId: "sc-f2ul3z-14"
})(["display:block;width:", "px;height:", "px;object-fit:contain;margin:0 auto;border-radius:", "px;"], function (props) {
  return props.imageSize.width;
}, function (props) {
  return props.imageSize.height;
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.defaults.borderRadius;
});
var ProductPreviewImagesContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__ProductPreviewImagesContainer",
  componentId: "sc-f2ul3z-15"
})(["display:flex;margin-top:8px;", ""], function (props) {
  return props.stageWidth <= props.theme.deviceSize.tabletS && 'justify-content: center;';
});
var ProductPreviewImage = styled_components_browser_esm.img.withConfig({
  displayName: "ProductModalstyles__ProductPreviewImage",
  componentId: "sc-f2ul3z-16"
})(["width:88px;height:88px;object-fit:contain;border-radius:", "px;margin-right:8px;cursor:pointer;opacity:", ";transition:.1s opacity ease-in;&:hover{opacity:0.8;}&:last-child{margin-right:0;}"], function (_ref6) {
  var theme = _ref6.theme;
  return theme.defaults.borderRadius;
}, function (props) {
  return props.$opacity;
});
var AttributesWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__AttributesWrapper",
  componentId: "sc-f2ul3z-17"
})(["gap:20px;display:flex;flex-wrap:wrap;margin-bottom:", ";"], function (_ref7) {
  var hasQuantity = _ref7.hasQuantity;
  return hasQuantity ? '24px' : '48px';
});
var CustomizableProductContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__CustomizableProductContainer",
  componentId: "sc-f2ul3z-18"
})(["display:flex;flex-direction:column;margin-bottom:24px;"]);
var PaidPersonalizationContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__PaidPersonalizationContainer",
  componentId: "sc-f2ul3z-19"
})(["display:flex;flex-direction:row;gap:8px;align-items:center;margin-bottom:16px;"]);
var PaidPersonalizationTitle = styled_components_browser_esm(H4).withConfig({
  displayName: "ProductModalstyles__PaidPersonalizationTitle",
  componentId: "sc-f2ul3z-20"
})(["font-weight:", ";"], function (_ref8) {
  var theme = _ref8.theme;
  return theme.typography.weight.medium;
});
var PaidPersonalizationChipText = styled_components_browser_esm(H5).withConfig({
  displayName: "ProductModalstyles__PaidPersonalizationChipText",
  componentId: "sc-f2ul3z-21"
})(["font-weight:", ";"], function (_ref9) {
  var theme = _ref9.theme;
  return theme.typography.weight.medium;
});
var PaidPersonalizationChip = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__PaidPersonalizationChip",
  componentId: "sc-f2ul3z-22"
})(["padding:", ";background-color:", ";border-radius:", ";"], function (_ref10) {
  var theme = _ref10.theme;
  return theme.chip.padding;
}, function (_ref11) {
  var theme = _ref11.theme;
  return theme.chip.backgroundColor;
}, function (_ref12) {
  var theme = _ref12.theme;
  return theme.chip.borderRadius;
});
var ThumbWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "ProductModalstyles__ThumbWrapper",
  componentId: "sc-f2ul3z-23"
})(["width:56px;height:56px;overflow:hidden;border-radius:8px;display:flex;align-items:center;justify-content:center;background-color:#fff;padding:4px;"]);
var ThumbImage = styled_components_browser_esm.img.withConfig({
  displayName: "ProductModalstyles__ThumbImage",
  componentId: "sc-f2ul3z-24"
})(["width:100%;height:100%;object-fit:cover;border-radius:8px;display:block;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/Partials/PriceDetails.tsx



var PriceDetails = function PriceDetails(_ref) {
  var price = _ref.price,
    discountPrice = _ref.discountPrice,
    _ref$currency = _ref.currency,
    currency = _ref$currency === void 0 ? '' : _ref$currency;
  if (price) {
    return /*#__PURE__*/react.createElement("div", null, !!discountPrice && /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(FullPrice, {
      tabIndex: TabIndex.DEFAULT,
      "aria-label": "Price: ".concat(price, " ").concat(currency)
    }, "".concat(price, " ").concat(currency)), /*#__PURE__*/react.createElement(Price, {
      tabIndex: TabIndex.DEFAULT,
      "aria-label": "Discounted price: ".concat(discountPrice, " ").concat(currency)
    }, "".concat(discountPrice, " ").concat(currency))), !discountPrice && /*#__PURE__*/react.createElement(Price, {
      tabIndex: TabIndex.DEFAULT
    }, "".concat(price, " ").concat(currency)));
  }
  return null;
};
/* harmony default export */ var Partials_PriceDetails = (PriceDetails);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/Partials/ProductInfoContainer.tsx







var ProductInfoContainer = function ProductInfoContainer(_ref) {
  var _ref$url = _ref.url,
    url = _ref$url === void 0 ? '' : _ref$url,
    _ref$buttonLabel = _ref.buttonLabel,
    buttonLabel = _ref$buttonLabel === void 0 ? '' : _ref$buttonLabel,
    stageWidth = _ref.stageWidth,
    _ref$title = _ref.title,
    title = _ref$title === void 0 ? '' : _ref$title,
    _ref$discountPrice = _ref.discountPrice,
    discountPrice = _ref$discountPrice === void 0 ? '' : _ref$discountPrice,
    _ref$description = _ref.description,
    description = _ref$description === void 0 ? '' : _ref$description,
    _ref$price = _ref.price,
    price = _ref$price === void 0 ? '' : _ref$price;
  var tabIndex = useTabIndex(TabIndex.CONTENT, true);
  return /*#__PURE__*/react.createElement(ProductModal_styles_ProductInfoContainer, null, /*#__PURE__*/react.createElement(ProductModal_styles_ScrollableContainer, {
    stageWidth: stageWidth
  }, title && /*#__PURE__*/react.createElement(ProductModal_styles_Title, {
    tabIndex: TabIndex.DEFAULT
  }, title), title && /*#__PURE__*/react.createElement(HrInProductTag, null), description && /*#__PURE__*/react.createElement(ProductModal_styles_Description, {
    tabIndex: TabIndex.DEFAULT
  }, description)), /*#__PURE__*/react.createElement(PriceSection, null, /*#__PURE__*/react.createElement(Partials_PriceDetails, {
    price: price,
    discountPrice: discountPrice
  })), url && buttonLabel && /*#__PURE__*/react.createElement(AdjacentButtons, {
    $stageWidth: stageWidth
  }, /*#__PURE__*/react.createElement("a", {
    href: getValidHref(url) ? url : undefined,
    rel: elements_ELEMENT_LINKS_REL_DEFAULT_REL,
    role: "button",
    target: "_blank",
    tabIndex: tabIndex
  }, /*#__PURE__*/react.createElement(StyledNativeButton, null, buttonLabel))));
};
/* harmony default export */ var Partials_ProductInfoContainer = (ProductInfoContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/Partials/PreviewImagesContainer.tsx








var PreviewImagesContainer = function PreviewImagesContainer(props) {
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    accountId = _useAtom2[0].link.accountId;
  var onKeyDownHandler = function onKeyDownHandler(event, index) {
    switch (event.code) {
      case KeyboardCodes.ENTER:
      case KeyboardCodes.SPACE:
        {
          event.preventDefault();
          props.changeImage(index);
          break;
        }
      default:
        break;
    }
  };
  return /*#__PURE__*/react.createElement(ProductPreviewImagesContainer, {
    stageWidth: props.stageWidth
  }, props.media.map(function (resource, index) {
    var source = getImageResourcePath(accountId, {
      src: resource.hash,
      provider: resource.provider
    });
    var src = props.downloadMode ? "".concat(source, "_t.jpg") : "".concat(source, "_t");
    return /*#__PURE__*/react.createElement(ProductPreviewImage, {
      key: "".concat(resource.hash, "-").concat(index),
      src: src,
      $opacity: props.currentIndex === index ? 1 : 0.7,
      tabIndex: TabIndex.DEFAULT,
      "aria-label": "product description image",
      onClick: function onClick() {
        return props.changeImage(index);
      },
      onKeyDown: function onKeyDown(event) {
        return onKeyDownHandler(event, index);
      }
    });
  }));
};
PreviewImagesContainer.propTypes = {
  currentIndex: (prop_types_default()).number.isRequired,
  media: prop_types_default().arrayOf(prop_types_default().shape({
    name: (prop_types_default()).string.isRequired,
    hash: (prop_types_default()).string.isRequired,
    provider: (prop_types_default()).string
  }).isRequired).isRequired,
  changeImage: (prop_types_default()).func.isRequired,
  stageWidth: (prop_types_default()).number.isRequired,
  downloadMode: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var Partials_PreviewImagesContainer = (PreviewImagesContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/Partials/ProductPhotosContainer.tsx










var DefaultMainImageSize = {
  width: 280,
  height: 280
};
var ProductPhotosContainer = function ProductPhotosContainer(props) {
  var _useState = (0,react.useState)(0),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    currentIndex = _useState2[0],
    setIndex = _useState2[1];
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    accountId = _useAtom2[0].link.accountId;
  var _useAtom3 = react_useAtom(rootPrimitivesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    downloadMode = _useAtom4[0].downloadMode;
  var source = '';
  (0,react.useEffect)(function () {
    setIndex(0);
  }, [props.media]);
  if (currentIndex < props.media.length) {
    source = getImageResourcePath(accountId, {
      src: props.media[currentIndex].hash,
      provider: props.media[currentIndex].provider
    });
  }
  var src = downloadMode ? "".concat(source, ".jpg") : getImageAppendedSrc({
    width: DefaultMainImageSize.width,
    height: DefaultMainImageSize.height,
    imgSrc: source
  });
  var multipleImages = props.media.length > 1;
  return /*#__PURE__*/react.createElement(ProductModal_styles_ProductPhotosContainer, {
    marginRight: 24,
    stageWidth: props.stageWidth
  }, /*#__PURE__*/react.createElement(ProductMainImage, {
    src: src,
    tabIndex: TabIndex.DEFAULT,
    "aria-label": "product description image",
    imageSize: DefaultMainImageSize
  }), multipleImages && /*#__PURE__*/react.createElement(Partials_PreviewImagesContainer, {
    media: props.media,
    changeImage: setIndex,
    currentIndex: currentIndex,
    stageWidth: props.stageWidth,
    downloadMode: downloadMode
  }));
};
ProductPhotosContainer.propTypes = {
  media: prop_types_default().arrayOf(prop_types_default().shape({
    name: (prop_types_default()).string.isRequired,
    hash: (prop_types_default()).string.isRequired,
    provider: (prop_types_default()).string
  }).isRequired).isRequired,
  stageWidth: (prop_types_default()).number.isRequired
};
/* harmony default export */ var Partials_ProductPhotosContainer = (ProductPhotosContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/ProductTagModal.tsx









var ProductTagModal = function ProductTagModal(props) {
  var _useAtom = react_useAtom(stageSizeWidthAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    width = _useAtom2[0];
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var elementAttributes = element.attributes;
  var media = elementAttributes.media || [];
  return /*#__PURE__*/react.createElement(ProductContainer, {
    $stageWidth: width
  }, !!media.length && /*#__PURE__*/react.createElement(Partials_ProductPhotosContainer, {
    media: media,
    stageWidth: width
  }), /*#__PURE__*/react.createElement(Partials_ProductInfoContainer, {
    stageWidth: width,
    url: elementAttributes.url,
    title: elementAttributes.title,
    price: elementAttributes.price,
    buttonLabel: elementAttributes.buttonLabel,
    description: elementAttributes.description,
    discountPrice: elementAttributes.discountPrice
  }));
};
ProductTagModal.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var ProductModal_ProductTagModal = (ProductTagModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/ProductTagActionContainer/ProductTagActionContainer.tsx

function ProductTagActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function ProductTagActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ProductTagActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ProductTagActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }






var ProductTagActionContainer = function ProductTagActionContainer(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = ProductTagActionContainer_objectSpread({}, element.attributes);
  return /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, null, /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: "auto",
    height: "auto",
    identifier: "".concat(props.pageId, "-").concat(props.elementIndex),
    ariaLabel: attributes.buttonLabel
  }, /*#__PURE__*/react.createElement(ProductModal_ProductTagModal, {
    pageId: props.pageId,
    elementIndex: props.elementIndex
  })));
};
ProductTagActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var ProductTagActionContainer_ProductTagActionContainer = (ProductTagActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/ProductTagActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/AudioActionContainer/AudioActionContainer.tsx


function AudioActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function AudioActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? AudioActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : AudioActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
















var AudioActionContainer = function AudioActionContainer(props) {
  var _useAtom = react_useAtom(rootPrimitivesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    downloadMode = _useAtom2[0].downloadMode;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var audioRef = (0,react.useRef)(null);
  var audioElementRef = (0,react.useRef)(null);
  var isOnActiveStage = settledStageIndex === props.stageIndex;
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var setCountAudios = useSetPageLoader(props.pageId, ElementsTypeEnum.AUDIOS, KeyEnum.NUMBER_OF_ELEMENTS);
  var setCountAudiosLoaded = useSetPageLoader(props.pageId, ElementsTypeEnum.AUDIOS, KeyEnum.NUMBER_OF_LOADED_ELEMENTS);
  var attributes = AudioActionContainer_objectSpread({}, element.attributes);
  var autoplay = attributes.autoplay,
    enableCustomDuration = attributes.enableCustomDuration,
    hash = attributes.hash,
    _attributes$audioInte = attributes.audioInterval,
    audioInterval = _attributes$audioInte === void 0 ? [] : _attributes$audioInte;
  var millisToSeconds = audioInterval.map(function (millis) {
    return millis / 1000;
  });
  var _millisToSeconds = slicedToArray_slicedToArray(millisToSeconds, 2),
    _millisToSeconds$ = _millisToSeconds[0],
    startSeconds = _millisToSeconds$ === void 0 ? 0 : _millisToSeconds$,
    _millisToSeconds$2 = _millisToSeconds[1],
    endSeconds = _millisToSeconds$2 === void 0 ? 0 : _millisToSeconds$2;
  var audioSrc = useResourcePath(resourceFolders_ResourceType.AUDIO, {
    src: hash
  });
  if (downloadMode) {
    audioSrc = "".concat(audioSrc, ".mp3");
  }
  var playAudio = function playAudio() {
    var _audioRef$current;
    audioRef === null || audioRef === void 0 || (_audioRef$current = audioRef.current) === null || _audioRef$current === void 0 || _audioRef$current.play();
  };
  var pauseAudio = function pauseAudio() {
    var _audioRef$current2;
    audioRef === null || audioRef === void 0 || (_audioRef$current2 = audioRef.current) === null || _audioRef$current2 === void 0 || _audioRef$current2.pause();
  };
  var resetAudio = function resetAudio() {
    if (audioRef !== null && audioRef !== void 0 && audioRef.current) {
      audioRef.current.currentTime = startSeconds;
    }
  };
  var setIconPause = function setIconPause() {
    props.onClickAction({
      changeProp: {
        icon: AudioIcon.PAUSE
      }
    });
  };
  var onClick = function onClick() {
    if (audioRef !== null && audioRef !== void 0 && audioRef.current) {
      if (audioRef.current.paused) {
        playAudio();
      } else {
        pauseAudio();
      }
      props.onClickAction({
        changeProp: {
          icon: audioRef.current.paused ? AudioIcon.PAUSE : AudioIcon.PLAY
        }
      });
    }
  };
  var onMouseDown = function onMouseDown(e) {
    if (isTouchEvent(e) && 'touches' in e && e.touches.length === 1 || e instanceof MouseEvent) {
      e.stopPropagation();
    }
  };
  var onTimeUpdate = function onTimeUpdate() {
    var audio = audioRef === null || audioRef === void 0 ? void 0 : audioRef.current;
    if (enableCustomDuration && endSeconds && audio && audio.currentTime >= endSeconds) {
      resetAudio();
      pauseAudio();
    }
  };
  var onKeyDownHandler = function onKeyDownHandler(event) {
    if (event.code === KeyboardCodes.ENTER || event.code === KeyboardCodes.SPACE) {
      onClick();
    }
  };
  (0,react.useEffect)(function () {
    if (isOnActiveStage) {
      resetAudio();
      if (autoplay) {
        playAudio();
      }
      props.onClickAction({
        changeProp: {
          icon: autoplay ? AudioIcon.PLAY : AudioIcon.PAUSE
        }
      });
    } else {
      pauseAudio();
      setIconPause();
    }
  }, [isOnActiveStage]);
  (0,react.useEffect)(function () {
    var onLoad = function onLoad() {
      setCountAudiosLoaded(function (prevCount) {
        return prevCount + 1;
      });
    };
    var audioElement = audioRef.current;
    if (audioSrc) {
      var _audioRef$current3, _audioRef$current4;
      setCountAudios(function (prevCount) {
        return prevCount + 1;
      });
      audioRef === null || audioRef === void 0 || (_audioRef$current3 = audioRef.current) === null || _audioRef$current3 === void 0 || _audioRef$current3.addEventListener('canplay', onLoad, {
        once: true
      });
      audioRef === null || audioRef === void 0 || (_audioRef$current4 = audioRef.current) === null || _audioRef$current4 === void 0 || _audioRef$current4.addEventListener('error', onLoad, {
        once: true
      });
      if (main/* isMobile */.Fr) {
        var _audioElementRef$curr;
        audioElementRef === null || audioElementRef === void 0 || (_audioElementRef$curr = audioElementRef.current) === null || _audioElementRef$curr === void 0 || _audioElementRef$curr.addEventListener('touchstart', onMouseDown);
      } else {
        var _audioElementRef$curr2;
        audioElementRef === null || audioElementRef === void 0 || (_audioElementRef$curr2 = audioElementRef.current) === null || _audioElementRef$curr2 === void 0 || _audioElementRef$curr2.addEventListener('mousedown', onMouseDown);
      }
    }
    return function () {
      audioElement === null || audioElement === void 0 || audioElement.removeEventListener('canplay', onLoad);
      audioElement === null || audioElement === void 0 || audioElement.removeEventListener('error', onLoad);
      if (main/* isMobile */.Fr) {
        var _audioElementRef$curr3;
        audioElementRef === null || audioElementRef === void 0 || (_audioElementRef$curr3 = audioElementRef.current) === null || _audioElementRef$curr3 === void 0 || _audioElementRef$curr3.removeEventListener('touchstart', onMouseDown);
      } else {
        var _audioElementRef$curr4;
        audioElementRef === null || audioElementRef === void 0 || (_audioElementRef$curr4 = audioElementRef.current) === null || _audioElementRef$curr4 === void 0 || _audioElementRef$curr4.removeEventListener('mousedown', onMouseDown);
      }
    };
  }, []);
  return /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, {
    role: "button",
    ref: audioElementRef,
    onClick: onClick,
    tabIndex: TabIndex.DEFAULT,
    "aria-label": utils_getTooltip(element),
    onKeyDown: onKeyDownHandler
  }, audioSrc && /*#__PURE__*/react.createElement("audio", {
    src: audioSrc,
    ref: audioRef,
    onPause: setIconPause,
    onTimeUpdate: onTimeUpdate
  }, /*#__PURE__*/react.createElement("track", {
    src: audioSrc,
    kind: "captions"
  })));
};
AudioActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  onClickAction: (prop_types_default()).func.isRequired,
  stageIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var AudioActionContainer_AudioActionContainer = (AudioActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/AudioActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getPageIndexFromPageId.ts
/**
 * Calculates page index for a specific page id
 * @param pageId
 * @param stageIndex
 * @param order
 * @param isDoublePage
 */
/* harmony default export */ var getPageIndexFromPageId = (function (pageId, stageIndex, order, isDoublePage) {
  if (!isDoublePage || stageIndex === 0) {
    return stageIndex + 1;
  }
  return stageIndex * 2 - 1 + order[stageIndex].indexOf(pageId);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/GoToUrlActionContainer/GoToUrlActionContainer.tsx

function GoToUrlActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function GoToUrlActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? GoToUrlActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : GoToUrlActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }















var GoToUrlActionContainer = function GoToUrlActionContainer(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var _useContext = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext.sendGAEvent;
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    order = _useContext2.pages.order,
    highlights = _useContext2.options.controls.highlights;
  var layout = useLayout();
  var attributes = GoToUrlActionContainer_objectSpread({}, element.attributes);
  var onClick = function onClick() {
    if (attributes.url) {
      var pageIndex = getPageIndexFromPageId(props.pageId, props.stageIndex, order, layout === constants_WidgetLayoutTypes.DOUBLE);
      sendGAEvent(GAEvents.CLICK, getGAClickEventLabel(pageIndex, attributes.url));
    }
  };
  var link = /*#__PURE__*/react.createElement(Anchor_Anchor, {
    href: getValidHref(attributes.url),
    target: attributes.target || '_blank',
    onClick: onClick,
    tabIndex: TabIndex.DEFAULT,
    ariaLabel: element.type === LinkType.OUTLINE ? '' : utils_getTooltip(element)
  });
  if (element.type === LinkType.OUTLINE) {
    return /*#__PURE__*/react.createElement(HyperlinkElementLayer, {
      $highlights: highlights || false
    }, link);
  }
  return /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, null, link);
};
GoToUrlActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  stageIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var GoToUrlActionContainer_GoToUrlActionContainer = (GoToUrlActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/GoToUrlActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/pageNavigation.ts



var NavigationAction = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, ActionType.GO_TO_PREV_PAGE, PageNavigationActionType.PREVIOUS), ActionType.GO_TO_NEXT_PAGE, PageNavigationActionType.NEXT), ActionType.GO_TO_FIRST_PAGE, PageNavigationActionType.FIRST), ActionType.GO_TO_LAST_PAGE, PageNavigationActionType.LAST), ActionType.GO_TO_PAGE, PageNavigationActionType.CUSTOM);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/PageNavActionContainer/NavigationElementLayer.tsx




var NavigationElementLayer = function NavigationElementLayer(props) {
  var ElementLayer = props.elementType === LinkType.OUTLINE ? HyperlinkElementLayer : GeneralStyles_ElementLayer;
  return /*#__PURE__*/react.createElement(ElementLayer, null, props.children);
};
NavigationElementLayer.propTypes = {
  elementType: (prop_types_default()).number.isRequired,
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var PageNavActionContainer_NavigationElementLayer = (NavigationElementLayer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/PageNavActionContainer/PageNavActionContainer.tsx

function PageNavActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function PageNavActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? PageNavActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : PageNavActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }







var PageNavigationContainer = function PageNavigationContainer(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = PageNavActionContainer_objectSpread({}, element.attributes);
  var pageNumber = attributes.page;
  var ariaLabel = ActionTypeName[props.elementAction];
  if (props.elementAction === ActionType.GO_TO_PAGE) {
    ariaLabel += pageNumber;
  }
  return /*#__PURE__*/react.createElement(PageNavActionContainer_NavigationElementLayer, {
    elementType: element.type
  }, /*#__PURE__*/react.createElement(PageNavigationActions_PageNavigationActions, {
    action: NavigationAction[props.elementAction],
    pageNumber: pageNumber,
    ariaLabel: ariaLabel
  }));
};
PageNavigationContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  elementAction: (prop_types_default()).number.isRequired
};
/* harmony default export */ var PageNavActionContainer = (PageNavigationContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/PageNavActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/GoToProfileActionContainer/GoToProfileActionContainer.tsx

function GoToProfileActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function GoToProfileActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? GoToProfileActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : GoToProfileActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }









var GoToProfileActionContainer = function GoToProfileActionContainer(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = GoToProfileActionContainer_objectSpread({}, element.attributes);
  var profileUrl = useUrl(urlType_UrlType.PROFILE, {});
  return /*#__PURE__*/react.createElement(HyperlinkElementLayer, null, /*#__PURE__*/react.createElement(Anchor_Anchor, {
    href: profileUrl,
    target: attributes.target,
    rel: "noopener noreferrer",
    ariaLabel: ActionTypeName[ActionType.GO_TO_FLIPSNACK_PROFILE],
    tabIndex: TabIndex.DEFAULT
  }));
};
GoToProfileActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var GoToProfileActionContainer_GoToProfileActionContainer = (GoToProfileActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/GoToProfileActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/DownloadPdfActionContainer/DownloadPdfActionContainer.tsx









var DownloadPdfActionContainer = function DownloadPdfActionContainer() {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    download = _useContext.options.controls.download;
  var _useContext2 = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext2.sendGAEvent,
    registerEvents = _useContext2.registerEvents;
  var downloadLink = useDownloadLink();
  var onClick = function onClick() {
    if (download) {
      sendGAEvent(GAEvents.DOWNLOAD);
      registerEvents([{
        eid: StatsType.DOWNLOAD_COLLECTION
      }]);
    }
  };
  return /*#__PURE__*/react.createElement(HyperlinkElementLayer, null, /*#__PURE__*/react.createElement(Anchor_Anchor, {
    tabIndex: TabIndex.DEFAULT,
    target: "_blank",
    rel: "noopener noreferrer",
    href: download ? downloadLink : '',
    onClick: onClick
  }));
};
/* harmony default export */ var DownloadPdfActionContainer_DownloadPdfActionContainer = (DownloadPdfActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/DownloadPdfActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/SendEmailActionContainer/SendEmailActionContainer.tsx

function SendEmailActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function SendEmailActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? SendEmailActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : SendEmailActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }







var SendEmailActionContainer = function SendEmailActionContainer(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    highlights = _useContext.options.controls.highlights;
  var attributes = SendEmailActionContainer_objectSpread({}, element.attributes);
  var emailLink = attributes.email ? "mailto:".concat(attributes.email) : '';

  // TODO: if !emailLink hide: HyperlinkElementLayer SAU Anchor
  return /*#__PURE__*/react.createElement(HyperlinkElementLayer, {
    $highlights: !!highlights
  }, /*#__PURE__*/react.createElement(Anchor_Anchor, {
    href: emailLink,
    target: "_blank",
    tabIndex: TabIndex.DEFAULT
  }));
};
SendEmailActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var SendEmailActionContainer_SendEmailActionContainer = (SendEmailActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/SendEmailActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/CaptionActionContainer/CaptionActionContainer.tsx

function CaptionActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function CaptionActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? CaptionActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : CaptionActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }







var CaptionActionContainer = function CaptionActionContainer(props) {
  var theme = Ze();
  var identifier = "".concat(props.pageId, "-").concat(props.elementIndex);
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = CaptionActionContainer_objectSpread({}, element.attributes);
  var _element$bounds = element.bounds,
    width = _element$bounds.width,
    height = _element$bounds.height,
    x = _element$bounds.x,
    y = _element$bounds.y;
  return /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, null, /*#__PURE__*/react.createElement(PopoverActionContainer_PopoverActionContainer, {
    popoverWidth: "".concat(theme.popoverSizes.default.width, "px"),
    popoverHeight: "auto",
    elementY: y,
    elementX: x,
    elementWidth: width,
    elementHeight: height,
    offsetX: props.offsetX,
    isFirstPage: props.isFirstPage,
    identifier: identifier
  }, /*#__PURE__*/react.createElement(components_DefaultPopoverContent, {
    text: attributes.text,
    url: attributes.url,
    label: attributes.label
  })));
};
CaptionActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  offsetX: (prop_types_default()).number.isRequired,
  isFirstPage: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var CaptionActionContainer_CaptionActionContainer = (CaptionActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/CaptionActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/SlideshowWrapper/SlideshowWrapper.styles.ts

var GalleryWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "SlideshowWrapperstyles__GalleryWrapper",
  componentId: "sc-zgdf62-0"
})([".image-gallery-thumbnails-wrapper{overflow:hidden;margin-top:12px;-webkit-overflow-scrolling:touch;position:relative;display:block;&::after,&::before{content:'';position:absolute;bottom:0;width:80px;height:100%;pointer-events:none;}&::after{right:0;background:linear-gradient(to left,#fff 0%,transparent 35%);}&::before{left:0;z-index:1;background:linear-gradient(to right,#fff 0%,transparent 35%);}}.image-gallery-slide img{border-radius:8px;}.image-gallery-thumbnails{gap:10px;display:flex;flex-wrap:nowrap;flex-direction:row;}.image-gallery-thumbnail{width:60px !important;height:60px !important;border-radius:12px;border:2px solid transparent;transition:border-color 0.2s ease-in-out;box-sizing:border-box;}.image-gallery-thumbnail.active,.image-gallery-thumbnail:focus{border-color:#000;outline:none;}"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/SlideshowWrapper/SlideshowWrapper.tsx


var SlideshowWrapper = function SlideshowWrapper(_ref) {
  var children = _ref.children;
  return /*#__PURE__*/react.createElement(GalleryWrapper, null, children);
};
/* harmony default export */ var SlideshowWrapper_SlideshowWrapper = (SlideshowWrapper);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/Partials/AttributesDropdown.tsx


function AttributesDropdown_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function AttributesDropdown_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? AttributesDropdown_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : AttributesDropdown_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


var AttributesDropdown = function AttributesDropdown(props) {
  var handleSelectVariant = function handleSelectVariant(attribute, name) {
    props.setActiveOption(attribute, name);
  };
  return /*#__PURE__*/react.createElement(react.Fragment, null, props.attributesReorder.map(function (attribute) {
    var _props$productAttribu;
    var _ref = (_props$productAttribu = props.productAttributes[attribute]) !== null && _props$productAttribu !== void 0 ? _props$productAttribu : {},
      label = _ref.label,
      properties = _ref.properties,
      propertiesOrder = _ref.propertiesOrder;
    if (propertiesOrder !== null && propertiesOrder !== void 0 && propertiesOrder.length) {
      var updatePropertiesOrder = toConsumableArray_toConsumableArray(propertiesOrder);
      var updateProperties = AttributesDropdown_objectSpread({}, properties);

      // Add customization option in dropdown
      if (props.personalizationActive && props.personalizationAttribute === attribute) {
        updatePropertiesOrder.push(props.customizableProductHash);
        updateProperties[props.customizableProductHash] = props.personalizationOptionName;
      }
      return /*#__PURE__*/react.createElement(src_Dropdown, {
        label: label,
        key: attribute,
        attribute: attribute,
        properties: updateProperties,
        optionsOrder: updatePropertiesOrder,
        disabledVariants: props.disabledVariants,
        onSelect: function onSelect(name) {
          return handleSelectVariant(attribute, name);
        },
        activeOption: props.activeOption,
        setActiveOption: props.setActiveOption
      });
    }
    return null;
  }));
};
/* harmony default export */ var Partials_AttributesDropdown = (AttributesDropdown);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/QuantityControls/QuantityControls.style.tsx

var eraseRightBorder = function eraseRightBorder(borderRadius) {
  return "\n    border-right: none;\n    border-radius: ".concat(borderRadius, "px 0 0 ").concat(borderRadius, "px;\n");
};
var eraseLeftBorder = function eraseLeftBorder(borderRadius) {
  return "\n    border-left: none;\n    border-radius: 0 ".concat(borderRadius, "px ").concat(borderRadius, "px 0;\n");
};
var QuantityControlsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "QuantityControlsstyle__QuantityControlsContainer",
  componentId: "sc-10cefev-0"
})(["display:flex;"]);
var QuantityEditButton = styled_components_browser_esm.button.withConfig({
  displayName: "QuantityControlsstyle__QuantityEditButton",
  componentId: "sc-10cefev-1"
})(["height:26px;width:26px;background-color:transparent;border:1px solid ", ";cursor:pointer;font-weight:", ";font-size:18px;&:disabled{color:", ";}", ""], function (_ref) {
  var $disabledColor = _ref.$disabledColor;
  return $disabledColor;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.typography.weight.bold;
}, function (_ref3) {
  var $disabledColor = _ref3.$disabledColor;
  return $disabledColor;
}, function (_ref4) {
  var $disabled = _ref4.$disabled,
    $color = _ref4.$color,
    $disabledColor = _ref4.$disabledColor;
  return $disabled ? "\n         color: ".concat($disabledColor, ";\n         pointer-events: none;\n     ") : "\n        color: ".concat($color, ";\n     ");
});
var DecreaseQuantityButton = styled_components_browser_esm(QuantityEditButton).withConfig({
  displayName: "QuantityControlsstyle__DecreaseQuantityButton",
  componentId: "sc-10cefev-2"
})(["", " padding:0;"], function (_ref5) {
  var $isRtl = _ref5.$isRtl,
    theme = _ref5.theme;
  return $isRtl ? eraseLeftBorder(theme.defaults.borderRadius) : eraseRightBorder(theme.defaults.borderRadius);
});
var IncreaseQuantityButton = styled_components_browser_esm(QuantityEditButton).withConfig({
  displayName: "QuantityControlsstyle__IncreaseQuantityButton",
  componentId: "sc-10cefev-3"
})(["", " padding:0;"], function (_ref6) {
  var $isRtl = _ref6.$isRtl,
    theme = _ref6.theme;
  return $isRtl ? eraseRightBorder(theme.defaults.borderRadius) : eraseLeftBorder(theme.defaults.borderRadius);
});
var InputContentWrapper = styled_components_browser_esm.span.withConfig({
  displayName: "QuantityControlsstyle__InputContentWrapper",
  componentId: "sc-10cefev-4"
})(["position:absolute;top:0;left:0;visibility:hidden;font:", "px;padding:0 6px;min-width:40px;max-width:100px;"], function (_ref7) {
  var theme = _ref7.theme;
  return theme.cart.quantityInput.fontSize;
});
var CartItemInputContainer = styled_components_browser_esm.input.withConfig({
  displayName: "QuantityControlsstyle__CartItemInputContainer",
  componentId: "sc-10cefev-5"
})(["font-size:", "px;height:26px;width:", ";background:transparent;border:1px solid ", ";text-align:center;color:", ";&:disabled{color:rgb(51,51,51);opacity:0.8;}::-webkit-outer-spin-button,::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}-moz-appearance:textfield;border-radius:0;"], function (_ref8) {
  var theme = _ref8.theme;
  return theme.cart.quantityInput.fontSize;
}, function (_ref9) {
  var $width = _ref9.$width;
  return "".concat($width, "px");
}, function (_ref10) {
  var $disabledColor = _ref10.$disabledColor;
  return $disabledColor;
}, function (_ref11) {
  var $color = _ref11.$color;
  return $color;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/QuantityControls/QuantityControls.tsx









var listKeyboardCodes = [KeyboardCodes.COMMA, KeyboardCodes.DOT, KeyboardCodes.NUMPAD_DOT];
var QuantityControls_CartQuantityLimits = src_CartView.constants.CartQuantityLimits;
var getQuantityCorrectInterval = function getQuantityCorrectInterval(newQuantity, minQuantity, maxQuantity) {
  return Math.max(minQuantity, Math.min(maxQuantity, newQuantity));
};
var defaultInputQuantity = QuantityControls_CartQuantityLimits.MIN.toString();
var QuantityControls = function QuantityControls(_ref) {
  var _ref$isRtl = _ref.isRtl,
    isRtl = _ref$isRtl === void 0 ? false : _ref$isRtl,
    onBlur = _ref.onBlur,
    onFocus = _ref.onFocus,
    quantity = _ref.quantity,
    saveQuantity = _ref.saveQuantity,
    quantityEnabled = _ref.quantityEnabled,
    _ref$isDark = _ref.isDark,
    isDark = _ref$isDark === void 0 ? false : _ref$isDark,
    quantityValue = _ref.quantityValue,
    _ref$variantDisabled = _ref.variantDisabled,
    variantDisabled = _ref$variantDisabled === void 0 ? false : _ref$variantDisabled;
  var theme = Ze();
  var hasRange = quantityValue.hasRange,
    min = quantityValue.min,
    max = quantityValue.max,
    _quantityValue$hasMOQ = quantityValue.hasMOQ,
    hasMOQ = _quantityValue$hasMOQ === void 0 ? false : _quantityValue$hasMOQ;
  var quantityMin = hasRange ? min : QuantityControls_CartQuantityLimits.MIN;
  var quantityMax = hasRange ? max : QuantityControls_CartQuantityLimits.MAX;
  var quantityAmount = getQuantityCorrectInterval(quantity, quantityMin, quantityMax);
  var _useState = (0,react.useState)("".concat(quantityAmount)),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    inputValue = _useState2[0],
    setInputValue = _useState2[1];
  var disableDecreaseQuantity = !quantityEnabled || quantityMin === Number(inputValue) || quantityAmount === QuantityControls_CartQuantityLimits.MIN;
  var disableIncreaseQuantity = !quantityEnabled || quantityMax === Number(inputValue) || quantityAmount === QuantityControls_CartQuantityLimits.MAX;
  var color = isDark ? theme.colors.white : theme.colors.black;
  var disabledColor = isDark ? theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.2) : theme.colors.withOpacity(ColorsWithOpacity.GREY, 0.6);
  var enabledMOQ = hasRange && hasMOQ;
  var inputValueQuantity = quantityEnabled ? inputValue : defaultInputQuantity;
  var _useState3 = (0,react.useState)(40),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    inputWidth = _useState4[0],
    setInputWidth = _useState4[1];
  var spanRef = (0,react.useRef)(null);

  // Update input width dynamically based on content
  (0,react.useLayoutEffect)(function () {
    var _spanRef$current;
    if (spanRef !== null && spanRef !== void 0 && (_spanRef$current = spanRef.current) !== null && _spanRef$current !== void 0 && _spanRef$current.offsetWidth) {
      setInputWidth(spanRef.current.offsetWidth);
    }
  }, [inputValueQuantity]);
  (0,react.useEffect)(function () {
    if (saveQuantity) {
      quantity > quantityMax && saveQuantity(quantityMax);
      quantity < quantityMin && saveQuantity(quantityMin);
    }
  }, [quantity, quantityMax, quantityMin]);
  var onKeyDown = function onKeyDown(event) {
    // We check if keyCode is '.' or ',' and we don't let the user type it if the value has to be integer
    if (listKeyboardCodes.includes(event.code)) {
      event.preventDefault();
    }
  };
  var checkQuantityAndSave = (0,react.useCallback)(function (value) {
    var newQuantity = getQuantityCorrectInterval(value, quantityMin, quantityMax);
    setInputValue(newQuantity.toString());
    saveQuantity && saveQuantity(newQuantity);
  }, [quantityMin, quantityMax]);
  var changeQuantityButton = function changeQuantityButton(operation) {
    var step = enabledMOQ ? min : 1;
    var newQuantity = Number(inputValue);
    if (operation === QuantityOperation.DECREASE) {
      newQuantity -= step;
    } else if (operation === QuantityOperation.INCREASE) {
      newQuantity += step;
    }
    checkQuantityAndSave(newQuantity);
  };
  var correctQuantityAndSave = (0,react.useCallback)(function (event) {
    var value = event.target.value;
    var newQuantity = parseInt(value || defaultInputQuantity, 10);
    if (enabledMOQ) {
      newQuantity = Math.floor(newQuantity / min) * min;
    }
    checkQuantityAndSave(newQuantity);
  }, [enabledMOQ, min, checkQuantityAndSave]);
  var correctQuantityAndSaveWithDebounce = (0,react.useMemo)(function () {
    return (0,lodash.debounce)(correctQuantityAndSave, 1100);
  }, [correctQuantityAndSave]);
  var onChangeInputQuantity = function onChangeInputQuantity(event) {
    var value = event.target.value;
    setInputValue(value);
    correctQuantityAndSaveWithDebounce(event);
  };

  // Cleanup the debounce function on unmount
  (0,react.useEffect)(function () {
    return function () {
      correctQuantityAndSaveWithDebounce.cancel();
    };
  }, [correctQuantityAndSaveWithDebounce]);
  return /*#__PURE__*/react.createElement(QuantityControlsContainer, null, /*#__PURE__*/react.createElement(DecreaseQuantityButton, {
    type: "button",
    onClick: function onClick() {
      return changeQuantityButton(QuantityOperation.DECREASE);
    },
    tabIndex: TabIndex.DEFAULT,
    $disabled: disableDecreaseQuantity || variantDisabled || false,
    $isRtl: isRtl,
    $color: color,
    $disabledColor: disabledColor,
    "aria-label": "decrease quantity"
  }, "-"), /*#__PURE__*/react.createElement(InputContentWrapper, {
    ref: spanRef
  }, inputValueQuantity), /*#__PURE__*/react.createElement(CartItemInputContainer, {
    type: "number",
    value: inputValueQuantity,
    disabled: !quantityEnabled || !!variantDisabled,
    tabIndex: TabIndex.DEFAULT,
    onChange: onChangeInputQuantity,
    onFocus: onFocus,
    onBlur: onBlur,
    $color: color,
    $disabledColor: disabledColor,
    $width: inputWidth,
    onKeyDown: onKeyDown,
    onBlurCapture: correctQuantityAndSave,
    inputMode: "numeric"
  }), /*#__PURE__*/react.createElement(IncreaseQuantityButton, {
    type: "button",
    onClick: function onClick() {
      return changeQuantityButton(QuantityOperation.INCREASE);
    },
    tabIndex: TabIndex.DEFAULT,
    $disabled: disableIncreaseQuantity || !!variantDisabled,
    $isRtl: isRtl || false,
    $color: color,
    $disabledColor: disabledColor,
    "aria-label": "increase quantity"
  }, "+"));
};
/* harmony default export */ var QuantityControls_QuantityControls = (QuantityControls);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/QuantityControls/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/Partials/PaidPersonalization.tsx





var PaidPersonalization = function PaidPersonalization(_ref) {
  var pricingMethod = _ref.pricingMethod,
    extraPrice = _ref.extraPrice,
    _ref$currency = _ref.currency,
    currency = _ref$currency === void 0 ? '' : _ref$currency;
  var textChip = "+ ".concat(extraPrice, " ").concat(currency);
  var character = useTranslate(Identifier.l_character);
  textChip = pricingMethod === CartPricingMethod.PER_CHARACTER ? "".concat(textChip, " / ").concat(character) : textChip;
  return /*#__PURE__*/react.createElement(PaidPersonalizationContainer, null, /*#__PURE__*/react.createElement(PaidPersonalizationTitle, null, useTranslate(Identifier.l_personalization)), /*#__PURE__*/react.createElement(PaidPersonalizationChip, null, /*#__PURE__*/react.createElement(PaidPersonalizationChipText, null, textChip)));
};
/* harmony default export */ var Partials_PaidPersonalization = (PaidPersonalization);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/Partials/PriceContainer.tsx













var PriceContainer = /*#__PURE__*/(0,react.forwardRef)(function (_ref, inputRef) {
  var _customizableProduct$, _customizableProduct$2, _customizableProduct$3, _customizableProduct$4, _customizableProduct$5;
  var discountPrice = _ref.discountPrice,
    currency = _ref.currency,
    price = _ref.price,
    quantity = _ref.quantity,
    disabled = _ref.disabled,
    customizableProduct = _ref.customizableProduct,
    error = _ref.error,
    setError = _ref.setError,
    showCustomizableProduct = _ref.showCustomizableProduct;
  var _useContext = (0,react.useContext)(contexts_CartContext),
    value = _useContext.value,
    setValue = _useContext.setValue,
    editedVariant = _useContext.editedVariant;
  var _useState = (0,react.useState)(''),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    inputValue = _useState2[0],
    setInputValue = _useState2[1];
  var _useState3 = (0,react.useState)(0),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    countCharacters = _useState4[0],
    setCountCharacters = _useState4[1];
  var enabled = quantity.enabled;
  var editedDiscountPrice = typeof (editedVariant === null || editedVariant === void 0 ? void 0 : editedVariant.discountPrice) === 'string' ? editedVariant === null || editedVariant === void 0 ? void 0 : editedVariant.discountPrice : discountPrice;
  var editedPrice = typeof (editedVariant === null || editedVariant === void 0 ? void 0 : editedVariant.price) === 'string' ? editedVariant === null || editedVariant === void 0 ? void 0 : editedVariant.price : price;
  var defaultsPaidPersonalization = src_CartView.constants.CartCustomizableProductDefaults.paidPersonalization;
  var paidPersonalizationActive = (customizableProduct === null || customizableProduct === void 0 || (_customizableProduct$ = customizableProduct.paidPersonalization) === null || _customizableProduct$ === void 0 ? void 0 : _customizableProduct$.active) || defaultsPaidPersonalization.active;
  var pricingMethod = (customizableProduct === null || customizableProduct === void 0 || (_customizableProduct$2 = customizableProduct.paidPersonalization) === null || _customizableProduct$2 === void 0 ? void 0 : _customizableProduct$2.pricingMethod) || defaultsPaidPersonalization.pricingMethod;
  var extraPrice = (customizableProduct === null || customizableProduct === void 0 || (_customizableProduct$3 = customizableProduct.paidPersonalization) === null || _customizableProduct$3 === void 0 ? void 0 : _customizableProduct$3.extraPrice) || defaultsPaidPersonalization.extraPrice;
  var characterLimit = (customizableProduct === null || customizableProduct === void 0 || (_customizableProduct$4 = customizableProduct.paidPersonalization) === null || _customizableProduct$4 === void 0 ? void 0 : _customizableProduct$4.characterLimit) || defaultsPaidPersonalization.characterLimit;
  var finalPrice = showCustomizableProduct && !editedDiscountPrice ? getFinalPrice(paidPersonalizationActive, pricingMethod, extraPrice, countCharacters, editedPrice) : editedPrice;
  var finalDiscountPrice = showCustomizableProduct && editedDiscountPrice ? getFinalPrice(paidPersonalizationActive, pricingMethod, extraPrice, countCharacters, editedDiscountPrice) : editedDiscountPrice;
  var saveValue = function saveValue(input) {
    setValue(input);
  };
  var handlerCustomizableProductInput = function handlerCustomizableProductInput(_ref2) {
    var target = _ref2.target;
    // If the customizable product input is required, we handle errors.
    if (customizableProduct !== null && customizableProduct !== void 0 && customizableProduct.required) {
      if (target.value && error) {
        setError(false);
      }
      if (!target.value && !error) {
        setError(true);
      }
    }
    if (paidPersonalizationActive) {
      var formatedValue = removeSpacing(target.value);
      if (formatedValue.length <= characterLimit) {
        setInputValue(target.value);
        setCountCharacters(formatedValue.length);
      }
    } else {
      setInputValue(target.value);
    }
  };
  return /*#__PURE__*/react.createElement(react.Fragment, null, showCustomizableProduct && /*#__PURE__*/react.createElement(CustomizableProductContainer, null, paidPersonalizationActive && /*#__PURE__*/react.createElement(Partials_PaidPersonalization, {
    currency: currency,
    extraPrice: extraPrice,
    pricingMethod: pricingMethod
  }), /*#__PURE__*/react.createElement(ModalContentStyles_Label, {
    tabIndex: TabIndex.DEFAULT,
    withoutMarginTop: true,
    required: customizableProduct.required
  }, customizableProduct.label), /*#__PURE__*/react.createElement(ModalContentStyles_Input, {
    value: inputValue,
    ref: inputRef,
    title: customizableProduct.label,
    tabIndex: TabIndex.DEFAULT,
    onChange: handlerCustomizableProductInput,
    isContentValid: !error
  }), /*#__PURE__*/react.createElement(HelperTextInput, null, /*#__PURE__*/react.createElement(TextError, null, error && /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_product_required_personalization)), paidPersonalizationActive && /*#__PURE__*/react.createElement(TextCharacterLimit, null, countCharacters, " / ", ((_customizableProduct$5 = customizableProduct.paidPersonalization) === null || _customizableProduct$5 === void 0 ? void 0 : _customizableProduct$5.characterLimit) || 20))), /*#__PURE__*/react.createElement(PriceSection, null, /*#__PURE__*/react.createElement(Partials_PriceDetails, {
    price: finalPrice,
    currency: currency,
    discountPrice: finalDiscountPrice
  }), enabled && /*#__PURE__*/react.createElement(QuantityControls_QuantityControls, {
    quantity: value,
    quantityEnabled: enabled,
    quantityValue: quantity,
    saveQuantity: saveValue,
    variantDisabled: disabled
  })));
});
/* harmony default export */ var Partials_PriceContainer = (PriceContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/Partials/CartContentContainer.tsx


function CartContentContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function CartContentContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? CartContentContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : CartContentContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }












var ShoppingButtonDefaultText = 'Shop this item';
var WebsiteLinkDefaultText = 'View more';
var CustomizableProductHash = 'customizeProduct';
var attributeBasedPersonalization = src_CartView.constants.CartCustomizableProductDefaults.attributeBasedPersonalization;

/**
 * Get the disabled variants from the product variants object
 * @param {{[p: string]: {hidden?: boolean}}} variants
 * @returns {{[p: string]: boolean} | {}}
 */
var filterDisabledVariants = function filterDisabledVariants(variants) {
  return Object.keys(variants).reduce(function (acc, variant) {
    var _variants$variant;
    if ((_variants$variant = variants[variant]) !== null && _variants$variant !== void 0 && _variants$variant.hidden) {
      return CartContentContainer_objectSpread(CartContentContainer_objectSpread({}, acc), {}, defineProperty_defineProperty({}, variant, true));
    }
    return acc;
  }, {});
};

/**
 * Get the hash from the selected variant by the order of attributesOrder
 * @param attributesOrder
 * @param {{[p: string]: string}} activeOption
 * @returns {string}
 */
var getOrderedActiveOptionHash = function getOrderedActiveOptionHash(attributesOrder, activeOption) {
  var hashes = attributesOrder.map(function (order) {
    if (activeOption[order]) {
      return activeOption[order];
    }
    return '';
  });
  return hashes.join('_');
};
var CartContentContainer = function CartContentContainer(props) {
  var _props$product, _props$product2, _props$product3, _props$product4, _props$website, _props$website2, _props$customizablePr, _props$customizablePr2, _props$customizablePr3, _props$product$attrib, _props$product9;
  var theme = Ze();
  var _useContext = (0,react.useContext)(contexts_CartContext),
    activeOption = _useContext.activeOption,
    setActiveOption = _useContext.setActiveOption,
    setEditedVariant = _useContext.setEditedVariant,
    editedVariant = _useContext.editedVariant;
  var _useState = (0,react.useState)(props.title),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    formattedTitle = _useState2[0],
    setFormattedTitle = _useState2[1];
  var _useState3 = (0,react.useState)(false),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    disabled = _useState4[0],
    setDisabled = _useState4[1];
  var _useState5 = (0,react.useState)(false),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    error = _useState6[0],
    setError = _useState6[1];
  var inputRef = (0,react.useRef)(null);
  var attributesOrder = (_props$product = props.product) !== null && _props$product !== void 0 && (_props$product = _props$product.attributesOrder) !== null && _props$product !== void 0 && _props$product.length ? props.product.attributesOrder : Object.keys(((_props$product2 = props.product) === null || _props$product2 === void 0 ? void 0 : _props$product2.attributes) || {});
  var attributesReorder = (_props$product3 = props.product) !== null && _props$product3 !== void 0 && (_props$product3 = _props$product3.attributesReorder) !== null && _props$product3 !== void 0 && _props$product3.length ? props.product.attributesReorder : Object.keys(((_props$product4 = props.product) === null || _props$product4 === void 0 ? void 0 : _props$product4.attributes) || {});
  var showWebsiteButton = !!((_props$website = props.website) !== null && _props$website !== void 0 && _props$website.enabled && (_props$website2 = props.website) !== null && _props$website2 !== void 0 && _props$website2.websiteUrl);
  var editedSku = typeof (editedVariant === null || editedVariant === void 0 ? void 0 : editedVariant.code) === 'string' ? editedVariant === null || editedVariant === void 0 ? void 0 : editedVariant.code : props.productId;
  var ariaLabelShopThisItemButton = "".concat(props.buttonLabel || ShoppingButtonDefaultText, " button.\n        ").concat(disabled ? 'Disabled. This product is out of stock' : '');
  var customizableProductActive = ((_props$customizablePr = props.customizableProduct) === null || _props$customizablePr === void 0 ? void 0 : _props$customizablePr.active) || false;
  var _ref = (_props$customizablePr2 = (_props$customizablePr3 = props.customizableProduct) === null || _props$customizablePr3 === void 0 ? void 0 : _props$customizablePr3.attributeBasedPersonalization) !== null && _props$customizablePr2 !== void 0 ? _props$customizablePr2 : {},
    _ref$active = _ref.active,
    personalizationActive = _ref$active === void 0 ? attributeBasedPersonalization.active : _ref$active,
    _ref$attribute = _ref.attribute,
    personalizationAttribute = _ref$attribute === void 0 ? attributeBasedPersonalization.attribute : _ref$attribute,
    _ref$optionName = _ref.optionName,
    personalizationOptionName = _ref$optionName === void 0 ? attributeBasedPersonalization.optionName : _ref$optionName;
  var _useState7 = (0,react.useState)(customizableProductActive && personalizationActive ? false : customizableProductActive),
    _useState8 = slicedToArray_slicedToArray(_useState7, 2),
    showCustomizableProduct = _useState8[0],
    setShowCustomizableProduct = _useState8[1];
  var handleAddToCart = function handleAddToCart() {
    var _inputRef$current, _props$customizablePr4;
    var customizableProductValue = (_inputRef$current = inputRef.current) !== null && _inputRef$current !== void 0 && _inputRef$current.value ? inputRef.current.value.trim() : '';
    if (showCustomizableProduct && (_props$customizablePr4 = props.customizableProduct) !== null && _props$customizablePr4 !== void 0 && _props$customizablePr4.required && !customizableProductValue) {
      setError(true);
      return;
    }
    if (!disabled) {
      props.addToCart(formattedTitle, customizableProductValue);
    }
  };
  var getDisabledVariants = function getDisabledVariants() {
    var _props$product5;
    return filterDisabledVariants(((_props$product5 = props.product) === null || _props$product5 === void 0 ? void 0 : _props$product5.variants) || {});
  };
  var disabledVariants = getDisabledVariants();
  var getActiveOptionHash = function getActiveOptionHash() {
    return getOrderedActiveOptionHash(attributesOrder || [], activeOption);
  };
  (0,react.useEffect)(function () {
    if (attributesOrder !== null && attributesOrder !== void 0 && attributesOrder.length) {
      var _props$product6, _props$product7, _Object$keys;
      var activeOptionHash = getActiveOptionHash();
      var activeOptionTitle = props.title;

      // Check if the active option is one of the edited variants
      if (Object.keys(((_props$product6 = props.product) === null || _props$product6 === void 0 ? void 0 : _props$product6.variants) || {}).length && (_props$product7 = props.product) !== null && _props$product7 !== void 0 && _props$product7.variants[activeOptionHash]) {
        setEditedVariant(props.product.variants[activeOptionHash]);
      } else {
        setEditedVariant({});
      }

      // Get the selected value from the dropdown
      Object.keys(activeOption).forEach(function (variant) {
        var _props$product8;
        var properties = (_props$product8 = props.product) === null || _props$product8 === void 0 || (_props$product8 = _props$product8.attributes[variant]) === null || _props$product8 === void 0 ? void 0 : _props$product8.properties;
        var propertyValue = activeOption[variant];
        var optionName = properties && properties[propertyValue] ? ", ".concat(properties[propertyValue]) : '';
        activeOptionTitle = "".concat(activeOptionTitle).concat(optionName);
      });
      if (customizableProductActive && personalizationActive) {
        var hasCustomizeProductValue = Object.values(activeOption).includes(CustomizableProductHash);

        // Display customizable product based on selected CustomizableProductHash
        if (hasCustomizeProductValue && !showCustomizableProduct) {
          setShowCustomizableProduct(true);
        } else if (!hasCustomizeProductValue && showCustomizableProduct) {
          setShowCustomizableProduct(false);
          setError(false);
        }
      }
      setFormattedTitle(activeOptionTitle);

      // Set the disabled parameter if the very first variant is disabled
      if (activeOptionHash && (_Object$keys = Object.keys(disabledVariants)) !== null && _Object$keys !== void 0 && _Object$keys.length) {
        setDisabled(!!disabledVariants[activeOptionHash]);
      }
    }
  }, [activeOption]);
  return /*#__PURE__*/react.createElement(ProductModal_styles_ProductInfoContainer, null, /*#__PURE__*/react.createElement(ProductModal_styles_ScrollableContainer, {
    stageWidth: props.stageWidth
  }, !!props.title && /*#__PURE__*/react.createElement(ProductModal_styles_Title, {
    tabIndex: TabIndex.DEFAULT
  }, formattedTitle), ((editedVariant === null || editedVariant === void 0 ? void 0 : editedVariant.code) || props.productId) && /*#__PURE__*/react.createElement(ProductId, {
    tabIndex: TabIndex.DEFAULT
  }, editedSku), !!props.title && /*#__PURE__*/react.createElement(HrInProductTag, null), !!props.description && /*#__PURE__*/react.createElement(ProductModal_styles_Description, {
    tabIndex: TabIndex.DEFAULT
  }, props.description)), /*#__PURE__*/react.createElement(react.Fragment, null, !!(attributesReorder !== null && attributesReorder !== void 0 && attributesReorder.length) && /*#__PURE__*/react.createElement(AttributesWrapper, {
    hasQuantity: !!(props.quantity && props.price)
  }, /*#__PURE__*/react.createElement(Partials_AttributesDropdown, {
    setActiveOption: setActiveOption,
    attributesReorder: attributesReorder,
    productAttributes: (_props$product$attrib = (_props$product9 = props.product) === null || _props$product9 === void 0 ? void 0 : _props$product9.attributes) !== null && _props$product$attrib !== void 0 ? _props$product$attrib : {},
    personalizationActive: customizableProductActive && personalizationActive,
    personalizationAttribute: personalizationAttribute,
    customizableProductHash: CustomizableProductHash,
    personalizationOptionName: personalizationOptionName,
    disabledVariants: disabledVariants,
    activeOption: activeOption
  })), /*#__PURE__*/react.createElement(Partials_PriceContainer, {
    discountPrice: props.discountPrice || '',
    price: props.price || '',
    currency: props.currency,
    quantity: props.quantity,
    disabled: disabled,
    customizableProduct: props.customizableProduct,
    ref: inputRef,
    error: error,
    setError: setError,
    showCustomizableProduct: showCustomizableProduct
  }), /*#__PURE__*/react.createElement(AdjacentButtons, {
    $stageWidth: props.stageWidth
  }, showWebsiteButton && /*#__PURE__*/react.createElement(ViewWebsite, {
    $stageWidth: props.stageWidth
  }, /*#__PURE__*/react.createElement(src_IconButton, {
    alpha: showWebsiteButton ? 1 : 0,
    height: theme.cart.websiteButton.height,
    href: getValidHref(props.website.websiteUrl),
    label: props.website.buttonLabel || WebsiteLinkDefaultText,
    labelColor: props.backgroundColor,
    variant: ButtonVariants.OUTLINED,
    padding: theme.cart.websiteButton.padding,
    fontSize: theme.button.default.fontSize,
    fontWeight: 500,
    centeredText: true,
    tabIndex: TabIndex.DEFAULT,
    hoverColor: hexToRgba(props.backgroundColor, 0.1),
    radius: "8px"
  })), /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: disabled ? 'This product is out of stock' : '',
    position: tooltipPosition.TOP_RIGHT
  }, /*#__PURE__*/react.createElement(StyledNativeButton, {
    onClick: handleAddToCart,
    tabIndex: TabIndex.DEFAULT,
    $backgroundColor: props.backgroundColor,
    $labelColor: props.labelColor,
    $stageWidth: props.stageWidth,
    $showWebsiteButton: showWebsiteButton,
    "aria-label": ariaLabelShopThisItemButton,
    $disabled: disabled || error
  }, props.buttonLabel || ShoppingButtonDefaultText)))));
};
/* harmony default export */ var Partials_CartContentContainer = (CartContentContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/ProductModal/CartModal.tsx
















var CartModal_DefaultMainImageSize = {
  width: 280,
  height: 280
};
var renderThumbInner = function renderThumbInner(item) {
  return /*#__PURE__*/react.createElement(ThumbWrapper, null, /*#__PURE__*/react.createElement(ThumbImage, {
    src: item.thumbnail,
    alt: "thumb"
  }));
};
var CartModal = function CartModal(props) {
  var _elementAttributes$pr;
  var _useAtom = react_useAtom(stageSizeWidthAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    width = _useAtom2[0];
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    accountId = _useAtom4[0].link.accountId;
  var _useContext = (0,react.useContext)(contexts_CartContext),
    activeOption = _useContext.activeOption,
    setVariantMedia = _useContext.setVariantMedia;
  var _useAtom5 = react_useAtom(rootPrimitivesAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    downloadMode = _useAtom6[0].downloadMode;
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var elementAttributes = element.attributes;
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    cart = _useContext2.cart;
  var color = elementAttributes.displayIcon === 'button' && elementAttributes.variant === 'modal' ? elementAttributes.color : elementAttributes.modalButtonBackground;
  var attributeHashWithMedia = elementAttributes === null || elementAttributes === void 0 || (_elementAttributes$pr = elementAttributes.product) === null || _elementAttributes$pr === void 0 || (_elementAttributes$pr = _elementAttributes$pr.attributesReorder) === null || _elementAttributes$pr === void 0 ? void 0 : _elementAttributes$pr.find(function (hash) {
    var _elementAttributes$pr2;
    return elementAttributes === null || elementAttributes === void 0 || (_elementAttributes$pr2 = elementAttributes.product) === null || _elementAttributes$pr2 === void 0 || (_elementAttributes$pr2 = _elementAttributes$pr2.attributes) === null || _elementAttributes$pr2 === void 0 ? void 0 : _elementAttributes$pr2[hash].propertiesMedia;
  });
  var propertyMedia;
  if (attributeHashWithMedia && activeOption[attributeHashWithMedia]) {
    var _elementAttributes$pr3;
    propertyMedia = elementAttributes === null || elementAttributes === void 0 || (_elementAttributes$pr3 = elementAttributes.product) === null || _elementAttributes$pr3 === void 0 || (_elementAttributes$pr3 = _elementAttributes$pr3.attributes) === null || _elementAttributes$pr3 === void 0 ? void 0 : _elementAttributes$pr3[attributeHashWithMedia].propertiesMedia[activeOption[attributeHashWithMedia]];
  }
  var media = propertyMedia || elementAttributes.media || [];
  (0,react.useEffect)(function () {
    setVariantMedia(media);
  }, [activeOption]);

  // Only solution to remove the thumbnails from tab order
  (0,react.useEffect)(function () {
    var thumbnails = document.querySelectorAll('.image-gallery-thumbnail');
    thumbnails.forEach(function (thumbnail) {
      thumbnail.setAttribute('tabindex', '-1');
    });
  }, []);
  var getImageSrc = function getImageSrc(src, provider) {
    var imgSrc = getImageResourcePath(accountId, {
      src: src,
      provider: provider
    });
    if (downloadMode) {
      return "".concat(imgSrc, ".jpg");
    }
    return getImageAppendedSrc({
      width: CartModal_DefaultMainImageSize.width,
      height: CartModal_DefaultMainImageSize.height,
      imgSrc: imgSrc
    });
  };
  return /*#__PURE__*/react.createElement(ProductContainer, {
    $stageWidth: width
  }, !!media.length && /*#__PURE__*/react.createElement(ProductModal_styles_ProductPhotosContainer, {
    marginRight: 24,
    stageWidth: width
  }, /*#__PURE__*/react.createElement(SlideshowWrapper_SlideshowWrapper, null, /*#__PURE__*/react.createElement(src_Slideshow, {
    getImageSrc: getImageSrc,
    width: CartModal_DefaultMainImageSize.width,
    height: CartModal_DefaultMainImageSize.height,
    items: media,
    showBullets: false,
    showThumbnails: true,
    showArrows: true,
    isIOS: main/* isIOS */.un,
    objectFit: "contain",
    disableKeyDown: false,
    renderThumbInner: renderThumbInner
  }))), /*#__PURE__*/react.createElement(Partials_CartContentContainer, {
    title: elementAttributes.title,
    description: elementAttributes.description,
    price: elementAttributes.price,
    discountPrice: elementAttributes.discountPrice,
    buttonLabel: elementAttributes.buttonLabel,
    stageWidth: width,
    addToCart: props.addToCart,
    currency: (cart === null || cart === void 0 ? void 0 : cart.currency) || '',
    backgroundColor: color,
    labelColor: elementAttributes.labelColor,
    productId: elementAttributes.code,
    quantity: elementAttributes.quantity,
    website: elementAttributes.website,
    product: elementAttributes.product,
    customizableProduct: elementAttributes.customizableProduct
  }));
};
CartModal.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  addToCart: (prop_types_default()).func.isRequired
};
/* harmony default export */ var ProductModal_CartModal = (CartModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/CartButtonContainer/CartButtonActionContainer.tsx




function CartButtonActionContainer_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ CartButtonActionContainer_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function CartButtonActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function CartButtonActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? CartButtonActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : CartButtonActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }



















var CartButtonActionContainer = function CartButtonActionContainer(props) {
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    hash = _useAtom2$.hash,
    accountId = _useAtom2$.link.accountId,
    dateLastUpdate = _useAtom2$.dateLastUpdate;
  var _useContext = (0,react.useContext)(contexts_ModalContext),
    setOpen = _useContext.setOpen,
    setDisabled = _useContext.setDisabled;
  var defaultsPaidPersonalization = src_CartView.constants.CartCustomizableProductDefaults.paidPersonalization;
  var _useContext2 = (0,react.useContext)(contexts_CartContext),
    value = _useContext2.value,
    activeOption = _useContext2.activeOption,
    editedVariant = _useContext2.editedVariant,
    variantMedia = _useContext2.variantMedia;
  var currentValues = (0,react.useRef)({
    quantity: value
  });

  // We need ref because the value is used inside an event listener
  (0,react.useEffect)(function () {
    currentValues.current = CartButtonActionContainer_objectSpread(CartButtonActionContainer_objectSpread({}, currentValues.current), {}, {
      quantity: value
    });
  }, [value]);
  (0,react.useEffect)(function () {
    currentValues.current = CartButtonActionContainer_objectSpread(CartButtonActionContainer_objectSpread({}, currentValues.current), {}, {
      editedVariant: Object.keys(editedVariant).length ? CartButtonActionContainer_objectSpread({}, editedVariant) : {},
      variantMedia: variantMedia,
      activeOption: activeOption
    });
  }, [activeOption, editedVariant]);
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = CartButtonActionContainer_objectSpread({}, element.attributes);
  var _useAtom3 = react_useAtom(addItemToCartAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 2),
    addItemToCart = _useAtom4[1];
  var elemRef = (0,react.useRef)(null);
  var ariaLabel = attributes.tooltip || attributes.buttonLabel;

  /**
   * Helper to calculate updated prices for paid personalization
   */
  var getUpdatedPrices = function getUpdatedPrices(customizableProductValue) {
    var _attributes$customiza;
    var updatePriceData = {};
    if ((_attributes$customiza = attributes.customizableProduct) !== null && _attributes$customiza !== void 0 && (_attributes$customiza = _attributes$customiza.paidPersonalization) !== null && _attributes$customiza !== void 0 && _attributes$customiza.active) {
      var _currentValues$curren, _currentValues$curren2, _currentValues$curren3, _currentValues$curren4;
      var countCustomizableProductValue = removeSpacing(customizableProductValue).length;
      var _attributes$customiza2 = attributes.customizableProduct.paidPersonalization,
        _attributes$customiza3 = _attributes$customiza2.active,
        paidPersonalizationActive = _attributes$customiza3 === void 0 ? defaultsPaidPersonalization.active : _attributes$customiza3,
        _attributes$customiza4 = _attributes$customiza2.pricingMethod,
        pricingMethod = _attributes$customiza4 === void 0 ? defaultsPaidPersonalization.pricingMethod : _attributes$customiza4,
        _attributes$customiza5 = _attributes$customiza2.extraPrice,
        extraPrice = _attributes$customiza5 === void 0 ? defaultsPaidPersonalization.extraPrice : _attributes$customiza5;
      var editedPrice = (_currentValues$curren = (_currentValues$curren2 = currentValues.current.editedVariant) === null || _currentValues$curren2 === void 0 ? void 0 : _currentValues$curren2.price) !== null && _currentValues$curren !== void 0 ? _currentValues$curren : attributes.price;
      var editedDiscountPrice = (_currentValues$curren3 = (_currentValues$curren4 = currentValues.current.editedVariant) === null || _currentValues$curren4 === void 0 ? void 0 : _currentValues$curren4.discountPrice) !== null && _currentValues$curren3 !== void 0 ? _currentValues$curren3 : attributes.discountPrice;
      var finalPrice = !editedDiscountPrice ? getFinalPrice(paidPersonalizationActive, pricingMethod, extraPrice, countCustomizableProductValue, editedPrice) : editedPrice;
      var finalDiscountPrice = editedDiscountPrice ? getFinalPrice(paidPersonalizationActive, pricingMethod, extraPrice, countCustomizableProductValue, editedDiscountPrice) : editedDiscountPrice;
      updatePriceData = {
        price: finalPrice,
        discountPrice: finalDiscountPrice
      };
    }
    return updatePriceData;
  };

  /**
   * Helper to build uniqueId for the cart item
   */
  var buildUniqueId = function buildUniqueId(formattedTitle, customizableProductValue) {
    var _currentValues$curren5, _attributes$customiza6;
    var uniqueId = "".concat(props.id);
    var currentActiveOption = (_currentValues$curren5 = currentValues.current.activeOption) !== null && _currentValues$curren5 !== void 0 ? _currentValues$curren5 : {};
    if (Object.keys(currentActiveOption).length) {
      Object.values(currentActiveOption).forEach(function (attribute) {
        uniqueId += "-".concat(attribute);
      });
    }
    if ((_attributes$customiza6 = attributes.customizableProduct) !== null && _attributes$customiza6 !== void 0 && _attributes$customiza6.active && customizableProductValue) {
      uniqueId += "-".concat(esm_browser_v4());
    }
    return uniqueId;
  };

  /**
   * Helper to build customizable product data
   */
  var buildCustomizableProductData = function buildCustomizableProductData(customizableProductValue) {
    var _attributes$customiza7;
    if ((_attributes$customiza7 = attributes.customizableProduct) !== null && _attributes$customiza7 !== void 0 && _attributes$customiza7.active && customizableProductValue) {
      return {
        customizableProduct: {
          label: attributes.customizableProduct.label,
          value: customizableProductValue
        }
      };
    }
    return {};
  };

  /**
   * Helper to build the new cart item object
   */
  var buildNewCartItem = function buildNewCartItem(uniqueId, title, customVariantMedia) {
    var _currentValues$curren6, _editedVariantCurrent, _editedVariantCurrent2, _attributes$website, _currentValues$curren7;
    var editedVariantCurrent = (_currentValues$curren6 = currentValues.current.editedVariant) !== null && _currentValues$curren6 !== void 0 ? _currentValues$curren6 : {};
    var editedPrice = (_editedVariantCurrent = editedVariantCurrent.price) !== null && _editedVariantCurrent !== void 0 ? _editedVariantCurrent : attributes.price;
    var editedDiscountPrice = (_editedVariantCurrent2 = editedVariantCurrent.discountPrice) !== null && _editedVariantCurrent2 !== void 0 ? _editedVariantCurrent2 : attributes.discountPrice;
    var websiteUrl = (_attributes$website = attributes.website) !== null && _attributes$website !== void 0 && _attributes$website.websiteUrl ? {
      website: {
        websiteUrl: attributes.website.websiteUrl
      }
    } : {};
    var currentActiveOption = (_currentValues$curren7 = currentValues.current.activeOption) !== null && _currentValues$curren7 !== void 0 ? _currentValues$curren7 : {};
    var activeOptionValues = Object.values(currentActiveOption);
    var variantHash = activeOptionValues.length ? "fs-".concat(activeOptionValues.join('-')) : '';
    return CartButtonActionContainer_objectSpread({
      elementId: uniqueId,
      title: title,
      price: editedPrice,
      discountPrice: editedDiscountPrice,
      media: customVariantMedia,
      quantity: CartButtonActionContainer_objectSpread(CartButtonActionContainer_objectSpread({}, attributes.quantity), {}, {
        value: attributes.quantity.hasRange && attributes.quantity.min && currentValues.current.quantity === 1 ? attributes.quantity.min : currentValues.current.quantity
      }),
      code: attributes.code,
      variantSku: editedVariantCurrent.code || variantHash || null
    }, websiteUrl);
  };
  var addToCart = /*#__PURE__*/function () {
    var _ref = asyncToGenerator_asyncToGenerator(/*#__PURE__*/CartButtonActionContainer_regeneratorRuntime().mark(function _callee() {
      var _currentValues$curren8, _attributes$customiza8;
      var formattedTitle,
        customizableProductValue,
        title,
        currentActiveOption,
        uniqueId,
        customizableProductData,
        updatePriceData,
        customVariantMedia,
        playerToken,
        newCartItem,
        addToCartAnimationDelay,
        firstImgSrc,
        _newCartItem,
        _args = arguments;
      return CartButtonActionContainer_regeneratorRuntime().wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            formattedTitle = _args.length > 0 && _args[0] !== undefined ? _args[0] : '';
            customizableProductValue = _args.length > 1 && _args[1] !== undefined ? _args[1] : '';
            title = attributes.title;
            currentActiveOption = (_currentValues$curren8 = currentValues.current.activeOption) !== null && _currentValues$curren8 !== void 0 ? _currentValues$curren8 : {};
            if (Object.keys(currentActiveOption).length) {
              title = formattedTitle;
            }
            uniqueId = buildUniqueId(formattedTitle, customizableProductValue);
            customizableProductData = buildCustomizableProductData(customizableProductValue);
            updatePriceData = (_attributes$customiza8 = attributes.customizableProduct) !== null && _attributes$customiza8 !== void 0 && _attributes$customiza8.active && customizableProductValue ? getUpdatedPrices(customizableProductValue) : {};
            customVariantMedia = (currentValues.current.variantMedia || []).length ? currentValues.current.variantMedia : attributes.media;
            playerToken = getPlayerToken(accountId, hash);
            newCartItem = buildNewCartItem(uniqueId, title, customVariantMedia);
            newCartItem = CartButtonActionContainer_objectSpread(CartButtonActionContainer_objectSpread(CartButtonActionContainer_objectSpread({}, newCartItem), customizableProductData), updatePriceData);
            addToCartAnimationDelay = 0;
            firstImgSrc = ''; // If it's the modal variant close the modal after the item is added to the cart
            if (attributes.variant === ElementAttributesVariants.MODAL) {
              setDisabled(true);
              setTimeout(function () {
                setOpen('');
              }, ANIMATION_EXECUTION_TIME);
              addToCartAnimationDelay = ANIMATION_EXECUTION_TIME;
            }
            if (customVariantMedia !== null && customVariantMedia !== void 0 && customVariantMedia[0]) {
              firstImgSrc = getImageResourcePath(accountId, {
                src: customVariantMedia[0].hash,
                provider: customVariantMedia[0].provider
              });
            }
            addItemToCart({
              playerToken: playerToken,
              newCartItem: newCartItem,
              datePublished: dateLastUpdate,
              addToCartAnimation: {
                firstImgSrc: firstImgSrc,
                addToCartAnimationDelay: addToCartAnimationDelay
              }
            });
            if (!(attributes.code && attributes.productHash)) {
              _context.next = 20;
              break;
            }
            _context.next = 20;
            return sendMessageHelper({
              hash: hash,
              pageId: props.pageId,
              eId: props.id,
              sku: attributes.code,
              variantSku: newCartItem.variantSku,
              quantity: ((_newCartItem = newCartItem) === null || _newCartItem === void 0 || (_newCartItem = _newCartItem.quantity) === null || _newCartItem === void 0 ? void 0 : _newCartItem.value) || 1,
              productHash: attributes.productHash,
              ts: Math.floor(new Date().getTime() / 1000)
            }, getTrackOrdersEndpoint());
          case 20:
          case "end":
            return _context.stop();
        }
      }, _callee);
    }));
    return function addToCart() {
      return _ref.apply(this, arguments);
    };
  }();
  var onKeyDownHandler = function onKeyDownHandler(event) {
    if (event.code === KeyboardCodes.ENTER || event.code === KeyboardCodes.SPACE) {
      addToCart();
    }
  };
  (0,react.useEffect)(function () {
    var currentElem = elemRef === null || elemRef === void 0 ? void 0 : elemRef.current;
    if (currentElem) {
      currentElem.addEventListener('click', addToCart);
      return function () {
        currentElem.removeEventListener('click', addToCart);
      };
    }
    return function () {/* Cleanup function */};
  }, []);
  if (attributes.variant === ElementAttributesVariants.MODAL) {
    return /*#__PURE__*/react.createElement(GeneralStyles_ElementLayer, null, /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
      width: "auto",
      height: "auto",
      identifier: "".concat(props.pageId, "-").concat(props.elementIndex),
      ariaLabel: ariaLabel
    }, /*#__PURE__*/react.createElement(ProductModal_CartModal, {
      pageId: props.pageId,
      elementIndex: props.elementIndex,
      addToCart: addToCart
    })));
  }
  return /*#__PURE__*/react.createElement(ButtonElementLayer, {
    ref: elemRef,
    tabIndex: TabIndex.DEFAULT,
    "aria-label": ariaLabel,
    onKeyDown: onKeyDownHandler
  });
};
/* harmony default export */ var CartButtonContainer_CartButtonActionContainer = (CartButtonActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/CartButtonContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/PhoneNumberActionContainer/PhoneNumberActionContainer.tsx

function PhoneNumberActionContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function PhoneNumberActionContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? PhoneNumberActionContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : PhoneNumberActionContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }









var PhoneNumberActionContainer = function PhoneNumberActionContainer(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    highlights = _useContext.options.controls.highlights;
  var attributes = PhoneNumberActionContainer_objectSpread({}, element.attributes);
  return /*#__PURE__*/react.createElement(HyperlinkElementLayer, {
    $highlights: !!highlights
  }, /*#__PURE__*/react.createElement(Anchor_Anchor, {
    href: "tel:".concat(attributes.phoneNumber),
    target: attributes.phoneNumber,
    tabIndex: TabIndex.DEFAULT,
    ariaLabel: element.type === LinkType.OUTLINE ? '' : utils_getTooltip(element)
  }));
};
PhoneNumberActionContainer.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  elementIndex: (prop_types_default()).number.isRequired
};
/* harmony default export */ var PhoneNumberActionContainer_PhoneNumberActionContainer = (PhoneNumberActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/PhoneNumberActionContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/QuestionModal/QuestionModal.styles.tsx

var QuestionModal_styles_QuestionModalContainer = styled_components_browser_esm.div.withConfig({
  displayName: "QuestionModalstyles__QuestionModalContainer",
  componentId: "sc-1aha8xt-0"
})(["display:flex;flex-direction:column;gap:24px;"]);
var QuestionModal_styles_Label = styled_components_browser_esm.label.withConfig({
  displayName: "QuestionModalstyles__Label",
  componentId: "sc-1aha8xt-1"
})(["font-size:", "px;font-weight:", ";"], function (_ref) {
  var theme = _ref.theme;
  return theme.typography.size.paragraph;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.typography.weight.bold;
});
var QuestionModal_styles_Textarea = styled_components_browser_esm.textarea.withConfig({
  displayName: "QuestionModalstyles__Textarea",
  componentId: "sc-1aha8xt-2"
})(["border:", ";width:100%;border-radius:", "px;height:", "px;font-size:", "px;flex-basis:65%;resize:none;margin-top:16px;padding:", ";;font-family:", ";&:focus{border-color:", ";outline:0;}"], function (_ref3) {
  var theme = _ref3.theme;
  return theme.input.border;
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.defaults.borderRadius;
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.input.height * 3;
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.typography.size.smallerParagraph;
}, function (_ref7) {
  var theme = _ref7.theme;
  return "".concat(theme.input.paddingX, "px ").concat(theme.input.paddingY, "px");
}, function (_ref8) {
  var theme = _ref8.theme;
  return theme.typography.family.sans;
}, function (_ref9) {
  var theme = _ref9.theme;
  return theme.input.focusBorderColor;
});
var QuestionModal_styles_SubmitButton = styled_components_browser_esm.button.withConfig({
  displayName: "QuestionModalstyles__SubmitButton",
  componentId: "sc-1aha8xt-3"
})(["font-family:", ";width:100%;cursor:pointer;margin-top:24px;color:", ";text-align:center;line-height:", "px;height:40px;border-radius:8px;background-color:", ";border:1px solid ", ";letter-spacing:0.1px;font-size:", "px;font-weight:", ";overflow:hidden;:not(:disabled):hover{background-image:linear-gradient(rgba(0,0,0,0.30),rgba(0,0,0,0.30));}"], function (_ref10) {
  var theme = _ref10.theme;
  return theme.typography.family.sans;
}, function (_ref11) {
  var theme = _ref11.theme;
  return theme.colors.getTextColor(theme.colors.primary);
}, function (_ref12) {
  var theme = _ref12.theme;
  return theme.typography.lineHeight.paragraph;
}, function (_ref13) {
  var theme = _ref13.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref14) {
  var theme = _ref14.theme;
  return theme.colors.getButtonColor(theme.colors.primary);
}, function (_ref15) {
  var theme = _ref15.theme;
  return theme.typography.size.button;
}, function (_ref16) {
  var theme = _ref16.theme;
  return theme.typography.weight.medium;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/QuestionModal/QuestionModal.tsx












var QuestionModal = function QuestionModal(_ref) {
  var attributes = _ref.attributes,
    showModalSuccessful = _ref.showModalSuccessful,
    elementId = _ref.elementId;
  var questions = attributes.questions,
    buttonLabel = attributes.buttonLabel,
    collectData = attributes.collectData,
    privacyPolicy = attributes.privacyPolicy,
    gdprCompliance = attributes.gdprCompliance;
  var _useAtom = react_useAtom(rootPrimitivesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    downloadMode = _useAtom2[0].downloadMode;
  var _useState = (0,react.useState)(true),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    disableButton = _useState2[0],
    setDisableButton = _useState2[1];
  var textAreaRef = (0,react.useRef)(null);
  var _useState3 = (0,react.useState)(''),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    readerEmail = _useState4[0],
    setReaderEmail = _useState4[1];
  var _useState5 = (0,react.useState)(!collectData),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    isEmailValid = _useState6[0],
    setIsEmailValid = _useState6[1];
  var _useState7 = (0,react.useState)(collectData ? !(privacyPolicy !== null && privacyPolicy !== void 0 && privacyPolicy.active) : true),
    _useState8 = slicedToArray_slicedToArray(_useState7, 2),
    agreedToPrivacyPolicy = _useState8[0],
    setAgreedToPrivacyPolicy = _useState8[1];
  var _useState9 = (0,react.useState)(false),
    _useState10 = slicedToArray_slicedToArray(_useState9, 2),
    agreedToGDPR = _useState10[0],
    setAgreedToGDPR = _useState10[1];
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    hash = _useAtom4[0].hash;

  // At the moment we use only one question
  var firstQuestion = questions[0];
  var questionText = firstQuestion.text || src_QuestionView.defaults.textQuestion;
  var buttonText = buttonLabel || src_QuestionView.defaults.buttonLabel;
  var onChange = function onChange(_ref2) {
    var target = _ref2.target;
    if (target.value && disableButton) {
      setDisableButton(false);
    }
    if (!target.value && !disableButton) {
      setDisableButton(true);
    }
  };
  var sendAnswer = function sendAnswer() {
    var _textAreaRef$current;
    // TODO: It will set a limitation.
    if (!downloadMode && textAreaRef !== null && textAreaRef !== void 0 && (_textAreaRef$current = textAreaRef.current) !== null && _textAreaRef$current !== void 0 && _textAreaRef$current.value && agreedToPrivacyPolicy && isEmailValid) {
      // Replace newline characters with spaces
      var answer = textAreaRef.current.value.replace(/\n/g, ' ');
      sendDataToSqs({
        it: InteractivityType.QUESTION,
        ch: hash,
        eid: elementId,
        responses: defineProperty_defineProperty({}, firstQuestion.hash, answer),
        ts: Math.floor(new Date().getTime() / 1000),
        md: {
          gdpr: agreedToGDPR,
          email: readerEmail
        }
      }, getInteractivityElementsEndpoint()).then(function () {
        // TODO: handle response
      });
      showModalSuccessful();
    }
  };
  return /*#__PURE__*/react.createElement(react.Fragment, null, collectData && /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(CollectData_CollectData, {
    showEmailSection: collectData,
    privacyPolicy: privacyPolicy,
    gdprCompliance: gdprCompliance,
    setAgreedToPrivacyPolicy: setAgreedToPrivacyPolicy,
    setAgreedToGDPR: setAgreedToGDPR,
    setIsEmailValid: setIsEmailValid,
    setReaderEmail: setReaderEmail,
    readerEmail: readerEmail
  }), /*#__PURE__*/react.createElement(ModalContentStyles_Divider, null)), /*#__PURE__*/react.createElement("div", {
    key: firstQuestion.hash
  }, /*#__PURE__*/react.createElement(QuestionModal_styles_Label, {
    tabIndex: TabIndex.DEFAULT
  }, questionText), /*#__PURE__*/react.createElement(QuestionModal_styles_Textarea, {
    ref: textAreaRef,
    maxLength: 350,
    title: questionText,
    tabIndex: TabIndex.DEFAULT,
    onChange: onChange
  })), /*#__PURE__*/react.createElement(QuestionModal_styles_SubmitButton, {
    disabled: disableButton || !isEmailValid || !agreedToPrivacyPolicy,
    onClick: sendAnswer,
    "aria-label": buttonText,
    tabIndex: TabIndex.DEFAULT,
    style: {
      marginTop: 0
    }
  }, buttonText));
};
/* harmony default export */ var QuestionModal_QuestionModal = (QuestionModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/QuestionModal/QuestionModalContainer.tsx








var QuestionModalContainer = function QuestionModalContainer(props) {
  var _useAtom = react_useAtom(modalStepAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    modalStep = _useAtom2[0];
  var setModalStep = react_useSetAtom(setModalStepAtom);
  var showModalSuccessful = function showModalSuccessful() {
    setModalStep(InteractivityModalStep.SUCCESSFUL_SEND_RESPONSE);
  };
  (0,react.useEffect)(function () {
    setModalStep(InteractivityModalStep.DEFAULT);
  }, []);
  return /*#__PURE__*/react.createElement(QuestionModal_styles_QuestionModalContainer, null, modalStep === InteractivityModalStep.SUCCESSFUL_SEND_RESPONSE ? /*#__PURE__*/react.createElement(SuccessfulSendResponse_SuccessfulSendResponse, {
    thankYouMessage: props.attributes.thankYouMessage
  }) : /*#__PURE__*/react.createElement(QuestionModal_QuestionModal, {
    attributes: props.attributes,
    showModalSuccessful: showModalSuccessful,
    elementId: props.id
  }));
};
/* harmony default export */ var QuestionModal_QuestionModalContainer = (QuestionModalContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/QuestionActionContainer/QuestionActionContainer.tsx









var QuestionActionContainer = function QuestionActionContainer(_ref) {
  var elementIndex = _ref.elementIndex,
    pageId = _ref.pageId,
    id = _ref.id;
  var element = useElement({
    elementIndex: elementIndex,
    pageId: pageId
  });
  var theme = Ze();
  var _useAtom = react_useAtom(stageSizeAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageSize = _useAtom2[0];
  var modalWidth = stageSize.width <= theme.deviceSize.tabletS ? 'auto' : "".concat(theme.leadForm.popoverSizes.width, "px");
  var attributes = element.attributes;
  return /*#__PURE__*/react.createElement(HyperlinkElementLayer, null, /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: modalWidth,
    height: "auto",
    identifier: "".concat(pageId, "-").concat(elementIndex),
    ariaLabel: attributes.tooltip
  }, /*#__PURE__*/react.createElement(QuestionModal_QuestionModalContainer, {
    id: id,
    attributes: attributes
  })));
};
/* harmony default export */ var QuestionActionContainer_QuestionActionContainer = (QuestionActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/QuestionActionContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/containers/OpenOverlayActionContainer/OpenOverlayActionContainer.tsx






var OpenOverlayActionContainer = function OpenOverlayActionContainer(props) {
  var element = useElement({
    elementIndex: props.elementIndex,
    pageId: props.pageId
  });
  var attributes = element.attributes,
    rotation = element.rotation,
    _element$bounds = element.bounds,
    width = _element$bounds.width,
    height = _element$bounds.height,
    x = _element$bounds.x,
    y = _element$bounds.y;
  var interactionAttributes = attributes;
  var interaction = {
    interactionType: interactionAttributes.interactionType,
    openActionType: interactionAttributes.openActionType,
    positionActionType: interactionAttributes.positionActionType,
    popinTooltip: interactionAttributes.popinTooltip,
    title: interactionAttributes.title,
    width: interactionAttributes.width,
    height: interactionAttributes.height,
    description: interactionAttributes.description,
    color: interactionAttributes.onHoverColor,
    alpha: interactionAttributes.alpha,
    onHoverColor: interactionAttributes.onHoverColor,
    onHoverAlpha: interactionAttributes.onHoverAlpha
  };
  var highlightColor = (interaction === null || interaction === void 0 ? void 0 : interaction.interactionType) === InteractionTypes.POPOVER ? {
    start: hexToRgba(interactionAttributes.onHoverColor, 0),
    hover: hexToRgba(interactionAttributes.onHoverColor, interactionAttributes.onHoverAlpha)
  } : {};
  return /*#__PURE__*/react.createElement(InteractionLayer, {
    $highlightColor: highlightColor
  }, /*#__PURE__*/react.createElement(InteractionPopover, {
    interaction: interaction,
    elementWidth: width,
    elementHeight: height,
    elementX: x,
    elementY: y,
    offsetX: props.offsetX,
    isFirstPage: props.isFirstPage,
    rotation: rotation,
    identifier: "".concat(props.pageId, "-").concat(props.elementIndex),
    openType: interaction.openActionType,
    elementAction: props.elementAction
  }));
};
/* harmony default export */ var OpenOverlayActionContainer_OpenOverlayActionContainer = (OpenOverlayActionContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/ActionHandler.tsx




























// All the action containers will be named like elementNameActionContainer
var ActionHandler = function ActionHandler(props) {
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  if (settledStageIndex !== props.stageIndex && props.effect !== playerTypes_PlayerEffect.SCROLL) {
    return null;
  }
  switch (props.elementAction) {
    case ActionType.IMAGE:
    case ActionType.TEXT_BOX:
    case ActionType.SHAPE_ELEMENT:
      return /*#__PURE__*/react.createElement(InteractionActionContainer_InteractionActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        offsetX: props.offsetX,
        isFirstPage: props.isFirstPage,
        elementAction: props.elementAction
      });
    case ActionType.OPEN_OVERLAY:
      return /*#__PURE__*/react.createElement(OpenOverlayActionContainer_OpenOverlayActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        isFirstPage: props.isFirstPage,
        offsetX: props.offsetX,
        elementAction: props.elementAction
      });
    case ActionType.VIDEO:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(VideoActionContainer_VideoActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        stageIndex: props.stageIndex
      }));
    case ActionType.PRODUCT_TAG:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(ProductTagActionContainer_ProductTagActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      }));
    case ActionType.AUDIO:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(AudioActionContainer_AudioActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        onClickAction: props.onClickAction,
        stageIndex: props.stageIndex
      }));
    case ActionType.GO_TO_FLIPSNACK_PROFILE:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(GoToProfileActionContainer_GoToProfileActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      }));
    case ActionType.GO_TO_PREV_PAGE:
    case ActionType.GO_TO_NEXT_PAGE:
    case ActionType.GO_TO_FIRST_PAGE:
    case ActionType.GO_TO_LAST_PAGE:
    case ActionType.GO_TO_PAGE:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(PageNavActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        elementAction: props.elementAction
      }));
    case ActionType.TAG:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(TagActionContainer_TagActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        offsetX: props.offsetX,
        isFirstPage: props.isFirstPage,
        stageIndex: props.stageIndex
      }));
    case ActionType.CAPTION:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(CaptionActionContainer_CaptionActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        offsetX: props.offsetX,
        isFirstPage: props.isFirstPage
      }));
    case ActionType.GO_TO_URL:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(GoToUrlActionContainer_GoToUrlActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        stageIndex: props.stageIndex
      }));
    case ActionType.DOWNLOAD_PDF:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(DownloadPdfActionContainer_DownloadPdfActionContainer, null));
    case ActionType.SEND_EMAIL:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(SendEmailActionContainer_SendEmailActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      }));
    case ActionType.PHONE_NUMBER:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(PhoneNumberActionContainer_PhoneNumberActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      }));
    case ActionType.SPOTLIGHT:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(SpotlightActionContainer_SpotlightActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      }));
    case ActionType.POPUP_FRAME:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(PopupFrameActionContainer_PopupFrameActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      }));
    case ActionType.CART_HYPERLINK:
    case ActionType.CART_BUTTON:
      return /*#__PURE__*/react.createElement(CartProviderContainer_CartProviderContainer, null, /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(CartButtonContainer_CartButtonActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        id: props.id
      })));
    case ActionType.PHOTO_SLIDESHOW:
      return /*#__PURE__*/react.createElement(PhotoSlideshowActionContainer_PhotoSlideshowActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      });
    case ActionType.CHARTS_LINE:
    case ActionType.CHARTS_BAR:
    case ActionType.CHARTS_PIE:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(ChartActionContainer_ChartActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      }));
    case ActionType.QUIZ:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(QuizActionContainer_QuizActionContainer, {
        pageId: props.pageId,
        elementId: props.id,
        elementIndex: props.elementIndex
      }));
    case ActionType.CONTACT_FORM:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(ContactFormActionContainer_ContactFormActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      }));
    case ActionType.QUESTION:
      return /*#__PURE__*/react.createElement("div", {
        onMouseLeave: props.onMouseLeave,
        onMouseEnter: props.onMouseEnter
      }, /*#__PURE__*/react.createElement(QuestionActionContainer_QuestionActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        id: props.id
      }));
    case ActionType.VIDEO_WIDGET:
    default:
      return null;
  }
};
ActionHandler.propTypes = {
  id: (prop_types_default()).number.isRequired,
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  stageIndex: (prop_types_default()).number.isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  elementAction: (prop_types_default()).number.isRequired,
  offsetX: (prop_types_default()).number.isRequired,
  isFirstPage: (prop_types_default()).bool.isRequired,
  onClickAction: (prop_types_default()).func.isRequired,
  onMouseLeave: (prop_types_default()).func.isRequired,
  onMouseEnter: (prop_types_default()).func.isRequired,
  effect: (prop_types_default()).string.isRequired
};
/* harmony default export */ var ActionHandler_ActionHandler = (ActionHandler);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/StageElement.tsx



















var ElementsComponents = StageElements_Elements_Elements();
var StageElement = function StageElement(props) {
  var _element$attributes, _element$attributes2;
  var _useState = (0,react.useState)({}),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    changedProps = _useState2[0],
    setChangedProps = _useState2[1];
  var _useState3 = (0,react.useState)(false),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    mouseOver = _useState4[0],
    setMouseOver = _useState4[1];
  var _useContext = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext.zoom;
  var _useContext2 = (0,react.useContext)(contexts_ControllerContext),
    initialPlayerScale = _useContext2.scale;
  var _useAtom = react_useAtom(scaleContentAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    scale = _useAtom2[0];
  var _useContext3 = (0,react.useContext)(contexts_ModalContext),
    active = _useContext3.active;
  var mandatoryActions = react_useAtomValue(mandatoryActionsAtom);
  var element = useElement({
    pageId: props.pageId,
    elementIndex: props.elementIndex
  });
  var showMandatoryStyle = false;

  // Check if the current element is mandatory and apply outline if so
  if (Object.keys(mandatoryActions).length) {
    var mandatoryStage = Object.keys(mandatoryActions).find(function (stageKey) {
      return stageKey.includes("".concat(props.pageId));
    });
    if (mandatoryStage) {
      var mandatoryActionsByStage = mandatoryActions[mandatoryStage];
      showMandatoryStyle = mandatoryActionsByStage.includes(element.id);
    } else {
      showMandatoryStyle = false;
    }
  } else {
    showMandatoryStyle = false;
  }
  var _useContext4 = (0,react.useContext)(contexts_PopoverContext),
    elementRef = _useContext4.elementRef;
  zoom *= initialPlayerScale * scale;
  var Component = ElementsComponents[ElementDefaults[element.type].component];
  var onClickAction = function onClickAction(action) {
    if (action && action.changeProp) {
      setChangedProps(action.changeProp);
    }
  };
  var onMouseEnter = function onMouseEnter() {
    setMouseOver(true);
  };
  var onMouseLeave = function onMouseLeave() {
    setMouseOver(false);
  };
  var elementAlpha = typeof element.alpha === 'number' ? element.alpha : 1;
  var opacity = getElementOpacity((_element$attributes = element.attributes) === null || _element$attributes === void 0 ? void 0 : _element$attributes.isAutoLink, (_element$attributes2 = element.attributes) === null || _element$attributes2 === void 0 ? void 0 : _element$attributes2.isAnnotation, props.highlightOnLinks, elementAlpha);

  // @ts-ignore
  var audioIconChanged = (changedProps === null || changedProps === void 0 ? void 0 : changedProps.icon) || '';
  // Browsers may have different strategy when rounding sub-pixel;
  var scaleValue = function scaleValue(value) {
    return value * zoom;
  };
  var scaleSizes = function scaleSizes(value) {
    return value * zoom < ELEMENT_MIN_SIZE_VALUE ? ELEMENT_MIN_SIZE_VALUE : value * zoom;
  };
  var isInteractiveElement = InteractiveButtonElements.concat(InteractiveLinkElements).includes(element.type);
  var hoverActive = isInteractiveElement && props.animatedInteractions && props.isStageActive && mouseOver;

  // Hover stays active after the modal is closed
  (0,react.useEffect)(function () {
    if (active) {
      setMouseOver(false);
    }
  }, [active]);
  return (0,react.useMemo)(function () {
    return /*#__PURE__*/react.createElement(ElementPositioning, {
      $top: "".concat(scaleValue(element.bounds.y), "px"),
      $left: "".concat(scaleValue(element.bounds.x), "px"),
      $width: scaleSizes(element.bounds.width),
      $height: scaleSizes(element.bounds.height),
      $rotation: (element === null || element === void 0 ? void 0 : element.rotation) || 0,
      $zIndex: element.zIndex,
      ref: elementRef
    }, /*#__PURE__*/react.createElement(StageElementTooltipContainer_StageElementTooltipContainer, {
      pageId: props.pageId,
      elementIndex: props.elementIndex
    }, /*#__PURE__*/react.createElement(ElementStatisticsLayer_ElementStatisticsLayer, {
      elementId: element.id,
      pageId: element.pageId
    }, /*#__PURE__*/react.createElement(MandatoryElementWrapper, {
      showMandatoryStyle: showMandatoryStyle,
      elementId: element.id
    }, /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.A)({}, element.attributes, {
      alpha: opacity,
      width: scaleValue(element.bounds.width),
      height: scaleValue(element.bounds.height),
      type: element.type,
      id: element.id,
      stageIndex: props.stageIndex,
      pageId: props.pageId,
      pageItemHash: props.pageItemHash
    }, changedProps, {
      zoom: zoom,
      radius: 'radius' in element.attributes ? element.attributes.radius * zoom : 0,
      animatedInteractions: props.animatedInteractions,
      isStageActive: props.isStageActive,
      mouseOver: hoverActive,
      pageNumber: props.pageNumber,
      effect: props.effect
    })), /*#__PURE__*/react.createElement(ActionHandler_ActionHandler, {
      elementAction: element.action,
      pageId: element.pageId,
      id: element.id,
      elementIndex: props.elementIndex,
      stageIndex: props.stageIndex,
      offsetX: props.offsetX,
      isFirstPage: props.isFirstPage,
      onClickAction: onClickAction,
      onMouseEnter: onMouseEnter,
      onMouseLeave: onMouseLeave,
      effect: props.effect
    })))));
  }, [element.id, audioIconChanged, zoom, props.highlightOnLinks, props.isStageActive, props.animatedInteractions, mouseOver, showMandatoryStyle]);
};
StageElement.propTypes = {
  stageIndex: (prop_types_default()).number.isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  offsetX: (prop_types_default()).number.isRequired,
  isFirstPage: (prop_types_default()).bool.isRequired,
  animatedInteractions: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var StageElements_StageElement = (StageElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/PopoverProviderContainer/PopoverProviderContainer.tsx



var PopoverProviderContainer = function PopoverProviderContainer(props) {
  var elementRef = (0,react.useRef)(null);
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    opened = _useState2[0],
    setOpened = _useState2[1];
  var data = (0,react.useMemo)(function () {
    return {
      elementRef: elementRef,
      opened: opened,
      setOpened: setOpened
    };
  }, [opened]);
  return /*#__PURE__*/react.createElement(PopoverProvider, {
    value: data
  }, props.children);
};
/* harmony default export */ var PopoverProviderContainer_PopoverProviderContainer = (PopoverProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/PopoverProviderContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/StageElements.tsx


function StageElements_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function StageElements_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? StageElements_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : StageElements_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
















var StageElements = function StageElements(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options = _useContext.options,
    _useContext$options$c = _useContext$options.content,
    layout = _useContext$options$c.layout,
    rtl = _useContext$options$c.rtl,
    effect = _useContext$options$c.effect,
    _useContext$options$c2 = _useContext$options.controls,
    highlights = _useContext$options$c2.highlights,
    _useContext$options$c3 = _useContext$options$c2.animatedInteractions,
    animatedInteractions = _useContext$options$c3 === void 0 ? true : _useContext$options$c3,
    _useContext$pages = _useContext.pages,
    pageData = _useContext$pages.data,
    pagesOrder = _useContext$pages.order;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    autoCreateLinks = _useAtom2[0].editor.autoCreateLinks;
  var _useAtom3 = react_useAtom(featuresAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    features = _useAtom4[0];
  var _useContext2 = (0,react.useContext)(contexts_SettledStageIndexContext),
    settledStageIndex = _useContext2.settledStageIndex;
  var _useState = (0,react.useState)(true),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    firstRender = _useState2[0],
    setFirstRender = _useState2[1];
  (0,react.useEffect)(function () {
    setFirstRender(false);
  }, []);
  var getElement = function getElement(element, index, offsetX, highlightOnLinks, pageNumber) {
    if (main/* isMobile */.Fr) {
      return /*#__PURE__*/react.createElement(StageElements_StageElement, {
        pageId: element.pageId,
        pageItemHash: pageData[element.pageId].source.hash,
        stageIndex: props.stageIndex,
        elementIndex: index,
        offsetX: offsetX,
        isFirstPage: props.isFirstPage,
        key: element.id,
        highlightOnLinks: highlightOnLinks,
        isStageActive: settledStageIndex === props.stageIndex && !firstRender,
        animatedInteractions: animatedInteractions,
        pageNumber: pageNumber,
        effect: effect
      });
    }
    return /*#__PURE__*/react.createElement(PopoverProviderContainer_PopoverProviderContainer, {
      key: element.id
    }, /*#__PURE__*/react.createElement(StageElements_StageElement, {
      pageId: element.pageId,
      pageItemHash: pageData[element.pageId].source.hash,
      stageIndex: props.stageIndex,
      elementIndex: index,
      offsetX: offsetX,
      isFirstPage: props.isFirstPage,
      highlightOnLinks: highlightOnLinks,
      isStageActive: settledStageIndex === props.stageIndex && !firstRender,
      animatedInteractions: animatedInteractions,
      pageNumber: pageNumber,
      effect: effect
    }));
  };
  var getElements = function getElements(elements) {
    var _elements$;
    var offsetX = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
    if (!elements) {
      return null;
    }
    var pageNumber = (_elements$ = elements[0]) !== null && _elements$ !== void 0 && _elements$.pageId ? getPageNumberByPageId(pagesOrder, elements[0].pageId, rtl) : 1;
    return elements.map(function (element, index) {
      var _element$attributes;
      var elementType = element.type,
        elementAction = element.action,
        invisible = element.invisible;
      var elementProvider = element !== null && element !== void 0 && element.attributes && 'provider' in element.attributes ? element.attributes.provider : '';
      var hideAutoDetectedLink = (element === null || element === void 0 || (_element$attributes = element.attributes) === null || _element$attributes === void 0 ? void 0 : _element$attributes.isAutoLink) && !autoCreateLinks;
      var invisibleOrHidden = invisible || !hasAccessToElement({
        elementType: elementType,
        elementAction: elementAction,
        elementProvider: elementProvider
      }, features) || hideAutoDetectedLink;
      return invisibleOrHidden ? /*#__PURE__*/react.createElement("div", {
        key: element.id
      }) : getElement(element, index, props.isFirstPage ? 0 : offsetX, highlights, pageNumber);
    });
  };
  var leftPageElements = (0,react.useMemo)(function () {
    return getElements(props.elements[0]);
  }, [props.elements, autoCreateLinks, highlights, settledStageIndex, animatedInteractions, firstRender, props.pageWidth, props.pageHeight]);
  var rightPageElements = (0,react.useMemo)(function () {
    return getElements(props.elements[1], props.pageWidth);
  }, [props.elements, props.pageWidth, props.pageHeight, autoCreateLinks, highlights, settledStageIndex, animatedInteractions, firstRender]);
  var overflow = layout === constants_WidgetLayoutTypes.DOUBLE && !rtl ? 'visible' : 'hidden';
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ShapesLoader_ShapesLoader, null), /*#__PURE__*/react.createElement(ElementsContainer, null, /*#__PURE__*/react.createElement(Elements_styles_Elements, null, /*#__PURE__*/react.createElement(ElementsList, {
    $width: props.pageWidth,
    $height: props.pageHeight,
    $overflow: overflow
  }, !firstRender && leftPageElements, firstRender && /*#__PURE__*/react.createElement(Preloader_Preloader, {
    width: props.pageWidth,
    height: props.pageHeight
  })), !props.hasOnlyOnePage && /*#__PURE__*/react.createElement(ElementsList, {
    $width: props.pageWidth,
    $height: props.pageHeight,
    $left: 0,
    $overflow: overflow
  }, !firstRender && !!rightPageElements && rightPageElements, firstRender && /*#__PURE__*/react.createElement(Preloader_Preloader, {
    width: props.pageWidth,
    height: props.pageHeight
  })))));
};
StageElements.propTypes = StageElements_objectSpread(StageElements_objectSpread({
  pageWidth: (prop_types_default()).number.isRequired
}, Elements), {}, {
  isFirstPage: (prop_types_default()).bool.isRequired
});
/* harmony default export */ var StageElements_StageElements = (StageElements);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/jotai-scope/dist/index.modern.js






function index_modern_extends() {
  index_modern_extends = Object.assign ? Object.assign.bind() : 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 index_modern_extends.apply(this, arguments);
}

function createIsolation() {
  const StoreContext = createContext(null);
  const Provider = ({
    store,
    initialValues: _initialValues = [],
    children
  }) => {
    const storeRef = useRef(store);
    if (!storeRef.current) {
      storeRef.current = createStore();
    }
    useHydrateAtoms(_initialValues, {
      store: storeRef.current
    });
    return jsx(StoreContext.Provider, {
      value: storeRef.current,
      children: children
    });
  };
  const useStore$1 = options => {
    const store = useContext(StoreContext);
    if (!store) throw new Error('Missing Provider from createIsolation');
    return useStore(index_modern_extends({
      store
    }, options));
  };
  const useAtom$1 = (anAtom, options) => {
    const store = useStore$1();
    return useAtom(anAtom, index_modern_extends({
      store
    }, options));
  };
  const useAtomValue$1 = (anAtom, options) => {
    const store = useStore$1();
    return useAtomValue(anAtom, index_modern_extends({
      store
    }, options));
  };
  const useSetAtom$1 = (anAtom, options) => {
    const store = useStore$1();
    return useSetAtom(anAtom, index_modern_extends({
      store
    }, options));
  };
  return {
    Provider,
    useStore: useStore$1,
    useAtom: useAtom$1,
    useAtomValue: useAtomValue$1,
    useSetAtom: useSetAtom$1
  };
}

const index_modern_isSelfAtom = (atom, a) => atom.unstable_is ? atom.unstable_is(a) : a === atom;
const isEqualSet = (a, b) => a === b || a.size === b.size && Array.from(a).every(v => b.has(v));
const ScopeContext = (0,react.createContext)([a => [a, false], undefined]);
const ScopeProvider = ({
  atoms,
  children
}) => {
  const parentScopeContext = (0,react.useContext)(ScopeContext);
  const atomSet = new Set(atoms);
  const [tryGetScopedRouterAtomInParentScope, storeOrUndefined] = parentScopeContext;
  const parentStore = react_useStore();
  const store = storeOrUndefined != null ? storeOrUndefined : parentStore;
  const initialize = () => {
    const commonRouterAtoms = new WeakMap();
    const scopedRouterAtoms = new WeakMap();
    /**
     * Create a CommonRouterAtom copy of originalAtom. CommonRouterAtom will NEVER act as a store
     * key to access states, but it intercepts originalAtom's read/write function. If some of
     * originalAtom's dependencies are scoped, the read/write function will be intercepted to access the correct
     * ScopedRouterAtom copy.
     *
     * NOTE: CommonRouterAtom is only used when originalAtom is not scoped in any scope. That logic
     * is guaranteed by `getRouterAtom`.
     *
     * @see getRouterAtom
     * @param originalAtom
     * @returns A CommonRouterAtom of originalAtom.
     */
    const createCommonRouterAtom = originalAtom => {
      /**
       * This is the core mechanism of how a router atom finds the correct atom to read/write.
       *
       * First, we know that originalAtom is not scoped in any scope, the logic is guaranteed by
       * `getRouterAtom`.
       *
       * Then, when the CommonRouterAtom call get(targetAtom) or set(targetAtom, value), this
       * function is called to route `targetAtom` to another atom. That atom would be used as
       * store key to access the globally shared / scoped state.
       * @param target The `targetAtom` that this atom is accessing.
       * @returns The actual atom to access. If the atom is originalAtom itself, return
       * originalAtom. If the atom is scoped, return a ScopedRouterAtom copy. Otherwise, return the
       * unscoped CommonRouterAtom copy.
       *
       * Check the example below, when calling useAtomValue, jotai-scope will first
       * find its router copy (lets call it `rAtom`). Then,
       * `anAtom.read(get => get(dependencyAtom))` becomes
       * `rAtom.read(get => get(routeAtom(anAtom, dependencyAtom)))`
       * @example
       * const anAtom = atom(get => get(dependencyAtom))
       * const Component = () => {
       *  useAtomValue(anAtom);
       * }
       * const App = () => {
       *   return (
       *    <ScopeProvider atoms={[anAtom]}>
       *      <Component />
       *    </ScopeProvider>
       *   );
       * }
       */
      const routeAtom = target => {
        // The target is got/set by itself. Since we know originalAtom is not scoped in any scope,
        // directly return the originalAtom itself.
        if (target === originalAtom) {
          return target;
        }
        // The target is got/set by another atom, access the target's router atom.
        return getRouterAtom(target);
      };
      const routerAtom = index_modern_extends({}, originalAtom, 'read' in originalAtom && {
        read(get, opts) {
          return originalAtom.read(a => get(routeAtom(a)), opts);
        }
      }, 'write' in originalAtom && {
        write(get, set, ...args) {
          return originalAtom.write(a => get(routeAtom(a)), (a, ...v) => set(routeAtom(a), ...v), ...args);
        }
      }, {
        // eslint-disable-next-line camelcase
        unstable_is: a => index_modern_isSelfAtom(a, originalAtom)
      });
      return routerAtom;
    };
    /**
     * Create a ScopedRouterAtom copy of originalAtom. The ScopedRouterAtom will act as a store key
     * to access its own state. All of a ScopedRouterAtom's dependencies are also scoped, so their
     * read/write functions will be intercepted to access ScopedRouterAtom copy, too.
     * @param originalAtom
     * @returns A ScopedRouterAtom copy of originalAtom.
     */
    const createScopedRouterAtom = originalAtom => {
      const scopedRouterAtom = index_modern_extends({}, originalAtom, 'read' in originalAtom && {
        read(get, opts) {
          return originalAtom.read(a => get(getScopedRouterAtom(a)), opts);
        }
      }, 'write' in originalAtom && {
        write(get, set, ...args) {
          return originalAtom.write(a => get(getScopedRouterAtom(a)), (a, ...v) => set(getScopedRouterAtom(a), ...v), ...args);
        }
      }, {
        // eslint-disable-next-line camelcase
        unstable_is: a => index_modern_isSelfAtom(a, originalAtom)
      });
      return scopedRouterAtom;
    };
    /**
     * For EVERY `useAtomValue` and `useSetAtom` call, since we don't know if the atom is scoped
     * or not, a router atom copy is always created to intercept the read/write function.
     *
     * It first check if originalAtom is scoped in any scope. If so, then route to
     * `ScopedRouterAtom`. All of the atom's dependency will be scoped in that scope as well.
     * If not, then the atom is globally unique, route to `CommonRouterAtom`. The atom's
     * dependencies' scope status is not determined yet.
     */
    const getRouterAtom = originalAtom => {
      // Step 1: Check if the atom is scoped in current scope.
      const [possiblyScoped, isScoped] = tryGetScopedRouterAtomInCurrentScope(originalAtom);
      // Step 2: If the atom is scoped, return the ScopedRouterAtom copy.
      if (isScoped) {
        return possiblyScoped;
      }
      // Step 3: If the atom is not scoped, return the CommonRouterAtom copy.
      let commonRouterAtom = commonRouterAtoms.get(originalAtom);
      if (!commonRouterAtom) {
        commonRouterAtom = createCommonRouterAtom(originalAtom);
        commonRouterAtoms.set(originalAtom, commonRouterAtom);
      }
      return commonRouterAtom;
    };
    const getScopedRouterAtom = originalAtom => {
      let scopedRouterAtom = scopedRouterAtoms.get(originalAtom);
      if (!scopedRouterAtom) {
        scopedRouterAtom = createScopedRouterAtom(originalAtom);
        scopedRouterAtoms.set(originalAtom, scopedRouterAtom);
      }
      return scopedRouterAtom;
    };
    /**
     * If originalAtom is scoped in current scope, returns ScopedRouterAtom copy.
     * Otherwise, recursively check if originalAtom is scoped in parent scope.
     *
     * If the atom is not scoped in any scope, return the originalAtom itself.
     * The second return value indicates whether the atom is scoped in any scope.
     */
    const tryGetScopedRouterAtomInCurrentScope = originalAtom => {
      if (atomSet.has(originalAtom)) {
        return [getScopedRouterAtom(originalAtom), true];
      }
      return tryGetScopedRouterAtomInParentScope(originalAtom);
    };
    /**
     * When an atom is accessed via useAtomValue/useSetAtom, the access should
     * be handled by a router atom copy.
     */
    const patchedStore = index_modern_extends({}, store, {
      get: (anAtom, ...args) => store.get(getRouterAtom(anAtom), ...args),
      set: (anAtom, ...args) => store.set(getRouterAtom(anAtom), ...args),
      sub: (anAtom, ...args) => store.sub(getRouterAtom(anAtom), ...args)
    });
    const scopeContext = [tryGetScopedRouterAtomInCurrentScope, store];
    return [patchedStore, scopeContext, parentScopeContext, atomSet];
  };
  const [state, setState] = (0,react.useState)(initialize);
  if (parentScopeContext !== state[2] || !isEqualSet(atomSet, state[3])) {
    setState(initialize);
  }
  const [patchedStore, scopeContext] = state;
  return (0,jsx_runtime.jsx)(ScopeContext.Provider, {
    value: scopeContext,
    children: (0,jsx_runtime.jsx)(Provider, {
      store: patchedStore,
      children: children
    })
  });
};


//# sourceMappingURL=index.modern.mjs.map

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/ScopeIdProvider/ScopeIdProvider.tsx





var ScopeIdProvider = function ScopeIdProvider(props) {
  var providerInitialValue = [[pageLoadingTaskAtom, defineProperty_defineProperty({}, props.pageIds[0], pageLoadingTaskDefaults)]];
  if (props.pageIds.length === 2) {
    providerInitialValue = [[pageLoadingTaskAtom, defineProperty_defineProperty(defineProperty_defineProperty({}, props.pageIds[0], pageLoadingTaskDefaults), props.pageIds[1], pageLoadingTaskDefaults)]];
  }
  return /*#__PURE__*/react.createElement(ScopeProvider, {
    atoms: [pageLoadingTaskAtom]
  }, /*#__PURE__*/react.createElement(HydrateAtoms_HydrateAtoms, {
    initialValues: providerInitialValue
  }, props.children));
};
/* harmony default export */ var ScopeIdProvider_ScopeIdProvider = (/*#__PURE__*/react.memo(ScopeIdProvider));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/ScopeIdProvider/index.tsx

;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/constants/index.ts
var FlipbookPageTypes = {
  PDF: 'pdf',
  PNG: 'png',
  JPG: 'jpg',
  JPEG: 'jpeg',
  CUSTOM: 'custom'
};
var constants_CoverType = {
  ORIGINAL: 'original',
  MEDIUM: 'medium',
  THUMB: 'thumb',
  SMALL: 'small'
};
var FlipbookPrivateVisibilityMap = {
  PRIVATE: 'PRIVATE',
  PRIVATE_EMAIL: 'PRIVATE_EMAIL',
  SHARED_TEAM: 'SHARED_TEAM',
  PRIVATE_SSO: 'PRIVATE_SSO'
};
var FlipbookPrivateVisibility = [FlipbookPrivateVisibilityMap.PRIVATE, FlipbookPrivateVisibilityMap.PRIVATE_EMAIL, FlipbookPrivateVisibilityMap.SHARED_TEAM, FlipbookPrivateVisibilityMap.PRIVATE_SSO];
var constants_ItemResourceBucket = /*#__PURE__*/function (ItemResourceBucket) {
  ItemResourceBucket["DEFAULT"] = "default";
  ItemResourceBucket["CONTENT"] = "content";
  return ItemResourceBucket;
}({});
;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/utils/getPageCover.ts


/**
 * Return page cover image
 *
 * @param cdnPath
 * @param hash
 * @param page
 * @param version
 * @param coverType
 * @param downloadMode
 * @return {string}
 */
/* harmony default export */ var getPageCover = (function (cdnPath, hash, page, version) {
  var coverType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : constants_CoverType.THUMB;
  var downloadMode = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
  var extension = downloadMode ? '.jpg' : '';
  return "".concat(cdnPath, "/collections/items/").concat(hash, "/covers/page_").concat(page + 1, "/").concat(coverType).concat(extension, "?version=").concat(version);
});
;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/utils/getPageCoverFromContent.ts


/**
 * Returns cover image from content bucket
 * @param {string} privateContentCdn
 * @param {string} workspaceHash
 * @param {string} flipbookHash
 * @param {string} hash
 * @param {number} page
 * @param {string} version
 * @param {string} coverType
 * @param {boolean} downloadMode
 * @param {string} signature
 * @returns {string}
 */
/* harmony default export */ var getPageCoverFromContent = (function (privateContentCdn, workspaceHash, flipbookHash, hash, page, version) {
  var coverType = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : constants_CoverType.THUMB;
  var downloadMode = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
  var signature = arguments.length > 8 ? arguments[8] : undefined;
  var extension = downloadMode ? '.jpg' : '';
  var itemsPath = "".concat(privateContentCdn, "/").concat(workspaceHash, "/collections/").concat(flipbookHash, "/items/");
  var coverPath = "".concat(hash, "/covers/page_").concat(page + 1, "/").concat(coverType).concat(extension);
  if (signature) {
    coverPath += "?".concat(signature);
  }
  return itemsPath + coverPath;
});
;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/components/Page/TemporaryBackgroundLayer.tsx



var PageTempDiv = styled_components_browser_esm.div.withConfig({
  displayName: "TemporaryBackgroundLayer__PageTempDiv",
  componentId: "sc-1je6cre-0"
})(["background-size:contain;background-repeat:no-repeat;background-position:center;width:100%;height:100%;background-color:transparent;background-image:url(", ");backface-visibility:hidden;transform:translateZ(0);position:absolute;top:0;"], function (_ref) {
  var $src = _ref.$src;
  return $src;
});
var TemporaryBackgroundLayer = function TemporaryBackgroundLayer(_ref2) {
  var src = _ref2.src;
  return /*#__PURE__*/react.createElement(PageTempDiv, {
    $src: src
  });
};
TemporaryBackgroundLayer.propTypes = {
  src: (prop_types_default()).string.isRequired
};
/* harmony default export */ var Page_TemporaryBackgroundLayer = (/*#__PURE__*/react.memo(TemporaryBackgroundLayer));
;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/components/Page/PageBackground.tsx



var PageDiv = styled_components_browser_esm.div.withConfig({
  displayName: "PageBackground__PageDiv",
  componentId: "sc-17hm0la-0"
})(["width:", ";height:", ";background:", " !important;"], function (_ref) {
  var $width = _ref.$width;
  return $width;
}, function (_ref2) {
  var $height = _ref2.$height;
  return $height;
}, function (_ref3) {
  var $bgColor = _ref3.$bgColor;
  return $bgColor;
});
var PageImg = styled_components_browser_esm.img.withConfig({
  displayName: "PageBackground__PageImg",
  componentId: "sc-17hm0la-1"
})(["object-fit:", ";pointer-events:none;user-select:none;background-color:#fff;"], function (_ref4) {
  var $objectFit = _ref4.$objectFit;
  return $objectFit;
});
var PageBackground_BackgroundContainer = styled_components_browser_esm.div.withConfig({
  displayName: "PageBackground__BackgroundContainer",
  componentId: "sc-17hm0la-2"
})(["position:relative;width:", ";height:", ";"], function (_ref5) {
  var $width = _ref5.$width;
  return $width;
}, function (_ref6) {
  var $height = _ref6.$height;
  return $height;
});
var PageBackground = function PageBackground(_ref7) {
  var width = _ref7.width,
    height = _ref7.height,
    color = _ref7.color,
    src = _ref7.src,
    temporarySrc = _ref7.temporarySrc,
    _ref7$objectFit = _ref7.objectFit,
    objectFit = _ref7$objectFit === void 0 ? 'contain' : _ref7$objectFit;
  var bg = (0,react.useMemo)(function () {
    return src ? /*#__PURE__*/react.createElement(PageImg, {
      width: width,
      height: height,
      src: src,
      $objectFit: objectFit
    }) : /*#__PURE__*/react.createElement(PageDiv, {
      $width: width,
      $height: height,
      $bgColor: color
    });
  }, [width, height, color, src]);
  var temporaryBg = (0,react.useMemo)(function () {
    return temporarySrc ? /*#__PURE__*/react.createElement(Page_TemporaryBackgroundLayer, {
      src: temporarySrc
    }) : null;
  }, [temporarySrc]);
  return /*#__PURE__*/react.createElement(PageBackground_BackgroundContainer, {
    $width: width,
    $height: height
  }, bg, temporaryBg);
};
/* harmony default export */ var Page_PageBackground = (/*#__PURE__*/react.memo(PageBackground));
;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/components/Page/index.tsx







var loadImage = function loadImage(src, onLoad, onError) {
  var img = new Image();
  img.src = src;
  img.onload = onLoad;
  img.onerror = onError;
};
var components_Page_Page = function Page(props) {
  var loaded = (0,react.useRef)(false);
  var _useState = (0,react.useState)(''),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    source = _useState2[0],
    setSource = _useState2[1];
  var _useState3 = (0,react.useState)(true),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    firstRender = _useState4[0],
    setFirstRender = _useState4[1];
  var _useState5 = (0,react.useState)(''),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    tempBackground = _useState6[0],
    setTempBackground = _useState6[1];
  var setBgTimeout = (0,react.useRef)(null);
  var setTempTimeout = (0,react.useRef)(null);
  var cdnBase = getCdnBase();
  var privateContentBase = getPrivateContent();
  var getCover = function getCover() {
    var imageSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : constants_CoverType.MEDIUM;
    return props.itemResourceBucket === constants_ItemResourceBucket.CONTENT ? getPageCoverFromContent(privateContentBase, props.workspaceHash, props.flipbookHash, props.sourceHash, props.sourcePage,
    // For uploaded pages, sourcePage is always number
    props.version, imageSize, props.downloadMode, props.signature) : getPageCover(cdnBase, props.sourceHash, props.sourcePage,
    // For uploaded pages, sourcePage is always number
    props.version, imageSize, props.downloadMode);
  };
  (0,react.useEffect)(function () {
    if (!firstRender && props.type !== FlipbookPageTypes.CUSTOM && props.showCover) {
      setTempBackground(source);
      var img = new Image();
      var newSrc = getCover(props.size);
      img.src = newSrc;
      img.onload = function () {
        // Set new background image
        clearTimeout(setBgTimeout.current);
        setBgTimeout.current = setTimeout(function () {
          setSource(newSrc);
        }, 100);

        // Delete temporary background
        clearTimeout(setTempTimeout.current);
        setTempTimeout.current = setTimeout(function () {
          setTempBackground('');
        }, 200);
      };
    }
    setFirstRender(false);
  }, [props.size, props.showCover]);
  (0,react.useEffect)(function () {
    if (!loaded.current && props.showCover && props.sourceHash && props.type !== FlipbookPageTypes.CUSTOM) {
      var smallCover = getCover(constants_CoverType.SMALL);
      var propsSizeCover = getCover(props.size);
      var onSmallLoad = function onSmallLoad(event) {
        var _props$onLoad;
        var target = event.target;
        loaded.current = true;
        setSource(target.src);
        (_props$onLoad = props.onLoad) === null || _props$onLoad === void 0 || _props$onLoad.call(props);
        if (smallCover !== propsSizeCover) {
          loadImage(propsSizeCover, function (sizeEvent) {
            var sizeTarget = sizeEvent.target;
            setSource(sizeTarget.src);
          }, function () {});
        }
      };
      var onSmallError = function onSmallError() {
        loadImage(constants_CoverType.ORIGINAL, function (event) {
          var _props$onLoad2;
          var target = event.target;
          setSource(target.src);
          (_props$onLoad2 = props.onLoad) === null || _props$onLoad2 === void 0 || _props$onLoad2.call(props);
        }, function () {
          var _props$onLoad3;
          (_props$onLoad3 = props.onLoad) === null || _props$onLoad3 === void 0 || _props$onLoad3.call(props);
        });
      };
      loadImage(smallCover, onSmallLoad, onSmallError);
    } else if (props.sourceHash === '') {
      setSource('');
      loaded.current = false;
    }
  }, [props.sourceHash, props.version, props.showCover, props.signature]);
  return /*#__PURE__*/react.createElement(Page_PageBackground, {
    src: source,
    color: props.bgColor || '#fff',
    width: "".concat(props.width, "px"),
    height: "".concat(props.height, "px"),
    temporarySrc: tempBackground,
    objectFit: props.objectFit || 'contain'
  });
};
/* harmony default export */ var components_Page = (components_Page_Page);
;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/components/StagePages/StagePages.styles.ts

var StagePagesDiv = styled_components_browser_esm.div.withConfig({
  displayName: "StagePagesstyles__StagePagesDiv",
  componentId: "sc-strpxr-0"
})(["justify-content:center;width:", "px;display:flex;"], function (props) {
  return props.$width;
});
;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/components/ErrorBoundary/index.tsx






function ErrorBoundary_callSuper(t, o, e) { return o = getPrototypeOf_getPrototypeOf(o), possibleConstructorReturn_possibleConstructorReturn(t, components_ErrorBoundary_isNativeReflectConstruct() ? Reflect.construct(o, e || [], getPrototypeOf_getPrototypeOf(t).constructor) : o.apply(t, e)); }
function components_ErrorBoundary_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (components_ErrorBoundary_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }


var components_ErrorBoundary_ErrorBoundary = /*#__PURE__*/function (_Component) {
  function ErrorBoundary(props) {
    var _this;
    classCallCheck_classCallCheck(this, ErrorBoundary);
    _this = ErrorBoundary_callSuper(this, ErrorBoundary, [props]);
    _this.state = {
      hasError: false
    };
    return _this;
  }
  inherits_inherits(ErrorBoundary, _Component);
  return createClass_createClass(ErrorBoundary, [{
    key: "render",
    value: function render() {
      if (this.state.hasError) {
        return /*#__PURE__*/react.createElement("h3", null, "Something went wrong");
      }
      return this.props.children;
    }
  }], [{
    key: "getDerivedStateFromError",
    value: function getDerivedStateFromError() {
      // Update state so the next render will show the fallback UI.
      return {
        hasError: true
      };
    }
  }]);
}(react.Component);
defineProperty_defineProperty(components_ErrorBoundary_ErrorBoundary, "propTypes", {});
components_ErrorBoundary_ErrorBoundary.propTypes = {
  children: (prop_types_default()).node.isRequired
};
/* harmony default export */ var components_ErrorBoundary = (components_ErrorBoundary_ErrorBoundary);
;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/components/StagePages/StagePages.tsx





// This used only for export pdf
var StagePages = function StagePages(props) {
  return /*#__PURE__*/react.createElement(StagePagesDiv, {
    $width: props.flipbookWidth * props.stagePages.length
  }, props.stagePages.map(function (page) {
    return /*#__PURE__*/react.createElement(components_ErrorBoundary, {
      key: page.id
    }, /*#__PURE__*/react.createElement(components_Page, {
      width: props.flipbookWidth,
      height: props.flipbookHeight,
      bgColor: page.bgColor,
      size: page.size,
      sourceHash: page.source.hash,
      sourcePage: page.source.page,
      version: page.version,
      showCover: page.showCover === undefined ? page.type !== FlipbookPageTypes.CUSTOM : page.showCover,
      type: page.type,
      itemResourceBucket: props.itemResourceBucket,
      workspaceHash: props.workspaceHash,
      flipbookHash: props.flipbookHash,
      signature: props.signature
    }));
  }));
};
/* harmony default export */ var StagePages_StagePages = (StagePages);
;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/components/StagePages/index.tsx

;// CONCATENATED MODULE: ../../modules/stage-pages/code/src/index.ts



var StagePage = components_Page;
var StagePagesContainerStyledDiv = StagePagesDiv;
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/PageContainer/PageContainer.tsx











var PageContainer_PageContainer = function PageContainer(props) {
  var signature = react_useAtomValue(signatureAtom);
  var _useAtom = react_useAtom(rootPrimitivesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    downloadMode = _useAtom2[0].downloadMode;
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    _useAtom4$ = _useAtom4[0],
    hash = _useAtom4$.hash,
    accountId = _useAtom4$.link.accountId,
    _useAtom4$$version = _useAtom4$.version,
    schema = _useAtom4$$version.schema,
    revision = _useAtom4$$version.revision;
  var setCountBackground = useSetPageLoader(props.id, ElementsTypeEnum.BACKGROUND_COVER, KeyEnum.NUMBER_OF_ELEMENTS);
  var itemResourceBucket = parseFloat("".concat(schema, ".").concat(revision)) >= flipbookVersion_JsonVersions['3.2'] ? flipbook_ItemResourceBucket.CONTENT : flipbook_ItemResourceBucket.DEFAULT;
  var setCountBackgroundLoaded = useSetPageLoader(props.id, ElementsTypeEnum.BACKGROUND_COVER, KeyEnum.NUMBER_OF_LOADED_ELEMENTS);
  (0,react.useEffect)(function () {
    if (props.type !== PageTypes.CUSTOM) {
      setCountBackground(function (prevCount) {
        return prevCount + 1;
      });
    }
  }, []);
  var onLoad = props.type !== PageTypes.CUSTOM ? function () {
    return setCountBackgroundLoaded(function (prevCount) {
      return prevCount + 1;
    });
  } : undefined;
  return /*#__PURE__*/react.createElement(StagePage, {
    width: props.flipbookWidth,
    height: props.flipbookHeight,
    bgColor: props.bgColor,
    sourceHash: props.source.hash,
    sourcePage: props.source.page,
    size: props.size,
    version: props.version,
    showCover: !!props.showCover,
    onLoad: onLoad,
    downloadMode: downloadMode,
    objectFit: props.objectFit,
    type: props.type,
    itemResourceBucket: itemResourceBucket,
    workspaceHash: accountId,
    flipbookHash: hash,
    signature: signature
  });
};
/* harmony default export */ var StageManager_PageContainer_PageContainer = (PageContainer_PageContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/PageContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/StagePagesContainer/StagePagesContainer.tsx




var StagePagesContainer_StagePagesContainer = function StagePagesContainer(props) {
  var getPages = function getPages() {
    return props.stagePagesProps.map(function (pageProps) {
      return /*#__PURE__*/react.createElement(StageManager_PageContainer_PageContainer, {
        key: pageProps.id,
        flipbookWidth: props.flipbookWidth,
        flipbookHeight: props.flipbookHeight,
        width: pageProps.width,
        height: pageProps.height,
        id: pageProps.id,
        type: pageProps.type,
        bgColor: pageProps.bgColor,
        source: pageProps.source,
        size: pageProps.size,
        version: pageProps.version,
        showCover: pageProps.showCover === undefined ? pageProps.type !== PageTypes.CUSTOM : pageProps.showCover,
        objectFit: pageProps.objectFit
      });
    });
  };
  return /*#__PURE__*/react.createElement(StagePagesContainerStyledDiv, {
    $width: props.flipbookWidth * props.stagePagesProps.length
  }, getPages());
};
/* harmony default export */ var StageManager_StagePagesContainer_StagePagesContainer = (StagePagesContainer_StagePagesContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/StagePagesContainer/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/StageListItem/helpers/getImageSize.ts

/* harmony default export */ var getImageSize = (function (width, height) {
  var imageSizeType = ImageSizeTypes.find(function (imgSizeType) {
    return ImageBreakpointSizes[imgSizeType].width >= width && ImageBreakpointSizes[imgSizeType].height >= height;
  }) || SMALL;
  return ImageBreakpointSizes[imageSizeType].type;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/StageListItem/StageListItem.styles.tsx

var StageListItem_styles_StageListItemContainer = styled_components_browser_esm.div.withConfig({
  displayName: "StageListItemstyles__StageListItemContainer",
  componentId: "sc-19csvl2-0"
})(["position:relative;overflow:hidden;width:", "px;z-index:1;"], function (props) {
  return props.$width;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ShapesProviderContainer/ShapesProviderContainer.tsx



var ShapesProviderContainer = function ShapesProviderContainer(props) {
  var loadedShapes = (0,react.useRef)({});
  var _useState = (0,react.useState)(null),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    shapeDefinitionsRef = _useState2[0],
    setShapeDefinitionsRef = _useState2[1];
  var setLoadedShapesHandler = function setLoadedShapesHandler(shapeId) {
    if (loadedShapes !== null && loadedShapes !== void 0 && loadedShapes.current) {
      loadedShapes.current[shapeId] = true;
    }
  };
  var resetLoadedShapesHandler = function resetLoadedShapesHandler() {
    if (loadedShapes !== null && loadedShapes !== void 0 && loadedShapes.current) {
      Object.keys(loadedShapes.current).forEach(function (key) {
        (loadedShapes === null || loadedShapes === void 0 ? void 0 : loadedShapes.current) && (loadedShapes.current[key] = false);
      });
    }
  };
  var setShapeDefinitionsRefHandler = function setShapeDefinitionsRefHandler(ref) {
    setShapeDefinitionsRef(ref);
  };
  return /*#__PURE__*/react.createElement(ShapesProvider, {
    value: {
      loadedShapes: loadedShapes,
      setLoadedShapes: setLoadedShapesHandler,
      resetLoadedShapes: resetLoadedShapesHandler,
      shapeDefinitionsRef: shapeDefinitionsRef,
      setShapeDefinitionsRef: setShapeDefinitionsRefHandler
    }
  }, props.children);
};
ShapesProviderContainer.propTypes = {};
/* harmony default export */ var ShapesProviderContainer_ShapesProviderContainer = (ShapesProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/ShapesProviderContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/StageListItem/StageListItem.tsx



function StageListItem_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function StageListItem_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? StageListItem_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : StageListItem_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





















var StageListItem = function StageListItem(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options$c = _useContext.options.content,
    shadows = _useContext$options$c.shadows,
    widgetLayout = _useContext$options$c.layout,
    effect = _useContext$options$c.effect,
    isMobilePreview = _useContext$options$c.isMobilePreview,
    pages = _useContext.pages,
    flipbookConverted = _useContext.flipbookConverted;
  var pagesLength = props.order.length;
  var _useContext2 = (0,react.useContext)(contexts_ControllerContext),
    scale = _useContext2.scale;
  var _useContext3 = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext3.zoom;
  var layout = useLayout();
  var _useAtom = react_useAtom(stageSizeWidthAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageWidth = _useAtom2[0];
  var _useFlipbookDimension = useFlipbookDimensions(),
    pageWidth = _useFlipbookDimension.width,
    pageHeight = _useFlipbookDimension.height;
  var isDoublePages = layout !== constants_WidgetLayoutTypes.SINGLE;
  var isFirstStage = props.index === 0;
  var isLastStage = props.index === pages.order.length - 1;
  var hasOnePagePerStage = pages.order[props.index].length === 1;
  var noOfPages = Object.keys(pages.data).length;
  var flipbookWidth = Math.round(pageWidth * scale * zoom * pagesLength);
  var regularCoverSize = (0,react.useMemo)(function () {
    var realWidth = pageWidth * scale;
    var realHeight = pageHeight * scale;
    return getImageSize(realWidth, realHeight);
  }, [scale, pageWidth, pageHeight]);
  var visibleCoverSize = (0,react.useMemo)(function () {
    var realWidth = pageWidth * zoom * scale;
    var realHeight = pageHeight * zoom * scale;
    return getImageSize(realWidth, realHeight);
  }, [zoom, scale, pageWidth, pageHeight]);
  var pageElements = [[], []];
  var viewRatio = pageWidth / pageHeight;

  // @ts-ignore TODO fix  PageType from @flipsnack/types
  var stagePagesProps = props.order.map(function (pageId, pageIndex) {
    if (props.isVisible) {
      // @ts-ignore TODO fix  PageType from @flipsnack/types
      pageElements[pageIndex] = toConsumableArray_toConsumableArray(pages.data["".concat(pageId)].elements);
      return {
        bgColor: pages.data["".concat(pageId)].bgColor,
        type: pages.data["".concat(pageId)].type,
        source: StageListItem_objectSpread({}, pages.data["".concat(pageId)].source),
        width: pages.data["".concat(pageId)].width,
        height: pages.data["".concat(pageId)].height,
        id: pages.data["".concat(pageId)].id,
        version: pages.data["".concat(pageId)].version,
        size: props.active ? visibleCoverSize : regularCoverSize,
        // Show cover only for non-custom pages
        showCover: pages.data["".concat(pageId)].type !== PageTypes.CUSTOM && pages.data["".concat(pageId)].showCover,
        // Use objectFit cover to prevent the browser to scale the image
        // If the page ratio is different, then the img must be scaled to contain
        objectFit: pages.data["".concat(pageId)].width / pages.data["".concat(pageId)].height === viewRatio ? 'cover' : 'contain'
      };
    }
    return StageListItem_objectSpread(StageListItem_objectSpread({}, defaultPage), {}, {
      id: pageId,
      width: Math.round(pageWidth * scale),
      height: Math.round(pageHeight * scale),
      type: PageTypes.CUSTOM,
      size: props.active ? visibleCoverSize : regularCoverSize,
      sourceHash: '',
      objectFit: 'contain'
    });
  });
  var hasElements = !!pageElements[0].length || !!pageElements[1].length;
  var hasOnlyOnePage = stagePagesProps.length === 1;
  var nrOfElements = hasOnlyOnePage ? pageElements[0].length : pageElements[0].length + pageElements[1].length;
  var isFirstPage = props.index === 0;
  var hasShadowOnPages = shadows && widgetLayout !== constants_WidgetLayoutTypes.SINGLE && !hasOnlyOnePage;
  var containerWidth = Math.round(pageWidth * scale * zoom);
  var containerHeight = Math.round(pageHeight * scale * zoom);
  var elements = (0,react.useMemo)(function () {
    return hasElements && flipbookConverted && /*#__PURE__*/react.createElement(StageElements_StageElements, {
      stageIndex: props.index,
      elements: pageElements,
      pageWidth: containerWidth,
      pageHeight: containerHeight,
      hasOnlyOnePage: hasOnlyOnePage,
      isFirstPage: isFirstPage
    });
  }, [props.isVisible, hasOnlyOnePage, hasElements, props.index, nrOfElements, containerWidth, containerHeight, flipbookConverted]);
  var style = {};

  // Calculate the left position when flipbook use scroll effect
  if (effect === playerTypes_PlayerEffect.SCROLL) {
    var baseLeft = main/* isMobile */.Fr || isMobilePreview ? 0 : FLIPBOOK_MIN_MARGIN;
    var isWideEnough = function isWideEnough(width) {
      return stageWidth > width;
    };
    var calculateLeft = function calculateLeft(width) {
      return isWideEnough(width) ? Math.abs((stageWidth - width) / 2) : baseLeft;
    };
    if (noOfPages <= 2 || !isDoublePages) {
      style.left = calculateLeft(flipbookWidth);
    } else if (isFirstStage) {
      style.left = isWideEnough(flipbookWidth * 2) ? Math.abs(flipbookWidth + (stageWidth - flipbookWidth * 2) / 2) : Math.abs(flipbookWidth + baseLeft);
    } else if (isLastStage && hasOnePagePerStage) {
      style.left = calculateLeft(flipbookWidth * 2);
    } else {
      style.left = calculateLeft(flipbookWidth);
    }
  }
  return /*#__PURE__*/react.createElement(ScopeIdProvider_ScopeIdProvider, {
    pageIds: props.order
  }, /*#__PURE__*/react.createElement(ShapesProviderContainer_ShapesProviderContainer, null, /*#__PURE__*/react.createElement(StageListItem_styles_StageListItemContainer, {
    $width: flipbookWidth,
    style: style
  }, /*#__PURE__*/react.createElement(StageManager_StagePagesContainer_StagePagesContainer, {
    stagePagesProps: stagePagesProps,
    flipbookWidth: containerWidth,
    flipbookHeight: containerHeight
  }), elements, /*#__PURE__*/react.createElement(PagePreloader_StagePreloader, {
    stagePages: props.order,
    pageWidth: containerWidth,
    pageHeight: containerHeight
  }), hasShadowOnPages && /*#__PURE__*/react.createElement(StageLayer_StageLayerGradient, null), props.isStageBlocked && /*#__PURE__*/react.createElement(BlockedStages, {
    hasOnlyOnePage: hasOnlyOnePage,
    iconSize: "".concat(60 * scale * zoom, "px")
  }))));
};
/* harmony default export */ var StageListItem_StageListItem = (/*#__PURE__*/react.memo(StageListItem));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/StageListItem/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/StageManager.tsx







var StageManager = function StageManager(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    effect = _useContext.options.content.effect;
  var _useContext2 = (0,react.useContext)(contexts_ControllerContext),
    scale = _useContext2.scale;
  var renderStageItem = (0,react.useCallback)(function (stageIndex, renderThisStagePage, isActive, order) {
    var isStageBlocked = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
    return /*#__PURE__*/react.createElement(StageListItem_StageListItem, {
      index: stageIndex,
      isVisible: renderThisStagePage,
      active: isActive,
      order: order,
      isStageBlocked: isStageBlocked
    });
  }, []);
  return scale > 0 ? /*#__PURE__*/react.createElement(SettledStageIndexProvider_SettledStageIndexProvider, null, /*#__PURE__*/react.createElement(EffectManager_EffectManager, {
    effect: effect,
    renderStage: renderStageItem,
    scaledWidth: props.scaledWidth
  })) : null;
};
StageManager.propTypes = {
  scaledWidth: (prop_types_default()).number.isRequired
};
/* harmony default export */ var StageManager_StageManager = (StageManager);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageManager/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Stage/utils/getStageWidth.ts
/**
 * Get the stage width for singe/double page layout
 * @param pageWidth
 * @param isDoublePageLayout
 * @return number
 */
/* harmony default export */ var getStageWidth = (function (pageWidth, isDoublePageLayout) {
  return isDoublePageLayout ? pageWidth * 2 : pageWidth;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Stage/utils/getPageScale.ts
/**
 * Get the scaling value for the stage
 * @param stageWidth
 * @param stageHeight
 * @param containerWidth
 * @param containerHeight
 * @return number
 */
/* harmony default export */ var getPageScale = (function (_ref, _ref2) {
  var stageWidth = _ref.stageWidth,
    stageHeight = _ref.stageHeight;
  var containerWidth = _ref2.containerWidth,
    containerHeight = _ref2.containerHeight;
  return parseFloat(Math.min(containerWidth / stageWidth, containerHeight / stageHeight).toFixed(3));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Stage/utils/getStageSizeForScrollEffect.ts
/**
 * Returns the size of the stage
 * @param containerHeight
 * @param stageWidth
 * @param pageScale
 * @return { scale: number, wrapperWidth: number, wrapperHeight: number, stageWidth: number, stageHeight: number }
 */
/* harmony default export */ var getStageSizeForScrollEffect = (function (_ref, pageScale) {
  var containerHeight = _ref.containerHeight,
    stageWidth = _ref.stageWidth;
  return {
    scale: pageScale,
    wrapperWidth: stageWidth,
    wrapperHeight: containerHeight,
    stageWidth: stageWidth,
    stageHeight: containerHeight / pageScale
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Stage/utils/getStageSize.ts
/**
 * Returns the size of the stage
 * @param pageHeight
 * @param stageWidth
 * @param pageScale
 * @return { scale: number, wrapperWidth: number, wrapperHeight: number, stageWidth: number, stageHeight: number }
 */
/* harmony default export */ var getStageSize = (function (_ref, pageScale) {
  var pageHeight = _ref.pageHeight,
    stageWidth = _ref.stageWidth;
  var wWidth = stageWidth * pageScale;
  return {
    scale: pageScale,
    wrapperWidth: wWidth,
    wrapperHeight: pageHeight * pageScale,
    stageWidth: stageWidth,
    stageHeight: pageHeight
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Stage/utils/getMaxStageSize.ts

/**
 * Calculate stage spacing
 *
 * @param theme
 * @param playerWidth
 * @param playerHeight
 * @return StageSizeType
 */
/* harmony default export */ var getMaxStageSize = (function (theme, playerWidth, playerHeight) {
  var width = playerWidth - theme.spacing.small.left - theme.spacing.small.right;
  var height = playerHeight - theme.spacing.small.top - theme.spacing.small.bottom;
  if (!main/* isMobile */.Fr && playerWidth > theme.deviceSize.tabletS) {
    width -= theme.spacing.large.left + theme.spacing.large.right;
    height -= theme.spacing.large.top + theme.spacing.large.bottom;
  }
  return {
    width: width,
    height: height
  };
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Stage/Stage.tsx




















var Stage = function Stage() {
  var theme = Ze();
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    effect = _useContext.options.content.effect,
    pages = _useContext.pages;
  var _useContext2 = (0,react.useContext)(contexts_ControllerContext),
    setScale = _useContext2.setScale;
  var _useAtom = react_useAtom(setScaleContentAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    setScaleAtom = _useAtom2[1];
  var _useContext3 = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext3.zoom;
  var _useAtom3 = react_useAtom(stageSizeWidthAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    width = _useAtom4[0];
  var _useAtom5 = react_useAtom(stageSizeHeightAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    height = _useAtom6[0];
  var layout = useLayout();
  var _useFlipbookDimension = useFlipbookDimensions(),
    pageWidth = _useFlipbookDimension.width,
    pageHeight = _useFlipbookDimension.height;
  var noOfPages = Object.keys(pages.data).length;
  (0,react.useEffect)(function () {
    setScaleAtom({
      layout: layout,
      flipbookWidth: pageWidth
    });
  }, []);
  var _useMemo = (0,react.useMemo)(function () {
      var isDoublePageLayout = layout === constants_WidgetLayoutTypes.DOUBLE && noOfPages > 2;
      var wrapperStageWidth = getStageWidth(pageWidth, isDoublePageLayout);
      var maxStageSize = getMaxStageSize(theme, width, height);
      var pageScale = getPageScale({
        stageWidth: wrapperStageWidth,
        stageHeight: pageHeight
      }, {
        containerWidth: maxStageSize.width,
        containerHeight: maxStageSize.height
      });
      if (effect === Effect.SCROLL) {
        return getStageSizeForScrollEffect({
          stageWidth: width,
          containerHeight: height
        }, pageScale);
      }
      return getStageSize({
        pageHeight: pageHeight,
        stageWidth: wrapperStageWidth
      }, pageScale);
    }, [width, height, layout, pageWidth, pageHeight, effect]),
    scale = _useMemo.scale,
    wrapperWidth = _useMemo.wrapperWidth,
    stageWidth = _useMemo.stageWidth,
    stageHeight = _useMemo.stageHeight;
  (0,react.useEffect)(function () {
    return setScale(scale);
  }, [scale]);
  var pagesContainerWidth = "".concat(stageWidth * scale * zoom, "px");
  var pagesContainerHeight = "".concat(stageHeight * scale * zoom, "px");
  var overflowX = layout === constants_WidgetLayoutTypes.SINGLE || effect === Effect.SLIDE ? 'clip' : 'visible';
  if (effect === Effect.SCROLL) {
    overflowX = 'hidden';
    pagesContainerWidth = "".concat(wrapperWidth, "px");
    pagesContainerHeight = "".concat(stageHeight * scale, "px");
  }
  return /*#__PURE__*/react.createElement(StageManagerContainer, {
    $effect: effect,
    $width: "".concat(width, "px"),
    $height: "".concat(height, "px")
  }, /*#__PURE__*/react.createElement(ZoomContainerWrapper_ZoomContainerWrapper, {
    playerWidth: width,
    playerHeight: height,
    width: stageWidth * scale,
    height: stageHeight * scale
  }, /*#__PURE__*/react.createElement(StageWrapper, null, /*#__PURE__*/react.createElement(StagePagesContainer, {
    $width: pagesContainerWidth,
    $height: pagesContainerHeight,
    $overflowX: overflowX
  }, /*#__PURE__*/react.createElement(StageManager_StageManager, {
    scaledWidth: wrapperWidth * zoom
  })))));
};
/* harmony default export */ var Stage_Stage = (Stage);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Stage/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/node_modules/react-swipeable/es/index.js


const es_LEFT = "Left";
const es_RIGHT = "Right";
const UP = "Up";
const DOWN = "Down";

/* global document */
const es_defaultProps = {
    delta: 10,
    preventScrollOnSwipe: false,
    rotationAngle: 0,
    trackMouse: false,
    trackTouch: true,
    swipeDuration: Infinity,
    touchEventOptions: { passive: true },
};
const initialState = {
    first: true,
    initial: [0, 0],
    start: 0,
    swiping: false,
    xy: [0, 0],
};
const mouseMove = "mousemove";
const mouseUp = "mouseup";
const touchEnd = "touchend";
const touchMove = "touchmove";
const touchStart = "touchstart";
function es_getDirection(absX, absY, deltaX, deltaY) {
    if (absX > absY) {
        if (deltaX > 0) {
            return es_RIGHT;
        }
        return es_LEFT;
    }
    else if (deltaY > 0) {
        return DOWN;
    }
    return UP;
}
function rotateXYByAngle(pos, angle) {
    if (angle === 0)
        return pos;
    const angleInRadians = (Math.PI / 180) * angle;
    const x = pos[0] * Math.cos(angleInRadians) + pos[1] * Math.sin(angleInRadians);
    const y = pos[1] * Math.cos(angleInRadians) - pos[0] * Math.sin(angleInRadians);
    return [x, y];
}
function getHandlers(set, handlerProps) {
    const onStart = (event) => {
        const isTouch = "touches" in event;
        // if more than a single touch don't track, for now...
        if (isTouch && event.touches.length > 1)
            return;
        set((state, props) => {
            // setup mouse listeners on document to track swipe since swipe can leave container
            if (props.trackMouse && !isTouch) {
                document.addEventListener(mouseMove, onMove);
                document.addEventListener(mouseUp, onUp);
            }
            const { clientX, clientY } = isTouch ? event.touches[0] : event;
            const xy = rotateXYByAngle([clientX, clientY], props.rotationAngle);
            props.onTouchStartOrOnMouseDown &&
                props.onTouchStartOrOnMouseDown({ event });
            return Object.assign(Object.assign(Object.assign({}, state), initialState), { initial: xy.slice(), xy, start: event.timeStamp || 0 });
        });
    };
    const onMove = (event) => {
        set((state, props) => {
            const isTouch = "touches" in event;
            // Discount a swipe if additional touches are present after
            // a swipe has started.
            if (isTouch && event.touches.length > 1) {
                return state;
            }
            // if swipe has exceeded duration stop tracking
            if (event.timeStamp - state.start > props.swipeDuration) {
                return state.swiping ? Object.assign(Object.assign({}, state), { swiping: false }) : state;
            }
            const { clientX, clientY } = isTouch ? event.touches[0] : event;
            const [x, y] = rotateXYByAngle([clientX, clientY], props.rotationAngle);
            const deltaX = x - state.xy[0];
            const deltaY = y - state.xy[1];
            const absX = Math.abs(deltaX);
            const absY = Math.abs(deltaY);
            const time = (event.timeStamp || 0) - state.start;
            const velocity = Math.sqrt(absX * absX + absY * absY) / (time || 1);
            const vxvy = [deltaX / (time || 1), deltaY / (time || 1)];
            const dir = es_getDirection(absX, absY, deltaX, deltaY);
            // if swipe is under delta and we have not started to track a swipe: skip update
            const delta = typeof props.delta === "number"
                ? props.delta
                : props.delta[dir.toLowerCase()] ||
                    es_defaultProps.delta;
            if (absX < delta && absY < delta && !state.swiping)
                return state;
            const eventData = {
                absX,
                absY,
                deltaX,
                deltaY,
                dir,
                event,
                first: state.first,
                initial: state.initial,
                velocity,
                vxvy,
            };
            // call onSwipeStart if present and is first swipe event
            eventData.first && props.onSwipeStart && props.onSwipeStart(eventData);
            // call onSwiping if present
            props.onSwiping && props.onSwiping(eventData);
            // track if a swipe is cancelable (handler for swiping or swiped(dir) exists)
            // so we can call preventDefault if needed
            let cancelablePageSwipe = false;
            if (props.onSwiping ||
                props.onSwiped ||
                props[`onSwiped${dir}`]) {
                cancelablePageSwipe = true;
            }
            if (cancelablePageSwipe &&
                props.preventScrollOnSwipe &&
                props.trackTouch &&
                event.cancelable) {
                event.preventDefault();
            }
            return Object.assign(Object.assign({}, state), { 
                // first is now always false
                first: false, eventData, swiping: true });
        });
    };
    const onEnd = (event) => {
        set((state, props) => {
            let eventData;
            if (state.swiping && state.eventData) {
                // if swipe is less than duration fire swiped callbacks
                if (event.timeStamp - state.start < props.swipeDuration) {
                    eventData = Object.assign(Object.assign({}, state.eventData), { event });
                    props.onSwiped && props.onSwiped(eventData);
                    const onSwipedDir = props[`onSwiped${eventData.dir}`];
                    onSwipedDir && onSwipedDir(eventData);
                }
            }
            else {
                props.onTap && props.onTap({ event });
            }
            props.onTouchEndOrOnMouseUp && props.onTouchEndOrOnMouseUp({ event });
            return Object.assign(Object.assign(Object.assign({}, state), initialState), { eventData });
        });
    };
    const cleanUpMouse = () => {
        // safe to just call removeEventListener
        document.removeEventListener(mouseMove, onMove);
        document.removeEventListener(mouseUp, onUp);
    };
    const onUp = (e) => {
        cleanUpMouse();
        onEnd(e);
    };
    /**
     * The value of passive on touchMove depends on `preventScrollOnSwipe`:
     * - true => { passive: false }
     * - false => { passive: true } // Default
     *
     * NOTE: When preventScrollOnSwipe is true, we attempt to call preventDefault to prevent scroll.
     *
     * props.touchEventOptions can also be set for all touch event listeners,
     * but for `touchmove` specifically when `preventScrollOnSwipe` it will
     * supersede and force passive to false.
     *
     */
    const attachTouch = (el, props) => {
        let cleanup = () => { };
        if (el && el.addEventListener) {
            const baseOptions = Object.assign(Object.assign({}, es_defaultProps.touchEventOptions), props.touchEventOptions);
            // attach touch event listeners and handlers
            const tls = [
                [touchStart, onStart, baseOptions],
                // preventScrollOnSwipe option supersedes touchEventOptions.passive
                [
                    touchMove,
                    onMove,
                    Object.assign(Object.assign({}, baseOptions), (props.preventScrollOnSwipe ? { passive: false } : {})),
                ],
                [touchEnd, onEnd, baseOptions],
            ];
            tls.forEach(([e, h, o]) => el.addEventListener(e, h, o));
            // return properly scoped cleanup method for removing listeners, options not required
            cleanup = () => tls.forEach(([e, h]) => el.removeEventListener(e, h));
        }
        return cleanup;
    };
    const onRef = (el) => {
        // "inline" ref functions are called twice on render, once with null then again with DOM element
        // ignore null here
        if (el === null)
            return;
        set((state, props) => {
            // if the same DOM el as previous just return state
            if (state.el === el)
                return state;
            const addState = {};
            // if new DOM el clean up old DOM and reset cleanUpTouch
            if (state.el && state.el !== el && state.cleanUpTouch) {
                state.cleanUpTouch();
                addState.cleanUpTouch = void 0;
            }
            // only attach if we want to track touch
            if (props.trackTouch && el) {
                addState.cleanUpTouch = attachTouch(el, props);
            }
            // store event attached DOM el for comparison, clean up, and re-attachment
            return Object.assign(Object.assign(Object.assign({}, state), { el }), addState);
        });
    };
    // set ref callback to attach touch event listeners
    const output = {
        ref: onRef,
    };
    // if track mouse attach mouse down listener
    if (handlerProps.trackMouse) {
        output.onMouseDown = onStart;
    }
    return [output, attachTouch];
}
function updateTransientState(state, props, previousProps, attachTouch) {
    // if trackTouch is off or there is no el, then remove handlers if necessary and exit
    if (!props.trackTouch || !state.el) {
        if (state.cleanUpTouch) {
            state.cleanUpTouch();
        }
        return Object.assign(Object.assign({}, state), { cleanUpTouch: undefined });
    }
    // trackTouch is on, so if there are no handlers attached, attach them and exit
    if (!state.cleanUpTouch) {
        return Object.assign(Object.assign({}, state), { cleanUpTouch: attachTouch(state.el, props) });
    }
    // trackTouch is on and handlers are already attached, so if preventScrollOnSwipe changes value,
    // remove and reattach handlers (this is required to update the passive option when attaching
    // the handlers)
    if (props.preventScrollOnSwipe !== previousProps.preventScrollOnSwipe ||
        props.touchEventOptions.passive !== previousProps.touchEventOptions.passive) {
        state.cleanUpTouch();
        return Object.assign(Object.assign({}, state), { cleanUpTouch: attachTouch(state.el, props) });
    }
    return state;
}
function useSwipeable(options) {
    const { trackMouse } = options;
    const transientState = react.useRef(Object.assign({}, initialState));
    const transientProps = react.useRef(Object.assign({}, es_defaultProps));
    // track previous rendered props
    const previousProps = react.useRef(Object.assign({}, transientProps.current));
    previousProps.current = Object.assign({}, transientProps.current);
    // update current render props & defaults
    transientProps.current = Object.assign(Object.assign({}, es_defaultProps), options);
    // Force defaults for config properties
    let defaultKey;
    for (defaultKey in es_defaultProps) {
        if (transientProps.current[defaultKey] === void 0) {
            transientProps.current[defaultKey] = es_defaultProps[defaultKey];
        }
    }
    const [handlers, attachTouch] = react.useMemo(() => getHandlers((stateSetter) => (transientState.current = stateSetter(transientState.current, transientProps.current)), { trackMouse }), [trackMouse]);
    transientState.current = updateTransientState(transientState.current, transientProps.current, previousProps.current, attachTouch);
    return handlers;
}


//# sourceMappingURL=index.js.map

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useAutoPlay.ts

var useAutoPlay = function useAutoPlay(autoNavigationDelay, nextPage, activeStageIndex, rtl) {
  (0,react.useEffect)(function () {
    var autoFlip;
    if (autoNavigationDelay !== 0) {
      autoFlip = setTimeout(function () {
        nextPage();
      }, autoNavigationDelay * 1000);
    }
    return function () {
      return clearTimeout(autoFlip);
    };
  }, [activeStageIndex, autoNavigationDelay, rtl, nextPage]);
};
/* harmony default export */ var hooks_useAutoPlay = (useAutoPlay);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useBackgroundAudio.ts






/**
 * Functionality to handle audio background:
 *
 * - When the user clicks the button, the audio pauses if it's playing, or resumes if it's paused.
 *
 * - Additionally, if the user changes background audio settings in the Customize page
 * or replaces the audio file, the audio will restart from the beginning when played again.
 *
 * - We use loadeddata to find if the media file has loaded completely.
 * If it has, then the next time the button it plays, the media will resume
 *
 * - We use loadstart to find if the media starts loading.
 * If it starts loading, it means that the src changed and the next time it plays, it starts from the beginning
 *
 * - Also, when the sound does not play in loop and the audio ends,
 * the Background Sound icon updates to the initial state. The ended event is used for this behaviour
 *
 * [Audio element events](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement)
 * @param {BackgroundAudioType} backgroundAudioProps
 */
var useBackgroundAudio = function useBackgroundAudio(backgroundAudioProps) {
  var loop = backgroundAudioProps.loop,
    enabled = backgroundAudioProps.enabled;
  var backgroundAudioElementRef = (0,react.useRef)(null);
  var setBackgroundSoundOn = react_useSetAtom(setBackgroundAudioOn);
  var backgroundSoundOn = react_useAtomValue(backgroundAudioOn);
  var backgroundAudioUrl = useResourcePath(resourceFolders_ResourceType.BACKGROUND_AUDIO, backgroundAudioProps);
  var audioReplaceRef = (0,react.useRef)(false);
  (0,react.useEffect)(function () {
    var _backgroundAudioEleme, _backgroundAudioEleme2;
    backgroundAudioElementRef.current = document.createElement('audio');
    (_backgroundAudioEleme = backgroundAudioElementRef.current) === null || _backgroundAudioEleme === void 0 || _backgroundAudioEleme.addEventListener('loadstart', function () {
      audioReplaceRef.current = true;
    });

    // After the resource loaded the next time audio plays, it resumes to the point it paused
    (_backgroundAudioEleme2 = backgroundAudioElementRef.current) === null || _backgroundAudioEleme2 === void 0 || _backgroundAudioEleme2.addEventListener('loadeddata', function () {
      audioReplaceRef.current = false;
    });
    return function () {
      var _backgroundAudioEleme3, _backgroundAudioEleme4, _backgroundAudioEleme5;
      (_backgroundAudioEleme3 = backgroundAudioElementRef.current) === null || _backgroundAudioEleme3 === void 0 || _backgroundAudioEleme3.pause();
      (_backgroundAudioEleme4 = backgroundAudioElementRef.current) === null || _backgroundAudioEleme4 === void 0 || _backgroundAudioEleme4.removeEventListener('loadstart', function () {
        audioReplaceRef.current = true;
      });
      (_backgroundAudioEleme5 = backgroundAudioElementRef.current) === null || _backgroundAudioEleme5 === void 0 || _backgroundAudioEleme5.removeEventListener('loadeddata', function () {
        audioReplaceRef.current = false;
      });
    };
  }, []);
  (0,react.useEffect)(function () {
    if (backgroundAudioElementRef.current) {
      backgroundAudioElementRef.current.loop = loop;
      if (!loop) {
        backgroundAudioElementRef.current.addEventListener('ended', function () {
          setBackgroundSoundOn(false);
        });
      }
    }
    return function () {
      if (loop) {
        var _backgroundAudioEleme6;
        (_backgroundAudioEleme6 = backgroundAudioElementRef.current) === null || _backgroundAudioEleme6 === void 0 || _backgroundAudioEleme6.removeEventListener('ended', function () {
          setBackgroundSoundOn(false);
        });
      }
    };
  }, [loop]);
  (0,react.useEffect)(function () {
    if (backgroundAudioElementRef.current && enabled) {
      backgroundAudioElementRef.current.src = backgroundAudioUrl;
    }
    return function () {
      if (backgroundAudioElementRef.current) {
        setBackgroundSoundOn(false);
        backgroundAudioElementRef.current.src = '';
      }
    };
  }, [backgroundAudioUrl, enabled]);
  (0,react.useEffect)(function () {
    var _backgroundAudioEleme7;
    if ((_backgroundAudioEleme7 = backgroundAudioElementRef.current) !== null && _backgroundAudioEleme7 !== void 0 && _backgroundAudioEleme7.src) {
      if (backgroundSoundOn) {
        var _backgroundAudioEleme8;
        // When the user plays/stops the audio, the audio should resume
        // Only if the options in customize changed, the audio should reload
        if (audioReplaceRef.current) {
          backgroundAudioElementRef.current.load();
        }
        (_backgroundAudioEleme8 = backgroundAudioElementRef.current) === null || _backgroundAudioEleme8 === void 0 || _backgroundAudioEleme8.play().catch(function () {
          setBackgroundSoundOn(false);
        });
      } else {
        var _backgroundAudioEleme9;
        (_backgroundAudioEleme9 = backgroundAudioElementRef.current) === null || _backgroundAudioEleme9 === void 0 || _backgroundAudioEleme9.pause();
      }
    }
  }, [backgroundSoundOn]);
};
/* harmony default export */ var hooks_useBackgroundAudio = (useBackgroundAudio);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/types/stageActions.ts
var AnimationDirection = /*#__PURE__*/function (AnimationDirection) {
  AnimationDirection["RIGHT_TO_LEFT"] = "RIGHT_TO_LEFT";
  AnimationDirection["LEFT_TO_RIGHT"] = "LEFT_TO_RIGHT";
  return AnimationDirection;
}({});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getPageNumber.ts


/**
* Get page number for statistics
 */
/* harmony default export */ var utils_getPageNumber = (function (activeStageIndex, layout, side, rtl, totalPages) {
  var stageIndex = rtl ? totalPages - activeStageIndex - 1 : activeStageIndex;
  if (layout === constants_WidgetLayoutTypes.DOUBLE) {
    if (side === ChangeAction.Previous) {
      if (rtl) {
        return stageIndex * 2 + 1;
      }
      return stageIndex * 2;
    }
    if (rtl) {
      return stageIndex * 2;
    }
    return stageIndex * 2 + 1;
  }
  return stageIndex + 1;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useChangeStage.ts














var useChangeStage = function useChangeStage() {
  var isChangePageAnimationDone = (0,react.useRef)(true);
  var activeStageIndex = react_useAtomValue(getActiveStageIndexAtom);
  var setPreviousStage = react_useSetAtom(setPreviousActiveStageIndexAtom);
  var setNextStage = react_useSetAtom(setNextActiveStageIndexAtom);
  var setFirstActiveStageIndex = react_useSetAtom(setFirstActiveStageIndexAtom);
  var setLastActiveStageIndex = react_useSetAtom(setLastActiveStageIndexAtom);
  var setZoomEnabled = react_useSetAtom(setZoomEnabledAtom);
  var setActiveMandatoryModal = react_useSetAtom(setActiveMandatoryModalAtom);
  var layout = useLayout();
  var isSwipeBlocked = usePreventSwipeOnZoom();
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    order = _useContext.pages.order,
    rtl = _useContext.options.content.rtl;
  var _useContext2 = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext2.sendGAEvent;
  var indexOfFirstMandatoryAction = useFirstMandatoryStageIndex();
  var nrOfStages = order.length;
  var isNotFirstStage = activeStageIndex > 0;
  var isNotLastStage = activeStageIndex < nrOfStages - 1;
  var sendGaEventForChangePage = function sendGaEventForChangePage() {
    var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AnimationDirection.RIGHT_TO_LEFT;
    if (!rtl && direction === AnimationDirection.RIGHT_TO_LEFT || rtl && direction === AnimationDirection.LEFT_TO_RIGHT) {
      sendGAEvent(GAEvents.NEXT, "Page ".concat(utils_getPageNumber(activeStageIndex, layout, ChangeAction.Next, rtl, order.length)));
    } else if (rtl && direction === AnimationDirection.RIGHT_TO_LEFT || !rtl && direction === AnimationDirection.LEFT_TO_RIGHT) {
      sendGAEvent(GAEvents.PREVIOUS, "Page ".concat(utils_getPageNumber(activeStageIndex, layout, ChangeAction.Previous, rtl, order.length)));
    }
  };
  var changeStage = function changeStage() {
    var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AnimationDirection.RIGHT_TO_LEFT;
    if (direction === AnimationDirection.RIGHT_TO_LEFT) {
      setNextStage();
    } else {
      setPreviousStage();
    }
  };
  (0,react.useEffect)(function () {
    var transitionEffectDone = function transitionEffectDone() {
      isChangePageAnimationDone.current = true;
      // Prevent zoom in/out while the flip effect is not properly finished
      setZoomEnabled(true);
    };
    var transitionEffectStart = function transitionEffectStart() {
      isChangePageAnimationDone.current = false;
      setZoomEnabled(false);
    };
    document.addEventListener(TRANSITION_EFFECT_DONE, transitionEffectDone);
    document.addEventListener(TRANSITION_EFFECT_START, transitionEffectStart);
    return function () {
      document.removeEventListener(TRANSITION_EFFECT_DONE, transitionEffectDone);
      document.removeEventListener(TRANSITION_EFFECT_START, transitionEffectStart);
    };
  }, []);
  return function (isSwipeAction, direction) {
    var playInLoop = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
    var hasNextStage = direction === AnimationDirection.RIGHT_TO_LEFT ? isNotLastStage : isNotFirstStage;
    var blockedByMandatoryActions = activeStageIndex === indexOfFirstMandatoryAction && (direction === AnimationDirection.RIGHT_TO_LEFT && !rtl || direction === AnimationDirection.LEFT_TO_RIGHT && rtl);

    // If zoom bigger than 1 the user can not use swipe actions to change the page only the arrows
    var canChangePage = isChangePageAnimationDone.current && (!isSwipeAction || isSwipeAction && !isSwipeBlocked) && hasNextStage && !blockedByMandatoryActions;
    if (canChangePage) {
      sendGaEventForChangePage(direction);
      changeStage(direction);
    } else if (!playInLoop && blockedByMandatoryActions) {
      // For auto flip, do not open the mandatory actions modal. The modal opens only on user action
      setActiveMandatoryModal(true);
    } else if (playInLoop) {
      sendGaEventForChangePage(direction);
      if (direction === AnimationDirection.RIGHT_TO_LEFT) {
        setFirstActiveStageIndex();
      } else {
        setLastActiveStageIndex();
      }
    }
  };
};
/* harmony default export */ var hooks_useChangeStage = (useChangeStage);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/hooks/useFlipSound.ts




// Play flip sound when the option is enabled in Customize
var useFlipSound = function useFlipSound(sound, activeStageIndex) {
  var flipSoundUrl = useResourcePath(resourceFolders_ResourceType.FLIP_SOUND, {
    resourceName: 'page_flip.mp3'
  });
  var ref = (0,react.useRef)(false);
  (0,react.useEffect)(function () {
    if (ref.current) {
      if (sound) {
        var flipSound = document.createElement('audio');
        flipSound.id = 'flipSound';
        flipSound.preload = 'auto';
        flipSound.style.position = 'absolute';
        flipSound.src = flipSoundUrl;
        flipSound.currentTime = 0;
        flipSound.play();
      }
    }
    ref.current = true;
  }, [activeStageIndex]);
};
/* harmony default export */ var hooks_useFlipSound = (useFlipSound);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/NavigationContainer/NavigationContainer.styles.ts

var NavigationButtonTheme = Ce(["", ""], function (_ref) {
  var theme = _ref.theme;
  return theme.navigationButton;
});
var NavigationContainer_NavigationContainer_styles_NavigationContainer = styled_components_browser_esm.div.withConfig({
  displayName: "NavigationContainerstyles__NavigationContainer",
  componentId: "sc-17uvxnw-0"
})(["pointer-events:auto;transition:all .2s ease-in-out;cursor:pointer;position:absolute;border:none;top:", ";right:", ";bottom:", ";left:", ";", ""], function (props) {
  var _props$$position;
  return ((_props$$position = props.$position) === null || _props$$position === void 0 ? void 0 : _props$$position.top) || 'unset';
}, function (props) {
  var _props$$position2;
  return ((_props$$position2 = props.$position) === null || _props$$position2 === void 0 ? void 0 : _props$$position2.right) || 'unset';
}, function (props) {
  var _props$$position3;
  return ((_props$$position3 = props.$position) === null || _props$$position3 === void 0 ? void 0 : _props$$position3.bottom) || 'unset';
}, function (props) {
  var _props$$position4;
  return ((_props$$position4 = props.$position) === null || _props$$position4 === void 0 ? void 0 : _props$$position4.left) || 'unset';
}, NavigationButtonTheme);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/NavigationContainer/NavigationContainer.tsx

























var NavigationContainer_NavigationContainer_NavigationContainer = function NavigationContainer(props) {
  var theme = Ze();
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    order = _useContext.pages.order,
    _useContext$options = _useContext.options,
    _useContext$options$c = _useContext$options.controls,
    autoNavigationDelay = _useContext$options$c.autoNavigationDelay,
    navigationArrows = _useContext$options$c.navigationArrows,
    _useContext$options$c2 = _useContext$options.content,
    sounds = _useContext$options$c2.sounds,
    rtl = _useContext$options$c2.rtl,
    effect = _useContext$options$c2.effect,
    backgroundAudio = _useContext$options.backgroundAudio;
  var _useContext2 = (0,react.useContext)(contexts_ModalContext),
    active = _useContext2.active;
  var activeStageIndex = react_useAtomValue(getActiveStageIndexAtom);
  var _useAtom = react_useAtom(controllerBarVisibleAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    setControllerBarVisible = _useAtom2[1];
  var changeStage = hooks_useChangeStage();
  var nrOfStages = order.length;
  var isFirstStage = activeStageIndex === 0;
  var isLastStage = activeStageIndex === nrOfStages - 1;
  var navigationButtonIds = rtl ? [BTN_NEXT_ID, BTN_PREV_ID] : [BTN_PREV_ID, BTN_NEXT_ID];
  var onTouchStart = function onTouchStart(event) {
    event.stopPropagation();
    setControllerBarVisible(false);
  };
  var onNextPage = (0,lodash.throttle)(function (e) {
    e.nativeEvent.stopImmediatePropagation();
    changeStage(false, AnimationDirection.RIGHT_TO_LEFT);
  }, constants_WAIT_USER_INTERACTION_MS, {
    trailing: false
  });
  var onPreviousPage = (0,lodash.throttle)(function (e) {
    e.nativeEvent.stopImmediatePropagation();
    changeStage(false, AnimationDirection.LEFT_TO_RIGHT);
  }, constants_WAIT_USER_INTERACTION_MS, {
    trailing: false
  });

  // For scroll effect we want to prevent swiping and change the stage
  var handlers = useSwipeable({
    onSwipedLeft: function onSwipedLeft() {
      if (effect !== src_playerTypes_PlayerEffect.SCROLL) {
        changeStage(true, AnimationDirection.RIGHT_TO_LEFT);
      }
    },
    onSwipedRight: function onSwipedRight() {
      if (effect !== src_playerTypes_PlayerEffect.SCROLL) {
        changeStage(true, AnimationDirection.LEFT_TO_RIGHT);
      }
    },
    delta: 100,
    // min distance(px) before a swipe starts
    preventScrollOnSwipe: false // call e.preventDefault *See Details*
  });
  hooks_useAutoPlay(autoNavigationDelay, rtl ? function () {
    return changeStage(true, AnimationDirection.LEFT_TO_RIGHT, true);
  } : function () {
    return changeStage(true, AnimationDirection.RIGHT_TO_LEFT, true);
  }, activeStageIndex, rtl);
  hooks_useFlipSound(sounds, activeStageIndex);
  hooks_useBackgroundAudio(backgroundAudio);
  (0,react.useEffect)(function () {
    var onKeyDown = function onKeyDown(event) {
      if (!isInputFocused()) {
        if (nextPageKeys.has(event.key) && !active.length && !isLastStage) {
          changeStage(false, AnimationDirection.RIGHT_TO_LEFT);
        }
        if (previousPageKeys.has(event.key) && !active.length && !isFirstStage) {
          changeStage(false, AnimationDirection.LEFT_TO_RIGHT);
        }
      }
    };
    window.addEventListener('keydown', onKeyDown);
    return function () {
      window.removeEventListener('keydown', onKeyDown);
    };
  }, [activeStageIndex, active, changeStage]);
  return /*#__PURE__*/react.createElement("div", handlers, /*#__PURE__*/react.createElement("div", null, effect !== src_playerTypes_PlayerEffect.SCROLL && !isFirstStage && navigationArrows && /*#__PURE__*/react.createElement(NavigationContainer_NavigationContainer_styles_NavigationContainer, {
    buttonFunction: "previous",
    onClick: onPreviousPage,
    $position: {
      top: "calc(50% - ".concat(theme.navigationButton.height / 2, "px)"),
      left: '0'
    },
    onTouchStart: onTouchStart,
    style: {
      marginLeft: 'env(safe-area-inset-left)'
    }
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    id: navigationButtonIds[0],
    ariaLabel: Identifier.accessibility_previous_page,
    type: HtmlButtonTypes.BUTTON,
    size: IconSize.large,
    hover: true,
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(src.WidgetPreviousPage, {
    color: theme.navigationButton.color,
    borderColor: theme.navigationButton.borderColor
  }))), props.children, effect !== src_playerTypes_PlayerEffect.SCROLL && !isLastStage && navigationArrows && /*#__PURE__*/react.createElement(NavigationContainer_NavigationContainer_styles_NavigationContainer, {
    buttonFunction: "next",
    onClick: onNextPage,
    $position: {
      top: "calc(50% - ".concat(theme.navigationButton.height / 2, "px)"),
      right: '0'
    },
    onTouchStart: onTouchStart,
    style: {
      marginRight: 'env(safe-area-inset-right)'
    }
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    id: navigationButtonIds[1],
    ariaLabel: Identifier.accessibility_next_page,
    type: HtmlButtonTypes.BUTTON,
    size: IconSize.large,
    hover: true,
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(src.WidgetNextPage, {
    color: theme.navigationButton.color,
    borderColor: theme.navigationButton.borderColor
  })))));
};
/* harmony default export */ var components_NavigationContainer_NavigationContainer = (NavigationContainer_NavigationContainer_NavigationContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/NavigationContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/FontsProviderContainer/FontsProviderContainer.tsx



var FontsProviderContainer = function FontsProviderContainer(props) {
  var _useState = (0,react.useState)([]),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    fontList = _useState2[0],
    setFontList = _useState2[1];
  var addFonts = function addFonts(fontFamilies) {
    fontFamilies.forEach(function (fontFamily) {
      if (fontList.indexOf(fontFamily) === -1) {
        var newFontList = fontList;
        newFontList.push(fontFamily);
        setFontList(newFontList);
      }
    });
  };
  return /*#__PURE__*/react.createElement(FontsProvider, {
    value: {
      fontList: fontList,
      addFonts: addFonts
    }
  }, props.children);
};
FontsProviderContainer.propTypes = {};
/* harmony default export */ var FontsProviderContainer_FontsProviderContainer = (FontsProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/FontsProviderContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/LeadFormModal/LeadFormModal.styles.tsx



var LeadFormModal_styles_LeadFormModal = styled_components_browser_esm.div.withConfig({
  displayName: "LeadFormModalstyles__LeadFormModal",
  componentId: "sc-118d9yv-0"
})(["width:100%;height:100%;display:flex;flex-direction:column;justify-content:space-between;"]);
var LeadFormTitle = styled_components_browser_esm(H2).withConfig({
  displayName: "LeadFormModalstyles__LeadFormTitle",
  componentId: "sc-118d9yv-1"
})(["text-align:center;max-width:", ";margin-bottom:23px;word-break:break-word;"], function (_ref) {
  var modalWidth = _ref.modalWidth,
    theme = _ref.theme;
  return modalWidth <= theme.deviceSize.tabletS ? "".concat(LEAD_FORM_TITLE_WIDTH, "px") : '';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/LeadFormModal/sendEmailToSqs.ts



/**
 * Sends email to sqs
 * @param email
 * @param endpoint
 */

/* harmony default export */ var sendEmailToSqs = (function (message, endpoint) {
  return new Promise(function (resolve, reject) {
    if (!endpoint) {
      resolve(false);
    } else {
      var payload = {
        Action: 'SendMessage',
        MessageBody: JSON.stringify(message)
      };
      utils_fetchApi("".concat(endpoint, "?").concat(objectToURLParams(payload))).then(function (response) {
        resolve(!!response);
      }).catch(function (e) {
        reject(e);
      });
    }
  });
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/LeadFormModal/LeadFormInputListContainer.tsx


function LeadFormInputListContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function LeadFormInputListContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? LeadFormInputListContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : LeadFormInputListContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }













var LeadFormInputListContainer = function LeadFormInputListContainer() {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    LeadFormData = _useContext.leadForm;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    hash = _useAtom2$.hash,
    title = _useAtom2$.title;
  var _defaultLeadForm = LeadFormInputListContainer_objectSpread(LeadFormInputListContainer_objectSpread({}, defaultLeadForm), LeadFormData),
    fields = _defaultLeadForm.fields,
    privacyPolicyActive = _defaultLeadForm.privacyPolicyActive,
    gdprActive = _defaultLeadForm.gdprActive,
    gdprMessage = _defaultLeadForm.gdprMessage;
  var _useContext2 = (0,react.useContext)(contexts_ModalContext),
    setOpen = _useContext2.setOpen;
  var _useState = (0,react.useState)(fields === null || fields === void 0 ? void 0 : fields.some(function (field) {
      return !field.valid;
    })),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    submitDisabled = _useState2[0],
    setSubmitDisabled = _useState2[1];
  var _useState3 = (0,react.useState)(!privacyPolicyActive),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    agreedToPrivacyPolicy = _useState4[0],
    setAgreedToPrivacyPolicy = _useState4[1];
  var _useState5 = (0,react.useState)(false),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    agreedToGDPR = _useState6[0],
    setAgreedToGDPR = _useState6[1];
  var gdprText = gdprMessage || defaultLeadForm.gdprMessage;

  // Update agreedToPrivacyPolicy when changing privacyPolicyActive in customize
  (0,react.useEffect)(function () {
    setAgreedToPrivacyPolicy(!privacyPolicyActive);
  }, [privacyPolicyActive]);
  if (!LeadFormData) {
    return null;
  }
  var setFieldValid = function setFieldValid(index, isValid) {
    if (fields) {
      fields[index].valid = isValid;
    }
    setSubmitDisabled(fields === null || fields === void 0 ? void 0 : fields.some(function (field) {
      return !field.valid;
    }));
  };
  var setFieldUserInput = function setFieldUserInput(index, userInput) {
    if (fields) {
      fields[index].userInput = userInput;
    }
  };
  var generateDataToSend = function generateDataToSend() {
    var leadFormDataToSend = [];
    fields === null || fields === void 0 || fields.forEach(function (field) {
      leadFormDataToSend.push({
        name: field.fieldName,
        value: field.userInput || ''
      });
    });
    if (LeadFormData.gdprActive) {
      leadFormDataToSend.push({
        name: 'GDPR',
        value: agreedToGDPR ? 'Yes' : 'No'
      });
    }
    return leadFormDataToSend;
  };
  var sendLeadFormData = function sendLeadFormData() {
    if (!submitDisabled) {
      setLeadFormCookies(hash);
      setOpen(LEAD_FORM_COMPLETED);
      sendEmailToSqs({
        type: LEAD_FORM_ID,
        data: {
          collectionHash: hash,
          Timestamp: new Date().toISOString(),
          fields: generateDataToSend(),
          'Book title': title,
          'Page index': LeadFormData.pageIndex + 1 // TODO: start from 1, then remove +1
        }
      }, getLeadFormEndpoint());
    }
  };
  var skipLeadForm = function skipLeadForm() {
    setLeadFormCookies(hash);
    setOpen(LEAD_FORM_COMPLETED);
  };
  return /*#__PURE__*/react.createElement(InputContent, null, /*#__PURE__*/react.createElement("form", null, /*#__PURE__*/react.createElement(FormContainer, null, /*#__PURE__*/react.createElement(LeadFormDataContainer, null, fields === null || fields === void 0 ? void 0 : fields.map(function (field, index) {
    return /*#__PURE__*/react.createElement(Input_ModalFormInputContainer, {
      key: "lead-form-input-".concat(index + 1),
      field: field,
      index: index,
      setFieldValid: setFieldValid,
      setFieldUserInput: setFieldUserInput
    });
  })), (LeadFormData.privacyPolicyActive || gdprActive) && /*#__PURE__*/react.createElement(AgreementContainer, null, LeadFormData.privacyPolicyActive && /*#__PURE__*/react.createElement(PrivacyPolicyAgreement_PrivacyPolicyAgreement, {
    companyName: LeadFormData.privacyPolicyCompany || '',
    privacyPolicyURL: LeadFormData.privacyPolicyWebsite || '',
    onChangePrivacyPolicy: function onChangePrivacyPolicy(e) {
      return setAgreedToPrivacyPolicy(e.target.checked);
    }
  }), gdprActive && /*#__PURE__*/react.createElement(GDPRAgreement_GDPRAgreement, {
    gdprMessage: gdprText,
    onChangeGDPRAgreement: function onChangeGDPRAgreement(e) {
      return setAgreedToGDPR(e.target.checked);
    }
  }))), /*#__PURE__*/react.createElement(ButtonsContainer, null, LeadFormData.allowUsersToSkip && /*#__PURE__*/react.createElement(SkipButton, {
    onClick: skipLeadForm,
    "aria-label": LeadFormData.skipButtonLabel,
    tabIndex: TabIndex.DEFAULT
  }, LeadFormData.skipButtonLabel), /*#__PURE__*/react.createElement(ModalContentStyles_SubmitButton, {
    disabled: submitDisabled || !agreedToPrivacyPolicy,
    onClick: sendLeadFormData,
    "aria-label": LeadFormData.label,
    tabIndex: TabIndex.DEFAULT
  }, LeadFormData.label))));
};
/* harmony default export */ var LeadFormModal_LeadFormInputListContainer = (LeadFormInputListContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/LeadFormModal/LeadFormModal.tsx








var LeadFormModal = function LeadFormModal(props) {
  var theme = Ze();
  var modalWidth = props.width <= theme.deviceSize.tabletS ? 'auto' : "".concat(theme.leadForm.popoverSizes.width, "px");
  var modalHeight = 'auto';
  return /*#__PURE__*/react.createElement(ModalActionContainer_ModalActionContainer, {
    width: modalWidth,
    height: modalHeight,
    modalHeight: modalHeight,
    identifier: LEAD_FORM_ID,
    displayCloseIcon: false
  }, /*#__PURE__*/react.createElement(LeadFormModal_styles_LeadFormModal, null, /*#__PURE__*/react.createElement(LeadFormTitle, {
    tabIndex: TabIndex.DEFAULT,
    modalWidth: props.width
  }, props.header), /*#__PURE__*/react.createElement(LeadFormModal_LeadFormInputListContainer, null)));
};
LeadFormModal.propTypes = {
  header: (prop_types_default()).string.isRequired,
  width: (prop_types_default()).number.isRequired
};
/* harmony default export */ var LeadFormModal_LeadFormModal = (LeadFormModal);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Modals/LeadFormModal/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Player/Player.tsx





























var StyledPlayer = styled_components_browser_esm.div.withConfig({
  displayName: "Player__StyledPlayer",
  componentId: "sc-1k1z8es-0"
})(["height:100%;width:100%;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right);position:relative;", ""], main/* isAndroid */.m0 && main/* isFirefox */.gm ? '' : 'pointer-events: none;');
var StyledPopoverPortal = styled_components_browser_esm.div.withConfig({
  displayName: "Player__StyledPopoverPortal",
  componentId: "sc-1k1z8es-1"
})(["position:absolute;top:0;left:0;pointer-events:auto;"]);
var Player = function Player() {
  var theme = Ze();
  var ref = (0,react.useRef)(null);
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    leadForm = _useContext.leadForm,
    downloadMode = _useContext.downloadMode,
    cartConfig = _useContext.cart,
    _useContext$options = _useContext.options,
    _useContext$options$c = _useContext$options.content,
    skinType = _useContext$options$c.skinType,
    isMobilePreview = _useContext$options$c.isMobilePreview,
    _useContext$options$c2 = _useContext$options.controls,
    fullScreen = _useContext$options$c2.fullScreen,
    showControls = _useContext$options$c2.showControls,
    toc = _useContext$options$c2.toc,
    isTocAlwaysVisible = _useContext$options$c2.isTocAlwaysVisible,
    tocData = _useContext.toc;
  var _useContext2 = (0,react.useContext)(contexts_PlayerRefContext),
    setPlayerRef = _useContext2.setPlayerRef;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    hash = _useAtom2$.hash,
    accountId = _useAtom2$.link.accountId,
    visibility = _useAtom2$.visibility;
  var _useAtom3 = react_useAtom(stageSizeAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    stageSize = _useAtom4[0];
  var _useAtom5 = react_useAtom(leadFormStageIndexAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    leadFormStageIndex = _useAtom6[0];
  var _useAtom7 = react_useAtom(featuresAtom),
    _useAtom8 = slicedToArray_slicedToArray(_useAtom7, 1),
    _useAtom8$ = _useAtom8[0],
    WIDGET_FORMS = _useAtom8$.WIDGET_FORMS,
    TABLE_OF_CONTENT = _useAtom8$.TABLE_OF_CONTENT;
  var _useAtom9 = react_useAtom(setStageSizeWidthAtom),
    _useAtom10 = slicedToArray_slicedToArray(_useAtom9, 2),
    setStageWidth = _useAtom10[1];
  var _useAtom11 = react_useAtom(setStageSizeHeightAtom),
    _useAtom12 = slicedToArray_slicedToArray(_useAtom11, 2),
    setStageHeight = _useAtom12[1];
  var isActiveMandatoryModal = react_useAtomValue(isActiveMandatoryModalAtom);
  var _useAtom13 = react_useAtom(fixedPanelAtom),
    _useAtom14 = slicedToArray_slicedToArray(_useAtom13, 2),
    fixedPanel = _useAtom14[0],
    setFixedPanel = _useAtom14[1];
  var playerToken = getPlayerToken(accountId, hash);
  var displayFullScreenButton = fullScreen && (skinType === playerTypes_SkinTypes.CLASSIC || !showControls);
  var _useContext3 = (0,react.useContext)(contexts_ModalContext),
    active = _useContext3.active;
  var _staticStore$config$g = getConfig(),
    renderedFrom = _staticStore$config$g.renderedFrom;
  var hasToc = TABLE_OF_CONTENT && !!toc && !!tocData.length;
  var setStageSize = function setStageSize() {
    if (ref !== null && ref !== void 0 && ref.current) {
      var padding = parseInt(window.getComputedStyle(ref.current).paddingLeft, 10) * 2;
      setStageWidth(ref.current.clientWidth - padding);
      setStageHeight(ref.current.clientHeight);
    }
  };
  (0,react.useEffect)(function () {
    if (hasToc && isTocAlwaysVisible && renderedFrom === '' && !isMobilePreview && !main/* isMobileOnly */.XF && ref.current && ref.current.clientWidth >= theme.deviceSize.tabletL) {
      setFixedPanel(Panel.TOC);
    } else {
      setFixedPanel('');
    }
  }, [hasToc, isTocAlwaysVisible]);
  (0,react.useEffect)(function () {
    if (ref !== null && ref !== void 0 && ref.current) {
      setPlayerRef(ref.current);
      setStageSize();
      document.addEventListener('wheel', function (e) {
        if (e.ctrlKey) {
          e.preventDefault(); // Stop pinch-to-zoom triggered by the trackpad
        }
      }, {
        passive: false
      });
    }
  }, [fixedPanel]);
  (0,react.useEffect)(function () {
    var debounceResize = (0,lodash.debounce)(setStageSize, constants_WAIT_USER_INTERACTION_MS, {
      leading: true
    });
    window.addEventListener('resize', debounceResize);
    return function () {
      debounceResize.cancel();
      window.removeEventListener('resize', debounceResize);
    };
  }, []);
  return /*#__PURE__*/react.createElement(StyledPlayer, {
    ref: ref
  }, /*#__PURE__*/react.createElement(ErrorBoundary_ErrorBoundary, null, !!(stageSize.width && stageSize.height) && /*#__PURE__*/react.createElement(react.Fragment, null, displayFullScreenButton && /*#__PURE__*/react.createElement(FullscreenButtonContainer_FullscreenButtonContainer, {
    privateFlipbook: isSharedWithUsers(visibility),
    buttonType: FullscreenButtonTypes.CENTERED_BUTTON
  }), /*#__PURE__*/react.createElement(components_NavigationContainer_NavigationContainer, null, /*#__PURE__*/react.createElement(FontsProviderContainer_FontsProviderContainer, null, /*#__PURE__*/react.createElement(Stage_Stage, null)), /*#__PURE__*/react.createElement(StyledPopoverPortal, {
    id: "playerPopover"
  }), /*#__PURE__*/react.createElement("div", {
    id: "playerTooltip"
  })),
  // TODO: move to StageListItem and override entire stage when active
  WIDGET_FORMS && leadForm && leadFormStageIndex !== -1 && !downloadMode && /*#__PURE__*/react.createElement(LeadFormModal_LeadFormModal, {
    header: leadForm.header,
    width: stageSize.width
  }), isActiveMandatoryModal && /*#__PURE__*/react.createElement(MandatoryActionsModal_MandatoryActionsModal, {
    stageSize: stageSize
  }), active === PAGES_MODAL_ID && /*#__PURE__*/react.createElement(PagesOverviewModal_PagesOverviewModal, null), cartConfig && !!Object.keys(cartConfig).length && /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(CartSendOrderModal_CartSendOrderModal, {
    playerToken: playerToken,
    cart: cartConfig
  }), active === CART_CLEAR_LIST_MODAL_ID && /*#__PURE__*/react.createElement(CartClearListModal_CartClearListModal, {
    playerToken: playerToken
  })))));
};
/* harmony default export */ var Player_Player = (Player);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Player/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/helpers/getSharePanelStyle.ts



/**
 * Returns the style for the share options panel on specific sizes
 * @param stageWidth
 * @param radiusVal
 * @param panelPosition
 * @param deviceSizeTabletS
 * @return string
 */

/* harmony default export */ var getSharePanelStyle = (function (stageWidth, radiusVal, deviceSizeTabletS, panelPosition) {
  var bottom = '';
  var top = '';
  var right = '';
  var width = 'width: auto;';
  var left = 'left: auto;';
  var radius = "border-radius: ".concat(radiusVal, "px;");
  if (panelPosition === PanelPosition.TOP_CENTER || panelPosition === PanelPosition.TOP_RIGHT) {
    top = 'top: 8px;';
  } else {
    bottom = 'bottom: 8px;';
    right = 'right: 8px;';
  }
  if (main/* isMobileOnly */.XF || stageWidth <= deviceSizeTabletS) {
    left = 'left: 8px;';
    right = 'right: 8px;';
  }
  return "".concat(right).concat(width).concat(bottom).concat(radius).concat(left).concat(top);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/helpers/getTocPanelStyle.ts
/**
 * Returns the style for the toc options panel on specific sizes
 * @param stageWidth
 * @param padding
 * @param radiusVal
 * @param deviceMaxSize
 * @param panelPosition
 * @return string
 */

/* harmony default export */ var getTocPanelStyle = (function (stageWidth, padding) {
  // TODO move this to styled component
  // Mobile - open modal by default?
  var height = 'height: 100%;';
  var width = 'width: 100%;';
  var display = 'display: flex;';
  var direction = 'flex-direction: column;';
  var paddingRight = "padding-right: ".concat(padding, "px;");
  var paddingBottom = "padding-bottom: ".concat(padding, "px;");
  var overflow = 'overflow: hidden;';
  return "\n        ".concat(height, "\n        ").concat(width, "\n        ").concat(display, "\n        ").concat(direction, "\n        ").concat(paddingRight, "\n        ").concat(paddingBottom, "\n        ").concat(overflow, "\n    ");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/helpers/getSearchPanelStyle.ts




/**
 * Returns the style for the toc options panel on specific sizes
 * @param stageWidth
 * @param padding
 * @param radiusVal
 * @param deviceSizeMobileL
 * @param panelPosition
 * @param $skinType
 * @return string
 */

// TODO customize for search design
/* harmony default export */ var getSearchPanelStyle = (function (stageWidth, padding, radiusVal, deviceSizeMobileL, panelPosition, $skinType) {
  var bottom = '';
  var right = '';
  var top = '';
  var maxWidth = "max-width: calc(100% - ".concat(padding * 2, "px);");
  var maxHeight = "max-height: calc(100% - ".concat(padding * 2, "px);");
  var width = 'width: 400px;';
  var radius = "border-radius: ".concat(radiusVal, "px;");
  var display = 'display: flex;';
  var direction = $skinType === playerTypes_SkinTypes.CLASSIC ? 'flex-direction: column-reverse;' : 'flex-direction: column;';
  if (panelPosition === PanelPosition.TOP_CENTER || panelPosition === PanelPosition.TOP_RIGHT) {
    top = 'top: 8px;';
  } else {
    bottom = "bottom: ".concat(padding, "px;");
    right = "right: ".concat(padding, "px;");
  }
  if (main/* isMobileOnly */.XF || stageWidth <= deviceSizeMobileL) {
    bottom = 'bottom: 0;';
    maxWidth = 'max-width: 100%;';
    maxHeight = 'max-height: 100%;';
    width = 'width: 100%;';
    radius = 'border-radius: 0;';
    right = 'right: 0;';
  }
  return "\n        ".concat(right, "\n        ").concat(bottom, "\n        ").concat(maxHeight, "\n        ").concat(maxWidth, "\n        ").concat(width, "\n        ").concat(display, "\n        ").concat(direction, "\n        ").concat(radius, "\n        ").concat(top, "\n    ");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/helpers/getAccessibilityPanelStyle.ts


/**
 * Returns the style for the toc options panel on specific sizes
 * @param stageWidth
 * @param padding
 * @param radiusVal
 * @param deviceSizeMobileL
 * @return string
 */

/* harmony default export */ var getAccessibilityPanelStyle = (function (stageWidth, padding, radiusVal, deviceSizeMobileL) {
  var top = "top: ".concat(padding, "px;");
  var left = "left: ".concat(padding, "px;");
  var maxWidth = "max-width: calc(100% - ".concat(padding * 2, "px);");
  var height = "height: calc(100% - ".concat(padding * 2, "px);");
  var width = 'width: 500px;';
  var radius = "border-radius: ".concat(radiusVal, "px;");
  var display = 'display: flex;';
  var direction = 'flex-direction: row;';
  if (main/* isMobileOnly */.XF || stageWidth <= deviceSizeMobileL) {
    top = 'top: 0;';
    maxWidth = 'max-width: 100%;';
    height = 'height: 100%;';
    width = 'width: 100%;';
    radius = 'border-radius: 0;';
    left = 'left: 0;';
  }
  return "\n        ".concat(left, "\n        ").concat(top, "\n        ").concat(height, "\n        ").concat(maxWidth, "\n        ").concat(width, "\n        ").concat(display, "\n        ").concat(direction, "\n        ").concat(radius, "\n    ");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/helpers/getCartPanelStyle.ts



/**
 * Returns the style for the Cart panel on specific sizes
 * @param stageWidth
 * @param padding
 * @param radiusVal
 * @param deviceSizeMobileL
 * @param panelPosition
 * @return string
 */

/* harmony default export */ var getCartPanelStyle = (function (stageWidth, padding, radiusVal, deviceSizeMobileL, panelPosition) {
  var right = '';
  var top = '';
  var maxWidth = "max-width: calc(100% - ".concat(padding * 2, "px);");
  var maxHeight = "max-height: calc(100% - ".concat(padding * 2, "px);");
  var width = 'width: 400px;';
  var radius = "border-radius: ".concat(radiusVal, "px;");
  var display = 'display: flex;';
  var direction = 'flex-direction: row;';
  var paddingRight = "padding-right: ".concat(padding, "px;");
  var overflow = 'overflow: hidden;';
  var bottom = '';
  if (panelPosition === PanelPosition.TOP_CENTER || panelPosition === PanelPosition.TOP_RIGHT) {
    top = 'top: 8px;';
  } else {
    bottom = "bottom: ".concat(padding, "px;");
    right = "right: ".concat(padding, "px;");
  }
  if (main/* isMobileOnly */.XF || stageWidth <= deviceSizeMobileL) {
    bottom = 'bottom: 0;';
    maxWidth = 'max-width: 100%;';
    maxHeight = 'max-height: 100%;';
    width = 'width: 100%;';
    radius = 'border-radius: 0;';
    right = 'right: 0;';
  }
  return "\n        ".concat(right, "\n        ").concat(maxHeight, "\n        ").concat(maxWidth, "\n        ").concat(width, "\n        ").concat(display, "\n        ").concat(direction, "\n        ").concat(paddingRight, "\n        ").concat(radius, "\n        ").concat(bottom, "\n        ").concat(top, "\n        ").concat(overflow, "\n    ");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/Panel.styles.tsx








var Panel_styles_Panel = styled_components_browser_esm.div.withConfig({
  displayName: "Panelstyles__Panel",
  componentId: "sc-tw4v0z-0"
})(["z-index:2;position:", ";display:", ";overflow:hidden;", ";left:0;width:100%;user-select:none;height:", ";", ";", ";"], function (_ref) {
  var _ref$$position = _ref.$position,
    $position = _ref$$position === void 0 ? 'absolute' : _ref$$position;
  return $position;
}, function (_ref2) {
  var _ref2$$display = _ref2.$display,
    $display = _ref2$$display === void 0 ? 'flex' : _ref2$$display;
  return $display;
}, function (_ref3) {
  var $panelPosition = _ref3.$panelPosition,
    theme = _ref3.theme;
  if ($panelPosition === PanelPosition.TOP_CENTER) {
    return "\n                top: ".concat(theme.controllerBar.height, "px;\n                justify-content: center;\n            ");
  }
  if ($panelPosition === PanelPosition.TOP_RIGHT) {
    return "\n                top: ".concat(theme.controllerBar.height, "px;\n                justify-content: end;\n                padding: 0 8px;\n            ");
  }
  if ($panelPosition === PanelPosition.TOP_LEFT) {
    return "\n                top: ".concat(theme.controllerBar.height, "px;\n                justify-content: start;\n            ");
  }
  if ($panelPosition === PanelPosition.LEFT) {
    return "\n                top: 0;\n                justify-content: start;\n            ";
  }
  return 'top: 0;';
}, function (_ref4) {
  var $height = _ref4.$height;
  return $height;
}, function (_ref5) {
  var $backgroundColor = _ref5.$backgroundColor;
  return $backgroundColor && "background-color: ".concat($backgroundColor, ";");
}, function (_ref6) {
  var $gridRow = _ref6.$gridRow;
  return $gridRow && "grid-row: ".concat($gridRow, ";");
});
var BasePanelContent = styled_components_browser_esm.aside.withConfig({
  displayName: "Panelstyles__BasePanelContent",
  componentId: "sc-tw4v0z-1"
})(["position:absolute;color:", ";", " animation:fadeInPanel .3s ease-out backwards;@keyframes fadeInPanel{from{opacity:0;}to{opacity:1;}};transition:opacity .3s ease-in-out;"], function (_ref7) {
  var theme = _ref7.theme;
  return theme.panel.color;
}, function (_ref8) {
  var $transparent = _ref8.$transparent,
    theme = _ref8.theme;
  return !$transparent ? "backdrop-filter: blur(20px); background: ".concat(theme.panel.background, ";") : '';
});
var AccessibilityPanel = styled_components_browser_esm(BasePanelContent).withConfig({
  displayName: "Panelstyles__AccessibilityPanel",
  componentId: "sc-tw4v0z-2"
})(["background-color:", ";position:absolute;color:", ";overflow:hidden;"], function (_ref9) {
  var theme = _ref9.theme;
  return theme.accessibility.panel.backgroundColor;
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.accessibility.panel.color;
});
var SharePanelContent = styled_components_browser_esm(BasePanelContent).withConfig({
  displayName: "Panelstyles__SharePanelContent",
  componentId: "sc-tw4v0z-3"
})(["", ";"], function (_ref11) {
  var $stageWidth = _ref11.$stageWidth,
    $panelPosition = _ref11.$panelPosition,
    theme = _ref11.theme;
  return $stageWidth && getSharePanelStyle($stageWidth, theme.panel.borderRadius, theme.deviceSize.tabletS, $panelPosition);
});
var TocPanelContent = styled_components_browser_esm(BasePanelContent).withConfig({
  displayName: "Panelstyles__TocPanelContent",
  componentId: "sc-tw4v0z-4"
})(["", ";"], function (_ref12) {
  var $stageWidth = _ref12.$stageWidth,
    theme = _ref12.theme;
  return $stageWidth && getTocPanelStyle($stageWidth, theme.panel.padding);
});
var SearchPanelContent = styled_components_browser_esm(BasePanelContent).withConfig({
  displayName: "Panelstyles__SearchPanelContent",
  componentId: "sc-tw4v0z-5"
})(["", ";"], function (_ref13) {
  var $stageWidth = _ref13.$stageWidth,
    $panelPosition = _ref13.$panelPosition,
    theme = _ref13.theme,
    $skinType = _ref13.$skinType;
  return $stageWidth && getSearchPanelStyle($stageWidth, theme.panel.padding, theme.panel.borderRadius, theme.deviceSize.mobileL, $panelPosition, $skinType);
});
var AccessibilityPanelContent = styled_components_browser_esm(AccessibilityPanel).withConfig({
  displayName: "Panelstyles__AccessibilityPanelContent",
  componentId: "sc-tw4v0z-6"
})(["", ";"], function (_ref14) {
  var $stageWidth = _ref14.$stageWidth,
    theme = _ref14.theme;
  return $stageWidth && getAccessibilityPanelStyle($stageWidth, theme.panel.padding, theme.panel.borderRadius, theme.deviceSize.mobileL);
});
var CartPanelContent = styled_components_browser_esm(BasePanelContent).withConfig({
  displayName: "Panelstyles__CartPanelContent",
  componentId: "sc-tw4v0z-7"
})(["", ";"], function (_ref15) {
  var $stageWidth = _ref15.$stageWidth,
    theme = _ref15.theme,
    $panelPosition = _ref15.$panelPosition;
  return $stageWidth && getCartPanelStyle($stageWidth, theme.panel.padding, theme.panel.borderRadius, theme.deviceSize.mobileL, $panelPosition);
});
var ZoomPanelContent = styled_components_browser_esm(BasePanelContent).withConfig({
  displayName: "Panelstyles__ZoomPanelContent",
  componentId: "sc-tw4v0z-8"
})(["top:8px;padding:0 5px;backdrop-filter:blur(20px);background:", ";border-radius:", "px;"], function (_ref16) {
  var theme = _ref16.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.8);
}, function (_ref17) {
  var theme = _ref17.theme;
  return theme.panel.borderRadius;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/PanelItemContext.ts

var panelItemContext = {
  activeId: '',
  setActive: function setActive() {}
};
var PanelItemContext = /*#__PURE__*/react.createContext(panelItemContext);
var PanelItemProvider = PanelItemContext.Provider;
/* harmony default export */ var contexts_PanelItemContext = (PanelItemContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/PanelListItemProvider/PanelListItemProvider.tsx




var PanelListItemProvider = function PanelListItemProvider(props) {
  var _useState = (0,react.useState)(''),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    activeId = _useState2[0],
    setActiveId = _useState2[1];
  return /*#__PURE__*/react.createElement(PanelItemProvider, {
    value: {
      activeId: activeId,
      setActive: setActiveId
    }
  }, props.children);
};
PanelListItemProvider.propTypes = {
  children: (prop_types_default()).node.isRequired
};
/* harmony default export */ var PanelListItemProvider_PanelListItemProvider = (PanelListItemProvider);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/PanelListItemProvider/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Toc/TocList/helpers/getTocPagesLinks.ts
/**
 * Returns an object that will be used to link the toc pages correctly
 * @param {PlayerProviderPagesType} pages
 * return {TocPageLinksType}
 */
/* harmony default export */ var getTocPagesLinks = (function (pages) {
  var pageLinks = {};
  var pageNumber = 0;
  pages.order.forEach(function (pageIds) {
    return pageIds.forEach(function (pageId) {
      var page = pages.data[pageId];
      if (page.source.hash) {
        var newPageNumber = pageNumber + 1;
        pageLinks["".concat(page.source.hash, "_").concat(page.id)] = newPageNumber;
        pageLinks["".concat(page.source.hash, "_").concat(page.source.page + 1)] = newPageNumber;
        pageNumber++;
      }
    });
  });
  return pageLinks;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Toc/TocList/TocListStyles.tsx




var TocItemViewText = styled_components_browser_esm(PanelItemViewText).withConfig({
  displayName: "TocListStyles__TocItemViewText",
  componentId: "sc-1q8rwvq-0"
})(["text-overflow:ellipsis;", " white-space:nowrap;margin-left:8px;", ";"], function (_ref) {
  var $isRtl = _ref.$isRtl,
    $padding = _ref.$padding;
  return getSpacing($isRtl, $padding, TypesOfSpacing.PADDING);
}, function (_ref2) {
  var $isRtl = _ref2.$isRtl;
  return $isRtl && 'margin-right: 8px';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Toc/TocList/helpers/getLevelIndent.ts
/**
 * Returns the indent margin for toc sub levels
 * @param level
 * return number
 */

var LEVEL_INDENT = 32;
var INDENT_LIMIT = 4;
/* harmony default export */ var getLevelIndent = (function (level) {
  if (level === 1) {
    return 0;
  }
  if (level <= INDENT_LIMIT) {
    return (level - 1) * LEVEL_INDENT;
  }
  if (level > INDENT_LIMIT) {
    return (INDENT_LIMIT - 1) * LEVEL_INDENT;
  }
  return 0;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/PanelItemView/PanelItemView.styles.tsx



var ItemViewContainer = styled_components_browser_esm.a.withConfig({
  displayName: "PanelItemViewstyles__ItemViewContainer",
  componentId: "sc-n1wwuz-0"
})(["color:", ";border:0;text-align:left;display:flex;width:100%;font-size:", "px;cursor:pointer;font-weight:", ";justify-content:space-between;padding:", "px;border-radius:", "px;background-color:", ";transition:.1s linear;margin-bottom:2px;", ";&:nth-last-child(1){margin-bottom:0;};", " span{color:", ";}&:active{background:", ";}"], function (_ref) {
  var $active = _ref.$active,
    theme = _ref.theme;
  return $active ? "".concat(theme.colors.getTextColor(theme.colors.primary)) : 'white';
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.typography.size.h4;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.typography.weight.regular;
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.panel.padding;
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.button.default.borderRadius;
}, function (_ref6) {
  var $active = _ref6.$active,
    theme = _ref6.theme;
  return $active ? theme.colors.getButtonColor(theme.colors.primary) : 'transparent';
}, function (_ref7) {
  var $isRtl = _ref7.$isRtl;
  return $isRtl && 'margin-right: 8px';
}, function (_ref8) {
  var theme = _ref8.theme,
    $active = _ref8.$active;
  return !main/* isMobile */.Fr && "\n        &:hover {\n            background: ".concat($active ? theme.colors.withOpacity(ColorsWithOpacity.PRIMARY, 0.8) : theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.2), ";\n        }\n    ");
}, function (_ref9) {
  var $active = _ref9.$active,
    theme = _ref9.theme;
  return $active ? "".concat(theme.colors.getTextColor(theme.colors.primary)) : 'white';
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.4);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/PanelItemView/PanelItemView.tsx










var PanelItemView = function PanelItemView(_ref) {
  var children = _ref.children,
    pageNumber = _ref.pageNumber,
    id = _ref.id,
    setHideResults = _ref.setHideResults,
    _ref$ariaLabel = _ref.ariaLabel,
    ariaLabel = _ref$ariaLabel === void 0 ? '' : _ref$ariaLabel,
    isRtl = _ref.isRtl;
  var theme = Ze();
  var _useContext = (0,react.useContext)(contexts_ActiveStageIndexContext),
    setActiveStageIndex = _useContext.setActiveStageIndex;
  var _useContext2 = (0,react.useContext)(contexts_PanelItemContext),
    activeId = _useContext2.activeId,
    setActive = _useContext2.setActive;
  var setFixedPanel = react_useSetAtom(fixedPanelAtom);
  var goToPage = function goToPage() {
    if (id !== activeId) {
      setActiveStageIndex(0, pageNumber, function () {
        setActive(id);
        // Move the focus back to the main content. It helps the user to navigate.
        document.getElementsByTagName('main')[0].focus();
      });
    }
    if (main/* isMobile */.Fr || window.innerWidth <= theme.deviceSize.tabletS) {
      setFixedPanel('');
      setHideResults(true);
    }
  };
  var goToPageByTabNavigation = function goToPageByTabNavigation(event) {
    return event.key === ENTER && goToPage();
  };
  return /*#__PURE__*/react.createElement(ItemViewContainer, {
    role: "button",
    onClick: goToPage,
    onKeyDown: goToPageByTabNavigation,
    $active: id === activeId,
    "aria-current": id === activeId,
    tabIndex: TabIndex.DEFAULT,
    "aria-label": ariaLabel,
    $isRtl: isRtl
  }, children);
};
/* harmony default export */ var PanelItemView_PanelItemView = (PanelItemView);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/PanelItemView/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Toc/TocList/TocItem.tsx






var _TocItem = function TocItem(_ref) {
  var node = _ref.node,
    identifier = _ref.identifier,
    tocPageLinks = _ref.tocPageLinks,
    isRtl = _ref.isRtl,
    nrOfPages = _ref.nrOfPages;
  var index = 1;
  var pageName = "".concat(node.originalHash, "_").concat(node.pageId || node.pageNumber);
  var pageNumber = tocPageLinks[pageName];
  var nestedNodes = (node.sub || []).map(function (subNode) {
    index++;
    if (node.sub.length) {
      return /*#__PURE__*/react.createElement(_TocItem, {
        identifier: "".concat(identifier, "_").concat(index),
        key: "".concat(identifier, "_").concat(index),
        node: subNode,
        tocPageLinks: tocPageLinks,
        isRtl: isRtl,
        nrOfPages: nrOfPages
      });
    }
    return null;
  });
  var getPageNumberToDisplay = getPageNumber(isRtl, nrOfPages, pageNumber);
  var ariaLabelText = "".concat(node.title, " page ").concat(getPageNumberToDisplay);
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(PanelItemView_PanelItemView, {
    id: identifier,
    pageNumber: pageNumber,
    ariaLabel: ariaLabelText,
    isRtl: isRtl
  }, /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(TocItemViewText, {
    $padding: getLevelIndent(Number(node.level)),
    $isRtl: isRtl,
    "aria-hidden": true
  }, node.title), /*#__PURE__*/react.createElement("span", {
    "aria-hidden": true
  }, getPageNumberToDisplay === 0 ? '' : getPageNumberToDisplay))), nestedNodes);
};
_TocItem.propTypes = {
  node: prop_types_default().shape({
    level: (prop_types_default()).string.isRequired,
    originalHash: (prop_types_default()).string.isRequired,
    pageNumber: (prop_types_default()).string.isRequired,
    sub: prop_types_default().arrayOf((prop_types_default()).any.isRequired).isRequired,
    title: (prop_types_default()).string.isRequired
  }).isRequired,
  identifier: (prop_types_default()).string.isRequired,
  tocPageLinks: prop_types_default().shape({}).isRequired,
  isRtl: (prop_types_default()).bool.isRequired,
  nrOfPages: (prop_types_default()).number.isRequired
};
/* harmony default export */ var TocItem = (_TocItem);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Toc/TocList/TocList.tsx




var TocList = function TocList() {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    toc = _useContext.toc,
    pages = _useContext.pages,
    isRtl = _useContext.options.content.rtl;
  var tocPageLinks = getTocPagesLinks(pages);
  var nrOfPages = Object.keys(pages.data).length;
  return /*#__PURE__*/react.createElement(react.Fragment, null, toc.map(function (subNode, index) {
    return /*#__PURE__*/react.createElement(TocItem, {
      identifier: (index + 1).toString(),
      key: subNode.idx || index,
      node: subNode,
      tocPageLinks: tocPageLinks,
      isRtl: isRtl,
      nrOfPages: nrOfPages
    });
  }));
};
/* harmony default export */ var TocList_TocList = (TocList);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Toc/TocList/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Toc/TocPanel/TocPanel.tsx














var TocPanel = function TocPanel(_ref) {
  var closePanel = _ref.closePanel,
    isRtl = _ref.isRtl;
  var headerAriaLabel = useTranslate(Identifier.accessibility_toc_header);
  var listRef = (0,react.useRef)(null);
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  (0,react.useEffect)(function () {
    var ref = listRef.current;
    var focusLastSelectedItem = function focusLastSelectedItem() {
      if (ref) {
        // Focus the last active item from the toc list.
        var lastActiveItem = ref.querySelector('a[aria-current="true"]');
        if (lastActiveItem) {
          lastActiveItem.focus();
        }
      }
    };
    if (ref) {
      ref.addEventListener('focus', focusLastSelectedItem, {
        once: true
      });
    }
    return function () {
      ref === null || ref === void 0 || ref.removeEventListener('focus', focusLastSelectedItem);
    };
  }, [settledStageIndex]);
  (0,react.useEffect)(function () {
    if (document.activeElement && document.activeElement.id === 'toc-button') {
      var _listRef$current;
      (_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.focus();
    }
    return function () {
      var _document$getElements;
      (_document$getElements = document.getElementsByTagName('main')[0]) === null || _document$getElements === void 0 || _document$getElements.focus();
    };
  }, []);
  return /*#__PURE__*/react.createElement(TocPanelContainer, null, /*#__PURE__*/react.createElement(PanelHeader, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(PanelTitle, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(H4, {
    tabIndex: TabIndex.DEFAULT,
    "aria-label": headerAriaLabel
  }, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_toc))), /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: AriaLabel.CLOSE_BUTTON,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    onClick: closePanel,
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(src.CloseIcon, {
    fill: "#fff",
    size: src.IconSizes.MEDIUM
  }))), /*#__PURE__*/react.createElement(PanelList, {
    dir: getDirection(isRtl),
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(PanelListContent, {
    role: "navigation",
    ref: listRef,
    tabIndex: 0,
    $isRtl: isRtl,
    $customPadding: "0 0 0 8px"
  }, /*#__PURE__*/react.createElement(TocList_TocList, null))));
};
TocPanel.propTypes = {};
/* harmony default export */ var TocPanel_TocPanel = (TocPanel);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Toc/TocPanel/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/FixedTocPanel.tsx











/* harmony default export */ var FixedTocPanel = (function () {
  var theme = Ze();
  var setFixedPanel = react_useSetAtom(fixedPanelAtom);
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options$c = _useContext.options.content,
    isRtl = _useContext$options$c.rtl,
    skinType = _useContext$options$c.skinType,
    isMobilePreview = _useContext$options$c.isMobilePreview;
  var position = 'relative';
  var height = '100%';

  // Small screen size must be handled differently
  if (main/* isMobileOnly */.XF || isMobilePreview || window.innerWidth <= theme.deviceSize.tabletS) {
    var isClassicSkin = skinType === playerTypes_SkinTypes.CLASSIC && !main/* isMobileOnly */.XF;
    var bottomPadding = isClassicSkin ? theme.controllerBar.height : theme.controllerBar.height + theme.slider.trackHeight;
    position = 'absolute';
    height = "calc(100% - ".concat(bottomPadding, "px)");
  }
  return /*#__PURE__*/react.createElement(Panel_styles_Panel, {
    $height: height,
    $panelPosition: PanelPosition.LEFT,
    $position: position,
    $display: "inline-block",
    $backgroundColor: theme.toc.panel.backgroundColor,
    $gridRow: "1"
  }, /*#__PURE__*/react.createElement(TocPanelContent, {
    $stageWidth: window.innerWidth,
    $transparent: false,
    $panelPosition: PanelPosition.LEFT,
    "aria-label": "Table of Contents"
  }, /*#__PURE__*/react.createElement(PanelListItemProvider_PanelListItemProvider, null, /*#__PURE__*/react.createElement(TocPanel_TocPanel, {
    closePanel: function closePanel() {
      return setFixedPanel('');
    },
    isRtl: isRtl
  }))));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/SearchContext.ts

var searchContext = {
  list: [],
  activeKeyword: '',
  initialResults: false,
  setList: function setList() {},
  setActiveKeyword: function setActiveKeyword() {},
  setInitialResults: function setInitialResults() {}
};
var SearchContext = /*#__PURE__*/react.createContext(searchContext);
var SearchProvider = SearchContext.Provider;
/* harmony default export */ var contexts_SearchContext = (SearchContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/SearchProviderContainer/SearchProviderContainer.tsx




var SearchProviderContainer = function SearchProviderContainer(props) {
  var _useState = (0,react.useState)(''),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    keyword = _useState2[0],
    setKeyword = _useState2[1];
  var _useState3 = (0,react.useState)([]),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    list = _useState4[0],
    setList = _useState4[1];
  var _useState5 = (0,react.useState)(false),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    initialResults = _useState6[0],
    setInitialResults = _useState6[1];
  var setActiveKeyword = function setActiveKeyword(word) {
    setKeyword(word);
  };
  var setResultsList = function setResultsList(resultsList) {
    setList(resultsList);
  };
  var setInitialList = function setInitialList(firstRender) {
    setInitialResults(firstRender);
  };
  return /*#__PURE__*/react.createElement(SearchProvider, {
    value: {
      list: list,
      setList: setResultsList,
      activeKeyword: keyword,
      setActiveKeyword: setActiveKeyword,
      initialResults: initialResults,
      setInitialResults: setInitialList
    }
  }, props.children);
};
SearchProviderContainer.propTypes = {
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var SearchProviderContainer_SearchProviderContainer = (SearchProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/providers/SearchProviderContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/contexts/AccessibilityContext.ts

var AccessibilityContextDefault = {
  textZoom: 0,
  setTextZoom: function setTextZoom() {}
};
var AccessibilityContext = /*#__PURE__*/react.createContext(AccessibilityContextDefault);
var AccessibilityProvider = AccessibilityContext.Provider;
/* harmony default export */ var contexts_AccessibilityContext = (AccessibilityContext);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Accessibility/AccessibilityProviderContainer.tsx






var AccessibilityProviderContainer = function AccessibilityProviderContainer(props) {
  var _useState = (0,react.useState)(0),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    textZoom = _useState2[0],
    setTextZoom = _useState2[1];
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    accessibility = _useAtom2[0].accessibility;
  return accessibility.enable ? /*#__PURE__*/react.createElement(AccessibilityProvider, {
    value: {
      textZoom: textZoom,
      setTextZoom: setTextZoom
    }
  }, props.children) : props.children;
};
AccessibilityProviderContainer.propTypes = {
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var Accessibility_AccessibilityProviderContainer = (AccessibilityProviderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/helpers.ts
/**
 * Returns the background color for the cart button based on its disabled state.
 *
 * @param {Object} theme - The theme object containing button styles.
 * @param {boolean} disabled - Whether the button is disabled.
 * @param {string} defaultColor - The background color when the button is enabled.
 * @returns {string} The background color for the cart button.
 */
var getCartButtonBackgroundColor = function getCartButtonBackgroundColor(theme, disabled, defaultColor) {
  return disabled ? theme.cart.button.disabledBackgroundColor : defaultColor;
};

/**
 * Returns the text color for the cart button based on its disabled state.
 *
 * @param {Object} theme - The theme object containing button styles.
 * @param {boolean} disabled - Whether the button is disabled.
 * @param {string} defaultColor - The text color when the button is enabled.
 * @returns {string} The text color for the cart button.
 */
var getCartButtonTextColor = function getCartButtonTextColor(theme, disabled, defaultColor) {
  return disabled ? theme.cart.button.disabledTextColor : defaultColor;
};

/**
 * Calculates the bottom margin for the footer based on the heights of displayed elements.
 *
 * @param {boolean} hasTotalSum - Whether the total sum should be displayed.
 * @param {boolean} hasSendOrderButton - Whether the "Send Order" button is displayed.
 * @param {boolean} whatsAppCheckout - Whether the WhatsApp checkout option is displayed.
 * @param {boolean} [displayMinimumOrder=false] - Whether the minimum order message is displayed.
 * @param {number} defaultHeightButton - Default height button from theme
 * @returns {number} The calculated bottom margin in pixels.
 */
var getCartPanelFooterMarginBottom = function getCartPanelFooterMarginBottom(hasTotalSum, hasSendOrderButton, whatsAppCheckout, displayMinimumOrder, defaultHeightButton) {
  var baseMargin = 32;

  // Add to baseMargin the height of each displayed element in the footer.
  if (hasTotalSum) {
    baseMargin += 44; // Approx height of total sum container
  }
  if (displayMinimumOrder) {
    baseMargin += 76; // Approx height of minimum order container
  }
  if (whatsAppCheckout) {
    baseMargin += defaultHeightButton;
  }
  if (hasSendOrderButton) {
    baseMargin += defaultHeightButton;
  }

  // Count how many optional sections are displayed.
  var displayedSectionsCount = [hasTotalSum, displayMinimumOrder, whatsAppCheckout, hasSendOrderButton].filter(Boolean).length;

  // Add extra spacing (gaps) between sections if more than one is displayed.
  if (displayedSectionsCount > 1) {
    var gap = 8; // 8px

    baseMargin += (displayedSectionsCount - 1) * gap;
  }
  return baseMargin;
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartPanel/PanelCartStyle.tsx






var CartListFooter = styled_components_browser_esm.div.withConfig({
  displayName: "PanelCartStyle__CartListFooter",
  componentId: "sc-1rkf4wp-0"
})(["background-color:", ";border-radius:0 0 4px 4px;position:absolute;bottom:0;width:100%;height:auto;display:flex;flex-direction:column;gap:8px;padding:", "px;"], function (_ref) {
  var theme = _ref.theme;
  return theme.colors.black;
}, function (_ref2) {
  var $padding = _ref2.$padding;
  return $padding;
});
var CartListFooterTotalPrice = styled_components_browser_esm.div.withConfig({
  displayName: "PanelCartStyle__CartListFooterTotalPrice",
  componentId: "sc-1rkf4wp-1"
})(["display:flex;flex-flow:row wrap;justify-content:space-between;align-items:center;margin-top:8px;margin-bottom:8px;"]);
var CartListFooterButtonContainer = styled_components_browser_esm.div.withConfig({
  displayName: "PanelCartStyle__CartListFooterButtonContainer",
  componentId: "sc-1rkf4wp-2"
})(["width:100%;display:flex;align-items:center;align-content:center;flex-direction:row;flex-wrap:wrap;gap:8px;"]);
var WhatsAppButtonContainer = styled_components_browser_esm.div.withConfig({
  displayName: "PanelCartStyle__WhatsAppButtonContainer",
  componentId: "sc-1rkf4wp-3"
})(["width:100%;"]);
var CartListFooterButton = styled_components_browser_esm.div.withConfig({
  displayName: "PanelCartStyle__CartListFooterButton",
  componentId: "sc-1rkf4wp-4"
})(["transition:0.1s linear;height:36px;flex:50%;border-radius:", "px;display:flex;justify-content:center;align-items:center;cursor:", ";font-size:", "px;font-weight:", ";color:", ";background-color:", ";&:hover{background-color:", ";}&:active{background-color:", ";}"], function (_ref3) {
  var theme = _ref3.theme;
  return theme.defaults.borderRadius * 2;
}, function (_ref4) {
  var $disabled = _ref4.$disabled;
  return $disabled ? 'default' : 'pointer';
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.typography.size.h5;
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.typography.weight.bold;
}, function (_ref7) {
  var theme = _ref7.theme,
    $disabled = _ref7.$disabled;
  return getCartButtonTextColor(theme, $disabled, theme.colors.getTextColor(theme.colors.primary));
}, function (_ref8) {
  var theme = _ref8.theme,
    $disabled = _ref8.$disabled;
  return getCartButtonBackgroundColor(theme, $disabled, theme.colors.getButtonColor(theme.colors.primary));
}, function (_ref9) {
  var theme = _ref9.theme,
    $disabled = _ref9.$disabled;
  return getCartButtonBackgroundColor(theme, $disabled, theme.colors.withOpacity(ColorsWithOpacity.PRIMARY, 0.8));
}, function (_ref10) {
  var theme = _ref10.theme,
    $disabled = _ref10.$disabled;
  return getCartButtonBackgroundColor(theme, $disabled, theme.colors.getButtonColor(theme.colors.primary));
});
var CartListButtonContainer = styled_components_browser_esm.div.withConfig({
  displayName: "PanelCartStyle__CartListButtonContainer",
  componentId: "sc-1rkf4wp-5"
})(["width:auto;height:32px;display:flex;justify-content:space-around;align-items:center;margin-left:8px;"]);
var CartListTitleButton = styled_components_browser_esm.button.withConfig({
  displayName: "PanelCartStyle__CartListTitleButton",
  componentId: "sc-1rkf4wp-6"
})(["transition:.1s linear;width:auto;height:26px;border-radius:", "px;border:1px solid ", ";background-color:", ";display:flex;justify-content:flex-start;align-items:center;cursor:pointer;color:", ";font-weight:", ";font-family:", ";font-size:", "px;line-height:", "px;&:hover{background:", ";border:1px solid ", ";}&:active{background:", ";}"], function (_ref11) {
  var theme = _ref11.theme;
  return theme.button.default.borderRadius;
}, function (_ref12) {
  var theme = _ref12.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.4);
}, function (_ref13) {
  var theme = _ref13.theme;
  return theme.colors.transparent;
}, function (_ref14) {
  var theme = _ref14.theme;
  return theme.colors.white;
}, function (_ref15) {
  var theme = _ref15.theme;
  return theme.typography.weight.medium;
}, function (_ref16) {
  var theme = _ref16.theme;
  return theme.typography.family.sans;
}, function (_ref17) {
  var theme = _ref17.theme;
  return theme.typography.size.smallButton;
}, function (_ref18) {
  var theme = _ref18.theme;
  return theme.typography.lineHeight.smallerParagraph;
}, function (_ref19) {
  var theme = _ref19.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.2);
}, function (_ref20) {
  var theme = _ref20.theme;
  return theme.colors.transparent;
}, function (_ref21) {
  var theme = _ref21.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.4);
});
var CartPanelContainer = styled_components_browser_esm.div.withConfig({
  displayName: "PanelCartStyle__CartPanelContainer",
  componentId: "sc-1rkf4wp-7"
})(["display:flex;flex-direction:row;width:100%;max-height:100%;"]);
var CartPanelContentContainer = styled_components_browser_esm(PanelList).withConfig({
  displayName: "PanelCartStyle__CartPanelContentContainer",
  componentId: "sc-1rkf4wp-8"
})(["margin-top:52px;margin-bottom:", "px;overflow-x:hidden;", " padding:8px ", ";height:auto;word-break:break-all;"], function (_ref22) {
  var $marginBottom = _ref22.$marginBottom;
  return $marginBottom;
}, function (_ref23) {
  var $isRtl = _ref23.$isRtl;
  return $isRtl && getSpacing(!$isRtl, 8, TypesOfSpacing.MARGIN);
}, function (_ref24) {
  var $isRtl = _ref24.$isRtl;
  return $isRtl ? '0 8px 0' : '0 8px 8px';
});
var CartPanelTotalCustomFont = styled_components_browser_esm.h4.withConfig({
  displayName: "PanelCartStyle__CartPanelTotalCustomFont",
  componentId: "sc-1rkf4wp-9"
})(["font-family:", ";font-size:", "px;line-height:", "px;margin:0;"], function (_ref25) {
  var theme = _ref25.theme;
  return theme.typography.family.sans;
}, function (_ref26) {
  var theme = _ref26.theme;
  return theme.typography.size.largeButton;
}, function (_ref27) {
  var theme = _ref27.theme;
  return theme.typography.lineHeight.smallerParagraph;
});
var CartPanelSendOrderButton = styled_components_browser_esm(CartListFooterButton);
var PanelCartStyle_Icon = styled_components_browser_esm.span.withConfig({
  displayName: "PanelCartStyle__Icon",
  componentId: "sc-1rkf4wp-10"
})(["width:", "px;height:", "px;position:relative;"], function (_ref28) {
  var theme = _ref28.theme,
    size = _ref28.size;
  return theme.icons.size[size].width;
}, function (_ref29) {
  var theme = _ref29.theme,
    size = _ref29.size;
  return theme.icons.size[size].height;
});
var CartListFooterMinimumOrder = styled_components_browser_esm.div.withConfig({
  displayName: "PanelCartStyle__CartListFooterMinimumOrder",
  componentId: "sc-1rkf4wp-11"
})(["padding:8px 12px;border-radius:", "px;background-color:", ";color:", ";"], function (_ref30) {
  var theme = _ref30.theme;
  return theme.cart.borderRadius;
}, function (_ref31) {
  var theme = _ref31.theme;
  return theme.colors.grey;
}, function (_ref32) {
  var theme = _ref32.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.6);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartWhatsAppOrder/CartWhatsAppOrder.tsx



function CartWhatsAppOrder_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ CartWhatsAppOrder_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }

























var whatsAppUrl = 'https://wa.me/';
var CartWhatsAppOrder_sectionSeparator = '------------------';
var CartWhatsAppOrder = function CartWhatsAppOrder(_ref) {
  var cart = _ref.cart,
    totalSum = _ref.totalSum,
    currency = _ref.currency,
    orderPersonalization = _ref.orderPersonalization,
    playerToken = _ref.playerToken,
    disabled = _ref.disabled;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    hash = _useAtom2$.hash,
    accountId = _useAtom2$.link.accountId,
    title = _useAtom2$.title,
    author = _useAtom2$.author,
    visibility = _useAtom2$.visibility;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    language = _useContext.options.controls.language;
  var directLink = useUrl(urlType_UrlType.SHARE, {
    isPrivate: isSharedWithUsers(visibility)
  });
  var cartProducts = (cart === null || cart === void 0 ? void 0 : cart.products) || {};
  var cartOrder = (cart === null || cart === void 0 ? void 0 : cart.order) || [];
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    cartConfig = _useContext2.cart;
  var _useAtom3 = react_useAtom(setCheckoutViaWhatsAppCartAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 2),
    isWhatsAppCheckout = _useAtom4[1];
  var theme = Ze();
  var recaptchaRef = (0,react.useRef)(null);
  var whatsAppButtonLabel = (orderPersonalization === null || orderPersonalization === void 0 ? void 0 : orderPersonalization.whatsAppButtonText) || 'Order via WhatsApp';
  var greetingMessage = (orderPersonalization === null || orderPersonalization === void 0 ? void 0 : orderPersonalization.whatsAppHelloMessage) || '';
  var thankYouMessage = (orderPersonalization === null || orderPersonalization === void 0 ? void 0 : orderPersonalization.whatsAppThankYouMessage) || '';
  var orderTotal = totalSum ? "\nTotal: ".concat(totalSum, " ").concat(currency, "\n").concat(CartWhatsAppOrder_sectionSeparator) : '';
  var _staticStore$config$g = getConfig(),
    orderEmailEndpoint = _staticStore$config$g.orderEmailEndpoint,
    recaptchaListKey = _staticStore$config$g.recaptchaListKey;
  var hasPopUpBlocker = main/* isSafari */.nr || main/* isFirefox */.gm && main/* isIOS */.un;
  var productList = '';
  cartOrder.forEach(function (productId) {
    var item = cartProducts[productId];
    if (item) {
      productList += generateProductListText(item, currency);
    }
  });
  var message = encodeURIComponent("".concat(greetingMessage, "\n").concat(CartWhatsAppOrder_sectionSeparator, "\n") + "".concat(productList).concat(CartWhatsAppOrder_sectionSeparator).concat(orderTotal, "\n").concat(thankYouMessage));
  var orderMessageUrl = "".concat(whatsAppUrl).concat(orderPersonalization === null || orderPersonalization === void 0 ? void 0 : orderPersonalization.whatsAppPhoneNumber, "/?text=").concat(message);

  // Define href for Safari and iOS Firefox to avoid pop-up blocking issues
  var whatsAppHref = hasPopUpBlocker ? orderMessageUrl : '';
  var sendWhatsAppOrderHandler = /*#__PURE__*/function () {
    var _ref2 = asyncToGenerator_asyncToGenerator(/*#__PURE__*/CartWhatsAppOrder_regeneratorRuntime().mark(function _callee() {
      var _recaptchaRef$current, token, flipbookData;
      return CartWhatsAppOrder_regeneratorRuntime().wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            if (disabled) {
              _context.next = 11;
              break;
            }
            _context.next = 3;
            return recaptchaRef === null || recaptchaRef === void 0 || (_recaptchaRef$current = recaptchaRef.current) === null || _recaptchaRef$current === void 0 ? void 0 : _recaptchaRef$current.executeAsync();
          case 3:
            token = _context.sent;
            if (!token) {
              _context.next = 10;
              break;
            }
            flipbookData = getOrderFlipbookData({
              directLink: directLink,
              title: title,
              author: author,
              language: language
            }, cartConfig === null || cartConfig === void 0 ? void 0 : cartConfig.currency);
            if (cart.isWhatsAppCheckout) {
              _context.next = 10;
              break;
            }
            _context.next = 9;
            return sendMessageHelper({
              hash: hash,
              accountId: accountId,
              orderId: getUniqueOrderId(),
              orderList: formatOrderList(cartOrder, cartProducts),
              flipbookData: flipbookData,
              recaptchaToken: token,
              customerFields: [],
              userDetails: buildUserFingerprint(),
              sources: [SourcesType.WHATSAPP]
            }, orderEmailEndpoint);
          case 9:
            isWhatsAppCheckout(playerToken);
          case 10:
            if (!hasPopUpBlocker) {
              window.open(orderMessageUrl, '_blank', 'noopener,noreferrer');
            }
          case 11:
          case "end":
            return _context.stop();
        }
      }, _callee);
    }));
    return function sendWhatsAppOrderHandler() {
      return _ref2.apply(this, arguments);
    };
  }();
  var onKeyDownSendWhatsAppOrderHandler = /*#__PURE__*/function () {
    var _ref3 = asyncToGenerator_asyncToGenerator(/*#__PURE__*/CartWhatsAppOrder_regeneratorRuntime().mark(function _callee2(event) {
      return CartWhatsAppOrder_regeneratorRuntime().wrap(function _callee2$(_context2) {
        while (1) switch (_context2.prev = _context2.next) {
          case 0:
            event.preventDefault();
            if (!(!disabled && event.code === KeyboardCodes.ENTER)) {
              _context2.next = 5;
              break;
            }
            // We need for enter key down
            if (hasPopUpBlocker) {
              window.open(orderMessageUrl, '_blank', 'noopener,noreferrer');
            }
            _context2.next = 5;
            return sendWhatsAppOrderHandler();
          case 5:
          case "end":
            return _context2.stop();
        }
      }, _callee2);
    }));
    return function onKeyDownSendWhatsAppOrderHandler(_x) {
      return _ref3.apply(this, arguments);
    };
  }();
  return /*#__PURE__*/react.createElement(WhatsAppButtonContainer, {
    role: "button",
    tabIndex: TabIndex.DEFAULT,
    "aria-label": whatsAppButtonLabel,
    onKeyDown: onKeyDownSendWhatsAppOrderHandler,
    onClick: sendWhatsAppOrderHandler
  }, /*#__PURE__*/react.createElement(src_IconButton, {
    bgColor: getCartButtonBackgroundColor(theme, disabled, theme.colors.success),
    hoverColor: getCartButtonBackgroundColor(theme, disabled, theme.colors.withOpacity(ColorsWithOpacity.SUCCESS, 0.4)),
    alpha: 1,
    height: theme.button.default.height,
    padding: theme.cart.whatsAppOrderButton.padding,
    radius: "".concat(theme.button.default.borderRadius, "px"),
    labelColor: getCartButtonTextColor(theme, disabled, theme.button.default.color),
    variant: ButtonVariants.CONTAINED,
    icon: /*#__PURE__*/react.createElement(src.WhatsAppIcon, {
      fill: getCartButtonTextColor(theme, disabled, theme.colors.white)
    }),
    label: whatsAppButtonLabel,
    fontSize: theme.button.default.fontSize,
    fontWeight: 500,
    centeredText: true,
    fullSizeIcon: true,
    href: whatsAppHref
  }), /*#__PURE__*/react.createElement(Recaptcha, null, /*#__PURE__*/react.createElement(lib_esm, {
    ref: recaptchaRef,
    size: "invisible",
    sitekey: recaptchaListKey
  })));
};
/* harmony default export */ var CartWhatsAppOrder_CartWhatsAppOrder = (CartWhatsAppOrder);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/printStyle.ts
/**
 * The css style for the pdf printing
 * @return {string}
 */
/* harmony default export */ var printStyle = (function () {
  return '@page{margin: 0; height: 280mm}' + 'html{margin: 0; padding: 0;}' + 'html,body{color-adjust: exact; -webkit-print-color-adjust: exact;font-size: 14px;}' + 'body{padding-top: 25px; padding-bottom: 25px;}' + '#pdf-content{font-family: Roboto, sans-serif;padding: 0 25px;}' + '#header-content{display: flex; justify-content: space-between; font-size: 14px;height: 135px;}' + '.header-img{max-width: 200px;max-height: 50px;}' + '#img-logo{max-width: 200px;height: 100%; object-fit: contain;}' + '.header-text{max-width:500px;text-align:right;white-space:pre-wrap;text-overflow:ellipsis; overflow:hidden;}' + '.details{background-color: #F7F7F7; border-radius: 4px; padding: 8px; margin: 14px 0;}' + '.title{text-decoration: none;color:#0362FC;max-width: 200px; overflow: hidden; height: 15px;' + ' text-overflow: ellipsis; white-space: nowrap;}' + '.bold{font-weight: bold}' + '.table{font-size: 14px; border-collapse: collapse; width: 100%; text-align: left; line-height: 14px;' + 'letter-spacing: 0.15px;}' + 'thead{border-top: 2px solid #F7F7F7; border-bottom: 2px solid #F7F7F7;' + 'display:table-row-group; height:50px;}' + 'tbody{line-height: 16px;}' + 'td,th{ padding: 15px 10px; vertical-align: top}' + 'td:last-child,th:last-child{text-align: right;}' + '.product-title-container{display: flex; gap: 0 8px;}' + '.product-image-container{width: 32px; height: 32px;}' + '.product-image{width: 32px; height: 32px; border-radius: 4px; object-fit: cover;}' + '.title-link{color: #0362FC;}' + '.product-title-info{display: flex; flex-direction: column; gap: 4px}' + '.customizable-product{font-size: 12px;}' + '.product-item{border-bottom: 1px solid #F7F7F7;}' + '.product-id{width: 200px; display: inline-block; word-break: break-word;}' + '.product-price{width: 70px;}' + '.product-amount{width: 50px;}' + '.product-total{width: 100px;}' + '.divider{margin: 20px 0 10px; border: 1px solid #F7F7F7;}' + '.total{display: flex; justify-content: space-between; align-items: center; font-weight: bold;' + ' font-size: 18px; line-height: 21px; padding-bottom: 10px;}' + '.footer{display: flex; padding-bottom: 10px;white-space: pre-wrap;}';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/cart/printPdf.ts



/**
 * Opens the print window
 * @param printWindow
 * @param isFullscreen
 */
var writeDocument = function writeDocument(printWindow, isFullscreen) {
  var timeout = isFullscreen ? 500 : 50;
  var button = document.getElementById('download-pdf');
  setTimeout(function () {
    printWindow.focus();
    if (!main/* isMobile */.Fr) {
      // Safari needs some time to load, so we have to set a timeout
      printWindow.print();
      printWindow.document.close();
      printWindow.close();
      if (button) {
        button.style.pointerEvents = 'all';
        button.style.opacity = '1';
      }
    }
    if (button) {
      button.style.pointerEvents = 'none';
      button.style.opacity = '0.6';

      // If it's not mobile we close the window automatically
      // For mobile it loads slow and the window is closing before the content was loaded
      if (!main/* isMobile */.Fr) {
        // Safari needs some time to load, so we have to set a timeout
        button.style.pointerEvents = 'all';
        button.style.opacity = '1';
      } else {
        printWindow.print();
        button.style.pointerEvents = 'all';
        button.style.opacity = '1';
      }
    }
  }, timeout);
};

/**
 * Creates the html page for printing the order in it
 * @param imgSrc
 * @param isFullscreen
 */
/* harmony default export */ var printPdf = (function (imgSrc) {
  var isFullscreen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var w = window.screen.width / 2;
  var h = window.screen.height / 2;
  var left = window.screen.width / 2 - w / 2;
  var top = window.screen.height / 2 - h / 2;

  // Use 'about:blank' to make sure the window properly loads
  var printWindow = window.open('about:blank', '_blank', "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no,\n         resizable=no, title=print, copyhistory=no, width=".concat(w, ", height=").concat(h, ", top=").concat(top, ", left=").concat(left));
  printWindow === null || printWindow === void 0 || printWindow.focus();
  if (printWindow) {
    var style = printStyle();
    var printContainer = document.getElementById('print-pdf');
    printWindow.document.open(); // Open the document stream to write content
    printWindow.document.write('<html lang="en"><head><title>Print window</title></head>');
    printWindow.document.write('<style>');
    printWindow.document.write(style);
    printWindow.document.write('@import url("https://fonts.googleapis.com/css2?family=Roboto&display=swap");');
    printWindow.document.write('</style>');
    printWindow.document.title = 'My product list';
    printWindow.document.write('</head>');
    printWindow.document.write('<body>');
    printWindow.document.write((printContainer === null || printContainer === void 0 ? void 0 : printContainer.innerHTML) || '');
    printWindow.document.write('</body></html>');
    printWindow.document.close(); // Close the document stream

    // If we have a logo, wait for it to load, otherwise the print document is written without it
    setTimeout(function () {
      if (imgSrc && imgSrc.length) {
        var img = new Image();
        img.onload = function () {
          writeDocument(printWindow, isFullscreen);
        };
        img.onerror = function () {
          writeDocument(printWindow, isFullscreen);
        };
        img.src = imgSrc;
      } else {
        writeDocument(printWindow, isFullscreen);
      }
    }, 250);
  }
});
// EXTERNAL MODULE: ../../modules/widget-player/code/node_modules/json2csv/dist/json2csv.umd.js
var json2csv_umd = __webpack_require__(4658);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartCsvDownloadLink/CartCsvDownloadLink.style.tsx

var CartCsvDownloadLink_style_Container = styled_components_browser_esm.div.withConfig({
  displayName: "CartCsvDownloadLinkstyle__Container",
  componentId: "sc-1ynisq7-0"
})(["text-decoration:none;display:block;color:", ";"], function (_ref) {
  var theme = _ref.theme;
  return theme.colors.white;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartCsvDownloadLink/CartCsvDownloadLink.tsx

function CartCsvDownloadLink_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function CartCsvDownloadLink_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? CartCsvDownloadLink_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : CartCsvDownloadLink_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





var CartCsvDownloadLink = function CartCsvDownloadLink(props) {
  var aRef = /*#__PURE__*/react.createRef();
  var generateCsvBlob = function generateCsvBlob() {
    var hasCustomizableProduct = props.cartOrder.some(function (item) {
      var _props$cartProducts$i;
      return (_props$cartProducts$i = props.cartProducts[item]) === null || _props$cartProducts$i === void 0 || (_props$cartProducts$i = _props$cartProducts$i.customizableProductProperties) === null || _props$cartProducts$i === void 0 ? void 0 : _props$cartProducts$i.value;
    });
    var hasPrice = props.cartOrder.some(function (item) {
      var _props$cartProducts$i2;
      return Number(((_props$cartProducts$i2 = props.cartProducts[item]) === null || _props$cartProducts$i2 === void 0 ? void 0 : _props$cartProducts$i2.price) || 0);
    });
    var someItemHasQuantityOptionsEnabled = props.cartOrder.some(function (item) {
      var _props$cartProducts$i3;
      return (_props$cartProducts$i3 = props.cartProducts[item]) === null || _props$cartProducts$i3 === void 0 || (_props$cartProducts$i3 = _props$cartProducts$i3.quantityProperties) === null || _props$cartProducts$i3 === void 0 ? void 0 : _props$cartProducts$i3.enabled;
    });
    var data = props.cartOrder.map(function (item) {
      var _props$cartProducts$i4, _props$cartProducts$i5, _props$cartProducts$i6, _props$cartProducts$i7, _props$cartProducts$i8, _props$cartProducts$i9;
      return CartCsvDownloadLink_objectSpread(CartCsvDownloadLink_objectSpread(CartCsvDownloadLink_objectSpread({
        title: (_props$cartProducts$i4 = props.cartProducts[item]) === null || _props$cartProducts$i4 === void 0 ? void 0 : _props$cartProducts$i4.title
      }, hasCustomizableProduct ? {
        'custom text': ((_props$cartProducts$i5 = props.cartProducts[item]) === null || _props$cartProducts$i5 === void 0 || (_props$cartProducts$i5 = _props$cartProducts$i5.customizableProductProperties) === null || _props$cartProducts$i5 === void 0 ? void 0 : _props$cartProducts$i5.value) || ''
      } : {}), {}, {
        code: (_props$cartProducts$i6 = props.cartProducts[item]) === null || _props$cartProducts$i6 === void 0 ? void 0 : _props$cartProducts$i6.code
      }, someItemHasQuantityOptionsEnabled ? {
        quantity: (_props$cartProducts$i7 = props.cartProducts[item]) !== null && _props$cartProducts$i7 !== void 0 && (_props$cartProducts$i7 = _props$cartProducts$i7.quantityProperties) !== null && _props$cartProducts$i7 !== void 0 && _props$cartProducts$i7.enabled ? (_props$cartProducts$i8 = props.cartProducts[item]) === null || _props$cartProducts$i8 === void 0 ? void 0 : _props$cartProducts$i8.quantity : ''
      } : {}), hasPrice ? {
        price: ((_props$cartProducts$i9 = props.cartProducts[item]) === null || _props$cartProducts$i9 === void 0 ? void 0 : _props$cartProducts$i9.price) || ''
      } : {});
    });
    var csvContent = new json2csv_umd.Parser().parse(data);
    var blob = new Blob([csvContent], {
      type: 'text/csv'
    });
    var url = URL.createObjectURL(blob);
    if (aRef.current) {
      aRef.current.href = url;
      aRef.current.download = CSV_FILENAME;
      aRef.current.click();
    }
    URL.revokeObjectURL(url);
  };
  var onClick = function onClick() {
    generateCsvBlob();
  };
  var onKeyDown = function onKeyDown(event) {
    if (event.code === KeyboardCodes.SPACE || event.code === KeyboardCodes.ENTER) {
      generateCsvBlob();
    }
  };
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(CartCsvDownloadLink_style_Container, {
    onClick: onClick,
    onKeyDown: onKeyDown,
    role: "button",
    "aria-label": "CSV option, click to download",
    tabIndex: TabIndex.DEFAULT
  }, props.children), /*#__PURE__*/react.createElement("a", {
    href: "/",
    ref: aRef,
    download: CSV_FILENAME,
    "aria-hidden": true,
    style: {
      display: 'none'
    }
  }, "CSV"));
};
/* harmony default export */ var CartCsvDownloadLink_CartCsvDownloadLink = (CartCsvDownloadLink);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartCsvDownloadLink/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartExportShoppingList/CartExportShoppingList.style.tsx


var CartExportShoppingList_style_Container = styled_components_browser_esm.div.withConfig({
  displayName: "CartExportShoppingListstyle__Container",
  componentId: "sc-ev1wph-0"
})(["cursor:pointer;"]);
var CartExportShoppingList_style_ButtonContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartExportShoppingListstyle__ButtonContainer",
  componentId: "sc-ev1wph-1"
})([""]);
var CartExportShoppingList_style_Dropdown = styled_components_browser_esm.div.withConfig({
  displayName: "CartExportShoppingListstyle__Dropdown",
  componentId: "sc-ev1wph-2"
})(["cursor:initial;position:absolute;top:46px;background-color:", ";backdrop-filter:blur(20px);border-radius:", "px;border:1px solid ", ";"], function (_ref) {
  var theme = _ref.theme;
  return theme.cart.dropdown.backgroundColor;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.cart.borderRadius;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.3);
});
var DropdownOptionContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartExportShoppingListstyle__DropdownOptionContainer",
  componentId: "sc-ev1wph-3"
})(["margin:8px;"]);
var CartExportShoppingList_style_DropdownOption = styled_components_browser_esm.div.withConfig({
  displayName: "CartExportShoppingListstyle__DropdownOption",
  componentId: "sc-ev1wph-4"
})(["transition:.1s linear;border-radius:", "px;padding:8px;cursor:pointer;height:32px;&:hover{background:", ";a,span{transition:.1s linear;color:", ";}}"], function (_ref4) {
  var theme = _ref4.theme;
  return theme.cart.borderRadius;
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.8);
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.colors.primary;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartExportShoppingList/CartExportShoppingList.tsx


















var CartExportShoppingList = function CartExportShoppingList(_ref) {
  var _orderPersonalization, _orderPersonalization2;
  var cartProducts = _ref.cartProducts,
    cartOrder = _ref.cartOrder,
    orderPersonalization = _ref.orderPersonalization;
  var theme = Ze();
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    isOpen = _useState2[0],
    setIsOpen = _useState2[1];
  var bothOptions = (orderPersonalization === null || orderPersonalization === void 0 ? void 0 : orderPersonalization.pdfDownload) && (orderPersonalization === null || orderPersonalization === void 0 ? void 0 : orderPersonalization.csvDownload);
  var downloadListText = useTranslate(Identifier.l_download_list);
  var _staticStore$config$g = getConfig(),
    cdnBase = _staticStore$config$g.cdnBase;
  var imgSrc = orderPersonalization !== null && orderPersonalization !== void 0 && (_orderPersonalization = orderPersonalization.logo) !== null && _orderPersonalization !== void 0 && _orderPersonalization.data ? "".concat(cdnBase, "/").concat(collections, "/").concat(ResourcesFolder.library, "/").concat(orderPersonalization === null || orderPersonalization === void 0 || (_orderPersonalization2 = orderPersonalization.logo) === null || _orderPersonalization2 === void 0 ? void 0 : _orderPersonalization2.data) : '';
  var _useState3 = (0,react.useState)(0),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    activeOption = _useState4[0],
    setActiveOption = _useState4[1];
  var dropdownRef = (0,react.useRef)(null);
  var fullscreen = (0,react.useContext)(contexts_FullscreenContext);
  (0,react.useEffect)(function () {
    var _dropdownRef$current;
    var options = (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.querySelectorAll('.dropdown-option');
    if (options && options.length > 0 && options[activeOption] !== undefined) {
      // @ts-ignore - focus() is tricky, there is a limited list of element that can be focused
      // And typescript doesn't know about it
      options[activeOption].childNodes[0].focus();
    }
  }, [activeOption]);
  (0,react.useEffect)(function () {
    if (isOpen) {
      var _dropdownRef$current2;
      (_dropdownRef$current2 = dropdownRef.current) === null || _dropdownRef$current2 === void 0 || _dropdownRef$current2.focus();
    }
  }, [isOpen]);
  var onKeyDownDownloadHandler = function onKeyDownDownloadHandler(event) {
    event.preventDefault();
    if (event.code === KeyboardCodes.SPACE || event.code === KeyboardCodes.ENTER) {
      setIsOpen(function (prevState) {
        return !prevState;
      });
    }
    if (isOpen && event.code === KeyboardCodes.TAB) {
      setIsOpen(false);
    }
  };
  var onKeyDownDownloadPDFHandler = function onKeyDownDownloadPDFHandler(event) {
    event.preventDefault();
    if (event.code === KeyboardCodes.SPACE || event.code === KeyboardCodes.ENTER) {
      if (fullscreen.isFullscreen) {
        // A print window cannot load the print order content if it is triggered from fullscreen
        fullscreen.toggleFullscreen();
        printPdf(imgSrc, true);
      } else {
        printPdf(imgSrc);
      }
    }
  };
  var onKeyDownDropdownHandler = function onKeyDownDropdownHandler(event) {
    event.preventDefault();
    if (event.code === KeyboardCodes.ARROW_UP) {
      setActiveOption(function (prevOption) {
        if (prevOption > 0) {
          return prevOption - 1;
        }
        if (prevOption === 0) {
          return 1;
        }
        return 0;
      });
    }
    if (event.code === KeyboardCodes.ARROW_DOWN) {
      setActiveOption(function (prevOption) {
        if (prevOption < 1) {
          return prevOption + 1;
        }
        if (prevOption === 1) {
          return 0;
        }
        return 1;
      });
    }
    if (event.code === KeyboardCodes.TAB) {
      setIsOpen(function (prevState) {
        return !prevState;
      });
      setActiveOption(0);
    }
  };
  var openPrintWindow = function openPrintWindow(event) {
    if (event.detail === 1) {
      if (fullscreen.isFullscreen) {
        // A print window cannot load the print order content if it is triggered from fullscreen
        fullscreen.toggleFullscreen();
        printPdf(imgSrc, true);
      } else {
        printPdf(imgSrc);
      }
    }
  };
  var iconButton = function iconButton() {
    return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
      label: isOpen ? '' : downloadListText,
      position: tooltipPosition.BOTTOM
    }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
      isActive: isOpen,
      ariaLabel: downloadListText,
      type: HtmlButtonTypes.BUTTON,
      size: "medium"
    }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
      size: IconSize.small
    }, /*#__PURE__*/react.createElement(src.DownloadIcon, {
      fill: theme.colors.white
    }))));
  };
  var openDropdown = function openDropdown() {
    return /*#__PURE__*/react.createElement(CartExportShoppingList_style_ButtonContainer, {
      role: "button",
      tabIndex: TabIndex.DEFAULT,
      "aria-label": "download options button",
      onClick: function onClick() {
        return setIsOpen(function (prevState) {
          return !prevState;
        });
      },
      onKeyDown: onKeyDownDownloadHandler
    }, iconButton());
  };
  var csvButton = function csvButton() {
    return /*#__PURE__*/react.createElement(CartCsvDownloadLink_CartCsvDownloadLink, {
      cartProducts: cartProducts,
      cartOrder: cartOrder
    }, iconButton());
  };
  var optionDropdown = function optionDropdown() {
    return /*#__PURE__*/react.createElement(CartExportShoppingList_style_Dropdown, {
      ref: dropdownRef,
      tabIndex: TabIndex.DEFAULT,
      onKeyDown: onKeyDownDropdownHandler
    }, /*#__PURE__*/react.createElement(DropdownOptionContainer, null, /*#__PURE__*/react.createElement(CartExportShoppingList_style_DropdownOption, {
      className: "dropdown-option"
    }, /*#__PURE__*/react.createElement(CartExportShoppingList_style_ButtonContainer, {
      id: "download-pdf",
      role: "button",
      tabIndex: TabIndex.DEFAULT,
      "aria-label": "PDF option, click to download",
      onClick: openPrintWindow,
      onKeyDown: onKeyDownDownloadPDFHandler
    }, /*#__PURE__*/react.createElement("span", {
      "aria-hidden": true
    }, "PDF"))), /*#__PURE__*/react.createElement(CartExportShoppingList_style_DropdownOption, {
      className: "dropdown-option"
    }, /*#__PURE__*/react.createElement(CartCsvDownloadLink_CartCsvDownloadLink, {
      cartProducts: cartProducts,
      cartOrder: cartOrder
    }, /*#__PURE__*/react.createElement("span", {
      "aria-hidden": true
    }, "CSV")))));
  };
  if (bothOptions) {
    return /*#__PURE__*/react.createElement(CartExportShoppingList_style_Container, null, isOpen && optionDropdown(), openDropdown());
  }
  if (orderPersonalization !== null && orderPersonalization !== void 0 && orderPersonalization.pdfDownload) {
    return /*#__PURE__*/react.createElement(CartExportShoppingList_style_Container, null, /*#__PURE__*/react.createElement(CartExportShoppingList_style_ButtonContainer, {
      id: "download-pdf",
      role: "button",
      tabIndex: TabIndex.DEFAULT,
      "aria-label": "PDF option, click to download",
      onClick: openPrintWindow,
      onKeyDown: onKeyDownDownloadPDFHandler
    }, iconButton()));
  }
  if (orderPersonalization !== null && orderPersonalization !== void 0 && orderPersonalization.csvDownload) {
    return /*#__PURE__*/react.createElement(CartExportShoppingList_style_Container, {
      role: "button"
    }, csvButton());
  }
  return null;
};
/* harmony default export */ var CartExportShoppingList_CartExportShoppingList = (CartExportShoppingList);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartExportShoppingList/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartPanel/CartPanelHeader.tsx















var CartPanelHeader = function CartPanelHeader(_ref) {
  var isRtl = _ref.isRtl,
    totalNumberOfItems = _ref.totalNumberOfItems,
    closePanel = _ref.closePanel,
    cartProducts = _ref.cartProducts,
    cartOrder = _ref.cartOrder,
    orderPersonalization = _ref.orderPersonalization;
  var _useContext = (0,react.useContext)(contexts_ModalContext),
    setOpen = _useContext.setOpen;
  var myTitleTranslated = useTranslate(Identifier.l_my_list);
  var ariaLabelTitle = "".concat(myTitleTranslated, ". You have ").concat(totalNumberOfItems || 'no', " items in your list.)");
  var totalNumberOfItemsToString = "".concat(totalNumberOfItems);
  var openClearListModal = function openClearListModal() {
    setOpen(CART_CLEAR_LIST_MODAL_ID);
  };
  return /*#__PURE__*/react.createElement(PanelHeader, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(PanelTitle, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(PanelTitleItems, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(PanelTitleInfo, null, /*#__PURE__*/react.createElement(H5, {
    tabIndex: TabIndex.DEFAULT,
    "aria-label": ariaLabelTitle
  }, myTitleTranslated), /*#__PURE__*/react.createElement(CartButton_CartItemsCounter, {
    cartItemsCount: totalNumberOfItemsToString
  })), !!totalNumberOfItems && /*#__PURE__*/react.createElement(PanelContainerButtons, null, /*#__PURE__*/react.createElement(CartExportShoppingList_CartExportShoppingList, {
    cartProducts: cartProducts,
    cartOrder: cartOrder,
    orderPersonalization: orderPersonalization
  }), /*#__PURE__*/react.createElement(CartListButtonContainer, null, /*#__PURE__*/react.createElement(CartListTitleButton, {
    tabIndex: TabIndex.DEFAULT,
    autoFocus: true,
    onClick: openClearListModal
  }, /*#__PURE__*/react.createElement(Translate_Translate, {
    "aria-hidden": true
  }, Identifier.l_clear_list)))))), /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: AriaLabel.CLOSE_BUTTON,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    onClick: closePanel,
    tabIndex: TabIndex.DEFAULT,
    isCloseButton: true
  }, /*#__PURE__*/react.createElement(src.CloseIcon, {
    fill: "#fff",
    size: src.IconSizes.MEDIUM
  })));
};
CartPanelHeader.propTypes = {
  isRtl: (prop_types_default()).bool.isRequired,
  totalNumberOfItems: (prop_types_default()).number.isRequired
};
/* harmony default export */ var CartPanel_CartPanelHeader = (CartPanelHeader);
// EXTERNAL MODULE: ../../modules/ui/code/content-icons/src/RemoveItemIcon.tsx
var RemoveItemIcon = __webpack_require__(4236);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartList/CartItemStyle.ts


var CartItemContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartItemStyle__CartItemContainer",
  componentId: "sc-4wps9w-0"
})(["color:", ";border:0;text-align:left;display:flex;font-size:", "px;line-height:", "px;font-weight:", ";justify-content:space-between;border-radius:", "px;transition:.1s linear;padding:", "px;&:nth-last-child(1){margin-bottom:0;};&:hover{background:", ";};"], function (_ref) {
  var theme = _ref.theme;
  return theme.colors.white;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.typography.size.h5;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.typography.lineHeight.h4;
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.typography.weight.regular;
}, function (_ref5) {
  var theme = _ref5.theme;
  return theme.button.default.borderRadius;
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.panel.padding;
}, function (_ref7) {
  var theme = _ref7.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.2);
});
var CartItemTextContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartItemStyle__CartItemTextContainer",
  componentId: "sc-4wps9w-1"
})(["font-weight:", ";line-height:", "px;word-break:break-word;width:auto;padding:0 ", "px;display:flex;flex-direction:column;justify-content:center;align-items:start;gap:4px;"], function (_ref8) {
  var theme = _ref8.theme;
  return theme.typography.weight.regular;
}, function (_ref9) {
  var theme = _ref9.theme;
  return theme.typography.lineHeight.h5;
}, function (_ref10) {
  var theme = _ref10.theme;
  return theme.panel.padding;
});
var CartItemTitleContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartItemStyle__CartItemTitleContainer",
  componentId: "sc-4wps9w-2"
})(["font-size:", "px;"], function (_ref11) {
  var theme = _ref11.theme;
  return theme.typography.size.smallerParagraph;
});
var CartItemSubTitleContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartItemStyle__CartItemSubTitleContainer",
  componentId: "sc-4wps9w-3"
})(["font-size:12px;"]);
var CartItemPriceContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartItemStyle__CartItemPriceContainer",
  componentId: "sc-4wps9w-4"
})(["font-weight:", ";"], function (_ref12) {
  var theme = _ref12.theme;
  return theme.typography.weight.bold;
});
var CartItemControlsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartItemStyle__CartItemControlsContainer",
  componentId: "sc-4wps9w-5"
})(["display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;& > button{padding:0;& > span{&:hover{background:", ";}&:active{background:", ";}}}"], function (_ref13) {
  var theme = _ref13.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.2);
}, function (_ref14) {
  var theme = _ref14.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.4);
});
var CartTextAndTitleContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartItemStyle__CartTextAndTitleContainer",
  componentId: "sc-4wps9w-6"
})(["display:flex;width:270px;"]);
var CartEmptyStateContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CartItemStyle__CartEmptyStateContainer",
  componentId: "sc-4wps9w-7"
})(["margin:4px 0;padding-left:", "px;padding-top:8px;padding-bottom:8px;"], function (_ref15) {
  var theme = _ref15.theme,
    $isRtl = _ref15.$isRtl;
  return !$isRtl ? theme.panel.padding : 0;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartList/CartItem.tsx
















var CartItem = function CartItem(_ref) {
  var isRtl = _ref.isRtl,
    playerToken = _ref.playerToken,
    elementId = _ref.elementId,
    title = _ref.title,
    price = _ref.price,
    quantity = _ref.quantity,
    quantityProperties = _ref.quantityProperties,
    media = _ref.media,
    currency = _ref.currency,
    onQuantityInputFocus = _ref.onQuantityInputFocus,
    onQuantityInputBlur = _ref.onQuantityInputBlur,
    customizableProductProperties = _ref.customizableProductProperties;
  var _useState = (0,react.useState)("".concat(quantity)),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    inputValue = _useState2[0],
    setInputValue = _useState2[1];
  var _useAtom = react_useAtom(deleteItemFromCartAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    deleteItemFromCart = _useAtom2[1];
  var _useAtom3 = react_useAtom(changeItemQuantityInCartAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 2),
    changeItemQuantityInCart = _useAtom4[1];
  var _useAtom5 = react_useAtom(propertiesAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    accountId = _useAtom6[0].link.accountId;
  var _useAtom7 = react_useAtom(rootPrimitivesAtom),
    _useAtom8 = slicedToArray_slicedToArray(_useAtom7, 1),
    downloadMode = _useAtom8[0].downloadMode;
  var inputTooltip = quantityProperties.enabled ? '' : 'Only 1 item available';
  var tabIndex = useTabIndex(TabIndex.ITEM_VIEW_PANEL);

  // If we remove the element but the input was still on focus we need to call the 'onQuantityInputBlur' manually
  (0,react.useEffect)(function () {
    return function () {
      onQuantityInputBlur(false);
    };
  }, [onQuantityInputBlur]);
  var firstImg = media && media[0];
  var firstImgSrc;
  if (firstImg) {
    firstImgSrc = getImageResourcePath(accountId, {
      src: firstImg.hash,
      provider: firstImg.provider
    });
  }
  var onBlur = function onBlur() {
    setInputValue("".concat(Number(inputValue) || 1));
    onQuantityInputBlur(false);
  };
  var saveQuantity = function saveQuantity(value) {
    changeItemQuantityInCart({
      playerToken: playerToken,
      elementId: elementId,
      newQuantity: value
    });
  };
  var saveQuantityOnFocus = function saveQuantityOnFocus() {
    onQuantityInputFocus();
  };
  return /*#__PURE__*/react.createElement(CartItemContainer, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(CartTextAndTitleContainer, null, /*#__PURE__*/react.createElement(CartItemImage_CartItemImage, {
    imgSrc: firstImg && firstImgSrc,
    downloadMode: downloadMode
  }), /*#__PURE__*/react.createElement(CartItemTextContainer, null, /*#__PURE__*/react.createElement(CartItemTitleContainer, {
    tabIndex: tabIndex
  }, title), (customizableProductProperties === null || customizableProductProperties === void 0 ? void 0 : customizableProductProperties.value) && /*#__PURE__*/react.createElement(CartItemSubTitleContainer, {
    tabIndex: tabIndex
  }, /*#__PURE__*/react.createElement("b", null, customizableProductProperties.label, ":"), " ", customizableProductProperties.value), /*#__PURE__*/react.createElement(CartItemPriceContainer, {
    tabIndex: tabIndex
  }, price && "".concat(price, " ").concat(currency)))), /*#__PURE__*/react.createElement(CartItemControlsContainer, null, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: AriaLabel.REMOVE_ITEM_BUTTON,
    type: HtmlButtonTypes.BUTTON,
    size: "small",
    tabIndex: tabIndex,
    onClick: function onClick() {
      return deleteItemFromCart({
        playerToken: playerToken,
        elementId: elementId
      });
    }
  }, /*#__PURE__*/react.createElement(RemoveItemIcon/* default */.A, null)), quantityProperties.enabled && /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: inputTooltip,
    position: isRtl ? tooltipPosition.TOP_RIGHT : tooltipPosition.TOP_LEFT
  }, /*#__PURE__*/react.createElement(QuantityControls_QuantityControls, {
    isDark: true,
    isRtl: isRtl,
    onBlur: onBlur,
    quantity: quantity,
    saveQuantity: saveQuantity,
    onFocus: saveQuantityOnFocus,
    quantityValue: quantityProperties,
    quantityEnabled: quantityProperties.enabled
  }))));
};
/* harmony default export */ var CartList_CartItem = (CartItem);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartList/CartList.tsx











var CartList = function CartList(_ref) {
  var isRtl = _ref.isRtl,
    playerToken = _ref.playerToken,
    cartProducts = _ref.cartProducts,
    cartItemsOrder = _ref.cartItemsOrder,
    currency = _ref.currency;
  var _useAtom = react_useAtom(hideCartPanelFooterAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    setHideCartPanelFooter = _useAtom2[1];
  var _useAtom3 = react_useAtom(stageSizeAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    stageSize = _useAtom4[0];
  var handleInputFocus = function handleInputFocus() {
    var isLandscapeOrientation = stageSize.height < stageSize.width;
    if (main/* isMobile */.Fr && isLandscapeOrientation) {
      setHideCartPanelFooter(true);
    }
  };
  var itemList = cartItemsOrder.map(function (elementId) {
    return /*#__PURE__*/react.createElement(CartList_CartItem, {
      isRtl: isRtl,
      key: elementId,
      elementId: elementId,
      title: cartProducts[elementId].title,
      price: cartProducts[elementId].price,
      quantity: cartProducts[elementId].quantity,
      quantityProperties: cartProducts[elementId].quantityProperties,
      customizableProductProperties: cartProducts[elementId].customizableProductProperties,
      media: cartProducts[elementId].media,
      playerToken: playerToken,
      currency: currency,
      onQuantityInputFocus: handleInputFocus,
      onQuantityInputBlur: setHideCartPanelFooter
    });
  });
  return /*#__PURE__*/react.createElement("div", null, itemList && itemList.length === 0 ? /*#__PURE__*/react.createElement(CartEmptyStateContainer, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(Paragraph, null, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_list_no_items))) : itemList);
};
/* harmony default export */ var CartList_CartList = (CartList);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartList/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartPanel/CartPanel.tsx























var CartPanel = function CartPanel(_ref) {
  var _ref3, _item$orderPersonaliz, _item$orderPersonaliz2, _item$minimumOrderVal, _item$minimumOrderVal2, _item$orderPersonaliz3, _item$minimumOrderVal3, _item$orderPersonaliz4;
  var closePanel = _ref.closePanel,
    isRtl = _ref.isRtl,
    playerToken = _ref.playerToken;
  var _useAtom = react_useAtom(cartAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    cart = _useAtom2[0];
  var _useAtom3 = react_useAtom(hideCartPanelFooterAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    hideCartPanelFooter = _useAtom4[0];
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    item = _useContext.cart;
  var cartItems = Object.values((cart === null || cart === void 0 ? void 0 : cart.products) || {});
  var totalNrOfItems = getTotalNrOfItems(cartItems);
  var totalSum = getTotalSumPrice(cartItems);
  var currency = item && item.currency || '';
  var _useContext2 = (0,react.useContext)(contexts_ModalContext),
    setOpen = _useContext2.setOpen;
  var hasCartItems = !!cartItems.length;
  var hasTotalSum = !!totalSum;
  var _ref2 = (item === null || item === void 0 ? void 0 : item.orderPersonalization) || {},
    _ref2$whatsAppCheckou = _ref2.whatsAppCheckout,
    whatsAppCheckout = _ref2$whatsAppCheckou === void 0 ? false : _ref2$whatsAppCheckou;
  var sendOrderButton = (_ref3 = (item === null || item === void 0 || (_item$orderPersonaliz = item.orderPersonalization) === null || _item$orderPersonaliz === void 0 ? void 0 : _item$orderPersonaliz.sendOrderButton) || (item === null || item === void 0 || (_item$orderPersonaliz2 = item.orderPersonalization) === null || _item$orderPersonaliz2 === void 0 || (_item$orderPersonaliz2 = _item$orderPersonaliz2.slack) === null || _item$orderPersonaliz2 === void 0 ? void 0 : _item$orderPersonaliz2.enabled)) !== null && _ref3 !== void 0 ? _ref3 : false;
  var showFooterButtons = sendOrderButton || whatsAppCheckout;
  var containerRef = (0,react.useRef)(null);
  var totalTextTranslated = useTranslate(Identifier.l_total);
  var sendOrderTextTranslated = useTranslate(Identifier.l_send_order_button);
  var minimumOrderValueText = useTranslate(Identifier.l_minimum_order_value);
  var pleaseAddMoreItemsText = useTranslate(Identifier.l_please_add_more_items);
  var displayMinimumOrder = (item === null || item === void 0 || (_item$minimumOrderVal = item.minimumOrderValue) === null || _item$minimumOrderVal === void 0 ? void 0 : _item$minimumOrderVal.enabled) && !!(item !== null && item !== void 0 && (_item$minimumOrderVal2 = item.minimumOrderValue) !== null && _item$minimumOrderVal2 !== void 0 && _item$minimumOrderVal2.price) && formatToMaximTwoDecimals(parseFloat(item.minimumOrderValue.price)) > Number(totalSum) || false;
  var paddingCartListFooter = hasTotalSum || displayMinimumOrder || showFooterButtons ? 16 : 8;
  var theme = Ze();
  var footerMarginBottom = hideCartPanelFooter || !hasCartItems ? 0 : getCartPanelFooterMarginBottom(hasTotalSum, sendOrderButton, whatsAppCheckout, displayMinimumOrder, theme.button.default.height);
  var openSendOrderModal = function openSendOrderModal() {
    if (!displayMinimumOrder) {
      setOpen(CART_SEND_ORDER_MODAL_ID);
    }
  };
  var onKeyDownSendOrderHandler = function onKeyDownSendOrderHandler(event) {
    event.preventDefault();
    if (event.code === KeyboardCodes.ENTER) {
      openSendOrderModal();
    }
  };
  var sendOrderButtonText = item !== null && item !== void 0 && (_item$orderPersonaliz3 = item.orderPersonalization) !== null && _item$orderPersonaliz3 !== void 0 && _item$orderPersonaliz3.sendOrderButtonText ? item.orderPersonalization.sendOrderButtonText : sendOrderTextTranslated;
  useTrapFocus(containerRef, [cartItems.length]);
  return /*#__PURE__*/react.createElement(CartPanelContainer, {
    ref: containerRef
  }, /*#__PURE__*/react.createElement(CartPanel_CartPanelHeader, {
    isRtl: isRtl,
    totalNumberOfItems: totalNrOfItems,
    closePanel: closePanel,
    cartProducts: cart.products,
    cartOrder: cart.order,
    orderPersonalization: (item === null || item === void 0 ? void 0 : item.orderPersonalization) || {}
  }), /*#__PURE__*/react.createElement(CartPanelContentContainer, {
    dir: getDirection(isRtl),
    $isRtl: isRtl,
    $marginBottom: footerMarginBottom
  }, /*#__PURE__*/react.createElement(PanelListContent, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(CartList_CartList, {
    isRtl: isRtl,
    playerToken: playerToken,
    cartProducts: (cart === null || cart === void 0 ? void 0 : cart.products) || {},
    cartItemsOrder: (cart === null || cart === void 0 ? void 0 : cart.order) || [],
    currency: currency
  }))), !hideCartPanelFooter && hasCartItems && /*#__PURE__*/react.createElement(CartListFooter, {
    $padding: paddingCartListFooter
  }, hasTotalSum && /*#__PURE__*/react.createElement(CartListFooterTotalPrice, null, /*#__PURE__*/react.createElement(CartPanelTotalCustomFont, {
    tabIndex: TabIndex.DEFAULT
  }, "".concat(totalTextTranslated, ":")), /*#__PURE__*/react.createElement(H2, {
    tabIndex: TabIndex.DEFAULT
  }, "".concat(totalSum, " ").concat(currency))), displayMinimumOrder && /*#__PURE__*/react.createElement(CartListFooterMinimumOrder, {
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(SmallerParagraph, null, minimumOrderValueText, /*#__PURE__*/react.createElement("strong", null, " ", item === null || item === void 0 || (_item$minimumOrderVal3 = item.minimumOrderValue) === null || _item$minimumOrderVal3 === void 0 ? void 0 : _item$minimumOrderVal3.price, " ", currency), "."), /*#__PURE__*/react.createElement(SmallerParagraph, null, pleaseAddMoreItemsText)), showFooterButtons && /*#__PURE__*/react.createElement(CartListFooterButtonContainer, null, whatsAppCheckout && /*#__PURE__*/react.createElement(CartWhatsAppOrder_CartWhatsAppOrder, {
    cart: cart,
    totalSum: totalSum,
    currency: currency,
    orderPersonalization: (_item$orderPersonaliz4 = item === null || item === void 0 ? void 0 : item.orderPersonalization) !== null && _item$orderPersonaliz4 !== void 0 ? _item$orderPersonaliz4 : null,
    playerToken: playerToken,
    disabled: displayMinimumOrder
  }), sendOrderButton && /*#__PURE__*/react.createElement(CartListFooterButton, {
    role: "button",
    tabIndex: TabIndex.DEFAULT,
    "aria-label": sendOrderButtonText,
    onClick: openSendOrderModal,
    onKeyDown: onKeyDownSendOrderHandler,
    $disabled: displayMinimumOrder
  }, sendOrderButtonText))));
};
CartPanel.propTypes = {
  closePanel: (prop_types_default()).func.isRequired,
  isRtl: (prop_types_default()).bool.isRequired,
  playerToken: (prop_types_default()).string.isRequired
};
/* harmony default export */ var CartPanel_CartPanel = (CartPanel);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/CartPanel/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getClickOrTouchPosition.ts

/* harmony default export */ var getClickOrTouchPosition = (function (event) {
  var position = {
    x: 0,
    y: 0
  };
  var isMouseEvent = event instanceof MouseEvent || 'nativeEvent' in event && event.nativeEvent instanceof MouseEvent;
  if (isMouseEvent && 'pageX' in event && 'pageY' in event) {
    position = {
      x: event.pageX,
      y: event.pageY
    };
  } else if (isTouchEvent(event) && 'changedTouches' in event && event.changedTouches[0]) {
    position = {
      x: event.changedTouches[0].pageX,
      y: event.changedTouches[0].pageY
    };
  }
  return position;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Slider/helpers/getPosition.ts
/**
 * Get current position in percent
 *
 * @param start
 * @param width
 * @param current
 * @return number
 */
/* harmony default export */ var getPosition = (function (start, width, current) {
  var realCurrentPosition = current - start;
  var percent = realCurrentPosition * 100 / width;
  return Math.min(Math.max(0, Number(percent.toFixed(2))), 100);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Slider/Slider.styles.ts

var Track = styled_components_browser_esm.div.withConfig({
  displayName: "Sliderstyles__Track",
  componentId: "sc-urgkj0-0"
})(["position:relative;width:100%;height:", "px;padding:0;margin:0;background-color:", ";border-radius:", "px;cursor:pointer;transform:", ";"], function (props) {
  return props.$trackHeight;
}, function (props) {
  return props.$trackBackground;
}, function (props) {
  return props.theme.slider.trackBorderRadius;
}, function (props) {
  return props.$rtl ? 'rotate(180deg)' : 'none';
});
var TrackHitArea = styled_components_browser_esm.div.withConfig({
  displayName: "Sliderstyles__TrackHitArea",
  componentId: "sc-urgkj0-1"
})(["width:100%;margin:0;cursor:pointer;", ""], function (_ref) {
  var isClassicSkin = _ref.isClassicSkin;
  return isClassicSkin ? 'height: 16px; display: flex; align-items: center;' : '';
});
var TrackProgress = styled_components_browser_esm.div.withConfig({
  displayName: "Sliderstyles__TrackProgress",
  componentId: "sc-urgkj0-2"
})(["position:relative;height:", "px;top:0;text-align:right;background-color:", ";border-radius:", "px;"], function (props) {
  return props.$trackProgressHeight;
}, function (props) {
  return props.theme.slider.trackProgressColor;
}, function (props) {
  return props.theme.slider.trackProgressBorderRadius;
});
var Thumb = styled_components_browser_esm.div.withConfig({
  displayName: "Sliderstyles__Thumb",
  componentId: "sc-urgkj0-3"
})(["position:absolute;display:inline-block;width:", "px;height:", "px;background-color:", ";border-radius:", "px;cursor:pointer;right:-", "px;top:-", "px;"], function (props) {
  return props.theme.slider.thumbWidth;
}, function (props) {
  return props.theme.slider.thumbHeight;
}, function (props) {
  return props.theme.slider.thumbColor;
}, function (props) {
  return props.theme.slider.thumbBorderRadius;
}, function (props) {
  return Math.ceil(props.theme.slider.thumbWidth / 2);
}, function (props) {
  return Math.ceil((props.theme.slider.thumbHeight - props.$trackProgressHeight) / 2);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Slider/Slider.tsx





var Slider_Slider_Slider = function Slider(props) {
  var theme = Ze();
  var trackRef = (0,react.useRef)(null);
  var thumbRef = (0,react.useRef)(null);
  var trackHeight = props.isClassicSkin ? theme.slider.classicTrackHeight : theme.slider.trackHeight;
  var trackBackground = props.isClassicSkin ? theme.slider.classicTrackColor : theme.slider.trackColor;
  var trackProgressHeight = props.isClassicSkin ? theme.slider.classicTrackHeight : theme.slider.trackProgressHeight;
  if (props.minValue > props.maxValue) {
    throw Error('Max value must be greater then minValue.');
  }
  if (props.value < props.minValue || props.value > props.maxValue) {
    throw Error('Default value must be between minValue and maxValue');
  }

  // Get nearest value
  var getNearestSnapPosition = function getNearestSnapPosition(value) {
    // Calculate nearest value related to "value"
    // Nearest value is calculated by snapRatio
    var decimal = value - Math.floor(value);

    // If decimals > snapRatio, snap to next step, else snap to previous step
    // Eg: value = 1.32, snapRatio = 0.25 than decimal of value is 0.32. 0.32 > 0.25 => snap to next step
    if (decimal > theme.slider.snapRatio) {
      return Math.ceil(value);
    }
    return Math.floor(value);
  };

  // Get thumb position in percent
  var getThumbPosition = function getThumbPosition(position) {
    if (trackRef && trackRef.current) {
      var _trackRef$current$get = trackRef.current.getBoundingClientRect(),
        trackStart = _trackRef$current$get.x,
        trackWidth = _trackRef$current$get.width;
      return getPosition(trackStart, trackWidth, position);
    }
    return 0;
  };

  // Get value by thumb position
  var getValue = function getValue(thumbPositionPercent) {
    var totalValues = props.maxValue - props.minValue;
    return +(props.minValue + Math.round(totalValues * thumbPositionPercent) / 100).toFixed(1);
  };

  // Get thumb position by value
  var getPositionByValue = function getPositionByValue(value) {
    var totalValues = props.maxValue - props.minValue;
    return Math.round((value - props.minValue) * 100 / totalValues * 100) / 100;
  };
  var setThumbPosition = function setThumbPosition(percent) {
    if (thumbRef && thumbRef.current) {
      var newWidth = !props.rtl ? percent : 100 - percent;
      thumbRef.current.style.width = "".concat(newWidth, "%");
    }
  };
  var handleMove = function handleMove(e) {
    e.preventDefault();
    e.stopImmediatePropagation();
    var newPosition = getThumbPosition(getClickOrTouchPosition(e).x);
    setThumbPosition(newPosition);
    if (props.onMove) {
      props.onMove(getValue(newPosition));
    }
  };
  var _mouseUp = function mouseUp(e) {
    var newPosition = getThumbPosition(getClickOrTouchPosition(e).x);
    var newValue = getValue(newPosition);
    if (props.snap) {
      newValue = getNearestSnapPosition(newValue);
      setThumbPosition(getPositionByValue(newValue));
    }
    if (props.onChange) {
      props.onChange(newValue);
    }
    window.removeEventListener('mouseup', _mouseUp, true);
    window.removeEventListener('mousemove', handleMove);
    window.removeEventListener('touchend', _mouseUp);
    window.removeEventListener('touchmove', handleMove);
  };
  (0,react.useEffect)(function () {
    setThumbPosition(getPositionByValue(props.value));
  }, [props.value, props.rtl]);
  (0,react.useEffect)(function () {
    setThumbPosition(getPositionByValue(props.value));
    return function () {
      window.removeEventListener('mouseup', _mouseUp, true);
      window.removeEventListener('mousemove', handleMove);
      window.removeEventListener('touchend', _mouseUp);
      window.removeEventListener('touchmove', handleMove);
    };
  }, []);
  var startDrag = function startDrag(e) {
    if (!trackRef || !trackRef.current) {
      return;
    }
    var newPosition = getThumbPosition(getClickOrTouchPosition(e).x);
    setThumbPosition(newPosition);
    window.addEventListener('mouseup', _mouseUp, true);
    window.addEventListener('mousemove', handleMove);
    window.addEventListener('touchmove', handleMove, {
      passive: false
    });
    window.addEventListener('touchend', _mouseUp);
  };
  var mouseDown = function mouseDown(e) {
    var isLeftMouseClick = typeof e.button !== 'undefined' && e.button === 0;
    if (isLeftMouseClick) {
      startDrag(e);
    }
  };
  var touchStart = function touchStart(e) {
    startDrag(e);
  };
  return /*#__PURE__*/react.createElement(TrackHitArea, {
    onMouseDown: mouseDown,
    onTouchStart: touchStart,
    isClassicSkin: !!props.isClassicSkin
  }, /*#__PURE__*/react.createElement(Track, {
    id: "slider-track",
    ref: trackRef,
    $rtl: props.rtl || false,
    $trackHeight: trackHeight,
    $trackBackground: trackBackground
  }, /*#__PURE__*/react.createElement(TrackProgress, {
    ref: thumbRef,
    $trackProgressHeight: trackProgressHeight
  }, /*#__PURE__*/react.createElement(Thumb, {
    $trackProgressHeight: trackProgressHeight
  }))));
};
/* harmony default export */ var GeneralComponents_Slider_Slider = (Slider_Slider_Slider);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Slider/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ZoomBar/ZoomBarStyles.tsx

var ZoomSlider = styled_components_browser_esm.div.withConfig({
  displayName: "ZoomBarStyles__ZoomSlider",
  componentId: "sc-p2w9ce-0"
})(["width:", "px;"], function (_ref) {
  var theme = _ref.theme;
  return theme.zoomSlider.width;
});
var ZoomBarStyles_ZoomBar = styled_components_browser_esm.div.withConfig({
  displayName: "ZoomBarStyles__ZoomBar",
  componentId: "sc-p2w9ce-1"
})(["display:flex;align-items:center;cursor:default;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ZoomBar/ZoomBar.tsx


















var ZoomBar = function ZoomBar(props) {
  var theme = Ze();
  var _useAtom = react_useAtom(zoomForComponentsAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    zoomForComponents = _useAtom2[0];
  var _useAtom3 = react_useAtom(closePanelAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 2),
    closePanel = _useAtom4[1];
  var _useAtom5 = react_useAtom(setZoomForComponentsAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 2),
    setZoomForComponents = _useAtom6[1];
  var tooltipPositions = props.isClassicSkin ? tooltipPosition.BOTTOM : tooltipPosition.TOP;
  var setZoomValue = function setZoomValue(value) {
    !props.isClassicSkin && closePanel();
    setZoomForComponents(value);
  };
  var decreaseZoomValue = function decreaseZoomValue() {
    if (zoomForComponents > ZOOM_MIN_VALUE) {
      !props.isClassicSkin && closePanel();
      var newZoom = helpers_getZoomScale(zoomForComponents, ZOOM_MIN_VALUE);
      setZoomForComponents(newZoom);
    }
  };
  var increaseZoomValue = function increaseZoomValue() {
    if (zoomForComponents < ZOOM_MAX_VALUE) {
      !props.isClassicSkin && closePanel();
      var newZoom = helpers_getZoomScale(zoomForComponents, ZOOM_MAX_VALUE);
      setZoomForComponents(newZoom);
    }
  };
  var closeZoomPanel = function closeZoomPanel() {
    if (!props.isClassicSkin) {
      closePanel();
    }
  };
  return /*#__PURE__*/react.createElement(ZoomBarStyles_ZoomBar, {
    role: "presentation",
    onClick: closeZoomPanel
  }, /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: Identifier.l_zoom_out,
    position: tooltipPositions
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: Identifier.accessibility_zoom_out,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    onClick: decreaseZoomValue,
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.MinusIcon, {
    fill: theme.colors.white
  })))), /*#__PURE__*/react.createElement(SliderWrapper, null, /*#__PURE__*/react.createElement(ZoomSlider, null, /*#__PURE__*/react.createElement(GeneralComponents_Slider_Slider, {
    maxValue: ZOOM_MAX_VALUE,
    value: zoomForComponents,
    minValue: ZOOM_MIN_VALUE,
    onChange: setZoomValue,
    onMove: setZoomValue
  }))), /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: Identifier.l_zoom_in,
    position: tooltipPositions
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: Identifier.accessibility_zoom_in,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    onClick: increaseZoomValue,
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, /*#__PURE__*/react.createElement(src.PlusIcon, {
    fill: theme.colors.white
  })))));
};
ZoomBar.propTypes = {
  isClassicSkin: (prop_types_default()).bool
};
/* harmony default export */ var ZoomBar_ZoomBar = (ZoomBar);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ZoomBar/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ZoomBar/ZoomBarPanel.tsx



var ZoomBarPanel = function ZoomBarPanel(props) {
  var panelRef = (0,react.useRef)(null);
  useTrapFocus(panelRef);
  return /*#__PURE__*/react.createElement("div", {
    ref: panelRef
  }, props.children);
};
ZoomBarPanel.propTypes = {
  children: (prop_types_default()).node.isRequired
};
/* harmony default export */ var ZoomBar_ZoomBarPanel = (ZoomBarPanel);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/showPageNumber.ts

/**
 * Return an array with page numbers
 * @returns {number[]} Array of page numbers
 */

/* harmony default export */ var showPageNumber = (function (_ref) {
  var _ref$hasOnlyOnePage = _ref.hasOnlyOnePage,
    hasOnlyOnePage = _ref$hasOnlyOnePage === void 0 ? false : _ref$hasOnlyOnePage,
    contentLayout = _ref.contentLayout,
    stageIndex = _ref.stageIndex,
    _ref$isFirstStage = _ref.isFirstStage,
    isFirstStage = _ref$isFirstStage === void 0 ? false : _ref$isFirstStage,
    _ref$isRtl = _ref.isRtl,
    isRtl = _ref$isRtl === void 0 ? false : _ref$isRtl;
  var selectedPages;
  if (hasOnlyOnePage) {
    if (contentLayout === constants_WidgetLayoutTypes.DOUBLE) {
      selectedPages = [stageIndex * 2 + (isFirstStage ? 1 : 0)];
    } else {
      selectedPages = [stageIndex + 1];
    }
  } else if (isRtl && contentLayout !== constants_WidgetLayoutTypes.DOUBLE) {
    selectedPages = [stageIndex * 2 + 1, stageIndex * 2];
  } else {
    selectedPages = [stageIndex * 2, stageIndex * 2 + 1];
  }
  return selectedPages;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/helpers/getWhatsappLink.ts
/**
 * Returns whatsapp's share link
 * @param link
 * @return string
 */

/* harmony default export */ var getWhatsappLink = (function (link) {
  return "https://api.whatsapp.com/send?text=".concat(encodeURI(link));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/social.ts
var SocialMediaType = {
  facebook: 'facebook',
  twitter: 'twitter',
  pinterest: 'pinterest',
  linkedin: 'linkedin',
  whatsapp: 'whatsapp'
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/ShareButtons/SocialButton.tsx






var SocialButton = function SocialButton(props) {
  var _useContext = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext.sendGAEvent;
  var eventName = "Share with ".concat(props.ariaLabel);
  var handleClick = function handleClick() {
    sendGAEvent(eventName);
    window.open(props.link, '_blank');
  };
  return /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: props.ariaLabel,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    onClick: handleClick,
    disabled: props.disabled,
    autoFocus: props.autoFocus,
    tabIndex: TabIndex.CONTENT
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, props.children));
};
/* harmony default export */ var ShareButtons_SocialButton = (SocialButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/ShareButtons/EmailButton.tsx










var EmailButton = function EmailButton(props) {
  var _useContext = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext.sendGAEvent;
  var body = "Take a look:\r\n\r\n ".concat(props.directLink);
  var openEmailClient = function openEmailClient() {
    var _window;
    sendGAEvent(GAEvents.SHARE_WITH_EMAIL);
    if ((_window = window) !== null && _window !== void 0 && _window.top) {
      window.top.location = "mailto:?Subject=".concat(encodeURIComponent('I found this awesome publication on www.flipsnack.com'), "&body=").concat(encodeURIComponent(body));
    }
  };
  return /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: useTranslate(Identifier.accessibility_share_on_email),
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    onClick: openEmailClient,
    disabled: props.disabled,
    tabIndex: TabIndex.CONTENT
  }, /*#__PURE__*/react.createElement(ControllerBarStyles_Icon, {
    size: IconSize.medium
  }, props.children));
};
EmailButton.propTypes = {
  children: (prop_types_default()).element.isRequired,
  directLink: (prop_types_default()).string.isRequired,
  disabled: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var ShareButtons_EmailButton = (EmailButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/ShareButtons/ShareButtons.tsx










var ShareButtons = function ShareButtons(props) {
  var theme = Ze();
  var buttonColor = !props.disabled ? theme.colors.white : theme.colors.disabled;
  var buttons = {
    facebook: /*#__PURE__*/react.createElement(src.ShareFacebookIcon, {
      fill: buttonColor
    }),
    twitter: /*#__PURE__*/react.createElement(src.ShareTwitterIcon, {
      fill: buttonColor
    }),
    linkedin: /*#__PURE__*/react.createElement(src.ShareLinkedinIcon, {
      fill: buttonColor
    }),
    email: /*#__PURE__*/react.createElement(src.ShareEmailIcon, {
      fill: buttonColor
    }),
    whatsapp: /*#__PURE__*/react.createElement(src.WhatsAppIcon, {
      fill: buttonColor
    })
  };
  var buttonTypes = [{
    name: SocialMediaType.facebook,
    link: props.facebookLink,
    tooltip: 'Facebook',
    ariaLabel: useTranslate(Identifier.accessibility_share_on_facebook)
  }, {
    name: SocialMediaType.twitter,
    link: props.twitterLink,
    tooltip: 'X (formerly Twitter)',
    ariaLabel: useTranslate(Identifier.accessibility_share_on_x)
  }, {
    name: SocialMediaType.whatsapp,
    link: props.whatsappLink,
    tooltip: 'WhatsApp',
    ariaLabel: useTranslate(Identifier.accessibility_share_on_whatsapp)
  }, {
    name: SocialMediaType.linkedin,
    link: props.linkedinLink,
    tooltip: 'LinkedIn',
    ariaLabel: useTranslate(Identifier.accessibility_share_on_linkedin)
  }];
  return /*#__PURE__*/react.createElement(react.Fragment, null, buttonTypes.map(function (button) {
    return /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
      label: button.tooltip,
      key: button.name
    }, /*#__PURE__*/react.createElement(ShareButtons_SocialButton, {
      ariaLabel: button.ariaLabel,
      key: button.name,
      link: button.link,
      disabled: props.disabled,
      autoFocus: button.name === SocialMediaType.facebook
    }, buttons[button.name]));
  }), /*#__PURE__*/react.createElement(ControlsTooltipContainer_ControlsTooltipContainer, {
    label: "Email"
  }, /*#__PURE__*/react.createElement(ShareButtons_EmailButton, {
    directLink: props.directLink,
    disabled: props.disabled
  }, buttons.email)));
};
ShareButtons.propTypes = {
  twitterLink: (prop_types_default()).string.isRequired,
  facebookLink: (prop_types_default()).string.isRequired,
  linkedinLink: (prop_types_default()).string.isRequired,
  whatsappLink: (prop_types_default()).string.isRequired,
  directLink: (prop_types_default()).string.isRequired,
  disabled: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var ShareButtons_ShareButtons = (ShareButtons);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/helpers/getTwitterLink.ts
/**
 * Returns twitter's share link
 * @param link
 * @return string
 */

/* harmony default export */ var getTwitterLink = (function (link) {
  return encodeURI("https://twitter.com/intent/tweet?&text=Check this out:\r\n\r\n".concat(link));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/helpers/getFacebookLink.ts
/**
 * Returns facebook's share link
 * @param link
 * @param title
 * @return string
 */

/* harmony default export */ var getFacebookLink = (function (link, title) {
  return "http://www.facebook.com/sharer.php?u=".concat(encodeURI(link), "&t=").concat(encodeURI(title));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/helpers/getLinkedinLink.ts
/**
 * Returns linkedin's share link
 * @param link
 * @return string
 */

/* harmony default export */ var getLinkedinLink = (function (link) {
  return "https://www.linkedin.com/sharing/share-offsite/?url=".concat(encodeURI(link));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/helpers/copyToClipboard.ts
/**
 * Returns the result of a Promise that can copy a text to the user's clipboard
 * @param {string} text
 * @returns {boolean | Promise<void>}
 */
/* harmony default export */ var copyToClipboard = (function (text) {
  if ('clipboard' in navigator) {
    return navigator.clipboard.writeText(text);
  }
  return document.execCommand('copy', true, text);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/ShareButtons/CopyButton.styles.ts

var CopyButtonContainer = styled_components_browser_esm.div.withConfig({
  displayName: "CopyButtonstyles__CopyButtonContainer",
  componentId: "sc-nkdg4y-0"
})(["", ""], function (_ref) {
  var $disabled = _ref.$disabled;
  return "".concat($disabled ? 'cursor: not-allowed;' : ' cursor: pointer;');
});
var CopyButton_styles_Label = styled_components_browser_esm.div.withConfig({
  displayName: "CopyButtonstyles__Label",
  componentId: "sc-nkdg4y-1"
})(["font-weight:", ";color:", ";padding:", ";"], function (_ref2) {
  var theme = _ref2.theme;
  return theme.typography.weight.bold;
}, function (_ref3) {
  var color = _ref3.color;
  return color;
}, function (_ref4) {
  var padding = _ref4.padding;
  return padding;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/ShareButtons/CopyButton.tsx













var CopyButton = function CopyButton(props) {
  var theme = Ze();
  var _useContext = (0,react.useContext)(StatisticsContext),
    sendGAEvent = _useContext.sendGAEvent;
  var labelColor = props.copied ? theme.colors.primary : "".concat(props.disabled ? theme.colors.disabled : theme.colors.black);
  var copyValue = function copyValue() {
    sendGAEvent(GAEvents.SHARE_WITH_LINK);
    props.setCopied(true);
    copyToClipboard(props.link);
  };
  return /*#__PURE__*/react.createElement(CopyButtonContainer, {
    $disabled: !props.link
  }, /*#__PURE__*/react.createElement(GeneralComponents_Button_Button, {
    startIcon: props.copied ? /*#__PURE__*/react.createElement(src.TickIcon, {
      fill: theme.colors.primary
    }) : /*#__PURE__*/react.createElement(src.CopyLinkIcon, null),
    disabled: props.disabled,
    style: {
      background: theme.colors.white,
      width: 164,
      hoverBackgroundColor: props.copied ? theme.colors.white : theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.6)
    },
    tabIndex: TabIndex.CONTENT,
    onClick: copyValue,
    ariaLabel: useTranslate(Identifier.accessibility_share_copy_link)
  }, /*#__PURE__*/react.createElement(CopyButton_styles_Label, {
    color: labelColor,
    padding: "10px",
    "aria-hidden": true
  }, props.label)));
};
CopyButton.propTypes = {
  link: (prop_types_default()).string.isRequired,
  label: (prop_types_default()).string.isRequired,
  disabled: (prop_types_default()).bool.isRequired,
  copied: (prop_types_default()).bool.isRequired,
  setCopied: (prop_types_default()).func.isRequired
};
/* harmony default export */ var ShareButtons_CopyButton = (CopyButton);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/ShareOptions.styles.ts


var ShareOptionsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ShareOptionsstyles__ShareOptionsContainer",
  componentId: "sc-y1ikew-0"
})(["display:flex;align-items:center;border-radius:inherit;padding:16px;", ""], function (_ref) {
  var $breakPoint = _ref.$breakPoint;
  return $breakPoint ? "\n        width: 100%;\n        flex-direction: column;\n        justify-content: space-around;\n        border-radius: 0;\n    " : "\n        flex-direction: column;\n        justify-content: space-between;\n        width: ".concat(main/* isMobile */.Fr ? '100%;' : '388px', ";\n    ");
});
var ShareOptions_styles_ShareButtons = styled_components_browser_esm.div.withConfig({
  displayName: "ShareOptionsstyles__ShareButtons",
  componentId: "sc-y1ikew-1"
})(["display:flex;width:100%;align-items:center;justify-content:space-between;padding-bottom:8px;"]);
var HorizontalLineContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ShareOptionsstyles__HorizontalLineContainer",
  componentId: "sc-y1ikew-2"
})(["width:100%;"]);
var HorizontalLine = styled_components_browser_esm.hr.withConfig({
  displayName: "ShareOptionsstyles__HorizontalLine",
  componentId: "sc-y1ikew-3"
})(["margin:0;opacity:20%;"]);
var ShareData = styled_components_browser_esm.div.withConfig({
  displayName: "ShareOptionsstyles__ShareData",
  componentId: "sc-y1ikew-4"
})(["display:flex;width:100%;flex-grow:", ";align-items:center;", ""], main/* isMobile */.Fr ? 1 : '', function (_ref2) {
  var $stageWidth = _ref2.$stageWidth;
  return $stageWidth > 385 ? "\n        flex-direction: unset;\n        padding-top: 8px;\n    " : "\n       flex-direction: column;\n       padding-top: 16px;\n    ";
});
var ShareInputContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ShareOptionsstyles__ShareInputContainer",
  componentId: "sc-y1ikew-5"
})(["padding:8px;width:100%;"]);
var ShareInput = styled_components_browser_esm.input.withConfig({
  displayName: "ShareOptionsstyles__ShareInput",
  componentId: "sc-y1ikew-6"
})(["width:100%;color:#fff;height:36px;overflow:hidden;padding:10px 14px;white-space:nowrap;text-overflow:ellipsis;background:transparent;border:1px solid rgba(255,255,255,0.4);font-size:", "px;border-radius:", "px;cursor:", ";", " &::selection{color:none;background:none;}&:focus{outline:none;}"], function (_ref3) {
  var theme = _ref3.theme;
  return theme.typography.size.h5;
}, function (_ref4) {
  var theme = _ref4.theme;
  return theme.defaults.borderRadius;
}, function (_ref5) {
  var $disabled = _ref5.$disabled;
  return $disabled ? 'default' : 'pointer';
}, function (_ref6) {
  var $breakPoint = _ref6.$breakPoint;
  return $breakPoint ? "\n        max-width: 100%;\n        min-width: auto;\n    " : "\n        max-width: ".concat(main/* isMobile */.Fr ? '100%' : '260px', ";\n        min-width: 260px;\n    ");
});
var ShareCopyButton = styled_components_browser_esm.div.withConfig({
  displayName: "ShareOptionsstyles__ShareCopyButton",
  componentId: "sc-y1ikew-7"
})(["cursor:pointer;flex:1;text-align:right;"]);
var CheckBoxLabelSpan = styled_components_browser_esm.label.withConfig({
  displayName: "ShareOptionsstyles__CheckBoxLabelSpan",
  componentId: "sc-y1ikew-8"
})(["font-weight:400;font-size:16px;line-height:24px;"]);
var CheckBoxLabel = styled_components_browser_esm.label.withConfig({
  displayName: "ShareOptionsstyles__CheckBoxLabel",
  componentId: "sc-y1ikew-9"
})(["cursor:pointer;display:flex;align-items:center;margin-left:8px;gap:4px;"]);
var CheckBoxContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ShareOptionsstyles__CheckBoxContainer",
  componentId: "sc-y1ikew-10"
})(["flex:1;text-align:left;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/ShareOptions.tsx

























var COPY_TIMEOUT = 1500;
var ShareOptions = function ShareOptions() {
  var theme = Ze();
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    copied = _useState2[0],
    setCopied = _useState2[1];
  var _useState3 = (0,react.useState)(false),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    fromCurrentPageChecked = _useState4[0],
    setFromCurrentPageChecked = _useState4[1];
  var label = copied ? Identifier.l_copied : Identifier.l_copy_link;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    pages = _useContext.pages,
    isRtl = _useContext.options.content.rtl;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    _useAtom2$ = _useAtom2[0],
    title = _useAtom2$.title,
    domain = _useAtom2$.link.domain,
    visibility = _useAtom2$.visibility;
  var _useAtom3 = react_useAtom(stageSizeWidthAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    stageWidth = _useAtom4[0];
  var directLink = useUrl(urlType_UrlType.SHARE, {
    isPrivate: isSharedWithUsers(visibility)
  });
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var layout = useLayout();
  var stageIndex = isRtl ? pages.order.length - settledStageIndex - 1 : settledStageIndex;
  var breakPoint = stageWidth <= theme.deviceSize.tabletS;
  var hasOnlyOnePage = pages.order[settledStageIndex] && pages.order[settledStageIndex].length === 1;
  var isFirstStage = stageIndex === 0;
  var currentPageCheckBoxId = 'current-page-check-box';
  var selectedPages = showPageNumber({
    hasOnlyOnePage: hasOnlyOnePage,
    contentLayout: layout,
    stageIndex: stageIndex,
    isFirstStage: isFirstStage,
    isRtl: isRtl
  });
  var shareLink = fromCurrentPageChecked ? "".concat(directLink, "?p=").concat(selectedPages[0]) : directLink;
  var containerRef = (0,react.useRef)(null);
  if (copied) {
    setTimeout(function () {
      setCopied(false);
    }, COPY_TIMEOUT);
  }
  var handleSetCurrentPageChecked = function handleSetCurrentPageChecked(e) {
    setFromCurrentPageChecked(e.target.checked);
  };
  useTrapFocus(containerRef);
  return /*#__PURE__*/react.createElement(ShareOptionsContainer, {
    ref: containerRef,
    $stageWidth: stageWidth,
    $breakPoint: breakPoint
  }, /*#__PURE__*/react.createElement(ShareOptions_styles_ShareButtons, {
    $stageWidth: stageWidth,
    $breakPoint: breakPoint
  }, /*#__PURE__*/react.createElement(ShareButtons_ShareButtons, {
    disabled: !domain,
    directLink: shareLink,
    linkedinLink: getLinkedinLink(shareLink),
    twitterLink: getTwitterLink(shareLink),
    facebookLink: getFacebookLink(shareLink, title),
    whatsappLink: getWhatsappLink(shareLink)
  })), /*#__PURE__*/react.createElement(HorizontalLineContainer, null, /*#__PURE__*/react.createElement(HorizontalLine, null)), /*#__PURE__*/react.createElement(ShareData, {
    $breakPoint: breakPoint,
    $stageWidth: stageWidth
  }, /*#__PURE__*/react.createElement(CheckBoxContainer, null, /*#__PURE__*/react.createElement(CheckBoxLabel, null, /*#__PURE__*/react.createElement(components_CheckBox_CheckBox, {
    checked: fromCurrentPageChecked,
    onChange: handleSetCurrentPageChecked,
    ariaLabelIdentifier: Identifier.accessibility_share_from_current_page,
    id: currentPageCheckBoxId
  }), /*#__PURE__*/react.createElement(CheckBoxLabelSpan, {
    htmlFor: currentPageCheckBoxId
  }, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_from_current_pg)))), /*#__PURE__*/react.createElement(ShareCopyButton, null, /*#__PURE__*/react.createElement(ShareButtons_CopyButton, {
    label: useTranslate(label),
    copied: copied,
    disabled: !domain,
    link: shareLink,
    setCopied: setCopied
  }))));
};
/* harmony default export */ var ShareOptions_ShareOptions = (ShareOptions);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ShareOptions/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/SearchInput/SearchInput.styles.tsx




var SearchInputContainer = styled_components_browser_esm.div.withConfig({
  displayName: "SearchInputstyles__SearchInputContainer",
  componentId: "sc-llfdfb-0"
})(["display:flex;justify-content:space-between;", " backdrop-filter:blur(20px);background:", ";right:0;bottom:0;width:100%;"], function (_ref) {
  var $isRtl = _ref.$isRtl;
  return getFlexDirection($isRtl);
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.panel.background;
});
var ClearIconContainer = styled_components_browser_esm.button.attrs(function (props) {
  return {
    'aria-label': props.ariaLabel
  };
}).withConfig({
  displayName: "SearchInputstyles__ClearIconContainer",
  componentId: "sc-llfdfb-1"
})(["position:absolute;border:0;background-color:transparent;padding:8px;cursor:pointer;top:53%;transform:translateY(-50%);", ";"], function (_ref3) {
  var $isRtl = _ref3.$isRtl;
  return $isRtl ? 'left: 10px;' : 'right: 10px;';
});
var InputDiv = styled_components_browser_esm.div.withConfig({
  displayName: "SearchInputstyles__InputDiv",
  componentId: "sc-llfdfb-2"
})(["padding:8px;display:flex;flex:1;position:relative;"]);
var InputElement = styled_components_browser_esm.input.withConfig({
  displayName: "SearchInputstyles__InputElement",
  componentId: "sc-llfdfb-3"
})(["width:100%;color:#fff;height:36px;background:transparent;padding:10px 0;", " ", " font-size:", "px;border:", ";border-radius:", "px;"], function (_ref4) {
  var $isRtl = _ref4.$isRtl;
  return getSpacing(!$isRtl, 36, TypesOfSpacing.PADDING);
}, function (_ref5) {
  var $isRtl = _ref5.$isRtl;
  return getSpacing($isRtl, 14, TypesOfSpacing.PADDING);
}, function (_ref6) {
  var theme = _ref6.theme;
  return theme.typography.size.h5;
}, function (_ref7) {
  var theme = _ref7.theme;
  return "1px solid ".concat(theme.colors.withOpacity(ColorsWithOpacity.WHITE, 0.4));
}, function (_ref8) {
  var theme = _ref8.theme;
  return theme.button.default.borderRadius;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/SearchInput/SearchInput.tsx















var SearchInput_SearchInput = function SearchInput(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    isRtl = _useContext.options.content.rtl;
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    inputHasValue = _useState2[0],
    setInputHasValue = _useState2[1];
  var inputRef = (0,react.useRef)(null);
  var searchRef = (0,react.useRef)({
    keyword: '',
    saveValue: function saveValue(value) {
      props.setActiveKeyword(value);
    },
    debounceSave: (0,lodash.debounce)(function () {
      searchRef.current.saveValue(searchRef.current.keyword);
    }, 300)
  });
  var clearContainerAriaLabel = useTranslate(Identifier.accessibility_clear_search_bar);
  var setInputValue = function setInputValue(e) {
    var _e$target$value = e.target.value,
      value = _e$target$value === void 0 ? '' : _e$target$value;
    searchRef.current.keyword = value;
    if (value.length) {
      if (!inputHasValue) {
        setInputHasValue(true);
      }
    } else {
      setInputHasValue(false);
    }
    if (!main/* isMobile */.Fr) {
      if (value && value.length >= 3) {
        searchRef.current.debounceSave();
      } else {
        searchRef.current.saveValue('');
      }
    }
  };
  (0,react.useEffect)(function () {
    if (inputRef && inputRef.current) {
      inputRef.current.value = props.activeKeyword;
    }
    var onEnterSaveValue = function onEnterSaveValue(e) {
      if (e.key === ENTER) {
        if (searchRef && searchRef.current.keyword.length >= 3) {
          var _inputRef$current;
          searchRef.current.debounceSave();
          inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.blur();
        } else {
          searchRef.current.saveValue('');
        }
      }
    };
    if (main/* isMobile */.Fr) {
      window.addEventListener('keydown', onEnterSaveValue);
    }
    return function () {
      var _inputRef$current2;
      inputRef === null || inputRef === void 0 || (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.blur();
      searchRef.current.debounceSave.cancel();
      window.dispatchEvent(new Event('resize'));
      if (main/* isMobile */.Fr) {
        window.removeEventListener('keydown', onEnterSaveValue);
      }
    };
  }, []);
  var resetInput = function resetInput() {
    if (inputRef !== null && inputRef !== void 0 && inputRef.current) {
      inputRef.current.value = '';
      props.setActiveKeyword('');
      inputRef.current.focus();
    }
    setInputHasValue(false);
  };
  var resetInputByTabNavigation = function resetInputByTabNavigation(event) {
    return event.key === ENTER && resetInput();
  };
  var onInputFocus = function onInputFocus() {
    if (props.hideResults) {
      props.setHideResults(false);
    }
  };
  return /*#__PURE__*/react.createElement(SearchInputContainer, {
    $stageWidth: props.stageWidth,
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(InputDiv, null, /*#__PURE__*/react.createElement(InputElement, {
    id: "inputSearch",
    type: "text",
    spellCheck: "false",
    autoFocus: true,
    ref: inputRef,
    onChange: setInputValue,
    placeholder: "".concat(useTranslate(Identifier.l_search), "..."),
    maxLength: 100,
    onFocus: onInputFocus,
    tabIndex: TabIndex.DEFAULT,
    dir: getDirection(isRtl),
    $isRtl: isRtl
  }), (inputHasValue || !!props.activeKeyword.length) && /*#__PURE__*/react.createElement(ClearIconContainer, {
    ariaLabel: clearContainerAriaLabel,
    onClick: resetInput,
    onKeyDown: resetInputByTabNavigation,
    tabIndex: TabIndex.DEFAULT,
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(src.ClearSearchIcon, null))), /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: AriaLabel.CLOSE_BUTTON,
    type: HtmlButtonTypes.BUTTON,
    size: "medium",
    onClick: props.closePanel,
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(src.CloseIcon, {
    fill: "#fff",
    size: src.IconSizes.MEDIUM
  })));
};
SearchInput_SearchInput.propTypes = {
  closePanel: (prop_types_default()).func.isRequired,
  setActiveKeyword: (prop_types_default()).func.isRequired,
  stageWidth: (prop_types_default()).number.isRequired,
  activeKeyword: (prop_types_default()).string.isRequired
};
/* harmony default export */ var Search_SearchInput_SearchInput = (SearchInput_SearchInput);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/SearchInput/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/SearchPanel/SearchPanelStyles.tsx






var SearchPanelContainer = styled_components_browser_esm.div.withConfig({
  displayName: "SearchPanelStyles__SearchPanelContainer",
  componentId: "sc-17jp71o-0"
})(["max-height:calc(100% - 2px);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow-y:auto;overflow-x:hidden;border-radius:", ";"], function (_ref) {
  var theme = _ref.theme;
  return "".concat(theme.panel.borderRadius, "px");
});
var SearchResultsCurtain = styled_components_browser_esm.div.withConfig({
  displayName: "SearchPanelStyles__SearchResultsCurtain",
  componentId: "sc-17jp71o-1"
})(["background:transparent;position:absolute;top:0;width:100%;border-radius:", ";height:100%;"], function (_ref2) {
  var $stageWidth = _ref2.$stageWidth,
    theme = _ref2.theme;
  return main/* isMobileOnly */.XF || $stageWidth <= theme.deviceSize.mobileL ? '0' : "".concat(theme.defaults.borderRadius, "px");
});
var SearchPanelHeader = styled_components_browser_esm(PanelHeader).withConfig({
  displayName: "SearchPanelStyles__SearchPanelHeader",
  componentId: "sc-17jp71o-2"
})(["background:", ";", ";background:#000;"], function (_ref3) {
  var $emptyList = _ref3.$emptyList,
    theme = _ref3.theme;
  return $emptyList ? theme.colors.black : theme.panel.background;
}, function (_ref4) {
  var theme = _ref4.theme;
  var radius = "".concat(theme.panel.borderRadius, "px");
  return "border-radius: ".concat(radius, " ").concat(radius, " 0 0");
});
var SearchResultsTitle = styled_components_browser_esm.div.withConfig({
  displayName: "SearchPanelStyles__SearchResultsTitle",
  componentId: "sc-17jp71o-3"
})(["height:52px;display:flex;align-items:center;"]);
var SearchPanelList = styled_components_browser_esm(PanelList).withConfig({
  displayName: "SearchPanelStyles__SearchPanelList",
  componentId: "sc-17jp71o-4"
})(["margin-left:0;backdrop-filter:blur(20px);background:", ";margin-top:", ";", " ", ""], function (_ref5) {
  var theme = _ref5.theme;
  return theme.colors.withOpacity(ColorsWithOpacity.BLACK, 0.8);
}, function (_ref6) {
  var theme = _ref6.theme;
  return "".concat(theme.controllerBar.height, "px");
}, function (_ref7) {
  var theme = _ref7.theme,
    $isRtl = _ref7.$isRtl;
  return !$isRtl && "margin-right: ".concat(theme.panel.padding, "px;");
}, function (_ref8) {
  var $isRtl = _ref8.$isRtl;
  return "text-align: ".concat($isRtl ? 'right;' : 'left;');
});
var SearchItemViewText = styled_components_browser_esm(PanelItemViewText).withConfig({
  displayName: "SearchPanelStyles__SearchItemViewText",
  componentId: "sc-17jp71o-5"
})(["", " ", " ", ""], function (_ref9) {
  var $isRtl = _ref9.$isRtl,
    theme = _ref9.theme;
  return $isRtl && getSpacing(!$isRtl, theme.panel.padding, TypesOfSpacing.PADDING);
}, function (_ref10) {
  var $isRtl = _ref10.$isRtl;
  return $isRtl && getSpacing(!$isRtl, 0, TypesOfSpacing.PADDING);
}, function (_ref11) {
  var $isRtl = _ref11.$isRtl;
  return "text-align: ".concat($isRtl ? 'right' : 'left');
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/SearchResult/SearchResultLine.tsx



var SearchResultLine = function SearchResultLine(_ref) {
  var before = _ref.before,
    keyword = _ref.keyword,
    after = _ref.after,
    isRtl = _ref.isRtl;
  return /*#__PURE__*/react.createElement(SearchItemViewText, {
    $isRtl: isRtl,
    "aria-hidden": true
  }, before, /*#__PURE__*/react.createElement("b", null, keyword.toLowerCase()), after);
};
SearchResultLine.propTypes = {
  before: (prop_types_default()).string.isRequired,
  keyword: (prop_types_default()).string.isRequired,
  after: (prop_types_default()).string.isRequired
};
/* harmony default export */ var SearchResult_SearchResultLine = (SearchResultLine);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/SearchResult/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/helpers/formatPagesOrder.ts
/**
 * Returns an array with the pages ordered by a given array
 * @param array
 * @param order
 * @param key
 * @return array
 */

/* harmony default export */ var formatPagesOrder = (function (array, order, key) {
  array.sort(function (a, b) {
    var A = a[key];
    var B = b[key];
    if (order.indexOf(A) > order.indexOf(B)) {
      return 1;
    }
    return -1;
  });
  return array;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/helpers/formatTextsList.ts


/**
 * Return a list with all the custom texts from pages
 * @param pages
 * @param isRtl
 */

/* harmony default export */ var formatTextsList = (function (pages, isRtl) {
  var results = [];
  var orderArray = [];
  var pagesArray = [];
  var uploadedTexts = [];
  pages.order.forEach(function (page) {
    return page.forEach(function (element) {
      return orderArray.push(element);
    });
  });
  if (isRtl) {
    orderArray = orderArray.reverse();
  }
  Object.entries(pages.data).forEach(function (page) {
    pagesArray.push(page[1]);
  });
  var orderedPages = formatPagesOrder(pagesArray, orderArray, 'id');
  orderedPages.forEach(function (entry, index) {
    if (entry.extractedText) {
      uploadedTexts.push({
        text: entry.extractedText,
        pageNumber: index + 1
      });
    }
    entry.elements.reduce(function (accumulator, currentValue) {
      if (currentValue.type === LinkType.TEXT_BOX) {
        var text = '';
        if ('nodes' in currentValue.attributes) {
          currentValue.attributes.nodes.forEach(function (node) {
            text += "".concat(node.text);
          });
        }
        accumulator.push({
          text: text,
          pageNumber: index + 1
        });
      }
      return accumulator;
    }, results);
  });
  return results.concat(uploadedTexts);
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/helpers/getSearchResultsList.ts
/**
 * Returns a formatted list for the search panel
 * @param list
 * @param activeKeyword
 */

var BEFORE_STRING = 10;
var MAX_RESULT_LENGTH = 72;
/* harmony default export */ var getSearchResultsList = (function (list, activeKeyword) {
  var formattedSearchList = [];
  list.reduce(function (accumulator, currentValue) {
    var textToLower = currentValue.text.toLowerCase();
    var keywordToLower = activeKeyword.toLowerCase();
    if (textToLower.includes(keywordToLower)) {
      var splittedText = textToLower.split(keywordToLower);
      splittedText.forEach(function (text, index) {
        if (index + 1 < splittedText.length) {
          var before = splittedText[index];
          var after = splittedText[index + 1];
          if (BEFORE_STRING + activeKeyword.length + after.length >= MAX_RESULT_LENGTH) {
            var resultLength = BEFORE_STRING + activeKeyword.length + after.length;
            var difference = resultLength - MAX_RESULT_LENGTH;
            var limit = resultLength - difference - BEFORE_STRING - activeKeyword.length;
            after = after.substring(0, limit);
          } else {
            after = after.substring(0, after.length);
          }
          formattedSearchList.push({
            before: before.length ? "".concat(before.substring(before.length - BEFORE_STRING)) : '',
            keyword: activeKeyword,
            after: after,
            pageNumber: currentValue.pageNumber,
            identifier: "".concat(currentValue.pageNumber)
          });
        }
      });
    }
    return accumulator;
  }, formattedSearchList);
  return formattedSearchList;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/SearchPanel/SearchPanel.tsx



















var SearchPanel = function SearchPanel(props) {
  var _useContext = (0,react.useContext)(contexts_SearchContext),
    list = _useContext.list,
    setList = _useContext.setList,
    setActiveKeyword = _useContext.setActiveKeyword,
    activeKeyword = _useContext.activeKeyword,
    setInitialResults = _useContext.setInitialResults,
    initialResults = _useContext.initialResults;
  var _useState = (0,react.useState)([]),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    searchList = _useState2[0],
    setSearchList = _useState2[1];
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    pages = _useContext2.pages;
  var nrOfPages = Object.keys(pages.data).length;
  var supplementaryKey = 0;
  var emptyList = searchList.length === 0 && activeKeyword.length === 0;
  var _useContext3 = (0,react.useContext)(contexts_PanelItemContext),
    hideResults = _useContext3.hideResults,
    setHideResults = _useContext3.setHideResults;
  var containerRef = (0,react.useRef)(null);
  var oneResult = searchList.length === 1;
  var resultsLabel = oneResult ? Identifier.l_search_result : Identifier.l_search_results;
  var resultsCount = emptyList ? 'No' : "".concat(searchList.length);
  var resultLabel = "".concat(resultsCount, " ").concat(useTranslate(resultsLabel));
  (0,react.useEffect)(function () {
    if (!list.length && !initialResults) {
      setList(formatTextsList(pages, props.isRtl));
      setInitialResults(true);
    }
  }, []);
  (0,react.useEffect)(function () {
    if (list.length && activeKeyword.length >= 3) {
      var formattedSearchList = getSearchResultsList(list, activeKeyword);
      setSearchList(formattedSearchList);
    } else {
      setSearchList([]);
    }
  }, [activeKeyword]);
  useTrapFocus(containerRef, [resultsCount], 'inputSearch');
  return /*#__PURE__*/react.createElement(SearchPanelContainer, {
    ref: containerRef
  }, !emptyList && /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(SearchResultsCurtain, {
    $stageWidth: props.stageWidth,
    $emptyList: !searchList.length
  }), !hideResults && /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(SearchPanelHeader, {
    $isRtl: props.isRtl,
    $emptyList: !searchList.length
  }, /*#__PURE__*/react.createElement(PanelTitle, {
    $isRtl: props.isRtl
  }, /*#__PURE__*/react.createElement(SearchResultsTitle, {
    "aria-live": "polite"
  }, /*#__PURE__*/react.createElement(H4, null, resultLabel)))), /*#__PURE__*/react.createElement(SearchPanelList, {
    $stageWidth: props.stageWidth,
    $emptyList: !searchList.length,
    $isRtl: props.isRtl,
    dir: getDirection(props.isRtl)
  }, !!searchList.length && /*#__PURE__*/react.createElement(PanelListContent, {
    $isRtl: props.isRtl,
    $customPadding: "8px"
  }, /*#__PURE__*/react.createElement("nav", {
    "aria-label": "Search results"
  }, searchList.map(function (item) {
    supplementaryKey++;
    var ariaLabel = "".concat(item.before + item.keyword.toLowerCase() + item.after, " on page ").concat(item.pageNumber);
    return /*#__PURE__*/react.createElement(PanelItemView_PanelItemView, {
      key: "search-".concat(item.identifier, "-").concat(supplementaryKey),
      pageNumber: getPageNumber(props.isRtl, nrOfPages, item.pageNumber),
      id: "search-".concat(item.identifier, "-").concat(supplementaryKey),
      setHideResults: setHideResults,
      ariaLabel: ariaLabel
    }, /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(SearchResult_SearchResultLine, {
      before: item.before,
      keyword: item.keyword,
      after: item.after,
      isRtl: props.isRtl
    }), /*#__PURE__*/react.createElement("div", {
      "aria-hidden": true
    }, item.pageNumber)));
  })))))), /*#__PURE__*/react.createElement(Search_SearchInput_SearchInput, {
    setActiveKeyword: setActiveKeyword,
    stageWidth: props.stageWidth,
    closePanel: props.closePanel,
    activeKeyword: activeKeyword,
    setHideResults: setHideResults,
    hideResults: hideResults
  }));
};
SearchPanel.propTypes = {
  closePanel: (prop_types_default()).func.isRequired
};
/* harmony default export */ var SearchPanel_SearchPanel = (SearchPanel);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Search/SearchPanel/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Accessibility/AccessibilityPanelBody.tsx





var AccessibilityPanelBody = function AccessibilityPanelBody(_ref) {
  var textZoom = _ref.textZoom,
    pages = _ref.pages;
  return /*#__PURE__*/react.createElement(react.Fragment, null, pages.map(function (page, id) {
    return (
      /*#__PURE__*/
      // eslint-disable-next-line react/no-array-index-key
      react.createElement(react.Fragment, {
        key: id
      }, /*#__PURE__*/react.createElement(H3, {
        tabIndex: TabIndex.DEFAULT,
        style: {
          fontSize: AccessibilityTextSize[textZoom].title.FONT_SIZE,
          letterSpacing: AccessibilityTextSize[textZoom].title.LETTER_SPACING,
          lineHeight: "".concat(AccessibilityTextSize[textZoom].title.LINE_HEIGHT, "px"),
          fontWeight: AccessibilityTextSize[textZoom].title.FONT_WEIGHT,
          marginBottom: 8,
          userSelect: 'text',
          wordBreak: 'break-word'
        }
      }, page.title), /*#__PURE__*/react.createElement(AccessibilityContent, {
        tabIndex: TabIndex.DEFAULT,
        $fontSize: AccessibilityTextSize[textZoom].description.FONT_SIZE,
        $lineHeight: AccessibilityTextSize[textZoom].description.LINE_HEIGHT,
        $letterSpacing: AccessibilityTextSize[textZoom].description.LETTER_SPACING,
        $fontWeight: AccessibilityTextSize[textZoom].description.FONT_WEIGHT
      }, page.description))
    );
  }));
};
/* harmony default export */ var Accessibility_AccessibilityPanelBody = (AccessibilityPanelBody);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Accessibility/AccessibilityPanelFooter.tsx










var AccessibilityPanelFooter = function AccessibilityPanelFooter(_ref) {
  var isRtl = _ref.isRtl,
    totalNoOfPages = _ref.totalNoOfPages;
  var theme = Ze();
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var changeStage = hooks_useChangeStage();
  var stageIndex = isRtl ? totalNoOfPages - settledStageIndex - 1 : settledStageIndex;
  var isFirstStage = stageIndex === 0;
  var isLastStage = stageIndex === totalNoOfPages - 1;
  var nextPageLabel = (0,react.useMemo)(function () {
    return /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.accessibility_next_page);
  }, []);
  var previousPageLabel = (0,react.useMemo)(function () {
    return /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.accessibility_previous_page);
  }, []);
  var onClickNextPage = function onClickNextPage() {
    changeStage(false, AnimationDirection.RIGHT_TO_LEFT);
  };
  var onClickPreviousPage = function onClickPreviousPage() {
    changeStage(false, AnimationDirection.LEFT_TO_RIGHT);
  };
  var ButtonStyle = {
    color: theme.colors.black,
    fontSize: '17',
    height: 52
  };
  var AccessibilityButtonLabelStyle = {
    paddingLeft: 20,
    paddingRight: 20
  };
  return /*#__PURE__*/react.createElement(AccessibilityFooter, null, isRtl ? /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(GeneralComponents_Button_Button, {
    style: ButtonStyle,
    onClick: onClickPreviousPage,
    disabled: isLastStage
  }, /*#__PURE__*/react.createElement(AccessibilityButtonLabel, {
    style: AccessibilityButtonLabelStyle
  }, nextPageLabel)), /*#__PURE__*/react.createElement(GeneralComponents_Button_Button, {
    style: ButtonStyle,
    onClick: onClickNextPage,
    disabled: isFirstStage
  }, /*#__PURE__*/react.createElement(AccessibilityButtonLabel, {
    style: AccessibilityButtonLabelStyle
  }, previousPageLabel))) : /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(GeneralComponents_Button_Button, {
    style: ButtonStyle,
    onClick: onClickPreviousPage,
    disabled: isFirstStage
  }, /*#__PURE__*/react.createElement(AccessibilityButtonLabel, {
    style: AccessibilityButtonLabelStyle
  }, previousPageLabel)), /*#__PURE__*/react.createElement(GeneralComponents_Button_Button, {
    style: ButtonStyle,
    onClick: onClickNextPage,
    disabled: isLastStage
  }, /*#__PURE__*/react.createElement(AccessibilityButtonLabel, {
    style: AccessibilityButtonLabelStyle
  }, nextPageLabel))));
};
/* harmony default export */ var Accessibility_AccessibilityPanelFooter = (AccessibilityPanelFooter);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Accessibility/AccessibilityPanelHeader.tsx











var AccessibilityPanelHeader = function AccessibilityPanelHeader(_ref) {
  var closePanel = _ref.closePanel,
    isRtl = _ref.isRtl;
  var theme = Ze();
  var _useContext = (0,react.useContext)(contexts_AccessibilityContext),
    textZoom = _useContext.textZoom,
    setTextZoom = _useContext.setTextZoom;
  var increaseFontSize = function increaseFontSize() {
    setTextZoom(textZoom + 1);
  };
  var decreaseFontSize = function decreaseFontSize() {
    setTextZoom(textZoom - 1);
  };
  return /*#__PURE__*/react.createElement(AccessibilityHeader, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(AccessibilityTitle, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(H2, {
    tabIndex: TabIndex.DEFAULT
  }, /*#__PURE__*/react.createElement(Translate_Translate, null, Identifier.l_accessibility))), /*#__PURE__*/react.createElement(AccessibilityActions, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(AccessibilityFont, {
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: AriaLabel.DECREASE_FONT_SIZE,
    type: HtmlButtonTypes.BUTTON,
    size: "large",
    onClick: decreaseFontSize,
    disabled: textZoom <= 0,
    autoFocus: true
  }, /*#__PURE__*/react.createElement(AccessibilityButtonLabel, null, /*#__PURE__*/react.createElement(src.DecreaseFontSizeIcon, {
    fill: theme.colors.black,
    size: src.IconSizes.LARGE
  }))), /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: AriaLabel.INCREASE_FONT_SIZE,
    type: HtmlButtonTypes.BUTTON,
    size: "large",
    onClick: increaseFontSize,
    disabled: textZoom >= AccessibilityTextSize.length - 1,
    autoFocus: true
  }, /*#__PURE__*/react.createElement(AccessibilityButtonLabel, null, /*#__PURE__*/react.createElement(src.IncreaseFontSizeIcon, {
    fill: theme.colors.black,
    size: src.IconSizes.LARGE
  })))), /*#__PURE__*/react.createElement(GeneralComponents_IconButton_IconButton, {
    ariaLabel: AriaLabel.CLOSE_BUTTON,
    type: HtmlButtonTypes.BUTTON,
    size: "large",
    onClick: closePanel
  }, /*#__PURE__*/react.createElement(AccessibilityButtonLabel, null, /*#__PURE__*/react.createElement(src.CloseIcon, {
    fill: theme.colors.black,
    size: src.IconSizes.LARGE
  })))));
};
/* harmony default export */ var Accessibility_AccessibilityPanelHeader = (AccessibilityPanelHeader);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Accessibility/AccessibilityPanel.tsx


function AccessibilityPanel_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function AccessibilityPanel_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? AccessibilityPanel_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : AccessibilityPanel_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }



















var AccessibilityPanel_AccessibilityPanel = function AccessibilityPanel(_ref) {
  var closePanel = _ref.closePanel;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var _useContext = (0,react.useContext)(contexts_AccessibilityContext),
    textZoom = _useContext.textZoom;
  var _useContext2 = (0,react.useContext)(contexts_PlayerContext),
    order = _useContext2.pages.order,
    isRtl = _useContext2.options.content.rtl;
  var _useAtom = react_useAtom(propertiesAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    accessibility = _useAtom2[0].accessibility;
  var stageIndex = isRtl ? order.length - settledStageIndex - 1 : settledStageIndex;
  var isFirstStage = stageIndex === 0;
  var hasOnlyOnePage = order[settledStageIndex].length === 1;
  var refScrollingContainer = (0,react.useRef)(null);
  var containerRef = (0,react.useRef)(null);
  var pageTextTranslated = useTranslate(Identifier.l_page);
  var contentLayout = react_useAtomValue(getLayoutAtom);

  // TODO Adaugat size-uri pentru componenta de Button in tema si in componente (small, medium, large)

  var getPageNumber = function getPageNumber() {
    var selectedPages = showPageNumber({
      hasOnlyOnePage: hasOnlyOnePage,
      contentLayout: contentLayout,
      stageIndex: stageIndex,
      isFirstStage: isFirstStage,
      isRtl: isRtl
    });
    if (isRtl) {
      return "".concat(pageTextTranslated, " ").concat(selectedPages.reverse().join(' - '));
    }
    return "".concat(pageTextTranslated, " ").concat(selectedPages.join(' - '));
  };
  var getPages = function getPages() {
    var pages = [];
    for (var i = 0; i < order[settledStageIndex].length; i++) {
      if (accessibility.pages[order[settledStageIndex][i]]) {
        pages.push(AccessibilityPanel_objectSpread({}, accessibility.pages[order[settledStageIndex][i]]));
      }
    }
    if (pages.length) {
      return /*#__PURE__*/react.createElement(Accessibility_AccessibilityPanelBody, {
        textZoom: textZoom,
        pages: isRtl ? pages.reverse() : pages
      });
    }
    return null;
  };
  (0,react.useEffect)(function () {
    var _refScrollingContaine;
    (_refScrollingContaine = refScrollingContainer.current) === null || _refScrollingContaine === void 0 || _refScrollingContaine.scrollTo({
      top: 0,
      behavior: 'smooth'
    });
  }, [settledStageIndex]);
  useTrapFocus(containerRef, [settledStageIndex]);
  return /*#__PURE__*/react.createElement(AccessibilityContainer, {
    ref: containerRef
  }, /*#__PURE__*/react.createElement(Accessibility_AccessibilityPanelHeader, {
    isRtl: isRtl,
    closePanel: closePanel
  }), /*#__PURE__*/react.createElement(AccessibilityContentContainer, {
    dir: getDirection(isRtl),
    ref: refScrollingContainer,
    $isRtl: isRtl
  }, /*#__PURE__*/react.createElement(H3, {
    tabIndex: TabIndex.DEFAULT,
    style: {
      marginBottom: 8,
      fontSize: AccessibilityTextSize[textZoom].pagination.FONT_SIZE,
      lineHeight: "".concat(AccessibilityTextSize[textZoom].pagination.LINE_HEIGHT, "px"),
      fontWeight: AccessibilityTextSize[textZoom].pagination.FONT_WEIGHT
    }
  }, getPageNumber()), getPages()), /*#__PURE__*/react.createElement(Accessibility_AccessibilityPanelFooter, {
    isRtl: isRtl,
    totalNoOfPages: order.length
  }));
};
AccessibilityPanel_AccessibilityPanel.propTypes = {
  closePanel: (prop_types_default()).func.isRequired
};
/* harmony default export */ var Accessibility_AccessibilityPanel = (AccessibilityPanel_AccessibilityPanel);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/Panel.tsx






















var SLIDER_HEIGHT = 8;
var PanelComponent = function PanelComponent() {
  var theme = Ze();
  var panelRef = (0,react.useRef)(null);
  var _useAtom = react_useAtom(panelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    panel = _useAtom2[0],
    setPanel = _useAtom2[1];
  var _useAtom3 = react_useAtom(stageSizeAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    stageSize = _useAtom4[0];
  var _useAtom5 = react_useAtom(hideCartPanelFooterAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    hideCartPanelFooter = _useAtom6[0];
  var _useAtom7 = react_useAtom(propertiesAtom),
    _useAtom8 = slicedToArray_slicedToArray(_useAtom7, 1),
    _useAtom8$ = _useAtom8[0],
    hash = _useAtom8$.hash,
    accountId = _useAtom8$.link.accountId;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options$c = _useContext.options.content,
    isRtl = _useContext$options$c.rtl,
    skinType = _useContext$options$c.skinType;
  var targetedElementOnMouseDown = null;
  var isClassicSkin = skinType === playerTypes_SkinTypes.CLASSIC;
  var panelHeightForClassicSkin = stageSize.height - (2 * theme.controllerBar.height + SLIDER_HEIGHT);
  var panelHeightForModernSkin = stageSize.height - (theme.controllerBar.height + SLIDER_HEIGHT);
  var fadeOutAnimation = function fadeOutAnimation() {
    if (panelRef.current) {
      panelRef.current.style.opacity = '0';
    }
    setTimeout(function () {
      return setPanel('');
    }, ANIMATION_EXECUTION_TIME);
  };
  var closePanel = function closePanel() {
    fadeOutAnimation();
  };
  var handleMouseDown = function handleMouseDown(event) {
    targetedElementOnMouseDown = event.target;
  };
  var handleMouseUp = function handleMouseUp(event) {
    if (event.target instanceof Element && panelRef.current && !panelRef.current.contains(event.target) && panel && panel !== Panel.ACCESSIBILITY && event.target === targetedElementOnMouseDown) {
      fadeOutAnimation();
    }
    targetedElementOnMouseDown = null;
  };
  var panelHeight = isClassicSkin ? panelHeightForClassicSkin : panelHeightForModernSkin;
  var panelPosition = (0,react.useMemo)(function () {
    if (isClassicSkin) {
      return PanelPosition.TOP_CENTER;
    }
    return PanelPosition.BOTTOM_RIGHT;
  }, [isClassicSkin, stageSize.width]);
  switch (panel) {
    case Panel.ACCESSIBILITY:
      {
        return /*#__PURE__*/react.createElement(Panel_styles_Panel, {
          onMouseDown: handleMouseDown,
          onMouseUp: handleMouseUp,
          $height: "".concat(panelHeightForClassicSkin, "px"),
          $panelPosition: PanelPosition.TOP_LEFT
        }, /*#__PURE__*/react.createElement(AccessibilityPanelContent, {
          $stageWidth: stageSize.width,
          $panelPosition: PanelPosition.TOP_LEFT,
          ref: panelRef
        }, /*#__PURE__*/react.createElement(Accessibility_AccessibilityPanel, {
          closePanel: closePanel
        })));
      }
    case Panel.SEARCH:
      {
        return /*#__PURE__*/react.createElement(Panel_styles_Panel, {
          onMouseDown: handleMouseDown,
          onMouseUp: handleMouseUp,
          $height: "".concat(panelHeight, "px"),
          $panelPosition: panelPosition
        }, /*#__PURE__*/react.createElement(SearchPanelContent, {
          ref: panelRef,
          $stageWidth: stageSize.width,
          $transparent: true,
          $panelPosition: panelPosition,
          $skinType: skinType
        }, /*#__PURE__*/react.createElement(PanelListItemProvider_PanelListItemProvider, null, /*#__PURE__*/react.createElement(SearchPanel_SearchPanel, {
          closePanel: closePanel,
          stageWidth: stageSize.width,
          isRtl: isRtl
        }))));
      }
    case Panel.SHARE:
      {
        return /*#__PURE__*/react.createElement(Panel_styles_Panel, {
          onMouseDown: handleMouseDown,
          onMouseUp: handleMouseUp,
          $height: "".concat(panelHeight, "px"),
          $panelPosition: panelPosition
        }, /*#__PURE__*/react.createElement(SharePanelContent, {
          ref: panelRef,
          $stageWidth: stageSize.width,
          $panelPosition: panelPosition,
          $transparent: false
        }, /*#__PURE__*/react.createElement(ShareOptions_ShareOptions, null)));
      }
    case Panel.CART:
      {
        return /*#__PURE__*/react.createElement(Panel_styles_Panel, {
          onMouseDown: handleMouseDown,
          onMouseUp: handleMouseUp,
          $height: "".concat(hideCartPanelFooter ? stageSize.height : panelHeightForClassicSkin, "px"),
          $panelPosition: PanelPosition.TOP_RIGHT
        }, /*#__PURE__*/react.createElement(CartPanelContent, {
          ref: panelRef,
          $stageWidth: stageSize.width,
          $panelPosition: PanelPosition.TOP_RIGHT,
          $transparent: false
        }, /*#__PURE__*/react.createElement(ErrorBoundary_ErrorBoundary, null, /*#__PURE__*/react.createElement(CartPanel_CartPanel, {
          closePanel: closePanel,
          isRtl: isRtl,
          playerToken: getPlayerToken(accountId, hash)
        }))));
      }
    case Panel.ZOOM:
      {
        return /*#__PURE__*/react.createElement(Panel_styles_Panel, {
          onMouseDown: handleMouseDown,
          onMouseUp: handleMouseUp,
          $height: "".concat(panelHeight, "px"),
          $panelPosition: panelPosition
        }, /*#__PURE__*/react.createElement(ZoomPanelContent, {
          ref: panelRef,
          $panelPosition: panelPosition
        }, /*#__PURE__*/react.createElement(ZoomBar_ZoomBarPanel, null, /*#__PURE__*/react.createElement(ZoomBar_ZoomBar, {
          isClassicSkin: isClassicSkin
        }))));
      }
    default:
      return null;
  }
};
/* harmony default export */ var Panel_Panel = (PanelComponent);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/GeneralComponents/Panel/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/PrintComponent/partials/HeaderOrder.tsx


var currentDate = dateFormat(Date.now());
var currentHour = formatAMPM(Date.now());
var replacePlaceholdersWithComponents = function replacePlaceholdersWithComponents(text, replacements) {
  return text.split(/(\{[^}]+})/).map(function (part, index) {
    return /*#__PURE__*/react.createElement(react.Fragment, {
      key: index
    }, replacements[part] || part);
  });
};

// This component displays the text before the table order PDF, containing the flipbook name and date.
var HeaderOrder = function HeaderOrder(props) {
  var CollectionTitle = props.isFlipbookPublished ? /*#__PURE__*/react.createElement("a", {
    className: "title bold",
    href: props.directLink,
    tabIndex: -1
  }, props.collectionTitle) : /*#__PURE__*/react.createElement("span", {
    className: "bold"
  }, props.collectionTitle);
  var CurrentDate = /*#__PURE__*/react.createElement("span", {
    className: "bold"
  }, currentDate);
  var CurrentHour = /*#__PURE__*/react.createElement("span", {
    className: "bold"
  }, currentHour);
  var replacements = {
    '{flipbook_name}': CollectionTitle,
    '{current_date}': CurrentDate,
    '{current_hour}': CurrentHour
  };
  return /*#__PURE__*/react.createElement("div", {
    className: "details"
  }, replacePlaceholdersWithComponents(props.headerText, replacements));
};
/* harmony default export */ var partials_HeaderOrder = (HeaderOrder);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/PrintComponent/PrintComponent.styles.tsx

var PrintPdf = styled_components_browser_esm.div.withConfig({
  displayName: "PrintComponentstyles__PrintPdf",
  componentId: "sc-kebvdh-0"
})(["max-width:1px;max-height:1px;opacity:0;overflow:hidden;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/PrintComponent/partials/PrintLogo.tsx




var PrintLogo = function PrintLogo(_ref) {
  var logo = _ref.logo;
  var _useState = (0,react.useState)(''),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    imgSrc = _useState2[0],
    setImageSrc = _useState2[1];
  var formatExtension = logo.extension ? ".".concat(logo.extension) : '';
  var resourceName = logo.location ? "".concat(logo.data).concat(formatExtension) : logo.data;
  var src = useResourcePath(resourceFolders_ResourceType.LOGO, {
    resourceLocation: ResourcesFolder.library,
    location: (logo === null || logo === void 0 ? void 0 : logo.location) || '',
    resourceName: resourceName,
    isPublic: true
  });
  var fallbackSrc = useResourcePath(resourceFolders_ResourceType.FALLBACK_LOGO, {
    resourceLocation: ResourcesFolder.library,
    location: (logo === null || logo === void 0 ? void 0 : logo.location) || '',
    resourceName: resourceName,
    isPublic: true
  });
  (0,react.useEffect)(function () {
    var currentImg = new Image();
    var setImgSuccess = function setImgSuccess() {
      setImageSrc(src);
    };
    var setImgError = function setImgError() {
      setImageSrc(fallbackSrc);
    };
    currentImg.addEventListener('load', setImgSuccess);
    currentImg.addEventListener('error', setImgError);
    currentImg.src = src;
    return function () {
      currentImg.removeEventListener('load', setImgSuccess);
      currentImg.removeEventListener('error', setImgError);
    };
  }, []);
  return imgSrc ? /*#__PURE__*/react.createElement("div", {
    className: "header-img"
  }, /*#__PURE__*/react.createElement("img", {
    id: "img-logo",
    alt: "img",
    src: imgSrc
  })) : /*#__PURE__*/react.createElement("div", null);
};
/* harmony default export */ var partials_PrintLogo = (PrintLogo);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/PrintComponent/PrintComponent.tsx










var placeholderProductIcon = /*#__PURE__*/react.createElement("svg", {
  xmlns: "http://www.w3.org/2000/svg",
  width: "32",
  height: "32",
  fill: "none"
}, /*#__PURE__*/react.createElement("rect", {
  width: "32",
  height: "32",
  rx: "4",
  fill: "#F7F7F7"
}), /*#__PURE__*/react.createElement("path", {
  d: "M18.12 9L19.95 11H24V23H8V11H12.05L13.88 9H18.12ZM19 7H13L11.17 9H8C6.9 9 6 9.9 6 11V23C6 24.1 6.9 25 8 25H24C25.1 25 26 24.1 26 23V11C26 9.9 25.1 9 24 9H20.83L19 7ZM16 14C17.65 14 19 15.35 19 17C19 18.65 17.65 20 16 20C14.35 20 13 18.65 13 17C13 15.35 14.35 14 16 14ZM16 12C13.24 12 11 14.24 11 17C11 19.76 13.24 22 16 22C18.76 22 21 19.76 21 17C21 14.24 18.76 12 16 12Z",
  fill: "#E8E8E8"
}));
var truncateText = function truncateText(source) {
  return source.length > 76 ? "".concat(source.slice(0, 73), "\u2026") : source;
};
var PrintComponent = function PrintComponent(_ref) {
  var orderPersonalization = _ref.orderPersonalization,
    cartOrder = _ref.cartOrder,
    cartProducts = _ref.cartProducts,
    isFlipbookPublished = _ref.isFlipbookPublished,
    directLink = _ref.directLink,
    collectionTitle = _ref.collectionTitle,
    totalSum = _ref.totalSum,
    currency = _ref.currency,
    accountId = _ref.accountId,
    downloadMode = _ref.downloadMode;
  var textOrder = {
    header: useTranslate(Identifier.orderPdfHeader),
    product: useTranslate(Identifier.orderPdfProduct),
    id: useTranslate(Identifier.orderPdfID),
    price: useTranslate(Identifier.orderPdfPrice),
    amount: useTranslate(Identifier.orderPdfAmount),
    total: useTranslate(Identifier.orderPdfTotal),
    grandTotal: useTranslate(Identifier.orderPdfFooter)
  };
  if (cartOrder !== null && cartOrder !== void 0 && cartOrder.length) {
    var _orderPersonalization;
    var showPrice = totalSum && totalSum !== '0';
    var showID = cartOrder.some(function (item) {
      var _cartProducts$item;
      return !!((_cartProducts$item = cartProducts[item]) !== null && _cartProducts$item !== void 0 && _cartProducts$item.code);
    });
    var extension = downloadMode ? '.jpg' : '_t';
    var someItemHasQuantityOptionsEnabled = cartOrder.some(function (item) {
      var _cartProducts$item2;
      return (_cartProducts$item2 = cartProducts[item]) === null || _cartProducts$item2 === void 0 || (_cartProducts$item2 = _cartProducts$item2.quantityProperties) === null || _cartProducts$item2 === void 0 ? void 0 : _cartProducts$item2.enabled;
    });
    var getProductImage = function getProductImage(firstImg) {
      return getImageResourcePath(accountId, {
        src: firstImg.hash,
        provider: firstImg.provider
      });
    };
    return /*#__PURE__*/react.createElement(PrintPdf, {
      id: "print-pdf"
    }, /*#__PURE__*/react.createElement("div", {
      id: "pdf-content"
    }, /*#__PURE__*/react.createElement("div", {
      id: "header-content"
    }, isFlipbookPublished && orderPersonalization !== null && orderPersonalization !== void 0 && (_orderPersonalization = orderPersonalization.logo) !== null && _orderPersonalization !== void 0 && _orderPersonalization.data ? /*#__PURE__*/react.createElement(partials_PrintLogo, {
      logo: orderPersonalization.logo
    }) : /*#__PURE__*/react.createElement("div", null), orderPersonalization !== null && orderPersonalization !== void 0 && orderPersonalization.header ? /*#__PURE__*/react.createElement("div", {
      className: "header-text"
    }, orderPersonalization.header) : /*#__PURE__*/react.createElement("div", null)), /*#__PURE__*/react.createElement(partials_HeaderOrder, {
      isFlipbookPublished: isFlipbookPublished,
      directLink: directLink,
      collectionTitle: collectionTitle,
      headerText: textOrder.header
    }), /*#__PURE__*/react.createElement("div", {
      className: "products"
    }, /*#__PURE__*/react.createElement("table", {
      className: "table"
    }, /*#__PURE__*/react.createElement("thead", null, /*#__PURE__*/react.createElement("tr", null, /*#__PURE__*/react.createElement("th", {
      className: "product-title"
    }, textOrder.product), showID && /*#__PURE__*/react.createElement("th", {
      className: "product-id"
    }, textOrder.id), showPrice && /*#__PURE__*/react.createElement("th", {
      className: "product-price"
    }, textOrder.price), someItemHasQuantityOptionsEnabled && /*#__PURE__*/react.createElement("th", {
      className: "product-amount"
    }, textOrder.amount), showPrice && /*#__PURE__*/react.createElement("th", {
      className: "product-total"
    }, textOrder.total))), /*#__PURE__*/react.createElement("tbody", {
      className: "body-row"
    }, cartOrder.map(function (item) {
      var _cartProducts$item$cu, _cartProducts$item3, _cartProducts$item$qu, _cartProducts$item4;
      var displaySku = getDisplaySku(cartProducts[item].code, cartProducts[item].variantSku);
      return /*#__PURE__*/react.createElement("tr", {
        className: "product-item",
        key: esm_browser_v4()
      }, /*#__PURE__*/react.createElement("td", {
        className: "product-title"
      }, /*#__PURE__*/react.createElement("div", {
        className: "product-title-container"
      }, /*#__PURE__*/react.createElement("div", {
        className: "product-image-container"
      }, cartProducts[item].media && cartProducts[item].media[0] ? /*#__PURE__*/react.createElement("img", {
        className: "product-image",
        alt: "product",
        src: getProductImage(cartProducts[item].media[0]) + extension
      }) : placeholderProductIcon), /*#__PURE__*/react.createElement("div", {
        className: "product-title-info"
      }, cartProducts[item].websiteUrl ? /*#__PURE__*/react.createElement("a", {
        href: cartProducts[item].websiteUrl,
        className: "td-text title-link",
        target: "_blank",
        rel: "noopener noreferrer",
        tabIndex: -1
      }, cartProducts[item].title || '') : /*#__PURE__*/react.createElement("div", {
        className: "td-text"
      }, cartProducts[item].title || ''), ((_cartProducts$item$cu = cartProducts[item].customizableProductProperties) === null || _cartProducts$item$cu === void 0 ? void 0 : _cartProducts$item$cu.value) && /*#__PURE__*/react.createElement("div", {
        className: "td-text customizable-product"
      }, /*#__PURE__*/react.createElement("div", {
        className: "bold"
      }, cartProducts[item].customizableProductProperties.label, ":"), /*#__PURE__*/react.createElement("div", null, cartProducts[item].customizableProductProperties.value))))), showID && /*#__PURE__*/react.createElement("td", {
        className: "product-id"
      }, /*#__PURE__*/react.createElement("div", {
        className: "td-text"
      }, truncateText(displaySku))), showPrice && /*#__PURE__*/react.createElement("td", {
        className: "product-price"
      }, /*#__PURE__*/react.createElement("div", {
        className: "td-text"
      }, cartProducts[item].price ? truncateText(String(cartProducts[item].price)) : '')), someItemHasQuantityOptionsEnabled && /*#__PURE__*/react.createElement("td", {
        className: "product-amount"
      }, /*#__PURE__*/react.createElement("div", {
        className: "td-text"
      }, (_cartProducts$item3 = cartProducts[item]) !== null && _cartProducts$item3 !== void 0 && (_cartProducts$item3 = _cartProducts$item3.quantityProperties) !== null && _cartProducts$item3 !== void 0 && _cartProducts$item3.enabled ? truncateText(String(cartProducts[item].quantity) || '') : '')), showPrice && /*#__PURE__*/react.createElement("td", {
        className: "product-total"
      }, /*#__PURE__*/react.createElement("div", {
        className: "td-text"
      }, cartProducts[item].price ? formatToMaximTwoDecimals(+cartProducts[item].price * +((_cartProducts$item$qu = (_cartProducts$item4 = cartProducts[item]) === null || _cartProducts$item4 === void 0 ? void 0 : _cartProducts$item4.quantity) !== null && _cartProducts$item$qu !== void 0 ? _cartProducts$item$qu : 0)) : '')));
    }))), /*#__PURE__*/react.createElement("div", {
      className: "divider"
    }), showPrice && /*#__PURE__*/react.createElement("div", {
      className: "total"
    }, /*#__PURE__*/react.createElement("div", null, textOrder.grandTotal), /*#__PURE__*/react.createElement("div", null, totalSum, " ", currency)), (orderPersonalization === null || orderPersonalization === void 0 ? void 0 : orderPersonalization.footer) && /*#__PURE__*/react.createElement("div", {
      className: "footer"
    }, orderPersonalization.footer))));
  }
  return null;
};
/* harmony default export */ var PrintComponent_PrintComponent = (PrintComponent);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/Cart/PrintComponent/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PrintOrderContainer/PrintOrderContainer.tsx












var PrintOrderContainer = function PrintOrderContainer() {
  var _useAtom = react_useAtom(cartAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    cart = _useAtom2[0];
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    item = _useContext.cart;
  var _useAtom3 = react_useAtom(propertiesAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    _useAtom4$ = _useAtom4[0],
    title = _useAtom4$.title,
    visibility = _useAtom4$.visibility,
    status = _useAtom4$.status,
    accountId = _useAtom4$.link.accountId;
  var _useAtom5 = react_useAtom(rootPrimitivesAtom),
    _useAtom6 = slicedToArray_slicedToArray(_useAtom5, 1),
    downloadMode = _useAtom6[0].downloadMode;
  var cartItems = Object.values((cart === null || cart === void 0 ? void 0 : cart.products) || {});
  var totalSum = getTotalSumPrice(cartItems);
  var currency = item && item.currency || '';
  var directLink = useUrl(urlType_UrlType.SHARE, {
    isPrivate: isSharedWithUsers(visibility)
  });
  return /*#__PURE__*/react.createElement(PrintComponent_PrintComponent, {
    totalSum: totalSum,
    currency: currency,
    directLink: directLink,
    collectionTitle: title,
    status: status,
    cartProducts: cart.products,
    cartOrder: cart.order,
    orderPersonalization: item === null || item === void 0 ? void 0 : item.orderPersonalization,
    isFlipbookPublished: status === FlipbookStatus.PUBLISHED.toLowerCase(),
    accountId: accountId,
    downloadMode: downloadMode
  });
};
/* harmony default export */ var PrintOrderContainer_PrintOrderContainer = (PrintOrderContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarButtons/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/isSmallDisplay.ts


/**
 * @param {number} width
 */
/* harmony default export */ var isSmallDisplay = (function (width) {
  var theme = Ze();
  return width <= theme.deviceSize.tabletXL;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/PageNumbersLabel/PageNumbers.styles.tsx


var PageNumber = styled_components_browser_esm.div.withConfig({
  displayName: "PageNumbersstyles__PageNumber",
  componentId: "sc-xg3u78-0"
})(["font-family:", ";font-size:", "px;font-weight:", ";", " cursor:default;text-shadow:0 0 2px rgb(0 0 0 / 50%);"], function (_ref) {
  var theme = _ref.theme;
  return theme.typography.family.sans;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.typography.size.smallerParagraph;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.typography.weight.bold;
}, function (_ref4) {
  var $skinType = _ref4.$skinType,
    theme = _ref4.theme;
  return $skinType === playerTypes_SkinTypes.MODERN ? '' : "min-width: ".concat(theme.pageNumber.minWidth, "px;");
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/PageNumbersLabel/index.tsx











var PageNumbersLabel = function PageNumbersLabel() {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    pages = _useContext.pages,
    _useContext$options$c = _useContext.options.content,
    isRtl = _useContext$options$c.rtl,
    skinType = _useContext$options$c.skinType;
  var totalPages = (0,react.useMemo)(function () {
    return Object.keys(pages.data).length;
  }, []);
  var _useAtom = react_useAtom(closePanelAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 2),
    closePanel = _useAtom2[1];
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var layout = useLayout();
  var stageIndex = isRtl ? pages.order.length - settledStageIndex - 1 : settledStageIndex;
  var hasOnlyOnePage = pages.order[settledStageIndex] && pages.order[settledStageIndex].length === 1;
  var isFirstStage = stageIndex === 0;
  var selectedPages = showPageNumber({
    hasOnlyOnePage: hasOnlyOnePage,
    contentLayout: layout,
    stageIndex: stageIndex,
    isFirstStage: isFirstStage,
    isRtl: isRtl
  });
  var getPageNumbersLabel = isRtl ? "".concat(totalPages, " / ").concat(selectedPages.reverse().join(' - ')) : "".concat(selectedPages.join(' - '), " / ").concat(totalPages);
  var ariaLabel = '';
  if (layout === constants_WidgetLayoutTypes.SINGLE) {
    ariaLabel = "Page ".concat(selectedPages[0], " of ").concat(totalPages);
  } else if (layout === constants_WidgetLayoutTypes.DOUBLE) {
    if (selectedPages.length === 1) {
      ariaLabel = "Page ".concat(selectedPages[0], " of ").concat(totalPages);
    } else {
      ariaLabel = "Page ".concat(selectedPages[0], " and ").concat(selectedPages[1], " of ").concat(totalPages);
    }
  }
  return /*#__PURE__*/react.createElement(PageNumber, {
    role: "img",
    onClick: closePanel,
    tabIndex: TabIndex.DEFAULT,
    "aria-label": ariaLabel,
    $skinType: skinType
  }, getPageNumbersLabel);
};
/* harmony default export */ var ControllerBar_PageNumbersLabel = (PageNumbersLabel);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarContent.tsx











var ControllerBarContent = function ControllerBarContent(props) {
  var theme = Ze();
  var _useAtom = react_useAtom(stageSizeWidthAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    width = _useAtom2[0];
  var isTabletS = width <= theme.deviceSize.tabletS;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options$b = _useContext.options.backgroundAudio,
    isBackgroundAudioEnabled = _useContext$options$b.enabled,
    src = _useContext$options$b.src;
  var _useAtom3 = react_useAtom(featuresAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    features = _useAtom4[0];
  return /*#__PURE__*/react.createElement(ControllerBar, {
    $isTabletS: isTabletS
  }, /*#__PURE__*/react.createElement(PageNumberingAndBackgroundAudio, null, /*#__PURE__*/react.createElement(PageNumberWrapper, {
    $isTabletS: isTabletS
  }, /*#__PURE__*/react.createElement(ControllerBar_PageNumbersLabel, null)), features.AUDIO_BACKGROUND && isBackgroundAudioEnabled && src && !isTabletS && /*#__PURE__*/react.createElement(BackgroundAudioButton, null)), /*#__PURE__*/react.createElement(ControlsContainer, {
    $isTabletS: isTabletS
  }, props.children));
};
ControllerBarContent.propTypes = {
  children: (prop_types_default()).element.isRequired
};
/* harmony default export */ var ControllerBar_ControllerBarContent = (ControllerBarContent);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBar.tsx








var ControllerBar_ControllerBar = function ControllerBar() {
  var stageWidth = react_useAtomValue(stageSizeWidthAtom);
  return /*#__PURE__*/react.createElement(ControllerBar_ControllerBarContent, null, /*#__PURE__*/react.createElement(react.Fragment, null, !isSmallDisplay(stageWidth) && /*#__PURE__*/react.createElement(ErrorBoundary_ErrorBoundary, null, /*#__PURE__*/react.createElement(ZoomBar_ZoomBar, null)), /*#__PURE__*/react.createElement(ControllerBarButtons, null)));
};
/* harmony default export */ var components_ControllerBar_ControllerBar = (ControllerBar_ControllerBar);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarBottom/ControllerBarBottomStyles.tsx

var ControllerBarBottomStyles_ControllerBarBottom = styled_components_browser_esm.div.withConfig({
  displayName: "ControllerBarBottomStyles__ControllerBarBottom",
  componentId: "sc-7zh1ab-0"
})(["bottom:0;width:100%;display:flex;padding:0 18px;user-select:none;position:absolute;align-items:center;background:transparent;justify-content:space-between;transition:opacity 200ms ease-in-out;color:", ";height:", "px;opacity:", ";pointer-events:", ";&:hover{opacity:1;pointer-events:all;}&:before{content:\"\";height:", "px;width:100%;background:linear-gradient(0deg,rgba(0,0,0,0.5) 0%,rgba(0,0,0,0.495676) 6.67%,rgba(0,0,0,0.482245) 13.33%,rgba(0,0,0,0.45917) 20%,rgba(0,0,0,0.426294) 26.67%,rgba(0,0,0,0.384113) 33.33%,rgba(0,0,0,0.334058) 40%,rgba(0,0,0,0.278654) 46.67%,rgba(0,0,0,0.221346) 53.33%,rgba(0,0,0,0.165942) 60%,rgba(0,0,0,0.115887) 66.67%,rgba(0,0,0,0.0737057) 73.33%,rgba(0,0,0,0.0408299) 80%,rgba(0,0,0,0.017755) 86.67%,rgba(0,0,0,0.0043236) 93.33%,rgba(0,0,0,0) 100%);position:absolute;bottom:0;right:0;pointer-events:none;}"], function (_ref) {
  var theme = _ref.theme;
  return theme.controllerBar.color;
}, function (_ref2) {
  var theme = _ref2.theme;
  return theme.controllerBar.height;
}, function (props) {
  return props.$visible ? '1' : '0';
}, function (props) {
  return props.$visible ? 'all' : 'none';
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.controllerBar.shadowHeight;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ShallowContainer/ShallowDiv.tsx






var ShallowDiv = function ShallowDiv(_ref) {
  var minWidth = _ref.minWidth;
  var theme = Ze();
  var _useAtom = react_useAtom(stageSizeWidthAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    stageWidth = _useAtom2[0];
  if (stageWidth <= theme.deviceSize.tabletS) {
    return null;
  }
  return /*#__PURE__*/react.createElement(ControllerBarStyles_ShallowDiv, {
    role: "presentation",
    minWidth: minWidth
  });
};
/* harmony default export */ var ShallowContainer_ShallowDiv = (ShallowDiv);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ShallowContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/SliderController/SliderController.tsx










/* harmony default export */ var SliderController = (function () {
  var PlayerProvider = (0,react.useContext)(contexts_PlayerContext);
  var pages = PlayerProvider.pages,
    _PlayerProvider$optio = PlayerProvider.options.content,
    rtl = _PlayerProvider$optio.rtl,
    skinType = _PlayerProvider$optio.skinType;
  var _useContext = (0,react.useContext)(contexts_ActiveStageIndexContext),
    setActiveStageIndex = _useContext.setActiveStageIndex;
  var settledStageIndex = react_useAtomValue(getSettledActiveStageIndexAtom);
  var setActiveMandatoryModal = react_useSetAtom(setActiveMandatoryModalAtom);
  var indexOfFirstMandatoryAction = useFirstMandatoryStageIndex();
  var sliderMaxValue = pages.order.length - 1;
  var sliderValue = Math.min(sliderMaxValue, settledStageIndex);
  var onSliderChange = function onSliderChange(newStageIndex) {
    // If there is a mandatory action in the way, set the thumb to the stage with mandatory action
    if (indexOfFirstMandatoryAction != null && (!rtl && newStageIndex > indexOfFirstMandatoryAction || rtl && newStageIndex < indexOfFirstMandatoryAction)) {
      setActiveStageIndex(indexOfFirstMandatoryAction);
      setActiveMandatoryModal(true);
    } else {
      setActiveStageIndex(newStageIndex);
    }
  };
  return /*#__PURE__*/react.createElement(ErrorBoundary_ErrorBoundary, null, /*#__PURE__*/react.createElement(GeneralComponents_Slider_Slider, {
    onChange: onSliderChange,
    minValue: 0,
    maxValue: sliderMaxValue,
    value: sliderValue,
    snap: true,
    rtl: rtl,
    isClassicSkin: skinType === playerTypes_SkinTypes.CLASSIC
  }));
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarBottom/ControllerBarBottom.tsx














var ControllerBarBottom = function ControllerBarBottom() {
  var theme = Ze();
  var numberOfPagesWidth = theme.pageNumber.minWidth + theme.controllerBar.container.paddingLeft * 2;
  var _useAtom = react_useAtom(controllerBarVisibleAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    isVisible = _useAtom2[0];
  var _useAtom3 = react_useAtom(stageSizeWidthAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    width = _useAtom4[0];
  var rightSideWidth = width > theme.deviceSize.tabletL ? numberOfPagesWidth : numberOfPagesWidth / 3;
  var isTabletS = width ? width <= theme.deviceSize.tabletS : false;
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    effect = _useContext.options.content.effect;
  return /*#__PURE__*/react.createElement(ControllerBarBottomStyles_ControllerBarBottom, {
    $visible: isVisible
  }, /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ControllerBarWrapper_ControllerBarWrapper, null), /*#__PURE__*/react.createElement(PageNumberWrapper, {
    $isTabletS: isTabletS,
    $isClassicSkin: true
  }, /*#__PURE__*/react.createElement(ControllerBar_PageNumbersLabel, null)), effect !== playerTypes_PlayerEffect.SCROLL && /*#__PURE__*/react.createElement(ThumbSliderContainer, null, /*#__PURE__*/react.createElement(ThumbSlider, null, /*#__PURE__*/react.createElement(SliderController, null))), /*#__PURE__*/react.createElement(ShallowContainer_ShallowDiv, {
    minWidth: rightSideWidth
  })));
};
/* harmony default export */ var ControllerBarBottom_ControllerBarBottom = (ControllerBarBottom);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/ControllerBarBottom/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/SliderController/index.ts

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/NavigationBar/NavigationBar.tsx





var NavigationBar = function NavigationBar(_ref) {
  var children = _ref.children;
  var _useAtom = react_useAtom(controllerBarVisibleAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    isVisible = _useAtom2[0];
  return /*#__PURE__*/react.createElement(ControllerBarStyles_NavigationBar, {
    $visible: isVisible
  }, children);
};
/* harmony default export */ var NavigationBar_NavigationBar = (NavigationBar);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ControllerBar/NavigationBar/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/NavigationBarContainer/index.tsx

















var NavigationBarContainer = function NavigationBarContainer() {
  var theme = Ze();
  var _useAtom = react_useAtom(stageSizeWidthAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    width = _useAtom2[0];
  var _useAtom3 = react_useAtom(hideCartPanelFooterAtom),
    _useAtom4 = slicedToArray_slicedToArray(_useAtom3, 1),
    hideCartPanelFooter = _useAtom4[0];
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options = _useContext.options,
    _useContext$options$c = _useContext$options.controls,
    showControls = _useContext$options$c.showControls,
    slider = _useContext$options$c.slider,
    _useContext$options$c2 = _useContext$options.content,
    skinType = _useContext$options$c2.skinType,
    effect = _useContext$options$c2.effect;
  var _useContext2 = (0,react.useContext)(contexts_FullscreenContext),
    isFullscreen = _useContext2.isFullscreen;
  var _useFullscreenUrl = useFullscreenUrl(),
    fullscreenUrlInterface = _useFullscreenUrl.fullscreenUrlInterface;
  var isFullscreenUrl = function isFullscreenUrl() {
    var iframeUrl = new URL(window.top.location.href);
    return iframeUrl.origin === fullscreenUrlInterface.origin;
  };

  // We display controls bar only if it`s enabled or if we are in full screen or IOS cdn link
  if (width && showControls && !hideCartPanelFooter || isFullscreen || !utils_isInIframe() && isFullscreenUrl()) {
    if (skinType === playerTypes_SkinTypes.MODERN) {
      return /*#__PURE__*/react.createElement(NavigationBar_NavigationBar, null, effect !== playerTypes_PlayerEffect.SCROLL && /*#__PURE__*/react.createElement(ThumbSliderContainer, null, /*#__PURE__*/react.createElement(ThumbSlider, {
        $height: theme.slider.trackHeight
      }, slider && /*#__PURE__*/react.createElement(SliderController, null))), /*#__PURE__*/react.createElement(components_ControllerBar_ControllerBar, null));
    }
    if (slider) {
      return /*#__PURE__*/react.createElement(ControllerBarBottom_ControllerBarBottom, null);
    }
  }
  return null;
};
/* harmony default export */ var components_NavigationBarContainer = (NavigationBarContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/backgroundTypes.ts
var backgroundTypes_BackgroundTypes = {
  COLOR: 'color',
  IMAGE: 'image'
};
var backgroundTypes_BackgroundScaleTypes = {
  SCALE_CROP: 'scaleCrop',
  CENTER: 'center',
  TILE: 'tile'
};
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getBackgroundColor.ts


/**
 * Return background color
 *
 * @param background
 * @return string
 */
/* harmony default export */ var utils_getBackgroundColor = (function (background) {
  return background.type === constants_BackgroundTypes.COLOR && background.opacity !== 0 ? background.color : 'transparent';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/utils/getBackgroundCss.ts

function getBackgroundCss_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function getBackgroundCss_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? getBackgroundCss_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : getBackgroundCss_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





/* harmony default export */ var utils_getBackgroundCss = (function (_ref) {
  var $background = _ref.$background;
  switch ($background.type) {
    case constants_BackgroundTypes.IMAGE:
      {
        var bgImgUrl = useResourcePath(resourceFolders_ResourceType.BACKGROUND, {
          backgroundImage: $background.src
        });
        var css = {
          backgroundImage: "url('".concat(bgImgUrl, "?v=1')")
        };
        switch ($background.scale) {
          case backgroundTypes_BackgroundScaleTypes.SCALE_CROP:
            css = getBackgroundCss_objectSpread(getBackgroundCss_objectSpread({}, css), {}, {
              backgroundSize: 'cover',
              backgroundPosition: 'center center'
            });
            return css;
          case backgroundTypes_BackgroundScaleTypes.CENTER:
            css = getBackgroundCss_objectSpread(getBackgroundCss_objectSpread({}, css), {}, {
              backgroundRepeat: 'no-repeat',
              backgroundPosition: 'center'
            });
            return css;
          default:
            return css;
        }
      }
    default:
      return {
        background: utils_getBackgroundColor($background)
      };
  }
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PlayerContainer/PlayerContainer.styles.tsx



var BackgroundCss = Ce(["", ""], function (PlayerContainerProps) {
  return utils_getBackgroundCss(PlayerContainerProps);
});
var PlayerContainer = styled_components_browser_esm.main.withConfig({
  displayName: "PlayerContainerstyles__PlayerContainer",
  componentId: "sc-htdim7-0"
})(["width:100%;height:", ";overflow:hidden;text-align:initial;position:relative;", " ", ";"], function (_ref) {
  var hasWatermarkBar = _ref.hasWatermarkBar;
  return hasWatermarkBar ? "calc(100% - ".concat(WATERMARK_BAR_HEIGHT, "px)") : '100%';
}, BackgroundCss, function (_ref2) {
  var showClassicSkinShadowInHeader = _ref2.showClassicSkinShadowInHeader,
    isControlBarVisible = _ref2.isControlBarVisible,
    theme = _ref2.theme;
  return showClassicSkinShadowInHeader && "\n        z-index: 4;\n\n        &:before {\n            content: \"\";\n            position: absolute;\n            width: 100%;\n            height: ".concat(theme.controllerBar.shadowHeight, "px;\n            left: 0;\n            top: 0;\n            background: linear-gradient(180deg,\n                rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.495676) 6.67%, rgba(0, 0, 0, 0.482245) 13.33%,\n                rgba(0, 0, 0, 0.45917) 20%, rgba(0, 0, 0, 0.426294) 26.67%, rgba(0, 0, 0, 0.384113) 33.33%,\n                rgba(0, 0, 0, 0.334058) 40%, rgba(0, 0, 0, 0.278654) 46.67%, rgba(0, 0, 0, 0.221346) 53.33%,\n                rgba(0, 0, 0, 0.165942) 60%, rgba(0, 0, 0, 0.115887) 66.67%, rgba(0, 0, 0, 0.0737057) 73.33%,\n                rgba(0, 0, 0, 0.0408299) 80%, rgba(0, 0, 0, 0.017755) 86.67%, rgba(0, 0, 0, 0.0043236) 93.33%,\n                rgba(0, 0, 0, 0) 100%);\n            transition: opacity 200ms ease-in-out;\n            opacity: ").concat(isControlBarVisible ? '1' : '0', ";\n            pointer-events: none;\n        };\n\n        &:hover {\n            &:before {\n                opacity: 1;\n            }\n        }\n    ");
});
var PasswordPlayerModalWrapper = styled_components_browser_esm.div.withConfig({
  displayName: "PlayerContainerstyles__PasswordPlayerModalWrapper",
  componentId: "sc-htdim7-1"
})(["position:relative;width:100%;height:100%;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/BackgroundContainer/BackgroundContainer.tsx








var BackgroundContainer_BackgroundContainer_BackgroundContainer = function BackgroundContainer(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    _useContext$options = _useContext.options,
    skinType = _useContext$options.content.skinType,
    showControls = _useContext$options.controls.showControls,
    background = _useContext$options.background;
  var _useContext2 = (0,react.useContext)(contexts_FullscreenContext),
    isFullscreen = _useContext2.isFullscreen;
  var showClassicSkinShadowInHeader = skinType === SkinTypes.CLASSIC && (showControls || !showControls && isFullscreen) && window.innerWidth >= DeviceSize.tabletS;
  var isControlBarVisible = react_useAtomValue(controllerBarVisibleAtom);
  return /*#__PURE__*/react.createElement(PlayerContainer, {
    tabIndex: TabIndex.UNREACHABLE,
    $background: background,
    hasWatermarkBar: props.hasWatermarkBar,
    showClassicSkinShadowInHeader: showClassicSkinShadowInHeader,
    isControlBarVisible: isControlBarVisible
  }, props.children);
};
/* harmony default export */ var components_BackgroundContainer_BackgroundContainer = (BackgroundContainer_BackgroundContainer_BackgroundContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/BackgroundContainer/index.tsx

;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PlayerLayout/PlayerLayout.styles.tsx

var PlayerLayoutContainer = styled_components_browser_esm.div.withConfig({
  displayName: "PlayerLayoutstyles__PlayerLayoutContainer",
  componentId: "sc-1iwtsw9-0"
})(["display:grid;grid-template-columns:", ";position:relative;height:100%;width:100%;overflow:hidden;"], function (_ref) {
  var isAsideOpen = _ref.isAsideOpen,
    theme = _ref.theme;
  return isAsideOpen ? "".concat(theme.toc.panel.width, " 1fr") : '1fr';
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PlayerLayout/PlayerLayout.tsx



















var PlayerLayout = function PlayerLayout() {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    isMobilePreview = _useContext.options.content.isMobilePreview;
  var fixedPanel = react_useAtomValue(fixedPanelAtom);
  var panel = react_useAtomValue(panelAtom);
  var _useAtomValue = react_useAtomValue(featuresAtom),
    WIDGET_NO_WATERMARK = _useAtomValue.WIDGET_NO_WATERMARK,
    WIDGET_LOGO = _useAtomValue.WIDGET_LOGO,
    TABLE_OF_CONTENT = _useAtomValue.TABLE_OF_CONTENT;
  var _staticStore$config$g = getConfig(),
    enableWatermark = _staticStore$config$g.enableWatermark;
  var showWatermark = !WIDGET_NO_WATERMARK && enableWatermark;
  var isAsideOpen = !!fixedPanel && !main/* isMobileOnly */.XF && !isMobilePreview && window.innerWidth > DeviceSize.tabletS;
  return /*#__PURE__*/react.createElement(PlayerLayoutContainer, {
    isAsideOpen: isAsideOpen
  }, /*#__PURE__*/react.createElement(components_BackgroundContainer_BackgroundContainer, {
    hasWatermarkBar: showWatermark
  }, /*#__PURE__*/react.createElement(HeaderContainer_HeaderContainer, {
    watermarkUrl: "".concat(getSiteBase()).concat(tracking.watermark),
    showWatermark: showWatermark,
    hasLogo: WIDGET_LOGO
  }), /*#__PURE__*/react.createElement(components_NavigationBarContainer, null), /*#__PURE__*/react.createElement(Player_Player, null), /*#__PURE__*/react.createElement(SearchProviderContainer_SearchProviderContainer, null, /*#__PURE__*/react.createElement(Accessibility_AccessibilityProviderContainer, null, /*#__PURE__*/react.createElement(Panel_Panel, null))), panel === Panel.CART ? /*#__PURE__*/react.createElement(PrintOrderContainer_PrintOrderContainer, null) : null), !!fixedPanel && TABLE_OF_CONTENT && /*#__PURE__*/react.createElement(FixedTocPanel, null));
};
/* harmony default export */ var PlayerLayout_PlayerLayout = (PlayerLayout);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/ui/_debug.ts





/**
 * https://jotai.org/docs/guides/debugging#debug-labels
 */
if (false) {}
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/store/cart/_debug.ts


/**
 * We need to add a label to every atom we use (these will be the names of the atoms we will see in Redux DevTools)
 * https://jotai.org/docs/guides/debugging#debug-labels
 */
if (false) {}
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/constants/_debug.ts


;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PlayerContainer/PlayerContainer.tsx


function PlayerContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function PlayerContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? PlayerContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : PlayerContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }



































var PlayerContainer_PlayerContainer = function PlayerContainer(props) {
  var _props$options$conten = props.options.content,
    widgetLayout = _props$options$conten.layout,
    colors = _props$options$conten.colors,
    _props$features = props.features,
    FLIP_PAGES = _props$features.FLIP_PAGES,
    WIDGET_PASSWORD = _props$features.WIDGET_PASSWORD,
    WIDGET_FORMS = _props$features.WIDGET_FORMS,
    CUSTOM_PLAYER_COLORS = _props$features.CUSTOM_PLAYER_COLORS,
    WIDGET_NO_WATERMARK = _props$features.WIDGET_NO_WATERMARK,
    _props$properties = props.properties,
    hash = _props$properties.hash,
    status = _props$properties.status,
    accountId = _props$properties.link.accountId,
    _props$properties$sec = _props$properties.security.password,
    password = _props$properties$sec === void 0 ? '' : _props$properties$sec,
    _props$properties$dat = _props$properties.dateLastUpdate,
    dateLastUpdate = _props$properties$dat === void 0 ? 0 : _props$properties$dat,
    _props$ui = props.ui,
    _props$ui$startPage = _props$ui.startPage,
    startPage = _props$ui$startPage === void 0 ? 1 : _props$ui$startPage,
    _props$ui$triggerResi = _props$ui.triggerResizeEvent,
    triggerResizeEvent = _props$ui$triggerResi === void 0 ? 0 : _props$ui$triggerResi,
    _props$ui$controllerB = _props$ui.controllerBarActive,
    controllerBarActive = _props$ui$controllerB === void 0 ? false : _props$ui$controllerB,
    _props$playerDataHash = props.playerDataHashCode,
    playerDataHashCode = _props$playerDataHash === void 0 ? 0 : _props$playerDataHash;
  var orientation = getOrientation(!!props.isLandscape, !!props.isPortrait);
  var _getPagesDataAndOrder = getPagesDataAndOrder(props.pages, FLIP_PAGES),
    data = _getPagesDataAndOrder.data,
    order = _getPagesDataAndOrder.order;
  var nativeActionContainerRef = (0,react.useRef)(null);
  var setOrientation = react_useSetAtom(setOrientationAtom);
  var setJson = react_useSetAtom(setJsonAtom);
  var setSignatureValue = react_useSetAtom(signatureAtom);
  var leadFormData = WIDGET_FORMS && props.leadForm && !props.downloadMode ? PlayerContainer_objectSpread(PlayerContainer_objectSpread({}, defaultLeadForm), props.leadForm) : null;
  var _useState = (0,react.useState)(null),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    playerRef = _useState2[0],
    setPlayerRef = _useState2[1];
  var _useState3 = (0,react.useState)(null),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    fullscreenRef = _useState4[0],
    setFullscreenRef = _useState4[1];
  var showWatermark = !WIDGET_NO_WATERMARK && props.config.enableWatermark;
  var skinType = getSkinType(props.options.content.skinType);
  var effect = getFlipbookEffect(props.options, props.features.PAGE_TRANSITION_SCROLL);
  var watermarkLogoUrl = "".concat(props.config.siteBase).concat(InteractivePdf).concat(tracking.watermark);
  (0,react.useEffect)(function () {
    dispatchResizeEvent();
    setOrientation(orientation);

    // For IOS, when the keyboard enters the view, it pushes the content up by the height of the keyboard
    // So we need to resize the content to be the original full height
    if (main/* isIOS */.un) {
      window.addEventListener('resize', function () {
        var html = document.getElementsByTagName('html')[0];
        if (html) {
          html.style.height = '100%';
        }
      });
    }
  }, [triggerResizeEvent, orientation]);
  (0,react.useEffect)(function () {
    setJson({
      features: props.features,
      properties: props.properties,
      rootPrimitives: {
        downloadMode: !!props.downloadMode,
        exportName: props.exportName
      }
    });
  }, [props.features, props.properties]);
  setConfig(props.config);
  (0,react.useEffect)(function () {
    if (props.signature) {
      setSignatureValue(props.signature);
    }
  }, [props.signature]);
  useCart(hash, accountId, dateLastUpdate);

  // Mobile-specific effects (in addition to page effects) are now supported.
  // When on a mobile device and using either the Scroll or Slide effect,
  // we need to explicitly handle and disable them as necessary.
  var rtl = props.options.content.rtl;
  var sounds = props.options.content.sounds;
  var shadows = props.options.content.shadows;
  var autoNavigationDelay = props.options.controls.autoNavigationDelay;
  if (main/* isMobile */.Fr || props.options.content.isMobilePreview) {
    if (props.options.content.mobileEffect === playerTypes_PlayerEffect.SCROLL) {
      rtl = false;
      sounds = false;
      shadows = false;
      autoNavigationDelay = 0;
    }
    if (props.options.content.mobileEffect === playerTypes_PlayerEffect.SLIDE) {
      sounds = false;
      shadows = false;
    }
  }
  return /*#__PURE__*/react.createElement(PlayerProvider_PlayerProvider, {
    pages: {
      data: data
    },
    options: PlayerContainer_objectSpread(PlayerContainer_objectSpread({}, props.options), {}, {
      content: PlayerContainer_objectSpread(PlayerContainer_objectSpread({}, props.options.content), {}, {
        effect: effect,
        skinType: skinType,
        rtl: rtl,
        sounds: sounds,
        shadows: shadows
      }),
      controls: PlayerContainer_objectSpread(PlayerContainer_objectSpread({}, props.options.controls), {}, {
        autoNavigationDelay: autoNavigationDelay
      })
    }),
    order: order,
    widgetLayout: widgetLayout,
    toc: props.toc,
    leadForm: leadFormData,
    flipbookConverted: props.flipbookConverted,
    playerDataHashCode: playerDataHashCode,
    downloadMode: !!props.downloadMode,
    exportName: props.exportName,
    cart: props.cart,
    orientation: orientation,
    key: orientation
  }, /*#__PURE__*/react.createElement(Statistics_Statistics, {
    flipbookHash: hash,
    allowedEvents: props.allowedEvents
  }, /*#__PURE__*/react.createElement(ZoomProviderContainer_ZoomProviderContainer, null, /*#__PURE__*/react.createElement(NativeActionsContainer_NativeActionsContainer, {
    nativeActionContainerRef: nativeActionContainerRef
  }, /*#__PURE__*/react.createElement(ActiveStageIndexProvider_ActiveStageIndexProvider, {
    hash: hash,
    orderLength: order.length,
    hasAccessToForm: WIDGET_FORMS,
    startPage: startPage || 1,
    leadForm: {
      active: (leadFormData === null || leadFormData === void 0 ? void 0 : leadFormData.active) || false,
      pageIndex: (leadFormData === null || leadFormData === void 0 ? void 0 : leadFormData.pageIndex) || 0,
      allowUsersToSkip: (leadFormData === null || leadFormData === void 0 ? void 0 : leadFormData.allowUsersToSkip) || false
    },
    playerRef: playerRef,
    isRtl: rtl
  }, /*#__PURE__*/react.createElement(PlayerRefProvider_PlayerRefProvider, {
    playerRef: playerRef,
    setPlayerRef: setPlayerRef
  }, /*#__PURE__*/react.createElement(Fe, {
    theme: customizableTheme(colors, CUSTOM_PLAYER_COLORS)
  }, /*#__PURE__*/react.createElement(providers_FullscreenRefProviderContainer, {
    fullscreenRef: fullscreenRef,
    setFullscreenRef: setFullscreenRef
  }, /*#__PURE__*/react.createElement(Fullscreen_Fullscreen, {
    isInFullscreen: props.isInFullscreen
  }, /*#__PURE__*/react.createElement(PasswordProtectedContainer_PasswordProtectedContainer, {
    password: password,
    hasAccessToPassword: WIDGET_PASSWORD,
    collectionStatus: status,
    unlockFlipbook: props.unlockFlipbook,
    nativeActionContainerRef: nativeActionContainerRef,
    isFlipbookLocked: !!props.isFlipbookLocked
  }, /*#__PURE__*/react.createElement(MouseOverPlayerProvider_MouseOverPlayerProvider, null, /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ControllerBarManager_ControllerBarManager, {
    controllerBarActive: controllerBarActive
  }), /*#__PURE__*/react.createElement(ShortcutKeys_ShortcutKeys, null), /*#__PURE__*/react.createElement(ControllerProviderContainer_ControllerProviderContainer, null, /*#__PURE__*/react.createElement(PlayerLayout_PlayerLayout, null)), /*#__PURE__*/react.createElement(WatermarkBarContainer_WatermarkBar, {
    url: "".concat(props.config.siteBase).concat(tracking.watermark),
    logoUrl: watermarkLogoUrl,
    showWatermark: showWatermark
  }), /*#__PURE__*/react.createElement("div", {
    id: "regularPlayerModal"
  })))), props.isFlipbookLocked && /*#__PURE__*/react.createElement(PasswordPlayerModalWrapper, {
    id: "passwordPlayerModal"
  }))))))))));
};
/* harmony default export */ var components_PlayerContainer_PlayerContainer = (withJotaiProvider(main/* isMobile */.Fr && main/* withOrientationChange */.LZ ? (0,main/* withOrientationChange */.LZ)(PlayerContainer_PlayerContainer) : PlayerContainer_PlayerContainer));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PlayerContainer/index.tsx


// TODO: use immutable props and check those (example: prevProps.myImmutableObj === nextProps.myImmutableObj),
/* harmony default export */ var components_PlayerContainer = (components_PlayerContainer_PlayerContainer);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Export/ExportElements.styles.ts

var ExportElementsContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ExportElementsstyles__ExportElementsContainer",
  componentId: "sc-1ikwp9m-0"
})(["position:absolute;top:0;transform:translateZ(0);"]);
var ExportElements = styled_components_browser_esm.div.withConfig({
  displayName: "ExportElementsstyles__ExportElements",
  componentId: "sc-1ikwp9m-1"
})(["display:inline-block;"]);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/ActionHandler/ExportActionHandler.tsx










/** Action handler used in export, with only the necessary interactions */
var ExportActionHandler = function ExportActionHandler(props) {
  switch (props.elementAction) {
    case ActionType.IMAGE:
    case ActionType.TEXT_BOX:
    case ActionType.SHAPE_ELEMENT:
      return /*#__PURE__*/react.createElement(InteractionActionContainer_InteractionActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        offsetX: props.offsetX,
        isFirstPage: props.isFirstPage,
        elementAction: props.elementAction
      });
    case ActionType.OPEN_OVERLAY:
      return /*#__PURE__*/react.createElement(OpenOverlayActionContainer_OpenOverlayActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        isFirstPage: props.isFirstPage,
        offsetX: props.offsetX,
        elementAction: props.elementAction
      });
    case ActionType.GO_TO_FLIPSNACK_PROFILE:
      return /*#__PURE__*/react.createElement(GoToProfileActionContainer_GoToProfileActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      });
    case ActionType.GO_TO_URL:
      return /*#__PURE__*/react.createElement(GoToUrlActionContainer_GoToUrlActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex,
        stageIndex: props.stageIndex
      });
    case ActionType.DOWNLOAD_PDF:
      return /*#__PURE__*/react.createElement(DownloadPdfActionContainer_DownloadPdfActionContainer, null);
    case ActionType.SEND_EMAIL:
      return /*#__PURE__*/react.createElement(SendEmailActionContainer_SendEmailActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      });
    case ActionType.PHONE_NUMBER:
      return /*#__PURE__*/react.createElement(PhoneNumberActionContainer_PhoneNumberActionContainer, {
        pageId: props.pageId,
        elementIndex: props.elementIndex
      });
    default:
      return null;
  }
};
ExportActionHandler.propTypes = {
  pageId: prop_types_default().oneOfType([(prop_types_default()).number, (prop_types_default()).string]).isRequired,
  stageIndex: (prop_types_default()).number.isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  elementAction: (prop_types_default()).number.isRequired,
  offsetX: (prop_types_default()).number.isRequired,
  isFirstPage: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var ActionHandler_ExportActionHandler = (ExportActionHandler);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Export/helpers/exportElementsAttributes.ts


function exportElementsAttributes_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function exportElementsAttributes_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? exportElementsAttributes_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : exportElementsAttributes_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

// Force some elements to have specific attributes in export
var exportElementsAttributes = defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty(defineProperty_defineProperty({}, LinkType.SLIDESHOW, function (currentAttributes) {
  return exportElementsAttributes_objectSpread(exportElementsAttributes_objectSpread({}, currentAttributes), {}, {
    autoplay: false,
    hideArrows: true,
    hideBullets: true
  });
}), LinkType.EMBED, function (currentAttributes) {
  return exportElementsAttributes_objectSpread(exportElementsAttributes_objectSpread({}, currentAttributes), {}, {
    content: ''
  });
}), LinkType.PRODUCT_TAG, function (currentAttributes) {
  return exportElementsAttributes_objectSpread(exportElementsAttributes_objectSpread({}, currentAttributes), {}, {
    pulsating: false
  });
}), LinkType.TAG, function (currentAttributes) {
  return exportElementsAttributes_objectSpread(exportElementsAttributes_objectSpread({}, currentAttributes), {}, {
    pulsating: false
  });
}), LinkType.VIDEO_WIDGET, function (currentAttributes) {
  if (currentAttributes.src) {
    var _currentAttributes$sr = currentAttributes.src.split('?'),
      _currentAttributes$sr2 = slicedToArray_slicedToArray(_currentAttributes$sr, 2),
      src = _currentAttributes$sr2[0],
      searchParams = _currentAttributes$sr2[1];
    var modifiedQueryString = '';
    if (searchParams) {
      var urlSearchParams = new URLSearchParams(searchParams);
      urlSearchParams.set('controls', '0');
      urlSearchParams.set('autoplay', '0');
      modifiedQueryString = "?".concat(urlSearchParams.toString());
    }
    return exportElementsAttributes_objectSpread(exportElementsAttributes_objectSpread({}, currentAttributes), {}, {
      src: "".concat(src).concat(modifiedQueryString)
    });
  }
  if (currentAttributes.ytlink) {
    var ytlink = new URL(currentAttributes.ytlink);
    ytlink.searchParams.set('controls', '0');
    ytlink.searchParams.set('autoplay', '0');
    return exportElementsAttributes_objectSpread(exportElementsAttributes_objectSpread({}, currentAttributes), {}, {
      ytlink: ytlink.toString()
    });
  }
  return currentAttributes;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Export/helpers/getExportAttributes.tsx

/* harmony default export */ var getExportAttributes = (function (elementType, currentAttributes) {
  if (exportElementsAttributes[elementType]) {
    return exportElementsAttributes[elementType](currentAttributes);
  }
  return currentAttributes;
});
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Export/ExportStageElement.tsx










var ExportStageElement_ElementsComponents = StageElements_Elements_Elements();
var ExportStageElement = function ExportStageElement(props) {
  var _element$attributes, _element$attributes2;
  var element = useElement({
    pageId: props.pageId,
    elementIndex: props.elementIndex
  });
  var _ElementDefaults$elem = ElementDefaults[element.type],
    component = _ElementDefaults$elem.component,
    exportComponent = _ElementDefaults$elem.exportComponent;
  var Component = ExportStageElement_ElementsComponents[exportComponent || component];

  // Browsers may have different strategy when rounding sub-pixel;
  var scaleValue = function scaleValue(value) {
    return value * props.scale;
  };
  var scaleSizes = function scaleSizes(value) {
    return value * props.scale < ELEMENT_MIN_SIZE_VALUE ? ELEMENT_MIN_SIZE_VALUE : value * props.scale;
  };

  // Customize specific elements for export
  var exportElementAttributes = getExportAttributes(element.type, element.attributes);
  var elementAlpha = typeof element.alpha === 'number' ? element.alpha : 1;
  var opacity = getElementOpacity((_element$attributes = element.attributes) === null || _element$attributes === void 0 ? void 0 : _element$attributes.isAutoLink, (_element$attributes2 = element.attributes) === null || _element$attributes2 === void 0 ? void 0 : _element$attributes2.isAnnotation, props.highlightOnLinks, elementAlpha);
  return /*#__PURE__*/react.createElement(ElementPositioning, {
    $top: "".concat(scaleValue(element.bounds.y), "px"),
    $left: "".concat(scaleValue(element.bounds.x), "px"),
    $width: scaleSizes(element.bounds.width),
    $height: scaleSizes(element.bounds.height),
    $rotation: (element === null || element === void 0 ? void 0 : element.rotation) || 0,
    $zIndex: element.zIndex
  }, /*#__PURE__*/react.createElement("div", {
    style: {
      width: scaleSizes(element.bounds.width),
      height: scaleSizes(element.bounds.height)
    }
  }, /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.A)({}, exportElementAttributes, {
    alpha: opacity,
    width: scaleSizes(element.bounds.width),
    height: scaleSizes(element.bounds.height),
    type: element.type,
    id: element.id,
    stageIndex: props.stageIndex,
    pageId: props.pageId,
    pageItemHash: props.pageItemHash,
    zoom: props.scale,
    radius: 'radius' in exportElementAttributes ? exportElementAttributes.radius * props.scale : 0,
    animatedInteractions: false,
    isStageActive: false,
    mouseOver: false,
    isDownloadPDF: true,
    pageNumber: props.pageNumber
  })), /*#__PURE__*/react.createElement(ActionHandler_ExportActionHandler, {
    elementAction: element.action,
    pageId: element.pageId,
    elementIndex: props.elementIndex,
    stageIndex: props.stageIndex,
    offsetX: props.offsetX,
    isFirstPage: props.isFirstPage
  })));
};
ExportStageElement.propTypes = {
  stageIndex: (prop_types_default()).number.isRequired,
  elementIndex: (prop_types_default()).number.isRequired,
  offsetX: (prop_types_default()).number.isRequired,
  isFirstPage: (prop_types_default()).bool.isRequired,
  highlightOnLinks: (prop_types_default()).bool.isRequired
};
/* harmony default export */ var Export_ExportStageElement = (ExportStageElement);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/StageElements/Export/ExportStageElements.tsx


function ExportStageElements_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function ExportStageElements_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ExportStageElements_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ExportStageElements_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }













/**
 * This file is used for generating the pages used for export and screenshot
 *
 * @param {ExportStageElementsType} props
 * @returns {React.ReactElement}
 * @constructor
 */
var ExportStageElements = function ExportStageElements(props) {
  var _useContext = (0,react.useContext)(contexts_PlayerContext),
    pageData = _useContext.pages.data,
    highlights = _useContext.options.controls.highlights;
  var _useAtom = react_useAtom(featuresAtom),
    _useAtom2 = slicedToArray_slicedToArray(_useAtom, 1),
    features = _useAtom2[0];
  var _useContext2 = (0,react.useContext)(contexts_ControllerContext),
    initialPlayerScale = _useContext2.scale;
  var _useContext3 = (0,react.useContext)(contexts_ZoomContext),
    zoom = _useContext3.zoom;
  zoom *= initialPlayerScale;
  var getElement = function getElement(element, index, offsetX, highlightOnLinks) {
    return /*#__PURE__*/react.createElement(Export_ExportStageElement, {
      pageId: element.pageId,
      pageItemHash: pageData[element.pageId].source.hash,
      stageIndex: props.stageIndex,
      elementIndex: index,
      offsetX: offsetX,
      isFirstPage: props.isFirstPage,
      key: element.id,
      scale: props.scale,
      highlightOnLinks: highlightOnLinks,
      pageNumber: props.pageNumber
    });
  };
  var getElements = function getElements(elements) {
    var offsetX = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
    return elements.map(function (element, index) {
      var _element$attributes$p;
      var elementType = element.type,
        elementAction = element.action,
        invisible = element.invisible;
      var elementProvider = element !== null && element !== void 0 && element.attributes && 'provider' in element.attributes ? (_element$attributes$p = element.attributes.provider) !== null && _element$attributes$p !== void 0 ? _element$attributes$p : '' : '';
      if (invisible || !hasAccessToElement({
        elementType: elementType,
        elementAction: elementAction,
        elementProvider: elementProvider
      }, features)) {
        return /*#__PURE__*/react.createElement("div", {
          key: element.id
        });
      }
      return getElement(element, index, props.isFirstPage ? 0 : offsetX, highlights);
    });
  };
  var pageElements = getElements(props.elements[0]);
  var pageWidth = props.pageWidth * zoom;
  var pageHeight = props.pageHeight * zoom;
  return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ShapesLoader_ShapesLoader, null), /*#__PURE__*/react.createElement(ExportElementsContainer, null, /*#__PURE__*/react.createElement(ExportElements, null, /*#__PURE__*/react.createElement(ElementsList, {
    $width: pageWidth,
    $height: pageHeight,
    $overflow: "hidden"
  }, pageElements))));
};
ExportStageElements.propTypes = ExportStageElements_objectSpread(ExportStageElements_objectSpread({
  pageWidth: (prop_types_default()).number.isRequired
}, Elements), {}, {
  isFirstPage: (prop_types_default()).bool.isRequired
});
/* harmony default export */ var Export_ExportStageElements = (ExportStageElements);
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/components/PlayerContainer/ExportContainer.tsx

function ExportContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function ExportContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ExportContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ExportContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }




















// This is needed to resolve a bug in puppeteer -> opacity is not working on the first color div on page
// When we have an export with renderBackground false, we add a small color div, that resolves the bug
// When renderBackground is true, we don't need to add anything, because the page has background color
var ColorDiv = styled_components_browser_esm.div.withConfig({
  displayName: "ExportContainer__ColorDiv",
  componentId: "sc-n1fh4f-0"
})(["width:", ";height:", ";background-color:", " !important;"], function (_ref) {
  var $width = _ref.$width;
  return $width;
}, function (_ref2) {
  var $height = _ref2.$height;
  return $height;
}, function (_ref3) {
  var $bgColor = _ref3.$bgColor;
  return $bgColor;
});
var ExportContainer = function ExportContainer(props) {
  var page = props.page,
    scale = props.scale,
    renderBackground = props.renderBackground,
    signature = props.signature,
    _props$properties = props.properties,
    hash = _props$properties.hash,
    accountId = _props$properties.link.accountId,
    _props$properties$ver = _props$properties.version,
    schema = _props$properties$ver.schema,
    revision = _props$properties$ver.revision,
    cart = props.cart;

  // Override properties width & height in export mode
  var properties = ExportContainer_objectSpread(ExportContainer_objectSpread({}, props.properties), {}, {
    width: page.width,
    height: page.height
  });
  setConfig(props.config);
  var pageId = page.id;
  var hasElements = !!page.elements.length;
  var stagePagesProps = [{
    bgColor: page.bgColor,
    type: page.type,
    source: ExportContainer_objectSpread({}, page.source),
    width: page.width,
    height: page.height,
    id: pageId,
    version: page.version,
    size: CoverType.ORIGINAL,
    visible: true,
    // Export-publication adds the cover for PDF pages
    showCover: page.type !== PageTypes.CUSTOM,
    objectFit: OBJECT_FIT_VALUES.CONTAIN
  }];
  var pageWidth = page.width;
  var pageHeight = page.height;
  var itemResourceBucket = parseFloat("".concat(schema, ".").concat(revision)) >= flipbookVersion_JsonVersions['3.2'] ? flipbook_ItemResourceBucket.CONTENT : flipbook_ItemResourceBucket.DEFAULT;
  var pageBackground = renderBackground ? /*#__PURE__*/react.createElement(StagePages_StagePages, {
    stagePages: stagePagesProps,
    flipbookWidth: pageWidth,
    flipbookHeight: pageHeight,
    itemResourceBucket: itemResourceBucket,
    workspaceHash: accountId,
    flipbookHash: hash,
    signature: signature
  }) : /*#__PURE__*/react.createElement(ColorDiv, {
    $width: "0.1px",
    $height: "0.1px",
    $bgColor: "white"
  });
  return /*#__PURE__*/react.createElement(Provider, null, /*#__PURE__*/react.createElement(HydrateAtoms_HydrateAtoms, {
    initialValues: [[featuresAtom, props.features], [propertiesAtom, properties], [signatureAtom, signature]]
  }, /*#__PURE__*/react.createElement(ScopeIdProvider_ScopeIdProvider, {
    pageIds: [pageId]
  }, /*#__PURE__*/react.createElement(ZoomProviderContainer_ZoomProviderContainer, null, /*#__PURE__*/react.createElement(Fe, {
    theme: customizableTheme()
  }, /*#__PURE__*/react.createElement(PlayerProvider_PlayerProvider, {
    pages: {
      data: defineProperty_defineProperty({}, pageId, page)
    },
    options: ExportContainer_objectSpread({}, props.options),
    order: [pageId],
    widgetLayout: constants_WidgetLayoutTypes.SINGLE,
    toc: [],
    leadForm: null,
    flipbookConverted: true,
    playerDataHashCode: 0,
    downloadMode: false,
    exportName: "",
    orientation: constants_Orientation.PORTRAIT,
    cart: cart
  }, /*#__PURE__*/react.createElement(ControllerProviderContainer_ControllerProviderContainer, null, /*#__PURE__*/react.createElement(ShapesProviderContainer_ShapesProviderContainer, null, /*#__PURE__*/react.createElement(react.Fragment, null, pageBackground, hasElements && /*#__PURE__*/react.createElement(Export_ExportStageElements, {
    stageIndex: 0,
    elements: [page.elements],
    pageWidth: pageWidth,
    pageHeight: pageHeight,
    isFirstPage: false,
    scale: scale,
    pageNumber: props.pageNumber
  }))))))))));
};
/* harmony default export */ var PlayerContainer_ExportContainer = (withJotaiProvider(ExportContainer));
;// CONCATENATED MODULE: ../../modules/widget-player/code/src/index.ts



;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/Player/Player.tsx

function Player_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function Player_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Player_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Player_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }






var Player_Player_Player = function Player(_ref) {
  var _json$options;
  var startPage = _ref.startPage,
    json = _ref.json,
    config = _ref.config,
    signature = _ref.signature,
    _ref$trackingData = _ref.trackingData,
    trackingData = _ref$trackingData === void 0 ? '' : _ref$trackingData,
    unlockFlipbook = _ref.unlockFlipbook,
    isFlipbookLocked = _ref.isFlipbookLocked,
    allowedEvents = _ref.allowedEvents;
  var _useContext = (0,react.useContext)(contexts_FlipbookOpenDataContext),
    setOpenFlipbook = _useContext.setOpenFlipbook,
    openFlipbook = _useContext.openFlipbook;
  (0,react.useEffect)(function () {
    var handler = function handler() {
      setOpenFlipbook(!!fscreen_lib/* default */.A.fullscreenElement);
    };
    fscreen_lib/* default */.A.addEventListener('fullscreenchange', handler, false);
    return function () {
      fscreen_lib/* default */.A.removeEventListener('fullscreenchange', handler, false);
    };
  }, []);
  (0,react.useEffect)(function () {
    setOpenFlipbook(true);
  }, [json.properties.hash]);
  if (!openFlipbook) {
    return null;
  }
  return /*#__PURE__*/react.createElement(components_PlayerContainer, {
    options: Player_objectSpread(Player_objectSpread({}, json.options), {}, {
      content: Player_objectSpread(Player_objectSpread({}, defaultOptions.content), json.options.content),
      background: Player_objectSpread(Player_objectSpread({}, defaultOptions.background), json.options.background),
      controls: Player_objectSpread(Player_objectSpread({}, defaultOptions.controls), json.options.controls),
      backgroundAudio: Player_objectSpread(Player_objectSpread({}, defaultOptions.backgroundAudio), (_json$options = json.options) === null || _json$options === void 0 ? void 0 : _json$options.backgroundAudio)
    }),
    pages: json.pages,
    config: {
      cdnBase: config.cdnBase,
      cdnContent: config.cdnContent,
      cdnStatic: config.cdnStatic,
      siteBase: config.siteBase,
      siteAppUrl: config.siteAppUrl,
      enableGATracking: config.enableGATracking,
      trackingData: trackingData,
      fullscreenUrl: config.fullscreenUrl,
      leadFormEndpoint: config.leadFormEndpoint,
      statisticsEndpoint: config.statisticsEndpoint,
      enableCollectStats: config.enableCollectStats,
      enableWatermark: config.enableWatermark,
      recaptchaListKey: config.recaptchaListKey,
      orderEmailEndpoint: config.orderEmailEndpoint,
      privateContentCdn: config.privateContentCdn,
      interactivityElementsEndpoint: config.interactivityElementsEndpoint,
      interactivityResultsEndpoint: config.interactivityResultsEndpoint,
      trackOrdersEndpoint: config.trackOrdersEndpoint
    },
    ui: {
      startPage: startPage
    },
    properties: Player_objectSpread(Player_objectSpread({}, defaultProperties), json.properties),
    features: Player_objectSpread(Player_objectSpread({}, defaultFeatures), json.features),
    toc: json.toc || [],
    leadForm: Player_objectSpread(Player_objectSpread({}, defaultLeadForm), json.leadForm),
    cart: json.cart,
    isInFullscreen: true,
    signature: signature,
    flipbookConverted: true,
    unlockFlipbook: unlockFlipbook,
    isFlipbookLocked: isFlipbookLocked,
    key: json.pages.order[0],
    allowedEvents: allowedEvents
  });
};
Player_Player_Player.propTypes = {
  startPage: (prop_types_default()).number,
  signature: (prop_types_default()).string,
  unlockFlipbook: (prop_types_default()).func.isRequired,
  isFlipbookLocked: (prop_types_default()).bool.isRequired,
  // @ts-ignore - PropTypes does not fully supports Set
  allowedEvents: prop_types_default().instanceOf(Set)
};
Player_Player_Player.defaultProps = {
  startPage: 1,
  signature: '',
  trackingData: '',
  allowedEvents: undefined
};
/* harmony default export */ var components_Player_Player = (Player_Player_Player);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/Player/index.ts

;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/Statistics/Statistics.tsx





var StatisticsPropTypes = {
  enableCollectStats: (prop_types_default()).bool.isRequired,
  statisticsEndpoint: (prop_types_default()).string.isRequired,
  bookshelfHash: (prop_types_default()).string.isRequired,
  children: (prop_types_default()).element.isRequired
};
/**
 * Handles statistics events from bookshelf:
 * - Send impression event on mount - send once
 * - Collect time spent on shelf - periodically send time event
 * - Send view event on mouseover - send once - contains device type and referrer type
 */
var Statistics_Statistics_Statistics = function Statistics(props) {
  var impressionHash = (0,react.useMemo)(function () {
    return esm_browser_v4().replace(/-/g, '');
  }, []);
  var memoizedCallbacks = (0,react.useMemo)(function () {
    return [function (timeSpent) {
      return [getTimeEvent(timeSpent)];
    }];
  }, []);
  var _useStatistics = useStatistics(props.enableCollectStats, props.statisticsEndpoint, props.bookshelfHash, impressionHash),
    registerEvents = _useStatistics.registerEvents;
  useViewEvents(registerEvents, props.enableCollectStats, memoizedCallbacks);
  (0,react.useEffect)(function () {
    // Views are send just after user interacts with the player
    document.addEventListener('mouseover', function () {
      setTimeout(function () {
        registerEvents([{
          eid: StatsType.VIEW,
          d: getDeviceType(),
          s: getReferrerType()
        }]);
      }, 2000);
    }, {
      once: true
    });
  }, []);
  return props.children;
};
Statistics_Statistics_Statistics.propTypes = StatisticsPropTypes;
/* harmony default export */ var components_Statistics_Statistics = (Statistics_Statistics_Statistics);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/BookshelfContainer/dispatchResizeEvent.ts


/**
 * Used for dispatching the resize event
 */
/* harmony default export */ var BookshelfContainer_dispatchResizeEvent = ((0,lodash.debounce)(function () {
  window.dispatchEvent(new Event('resize'));
}, 500));
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/BookshelfContainer/BookshelfContainer.tsx


function BookshelfContainer_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function BookshelfContainer_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? BookshelfContainer_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : BookshelfContainer_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }


















var BookshelfContainer_BookshelfContainer = function BookshelfContainer(props) {
  var _props$flipbookJson, _ref, _props$ui, _props$flipbookJson4;
  var _useState = (0,react.useState)(false),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    openFlipbook = _useState2[0],
    _setOpenFlipbook = _useState2[1];
  // Warning! This is a workaround for fullscreen, as in safari it needs to be a user action
  // First we entered in fullscreen and then getting the json, but on second flipbook it has been rendering
  // previous flipbook, using a callback function to avoid this did not work in safari
  var _useState3 = (0,react.useState)(false),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    hasFlipbook = _useState4[0],
    setHasFlipbook = _useState4[1];
  var _useState5 = (0,react.useState)(false),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    showPreloader = _useState6[0],
    setShowPreloader = _useState6[1];
  var skipTrackingAndStats = isOnFlipsnackAdminDomain();
  var previousFlipbookHash = (0,react.useRef)('');
  var playerContainerRef = (0,react.useRef)(null);
  var enableCollectStats = !!props.config.enableCollectStats && !openFlipbook;
  var trackingData = btoa("bookshelf:".concat(props.bookshelfHash));
  var newSignature = props.signature && props.signature[props === null || props === void 0 || (_props$flipbookJson = props.flipbookJson) === null || _props$flipbookJson === void 0 || (_props$flipbookJson = _props$flipbookJson.properties) === null || _props$flipbookJson === void 0 ? void 0 : _props$flipbookJson.hash] ? props.signature[props.flipbookJson.properties.hash] : '';
  var bookshelfSignature = (_ref = props.signature && props.signature[props.bookshelfHash]) !== null && _ref !== void 0 ? _ref : '';

  // Disable stats on admin domain
  if (skipTrackingAndStats) {
    enableCollectStats = false;
  }
  var flipbookOpenValue = (0,react.useMemo)(function () {
    return {
      openFlipbook: openFlipbook,
      setOpenFlipbook: function setOpenFlipbook(isFlipbookOpen) {
        _setOpenFlipbook(isFlipbookOpen);
        if (!isFlipbookOpen) {
          var _props$flipbookJson2;
          setHasFlipbook(false);
          previousFlipbookHash.current = '';
          props.cleanUpOnFlipbookClose(props === null || props === void 0 || (_props$flipbookJson2 = props.flipbookJson) === null || _props$flipbookJson2 === void 0 || (_props$flipbookJson2 = _props$flipbookJson2.properties) === null || _props$flipbookJson2 === void 0 ? void 0 : _props$flipbookJson2.hash);
        }
      }
    };
  }, [openFlipbook]);
  var toggleFullscreen = function toggleFullscreen() {
    if (fscreen_lib/* default */.A.fullscreenEnabled) {
      if (playerContainerRef && playerContainerRef.current) {
        fscreen_lib/* default */.A.requestFullscreen(playerContainerRef.current);
      } else {
        fscreen_lib/* default */.A.exitFullscreen();
      }
      window.dispatchEvent(new Event('resize'));
    }
  };
  (0,react.useEffect)(function () {
    BookshelfContainer_dispatchResizeEvent();
  }, [props === null || props === void 0 || (_props$ui = props.ui) === null || _props$ui === void 0 ? void 0 : _props$ui.triggerResizeEvent]);
  (0,react.useEffect)(function () {
    var _props$flipbookJson3;
    if ((_props$flipbookJson3 = props.flipbookJson) !== null && _props$flipbookJson3 !== void 0 && (_props$flipbookJson3 = _props$flipbookJson3.properties) !== null && _props$flipbookJson3 !== void 0 && _props$flipbookJson3.hash) {
      setHasFlipbook(true);
      setShowPreloader(false);
    }
  }, [(_props$flipbookJson4 = props.flipbookJson) === null || _props$flipbookJson4 === void 0 || (_props$flipbookJson4 = _props$flipbookJson4.properties) === null || _props$flipbookJson4 === void 0 ? void 0 : _props$flipbookJson4.hash]);
  var getFlipbook = function getFlipbook(flipbookHash) {
    if (previousFlipbookHash.current !== flipbookHash) {
      setShowPreloader(true);
      props.getFlipbookJson(flipbookHash);
      previousFlipbookHash.current = flipbookHash;
      setHasFlipbook(false);
    } else {
      _setOpenFlipbook(true);
    }
    toggleFullscreen();
  };

  // This is bad practice - refactor this
  var renderPlayer = function renderPlayer() {
    var _props$flipbookJson5, _props$flipbookJson6, _props$flipbookJson7;
    if (((_props$flipbookJson5 = props.flipbookJson) === null || _props$flipbookJson5 === void 0 || (_props$flipbookJson5 = _props$flipbookJson5.properties) === null || _props$flipbookJson5 === void 0 ? void 0 : _props$flipbookJson5.visibility) === FlipbookVisibilityType.PRIVATE || ((_props$flipbookJson6 = props.flipbookJson) === null || _props$flipbookJson6 === void 0 || (_props$flipbookJson6 = _props$flipbookJson6.properties) === null || _props$flipbookJson6 === void 0 ? void 0 : _props$flipbookJson6.visibility) === FlipbookVisibilityType.SHARED_TEAM || ((_props$flipbookJson7 = props.flipbookJson) === null || _props$flipbookJson7 === void 0 || (_props$flipbookJson7 = _props$flipbookJson7.properties) === null || _props$flipbookJson7 === void 0 ? void 0 : _props$flipbookJson7.visibility) === FlipbookVisibilityType.SHARED) {
      setHasFlipbook(false);
      previousFlipbookHash.current = '';
      fscreen_lib/* default */.A.exitFullscreen();
      return null;
    }
    var unLockFlipbook = function unLockFlipbook(password) {
      setShowPreloader(true);
      props.unlockBookShelfFlipbook(password, props.flipbookJson.properties.hash, function () {
        setShowPreloader(false);
      });
    };
    if (showPreloader) {
      return /*#__PURE__*/react.createElement(src_BrandedPreloader, null);
    }
    return !showPreloader && hasFlipbook && /*#__PURE__*/react.createElement(components_Player_Player, {
      json: props.flipbookJson,
      config: BookshelfContainer_objectSpread(BookshelfContainer_objectSpread({}, defaultConfig), props.config),
      signature: newSignature,
      trackingData: trackingData,
      unlockFlipbook: unLockFlipbook,
      isFlipbookLocked: props.isFlipbookLocked,
      allowedEvents: props.allowedEvents
    });
  };
  var bookshelf = /*#__PURE__*/react.createElement(ShelfJsonProvider_ShelfJsonProvider, {
    config: BookshelfContainer_objectSpread(BookshelfContainer_objectSpread({}, defaultConfig), props.config),
    options: props.options,
    collection: props.collection,
    properties: props.properties,
    features: props.features,
    trackingData: trackingData,
    shelfJsonHashCode: props.shelfJsonHashCode,
    signature: bookshelfSignature,
    hash: props.bookshelfHash
  }, /*#__PURE__*/react.createElement(BackgroundContainer_BackgroundContainer, {
    background: props.options.background
  }, /*#__PURE__*/react.createElement(FlipbookRequestProvider, {
    value: {
      getFlipbookJson: getFlipbook
    }
  }, /*#__PURE__*/react.createElement(Bookshelf_Bookshelf, null))));
  return /*#__PURE__*/react.createElement(components_Statistics_Statistics, {
    enableCollectStats: enableCollectStats,
    statisticsEndpoint: props.config.statisticsEndpoint,
    bookshelfHash: props.bookshelfHash
  }, /*#__PURE__*/react.createElement(react.Fragment, null, bookshelf, /*#__PURE__*/react.createElement(FlipbookOpenDataProvider, {
    value: flipbookOpenValue
  }, fscreen_lib/* default */.A.fullscreenEnabled && /*#__PURE__*/react.createElement(BookshelfPlayerContainer, {
    ref: playerContainerRef
  }, renderPlayer()))));
};
BookshelfContainer_BookshelfContainer.propTypes = BookshelfContainer_objectSpread(BookshelfContainer_objectSpread(BookshelfContainer_objectSpread(BookshelfContainer_objectSpread(BookshelfContainer_objectSpread(BookshelfContainer_objectSpread({}, collectionsProps), optionsProps), configProps), propertiesProps), featuresProps), {}, {
  getFlipbookJson: (prop_types_default()).func.isRequired,
  signature: prop_types_default().shape({}),
  bookshelfHash: (prop_types_default()).string.isRequired,
  shelfJsonHashCode: (prop_types_default()).number.isRequired,
  flipbookJson: prop_types_default().shape({}),
  unlockBookShelfFlipbook: (prop_types_default()).func.isRequired,
  cleanUpOnFlipbookClose: (prop_types_default()).func.isRequired,
  isFlipbookLocked: (prop_types_default()).bool.isRequired,
  // @ts-ignore - PropTypes does not fully supports Set
  allowedEvents: prop_types_default().instanceOf(Set)
});
BookshelfContainer_BookshelfContainer.defaultProps = {
  signature: {},
  flipbookJson: {},
  allowedEvents: undefined
};
/* harmony default export */ var components_BookshelfContainer_BookshelfContainer = (main/* isMobile */.Fr && main/* withOrientationChange */.LZ ? (0,main/* withOrientationChange */.LZ)(BookshelfContainer_BookshelfContainer) : BookshelfContainer_BookshelfContainer);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/components/BookshelfContainer/index.tsx

/* harmony default export */ var components_BookshelfContainer = (components_BookshelfContainer_BookshelfContainer);
;// CONCATENATED MODULE: ../../modules/bookshelf/code/src/index.ts

;// CONCATENATED MODULE: ./src/types/bookshelfPropTypes.ts

var bookshelfPropTypes_propertiesProps = {
  title: (prop_types_default()).string.isRequired,
  description: (prop_types_default()).string.isRequired,
  link: prop_types_default().shape({
    name: (prop_types_default()).string.isRequired,
    profile: (prop_types_default()).string.isRequired,
    domain: (prop_types_default()).string.isRequired
  }).isRequired,
  type: (prop_types_default()).string.isRequired,
  visibility: (prop_types_default()).string.isRequired,
  resourceVersion: (prop_types_default()).number.isRequired
};
var bookshelfPropTypes_optionsProps = {
  background: prop_types_default().shape({
    color: (prop_types_default()).string.isRequired,
    opacity: (prop_types_default()).number.isRequired
  }).isRequired,
  shelfColor: (prop_types_default()).string.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  language: (prop_types_default()).string.isRequired,
  itemsWidth: (prop_types_default()).number.isRequired,
  openInNewTab: (prop_types_default()).bool.isRequired,
  showSearchInBookshelf: (prop_types_default()).bool.isRequired,
  showFlipbookTitleOnHover: (prop_types_default()).bool.isRequired,
  logoImage: (prop_types_default()).string.isRequired,
  logoImageURL: (prop_types_default()).string.isRequired,
  logoImageLocation: (prop_types_default()).string
};
var bookshelfPropTypes_featuresProps = {
  FLIP_PAGES: (prop_types_default()).number.isRequired,
  FLIP_FILES: (prop_types_default()).number.isRequired,
  WIDGET_NO_WATERMARK: (prop_types_default()).bool.isRequired,
  WIDGET_RTL_ORIENTATION: (prop_types_default()).bool.isRequired,
  WIDGET_SINGLE_PAGE_VIEW: (prop_types_default()).bool.isRequired,
  WIDGET_SEARCH: (prop_types_default()).bool.isRequired,
  CUSTOM_FONTS: (prop_types_default()).bool.isRequired,
  WIDGET_SHELF: (prop_types_default()).bool.isRequired,
  WIDGET_LOGO: (prop_types_default()).bool.isRequired,
  WIDGET_PASSWORD: (prop_types_default()).bool.isRequired,
  WIDGET_ANALYTICS: (prop_types_default()).bool.isRequired,
  WIDGET_PRINT: (prop_types_default()).bool.isRequired,
  WIDGET_MEDIA: (prop_types_default()).bool.isRequired,
  WIDGET_TAGS: (prop_types_default()).bool.isRequired,
  WIDGET_FORMS: (prop_types_default()).bool.isRequired,
  WIDGET_SHOPPING: (prop_types_default()).bool.isRequired,
  WIDGET_DOMAIN_RESTRICTIONS: (prop_types_default()).bool.isRequired,
  WIDGET_SHOW_PRODUCTS: (prop_types_default()).bool.isRequired,
  DOWNLOAD_PDF: (prop_types_default()).bool.isRequired,
  LAYOUTS: (prop_types_default()).bool.isRequired,
  TABLE_OF_CONTENT: (prop_types_default()).bool.isRequired,
  LINKS_FROM_TEXT: (prop_types_default()).bool.isRequired,
  EMBED: (prop_types_default()).bool.isRequired,
  UPLOAD_VIDEO: (prop_types_default()).bool.isRequired,
  PRODUCT_TAG: (prop_types_default()).bool.isRequired,
  POPUP_FRAME: (prop_types_default()).bool.isRequired,
  SPOTLIGHT: (prop_types_default()).bool.isRequired,
  PHOTO_SLIDESHOW: (prop_types_default()).bool.isRequired,
  CHARTS: (prop_types_default()).bool.isRequired
};
var bookshelfPropTypes_flipbookProps = prop_types_default().shape({
  hash: (prop_types_default()).string.isRequired,
  name: (prop_types_default()).string.isRequired,
  width: (prop_types_default()).number.isRequired,
  height: (prop_types_default()).number.isRequired,
  linkName: (prop_types_default()).string.isRequired,
  coverPath: (prop_types_default()).string.isRequired
}).isRequired;
;// CONCATENATED MODULE: ./src/components/Bookshelf.tsx

function Bookshelf_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function Bookshelf_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Bookshelf_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Bookshelf_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





var components_Bookshelf_Bookshelf = function Bookshelf(props) {
  return /*#__PURE__*/react.createElement("div", {
    style: {
      width: '100%'
    }
  }, /*#__PURE__*/react.createElement(components_BookshelfContainer, {
    options: props.json.options,
    config: {
      cdnBase: config_0.amazon.s3.cloudfront,
      cdnContent: config_0.amazon.s3.cloudfrontContent,
      cdnStatic: config_0.amazon.s3.cloudfrontStatic,
      privateContentCdn: config_0.amazon.s3.cloudfrontPrivate,
      siteBase: config_0.siteBase,
      siteAppUrl: config_0.appUrl,
      enableGATracking: config_0.googleAnalytics.enableGATracking,
      fullscreenUrl: window.location.href,
      leadFormEndpoint: config_0.leadFormEndpoint,
      statisticsEndpoint: config_0.statisticsEndpoint,
      recaptchaListKey: config_0.recaptchaListKey,
      orderEmailEndpoint: config_0.orderEmailEndpoint,
      enableCollectStats: config_0.enableCollectStats,
      enableWatermark: true,
      accountId: props.accountId,
      interactivityElementsEndpoint: config_0.interactivityElementsEndpoint,
      interactivityResultsEndpoint: config_0.interactivityResultsEndpoint,
      trackOrdersEndpoint: config_0.trackOrdersEndpoint
    },
    properties: props.json.properties,
    features: props.json.features,
    collection: props.json.collection,
    getFlipbookJson: props.getFlipbookJson,
    flipbookJson: props.flipbookJson,
    signature: props.signature,
    bookshelfHash: props.bookshelfHash,
    shelfJsonHashCode: 0,
    unlockBookShelfFlipbook: props.unlockBookShelfFlipbook,
    cleanUpOnFlipbookClose: props.cleanUpOnFlipbookClose,
    isFlipbookLocked: props.isFlipbookLocked,
    allowedEvents: props.allowedEvents
  }));
};
components_Bookshelf_Bookshelf.propTypes = {
  bookshelfHash: (prop_types_default()).string.isRequired,
  json: prop_types_default().shape({
    properties: prop_types_default().shape(Bookshelf_objectSpread({}, bookshelfPropTypes_propertiesProps)).isRequired,
    options: prop_types_default().shape(Bookshelf_objectSpread({}, bookshelfPropTypes_optionsProps)).isRequired,
    collection: prop_types_default().arrayOf(bookshelfPropTypes_flipbookProps).isRequired,
    features: prop_types_default().shape(Bookshelf_objectSpread({}, bookshelfPropTypes_featuresProps)).isRequired
  }).isRequired,
  getFlipbookJson: (prop_types_default()).func.isRequired,
  accountId: (prop_types_default()).string.isRequired,
  signature: prop_types_default().shape({}),
  unlockBookShelfFlipbook: (prop_types_default()).func.isRequired,
  cleanUpOnFlipbookClose: (prop_types_default()).func.isRequired,
  isFlipbookLocked: (prop_types_default()).bool.isRequired,
  // @ts-ignore - PropTypes does not fully supports Set
  allowedEvents: prop_types_default().instanceOf(Set)
};
components_Bookshelf_Bookshelf.defaultProps = {
  signature: {},
  allowedEvents: undefined
};
/* harmony default export */ var components_Bookshelf = (components_Bookshelf_Bookshelf);
;// CONCATENATED MODULE: ./src/components/ErrorMessage.styles.tsx

var ErrorMessageContainer = styled_components_browser_esm.div.withConfig({
  displayName: "ErrorMessagestyles__ErrorMessageContainer",
  componentId: "sc-1a2kuc1-0"
})(["display:flex;justify-content:center;align-items:center;background-color:#000;"]);
var ErrorMessage_styles_ErrorMessage = styled_components_browser_esm.h1.withConfig({
  displayName: "ErrorMessagestyles__ErrorMessage",
  componentId: "sc-1a2kuc1-1"
})(["font-size:32px;color:#fff;"]);
;// CONCATENATED MODULE: ./src/components/ErrorMessage.tsx



var ErrorMessage_ErrorMessage = function ErrorMessage(_ref) {
  var _ref$message = _ref.message,
    message = _ref$message === void 0 ? '' : _ref$message;
  return /*#__PURE__*/react.createElement(ErrorMessageContainer, null, /*#__PURE__*/react.createElement(ErrorMessage_styles_ErrorMessage, null, message));
};
ErrorMessage_ErrorMessage.propTypes = {
  message: (prop_types_default()).string.isRequired
};
/* harmony default export */ var components_ErrorMessage = (ErrorMessage_ErrorMessage);
;// CONCATENATED MODULE: ./src/helpers/isOnFlipsnackDomain.ts
/**
 * Check if we are on a flipsnack domain
 *
 * @return boolean
 */
/* harmony default export */ var helpers_isOnFlipsnackDomain = (function () {
  var ref = document.referrer || window.location.hostname;
  var flipsnackDomains = ['(http(s?)://)?www.flipsnack.com', '(http(s?)://)?prelive.flipsnack.com', '(http(s?)://)?[a-z0-9-.]*site.flipsnack.net', '(http(s?)://)?[a-z0-9-.]*flipsnack.io'];
  var regex = new RegExp(flipsnackDomains.join('|'), 'i');
  return regex.test(ref);
});
;// CONCATENATED MODULE: ./src/components/Player.tsx

function components_Player_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function components_Player_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? components_Player_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : components_Player_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }





var src_components_Player_Player = function Player(_ref) {
  var _Languages$json$optio, _json$options, _json$options2, _json$options3, _json$options4;
  var startPage = _ref.startPage,
    json = _ref.json,
    _ref$trackingData = _ref.trackingData,
    trackingData = _ref$trackingData === void 0 ? '' : _ref$trackingData,
    signature = _ref.signature,
    _ref$overWriteConfig = _ref.overWriteConfig,
    overWriteConfig = _ref$overWriteConfig === void 0 ? {} : _ref$overWriteConfig,
    unlockFlipbook = _ref.unlockFlipbook,
    isFlipbookLocked = _ref.isFlipbookLocked,
    allowedEvents = _ref.allowedEvents;
  var changeLanguageAttribute = function changeLanguageAttribute(languageId) {
    return document.documentElement.setAttribute('lang', languageId);
  };
  changeLanguageAttribute(((_Languages$json$optio = translations[json.options.controls.language]) === null || _Languages$json$optio === void 0 ? void 0 : _Languages$json$optio.code) || 'en-US');
  return /*#__PURE__*/react.createElement("div", {
    style: {
      width: '100%'
    }
  }, /*#__PURE__*/react.createElement(components_PlayerContainer, {
    options: components_Player_objectSpread(components_Player_objectSpread(components_Player_objectSpread({}, json.options), defaultOptions), {}, {
      content: components_Player_objectSpread(components_Player_objectSpread({}, defaultOptions.content), (_json$options = json.options) === null || _json$options === void 0 ? void 0 : _json$options.content),
      background: components_Player_objectSpread(components_Player_objectSpread({}, defaultOptions.background), (_json$options2 = json.options) === null || _json$options2 === void 0 ? void 0 : _json$options2.background),
      controls: components_Player_objectSpread(components_Player_objectSpread({}, defaultOptions.controls), (_json$options3 = json.options) === null || _json$options3 === void 0 ? void 0 : _json$options3.controls),
      backgroundAudio: components_Player_objectSpread(components_Player_objectSpread({}, defaultOptions.backgroundAudio), (_json$options4 = json.options) === null || _json$options4 === void 0 ? void 0 : _json$options4.backgroundAudio)
    }),
    pages: components_Player_objectSpread(components_Player_objectSpread({}, defaultNewJson.pages), json.pages),
    config: components_Player_objectSpread({
      cdnBase: config_0.amazon.s3.cloudfront,
      cdnContent: config_0.amazon.s3.cloudfrontContent,
      cdnStatic: config_0.amazon.s3.cloudfrontStatic,
      siteBase: config_0.siteBase,
      siteAppUrl: config_0.appUrl,
      enableGATracking: config_0.googleAnalytics.enableGATracking,
      trackingData: trackingData,
      fullscreenUrl: window.location.href,
      leadFormEndpoint: config_0.leadFormEndpoint,
      statisticsEndpoint: config_0.statisticsEndpoint,
      recaptchaListKey: config_0.recaptchaListKey,
      orderEmailEndpoint: config_0.orderEmailEndpoint,
      enableCollectStats: config_0.enableCollectStats,
      enableWatermark: !helpers_isOnFlipsnackDomain(),
      privateContentCdn: config_0.amazon.s3.cloudfrontPrivate,
      interactivityElementsEndpoint: config_0.interactivityElementsEndpoint,
      interactivityResultsEndpoint: config_0.interactivityResultsEndpoint,
      trackOrdersEndpoint: config_0.trackOrdersEndpoint
    }, overWriteConfig),
    ui: {
      startPage: startPage
    },
    properties: components_Player_objectSpread(components_Player_objectSpread({}, defaultProperties), json.properties),
    features: components_Player_objectSpread(components_Player_objectSpread({}, defaultFeatures), json.features),
    toc: json.toc || [],
    leadForm: components_Player_objectSpread(components_Player_objectSpread({}, defaultLeadForm), json.leadForm),
    downloadMode: config_0.downloadMode,
    exportName: config_0.exportName,
    cart: json.cart,
    signature: signature,
    flipbookConverted: true,
    unlockFlipbook: unlockFlipbook,
    isFlipbookLocked: isFlipbookLocked,
    allowedEvents: allowedEvents
  }));
};
src_components_Player_Player.defaultProps = {
  startPage: 1,
  signature: '',
  overWriteConfig: {},
  trackingData: '',
  allowedEvents: undefined
};
/* harmony default export */ var components_Player = (src_components_Player_Player);
;// CONCATENATED MODULE: ./src/constants/index.ts
var constants_PlayerJsonTokenDelimiter = '+';
var paths = {
  playerJson: '/collections'
};
var ReaderType = {
  FLIPBOOK: 'flipbook',
  BOOKSHELF: 'bookshelf'
};
var Env = {
  LOCAL: 'local',
  DEVELOPMENT: 'development',
  PRODUCTION: 'production'
};
;// CONCATENATED MODULE: ./src/helpers/createTokenFromBookshelf.ts


/**
 * Returns a base64 token made from flipbooks with private ACL from a bookshelf having this form:
 * base64 of accountId1+flipbookHash1,accountId2+flipbookHash2 etc.
 *
 * @param accountId
 * @param shelfCollections
 */
/* harmony default export */ var createTokenFromBookshelf = (function (accountId, shelfCollections) {
  var token = '';
  var separator = '';
  shelfCollections.forEach(function (shelfCollection) {
    token += "".concat(separator).concat(accountId, "+").concat(shelfCollection.hash);
    separator = ',';
  });
  if (token.length) {
    return base64_encodeURI(token);
  }
  return token;
});
;// CONCATENATED MODULE: ./src/helpers/getDefaultPasswordProtectedJson.ts

function getDefaultPasswordProtectedJson_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function getDefaultPasswordProtectedJson_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? getDefaultPasswordProtectedJson_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : getDefaultPasswordProtectedJson_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }

/**
 * @param flipbookHash - the hash of the flipbook
 * @param brandData - the brand data for the flipbook
 * @param password - the password for the flipbook.
 *
 * @description
 * Generates a deep clone of the default json with the necessary changes for a password protected flipbook.
 * Use '' (empty string) for default password and to trigger the password modal.
 * After the user enters a password, and it is invalid, we store it in the default json.
 *
 * @return {FlipbookJsonType}
 */
/* harmony default export */ var getDefaultPasswordProtectedJson = (function (flipbookHash, brandData) {
  var _brandData$colors;
  var password = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  var json = JSON.parse(JSON.stringify(defaultNewJson));
  json.properties.security = getDefaultPasswordProtectedJson_objectSpread(getDefaultPasswordProtectedJson_objectSpread({}, json.properties.security), {}, {
    password: password
  });
  if (brandData !== null && brandData !== void 0 && (_brandData$colors = brandData.colors) !== null && _brandData$colors !== void 0 && _brandData$colors.primary) {
    json.options.content.colors = brandData.colors;
    json.features.CUSTOM_PLAYER_COLORS = true;
  }
  json.options.controls.language = (brandData === null || brandData === void 0 ? void 0 : brandData.language) || 'English';
  json.properties.status = FlipbookStatus.PUBLISHED.toLowerCase();
  json.properties.hash = flipbookHash;
  json.features.WIDGET_PASSWORD = true;
  return json;
});
;// CONCATENATED MODULE: ./src/helpers/getJson.ts


/* harmony default export */ var getJson = (function (variables) {
  var signature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  return new Promise(function (resolve) {
    var contentPrivatePrefix = "".concat(config_0.amazon.s3.cloudfrontPrivate, "/");
    var collectionPath = "".concat(variables.accountId).concat(paths.playerJson);
    var dataJsonWithSignature = "/".concat(variables.hash, "/data.json?").concat(signature);
    var url = contentPrivatePrefix + collectionPath + dataJsonWithSignature;
    fetch(url).then(function (r) {
      return r.json();
    }).then(function (response) {
      return resolve(response);
    });
  });
});
;// CONCATENATED MODULE: ./src/helpers/getLogoUrl.ts

/**
 * Get the logo's URL
 * @param {BrandDataType} brandData
 * @param {string} logoDirectory
 * @param {string} accountId
 * @param {string} hash
 * @param {string} signature
 * @returns {string}
 */
/* harmony default export */ var helpers_getLogoUrl = (function (brandData, logoDirectory, accountId, hash, signature) {
  var _brandData$logo;
  if (brandData !== null && brandData !== void 0 && (_brandData$logo = brandData.logo) !== null && _brandData$logo !== void 0 && _brandData$logo.src) {
    var _brandData$logo2;
    if (brandData.logo.location && accountId && hash) {
      return "".concat(config_0.amazon.s3.cloudfrontPrivate, "/").concat(accountId, "/collections/").concat(hash, "/").concat(logoDirectory, "/") + "".concat(brandData.logo.src, "?").concat(signature);
    }
    return "".concat(config_0.amazon.s3.cloudfront, "/collections/customize/").concat(brandData === null || brandData === void 0 || (_brandData$logo2 = brandData.logo) === null || _brandData$logo2 === void 0 ? void 0 : _brandData$logo2.src);
  }
  return '';
});
;// CONCATENATED MODULE: ./src/helpers/getPostMethodOptions.ts
/**
 * @param password
 * @return {{headers: {'Content-Type': string}, method: string, body: string}}
 */
/* harmony default export */ var getPostMethodOptions = (function (password) {
  return {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      password: password
    })
  };
});
;// CONCATENATED MODULE: ./src/helpers/isBookshelf.ts

/**
 * Verifies if the json is bookshelf json
 * @param {Object} json
 * @returns {boolean}
 */
/* harmony default export */ var isBookshelf = (function (json) {
  var _properties;
  return (json === null || json === void 0 || (_properties = json.properties) === null || _properties === void 0 ? void 0 : _properties.type) === ReaderType.BOOKSHELF;
});
;// CONCATENATED MODULE: ./src/helpers/isFlipbook.ts

/**
 * Verifies if the json is flipbook json
 * @param {Object} json
 * @returns {boolean}
 */
/* harmony default export */ var isFlipbook = (function (json) {
  var _properties;
  return (json === null || json === void 0 || (_properties = json.properties) === null || _properties === void 0 ? void 0 : _properties.type) === ReaderType.FLIPBOOK;
});
;// CONCATENATED MODULE: ./src/helpers/isOnAllowedDomain.ts


/**
 * Verifies if the flipbook is embedded in an allowed domain
 * @param {Array.<string>} allowedDomains
 * @returns {boolean} the boolean that decides if the flipbook is embedded in an allowed domain
 */
/* harmony default export */ var isOnAllowedDomain = (function () {
  var allowedDomains = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  var url = getCurrentUrl();
  if (isOnFlipsnackDomain(url) || isOnFlipsnackCustomDomain(url)) {
    return true;
  }
  if (url && allowedDomains.length) {
    var hostName = new URL(url).hostname;
    return !!allowedDomains.find(function (allowedDomain) {
      return allowedDomain === hostName;
    });
  }
  return false;
});
;// CONCATENATED MODULE: ./src/helpers/isFlipbookAvailable.ts






/**
 * Verifies if the flipbook is available
 * @param {Object} json
 * @returns {boolean} the boolean representing the flipbook's availability
 */
/* harmony default export */ var isFlipbookAvailable = (function (json) {
  var _json$properties, _json$properties2, _json$features, _json$options$restric, _json$options$restric2;
  // Malformed json
  if (!json.options || !json.pages) {
    return false;
  }
  if (config_0 !== null && config_0 !== void 0 && config_0.downloadMode) {
    return true;
  }
  if (((_json$properties = json.properties) === null || _json$properties === void 0 ? void 0 : _json$properties.status) === FlipbookStatus.PUBLISHED.toLowerCase() && isSharedWithUsers(json.properties.visibility)) {
    return false;
  }

  // If fullscreen url, flipbook is available
  if (js_cookie_default().get('isFullscreenUrl')) {
    return true;
  }
  if (((_json$properties2 = json.properties) === null || _json$properties2 === void 0 ? void 0 : _json$properties2.status) !== FlipbookStatus.PUBLISHED.toLowerCase()) {
    return false;
  }
  if ((_json$features = json.features) !== null && _json$features !== void 0 && _json$features.WIDGET_DOMAIN_RESTRICTIONS && (_json$options$restric = json.options.restrictedDomainsSettings) !== null && _json$options$restric !== void 0 && _json$options$restric.useRestrictedDomains && !isOnAllowedDomain((_json$options$restric2 = json.options.restrictedDomainsSettings) === null || _json$options$restric2 === void 0 ? void 0 : _json$options$restric2.restrictedDomains)) {
    return false;
  }
  return true;
});
;// CONCATENATED MODULE: ./src/helpers/isShelfAvailable.ts



/**
 * Verifies if the bookshelf is available
 * @param {Object} json
 * @returns {boolean} the boolean representing the bookshelf's availability
 */
/* harmony default export */ var isShelfAvailable = (function (json) {
  var _json$features, _json$options$restric, _json$options$restric2;
  // If fullscreen url, flipbook is available
  if (js_cookie_default().get('isFullscreenUrl')) {
    return true;
  }
  if (!json.options || !json.collection || !json.collection.length) {
    return false;
  }
  if ((_json$features = json.features) !== null && _json$features !== void 0 && _json$features.WIDGET_DOMAIN_RESTRICTIONS && (_json$options$restric = json.options.restrictedDomainsSettings) !== null && _json$options$restric !== void 0 && _json$options$restric.useRestrictedDomains && !isOnAllowedDomain((_json$options$restric2 = json.options.restrictedDomainsSettings) === null || _json$options$restric2 === void 0 ? void 0 : _json$options$restric2.restrictedDomains)) {
    return false;
  }
  return true;
});
;// CONCATENATED MODULE: ./src/helpers/getAllowedStatisticsEvents.ts


/**
    * Returns a set of allowed statistics events based on the current state of the flipbook
    * It is used for password protected flipbooks, where we want to send impression once the flipbook is loaded
    * and all other events after the password is entered correctly.
    * Flipbooks that are not password protected will return null, and send all statistics events.
    * @param authorizationRequired - boolean, if the flipbook is password protected
    * @param isFlipbookLocked - boolean, if the password was entered correctly
    * @param authorizationData - string, empty string if the password was not yet entered
*/
/* harmony default export */ var getAllowedStatisticsEvents = (function (authorizationRequired, isFlipbookLocked, authorizationData) {
  if (authorizationRequired) {
    if (!authorizationData) {
      // First time render
      return new Set([StatsType.IMPRESSION]);
    }
    if (isFlipbookLocked) {
      // Password was incorrect
      return new Set();
    }

    // Password was correct - we send all events except IMPRESSION, because it was already sent
    return new Set(Object.values(StatsType).filter(function (v) {
      return typeof v === 'number' && v !== StatsType.IMPRESSION;
    }));
  }
  return undefined;
});
;// CONCATENATED MODULE: ./src/Reader.tsx




function Reader_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ Reader_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == typeof_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function Reader_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function Reader_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Reader_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Reader_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }



















var Reader = function Reader(_ref) {
  var _ref$startPage = _ref.startPage,
    startPage = _ref$startPage === void 0 ? 1 : _ref$startPage,
    readerJsonToken = _ref.readerJsonToken,
    trackingData = _ref.trackingData;
  var _useState = (0,react.useState)({
      flipbook: null,
      bookshelf: null
    }),
    _useState2 = slicedToArray_slicedToArray(_useState, 2),
    json = _useState2[0],
    setJson = _useState2[1];
  var flipbook = json.flipbook,
    bookshelf = json.bookshelf;
  var _useState3 = (0,react.useState)(null),
    _useState4 = slicedToArray_slicedToArray(_useState3, 2),
    flipbookJson = _useState4[0],
    setFlipbookJson = _useState4[1];
  var accountId = (0,react.useRef)('');
  var _useState5 = (0,react.useState)(true),
    _useState6 = slicedToArray_slicedToArray(_useState5, 2),
    loadingJsonData = _useState6[0],
    setLoadingJsonData = _useState6[1];
  var _useState7 = (0,react.useState)(true),
    _useState8 = slicedToArray_slicedToArray(_useState7, 2),
    delayFlipbookLoading = _useState8[0],
    setDelayFlipbookLoading = _useState8[1];
  var _useState9 = (0,react.useState)(false),
    _useState10 = slicedToArray_slicedToArray(_useState9, 2),
    needSignature = _useState10[0],
    setNeedSignature = _useState10[1];
  var signatureRef = (0,react.useRef)({});
  var brandDataRef = (0,react.useRef)({});
  var token = decode(readerJsonToken).split(constants_PlayerJsonTokenDelimiter);
  var hash = token[1];
  // regenerationCounter - used to trigger the next getLambdaSignature event
  var _useState11 = (0,react.useState)(0),
    _useState12 = slicedToArray_slicedToArray(_useState11, 2),
    regenerationCounter = _useState12[0],
    setRegenerationCounter = _useState12[1];
  var signatureTokenRef = (0,react.useRef)(readerJsonToken);
  var downloadHTMLJson = typeof window["json_".concat(hash)] === 'function' && window["json_".concat(hash)]();
  var brandData = downloadHTMLJson ? downloadHTMLJson.options : brandDataRef.current;
  var authorizationRequired = (0,react.useRef)(false);
  var authorizationData = (0,react.useRef)('');
  var _useState13 = (0,react.useState)(false),
    _useState14 = slicedToArray_slicedToArray(_useState13, 2),
    isFlipbookLocked = _useState14[0],
    setIsFlipbookLocked = _useState14[1];
  var getLambdaSignature = function getLambdaSignature() {
    return new Promise(function (resolve) {
      var url = "".concat(config_0.signatureFetchUrl, "?hash=").concat(signatureTokenRef.current);
      var requestOptions = authorizationRequired.current && authorizationData.current ? getPostMethodOptions(authorizationData.current) : {};
      resolve(fetch(url, requestOptions).then(/*#__PURE__*/function () {
        var _ref2 = asyncToGenerator_asyncToGenerator(/*#__PURE__*/Reader_regeneratorRuntime().mark(function _callee(response) {
          var brandDataJson;
          return Reader_regeneratorRuntime().wrap(function _callee$(_context) {
            while (1) switch (_context.prev = _context.next) {
              case 0:
                if (!response.ok) {
                  _context.next = 2;
                  break;
                }
                return _context.abrupt("return", response.json());
              case 2:
                if (!(response.status === 401)) {
                  _context.next = 7;
                  break;
                }
                _context.next = 5;
                return response.json();
              case 5:
                brandDataJson = _context.sent;
                return _context.abrupt("return", Reader_objectSpread(Reader_objectSpread({
                  signature: {}
                }, brandDataJson), {}, {
                  authorizationRequired: true
                }));
              case 7:
                throw new Error('Network response was not ok.');
              case 8:
              case "end":
                return _context.stop();
            }
          }, _callee);
        }));
        return function (_x) {
          return _ref2.apply(this, arguments);
        };
      }()).then(function (data) {
        if (data) {
          // Prevents overriding brandData if already loaded
          if (!Object.keys(brandDataRef.current).length) {
            brandDataRef.current = data.brandData;
          }
          signatureRef.current = data.signature;
        }
        if (data.authorizationRequired) {
          authorizationRequired.current = true;
        }
        setRegenerationCounter(function (prevCounter) {
          return prevCounter + 1;
        });
        return data;
      }).catch(function () {
        setRegenerationCounter(function (prevCounter) {
          return prevCounter + 1;
        });
      }));
    });
  };
  (0,react.useEffect)(function () {
    var timeout;
    var interval = config_0.signatureInterval;
    if (!loadingJsonData && !downloadHTMLJson && needSignature) {
      timeout = setTimeout(function () {
        getLambdaSignature().catch(null);
      }, interval);
    }
    return function () {
      if (timeout) {
        clearTimeout(timeout);
      }
    };
  }, [regenerationCounter, loadingJsonData, downloadHTMLJson, needSignature]);
  var initializeReader = function initializeReader(responseJson) {
    setJson(responseJson);
    if (responseJson.bookshelf) {
      setNeedSignature(false);
    } else if (isFlipbook(responseJson.flipbook)) {
      var flip = responseJson.flipbook;
      setNeedSignature(parseFloat("".concat(flip.properties.version.schema, ".").concat(flip.properties.version.revision)) >= flipbookVersion_JsonVersions[3.2]);
    }
  };
  var resolveJsonData = function resolveJsonData(signatureData, flipbookHash) {
    if (signatureData !== null && signatureData !== void 0 && signatureData.signature && signatureData.signature[flipbookHash]) {
      setIsFlipbookLocked(false);
      return getJson({
        accountId: accountId.current,
        hash: flipbookHash
      }, signatureData.signature[flipbookHash]);
    }
    if (signatureData !== null && signatureData !== void 0 && signatureData.authorizationRequired) {
      setIsFlipbookLocked(true);
      return getDefaultPasswordProtectedJson(flipbookHash, signatureData.brandData, authorizationData.current);
    }
    setDelayFlipbookLoading(false);
    return null;
  };

  /**
   * Download HTML5 data initialization.
   * This is a special case when we have the flipbook json from the window object.
   * Password is removed from the security object.
   */
  var initializeDownloadHTMLData = function initializeDownloadHTMLData() {
    initializeReader({
      flipbook: Reader_objectSpread(Reader_objectSpread({}, downloadHTMLJson), {}, {
        properties: Reader_objectSpread(Reader_objectSpread({}, downloadHTMLJson.properties), {}, {
          security: Reader_objectSpread(Reader_objectSpread({}, downloadHTMLJson.properties.security), {}, {
            password: ''
          })
        })
      }),
      bookshelf: null
    });
    setLoadingJsonData(false);
  };
  (0,react.useEffect)(function () {
    var _token = slicedToArray_slicedToArray(token, 1);
    accountId.current = _token[0];
    if (loadingJsonData) {
      // Get player json from window for download HTML5.
      if (downloadHTMLJson) {
        initializeDownloadHTMLData();
      } else {
        getLambdaSignature().then(function (signatureData) {
          return resolveJsonData(signatureData, hash);
        }).then(function (response) {
          return new Promise(function (resolveDataJsonRequest) {
            if (response) {
              initializeReader({
                flipbook: isFlipbook(response) ? response : null,
                bookshelf: isBookshelf(response) ? response : null
              });
            }
            resolveDataJsonRequest(true);
          }).then(function () {
            return setLoadingJsonData(false);
          }).catch(function (error) {
            console.log('Error', error); // Handle any errors
          });
        });
      }
    }
  }, [hash, loadingJsonData]);
  (0,react.useEffect)(function () {
    var _brandData$logo, _brandData$background;
    var timeout;
    var hasBrandingOptions = !!(brandData !== null && brandData !== void 0 && (_brandData$logo = brandData.logo) !== null && _brandData$logo !== void 0 && _brandData$logo.src || brandData !== null && brandData !== void 0 && (_brandData$background = brandData.background) !== null && _brandData$background !== void 0 && _brandData$background.color);

    // If we have a logo or background color, we keep the preloader for an additional 1 second.
    if (hasBrandingOptions) {
      timeout = setTimeout(function () {
        setDelayFlipbookLoading(false);
      }, 1500);
    }

    // We can remove the preloader in case of
    // 1. signatureRef.current[hash] is truthy - we have a valid signature
    // 2. downloadHTMLJson is truthy - resources are already loaded
    // 3. authorizationRequired.current is truthy - we have to ask the user for password
    if (!hasBrandingOptions && (signatureRef.current && signatureRef.current[hash] || downloadHTMLJson || authorizationRequired.current)) {
      setDelayFlipbookLoading(false);
    }
    return function () {
      if (timeout) {
        clearTimeout(timeout);
      }
    };
  }, [brandData, signatureRef.current, downloadHTMLJson]);
  var getFlipbookJson = /*#__PURE__*/function () {
    var _ref3 = asyncToGenerator_asyncToGenerator(/*#__PURE__*/Reader_regeneratorRuntime().mark(function _callee2(flipbookHash) {
      var tokenFromShelfFlipbooks;
      return Reader_regeneratorRuntime().wrap(function _callee2$(_context2) {
        while (1) switch (_context2.prev = _context2.next) {
          case 0:
            tokenFromShelfFlipbooks = createTokenFromBookshelf(accountId.current, [{
              hash: flipbookHash
            }]);
            if (!tokenFromShelfFlipbooks) {
              _context2.next = 4;
              break;
            }
            signatureTokenRef.current = tokenFromShelfFlipbooks;
            return _context2.abrupt("return", getLambdaSignature().then(function (signatureData) {
              return resolveJsonData(signatureData, flipbookHash);
            }).then(function (response) {
              if (response && isFlipbook(response)) {
                setFlipbookJson(response);
                setNeedSignature(parseFloat("".concat(response === null || response === void 0 ? void 0 : response.properties.version.schema, ".").concat(response === null || response === void 0 ? void 0 : response.properties.version.revision)) >= flipbookVersion_JsonVersions[3.2]);
              }
              return true;
            }).catch(null));
          case 4:
            return _context2.abrupt("return", false);
          case 5:
          case "end":
            return _context2.stop();
        }
      }, _callee2);
    }));
    return function getFlipbookJson(_x2) {
      return _ref3.apply(this, arguments);
    };
  }();
  var unlockFlipbook = (0,react.useCallback)(function (password) {
    if (authorizationRequired.current && password) {
      authorizationData.current = password;
      // This will trigger the next getLambdaSignature event - and retrieve the flipbook json
      setLoadingJsonData(true);
    }
  }, []);
  var unlockBookShelfFlipbook = (0,react.useCallback)(function (password, flipbookHash, callbackFn) {
    if (authorizationRequired.current && password) {
      authorizationData.current = password;

      // This will trigger the next getLambdaSignature event - and retrieve the flipbook json
      getFlipbookJson(flipbookHash).then(function () {
        typeof callbackFn === 'function' && callbackFn();
      });
    } else {
      // Nothing to do here, just call the callback
      typeof callbackFn === 'function' && callbackFn();
    }
  }, []);
  var cleanUpOnFlipbookClose = (0,react.useCallback)(function (openedFlipbookHash) {
    authorizationRequired.current = false;
    authorizationData.current = '';
    signatureRef.current[openedFlipbookHash] = '';
    setFlipbookJson(null);
  }, []);

  // Determine whether to show the preloader with extra time or loading JSON data.
  var showPreloader = downloadHTMLJson ? delayFlipbookLoading : delayFlipbookLoading || loadingJsonData;
  if (showPreloader) {
    return /*#__PURE__*/react.createElement(src_BrandedPreloader, {
      logoPath: helpers_getLogoUrl(brandData, 'library/images', accountId.current, hash, signatureRef.current[hash]),
      logoPathFallback: helpers_getLogoUrl(brandData, 'logos', accountId.current, hash, signatureRef.current[hash]),
      background: brandData === null || brandData === void 0 ? void 0 : brandData.background
    });
  }
  var allowedEvents = getAllowedStatisticsEvents(authorizationRequired.current, isFlipbookLocked, authorizationData.current);
  if (json && flipbook && isFlipbookAvailable(flipbook)) {
    document.title = flipbook.properties.title || 'Flipsnack player';
    var currentSignature = signatureRef.current[hash] || '';
    return /*#__PURE__*/react.createElement(components_Player, {
      json: flipbook,
      startPage: startPage,
      signature: currentSignature,
      trackingData: trackingData,
      unlockFlipbook: unlockFlipbook,
      isFlipbookLocked: isFlipbookLocked,
      allowedEvents: allowedEvents
    });
  }
  if (json && bookshelf && isShelfAvailable(bookshelf)) {
    document.title = bookshelf.properties.title || 'Flipsnack player';
    return /*#__PURE__*/react.createElement(components_Bookshelf, {
      bookshelfHash: hash,
      json: bookshelf,
      getFlipbookJson: getFlipbookJson,
      flipbookJson: flipbookJson,
      accountId: accountId.current,
      signature: signatureRef.current,
      unlockBookShelfFlipbook: unlockBookShelfFlipbook,
      cleanUpOnFlipbookClose: cleanUpOnFlipbookClose,
      isFlipbookLocked: isFlipbookLocked,
      allowedEvents: allowedEvents
    });
  }
  return /*#__PURE__*/react.createElement(components_ErrorMessage, {
    message: "This publication is unavailable."
  });
};
/* harmony default export */ var src_Reader = (Reader);
// EXTERNAL MODULE: ./node_modules/query-string/index.js
var query_string = __webpack_require__(6663);
;// CONCATENATED MODULE: ./src/helpers/getLastPageVisited.ts
/* harmony default export */ var getLastPageVisited = (function (readerJsonToken) {
  try {
    if (sessionStorage && sessionStorage.getItem("".concat(readerJsonToken, "page"))) {
      return Number(sessionStorage.getItem("".concat(readerJsonToken, "page")));
    }
  } catch (error) {
    // Prevent crashing reader if web storage is disabled for browser
  }
  return 1;
});
;// CONCATENATED MODULE: ./src/helpers/parseUrlParams.ts



/**
 * Parse url params
 * @return {{startPage: number, readerJsonToken: string, trackingData: string}}
 */
/* harmony default export */ var parseUrlParams = (function () {
  var urlParams = (0,query_string.parse)(window.location.search);
  var readerJsonToken = urlParams.hash ? urlParams.hash.toString() : '';
  var startPage = Number(urlParams.p) || getLastPageVisited(readerJsonToken);
  var trackingData = urlParams.td ? urlParams.td.toString() : '';
  return {
    startPage: startPage,
    readerJsonToken: readerJsonToken,
    trackingData: trackingData
  };
});
;// CONCATENATED MODULE: ./src/service-worker.ts
// @ts-nocheck

// This optional code is used to register a service worker.
// register() is not called by default.

// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.

// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA

var isLocalhost = Boolean(window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4.
window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));
function registerValidSW(swUrl, config) {
  navigator.serviceWorker.register(swUrl).then(function (reg) {
    var registration = reg;
    registration.onupdatefound = function () {
      var installingWorker = registration.installing;
      if (installingWorker == null) {
        return;
      }
      installingWorker.onstatechange = function () {
        if (installingWorker.state === 'installed') {
          if (navigator.serviceWorker.controller) {
            // At this point, the updated precached content has been fetched,
            // but the previous service worker will still serve the older
            // content until all client tabs are closed.
            console.log('New content is available and will be used when all ' + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.');

            // Execute callback
            if (config && config.onUpdate) {
              config.onUpdate(registration);
            }
          } else {
            // At this point, everything has been precached.
            // It's the perfect time to display a
            // "Content is cached for offline use." message.
            console.log('Content is cached for offline use.');

            // Execute callback
            if (config && config.onSuccess) {
              config.onSuccess(registration);
            }
          }
        }
      };
    };
  }).catch(function (error) {
    console.error('Error during service worker registration:', error);
  });
}
function checkValidServiceWorker(swUrl, config) {
  // Check if the service worker can be found. If it can't reload the page.
  fetch(swUrl, {
    headers: {
      'Service-Worker': 'script'
    }
  }).then(function (response) {
    // Ensure service worker exists, and that we really are getting a JS file.
    var contentType = response.headers.get('content-type');
    if (response.status === 404 || contentType != null && contentType.indexOf('javascript') === -1) {
      // No service worker found. Probably a different app. Reload the page.
      navigator.serviceWorker.ready.then(function (registration) {
        registration.unregister().then(function () {
          window.location.reload();
        });
      });
    } else {
      // Service worker found. Proceed as normal.
      registerValidSW(swUrl, config);
    }
  }).catch(function () {
    console.log('No internet connection found. App is running in offline mode.');
  });
}
function register(config) {
  if ( true && 'serviceWorker' in navigator) {
    // The URL constructor is available in all browsers that support SW.
    var publicUrl = new URL(({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).PUBLIC_URL, window.location.href);
    if (publicUrl.origin !== window.location.origin) {
      // Our service worker won't work if PUBLIC_URL is on a different origin
      // from what our page is served on. This might happen if a CDN is used to
      // serve assets; see https://github.com/facebook/create-react-app/issues/2374
      return;
    }
    window.addEventListener('load', function () {
      var swUrl = "".concat(({"NODE_ENV":"production","CONFIG":{"amazon":{"s3":{"cdn":"https://cdn.flipsnack.com","content":"https://content.flipsnack.com","static":"https://static.flipsnack.com","cloudfront":"https://d1dhn91mufybwl.cloudfront.net","cloudfrontContent":"https://d160aj0mj3npgx.cloudfront.net","cloudfrontStatic":"https://d1fpu6k62r548q.cloudfront.net","cloudfrontPrivate":"https://d3u72tnj701eui.cloudfront.net"}},"googleAnalytics":{"enableGATracking":true},"statisticsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-sts","leadFormEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-widget-queue","siteBase":"https://www.flipsnack.com","appUrl":"https://app.flipsnack.com","enableWatermark":false,"enableCollectStats":true,"downloadMode":false,"exportName":"","recaptchaListKey":"6LceL0ghAAAAAIsQS9otnJ5paOB-2Qv85CF_18D0","orderEmailEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-order-email","signatureFetchUrl":"https://content-private.flipsnack.com/authorization","signatureInterval":50000,"interactivityElementsEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-interactivity-stats","trackOrdersEndpoint":"https://sqs.us-east-1.amazonaws.com/756737886395/flip-track-orders","interactivityResultsEndpoint":"https://interactivity-results.flipsnack.com/v1/quiz","env":"production"},"BUILD_TARGET":"web"}).PUBLIC_URL, "/service-worker.js");
      if (isLocalhost) {
        // This is running on localhost. Let's check if a service worker still exists or not.
        checkValidServiceWorker(swUrl, config);

        // Add some additional logging to localhost, pointing developers to the
        // service worker/PWA documentation.
        navigator.serviceWorker.ready.then(function () {
          console.log('This web app is being served cache-first by a service ' + 'worker. To learn more, visit https://bit.ly/CRA-PWA');
        });
      } else {
        // Is not localhost. Just register service worker
        registerValidSW(swUrl, config);
      }
    });
  }
}
function unregister() {
  if ('serviceWorker' in navigator) {
    navigator.serviceWorker.ready.then(function (registration) {
      registration.unregister();
    }).catch(function (error) {
      console.error(error.message);
    });
  }
}
;// CONCATENATED MODULE: ./src/index.tsx





var _parseUrlParams = parseUrlParams(),
  readerJsonToken = _parseUrlParams.readerJsonToken,
  startPage = _parseUrlParams.startPage,
  trackingData = _parseUrlParams.trackingData;
var root = (0,client/* createRoot */.H)(document.getElementById('root'));
root.render(/*#__PURE__*/react.createElement(src_Reader, {
  readerJsonToken: readerJsonToken,
  startPage: startPage,
  trackingData: trackingData
}));

// If you want your app to work offline and load faster, you can change unregister() to register() below
// Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
unregister();
}();
/******/ })()
;